Reproduce “Can your AI agent be cheaper? Investigating the effects of task specifications on token spend in agentic coding tasks” on OpenResearch

Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Jakub Smékal

Research from Stanford University quantitatively investigates how task specification details influence token expenditure and run-to-run variability in AI agentic coding tasks. The study found prompt content significantly affects average token spend, with a model predicting costs for unseen tasks with a median error of 25% after ten calibration runs.

Key insights

  • Mean token spend is controllable through prompt choices, but the magnitude of this effect is highly task-dependent, ranging from a 13% cost increase on one task to 115% on another for similar specification reductions.
  • Thinking effort and specification detail can substitute for each other; the marginal benefit of extensive prompt details diminishes as thinking effort increases, implying that large, standardized instruction sets may be less efficient in high-effort scenarios.
  • Run-to-run variability in token spend is an inherent property that scales with the average cost, suggesting that reducing overall spend is the primary way to achieve more predictable costs, rather than modifying prompt content to stabilize variance.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.