arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2607.01916cs.AI

ContextSniper: AntTrail的令牌高效代码记忆用于仓库级程序修复

ContextSniper: AntTrail's Token-Efficient Code Memory for Repository-Level Program Repair

Chiwang Luk, Matin Mohammad Najafi, Zhifeng Jia, Wei Yang, Xiuchang Li, Jinwei Zhu, Yang Ren, Lei Chen, Gao Cong

首次发表
浏览论文内容

中文总结 AI 辅助

提出ContextSniper,一种令牌高效的代码记忆层,通过精准证据选择、混合检索排序和意图感知上下文门控,在SWE-bench Lite上减少51.5%令牌使用和36.4%成本,修复率仅轻微下降。

中文摘要 AI 辅助

大型语言模型代理可以修复真实的仓库问题,但它们通常将大量上下文预算花费在整文件读取、广泛搜索和长终端输出上,其中有用的证据与无关代码和日志混杂在一起。本文提出ContextSniper,AntTrail的令牌高效代码记忆层,用于仓库级程序修复。作为AntTrail更广泛的代理记忆引擎的编码专业化,ContextSniper实现了Sniper功能以实现精准证据选择:它检索候选代码和运行时证据,使用混合检索信号对其进行排序,通过意图感知上下文门控过滤长输出,并返回紧凑的证据包,同时在提示之外保留可恢复的源上下文。我们在SWE-bench Lite上使用OpenClaw和Claude Code评估ContextSniper,每个主机-代理条件下进行50次任务运行。ContextSniper将OpenClaw的总令牌使用量减少51.5%,记录成本减少36.4%;将Claude Code的总令牌使用量减少38.9%,估计成本减少27.3%。提交的解决率略有下降,OpenClaw从26.0%降至24.0%,Claude Code从32.0%降至30.0%。ContextSniper的试点测试脚本已在此https URL开源。

英文摘要

Large language model agents can repair real repository issues, but they often spend large context budgets on whole-file reads, broad searches, and long terminal outputs where useful evidence is mixed with irrelevant code and logs. This paper presents ContextSniper, AntTrail's code-repair module for precision evidence selection in repository-level program repair, as part of AntTrail's broader agent-memory engine. AntTrail is available at https://gitcode.com/datagallery/AntTrail. ContextSniper indexes code and action memory at three levels of abstraction, retrieves candidates with a hybrid ranker, filters long tool output through an intention-aware context gate, and returns compact evidence packets while keeping full source recoverable on demand. In matched 50-task-per-condition comparisons, ContextSniper reduces total token use by 51.5% and logged cost by 36.4% for OpenClaw on SWE-bench Lite, and reduces total token use by 40.0% and average interaction rounds by 28.1% for OpenCode on SWE-bench Pro. Submitted-resolution rates differ by one task out of 50 in each host-agent setting. In a separate five-task comparison, ContextSniper outperforms existing memory- and retrieval-augmented generation (RAG)-style integrations in token efficiency. These results suggest that ContextSniper can substantially reduce token and interaction overhead for repository-level repair agents without a measurable loss in repair quality. The evaluation harness is available at https://gitcode.com/lukchiwang/ContextSniper.

发表机构

  • Huawei(华为)
  • HKUST(GZ)(香港科技大学(广州))
  • Nanyang Technological University(南洋理工大学)

机构由 AI 辅助整理,请以论文原文为准。

↑