- Introduced by
- Mikolov, T., Chen, K., Corrado, G., & Dean, J.
- Year
- 2013
- Type
- Self-supervised neural word embedding
- Family
- Deep learning / NLP / CV
What does it do?
Word2Vec is a shallow neural network model introduced by Mikolov et al. (2013) that learns dense vector representations of words from large unlabeled text corpora using self-supervised objectives.
By training a model to predict surrounding context words (Skip-gram) or a target word from its context (CBOW), it captures rich semantic and syntactic regularities in continuous vector space without any manual annotation.
The intuition behind the method
The key insight of Word2Vec is that words appearing in similar contexts tend to have similar meanings, which is the distributional hypothesis. Rather than labeling data manually, the model creates its own supervision signal: it treats neighboring words in a sentence as positive examples and random words as negatives. The network learns embeddings such that semantically related words lie close together in vector space, which allows arithmetic-style relations such as king - man + woman ≈ queen. Because the supervision comes from the text itself, the method can learn from large text collections without human annotation cost.
History
Word2Vec was introduced by Tomas Mikolov and colleagues in 2013 (Mikolov et al., 2013). Its efficiency and the usefulness of its embeddings led to wide adoption in NLP and to much subsequent research on learned word representations. Because its training labels are derived from the text itself, it is an example of the self-supervised paradigm.
When to use it
Use Self-supervised Word2Vec when you need pre-trained dense word features for downstream NLP tasks and have access to a reasonably large text corpus, but lack labeled data. It is ideal for sentiment analysis, information retrieval, and similarity-based tasks on domain-specific corpora where general embeddings may not transfer well. Do not use it when you need contextual embeddings that vary by sentence position (use BERT or similar); when your corpus is very small (fewer than a few million tokens, embeddings will be noisy); or when subword morphology matters (prefer FastText instead).
Limitations and considerations
- Produces static, context-independent embeddings: one vector per word regardless of polysemy or context.
- Requires a large corpus to learn reliable embeddings; small corpora yield noisy or degenerate vectors.
- Out-of-vocabulary words receive no embedding without post-hoc workarounds.
- Superseded by contextual models (BERT, GPT) on most NLP benchmarks, making it a less competitive baseline.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Learns dense word vectors from raw text with no manual labelling; the corpus supplies its own training signal.
- Negative sampling avoids computing a full softmax over the vocabulary, which keeps training on large unlabelled corpora practical.
- The learned space supports vector arithmetic that reflects some semantic and syntactic regularities, as in the analogy example in the introduction.
- Transferable: embeddings trained on a large corpus can be reused as input features for many downstream NLP tasks.
- Supported by open-source implementations, such as the Gensim library and the original word2vec tool, which makes the method straightforward to reproduce.
Applications
- Learning domain-specific word representations from medical, legal, or scientific corpora.
- Feature extraction for text classification, sentiment analysis, and named entity recognition.
- Semantic similarity and document retrieval in information systems.
- Analogy completion and lexical knowledge discovery from large corpora.
- Initialization of embedding layers in larger neural network architectures.
- Bias detection and debiasing research in NLP fairness studies.
How it works
How it works
A large raw text corpus is tokenized and preprocessed. Frequent words may be subsampled to reduce their dominance: each occurrence is discarded with a probability that increases with the word's frequency, controlled by a threshold parameter, so that very common function words contribute less to training. Very rare words can be removed with a minimum-count parameter. The vocabulary is built from the unique tokens that remain, and each token is assigned an initial low-dimensional dense vector, which is random at the start of training.
A sliding context window of fixed size (typically 2–10 words) moves over the corpus. In Skip-gram, the center word is the input and the surrounding words are the prediction targets. In CBOW, the surrounding context words are averaged as input to predict the center word. The window defines which word pairs form the self-supervised training signal.
The training objective is the negative average log-probability of the context words given the center word (Skip-gram), or of the center word given its context (CBOW), taken over all positions in the corpus. This negative average is the loss that is minimised in the formula, which is equivalent to maximising the average log-probability. No human labels are needed, because the word order in the text supplies the targets. This is the defining self-supervised aspect of the method.
Formula
J = -\frac{1}{T}\sum_{t=1}^{T}\sum_{-c \le j \le c, j \ne 0} \log p(w_{t+j} | w_t)Computing the full softmax over a large vocabulary is expensive. Negative sampling approximates the objective by scoring each observed center-context pair against k words drawn at random from a noise distribution P_n(w); the expression given is the quantity maximised for one such pair. Here k is the number of negative samples per positive pair, a tunable setting that is best checked against the downstream task. The noise distribution is a smoothed distribution derived from word frequencies, so frequent words are drawn as negatives more often than rare words, though not in direct proportion to their raw counts. This reduces the cost of each training step while keeping the learned embeddings useful.
Formula
\log \sigma(v_{w_O}^\top v_{w_I}) + \sum_{i=1}^{k} \mathbb{E}_{w_i \sim P_n(w)}[\log \sigma(-v_{w_i}^\top v_{w_I})]After training, the weight matrix of the input layer serves as the learned word embedding table, with one dense vector per word. These vectors can be exported and reused as input features in downstream NLP tasks such as sentiment analysis, named entity recognition, or document classification.
Common pitfalls
- Choosing a window size far outside the typical range without a task-specific reason. Small windows tend to emphasise closer, more syntactic relations, while large windows emphasise broader, more topical relations, so the window should be selected for the task and checked on validation data.
- Applying pretrained general-domain embeddings to highly specialized domains (e.g., clinical notes) without fine-tuning or domain-specific retraining.
- Treating cosine similarity between embeddings as ground-truth semantic similarity without task-specific validation.
- Ignoring subsampling of frequent stop words, which can dominate the context window and dilute meaningful signal.
- Evaluating only on word similarity benchmarks and ignoring downstream task performance.
Frequently asked questions
What makes Word2Vec 'self-supervised'?
The model generates its own training labels directly from the structure of text: for each word, its neighbors in the context window serve as positive supervision and randomly sampled words serve as negatives. No human annotation is needed, placing it within the self-supervised learning paradigm.
Skip-gram or CBOW — which should I choose?
Skip-gram generally produces better embeddings for rare words and works well on smaller corpora because it generates more training examples per word. CBOW trains faster and often performs better on frequent words, making it preferable when training on very large corpora and speed is a priority.
Is Word2Vec obsolete now that BERT exists?
For many production NLP tasks, contextual models (BERT, RoBERTa) outperform Word2Vec. However, Word2Vec remains useful for domain-specific corpora with limited compute, for interpretability studies, and as a fast baseline. Its ideas have also been extended to graph embeddings, as in DeepWalk and node2vec.
How large does my corpus need to be?
As a rough guide, at least several million tokens are needed to obtain coherent embeddings. A few hundred million tokens will yield high-quality general embeddings. Very small corpora (tens of thousands of words) will produce noisy vectors that may harm downstream task performance.
How do I choose the embedding dimension?
Common starting points are 100, 200, or 300 dimensions. Larger dimensions can capture more information but require more data and memory, and whether they help depends on corpus size and the downstream task. The dimension is therefore a tunable setting, best checked by validating on the downstream task.
Related methods
Sources
Mikolov, T., Chen, K., Corrado, G., & Dean, J. (2013). Efficient estimation of word representations in vector space. In Proceedings of the International Conference on Learning Representations (ICLR 2013).
Open publication referenceMikolov, T., Sutskever, I., Chen, K., Corrado, G., & Dean, J. (2013). Distributed representations of words and phrases and their compositionality. In Advances in Neural Information Processing Systems (NeurIPS 2013), 26.
Open publication reference