AI

Why smaller prompts outperform larger ones

Editorial · Reveneau · December 11, 2026

Why smaller prompts outperform larger ones

Teams building on language models reach for longer prompts when the output is not quite right. The failure on the last run is diagnosed as a missing instruction, so an instruction is added. The next run is better in some ways and worse in others, which gets diagnosed as another missing instruction. The prompt grows by a paragraph or two per iteration. After a few months the prompt is 5,000 tokens, contradicts itself in several places, and the model's output has gotten worse rather than better.

This pattern is common enough that it appears on most AI projects the team has not explicitly guarded against. The underlying cause is a property of how language models process their inputs: attention is finite, and more context in the prompt means less attention per token. A long prompt dilutes the attention available to the parts that matter.

The attention dilution effect

A language model, in simplified terms, reads the prompt by giving every token some attention and letting the tokens influence each other. The influence is bounded. There is a fixed amount of attention to go around, and every token competes for it.

A prompt of 500 well-chosen tokens has the model's attention concentrated on the task. Each instruction in the prompt gets a meaningful share of the attention budget. The model's output reflects the full prompt because the full prompt was within the window of what the model could focus on.

A prompt of 5,000 tokens has the same attention budget spread across ten times the content. Each instruction gets a tenth of the attention it would have gotten in the shorter prompt. The model's output reflects some parts of the prompt well and others poorly, because the attention could not be given to all of them.

The effect is not linear. Doubling the prompt does not halve the quality on every part. In practice, the model tends to pay more attention to the start and end of the prompt than to the middle, which is why long prompts often produce outputs that follow the first and last instructions and ignore the middle ones. This is the "lost in the middle" effect that has been observed in multiple measurements.

The practical takeaway is that adding to a prompt is not always helpful, and often actively harms the output. Teams that add instructions reflexively after each failure are often making the problem worse.

The signs of an oversized prompt

An oversized prompt produces specific symptoms, and a team familiar with them can spot the problem without a formal measurement.

The output is correct in parts and wrong in parts. The model handles some aspects of the task well and others poorly, and the pattern of success and failure does not correspond to the difficulty of the inputs. Easy inputs sometimes fail. Hard inputs sometimes succeed. The inconsistency is the signature.

The model follows one instruction and ignores another. The prompt says "keep the response under 100 words" and the response is 300 words. The prompt says "use the formal tone" and the response is casual. The prompt says "cite sources" and there are no citations. One or more specific instructions are being ignored, and which ones tend to shift from run to run.

The output is inconsistent across runs with the same inputs. The model produces different outputs for the same prompt on different runs, and the differences are substantive rather than cosmetic. This is a sign that the model is making different tradeoffs on different runs about which parts of the prompt to attend to.

The output has drifted from what it used to produce. The prompt has been edited many times, each edit intended to fix a specific case, and the current output is worse than the version from three months ago. The accumulation of edits has crossed the line where the next edit makes things worse rather than better.

What to cut

The first thing to cut from an oversized prompt is the redundant instructions. A prompt that grew iteratively usually says the same thing several ways. "Be concise. Be brief. Keep the output short. Do not write long responses." are four versions of one instruction. One version is enough; four create the impression that the model should go to unusual lengths to be concise, which sometimes produces outputs that are terse to the point of being useless.

The second thing to cut is explanation. A prompt often says "the user will be a software engineer, so they will want..." and goes on to explain why the instruction exists. The model does not need the explanation. It needs the instruction. "Output should be at a software engineer's level of detail" is enough.

The third thing to cut is edge-case instructions. Over time, a prompt accumulates handling for specific cases that happen rarely. "If the input is in all caps, treat it as a shouting user and respond with..." If the case happens in 1 percent of runs, handling it in the prompt costs attention on the other 99 percent. Handle it in post-processing instead, or accept that the 1 percent will be handled imperfectly.

The fourth thing to cut is examples that do not change behaviour. If the prompt includes three examples and the model's output on new inputs is the same whether or not the examples are present, the examples are not pulling their weight. Keep examples that change outputs; drop ones that do not.

