Cost-Aware Agents · Prompt Engineering

Your prompt is
the cost center.

Researchers asked what drives token spend in large reasoning models running coding tasks. They held task difficulty constant and varied only the instructions. The words you use to ask for help, it turns out, move spend more than the complexity of what you are asking for.

Core finding
Open-ended exploration cues like "develop and compare several approaches" inflate reasoning tokens 2.4 to 7.4 times with no correctness gain. Replacing them with a bounded template can cut that spend in half.

First surfaced in Tandemly Briefing — 2026-08-02.

scroll to explore

Everybody optimizes
the wrong thing.

Most cost-reduction work for AI coding agents targets the plumbing: compress context, cache prefixes, cut tool calls. This paper targets the demand side. What if the instructions themselves are the cost?

When reasoning models became available, their token economics changed in a specific way. These models think before they respond. They run an internal deliberation step that generates tokens you never see but absolutely pay for. A difficult task warrants more deliberation. Everyone accepts that. But the implicit assumption underneath most cost discussions is that deliberation tracks task difficulty, not instruction phrasing.

That assumption turns out to be wrong in a measurable and consequential way. The same coding task, asked with different wording, produces wildly different deliberation token counts with no corresponding difference in whether the code works. The model is not doing more useful thinking. It is doing more thinking because the instruction asked it to.

This is a different problem from the one most cost tooling addresses. Context compression, KV-cache tuning, and retrieval filtering all operate on the data that flows through the system. Prompt-induced waste operates on the request itself. You can have perfectly optimized infrastructure and still be burning money on the way you phrase things.

Why a preregistered design matters here

Cost studies on agent systems are easy to confound. Task difficulty, model routing, caching state, and environment variance all move the numbers. The authors preregistered their hypotheses before collecting data, which makes it harder to select the result after the fact. The causal story, prompt phrasing drives cost independent of task difficulty, is more credible here than in a post-hoc analysis.

Same tasks, different
words, 4,643 runs.

The study ran two separate agent harnesses over the same set of coding tasks, varying only the instruction phrasing. Three categories of phrasing were tested. The measurements: deliberation tokens, tool calls, and repeated agent turns. Correctness was held as the control variable.

The setup starts with a fixed task set: coding problems with verifiable correct answers, so you can check whether changing the prompt actually changed the output quality or just the cost. Two different agent harnesses ran the same tasks under each prompt condition. Using two harnesses is a key design decision: if an effect shows up in both, it is probably real and not an artifact of how one specific framework handles context.

The three prompt conditions target different intuitions practitioners commonly act on. The first is the "explore thoroughly" instinct: telling an agent to develop and compare multiple approaches before committing. The second is the generic effort cue: instructions that say to think carefully or reason deeply without specifying what that means. The third is a bounded template: an explicit scope statement, clear acceptance criteria, and a stop condition that tells the model when it has done enough.

Across 4,643 valid runs the study measured deliberation tokens generated before the first code output, the number of tool calls made, and whether the agent repeated agentic turns on the same task. These three measures together capture where the spend actually goes: internal reasoning, external calls, and retry loops.

High-cost pattern
Explore and Compare
"Develop and compare several approaches before committing to one." This phrasing asks the model to generate multiple candidate solutions in its internal reasoning step before producing any output. The model complies. It generates candidates you never see, evaluates them against each other, and then starts writing code. All of that deliberation costs tokens.
Low-cost pattern
Bounded Template
Explicit scope (what is in and out of scope), acceptance criteria (what done looks like), and a stop condition (when to stop). The model knows what it is solving, what success looks like, and when to stop deliberating. The reasoning step narrows. Correctness holds.
What "cost-neutral" means here

The bounded template is described as cost-neutral relative to a baseline prompt with no special framing. It does not add overhead. It removes waste. The savings relative to the open-ended exploration condition range from cost-neutral to a halving of deliberation tokens depending on the harness and task type. The correctness numbers do not move.

The words inflate the bill.
Not the task.

The numbers are large enough to matter for anyone running production coding agents at scale. The correctness numbers are flat. The cost numbers are not.

Explore-and-compare inflation
2.4 – 7.4x
Reasoning token inflation from "develop and compare several approaches" versus a neutral baseline, with no corresponding correctness gain across both harnesses and all task types.
Think-deeply inflation
1.6 – 2.2x
Token inflation from generic effort cues ("think carefully", "reason deeply") that invoke effort without specifying scope or acceptance criteria. Smaller than exploration cues but still substantial at production volume.
Bounded template savings
Up to 50%
Deliberation token reduction from the bounded template (scope + acceptance criteria + stop condition) relative to the open-ended exploration condition. The template is cost-neutral relative to a plain baseline and avoids the waste the other two patterns generate.
Finding 1: The exploration instruction is the most expensive sentence in most system prompts

