ChatPaper.aiChatPaper

Mastermind: 策略驱动的仓库级漏洞复现学习

Mastermind: Strategy-grounded Learning for Repository-Scale Vulnerability Reproduction

July 2, 2026
作者: Mingzhe Du, Luu Anh Tuan, Tianyi Wu, Renyang Liu, Zhijiang Guo, Dong Huang, See-Kiong Ng
cs.AI

摘要

仓库级漏洞复现是一项要求较高的软件工程(SE)任务:智能体必须审查代码库,推断能够触发漏洞路径的输入语法,构建概念验证(PoC),并验证补丁版本中崩溃是否消失。当前的LLM智能体在方法正确时通常能够执行这些步骤,但仍可能因选择错误策略而失败。本文认为,对于此类SE智能体而言,策略——而非完整的动作轨迹——是更合适的学习单元:它足够紧凑以便优化,足够具体以指导执行,且足够稳定以便在多次尝试中存储和复用。我们提出Mastermind,一个将可迁移策略学习与任务特定经验分离的双循环框架。一个可训练的规划器通过监督微调(SFT)和基于里程碑的GRPO学习可复用的漏洞复现策略,而一个经验循环则维护任务局部的策略记录,以指导后续尝试。该规划器独立于执行器进行训练,使得策略学习能够改进多个冻结的执行器,而无需修改其动作生成能力。我们在CyberGym上使用260个训练任务和200个保留评估任务对Mastermind进行评估。以GPT-5.5作为冻结执行器时,Mastermind达到了84.5%的通过率,优于开放书PoC上下文(60.0%)、Best-of-8采样(63.0%)和迭代改进(77.0%)。同一规划器还将GPT-5.4 mini和GLM~5.1的通过率分别从45.0%和58.5%提升至60.0%和71.0%。这些结果表明,学习高层策略是改进仓库级SE智能体的一种有效且可迁移的机制。
English
Repository-level vulnerability reproduction is a demanding software engineering (SE) task: an agent must inspect a codebase, infer the input grammar that reaches a vulnerable path, construct a proof-of-conceptv(PoC), and verify that the crash disappears on the patched build. Recent LLM agents can often execute these steps when the approach is correct, yet they still fail by choosing the wrong strategy. This paper argues that strategy, rather than the full action trajectory, is the right learning unit for such SE agents: it is compact enough to optimize, concrete enough to guide execution, and stable enough to store and reuse across attempts. We present Mastermind, a dual-loop framework that separates transferable strategy learning from task-specific experience. A trainable planner learns reusable vulnerability-reproduction strategies through SFT and milestone-based GRPO, while an experience loop maintains task-local strategy records that guide subsequent attempts. The planner is trained independently of the executor, allowing strategy learning to improve multiple frozen executors without modifying their action-generation capability. We evaluate Mastermind on CyberGym using 260 training tasks and 200 held-out evaluation tasks. With GPT-5.5 as the frozen executor, Mastermind achieves an 84.5% pass rate, outperforming open-book PoC context (60.0%), Best-of-8 sampling (63.0%), and iterative improvement (77.0%). The same planner also improves GPT-5.4 mini and GLM~5.1 from 45.0% and 58.5% to 60.0% and 71.0%. These results demonstrate that learning high-level strategies is an effective and transferable mechanism for improving repository-scale SE agents.