What to keep

The parts that stay in the prompt are the ones that carry information the model cannot derive from the task alone.

The task description, stated clearly. "Translate the user's question into a SQL query against the schema below." Specific enough that the model knows what it is being asked to produce.

The output format. "Return a JSON object with two fields: 'query' (the SQL as a string) and 'confidence' (a number from 0 to 1)." The model will produce output that matches the format if the format is stated; it will produce something structurally plausible but variable if the format is not.

Constraints that are not derivable from the task. "The SQL should be read-only; reject any question that would require a write." "Table names are case-sensitive." These are rules the model needs to apply and cannot infer.

Examples that change behaviour. "Here are two sample questions and their correct SQL outputs." A single well-chosen example can anchor the model on a specific pattern more effectively than a paragraph of instruction can.

Everything else is optional, and the choice to include it should be a choice, not a reflex.

The trimming method

The practical method for trimming a prompt is to produce two versions, run both on the same test set, and compare.

Start with the current prompt. Produce a trimmed version that removes everything the team believes is not essential. If the cuts are too aggressive, the trimmed version will fail where the current one passes; if they are not aggressive enough, the two will perform the same. Both outcomes are information.

Run both prompts on a test set that includes the cases the team cares about most, including the edge cases that drove the original additions. For each case, record whether the outputs are correct, acceptable but different, or wrong.

Compare the results case by case. If the trimmed version performs better overall, it replaces the current one. If it performs worse on specific cases, those are the cases where the cut content was carrying weight. Add back only the content needed for those specific cases, not the general length.

Most teams that do this exercise find that the trimmed prompt performs the same or better on most cases, and worse on a small number of cases that can be addressed with a few sentences added back. The result is a prompt that is 20 to 70 percent shorter and produces output that is at least as good.

Context, not just prompts

The attention dilution effect applies to the entire context the model sees, not just the prompt the team wrote. A short prompt with a large retrieved context has the same problem as a long prompt.

For a retrieval-augmented system, the retrieval configuration matters as much as the prompt. A retriever that returns 10 chunks when only 2 are relevant produces an 8-chunk attention dilution for every request. The fix is either to tune the retriever's threshold up (fewer, more relevant chunks), to add a filtering step between retrieval and the model, or to accept that the model will not be at its best because of the extra content.

For a conversational system, the conversation history is also context. A 20-turn conversation has 20 turns of history competing for attention with the current turn's instruction. Trimming the history to the last few relevant turns, or summarising older turns, is the same kind of trimming as cutting a prompt. For related reading, see rag vs fine tuning for product teams and why context windows change how you structure a task.

For a coding assistant, the context is the selected files. A coding task with the whole codebase in context underperforms one with the specific files needed. Most coding assistants that search the codebase and include matches perform worse than ones that ask the user to name the specific files, because the user's selection is more precise than the search.

The cost dimension

Trimmed prompts are cheaper as well as more accurate. Every token in the prompt costs money, and the cost is linear in the number of tokens. A prompt that is 70 percent shorter is 70 percent cheaper.

For a system that serves many requests, the savings compound. A system that runs 10,000 requests a day with 4,000-token prompts is spending roughly four times as much on prompt tokens as one that runs the same requests with 1,000-token prompts. If the shorter prompts also produce better output, the system is both cheaper and better.

The cost argument is sometimes what gets the trimming prioritised. The quality argument is real but hard to make concretely until the measurement is done. The cost argument is concrete: here is what the prompts cost today, here is what they cost after trimming, here is the monthly savings. Teams that are not yet motivated by the quality concern are often motivated by this one.

For related reading, see how to budget for ai coding tools and why a long claude code session costs more on every message.

The habit of cutting before adding

The teams that avoid the prompt-bloat trap have a specific habit. When the output is wrong, they investigate before changing the prompt.

