Arithmetic with meaningsDe l'arithmétique avec des sens

TRA6008 S2 · in classS2 · en classe

King minus man plus woman

Static word embeddings static word embeddingplongement lexical statique embeddingsplongements A numerical representation that assigns each word type, meaning each distinct word in a vocabulary, a single fixed vector learned from patterns in a corpus.Représentation numérique qui attribue à chaque type de mot, c'est-à-dire à chaque mot distinct d'un vocabulaire, un unique vecteur fixe appris à partir des régularités d'un corpus. like word2vec, one fixed vector per word, let you do arithmetic with words.

Take the vector for king, subtract the vector for man, and add the vector for woman. The point you land on is nearest the word queen (Mikolov et al., 2013b). Nothing in the training aimed at this. It falls out of the geometry: the displacement from man to king encodes something like royalty, and applying that same displacement to woman arrives near queen.

Click the drawing, or a line below, to build it up stage by stage. Cliquez sur le dessin, ou sur une ligne ci-dessous, pour le construire étape par étape.

Figure 5. Subtracting man from king leaves the crown, and adding woman to the crown arrives at queen.

One direction among many

The royalty direction is one of many. Mikolov et al. (2013b) tested the pattern systematically on grammatical relations, a thousand questions each for comparatives (good is to better as rough is to rougher), plurals (year is to years) and verb tense (see is to saw as return is to returned), and found it there too. Encyclopedic relations behave the same way, a country and its capital among them (Jurafsky & Martin, 2026). The axes are still unreadable. The meaning is in the directions between whole vectors, and those can be looked for after the fact.

Two small maps of the space. On the left, three parallel arrows run from be to was, from run to ran and from have to had, all pointing the same way: the past-tense direction. On the right, three more parallel arrows run from Belgium to Brussels, from France to Paris and from Germany to Berlin: the capital direction.
Figure 6. A grammatical relation and an encyclopedic one, each a direction that every pair shares.

Carnegie Mellon’s browser demo does exactly that. The three screenshots below were taken from it on 9 September 2026, and the demo can change. They are dense, and a click opens each one larger.

A three-dimensional scatter plot titled Word vector projection. The horizontal axis is labelled intelligence, the vertical axis empathy and the third residual. Man and woman sit high on empathy, boy and girl low. Between them are kind, strong, intelligent, bossy, lawyer, nurse, smart, pretty and beautiful.
Figure 7. The space projected onto two directions named by words: intelligence and empathy. The axes were chosen after training, not built into it.
Three analogy queries in the demo, each shown in words and as vector arithmetic. Canada is to moose as UK is to deer. Montreal is to cold as Miami is to hot. Quebec is to French as Flanders is to Flemish.
Figure 8. Three analogies on the demo's word2vec vectors. Canada is to moose as UK is to deer, Montreal is to cold as Miami is to hot, Quebec is to French as Flanders is to Flemish. Each analogy is typed in words above and as vector arithmetic below, and the two forms return the same word.

The same arithmetic on stereotypes

The arithmetic works on stereotypes too. In embeddings trained on Google News articles, man is to computer programmer as woman is to homemaker, and occupation words divide along a gender direction the same way king and queen divide along a royalty one (Bolukbasi et al., 2016).

Three analogy queries in the demo. Man is to king as woman is to queen. Man is to strong as woman is to weak. Man is to handsome as woman is to beautiful.
Figure 9. The same demo, on the same word2vec vectors. Man is to king as woman is to queen, the textbook analogy. Then man is to strong as woman is to weak, and man is to handsome as woman is to beautiful.

No programmer decided to put woman further from doctor and closer to nurse. The bias comes from the text: the vectors record how the words are used across millions of sentences, and people wrote those sentences. The method is working as designed. The consequences reach everything built on embeddings since (see also the Critical issues with LLMs module) (voir aussi le module Enjeux critiques des GML).

Written in English. The French version was automatically generated and I have not revised it. Rédigé en anglais. La version française a été générée automatiquement et je ne l'ai pas révisée. Updated 2 October 2026

Roi moins homme plus femme

Les plongements lexicaux statiques static word embeddingplongement lexical statique embeddingsplongements A numerical representation that assigns each word type, meaning each distinct word in a vocabulary, a single fixed vector learned from patterns in a corpus.Représentation numérique qui attribue à chaque type de mot, c'est-à-dire à chaque mot distinct d'un vocabulaire, un unique vecteur fixe appris à partir des régularités d'un corpus. comme word2vec, un vecteur fixe par mot, permettent de faire de l’arithmétique avec des mots.

Prenez le vecteur de roi, soustrayez le vecteur de homme, puis ajoutez le vecteur de femme. Le point où vous arrivez a pour plus proche voisin le mot reine (Mikolov et al., 2013b). Rien dans l’entraînement ne visait ce résultat. Il découle de la géométrie : le déplacement de homme vers roi encode quelque chose comme la royauté, et appliquer ce même déplacement à femme arrive près de reine.

Click the drawing, or a line below, to build it up stage by stage. Cliquez sur le dessin, ou sur une ligne ci-dessous, pour le construire étape par étape.

Figure 5. Soustraire homme de roi laisse la couronne, et ajouter femme à la couronne arrive à reine.

Une direction parmi bien d’autres

La direction de la royauté est l’une parmi bien d’autres. Mikolov et al. (2013b) ont éprouvé le motif de façon systématique sur des relations grammaticales, mille questions chacune pour les comparatifs (good est à better ce que rough est à rougher), les pluriels (year est à years) et le temps des verbes (see est à saw ce que return est à returned), et il tenait. Les relations encyclopédiques se comportent de la même manière, dont celle d’un pays et de sa capitale (Jurafsky et Martin, 2026). Les axes restent illisibles. Le sens est dans les directions entre vecteurs entiers, et celles-ci peuvent se chercher après coup.

