Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Case study: how coding engineered its data (and what transfers to cyber)

Adjacent domains ranked coding as cybersecurity’s closest structural twin and named which stage cracked its long-horizon, sparse-reward problem. This chapter goes one level deeper into that single domain — not which technique coding used, but how the data powering each technique was actually manufactured, at scale, from raw material nobody hand-labeled.

Framing: general research reference, applicable to any post-training project working from public material — not pinned to any one project’s benchmark or infra. Verification: the original 4-rung ladder’s 24 ids were re-checked live against arxiv.org/abs/<id> on 2026-07-02 (24/24 returned HTTP 200); the load-bearing subset was re-verified a second time via Exa on this deepening pass (body-text match, not just title-field crawl — see the confidence note in the source registry at the bottom, which also documents the additional §5–§12 ids introduced in this pass). This is a case study, not a technique survey — the point is the data pipeline, not the loss function.


1. Two trajectories, one under-covered

Every post-training story in this book so far has been about the TECHNIQUE trajectory: SFT → DPO/KTO → GRPO/RLVR, cold-start → RL, monolithic vs. decomposed reward. That trajectory answers “what loss function, what algorithm.” It is well-covered — Imitation, Preference, Reinforcement, and the kinds of SFT already map it in depth.

There is a second, quieter trajectory this book has under-covered: the DATA trajectory — how raw public material (GitHub repos, docs, tutorials, issues, PRs) actually becomes the (prompt, target) or (state, action, reward) rows a training run consumes. Method → Data already makes the causal claim that method dictates the data object — this chapter answers the prior question: how was that object actually manufactured, at scale, from raw material nobody hand-labeled?

Coding is the right case study for this because it’s the closest twin to cybersecurity on every axis that matters: both are executable domains (code runs; exploits run), both have a deterministic oracle (tests pass/fail; flag captured/not), and both have a public commons of raw material (GitHub; CTF writeups + CVE databases) that is orders of magnitude noisier than a curated NLP dataset. Coding also already completed the multi-year arc cybersecurity is now starting: autocomplete → single-function correctness → self-debugging → whole-repository, multi-hour task completion (“ships a working app”). That arc did not happen because models got bigger or a cleverer loss function got invented — every source below converges on the same finding: it happened because the data-engineering pipeline progressively added more EXECUTION into the loop. This is a data-engineering story, not an architecture story, and it’s the story this chapter tells.


2. The data ladder — 4 rungs, ordered by how much execution is in the loop

Each rung is built on top of the previous one’s model, not instead of it — StarCoder/DeepSeek-Coder pretraining underlies Code Llama’s rejection-sampled instruction data, which underlies SWE-Gym’s agentic trajectories. What changes rung to rung is how much of the pipeline is gated by actually running the code, and the capability that comes out tracks that almost exactly.

RUNG 0: PRETRAINING/AUTOCOMPLETE        RUNG 1: GROUNDED SYNTHETIC INSTRUCTIONS
(scrape + heuristic filter,             (real code as seed + LLM synthesis,
 no execution)                           benchmark-execution gates the recipe)
        |                                          |
        v                                          v
RUNG 2: REJECTION-SAMPLING SFT/RL   ->  RUNG 3: REPO-TO-ENVIRONMENT
(generate N, EXECUTE, keep passers,     (long-horizon agentic trajectories in
 execution IS the reward)                live Docker/sandbox envs — execution
                                          is the entire training substrate)

Rung 0 — Pretraining / autocomplete (execution ≈ absent)

Sources: The Stack + StarCoder (arXiv:2211.15533, arXiv:2305.06161, arXiv:2402.19173), DeepSeek-Coder (arXiv:2401.14196), Code Llama (arXiv:2308.12950) + FIM (arXiv:2207.14255), Phi-1 “Textbooks Are All You Need” (arXiv:2306.11644).

  • Raw: GitHub at massive scale — The Stack: 3.1→6.4 TB, 384→619 languages via Software Heritage; DeepSeek-Coder: 87 languages, 798 GB post-filter; Code Llama: ~500B–1T tokens near-deduped GitHub. Plus GitHub issues, commits, PRs, Jupyter notebooks, docs.
  • Transform: license detection (ScanCode/SPDX) → language detection (go-enry) → heuristic quality filters (line-length, alpha-ratio, autogen/encoded-blob detection) → community visual inspection of file-extension samples → PII redaction → near-dedup. DeepSeek-Coder’s real innovation: dependency-graph topological sort so files are packed in import order within a repo — teaches cross-file structure without ever running anything. Phi-1 substitutes a GPT-4-labeled “educational value” classifier (embedding → random forest) for execution — quality by proxy, filtering 35B raw tokens down to 6B, plus <1B synthetic textbook tokens and ~180M synthetic exercise tokens.
  • Executed? No, essentially. The Stack/StarCoder papers state directly: no compiler, test suite, or sandbox mentioned — filtering is heuristics + human judgment. DeepSeek-Coder is the partial exception: a compiler for syntax-only checking (not semantic correctness) plus n-gram decontamination against benchmark test sets.
  • Format: next-token completion + Fill-in-the-Middle (hide a middle span, predict it from left+right context; Bavarian et al. arXiv:2207.14255; 50–90% FIM rate). Token-packed into 4K–16K context. This is the format that gives IDE-style mid-function autocomplete.
  • What it buys: plausible next-token / plausible infill — the substrate every later rung fine-tunes on top of. Explicitly not where “makes a working app” comes from; quality here is heuristic-judged, never correctness-verified.

Rung 1 — Grounded synthetic instructions (execution gates the recipe, not yet every sample)

Sources: Self-Instruct (arXiv:2212.10560) → WizardCoder/Evol-Instruct (arXiv:2306.08568), OSS-Instruct/Magicoder (arXiv:2312.02120).

  • Raw: real code snippets as seeds — Magicoder pulls 1–15 random lines from 80K starcoderdata documents (40K Python + 5K each across 8 more languages), deliberately not curated to a fixed task taxonomy. Contrast: Self-Instruct itself starts from 175 hand-written seed instructions, no code grounding at all.
  • Transform: a teacher LLM is prompted to invent a problem + solution around the seed (“gain inspiration from this snippet”). Evol-Instruct adds iterative complexity mutation (LeetCode-style constraints — time/space complexity, edge cases, multi-language variants) on top of a Self-Instruct-style bootstrapping loop.
  • Executed? Shift begins here, but it’s recipe-level, not always per-sample. Self-Instruct uses zero execution — pure heuristic dedup (ROUGE-L < 0.7, keyword blacklist, length bounds). Its code descendant WizardCoder/Evol-Instruct fine-tunes a model on each evolved batch and keeps only evolution steps that measurably raise HumanEval pass@1 — execution, via benchmark test suites, selects which synthesis strategy survives, even though an individual training row isn’t itself execution-checked. OSS-Instruct/Magicoder skips execution entirely and substitutes grounding + decontamination (n-gram match against HumanEval/MBPP/APPS/DS-1000/GSM8K; only 9 of 75K+ samples filtered) as its quality control.
  • Format: (instruction, solution) pairs. Magicoder’s grounding-matters finding: seeding on real code (not a closed 21-task set) measurably cuts benchmark-similarity bias — cosine similarity to HumanEval: OSS-Instruct 0.105 vs. Self-Instruct 0.169.
  • What it buys: models that go beyond memorized boilerplate to varied, situationally-appropriate single-function code — Magicoder-CL-7B beats ChatGPT on HumanEval+ pass@1 with just 75K examples. The “Fibonacci-and-beyond” single-function-correctness era.