Investigate what. The specific failure. What was the input, what did the model produce, what should it have produced. Why did the model produce what it did. Was it ignoring an instruction, misreading an input, lacking information, or producing a reasonable interpretation of ambiguous instructions.

The investigation often reveals that the fix is not a new instruction. The fix is a clearer existing instruction, a cleaner input, a filter on the retrieved context, or a decision that the specific case does not need to be handled by the prompt at all.

When the fix is a new instruction, add it carefully. Check whether the new instruction contradicts an existing one; if it does, decide which should win and remove the other. Check whether the new instruction could be covered by tightening an existing instruction instead of adding a new one.

The habit of cutting before adding keeps the prompt small enough that attention dilution does not become the dominant failure mode. The habit is not natural; the natural response to a failure is to add. The teams that learn this habit produce prompts that keep working as the project scales, and the teams that do not end up with 10,000-token prompts that nobody understands and nobody wants to trim.

Common questions

Why do smaller prompts often outperform larger ones?

Because the model's attention is finite. Every token in the prompt competes for attention with every other token, and a long prompt dilutes the attention available to the parts that matter. A focused prompt with 500 tokens of carefully chosen context often produces better output than one with 5,000 tokens that includes everything the author thought might be relevant.

What is attention dilution?

The effect where adding more content to a prompt reduces the weight the model gives to any one part of it. A prompt that says "do X" clearly has the model's full attention on X. A prompt that says "do X, and here are 20 other things to consider" has the model's attention split 21 ways, and the chance of X getting the specific attention it needs drops.

How do you tell if a prompt is too large?

The output is correct in parts and wrong in parts, in ways that do not correlate with the input. The model follows one instruction and ignores another. The model handles the main case well and the edge cases poorly. The model's output is inconsistent across runs with the same inputs. Each of these is a sign that the model is making tradeoffs in the attention it is giving the prompt, and the tradeoffs are not always in the team's favour.

What is the first thing to cut from an oversized prompt?

Redundant instructions. Prompts grow because teams add new instructions after each failure, and over time the same thing is said three ways. "Be concise. Be brief. Keep the output short." are the same instruction. Consolidating them into one clear statement reduces the prompt length without losing content.

What should stay in the prompt?

The task description, the output format, any constraints that are not derivable from the task, and specific examples if they change the behaviour of the model. These are the parts that carry information. Everything else is explanation, and the model does not need explanation.

How much shorter can a prompt get before it stops working?

Depends on the task, but usually much shorter than teams first expect. A prompt of 2,000 tokens can often be trimmed to 500 with no change in output quality and sometimes an improvement. Below that, the trimming starts to remove information the task genuinely needs. The way to tell is to run both and measure.

What is the difference between a prompt and context?

The prompt is the instruction the team writes. The context is the information the model uses to produce the output, which may include the prompt plus retrieved documents, previous messages, system prompts, and tool outputs. The attention dilution effect applies to the whole context, not just the prompt. A short prompt with 10,000 tokens of retrieved context has the same problem as a 10,000-token prompt.

How does this interact with retrieval augmented generation?

Retrieval systems often pull more content than the task needs. The team configures the retriever to return 10 chunks, and the model has to use all 10. If only 2 are relevant, the other 8 are attention dilution. The fix is to tune the retriever's threshold or to ask the model to filter before answering. For related reading, see rag vs fine tuning for product teams.

Does this apply to coding assistants too?

Yes. A coding task with a focused context (the specific files the change needs, the specific functions to call) outperforms one with the whole codebase in the context. Coding assistants that search the codebase and include matches often perform worse than ones that ask the user to name the specific files, because the user's selection is more precise than the search.

How do you measure whether a shorter prompt is actually better?

Run both on the same test set and compare the outputs. The test set should include the cases the team cares about most, including the edge cases that were the reason the prompt grew in the first place. If the shorter prompt handles the main cases at least as well and the edge cases at least as well, it is better. If it handles the main cases better and the edge cases worse, the fix is to add specific coverage for the edge cases rather than general length.

Start a project