paperbot · PL 论文追踪

全部论文 待读 收藏

P2 TwinMem-Agent: Episodic and Semantic Memory for Repository-Level Program Repair

TwinMem-Agent:面向仓库级程序修复的情节记忆与语义记忆
FSE Proceedings of the 34th ACM International Conference on the Foundations of Software Engineering2026匹配度 3/10 · 论文属于 LLM Agent 用于程序修复的范畴,与 PL×AI 有交叉,且涉及仓库级 issue 流这一较新的场景设定;但其核心是用情节/语义记忆提升 Agent 自身的修复成功率,既没有对 Agentic 程序做静态分析,也没有用 LLM 改进静态分析/形式化验证,属于用户画像中明确不感兴趣的“研究目标本身是 LLM/Agent 能力提升(靠记忆与提示工程,无权重微调)”一类工作。引用 0 inbox
Benzhao Wu, Zhiwen Luo, Fangwen Mu, Lijun Xiang
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:为 LLM 修复智能体引入情节记忆与语义记忆,在同一代码库的连续 issue 流中复用经验,以更低成本大幅提升修复成功率。

仓库级程序修复中,LLM 通常对每个 issue 重置上下文,而真实维护往往是同一代码库上连续不断的工单流。作者在 SWE-Bench Pro 的分层子集(8 个项目 × 25 个实例)上研究这种序列化场景,并在每个项目内按提交时间顺序执行实例,使后续修复能利用先前轨迹。为此提出 TwinMem-Agent:将 test-patch-validate 循环与情节记忆(有据可依的演示)和语义记忆(LLM 蒸馏的笔记)配对;每个 issue 结束后记忆模块压缩轨迹、在固定预算下合并更新,并在推理时检索范例与指南,全程不微调模型权重。以 DeepSeek-V3.2 为共享骨干、使用相同 Docker 化实例,与 mini-swe-agent 对比 Pass@1 与平均推理成本,并在 25 个 Ansible 实例上对记忆模块做消融(Pass@1 与 RSR)。结果显示 TwinMem-Agent 达到 89.1% Pass@1(基线 60.0%),成本约低 18 倍($0.0044 对 $0.0798);移除记忆模块使 Pass@1 下降 8 个百分点、RSR 下降 12 个百分点,RSR 的更大跌幅表明跨 issue 积累的经验最直接地惠及缺陷复现,并进而提升补丁成功率。

问题
仓库级程序修复的 LLM 智能体通常为每个 issue 重置上下文,无法利用同一代码库中前后工单之间累积的维护经验。
方法
TwinMem-Agent 将 test-patch-validate 循环与两类记忆结合:情节记忆提供有据可依的演示,语义记忆存储 LLM 蒸馏的笔记;每个 issue 后压缩轨迹并在固定预算下合并更新,推理时检索范例与指南,且不微调模型权重。
评估
在 SWE-Bench Pro 的 8×25 分层子集上按提交时间顺序运行,以 DeepSeek-V3.2 为统一骨干和相同 Docker 化实例,与 mini-swe-agent 比较 Pass@1 与平均推理成本,并在 25 个 Ansible 实例上消融记忆模块、测量 Pass@1 与 RSR。
原文摘要(Abstract)

Large language models for repository-level repair usually reset context for every issue, even though real maintenance often unfolds as a stream of tickets within the same codebase. We study this sequential regime on a stratified 8 × 25 subset of SWE-Bench Pro (eight projects, twenty-five instances each), running instances in commit-time order within each project so later repairs can draw on earlier trajectories. We present TwinMem-Agent, which pairs a test-patch-validate loop with episodic memory (grounded demonstrations) and semantic memory (LLM-distilled notes). After each issue, a memory module compacts the trajectory, merges updates under a fixed budget, and retrieves exemplars and guidelines at inference time, all without fine-tuning model weights. Using DeepSeek-V3.2 as the shared backbone and identical Dockerized instances, we compare TwinMem-Agent to mini-swe-agent on Pass@1 and average inference cost, and ablate the memory module on 25 Ansible instances measuring Pass@1 and RSR. TwinMem-Agent achieves 89.1% Pass@1 versus 60.0% for the baseline at roughly 18× lower cost ($0.0044 vs. $0.0798). Removing the memory module reduces Pass@1 by 8 pp and RSR by 12 pp, with the larger RSR drop confirming that accumulated cross-issue experience most directly benefits bug reproduction and cascades into higher patch success.

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@inproceedings{WuLMX26,
  title = {TwinMem-Agent: Episodic and Semantic Memory for Repository-Level Program Repair},
  author = {Benzhao Wu and Zhiwen Luo and Fangwen Mu and Lijun Xiang},
  booktitle = {FSE},
  year = {2026},
  doi = {10.1145/3803437.3807664}
}