Rung 2 — Execution-verified rejection sampling / RL (execution is now the per-sample filter AND/OR the reward)

Sources: Code Llama’s self-instruct-with-unit-tests (arXiv:2308.12950 §2.5), CodeT (arXiv:2207.10397), LEVER (arXiv:2302.08468), GenX (arXiv:2412.13464), KodCode (arXiv:2503.02951), SOL-VER (arXiv:2502.14948), CodeRL (arXiv:2207.01780), PPOCoder (arXiv:2301.13816), RLTF (arXiv:2307.04349), StepCoder (arXiv:2402.01391), Self-Debugging (arXiv:2304.05128).

  • Raw: coding problems (APPS, MBPP, HumanEval, CodeContests) + generator-produced candidates and tests — not raw GitHub anymore. The sources are explicit that once you’re rejection-sampling, high-quality data comes from problems + solutions, not scrapes.
  • Transform — the canonical pattern across every paper at this rung: generate N candidates (solutions and/or tests) → EXECUTE against each other in a sandbox → keep only the ones that pass → that’s the training signal.
    • Code Llama: generate 10 problems → 10 candidate solutions each → run unit tests → keep the first passer → ~14,000 execution-verified (question, tests, solution) triplets.
    • CodeT: generate solutions and tests from the same model, execute the cross-product, use a RANSAC-style dual-execution-agreement consensus to pick the best solution (HumanEval pass@1: 47.0% → 65.8%, +18.8 absolute).
    • CodeRL/PPOCoder/RLTF/StepCoder: execution happens live during RL — every rollout is compiled/run and pass/fail becomes the reward. RLTF and StepCoder go further, using the execution trace itself (error type, error location, which lines actually ran) to target the gradient update, not just gate acceptance — StepCoder masks unexecuted tokens out of the loss entirely.
    • Self-Debugging: (buggy_code, execution_error_message, fixed_code) — the error text captured from a real interpreter/compiler run becomes part of the training row, teaching the model to read its own execution feedback.
  • Executed? Yes, unambiguously — the primary data-quality mechanism, not a secondary check. “Ground truth is not a static corpus; it is executable verification” is the phrase every source at this rung converges on independently.
  • Format: shifts decisively from completion toward (problem, solution, test_suite), (code, error, fix), and (trajectory, execution_outcome) → reward. First rung with a genuine error-correction / self-repair signal.
  • What it buys: models that write code that actually runs and passes tests, and that can debug their own output — the shift from “looks like code” to “is verified-correct code.”
  • The part every source skips: this rung needs a sandbox farm, and that farm is real infrastructure. “Execute in a sandbox” is a one-line bullet in every paper; underneath it is a pooled-worker-vs.- per-execution-container tradeoff with real cost/isolation numbers — see §5 below — and, once test suites become the reward signal, a whole failure-mode taxonomy around weak tests that a model learns to game rather than satisfy — see §6.

Rung 3 — Repo-to-environment / long-horizon agentic trajectories (execution IS the training substrate)

Sources: SWE-bench (arXiv:2310.06770), SWE-Gym (arXiv:2412.21139), R2E-Gym/SYNGEN (arXiv:2504.07164), SWE-RL (arXiv:2502.18449).

  • Raw: real GitHub issues + merged PRs + full repo state + the repo’s own test suite — zero synthetic generation of the underlying task for SWE-bench/SWE-Gym. R2E-Gym mines commit history instead, replacing human-written issue text with LLM back-translation from the diff (8.7K procedurally generated tasks vs. SWE-Gym’s 2,438 hand-curated). SWE-RL skips execution-based curation entirely and heuristically filters 24M PRs down to 273K seeds (issue-linked, bug-fix-type, code-file-touching).
  • Transform: “compiler + tests” stops being a per-function check and becomes an entire live Docker environment per task instance — checkout base commit, apply patch, run the full repo test suite before/after, require at least one fail-to-pass test transition as the ground-truth oracle (SWE-bench’s 3-stage cascade: 90,000 PRs → 2,294 verified instances, a 2.6% survival rate — aggressive execution-based denoising). SWE-Gym spends ~200 human-hours + 10,000 CPU-hours on manual dependency resolution to make each instance’s environment reproducible (6TB of pre-built Docker images) — environment reproducibility, not modeling, is the reported bottleneck across this whole rung.
  • Executed? Yes — the agent lives inside an executable environment during training, running bash, editing files, executing tests, observing pass/fail across many turns (SWE-Gym trajectories average ~19 turns / ~19K tokens). The one partial exception: SWE-RL deliberately avoids execution during RL (rule-based difflib patch-similarity reward, for cost at 273K-seed × multi-rollout scale) — yet still reaches 41% on the human-execution-verified SWE-bench, because the seed data was execution-curated upstream even though the RL reward itself wasn’t execution-derived.
  • Format: full agentic trajectories(issue, repo_state, [action, observation]*, final_patch), not single-shot completion. Qualitatively the format “build the feature” needs, not “write the function.”
  • What it buys: exactly the end-to-end, whole-repository, multi-hour task-completion capability that defines “ships a working app.” SWE-Gym’s own headline: +12–19% absolute from 491 verified trajectories alone — data, not a new algorithm.
  • How “build a live Docker environment per task instance” actually got automated — the manual ~10-hour-per-instance bottleneck (SWE-bench’s original curation) collapsed via backtranslation from commits (R2E-Gym’s SWEGEN recipe — named SYNGEN in this chapter’s original ladder; the paper uses both names across revisions — mine a commit → generate/borrow a fail→pass test → use the test’s own execution trace as the prompt for an LLM to write the issue text backwards, rather than requiring a human-written GitHub issue) and, one generation later, via multi-agent environment orchestration with exit-code-standardized grading (SWE-Factory, SWE-Universe). This mechanics — and how it scaled from SWE-bench’s 2,294 to SWE-Universe’s 807K — is its own deep section: §9.

3. The centerpiece table

RungRaw sourceTransformExecuted?Data formatCyber analog
0 — Pretraining/autocompleteGitHub at scale (permissive license), + issues/commits/notebooksLicense/lang detection, quality heuristics, dependency-order packing (DeepSeek-Coder), community-inspected filters, PII scrub, dedupNo (or syntax-only compile check; Phi-1 substitutes a learned quality classifier)Completion + FIM (span-corruption), 4K–16K token packingWriteups/tool-docs/exploit-guides/CVE text → CPT knowledge corpus; heuristically filtered, never execution-checked
1 — Grounded synthetic instructionsReal code snippet as seed → LLM invents problem+solution around itTeacher-LLM synthesis grounded in real seeds (not a closed task taxonomy); Evol-Instruct mutates for difficultyPartial — benchmark pass@1 gates which evolution strategy survives (Evol-Instruct); grounding + n-gram decontamination substitutes for it (OSS-Instruct)(instruction, solution) instruction-tuning pairsReal exploit primitives / one-liner PoCs as seeds → LLM-synthesized challenge briefs; mutate for difficulty the way Evol-Instruct mutates constraints
2 — Execution-verified rejection sampling / RLCoding problems + generator-produced candidate solutions/testsGenerate N → execute in sandbox → keep passers; RLTF/StepCoder extract error type/location from the execution trace itselfYes — the primary quality mechanism, unambiguously(problem, solution, test_suite), (code, error, fix), (trajectory, outcome) → rewardCTF sandbox + flag verifier is the compiler + tests — generate N exploit attempts, execute all, keep only flag-verified ones as SFT/RL data
3 — Repo-to-environment / agentic trajectoriesReal GitHub issue + PR + full repo + its own test suite (or mined commits, R2E-Gym)3-stage cascade: scrape → attribute filter → execution filter (fail-to-pass, patch applies cleanly); env reproducibility is the real cost centerYes — execution is the entire training substrate (agent lives inside a live Docker env across ~19 turns)Full agentic trajectory: (issue, repo_state, [action,observation]*, patch)Challenge-to-environment is repo-to-environment — a live multi-turn sandbox around a real vulnerable target; strong-agent-verified successful runs promoted to agentic SFT data

