MNLP-L05: Static Embeddings

In short

How do you give every word a vector, so that nearby vectors mean similar words, using only raw text? By the company the word keeps: count its context words, train a small network to predict them (Word2Vec, made affordable by negative sampling), or fit vectors to corpus-wide co-occurrence counts (GloVe). fastText builds a word’s vector from its character n-grams, so related forms share parts and unseen words still get a vector.

The second half aligns two languages’ spaces with a single linear map, learned from a seed dictionary (least squares, then an orthogonal map solved by SVD) or with no dictionary at all (adversarial training, MUSE), and retrieves translations with CSLS, which discounts “hub” words. Unsupervised alignment breaks down for very different morphology, mismatched domains and mismatched embedding algorithms.

“Static” means one vector per word type, whatever the sentence: bank gets the same vector in river bank and bank account; MNLP-L06 - Contextual Embeddings removes that limit. The sample exam has no question on this lecture; expect statements about what each method does, which data it uses, what is fixed or constrained, and when it fails.

The idea: a word is known by its contexts

We want word representations that let us compute similarity along several dimensions: meaning (synonyms such as car and automobile, topical relatedness such as car and road) and morphology (run, runs, running).

Distributional hypothesis

“You shall know a word by the company it keeps.” (Firth, 1957)

Produce vector representations of words based on the contexts in which they occur: words in similar contexts get similar vectors, and are taken to have similar meanings.

There are two types of approach. Count-based methods (distributional semantics) count the context words directly. Prediction-based methods (neural embeddings) train a network to predict words from contexts, or the reverse, and keep its weights as the vectors. GloVe combines the two.

Counting the company a word keeps

Define a vocabulary of context words, a vocabulary of target words (they can be the same) and a window of size (sliding; the context can also be the sentence or document). For each occurrence of , count how often each occurs within words to its left or right, and store the counts in a vector of length . With and , “…he took the dog for a walk…” adds 1 to ; took is in the window but not in , so it is ignored.

Similarity is the cosine of the angle between two vectors.

Cosine similarity key-formula

where is the dot product and the Euclidean length. It is 1 for vectors pointing the same way, 0 for orthogonal ones.

Cosine ignores length on purpose: a frequent word has large counts everywhere, and only the proportions of its contexts should matter. With two context words (runs, legs), dog = (1, 4) and a word seen ten times as often in the same mix, (10, 40), have cosine 1; car = (4, 1) gets against dog.

Context vectors are high-dimensional, discrete (counts) and sparse (mostly zeros). They are an unsupervised way to induce word similarity, and their dimensions are interpretable ( counts an actual word). But they stay sparse even after stemming (cutting words to a common stem, so walked counts as walk), and there is no explicit criterion to tell signal from noise: some words fall in the window by chance, and nothing says which context words discriminate a word’s meaning (the co-occurs with everything). One fix weights context words by inverse document frequency, , with the number of contexts and the number containing : a word found in nearly every context gets a weight near 0.

Learning dense vectors by prediction

The probabilistic neural language model (PNLM) predicts the next word through a projection layer that maps each word to a learned vector , then a non-linear hidden layer and a softmax. A good embedding has exactly when and mean the same and behave the same syntactically. In most models such vectors are by-products of the task; in representation learning they are the main objective. Word2Vec works this way: prediction is a pretext, and only the embedding matrices are kept.

Word embeddings share the intuition of distributional semantics, but they are low-dimensional (e.g. 100, against ), dense, continuous () and learned by performing a task (prediction). Their dimensions are not interpretable.

Word2Vec (Mikolov et al., 2013) has two variants: CBOW predicts a word from its context, Skip-gram predicts the context from the word.

CBOW: predict the word from its context

Continuous Bag of Words (CBOW): given position , the words to its left and the to its right, predict the word at position (“the man X the road”). An n-gram language model predicts from the left only (); CBOW also looks right, so it is useless as a language model and exists only to learn representations. It is simpler than the PNLM: it drops the non-linear hidden layer, so the embedding layer sits right next to the output. Typically , with .

No non-linearities. One hidden layer, then the output:

where:

  • is the one-hot vector of the word at position
  • is the input (projection) matrix, the embedding size
  • is the output matrix, the predicted distribution
  • and are not (necessarily) shared:

