arXiv:2608.25399cs.AI2026-08

任务描述越简略,AI写代码越费Token,且可提前预测。

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

  • 用不同详细程度的任务描述测试AI编码,发现简化后耗Token增29.7%
  • 同一任务不同提示下,运行波动不变,但耗Token变化幅度达13%~115%
  • 提出新方法,仅需一次低成本探测即可预估复杂任务的耗Token

AI代理在实际系统中广泛部署,其长程推理与工具调用导致Token消耗成为成本与效率的关键考量。两位工程师使用AI解决同一问题的方式不同,任务描述如何影响代理的Token消耗,以及能否提前预测,仍是开放问题。本研究以Kimi K3模型在三种思考强度下,对2,700次运行进行分析,发现将完整任务描述简化为简单用户故事,会使Token消耗增加29.7%;而运行间方差不受提示变化影响。提示敏感性呈现任务依赖性,范围从13%到115%。我们构建了一个简单预测器,仅需在未见任务上进行一次低成本探测,即可估算多种任务描述与思考强度组合下的完整耗Token分布,误差低于36%,优于现有方法。本工作首次量化了任务描述对代理式编码耗Token的影响,并提供可系统评估AI编码成本的方法。

原文摘要 · Abstract (English)

Agentic coding workflows are now widely deployed in real-world systems. With long-horizon reasoning and tool use, token usage has become an important consideration for both cost and efficiency. Two engineers using AI will solve the same problem differently. How the specification of a task shapes an agent's token spend, and whether that spend can be predicted in advance, are open questions. Here, we study the effects of different task specifications on agentic token spend with the Kimi K3 model at three thinking efforts. Across $2,700$ runs, we show that reducing a full task specification to a bare user story raises token spend by $29.7\%$, while run-to-run variance remains unaffected by any prompt changes. We show that prompt-sensitivity is task-dependent, running from $13\%$ to $115\%$. We fit a simple predictor that can price a full distribution of task specifications and thinking effort configurations from a single cheap probe on an unseen task within $36\%$, improving over prior work in predicting token spend. Our work provides initial results quantifying the effects of task specification on agentic token spend and introduces a method that can be used to systematically evaluate the cost of AI coding workflows.

AI代理编码效率成本优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。