仅用终端指令训练的代码搜索智能体,性能媲美大模型。
CodeScout: An Effective Recipe for Reinforcement Learning of Code Search Agents
- 用强化学习训练仅依赖终端的代码搜索代理。
- 在三个基准上超越2-18倍大的基线模型,接近闭源模型表现。
- 适合想低成本构建高效代码搜索系统的开发者使用。
编码智能体在大型代码库中执行任务的前提是代码定位——识别相关文件、类和函数。尽管已有基于嵌入的检索方法实现仓库级代码定位,近期研究转向开发智能体,在执行任务前或过程中完成定位。多数现有方法为智能体配备复杂专用工具,如静态分析生成的仓库图。本文表明,通过有效的强化学习策略,仅配备标准Unix终端的编码智能体即可取得优异效果。我们在SWE-Bench Verified、Pro和Lite三个基准上进行实验,结果表明,我们的模型在性能上始终优于或媲美2-18倍更大的基线与微调大模型,部分场景下接近Claude Sonnet等闭源模型表现,即使使用专用框架也如此。本工作聚焦于复用现有编码智能体环境、奖励设计及强化学习优化技术。我们开源了CodeScout模型族及相关全部代码与数据,供社区持续改进。
原文摘要 · Abstract (English)
A prerequisite for coding agents to perform tasks on large repositories is code localization - the identification of relevant files, classes, and functions to work on. While repository-level code localization has been performed using embedding-based retrieval approaches such as vector search, recent work has focused on developing agents to localize relevant code either as a standalone precursor to or interleaved with performing actual work. Most prior methods on agentic code search equip the agent with complex, specialized tools, such as repository graphs derived from static analysis. In this paper, we demonstrate that, with an effective reinforcement learning recipe, a coding agent equipped with nothing more than a standard Unix terminal can be trained to achieve strong results. Our experiments on three benchmarks (SWE-Bench Verified, Pro, and Lite) reveal that our models consistently achieve superior or competitive performance over 2-18x larger base and post-trained LLMs and sometimes approach performance provided by closed models like Claude Sonnet, even when using specialized scaffolds. Our work particularly focuses on techniques for re-purposing existing coding agent environments for code search, reward design, and RL optimization. We release the resulting model family, CodeScout, along with all our code and data for the community to build upon.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。