Practitioners add "develop and compare several approaches" to agent prompts with good intentions. It sounds rigorous. It sounds like it should produce better code. Across 4,643 runs it produced code of equivalent correctness at 2.4 to 7.4 times the deliberation token cost. The variation in that range is across harnesses and task types, but in every condition it was worse, never neutral or beneficial.

Finding 2: Generic effort cues are cheaper than exploration cues but still wasteful

The "think deeply" family of instructions sits in a middle tier. They inflate deliberation tokens 1.6 to 2.2 times without moving correctness. They are less harmful than explicit exploration instructions, but at scale they represent the same category of waste: paying for deliberation that does not change the answer. The mechanism is similar: the model interprets an open-ended cue as license to reason more broadly, not as a directive toward a specific kind of reasoning.

Finding 3: Specifying the stop condition is the load-bearing part of the bounded template

The bounded template is not just "be more specific." It has three components, and each does work. Scope narrows what the model considers in scope. Acceptance criteria define what done looks like. The stop condition tells the model when deliberating further is no longer productive. All three together produce the cost reduction. A prompt that has scope and acceptance criteria but no explicit stopping signal still allows the model to continue deliberating after the answer is evident, which is where a significant fraction of waste appears in the exploration condition.

Scope and limitations

The study covers coding tasks with verifiable correct answers across two agent harnesses. It does not cover open-ended creative or analytical tasks where exploration genuinely changes quality. The inflation factors apply to large reasoning models that have a distinct internal deliberation step. Instruction-following models without a separate reasoning phase may respond differently. The bounded template requires knowing the acceptance criteria in advance, which is easier for well-specified coding tasks than for ambiguous or exploratory work.

Audit the words,
not just the pipeline.

Cost reduction for AI coding agents usually starts with infrastructure. This paper suggests the instruction layer deserves the same attention. You can build an optimized agent harness and still be spending 2 to 7 times too much on internal reasoning because of how the prompt is written.

1
For developers shipping coding agents
Search your system prompts for exploration cues. Any instruction asking the agent to develop multiple approaches, consider alternatives, or think thoroughly before committing is a candidate for replacement. Swap them with a bounded template and measure deliberation tokens before and after. Correctness should hold; spend should drop.
2
For teams building the bounded template
The three components are scope (what is in and out of scope for this request), acceptance criteria (what a correct output looks like, specifically enough to check), and a stop condition (an explicit signal that tells the model when it has met the criteria and should stop deliberating). All three need to be present. A template missing the stop condition is a prompt with a better scope statement, not a bounded template.
3
For anyone running A/B prompt tests
Measure deliberation tokens and correctness separately. Aggregate cost numbers conflate infrastructure spend and prompt-induced deliberation. If you are testing two prompt variants, the interesting question is whether one generates more reasoning tokens than the other at equal correctness. That tells you whether the phrasing difference is buying anything.
4
For teams using generic reasoning models on specialized tasks
Large reasoning models allocate deliberation in proportion to the perceived complexity of what they are asked to do. An open-ended exploration instruction signals high complexity. A bounded template signals a well-specified problem. The model's deliberation budget responds accordingly. Matching instruction precision to the actual task complexity is the lever.
5
Pair this with billing-level cost measurement
This paper's companion work from the same authors established that token count and billed cost diverge once caching is in the picture. Measuring the prompt-wording intervention at the token level gives you the deliberation signal. Measuring it at the billing level tells you how much of that shows up in the invoice, which depends on cache utilization for the affected token types. Both measurements are worth running.

Steps you can
take now.

1
Grep your prompts for exploration and effort cues
Search system prompts and user-turn templates for phrases: "compare approaches," "consider alternatives," "think carefully," "reason step by step before," "explore options." These are the candidates. Note their location in the prompt and which tasks they affect.
2
Draft a bounded template for your most common task type
Write three sentences: one stating scope, one describing the acceptance criterion, and one specifying the stop condition. "In scope: X. Done when: Y. Stop if you have met Y without needing Z." Test it on a batch of representative tasks against your existing prompt.
3
Instrument deliberation tokens before your A/B test
Most reasoning model providers surface deliberation (thinking) tokens separately from output tokens in the API response. Log them per task. The A/B comparison is deliberation tokens per correctly-solved task for each prompt variant, not aggregate cost.
4
Read the companion paper on billing vs. token counts
The same authors' prior study, Token Reduction Is Not Cost Reduction, covers the gap between tokens shed and dollars removed from the invoice. Reading both gives you a full picture of the demand-side (prompt phrasing) and supply-side (context compression, caching) levers available. Tandemly synthesis: token-reduction-cost-billing.
5
Cite the preprint
Weinberger & Hozez, "Prompt-Induced Waste in Large Reasoning Models: A Preregistered Two-Harness Benchmark of Coding Agents," arXiv:2608.01347 (2026). Available at arxiv.org/abs/2608.01347.