Loading slide

Embeddings

  1. 01Embeddings
  2. 02Memory card
  3. 03Hold this one idea
  4. 04A space of meaning
  5. 05Don't panic about hundreds of directions
  6. 06Word2Vec and the arithmetic of meaning
  7. 07Let that land
  8. 08Memory card
  9. 09The same word, different meanings
  10. 10Reinforce your understanding
  11. 11Question: Geometry of meaning
  12. 12Question: What embeddings can't capture
  13. 13Quiz: answer
  14. 14What you now know
  15. 15Meaning became geometry
  16. 16Want to go deeper?
6 / 15
BackNext

Word2Vec and the arithmetic of meaning

In 2013, a team at Google wrote the recipe down and ran it at full scale. They called it Word2Vec, and at its heart is exactly the game from the first chapter: hide a word, guess it from its company, nudge, repeat, across billions of sentences. Out of nothing but that game came a position for every word: the map you just wandered.

Then came the part nobody expected. The space didn't just put similar words near each other. That was the goal. It had also turned relationships into directions.

Remember the square from the first chapter? King and queen on one row, man and woman below, royalty running one way and gender the other? Word2Vec built that square on its own. Take the vector for "king." Subtract "man." Add "woman." The result lands almost exactly on "queen." The step that carries man to woman, the "male to female" direction, is the same step that carries king to queen. Walk it yourself on this slide.

Nobody told the model about royalty or gender. It read text and played the guessing game, and a relationship between words became a piece of geometry you can do arithmetic with.

Did you know?

The same trick captures relationships nobody programmed in. "Paris" minus "France" plus "Italy" lands near "Rome." "Walking" minus "walk" plus "swim" lands near "swimming." The model never learned capitals or grammar as rules. It just arranged words so the patterns of how we use them became consistent directions in space. Whether that counts as "understanding" is a question worth sitting with, and one the course keeps returning to.
Citations(2)↓
  1. 1. arxiv.org
  2. 2. jalammar.github.io
Citations(2)↓
  1. 1. arxiv.org
  2. 2. jalammar.github.io