# What a model actually does: prediction, not understanding
Type "The capital of France is" into any AI tool and it will say "Paris." It feels like the model *knows* this. It doesn't. It just calculated that "Paris" is the most likely word to come next, based on patterns in billions of sentences it was trained on. The answer is correct, but the mechanism is prediction, not knowledge.
This one idea explains almost everything weird about working with AI: why prompts matter so much, why the same question gives different answers, and when you should double-check before you trust.
You already use prediction every day. Your phone suggests the next word as you text. Type "I'll be there in five," and it offers "minutes." That's a tiny autocomplete trained on common phrases.
A large language modellarge language modelA Large Language Model is an AI system trained on vast text data to predict and generate language, enabling tasks like writing, summarizing, and answering questions.Voir la définition complète → (LLM, the technology behind ChatGPT, Claude, and Gemini) is the same idea, scaled up massively. It has read an enormous slice of the internet, books, and code, and learned the statistical patterns of how language flows.
When you ask it something, it does not look up an answer in a database. It generates a response one tokentokenA token is the basic unit of text that language models process, often a word fragment, whole word, or punctuation mark rather than a single character.Voir la définition complète → at a time. A tokentokenA token is the basic unit of text that language models process, often a word fragment, whole word, or punctuation mark rather than a single character.Voir la définition complète → is a chunk of text, usually a word or part of a word ("walking" might be "walk" + "ing"). For each tokentokenA token is the basic unit of text that language models process, often a word fragment, whole word, or punctuation mark rather than a single character.Voir la définition complète →, the model asks: *given everything so far, what comes next?*
It picks a likely tokentokenA token is the basic unit of text that language models process, often a word fragment, whole word, or punctuation mark rather than a single character.Voir la définition complète →, adds it, then repeats. A whole essay is just this guessing game running thousands of times.
Because it has seen so much text, the model's predictions are often genuinely useful. It has absorbed how legal contracts are phrased, how Python functions are structured, how a polite email opens. That's real, valuable pattern-matching.
But it is still pattern-matching. The model has no concept of *true* or *false*. It has a concept of *likely* or *unlikely*. Usually those overlap. Sometimes they don't, and that gap is where things go wrong.
Ask ChatGPT "Give me a name for my coffee shop" three times and you'll get three different lists. This surprises people. Shouldn't a computer be consistent?
Here's why it isn't. At each step, the model doesn't just pick the single most likely tokentokenA token is the basic unit of text that language models process, often a word fragment, whole word, or punctuation mark rather than a single character.Voir la définition complète →. It picks from a range of likely options, with some randomness mixed in. This is controlled by a setting called temperature.
Most chat tools run at a medium temperature by default, which is why you get fresh answers each time. If you use the APIAPIApplication Programming Interface: a standardised interface that lets applications communicate and exchange data without knowing each other's internal workings.Voir la définition complète → (the developer interface for sending requests directly to the model), you can set this yourself:
from openai import OpenAI
client = OpenAI()
response = client.chat.completions.create(
model="gpt-5",
temperature=0.2, # low = more consistent, focused answers
messages=[
{"role": "user", "content": "Name 3 ideas for a coffee shop."}
]
)
print(response.choices[0].message.content)Set temperature=0.2 and run it twice: the answers will be very similar. Set it to 1.0 and the lists will diverge wildly. Same prompt, different dice roll.
Practical takeaway: for creative brainstorming, embrace the variation. For tasks where you need consistency (data extraction, classification, formatting), lower the temperature or run the task in the APIAPIApplication Programming Interface: a standardised interface that lets applications communicate and exchange data without knowing each other's internal workings.Voir la définition complète → where you control it.
A hallucinationhallucinationA hallucination is when an AI model generates output that is fluent and confident but factually wrong, fabricated, or unsupported by its source data.Voir la définition complète → is when the model states something false with total confidence. It invents a court case, a research paper, a quote, or a statistic that does not exist.
Once you understand prediction, this stops being mysterious. The model's job is to produce *plausible* text. A fake citation like "Smith et al., 2019, *Journal of Applied Linguistics*" looks exactly like a real one. It fits the pattern. The model has no internal fact-checker saying "wait, does this paper actually exist?" It just continues the most likely sequence.
This is why hallucinations are most dangerous when:
The model would rather give you a confident, fluent wrong answer than say "I don't know," because fluent answers are what it was trained to produce.
If the model predicts based on context, then the context you give it is your steering wheel. Better input means better predictions.
The model continues whatever pattern you set up. So set up a good one.
Weak prompt:
> Write about marketing.
Strong prompt:
> You are a marketing advisor for a small bakery. Write 3 specific Instagram post ideas for promoting a new sourdough loaf. Keep each under 40 words.
The second prompt gives the model a role, a topic, a format, and a constraint. That narrows the prediction toward exactly what you want.
Don't rely on the model to recall obscure details. Paste them in. If you want a summary of a specific report, give it the report. This technique, feeding the model the source material, dramatically reduces hallucinationhallucinationA hallucination is when an AI model generates output that is fluent and confident but factually wrong, fabricated, or unsupported by its source data.Voir la définition complète → because the model now predicts from *your* text, not its hazy memory.
> Here is our Q3 sales data: [paste]. Summarize the top 3 trends in plain English.
You can prompt the model to flag when it's guessing:
> Answer this question. If you are not confident or don't have the information, say so explicitly instead of guessing.
This doesn't make the model perfect, but it nudges the predicted text toward honesty. For a deeper, free guide on writing effective prompts, OpenAI's prompt engineering guide is a solid starting point.
Vérification des acquis
1. When you type "The capital of France is" and an LLM responds "Paris," what is actually happening under the hood?
2. According to the lesson, what is a "token" in the context of how an LLM generates text?
3. The lesson compares an LLM to your phone's autocomplete. What is the key difference it highlights?
4. Select ALL correct answers about what the lesson says regarding an LLM's relationship to truth and knowledge.
Sélectionnez toutes les réponses correctes.
5. Select ALL correct answers about why understanding "prediction, not understanding" is described as so important.
Sélectionnez toutes les réponses correctes.
Prediction is reliable for some tasks and risky for others. Here's a simple rule of thumb based on what the model is actually doing.
Generally safe (the model transforms text you gave it):
Verify carefully (the model recalls or invents facts):
A useful mental shortcut: the model is strongest when it's *processing* information you handed it, and weakest when it's *retrieving* information from memory.
Modern versions of ChatGPT, Claude, and Gemini can now browse the web or use connected tools. When a model searches and cites a live source, it's far more trustworthy, because it's predicting from real fetched text rather than memory. But still click the link. Sometimes the model summarizes a source incorrectly or cites a page that doesn't say what it claims.
Stop treating the AI like a search engine or an oracle. Treat it like a brilliant, fast, slightly overconfident intern who has read everything but remembers details imperfectly.
You wouldn't send an intern's first draft to a client without reading it. You wouldn't trust their memory of a specific legal clause without checking the document. But you'd absolutely use them to draft, brainstorm, reformat, and explain.
That's exactly the right relationship with an LLMLLMA Large Language Model is an AI system trained on vast text data to predict and generate language, enabling tasks like writing, summarizing, and answering questions.Voir la définition complète →. It predicts; you verify and decide.