论文

RepoTrace:用需求-代码对应改善多轮代码智能体表现

RepoTrace: Improving Requirement Tracing in Multi-Round Agent Interactions

精选理由

代码智能体改着改着就跑偏?这篇论文用需求-代码对应关系把它拉回来,GLM-5.2 上 MPR 涨了 19.99,还开源了。

论文分析了 EvoCode-Bench 中 2656 条智能体轨迹,发现需求焦点错位是多轮交互中的常见失败模式,智能体难以区分需求的主要修改目标和无关代码。作者提出 RepoTrace,一个需求驱动的仓库理解框架,将仓库结构与需求语义结合构建需求-代码对应关系,并注入智能体上下文。实验显示该方法在不同模型和框架上提升平均每轮奖励(MPR),其中 GLM-5.2 提升 19.99,Claude Code 提升 10.22。在 Terminus-2 搭配 DeepSeek-V4-Pro 上,平均每轮奖励从 0.163 提升到 0.371,平均回归错误减少 56.78%。源码和智能体轨迹已开源发布。

原文 · arXiv: DeepSeek

RepoTrace: Improving Requirement Tracing in Multi-Round Agent Interactions

Code agents have become increasingly capable of performing software engineering tasks through interaction with software environments. However, agents tend to degrade as the number of interaction rounds increases, making it difficult to maintain existing software during iterative modification. We analyze 2,656 agent trajectories in EvoCode-Bench and identify requirement focus misalignment as a recurring failure pattern, where agents struggle to distinguish the primary modification targets of a requirement from unrelated code. We propose Repotrace a requirement-driven repository understanding harness that combines repository structure with requirement semantics to construct a requirement-code correspondence and injects it into the agent context. This correspondence enables code agents to follow the repository architecture, trace requirements across multi-round interactions, and identify the core code elements corresponding to the current requirement. Experiments show that Repotrace improves the mean per-round reward (MPR) across different models (e.g., +19.99 on GLM-5.2) and agent harnesses (e.g., +10.22 on Claude Code). Across rounds, Repotrace increases the average per-round reward from 0.163 to 0.371 on Terminus-2 with DeepSeek-V4-Pro, while reducing average regression errors by 56.78%. We release the source code and agents' trajectories to support future research.