The demystifying session
Everything you have built so far - neural nets (S2), embeddings (S3), retrieval (S5) - comes together here. A large language model is a very large neural net that turns text into tokens, into vectors, and predicts what comes next. No lookup, no database of answers, no understanding in the human sense. Just a staggeringly good next-token guesser. That framing is the difference between using these tools well and being fooled by them.
Next-token prediction 5 min live
Give the model the text so far. It produces a probability for every possible next token (a token is a word or word-piece), picks one, appends it, and runs again. That loop, scaled to billions of parameters trained on much of the internet, is the entire mechanism. It is not retrieving a stored answer - it is predicting, token by token.
LivePredicting, not retrieving3 min▶
- A token is a word chunk. "unbelievable" might be un + believ + able. The model works in tokens, not letters or whole words - which is why it can miscount the letters in a word (self-study).
- Every step is a probability list. The model does not "know" the answer; it computes how likely each token is to come next given everything so far, then samples one.
- Fluency is the point, not a side effect. It was trained to make text that sounds like its training data. Sounding right and being right are different goals - hold onto that for Part 3.
Autocomplete on your phone is a tiny version of the same idea: it guesses your next word from the last few. An LLM is that, scaled up by a factor of billions and fed the internet - enough that "guess the next token" produces essays, code, and arguments. Same loop, wildly different scale.
Self-studyTokens vs words, and the "strawberry" trap2 min read▶
Ask some models "how many r's in strawberry?" and they stumble. Not because they are dumb - because they never see letters. Text is chopped into tokens before the model sees it, so "strawberry" might arrive as a few chunks with no letter-level view. Counting characters is genuinely hard for a system that thinks in tokens. The lesson for practitioners: LLMs are weak exactly where the task lives below the token (spelling, arithmetic digit-by-digit, exact character edits) - route those to a tool (Session 7's agents) instead of trusting the model.
Training vs inference, context, temperature 5 min live
Two moments matter: training (once, expensive, bakes patterns into the weights) and inference (every time you prompt it). At inference you control two dials that decide almost everything about the output: how much it can see (context window) and how boldly it strays from the safest token (temperature).
LiveContext and temperature, in plain terms3 min▶
- Context window = short-term memory. Everything the model can "see" at once - your prompt, the conversation, any documents you paste. Past the limit, earlier content falls out of view. Bigger windows (now hundreds of pages) changed what is possible, but they are not infinite and cost more.
- Temperature = boldness. Low temperature almost always grabs the top token (focused, repetitive, good for facts). High temperature flattens the odds so unlikely tokens can win (creative, surprising, riskier). You will feel this in the widget.
- The weights are frozen at inference. ChatGPT does not learn from your conversation in real time. Genuinely updating the model means retraining or fine-tuning (Session 7) - a deliberate, separate act.
Self-studyWhy the model does not know last week's news2 min read▶
Training has a cutoff date - the model only saw data up to some point, then its weights froze. Anything after that simply is not in there. That is why models get recent events wrong or refuse them, and why grounding matters: to answer about your latest data or today's news, you feed it in at inference time via the context window (paste it, or retrieve it with RAG from Session 5). The model supplies fluency and reasoning-shaped patterns; you supply the current facts. Confusing "it was trained on a lot" with "it knows everything now" is a top source of trust errors.
Why they hallucinate 5 min live
A hallucination is a confident, fluent, wrong answer. It happens because the model optimizes for plausible next tokens, not for truth - and it has no built-in fact-checker. When it does not "know", it does not stop; it generates the most likely-sounding continuation, which can be a convincing fabrication. This is a property of the mechanism, not a bug you can fully patch. So you design around it.
LiveDesign around it, do not wish it away3 min▶
- Fluent and confident is not evidence. The model has the same smooth tone whether it is right or inventing. Never read confidence as accuracy.
- Ground it. Give the model the real facts in the prompt (paste them, or retrieve with RAG). It is far more reliable summarizing what you handed it than recalling from training.
- Keep a human on high-stakes output. Legal, medical, financial, anything published in your name - a person verifies before it counts. Session 8 makes this a governance rule.
- Measure it. Evals (Session 7) tell you the real error rate on your task, so "seems fine" becomes a number you can manage.
In 2023 two lawyers filed a brief citing six court cases an LLM had invented, complete with fake quotes and citation numbers. The model was not malfunctioning - it produced plausible-looking legal text, which is exactly what it does. The failure was trusting fluency without verification. A grounding step or a human check would have caught all six.
Self-studyTransformers and attention, in one honest paragraph3 min read▶
The architecture behind modern LLMs is the transformer (2017, "Attention Is All You Need"). Its key trick is attention: for each token it is about to predict, the model weighs which earlier tokens matter most and how they relate - so "it" in a sentence can attend to the noun it refers to twenty words back. Stacking many attention layers lets the model track long-range structure in language, which is why transformers blew past the older sequence models (RNNs/LSTMs) that struggled to remember far back. You do not need the math; you need the intuition: attention is the mechanism that lets a next-token predictor stay coherent across a long passage. That coherence is why it feels like understanding - and why it is easy to over-trust.
Be the LLM ★ 10 min · everyone plays
Build a sentence one token at a time, straight from the probability list - then move the temperature dial and watch the odds change shape. This is the whole mechanism in your hands.
Rank the hallucination risk ★ 6 min · everyone judges
Four tasks: (a) summarize a document you paste in, (b) cite a specific court case from memory, (c) brainstorm 20 product names, (d) state a medication dose.
Rank them by hallucination danger. Ask for each: is the model grounded in facts you gave it, or recalling from training? Is the output verifiable? What is the cost of being wrong?
Land the pattern: grounded + low-stakes + easy-to-verify (summary, brainstorm) is safe; recall + high-stakes + hard-to-verify (case citation, dose) is dangerous - and needs grounding plus a human.
Map one real task from your work onto this spectrum. Decide its guardrail now.
Budget the context window ★ 6 min · everyone plans
Take a real big-input task: "analyze this 100-page contract" or "answer from our 500-page handbook".
The whole thing will not fit in one context window. List your options: paste the most relevant sections only, or retrieve the right chunks on demand (RAG, Session 5) and feed just those.
Notice the realization: the quality ceiling is set by which chunks you retrieve, not by the model. Retrieval quality = answer quality.
Write one line: for your task, how would you get the right few pages in front of the model? That sentence is your S7 starting point.
"We fed the AI our whole wiki and it still gave wrong answers" almost always means the retrieval picked the wrong chunks, not that the model is weak. The context window is a small stage - what you put on it is the job.
This week ◐ 25 min total
- Temperature test: in any chatbot, ask the same creative question twice, once asking for a "safe, standard" answer and once for a "bold, unusual" one. Feel the dial in real output.
- Catch a hallucination: ask a model for five specific facts you can verify (citations, dates, statistics). Check them. Note how confident the wrong ones sounded.
- Read the self-study cards above: tokens vs words, the training cutoff, and transformers/attention.
- Optional deep end: skim the "Attention Is All You Need" abstract (2017) - you will recognize every idea from Part 3's self-study card.
Three questions before you go 🎯 ◐ 90 seconds
1 · At its core, what does a large language model actually do?
It is a next-token predictor scaled up enormously. No lookup, no stored answers, no human-style reasoning - just probability over the next chunk of text, again and again.
2 · Output is coming out bland and repetitive. Which dial do you reach for?
Temperature is boldness. Low = safe and samey, high = creative and riskier. Context window is about how much it can see, not how adventurous it is.
3 · Why do LLMs hallucinate confident, wrong answers?
Hallucination is a property of how the mechanism works. Bigger models hallucinate less but never zero. You contain it with grounding, human review, and evals.
Concepts covered & where they come from
Leaders get the working model; practitioners get the Self-study lane and the names to go deeper.