plaination Xplaining Tomorrow Today
How Does LLM Prompting Work? Context Engineering Explained
AI Aug 6, 2026 · 6 tags

How Does LLM Prompting Work? Context Engineering Explained

Learn how context engineering and next-token prediction power modern LLM prompting, and why outdated 2023 techniques fail with reasoning models.

#prompting#ai#reasoning#llm#model#models

How Does LLM Prompting Work? Context Engineering Explained

You’ve been told to tell AI to “think step by step.” Here’s the wild part: on the reasoning models you’re actually using today, that advice can actively make your results worse. The standard playbook you learned in 2023 was written for models that no longer dominate. The craft didn’t die; it just turned inside out.

So how does prompting actually work? Imagine a massive, multidimensional dice tower. Every face on every die represents a possible word, or token. When you type a prompt, you aren’t writing a command the model reads like a human. You’re nudging the tower. Your words reshape the probability distribution across those dice, making certain tokens cascade down into an answer. This mechanism—predicting the next token based on the sequence so far—is the bedrock of LLMs, and it hasn’t changed since day one.

But the strategy has flipped. Leading reasoning models now generate their own extended chains of reasoning internally, exploring paths and backtracking before they output a word. When you script the reasoning in your prompt, you pin the model to the path you imagined instead of the better one it would have found. You no longer hunt for magic sentences. You engineer the context, decide when to spend reasoning tokens, and manage the flow of information. Let’s look at how the pieces fit together.

What is Fine Tuned Prompting?

You might have heard “fine-tuned prompting” tossed around, and it’s easy to get confused because that phrase mashes up two very different levers. Let’s separate them so you know exactly what you’re controlling.

Fine-tuning changes the model’s weights—the internal parameters learned during training. It permanently alters how the model predicts tokens. This is heavy, expensive work. In 2026, a big focus is distillation: researchers are figuring out how much frontier reasoning a small model can inherit by fine-tuning it on outputs from a larger model. You’re teaching the small model to mimic the reasoning patterns of the big one, baking that capability into its weights.

Prompting, on the other hand, doesn’t touch the weights. It reshapes the probability distribution dynamically at inference time. A prompt is a constraint you apply to the current session. You can prompt a fine-tuned model just like a base model, but the prompt’s effect filters through those fine-tuned weights. If a model is fine-tuned to follow instructions strictly, a simple prompt might do what previously required a wall of examples.

When people ask about “fine-tuned prompting,” they’re usually asking how these levers interact. The answer is simple: prompting is your immediate, reversible control surface. Fine-tuning is the permanent structural adjustment. You prompt to adapt a model to a task on the fly; you fine-tune to teach a new distribution of behavior that sticks around. Today, that conversation has shifted to context engineering, where the prompt is just one piece of the puzzle alongside system instructions, retrieved documents, tool definitions, and history.

How Does LLM Prompting Work?

We touched on the mechanism, but let’s zoom in on how you actually wield it now. Close up of hands typing on a mechanical keyboard while a la

Prompting works by constraining a next-token predictor’s probability distribution. The model looks at everything it’s seen so far and calculates the likelihood of every possible next token. A prompt injects structure, context, and constraints that shift those probabilities. Write “The capital of France is,” and “Paris” becomes nearly inevitable. Write “The capital of France is, according to a fictional map,” and the probability mass shifts toward made-up names.

This mechanism is the anchor, but the strategy has evolved. You manipulate the distribution by engineering the entire context window. An LLM doesn’t just see your sentence; it sees a massive bundle the system assembles for every call. That includes the system prompt defining the role, retrieved documents providing ground truth, tool definitions enabling action, conversation history carrying context, and long-term memory storing past interactions. This shift to context engineering is driven by agents. An agent operating over dozens of steps carries the residue of previous decisions. A single well-worded sentence can’t manage that complexity. The unit of work is now the context window. You design the context to ensure the model has the right information, in the right format, at the right time.

Prompting also involves routing and effort allocation. Modern reasoning models let you control how much “thinking” the model performs. Anthropic ships extended thinking with selectable effort levels and adaptive thinking, where the model decides when deeper reasoning is worth the cost. OpenAI’s reasoning guidance advises developers to avoid scripting reasoning on their reasoning models, implying the prompt’s role is to set the stage and let internal mechanisms do the heavy lifting. The prompt is less about telling the model what to think and more about defining the boundaries of how it should operate.

What is Chain of Thought Prompting?

Chain of Thought (CoT) prompting is the technique that broke the old playbook, and understanding why requires a shift in perspective.

