← Latest papers
🤖 AI

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

This paper introduces Mastermind, a dual-loop framework that improves repository-scale vulnerability reproduction by training a planner to learn and transfer high-level strategies, achieving an 84.5% pass rate on CyberGym and significantly outperforming existing baselines across multiple frozen LLM executors.

Original authors: Mingzhe Du, Luu Anh Tuan, Tianyi Wu, Renyang Liu, Zhijiang Guo, Dong Huang, See-Kiong Ng

Published 2026-07-03
📖 4 min read☕ Coffee break read

Original authors: Mingzhe Du, Luu Anh Tuan, Tianyi Wu, Renyang Liu, Zhijiang Guo, Dong Huang, See-Kiong Ng

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are trying to find a very specific, hidden flaw in a massive, complex machine (like a giant library of code). To prove the flaw exists, you have to build a tiny, custom key (a "Proof-of-Concept" or PoC) that fits perfectly into the lock to make the machine crash in a specific way. If you can do that, you've found the vulnerability.

The paper argues that the problem isn't that the "worker" (the AI) is bad at building keys or turning them. The problem is that the worker keeps trying the wrong keys or looking in the wrong rooms. They are efficient at acting, but terrible at planning.

Here is how the paper's solution, called Mastermind, works, using simple analogies:

The Problem: The "Busy but Lost" Worker

Imagine a very skilled mechanic (the AI Executor) who can use any tool, open any door, and fix any engine. However, if you tell them, "Go find the broken part," they might spend hours checking the radio, the tires, and the seats, completely missing the engine block where the real problem is.

Recent AI agents are like this mechanic. They can follow instructions perfectly, but they often waste time exploring dead ends because they don't have a good strategy for where to look first.

The Solution: Mastermind (The "General" and the "Scribe")

Mastermind splits the job into two distinct roles, separating thinking from doing.

  1. The General (The Planner): This is the part that learns. It doesn't touch the tools or the machine. Its only job is to write a short, clear map (a "Strategy") that says: "Go to the engine room, check the fuel line, and try turning the valve clockwise."
  2. The Scribe/Worker (The Executor): This is the frozen AI (like GPT-5.5) that actually does the work. It reads the General's map and performs the actions. It is not changed or retrained; it just follows orders.

How Mastermind Learns: The "Dual-Loop" System

The paper introduces a clever two-part learning system to make the General better at writing maps:

  • Loop 1: The "Lesson Book" (Experience Loop)
    Imagine the General keeps a notebook for this specific machine. If the General says, "Check the fuel line," and the worker finds nothing, the General writes in the notebook: "Fuel line was fine; don't check it again." This notebook is temporary and specific to the current task. It helps the General avoid the same mistakes in the next attempt on this machine.

  • Loop 2: The "Brain Training" (Policy Loop)
    This is where the General actually gets smarter over time. After many attempts on many different machines, the General looks at its notebook and asks: "When I wrote 'Check the fuel line,' did it usually work? When I wrote 'Check the tires,' did it usually fail?"
    The system uses a reward system (like a video game score) to tell the General: "Good job, that strategy led to a crash!" or "Bad job, that was a waste of time." The General updates its internal brain (weights) to learn general rules about how to find flaws, which it can then use on new machines it has never seen before.

Why This is a Big Deal

The paper tested this on a benchmark called CyberGym, which has hundreds of real-world code vulnerabilities.

  • Without Mastermind: If you just let the AI try random guesses (or even try 8 different random guesses at once), it solves about 63% of the problems.
  • With Mastermind: By teaching the AI to plan better strategies, it solved 84.5% of the problems using the same underlying AI worker.

The Key Takeaway

The paper claims that for complex software tasks, strategy is more important than raw power.

Think of it like a treasure hunt. You can have the strongest, fastest runner (the AI Executor), but if they don't have a good map (the Strategy), they will run in circles. Mastermind teaches the AI how to draw better maps. Once the AI learns how to draw a good map, it can give that map to any runner (even a smaller or different AI), and they will all do a much better job finding the treasure.

In short: Mastermind doesn't make the AI stronger at moving its hands; it makes the AI smarter at deciding where to move its hands.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →