Word2vec's King-Queen Trick Only Works Because the Answer Was Rigged
The demo excludes the query words themselves — without that exclusion, 'king' often beats 'queen' as the nearest match
Tomas Mikolov did not work at Google when the most famous equation in natural language processing was born. In the spring of 2013 he was a researcher at Microsoft, and the paper he wrote with Wen-tau Yih and Geoffrey Zweig for that year's NAACL conference contained a demonstration that would outlive almost everything else in it: take the vector for "king," subtract the vector for "man," add the vector for "woman," and the nearest point in the space belongs to "queen." Word2vec — the tool most people actually associate with the trick — wouldn't be released until later that same year, from Google, after Mikolov moved there. The meme got attached to the wrong toolkit almost immediately, and it never let go.
That mix-up is trivial next to the bigger one hiding in plain sight: the equation became AI's favorite party trick not because it proved machines understand gender and royalty as abstract concepts, but because the demonstration quietly excluded the one answer that would have ruined it.
The Trick Inside the Trick
Here is what almost no popular explainer mentions. When you compute king − man + woman, you get a new point floating in a few-hundred-dimensional space. To turn that point into a word, the algorithm searches for the nearest neighbor among every word vector in the vocabulary — and by convention, it throws out "king," "man," and "woman" themselves before looking. That exclusion isn't a footnote; it's load-bearing. Word vectors cluster so tightly around their own neighborhoods that, left unfiltered, the closest vector to king − man + woman is very often just king again, or some other royal near-synonym, with "queen" arriving several places down the list. This is the phenomenon researchers call "hubness": a handful of vectors sit unusually close to enormous swaths of the space, so they keep winning nearest-neighbor searches regardless of what arithmetic produced the query. Yishay Carmiel and others working on vector-space search had documented hubness in high-dimensional data before word2vec existed; it simply migrated into the word-embedding literature along with the rest of the geometry.
Omer Levy and Yoav Goldberg made the mechanics explicit in a 2014 CoNLL paper, showing that the standard method — nicknamed 3CosAdd — is dominated by whichever of the three input words happens to sit in the densest part of the space, and proposing an alternative, 3CosMul, that multiplies rather than adds similarities to correct for it. The takeaway is unglamorous but important: the "elegant algebra" story requires a specific evaluation protocol, tuned to produce the elegant answer, and a different but equally defensible protocol produces a messier one.
The Demo That Was Built to Work
None of this makes the original observation fraudulent. Word embeddings genuinely do encode a rough geometry of relatedness — gender, tense, capital-country pairs, comparative-superlative adjective pairs all show up as roughly parallel offsets often enough to be striking. But "roughly parallel offsets, often enough" is a different claim from "solves analogies," and the difference is exactly the gap that made the meme spread faster than the caveat could catch up. A single, clean, four-word equation is irresistible to journalists, professors building a first lecture on embeddings, and tech companies who want a thirty-second demo of a language model "understanding" meaning. The asterisk — computed over a curated vocabulary, with the query words barred from winning, using an additive formula chosen partly because it produces analogy-shaped results — rarely makes the slide.
Malvina Nissim, Rik van Noord, and Rob van der Goot pushed on exactly this in a paper pointedly titled "Fair Is Better Than Sensational," built around the parallel, more troubling analogy "man is to doctor as woman is to nurse." Their argument wasn't just about bias; it was methodological. They showed how much of what gets reported as a semantic finding depends on choices in the evaluation pipeline — which words are excluded, which similarity metric is used, how the vocabulary is filtered — choices that are rarely disclosed with the same confidence as the headline result.
Same Algebra, Uglier Answer
Here is the part of the story that turns the meme against itself. The very method that produced the charming king/queen result was repurposed, almost unchanged, to expose how ugly the same embeddings could be. In 2016, Tolga Bolukbasi and coauthors at Boston University and Microsoft Research ran the identical vector arithmetic and got he − she + programmer landing near "homemaker," and man − woman + doctor landing near roles the model coded as domestic and subordinate. The paper's title, "Man Is to Computer Programmer as Woman Is to Homemaker?," was a direct, deliberate echo of the king-queen formula, weaponizing its own fame against it.
Then came the second twist. Hila Gonen and Yoav Goldberg's 2019 paper "Lipstick on a Pig" examined the debiasing techniques that followed Bolukbasi's discovery — methods that try to scrub the gender direction out of the vector space — and found that they mostly hide the bias rather than remove it. Words that were stereotypically gendered before debiasing still clustered together after it; the offending vector arithmetic just got harder to demonstrate on stage. In other words, the same geometric fragility that let king − man + woman look like queen also let engineers make bias look fixed without it being fixed. The trick cuts in whichever direction the evaluation is built to show.
What the Party Trick Actually Teaches
The honest version of this story isn't "word embeddings understand royalty and gender," and it isn't "word embeddings are useless." It's that a compelling demonstration and a rigorous finding are not the same object, and the distance between them is where an entire decade of AI reporting has repeatedly gone astray — from image classifiers "recognizing" objects for the wrong reasons to large language models "reasoning" through prompts that happen to resemble their training data. The king-queen equation is small and old enough now to see clearly, with the methodological seams exposed by a decade of follow-up papers. Every big claim about a new model doing something that looks like understanding deserves the same treatment: not "does the demo work," but "what was excluded, filtered, or tuned to make it work," and would the answer survive if you asked it more honestly.
References
- ACL Anthology. Linguistic Regularities in Continuous Space Word Representations (Mikolov, Yih, Zweig, NAACL 2013)
- ACL Anthology. Linguistic Regularities in Sparse and Explicit Word Representations (Levy & Goldberg, CoNLL 2014)
- arXiv. Man Is to Computer Programmer as Woman Is to Homemaker? Debiasing Word Embeddings (Bolukbasi et al., 2016)
- ACL Anthology. Lipstick on a Pig: Debiasing Methods Cover up Systematic Gender Biases in Word Embeddings But do not Remove Them (Gonen & Goldberg, NAACL 2019)
- ACL Anthology. Fair Is Better Than Sensational: Man Is to Doctor as Woman Is to Doctor (Nissim, van Noord, van der Goot, Computational Linguistics 2020)