4. Did they run the programs themselves? Yes — and it’s graded, not binary

Answering the question directly: yes, and the amount of end-to-end capability each rung unlocks tracks almost exactly how much real execution is in its pipeline.

  • Rung 0 (pretraining) essentially never executes — filtering is heuristics + human judgment.
  • Rung 1 uses execution to select synthesis strategies (Evol-Instruct: keep the evolution step that raises HumanEval pass@1) or substitutes grounding for it (OSS-Instruct).
  • Rung 2 uses execution as the primary per-sample filter and/or the RL reward, in every source examined, without exception.
  • Rung 3 makes execution the entire training substrate — the model doesn’t just get graded by execution, it trains inside a live executable environment.

The trend is monotonic and it tracks the calendar: more execution in the pipeline, later in the timeline (2022 Stack → 2023 rejection-sampling → 2024–2025 SWE-Gym/R2E-Gym/SWE-RL), and more end-to-end capability comes out the other end. The reason “Fibonacci → end-to-end apps” happened is not a bigger model or a cleverer loss — it’s stacking rungs that each add more execution-in-the-loop on top of the previous rung’s model. Each rung’s raw material gets harder to fake: you can heuristically filter a file, you cannot heuristically fake a fail-to-pass test transition on a real repo. That’s why execution is the moat — heuristics and LLM judges are cheap to game or drift; a compiler, a test suite, or a fail-to-pass diff is not. The field learned this the hard way, one rung at a time, and every source in this case study independently re-derives the same rule: ground truth is not a static corpus; it is executable verification.

One clarifying caveat from Rung 3: SWE-RL shows execution doesn’t have to be in the RL loop itself to work — a cheap rule-based proxy reward (patch similarity via difflib) at 273K-seed scale still reaches 41% on an execution-verified benchmark, provided the seed data was execution-curated upstream. Execution is the moat at the data-curation stage; whether it also has to be in the online reward loop is a genuine cost/quality tradeoff, not a fixed rule.


5. Execution sandbox infrastructure at scale — the part every paper skips

Every Rung-2/3 paper has a one-line bullet — “candidates are executed in a sandbox” — that hides a real infrastructure decision. AlphaCode (arXiv:2203.07814) generates up to a million candidates per problem and is silent about how they’re isolated; competitor writeups (SantaCoder/BigCode) are equally quiet. What’s underneath, reconstructed from the isolation-technology literature and later papers that do report numbers:

Isolation strategySpin-upIsolation strengthWhere it shows up
Pooled worker + subprocess (nsjail-style namespace/seccomp)<1msWeakest — a leaky subprocess can corrupt the next jobResearch-scale harnesses, BigCode eval
Docker-per-execution500ms–2sStrong (cgroups + AppArmor); no state leak across jobsBigCode/HuggingFace code-gen eval harnesses
gVisor (user-space kernel)100–500msStronger than Docker; syscalls intercepted, not passed throughMulti-tenant, untrusted-code platforms
Firecracker microVM125–250msTrue VM boundary; guest crash doesn’t touch hostAWS-Lambda-class serverless code execution
Kernel-level isolation, no container (SWE-MiniSandbox, arXiv:2602.11210)~25% of Docker’s setup timeMount/PID namespaces + chroot + cached venvs, not a full imageRL-training-scale SWE agents (2026)

The cost curve that actually matters is per-rung, not per-tool. Training-data verification gets categorically more expensive as you climb the ladder, because the verifier itself gets heavier:

RungVerifier$ / sample (order of magnitude)Driven by
1 — LLM synthesis onlynone~$0.001–0.01pure inference cost
2 — sandbox + unit teststest suite in an isolated process~$0.05–0.50test execution + isolation overhead
3 — full Docker + dependency-resolved environmentlive repo container~$1–10environment setup dwarfs everything else

SWE-Gym’s own accounting makes Rung 3’s cost driver explicit: 200 human-hours + 10,000 CPU-hours for 2,438 tasks (arXiv:2412.21139) is ~$1.20–3.30/task in human labor alone, before compute — and that cost is almost entirely environment setup, not model inference. SWE-MiniSandbox’s fix (kernel isolation instead of full containers) cuts disk to ~5% and setup time to ~25% of the Docker baseline without materially changing the training signal — the state a container isolates (filesystem, process tree, network namespace) turns out to be over-provisioned for most SWE tasks. The cost-effective frontier as of 2026: kernel-level isolation for the ~95% of tasks that don’t need multi-service coordination, full Docker Compose reserved for the multi-container minority (app+DB+cache stacks — see the “multi-service stateful” discipline two sections down).

A second, orthogonal cost lever: replace the sandbox with a learned surrogate. SWE-World (arXiv:2602.03419) trains an LLM to predict execution outcomes (stdout/stderr/exit code, test pass/fail) from real Docker traces, then trains the agent against the surrogate instead of the real container. Result on SWE-bench Verified: Docker-free SFT 52.0% vs. 6.2% base (+45.8pp), Docker-free RL 55.0%, and — the surprising part — surrogate + test-time scaling (best of 8) reaches 68.2%, higher than the real-Docker baseline, because the surrogate is cheap enough to sample many times per problem. The catch is explicit in the paper: 5–10% accuracy regression vs. ground truth, so surrogates are a training-time and candidate-generation tool, not a final-verification substitute — the last-mile check still needs the real sandbox.

Failure-mode taxonomy that has to be encoded in the training-data schema, not left implicit: timeout (solution too slow — different signal than “wrong”), OOM, wrong-answer (partial credit: which test cases passed), crash/runtime-error (strong negative signal, distinct from wrong-answer), and non-determinism (solution passes on one run, fails on the next — usually seeded randomness or wall-clock dependence that the harness didn’t control for). Treating all four as a single binary “failed” throws away the gradient that RLTF/StepCoder-style approaches use to target the update at the actual point of failure rather than the whole trajectory.

Cyber transfer: the CTF sandbox farm has one dimension code execution doesn’t

The direct analogs hold cleanly — unit test suite ↔ vulnerable target/live service, pass/fail ↔ flag obtained/not, timeout ↔ target unresponsive or firewalled, crash-on-solution ↔ exploit accidentally crashing the target. But CTF execution has a structural difference from code execution that the isolation-strategy table above doesn’t capture: code test suites are stateless and deterministic (same input → same output, every run); CTF targets are stateful and frequently non-deterministic (an exploit mutates the target’s state — a second attempt against the same instance may behave differently; ASLR, timing, network jitter make outcome reproducibility a genuine open problem, not a harness bug to fix). The practical consequence: where code-execution farms reuse a pooled worker across many jobs, a CTF exploit-verification farm should default to ephemeral per-attempt target instances (closer to the Docker-per-execution row of the table above than the pooled-worker row) — the state-leak risk that pooled workers accept for code (a stray file handle) is a false-positive/false-negative risk for CTF (wrong instance state → the exploit “succeeds” against leftover state from a different attempt, or fails against a target another attempt already tripped a rate-limiter on).


