# Efficient Estimation of Word Representations in Vector Space

Tomas Mikolov, Kai Chen, Greg Corrado, Jeffrey Dean · arXiv · 2013-1-16

- **Problem** Learning useful word vectors from billions of words is too costly for the neural language models of the time.
- **Method** Two log-linear models, CBOW and Skip-gram, drop the hidden layer and use a Huffman-tree hierarchical softmax, so training can scale to much larger corpora.
- **Results** Skip-gram with 300-dimensional vectors trained on 783M words reached 53.3 total accuracy on the word relationship test set, with full vocabularies and one CPU.

## Why word vectors must scale

Many NLP systems still treat each word as an index in a vocabulary, so the system has no built-in sense that two words are related. Simple count-based models remain hard to beat mainly because they can be trained on enormous amounts of text, with N-gram models trained on trillions of words as the example. Simple scaling stops helping in some tasks.

Speech recognition depends on the amount of high-quality transcribed speech, which is often only millions of words, and machine translation corpora for many languages are small, so better techniques are needed rather than more of the same. Larger models trained on more data have become practical, and distributed word representations are the most successful concept among them.

Neural network language models clearly outperform N-gram models, which makes the cost of training them the practical question.

The stated goal is to learn high-quality word vectors from data sets with billions of words and vocabularies of millions of words. Earlier architectures had not been trained successfully on more than a few hundred million words at dimensionalities of about 50 to 100. The vectors are also expected to capture more than similarity. Words may carry several degrees of similarity, and a word offset operation can recover analogies: vector(King) minus vector(Man) plus vector(Woman) lands closest to vector(Queen).

The authors therefore aim to maximize the accuracy of these vector operations by designing architectures that keep linear regularities among words, and they build a test set that covers both syntactic and semantic regularities.

## Where the training cost sits

Training cost is measured by the number of parameters that must be accessed to train a model fully. For all models considered, the training complexity is \\\[ O = E \\times T \\times Q \\\] where E is the number of epochs, T is the number of words in the training set and Q is the per-example cost that depends on the architecture. In the feedforward NNLM, N previous words are encoded as one-of-V vectors and projected into a layer of dimensionality N × D through a shared matrix.

Its per-example cost is \\\[ Q = N \\times D + N \\times D \\times H + H \\times V \\\] where H is the hidden layer size and V the vocabulary size. The projection step is cheap, because only N inputs are active at a time. The term H × V, produced by the softmax over the vocabulary, and the N × D × H term, produced by the link from the dense projection to the hidden layer, carry most of the cost.

The recurrent model drops the projection layer and costs Q = H × H + H × V per example. Once the output is made hierarchical, H × V reduces to H × log2(V), so most of its cost sits in H × H.

## Huffman tree hierarchical softmax

The hierarchical softmax replaces the full softmax over V words with a binary tree, so a word needs only about log2(V) output units evaluated instead of V. The authors organize the vocabulary as a Huffman binary tree. A Huffman tree gives short binary codes to frequent words, so the number of output evaluations depends on the unigram perplexity of the vocabulary rather than on log2(V) alone.

For a vocabulary of one million words, the authors report about two times speedup in evaluation. The authors note that this speedup is not decisive for neural network LMs, whose bottleneck remains the N × D × H term. It matters more for the new architectures, which have no hidden layer and depend heavily on the efficiency of the softmax normalization.

## CBOW and Skip-gram

Both models remove the nonlinear hidden layer of the feedforward NNLM, which the authors identify as the main source of cost. What remains is a log-linear classifier on top of a projection layer, which is simpler but may represent the data less precisely. CBOW shares one projection for all word positions, so the context words are averaged and the order of the history does not matter.

It uses four future and four history words and predicts the middle word, with training cost Q = N × D + D × log2(V).

Skip-gram reverses the direction of prediction: each current word is the input to a log-linear classifier, and the model predicts words within a range before and after it. Distant words get less weight because they are sampled less often in the training examples. For each training word, a number R is drawn randomly from the range 1 to C, and R words from the history and R words from the future are used as correct labels, which gives R × 2 classifications per word.

The training cost is \\\[ Q = C \\times (D + D \\times \\log\_2(V)) \\\] and the authors use C = 10 in the experiments.

Figure 1 shows the two data flows. CBOW gathers the context words into a summed projection before the output, while Skip-gram takes one input word and predicts the words around it.

## Training setup

The models are trained with stochastic gradient descent and backpropagation. For the experiments in Tables 2 and 4 the authors used three training epochs, a starting learning rate of 0.025 and a learning rate decreased linearly so that it reaches zero at the end of the last epoch. Later experiments use a single epoch, with the learning rate again decreased linearly to zero at the end of training.

For large data sets the models run in DistBelief, where several replicas of a model run in parallel and synchronize gradient updates through a centralized server that holds the parameters. The updates use mini-batch asynchronous gradient descent with the Adagrad adaptive learning rate. The Google News runs use 50 to 100 model replicas.

