A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Word Embeddings and Representations

Graduate Depth 92 in the knowledge graph ☐ I know this ☆ Set as goal
4topics build on this
638prerequisites beneath it
See this on the map →
Neural Network FundamentalsDot Product (Inner Product in R^n)+2 more→→Sentiment Analysis in NLPZero-Shot Learning
nlp embeddings representation-learning

Core Idea

Word embeddings map words to dense vectors capturing semantic relationships. Word2Vec (Skip-gram, CBOW) learns via context prediction; GloVe combines local and global statistics. Embeddings enable arithmetic operations and transfer to downstream tasks.

Explainer

Before word embeddings, the standard way to represent words for machine learning was one-hot encoding: each word gets a vector with a single 1 and all other entries 0. In a vocabulary of 50,000 words, "king" might be [0, 0, ..., 1, ..., 0] and "queen" would be a completely different sparse vector. The problem is immediate: these vectors are orthogonal to each other, so the dot product between any two words is zero. The representation carries no information about meaning — "king" is as far from "queen" as it is from "toaster." Word embeddings solve this by learning dense, low-dimensional vectors (typically 100–300 dimensions) where semantic similarity is encoded as geometric proximity.

The breakthrough insight behind Word2Vec is the distributional hypothesis: words that appear in similar contexts have similar meanings. The Skip-gram model operationalizes this by training a shallow neural network on a simple task — given a target word, predict the words that surround it in a text corpus. The network has a single hidden layer whose weights, after training, become the word vectors. Words that predict similar context words end up with similar vectors. The CBOW (Continuous Bag of Words) variant reverses the task: given the surrounding context, predict the center word. Both approaches are remarkably efficient to train on large corpora because they avoid the full softmax over the vocabulary, using techniques like negative sampling instead.

GloVe (Global Vectors) takes a different approach. Rather than learning from local context windows, GloVe constructs a global word co-occurrence matrix — counting how often each pair of words appears together across the entire corpus — and then factorizes this matrix to produce vectors. The objective function is designed so that the dot product of two word vectors approximates the logarithm of their co-occurrence probability. This merges the advantages of count-based methods (which capture global statistics) with the embedding approach (which produces dense, useful vectors).

The most striking property of well-trained embeddings is that they encode semantic relationships as vector arithmetic. The famous example: vec("king") − vec("man") + vec("woman") ≈ vec("queen"). The direction from "man" to "woman" captures a gender relationship, and adding that direction to "king" lands near "queen." This works because the embedding space organizes concepts along consistent axes of meaning. In practice, pretrained word embeddings serve as the input representation for downstream NLP tasks — sentiment analysis, named entity recognition, machine translation — providing a rich starting point that encodes linguistic knowledge learned from billions of words of text.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Dividing Integers → Unit Rates → Proportions → Percent Concept → Converting Between Fractions, Decimals, and Percents → Operations with Rational Numbers → Two-Step Equations → Solving Multi-Step Equations → Equations with Variables on Both Sides → Angle Pairs: Complementary, Supplementary, and Vertical → Parallel Lines and Transversals → Corresponding Angles → Alternate Interior Angles → Triangle Angle Sum Theorem → Exterior Angle Theorem → Triangle Inequality Theorem → Similar Triangles: AA Similarity → Similar Triangles: SSS and SAS Similarity → Proportions in Similar Triangles → Right Triangle Trigonometry Introduction → Sine, Cosine, and Tangent Ratios → Trigonometric Ratios Review → Radian Measure → Converting Between Degrees and Radians → The Unit Circle → Graphing Sine and Cosine → Graphing Tangent and Reciprocal Trigonometric Functions → Derivatives of Trigonometric Functions → Antiderivatives → Indefinite Integrals → Basic Integration Rules → Riemann Sums → Definite Integral Definition → Probability Density Functions and Continuous Distributions → Cumulative Distribution Functions → Continuous Random Variables → Probability Density Functions → Expected Value → Linear Regression in Machine Learning → Neural Network Fundamentals → Word Embeddings and Representations

Longest path: 93 steps · 638 total prerequisite topics

Prerequisites (4)

Leads To (2)