stanfordnlp/GloVe logo

stanfordnlp/GloVe

Free

Software in C and data files for the popular GloVe model for distributed word representations, a.k.a. word vectors or embeddings

FreeFree tier
Type
Open Source
Company
Stanford NLP Group

About stanfordnlp/GloVe

GloVe (Global Vectors for Word Representation) is an unsupervised learning algorithm developed by the Stanford NLP group for obtaining distributed word representations (word vectors). The implementation is written in C and provides tools to train word vectors on new corpora as well as download pre-trained vectors from large-scale web datasets. Pre-trained vectors are available for corpora such as Common Crawl (42B and 840B tokens), Wikipedia 2014 + Gigaword 5, Twitter, and newly released 2024 vectors trained on Dolma and Wikipedia+Gigaword 5. The repository includes source code, a demo script for quick testing on a small Wikipedia sample, and an evaluation script for word analogy tasks. It is widely used in natural language processing for tasks like word similarity, analogy reasoning, and as feature inputs to downstream models.

Key Features

Written in C for efficient training and evaluation
Provides pre-trained word vectors for multiple large-scale corpora (Common Crawl, Wikipedia, Twitter, 2024 Dolma/WikiGiga)
Supports training word vectors on custom corpora with simple build and demo scripts
Includes co-occurrence matrix construction, shuffling, and training pipeline
Word analogy evaluation script to verify vector quality
NEW 2024 vectors trained on Dolma (220B tokens) and Wikipedia+Gigaword 5 (11.9B tokens), available in multiple dimensions (50d, 100d, 200d, 300d)
Public domain license for pre-trained vectors

Pros & Cons

Pros
  • Efficient C implementation with low memory footprint for training
  • Widely adopted and benchmarked in NLP research
  • Pre-trained vectors available off-the-shelf for many common domains
  • Open source (Apache 2.0 license) with active community and clear documentation
  • Supports training on arbitrary text corpora, enabling domain-specific embeddings
  • Includes both training code and evaluation scripts in a single repository
Cons
  • Produces static word embeddings (no context sensitivity like ELMo or BERT)
  • Training requires significant RAM for large vocabularies and high-dimensional vectors
  • No built-in GPU acceleration (CPU-only implementation in C)
  • Requires compilation with GCC and GNU Make, which may be non-trivial for some users
  • Pre-trained vectors may become outdated if not periodically updated (new 2024 vectors address this partially)

Best For

Word similarity and relatedness tasksWord analogy reasoning (e.g., man:woman as king:queen)Feature extraction for downstream NLP models (e.g., text classification, sentiment analysis)Semantic and syntactic analysis of text corporaBuilding baseline word representations for research or production

FAQ

What is GloVe?
GloVe (Global Vectors) is an unsupervised algorithm from Stanford NLP for learning word embeddings by aggregating global word-word co-occurrence statistics from a corpus.
How can I download pre-trained GloVe vectors?
Pre-trained vectors are available for multiple corpora including Common Crawl, Wikipedia 2014 + Gigaword 5, Twitter, and new 2024 vectors (Dolma, Wikipedia+Gigaword 5). Download links are provided in the repository README.
Can I train my own GloVe vectors?
Yes. Clone the repository, run 'make' to compile the source, then modify or run the demo.sh script. The demo downloads a small Wikipedia corpus and trains vectors. For full training, adjust hyperparameters and provide your own corpus.
What are the prerequisites to run GloVe locally?
You need GNU Make, GCC (or compatible C compiler), and Python with NumPy for evaluation scripts.
Are the 2024 vectors different from earlier ones?
Yes. The 2024 vectors were trained on more recent and larger corpora (Dolma with 220B tokens and Wikipedia+Gigaword 5 with 11.9B tokens) and are provided in 50d, 100d, 200d, and 300d dimensions. Documentation and analysis are available in the Training_README and a linked report.