Command Palette
Search for a command to run...
GloVe: 語表現のための大域ベクトル
GloVe: 語表現のための大域ベクトル
Jeffrey Pennington Richard Socher Christopher D. Manning
概要
近年の単語のベクトル空間表現を学習する手法は、ベクトル演算を用いて細粒度の意味的・統語的正則性を捉えることに成功してきたが、これらの正則性の起源は不明なままであった。我々は、単語ベクトルにおいてそのような正則性が創発するために必要なモデルの性質を分析し、明示化する。その結果、文献における2つの主要なモデル群、すなわち大域行列因子分解と局所文脈窓手法の利点を組み合わせた、新たな大域対数双線形回帰モデルが得られた。本モデルは、大規模コーパスにおける個々の文脈窓や疎な行列全体に対して学習するのではなく、語語共起行列の非ゼロ要素のみに対して学習することで、統計的情報を効率的に活用する。本モデルは、最近の語の類推課題において75%の性能を示すことが証拠となるように、意味のある副構造を持つベクトル空間を生成する。また、類似性課題や固有表現認識においても関連するモデルを上回る性能を示す。
One-sentence Summary
Stanford University researchers propose GloVe, a global log-bilinear regression model that unifies global matrix factorization and local context window methods by training only on nonzero entries of word-word co-occurrence matrices, achieving 75% on a word analogy task and outperforming related models on similarity and named entity recognition tasks.
Key Contributions
-
GloVe is introduced as a global log-bilinear regression model that combines global matrix factorization and local context window methods for learning word vector representations.
-
The analysis identifies model properties needed for semantic and syntactic regularities to emerge, and the model trains efficiently on nonzero entries in a word-word cooccurrence matrix rather than on the full sparse matrix or individual context windows.
-
Results show meaningful vector-space substructure, with 75% performance on a recent word analogy task and gains over related models on word similarity and named entity recognition.
Introduction
Semantic word vector spaces are important because they support applications such as information retrieval, document classification, question answering, named entity recognition, and parsing. Earlier approaches face a tradeoff: global matrix factorization models such as LSA use corpus statistics efficiently but often miss the linear structure needed for word analogy tasks, while local context window models such as skip-gram capture analogy-like directions of meaning but make inefficient use of global co-occurrence statistics. The authors address this by proposing GloVe, a global log-bilinear regression model based on weighted least squares that trains directly on word-word co-occurrence counts, combining efficient statistical learning with meaningful vector substructure.
Dataset
-
The authors use five English text corpora: a 2010 Wikipedia dump with 1 billion tokens, a 2014 Wikipedia dump with 1.6 billion tokens, Gigaword 5 with 4.3 billion tokens, a combined Gigaword 5 and Wikipedia 2014 corpus with 6 billion tokens, and Common Crawl web data with 42 billion tokens.
-
Each corpus is tokenized and lowercased with the Stanford tokenizer. The vocabulary is limited to the 400,000 most frequent words. No labels, metadata fields, or supervised schema are described; the corpora are processed as plain token sequences.
-
The main data structure built from each corpus is a word co-occurrence count matrix X. The default context window captures ten words to the left and ten words to the right of each target word.
-
Co-occurrence counts are downweighted by distance. Word pairs separated by d words contribute 1/d to the total count, reflecting that distant pairs are less informative about word relationships.
-
For vector learning, the authors set weighting parameters x_max = 100 and alpha = 3/4, and they sample nonzero entries from the co-occurrence matrix during training.
-
The corpora are not combined into a single mixture with specified ratios. Instead, the model is trained on each corpus or corpus combination separately, including the 6 billion token Gigaword 5 plus Wikipedia 2014 setting.
-
For word2vec comparison, the 6 billion token corpus is trained with the same 400,000 word vocabulary and a context window size of ten.
-
For SVD baselines, the co-occurrence matrix is truncated to retain only the top 10,000 most frequent word columns, reducing sparse zero entries and lowering computational cost.
Method
The GloVe architecture is built as a global vector learning system that converts corpus-level co-occurrence statistics into dense word representations. Rather than learning embeddings through repeated local prediction tasks, the model directly learns a matrix factorization-like structure from a precomputed word-word co-occurrence matrix. The method is therefore organized around three major components: corpus statistics extraction, a parametric objective that links embeddings to co-occurrence probabilities, and a weighted regression procedure that controls the influence of frequent and rare events.
The input to the system is a large text corpus from which a co-occurrence count matrix X is constructed. Each entry Xij records how many times word j appears in the context of word i. The row sum
Xi=k∑Xikcounts the total number of contexts observed for word i, and the conditional co-occurrence probability
Pij=P(j∣i)=XiXijrepresents the probability that word j appears in the context of word i. These statistics become the target signal for learning the word vectors.
The central idea is that meaningful semantic relationships are more clearly exposed by ratios of co-occurrence probabilities than by raw probabilities. For two words of interest, say i and j, the behavior with respect to a probe word k is examined through the ratio
PjkPik.If k is associated with i but not with j, the ratio is large. If k is associated with j but not with i, the ratio is small. If k is unrelated to both, or related to both, the ratio is close to one. This observation motivates a model whose vector-space structure should reproduce such ratios.
The authors start from a general functional form
F(wi,wj,w~k)=PjkPik,where wi and wj are word vectors, and w~k is a separate context vector. To connect this with linear vector operations, the model is restricted so that F depends on the difference between the two target word vectors:
F(wi−wj,w~k)=PjkPik.Because the arguments are vectors while the right-hand side is a scalar, the model further reduces the interaction to an inner product:
F((wi−wj)Tw~k)=PjkPik.To preserve symmetry between a word and its context, the function is required to behave as a homomorphism from addition to multiplication:
F((wi−wj)Tw~k)=F(wjTw~k)F(wiTw~k).This implies that F must be exponential. After adding target and context bias terms, the final regression target becomes
wiTw~k+bi+b~k=logXik.Thus, the model learns embeddings such that the inner product between a target vector, a context vector, and their biases approximates the logarithm of the observed co-occurrence count.
The actual training objective is a weighted least-squares formulation:
J=i,j=1∑Vf(Xij)(wiTw~j+bi+b~j−logXij)2,where V is the vocabulary size. The weighting function f(Xij) is essential because many co-occurrence entries are zero or very small, while some are extremely frequent. The weights satisfy three design requirements: f(0)=0, so zero co-occurrences do not contribute; f is non-decreasing, so rare events are not overweighted; and f saturates for large Xij, so extremely common pairs do not dominate training. The model uses a practical parameterization
f(x)={(x/xmax)α,1,x<xmax,x≥xmax.In the described setup, xmax=100 and α=3/4. This weighting creates a smooth interpolation between fitting moderate co-occurrences and limiting the influence of very frequent or very sparse evidence.
Training is carried out over the entries of the co-occurrence matrix, typically over nonzero entries because the weighting function removes zero counts from the objective. The parameters learned are the target word vectors wi, context vectors w~j, and scalar biases bi and b~j. The optimization can be viewed as fitting a logarithmic factorization of the co-occurrence matrix, where the inner product and bias terms act as a low-rank explanation of the log-frequency surface.
The authors also relate GloVe to window-based models such as skip-gram. A softmax context model defines a probability
Qij=∑k=1Vexp(wiTw~k)exp(wiTw~j).When training scans through a corpus, the implied global objective can be written as
J=−i=1∑Vj=1∑VXijlogQij.This can be interpreted as a weighted cross-entropy objective over empirical and modeled context distributions. By moving from probability-space divergence to a least-squares objective in log space, and by replacing the implicit co-occurrence weighting with a more general function f(Xij), the GloVe model obtains a more direct and computationally cleaner regression target.
The complexity of the method depends on the number of nonzero entries in X. If the co-occurrence counts follow a power-law relationship over ranked word pairs,
Xij=rijαk,then the number of nonzero co-occurrences scales subquadratically with corpus size under typical conditions. For observed co-occurrence distributions with α≈1.25, the effective number of nonzero entries behaves roughly like ∣C∣0.8, where ∣C∣ denotes corpus size. This makes the training process substantially more efficient than the worst-case O(∣V∣2) bound implied by a dense vocabulary matrix.
Experiment
The experiments evaluate the word-vector model on word analogy, word similarity, and named entity recognition, while also analyzing vector length, context window, corpus size, training cost, and comparison with word2vec and SVD baselines. The model performs strongly across these tasks, especially on analogies and downstream entity recognition, and remains competitive or superior even with smaller corpora or shorter training times. Additional analyses show that syntax benefits from smaller asymmetric contexts, semantics benefits from larger contexts, and corpus domain matters, while the proposed weighting scheme helps the model scale better than plain SVD baselines.
The probabilities show that the ratio between ice and steam context associations can reveal properties specific to each word. Words linked more strongly to one target produce ratios far from one, while words relevant to both or neither yield ratios close to one. This supports using co-occurrence probability ratios to highlight semantic properties and reduce noise from generic context words. Probe words related to ice but not steam have much larger ice-to-steam probability ratios. Probe words related to both targets or to neither remain near a ratio of one.
GloVe achieves the strongest word analogy accuracy overall, frequently beating baselines even when using smaller vector dimensions or smaller training corpora. The retrained skip-gram and CBOW results are somewhat better than many published baselines, attributed partly to negative sampling and corpus choices. Scaling to a much larger corpus gives the model a substantial performance gain, while a basic SVD model loses accuracy on that corpus, supporting the need for the model's weighting scheme. GloVe reaches the best overall analogy accuracy among the compared vector models. The larger corpus improves the model substantially, but it can reduce accuracy for the basic SVD baseline.
The table compares 300-dimensional word vectors on five word similarity datasets using Spearman rank correlation with human judgments. GloVe performs strongly across most benchmarks and outperforms word2vec vectors that include phrase vectors, even though those vectors are trained on a much larger corpus. Expanding SVD-L to a larger corpus improves several scores but does not produce uniform gains across all similarity tasks. GloVe shows competitive word similarity results across all five evaluation sets. GloVe exceeds published word2vec vectors while using a smaller training corpus. Larger-corpus SVD-L improves some similarity scores but remains mixed across datasets.
The results compare named entity recognition F1 scores with 50-dimensional vectors against a discrete baseline without word vectors. Vectors trained with HPCA and CW show the strongest overall performance, especially on the ACE and MUC7 datasets. SVD variants stay closer to the discrete baseline, while SVD-L is noticeably weaker on the news-focused evaluation sets. HPCA vectors achieve the best performance across the reported evaluation sets. CW vectors are close to HPCA and outperform the SVD-based models overall. SVD-L falls below the discrete baseline on ACE and MUC7, indicating weaker scaling behavior.
The experiments evaluate both the diagnostic use of co-occurrence probability ratios and the practical utility of distributional vector models. The ratio analysis shows that words selective for one concept yield extreme ratios, while generic or irrelevant words cluster near unity, indicating that such ratios can expose word-specific semantics while suppressing noise. On standard language tasks, GloVe demonstrates consistently strong performance, especially on word analogy and similarity benchmarks, and larger training corpora generally improve learned representations for models with suitable weighting schemes. The named entity recognition results further support the value of well-constructed dense vectors, with HPCA and CW achieving the strongest downstream gains, whereas some scaling-sensitive baselines show weaker or inconsistent behavior.