wunder beta

🧠 How AI & LLMs Actually Work

Understand what is really happening inside modern AI. You'll follow how models learn from data, what a neural network and a token are, and why language models sometimes fail.

10
lessons
~60 min
to learn
🔬 Science
subject
Adults
level
Start the course →

What you’ll learn

  1. One Question, Asked Over and OverEstablish the single computation a language model performs — and why that framing is neither a dismissal nor a mystery.A language model is a function that takes a sequence of text and returns a probability for every possible next chunk of text. That is the whole computation; everything else in this course is detail about how the function is shaped and how its parameters were chosen. Two lazy stories have grown up around this fact — 'it's just autocomplete' and 'it might be thinking' — and both skip the interesting part, which is what it actually takes to answer that one question well.
  2. The Model Never Sees a WordUnderstand tokenisation, and see how a chopping decision made before the model runs explains a whole family of famous failures.Text is split into tokens — frequent chunks from a fixed vocabulary, built by an algorithm like byte-pair encoding that merges common character pairs until it has enough entries. The model then only ever sees token ID numbers; letters are gone. This is why character-level tasks (counting letters, reversing strings, rhyming, arithmetic on long numbers) are structurally awkward for models that are otherwise very capable, and why a rare name may cost five tokens while a common word costs one.
  3. Meaning as a DirectionUnderstand embeddings — how an arbitrary ID becomes a position in a space where geometry encodes usage — and where the popular story about them overreaches.Each token ID indexes a row in a big table, giving a vector of hundreds or thousands of numbers. Those numbers are not designed; they are learned, driven by the distributional hypothesis — words used in similar contexts end up near each other. The famous king − man + woman ≈ queen result is real but has been shown to depend heavily on excluding the input words from the answer, so it is weaker evidence of clean conceptual arithmetic than it is usually presented as. Crucially, embeddings inherit whatever associations were in the text.
  4. Attention: Letting Words Read Each OtherUnderstand what attention computes, what problem it solved, and why it — not raw scale alone — is the hinge the modern field turns on.A fixed embedding cannot represent 'bank' differently in two sentences, so context must be mixed in. Attention lets every position emit a query, every position advertise a key, and each position pull a weighted blend of other positions' values — a learned, content-based lookup. Its decisive practical advantage over the recurrent networks it replaced is that all positions compute at once, which is what made training on GPUs at scale possible; its cost is that comparing every position with every other grows with the square of length.
  5. Depth: What the Stack Actually BuildsSee what one layer contributes, why depth is repetition rather than a pipeline of named stages, and where the model's knowledge physically sits.A layer is attention (gather context) followed by a feed-forward network (process what was gathered), both added onto a running residual stream rather than replacing it. Dozens of near-identical layers are stacked, and the great majority of a model's parameters sit in the feed-forward blocks, not the attention. Depth is not a designed pipeline with named stages; it is the same operation applied over and over, and what each layer ends up doing is discovered, not specified — which is precisely why interpretability is hard.
  6. Training: Fitting a Function to a Pile of TextUnderstand what training actually does — mechanically, and what it costs — and see that no facts are ever stored, only parameters adjusted.Training hides the next token, measures how wrong the model's probability for the true token was, and nudges every parameter slightly in the direction that would have reduced that error. Repeat over trillions of tokens. The training data supplies the answer key for free, which is why the internet could be a training set at all. Nothing is stored: the text is thrown away and only the adjusted weights remain — a lossy compression of regularities, not a library.
  7. Inference: Why the Same Prompt Gives Different AnswersUnderstand sampling and temperature, and why the model's variability is a deliberate choice rather than a flaw or a sign of moodiness.The forward pass ends with a score for every token, converted by softmax into probabilities. Something must then choose. Always taking the most likely token is available — and produces flat, repetitive text — so systems sample instead, with temperature scaling how much the long tail is allowed to compete. This is why identical prompts give different answers: the randomness is in the pick, not the model. Training and inference are also completely separate: the model does not learn from your conversation.
  8. From Predictor to AssistantUnderstand why a pretrained model is not usable as an assistant, and what post-training does — including the costs it imposes.A pretrained model completes text; asked a question it may produce more questions, because that is what documents of questions look like. Post-training fixes this in stages: supervised fine-tuning on demonstrations, then learning from human preference comparisons, either through a reward model with reinforcement learning or more directly. The results are large — InstructGPT's 1.3B model was preferred to the 175B base — but the objective becomes 'what a rater will approve of', which is adjacent to truth rather than identical to it, and measurably produces sycophancy.
  9. Hallucination Is the Objective, Not the BugSee that confident falsehood follows structurally from how these systems are built and scored — and understand honestly what does and does not reduce it.Nothing in pretraining distinguishes true from false; it distinguishes likely from unlikely, and a plausible-sounding false statement is exactly the target. Post-training then adds a second push: OpenAI researchers argued in 2025 that standard benchmarks score a wrong answer and 'I don't know' identically at zero, so guessing dominates abstention. Retrieval and citation help substantially by changing the task from recall to reading, but the generation step is unchanged, so the failure mode is reduced rather than removed.
  10. What Nobody Can Tell You YetBe honest about the field's live disagreements and its largest unsolved problem, and leave with a defensible way to read AI claims.Interpretability has real results — sparse autoencoders recover millions of human-interpretable features from a production model — but nobody can give a complete causal account of why a specific output appeared, and superposition means features outnumber neurons. Meanwhile two headline questions are genuinely open: whether 'emergent abilities' are real discontinuities or artefacts of discontinuous metrics, and whether scaling continues. The defensible position is that the mechanism is known exactly and the consequences are not.