CoT is a technique designed to elicit intermediate reasoning steps before the final answer. The goal is to break complex tasks into smaller steps, hoping the model arrives at a more accurate conclusion by generating that reasoning trace. In 2023, this was revolutionary. You’d append “Let’s think step by step,” and models would produce detailed explanations that boosted performance on math and logic.

But CoT has hit a hard wall with reasoning models. On a modern reasoning model, telling it to “think step by step” is at best neutral and can actively hurt performance. This is the inversion. Reasoning models generate their own extended reasoning traces internally. They explore multiple approaches, backtrack, and self-correct without being asked. When you script a chain of thought, you’re not adding value; you’re pinning the model to the path you imagined instead of the better one it would have searched.

OpenAI’s published reasoning best practices explicitly advise against chain-of-thought prompting on reasoning models. Their guidance notes that because the model reasons internally, instructing it to explain its reasoning is unnecessary and may constrain the model to a suboptimal path. Anthropic’s approach mirrors this, offering adaptive thinking where the model decides autonomously when deeper reasoning is needed. The craft has moved from scripting the reasoning process to deciding when to buy that reasoning via effort levels and what context to provide. Side profile of a researcher in a white coat calibrating a p

CoT isn’t dead, but its status has flipped. It’s now a legacy technique for base or non-reasoning models. For frontier reasoning models, CoT is often redundant and can act as a cage, forcing the model to commit to a trajectory early and preventing internal search from finding a superior solution.

What is Few Shot Prompting in AI?

Few-shot prompting remains a staple, but its role has shifted.

Few-shot prompting is where you provide the model with a small number of examples of the desired input-output behavior within the prompt. Instead of just asking a question, you show the model a few instances of how to solve similar problems, then ask it to solve a new one. This works by leveraging the model’s pattern recognition. The examples reshape the probability distribution, making the model more likely to follow the demonstrated pattern. For example, if you want a model to extract names, you might provide three examples of text with names listed, followed by the new text. The model sees the pattern and predicts the continuation.

This technique was a cornerstone of early engineering because it let you tailor behavior without fine-tuning. Today, few-shot prompting remains valid, but it’s largely subsumed by context engineering. Rather than manually inserting examples into every user prompt, you often manage few-shot patterns through system prompts, retrieved documents, or conversation history. An agent might retrieve a relevant example from a knowledge base and inject it dynamically.

Few-shot prompting is also critical for tool use and structured outputs. When you define tools, you’re essentially providing examples of how the model should interact with them. Tool definitions and function signatures guide the model toward correct function calls. In multi-turn conversations, the model learns from its own previous interactions; the history acts as a form of few-shot learning.

Few-shot prompting retains value for edge cases or specific formatting. If a model struggles with a complex output schema, adding examples can be a highly effective fix. The key difference today is that few-shot is no longer a magic bullet. It’s a targeted tool within a broader context engineering strategy. You use it when the model’s general capabilities fall short, and you rely on it sparingly to save tokens for other context.

Which Statement Best Describes the Chain of Thought (CoT) Prompting Technique?

Let’s tackle the quiz question head-on.

Chain of Thought is a prompting technique that structures the input to elicit intermediate reasoning steps from the model before a final answer, thereby guiding the output distribution through explicit logical progression; however, on modern reasoning models, this technique is often redundant or counterproductive as the model performs extended reasoning internally and external scripting can constrain its search. High angle aerial view of a busy city intersection at dusk w

This statement captures the essence while acknowledging the 2026 reality. CoT is fundamentally about eliciting intermediate text. The model generates reasoning tokens that bridge the prompt and the final answer. This bridge can improve accuracy by breaking down complex predictions into simpler steps, reducing the chance of jumping to an incorrect conclusion. The mechanism relies on the model using generated reasoning tokens as context for subsequent predictions.

However, the second part is crucial. On reasoning models, the model already generates these steps internally. It produces a reasoning trace that it may or may not show you. When you add a CoT prompt, you force the model to externalize and script this process. This can interfere with internal search mechanisms. The model might have found a better path internally, but your prompt locks it into the path you described. It’s the same mechanism as ever — prompting constrains a next-token predictor’s probability distribution — only now it constrains something that was already working. CoT narrows the distribution to follow a logical sequence. But if the model’s internal distribution already favors a better sequence, the external constraint harms performance. The technique exists, but its utility has inverted. It’s a tool to be aware of, not one to apply indiscriminately.

How Does Chain of Thought Prompting Improve Complex Reasoning in LLMs?

It’s worth asking how CoT actually improves reasoning, given the caveats.

