★ FOUR BRAND-NEW COURSES ANNOUNCED! ★ Machine Learning End To End  •  Hands-On Deep Learning with Python  •  Generative AI & LLMs with Python  •  AI Agents and Agentic AI with Python  ★  Open the “Educational” menu above to explore them ★  ★  NEW! 5. JOB ASSISTANCE: JD Report • Resume customization • AI Mock Interviews — FREE with course bundles, or just ₹499 / US$5. Single Payment. No Subscription. ★★ FOUR BRAND-NEW COURSES ANNOUNCED! ★ Machine Learning End To End  •  Hands-On Deep Learning with Python  •  Generative AI & LLMs with Python  •  AI Agents and Agentic AI with Python  ★  Open the “Educational” menu above to explore them ★  ★  NEW! 5. JOB ASSISTANCE: JD Report • Resume customization • AI Mock Interviews — FREE with course bundles, or just ₹499 / US$5. Single Payment. No Subscription. ★★ FOUR BRAND-NEW COURSES ANNOUNCED! ★ Machine Learning End To End  •  Hands-On Deep Learning with Python  •  Generative AI & LLMs with Python  •  AI Agents and Agentic AI with Python  ★  Open the “Educational” menu above to explore them ★  ★  NEW! 5. JOB ASSISTANCE: JD Report • Resume customization • AI Mock Interviews — FREE with course bundles, or just ₹499 / US$5. Single Payment. No Subscription. ★★ FOUR BRAND-NEW COURSES ANNOUNCED! ★ Machine Learning End To End  •  Hands-On Deep Learning with Python  •  Generative AI & LLMs with Python  •  AI Agents and Agentic AI with Python  ★  Open the “Educational” menu above to explore them ★  ★  NEW! 5. JOB ASSISTANCE: JD Report • Resume customization • AI Mock Interviews — FREE with course bundles, or just ₹499 / US$5. Single Payment. No Subscription. ★

How a next-token predictor drafts a paragraph, and why it rambles

How a next-token predictor drafts a paragraph, and why it rambles
12-10-2026  |  By Tejas Desai, Ecube Analytics  |  Generative AI: Tokenization & decoding (Chapter 2)  |  3 min read
READ 8TH OF 8 IN THIS SERIES

How a next-token predictor drafts a paragraph, and why it rambles

Tokenization & decoding · Part 8 of 8

A skeptical manager asks: “Explain, in terms our editors can follow, how a model that only predicts the next token can draft a paragraph, and why it sometimes rambles.” After seven posts, you can answer exactly that.

The loop

Drafting a paragraph is one tiny step repeated hundreds of times:

  1. Turn the prompt into tokens.
  2. Run the model once: it gives a probability for every possible next token.
  3. Pick one with the decoding rule (greedy, beam, or sampling with temperature, top-k and top-p).
  4. Append it to the text and go back to step 2.
  5. Stop at the end-of-text token or at a length limit.
The generation loopPrompt tokens go into the model, which gives probabilities for the next token; one is picked and appended, and the loop repeats.Promptas tokensLanguage modelreads all tokens so farProbabilitiesone per vocabulary itemPick onethe decoding ruleAppendto the textrepeat, one token at a time, until an end-of-text token or the length limittemperature · top-k · top-p · beamWriting a paragraph is this loop, run hundreds of timesNothing else: there is no plan, no outline, only the next token.
The whole of text generation. There is no outline or plan, only the next token, again and again.

Each token is chosen knowing everything written so far, which is why the text is usually fluent and consistent from word to word. The model learned fluent continuations from an enormous amount of text.

Why it sometimes rambles

  • No plan. The model does not decide where the paragraph is going. It only decides the next token, so it can drift.
  • Mistakes are never undone. A poor token early on becomes part of the context for everything after it, and greedy decoding cannot go back.
  • Greedy loops. Always taking the most likely word can fall into repeating itself. Our count-table model shows a version of this: with a long context it copies its training text, as in “The warehouse opens at the works together to worry. At night the start”.
  • Too much heat. At a high temperature unlikely tokens get picked and the text wanders into nonsense.
  • Training is not generation. With teacher forcing, the model is trained on true history but generates from its own, so small slips can compound.

What an editor can do

Lower the temperature or use top-p around 0.9 for steadier text; set a length limit and a sensible stop; and remember that the model writes fluent text because it has seen a lot of it, not because it has checked the facts. The next time a draft rambles, you will know which of the five causes to suspect.

The one-sentence answer. A language model drafts a paragraph by predicting one token at a time and appending it, and it rambles because nothing in that loop plans ahead or looks back.

Takeaways

  • Generation is one loop: tokens in, probabilities out, pick one, append, repeat.
  • There is no plan, only the next token, which explains both fluency and drifting.
  • Rambling comes from drift, uncorrected mistakes, greedy loops, high temperature and the training/generation gap.
  • Decoding settings are the main control you have over how adventurous the text is.

That completes the series. The chapter in the course goes further, with a full hands-on lab, a self-test and optional deep-dives.

This blog is from chapter 2, course-2-generative-ai of 4 world-class courses on aibits.ecubeanalytics.com
← Previous Article 8 of 8 in this series