Tech●●●●●Difficulty 4 of 5

How can a computer do arithmetic with the meaning of words?

Subtract "man" from "brother", add "woman", and a 2013 Google algorithm lands on "sister". It never read a dictionary.

▶ Start the story

A computer can do arithmetic with meaning thanks to word embeddings. Each word becomes a long list of numbers, called a vector. The vectors are arranged so that words with similar meanings sit close together. Subtract one word's vector from another, add a third, and you land near a fourth word that makes the same kind of sense to a human.

The idea goes back to 1957. The English linguist John Rupert Firth proposed that a word is characterized by the company it keeps: words used in the same contexts tend to mean similar things. In 2013, a team at Google turned that idea into numbers with Word2vec, a small neural network trained on huge amounts of text. It gives every word a vector, usually a few hundred numbers long, based only on the words that tend to surround it.

Vector arithmetic on words
  1. Step 1: Start with 'Brother'

    A vector of a few hundred numbers

  2. Step 2: Subtract 'Man'

    Remove the 'male' direction

  3. Step 3: Add 'Woman'

    Add the 'female' direction

  4. Step 4: Land near 'Sister'

    The closest word in the whole vocabulary

What made Word2vec famous was that its vectors captured relationships, not just similarity. Take the vector for "Brother", subtract "Man", add "Woman", and the result is closest to "Sister". The same arithmetic works for countries and their capitals, and even for verb tenses. Nobody told the model what a sister or a capital city is. It learned the pattern from raw text.

That sensitivity to the company words keep has a dark side. In 2016, researchers showed that a popular word2vec model trained on Google News text produced the analogy "man is to computer programmer as woman is to homemaker". It had absorbed gender stereotypes from the articles it learned from. Later research found that using such embeddings without careful oversight can carry society's biases into the systems built on them, and can even amplify them.

Quiz me

0/3

  1. 1.What 1957 idea by linguist John Rupert Firth underlies word embeddings?
  2. 2.What did Mikolov and colleagues demonstrate with Word2vec's vector arithmetic?
  3. 3.What did the 2016 study on a popular Google News word2vec model reveal?

Recap

A model that learns meaning purely from which words appear near which other words will learn a culture's patterns exactly as written, biases included.

Surprising fact · Word2vec's own vector arithmetic reproduces real analogies like brother-to-sister, but a widely used version trained on news text also reproduced the stereotype that a woman's equivalent of 'computer programmer' is 'homemaker'.

Sources (4)

No source, no claim. Every fact in this lesson (10 claims) cites at least one of these.

  1. [1]Word embedding · Wikipedia
  2. [2]Distributional semantics · Wikipedia
  3. [3]Word2vec · Wikipedia
  4. [4]John Rupert Firth · Wikipedia
More lessons in 💻 Tech (3) See all tech lessons →

One more light on your map.

Get one lesson like this every day, about the things you love. Free, in two or five minutes.

Get the share card for this lesson ↗