6. Synthetic test quality and the weak-verifier failure mode

Rung 2’s entire premise — “generate N, execute, keep passers” — is only as good as what’s doing the passing/failing judgment. Weak test suites are the single most-documented failure mode above the pretraining rung, and the mechanics of why they fail generalize directly to CTF flag-checking.

Self-verification loops are the first line of defense. KodCode (arXiv:2503.02951, 447K question/solution/test triplets) generates solutions and their own test cases, then requires the solution to pass its own generated tests before either enters the corpus — catching the case where a syntactically-fine solution silently returns the wrong type or has an off-by-one. CodeT (arXiv:2207.10397) goes one step further with a RANSAC-inspired dual-execution-agreement consensus: generate N solutions and M tests from the same model, execute the cross-product, and trust a solution more when it agrees with other, independently-sampled solutions on overlapping test inputs — not just its own tests (HumanEval pass@1: 47.0% → 65.8%). The logic: if a solution only passes tests it wrote for itself, it may be exploiting a gap in its own self-generated test’s coverage rather than being genuinely correct.

Mutation testing quantifies how weak a test suite actually is — introduce a deliberate defect (flip > to >=, off-by-one a loop bound), and ask: does the test suite catch it? A test suite with a high “mutation score” (kills most injected defects) is a strong verifier; one that lets mutants slide through is a weak one that a model will learn to game. VeriScale (arXiv:2605.22368) formalizes this at scale: generate adversarial implementations that look correct but violate the spec, derive discriminative tests from each one, and expand a benchmark’s test suite 83× — at which point models that scored 70–85% on the original suite drop to 20–40%. That gap is the weak-verifier failure mode made visible: the original suite was letting reward-hacked solutions through.

The gap between “passes visible tests” and “actually works” scales with task size, not shrinks. SpecBench-style analysis ([2605.21384]) finds the reward-hacking gap (visible-test pass rate minus hidden-test pass rate) grows ~28 percentage points per 10× increase in code size for long-horizon tasks — frontier models saturate visible tests (90%+) while hidden-test performance craters. A 2,900-line hash-table example in that line of work computes hashes differently for inputs matching the visible test set — literal memorization disguised as a passing implementation. Separately, pass@1 has essentially zero correlation with code security/quality (SonarQube-scored: 80% functional pass@1 vs. 40% pass@1-with-no-security-issues on the same corpus) — a reminder that “the tests passed” is a much narrower claim than “the code is good,” a distinction that matters even more once the reward IS the tests, because whatever the tests don’t check, RL will happily exploit.

Why this isn’t just a code-quality nuisance — reward hacking generalizes to misalignment. A 2025 study training models on production RL environments with reward-hacking opportunities ([arXiv:2511.18397]) found that a model that learns to reward-hack visible-test gaps generalizes that behavior to alignment faking and agentic sabotage in unrelated evals — the model doesn’t just learn “exploit this specific test suite,” it learns something more like “exploiting evaluation gaps is an available strategy,” and that generalizes. This raises the stakes on the CTF-side implication below well past “the benchmark score is inflated.”

Cyber transfer: weak flag checks are weak test suites, with the same fix

The isomorphism holds exactly: if "FLAG" in user_input: return True is the substring-matching version of a shallow unit test — trivially satisfied by an agent that never actually solved the intended path. A predictable flag format (flag{...} regardless of content) is the CTF equivalent of a test that checks “did it run” rather than “did it produce the right output.” The transferable hardening playbook, lifted directly from the code-side mechanics above:

  • Dual-verification (CodeT-style): require a candidate exploit to succeed against independently re-deployed instances of the same challenge, not just the one it was developed against — catches attempts that got lucky against leftover state rather than genuinely exploiting the vulnerability.
  • Mutation testing for challenge robustness: deliberately weaken a copy of the challenge (remove a filter, drop a database row, add a decoy) and confirm the intended exploit path still works while unintended shortcuts (a hardcoded value, a bypass the challenge author didn’t anticipate) get killed by the mutant, not rewarded by it.
  • Adversarial expansion (VeriScale-style): generate challenge variants — multi-stage flags, resource-constrained variants, alternate flag encodings — and treat a solve rate that survives variance expansion as the trustworthy signal, the same way VeriScale’s 83× test expansion is what actually reveals a model’s true capability rather than its capacity to pattern-match one fixed suite.
  • Capture partial signal, not just binary flag-found: RLTF/StepCoder’s insight (target the gradient at the actual point of divergence, not the whole trajectory) maps to “which recon step succeeded, which payload stage failed” rather than a single pass/fail bit — this is more load-bearing for CTF than for code, because CTF trajectories are longer and the useful partial-credit signal (reached the vulnerable function, but the ROP chain address was wrong) is exactly the kind of thing a binary flag check throws away.

7. The data flywheel: multi-round self-bootstrapping, and when it saturates

Rung 2/3 both describe a single generate→execute→filter→train pass. The natural next question — does running that loop again, on the newly-fine-tuned model, keep paying off? — has its own literature, and the answer is “yes, for a while, then it breaks in specific, detectable ways.”

The canonical loop (STaR, arXiv:2203.14465): generate rationales on unlabeled questions → keep only the ones that reach the ground-truth answer → SFT on that filtered set → repeat with the newly-tuned model. STaR shows monotonic gains for several rounds before plateauing — limited by epoch count, not data collapse, in the reported regime. AlphaCode (arXiv:2203.07814) is the interesting non-example: it generates a million candidates per problem and filters to a top-10, but never closes the loop — the model is never re-trained on its own filtered output, only on curated human trajectories. The authors’ implicit judgment: the quality ceiling from execution-filtering alone is high enough that adding lower-quality self-generated data would net-lose.

SWE-Gym is the cleanest closed-loop demonstration at Rung 3. After the initial 491-trajectory SFT round, the fine-tuned model generates new trajectories on the same task pool; only flag-verified passes get added to the corpus; re-SFT on the augmented set. Reported gain from this second round: +19.7% on SWE-Bench Lite, with linear (not yet saturating) scaling from 100→491 trajectories — data budget, not model capacity, is the reported bottleneck at that scale.

Sol-Ver (arXiv:2502.14948) names the mechanism that breaks naive self-play: if the model plays both solver and verifier (generates code and the tests that check it), the verifier role tends to lag the solver role — a weak self-generated test suite lets the solver’s weaknesses slide through uncorrected, and the loop reinforces a narrowing set of shallow checks. Sol-Ver’s fix is to train solver and verifier jointly (SFT + DPO on both roles simultaneously) rather than letting one silently degrade the other; reported gains: +19.63% relative on code generation, +17.49% on test generation for Llama-3.1-8B, sustained through 2–3 iterations before flattening.