Loss: cross entropy. Training: SGD.

Multiplying by a one-hot vector selects a column of , so is the average of the context embeddings (a sum scaled by ). Summing loses word order, hence “bag of words”. The softmax normalises over all words, so every example touches all of : the cost negative sampling removes.

Column of is word as an input word (the context words in CBOW, the centre word in Skip-gram); row of is word as an output word. Typically is used as the embedding, or both are combined: .

Skip-gram: predict the context from the word

Skip-gram: given the word at position , predict the words between and and between and . One input word, predictions.

Skip-gram key-formula

One hidden layer: , with the one-hot input word at position .

output layers, the context words independent given the input word:

, as in CBOW, not necessarily shared. Loss: cross entropy. Training: SGD.

is the input word’s column of , with no averaging. All outputs share and , so they give the same distribution, each scored against a different context word: Skip-gram trains on separate (input word, context word) pairs per position.

Negative sampling: classify pairs instead of predicting words

Both models benefit from large amounts of data, and that is where computing the full output layer hurts: a score for every vocabulary word, for every example. Negative sampling instead distinguishes words that do and do not occur in the context of the input word: a classification task with 1 positive example from the ground truth and negative examples from a random noise distribution. The cost per example drops from dot products to (see Negative Sampling, an instance of Contrastive Learning).

The objective. Let be the observed (word, context) pairs and pairs from the noise distribution. Choose parameters (the matrices , ) that make observed pairs look real () and noise pairs look fake ():

where , (the input word’s column of ) and (the context word’s row of ). Since and , taking logs gives:

Negative sampling objective key-formula

One training step of Skip-gram with negative sampling. Take a real pair from the window. Draw words from the noise distribution and pair each with the same input word : a negative keeps and swaps in a sampled word for . Minimise by SGD. That updates (a column of ) and the output vectors (rows of ), and nothing else.

The dot product is a compatibility score, pushed up for real pairs and down for random ones, so words that share many contexts are pulled towards the same output vectors, and so towards each other. (Outside the lecture: the gradient for is , so a step moves towards and away from the negatives.)

Word2Vec practical settings

  • Skip-gram: for each observed pair , add 5 to 20 negative samples.
  • Draw negatives from the unigram distribution (each word’s share of all tokens), raised to the power 0.75 and renormalised, to bias sampling towards rarer words.
  • Context size typically around 2 to 5 (a practical recommendation; the CBOW description allows up to 10).
  • The more data, the smaller the context and the negative sample set can be.

Without the 0.75 power nearly every negative would be the, of or and.

GloVe: fit vectors to global counts

Two strategies, each strong where the other is weak. Count-based methods, used directly or as global matrix factorisation (latent semantic analysis: factorise the co-occurrence matrix with SVD), use global information directly but tend to perform worse. Prediction-based methods with a local window (CBOW, Skip-gram) tend to outperform them, but treat each context window as an independent event, rediscovering the association between two words every time they co-occur.

GloVe (Global Vectors; Pennington et al., 2014) combines global co-occurrence statistics with local prediction-based updating: count once over the whole corpus, then fit vectors to those counts with gradient updates. is the number of times word occurs in the context of word .

GloVe objective key-formula

where is the vector for word , the vector for context word , and scalar biases, the target, and a weighting function.

So GloVe is weighted least-squares regression: vectors whose dot product (plus biases) predicts the log of how often two words co-occur. Words with similar co-occurrence rows get similar vectors.

GloVe weighting function

It de-emphasises very rare (noisy) and very frequent (uninformative) co-occurrences: it rises smoothly from zero for rare pairs and caps at 1 for frequent ones. Frequent pairs still get the highest weight, 1; the cap only stops their weight growing with the count. Since , pairs that never co-occur (where is undefined) drop out, and training runs only over the non-zero cells of .

Training. A single pass over the corpus builds , each co-occurrence often weighted by 1/distance so nearer words count more. Training then sees only , never the corpus: that is what “global” means. Each epoch visits the pairs in shuffled order and updates , , , with AdaGrad (outside the lecture: SGD with a per-parameter learning rate that shrinks for parameters that have had large gradients). The final embedding is , the same trick as in Word2Vec.

