Section 2 · Questions 32–50
How AI models work
Learning from examples
Machine learning is a way of making a program by showing a computer examples instead of writing its rules by hand. To build a spam filter, nobody lists the warning signs; the filter is shown thousands of emails marked spam or not spam, and it finds its own rule.
It takes three things:
- A model. A function with adjustable numbers, called parameters. A straight line has two, its slope and its intercept; a large language model has billions.
- Data. Examples of the behavior wanted, such as emails with their labels.
- A loss. One number that says how far the model’s outputs are from what the data say they should be.
TrainingHow does training adjust the weights? Q34 → nudges the parameters, a little at a time, to make the loss smaller, in the hope that what works on the training examples also works on new ones (Goodfellow et al., 2016).
The right answers can come from people’s labels, from the data itself, such as the next word of a text, or from a score for what the model did (reinforcement learningWhat is reinforcement learning? Q35 →). A chat model is trained in all three ways. Because the loss decides what counts as better, a model learns whatever it rewards, including things nobody intended.
Source Goodfellow et al., Deep Learning (2016).
A neural network is a model built from many simple units, called neurons, arranged in layers. Each neuron multiplies each incoming number by a weight, adds them up with a fixed offset, and passes the sum through a simple nonlinear function, such as the ReLU, which keeps positive numbers and turns negative ones into zero. The result goes on to the next layer. Stacking layers builds complicated functions out of these simple steps (Goodfellow et al., 2016).
Two kinds of numbers are involved. The weights are the learned parametersWhat is machine learning? Q32 →: fixed once training ends and the same for every input. The activations are what the neurons output for one particular input, worked out afresh each time.
The distinction organizes interpretabilityWhat is interpretability? Q5 → research. Some methods read the activations on a given input; others study the weights directly, reading circuitsCircuit: A set of connected parts inside a network that together do one job: features linked by weights, in which earlier features combine to compute a later one. Q157 →: the weighted connections through which the patterns one layer detects (its features) compute the features of later layers (Olah et al., 2020).
Sources Goodfellow et al., Deep Learning (2016); Olah et al., Zoom In: An Introduction to Circuits (2020).
A little at a time, by nudging every weight in whichever direction lowers the lossWhat is machine learning? Q32 →. The weightsWeights: The numbers inside a model that training sets; they stay fixed afterward and are the same for every input. Q33 → are the numbers inside a model that training can change. The loss is one number that says how far the model’s outputs are from what the data say they should be. One training step has three parts:
- Forward pass. Run a small batch of training examples through the network and compute the loss.
- Backward pass. Work out, for every weight, how fast the loss would rise if that weight alone were nudged up. These slopes together are the gradient. Backpropagation finds them all by applying the chain rule of calculus backward through the layers, for about the cost of one more pass (Rumelhart et al., 1986; Baydin et al., 2015).
- Update. Move every weight a small step against its slope, a step whose size η is the learning rate:
Then repeat on fresh batches. This is gradient descent, like walking downhill in fog by always stepping where the ground slopes down most steeply. It finds a low point near where it starts, not necessarily the lowest one (Goodfellow et al., 2016). Nearly every model discussed in alignment is trained this way.
Sources Goodfellow et al., Deep Learning (2016); Rumelhart et al., Learning representations by back-propagating errors (1986); Baydin et al., Automatic differentiation in machine learning: a survey (2015).
Reinforcement learning trains an agent to act well in an environment by trial and error. Say a model is asked for 17 × 3. It tries 41, and a checker gives it a reward of 0. It tries 51 and gets a reward of 1, so training makes that answer more likely. In general, at each step the agent observes the environment’s state, chooses an action, and receives a new state and a number called the reward. Its goal is to collect as much reward as possible over time (Sutton and Barto, 2018). Its rule for choosing actions is its policy, and a language model is already one: given the text so far, it gives a probability for every possible next word or piece of a word, its next tokenWhat is a language model? Q36 →.
Nobody tells the agent the right action; it learns from the consequences of its choices, which often arrive late. Policy-gradient methods raise the probability of actions whose results beat a baseline, an estimate of the result to expect (Williams, 1992). PPO (Schulman et al., 2017) and GRPO (Shao et al., 2024), widely used to train language models, build on this. A language model’s reward may come from human ratings, a reward modelReward model: A model trained on human or AI judgments to score outputs, used as the reward when training another model. Q57 → trained on them, or tests that check its code.
Rewards usually count only within an episode, one run from a start to a reset, so a policy has no direct reason to care about what happens after it ends.
Sources Sutton and Barto, Reinforcement Learning: An Introduction (2nd edition) (2018); Williams, Simple statistical gradient-following algorithms for connectionist reinforcement learning (1992); Schulman et al., Proximal Policy Optimization Algorithms (2017); Shao et al., DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models (2024).
How a language model works
A language model predicts the next piece of text. Given “The capital of France is,” it gives every tokenToken: A word or piece of a word, the unit of text a language model reads and writes. Q37 → in its vocabulary a probability of coming next: “Paris” a high one, “a” and “the” small ones, nearly everything else almost none. A token is a word or a piece of a word (see how text becomes tokensHow does a model turn text into numbers? Q37 →).
To produce those probabilities, the model’s last layer gives each token a raw score, called a logit, and a function called the softmax turns the scores into probabilities that are positive and add up to one (Jurafsky and Martin, 2026).
It learns by being scored on real text. At every position in its training data, the loss is its surprise at the token that actually came next: minus the log of the probability it gave that token. Pretraining, the first and largest stage of training, is lowering that loss across a vast amount of text (Bengio et al., 2003).
Sources Bengio et al., A Neural Probabilistic Language Model (2003); Jurafsky and Martin, Speech and Language Processing (3rd ed. draft) (2026).
By cutting the text into words and pieces of words, then replacing each one with a list of numbers. It takes three steps:
- Split into tokens. A tokenizer breaks the text into pieces. Common words become one token each and rarer words are split, so “The capital of France is” becomes five tokens. The vocabulary of pieces is learned beforehand (Sennrich et al., 2015).
- Look up each token’s number. Each token is replaced by its position in that vocabulary, its token ID.
- Turn each number into a vector. Each ID picks out one row of a table the model learns in training, the embedding matrix: a list of hundreds or thousands of numbers that becomes that token’s vector. Words used in similar contexts end up with similar vectors (Bengio et al., 2003; Mikolov et al., 2013a).
From then on the model works only with these vectors.
Sources Sennrich et al., Neural Machine Translation of Rare Words with Subword Units (2015); Bengio et al., A Neural Probabilistic Language Model (2003); Mikolov et al., Efficient Estimation of Word Representations in Vector Space (2013a).
Because predicting text well requires knowing what the text is about. The training itself is simple: take a passage, have the model predict every next token (a word or piece of a word) at once, each position seeing only the tokens before it, compare each prediction with the token that actually came next, and adjust the weights to lower the lossHow does training adjust the weights? Q34 →. Then repeat across a large share of the written internet.
To guess the next line of a proof, a translation, a program or a conversation, it helps to represent the mathematics, both languages, what the code does or what the speakers want. Andreas (2022) argues that because text is written by people with beliefs and goals, good prediction pushes models to infer properties of the likely author. GPT-3, at 175 billion parameters, could do many tasks from a few examples in its promptWhat is in-context learning? Q46 → (Brown et al., 2020).
How deep that modeling goes is disputed. Bender and Koller (2020) argued that form alone cannot teach meaning. Yet a transformerTransformer: The neural-network design behind nearly all large language models, built from stacked layers of attention and MLP blocks. Q39 → trained only on Othello moves built an internal boardCan a model trained only to predict sequences learn a model of the world? Q186 → (Li et al., 2022), though stricter tests find such internal models are often incoherent (Vafa et al., 2024).
Sources Andreas, Language Models as Agent Models (2022); Brown et al., Language Models are Few-Shot Learners (2020); Bender and Koller, Climbing towards NLU: On Meaning, Form, and Understanding in the Age of Data (2020); Li et al., Emergent World Representations: Exploring a Sequence Model Trained on a Synthetic Task (2022); Vafa et al., Evaluating the World Model Implicit in a Generative Model (2024).
A transformer is the neural-networkWhat is a neural network? Q33 → design behind nearly all of today’s large language models (Vaswani et al., 2017). Follow “The capital of France is” through it:
- Each of the five tokens, here the five words, becomes a vectorHow does a model turn text into numbers? Q37 →, a list of numbers.
- The vectors pass up through a stack of layers, dozens in a large model. In each layer an attentionWhat is attention in a transformer? Q40 → block lets every position gather information from earlier positions, so the vector at “is” can pick up “capital” and “France.” Then an MLP block (multilayer perceptron) works on each position alone, projecting its vector up to a wider layer, applying a nonlinearity and projecting it back down; such layers act partly as stores of associations (Geva et al., 2020).
- Each block adds its result to the position’s running vector, the residual streamResidual stream: Where a transformer keeps its work in progress: a running list of numbers for each token, which every layer reads from and adds to. Q41 →.
- After the last layer, the vector at the final position becomes a score for every token in the vocabulary: the prediction of what comes next.
Unlike the recurrent networks before it, which read text one token at a time, a transformer handles all the positions at once, which made training far faster on parallel hardware.
Sources Vaswani et al., Attention Is All You Need (2017); Geva et al., Transformer Feed-Forward Layers Are Key-Value Memories (2020).
Attention is the part of a transformer that lets the model, as it works on one word, look back at the earlier words and gather what it needs from them. More precisely, it is how a transformer moves information between token positions: the only route by which the computation at one position can use the vectors at others (Vaswani et al., 2017).
Each token’s vector is projected three ways: a query, what this position is looking for; a key, what each position contains, for queries to match against; and a value, what each position passes on if attended to. A position’s query is compared with every key by a dot product, scaled by √d, where d is the size of the head; a softmax turns the scores into weights that are positive and sum to one, and the output is the weighted sum of the values:
At “is” in “The capital of France is,” for instance, the query might look for the place being asked about; the key at “France” matches it, so France’s value is added into the vector at “is.” A causal mask hides later positions, so each token sees only itself and earlier ones, which is what lets training predict every position at onceHow can predicting the next word teach a model so much? Q38 →. Each layer runs many heads side by side. Each head has two largely independent parts: a QK circuit, which decides where to look, and an OV circuit, which decides what moves (Elhage et al., 2021).
Sources Vaswani et al., Attention Is All You Need (2017); Elhage et al., A Mathematical Framework for Transformer Circuits (2021).
The residual stream is where a transformer keeps its work in progress: one list of numbers for each word or word piece in the text, updated layer by layer. More precisely, it is the running vector at each token position that every layer reads from and adds to. It starts as the token’s embeddingHow does a model turn text into numbers? Q37 →. Each attention block and MLP blockMLP block: The part of each transformer layer (a multilayer perceptron) that transforms each token’s vector on its own, by projecting it up to a wider layer, applying a nonlinearity and projecting back down. Q39 → reads the stream, computes something and adds its output back. At the end, the unembedding matrix, a learned table that works like the embedding in reverse, turns the stream into one logit per vocabulary token, the scores for the next token.
Adding means each layer learns a correction to what is already there rather than a whole new representation. He et al. (2015) introduced residual connections because they made very deep networks trainable: a layer with nothing useful to contribute can learn to output almost nothing. Elhage et al. (2021) proposed treating the stream as a shared communication channel. Layers never talk to each other directly; whatever an early layer writes stays there for every later layer to read, unless a later layer subtracts it. That is why so many interpretability methods work by reading or editing the stream.
Sources He et al., Deep Residual Learning for Image Recognition (2015); Elhage et al., A Mathematical Framework for Transformer Circuits (2021).
By choosing one token (a word or piece of a word) from its own prediction, adding it to the text and predicting again. After “The capital of France is,” the probabilities favor “Paris”; one token is drawn and appended, and the whole sequence goes back in to predict what follows “Paris.” The loop repeats until the model produces a special stop token or reaches a length limit, so a long answer is hundreds of single steps (Jurafsky and Martin, 2026).
How the token is chosen matters. Always taking the most likely one tends to give bland, repetitive text, while sampling from the whole distribution can wander into unlikely nonsense (Holtzman et al., 2019). Two settings steer between them. Temperature divides the logits before the softmax: below 1 it sharpens the distribution toward the top choice, above 1 it flattens it. Top-p sampling draws only from the smallest set of tokens whose probabilities add up to p (Holtzman et al., 2019).
Because of sampling, the same prompt can give different answers each time, which is why evaluations repeat their tests.
Sources Holtzman et al., The Curious Case of Neural Text Degeneration (2019); Jurafsky and Martin, Speech and Language Processing (3rd ed. draft) (2026).
Scale, prompting and agents
Neural scaling laws are the regular patterns by which a language model gets better at predicting text as it is made bigger and trained on more data with more computing power. More precisely, they describe how a language model’s loss falls as the model is scaled up: smoothly and predictably, as a power law. Each tenfold increase in compute cuts the loss by about the same fraction, a straight line when both axes are drawn on a log scale.
The loss is the one the model is trained onWhat is a language model? Q36 →: its average surprise at the token that actually came next, such as “Paris” after “The capital of France is.” Three things can be scaled:
- Parameters, the weights that store what the model learns.
- Data, the number of training tokens.
- Compute, the arithmetic of training, counted in floating-point operations (FLOP): about 6 × parameters × tokens (Kaplan et al., 2020).
A model of fixed size improves with more training and then levels off, once it has learned what its size allows. The best size for each compute budget traces the smooth line underneath, as the figure shows, falling toward a floor, never zero, set by how unpredictable text itself is. For a given budget, parameters and data should grow in roughly equal proportion, about 20 tokens per parameter (Hoffmann et al., 2022).
The regularity lets developers fit the line on small runs and predict a much larger run’s loss before paying for it. Following the line further takes ever more data and power. The largest training sets are projected to reach the stock of public human-written text between 2026 and 2032 (Villalobos et al., 2022, updated 2024), and electricity is the likeliest limit on runs planned for 2030 (Sevilla et al., 2024). What a lower loss means for any particular ability is harder to predict, as sudden abilitiesWhy do some abilities seem to appear suddenly as models grow? Q44 → show.
Sources Kaplan et al., Scaling Laws for Neural Language Models (2020); Hoffmann et al., Training Compute-Optimal Large Language Models (2022); Villalobos et al., Will we run out of data? Limits of LLM scaling based on human-generated data (2022); Sevilla et al., Can AI scaling continue through 2030? (2024).
Often because the test gives credit only for a completely right answer. A task that needs every one of several steps to be right can stay near zero until each step is reliable, and then rise quickly, even while the loss falls smoothly.
Take an answer 8 tokens long, scored by exact match. A model that gets each token right half the time gets the whole answer right only 0.4% of the time. At 90% per token it is right 43% of the time, and at 99%, 92%. A steady gain on each token looks, on the exact-match score, like an ability switching on. The loss, by contrast, averages over countless predictions that each improve a little.
Whether all such jumps are this kind of artifact is disputed. Wei et al. (2022a) called abilities emergent when they appear only in larger models and could not have been predicted from smaller ones. Schaeffer et al. (2023) showed that many such jumps appear only under all-or-nothing metrics: scored with a continuous one, such as the probability given to the right answer, the same models improve smoothly. But Du et al. (2024) found that some abilities rise above chance only once the loss falls below a threshold, even under continuous metrics.
This matters for seeing risks coming: a developer can forecast how well a bigger model will predict text without knowing what new things it will be able to do (Ganguli et al., 2022a).
Sources Ganguli et al., Predictability and Surprise in Large Generative Models (2022a); Wei et al., Emergent Abilities of Large Language Models (2022a); Schaeffer et al., Are Emergent Abilities of Large Language Models a Mirage? (2023); Du et al., Understanding Emergent Abilities of Language Models from the Loss Perspective (2024).
Often, though not always. Spending more computation while a model answers, rather than in training, can buy better answers. This test-time compute can be spent in three main ways:
- Think longer. The model writes more reasoning before its final answer. Each token it writes is one more pass through the network, and later tokens build on earlier ones, so more tokens mean more steps of computation (see chain-of-thought promptingWhat is chain-of-thought prompting? Q47 →).
- Sample and choose. The model writes many answers, and the one a checker scores highest, or the one given most often, is kept.
- Revise. The model checks its own draft and rewrites it.
Snell et al. (2024) found that matching the effort to each question’s difficulty was about 4 times as efficient as always sampling many answers and keeping the best (best-of-N). Even a crude version works: making the s1 model think longer by appending “Wait” whenever it tried to stop raised its score on the 2024 AIME, a US high-school math competition, from 50% to 57% (Muennighoff et al., 2025). Reasoning modelsReasoning model: A language model trained to write out a long chain of thought before it answers. Q49 → are trained specifically to make good use of long thinking.
More thinking can also hurt. On tasks Gema et al. (2025) built to expose the effect, reasoning models got less accurate the longer they thought, distracted by irrelevant details, applying framings that did not fit or losing focus in long deductions; in one setting, longer reasoning also raised a model’s expressed wish for self-preservation. Such tasks show that longer thinking can hurt, not that it usually does.
Sources Snell et al., Scaling LLM Test-Time Compute Optimally can be More Effective than Scaling Model Parameters (2024); Muennighoff et al., s1: Simple test-time scaling (2025); Gema et al., Inverse Scaling in Test-Time Compute (2025).
In-context learning is a model picking up a task from examples or instructions in its prompt, with no change to its weights. Give a model a few English words with their French translations, then a new English word, and it will usually supply the French.
Nothing is learned in the training sense. The examples are simply more tokens in the input, and attentionWhat is attention in a transformer? Q40 → lets the position where the answer goes read them: the format the answers take and the task that links each pair. The effect lasts only while the examples are in the context window, the most tokens the model can take in at once. Fine-tuningFine-tuning: Further training of an already trained model on a smaller, chosen set of examples. Q51 →, by contrast, changes the weights by gradient descentHow does training adjust the weights? Q34 →, and the change persists.
The examples mostly tell the model which task is wanted; it then draws on what it learned in pretraining. Min et al. (2022) found that random labels in the examples barely hurt many classification tasks if the format and kinds of input stayed the same, though Yoo et al. (2022) found correct labels can matter a great deal, depending on the setup and the model’s size.
How a network does this is partly understood. In small models much of it runs through induction headsInduction head: An attention head that completes repeated patterns: if A was followed by B earlier, then on seeing A again it predicts B. Q182 →, attention circuits that find an earlier occurrence of the current token and copy whatever followed it. They form suddenly during training, at the same moment in-context learning improves sharply (Olsson et al., 2022). The evidence is causal for small models but only correlational for large ones.
Sources Min et al., Rethinking the Role of Demonstrations: What Makes In-Context Learning Work? (2022); Yoo et al., Ground-Truth Labels Matter: A Deeper Look into Input-Label Demonstrations (2022); Olsson et al., In-context Learning and Induction Heads (2022).
Chain-of-thought prompting gets a model to write out intermediate reasoning steps before its final answer, either by showing worked examples in the prompt (Wei et al., 2022b) or just by adding “Let’s think step by step” (Kojima et al., 2022). It sharply raised large models’ accuracy on arithmetic, commonsense and symbolic tasks, though not small models’.
Take a word problem from Wei et al.: a cafeteria had 23 apples, used 20 for lunch and bought 6 more. Answering at once, the model said 27; writing “23 − 20 = 3, and 3 + 6 = 9” first, it reached the right answer, 9. The reason is in how text is writtenHow does a model pick the next word and keep writing? Q42 →. Every token comes from one pass through the same fixed stack of layersWhat is a transformer? Q39 →, which caps how many steps of computation the model can take before it commits to that token. But each token it writes goes back in as input, so the next pass can build on it. The written steps work as scratch paper.
Theory backs this up: with T intermediate tokens, a fixed-depth transformer can carry out about T steps of step-by-step computation, and solve problems it provably could not solve answering at once (Li et al., 2024b).
Nothing forces the written steps to match the computation that actually produced the answer, and the two can come apartWhy might a model’s written reasoning differ from the computation that produced its answer? Q214 →: models swayed by a hint in the prompt often did not mention it (Turpin et al., 2023).
Sources Wei et al., Chain-of-Thought Prompting Elicits Reasoning in Large Language Models (2022b); Kojima et al., Large Language Models are Zero-Shot Reasoners (2022); Li et al., Chain of Thought Empowers Transformers to Solve Inherently Serial Problems (2024b); Turpin et al., Language Models Don’t Always Say What They Think: Unfaithful Explanations in Chain-of-Thought Prompting (2023).
They are two ways of describing what a language model is when it talks. The simulator view says a pretrained model is less an agent with goals of its own than a simulator that can play any character whose writing it has seen. The persona view adds that post-trainingPost-training: The training after pretraining, on example conversations, preferences and rewards, that turns a base model into an assistant. Q51 →, the training that turns it into an assistant, mainly picks out one of those characters, the Assistant, and refines it.
The simulator view (janus, 2022) follows from how the model is trained. To predict the next token of millions of documents, it has to model whoever wrote each one: a textbook author, a quiz-show host, a novelist’s villain. The prompt sets the scene and the model continues in that voice. “The capital of France is” continues as a textbook would, with “Paris”; the same words in a script for a quiz show might be followed by a contestant’s wrong guess. Shanahan et al. (2023) similarly treat chatbots as role-players, which lets researchers discuss apparent deception or self-preservation without attributing human-like beliefs to the network.
The persona selection model of Marks et al. (2026), which its authors present as one perspective among several, carries this into post-training. If training mainly selects a character, then training the model on one narrow behavior acts as evidence about what kind of character the Assistant is, so the effect spreads. That predicts emergent misalignmentEmergent misalignment: Broad misbehavior that appears after training a model on something narrow. Q127 →: fine-tuning a model to write insecure code without saying so made it broadly misaligned, while the same code requested for a computer-security class did not (Betley et al., 2025a), and OpenAI researchers later found a “toxic persona” feature that controlled the effectWhat inside a model drives emergent misalignment? Q128 → (Wang et al., 2025a).
Sources janus, Simulators (2022); Shanahan et al., Role-Play with Large Language Models (2023); Marks et al., The Persona Selection Model: Why AI Assistants might Behave like Humans (2026); Betley et al., Emergent Misalignment: Narrow finetuning can produce broadly misaligned LLMs (2025a); Wang et al., Persona Features Control Emergent Misalignment (2025a).
A reasoning model is a language model trained to write a long chain of thoughtChain of thought: The step-by-step reasoning a model writes out before giving its answer. Q47 → before it answers, usually by reinforcement learning on problems whose answers can be checked. An ordinary chat model can be prompted to reason step by stepWhat is chain-of-thought prompting? Q47 →; a reasoning model is trained to, in a loop:
- Pose a problem with a checkable answer, such as a math problem with a known result or a programming task with tests.
- Let the model reason and answer, many times over for the same problem.
- Score each answer automatically: 1 if it is right, 0 if not.
- Reinforce what worked. Reinforcement learningWhat is reinforcement learning? Q35 → (RL) makes the reasoning that led to right answers more likely. Then repeat across many problems (learning from verifiable rewardsWhat is reinforcement learning from verifiable rewards? Q70 →).
Nobody shows the model how to reason; only results are rewarded. DeepSeek-R1-Zero, trained this way, learned on its own to write longer chains with self-checking and backtracking, and its first-try score on AIME 2024 math problems rose from 15.6% to 77.9% (DeepSeek-AI, 2025), though Z. Liu et al. (2025b) found that the base modelBase model: A model after pretraining alone, which continues text rather than following instructions. Q55 → it started from already showed some such self-reflection.
Whether this training teaches new reasoning or sharpens what the base model could already do is unsettled. Yue et al. (2025) found that RL-trained models beat their base models on the first try, but given many attempts the base models caught up or passed them, suggesting RL mostly makes existing reasoning paths likelier. NVIDIA researchers found that prolonged RL on varied tasks let a 1.5-billion-parameter model beat its base even on tasks the base never solved (M. Liu et al., 2025a).
Sources DeepSeek-AI, DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning (2025); Liu et al., Understanding R1-Zero-Like Training: A Critical Perspective (2025b); Yue et al., Does Reinforcement Learning Really Incentivize Reasoning Capacity in LLMs Beyond the Base Model? (2025); Liu et al., ProRL: Prolonged Reinforcement Learning Expands Reasoning Boundaries in Large Language Models (2025a).
A language-model agent uses a model to work toward a goal over many steps instead of replying once. The model runs in a loop (Yao et al., 2022):
- Choose an action. Given the goal and everything so far, the model writes a request to use one of its tools: a web search, a shell command, a click.
- Carry it out. The software around the model, not the model itself, runs the tool.
- Read the result. The output comes back into the model’s input as text or an image.
- Choose again, until the task is done or the agent gives up.
Tools work by description: the developer gives the model each tool’s name, purpose and input format, and the model, which can only produce text, writes requests in that format (Anthropic, 2026). Asked for the population of Paris, a model with a search tool can search instead of answering from memory. Computer use extends this to an ordinary screen, with screenshots in and clicks and keystrokes out (Anthropic, 2024). Any text the agent reads, on a web page or in a document, then becomes a route for prompt injectionPrompt injection: An attack in which text from an untrusted source, such as a web page or email, carries instructions that override the developer’s or user’s. Q282 →, instructions planted for the model to follow.
The software around the model, its prompts, tools, memory and retry logic, is called the scaffold, and it can change results greatly. Davidson et al. (2023) estimated that most improvements added after training, scaffolding among them, are worth more than a 5-fold increase in training compute, though Kapoor et al. (2024a) caution that once cost is counted, simple baselines often match elaborate scaffolds.
A chatbot’s output is read by a person. An agent’s output changes things directly, often with nobody checking each step.
Sources Yao et al., ReAct: Synergizing Reasoning and Acting in Language Models (2022); Anthropic, Tool use with Claude (2026); Anthropic, Introducing computer use, a new Claude 3.5 Sonnet, and Claude 3.5 Haiku (2024); Davidson et al., AI capabilities can be significantly improved without expensive retraining (2023); Kapoor et al., AI Agents That Matter (2024a).