All models

Word2Vec-SkipGram

Skip-gram word2vec: learn a vector per word by predicting the words around it, with full softmax or negative sampling.

Language · 3 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (6 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Family
word2vec
Parameters
14.3M
Operations
3
Framework
PyTorch
Recurrent
No
Published
2013
Cited by
43,704 (as of 17 November 2026)
Authors
Tomas Mikolov, Kai Chen, Greg Corrado, Jeffrey Dean
License
Apache-2.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m3416
Graph hash
8e5749fa9e5ab1e487247214dc7c609a2e51d5eb84e3b88a39fb13101d695634
Skeleton hash
1e54144c6d15cd044273a6b2a4c3c772112d222498a9807abdacb77fe6684873
Architecture hash
6208f0c2f3bebef6989078a077d41e530192eb11ba2596a23aa2d322db7c1045
Diagram SHA-256
b0168e0f4fd61fe380cec973f9ac7706a2a0ce50ecd79a10a1fd71b8ded30468
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

About this model's family

word2vec is a tool for computing distributed representations of words: given a text corpus, it learns a vector for every word in the vocabulary using the Continuous Bag-of-Words or the Skip-Gram neural network architectures. The paper that introduced it proposed two novel model architectures for computing continuous vector representations of words from very large data sets, and reported large improvements in accuracy at much lower computational cost, taking less than a day to learn high quality word vectors from a 1.6 billion words data set.

The two captured members are both Skip-gram models, whose training objective is to find word representations that are useful for predicting the surrounding words in a sentence or a document. Unlike most of the earlier neural network architectures for learning word vectors, training of the Skip-gram model does not involve dense matrix multiplications, which makes it extremely efficient. The basic formulation defines the probability of an output word with a softmax over the whole vocabulary, which is impractical because the cost of the gradient is proportional to W, the number of words in the vocabulary.

The second member uses the follow-up paper's Negative sampling, a simple alternative to the hierarchical softmax, where the task becomes distinguishing the target word from draws from a noise distribution using logistic regression, with k negative samples for each data sample. The authors found that values of k in the range 5 to 20 are useful for small training datasets, while for large datasets k can be as small as 2 to 5, and that a unigram distribution raised to the 3/4 power as the noise distribution outperformed significantly the unigram and the uniform distributions. The learned vectors explicitly encode many linguistic regularities: the result of vec(Madrid) - vec(Spain) + vec(France) is closer to vec(Paris) than to any other word vector.

Key idea. word2vec made high quality word vectors cheap to learn with a Skip-gram model whose training does not involve dense matrix multiplications.

  • word2vec
  • Skip-gram
  • SGNS
  • negative sampling
  • CBOW
  • Continuous Bag-of-Words
  • word embeddings
  • word vectors
  • Mikolov
  • distributed representations
  • hierarchical softmax
  • Efficient Estimation of Word Representations in Vector Space

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{mikolov2013efficientestimationwordrepresentations,
      title={Efficient Estimation of Word Representations in Vector Space}, 
      author={Tomas Mikolov and Kai Chen and Greg Corrado and Jeffrey Dean},
      year={2013},
      eprint={1301.3781},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/1301.3781}, 
}