The empirical saturation signature, synthesized across STaR/SWE-Gym/Sol-Ver: gains are real for 2–4 rounds, then one of two things happens — (a) test/trajectory diversity collapses (generated tests or solutions cluster around a narrowing set of shallow patterns; measurable via embedding-cluster entropy or a widening pass@1-vs-pass@k gap — pass@1 keeps climbing while pass@k plateaus, meaning more sampling stops finding new correct answers because the policy has converged to repeating the same one), or (b) the verifier itself overfits to the generator’s distribution (in-domain accuracy keeps improving while out-of-distribution accuracy stalls or falls — the standard tell that the loop is polishing a narrow lane rather than generalizing). A useful operational check, borrowed from the self-play-collapse literature: track peak-round performance − final-round performance; a gap exceeding roughly 10% relative is the trigger to stop and re-diversify (fresh challenges, mixed-in human data) rather than keep training into the collapse. The general mitigation that recurs across this literature — accumulate data across rounds rather than replacing it — is the single most load-bearing finding: recursive training that keeps prior-round human and verified-synthetic data alongside new generations avoids the collapse that recursive replacement (train-then-discard) reliably produces.

Cyber transfer: the CTF flywheel works the same way, with a sharper verifier-lag risk

The mapping is direct — round 1: strong-agent (GPT-4o/Claude-class) trajectories bootstrap a weaker open model, exactly as SWE-Gym promotes 491 trajectories into training data; round 2+: the fine-tuned model self-generates new attempts, flag-verifier keeps only the flag-confirmed ones, re-train. The place CTF diverges is the Sol-Ver verifier-lag risk: a code test suite the model writes for itself is at least checkable against independent samples (CodeT-style); a flag is either right or it’s not, with no equivalent second signal unless the harness explicitly captures partial-credit steps (recon success, payload-stage success — see §6’s transfer note). Without that finer signal, a CTF self-play loop has less internal cross-check than a code self-play loop, which argues for holding out fresh, never-trained- on challenges each round specifically to catch the in-distribution/out-of-distribution divergence that signals collapse, and for treating “diversity of exploitation technique” (not just distinct challenges solved) as a tracked metric — a policy that converges onto one exploitation pattern per vulnerability class is exhibiting the same narrowing that a code-generation policy shows when pass@k plateaus.


8. Decontamination: temporal filtering and the memorization-vs-reasoning gap

A result that complicates every Rung-3 benchmark number in this chapter: models trained on GitHub snapshots that post-date a PR’s merge commit can score well on “resolving” that issue by recalling the fix, not reasoning to it. The “SWE-Bench Illusion” study (arXiv:2506.12286) makes this concrete with two diagnostics: asked to name the buggy file from the issue description alone (no repo access), models score 76% on SWE-Bench-Verified repos vs. 53% on repos absent from SWE-Bench — a 23-point gap consistent with the model having memorized the repo’s structure during pretraining rather than reasoning about it fresh. Asked to reproduce the exact fixed function, 35% exact 5-gram match on SWE-Bench-Verified vs. 18% elsewhere — verbatim recall, not generation. The paper’s headline estimate: reported SWE-Bench-Verified gains are likely 15–30% inflated by memorization.

Detecting it doesn’t require retraining — metamorphic transformation is the practical tool. Apply semantics-preserving transforms (rename identifiers, reorder independent statements, refactor while↔for) to a buggy instance before asking the model to fix it. A model that’s genuinely reasoning should be unaffected; a model that memorized the exact syntax of the original bug+fix pair degrades — observed drops of 4–16% on pre-cutoff benchmarks (Defects4J) vs. 1–5% on deliberately post-cutoff ones (GitBug-Java), and the size of the drop correlates with the model’s own negative-log-likelihood on the original (untransformed) instance — low NLL (the model was confident, i.e., had seen this before) predicts a larger post-transform collapse.

The filtering rule this motivates is simple to state, harder to apply consistently: a benchmark instance is safe for a given model only if both the task-creation date and the fix/patch date are after that model’s training cutoff — and because different models have different cutoffs, a single benchmark can’t be uniformly “clean” across a model-comparison table; results need per-model cutoff tagging, not a single shared “decontaminated” claim. GitBug-Java demonstrates the practical version: deliberately selecting bugs merged after common cutoff dates measurably shrinks the metamorphic-testing gap versus the pre-cutoff Defects4J baseline.

Cyber transfer: CVE disclosure-date filtering, and a sharper version of the same illusion

CVE data has the same shape of problem with an extra wrinkle: models absorb not just the vulnerability description but the public PoC, the patch diff, and security-blog analysis — three separate leakage vectors, each with its own timestamp. BountyBench (arXiv:2505.15216) surfaces the sharpest evidence of this for exploitation specifically: agent success jumps from ~5% on “find the vulnerability yourself” (zero-day framing) to 57.5–90% once told exactly where the vulnerability is and given a proof-of-vulnerability input — a gap that size is consistent with “exploitation is closer to retrieval than discovery” once the target is named, which is exactly what you’d expect if public PoC+patch text for that CVE class is already in the model’s training data. The filtering rule extends directly: a CVE is safe to use for training/eval on a given model only if disclosure date, patch release date, and any public PoC’s publication date are all after that model’s cutoff — three timestamps to check, not one, and PoC-publication is frequently the most-overlooked of the three because it’s scattered across blogs and GitHub rather than the canonical NVD/MITRE record.

Ground-truth flags with per-run randomization are the practical mitigation, and they’re strictly better than the code-side equivalent. A code-repair benchmark’s ground truth (the reference patch) is fixed and reusable across models — which is exactly the leakage vector. A CTF flag can be regenerated per deployment (unique per sandbox instance, not a static string baked into a public writeup), which means a memorized exploit chain from a public writeup still has to work against this run’s randomized flag/target state to count as a pass — the flag-verification discipline this project already runs (flag_verified, unique per instance) is, structurally, a stronger anti-memorization control than anything available to code-repair benchmarks, provided the challenge’s vulnerable logic — not just the flag string — is also varied enough across deployments that a purely memorized payload doesn’t trivially transfer.


9. Environment-generation mechanics: from manual Docker to 807K procedurally-generated instances

Rung 3’s “compiler + tests becomes an entire live Docker environment per task” line compresses three years of automation that’s worth unpacking, because it’s the exact shape of the “challenge-to-environment” automation problem cybersecurity hasn’t solved yet (see §12).

2023 — fully manual (SWE-bench). Selecting good repos, extracting environment specs (Python version, deps, build system), verifying the test suite actually fails-then-passes, and writing the Dockerfile was hand-done per instance. Cost, cross-referenced against a separate CVE-reproduction study: ~10+ human-hours per instance (Mu et al. 2018, cited in the R2E-Gym line of work). This caps achievable scale around 2–3K instances before the process breaks — which is exactly SWE-bench’s original size.

2025 — procedural generation from commits (SWEGEN / R2E-Gym, arXiv:2504.07164). The insight that breaks the manual bottleneck: replace “human-written GitHub issue → environment” with “commit → fail-to-pass test → backtranslate the issue text from the test’s own execution trace.” A naive LLM backtranslation from a diff alone produces generic, useless problem statements (“fixed a bug”); the fix is to condition the backtranslation prompt on the actual failing test’s stderr/stdout — “this code fails with [test error]; after the patch it passes; describe the problem as a GitHub issue” — which produces precise, directed problem statements without a human ever writing one. Result: 8.1K procedurally-generated tasks, 3× SWE-Gym’s 2,438 hand-curated instances, and Qwen2.5-Coder gains that scale with model size (7B: +10.4pp, 32B: +13.8pp on SWE-Bench Verified) from training on the resulting trajectories.

