Language Models Intermediate

Word2Vec

Learning a word from its neighbors and giving it coordinates

Key points
  • Word2Vec is a method that turns each individual word into numeric coordinates.
  • Nobody writes down the meaning by hand. It learns only from which neighbors a word shows up with.
  • Words that keep similar neighbors end up with coordinates that sit close together.
  • Relationships sometimes show up as a direction between coordinates — the direction from a country to its capital turns out similar across many countries.
  • Each word gets exactly one set of coordinates, so a word with several meanings gets smeared into one spot. Today's models fixed that.
Contents

1The analogy

Watch enough baseball and you can guess a batting position's role without knowing the player's name. The hitter who bats between the first and third slots does different work than the one who follows the cleanup hitter. Stack up lineup cards from many games, and players who consistently keep similar neighbors ahead and behind start standing out. Swap two such players' spots and the lineup barely looks off.

Word2Vec learns words the same way. Instead of pulling a definition from a dictionary, it gathers an enormous number of examples of which neighbors a word showed up with in a sentence. Words with similar neighbors on either side can swap places without making the sentence sound strange, and words like that end up placed close together.

Here, "placed" means literal coordinates. Every word gets its own set of numbers, and those numbers fix its position.

2In detail

It learns from neighbors, not definitions

The training method is surprisingly simple. Cover up one word in a sentence and have the system guess what showed up in the few slots around it. There's also a reverse version: hand over the neighbors and have it guess the word in the middle. A correct guess leaves the coordinates untouched; a wrong one nudges them slightly.

Repeat this over hundreds of millions of sentences, and words that kept turning up in similar spots drift together on their own. "Coffee" and "tea" share neighbors like drink, cup, and hot, so they move closer together; "coffee" and "bolt" almost never share a context, so they drift apart.

Nobody ever defined a meaning by hand. Something close to meaning falls out purely from a record of what showed up together. The idea itself is old in linguistics — Word2Vec's contribution was making it cheap to compute.

Words become numeric coordinates

Once training finishes, each word is left with its own set of numbers — usually a few dozen to a few hundred of them. Those numbers point to a location inside a very wide space.

We can only see two or three directions at once, but the actual space spreads across far more. One direction might carry something related to cooking, another might split hard from soft. Nobody decided what each direction means, though, so none of them can be labeled.

Once words are converted this way, how alike two words are can be measured as a distance. That's the starting point for finding a document that uses different wording in search, or grouping similar items in a recommendation.

Relationships show up as direction between coordinates

Word2Vec became famous because the shape its coordinates settled into turned out to be surprisingly regular. The direction from a country to its capital came out nearly the same for country after country. A similar pattern showed up between a word's singular and plural, or its present and past tense.

That means adding and subtracting coordinates can carry a relationship across. Take the direction from one country to its capital and apply it to a different country's spot, and you land near that country's capital.

The pattern doesn't always hold. Some relationships work beautifully; others land somewhere odd. Still, the fact that this kind of structure emerged without anyone hard-coding a rule was a genuine surprise at the time.

The limit of one spot per word

Word2Vec's biggest weakness is that each word gets exactly one set of coordinates. The "bank" in "river bank" and the "bank" in "savings bank" share the same spot. It ends up sitting halfway between two meanings, fitting neither sentence well.

It barely captures word order within a sentence either — it only looks at which words were inside the window, largely ignoring whether a word came before or after. It also carries over whatever bias sat in the training data; a direction linking certain jobs to certain genders is a well-known example.

Today's language models moved past this limit. Instead of a fixed spot per word, the same word gets different coordinates depending on the sentence it's in. Word2Vec sits at the starting point of that path — the idea of handling words as numbers at all spread widely from here.

3More precisely

Word2Vec is a training method released around 2013, with two variants: guessing the neighbors from the middle word, and guessing the middle word from the neighbors. It runs on a very shallow neural network with a single layer, and after training, what gets kept isn't the network itself but the per-word numbers built up inside it. Because that network is so shallow, training runs cheaply even on huge amounts of text, which is a big part of why the method spread so quickly once it was published.

The analogy has a limit. A baseball lineup has only nine slots and a manager who fills it on purpose, while a word's coordinates sit in a space spread across hundreds of directions that nobody assigned. A lineup's neighbors also come in a fixed order, while the neighbors Word2Vec looks at just need to fall within a few slots either way — order barely matters. "Close" means something slightly different too: in practice it's usually measured as how similar two directions from the origin are, not distance as we normally picture it. Change the training text and the whole layout shifts, so coordinates built from different sources can't be mixed together either.

4Try it yourself

5Common misconceptions

  • It's easy to think Word2Vec knows what a word means, but actually it only gathers statistics about which neighbors showed up together and sets a position from that.

  • It's easy to assume closeness means similar meaning, but actually opposites often share similar neighbors too, so they frequently end up placed close together.

  • It's easy to think today's chatbots still handle words this way, but actually they've moved to giving the same word different coordinates depending on the sentence.

7One-line summary

In shortWord2Vec learns a word from its neighbors and seats it at a coordinate, and it's the starting point for today's approach of handling words as numbers.

Spotted an error or have a better analogy? Suggest an edit · Last updated2026-09-02