Plate IIAgent SystemsHOWARDISM

Cache-Aware Agent-Loop Cost (TurnCost)

Kumar & Pandey (Penn State, POVC '26 at ASE 2026): re-scoring 600 public coding-agent trajectories under an exact prefix-cache simulation, 98.1–99.0% of input tokens are cache hits, so flat input pricing overstates loop cost ~7.1× (5.3× under 40 turns, 8.0× over 130). A closed-form break-even says delegate an observation only when remaining turns exceed weak-input / strong-cached price. Learned delegation ties deterministic truncation on cost. Turn count explains 84% of log-cost variance and mean observation size 4%, so every observation-side technique works the smaller axis.

Article metadata
Publication details
Published:
Filed:Concept
Domain:Agent Systems
Reading:29 min
Source:AI-synthesised
About this piece

Articles in this journal are synthesised by AI agents from a curated wiki and are refreshed automatically as new concepts arrive. Topics, framing, and editorial direction are curated by Howardism.

Illustration for Cache-Aware Agent-Loop Cost (TurnCost)

Sources#

Summary#

A coding agent's loop is append-only: every turn re-sends everything retained so far plus the newest tool output. Under prefix caching, almost all of that re-sent context is billed at the cached-read rate, and only the newest suffix pays full input price. TurnCost (Pramod Kumar & Raj Kumar Pandey, Penn State, arXiv 2610.15093, 2026-10-10, POVC '26 workshop at ASE 2026, empirical) takes that structure seriously and re-scores 600 published trajectories under it. It reaches four results:

  1. Cache-unaware accounting is off by roughly 7×. 98.1–99.0% of input tokens are cache hits, so flat input pricing overstates loop cost by 6.5–7.8× per cell, mean 7.14×, under near-ideal caching.
  2. The real constraint on using a cheaper model is the strong model's cached price, not its list price. A closed-form break-even follows, and it is about ten times tighter than list prices suggest.
  3. Learned observation reduction ties deterministic truncation on cost, because real observations are small (median 118–286 tokens). The bulk sits on Tool-Output Pruning.
  4. Turn count, not observation size, carries the cost variance: R² = 0.844 against 0.040.

The authors call the design of this iterative control loop "loop engineering": context management, model selection, compaction and termination. That is narrower than this wiki's Loop Engineering, which is the practitioner discipline of building the system that prompts the agent. The two meet at the same object, the loop, from the cost side and the workflow side.

The cost model#

Let C_t be the context sent at turn t, o_t the output, and r_t the observation appended after turn t. The loop appends only, so C_t = C_0 + Σ_{j<t}(o_j + r_j): a token added at turn j is paid for again on every later turn. Under prefix caching the cached share at turn t is h_t = C_t − r_{t−1}. Everything except the newest observation is a prefix the backend has already seen, and a radix-tree KV cache (SGLang) reuses it exactly. The same mechanism makes switching models expensive: a new backend shares no prefix with the old one and must prefill the whole context cold.

TurnCost reconstructs per-turn context from the message sequence, tokenizes with o200k_base, counts tool schemas (re-sent every request), and bills reasoning tokens as output without carrying them forward. It uses normalized prices: strong input = 1, cached read = 0.1, weak input = 0.05, summary ratio σ = 0.05. All three are swept.

What "98.6% cached" is and is not. It is a simulated share. It follows from the append-only structure under an ideal cache, not from provider-reported cache hits. The paper names what it leaves out: block-boundary rounding, TTL eviction, and loss of reuse when requests move between backends. Prompt-Cache Economics measures exactly those losses on a production API (ρ ≈ 0.83–0.89). TurnCost's sensitivity ladder is what connects the two numbers. The 7.1× inflation falls to 4.0× at 90% cache efficiency, 2.4× at 75% and 1.45× at 50%. The authors ask that 7.1× always be cited with that caveat.

Flat pricing gets worse as loops get longer#

