arXiv cs.AI· Zhongming Yu, Yitong Ma, Hengjia Yu, Boqin Yuan, Xiangye Lin, Hejia Zhang, Jishen Zhao·· 3 小时前AI 评分47
论文提出质量约束的资源核算方法,评估 Coding Agent 上下文策略的物理成本
The Physical Cost of Context: Quality-Constrained Resource Accounting for Coding Agents
AI 导读
论文提出质量门控协议,将 prefill 拆分为逻辑提示词减去复用前缀,测量 KV 驻留、时间和能耗,评估 Coding Agent 的上下文策略。
正文 · 原文
Abstract:Coding agents resend a growing context on every model call, and context policies are usually judged by the prompt tokens they save. Executed work also depends on call count and prefix reuse: a caching runtime prefills only the tokens after the longest cached prefix. A shorter prompt can therefore cost more if it rewrites cached history. Our quality-gated protocol splits executed prefill into logical prompt minus reused prefix and measures KV residency, time, and energy. On 450 localization cases derived from SWE-rebench V2, preloading ten retrieved blocks (Eager) and adding anchored history compaction (Compact) both pass a five-point non-inferiority gate. In a separate 900-cell study, Eager cuts model calls by 35.7% and the GPU-energy proxy by 33.2% against on-demand search (Grep); Compact saves nothing further. Enabling prefix caching leaves Eager's prompt volume similar (+8.3%; its 95% CI spans zero) but cuts its uncached prefill by 67.7%. Deleting history can turn a token saving into extra work. With mini-SWE-agent on 100 SWE-bench Verified instances, keeping only the last five observations (Mask-5) cuts Eager's prompt volume by 33.3% but loses 135.9k reusable tokens per task. Uncached prefill rises by 608.5%, the energy proxy by 125.6%, and the policy misses the quality gate. Policies thus save physical work by shortening the trajectory and can multiply it by editing reusable history.
| Comments: | Accepted at the NeurIPS 2026 Workshop on Resource-Aware Agentic AI (RAAAI). 15 pages, 2 figures, 6 tables |
| Subjects: | Software Engineering (cs.SE); Artificial Intelligence (cs.AI) |
| Cite as: | arXiv:2610.34763 [cs.SE] |
| (or arXiv:2610.34763v1 [cs.SE] for this version) | |
| https://doi.org/10.48550/arXiv.2610.34763 arXiv-issued DOI via DataCite (pending registration) |
Submission history
From: Zhongming Yu [view email]
[v1]
Mon, 26 Oct 2026 03:07:29 UTC (440 KB)
来源:arXiv cs.AI · arxiv.org