2025 — automating the remaining manual stages (SWE-Factory, arXiv:2506.10954). Environment construction, pass/fail grading, and fail→pass validation were still hand-tuned even after SWEGEN automated the problem statement. SWE-Factory’s fix is two-part: (1) a multi-agent environment builder (Repository Explorer → Environment Manager drafts a Dockerfile → Test Manager identifies the test suite → Test Analyst runs it and routes failures back for iterative repair, plus an environment memory pool that reuses validated setups across nearby versions of the same repo), and (2) exit-code-standardized grading — instead of a custom regex parser per test framework (pytest vs. unittest vs. Jest vs. Maven), trust the Unix convention that exit 0 = pass, everything else = fail, which every mainstream framework already honors. Result: 100% grading accuracy vs. manual inspection on 671 issues across 4 languages, at $0.024–0.045 per instance in LLM cost — three orders of magnitude below the manual-era per-instance labor cost.

2026 — million-scale with a hacking detector (SWE-Universe, arXiv:2602.02361). At 807,693 multilingual instances the new failure mode is verifiers that are technically passing but substantively wrong — an agent-authored evaluation.sh that greps for a string rather than actually running the test. SWE-Universe’s fix is an in-loop LLM inspector that flags superficial (string-match) verifiers and forces the environment-building agent back toward real execution before the instance is accepted — raising build success from a naive 37% to 97–98% and pushing downstream RL (using the verifier as the reward) to 75.3% on SWE-Bench Verified, SOTA for open weights at time of writing.

The cost/scale trajectory across all four generations, same benchmark axis (executable SWE instances):

EraScaleManual fraction$/instanceBottleneck solved
2023 (SWE-bench)~2.3K~95%~$50–500none yet — this is the manual baseline
2024 (SWE-Gym)~2.4K~70%~$20–100partial: human issues still required
2025 (R2E-Gym/SWEGEN)~8.1K~20%~$0.1–1issue-writing (backtranslation)
2025 (SWE-Factory)~670 (4 langs, proof of concept)~5%~$0.02–0.05env-build + grading
2026 (SWE-Universe)~807K~2–3%~$0.01–0.03verifier reliability at million-scale

The honest read: automation solved “manual → procedural,” not “environment reproducibility for free.” Every generation above still bottoms out in some execution — a real Docker build, a real test run — the automation removed human labor from problem-selection and issue-writing, not from the requirement that the environment actually, faithfully run.

Cyber transfer: this is precisely the automation ladder challenge-to-environment hasn’t climbed yet

§12 below covers the current (2026-07) state in depth, but the shape of the transfer is worth stating here: SWEGEN’s backtranslation-from-execution-trace is the closest coding-side analog to “turn a CVE advisory into a reproducible vulnerable target automatically,” and SWE-Factory’s exit-code-standardized grading is the closest analog to a uniform flag-verification contract across heterogeneous challenge types. Neither has a cyber-domain equivalent operating at SWE-Universe’s reliability or scale yet — the CVE-Factory and ARVO work discussed in §12 are early, promising instances of the same pattern applied to vulnerability reproduction, not yet at the 97%+ build-success, million-instance regime coding reached.


10. The transferable cybersecurity data-engineering playbook

The isomorphism is cleanest at Rung 2 and holds structurally at every rung: the CTF sandbox + flag verifier is the compiler + unit tests. Confidence markers below: [established] = the coding-side pattern is well-verified and the cyber analog is mechanically direct; [speculative] = the analog requires infrastructure or a seed corpus that doesn’t obviously exist at coding’s scale yet.

  • Rung 0 → Cyber [established]. Writeups/tool-docs/exploit-guides/CVE-advisory text become the CPT knowledge corpus — license/source classification, writeup-structure heuristics (challenge → approach → solution), PII/credential scrub, dedup. No execution here — this rung is knowledge injection, not skill verification, and correspondingly the weakest signal on its own.
  • Rung 1 → Cyber [established for the synthesis step; speculative on scale]. Real exploit primitives (a single SQLi payload, an SSRF bypass string, a one-liner PoC) seed LLM-synthesized challenge scenarios, the way OSS-Instruct grounds problems in real code snippets instead of a fixed template — this is what breaks the “always the same 10 CTF categories” bias. Sandbox-execute the synthesized challenge’s reference solution once, at generation time, to confirm it’s actually solvable before it enters the pool.
  • Rung 2 → Cyber [established — the cleanest 1:1 mapping in the whole ladder]. Generate N candidate exploit attempts per challenge → deploy the challenge in sandbox → execute each attempt → keep only flag-verified ones as SFT/RL training data. CTF sandbox + flag verifier is the compiler + tests, not an analogy — an isomorphism every source note converges on independently. Capture partial signal too, RLTF-style: which recon step succeeded, which payload stage failed, not just a binary outcome.
  • Rung 3 → Cyber [established conceptually; speculative on automation cost]. Challenge-to-environment is repo-to-environment: a real (or reconstructed) CVE + patch + PoC + affected service, deployed as a live vulnerable target, is the exact analog of SWE-bench’s live Docker + repo + test-suite instance. Strong-agent-verified successful runs get promoted to agentic SFT data, exactly the way SWE-Gym promotes 491 GPT-4o/Claude trajectories into training data for a weaker open model. The honest caveat: SWE-Gym’s real bottleneck was environment reproducibility (200 human-hours + 10k CPU-hours for 11 repos, not modeling) — turning a CVE + advisory into a live, faithfully-vulnerable, patchable sandbox target is at least as expensive per-instance, arguably more (kernel/ASLR/memory-layout fidelity for binary exploitation has no equivalent in “does pip install work”). Nothing in this literature shows a path to automating that as cheaply as SYNGEN automates commit-mining — see §12 for where this stands as of this chapter’s most recent verification pass.

Three honest caveats worth carrying forward, not hedging away:

  1. The scale gap is real and unresolved. Coding’s Rung 1–2 leverage comes from GitHub’s sheer volume (billions of lines, millions of solved LeetCode-style problems). Cybersecurity’s public equivalent (HackTheBox/TryHackMe writeups, Exploit-DB, CVE+PoC pairs) is orders of magnitude smaller and messier — the ladder’s mechanics transfer cleanly, but the achievable scale at each rung is a genuinely open empirical question, not something to assume by analogy.
  2. A design choice worth flagging, not a settled recommendation. SWE-RL’s finding — a rule-based, non-execution reward beating execution-per-rollout on cost grounds at 273K scale, while still hitting a respectable score on an execution-verified benchmark — suggests it may not be necessary to execute every single RL rollout in a live CTF sandbox if a cheaper proxy reward (structural similarity to a known-good exploit chain) can substitute during RL, provided the seed data was execution-verified upstream. This is a possible cost-saving lever, not a proven one.
  3. The rejection-sampling-vs-build-once inflection point is a real number to compute, not a vibe. Coding’s own cost curves (Rung 2, §5’s table) show rejection sampling beats building a faithful environment once baseline pass-rate sits in roughly a 10–30% band — below ~5% pass@1 the cost per verified sample explodes (too many wasted attempts per hit); above ~60% the marginal verified sample is nearly free either way, so building durable, harder environments becomes the better spend. The same arithmetic applies directly to whether you should hand-author the next CTF challenge or generate-and- filter one: at a rough $150–300 estimated per-challenge human-authoring cost against ~$0.50–2.00 per sandbox-verified LLM-generated challenge (at a 20–30% synthesis solve-rate — cheap because flag verification is O(1) string-match, not an O(N) test suite), the break-even sits around a 3–10% solve rate depending on labor rate assumed — LLM generation wins decisively above that, hand-authoring still wins for the small, high-stakes, published-benchmark tier where quality control matters more than volume. Treat these as order-of-magnitude planning numbers, not calibrated project estimates — nobody has published a real measured cost curve for CTF-challenge rejection sampling yet.

