How LLMs and agents actually work.
The theory behind tokens, context, attention, RAG, tools, MCP and agents — in ten short animated reels. Checked against the field, and corrected where the usual explanation goes wrong.
Reel 01From algorithms to LLMs· 01/05 Open
0:00 / 1:06
From algorithms to LLMs
An algorithm solves a task you can write down. AI solves the ones you can't.
Reel 01 · 1:06
From algorithms to LLMs
From algorithms to LLMs. An algorithm solves a task you can write down. AI solves the ones you can't.
The reels
Ten films, one topic each, in the order they build on one another. Each ends with the next one queued; the terms under a card are what it teaches.
Checked against the field
The usual explanations get the big picture right. These are the places where the precise statement differs from the one you usually hear — each also appears inside the reel it belongs to, as a “Checked” note.
01 · Training
Usually said · Machine learning: the model is given data and the correct answers.
Precisely · That is supervised learning. An LLM is pre-trained self-supervised: the text itself is the answer — the model predicts the next token and the real one is the label. Human answers come later, in post-training.
02 · The map
Usually said · AI ⊃ machine learning ⊃ deep learning ⊃ neural network ⊃ LLM.
Precisely · A neural network is the model family, not a level: deep learning is machine learning with deep networks. Shallow networks live outside deep learning. The nesting is AI ⊃ ML ⊃ DL ⊃ LLM.
03 · Output
Usually said · The model outputs the probability of the next word.
Precisely · The next token — a piece of a word, from a vocabulary of tens to hundreds of thousands of entries. Cost and context are counted in tokens, not words.
04 · Decoding
Usually said · The most probable token goes next.
Precisely · Only with greedy decoding. By default the next token is drawn from the distribution; temperature reshapes it and top-p / top-k trim the tail. That is why the same prompt gives different answers.
05 · Reproducibility
Usually said · At temperature zero the same prompt gives the same answer, a hundred times out of a hundred.
Precisely · A strong tendency, not a guarantee: batched GPU inference, floating-point order and mixture-of-experts routing make identical calls diverge now and then. A seed is best-effort.
06 · Embeddings
Usually said · In RAG the prompt becomes a vector, as we saw with tokens.
Precisely · Two different things. The LLM maps each token id to an input vector, and its layers build contextual representations. RAG uses a separate embedding model that turns a whole chunk or query into one vector — query and chunks must go through the same one.
07 · Transformer
Usually said · Attention understands the importance and the position of tokens relative to each other.
Precisely · Attention computes relevance: how much each token should look at each other token. Order is injected separately by positional encodings (rotary, mostly). The two together are why “not” binds to the right verb.
08 · Context
Usually said · The more context you give the model, the better and fuller the answer.
Precisely · More relevant context helps. More tokens as such degrade quality well before the window is full (lost-in-the-middle, context rot). Compaction and prompt caching are the working tools — the second half of the saying, “junk makes it worse”, is the rule.
09 · Retrieval
Usually said · Search finds the nearest vectors to the prompt.
Precisely · Production retrieval is hybrid: lexical search plus vectors, then a reranker, then a token budget. In agentic setups the model decides to search by calling a tool — the search still runs outside the model.
10 · Hallucinations
Usually said · The model does not think in right and wrong, so it can't be fixed.
Precisely · Models carry internal uncertainty; training and benchmarks reward a confident guess over “I don't know”, so guessing is learned. It can't be eliminated, but grounding, tool verification, an allowed abstain and clean context each cut it.
11 · Tool calling
Usually said · The model either answers “I don't know” or calls an external tool.
Precisely · And the result comes back into the context as a message the model reads before it continues. Tools are declared up front as schemas; the choice to call one is made per step.
12 · MCP
Usually said · GitHub → MCP → GPT: the service returns a set of tools for the model.
Precisely · The Model Context Protocol (open standard, Nov 2024) connects an MCP client in the host app to MCP servers, over stdio or HTTP. Servers expose tools, resources and prompts; the model only ever sees tools. Right if “GPT” means the whole app.
13 · Agents
Usually said · The agent thinks, acts, checks and repeats.
Precisely · The loop runs in the harness; every model call is stateless and gets the observation fed back. State is the harness's bookkeeping — step, open calls, budget, permissions. Add a stop condition and a budget or the loop never ends.
14 · Orchestration
Usually said · A reviewer agent gets an empty context because it didn't write the code.
Precisely · Isolation is the whole point: no anchoring on the author's reasoning, no polluted window, and the sub-agents can run in parallel. That is the case for orchestration in one line.
15 · Skills
Usually said · Skills are reusable instructions you load when needed.
Precisely · What makes them more than a longer system prompt: a skill's body enters the context only when the task matches, so fifty skills cost a few lines until one is used. They can bundle scripts and files, not just text.
16 · Ways of working
Usually said · AI engineering: expertise in development — required; expertise in AI — not needed.
Precisely · Decomposing work for agents, writing specs, managing context and noticing when the model went the wrong way is AI expertise. Both ways of working need the theory; vibe coding trades code review for speed, AI engineering keeps it.
17 · Terms
Usually said · “Web coding”; GPT as the architecture that brought AI to the masses.
Precisely · Vibe coding (early 2025: “don't read the code”). The architecture is the Transformer (2017); GPT is one family's name; the mass moment was a chat product on top, late 2022.