Skip to content

word2vec

A fast, shallow neural method from Google that learns a vector for every word from which words appear near it, famous for 'king − man + woman ≈ queen'.

Also skip-gram · CBOW · continuous bag of words · GloVe · king - man + woman

Fig. / How it works
MANWOMANKINGQUEENSAME OFFSETKING − MAN + WOMAN ≈ QUEEN
Role · kind
Models and algorithmsModel
Level
Intermediate

Mikolov, Chen, Corrado and Dean, Google, 2013

You can guess what a word means from the company it keeps. word2vec reads billions of sentences and gives each word a list of numbers, so words used in similar places get similar numbers.

Where it fits

+All relationships as a list

See it on the full map

How it works

“You shall know a word by the company it keeps.” In 2013, a team at Google turned that old linguistic idea into a fast neural method: word2vec.

Two variants:

  • CBOW (continuous bag of words): guess a missing word from its neighbors.
  • Skip-gram: given a word, guess its neighbors.

Neither task matters in itself. The point is the by-product: to do it well, the model learns a vector (an embedding) for every word, and words used in similar contexts end up close together. The paper reported learning high-quality vectors from 1.6 billion words in less than a day.

The vectors also showed striking structure. Directions in the space encode relationships, so

king⃗−man⃗+woman⃗≈queen⃗.\vec{\text{king}} - \vec{\text{man}} + \vec{\text{woman}} \approx \vec{\text{queen}}.

The same arithmetic exposed a problem: vectors learned from text absorb its stereotypes, for example linking “programmer” with men. See bias and fairness.

word2vec gives each word a single vector no matter the sentence. Contextual models like BERT and GPT compute a different vector for each occurrence, which is why they replaced static word vectors. The core idea, learning meaning from context with self-supervision, runs straight through to today’s LLMs.

Everyday use cases

  • Case 01

    Search and recommendations

    Matching "sneakers" to "running shoes" because their vectors are close.

  • Case 02

    Features for NLP models

    Through the mid-2010s, pretrained word vectors were the standard input for text classifiers.

Strengths, weaknesses and when to use it

Strengths

  • Very fast to train; simple vectors that capture surprising semantic structure.

Weaknesses

  • One vector per word, so "bank" (river) and "bank" (money) are mixed together.
  • Inherits social biases from text, such as gender stereotypes in occupations.

When to use itHistorical milestone and lightweight baseline; modern systems use contextual embeddings from Transformers.

Compare with

Check yourself

  1. Q01

    What does skip-gram predict?

    Show answer

    A: The surrounding words from a given word

  2. Q02

    What is the main limitation of word2vec vectors?

    Show answer

    A: Each word has one vector regardless of context

Go deeper