MNLP - Exam Questions
All 55 exam-style questions for Multilingual Natural Language Processing, one set per note. Each answer opens with the key points a grader looks for, then a full model answer. Write or say your answer before revealing. The short drilling cards are on the flashcards page.
Back to the Multilingual Natural Language Processing home.
L01 Overview
Exam questions
Distinguish multilingual from crosslingual NLP, give examples of each, and say what the English-centric training of LLMs means for both.
Key points: multilingual means one system for many languages without being language-specific; crosslingual means information or knowledge crossing between languages; multilingual examples: NER, parsing, classification across languages; crosslingual examples: MT, crosslingual QA, crosslingual unlearning, crosslingual reasoning; LLMs are trained mostly on English web text and fragile elsewhere.
- Multilingual: one system that works for multiple languages, without being language-specific. Examples: NER for multiple languages (can it be trained without being language-specific?), language-independent parsing (are there universal features?), sentence or document classification across languages (again, trained without being language-specific).
- Crosslingual: information or knowledge crosses from one language to another. Examples: machine translation (make information understandable across languages), crosslingual QA (extract information from resources in other languages), crosslingual unlearning (manipulate information across languages), crosslingual reasoning (combine information across languages).
- LLMs: trained predominantly on Internet resources, about half of which are English, so most state-of-the-art models are English-centric. General multilingual models such as Llama 3.1 and DeepSeek do better on high-resource languages; dedicated multilingual models such as Aya-Expanse tend to lag behind (behind what is not stated; read as behind the general models). Translation can still go badly wrong: asked to translate a sentence in Amharic (identified from its script and grammar; the course does not name the language), one of four models produced a fluent translation of a different event.
Losing marks: treating the two terms as synonyms, or calling classification across languages crosslingual because of the word “across”.
Contrast pre-deep-learning NLP with deep-learning NLP. What did neural networks gain, what did they cost, and why do insights now transfer between fields?
Key points: before: one approach per application, ML weighing hand-built features; gains: state of the art, little or no feature engineering, few network types; costs: data hunger, hard-to-trace errors, spectacular failures; transfer through uniform network types and few application-specific features.
- Before: each application required a different approach. Classical ML (SVMs, decision trees, generative Bayesian models, discriminative maximum-entropy models) weighed the importance of hand-built features: word classes (POS tags, morphology), syntactic features (parse trees), semantic features (named entities, taxonomies, argument roles).
- Advantages of deep learning: state-of-the-art performance for all NLP applications; very little or no feature engineering; a limited repertoire of network types covers most or all tasks.
- Disadvantages: needs large amounts of training data; errors are hard to trace; can get it spectacularly wrong.
- Transfer: the same success appears in computer vision, handwriting recognition, speech recognition, robotics and IR. Because network types are uniform and application-specific features are few, insights carry over between these areas.
Link to originalWhat roles do large language models now play in NLP, and what are their limits? Use the four-model translation comparison as evidence.
Key points: LLMs originated in and now dominate NLP; end-to-end QA, summarization, MT; substitute or supplement humans in annotation, LLM-as-judge evaluation, dialog; English-centric training data; Mistral Small 3.2 produced a fluent translation of a different event.
- LLMs originated within NLP and now dominate research.
- Uses: traditional NLP tasks end to end (QA, summarization, MT); substituting or supplementing humans in data annotation, evaluation (LLM as a judge) and dialog.
- Limit: trained mostly on English Internet text, so weaker on other languages, especially low-resource ones.
- Evidence: asked to translate a sentence in Amharic (identified from its script and grammar; the course does not name the language), GPT-5.6 Terra, Gemini 3.6 Flash and Claude Sonnet 4.6 all render it as the embassy in South Sudan calling for an investigation into an attack that killed Ethiopian peacekeepers, differing only in wording. Mistral Small 3.2 produced “The Ethiopian embassy in Khartoum, where the Ethiopian peacekeepers were detained, is closed”: fluent, and about a different event.
L02 Multilinguality and Writing Systems
Exam questions
State the four English-first assumptions built into standard NLP pipelines. For each, give languages where it fails and what goes wrong concretely.
Key points: whitespace word boundaries fail for Chinese, Japanese, Thai; word-order grammar fails for case-marking Russian, Finnish, Korean; one word one meaning fails for agglutinative and compounding languages; left-to-right fails for Arabic, Hebrew, Urdu, Persian.
- Words are separated by whitespace. Fails for Chinese, Japanese, Thai, Lao, Khmer, Burmese: there is no word delimiter, so whitespace tokenization returns one token for a whole Chinese sentence. Thai uses spaces to end clauses or sentences and has no dedicated full stop, so a space does not mark a word boundary.
- Grammatical relations are encoded by word order. Fails for languages with rich morphology, especially case marking (Russian, Finnish, Korean): who did what to whom is marked on the noun, word order is more flexible, and position says much less about a word’s role.
- One word = one unit of meaning. Fails for agglutinative languages (Finnish, Turkish, Hungarian) and compounding languages (German, Dutch, Swedish): Bundesverfassungsgericht is one token holding federal + constitutional + court.
- Text flows left to right. Fails for Semitic languages and languages in Arabic script (Arabic, Hebrew, Urdu, Persian): the text is stored left to right but rendered right to left, so the first character in the string is the rightmost on screen.
Argue that "script is not language" holds in both directions, and explain what each direction breaks in an NLP pipeline.
Key points: one script serves many languages (Latin, Arabic); script detection does not identify the language; one language uses several scripts (Serbian, Uzbek); language does not fix the script, so train and test data can share almost no letters.
- One script, many languages: Latin (English, German, French, most European languages, several African, Turkic and Asian languages), Arabic (Arabic, Persian, Urdu, Pashto, Sorani), Cyrillic (Russian, Belarusian, Serbian), Devanagari (Hindi, Marathi, Nepali), Ethiopic (Amharic, Tigrinya). So detecting the script does not identify the language: Latin narrows almost nothing, and Arabic script still leaves five candidates.
- One language, many scripts: Serbian (Cyrillic and Latin), Kurdish (Latin and Arabic), Uzbek (Latin and Cyrillic), Punjabi (Gurmukhi and Arabic). So knowing the language does not tell you the script: a Serbian corpus can mix both, even in one document, and a model trained on one script and tested on the other shares almost no letters with the test data, though the language is the same.
- Some scripts are language-specific (Armenian, Georgian, Greek, Sinhala, Khmer).
- Also: one sentence can mix several writing systems (Japanese uses Katakana, Kanji and Hiragana together), so a single “script of this text” label can fail.
Why is the English-centric bias of NLP structural, and why do claims of "language independence" deserve suspicion?
Key points: resources exist mostly in English; non-English data are by-products or translations of English resources; coverage follows commercial and military interest, not speaker numbers; pipelines encode English properties; language independence is rarely tested.
- Most resources are in English: annotated data, unannotated data, toolkit coverage (dictionaries, analyzers), benchmarks. Most publications also focus on English.
- Non-English resources arise mostly as by-products (translations, product reviews) or as translations of English annotated resources (so the annotation scheme stays English-shaped), less so as dedicated efforts.
- Coverage tracks commercial interest and military relevance, not speaker numbers. Over 7,000 languages exist. The high-resource tier is English and Mandarin, then, after a big gap, French, Spanish, Arabic and Russian. German, Italian, Dutch, Korean and Japanese are medium resource. The rest are low resource, which on these tiers includes most languages with over ten million speakers.
- Standard pipelines encode properties of English (whitespace tokenization, fixed word order, closed vocabularies) as if they were properties of language.
- “Language independent” claims are usually untested outside English or a very small set of languages.
- The bias is understandable, since resource creation costs time and money.
Compare alphabetic, syllabic and logographic writing systems and explain what each, plus the Devanagari, Arabic and Hangul cases, implies for NLP.
Key points: alphabetic: sounds, small inventory; syllabic: whole syllables; logographic: words or morphemes, thousands of symbols; Devanagari alphasyllabic (consonant + inherent vowel); Arabic writes the consonant root and omits vowels, so the model must disambiguate; Hangul letter shapes encode articulation.
- Alphabetic: each symbol is a consonant or vowel sound, small inventory (Latin, Cyrillic, Hangul).
- Syllabic: each symbol is a whole syllable (Hiragana, Katakana).
- Logographic: each symbol is a word or morpheme directly, little sound information (Chinese Hanzi, Japanese Kanji).
- Inventory size sets the cost of a character: tens of symbols for an alphabet, thousands for a logographic script, which a character-level vocabulary must budget for.
- Devanagari is alphasyllabic: a consonant letter carries an inherent vowel.
- Arabic writes the consonant root and omits vowels, so one written form can stand for several words (كتب can be read kataba, kutiba or kutub, examples from outside the course material). The writing is lossier than the language and the model must resolve the ambiguity from context. No tokenizer can recover vowels that were never written.
- Hangul is alphabetic, and its letter shapes encode articulatory features.
Explain the difference between a grapheme, a codepoint and a byte, and show how confusing them corrupts tokenization, deduplication and span annotation.
Key points: grapheme is the perceived character; one or more codepoints per grapheme; 1 to 4 UTF-8 bytes per codepoint; NFC/NFD mismatch silently breaks dedup and search; mixed breaking conventions misalign spans.
- Grapheme: what the reader sees as one character. Codepoint: Unicode’s abstract number, one or more per grapheme. Byte: UTF-8 stores each codepoint in 1 to 4 bytes.
- Example: NFD é is 1 grapheme, 2 codepoints (U+0065 U+0301), 3 bytes (65 CC 81).
- Tokenization: byte-level tokenizers see the byte stream. Byte-level splits can produce non-existent characters; codepoint splits can strand a diacritic from its base letter.
- Deduplication, search, equality, prefix matching assume identical codepoint sequences, so NFC and NFD copies of the same text silently fail to match.
- Span annotation (SQuAD-style QA): offsets recorded under one breaking convention and read under another give shifted answers. Counts across corpora with different conventions are not comparable.
- Fix: normalize consistently in the pipeline, and keep breaking and length computation consistent across documents.
Crawled multilingual data mixes normalization forms. Which Unicode normalization form would you use for search indexing and for comparing rendered text, and is NFKD suitable for generation targets? Why?
Key points: canonical lossless, compatibility lossy; NFD for comparing rendered text; NFKD for search indexing and analysis; NFKD not necessarily for generation; normalize consistently.
- The four forms form a grid: canonical (lossless) NFC and NFD; compatibility (lossy) NFKC and NFKD; composed (C) against decomposed (D).
- Comparing rendered text: NFD, which splits into base characters plus combining marks and preserves semantic and visual equivalence. It is non-lossy, so you can decompose and recompose. (Outside the course material: NFC also gives a valid equality check, but the expected answer is NFD.)
- Search indexing or NLP analysis: NFKD. Its lossiness helps: the ligature fi and the pair fi become the same, ① becomes 1.
- Generation: NFKD is not necessarily suitable. A model trained on NFKD targets never sees, so cannot produce, the folded-away characters (for example the long s ſ becomes plain s).
- Whatever you choose, apply it consistently in the pipeline (for example canonical decomposition then composition, which ends in NFC), otherwise dedup, search and equality checks are silently inaccurate.
Losing marks: getting the analysis against generation rule backwards, or claiming NFKD is reversible.
Explain byte inflation for byte-level tokenizers and compute it for "hello", "café" and "中文". What are its consequences?
Key points: UTF-8 bytes over perceived characters; 1.0x, 1.25x (café in NFC), 3.0x; more bytes means more aggressive splitting; byte splits can produce non-existent characters.
- , characters meaning what a reader perceives.
- “hello”: 5 bytes / 5 = 1.0x. “café” (NFC, é is 2 bytes): 5 / 4 = 1.25x. “中文” (3 bytes each): 6 / 2 = 3.0x.
- More bytes per character means text tends to be split more aggressively, into more pieces per character; byte splits can also produce fragments that are not characters at all.
- Outside the course material: in practice CJK text often costs more tokens for the same content, depending on the tokenizer’s training data.
Link to originalEncode U+4E2D (中) in UTF-8 by hand, stating which byte rules you use.
Key points: 15 bits exceed 11, so 3-byte form; 1110xxxx 10xxxxxx 10xxxxxx; result E4 B8 AD; lead and continuation byte rules.
- 0x4E2D =
100111000101101: 15 bits, more than the 11 payload bits of the 2-byte form, so use the 3-byte form1110xxxx 10xxxxxx 10xxxxxxwith payload bits.- Pad to 16 bits and split 4 + 6 + 6:
0100 | 111000 | 101101.- Bytes:
11100100 10111000 10101101(hex E4 B8 AD).- Rules: a byte starting
0is a single byte (ASCII); a byte starting11begins a multi-byte sequence, with the number of leading 1s giving the length of the whole sequence (here 3); a byte starting10is a continuation byte.- Because no byte is ambiguous about its role, a reader can find the next character start from any offset by skipping
10xxxxxxbytes.
L03 Morphology and Word Formation
Exam questions
Name the four morphological types, give example languages for each, and illustrate each with one analysed word or sentence. What distinguishes agglutinative from fusional?
Key points: isolating: no inflection, word order and particles (Chinese, Vietnamese); agglutinative: one morpheme, one meaning (Turkish ev-ler-iniz-den); fusional: one affix, several fused features (Russian knig-ami); polysynthetic: a sentence in one word (Inuktitut); agglutinative and fusional are defined by separability; agglutinative words tend to have more morphemes as a consequence.
- Isolating (Chinese, Vietnamese): words do not change form; grammar comes from word order and particles. Chinese 我 昨天 看 了 一 本 书 “I read a book yesterday”: 看 never changes, past comes from the particle 了 (PFV) and 昨天 “yesterday”.
- Agglutinative (Turkish, Finnish): morphemes strung together, one morpheme, one meaning, visible boundaries. Turkish ev-ler-iniz-den = house + plural + your + from, “from your houses”.
- Fusional (Russian, Spanish, Arabic): one affix encodes several features that cannot be separated. Russian knig-ami “with books”: -ami fuses, in the course’s gloss, case (instrumental), number (plural) and gender (feminine). Spanish habl-é: person, number, tense, aspect in one vowel.
- Polysynthetic (Inuktitut, Mohawk): verb, subject, object (or destination) and modifiers (negation, tense, mood, instrument, location) packed into one word. Qangatasuukkuvimmuuriaqalaaqtunga “I will have to go to the airport”.
- The axis (outside the course material): isolating and polysynthetic are the two ends of a scale of how much meaning one word carries; agglutinative and fusional differ on a separate question, whether the packed meaning can be cut apart.
The usual mistake: defining agglutinative as “more morphemes”. The definition is separable morphemes, one feature each; that agglutinative words end up with more morphemes per word than fusional ones is a consequence.
Why do fixed word-level vocabularies break for morphologically rich languages and for multilingual models, and what is the practical fix?
Key points: fixed-size matrices and softmax make drive memory; inflection multiplies forms and productivity keeps the vocabulary open; either explodes or OOV soars with every rare form as
<unk>; a shared multilingual vocabulary fragments rich languages; fix: subword tokenization, with very low (not zero) OOV.
- Neural weight matrices are fixed size; the output layer is a matrix ( the embedding dimension) plus a softmax over at every position, so drives memory.
- A realistic Russian vocabulary is about five times the English one, because Russian inflects far more (case on every noun, among much else), so each lemma has many more surface forms.
- Inflectional features multiply: forms per lemma = product of slot sizes. Productivity (doomscrolling, doomscrolled, doomscrolls, doomscroller) means no vocabulary can be closed, so OOV never goes away.
- Two horns: keep all forms and explodes (embedding matrix and softmax with it); or use a vocabulary sized for English and get massive OOV rates, with every rare form mapped to
<unk>and given equal probability.- Word indices hide relations (move 2863 vs moved 87542) and give nothing for unseen words (hammered). Morphology could build meaning for unseen words; context alone cannot.
- Multilingual: a word vocabulary shared across languages spreads its fixed budget thinner, and the rich languages suffer most; even with subwords they get split into many more pieces per word than English.
- Fix: morphological analysers are language dependent and need per-language expertise, so the practical compromise is subword tokenization: statistically useful pieces, language-agnostic, learned from data. Falling back to characters makes OOV very rare but not zero: an unseen character is still unknown (only byte-level vocabularies remove that).
Run Forward and Backward Maximum Matching on 研究生活 with vocabulary {研究, 研究生, 生活, 生, 活}. Why do the results differ, how does bidirectional matching resolve it, and what are the method's limits?
Key points: FMM gives 研究生 | 活; BMM gives 研究 | 生活; genuine ambiguity leaks through the greedy scan direction; bidirectional: accept if they agree, else prefer fewer words or fewer single-character words; limits: fixed vocabulary, OOV silently split, no learning from data.
- FMM: at , 研究生活 is not in , 研究生 is (3 chars), emit it. At , 活 is in . Result 研究生 | 活.
- BMM: at , the longest suffix in is 生活 (2 chars), prepend it. At , 研究 is in . Result 研究 | 生活.
- Why: same string, same dictionary, only the scan direction changed. The string is ambiguous and each greedy rule commits to one reading. Neither algorithm is buggy.
- Bidirectional: if FMM and BMM agree, accept with high confidence. If not, apply a tie-breaking heuristic; two common choices are fewer total words, or fewer single-character words. Here the fewer-words rule cannot decide (2 words each); the fewer-single-characters rule picks BMM (0 against FMM’s 1, 活).
- Limits: needs a precompiled per-language vocabulary; new words (names, neologisms, typos) can never be matched; cannot improve from data; OOV words are silently chopped into single characters; real ambiguity in the language cannot be fixed by any direction heuristic.
Reformulate Chinese word segmentation as sequence labelling and explain how an HMM with Viterbi solves it. Give the recursion, the complexity, and what the approach still cannot do.
Key points: BMES tags with a boundary after every E and S; hidden tags emit characters, transitions and emissions estimated by MLE; Viterbi recursion with backpointers; against ; first-order, no long-range context (CRFs), unsupervised training worse.
- BMES tags: B (first char of multi-char word), M (interior of 3+ char word), E (last char of multi-char word), S (single-char word). Boundary after every E and S.
- HMM: hidden tag sequence generates the observed characters. Transitions ; emissions , the character given the tag. B can only be followed by M or E; E and S only by B or S. Decode .
- Training: MLE counts from a segmented corpus: , .
- Viterbi: , with a backpointer to the winning ; backtrace from the best final cell whose tag is E or S.
- Complexity: , i.e. for 4 tags, against brute-force tag sequences.
- Gains over maximum matching: no fixed dictionary, ambiguity resolved by probabilistic evidence, trainable from any segmented corpus.
- Still cannot: first-order Markov assumption, each tag generated from the previous tag alone (higher orders are more involved); no longer-range context (motivates CRFs, and beyond them neural labellers such as LSTMs and Transformers); unsupervised Baum-Welch (EM) training degrades quality.
Distinguish inflection, derivation and compounding with examples, and explain why productivity of these processes matters for NLP.
Key points: inflection keeps POS, changes features (see, saw); derivation changes POS and/or meaning (happy, happiness; perfect, imperfect); compounding joins words (Tischbein); productivity means no vocabulary can be closed, so OOV never goes away.
- Inflection: keeps the part of speech, changes grammatical features (tense, number). see, saw, seen; book, books. Another form of the same dictionary entry.
- Derivation: changes POS and/or meaning, giving a new dictionary entry. happy → happiness (noun), happy → happily (adverb); perfect → imperfect (meaning only).
- Test: is the result a new word with its own dictionary entry? A changed part of speech means derivation (happy / happiness), but derivation can also keep it (perfect / imperfect), so a kept part of speech alone does not prove inflection.
- Compounding: several words into one, not only nouns. German Tisch + Bein = Tischbein “table leg” (noun + noun); sicher + gehen = sichergehen “make sure” (adjective + verb). German writes it as one token where English uses two.
- Productivity: the processes apply iteratively and to new combinations. doomscroll is a new compound already carrying inflection (-ing, -ed, -s) and derivation (-er). No fixed vocabulary can be closed over a productive process, which is why OOV never disappears.
What is non-concatenative morphology, and why can no string-cutting segmenter (from maximum matching to subword tokenization) fully handle it? Use German and Arabic, and say how the Inuktitut problem differs.
Key points: change inside the root (apophony, Buch/Bücher); circumfix ge-…-en is one morpheme in two pieces; Arabic interleaves root and pattern and leaves the vowels unwritten; Inuktitut morphemes stay in sequence but change shape where they meet (a different problem); segmenters cut contiguous pieces, so they fully handle only the concatenative case.
- Concatenative: word = concatenation of morphemes; string splitting can recover them.
- Non-concatenative: the change happens inside the root. Apophony: German Buch → Bücher, Haus → Häuser (vowel change plus suffix). No cut separates “book” from “plural” in Bücher.
- Circumfix (related problem): German ge-seh-en: ge- and -en are one morpheme in two pieces, so neither stripping the prefix nor the suffix alone works.
- Arabic: consonantal root k-t-b “write” poured into a pattern ya- C1 C2 -u- C3 -u = yaktubu “he writes”. Root and pattern are interleaved, and the pattern’s vowels are not written in regular Arabic, so part of the information is absent from the string.
- Inuktitut (a different problem, classed outside the course material): the morphemes are still in sequence, so this is concatenative, but they change shape where they meet (-k-mut-uq surfaces as -mmuu-). The boundaries are blurred, so cutting the string cannot recover them either. Agglutinative languages show the same kind of join change.
- Every segmentation method cuts a string into contiguous pieces, so subword segmentation can only fully capture the concatenative case.
Link to originalWord segmentation and subword segmentation are often confused. Define each, give a language where each is needed, and say how they are solved.
Key points: word segmentation finds boundaries in unmarked scripts (Chinese, Thai); solved by maximum matching or BMES labelling (HMM, CRF, neural); subword segmentation splits delimited words in rich languages (Finnish); solved by statistical subword tokenization learned from data; same cutting problem, different target units.
- Word segmentation (tokenization): establishing word boundaries in scripts that do not mark them (Chinese, Japanese, Thai, Burmese). Must happen before POS tagging, parsing or anything else. Solved by maximum matching (FMM, BMM, bidirectional) or statistical BMES labelling (HMM plus Viterbi, CRFs, neural taggers). Benchmarked in the SIGHAN bake-offs.
- Subword segmentation: splitting words that are already well delimited into units smaller than the word, because morphologically rich languages (Finnish) blow up fixed vocabularies. Solved by statistical, language-independent subword tokenization (next lecture).
- Both decide where to cut a character string; they differ in what the pieces are meant to be: whole words against units smaller than words.
L04 Subword Segmentation
Exam questions
Compare BPE and Unigram LM as subword segmentation methods: mechanism, segmentation quality and downstream effect.
Key points: BPE bottom-up, greedy, one segmentation per word; Unigram LM top-down likelihood pruning, global best, n-best and sampling; Unigram LM closer to gold segmentations, far more so in English; downstream gains small in English (a few tenths on some tasks), large on Japanese TyDi QA; SentencePiece is the toolkit that implements both.
- Mechanism. BPE (Sennrich et al., 2016) is bottom-up: start from characters and greedily merge the most frequent adjacent pair until the merge budget is spent. A merge is never undone, and each word has exactly one segmentation. Unigram LM (Kudo, 2018) is top-down: start from every substring occurring more than once, fit a unigram LM by EM, and prune tokens until the target size is reached (as given in MNLP, those with the highest loss ; Kudo’s paper actually removes the smallest). It scores whole segmentations, , takes the global best by dynamic programming, and can return n-best or sampled segmentations.
- Segmentation quality (Bostrom and Durrett, 2020, same data and same vocabulary size): Unigram LM has higher precision, recall and F1 than BPE against CELEX2 (English morphology) and MeCab (Japanese word segmentation), with a far larger gap in English. Unigram LM recovers suffixes (
ed,s); BPE over-produces word-initial single capitals and frequency artefacts such asn|an|ote|chn|ology.- Vocabulary use: Unigram LM produces longer segments on average (English and Japanese) and, in English, uses its vocabulary more effectively, with more tokens of moderate frequency; BPE spends the bottom of its vocabulary on near-unused tokens.
- Downstream (identical pretraining and model, only the tokenizer differs): on English, Unigram LM is ahead by a bit over a point (under 1.5) on SQuAD and MNLI matched and by only a few tenths on MNLI mismatched and CoNLL NER; on Japanese TyDi QA it is ahead by more than ten points. The larger gold-standard gap (English) does not predict the larger downstream gap (Japanese).
Losing marks: calling SentencePiece the algorithm (it is the toolkit that implements both); reading the low absolute English recall as “tokenizers fail at English” when the point is the comparison between the methods.
Why does neural machine translation need subword segmentation? Argue from the weaknesses of word-level, character-level and rule-based (FST) alternatives.
Key points: vocabulary bottleneck, representation depends on frequency and contexts; word-level: huge vocabularies, no sharing, unseen words become
<UNK>; character-level: meaningless units, long sequences; FSTs: laborious, language dependent, no preference among ambiguities; subwords: 30K to 128K, near-zero OOV, learned from frequencies.
- The vocabulary is one of the main bottlenecks of training an NMT system. How well a word is represented depends on its frequency and on the number of different contexts it occurs in, both properties of the training corpus.
- Many word occurrences come from word formation: inflection (
tall,taller,tallest) and compounding (Donaudampfschifffahrtsgesellschaft). A word-level vocabulary treatstallandtallestas unrelated entries.- Word-level: 300K to 500K entries and still OOVs, huge embedding and output matrices, every unseen word collapses to
<UNK>(an unseen “Kyrgyzstan” becomes an unspecified place).- Character-level: near-zero OOV, but each symbol carries almost no meaning and sequences are long and slow.
- Hand-built FSTs: accurate and efficient, but extremely laborious, totally language dependent, and with no preference among ambiguous analyses, so they do not scale to many languages.
- Subwords (typically 30K to 128K merges): learned from frequencies with no annotation, vocabulary size tunable, near-zero OOV, moderate sequence length. The price is that pieces are not clean morphemes.
Train BPE on the corpus
the tall man is taller than the tallest manfor 10 merges, breaking ties by first occurrence. Give the merges and comment on the result.Key points: six-way tie at 3,
t+hmet first;thandoes not count towardst+a; merge order ending intall+e; finaltalle randtalle s t; the greedy merge destroystall|erand is never undone.
- Word types:
the2,tall1,man2,is1,taller1,than1,tallest1. Split each into characters and append</w>.- Initial counts: six pairs tie at 3:
t+h(2 fromthe, 1 fromthan),t+a,a+l,l+l,a+n,n+</w>.t+his met first, so it wins.- Merges in order:
t+h(3),t+a(3),ta+l(3),tal+l(3),a+n(3),an+</w>(3),th+e(2),the+</w>(2),m+an</w>(2),tall+e(2).- Final corpus:
the</w>,tall </w>,man</w>,i s </w>,talle r </w>,th an</w>,the</w>,talle s t </w>,man</w>.- Comment: the frequent words
theandmanbecame single tokens, as desired. Buttallerandtallestended astalle + randtalle + s + twhere the morphological split istall + erandtall + est. Thetall + emerge was locally the most frequent move and destroyed the morpheme boundary, and BPE never undoes a merge.Losing marks: counting
thantowardst+a(inthanthetis followed byh).On the corpus
the tall man is taller than the tallest man, which pair does WordPiece merge first, and how does that differ from BPE? Show the computation.Key points: WordPiece score count(ab) / (count(a) count(b)); symbol counts
t7,h3,i1,s2,e4,r1;t+hscores 3/21,i+sscores 1/2; WordPiece mergesi+s, BPE mergest+h; WordPiece prefers pairs whose parts rarely occur apart.
- BPE merges the pair with the highest raw count. Six pairs tie at 3, and
t+his met first.- WordPiece merges the pair with the highest . Symbol counts:
t7,a6,l6,e4,h3,n3,m2,s2,i1,r1,</w>9.- Scores:
t+h;a+n;l+l;e+r;i+s. WordPiece mergesi+s, thene+r(0.25 after the recount, tied withe+sand met first).- Comment:
i+soccurs once, butioccurs nowhere else, so the pair is maximally “surprising”.tandhare each common, sothscores low despite its count. WordPiece therefore reaches the suffixerbefore buildingtall; both methods remain greedy, bottom-up and deterministic.(WordPiece is only named in MNLP; the score is how common implementations compute its likelihood criterion.)
Segment
catsby bottom-up DP with p(c)=.02, p(a)=.04, p(t)=.03, p(s)=.05, p(ca)=.002, p(at)=.0015, p(ts)=.0004, p(cat)=.003, p(ats)=.00005, p(cats)=.0001.Key points: each cell initialised with the unsplit probability;
tsandatssplit,catstays whole; givescat | s, ; a rare whole word loses to common pieces; valid because segments are independent.
- Length 1: is the character probability: 0.02, 0.04, 0.03, 0.05.
- Length 2:
castays whole, 0.002 (split gives 0.0008);atstays whole, 0.0015 (split 0.0012);tssplits, , so .- Length 3:
catstays whole, 0.003 (splits give 0.00003 and 0.00006);atsis best asat|s, , beating unsplit 0.00005 anda|ts0.00006, so .- Length 4: unsplit
cats0.0001; : ; : ; : . Winner , .- Read back: splits into and ; is unset, so the result is
cat | swith .- Points to make: the rare whole word
catsloses to two common pieces, which BPE cannot do once it has mergedcats. The morphologically correct split appears without any morphology in the model, because pluralsis frequent. Combining the best scores of two halves is valid only because the unigram model treats segments as independent.Explain fertility and why one subword vocabulary serves languages unequally. Include byte-level BPE in your answer.
Key points: fertility = subword tokens / words; drivers: vocabulary size, word length, morphological richness; no single scheme dominates, so some languages get high fertility; three costs: reassembly, API cost, context; byte-level BPE: zero OOV but multi-byte scripts get shorter subsegments, because of UTF-8 encoding length.
- Fertility = subword tokens / words, the average number of segments per word. 1 means every word is one token.
- Drivers: merge count or target vocabulary size (the one you control), average surface word length, morphological richness. Isolating Latin-script languages are close to 1 for common words; agglutinative languages (Finnish, Turkish) have many more, individually rarer word forms, which get split further.
- Why it is unequal: no single tokenization scheme dominates across all languages and scripts, so whichever vocabulary a multilingual model picks, some languages get high fertility.
- Costs of high fertility: (1) the model must reassemble meaning from many small parts; (2) commercial APIs price by token, so high-fertility languages pay more for the same content; (3) fixed context windows fill up faster.
- Byte-level BPE: the 256-byte base alphabet guarantees zero OOV, but UTF-8 uses 1 byte for ASCII and 2 to 4 for most other characters (3 for most CJK, Devanagari and Thai). Those scripts spend merges just getting from bytes back to characters and end up with shorter subsegments, each covering fewer characters. The cause is encoding length, nothing about the language itself.
Link to originalWalk through Unigram LM vocabulary construction (Kudo, 2018). Which tokens are pruned each round?
Key points: seed with all substrings occurring more than once, not crossing words; fit unigram LM (EM in Kudo’s paper); = likelihood lost by removing ; prune at most a fraction per round, refit; MNLP (labelled Kudo 2018): remove the highest ; background: Kudo’s paper removes the smallest and never single characters.
- Seed with all substrings that occur more than once in and do not cross word boundaries (millions of candidates: the top-down start).
- While : fit a unigram LM to (by EM in Kudo’s paper, since each string’s segmentation is hidden).
- For each token : , where is the LM without . This is the likelihood lost by removing : large for a token nothing else can express.
- Remove tokens, a hyperparameter, then refit. Pruning is gradual because each assumes all other tokens are still present.
- Fit the final unigram LM and return and .
Which tokens go. As given in MNLP, under the label “Unigram LM (Kudo, 2018)”, the tokens with the highest are removed, those whose removal hurts most; expect that to be keyed true whether a statement names Unigram LM, Kudo, SentencePiece or nobody. Background, outside the course material: Kudo’s paper and SentencePiece’s code remove those with the smallest and never remove single characters, so every string stays segmentable.
L05 Static Embeddings
Exam questions
Does unsupervised bilingual lexicon induction work? Answer with the mechanism, how it compares with supervised alignment, and the conditions under which it fails.
Key points: shared space hypothesis and the MUSE pipeline (adversarial, CSLS checkpoint selection, Procrustes refinement); matches supervised on close pairs, falls short on distant ones; collapses for mixed- and double-marking languages (Estonian, Finnish, Greek), across domains and across base models, and data size does not explain it; the free identical-word baseline beats it.
- Mechanism. The shared space hypothesis says separately trained spaces are approximately isomorphic, so a single linear map should align them. MUSE (Conneau et al., 2018) bootstraps a rough adversarially (a linear generator against an MLP discriminator, kept near-orthogonal), picks the checkpoint by the unsupervised CSLS criterion, then refines with Procrustes () on a synthetic dictionary of mutual CSLS nearest neighbours, repeated.
- Against supervised alignment. Fully unsupervised MUSE matches or slightly beats supervised Procrustes with CSLS on close, well-resourced pairs (English with Spanish, French, German), and falls well short on distant ones (English with Russian, Chinese).
- Where it collapses (Søgaard et al., 2018). English-Estonian, English-Finnish and English-Greek give essentially zero: the mixed- and double-marking languages. Marking type alone does not decide it, since French is mixed-marking and aligns well. English-Finnish stays at zero with a much larger Finnish corpus (1.7 billion words), so data size is not the whole story; Estonian-Finnish, structurally similar, does align. Mismatched domains give essentially zero even for English-Spanish, and so does Spanish fastText CBOW against English fastText Skip-gram.
- A free baseline beats it. A seed dictionary of identically spelled words beats adversarial training on every pair involving English, from a small margin (English-Spanish) to working against not working (English-Estonian).
- Verdict. It works when the languages are typologically similar, the corpora share a domain and both sides use the same base model: the conditions it was evaluated under, and the opposite of the low-resource setting that motivates it.
Explain Skip-gram with negative sampling: the classification set-up, how negative pairs are formed, the objective, and what one training step updates.
Key points: real-or-noise classification with 1 positive and negatives; a negative keeps the input word and swaps in a sampled word; and give the log objective; one step updates and output vectors; cost instead of .
- Why. A full softmax needs a score for all words per example. Instead ask “is this (word, context) pair real or noise?“.
- Pairs. For a real pair , draw (5 to 20) words from the unigram distribution raised to 0.75, which favours rarer words, and pair each with the same input word .
- Likelihood. , with , , . Since , after logs: .
- One step. Minimise by SGD. It updates (a column of ) and (rows of ), nothing else.
- Effect. Real pairs’ dot products go up, random pairs’ go down, so words sharing contexts end up close. (Outside the lecture: the gradient for is .)
Compare Word2Vec (CBOW and Skip-gram) with GloVe: what each optimises, what information each uses, how each handles frequency imbalance, and what the final embedding is.
Key points: CBOW and Skip-gram predict within local windows; GloVe is weighted least squares on global log counts; subsampling against ; final embedding or against .
- CBOW: predict the centre word from the average of context embeddings, , , no non-linearity, cross entropy, SGD.
- Skip-gram: predict each of the context words from the centre word, , context words independent given ; in practice trained with negative sampling.
- GloVe (Pennington et al., 2014): weighted least squares on log co-occurrence counts, .
- Information used: Word2Vec sees individual local windows, each an independent event, so it keeps rediscovering the same association. GloVe counts once over the whole corpus and fits those global counts.
- Frequency imbalance: Word2Vec subsamples frequent words (and draws negatives from ); GloVe uses (, ), rising from zero and capped at 1.
- Final embedding: Word2Vec typically , or ; GloVe .
Why does constraining a crosslingual mapping to be orthogonal help? Give the objective, the two problems it fixes with a derivation for each, its solution, and the evidence.
Key points: with unit vectors, an added constraint beyond the shared space hypothesis; a rigid map cannot overfit the seed pairs; aligns training with retrieval; by SVD; unconstrained degrades with dimension, orthogonal better everywhere.
- Objective (Xing et al., 2015). subject to , all embeddings unit length. A strictly orthogonal is square and only rotates and reflects. The shared space hypothesis itself asks only for a linear map.
- Overfitting. An unconstrained can stretch and shear to fit the seed pairs and fail on the words outside the dictionary. Orthogonal preserves geometry, , so the space moves rigidly.
- Objective mismatch. Training uses Euclidean distance, retrieval cosine. For unit vectors and orthogonal : , so they coincide.
- Solution. , : exact, one SVD.
- Evidence (English to Spanish). The unconstrained map gets worse as the dimension grows (likely overfitting, a reason not given in the lecture); the orthogonal map, which also normalises the vectors, is better at every dimension and improves slightly.
Losing marks: claiming Euclidean training and cosine retrieval always agree, or saying the shared space hypothesis requires an orthogonal map.
Explain the hubness problem in crosslingual word retrieval and how CSLS corrects it, including which term of the formula does the work.
Key points: hubs are nearest neighbours of many points, worse in high dimensions; ; penalises hubs; constant per source word; better retrieval with only to set.
- Hubness: in high-dimensional spaces a few vectors become the nearest neighbour of many points regardless of real similarity; a general property of high-dimensional geometry that worsens with dimension. One target hub becomes the “translation” of many unrelated source words. Nearest neighbour is asymmetric.
- CSLS (Conneau et al., 2018): , with the mean cosine of to its nearest target vectors and the mean cosine of to its nearest mapped source vectors.
- Which term works: penalises a candidate close to many things. is the same for every candidate of a fixed , so it matters only when comparing scores across source words.
- Effect: better than plain nearest neighbour on every language pair, with no tuning beyond .
Describe the full MUSE pipeline of Conneau et al. (2018) for aligning two embedding spaces without any bilingual signal, and justify each design choice.
Key points: linear generator against MLP discriminator; linear so word correspondence follows the distribution match; label smoothing, 50k frequent words, re-orthogonalisation; CSLS-based checkpoint selection; Procrustes refinement on mutual nearest neighbours.
- Adversarial step. Generator = the mapping , a single linear matrix initialised to the identity (or a random orthogonal matrix); discriminator = an MLP (2 hidden layers of 2048, ReLU, input dropout) telling from real . Steps alternate with the other side frozen; the generator uses flipped labels.
- Linear generator. A deep generator could match the target distribution while scrambling which word lands where.
- Label smoothing keeps the discriminator from becoming pathologically overconfident.
- Only the 50k most frequent words: rare words have poorly estimated embeddings.
- Re-orthogonalisation , , keeps near orthogonal.
- Checkpoint selection. The adversarial loss is unreliable; instead average the cosine between the 10k most frequent source words and their CSLS nearest targets, and keep the best checkpoint.
- Refinement. Synthetic dictionary of high-confidence mutual CSLS nearest neighbours among frequent words, by SVD, repeat. This step is called semi-supervised, but MUSE as a whole uses no bilingual data. Each component adds accuracy.
What is fastText, how does it differ from Skip-gram with negative sampling, and where does it help and not help?
Key points: sum of character n-grams of
<w>(3 to 6) plus the word; same loss, only the centre word decomposed; vectors for unseen words; gains on word similarity (most for rich morphology and rare words) and on syntactic analogies; semantic analogies barely change.
- Problem: one opaque vector per word type, so
runandrunsshare nothing, morphologically rich languages split lemmas into many rare forms, and unseen words get no vector.- Model: , with the n-grams of
<w>for from 3 to 6 plus<w>itself;<and>make prefixes and suffixes distinct.- Same as Skip-gram with negative sampling: the loss; context vectors stay per word.
- Different: every n-gram of gets the same gradient; the output is the n-gram table, so any word gets a vector.
- Evidence (Bojanowski et al., 2017): best or tied on almost all word-similarity sets, most in morphologically rich languages and on English rare words; the only loss is English WS-353. Building unseen words from n-grams helps further. Analogy gains are syntactic; semantic analogies barely change, and for German get worse.
How can the degree of isomorphism between two embedding spaces be measured without a dictionary, what did it show for English and Finnish, and what can it not show?
Key points: Laplacian eigenvalues of nearest-neighbour graphs; = sum of squared eigenvalue differences; no dictionary needed; highest for the failing pairs; low does not prove isomorphism.
- Why: isomorphism is true/false; Søgaard et al. want a degree.
- Eigenvector similarity: nearest-neighbour graph per language (adjacency ), degree matrix , Laplacian , keep the largest of eigenvalues, .
- Reading it: larger eigenvalues mean denser connectivity; larger means more structurally different graphs. Eigenvalues ignore node labels, so no alignment is needed.
- Results: English-Spanish has the lowest ; English-Estonian, English-Finnish and English-Greek, where adversarial alignment fails, the highest.
- Finnish: one lemma’s many inflected forms cluster tightly, while English gives a flatter graph; no rotation can fix that, since a rotation keeps the neighbour graph.
- Limit: near-isomorphic graphs have low , but low does not imply near-isomorphism. rules isomorphism out, never in.
How should word embeddings be evaluated? Cover the evaluation axes, the word similarity and analogy tasks, and the limits of 2D visualisations.
Key points: intrinsic against extrinsic, qualitative against quantitative; word similarity by Spearman, WS-353 relatedness against SimLex-999 similarity; analogies via scored by accuracy; 2D projections distort, t-SNE hyperparameters matter.
- Axes: intrinsic (the embeddings by themselves) against extrinsic (downstream tasks such as MT, IR, summarisation); qualitative (selected examples, plots) against quantitative (an overall score). Independent of each other.
- Word similarity: rank pairs by cosine, compare with human ratings by Spearman correlation. WS-353 annotates relatedness (
bread/butterhigh), SimLex-999 similarity in the strict sense, so the same embeddings can rank differently on the two.- Analogies: a : b :: c : X, answer the word nearest to , scored by accuracy; semantic and syntactic sets.
- Visualisation: PCA (linear) or t-SNE (non-linear, local). Shows sense clusters and a consistent gender direction, but distorts distances, and t-SNE hyperparameters change the picture. Plots complement quantitative and extrinsic evaluation.
Link to originalDerive the closed-form solution of the unconstrained linear mapping , state when it exists, and say how this mapping behaves as the embedding dimension grows.
Key points: loss ; zero gradient gives ; needs invertible; SGD as the scalable alternative; accuracy falls as dimension grows.
- Matrix form. Dictionary pairs as columns: is , is . Loss .
- Gradient ; set to zero: , so (the derivation is outside the lecture; the formula is in it).
- Existence. must be invertible: at least linearly independent source vectors.
- Closed form against SGD. Closed form is exact; SGD (Mikolov et al., 2013) is approximate, scales better and is more memory-friendly.
- Dimension. Accuracy falls as grows. A likely reason, not given in the lecture: has free parameters for the same dictionary, so it stretches and shears to fit the anchors and generalises poorly.
L06 Contextual Embeddings
Exam questions
Why can mBERT transfer a task from one language to another when nothing in its training is cross-lingual? Argue from the experimental evidence.
Key points: only parameters and subword vocabulary are shared; vocabulary overlap is a minor cause (cross-script transfer, flat overlap curve, fake English costs little); structure and word order matter; depth matters; no single factor, and mixed-language inputs fail.
- What mBERT lacks. Same architecture and loss as BERT (MLM + NSP) on 104 Wikipedias; no parallel data, no language-ID embedding, no language-specific parameters, no alignment loss, NSP pairs always within one language. Languages share only the parameters and the subword vocabulary.
- Vocabulary overlap is a minor cause. Pires et al. (2019): mBERT transfers well across scripts (Hindi and Urdu, English to Bulgarian), and its zero-shot NER F1 is roughly flat in entity-wordpiece overlap, while English BERT’s is near zero at low overlap and rises with it. K et al. (2020): fake English removes all subword overlap and costs little, at most about a point and a half of XNLI accuracy.
- Structure matters. From an SVO language, transfer to SVO targets is far better than to SOV targets and rises with the number of shared WALS features. Permuting words during pre-training drops XNLI significantly, most for Hindi, yet transfer stays well above chance.
- Depth matters. At roughly constant parameter count, in-language accuracy saturates early while zero-shot accuracy keeps rising with depth, so the gap shrinks: deeper networks learn more language-independent representations.
- Bottom line: no single factor explains transfer, or the lack of it.
- The limit. When premise and hypothesis are in different languages, accuracy falls below both monolingual settings, so the shared space is not truly language-neutral. Rajaee and Monz hypothesise that transfer of heuristics (such as premise-hypothesis word overlap) contributes to cross-lingual generalisation; on one reading, mixed-language inputs remove that shortcut (an interpretation, not an established result).
Losing marks: calling shared wordpieces the main cause; claiming mBERT saw parallel data or an alignment objective.
Explain why static word embeddings are inadequate and how contextual embeddings fix this. What design tension do contextual models face, and how can it be managed?
Key points: one vector per word type (); contextual models give each occurrence its own vector; tension: enough context to separate senses without losing the word’s own contribution; managed by choice of layer, choice of task, residual connections.
- Static embeddings, whether a by-product of a task (the embedding layer of a classifier or translation system) or trained directly (Word2Vec with negative sampling, limited window), give one vector per word type: for the vehicle, the verb “to practise” and “train of thought”.
- In the by-product route the network did see the whole sentence, but only the input embedding layer was kept, so the context computed in deeper layers was thrown away.
- Contextual embeddings keep it: a deep network reads the whole sentence and every occurrence gets its own vector (a hidden state in that word’s column).
- Tension: integrate enough context to distinguish occurrences of the same word, without capturing so much that the word’s own contribution becomes unclear.
- Managed by: (1) choosing the right layer(s): lower layers are closer to the word, higher ones to the sentence; (2) choosing the right training task(s): per-token outputs keep each top state about its word, a single pooled output pushes the top layer toward the sentence; (3) tightening connections between layers, e.g. residual connections, which carry the word’s own information upward alongside the added context.
Describe how BERT is pre-trained and fine-tuned: input representation, both pre-training objectives, the role of
[CLS], and how task heads attach.Key points: input = token + segment + position embeddings; MLM: 15% selected, 80/10/10, loss on selected positions only; NSP: 50% IsNext, 50% random, classified from
[CLS]; head on[CLS]for classification, on token outputs for tagging and spans; short fine-tuning, BERT optionally updated.
- Model: encoder half of the Transformer, bidirectional (every position attends left and right).
- Input:
[CLS] A [SEP] B [SEP], with . WordPiece tokens.- MLM: select 15% of tokens; replace 80% of those with
[MASK], 10% with a random token, leave 10% unchanged; the loss is on the selected positions only, predicting the original token.- NSP: 50% B really follows A (IsNext), 50% B is random (NotNext); classified from , the final-layer output at
[CLS].[CLS]: never masked, not tied to a word, represents the whole sequence, trained through a classification loss.- Fine-tuning: a small randomly initialised head on the token outputs for tagging or span extraction (for SQuAD, a start vector and an end vector), on for classification; train on the task with or without updating BERT, with small batches for 2 to 4 epochs.
- Self-supervised pre-training can use huge amounts of task-irrelevant data; supervised fine-tuning then works with little task data.
Losing marks: saying the loss covers all tokens, or only the positions showing
[MASK].Describe how mBERT is trained and what it deliberately lacks. Explain its language sampling scheme and the problems a single shared multilingual vocabulary causes.
Key points: same architecture and MLM + NSP loss on 104 Wikipedias; no parallel data, language ID or alignment loss, NSP within one language; smoothed sampling with ; one shared WordPiece vocabulary; favours high-resource languages and Latin script, higher fertility for low-resource languages, uncased strips accents.
- Released on GitHub in 2018 with no paper. Exactly BERT’s architecture and loss (MLM + NSP), on the concatenated Wikipedias of 104 languages.
- Absent: parallel data (at least intentionally), language-ID embedding, language-specific parameters such as adapters, any alignment loss. NSP pairs are always in one language; no language mixing within a sequence (a batch can mix languages).
- Sampling: Wikipedia sizes are extremely skewed (English alone exceeds dozens of small languages combined), so languages are drawn with . : proportional, big languages dominate; : uniform, tiny languages are memorised; : up-weights low-resource and down-weights high-resource languages. Written as a temperature, , and a higher is flatter.
- Vocabulary: one shared WordPiece vocabulary, four times English BERT’s, which accounts for all of mBERT’s extra parameters. CJK characters are split into single characters before WordPiece. The sampling smoothing is also applied to the counts used to build the vocabulary.
- Problems: even smoothed, the vocabulary favours high-resource languages and Latin script; low-resource and morphologically rich languages get much higher fertility (more pieces per word); the uncased variant lowercases and strips accents, which damages languages that depend on diacritics.
Calculate: English has 1000 units of training text and Swahili 10. Using , give both sampling probabilities for , and , and interpret each.
Key points: : 0.0099 and 0.990, English dominates; : 0.038 and 0.962, Swahili up-weighted; : 0.5 and 0.5, small language memorised; the ratio becomes .
- : , . Proportional to size; English dominates.
- : , , so and . Swahili gets about 3.9 times its raw share; English still gets 96%.
- : . Each unit of Swahili text is drawn 100 times as often as each unit of English ( against ): the model would memorise the small language.
- General rule: the ratio between two languages goes from to , because with is concave and compresses large values more. Here 100:1 becomes about 25:1 at . With a temperature, : is .
Compare XLM-R with mBERT: what changed in training, and how do the two compare within a language and across languages on XNLI and cross-lingual QA?
Key points: MLM only, dynamic masking, CC-100, 250k SentencePiece Unigram vocabulary; better within a language on XNLI and QA; better across languages on XNLI; worse across languages on QA; better per language, not better at relating languages.
- XLM-R (Conneau et al. 2020) is a RoBERTa-style extension of mBERT: MLM only (NSP dropped: it contributes little and sometimes hurts), dynamic masking, more data (CC-100: filtered CommonCrawl, 100 languages, about two orders of magnitude more than Wikipedia) and a larger 250k Unigram LM vocabulary via SentencePiece (better fertility, bigger embedding matrix). Still no cross-lingual signal.
- Within a language XLM-R is better on both XNLI and QA, on average and in almost every language.
- Across languages on XNLI it is also better, with a slightly smaller within-across gap.
- Across languages on QA it is worse than mBERT on average, with a far larger within-across gap. Thai within-language QA improves enormously while Thai across barely moves.
- XLM-R’s QA results are “own language, or English question”: strong diagonal and English-question column, little in between. mBERT degrades more smoothly.
- Conclusion: more data and a bigger vocabulary made each language better on its own without making the model better at relating two languages inside one input.
What happens when the two inputs of one task are in different languages? Give the evidence for B-BERT, mBERT and XLM-R, and a possible explanation.
Key points: B-BERT mixed pairs fall below both monolingual conditions; mBERT across below within for every language; XLM-R worse across on QA; the space is not language-neutral; heuristics hypothesis: the word-overlap shortcut fails across languages.
- Standard zero-shot transfer is English fine-tuning, then monolingual testing in another language. Cross-lingual inference within a task means, for example, an English premise with a Spanish hypothesis.
- K et al. (2020), B-BERT on XNLI: fake-English pairs and target-language pairs both work; mixed pairs fall below both monolingual conditions for all three languages (Hindi scores lowest, but its monolingual baseline is lowest too). A fake-English hypothesis beats a fake-English premise.
- Rajaee and Monz (2024), mBERT on XNLI, 15 languages: across is below within for every language. An English hypothesis helps; a Swahili hypothesis is barely above chance and a Thai one little better.
- XLM-R: better than mBERT within and across on XNLI (on average), but worse than mBERT across languages on QA.
- Interpretation: the models can do the same task in another language but are poor at relating two languages inside one input, so the space is not language-neutral.
- Heuristics hypothesis: transfer of heuristics can contribute to cross-lingual generalisation. In SNLI, full premise-hypothesis word overlap almost always means entailment; a model can learn “high overlap means entailment”, which works within any single language but fails when premise and hypothesis are in different languages, where overlap is near zero. (How exactly this explains the drop is an interpretation, not an established result.)
What do layer-wise analyses reveal about where mBERT holds language-neutral information? Use translation retrieval and parameter freezing, and link to the choice of layer.
Key points: translation retrieval follows an inverted U peaking at layers 6 to 8; middle layers most language-neutral, top layers language-specific; Feat (no fine-tuning) below fine-tuning on every task; freezing lower layers helps or is neutral, freezing up to layer 9 hurts; ties to choosing the right layer.
- Translation retrieval (Pires et al.): per layer, mean-pool hidden states (excluding
[CLS],[SEP]), shift each English vector by the one mean EN-to-DE difference vector, retrieve the nearest German sentence by distance. Accuracy follows an inverted U: low at layer 1, peak at layers 6 to 8, falling in the last layers.- Reading: low layers are close to language-specific surface tokens; middle layers are the most language-neutral (one constant offset maps one language onto the other); top layers are shaped by predicting words in a specific language.
- Freezing (Wu and Dredze 2019): fine-tune on English with every layer up to and including layer frozen ( freezes only the embeddings), compared with fine-tuning all layers. Feature-based use without fine-tuning is below the best fine-tuned setting on average on every task. Freezing the lowest layers helps or is neutral (best at 0 or 3 for NER, 3 for POS, 6 for MLDoc and XNLI), since English-only fine-tuning would pull lower layers toward English. Freezing up to layer 9 hurts NER (most), POS and XNLI, though not MLDoc: upper layers must adapt to the task.
- Both measure the “choose the right layer” strategy for balancing word and context information.
Link to originalExplain how subword segmentation interacts with masked language modelling and with multilingual models: WordPiece, whole-word masking, and the vocabulary choices of mBERT and XLM-R.
Key points: WordPiece: count-ratio merges,
##, greedy longest match, whole word to[UNK]; suffix pieces easy to predict, so whole-word masking at the same rate, which improves SQuAD and MultiNLI; mBERT’s shared vocabulary biased to high-resource languages and Latin script; XLM-R 250k Unigram LM, better fertility; overlap contributes little to transfer.
- WordPiece (BERT, mBERT): bottom-up merges by ;
##marks non-initial pieces; inference is greedy longest match, not replaying merges; a word with an unmatchable character becomes[UNK]as a whole.- Masking problem: pieces carrying morphology (tense, number, case) are easy to predict from their visible stem, so per-token masking wastes many masked positions on trivially recoverable suffixes.
- Whole-word masking: mask all pieces of a word together at the same overall rate (about 15%); it improves BERT-Large on SQuAD and MultiNLI, cased and uncased.
- mBERT: one shared WordPiece vocabulary built from smoothed counts, CJK split into characters, still biased toward high-resource languages and Latin script, higher fertility for low-resource and morphologically rich languages; the uncased variant strips accents.
- XLM-R: a 250k Unigram LM vocabulary via SentencePiece, fewer pieces per word, at the cost of a larger embedding matrix.
- Wordpiece overlap itself contributes little to transfer (fake English costs at most about a point and a half).
L07 Crosslingual NLP
Exam questions
Why does multilingual pretraining (mBERT, XLM-R) not by itself make a model crosslingual, and what evidence shows that explicit crosslingual objectives fix it?
Key points: MLM uses only same-language context, so alignment is an emergent side effect; standard zero-shot keeps the input in one language; within against across on mixed-language XNLI and QA; XLM-R beats mBERT within but loses across on QA; InfoXLM’s TLM and XLCo close most of the gap.
- The mechanism. Multilingual models train jointly on many languages with one model and one subword vocabulary, but MLM predicts a word only from same-language context. When predicting word in language , unrelated context in is of no use, so nothing in the objective links languages. Any alignment is an emergent side effect.
- Why it looked fine. Standard zero-shot benchmarks (fine-tune on English, test on another language) keep all parts of the input in one language, and mBERT does reasonably there.
- The harder test. Put premise and hypothesis (XNLI) or context and question (XSQuAD) in different languages, and compare within (both parts in one language) with across (mixed, with the language in either position).
- The result. Every model drops from within to across. XLM-R is much better than mBERT within languages, but worse than mBERT across languages on QA on average: being good at each language separately does not make a model good at relating two of them. On QA it works across languages mainly when the question is in English.
- The fix. InfoXLM adds TLM and XLCo on parallel data. Within a language it is only slightly better than XLM-R; across languages it is much better, most of all on QA, where the within-across gap shrinks to about a quarter.
Losing marks: treating “multilingual” and “crosslingual” as the same thing, or citing only standard zero-shot scores as proof of crosslingual ability.
You have English-only training data for NLI and need a system for 14 other languages. Compare translate-train, translate-test and zero-shot transfer, using the XLM results on XNLI.
Key points: translate-train translates the training set into each language (best on average, but costly); translate-test translates the test set into English; zero-shot fine-tunes on English only; zero-shot XLM (MLM+TLM) slightly beats translate-test on average, though not in every language; TLM gives the gain over MLM alone.
- Translate-train: machine-translate the English training set into each language and fine-tune on the translation. The best of the three for XLM on average (Urdu is the exception), but it needs an MT system and a translated training set for every language.
- Translate-test: machine-translate each test example into English and apply the same XLM model fine-tuned on English.
- Zero-shot crosslingual transfer: fine-tune on English only and test directly on each language.
- On average over the 15 languages, zero-shot XLM with MLM+TLM slightly beats translate-test, although it never saw non-English NLI data. Per language it does not always win: translate-test is better for every European language except English (a tie), and for Turkish and Arabic; zero-shot wins for Vietnamese, Thai, Chinese, Hindi, Swahili and Urdu. TLM is what gets it there: XLM with MLM alone is a few points lower on average, and the TLM gain is largest for languages far from English (Vietnamese, Turkish, Arabic, Chinese).
- Zero-shot XLM (MLM+TLM) also beats mBERT and LASER in every language where they are reported.
Losing marks: mixing up which side gets translated (training set into the target language, or test set into English).
Explain translation language modelling (TLM): its input, its loss, why it forces crosslingual alignment, and how it differs from MLM and CLM.
Key points: TLM is MLM over a sentence concatenated with its translation; same loss, different input; a masked word is predictable from its translation, which forces alignment; positions restart at 0 and language embeddings mark the halves; CLM predicts the next word, MLM uses monolingual context.
- XLM (Lample and Conneau, 2019) has three objectives: CLM (predict the next word from a prefix), MLM (predict masked words from monolingual context, as in BERT), TLM (predict masked words in a sentence concatenated with its translation). TLM is always paired with MLM or CLM; NSP is dropped; the parallel data comes from OPUS.
- Loss: TLM is MLM applied to : The loss is the same as MLM’s; only the input changes.
- Why it aligns: in “the [MASK] [MASK] blue” / “[MASK] rideaux étaient [MASK]”, the English context barely constrains curtains, but the unmasked French rideaux gives it away. The cheapest way to lower the loss is to attend across languages and learn that rideaux corresponds to curtains. Context in becomes useful for predicting in .
- Two input details: position embeddings restart at 0 in the second sentence (so position cannot separate the halves, and corresponding words get similar position signals); language embeddings (en, fr) mark which half is which.
- Evidence: on zero-shot XNLI, adding TLM to MLM improves every language.
How would you build a parallel corpus from the web, and how do LASER embeddings make sentence alignment possible?
Key points: OPUS and natural sources (UN, EU, multilingual news and countries); document alignment then sentence alignment, or direct mining from Common Crawl; LASER: trained on parallel data, BiLSTM encoder max-pooled into one sentence vector; the language ID goes only to the decoder, which makes the vector language-independent; vecalign aligns by LASER similarity at scale.
- Sources first: natural by-products (multilingual news such as Xinhua, the UN and EU, websites of multilingual countries such as Canada and Belgium) and OPUS, a large research collection of parallel corpora.
- Crawl pipeline: (1) document alignment (find parallel documents), (2) sentence alignment inside them. Or mine sentences directly from raw crawls such as Common Crawl.
- Why sentence alignment is a separate step: translations do not keep paragraph boundaries (in one English-Chinese news story, two English paragraphs map into one Chinese paragraph, which must be split at a sentence boundary).
- Measuring equivalence: old methods use dictionary overlap and relative length; the modern method compares LASER sentence embeddings (Artetxe and Schwenk, 2019).
- LASER: an encoder-decoder trained to translate on parallel data. BPE embeddings, stacked BiLSTM encoder, max pooling into one sentence vector; the encoder is never told the input language. An LSTM decoder knows the source only through that vector, and is told the output language by a language ID embedding. So the vector must encode meaning and has no reason to encode the input language. Translations end up as near neighbours.
- vecalign uses LASER similarities to match sentences, with an efficient search that scales to massive data sets.
Explain neural machine translation as conditional language modelling, from the RNN encoder-decoder to the Transformer encoder-decoder.
Key points: seq2seq drops and ; conditional LM ; decoder input is the target shifted by one; RNN is an information bottleneck; Transformer cross-attention over all encoder outputs removes it.
- Seq2seq drops two assumptions of sequence labelling: that corresponds to , and that . MT needs both dropped (Hiermit hörte sie nicht auf / She did not stop with this: different lengths, reordering, one-to-many, many-to-one).
- It is conditional language modelling: , with the encoder output and the decoder’s prefix. The sequence probability is the product of these terms over .
- Data: source ids ; decoder input =
<s>+ sentence; target = sentence +</s>( shifted by one). Training feeds the gold previous words.- RNN encoder-decoder (Sutskever et al., 2014, LSTMs): . Everything about the source must pass through one fixed-size vector: an information bottleneck.
- Transformer: each decoder layer has a target context layer (masked self-attention over the target prefix), a source-target context layer (attention over all top-layer encoder outputs) and a feed-forward layer, each with a residual connection. Every decoder position in every layer can read every source position, which removes the bottleneck.
Describe parent-child transfer learning for low-resource NMT. What should be frozen, and which factors decide whether transfer pays off?
Key points: train a parent on a high-resource pair, continue on the child with the same target language; freeze the decoder (Monz’s condition), which the experiment narrows to the target embeddings; related parents help, but structure transfers too (French’); with a shared vocabulary unrelated parents help; transfer must flow from the larger corpus to the smaller; inner layers carry most of the benefit.
- Procedure (Zoph et al., 2016): train a parent on a high-resource pair (French→English); copy all parameters into the child (Uzbek→English, far less data); child source words take over rows of the parent’s source embedding matrix; freeze the English embeddings; continue training with strong regularisation (dropout 0.5).
- Gains: every child improves; the smallest corpus (Urdu) gains most.
- Freezing: Monz lists “decoder parameters are frozen” as a condition, and a statement in that wording is most likely marked true. The freezing experiment narrows it: with everything frozen the child scores zero; training source embeddings, encoder, decoder RNN and attention each helps; unfreezing the target embeddings then lowers BLEU, because retraining embeddings learned from far more English data on the small child data overfits.
- Relatedness: a Spanish child gains more from a French parent than from a German one. But French’ (scrambled vocabulary) still gains a lot from a French parent, so structure transfers, as well as shared words.
- Shared vocabulary (Kocmi and Bojar, 2018): English→Czech and English→Russian parents (unrelated) help an English→Estonian child about as much as an English→Finnish one (related).
- Direction: transfer must flow from the larger corpus to the smaller; reversed, it helps little or hurts.
- What transfers (Aji et al., 2020): inner layers carry most of the benefit; parent embeddings alone are worse than training from scratch; both together are best.
Describe BART: its architecture, its pretraining noise functions, which noise works best, and how it is fine-tuned for classification, span prediction and translation.
Key points: bidirectional encoder plus autoregressive decoder reconstructing corrupted text; five noise functions; text infilling best, rotation and permutation alone poor; classification from the last decoder state, start and end labels for spans; MT via a new randomly initialised source encoder, and only Tuned BART beats the baseline.
- Architecture: bidirectional encoder (as BERT) plus autoregressive decoder (as GPT). The encoder reads a corrupted document, the decoder reconstructs the original through cross-attention: a denoising autoencoder. Suited to tasks needing both, such as translation and summarisation.
- Noise functions: token masking, token deletion (the model must find where tokens are missing), text infilling (a span replaced by one
[MASK]; the model must find how many tokens are missing), sentence permutation, document rotation.- Best: text infilling; deletion beats masking on generation tasks; rotation and sentence permutation alone are poor; infilling plus permutation gives the best CNN/DailyMail perplexity.
- Classification: same input to encoder and decoder; label predicted from the last decoder hidden state. Span prediction (SQuAD): label each token, predict start and end of the answer.
- MT: a randomly initialised source encoder replaces the embedding layer of BART’s encoder; the pretrained BART encoder can be frozen or updated; the source vocabulary can differ from BART’s. On Romanian→English, Fixed BART (frozen) is slightly below the baseline, Tuned BART (updated) beats it by about one BLEU.
- At scale BART matches RoBERTa on SQuAD and is the best summariser, with its largest lead on the abstractive XSum.
Why does crosslingual QA expose the weakness of purely multilingual models much more than XNLI does? Use the XLM-R and InfoXLM results.
Key points: XNLI can rely on a sentence-level gist; QA needs word-level matching across languages; XLM-R QA works across languages mainly with an English question; InfoXLM fills the grid; InfoXLM’s across gain is far larger on QA than on XNLI.
- XNLI compares two sentences; a coarse sentence-level gist in a shared space is often enough.
- Extractive QA must find the exact answer span, which means matching the question’s words to specific context words. With a Hindi question and an Arabic context that is word-level matching between two non-English languages, never asked for by MLM on separate languages, and exactly what TLM trains.
- XLM-R QA: strong when both parts share a language, and mainly works across languages with an English question; a question in one non-English language about a context in another mostly collapses. Its across score falls below mBERT’s.
- InfoXLM QA: no cell collapses; the pairs XLM-R failed on become reasonable.
- InfoXLM’s across gain over XLM-R is moderate on XNLI and very large on QA.
Which factors predict whether crosslingual transfer will succeed? Support each with evidence.
Key points: language relatedness; pairing with English; how well the model represents the language; an explicit crosslingual training signal; size and direction of the data in NMT transfer, and which parameters transfer.
- Language relatedness: for Nepali language modelling, Hindi data helps far more than English data; a Spanish NMT child gains more from a French parent than from a German one; zero-shot Belarusian→Russian is good, Hindi→Finnish poor.
- Pairing with English: English dominates pretraining and fine-tuning data, so an English hypothesis gives the best mixed-language pairs in every XNLI model, and MT directions involving English are by far the best.
- How well the model represents the language: with a Swahili hypothesis mBERT is barely above chance; mBERT is weak on Thai even within Thai; XLM-R fixes Thai within Thai, but on QA a Thai question about a context in another language still fails.
- An explicit crosslingual training signal: TLM and XLCo on parallel data close most of the within-across gap (InfoXLM).
- Amount and direction of data in NMT transfer: transfer helps when it flows from a large parent to a small child; reversed it helps little or hurts. With a shared vocabulary and a large parent, relatedness matters less (Kocmi and Bojar).
- Which parameters transfer: inner layers carry most of the benefit (Aji et al.).
Describe multilingual NMT as in Johnson et al. (2017): training data, how the output language is chosen, what is shared, and how zero-shot translation arises.
Key points: one system with all parameters shared, transfer in parallel; English-centric data (, ) mixed within batches; target language tag prepended to the source; one WordPiece vocabulary and shared embeddings; non-English pairs are zero-shot.
- One single system for all translation directions, trained jointly: knowledge is transferred in parallel, as opposed to parent-child transfer in stages.
- Data: a collection of parallel corpora, English-centric: only and directions, because that is where the resources are. Directions are mixed during training, even within a batch.
- Target language tag: every training example gets a tag such as
<2es>prepended to the source as fed to the encoder. It names the target language; the source language is never named.- Shared everything: all parameters shared for all language combinations, one WordPiece vocabulary for all languages (32k, 64k), shared source, target and output embeddings. The architecture is a standard encoder-decoder.
- Zero-shot: training covers many-to-one and one-to-many; asking for a non-English pair (many-to-many, testing only) such as German→French is a direction never seen in training and relies entirely on transfer.
- Balancing: languages are sampled with weights, between proportional (high-resource languages dominate) and uniform (high-resource languages suffer), set by a temperature ( proportional, uniform, the compromise; the temperature settings are from Arivazhagan et al., 2019).
Losing marks: saying the tag names the source language, or that the model trains on non-English pairs.
Link to originalCompare many-to-one and one-to-many multilingual NMT, and explain transfer, interference and the choice of sampling temperature.
Key points: many-to-one beats bilingual baselines in every direction, one-to-many is mixed; the decoder’s languages compete; low-resource languages gain (mostly into English), high-resource ones lose; All→All is weakest; favours high-resource, low-resource, the compromise.
- Many-to-one (into English): the multilingual model beats the bilingual baseline for every direction, by small margins, even on large production data. All directions share one target side.
- One-to-many (out of English): some directions gain, others lose, because the decoder must produce several languages that compete for the same parameters. Oversampling only moves the loss to whichever direction gets less training signal.
- Transfer (a direction improves by sharing a model) against interference (it gets worse because others compete for capacity). Across 103 languages (Arivazhagan et al., 2019): low-resource languages gain, far more into English than out of it; high-resource languages lose, and no multilingual model beats their bilingual baselines; All→All is the weakest multilingual model.
- Temperature (Arivazhagan et al.) in : (proportional) is best for high-resource languages but wrecks low-resource ones; (uniform) is best for low-resource and worst for high-resource; is nearly as good as uniform for low-resource languages and better for high-resource ones.