Word2Vec instead handles frequent words by subsampling (defined here, not in the lecture): randomly discarding occurrences of very frequent words before training, more often the more frequent the word.

Word2VecGloVe
Trains onlocal context windowsglobal co-occurrence matrix
Objectivepredict context wordsweighted least squares on log counts
Frequency imbalancesubsampling (and negative sampling)weighting function
Interpretabilityindirect: learns to predict contextdirectly fits log counts

Neither has interpretable dimensions; the last row is about what the objective fits.

Judging whether embeddings are any good

Evaluation has two independent axes. Intrinsic evaluation asks how good the embeddings are by themselves, extrinsic how useful they are for downstream tasks (summarisation, MT, IR). Qualitative evaluation examines selected examples, quantitative uses an overall, task-dependent score. A 2D plot is intrinsic and qualitative, a similarity benchmark intrinsic and quantitative.

Word similarity. Rank word pairs such as (car, bicycle) by cosine and compare with human judgements by Spearman correlation, a correlation between the two rankings, so only the order matters. WS-353 annotates relatedness: bread and butter score fairly high although neither is a kind of the other. SimLex-999 annotates similarity in the strict sense, so related but unlike pairs such as coffee and cup (an example from outside the lecture) score low. The same embeddings can therefore rank differently on the two. The pair lists mix all kinds of pairs: synonyms, topically related and unrelated ones (WS-353 has both tiger/cat and drink/ear).

Analogies. Paris is to France as Berlin is to X, scored by accuracy. The “arithmetic magic”: , answered by the word nearest to by cosine (queen), excluding the input words. There are syntactic analogies too: acquired is to acquire as tried is to X.

Visualisation. Project to 2D with PCA (linear, onto the directions of largest variance) or t-SNE (non-linear, keeps neighbours close, gives up global distances). Plots show senses separating, and relations as directions: brother to sister and king to queen point the same way, a consistent gender direction. But plots should not be taken at face value: non-linear projections distort distances, and t-SNE hyperparameters have a substantial impact (Wattenberg 2016). They complement, but do not substitute, quantitative and extrinsic evaluation.

fastText: words built from character n-grams

Word2Vec and GloVe give one opaque vector per word type: run, runs, running, runner get four potentially unrelated vectors. Morphologically rich languages suffer most: Finnish, Turkish and Russian have huge families of word forms, each a separate, rarer word with a worse vector. And there is no fallback for unseen (out-of-vocabulary, OOV) words. This is the problem of MNLP-L04 - Subword Segmentation from the embedding side.

There are two fixes. One splits words into subword segments (e.g. with BPE) and learns an embedding per segment. The other slides a character window over the word: fastText (Bojanowski et al., 2017). fastText is Skip-gram with negative sampling, with these changes:

  • The centre word’s vector is the sum of its character n-gram vectors, . holds the n-grams of <w> of 3 to 6 characters by default, plus the whole word <w>.
  • < and > are boundary markers, so prefixes and suffixes are distinct n-grams (<ru only starts a word, ns> only ends one).
  • The loss is the negative-sampling loss. Only the centre word is decomposed; context vectors stay per word.
  • Every n-gram of the word gets the same gradient, since is a sum.
  • Training returns the n-gram table . Any word’s vector, seen in training or not, is the sum of its n-grams.

The n-grams of runs

<runs> gives <ru, run, uns, ns>, <run, runs, uns>, <runs, runs>, <runs>. <running> shares <ru, <run and run, so the two vectors are pulled together. The unseen runnings still has known n-grams such as <run and ings>, so it gets a sensible vector where Word2Vec has none.

The evidence (Bojanowski et al.), against Word2Vec Skip-gram and CBOW:

  • Word similarity: fastText is best or tied best on almost every dataset, with the largest gains in morphologically rich languages (German, Russian) and a gain on English rare words. Its one loss is English WS-353 (a likely reason, outside the lecture: its words are frequent, so their whole-word vectors are already good). Building unseen words from n-grams, rather than giving them a null vector, adds further.
  • Analogies: the gains are on syntactic analogies (largest for Czech), which are about morphology. Semantic analogies barely change, and for German get worse. A likely reason (outside the lecture): a country and its capital share nothing in spelling, and tying words with shared n-grams together adds noise.

