How does AI process language?
Follow a word from a numerical representation to a next-token prediction.
What you’ll explore
- Embeddings
- Self-attention
- Transformers
Your lessons
0 / 13 completeChoose the pieces a model predicts
Fit character, word and subword tokenizers; inspect unknown text and a count-based next-token baseline.
Give words a place in space
Explore vectors, similarity, and why a word’s representation can change with context.
Compare, normalize, combine
Edit queries, keys, and values, and trace the weighted sum that lets tokens share context.
Follow a token through a Transformer
Inspect a tiny numerical decoder from token IDs to the next-token distribution.
Predict the next token
Shift inputs and targets, inspect causal visibility, calculate cross-entropy and compare reference versus generated prefixes.
Prepare a text corpus
Inspect text provenance, repair duplicate leakage, compare filters and control training exposure.
Train a tiny language model
Train a causal attention decoder, inspect actual gradients, restore checkpoints and compare position-level losses against a count baseline.
Choose how to sample
Compare greedy, temperature, top-k and top-p decoding on trained checkpoints with fixed random draws and separate quality diagnostics.
Adapt a pretrained model
Compare full fine-tuning with a rank-two output update, inspect its arithmetic and measure new versus retained behavior.
Learn from preferences
Train a response ranker from editable pairwise labels, examine rater disagreement and expose a polished but false proxy exploiter.
Connect instruction tuning, preferences and verified rewards
Compare actual supervised, DPO-style and exact expected-reward updates on a finite response set; expose a weak verifier and inspect a fixed-reference penalty.
Use a pretrained model responsibly
Inspect token IDs, context budgets, genuine recorded completions, output schemas and source support.
Evaluate language tasks with evidence
Design a rubric and reserved task suite, inspect actual model failures, and distinguish token loss, source support and task success.