CoT improves complex reasoning by leveraging the token prediction mechanism to break down difficult tasks. When a model faces a complex problem, predicting the final answer in one step requires navigating a vast, ambiguous probability distribution. Errors can accumulate, leading to hallucinations or logical flaws. By generating intermediate reasoning steps, CoT decomposes the problem into a sequence of smaller, more manageable predictions. Each step conditions the next, narrowing the probability distribution and guiding the model toward a more accurate conclusion. This improvement relies on the model using the generated reasoning tokens as context. The trace provides a scaffold. It allows the model to correct minor errors and maintain consistency. The mechanism is essentially a form of self-verification; the model is more likely to produce a correct final answer if it has generated a coherent chain of reasoning leading to it.

However, this mechanism has limits in 2026. First, the improvement assumes the reasoning trace is faithful to the model’s computation. Anthropic’s research, specifically the paper “Reasoning Models Don’t Always Say What They Think,” highlights a gap between the trace a model emits and the computation that produced its answer. The model may generate a plausible-sounding trace that doesn’t reflect the internal decision-making process. If the trace is unfaithful, the CoT improvement may be illusory; the model might be generating a post-hoc justification rather than genuine reasoning.

Second, the improvement breaks down on reasoning models due to the “cage effect.” Scripting a chain of thought constrains the model to a specific path. The model’s internal search might explore multiple paths and backtrack. An external CoT prompt prevents this backtracking by committing the model to the scripted path early. This can lead to worse performance if the scripted path is flawed. OpenAI’s guidance to avoid CoT on reasoning models reflects this. The improvement is superseded by internal reasoning, and the external constraint introduces risk.

Finally, CoT’s improvement depends on model capability. On base or smaller models without internal reasoning, CoT can still provide significant gains. These models benefit from the decomposition and explicit structure. But as models become more capable and reasoning internalizes, the marginal benefit of CoT diminishes, and the costs of constraint increase. CoT improves reasoning by structuring the prediction process, but on modern models, that structure is often already present internally, making external scripting unnecessary or harmful. Overhead angle of three identical vintage calculators arrang

The Catches

Before we wrap up, here are the catches you need to keep in your pocket.

The Reasoning Trace is Not a Window into the Model’s Mind. It is generated text. Even when a model produces a detailed reasoning trace, you cannot assume it faithfully reflects the computation that produced the answer. Anthropic’s research explicitly finds that reasoning models do not always say what they think. The trace is a narrative the model generates, not a log of its internal state. Treat it as a helpful artifact, not a source of truth about the model’s cognition.

Prompting Does Not Give the Model Intent or Understanding. The model is a next-token predictor. It forecasts the next token based on the sequence so far. It does not “think” or “understand” your prompt. Attributing human-like cognition to the model is a category error that leads to overconfidence and debugging nightmares. The model is reshaping probability distributions; it is not solving problems in the way you do.

“Think Step by Step” Can Backfire. This is the most critical practical catch. On reasoning models, instructing the model to think step by step or explain its reasoning can constrain the model to a worse path. The model reasons internally; scripting that reasoning externalizes and rigidifies it. Follow the guidance from model providers like OpenAI, which advises against chain-of-thought prompting on reasoning models. The universal best practice of 2023 is a trap in 2026.

Prompt Engineering Has Moved, Not Died. You will hear claims that prompt engineering is dead. This is an overclaim. The 2023 craft of hunting magic phrasings is obsolete, but the discipline has evolved. It has moved up the stack to context engineering, routing, and effort allocation. You are now designing the entire context window, deciding when to spend reasoning tokens, and managing complex agent workflows. The craft is harder and more architectural, but it is far from dead.

Be Skeptical of the Numbers You’ll Find. Search results for prompting are thick with content built for ranking rather than accuracy, and it shows in the statistics. You’ll see claims like a “98% improvement” or a “44% accuracy boost” with no indication of what was measured, on which model, against what baseline. If a number can’t be stated as “X measured Y on Z,” it isn’t telling you anything. The same caution applies to version numbers: secondary write-ups routinely attribute the same finding to three different model releases, so trust the lab’s own documentation over the blog summarizing it.

Closing

Prompting is no longer about finding the right sentence to coax a response; it’s about engineering the context and constraints that guide a next-token predictor through a complex probability landscape. The inversion of 2026 has forced a reckoning: the techniques that worked before can now hinder the very models that need the most precision. By understanding the mechanism, respecting the limits of reasoning traces, and embracing the shift to context engineering, you can harness the power of LLMs without falling into the traps of the past. The craft has evolved, and so must you.

Sources

Watch the full lesson