Crosslingual embeddings: one space for two languages

Embeddings give in English and (gebouw, building) in Dutch. Can we get ? Such a space gives bilingual lexicon induction (BLI: building a dictionary by nearest-neighbour search) and transfer between languages (MNLP-L07 - Crosslingual NLP).

There are three basic set-ups: train each language separately, then align the spaces; train all languages together on one mixed corpus (shared names and numbers tie them together), then align the parts of the space each language occupies; or train on data aligned at the word or sentence level. In all three some alignment is needed, so that translation-equivalent words end up close together. The hope is to use large monolingual corpora and only a small bilingual signal. Everything below concerns the first set-up.

The shared space hypothesis

Plot English number words and animals in 2D next to their Spanish translations, and the arrangement is the same (one/uno apart from the other numbers, horse/caballo near cow/vaca), only turned and stretched.

Shared space hypothesis

  • Different languages, trained separately, still encode similar relational structure: king and queen relate in English as rey and reina do in Spanish.
  • There is an approximate isomorphism between the spaces: the overall shape of the point cloud is similar, but the specific coordinates and orientations can differ.
  • If true (it is a hypothesis), a single geometric transformation can align the spaces: a general linear mapping applied to one space brings translations close together.

In English, king and queen are separated by roughly the same offset as man and woman; in Spanish the same holds for rey, reina, hombre, mujer, but the whole cloud may be rotated and scaled differently. A structure-preserving map (an isomorphism) keeps the operations between vectors, with an operation such as or , so : the English gender offset becomes the Spanish one. A linear map satisfies this exactly; the "" is there because the spaces are only approximately isomorphic.

How much bilingual signal: seed dictionaries

Types of alignment methods

  • Supervised: a seed bilingual dictionary as anchors, typically thousands of translations.
  • Semi-supervised: a very small seed dictionary (hundreds of translations), then bootstrapping new translations based on statistical confidence.
  • Unsupervised: no bilingual signal; uses adversarial training.

A seed dictionary is a list of (source word, target word) translation pairs, often the top few thousand most frequent words translated with an existing dictionary; automatic translation can be used too, with caution. It is limited to words, because there are no embeddings for multi-word expressions. Each pair is one anchor across the spaces (the source vector of cat, the target vector of gato), and the goal is a mapping that generalises beyond the anchors.

Dictionaries come from three sources, each with problems the lecture leaves as questions (likely answers in brackets): human-compiled dictionaries (lemmas such as hablar, while embeddings hold forms such as hablamos); dictionaries learned from data by word-aligning human sentence translations (alignments are not one-to-one, so noisy); and words spelled identically in both languages (false friends; a shared script is needed). The last works surprisingly well, as the critique at the end shows.

Learning a translation matrix from a seed dictionary

The linear transformation hypothesis is a strong assumption: a single linear transformation is sufficient to map one language’s space onto another’s. Why linear rather than non-linear? King/queen and man/woman analogies are already linear regularities within one space, assumed to hold across spaces too. It reduces alignment to a classic regression problem.

General alignment problem key-formula

where are paired vectors, a source embedding and the target embedding of its translation, and () is applied to every source vector.

Stack the dictionary pairs as columns of () and (). Either run gradient descent on the squared loss, or use the closed form (derivation outside the lecture: set the gradient to zero):

Closed-form solution

It needs invertible: at least dictionary pairs whose source vectors are linearly independent.

Mikolov et al. (2013) used SGD, which scales better with large embedding dimensions and dictionaries; the closed form is exact, SGD approximate but more memory-friendly. To translate , compute and return the nearest target word by cosine.

How well it worked (Mikolov et al., English with Spanish and Czech): the translation matrix beats both baselines by a wide margin, edit distance (pick the most similarly spelled word) and word co-occurrence (count-based vectors). Accuracy rises with monolingual data size and drops for rarer words, whose embeddings are worse. The errors are related words (imperio, empire, gives dictatorship; millas ranks kilometers above miles): nearness captures relatedness, while a dictionary demands equivalence.

Keeping the map rigid: orthogonal mappings

