Practical AI Foundations

How AI actually works

What you'll learn

Estimated time: 6 minutes

A language model does not look anything up. It reads your prompt as a run of tokens, small chunks of text, and predicts the most likely next token, then the next, until the response is done. That one mechanism, learned once during training and then run again every time you ask a question, explains why identical prompts can produce different answers and why a wrong statement can still sound completely sure of itself.

  • Describe what a token is and what "predicting the next one" means in plain terms.
  • Distinguish training, when the model learns patterns once, from inference, when it answers you.
  • Explain why an identical prompt can produce two different answers.
  • Explain why a confident, well-formatted answer can still be invented.

Video lesson

The animation follows one prompt through tokens and next-word prediction, then runs the same prompt twice to show answers varying, and asks about a fictional business to show a confident answer being invented.

Prediction, one piece at a time

Before a model reads your message, it breaks the text into tokens: whole words, word fragments or punctuation, depending on the language and the term. It then works out one of the most likely next tokens given everything so far, adds that token to the sequence, and repeats. A whole answer is thousands of small, one-step guesses, each shaped by the one before it.

Nothing is fetched from a filing cabinet. The "knowledge" is a pattern, learned from an enormous amount of text, about which words tend to follow which other words in which contexts. That pattern is usually a good guide to a correct answer. It is not the same thing as checking a fact.

Training happens once; answering happens every time

Training is the slow, expensive part: the model is shown huge volumes of text and its internal patterns are adjusted until its predictions get consistently better. That process finishes long before you open a chat window. Answering you, called inference, reuses those fixed patterns; it does not add new ones. A model’s core knowledge is frozen at a training cut-off date and does not update itself between sessions.

When a tool tells you it searched the web or read a connected file, that is a separate step layered on top of prediction, not a change to the model itself. Without that extra step, the model only has what it learned during training.

Why answers vary, and why a wrong one can sound right

Open two new chats and ask the identical question in both: "Suggest a one-line tagline for a neighbourhood bakery." One answer might come back as "Small oven, big flavour, every morning." The other, from the same model and the same prompt, might read "Fresh bread, five minutes from your door." Neither is wrong. At each step the tool weighs several likely next tokens and deliberately does not always take the single top-ranked one; that built-in variation, not a lookup of one fixed correct answer, is why two runs of the same prompt can land on two different, equally reasonable sentences.

The same mechanism explains a more serious failure. Ask "How many staff work at Bellbird Bakery, and where does that number come from?" for a business that does not exist, and a model can still answer: "Bellbird Bakery employs approximately 18 staff across its two locations, based on its most recent annual report." There is no such report. The model produced the most plausible-looking sequence of words it could, including a citation format it has seen thousands of times, with no built-in step that checks whether Bellbird Bakery or that report is real. This is what people mean by hallucination: a fluent, confident answer built from pattern, not from a verified fact.

Put it into practice

1. Prepare your practice material

Write three to five sentences describing a real or fictional situation in which you need to explain in plain terms how a language model produces an answer, and why answers vary or go wrong. Include the intended user, one constraint and how you will check the result.

2. Choose your AI tool

Choose one tool for this exercise. The remaining steps will adapt to it.

3. Copy the prompt

Prompt you will use

Open your AI tool in two separate new chats and ask the identical question in both: "Suggest a one-line tagline for a neighbourhood bakery." Compare the two answers. Then, in a third chat, ask about a business or fact you know does not exist and request a source. Check whether that source is real.

4. Open ChatGPT · Paste the prompt into a new chat

Open a new chat in ChatGPT and paste the copied prompt into the message box.

Open ChatGPT

5. Add your practice material

Paste your prepared scenario beneath the prompt, separated by a heading such as “Practice scenario”.

6. Send, then review the result

Answer any clarifying questions. Before using the result, check it against your source and the completion checks below.

Before you continue

You can explain in one sentence what a token is and what the model predicts next.

You know the difference between training and answering (inference).

You have seen, in practice, why an identical prompt can produce two different answers.

You can explain why a confident, well-formatted answer can still be invented.