HyperAIHyperAI

Command Palette

Search for a command to run...

GloVe: Globale Vektoren für die Wortrepräsentation

Jeffrey Pennington Richard Socher Christopher D. Manning

Zusammenfassung

Jüngere Verfahren zur 학습 von Vektorraumrepräsentationen von Wörtern haben feingranulare semantische und syntaktische Regularitäten mithilfe der Vektorarithmetik erfolgreich erfasst, deren Herkunft blieb jedoch undurchsichtig. Wir analysieren und explizieren die Modelleigenschaften, die für das Auftreten solcher Regularitäten in Wortvektoren erforderlich sind. Das Ergebnis ist ein neues globales logbilineares Regressionsmodell, das die Vorteile der beiden im Literaturdiskurs vorherrschenden Modellfamilien vereint: globale Matrixfaktorisierung und lokale Kontextfenstermethoden. Unser Modell nutzt statistische Informationen effizient, indem es ausschließlich auf den Nicht-Null-Elementen einer Wort-Wort-Kookkurrenzmatrix trainiert wird, anstatt auf der gesamten dünnbesetzten Matrix oder auf einzelnen Kontextfenstern eines großen Korpus. Das Modell erzeugt einen Vektorraum mit sinnvoller Substruktur, wie die Leistung von 75 % bei einer kürzlich veröffentlichten Wortanalogieaufgabe belegt. Es übertrifft zudem verwandte Modelle bei Ähnlichkeitsaufgaben und der Erkennung benannter Entitäten.

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%75\%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 XXX is constructed. Each entry XijX_{ij}Xij​ records how many times word jjj appears in the context of word iii. The row sum

Xi=∑kXikX_i = \sum_k X_{ik}Xi​=k∑​Xik​

counts the total number of contexts observed for word iii, and the conditional co-occurrence probability

Pij=P(j∣i)=XijXiP_{ij} = P(j|i) = \frac{X_{ij}}{X_i}Pij​=P(j∣i)=Xi​Xij​​

represents the probability that word jjj appears in the context of word iii. 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 iii and jjj, the behavior with respect to a probe word kkk is examined through the ratio

PikPjk.\frac{P_{ik}}{P_{jk}}.Pjk​Pik​​.

If kkk is associated with iii but not with jjj, the ratio is large. If kkk is associated with jjj but not with iii, the ratio is small. If kkk 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)=PikPjk,F(\mathbf w_i, \mathbf w_j, \tilde{\mathbf w}_k) = \frac{P_{ik}}{P_{jk}},F(wi​,wj​,w~k​)=Pjk​Pik​​,

where wi\mathbf w_iwi​ and wj\mathbf w_jwj​ are word vectors, and w~k\tilde{\mathbf w}_kw~k​ is a separate context vector. To connect this with linear vector operations, the model is restricted so that FFF depends on the difference between the two target word vectors:

F(wi−wj,w~k)=PikPjk.F(\mathbf w_i - \mathbf w_j, \tilde{\mathbf w}_k) = \frac{P_{ik}}{P_{jk}}.F(wi​−wj​,w~k​)=Pjk​Pik​​.

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)=PikPjk.F\left((\mathbf w_i - \mathbf w_j)^T \tilde{\mathbf w}_k\right) = \frac{P_{ik}}{P_{jk}}.F((wi​−wj​)Tw~k​)=Pjk​Pik​​.

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(wiTw~k)F(wjTw~k).F\left((\mathbf w_i - \mathbf w_j)^T \tilde{\mathbf w}_k\right) = \frac{F(\mathbf w_i^T \tilde{\mathbf w}_k)} {F(\mathbf w_j^T \tilde{\mathbf w}_k)}.F((wi​−wj​)Tw~k​)=F(wjT​w~k​)F(wiT​w~k​)​.

This implies that FFF must be exponential. After adding target and context bias terms, the final regression target becomes

wiTw~k+bi+b~k=log⁡Xik.\mathbf w_i^T \tilde{\mathbf w}_k + b_i + \tilde b_k = \log X_{ik}.wiT​w~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=1Vf(Xij)(wiTw~j+bi+b~j−log⁡Xij)2,J = \sum_{i,j=1}^{V} f(X_{ij}) \left( \mathbf w_i^T \tilde{\mathbf w}_j + b_i + \tilde b_j - \log X_{ij} \right)^2,J=i,j=1∑V​f(Xij​)(wiT​w~j​+bi​+b~j​−logXij​)2,

where VVV is the vocabulary size. The weighting function f(Xij)f(X_{ij})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)=0f(0)=0f(0)=0, so zero co-occurrences do not contribute; fff is non-decreasing, so rare events are not overweighted; and fff saturates for large XijX_{ij}Xij​, so extremely common pairs do not dominate training. The model uses a practical parameterization

f(x)={(x/xmax⁡)α,x<xmax⁡,1,x≥xmax⁡.f(x) = \begin{cases} \left(x / x_{\max}\right)^\alpha, & x < x_{\max}, \\ 1, & x \ge x_{\max}. \end{cases}f(x)={(x/xmax​)α,1,​x<xmax​,x≥xmax​.​

In the described setup, xmax⁡=100x_{\max}=100xmax​=100 and α=3/4\alpha=3/4α=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\mathbf w_iwi​, context vectors w~j\tilde{\mathbf w}_jw~j​, and scalar biases bib_ibi​ and b~j\tilde b_jb~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=exp⁡(wiTw~j)∑k=1Vexp⁡(wiTw~k).Q_{ij} = \frac{\exp(\mathbf w_i^T \tilde{\mathbf w}_j)} {\sum_{k=1}^{V} \exp(\mathbf w_i^T \tilde{\mathbf w}_k)}.Qij​=∑k=1V​exp(wiT​w~k​)exp(wiT​w~j​)​.

When training scans through a corpus, the implied global objective can be written as

J=−∑i=1V∑j=1VXijlog⁡Qij.J = -\sum_{i=1}^{V} \sum_{j=1}^{V} X_{ij} \log Q_{ij}.J=−i=1∑V​j=1∑V​Xij​logQij​.

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)f(X_{ij})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 XXX. If the co-occurrence counts follow a power-law relationship over ranked word pairs,

Xij=krijα,X_{ij} = \frac{k}{r_{ij}^{\alpha}},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\alpha \approx 1.25α≈1.25, the effective number of nonzero entries behaves roughly like ∣C∣0.8|C|^{0.8}∣C∣0.8, where ∣C∣|C|∣C∣ denotes corpus size. This makes the training process substantially more efficient than the worst-case O(∣V∣2)O(|V|^2)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.


KI mit KI entwickeln

Von der Idee bis zum Launch – beschleunigen Sie Ihre KI-Entwicklung mit kostenlosem KI-Co-Coding, sofort einsatzbereiter Umgebung und bestem GPU-Preis.

KI-gestütztes kollaboratives Programmieren
Sofort einsatzbereite GPUs
Die besten Preise

HyperAI Newsletters

Abonnieren Sie unsere neuesten Updates
Wir werden die neuesten Updates der Woche in Ihren Posteingang liefern um neun Uhr jeden Montagmorgen
Unterstützt von MailChimp