Limitations of unconstrained mappings

  • An arbitrary can stretch, shear and rotate; nothing preserves the source space’s internal geometry (distances, angles).
  • So it can overfit the seed dictionary: pairs in or near the dictionary fit well, and the mapping does not generalise to the words outside it (the majority).
  • Training minimises Euclidean distance, retrieval uses cosine, and the two are not equivalent unless vectors are unit-normalised.

Orthogonal mapping (Xing et al., 2015) key-formula

with all embeddings normalised to unit length.

A strictly orthogonal is square, which needs both spaces to have the same dimension ; Xing et al. also report a run with 800 English and 200 Spanish dimensions, where is non-square and can be orthogonal in one direction only. It only allows rotations and reflections, no scaling or shearing, so it preserves angles and distances. can be solved exactly using SVD.

Orthogonality is an extra constraint added by Xing et al.; the shared space hypothesis itself asks only for a linear map. The constraint fixes both problems:

  1. Geometry is preserved: , so the source space moves rigidly and cannot be warped to fit the seed pairs. With every vector at unit length, a uniform difference in scale between the two clouds disappears, so a rotation (or reflection) can carry the shared shape across.
  2. Training and retrieval agree: for unit vectors and orthogonal , , so minimising distance is maximising cosine.

Orthogonal Procrustes solution

One SVD of a matrix: exact, no iterations, no learning rate.

The name “Procrustes” is used two ways. Monz uses it for the general least-squares problem above, so a statement such as “the Procrustes algorithm finds the minimising ”, with no constraint on , is true in the lecture’s sense. In the literature and in Conneau et al.’s results tables, “Procrustes” means the orthogonal version solved by SVD.

The evidence (English to Spanish): the unconstrained map gets worse as the embedding dimension grows (a likely reason, not given in the lecture: more free parameters, , to overfit the same dictionary). The orthogonal map is better at every dimension and improves slightly with it; its runs also normalise the vectors, so both changes contribute. One setting gives the two languages different dimensions (800 English, 200 Spanish), where a non-square can be orthogonal in one direction only.

Hubs, and how CSLS discounts them

Retrieval is nearest-neighbour search at inference time, and in high-dimensional spaces some points become hubs: a small number of vectors are the nearest neighbour of many other points, regardless of actual similarity. This is a known phenomenon of high-dimensional geometry, not specific to embeddings, and it worsens as dimensionality increases. A target hub becomes the “translation” of many unrelated source words: nn(cat) = nn(car) = nn(house) = thing. Nearest neighbour is not symmetric: thing can be cat’s nearest neighbour while cat is far down thing’s list. Conneau et al. (2018) modify cosine to correct for this.

Cross-domain Similarity Local Scaling (CSLS) key-formula

where is a mapped source vector and a target vector,

  • is the average cosine between and its nearest neighbours in the target space
  • is the average cosine between and its nearest neighbours in the (mapped) source space

Subtracting penalises a candidate that is close to lots of things: a hub has a high . is the same for every candidate when translating a fixed , so it cannot change the winner; it matters when scores are compared across source words, as when building a dictionary. CSLS significantly increases translation accuracy without parameter tuning; only is set ( in Conneau et al.).

CSLS defusing a hub (toy numbers)

Translating cat, with . The hub thing: , , CSLS . gato: , , CSLS . Nearest neighbour picks thing; CSLS picks gato.

The evidence (supervised orthogonal mapping on fastText embeddings): CSLS beats plain nearest neighbour on every language pair, and is about level with inverted softmax, another hubness correction. Accuracy falls from Spanish and French through German and Russian to Chinese, which fits distance from English. Esperanto is lowest, which distance does not explain (likely a small corpus; outside the lecture).

No dictionary at all: adversarial training (MUSE)

For many low-resource pairs even a small dictionary may not exist, and dictionaries may not cover the inflected forms common in real text. Can two spaces be aligned from their geometry alone? The catch is a chicken-and-egg problem: you need a mapping to find translation pairs, and translation pairs to learn the mapping. Conneau et al. (2018) break it with adversarial training, which bootstraps a rough alignment from distributional structure alone. Their toolkit is called MUSE.

The adversarial game

The set-up is borrowed from Generative Adversarial Networks (GANs). The generator is the mapping : it maps source embeddings into the target space, aiming to make them indistinguishable from real target vectors. The discriminator, a classifier trained simultaneously, tells mapped source vectors (fake data) from real target vectors (real data). They are trained in opposition: the discriminator gets better at telling them apart, at fooling it. If the discriminator cannot tell the clouds apart, they have the same shape, and under the shared space hypothesis that puts translations on top of each other.