## Measuring offset answers

The Semantic-Syntactic Word Relationship test set has five semantic and nine syntactic question types, with 8869 semantic and 10675 syntactic questions. Questions were built by first writing lists of similar word pairs by hand and then combining two pairs with the same relationship. Only single-token words appear, so multi-word entities such as New York are absent.

An answer is found by computing the vector X = vector(biggest) minus vector(big) plus vector(small), as the formula \\\[ X = \\mathrm{vector}(\\mathrm{biggest}) - \\mathrm{vector}(\\mathrm{big}) + \\mathrm{vector}(\\mathrm{small}) \\\] and then returning the vocabulary word closest to X by cosine distance, with the question words excluded from the search.

A question is correct only when that nearest word is exactly the expected word, so synonyms count as mistakes. The authors expect 100% accuracy to be out of reach because the models have no word-morphology input.

## Dimensionality and data trade-off

Before the full runs, the authors trained CBOW on subsets of the training data with the vocabulary restricted to the most frequent 30k words, and scored only questions whose words fall in that vocabulary. Accuracy rises with both vector dimensionality and training words, but the gains flatten after a point. At 783M training words, 50-dimensional vectors reach 23.2 and 600-dimensional vectors reach 50.4.

Given the cost formula, doubling the training data adds about as much computation as doubling the vector size. The authors therefore grow both dimensionality and data together rather than one of them alone.

## Architecture comparison on shared data

All architectures are trained on the same LDC corpora of 320M words with an 82K vocabulary, using 640-dimensional word vectors. The RNNLM was a previously trained model that took about 8 weeks on a single CPU, and the feedforward NNLM uses 640 hidden units and a history of 8 previous words. Table 3 reports semantic and syntactic accuracy on the word relationship test set.

RNNLM reaches 9 and 36, NNLM 23 and 53, CBOW 24 and 64, and Skip-gram 55 and 59.

Skip-gram gives the best semantic result, while CBOW gives the best syntactic result and beats the NNLM on syntax, with about the same semantic accuracy. Skip-gram is slightly behind CBOW on syntax but still ahead of the NNLM. The authors attribute the NNLM vectors' advantage over the RNN vectors to the RNNLM word vectors being directly connected to a nonlinear hidden layer.

## Comparison with public vectors and training length

Table 4 compares models trained with one CPU against publicly available vectors on full vocabularies. The 300-dimensional Skip-gram trained on 783M words reaches a total accuracy of 53.3, against 24.6 for the 640-dimensional RNNLM from the Mikolov row, which was trained on 320M words. The comparison mixes training corpora and systems, so the rows are reference points rather than a controlled experiment.

Table 5 compares three epochs with one epoch on the same data. CBOW with 300 dimensions trained for three epochs on 783M words takes 1 day and reaches a total accuracy of 36.1. Skip-gram with 300 dimensions on 783M words drops from 53.3 total with three epochs to 49.2 total with one epoch, and one epoch on 1.6B words gives 53.8 total in 2 days.

## Large-scale DistBelief runs

On the Google News 6B data set, the 1000-dimensional CBOW reaches a total accuracy of 63.7, and the 1000-dimensional Skip-gram reaches 65.6. The training times are 2 x 140 and 2.5 x 125, in days times CPU cores. The NNLM with 100 dimensions reaches a total accuracy of 50.8 at 14 x 180 in the same units.

## Sentence completion with Skip-gram

The challenge has 1040 sentences, each with one missing word and five candidate choices. The model is a 640-dimensional Skip-gram trained on 50M words. Each sentence is scored by placing the unknown word at the input and predicting the surrounding words; the sentence score is the sum of these predictions, and the highest-scoring candidate is chosen.

Skip-gram alone reaches 48.0, which is below the average LSA similarity of 49 reported in earlier work. Its scores are complementary to those of RNNLMs, and a weighted combination reaches 58.9% accuracy, with 59.2% on the development part and 58.7% on the test part. The authors describe the combined result as a new state-of-the-art result on this benchmark, which previously stood at 55.4% for a combination of recurrent networks.

## Examples and extensions of the offset idea

Table 8 uses the best Skip-gram vectors, trained on 783M words with 300 dimensions, to show word pair relationships. The example Paris minus France plus Italy returns Rome. Several rows show different relations, such as Microsoft minus Windows giving Linux-like pairs and Japan minus sushi giving pizza-like pairs, which the authors use as illustrations rather than as a scored benchmark.

The vector operations are also applied to selecting out-of-list words, by averaging a list of words and finding the most distant vector. The authors report good accuracy on this task without giving a figure.

## Limitations

Exact-match scoring counts synonyms as errors, and the models have no input information about word morphology, so the authors expect 100% accuracy to be impossible. They suggest that structure within words could improve the syntactic questions. The vector-offset questions cover only single-token words, so multi-word entities are not tested.

