Peer pressure: attacker and defender populations for code security perform validated coevolutionPeer Pressure: Execution-Verified Co-Evolution of Attacker and Defender Populations for Code Security
PRPO uses execution verification to co-train attacking and defending LoRA populations; the 7B reviewer achieves 64.8% balanced accuracy on four unseen applications.
- Vulnerability detectors and guardrails trained on static corpora stop improving after absorbing the snapshot while the attack distribution keeps moving; a single red-blue pair collapses in policy, and the training reward also cannot distinguish progress from opponent stagnation.
- PRPO co-trains Red and Blue LoRA populations on the same frozen base. A patch receives reward only if it builds, passes tests and reproduces the exploit in an isolated container; same-condition peer returns serve as the advantage baseline, and a tournament eliminates the weakest adapters.
- The diff-level 7B reviewer achieves 64.8% balanced accuracy on four unseen applications, and 87.0% on the source application holdout. Repository-level Setting B recovers 23/172 suggestions on VulnGym. The jailbreak guardrail reduces ASR on WildGuardTest from 36.0% to 4.6%.
- The authors note that the evaluation set is balanced by construction and precision would be very low under a low prior; weakness classes are fixed in advance, and state-dependent and cross-commit weaknesses fall outside the reward; rebuilding the site bank requires a capable proposer; larger populations were not studied, and the two arms use different backbones.
- Evaluated models
- Qwen2.5-Coder-7B-InstructQwen3.5-9BQwen2.5-7B-Instruct
- Benchmarks
- GrimoireLagoPrestaShopPretixOpenEMRHabiticaMauticMinifluxFileBrowserBookStackPlausibleVulnGymHarmBenchWildJailbreakWildGuardTestStrongREJECTXSTest
- Metrics
- balanced accuracyTPR at FPR=0.1advisory recallentry recalledit similarityASRF1
The researchers propose Peer-Relative Policy Optimization, in which attackers and defenders are trained together as a population of LoRA adapters on the same frozen base, and the reward is determined by whether a patch can be applied, built, pass tests, and reproduce a real vulnerability in an isolated container. A 7B diff-review model trained this way reached 64.8% balanced accuracy on four unseen applications and three untrained languages, 5.5 percentage points higher than supervised safety fine-tuning and 4.4 percentage points higher than the frozen frontier review model Claude Opus 4.8. Its 9B repository agent reproduced 23 of 172 held-out VulnGym advisories, versus 10 after supervised fine-tuning and 7 for the untrained same backbone; it located 17 of 43 reachable entry points, versus 13 for mini-swe-agent using GLM-5.2. When the same algorithm was applied unchanged to jailbreak defense, it reduced attack success rate from 36.0% to 4.6% under a judge different from the training judge, versus 8.9% for WildGuard.
Paper analysis
What problem does this paper attempt to solve?
The authors aim to address code vulnerability detection on static corpora failing to keep up with an adapting opponent, and use execution-verified population co-training to do so.
Vulnerability detection on static corpora absorbs a snapshot and then stalls, while the attack distribution keeps moving; the authors use execution-verified red-blue population co-training in exchange for actionable localization supervision.
- Scenario: the authors state that LLMs already write and review a large amount of production code, detectors and guardrails stop improving after fitting a static corpus, yet the attack distribution keeps moving. The authors also state that writers and reviewers from the same model family have correlated errors, and the weaknesses a writer introduces are exactly the ones the reviewer finds hardest to catch.
- Existing shortcomings: the authors point out two instabilities: a single Red–Blue pair collapses to one policy, after which both sides' learning stalls; and Blue's training reward still rises when Red stops improving, so real progress cannot be distinguished from opponent stagnation.
- Core observation: known weakness classes are implanted into container copies of real applications, and a site is admitted only when the existing exploit harness triggers. The authors state that what this yields is a label for where catalogued classes are reachable, not new vulnerabilities, in a manner similar to mutation testing and fuzzer benchmarks.
- Game setup: Red must hide a known-class weakness while completing the development task; the patch must apply, build, pass tests, and reproduce a real exploit in an isolated container, otherwise the reward is zero. Blue must flag the problem and point out the entry and the effective location. Red receives only certified sites and does not search for unknown weaknesses; both sides are LoRA populations on the same frozen base. Training takes place in the authors' own container copies.
- Proposed method: the authors propose Peer-Relative Policy Optimization (PRPO): same-role LoRA populations, matched-population advantage (MPA) over the same conditions, and a tournament that eliminates the weakest adapters.
What related research exists?
Related work is divided into co-training, code red-blue, population credit and vulnerability detection; the authors state that the population is placed into the policy gradient baseline.
Adversarial LLM Co-Training
- Single policy or text games: Liu et al. (2025a) have one policy play both sides; Wen et al. (2026) train attack and defense separately. The authors note that both optimize a single policy or a pair of policies and score text rather than executable artifacts.
- Self-generated tasks: Absolute Zero (Zhao et al., 2026) and R-Zero (Huang et al., 2026a) remove the fixed dataset and learn from a code executor or majority-vote pseudo-labels, respectively. The authors state that the Red reward is closest to Absolute Zero's proposer reward, i.e., one minus the solver success rate.
- PopuLoRA: Castanyer et al. (2026) co-evolve a LoRA population on a shared base, with the population entering the reward and selection by TrueSkill, on code generation. The authors contrast: PRPO targets security and puts the population into the baseline.
Code Security Red-Blue
- Verification: the authors state that vulnerability-injection frameworks usually verify with syntax or detector F1 rather than running an exploit, so a diff that only looks dangerous can still score. RvB (Huang et al., 2026b) is a red-blue game with no parameter updates; controlled generation hardening (He and Vechev, 2023) and reasoning-distilled detectors (Weyssow et al., 2025) fit the model once to a fixed corpus.
Population Credit and Variance Reduction
- Opponent pools and critics: PSRO (Lanctot et al., 2017) and league training (Vinyals et al., 2019) use the population as an opponent distribution, leaving the baseline to the inner-loop learner. Centralized critics (Foerster et al., 2018; Yu et al., 2022) use a learned value function to bring other agents into credit assignment.
- Peer mean: the authors define the peer baseline as the empirical mean of independent attempt returns under the same matched condition. Quality-diversity red teaming (Samvelyan et al., 2024) evolves prompt archives with frozen models; population training (Jaderberg et al., 2017) evolves full models for hyperparameter search, which the authors call the predecessor of their tournament.
- In-group baseline: RLOO (Ahmadian et al., 2024) and GRPO (Shao et al., 2024) draw groups from a single policy; OPO (Hao et al., 2025) uses a length-weighted group mean that includes the scored sample. The authors state that MPA follows VIMCO's leave-one-out control variate and extends the group to different policies under a shared condition.
Detection Evaluation and Baselines
- Detectors and VulnGym: Ding et al. (2024) report that models rarely separate a vulnerable function from its patch; Li et al. (2025) report precision drops at repository scale; Shu et al. (2026), Hanifi et al. (2023), and Chakraborty et al. (2021) discuss granularity, language, and data realism. VulnGym (Ji et al., 2026) is the repository-level evaluation the authors use, with line-level entry, key operation, and trace.
- Baselines and benchmarks: code controls are Security-SFT, single pair, Ensemble-of-4, within-policy RLOO, global baseline, OPO, and a learned critic; repository-level is evaluated on mini-swe-agent, citing Ji et al. (2026)'s zero-shot public row. Jailbreak controls include Safety-SFT, WildGuard, and Llama Guard 3, with benchmarks HarmBench, WildJailbreak, WildGuardTest, StrongREJECT, and XSTest.
The authors state that, to their knowledge, this is the first population-based co-evolution trainer for adaptive security, and the first to put the population into the policy-gradient baseline rather than into an opponent pool, reward, or learned critic; evaluation uses security outcome metrics rather than the training reward.
How does the paper address this problem?
PRPO maintains red and blue LoRA populations on a frozen base, executes fixed rewards in a sandbox, and uses same-condition peer returns as the baseline.
PRPO makes Red and Blue into LoRA populations on the same frozen base: reward is determined only by build and execution, and the advantage baseline comes from same-role peers facing the same condition, not from an opponent pool or a learned critic.
Game and conditions
- Scenario: scenario x=(r, τ, c, y), containing the repository state, the development task, the target weakness class and the label y∈{clean, vulnerable}. A round fixes the condition ω=(x, frozen opponent committee, decoding budget), making same-role policies comparable.
- Red's edits: the bank provides a reference diff that has completed the task and passed tests. The vulnerable polarity introduces a reachable weakness of class c while preserving the functional change; the clean polarity makes an edit of similar scale that introduces no weakness. Both polarities are written by Red on the same base, and the authors state that Blue cannot win by recognizing the model-written diff.
- Non-zero-sum: Red must produce a patch that builds, passes tests and is exploitable; it cannot score merely by making Blue err. Red does not search and always receives a certified site; the two code arms differ only in Blue's observation (Table A1). The authors state that the sink is fixed but the path is not, the certification records the exploit's actual path, and the reference location follows Red's choice.
- Population: N=4 adapters per side, LoRA rank r=32, about 0.1% of base parameters. The frozen base is also the KL reference πref.
Execution-verified reward
- Gate F: the verifier is the only domain-specific component; it applies, builds, tests and runs class-specific exploit probes in a container. F=1 requires the patch to be valid, complete the task, and have the safety outcome match the label: when vulnerable, reproduce the class exploit; when clean, the probe does not trigger. Infeasible patches receive exactly zero reward; if all same-condition peers fail, there is no gradient.
- Localization labels: the probe enters from an externally reachable handler and ends at the edited operation, giving h⋆ at file and line granularity, including entry point, key operation and trace. The authors state that static annotation cannot provide this label. Differential taint is used only for reporting the class; it is neither a conjunct of F nor does it produce h⋆.
- Returns for both sides: Red's return is Rred=F(x,Δ)(1−qB(Δ)), i.e., only when the gate passes is credit given according to the degree of being missed or mislocalized. qB is the frozen Blue committee's confidence in the oracle label, weighted by localization match. Blue maximizes balanced accuracy (chance level 50%), with reward inversely weighted by class prior and including a false-positive penalty; diff-level λloc=0, repository-level λloc=0.5. The FPR upper bound δFP=0.1 is maintained by dual ascent.
- Rationale given by the authors: hard voting takes too few values, so patches with different degrees of stealth but equally undetected receive the same return. In the jailbreak domain, ℓ is changed to a judgment of the target response (Appendix Q). Appendix F gives the full prompts for each role.
Matched-population advantage
- Estimation: sample m same-role policies on the same condition; the advantage is Ai=Ri−1/(m−1)∑k≠ isg[Rk], with peer returns stop-gradient. Standardization is done over the update batch, not within a condition: when m=2 the two advantages are negatives of each other, within-condition whitening leaves only the sign, and conditions are reweighted by difficulty.
- Closed form: the authors write the return as condition difficulty plus noise and give a closed form for the advantage variance, for Var(Ai), not gradient variance or convergence. The authors state that when peer correlation ρ>1/m, this variance is lower than the global baseline. Default m=2, break-even at ρ>0.5. Peers are sampled uniformly without replacement; ρ is determined by the condition, not by the matcher.
- Allocation: the authors state that the difference from within-policy RLOO is allocation. A fixed verification budget either buys m rollouts of the same policy or one each of the m policies the tournament would have maintained. Including the mean and leave-one-out differ by a factor absorbed by standardization.
- Update: no critic. Each adapter uses REINFORCE++'s token-level clipped surrogate objective, plus KL to the frozen base. βR=0.02, less than βB=0.04, because Red needs to move further from the base's safe-code prior. Clipping ε=0.2. Each batch of rollouts does μ=4 minibatch updates, because the verifier is the bottleneck. The two sides update alternately with the opponent committee frozen; verified Red trajectories are cached and reused for matched Blue.
Tournament and training schedule
- Elimination: every Ttourn=50 rounds, eliminate the lowest-fitness adapter. Fitness is mean Elo result plus γ times recent peer diversity; diversity is Hamming distance over a six-axis stealth vocabulary. Appendix I gives γdiv=0.3. Elites are not eliminated.
- Reseeding: with equal probability, Gaussian mutation of LoRA factors (σ=0.08) or crossover after orthogonal Procrustes alignment, to preserve rank. New adapters' Elo is set to the population mean. The matching window is ±120 of the first-draw Elo.
- Length and polarity: T=1000 rounds. Clean scenario sampling rate pclean=0.30, with 1/πy weighting used for correction; the evaluation set is balanced. Phase-0 requires the base plus SFT Red to pass the joint gate on at least 25% of attempts before training begins.
Two arms and jailbreak transfer
- The two code arms are trained separately: diff-level uses Qwen2.5-Coder-7B-Instruct with 32K context; Blue returns a verdict and confidence for one-to-three-file diffs, without returning locations. Repository-level uses Qwen3.5-9B, which the authors state meets Ji et al. (2026)'s 256K selection criterion; the scaffold is unmodified mini-swe-agent, read-only, with at most 40 tool calls, and returns localization findings.
- Jailbreak: the authors state that only the verifier, the ℓ term and the source of benign conditions are domain-specific. Red rewrites seed harmful behaviors, Blue acts as a guardrail and gives a block probability; the training oracle is a frozen HarmBench verification classifier, and evaluation uses WildGuardTest, so the oracle and the judge differ.
What experiments did the paper conduct?
diff-level unseen balanced accuracy 64.8%; Setting B recovers 23/172 items; jailbreak ASR from 36.0% to 4.6%.
Experimental Setup
- Backbones: diff-level uses Qwen2.5-Coder-7B-Instruct; repository-level uses Qwen3.5-9B; jailbreak guardrail uses Qwen2.5-7B-Instruct. All are LoRA on a frozen base, r=32. N=4 per role, m=2 for MPA. Deployed is the single Blue adapter with the highest Elo on the validation checkpoint.
- Code data: Setting A is the TypeScript application Grimoire (v0.5.0), 7 weakness classes, 60 admission sites. Setting B adds 6 applications and 5 business-logic classes, 186 sites total, of which 78 are business logic. The seven training applications are disjoint from the four transfer applications and the VulnGym repositories.
- Held-out sets: Miniflux and FileBrowser (Go), BookStack (PHP), Plausible (Elixir), 100 paired scenarios each. VulnGym is fully held out: 172 stratified T1 advisories, and 43 Hard targets with oracle components. The authors' own rows, including zero-shot, all use the unmodified mini-swe-agent.
- Jailbreak data: training uses HarmBench validation behaviors and WildJailbreak train, with the frozen HarmBench validation classifier as oracle. Evaluation is all 1,725 WildGuardTest items; HarmBench, StrongREJECT, XSTest serve as held-out checks. The judge in Table 3 is not the training oracle. The jailbreak target model is frozen Qwen3.5-9B.
- Budget and controls: budget is counted in candidate equivalents, i.e., one Red diff that passed the verifier. With m=2, T=1000, that is 2,000 per seed. Base and Security-SFT are zero-RL references and do not match budget. The remaining arms match budget: single pair, Ensemble-of-4 without co-training, within-policy RLOO (G=2), and a learned critic that only replaces the baseline, a global baseline, and OPO.
- Metrics and seeds: instrumented applications report balanced accuracy, and TPR at FPR=0.1. The VulnGym matching criterion is normalized relative path with line difference no more than k=5; an entry hit requires both EP and CO to match. diff-level allocation and ensemble controls use 12 seeds, matched-credit controls use 24 seeds, repository-level uses 8 seeds, jailbreak uses 12 seeds (Appendix V, Appendix Q). Table 1 paired standard error is 0.4 to 0.6.
Main Results
The table below follows Table 1: diff-level, Setting A, Qwen2.5-Coder-7B-Instruct, frozen Blue balanced accuracy (%). Source applications are 100 held-out scenarios from training applications; unseen is the mean±SD over four unseen applications. Δ is the paired difference versus MPA. Chance level is 50%.
Swipe horizontally to read the table
Method Source applications Unseen applications Δ Base 61.4 55.9±1.8 -8.9 Security-SFT 74.0 59.3±1.6 -5.5 Single pair N=1 81.0 61.4±1.5 -3.4 RLOO G=2 83.8 62.4±1.4 -2.4 Global baseline 85.4 62.5±1.5 -2.3 OPO 86.1 63.4±1.4 -1.4 MPA m=2 87.0 64.8±1.5 — The table does not list Ensemble-of-4 (unseen 62.2±1.5) and the learned critic (unseen 62.0±1.6). Table 1 marks these Δ with paired Wilcoxon asterisks (p<0.05 or p<0.01). The row containing the mean is -0.1, which the authors mark N.S. and do not include in the table above.
- The authors state the gains require an adapting opponent: Table A12 gives 60.8% on the four unseen applications with frozen Red and training Blue only.
- The Figure 2 caption states: against the frozen initial opponent, Red's certified evasion rises from 0.19 to 0.37, and Blue balanced accuracy from 62 to 89%; against the current opponent, mean evasion is 0.14, slope n.s. This is a training curve, not the held-out evaluation of Table 1.
- The Figure A6 caption states sensitivity 0.66→0.86, specificity 0.66→0.88. The authors state both rise together and the gain is discrimination rather than a threshold shift.
VulnGym Repository-Level
- Setup: Qwen3.5-9B, unmodified mini-swe-agent, matched training budget. The public row is a zero-shot external reference with a different scaffold and does not match budget.
- T1: the authors report Setting A recovers 18/172 advisories, Setting B 23/172; Security-SFT is 10, same backbone, same scaffold, untrained is 7. The public Qwen3.5-9B row recovers 8, but under Claude Code. Setting B's gain over eight seeds is 12.4±2.3 items. The hardest tier has Setting B at 1 of 31; the authors state Qwen3.5-27B and the strongest public agent are 4 and 7 respectively. Setting A's Hard-tier AR is 0.0 in Table 2.
- Localization: the authors state entry-file recall rises from zero-shot 4/43 and Security-SFT's 6/43 to 17/43, 4 more than mini-swe-agent plus GLM-5.2's 13/43; line recall 11 versus 8. The sentence does not state whether this is Setting A or B. Key-operation localization is 18/43, and the authors state the public best is 22. The authors state the gains concentrate in entry localization, and cite Ji et al. (2026) Fig. 5: among Hard failures, missing entry accounts for 23.1% and missing key operation for 9.2%.
Transfer, Weights, and Population
- Transfer: Blue is selected on source-application validation data and then evaluated frozen. The authors state that none of Setting A's unseen applications share the training TypeScript; under Setting B, BookStack and three training applications are all PHP. The +3.4 versus single pair and +5.5 versus Security-SFT are +4.4 to +6.6 on each application. Table A12: TPR at FPR=0.1 is 53.0%, SFT 42.4%, RLOO 49.4%. Held-out files from training applications cost 1.6 points; the scale and hunk probe is 52.4%. Rotation plus one additional real application gives 67.1 versus 66.0 on the same three applications (+1.1). Setting B changes only the bank; unseen mean 64.8%→67.6%, concentrated in broken authorization (61.7%→69.0%). The authors state transfer is organized by weakness class rather than by repository. In Table A10, OPO on Plausible is 61.7 and MPA 61.2, the only reversal in that block.
- Weight updates: frozen weights with only the skill library evolving gives 60.5% on the authors' backbone's unseen applications, 4.3 points below PRPO. Claude Opus 4.8 gives 71.2% on training applications and 60.4% unseen, versus co-evolving 7B's 87.0% and 64.8%; Appendix X.4 separately gives zero-shot 68.4% and 58.9%. The authors state the out-of-distribution margin is a quarter of the in-distribution margin, and that prompt-level adaptation is limited by fixed context and cannot learn from the verifier. In Appendix R's 36-round prompt-level case, the authors state the windowed evasion rate falls within the sampling band of a fixed policy and cannot alone demonstrate adaptation.
- Fixed budget: ρ=0.60 (ANOVA, 95% CI [0.52, 0.67]). Identity predicts an advantage variance ratio of 0.80; measured 0.77. Under equal coverage, +2.3 versus global baseline, +1.4 versus OPO. The +2.4 versus RLOO the authors attribute to coverage: 500 distinct conditions per adapter, versus RLOO's 250 conditions each seen twice. The RLOO gap narrows with budget from 3.5 to 1.2; MPA reaches RLOO's accuracy at 2,000 calls at about 1,000 calls. A global baseline with equal coverage still trails by 2.3. The authors state the double-budget control also changed the budget, so they did not isolate coverage as the cause. Removing elimination and the diversity term loses 1.2 points, ρ rises to 0.86, and six-axis coverage drops from 5.4 to 3.2.
Jailbreak Safety
- Setup: the algorithm is unchanged; only the verifier, ℓ, and the source of benign conditions are swapped. The guardrail is PRPO on Qwen2.5-7B-Instruct, the target is frozen Qwen3.5-9B. Neither judge is the training oracle.
- Table 3: on all 1,725 WildGuardTest items, ASR goes from 36.0% without a guardrail (37.1% under the other judge) to 4.6% with PRPO (5.3%); published WildGuard is 8.9% (9.6%). The credit control is 5.9→4.6, with the authors reporting a paired t, p=0.041, 12 seeds. Refusal rate on XSTest's 250 safe prompts: 2.1% without a guardrail, 3.8% PRPO, 4.2% WildGuard. The authors state over-refusal is essentially unchanged.
- Held-out: the authors state that against the frozen WildGuard never in the loop, Red's attack success rate goes from 12.4% to 27.8%, and this paper's guardrail suppresses these prompts to 9.3%. On 320 held-out HarmBench behaviors, ASR goes from 41.5% to 7.2%. StrongREJECT score goes from 0.52 to 0.19. The authors state that on the same corpus and model scale, static F1 is comparable to WildGuard, and that attack success rate is halved.
Other Ablations and Analyses
- Static versus execution (n=600): κ=0.79; without an exploit, static mislabels 18.3%; with an exploit, it misses 4.6% (Appendix B).
- Gating rate after rejection sampling πF=0.70; at m=2, 9% of conditions have no signal, which the authors call a lower bound (RQ1). Joint pass rate before sampling is 0.58 (Appendix I).
- m=4: relative advantage variance 0.61, balanced accuracy 87.4%, +0.4 versus m=2's 87.0 (Table A3).
- No SFT: πF=0.06, unseen balanced accuracy 54.2%, below the skipped SFT checkpoint's 59.3 (Table A12).
- Patched suggestions n=30: 19/30 versus Security-SFT's 13/30, p=0.11 (Table A12).
- Turning off mutation and crossover: 64.5% versus 64.8%, which the authors call not significant (Table A12).
What are some points that can be further explored?
The authors note that the evaluation set is constructed to be balanced, weakness classes are fixed in advance, site proposals depend on a strong proposer, and larger populations were not studied.
Limitations and future directions noted by the authors
- Evaluation prior: the evaluation set is balanced by construction, but real review traffic is not. Limitations states: at the source application operating point TPR=0.84, FPR=0.10, precision would be 30.7% under a 5% prior and 7.8% under a 1% prior, so most alerts a reviewer sees would be false positives. Training constrains FPR and reports TPR at FPR=0.1, but the deployment threshold should be calibrated to the target repository's prior.
- Oracle scope: reward requires the probe to trigger, and each probe confirms only the class it targets. Weakness classes are fixed before training; weaknesses that are state-dependent, multi-step, or assembled across multiple commits fall outside the reward and metrics. Red adapts to how known weaknesses are hidden, not to which weaknesses exist; extending classes requires a new exploit harness. The jailbreak oracle is a frozen classifier and inherits its blind spots (Limitations).
- Site proposal: structural classes have no dangerous call sink, so candidate sites come from an offline frontier-model sweep: 22 of 60 in Setting A, and 100 of 186 in Setting B. Admission is still decided by execution. The open-weight proposer has a Jaccard of 0.60, but rebuilding the bank requires a capable proposer (Limitations).
- Scale: N=4 per role, single node. The authors state that larger populations were not studied. Repository-level is more expensive per seed, runs 8 seeds, and uses a different backbone from diff-level, so granularity and model scale are not separated (Limitations).
- Policy space boundary: Appendix E states that the reachable policy space is bounded by the sites contained in the bank, and records this openness limitation in Limitations.
Experimental coverage
- Code arms: diff-level backbone is Qwen2.5-Coder-7B-Instruct, with allocation and ensemble comparisons over 12 seeds and matched-credit comparisons over 24 seeds; repository-level is Qwen3.5-9B plus mini-swe-agent, 8 seeds (§4, §5, Appendix V).
- Data: Setting A is Grimoire, 7 classes, 60 sites; Setting B is 7 applications, 186 sites, 78 business-logic sites. Transfer is 4 applications, 100 paired scenarios each. VulnGym is 172 T1 and 43 Hard targets (§4).
- Jailbreak: guardrail backbone Qwen2.5-7B-Instruct, frozen target Qwen3.5-9B, 12 seeds; WildGuardTest 1,725 items, plus HarmBench 320 held-out behaviors, StrongREJECT, and 250 safety prompts from XSTest (§4, §5, Appendix Q).
- Training loop: 4 adapters per role, m=2, T=1000 rounds, a tournament every 50 rounds, 2,000 candidate equivalents per seed; evaluation uses one adapter (§3, §4).
- Comparisons: same-budget comparisons include single pair, Ensemble-of-4, RLOO, global baseline, OPO and a learned critic; there are also frozen one-sided, skill-library and Claude Opus 4.8 review comparisons (Table 1, Table A12). The paper states that one arm was not run: halving RLOO's G and doubling conditions at matched budget, to isolate coverage separately (Appendix Y).
Summarize the main content of the paper
PRPO co-trains red and blue populations; unseen balanced accuracy 64.8%, Setting B recovers 23/172, jailbreak ASR 4.6%.
PRPO is a population co-training method for code security: Red writes patches to hide known-class weaknesses, Blue reviews and localizes, and the reward is determined only by build, tests, and exploit in an isolated container.
- Problem: the authors argue that detectors on static corpora stop improving after absorbing the snapshot, a single red-blue pair collapses in policy, and the training reward cannot distinguish progress from opponent stagnation.
- Method: 4 LoRA adapters per side, sharing one frozen base. Peers facing the same condition provide the policy-gradient baseline; every 50 rounds the weakest adapter is eliminated by Elo plus diversity. diff-level and repository-level are trained separately. The authors state the same algorithm can be used for jailbreak guardrails after swapping the verifier.
- diff-level: on Qwen2.5-Coder-7B-Instruct, MPA's balanced accuracy on four unseen applications is 64.8%, and 87.0% on 100 held-out scenarios from training applications (Table 1). The authors state it is 5.5 points above Security-SFT on unseen applications, 4.4 points above frozen Claude Opus 4.8, and 15.8 points above on the trained applications. Against frozen Red, the four unseen applications give 60.8%; the authors state the gains require an adapting opponent.
- Repository-level and jailbreak: Qwen3.5-9B on held-out VulnGym, Setting B recovers 23/172 advisories, Setting A 18/172; Security-SFT is 10, and the same scaffold untrained is 7. The jailbreak guardrail on all 1,725 WildGuardTest items lowers ASR from 36.0% to 4.6%, with published WildGuard at 8.9%; the judge is not the training oracle.
- Authors' conclusions: the authors state that co-evolution's gain over supervised safety fine-tuning disappears when the opponent is frozen; under matched budget, peer relative credit is better than within-policy controls. The authors state the gains on VulnGym concentrate in entry localization, and that the algorithm still lowers attack success rate for jailbreak defense beyond code.