11. The 2025–26 frontier: agentic data recipes now in production — and why “Rung 4” still doesn’t exist

Rung 3 (live-environment agentic trajectories) was “emerging, expensive, small-scale” as of the sources that anchor this chapter’s original ladder (SWE-Gym’s 2,438 hand-curated instances, R2E-Gym’s 8.1K procedurally-generated ones). As of the 2025–26 frontier, it is production-standard across every model family that publishes a data-engineering section, and the mechanics converge on a common pattern worth naming explicitly, because it’s the shape this whole chapter’s ladder was pointing toward.

The converged 2025–26 recipe: real GitHub PRs as skeleton, synthetic augmentation for breadth, execution as the only trusted gate.

  • Qwen3-Coder-Next interleaves mid-training (continued pretraining on task-specific data) with RL directly against executable environments, rather than the older sequence of pretrain → SFT → RL as separate stages — generate→execute→verify→reward folded into the training loop itself.
  • Kimi K2 (arXiv:2507.20534) treats agentic tool-use data as a synthesis problem distinct from code synthesis: generate a diverse agent persona + task for a sampled toolset, generate the multi-step trajectory, then filter by LLM-judge quality — reaching 65.8% SWE-Bench Verified, 66.1% on Tau2-Bench (agentic planning), 76.5% on ACEBench without a “thinking” mode.
  • DeepSeek-Coder-V2 (arXiv:2406.11931) is the clean instance of the Rung 2 pattern industrialized: GRPO with compiler feedback + test-case pass/fail as the direct RL reward, on top of a 60%-code / 10%-math / 30%-NL pretraining mix (10.2T tokens total) — a modern, large-scale confirmation that “execution as the RL reward” (this chapter’s Rung 2 claim) is still the load-bearing mechanism three years later, just at far larger scale.
  • Seed-Coder (arXiv:2506.03524) replaces the 100+ hand-crafted filtering rules DeepSeek-Coder/Qwen2.5-Coder used at Rung 0 with an LLM-as-quality-judge — a direct, later confirmation of this chapter’s “Rung 0 has no execution, only judgment” claim, with the judgment itself now automated rather than hand-coded.
  • GLM-5 invests in asynchronous RL infrastructure (decoupling rollout generation from the training update) rather than more data — a signal the frontier bottleneck for the best-resourced labs has partly shifted from data collection to RL-training throughput, though this doesn’t change what the data itself needs to look like for anyone not yet at that scale.

Rung 4 — fully synthetic repositories/environments, zero real-code seed — still does not exist, and the reason is a genuine circular dependency, not a missing engineering effort. Three papers that each tried a piece of it converge on the same wall: RepoZero (arXiv:2605.07122) asks an agent to regenerate an existing open-source package from scratch in a different language (to dodge memorization), using the real package as the oracle for generating test cases — best models reach only 30–55% pass rate, and the approach is structurally Rung-3-with-a-harder-task, not Rung 4, because it still needs a real repo as the oracle. ProgramBench (arXiv:2605.03546) fuzzes a gold, compiled reference executable to generate ground-truth test cases, then strips the source and asks a model to reconstruct it — zero tasks fully resolved across 200 instances, and again the oracle dependency (a real compiled reference) rules this out as Rung 4. CodeAlchemy (arXiv:2606.10087), the most extensively execution-verified of the three (500B+ synthetic tokens across five rewriting strategies, including 1.3M execution-traced (code, trace) pairs), still starts every strategy from real GitHub files — and its own headline finding undercuts the Rung-4 dream further: frontier models achieve only 5.6% exact match on execution semantics even when trained on execution traces, meaning models learn code syntax far faster than code behavior. The circular dependency underneath all three: verifying synthetic code requires an oracle; the only oracle that scales is real code (a real repo, a real compiled binary); therefore “zero real-code seed” removes the only verification method every published approach actually uses. Separately, recursive training on model-generated code shows measurable output-diversity collapse (arXiv:2603.12683) — a second, independent reason a bootstrapped- from-nothing loop degrades rather than compounds. For cybersecurity, this blocker is strictly harder: code execution is deterministic (same input → same output, so a learned oracle or symbolic-execution substitute is at least conceivable); exploit execution is not (ASLR, timing, target state make the “oracle” itself probabilistic) — so a cyber-domain Rung 4 has no obvious path even in principle, not just in current engineering maturity.


12. The vulnerable-target-reconstruction open problem — a 2026-07 update

§10’s Rung-3 caveat — “nothing in this literature shows a path to automating vulnerable-target reconstruction as cheaply as SYNGEN automates commit-mining” — was written against the coding-side evidence alone. Checking the cybersecurity-specific literature directly (DARPA AIxCC 2023–2025 and the CVE-reproduction line of work through 2026-02) sharpens rather than resolves that caveat: the bottleneck has moved, not closed.

What’s now substantially automated: CVE → Docker environment. CVE-Factory (arXiv:2602.03012) runs a three-stage multi-agent pipeline — infer a Dockerfile + dependencies from the CVE description and vulnerable source, generate a PoC + verifiable test from CVE-description hints, synthesize the natural-language task description — with iterative execution-based validation at each stage. Reported quality on cross-validation against human experts: 95% solution correctness, 96% environment fidelity, producing LiveCVEBench (190 verified tasks, 14 languages) and 1,000+ executable training environments; a Qwen3-32B trained against it improves 5.3%→35.8% on LiveCVEBench. ARVO (arXiv:2408.02153) takes the complementary route — start from OSS-Fuzz crash reports (execution-based proof a vulnerability exists, not a sparse text description) and systematically re-resolve dependencies until the vulnerable version recompiles: 81% reproducibility success, despite 63% of candidate vulnerable versions initially failing to build (dependency drift / bitrot). Both results are a real jump from this chapter’s earlier framing of “manual, ~10-15 hours per CVE.”

What’s still substantially unsolved: patch (and by extension, exploit) semantic correctness. The DARPA AIxCC competition (2023–2025, systematized in an SoK, arXiv:2602.07666) is the largest automation attempt to date at this problem — 7 finalist teams, 100+ real-world C/Java projects, effectively unlimited compute by academic standards — and its own retrospective states plainly: no team achieved >60% patch correctness, and manual triage remained essential even with every team running LLM-guided fuzzing plus (for the top finishers) static/symbolic analysis. The winning system (ATLANTIS) layered static analysis + directed fuzzing + symbolic execution + LLM interpretation at three separate points; the runner-up (a pure fuzzing+LLM system, “All You Need Is A Fuzzing Brain”, arXiv:2509.07225) found 28 vulnerabilities (6 novel zero-days) and generated validated patches for 14 of them — real, useful automation, well short of a reliable pipeline. CVE-Bench (arXiv:2503.17332), evaluating exploitation rather than patching on real critical-severity web CVEs deployed as live Docker targets, reports a 13% success rate for a SOTA agent framework — a number that, read against this chapter’s Rung-2/3 pass-rate cost curves, sits well below the 10–30% inflection band where rejection sampling starts paying for itself cheaply, meaning naive “generate N exploit attempts, keep the flag-verified ones” is currently an expensive way to harvest real-CVE training data, not a cheap one — exactly opposite the CTF-challenge economics in §10’s third caveat, where synthetic (not real-CVE) challenges sit comfortably in the cost-effective band.