The inflation rises steadily with trajectory length: 5.33× below 40 turns, then 6.10×, 6.93× and 7.44× across the middle strata, and 7.99× above 130 turns. The longest cell (qwen35/SWE-agent, median 134 turns) inflates most at 7.8×, and the shortest (minimax/OpenHands, 60) least at 6.5× (Figure 2, viewed). The ratio is bounded by the input/cached price ratio (10× at the default tariff) and approaches it as the cached prefix comes to dominate.

This is how the routing literature can report large savings. AgentRouter reports 71.8% cost reduction at 97.3% of frontier quality, but on 4–12-step LangGraph/CrewAI workflows priced from output-token rates only. SWE-Router uses flat per-inference pricing. MTRouter prices from a flat input/output table even though it discusses cache loss under model switching. Short trajectories sit at the far left of the inflation curve, where flat pricing is least wrong, and even there it is wrong by about 5×. AgentDiet does price cached input, and the critique does not apply to it. TRACE-Router reports no token-level cost model, so the paper makes no claim about it. The authors audited these five systems only, not the wider routing literature.

In-band swap vs out-of-band delegation#

There are two ways to use a cheaper model inside the loop. Once caching is priced, they run in opposite directions.

  • In-band swapping runs a whole turn on the weak model with the full transcript. The weak model has no cache and pays a cold prefill on all of C_t. It saves money only when p_W^in < p_S^cache, not p_W^in < p_S^in. At the defaults (0.05 < 0.10) it does save: 14.7% at a 200-token threshold, 0.4% at 5,000. But it sits on a knife-edge. A weak model at 20% of the strong model's list price looks like an 80% saving under flat accounting and is a net loss once caching is counted. Profit and loss are a factor of two apart, and list prices give no warning.
  • Out-of-band delegation hands the weak model only the observation and inserts a short result into the main transcript. The strong model's cache stays intact and the transcript is shortened permanently, so the saving recurs on every later turn.

Break-even (Eq. 3). Delegating an observation of r_j tokens at turn j into a summary of σr_j pays for itself when

T − j > [p_W^in (1 + e) + p_W^out σ] / [(1 − σ) p_S^cache] → p_W^in / p_S^cache (σ, e → 0)

where e is prompt overhead relative to r_j. Three things are absent from it, and each absence is informative. Observation size is absent: it sets how much a delegation saves, not whether it is worth doing. The strong model's list price is absent, because the comparison is against its cached price, typically a tenth of list. And a poor compressor (large σ) hurts through both numerator and denominator, so the penalty is worse than linear. Worked at $3.00 input / $0.30 cached / $0.15 weak, H = 0.5 turns. The list-price version gives 0.05, understating the threshold 10×.

The data do not follow the formula's optimism. At realistic price ratios Eq. 3 puts break-even under two remaining turns, yet delegation still loses money at conservative thresholds in the two minimax cells (Figure 3, viewed: about −1.5% and −4% at 5,000 tokens). Those are also the two cells with the shortest trajectories. The binding constraint is observation size. Large observations are rare and tend to arrive late, with too few turns left to amortize the call. "If delegation still fails to break even [at that horizon], the price gap is not the problem, and no amount of router tuning will fix it."

Turns carry the variance#

Across all 600 trajectories, on log-log scales:

PredictorR²Exponent
Turn count alone0.8441.23
Mean observation size alone0.040−0.31
Both0.945—

Adding turn count to a model that already contains observation size raises R² by 0.905. The reverse adds 0.101. By turn-count decile, median turns rise 36 → 168 and median cost rises sevenfold (0.138 → 0.978), while median observation size falls from 655 to 334 tokens. The most expensive trajectories have the most turns and the smallest observations. Cost per turn is comparatively stable (median 0.005, CV 0.28), and cost per observation token less so (CV 0.36).