The generator is deliberately not a deep network

Unlike a standard GAN, the generator is a single matrix, a linear map with no non-linearity. A deep generator could learn an arbitrarily complex warping that makes the mapped cloud statistically indistinguishable from the target cloud while scrambling which source word lands where. A near-rigid map cannot reshuffle words, so matching the two clouds also lines up the translations.

The discriminator is a multilayer perceptron with 2 hidden layers of 2048 units, ReLU and dropout on the input layer. Its two-class output uses label smoothing : targets instead of , which keeps it from becoming pathologically overconfident (outside the lecture: an overconfident discriminator gives the generator almost no gradient). Source and target vectors come only from the 50k most frequent words of each language, because rare words have poorly estimated embeddings and frequent ones give a cleaner signal.

Algorithm: Adversarial training (MUSE)
──────────────────────────────────────────────
Input: source embeddings X, target embeddings Y
       (monolingual, unaligned), β = 0.01
Initialise W ← I (identity/random orthogonal)
Initialise discriminator parameters θ_D
 
repeat:
  // Discriminator step (W frozen):
  sample batches {x_i} (source), {y_j} (target)
  ℒ_D ← −(1/n) Σ log P_θD(source=1 | W x_i)
        −(1/m) Σ log P_θD(source=0 | y_j)
  θ_D ← θ_D − η · ∂ℒ_D/∂θ_D
 
  // Generator step (θ_D frozen):
  sample new batches {x_i}, {y_j}
  ℒ_W ← −(1/n) Σ log P_θD(source=0 | W x_i)
        −(1/m) Σ log P_θD(source=1 | y_j)
  W ← W − η · ∂ℒ_W/∂W
 
  // Re-orthogonalisation:
  W ← (1 + β) W − β (W Wᵀ) W

is the discriminator’s probability that is a mapped source vector. The two steps alternate, each with the other side frozen. The discriminator trains on the true labels, the generator on flipped labels, so is rewarded when mapped vectors are judged “target”. Re-orthogonalisation pulls back towards an orthogonal matrix after each step (an orthogonal has and is left unchanged); without it, would drift into a general linear map with the warping problems of the unconstrained mapping.

Choosing a checkpoint without a dictionary. The adversarial loss is not a reliable indicator of alignment quality: the discriminator loss can look fine while the mapping is poor, and there is no validation dictionary. Instead, take the 10k most frequent source words, find each one’s CSLS nearest neighbour in the target space with the current , compute the average cosine over these pairs, and keep the checkpoint where it is highest. A poor mapping puts mapped words far from any real target word, so a high average means the mapping lands on actual target words; whether they are the correct ones it cannot tell.

Refinement: from a rough map to a precise one

The adversarial is rough: the global orientation is about right, but it is not precise enough for good retrieval. The full MUSE pipeline continues:

  1. Adversarial training for a rough .
  2. Build a synthetic dictionary: use with CSLS to find mutual nearest-neighbour pairs among frequent words, keeping only high-confidence matches. “Mutual” means is ‘s best match and is ‘s, which filters out hubs.
  3. Re-solve for exactly via SVD on that dictionary (orthogonal Procrustes).
  4. Repeat steps 2 and 3 (self-learning).

MUSE as a whole is unsupervised: it uses no bilingual data. Conneau et al. call the refinement step semi-supervised, because steps 2 to 4 are the supervised orthogonal method run on a dictionary the system built itself. The semi-supervised alignment type from earlier is the same loop started from a small human seed dictionary instead of from adversarial training.

How well it works. Each component helps: adversarial alone is weakest, CSLS retrieval and refinement each add, and both together are best. 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 pairs (English with Russian, Chinese). The critique starts there.

When unsupervised mapping fails

Søgaard, Ruder and Vulić (2018) questioned Conneau et al.’s assumptions and results from several angles. They classify languages by where grammar is marked and by morphological type.

Head marking and dependent marking

