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.
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.
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.
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).
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).
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.
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.
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.
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).
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).
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/