Understanding How AI Language Models Work
Learn what really happens inside a language model so you can use, judge, and explain it with confidence.
This course is for members
$9 unlocks every course in the library, this one included, plus a credit to build a topic of your own and at least 10 new courses every month.
What you will learn about Understanding How AI Language Models Work
The 7-day sprint
- Prediction Is the Whole Trick. A language model is a function that takes a stretch of text and outputs a probability for every possible next chunk of text.
- Tokens, Not Words. Models read and write in tokens, which are common character chunks rather than whole words, and this shapes what they find easy or hard.
- Meaning as Direction in Space. Each token becomes a long list of numbers, an embedding, positioned so that tokens and passages with related meanings sit near each other.
- Attention and the Transformer. Attention lets every position in the text pull in information from other positions it judges relevant, and stacking that operation many times is what a transformer is.
- From Raw Predictor to Helpful Assistant. Pretraining creates a text predictor; instruction tuning and preference training turn that predictor into something that follows requests and refuses harmful ones.
- Context, Memory, and Retrieval. A model's only working memory is the text in its context window, so useful systems put the right information into that window rather than relying on what the model absorbed in training.
- Sampling, Limits, and Verification. Decoding settings turn one probability distribution into many possible texts, and knowing the model's structural limits tells you exactly which outputs you must verify.
The 80/20: the 6 concepts that matter most
- Next-token prediction as the universal engine
- Tokens are the unit of everything
- Context is the only memory
- Retrieval and tools beat recall
- Attention is what makes long-range meaning possible
- Alignment training shapes behavior, not knowledge
The core idea, explained like you are 5
A language model is a next-token predictor: it converts the text so far into a probability distribution over what comes next, and all of its apparent intelligence is a consequence of doing that extremely well.
Then the quiz and the ladder
10 questions that correct you when you are wrong, and beginner, intermediate, advanced levels, each with a practical exercise.