Deux petites cartes de l'espace. À gauche, trois flèches parallèles vont de être à était, de aller à allait et de avoir à avait, toutes dans le même sens : la direction du passé. À droite, trois autres flèches parallèles vont de Belgique à Bruxelles, de France à Paris et d'Allemagne à Berlin : la direction de la capitale.
Figure 6. Une relation grammaticale et une relation encyclopédique, chacune une direction que toutes les paires partagent.

La démonstration en ligne de Carnegie Mellon fait exactement cela. Les trois captures ci-dessous en viennent, prises le 9 septembre 2026, et la démonstration peut changer. Elles sont denses ; un clic ouvre chacune en plus grand.

Un nuage de points en trois dimensions intitulé « Word vector projection ». L'axe horizontal porte l'étiquette intelligence, l'axe vertical empathy et le troisième residual. Man et woman se situent haut sur l'empathie, boy et girl bas. Entre eux se trouvent kind, strong, intelligent, bossy, lawyer, nurse, smart, pretty et beautiful.
Figure 7. L'espace projeté sur deux directions nommées par des mots : l'intelligence et l'empathie. Les axes ont été choisis après l'entraînement, ils n'y étaient pas intégrés.
Trois requêtes d'analogie dans la démonstration, chacune montrée en mots puis en arithmétique vectorielle. Canada est à moose ce que UK est à deer. Montreal est à cold ce que Miami est à hot. Quebec est à French ce que Flanders est à Flemish.
Figure 8. Trois analogies sur les vecteurs word2vec de la démonstration. Canada est à moose ce que UK est à deer, Montreal est à cold ce que Miami est à hot, Quebec est à French ce que Flanders est à Flemish. Chaque analogie est saisie en mots au-dessus et en arithmétique vectorielle au-dessous, et les deux formes renvoient le même mot.

La même arithmétique sur les stéréotypes

L’arithmétique fonctionne aussi sur les stéréotypes. Dans des plongements entraînés sur des articles de Google News, man est à computer programmer ce que woman est à homemaker, et les noms de métiers se répartissent selon une direction de genre exactement comme roi et reine se répartissent selon une direction de royauté (Bolukbasi et al., 2016).

Trois requêtes d'analogie dans la démonstration. Man est à king ce que woman est à queen. Man est à strong ce que woman est à weak. Man est à handsome ce que woman est à beautiful.
Figure 9. La même démonstration, sur les mêmes vecteurs word2vec. Man est à king ce que woman est à queen, l'analogie des manuels. Puis man est à strong ce que woman est à weak, et man est à handsome ce que woman est à beautiful.

Aucun programmeur n’a décidé d’éloigner woman de doctor et de la rapprocher de nurse. Le biais vient des textes : les vecteurs enregistrent la manière dont les mots sont employés à travers des millions de phrases, et ce sont des personnes qui ont écrit ces phrases. La méthode fonctionne comme prévu. Les conséquences touchent tout ce qui a été construit sur des plongements depuis (see also the Critical issues with LLMs module) (voir aussi le module Enjeux critiques des GML).

Written in English. The French version was automatically generated and I have not revised it. Rédigé en anglais. La version française a été générée automatiquement et je ne l'ai pas révisée. Mise à jour 16 septembre 2026

Sources

  • Bolukbasi, T., Chang, K.-W., Zou, J., Saligrama, V., & Kalai, A. (2016). Man is to Computer Programmer as Woman is to Homemaker? Debiasing Word Embeddings. Advances in Neural Information Processing Systems 29 (NIPS 2016). https://proceedings.neurips.cc/paper/2016/hash/a486cd07e4ac3d270571622f4f316ec5-Abstract.html
  • Jurafsky, D., & Martin, J. H. (2026). Speech and Language Processing: An Introduction to Natural Language Processing, Computational Linguistics, and Speech Recognition with Language Models. Online draft, 3rd edition. https://web.stanford.edu/~jurafsky/slp3/
  • Mikolov, T., Yih, W., & Zweig, G. (2013b). Linguistic Regularities in Continuous Space Word Representations. Proceedings of the 2013 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies. https://aclanthology.org/N13-1090/

Sources

  • Bolukbasi, T., Chang, K.-W., Zou, J., Saligrama, V., & Kalai, A. (2016). Man is to Computer Programmer as Woman is to Homemaker? Debiasing Word Embeddings. Advances in Neural Information Processing Systems 29 (NIPS 2016). https://proceedings.neurips.cc/paper/2016/hash/a486cd07e4ac3d270571622f4f316ec5-Abstract.html
  • Jurafsky, D., & Martin, J. H. (2026). Speech and Language Processing: An Introduction to Natural Language Processing, Computational Linguistics, and Speech Recognition with Language Models. Online draft, 3rd edition. https://web.stanford.edu/~jurafsky/slp3/
  • Mikolov, T., Yih, W., & Zweig, G. (2013b). Linguistic Regularities in Continuous Space Word Representations. Proceedings of the 2013 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies. https://aclanthology.org/N13-1090/

Spotted an error? Une erreur ?

Language, content, a broken link: e-mail me what you saw and I will fix it. Langue, contenu, lien brisé : écrivez-moi ce que vous avez vu et je corrige.

ayla.rigouts.terryn@umontreal.ca

Please mention the page: Mentionnez la page :