Word2Vec Cbow Skipgram

NLP interview question · Medium difficulty

How does Word2Vec learn word vectors — what's the difference between CBOW and Skip-gram?medium

Status
✓
Type
conceptual
Topic
word2vec-cbow-skipgram
Frequency
common
Tags
word2vec, CBOW, skip-gram, static-embeddings
Answer

Word2Vec has two training architectures. CBOW (Continuous Bag of Words) predicts the target word from its surrounding context words; Skip-gram does the reverse, predicting the surrounding context words from a single center word. CBOW is faster and works well on frequent words; Skip-gram tends to work better on rare words because each occurrence generates multiple training examples from its context.

Explanation

For the sentence "The cat sits on the mat," CBOW takes the context {The, cat, on, the} and learns to predict the target "sits" — surrounding words → center word. Skip-gram takes the center word "cat" and learns to predict its surrounding context {The, sits, on, mat} — center word → surrounding words. Word2Vec embeddings capture semantic similarity (king close to queen, car close to vehicle) and even analogy-like relations such as king − man + woman ≈ queen, because certain relationships end up encoded as consistent vector directions. The well-known limitation is that Word2Vec is static: each word gets exactly one vector regardless of context, so "bank" gets the identical vector in "I deposited money in the bank" and "I sat near the river bank" — it has no mechanism to disambiguate polysemy, which is exactly the gap that contextual embedding methods like ELMo and later Transformer-based models closed.

Follow-upWhy does Skip-gram tend to outperform CBOW specifically on rare words?
Follow-upWhy can't Word2Vec give 'bank' two different vectors for its two meanings?
Follow-upHow does the king - man + woman ≈ queen analogy actually emerge from training, given nobody labels gender relationships?