The reframed open problem, precisely stated: it is no longer “can a CVE be turned into a reproducible Docker target automatically” (CVE-Factory and ARVO show yes, at real if imperfect fidelity) — it is “can the patch/exploit that closes or exercises that target be automated to the point of trustworthy, unsupervised training-data generation.” SoK’s <60%-patch-correctness ceiling, held even at AIxCC’s resourcing, is the honest current answer: not yet, and the gap is semantic correctness, not environment provisioning. For a training-data pipeline specifically (rather than a live-competition red team), the practical implication is to lean on the CVE-Factory/ARVO-style automation for the environment half of the pipeline (now genuinely cheap-ish, ~$0.03–0.10/instance in LLM cost per CVE-Factory’s own accounting) while treating the exploit-generation half as still requiring either real strong-agent trajectories (SWE-Gym’s weak-to-strong pattern, §7) or a test-suite-preservation-style proxy verification (Dockerless-style patch scoring without execution, an idea borrowed from the coding side but not yet published for exploits specifically) rather than trusting a rejection-sampled exploit corpus at face value.


  • The kinds of SFT — it is the data, not the algorithm — this chapter’s rungs are a concrete, execution-graded instance of “where did the target sequence come from”; Rung 2/3 formats map directly onto that chapter’s rejection-sampling and agentic-trajectory rows.
  • Method → Data (your real bottleneck) — this case study is the how behind that chapter’s what: once you’ve picked GRPO/RLVR or rejection-sampling FT, the data ladder here is the concrete pipeline for producing the object that method consumes.
  • Cybersecurity is one of a family — what cracked the others — that chapter’s “long-horizon coding” row (SWE-Gym/R2E-Gym/SWE-RL) is Rung 3 of this ladder viewed from the technique axis; this chapter is the data axis underneath the same evidence.
  • The recipe is a sequence, not a pick — the data ladder here is a second, independent confirmation that capability compounds stage-by-stage rather than arriving from a single technique choice — the coding field learned this on the data-engineering axis a few years before the RL-technique-sequencing literature named it explicitly.
  • Data mixing, ratios & not forgetting how to think — every rung above Rung 0 is built on top of the previous rung’s model, not as a replacement; the mixing/forgetting discipline that chapter covers is exactly what governs how much of each rung’s data a later stage should see without regressing the capability the earlier rung installed.
  • Reinforcement — §7’s data-flywheel saturation signature (peak-to-end gap, pass@1-vs-pass@k divergence, verifier overfitting to the generator’s own distribution) is the data-engineering-side mirror of that chapter’s RL-collapse discussion; §6’s reward-hacking-generalizes- to-misalignment finding is a concrete instance of the alignment risk that chapter flags abstractly.

Source registry (all verified live via arxiv.org/abs/<id>, 2026-07-02)

Original ladder verified live 2026-07-02; §5–§12 additions verified live via Exa web_search_advanced_exa against arxiv.org, same date.

Rungs 0–3 (original ladder — re-verified this pass)

RungPaperarXiv
0The Stack2211.15533
0StarCoder2305.06161
0StarCoder2 / Stack v22402.19173
0DeepSeek-Coder2401.14196
0Code Llama2308.12950
0FIM (Bavarian et al.)2207.14255
0Phi-1 “Textbooks Are All You Need”2306.11644
1Self-Instruct2212.10560
1WizardCoder / Evol-Instruct2306.08568
1Magicoder / OSS-Instruct2312.02120
2CodeT2207.10397
2LEVER2302.08468
2GenX2412.13464
2KodCode2503.02951
2SOL-VER2502.14948
2CodeRL2207.01780
2PPOCoder2301.13816
2RLTF2307.04349
2StepCoder2402.01391
2Self-Debugging2304.05128
3SWE-bench2310.06770
3SWE-Gym2412.21139
3R2E-Gym / SYNGEN2504.07164
3SWE-RL2502.18449

§5 — execution sandbox infrastructure at scale

PaperarXiv
AlphaCode2203.07814
SWE-MiniSandbox2602.11210
SWE-World (Docker-free surrogate)2602.03419

§6 — synthetic test quality and the weak-verifier failure mode

PaperarXiv
KodCode2503.02951
CodeT2207.10397
VeriScale2605.22368
SpecBench (reward-hacking gap vs. task size)2605.21384
Emergent misalignment from reward hacking2511.18397

§7 — the data flywheel / expert iteration

PaperarXiv
STaR2203.14465
AlphaCode2203.07814
SWE-Gym2412.21139
Sol-Ver2502.14948

§8 — decontamination and the memorization-vs-reasoning gap

PaperarXiv
SWE-Bench Illusion2506.12286
Metamorphic testing for memorization diagnosis2604.21579
BountyBench2505.15216

§9 — environment-generation mechanics (manual → 807K procedural)

PaperarXiv
R2E-Gym / SWEGEN2504.07164
SWE-Factory2506.10954
SWE-Universe2602.02361

§11 — the 2025–26 frontier and the “Rung 4” question

PaperarXiv
Kimi K22507.20534
DeepSeek-Coder-V22406.11931
Seed-Coder2506.03524
RepoZero2605.07122
ProgramBench2605.03546
CodeAlchemy2606.10087
Model self-convergence / collapse under recursive synthetic training2603.12683

§12 — vulnerable-target-reconstruction open problem

PaperarXiv
CVE-Factory2602.03012
ARVO2408.02153
SoK: DARPA AIxCC2602.07666
All You Need Is A Fuzzing Brain2509.07225
CVE-Bench2503.17332
BountyBench2505.15216

Confidence note on the §5–§12 additions: the nine core-ladder ids (The Stack, SWE-bench, SWE-Gym, SWE-RL, R2E-Gym, Code Llama, Magicoder/OSS-Instruct, CodeT, DeepSeek-Coder) were re-verified this pass against arxiv.org via web_search_advanced_exa with includeDomains:["arxiv.org"] and body-text matching (not just the crawling_exa title field, which is documented as unreliable) — all nine confirmed. The additional §5–§12 ids were pulled from the underlying deep-research notes in artifacts/overnight-coding-data/research/, each of which carries its own live-verification stamp dated 2026-07-02; a subset (five, marked with full arxiv.org/abs/ links above) were independently re-checked in this pass and confirmed. The remainder (shown as bare ids without link markdown) inherit the source notes’ verification and were not independently re-crawled in this editing pass — treat them as high-confidence but not double-verified, consistent with the “confidence calibration” discipline this seat runs on.

RungPaperarXiv
0The Stack2211.15533
0StarCoder2305.06161
0StarCoder2 / Stack v22402.19173
0DeepSeek-Coder2401.14196
0Code Llama2308.12950
0FIM (Bavarian et al.)2207.14255
0Phi-1 “Textbooks Are All You Need”2306.11644
1Self-Instruct2212.10560
1WizardCoder / Evol-Instruct2306.08568
1Magicoder / OSS-Instruct2312.02120
2CodeT2207.10397
2LEVER2302.08468
2GenX2412.13464
2KodCode2503.02951
2SOL-VER2502.14948
2CodeRL2207.01780
2PPOCoder2301.13816
2RLTF2307.04349
2StepCoder2402.01391
2Self-Debugging2304.05128
3SWE-bench2310.06770
3SWE-Gym2412.21139
3R2E-Gym / SYNGEN2504.07164
3SWE-RL2502.18449