When two words are in a grammatical relationship, which one carries the morphological marker?

  • Dependent-marking: the dependent. Head-marking: the head. Double-marking: both. Zero-marking: neither.
  • Mixed marking (not defined in the lecture; the usual meaning in typology): some constructions mark the head, others the dependent.

In a possessive phrase the head is the possessed noun and the dependent the possessor; in a clause the head is the verb, the dependents subject and object.

German der Mann sieht den Hund (the man sees the dog) puts case (marking of a noun’s role in the sentence, here on the articles: der nominative, den accusative) on subject and object, the dependents; the verb also agrees with its subject, so there is some head-marking, but dependent marking predominates. English uses word order instead. The morphological types come from MNLP-L03 - Morphology and Word Formation: fusional languages pack several meanings into one affix, agglutinative ones string together separable affixes, one meaning each.

The choice of languages. Conneau et al.’s languages (Spanish, French, German, Russian, Chinese) are mostly dependent-marking and none is agglutinative. Spanish, French and Chinese have no cases, German has 4 and Russian 6 to 7, but none has 10 or more. Søgaard et al. added Estonian and Finnish (mixed marking, agglutinative, 10+ cases), Greek (double marking, fusional, 3 cases), and Hungarian, Polish and Turkish (dependent marking, 6 or more cases).

A free baseline: identical-word supervision. Use the words spelled identically in both languages as the seed dictionary, then run ordinary supervised alignment. It needs no human dictionary either. The results:

  • Adversarial alignment fails completely (essentially zero precision) for English-Estonian, English-Finnish and English-Greek.
  • Identical-word supervision beats adversarial training on every pair involving English, from a small margin (English-Spanish) to working against not working (English-Estonian).
  • Estonian-Finnish, two structurally similar languages, aligns adversarially though neither aligns with English: the one pair where adversarial beats identical.

The lecture sums this up as “languages with mixed or double dependent marking perform poorly”, but marking type alone does not decide it: French is mixed-marking and aligns well with English. The failing languages combine mixed or double marking with rich morphology (Estonian and Finnish are agglutinative with 10+ cases; Greek is fusional with 3), and Hungarian (dependent-marking, agglutinative, 10+ cases) lands in between.

Why it hurts. In mixed- or double-marking languages grammatical information is distributed across more word forms: a lemma is realised in many more distinct surface forms, each with its own embedding and each of lower frequency. That makes the mapping between a language that marks relations by word order and one that marks them by morphology more complex: non-isomorphic. English house faces Finnish talo, talon, taloa, talossa, … (an illustration from outside the lecture), and no rotation maps one point onto a dozen.

Measuring how isomorphic two spaces are

Isomorphism is a strict true/false criterion. To measure degrees of it, Søgaard et al. compare nearest-neighbour graphs through their eigenvalues.

Eigenvector similarity

  1. Compute each word’s nearest neighbours and represent them as an adjacency matrix .
  2. Form the Laplacian , with the diagonal matrix of neighbour counts.
  3. Take the eigenvalues of and keep the largest .
  4. For two languages, sum the squared differences of their Laplacian eigenvalues: with the -th largest kept eigenvalues of each graph.

(The lecture words this step the other way round: “subtracting diagonal matrix … from ”, which is . A statement that the Laplacian is obtained by subtracting from follows the lecture. only flips the sign of every eigenvalue; the standard form is , with eigenvalues .)

Laplacian eigenvalues indicate how connected the nodes are: bigger values, denser connectivity. The bigger , the more structurally different the graphs, the further from isomorphism. It does not require knowing the alignment, since eigenvalues do not change when nodes are relabelled: if dense parts are similarly dense and sparse parts similarly sparse, is small.

A high means that words cluster in language A unlike in language B, that no rotation can fix it (a rotation keeps the neighbour graph, so the eigenvalues), and that the isomorphism assumption does not hold. For Finnish the plausible reason is morphology: one lemma spreads across dozens of inflected forms that cluster tightly through overlapping meaning, while English, with far fewer forms per lemma, gives a flatter, more evenly connected graph. In the results the three pairs where adversarial alignment fails have the largest , but the fit is loose (Estonian-Finnish aligns despite a larger than English-Hungarian), and eigenvector similarity is poor for most pairs: every pair has a larger than English-Spanish, and the three failing pairs the largest.

The inference only goes one way

