The idea that turned words into arrows — and made meaning something you can measure with a dot product.
Word2Vec (Mikolov et al., 2013) takes that linguistic intuition and makes it a prediction task. Train a deliberately shallow network to predict a word from its context (or its context from the word), then throw the classifier away and keep the weights. Each row of that weight matrix is a dense vector — typically 100–300 dimensions — and words used in similar contexts land near each other in that space.
The shift is from symbol to geometry. One-hot vectors are orthogonal: cat and kitten are exactly as unrelated as cat and bureaucracy. Embeddings give you similarity, direction, and distance — the substrate every modern NLP model still stands on.
A sliding window of size c defines "nearby". In the cat sat on the mat with c=2, the centre word sat pairs with {the, cat, on, the}. Small windows capture syntax; large windows capture topic.
CBOW averages context vectors to predict the centre word — fast, better on frequent words. Skip-gram uses the centre word to predict each context word — slower, far better on rare words.
A full softmax over a 1M-word vocabulary is ruinous. Instead: score the true (word, context) pair as 1, and k = 5–20 random pairs as 0. Binary logistic regression replaces a giant normalisation.
Shape V×d (vocabulary × dimensions). It is not a means to an end — it is the product. Row i is the vector for word i. Cosine similarity between rows is your semantic ruler.
log σ(v·upos) plus Σ log σ(−v·uneg) by SGD: pull real pairs together, push sampled pairs apart. Only the handful of involved rows update — hence the speed.Semantic retrieval & query expansion. Match "affordable flat" to "cheap apartment" without a synonym list — the direct ancestor of today's vector databases.
Item2Vec. Treat a user's purchase or listen history as a "sentence" and products as "words". Airbnb, Spotify and Alibaba all shipped embeddings built this way.
Protein & gene embeddings. Amino-acid sequences as sentences: the same objective learns structural similarity from unlabelled sequence databases.
Log & clickstream analysis. Embed event types by co-occurrence to cluster failure modes and surface anomalous sequences.
Foundation for what followed. GloVe, fastText, then contextual embeddings (ELMo, BERT). Attention replaced the mechanism, not the premise.
Say them out loud or write two lines each. Retrieval beats re-reading.