Part II · Chapter 6 of 42

How an LLM Turns a Prompt into a Response

Tokens, training, and parametric memory

Strip away the product chrome and an LLM does one thing: given a sequence of text, it predicts the next small piece of text, appends it, and repeats until an answer exists. Every measurement and optimization decision later in this book follows from the mechanics of that loop. This chapter covers the mechanics that matter: tokens, prediction, temperature, training data, cutoffs, and why a model states wrong things with total confidence. No transformer-architecture tourism; just the properties you will use.

Tokens and prediction

A model never reads words. Before text reaches the model, a tokenizer splits it into tokens: chunks of characters, usually a word, part of a word, or a punctuation mark. Tokenizers are built by counting frequency across a large text corpus, so strings that appear often in that corpus get their own compact token, and rare strings get assembled from fragments. A famous brand name is often a single token; an obscure or oddly spelled one gets broken into several pieces, the same pieces that also spell out unrelated words.

Generation runs one token at a time. At each step the model produces a probability for every token in its vocabulary, one gets selected, and the sequence grows by that token. When a model recommends your competitor, that recommendation was a chain of these single-token choices, each one shaped by the statistical associations the model learned in training. There is no lookup step, no database of brands, and no ranked list sitting anywhere inside the model waiting to be read out.

Temperature: why the same prompt gives different answers

The selection step is sampled, and a setting called temperature controls how much randomness the sampling adds. At temperature zero the model picks the most probable token every time; at the settings consumer products actually run, lower-probability tokens win some of the time on purpose, because that makes the writing less repetitive. So the same prompt, on the same model, produces different answers on different runs, by design.

For visibility work this is the single most important property in the chapter. One answer is one sample from a probability distribution. A brand missing from one run may appear in the next, and checking a prompt once tells you almost nothing. The sampling protocol that deals with this, running each prompt repeatedly and measuring share of answers, is in Measuring AI Search Visibility.

Training data, weights, and the cutoff

Training feeds the model enormous amounts of text, largely web crawls plus licensed and curated datasets, and adjusts its parameters, the weights, until its next-token predictions match that text well. Where the text comes from, and which bots collect it, is covered in Where the Machines Get Their Data: Crawlers, Indexes, and Training Pipelines. What matters here is what the weights are: a lossy statistical compression of the training text. Engineers call the result parametric memory. Your brand exists in there as a pattern of associations with your category, your competitors, and the words people used when writing about you. It is never stored as a record, so nothing about you can be looked up, corrected, or deleted; the associations can only be overwritten by the next training run.

Training also stops. Every model has a knowledge cutoff, the point after which nothing new entered its memory.OpenAI publishes each model's cutoff in its model documentation; the current GPT-5.6 models list a cutoff of February 16, 2026. Other providers publish theirs in model cards. A model serving answers today may be working from a snapshot of your pricing, product line, and reputation that is months to years old, and everything you have shipped since the cutoff is invisible to its memory. Live web search papers over some of this, and Model Memory and Live Retrieval puts numbers on how much.

Fame is a gradient in the weights

Compression keeps what repeats. A brand written about across thousands of independent pages, over years, shows up as a strong, stable pattern in the weights; a brand mentioned on forty pages shows up faintly or not at all. So when the model predicts which brand name comes after "the best project management tool is", the strongly represented names carry most of the probability. This is mechanical, and it is why model memory favors famous brands: fame in training data means accumulated coverage, and accumulated coverage is what the weights preserve. The evidence for which kinds of coverage correlate with being named is in What Actually Correlates with AI Search Visibility.

Confident and wrong

The loop always produces a next token. When the weights hold a strong pattern, the output tracks reality; when they hold a weak or conflicting pattern, the model still emits fluent, grammatical, confident text, because fluent text is exactly what training rewarded. Hallucination is this second case, and it is a natural output of prediction rather than a malfunction. The model has no internal check that distinguishes remembering from inventing; both feel identical from inside the loop, and both read identically to the user.

For your brand the risk is specific: a weakly represented company gets its facts filled in from the category average. Plausible but wrong pricing, a product you discontinued, a competitor's feature attributed to you. The mitigations run through the rest of this book: consistent facts everywhere machines look, in Entities: Becoming a Thing the Machine Knows, and retrievable current pages the answer can be grounded in, in Retrieval and Grounding: How an AI Answer Gets Assembled.

Hold on to the four properties. Answers are sampled, so measure repeatedly. Memory is compressed coverage, so obscurity is a representation problem. Memory is frozen at the cutoff, so recency is a retrieval problem. And prediction fills gaps with plausible text, so wrong brand facts are an expected failure mode you check for rather than a surprise.