arXiv:2506.11060cs.SEcs.AI2025-06被引 19

用深度研究框架解决系统级代码漏洞,显著提升修复成功率。

Code Researcher: Deep Research Agent for Large Systems Code and Commit History

  • 构建代码深度研究代理,融合语义、模式与提交历史多维推理。
  • 在内核崩溃数据集上达成54%修复率,优于现有方法31%-31.5%。
  • 适用于大型复杂代码库,适合研发与自动化测试团队使用。

基于大语言模型的编程代理在编码基准上表现良好,但在系统代码领域的应用仍不充分。由于系统代码规模庞大且结构复杂,修改代码前需从代码库及其海量提交历史中获取多方面上下文信息。受深度研究代理进展启发,我们设计首个面向代码的深度研究代理——Code Researcher,用于生成修复系统代码崩溃的补丁。Code Researcher通过多步推理分析代码语义、模式及提交历史,从代码库和其提交历史中检索所有相关上下文。我们在kBenchSyz(Linux内核崩溃基准)上评估该方法,结果表明其显著优于强基线:使用GPT-4o时,崩溃修复率(CRR)达48%,高于SWE-agent的31.5%和Agentless的31%;采样预算扩大至10条轨迹时,修复率进一步提升至54%。在采用Gemini 2.5-Flash模型时,修复率可达67%。此外,在开源多媒体软件上的实验验证了其泛化能力,并进行了消融分析。实验表明,全局上下文收集与多维度推理对大型代码库至关重要。

原文摘要 · Abstract (English)

Large Language Model (LLM)-based coding agents have shown promising results on coding benchmarks, but their effectiveness on systems code remains underexplored. Due to the size and complexities of systems code, making changes to a systems codebase requires researching about many pieces of context, derived from the large codebase and its massive commit history, before making changes. Inspired by the recent progress on deep research agents, we design the first deep research agent for code, called Code Researcher, and apply it to the problem of generating patches to mitigate crashes reported in systems code. Code Researcher performs multi-step reasoning about semantics, patterns, and commit history of code to retrieve all relevant context from the codebase and its commit history. We evaluate Code Researcher on kBenchSyz, a benchmark of Linux kernel crashes, and show that it significantly outperforms strong baselines, achieving a crash-resolution rate (CRR) of 48%, compared to 31.5% by SWE-agent and 31% by Agentless, using OpenAI's GPT-4o model. Scaling up sampling budget to 10 trajectories increases Code Researcher's CRR to 54%. Code Researcher is also robust to model choices, reaching 67% with the newer Gemini 2.5-Flash model. Through another experiment on an open-source multimedia software, we show the generalizability of Code Researcher and also conduct ablations. Our experiments highlight the importance of global context gathering and multi-faceted reasoning for large codebases.

代码修复研究代理系统代码

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。