Command Palette
Search for a command to run...
Estimation efficace des représentations de mots dans l'espace vectoriel
Estimation efficace des représentations de mots dans l'espace vectoriel
Tomas Mikolov Greg Corrado Kai Chen Jeffrey Dean
Résumé
Nous proposons deux nouvelles architectures de modèles pour calculer des représentations vectorielles continues de mots à partir de très grands ensembles de données. La qualité de ces représentations est mesurée dans une tâche de similarité de mots, et les résultats sont comparés aux meilleures techniques précédentes basées sur différents types de réseaux de neurones. Nous observons de grandes améliorations de la précision pour un coût de calcul bien moindre, c'est-à-dire qu'il faut moins d'une journée pour apprendre des vecteurs de mots de haute qualité à partir d'un ensemble de données de 1,6 milliard de mots. De plus, nous montrons que ces vecteurs offrent des performances de pointe sur notre ensemble de test pour mesurer les similarités syntaxiques et sémantiques des mots.
One-sentence Summary
Two novel model architectures efficiently learn high-quality continuous word representations from massive text corpora, achieving substantial accuracy gains and state-of-the-art syntactic and semantic similarity performance while requiring less than one day of computation on a 1.6-billion-word dataset, dramatically reducing cost over prior neural network methods.
Key Contributions
- Two model architectures, the Continuous Bag-of-Words and Skip-gram models, are introduced for learning continuous word vector representations from large-scale data with substantially lower computational cost than previous neural network methods.
- A new comprehensive test set is designed for evaluating both syntactic and semantic word similarities, providing a detailed benchmark for word vector quality.
- These models achieve state-of-the-art performance on the proposed test set, can be trained on a 1.6-billion-word corpus in under a day, and preserve linear regularities that enable accurate analogical reasoning via simple vector arithmetic.
Introduction
Many NLP systems represent words as atomic units, with no notion of similarity between them, a simple and robust approach that works well when massive training data is available. This scaling strategy breaks down, however, in domains with limited in-domain text, such as speech recognition or machine translation for under-resourced languages. Prior work on learning distributed word vectors (word embeddings) had shown promise by capturing semantic and syntactic regularities, but existing architectures were computationally expensive and could not scale beyond a few hundred million words or modest vector dimensionalities. The authors address these limitations by introducing two efficient model architectures, CBOW and Skip-gram, that dramatically reduce training complexity. Their contribution is a method to learn high-quality word vectors from corpora containing billions of words, enabling the training of high-dimensional embeddings that preserve linear relationships such as analogies, and they provide a comprehensive syntactic and semantic test set to evaluate these representations.
Method
The authors focus on distributed representations of words learned by neural networks, aiming to maximize accuracy while minimizing computational complexity. The training complexity for the evaluated models is generally proportional to O=E×T×Q, where E is the number of training epochs, T is the number of words in the training set, and Q is the complexity per training example. All models are trained using stochastic gradient descent and backpropagation.
Initially, the authors evaluate the Feedforward Neural Net Language Model (NNLM) and the Recurrent Neural Net Language Model (RNNLM). The NNLM consists of input, projection, hidden, and output layers. Its complexity is dominated by the term H×V, which can be mitigated using hierarchical softmax with a Huffman binary tree. The RNNLM overcomes the fixed context length limitation of the NNLM by using a recurrent matrix that connects the hidden layer to itself, forming a short term memory. Its complexity is primarily driven by the H×H term. To handle huge datasets, the authors implement these models on the DistBelief distributed framework, utilizing mini batch asynchronous gradient descent with the Adagrad adaptive learning rate procedure across multiple model replicas.
To further minimize computational complexity, the authors propose two new log linear model architectures that remove the non linear hidden layer, allowing for efficient training on much larger datasets.
The first architecture is the Continuous Bag of Words (CBOW) model. Similar to the feedforward NNLM, it removes the non linear hidden layer and shares the projection layer for all words, effectively averaging their vectors into the same position. The order of words in the history does not influence the projection. The model operates as a log linear classifier that uses both past and future context words to predict the current middle word. The training complexity is reduced to Q=N×D+D×log2(V).
The second architecture is the Continuous Skip gram model. Instead of predicting the current word from the context, it uses the current word as input to predict words within a certain range before and after it in the same sentence. The authors found that increasing this range improves the quality of the resulting word vectors but increases computational complexity. To balance this, distant words are sampled less frequently. The training complexity for this architecture is proportional to Q=C×(D+D×log2(V)), where C is the maximum distance of the words.
As shown in the figure below, the two new model architectures are illustrated side by side.
The CBOW architecture on the left predicts the current word w(t) based on the context words w(t−2),w(t−1),w(t+1),w(t+2), which are projected and summed. The Skip gram architecture on the right takes the current word w(t) as input and predicts the surrounding context words. The weight matrix between the input and projection layer is shared for all word positions in both models.
Experiment
The evaluation uses a semantic-syntactic analogy test set and the Microsoft Sentence Completion Challenge to assess word vector quality. Experiments demonstrate that simple vector arithmetic on high-dimensional word embeddings trained on large corpora can capture a variety of linguistic relationships, with the Skip-gram architecture excelling at semantic tasks and CBOW performing better on syntactic ones. Increasing both training data and vector dimensionality is necessary for optimal accuracy, and combining the Skip-gram model with a recurrent neural network language model achieves a new state-of-the-art on the sentence completion benchmark.
A large analogy test set was created to evaluate word vectors, consisting of five semantic relationship types (e.g., capital cities, currencies) and nine syntactic types (e.g., adjective-to-adverb, opposites), with a total of 8869 semantic and 10675 syntactic questions. Each question is formed by connecting two word pairs from manually curated lists, and a correct answer requires an exact word match, making 100% accuracy unlikely due to the absence of morphological information in the models. Semantic questions cover five types such as common capital cities, all capital cities, currencies, city-in-state, and man-woman analogies. Syntactic questions span nine categories including adjective-to-adverb conversion and opposites, totaling 10675 questions.
On a semantic-syntactic test restricted to the top 30k words, accuracy of CBOW word vectors improves as both training data size and vector dimensionality grow. However, increasing only one factor yields diminishing returns, so balanced scaling of data and dimensions is necessary. The strongest result (600 dimensions, 783 million training words) reaches 50.4% accuracy. With only 24 million training words, raising vector dimensionality from 50 to 600 gives a modest accuracy increase from 13.4% to 24.0%. For 600-dimensional vectors, doubling training data from 196M to 391M words adds 5.8 percentage points, but the next doubling to 783M adds only 3.8 points, illustrating diminishing returns.
Skip-gram achieves the highest semantic accuracy, more than doubling the nearest competitor, while CBOW performs best on syntactic accuracy and the MSR Word Relatedness test. The feedforward NNLM substantially improves over the RNNLM, and CBOW surpasses the NNLM on syntactic and relatedness tasks, matching it on semantic accuracy. Skip-gram reaches 55% semantic accuracy, far outpacing other architectures on the Semantic-Syntactic Word Relationship test set. CBOW attains the top syntactic accuracy (64%) and MSR relatedness score (61%), demonstrating strong performance on word similarity and analogy tasks.
Among publicly available word vectors on the Semantic-Syntactic test set, the Collobert-Weston NNLM trained on 660M words reaches the highest total accuracy, while a recurrent architecture (Mikolov RNNLM) gives the strongest syntactic performance. Larger training corpora and higher vector dimensionality tend to improve accuracy, but the type of model has a substantial impact beyond data size alone. The Collobert-Weston NNLM with 50-dimensional vectors and 660M training words obtains the best total accuracy (11.0%) among all publicly available models listed. The Mikolov RNNLM, using 80-dimensional vectors and 320M words, achieves the highest syntactic accuracy (18.4%) and the second-highest total accuracy (12.7%), outperforming all NNLM variants on syntactic relations. Increasing the Mnih NNLM dimensionality from 50 to 100 while keeping 37M training words doubles semantic accuracy and raises syntactic accuracy from 9.1% to 13.2%, but overall performance remains below the RNNLM. Turian's NNLM shows minimal semantic accuracy (1.4%) regardless of whether 50- or 200-dimensional vectors are used, indicating that a larger dimension alone cannot compensate for a small 37M-word training set.
The table evaluates CBOW and Skip-gram word vectors on a semantic-syntactic test set, comparing three-epoch and one-epoch training configurations. Three-epoch Skip-gram attains the highest overall accuracy, driven by a much stronger semantic performance, while CBOW models are more competitive on syntactic tasks. A single training epoch with more data or increased dimensionality can largely match or slightly exceed the accuracy of three epochs on a smaller dataset while cutting training time significantly. Three-epoch Skip-gram achieves 50.0% semantic accuracy, far surpassing the 15.5% of three-epoch CBOW, leading to a 53.3% overall score. One-epoch CBOW on 1.6B words matches the total accuracy of three-epoch CBOW on 783M words (36.1%) in only 0.6 days instead of 1 day.
A large analogy test set covering semantic and syntactic relationships is used to evaluate word vectors, with exact-word matching required. Experiments reveal that Skip-gram excels on semantic tasks while CBOW performs better on syntactic and relatedness tests, and that balanced scaling of data and dimensionality is necessary due to diminishing returns when only one factor is increased. Model architecture strongly affects accuracy beyond corpus size alone, and training for a single epoch on larger data can match multi-epoch training on less data while saving significant time.