Agent 与自动化 4.0 · 优秀 2026-10-26 · 论文

The Hidden Costs of Forgetting: A Study of Trajectory Deletion in Software Engineering Agents

SWE agent 每轮把完整轨迹重发给模型,在线轨迹压缩因此被当省钱手段,但为什么能删agent 怎么补账单上是否真省钱没人算过该文做 42 种轨迹删除配置的系统实验,在 SWE-bench Verified 上用两个 SOTA agent 跑 9,400 次,覆盖删除范围粒度比例与时机结论:旧轮次推理文本可删到 100% 仍保住整体效果,但必须延迟删除,立即删会明显掉分;agent 靠重新抓取补偿,轮数与输入输出 token 反而增加;成本取决于计价模型平价计费下 26/42 配置省钱,缓存感知计价下 0/42 省钱,因为删除破坏了按低价计费的缓存前缀

打开原文回到归档

The Hidden Costs of Forgetting: A Study of Trajectory Deletion in Software Engineering Agents

  • ID: 51b88733
  • 原文链接: https://arxiv.org/abs/2610.35496
  • PDF: https://arxiv.org/pdf/2610.35496v1
  • 作者: Fernando Vallecillos-Ruiz, Islem Bouzenia, Michael Pradel, Leon Moonen
  • 日期: 26 Oct 2026
  • 更新: 26 Oct 2026
  • 分类: agents
  • 来源类型: paper
  • 标签: swe-agents, trajectory-compression, cost-analysis, prompt-caching, swebench
  • 质量评分: 4/5
  • 抓取时间: 2026-10-28T15:46:42Z

中文导读

SWE agent 每轮把完整轨迹重发给模型,在线轨迹压缩因此被当省钱手段,但为什么能删、agent 怎么补、账单上是否真省钱没人算过。该文做 42 种轨迹删除配置的系统实验,在 SWE-bench Verified 上用两个 SOTA agent 跑 9,400 次,覆盖删除范围、粒度、比例与时机。结论:旧轮次推理文本可删到 100% 仍保住整体效果,但必须延迟删除,立即删会明显掉分;agent 靠重新抓取补偿,轮数与输入输出 token 反而增加;成本取决于计价模型——平价计费下 26/42 配置省钱,缓存感知计价下 0/42 省钱,因为删除破坏了按低价计费的缓存前缀。

为什么值得关注

SWE agent 每轮把完整轨迹重发给模型,在线轨迹压缩因此被当省钱手段,但为什么能删、agent 怎么补、账单上是否真省钱没人算过。该文做 42 种轨迹删除配置的系统实验,在 SWE-bench Verified 上用两个 SOTA agent 跑 9,400 次,覆盖删除范...

Extra grounding: arXiv v1 submitted 26 Oct 2026; subjects cs.SE, cs.AI.

Obsidian 摘要摘录

摘自 论文流水线 2026-10-28:

这篇做了 42 种轨迹删除配置的系统实验,在 SWE-bench Verified 上用两个 SOTA agent 跑了 9,400 次,变量覆盖删除范围、粒度、比例和时机。三个结论:旧轮次的推理文本可以删到 100%,整体效果仍能保住,但必须延迟删除,立即删会明显掉分;agent 会靠重新抓取来补内容,轮数和输入输出 token 反而增加;成本结论取决于计价模型——平价计费下 42 个配置里 26 个省钱,按缓存感知计价则是 42 个里 0 个省钱,因为删除破坏了按低价计费的缓存前缀。

关键信息

  • 论文标题:The Hidden Costs of Forgetting: A Study of Trajectory Deletion in Software Engineering Agents
  • 作者:Fernando Vallecillos-Ruiz, Islem Bouzenia, Michael Pradel, Leon Moonen
  • arXiv:https://arxiv.org/abs/2610.35496
  • PDF:https://arxiv.org/pdf/2610.35496v1
  • 发布时间:26 Oct 2026
  • 更新时间:26 Oct 2026
  • arXiv 分类:Software Engineering (cs.SE); Artificial Intelligence (cs.AI)
  • 关联标签:swe-agents, trajectory-compression, cost-analysis, prompt-caching, swebench

English Abstract

Software engineering agents resend their entire trajectory to an LLM at every turn, motivating online trajectory reduction. Prior work shows that randomly deleting 75% of tokens in old turns may preserve agent effectiveness, but it remains unclear why, how agents compensate for missing content, and whether it actually reduces costs. This paper presents an empirical study of 42 trajectory-reduction configurations, focusing on effectiveness, agent behavior, and cost. We systematically explore deleting content from old turns by varying the scope, granularity, amount, and timing of deletion across 9,400 runs with two state-of-the-art agents on SWE-bench Verified. We find deleting large amounts of trajectory content (e.g., up to 100% of reasoning text) can preserve overall effectiveness. Importantly, such deletion must be applied with a delay, as immediate deletion tends to significantly degrade effectiveness. Agents often compensate for deleted content by re-fetching it, increasing both the number of turns taken and the input/output tokens. Whether trajectory reduction reduces costs depends on the pricing model: Under a flat pricing model, estimated costs fall in 26 of 42 evaluations. Surprisingly, under a caching-aware pricing model, zero evaluations yield lower costs, since reducing the trajectory breaks the cached prefix billed at a lower rate. Our findings have three implications: First, token counts alone are misleading; trajectory reduction techniques must consider overall costs under a realistic pricing model. Second, analyzing trajectories is crucial to understand agent behavior, as end-to-end effectiveness hides differences such as excessive re-fetching. Finally, these results highlight the need for future work on memory management to reduce costs without sacrificing effectiveness.