What is language made of — and how can a model learn what a word means from the company it keeps? Watch the lecture in ten short chapters with English and Chinese subtitles, follow the lecture map below, then try the ideas in Colab.
Five acts, ten chapters. The first half climbs the levels of language — characters, words, subwords, sentences, discourse — and asks where that structure went in today's LLMs. The second half turns words into vectors: first by counting contexts, then by predicting them with word2vec. The thread through both halves is context. Click a chapter to watch it.
Linguistics is the scientific study of language. Substitution tests on "The cat sat on the mat" reveal constituents, "Colorless green ideas sleep furiously" separates form from meaning, and English varieties remind us that communication is cooperative.
Chinese characters carry sound and meaning; encodings from GB2312 to Unicode and UTF-8 map them to bytes. Spaces do not define words, normalization is a trade-off, and Zipf's long tail guarantees out-of-vocabulary words.
Words are built from morphemes; Chinese words have little inflection and ambiguous boundaries (乒乓球拍卖完了). GPT-style models sidestep both with byte-level BPE, which learns frequent pieces and can always fall back to bytes. Parts of speech give words a grammatical role.
Phrase-structure trees group words into constituents; dependency trees link each word to its head. Ambiguity ("I shot an elephant in my pajamas") makes parsing hard, and discourse relations connect sentences into a coherent text.
A review with a contrastive "but" once needed a pipeline of separate analysis stages; a language model trained only to predict text handles it end to end, and probes find linguistic structure inside it. The field swings between empiricism and rationalism — may it swing back?
Search needs a score, not just a match. The vector space model with TF-IDF weights ranks documents; latent semantic analysis compresses the term-document matrix with SVD so related words meet even without exact matches.
Hand-built resources like WordNet are costly; the distributional hypothesis lets text do the work. You can guess "ongchoi" from its contexts, and so can a computer: co-occurrence counts, cosine similarity, PPMI weighting, and SVD for dense vectors.
Embedding spaces capture neighbors, analogies (king − man + woman), cross-lingual structure, semantic change — and social bias. Skip-gram learns them by predicting context words with a softmax over the vocabulary, using two tables of 2|V|d parameters.
Negative sampling turns prediction into a few binary decisions, touching K + 2 vectors per update. CBOW flips the direction, GloVe fits global counts, pretrained vectors save training, and intrinsic and extrinsic tests answer different questions.
A recap of the thread from structure to representation, then the calculus: the center-word gradient is the expected context vector minus the observed one, and the full-softmax update costs about |V|·d per pair, against K·d with negative sampling.
Three short notebooks turn the lecture into experiments. Click Open in Colab, then Runtime → Run all. Each ends with exercises. All three run on the free CPU runtime; no GPU is needed.
Key terms of the lecture. Each link opens the video at the slide where the idea is explained.
Word2vec and GloVe date from 2013–2014, and BPE entered NLP in 2016. The questions in this lecture — what a token should be, and what a vector should capture — are still moving. Five developments to watch:
GPT-2's byte-level BPE vocabulary (the idea on slide 61) has 50,257 tokens. Llama 3 moved to 128K tokens and reports up to 15% fewer tokens than Llama 2; Gemma 3 uses 262K, chosen to be more balanced for non-English text — the cost gap that slide 58 shows for Chinese.
Spaces do not define words ("New York"). SuperBPE lets tokens span whitespace: at a fixed 200K vocabulary it encodes text with up to 33% fewer tokens, and an 8B model trained with it gains 4.0 points on average over 30 tasks.
Instead of a fixed BPE vocabulary, models read raw bytes and learn their own grouping: BLT forms patches by next-byte entropy, Bolmo converts an existing Olmo 3 model to bytes, and ByteFlow learns segmentation by compression.
A lookup table plus averaging, like the baseline on slide 176, trained with modern objectives: Sentence Transformers' static models run 100–400× faster on CPU and keep at least 85% of the quality of transformer encoders.
Cross-lingual structure (slide 152) shows up inside large models too: interpretability work found language-independent features for concepts such as "small" and "opposite", and the shared fraction grows with model scale.
"You shall know a word by the company it keeps."
The one-line summary of Chapters 7–9.
"Difference of meaning correlates with difference of distribution."
The distributional hypothesis (slide 132) stated as a testable claim.
"Colorless green ideas sleep furiously."
Grammatical form and meaning are different things.
"The meaning of a word is its use in the language."
The philosophical root of learning meaning from usage.