A low does not mean the spaces are near-isomorphic. Near-isomorphic graphs have a low , not the other way round (outside the lecture: different graphs can share the same eigenvalues). can rule isomorphism out, never in.

Data size, domain and embedding algorithm

Not only data size. Finnish Wikipedia is far smaller than Spanish, so too little data was a suspect. Retraining on a much larger Finnish corpus (WaC, 1.7 billion words) still left English-Finnish at zero, while Estonian-Finnish aligns. Structural similarity matters: pairing structurally dissimilar languages is the problem. Results also differ by part of speech: for English-Hungarian, nouns and verbs, the most inflected, do worst.

Domain. With equal-sized corpora from EuroParl (political debates), Wikipedia or EMEA (medical texts), English aligned with Spanish, both methods work when both sides share a domain. Across domains, identical-word supervision degrades but survives, while adversarial induction collapses to essentially zero in every combination, even for English and Spanish.

Embedding algorithm. Both sides use fastText. English is fixed at fastText Skip-gram (window 2, n-grams 3 to 6) and the Spanish settings vary. Variations within one model barely matter: another window size or n-gram range for Spanish Skip-gram costs very little. Two different base models do not work at all: Spanish fastText CBOW against English fastText Skip-gram gives essentially zero, even with otherwise identical settings. So the approximate isomorphism depends partly on using the same algorithm on both sides.

What the critique adds up to

Unsupervised alignment works when the languages are typologically similar, the corpora share a domain, and both sides use the same embedding algorithm: the conditions it was evaluated under, and the opposite of the low-resource setting that motivates it. A free dictionary of identically spelled words beats it on every English pair tested.

The alignment methods side by side

MethodSignalConstraint on Solved by
Translation matrix (Mikolov)seed dictionarynoneSGD or closed form
Orthogonal (Xing)seed dictionaryorthogonal, unit vectorsSVD
Procrustes + CSLS (Conneau)seed dictionaryorthogonalSVD, CSLS retrieval
MUSE (Conneau)nonenear-orthogonaladversarial, SVD refinement
Identical words (Søgaard)identical spellingsas supervisedas supervised

What to be able to answer

  • CBOW against Skip-gram; how negative sampling forms negatives and what one step updates.
  • GloVe against Word2Vec; WS-353 against SimLex-999.
  • fastText: what is decomposed, where it gains and where it does not.
  • The shared space hypothesis; the three kinds of bilingual signal.
  • Unconstrained against orthogonal mapping; the two senses of “Procrustes”; CSLS.
  • MUSE’s design choices, and when unsupervised alignment fails.

Model answers are in the exam questions below.

Exam questions

Flashcards

  • Course: Course overview
  • Previous: MNLP-L04 - Subword Segmentation (subword units; fastText’s character n-grams are the embedding-side answer to the same vocabulary problem)
  • Next: MNLP-L06 - Contextual Embeddings (vectors that depend on the sentence, built with RNNs, Self-Attention and Transformers, the basis of Large Language Models (LLM))
  • Later: MNLP-L07 - Crosslingual NLP (crosslingual transfer, building on the aligned spaces of this lecture)
  • Related concepts: Word Embeddings · Negative Sampling · Contrastive Learning · Vector Space Model · Bag of Words · Tokenization
  • Source: embeddings_static.pdf, Christof Monz, MNLP: Static Embeddings, slides 1 to 71
  • Primary references: Firth (1957) · Mikolov et al. (2013), Efficient Estimation of Word Representations in Vector Space and Distributed Representations of Words and Phrases and their Compositionality (Word2Vec, negative sampling) · Mikolov, Le and Sutskever (2013), Exploiting Similarities among Languages for Machine Translation (linear translation matrix) · Pennington, Socher and Manning (2014), GloVe: Global Vectors for Word Representation · Wattenberg, Viégas and Johnson (2016), How to Use t-SNE Effectively · Bojanowski et al. (2017), Enriching Word Vectors with Subword Information (fastText) · Xing et al. (2015), Normalized Word Embedding and Orthogonal Transform for Bilingual Word Translation · Conneau et al. (2018), Word Translation Without Parallel Data (MUSE, CSLS) · Søgaard, Ruder and Vulić (2018), On the Limitations of Unsupervised Bilingual Dictionary Induction