StageGate-RSI: Self-Evolution of Vulnerability Discovery Agents via Decoupled Attribution and Statistical Gating

StageGate-RSI framework tackles evaluation contamination and attribution ambiguity in vulnerability discovery agent self-evolution via zero-leakage benchmarks, stage decoupling, and statistical gating.
The article identifies three obstacles for LLM-based autonomous vulnerability discovery agents in recursive self-improvement (RSI): historical benchmark contamination causing label leakage or polarity reversal; post-fix specificity collapse (pre-fix recall 74.84%-76.96% but post-fix specificity only 39.22%-43.12%, near random); and high-variance stochastic optimization causing naive reflection-based evolution to overfit validation noise. Researchers propose StageGate-RSI, comprising zero-leakage paired benchmarks PairVuln (Multi: 203 pairs, Single: 1,241 pairs), stage decoupling (separating hypothesis generation from agent verification via Teacher-Forced Hypothesis Cards), and a seven-slot RSI outer loop with a multi-gate statistical defense protocol. Experiments show 56.9% of post-fix false positives stem from Stage-1 topic drift; pre-fix hypothesis forcing raises specificity by 32.36 percentage points to 75.48% and paired accuracy by 14.25 percentage points. The outer loop achieves 2.26 percentage points search gain and 1.83 percentage points held-out validation gain (6.67 percentage points specificity improvement). The article stresses that RSI must first solve evaluation contamination and attribution ambiguity, and that stage decoupling and statistical gating have general engineering value.
The Self-Evolution Dilemma of Vulnerability Discovery Agents
Autonomous vulnerability discovery agents based on large language models hold great promise—they are expected to automatically audit production codebases and recursively self-improve (RSI) from execution trajectories. However, this path is blocked by three obstacles.
According to the study, the first obstacle is historical benchmark contamination, which leads to ground-truth label leakage or polarity reversal between pre-fix and post-fix states; the second is post-fix specificity collapse—end-to-end agents achieve pre-fix recall of 74.84%-76.96%, but post-fix specificity is close to random levels (39.22%-43.12%); the third is high-variance stochastic optimization, with single-sample trajectory flip rates as high as 14%-15%, causing naive reflection-based evolution to easily overfit validation noise or sacrifice one of recall and specificity for the other.
To address these issues, researchers propose the StageGate-RSI framework, offering a complete solution spanning benchmark construction, stage-decoupled attribution, and statistically gated recursive self-improvement.

