用强化学习训练单一代码跳转工具,高效定位大型仓库问题
One Tool Is Enough: Reinforcement Learning for Repository-Level LLM Agents
- 仅用跳转定义一个工具,按代码执行流设计智能体
- 7B模型超越14B基线,32B模型超闭源模型表现
- 适合需要精准代码定位的开发与自动化测试场景
在大型软件仓库中定位需修改的文件和函数极具挑战,因规模庞大且结构复杂。现有基于大模型的方法通常将其视为仓库级检索任务,并依赖多个辅助工具,常忽略代码执行逻辑且增加控制难度。本文提出RepoNavigator,一种配备单一执行感知工具(跳转至被调用符号定义)的LLM智能体。该统一设计反映真实代码执行流程,同时简化工具操作。RepoNavigator通过强化学习端到端训练,直接从预训练模型出发,无需依赖闭源蒸馏。实验表明,强化学习训练的RepoNavigator达到当前最佳性能:7B模型优于14B基线,14B模型超越32B对手,32B模型在多数指标上超过GPT-5等闭源模型。结果证明,将单一结构化工具与强化学习结合,为仓库级问题定位提供了高效可扩展的解决方案。
原文摘要 · Abstract (English)
Locating files and functions requiring modification in large software repositories is challenging due to their scale and structural complexity. Existing LLM-based methods typically treat this as a repository-level retrieval task and rely on multiple auxiliary tools, which often overlook code execution logic and complicate model control. We propose RepoNavigator, an LLM agent equipped with a single execution-aware tool: jumping to the definition of an invoked symbol. This unified design reflects the actual flow of code execution while simplifying tool manipulation. RepoNavigator is trained end-to-end via Reinforcement Learning (RL) directly from a base pretrained model, without relying on closed-source distillation. Experiments demonstrate that RL-trained RepoNavigator achieves state-of-the-art performance, with the 7B model outperforming 14B baselines, the 14B model surpassing 32B competitors, and the 32B model exceeding closed-source models such as GPT-5 on most metrics. These results confirm that integrating a single, structurally grounded tool with RL training provides an efficient and scalable solution for repository-level issue localization.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。