AI, Actually ExplainedLesson 22 of 92

Module 3 · What a chatbot is actually doing

One chunk at a time, and it cannot take it back

In this lesson

  • 9 min read
  • 6 reading sections
  • Knowledge check
  • Lesson 3 of 11 in this chapter

This chapter’s goalTrace text through tokenisation and next-token generation, distinguish training from inference, and explain how attention, decoding, context management, retrieval and product controls affect an assistant. Check sources instead of treating fluent answers or citations as proof.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmWatch11:01Watch12:27
Full audiobookNot availableNot available

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 8Free · no account needed
Lesson steps

The whole loop

Here is a simplified five-step description of autoregressive text generation. It describes the output loop, not every architecture, cache, tool or verification step around it.

  1. Prepare the available input tokens: instructions, the selected conversation and any other supplied material.
  2. Compute next-token scores over the model’s vocabulary, using the current prefix.
  3. A decoding procedure selects a token, either greedily or by another strategy such as sampling.
  4. Append the selected token to the sequence.
  5. Continue until a stopping condition is reached, usually reusing cached calculations where supported.

For a toy illustration, a model might assign a high next-token probability to Paris after “The capital of France is”. Those hypothetical scores describe a continuation, not confidence in a fact. After the token is appended, the next prediction depends on the extended prefix.

Autoregressive means generating later output conditioned on the preceding sequence. Several useful consequences follow, with important qualifications.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Stuck on something?Ask Meenal, your AI tutor

How to cite: Addaly (2026) ‘One chunk at a time, and it cannot take it back’, in AI, Actually Explained. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/ai-actually-explained/the-next-word-game (Accessed: 29 November 2026).