Zero-Leakage Paired Benchmark: Building PairVuln
The prerequisite for evaluating vulnerability discovery agents is a benchmark that is uncontaminated and can distinguish pre-fix from post-fix states. StageGate-RSI constructs two zero-leakage paired benchmarks via a five-stage automated curation pipeline: PairVuln-Multi containing 203 commit pairs, and PairVuln-Single containing 1,241 commit pairs.
The "paired" design is key. Each commit pair includes both the pre-fix and post-fix code states, enabling evaluation to separately measure the agent's ability to discover vulnerabilities before fixes (recall) and its ability to avoid false positives after fixes (specificity). Zero-leakage means no ground-truth labels remain in the benchmark, preventing agents from "memorizing answers."
This benchmark construction approach essentially advances vulnerability discovery evaluation from single-point judgment to paired comparison, providing a clean data foundation for subsequent attribution analysis.
Historical benchmark contamination is a common pitfall in vulnerability discovery agent evaluation. Since LLM pre-training data may already contain historical versions of public codebases, if benchmark vulnerability samples come from commits the model has seen during training, the model may "remember" labels rather than genuinely reason. More insidious is polarity reversal: for the same commit pair, the pre-fix code contains a vulnerability and the post-fix code has it patched, but if the benchmark construction incorrectly labels the state, the signal the model learns will be opposite to the true objective, distorting evaluation results. Zero-leakage paired benchmarks remove commits that appeared in training sets through automated pipelines and strictly verify pre-fix and post-fix states, thereby avoiding label leakage and polarity errors and providing a foundation for fair evaluation.
Stage Decoupling: Separating Hypothesis Generation from Agent Verification
One of StageGate-RSI's core designs is decoupling Stage-1 hypothesis generation from Stage-2 agent verification, with information passed through Teacher-Forced Hypothesis Cards.
This decoupling enables clear attribution. The study finds that on PairVuln-Single, 56.9% of post-fix false positives from end-to-end agents originate from Stage-1 post-fix topic drift. In other words, more than half of false positives are not failures of the verification stage but stem from the hypothesis generation stage already going off track.
Further experiments show that pre-fix hypothesis forcing improves post-fix specificity by 32.36 percentage points to 75.48%, and paired accuracy by 14.25 percentage points to 73.23%. When hypothesis cards contain only location information, about 70% of Stage-2 post-fix false positives shift to irrelevant secondary code smells.
These data reveal an easily overlooked fact: agents' false positives on post-fix code are often not because they "can't understand the code," but because the information structure provided by hypothesis cards directs their attention to the wrong target.
Teacher-Forced Hypothesis Cards are a structured intermediate representation used to forcibly pass Stage-1 (hypothesis generation) outputs to Stage-2 (agent verification). During training or evaluation, teacher forcing means Stage-2 receives the "ground-truth" hypothesis cards generated by Stage-1 rather than its own approximate predictions, thereby isolating errors between the two stages. Hypothesis cards typically contain fields such as vulnerability location, type, and pre-fix code snippets, and their information structure directly affects attention allocation in the verification stage. Through decoupling, researchers can independently assess hypothesis generation quality and pinpoint false positive sources—for example, when hypothesis cards contain only location information, the verification stage tends to shift to irrelevant secondary code smells, explaining why information structure guidance is crucial.
Seven-Slot RSI Outer Loop and Statistical Gating
Beyond evaluation, StageGate-RSI designs a seven-slot RSI outer loop, incorporating four-quadrant contrastive paired reflection and a pre-registered multi-gate statistical defense protocol.
High variance is the natural enemy of recursive self-improvement. Researchers use gating mechanisms to combat the Winner's Curse and threshold drift caused by validation noise. Ultimately, through sectioned bounded base scoring rule evolution, the outer loop achieves a confirmed 2.26 percentage point search gain and a 1.83 percentage point held-out validation gain (including a 6.67 percentage point specificity improvement).
These gain magnitudes may seem modest, but under statistical gating constraints they represent "confirmed" real improvements rather than noise-driven inflation. For high-risk optimization scenarios like recursive self-improvement, trustworthy small gains have more engineering value than untrustworthy large improvements.
Winner's Curse in recursive self-improvement manifests as: when selecting the version with the best validation set performance from a large number of random mutations, its true performance is often overestimated because the selection process exploits validation noise. Threshold drift refers to decision thresholds gradually deviating from optimal values due to overfitting the validation set as iterations progress. The pre-registered multi-gate statistical defense protocol pre-specifies statistical tests (such as significance levels and effect size thresholds) and multiple independent validation gates (such as search gain gate and held-out validation gate), requiring improvements to pass all gates simultaneously to be confirmed, thereby suppressing noise-driven spurious improvements. This protocol draws on the pre-registration concept from clinical trials, ensuring that recursive self-improvement gains have statistical credibility.
Implications for Vulnerability Discovery Agent Research
The value of StageGate-RSI extends beyond a single framework. It reminds the research community that for recursive self-improvement to be truly usable, two prerequisite problems must first be solved: evaluation contamination and attribution ambiguity.
The stage decoupling approach is generalizable—any multi-stage agent pipeline can localize bottleneck stages by forcibly passing structured intermediate artifacts. The statistical gating protocol provides an engineering paradigm for combating stochastic optimization overfitting.
Given the current state of high pre-fix recall and low post-fix specificity, end-to-end vulnerability discovery agents still have a way to go before production readiness. The combination of decoupling and gating offered by StageGate-RSI at least points to a verifiable improvement path.
One-line Summary
StageGate-RSI framework addresses evaluation contamination and attribution ambiguity in vulnerability discovery agent self-evolution through zero-leakage benchmarks, stage decoupling, and statistical gating.
Paragraph Summary
The article identifies three obstacles facing LLM-based autonomous vulnerability discovery agents in recursive self-improvement (RSI): historical benchmark contamination causing label leakage or polarity reversal; post-fix specificity collapse, where end-to-end agents achieve pre-fix recall of 74.84%-76.96% but post-fix specificity of only 39.22%-43.12%, near random levels; and high-variance stochastic optimization making naive reflection-based evolution prone to overfitting validation noise. To address these, researchers propose the StageGate-RSI framework, including zero-leakage paired benchmarks PairVuln (Multi: 203 pairs, Single: 1,241 pairs), stage decoupling (separating hypothesis generation from agent verification via Teacher-Forced Hypothesis Cards), and a seven-slot RSI outer loop with a multi-gate statistical defense protocol. Experiments find that 56.9% of post-fix false positives originate from Stage-1 topic drift; pre-fix hypothesis forcing improves specificity by 32.36 percentage points to 75.48% and paired accuracy by 14.25 percentage points. The outer loop ultimately achieves 2.26 percentage points search gain and 1.83 percentage points held-out validation gain (6.67 percentage points specificity improvement). The article emphasizes that recursive self-improvement must first address evaluation contamination and attribution ambiguity, and that stage decoupling and statistical gating have general engineering value.
Related articles

A Data Scientist's Ten-Year Reflection: Vibe Coding Was Right All Along
A data scientist with ten years' experience reflects on why he misjudged vibe coding: from inverted product validation logic and security risk tradeoffs to tool maturity and clone wars—deconstructing the real competitive moat in the AI coding era: trust and demand matching.

CleanYourTV: One-Click Removal of Android TV Ads and Bloatware
CleanYourTV is a tool for removing ads and bloatware from Android TV and Google TV, sparking discussion on Hacker News. This article covers what it does, the community discussion highlights, and usage considerations.

Chamberlain's New Terms: Your Garage Door Data Will Be Permanently Licensed to Train AI
Chamberlain Group's new terms effective January 6, 2027, grant it permanent rights to use garage door device data for AI training. This article analyzes the business logic, privacy risks, and smart home data governance dilemma.