The authors are explicit that this is association, partly by construction: cost is a sum over turns, so some relationship with T is definitional. They identify two features that are not definitional. The exponent exceeds one (1.23): cost grows faster than turn count because each turn re-reads all earlier ones. And observation size predicts slightly negatively, so the two axes are not two views of one quantity. The positive claim is a pointer. Every technique examined (routing, learned reduction, truncation) acts on the axis carrying 4% of the explained variance, and nobody targets redundant turns directly. Removing a turn removes its cost and every later re-read of it. The authors do not claim turns can be removed at held task success. "Why an agent needs a hundred turns to fix one bug" is left open.

The measured exponent sharpens the "quadratic replay" framing used elsewhere in the wiki (Orchestration Sets Token Economics, Context Lifecycle Management's O(n²) full-append case). Token volume in an append-only loop does grow as O(n²) when per-turn additions are constant. Cache-aware cost over 36–168 turns grows as roughly T^1.23 in this corpus, because every re-read is billed at a tenth of the input price and per-turn additions are not constant. Both statements hold, and they describe different quantities.

Implications the paper draws#

  1. Price the cache before optimizing anything. For workloads like these, a saving tuned against list price underdelivers in production by roughly the inflation factor.
  2. Use Eq. 3 as a deployment rule. Delegate only when remaining turns exceed p_W^in / p_S^cache. (Qualified 2026-11-23 by Yang et al.: Eq. 3, like their Eq. 2, holds the agent's later actions fixed. A live audit of the analogous removal rule found agents re-fetch masked content and run longer, so fixed-action savings of 14–22% became premiums of 9.6–24% in SWE-agent. See the section below.)
  3. Always compare against a truncation baseline. A method that does not beat deleting the observation is buying quality, not cost, and has to be justified on quality.

Where it sits in the wiki#

  • It corroborates the harness-side cost model with trajectory data, but only by simulation. Writer's p_eff = p_in(1 − h(1 − κ)) (Orchestration Sets Token Economics) claims h is set by how the orchestration layer assembles context. TurnCost finds h ≈ 0.98–0.99 for an append-only loop across two open scaffolds, against Writer's single identical-prefix call at 99.9%. Neither is a billed measurement. CAPC's measured ρ ≈ 0.85 is.

  • It explains the minimal-harness cost inversion without measuring it. Minimal Harness for Autonomous ML Engineering (Malena)'s single 24h session costs ~6× a thread-resetting harness, "almost all of it cache reads," priced at an assumed 0.1×. TurnCost uses the same 0.1× default, so it cannot confirm that price. What it adds is the structural premise (a never-reset append-only loop is ~98–99% cache-eligible) and the turn-count exponent. The sensitivity ladder also bears on the direction of error, as set out on that page.

  • It does not explain Harness Tax: Coding-Agent Cost Multiplies Across Harnesses While Success Barely Moves's gap, and the two fit together. Arena.ai's cleanest pair (Fable 5, Pi vs Claude Code) averages 15.4 vs 15.3 turns at ~2× the cost. Turn count is held fixed there, so the harness tax is a per-turn cost difference: Claude Code's first-call context is over 10× Pi's. TurnCost's decomposition runs within a scaffold-model cell, where cost per turn is comparatively stable (CV 0.28) and turn count varies. Read together, turn count sets cost within a harness, and the size of the re-sent prefix sets it across harnesses at matched turns. Under cache-aware pricing that prefix is billed mostly at the cached rate, so its dollar weight depends on accounting that Arena says matters ("total spending also depends on caching") but does not itemize. At ~15 turns, these rollouts sit where TurnCost finds flat pricing least wrong.

  • A controlled intervention on turn count, run the wrong way (Vats, 2026-10). Vats (empirical) holds a Claude Sonnet 5.5 terminal agent fixed on Terminal-Bench 2.1 and varies only a controller that can append advisory messages or end the run. Cost is provider-reported with prompt caching, so the bill is cache-aware by construction. Every informed controller added turns, and cost followed them: Jev 16.0 steps against native's 13.3 at cost ×1.19, Haiku 17.8 at ×1.47. No pass-rate difference between arms was detectable. Jev's verification rounds explain only $0.011 of its extra $0.029 per attempt, and the rest came from longer runs throughout. This is this page's turn-count axis seen from the other side: the added turns bought nothing. The turn-removing lever was available and went unused. No controller chose abandon in 315 trials, most native failures (10 of 17) ran to a timeout or cap, and the costliest task's 15 runs all failed at Harbor's timeout or the $1.00 cap. The paper's deviation log adds one direct turn-reduction datum: p90 caps of 20 steps and $0.25 "would have cut 5 of 44 passing runs and acted as an abandon policy." See Typed Decision Verifiers.

  • Billed token splits across three shipped harnesses (Liu & Han, 2026-10). Harness Swap vs. Rerun Noise (What a Harness Buys) (arXiv 2610.04433, empirical) prices each SWE-bench Verified trial from its own provider-reported cache-hit, cache-miss and output tokens. 96–99% of input tokens are cache hits in every arm (Claude Code, mini-SWE-agent, OpenCode) on both vendor APIs (DeepSeek-V4-Flash, GLM-5.3-Flash). That is close to this page's simulated 98.1–99.0%, from production endpoints rather than an ideal cache. Across harnesses, the bill is a fixed per-step preamble (16,581 / 829 / 7,025 tokens) times the step count. Per-step growth sits within 1.5× across the three, which is this page's turn-count axis with a harness-set intercept added. The hit price rescales the bill without reordering the harnesses: 0.287× the miss price at Zhipu, 0.033× at DeepSeek, and repricing each model's tokens under the other list keeps the order.

Fixed-action re-scoring meets a reacting agent (Yang et al., 2026-11)#

TurnCost re-scores fixed trajectories, so every saving it reports assumes the agent would have acted the same way on the reduced context. Yang et al. (arXiv 2611.22238, Huawei, 2026-11-17, empirical, 20,000+ live runs of open models on local vLLM) test that assumption directly. They replay each unmodified run under a context-removal rule with its actions held fixed, then compare against live runs where the agent sees the edited context.

  • The behavioural term can reverse the sign. In SWE-agent at a tenth-price cache, batched masking would save 21% and break-even masking 15% with actions fixed. Live, they cost +24% and +9.6%, because masked runs grew by about 23 steps. In mini-SWE-agent the reaction is smaller (+2.7 to +5.3 steps) and consists of re-reads and re-searches, not edits. So TurnCost's 11–19% observation-reduction savings are best read as this direct term: an upper bound on realized savings, not a forecast of them.
  • Live truncation at the source cost more. Cutting each output over 2,000 characters once, on entry, keeps the cache intact, yet cost +3.6% at c = 0.1 and +5.6% at c = 1 over 178 tasks, because runs grew from 51.9 to 60.1 commands. That is a different threshold and scaffold from TurnCost's grid, and so not a like-for-like contradiction. It is the first live measurement of the baseline TurnCost asks every method to beat, and the baseline itself did not save money.
  • It corroborates the turn axis from the intervention side. Every removal method that failed did so through extra turns. The one method that cut cost sharply at held resolution was a fine-tune that cut turns (−9.7 turns, −32% cost), which bears on the turn-removal question below.
  • Its own-cache share sits between the two numbers here. Own-cache hits counted at token granularity, from the previous request only, are 94–98% of input tokens. The paper also cites an external trace study of real Claude Code and Codex sessions at 95.6%.

Limitations worth carrying#

  • Corpus provenance. nvidia/Open-SWE-Traces was assembled as distillation data and excludes trajectories that hit the iteration limit or were prematurely terminated, plus empty-patch and test-altering runs. This biases the 7.1× conservative (inflation grows with length, and the longest runs are gone). It biases the observation-size tail in an unbounded, adverse direction: an agent re-reading a huge log until it exhausts its budget is exactly what was filtered out.
  • Sampling. 150 trajectories per cell, taken as the first rows in file order without shuffling. That is deterministic and reproducible, but it is not a random sample.
  • Open-weight models only (Qwen3.5-122B-A10B, Minimax-M2.5) on two open scaffolds (OpenHands, SWE-agent). Frontier proprietary agents may behave differently.
  • Tokenizer mismatch. o200k_base is used throughout rather than each model's native tokenizer, so absolute counts may be off by 10–20%.
  • Quality is not measured. The truncation/delegation parity is about cost only. AgentDiet's 60% vs 58% pass rate is the only quality evidence cited.
  • Cache model is ideal-by-construction. No TTL, block rounding or backend migration. The authors say method comparisons are robust to this and magnitudes are not.

A prover loop, measured (h1, 2026-10)#

In Lean, h1: A Taste of the Bitter Lesson in Automated Theorem Proving (empirical) puts the cost model through a same-model comparison and a sweep. AxProverBase regenerates the whole proof after every feedback round. Output is 89% of its $17.39 per problem, and at most 0.5% of its input comes from cache. h1 edits a persistent file in one growing context. Output is 34% of its $9.00, and 74–94% of its input is cached. Varying the turns between context resets shows where the cache argument stops. At 200 turns the cached share reaches 86%, against 0.2% at one turn, but solves fall from 72/65 at ten turns to 60/52. The tokens are cheaper and the work is worse. mini-Lean-agent's 8.7% against 91.5% is the same split, measured by another team. Detail on Simple-Loop Lean Harness (h1).

Connections#

  • Simple-Loop Lean Harness (h1) — the cache split in a Lean prover (≤0.5% against 74–94% cached input) and where it stops paying: 86% cached at 200 turns per reset, with fewer solves than at ten
  • Error Reproduction in Agent Memory (Anti-Persistence) — another cost claim made in calls rather than tokens. Anti-Persistence's "lowest LLM-call cost" is 9.3 vs 9.5 calls on average, and each extra synthesis call reads up to five full trajectories
  • Listed-Price Reversal: the same mechanism across proprietary model pairs. A Shapley attribution of cost gaps on Terminal-Bench 2.0, Cybench and GAIA puts them on turn count and replayed history, with cost super-linear in turns and cheaper-listed models exhausting the message budget more often. It is attribution on benchmark rollouts, not a cache-aware re-scoring, so it does not test the 7.1× figure
  • Tool-Catalog Context Cost: the fixed per-call overhead this page's turn-count result makes secondary on long loops. A resident tool catalog is that overhead's largest single component, and moving it off the prefix pays most on short, numerous tasks
  • Prompt-Cache Economics: the measured-cache counterpart. CAPC bills a real API and finds ρ ≈ 0.83–0.89. TurnCost simulates an ideal cache over real trajectories and gives the ladder that converts one into the other's inflation factor
  • Tool-Output Pruning: the observation-size distribution that bounds every pruner, the editor-echo finding, and truncation/delegation cost parity
  • Context Lifecycle Management: the O(n²) full-append cost case, priced with caching that its source dropped by assumption
  • Orchestration Sets Token Economics: the same p_eff model reached from the harness side. The guided-truncation result also supports its "reject with guidance, don't silently truncate" offload rule
  • Minimal Harness for Autonomous ML Engineering (Malena): the long-session cost inversion, which uses the same assumed 0.1× cache price
  • Harness Tax: Coding-Agent Cost Multiplies Across Harnesses While Success Barely Moves: the across-harness complement. At matched turn counts the tax there is per-turn prefix size, while here, within one harness, turn count carries the cost
  • Client-Side Agent Optimization: step-level routing priced correctly. The in-band swap break-even is the cache-stickiness term its routing predecessors treat as a static per-model price
  • Cost-per-Task Over Cost-per-Token: per-token price as a function of cache state and remaining turns rather than a constant
  • Loop Engineering: same name, adjacent meaning. Here it is the cost-side design of the agent's control loop rather than the practitioner's goal loop
  • Typed Decision Verifiers: the controller study that intervened on turn count in a live coding loop. Advisory nudges added steps and cost at held success, and the turn-removing abandon action was never chosen
  • Harness Swap vs. Rerun Noise (What a Harness Buys) — provider-reported cache-hit shares (96–99%) on two production APIs across three shipped harnesses, and the across-harness cost multiplier (a fixed per-step preamble) beside this page's within-harness one (turn count)
  • Context Edits Under Prefix Caching (the Price-Dependent Sign) — the live-run counterpart. Yang et al. replay trajectories under context-removal rules with actions fixed and then run the agent for real: fixed-action savings like this page's become premiums once the agent re-fetches and runs longer, and keep-10 masking flips from −19% at c = 1 to +116% at c = 0.1
  • Read-Time Memory Curation (JitMem) — an executor-only token count of the kind this page warns about. JitMem's 50–56% input-token saving over write-time memory leaves out the curator's own per-task call, which reads three full raw trajectories

Open Questions#

  • Residual of the turn-removal question (Resolved below): does an inference-time stop rule, rather than fine-tuning, remove turns at held success with cache-aware cost reported? Vats' abandon never fired. Settler: a pre-specified stop-rule arm on new tasks.
  • Residual of the billed-cache-share question (resolved half below): on Anthropic or OpenAI production APIs, is a long coding-agent loop's billed cache-hit share near CAPC's ρ ≈ 0.85 or the 96–99% open-weight vendor APIs report? Settler: provider-billed token splits from a Claude Code or Codex trajectory set. Partially answered (2026-11-23), secondhand: Yang et al. cite TraceLab (Zhu et al., arXiv 2606.30560, not ingested): 95.6% of input tokens were cache reads across 8,058 Claude Code and Codex sessions, and those sessions' actual bills split 58.6% cached input, 30% uncached input and 11% output. That puts the Anthropic and OpenAI share on the 96–99% side, not near ρ ≈ 0.85. The settler is now specific: ingest TraceLab and read its splits first-hand.
  • Does the small-observation distribution (median 118–286 tokens, editor echo the largest per-turn bulk) hold for frontier proprietary agents and for the iteration-limit trajectories the corpus filtered out? The excluded runs are exactly where a heavy log tail would live. Partially answered 2026-10-26 by What Does a Harness Buy? Tokens, Mostly (empirical): in the proprietary Claude Code harness (on GLM-5.3-Flash, not a frontier model), with every trial kept including those that ended at a cap or the window, a tool return is median 392 / mean 1,237 / p90 3,095 characters, about 100 tokens at the median. mini-SWE-agent and OpenCode are within about 10% of that at the mean and p90 (Harness Swap vs. Rerun Noise (What a Harness Buys)). So the small-observation shape survives a proprietary harness and the unfiltered tail. Still open: a frontier model's own trajectories.

Resolved Questions#

  • Can redundant turns be removed at held task success, with cache-aware cost and pass rate reported on one scaffold and one model? Answered (2026-11-23), in one setting: Yang et al. (empirical) fine-tune Qwen3.5-9B on cheap, successful Qwen3.6-27B trajectories and A/B it against the base model on 80 SWE-bench Verified tasks. Runs shorten by 9.7 turns and cost falls 32% at a tenth-price cache. The official resolved rate does not move detectably: +4.5 points without the evidence package, −0.6 with it. The turns removed were mostly verification: post-edit script or test runs fell from 4.19 to 1.83, and precision among submitted runs fell from 0.43–0.44 to 0.37–0.38. A second route removes exploration turns at held success and raises cost. A retrieved evidence package cuts 5–7 read/search commands with resolution equivalent within ±5 points on 217 fresh tasks, and cost rises ~33–42% because the added context is re-read on every turn. So turns can be removed at held success, and whether that saves money depends on what replaces them (Context Edits Under Prefix Caching (the Price-Dependent Sign)). The stop-rule residual stays in Open Questions. Evidence trail (original bullet, moved 2026-11-23): Can redundant turns be removed at held task success? The paper shows turn count carries 84% of log-cost variance, while every published technique targets the 4% axis. No source in the corpus intervenes on turn count directly in a coding agent and reports both cost and resolve rate. The falsifiable form: a turn-reduction policy (a batched-tool-call prompt, a stop rule, a plan-first step) A/B'd on one scaffold and one model, reporting cache-aware cost and pass rate. Partially answered (2026-10-21), from the opposite direction: Vats (empirical) runs that A/B on one scaffold and one model (Sonnet 5.5, Terminal-Bench 2.1, provider-billed with caching). Interventions that added turns raised cost 19–47% with no detectable pass-rate difference, so on a strong agent the extra turns were redundant by this question's own test. The one turn-removing policy offered, a guarded abandon, was never chosen by any controller, and a tighter step cap (20 vs 60) would have cut 5 of 44 passing calibration runs. Still open: a removal policy that actually fires. Settler: the stop-rule arm the paper calls for, pre-specified on new tasks.
  • What is the billed cache-read share of a long coding-agent trajectory on a production API? TurnCost's 98.1–99.0% is simulated under an ideal cache, while Prompt-Cache Economics measures ρ ≈ 0.85 at production prefix sizes. If the billed share is near 85%, TurnCost's own ladder puts the flat-pricing error at roughly 3× rather than 7×. Partially answered 2026-10-15 by Do Theorem Provers Need Theorem-Proving Agents? mini-Lean-agent: A Coding-Agent Baseline for Lean (empirical): a mini-SWE-agent loop on Gemini 3.8 Flash through Google AI Studio reports 91.5% of input tokens as cached (69.69M of 76.16M) over 1,091 calls on 12 Lean problems, about 90 calls per trajectory. That falls between the ~85% production measurement and TurnCost's simulated 98–99%. It is one model, short trajectories in a non-SWE task, and the paper does not say whether caching was implicit or explicit. A Lean-tooled harness on the same model caches only 8.7%, so the share is a property of the harness's prompt shape as much as of the provider. Answered 2026-10-26 for open-weight vendor APIs by What Does a Harness Buy? Tokens, Mostly (empirical): provider-reported splits on the DeepSeek and Zhipu APIs put 96–99% of input tokens as cache hits in every arm of three shipped harnesses on SWE-bench Verified (Harness Swap vs. Rerun Noise (What a Harness Buys)). That is close to TurnCost's simulated 98–99% and well above the ~85% production measurement. The residual for Anthropic and OpenAI APIs stays in Open Questions.

Sources#

  • The Price Reversal Phenomenon: When Cheaper Reasoning Models Cost More — Chen, Zhang, He, Stoica, Zaharia & Zou, arXiv 2603.23971 v2 (2026-05-28), empirical: Figure 3 and Appendix E (turns and replayed history drive agentic cost gaps, super-linear in turns). Full treatment and parse warnings at Listed-Price Reversal
  • TurnCost: Turns, Not Observations: Cache-Aware Loop Engineering for Coding Agents — Pramod Kumar & Raj Kumar Pandey (The Pennsylvania State University), TurnCost: Turns, Not Observations: Cache-Aware Loop Engineering for Coding Agents, arXiv 2610.15093, 2026-10-10, POVC '26 (1st International Workshop on PromptOps and Vibe Coding, co-located with ASE 2026, Munich; DOI 10.1145/3843779.3844635), 8pp, empirical. No COI: the authors evaluate no product of their own, and TurnCost is an open re-scoring tool (Zenodo 10.5281/zenodo.22216661). Cited: §2.2 and the "scope of our accounting claim" paragraph (which routing papers are cache-unaware); §3 Eqs. 1–3 and the worked example; §4 corpus, reconstruction and default prices; §5.1–5.8; §6; §7. Note that the cost figures are re-scored, not billed: the corpus ships conversations, not token accounting, and the cache share is simulated. Parse notes: Tables 1 and 2 were reconciled against pdftotext -layout on the local PDF and match cell for cell, and their medians, p90s, maxima and mean edit/read sizes agree with the §5.1–5.2 prose. Figures 2 (flat vs cache-aware per cell) and 3 (saving vs delegation threshold) were viewed. The per-cell negative savings (about −1.5% and −4%) are read off Figure 3 and approximate. The affiliation block is welded into a fragment of §1's prose, and that is cosmetic.
  • Do Theorem Provers Need Theorem-Proving Agents? mini-Lean-agent: A Coding-Agent Baseline for Lean — Ortega et al. (Princeton / Rutgers), arXiv 2610.17331, 2026-10-12, empirical. Cited for Table 4's provider-recorded cached-input share (91.5% for a bash-only loop vs 8.7% for a module-per-call harness, Gemini 3.8 Flash)
  • Good Judgment, Bad Advice: Decision-Model Controllers Raise Agent Cost Without Improving Success — Naman Vats, arXiv 2610.24649, 2026-10-17, empirical. Cited for Table 1's steps and cost per arm (reconciled against §4.4 prose), §4.4's verification-versus-longer-runs decomposition and abandon finding, §5's 10-of-17 failures-at-a-limit, and Appendix D's cap deviation. Full treatment on Typed Decision Verifiers
  • What Does a Harness Buy? Tokens, Mostly — Yangze Liu & Zhongyi Han (Shandong University), arXiv 2610.04433, 2026-10-03, empirical. Cited for the provider-reported cache-hit share (§4.4), Table A4's tool-return sizes and per-step budget, and Appendix G's per-step growth and cross-vendor repricing. Full treatment and parse notes on Harness Swap vs. Rerun Noise (What a Harness Buys)
  • Context Has a Price: Adding and Removing Context for LLM Coding Agents under Prefix Caching — Zerui Yang, Chaorui Zhang et al. (Huawei Technologies), arXiv 2611.22238, 2026-11-17, empirical. Cited for Table 6 (fixed-action vs live masking cost), Table 5 (truncation at source), App. M (distillation turn and cost cuts at unchanged official resolution), §4 (evidence package), and §2's secondhand TraceLab cache share. Full treatment and parse warning on Context Edits Under Prefix Caching (the Price-Dependent Sign)
  • h1: A Taste of the Bitter Lesson in Automated Theorem Proving — Moalla, Rammal, Patel, Munos & Kempe (FAIR at Meta), arXiv 2610.35962 v2, 2026-10-30, empirical. Cited for the AxProverBase cost and cache figures and the reflection-interval sweep (prose; Figure 18 and 29 captions). Detail on Simple-Loop Lean Harness (h1).
§ end
Cited by 19
Related articles
  • Cost-per-Task Over Cost-per-Token

    Anthropic's inverted model-selection default: start with the most capable model and dial effort down — a stronger model…

  • Prompt-Cache Economics

    Prompt caching and prompt compression are one joint optimization, not two independent levers — CAPC measures Anthropic…

  • Open Questions Backlog

    Generated by `_system/lint.py --write-backlog`. Do not hand-edit. Domain and Watching sections carry one row per page —…

  • Context Lifecycle Management

    Treating an agent's active context as indexed runtime objects with a lifecycle (fold/mask/prune, recoverable sidecars,…

  • Orchestration Sets Token Economics

    Writer's controlled harness swap — same 22 tasks, same six models, same judges and price table, only the orchestration…