GloVe
Word2Vec learns word vectors by sliding a window over a corpus and predicting neighbours, one local context at a time. GloVe — short for Global Vectors — starts from the finished tally instead: a matrix counting how often every word appears near every other word across the entire corpus.
Ratios, not counts
The insight behind the method is that meaning lives in ratios of co-occurrence probabilities rather than in raw counts. “Ice” and “steam” both occur near “water”, which separates nothing; but “ice” occurs with “solid” far more often than “steam” does, and the ratio of those two probabilities isolates exactly that difference. GloVe therefore fits vectors so that the dot product of two of them approximates the logarithm of their co-occurrence count, by weighted least squares:
- pairs that never co-occur are skipped, which keeps a very sparse matrix tractable;
- a weighting function caps the influence of very frequent pairs, so “the” cannot dominate the fit.
Using it
Stanford NLP publishes pretrained vectors from 50 to 300 dimensions, trained on Wikipedia plus Gigaword, on Common Crawl and on Twitter, and they remain a cheap, strong initialisation for a text classifier or a retrieval baseline when there is too little labelled data to learn an embedding layer from scratch. Gensim and spaCy load them directly.
Limits worth knowing
One vector per word, fixed forever: “apple” carries fruit and company blended together, and a word absent from training has no vector at all, where FastText would compose one from subwords. Those two limits are why contextual encoders displaced static embeddings — not that GloVe got worse.
GloVe (Global Vectors) learns word embeddings by factorising a corpus-wide word-word co-occurrence matrix, fitting vectors so that a dot product approximates the log of how often two words appear together. Its premise is that meaning is carried by ratios of co-occurrence probabilities, not raw counts. The result is one dense static vector per word, with the linear structure that makes analogy arithmetic work, widely used as a pretrained embedding layer.
Think of a huge tally of which words keep turning up near which others across millions of pages. “Ice” sits near “cold” and “solid”; “steam” sits near “hot” and “gas”. The company a word keeps tells you what it means.
GloVe turns that tally into numbers. It gives every word a short list of coordinates — a position on a kind of map of meaning — chosen so that words appearing in similar company end up close together. Software cannot do arithmetic on letters, but it can on coordinates, so this is the step that lets a program treat “trainers” and “sneakers” as near neighbours rather than two unrelated strings.