How GenAI Works

Generative AI works by predicting the next token: it converts text into tokens, weighs them against each other, and repeatedly picks the most likely continuation - which is prediction, not reasoning or retrieval.

Almost every surprising AI behaviour makes sense once you accept that the model is predicting the next token and nothing else. This walks through the machinery that makes that prediction.

Open How GenAI Works on Testing Titbits Playground · 2-3 min · GenAI Basics · Free, no sign-up

How to read it

  1. Watch text become tokens.
  2. See the model weigh what came before.
  3. Watch a probability distribution over possible next tokens.
  4. See one get chosen, and the loop start again.

What you will learn

Frequently asked questions

How does generative AI work?

It breaks input into tokens, weighs every token against the others to build a picture of the context, produces a probability distribution over possible next tokens, picks one, and repeats. There is no lookup and no deliberate reasoning step.

Why does AI hallucinate?

Because it predicts a plausible continuation rather than retrieving a fact. A confident wrong answer and a confident right answer are produced by exactly the same process, which is why output must be verified rather than trusted.

Does the model understand what it is saying?

It models the statistics of language extremely well. Whether that constitutes understanding is a debate; for testing purposes, treat every output as an unverified claim.

More free games and infographics for testers

Created by Rahul Parwal · TestingTitbits.com