Questions this course answers

Why is calling a language model "just autocomplete" criticised in this chapter?

The description 'predicts the next token' is accurate — the word smuggling in the error is 'just'. Predicting the last word of 'the physicist who published special relativity in 1905 was Albert ___' requires the fact; predicting the killer's name in the last line of a mystery requires having tracked the plot. The task's ceiling is very high.

The course argues that a chatbot sounding human-like is weak evidence about what is happening inside it. Why?

Fluency is precisely what a text predictor optimised on human writing should produce — it is the target, not a side effect. So it is the one piece of evidence such a system will emit whether or not anything mind-like is inside. That doesn't settle the deeper question either way; it just means fluency can't settle it.

Byte-pair encoding builds its vocabulary by...

It is a greedy frequency loop: find the commonest adjacent pair, glue it into a new symbol, repeat tens of thousands of times. Nobody decides that 'ing' is a meaningful suffix — it survives because it was common. The model's perceptual atoms are a compression statistic, not a linguistic theory.

Why is one-character-per-token rejected even though it never hits an unknown word?

Character tokens solve coverage but explode sequence length — 'understanding' becomes thirteen positions instead of one. Since attention makes every position read every other position, cost grows sharply with length. BPE is the compromise: frequency buys brevity, with characters kept underneath as a fallback so nothing is ever unrepresentable.

What pressure causes 'cat' and 'dog' to end up near each other in embedding space?

The table starts as noise and is shaped purely by the prediction job. Words used in the same sentences call for the same predictions, so training pulls them together — the distributional hypothesis turned into geometry. Token IDs, by contrast, carry no information at all: 4919 and 4920 could be 'apple' and 'apprehend'.

What did Nissim and colleagues (2020) show about the famous king − man + woman ≈ queen result?

There is real directional structure in embedding space — but the celebrated demo is weaker evidence for it than its fame suggests, because the search is forbidden from returning the boring answer. The vectors often barely moved. Real structure, oversold demo.

Grounded in trusted sources

  • Ashish Vaswani et al., 'Attention Is All You Need', NeurIPS 2017 — https://arxiv.org/abs/1706.03762
  • Tom B. Brown et al., 'Language Models are Few-Shot Learners' (GPT-3, 175 billion parameters), 2020 — https://arxiv.org/abs/2005.14165
  • Jared Kaplan et al., 'Scaling Laws for Neural Language Models', 2020 — https://arxiv.org/abs/2001.08361
  • Jordan Hoffmann et al., 'Training Compute-Optimal Large Language Models' (Chinchilla), 2022 — https://arxiv.org/abs/2203.15556
  • Long Ouyang et al., 'Training language models to follow instructions with human feedback' (InstructGPT), 2022 — https://arxiv.org/abs/2203.02155
  • Adam Tauman Kalai, Ofir Nachum, Santosh Vempala, Edwin Zhang, 'Why Language Models Hallucinate', OpenAI, 2025 — https://arxiv.org/abs/2509.04664
  • Rylan Schaeffer, Brando Miranda, Sanmi Koyejo, 'Are Emergent Abilities of Large Language Models a Mirage?', NeurIPS 2023 — https://arxiv.org/abs/2304.15004
  • Jason Wei et al., 'Emergent Abilities of Large Language Models', TMLR 2022 — https://arxiv.org/abs/2206.07682

Every Wunder lesson is built from real, reputable sources — never invented.

Related Science courses

Wunder is a personalized learn-anything platform — tell it any topic and it builds a beautiful, fact-checked course in minutes, with narration, a knowledge check, and a college-style University track.

Browse more Science courses · All topics · Home

© 2026 Wunder Learning LLC · Terms & Privacy