ArticleslgStudy

computer science

GloVe

GloVe is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand GloVe rather than just read about it. In short: In natural language processing, GloVe (acronym for Global Vectors) is a model for distributed word representation. The model is an unsupervised learning algorithm for obtaining vector representations of words.

Key takeaways

  • GloVe belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect GloVe to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of GloVe from memory before moving on to harder problems.

Reference excerpt

In natural language processing, GloVe (acronym for Global Vectors) is a model for distributed word representation. The model is an unsupervised learning algorithm for obtaining vector representations of words. This is achieved by mapping words into a meaningful space where the distance between words is related to semantic similarity. Training is performed on aggregated global word-word co-occurrence statistics from a corpus, and the resulting representations showcase interesting linear substructures of the word vector space. As log-bilinear regression model for unsupervised learning of word representations, it combines the features of two model families, namely the global matrix factorization and local context window methods. It was developed as an open-source project at Stanford University and launched in 2014. It was designed as a competitor to word2vec, and the original paper noted multiple improvements of GloVe over word2vec. As of 2022, both approaches are outdated, and transformer-based models, such as BERT, which add multiple neural-network attention layers on top of a word embedding model similar to Word2vec, have come to be regarded as the state of the art in natural language processing (NLP).

Definition You shall know a word by the company it keeps (Firth, J. R. 1957:11)The idea of GloVe is to construct, for each word i {\displaystyle i} , two vectors w i , w ~ i {\displaystyle w_{i},{\tilde {w}}_{i}} , such that the relative positions of the vectors capture part of the statistical regularities of the word i {\displaystyle i} . The statistical regularity is defined as the co-occurrence probabilities. Words that resemble each other in meaning should also resemble each other in co-occurrence probabilities.

Word counting Let the vocabulary be V {\displaystyle V} , the set of all possible words (aka "tokens"). Punctuation is either ignored, or treated as vocabulary, and similarly for capitalization and other typographical details.

If two words occur close to each other, then we say that they occur in the context of each other. For example, if the context length is 3, then we say that in the following sentenceGloVe1, coined2 from3 Global4 Vectors5, is6 a7 model8 for9 distributed10 word11 representation12the word "model8" is in the context of "word11" but not the context of "representation12". A word is not in the context of itself, so "model8" is not in the context of the word "model8", although, if a word appears again in the same context, then it does count. Let X i j {\displaystyle X_{ij}} be the number of times that the word j {\displaystyle j} appears in the context of the word i {\displaystyle i} over the entire corpus. For example, if the corpus is just "I don't think that that is a problem." we have X that , that = 2 {\displaystyle X_{{\text{that}},{\text{that}}}=2} since the first "that" appears in the second one's context, and vice versa. Let X i = ∑ j ∈ V X i j {\displaystyle X_{i}=\sum _{j\in V}X_{ij}} be the number of words in the context of all instances of word i {\displaystyle i} . By counting, we have X i = 2 × ( context size ) × # ( occurrences of word i ) {\displaystyle X_{i}=2\times ({\text{context size}})\times \#({\text{occurrences of word }}i)} (except for words occurring right at the start and end of the corpus)

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with GloVe

Start with the simplest possible case. Write down what GloVe claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to GloVe before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about GloVe ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of GloVe

In research
GloVe appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses GloVe in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
GloVe is common in secondary-school and first-year university syllabi. It links to neighbouring topics 2014 in artificial intelligence, 2014 software, Computational linguistics, so understanding it makes those chapters shorter.
In everyday life
Look for GloVe outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study GloVe in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what GloVe means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain GloVe out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is GloVe in simple terms?

In natural language processing, GloVe (acronym for Global Vectors) is a model for distributed word representation. The model is an unsupervised learning algorithm for obtaining vector representations of words.

Why does GloVe matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study GloVe?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on GloVe.

Tags

  • 2014 in artificial intelligence
  • 2014 software
  • Computational linguistics
  • Natural language processing toolkits

Keep exploring