Chapters
Chapter 1
What a language model is, probability over sequences, n-grams, bag-of-words, and why counting fails.
Chapter 2
Term frequency, inverse document frequency, and why sparse vectors fail to capture meaning — leading us toward dense, learned representations.
Chapter 3
From sparse counts to dense vectors: perceptrons, multi-layer networks, and activation functions.
Chapter 4
Loss functions, cross-entropy, softmax, and gradient descent — how a network knows it is wrong and how to improve.
Chapter 5
The chain rule applied backward through a network, turning one loss value into gradients for every weight and bias.
Chapter 6
Recurrent neural networks, sequence tasks, unrolling through time, and the vanishing gradient problem that motivates gated architectures.
Chapter 7
Long Short-Term Memory gates, sequence-to-sequence models, and why attention replaced recurrence for long contexts.
Chapter 8
Dense vectors, Word2Vec, analogies, subword tokenization, static and contextual embeddings, positional encoding, and an interactive embedding-space playground.
Chapter 9
Self-attention, query-key-value, multi-head attention, and the math behind it — built on top of sequence models.
Chapter 10
Layer norm, residual connections, feed-forward networks, and encoder/decoder variants.
Chapter 11
Tokenization at scale, next-token prediction, optimizers, and training dynamics.
Chapter 12
Greedy, beam, temperature, top-k, top-p, and interactive text generation.
Chapter 13
Scaling laws, GPT/LLaMA/Mistral families, MoE, and multimodal extensions.
Chapter 14
SFT, RLHF, LoRA, instruction tuning, and parameter-efficient methods.
Chapter 15
Prompt engineering, RAG, benchmarks, and failure modes.