The authors expect larger training sets and higher-dimensional vectors to improve accuracy. This is a belief in the paper, and the runs above do not establish it beyond the sizes they tried. The claim that CBOW and Skip-gram could be trained on corpora with one trillion words is stated as a possibility under the DistBelief framework, not as a measured result.

On sentence completion, Skip-gram alone does not beat the LSA similarity baseline, and its advantage depends on the combination with RNNLMs.

## Paper info

- **Authors**: Tomas Mikolov, Kai Chen, Greg Corrado, Jeffrey Dean
- **Venue**: arXiv · Preprint
- **First published**: 2013-1-16
- **Added**: 2026-10-20
- **Updated**: 2013-9-7
- **Version**: v3
- **arXiv**: 1301.3781
- **Category**: cs.CL
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1301.3781v3) · [PDF ↗](https://arxiv.org/pdf/1301.3781v3)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Tomas Mikolov, Kai Chen, Greg Corrado, Jeffrey Dean (2013). Efficient Estimation of Word Representations in Vector Space. arXiv:1301.3781v3. https://arxiv.org/abs/1301.3781v3

**BibTeX**

```
@misc{mikolov2013efficient,
  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},
  url = {https://arxiv.org/abs/1301.3781v3}
}
```

## Other paper commentary

- [Deep contextualized word representations](https://refivu.com/en/papers/13952ebe-dec9-4497-bba2-03f142631507-deep-contextualized-word-representations.md)
- [XLNet: Generalized Autoregressive Pretraining for Language Understanding](https://refivu.com/en/papers/b3e5ce04-f8db-4e06-9f54-1aba7291fad5-xlnet-generalized-autoregressive-pretraining-for-language.md)
- [Distributed Representations of Words and Phrases and their Compositionality](https://refivu.com/en/papers/3b76539e-2654-42d7-9073-06bc84af912a-distributed-representations-of-words-and-phrases-and-their.md)
- [Neural Machine Translation by Jointly Learning to Align and Translate](https://refivu.com/en/papers/d3733cd4-18bb-4ef7-881b-d6d27baee015-neural-machine-translation-by-jointly-learning-to-align.md)
- [BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding](https://refivu.com/en/papers/037751cf-a504-48c3-b08a-868e3ab40b26-bert-pre-training-of-deep-bidirectional-transformers-for.md)
- [Looped Models are Fast Multi-Token Predictors](https://refivu.com/en/papers/753aee4a-f281-45ed-9e03-84eb93c47b6d-looped-models-are-fast-multi-token-predictors.md)
- [Sequence to Sequence Learning with Neural Networks](https://refivu.com/en/papers/2ac7aa06-39ab-48fb-868d-81dbac5767e6-sequence-to-sequence-learning-with-neural-networks.md)
- [Proximal Policy Optimization Algorithms](https://refivu.com/en/papers/831b67ec-e2f9-4c8f-914d-dc9387e23e27-proximal-policy-optimization-algorithms.md)
- [An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale](https://refivu.com/en/papers/8a112940-90e3-4c6b-8fa0-d576b3ebd5d1-an-image-is-worth-16x16-words-transformers-for.md)
- [RoBERTa: A Robustly Optimized BERT Pretraining Approach](https://refivu.com/en/papers/3dc17b50-5c0f-4503-a368-4b0d9e86745c-roberta-a-robustly-optimized-bert-pretraining-approach.md)
- [Auto-Encoding Variational Bayes](https://refivu.com/en/papers/90411040-94ff-4aca-9d04-a1a99cad3eb4-auto-encoding-variational-bayes.md)

## Terms in this paper

- [Accuracy](https://refivu.com/en/terms/1995c0cd6282-accuracy)
- [Stochastic Gradient Descent](https://refivu.com/en/terms/a49650824022-stochastic-gradient-descent)
- [Adagrad](https://refivu.com/en/terms/d6141e5e2b98-adagrad)
- [CBOW](https://refivu.com/en/terms/be0f50b387e8-cbow)
- [hierarchical softmax](https://refivu.com/en/terms/3cdc16770ffd-hierarchical-softmax)
- [cosine distance](https://refivu.com/en/terms/e6f2fa77e243-cosine-distance)
- [Latent Semantic Analysis](https://refivu.com/en/terms/ec75a360b680-latent-semantic-analysis)
- [computational complexity](https://refivu.com/en/terms/e97a1b3cba75-computational-complexity)
- [Google News corpus](https://refivu.com/en/terms/5c484f35683a-google-news-corpus)
- [Skip-gram](https://refivu.com/en/terms/e835a0cf8e3d-skip-gram)
- [RNNLM](https://refivu.com/en/terms/4f5bd1bc0dee-rnnlm)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/d295cb4b-dace-4ef1-9199-b860d9b1f123-efficient-estimation-of-word-representations-in-vector-space)
