How do you show that skip-gram with negative sampling, with negatives per positive pair, has an optimum at for each (word, context) pair, so it implicitly factorises a shifted PMI matrix (Levy and Goldberg). What assumptions do you need?
Sequence models and transformers, Word embeddings
Level L4 Advanced. Length Long. Nature Mat Mathematical.
What's being asked
Whether you can write the expected objective per pair as a function of the score and solve for its stationary point.
Key idea
The per-pair objective is with . Setting gives .
Steps
- Let be the count of the pair in the corpus, and the word and context counts, the total number of pairs. Negatives for are drawn from the unigram distribution .
- The global objective is : each observed pair is a positive, and each occurrence of draws negatives.
- Assume the vectors have enough freedom (large dimension) that each score can be set independently. Then maximise each term separately in .
- Let and . Then and , using .
- Set : , so . Thus .
- Since , the optimum is .
- Interpretation: the matrix approximates the shifted PMI matrix. Pairs never seen have , so in practice a low-rank constraint and finite training stop this. Positive PMI (clip at ) is also used.
Common mistakes
- Forgetting that negatives are sampled in proportion to times , which gives the term.
- Ignoring the assumption of enough dimensions; with small the matrix is only approximated.
- Writing the shift as .
How long your answer should be
One page; 8–10 minutes.
Last checked on 4 December 2026.
Read this
Previous in Sequence models and transformers: What is an induction head, and how can a two-layer attention-only transformer use a pair of heads to complete a pattern such as ? What evidence ties induction heads to in-context learning?
Next in Sequence models and transformers: Assume the loss follows and training compute is . Derive the compute-optimal and and their scaling exponents. What do and imply?