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

Introduction

This is a living field manual for post-training an agent — written for an engineer who wants to know it, then do it, not experiment blindly. It grows: each session adds or sharpens a chapter.

📄 Offline? Grab the whole book as a single PDF: download.pdf — every chapter, diagrams included, for reading with no network.

The problem it exists to answer

Run a CTF-playing agent against a real benchmark and the pattern is a familiar one: most challenges fail, only a minority solve. You have the harness, the workflow, the budget, and the backing to do anything. The bottleneck is usually not data — it’s knowing which fine-tuning method you want, and therefore what data to build, and why.

Everything here builds toward answering that from first principles.

The shape of this book

Four parts, front to back — Problem → Learnings → Understanding → Conclusion:

  1. Problem — this chapter, the 5-minute journey, and the diagnostic chapters (behavioral audit → training signal, diagnosing the gap) establish what’s actually broken and how to know it from evidence, not vibes.
  2. Learnings — how models are actually built — the general theory, unattached to your case: the on/off-policy axis, what “data” means, the method family (imitation / preference / reinforcement / agentic RL / PEFT), and how frontier labs sequence, loop, order and batch, and mix data without forgetting these into real recipes.
  3. Understanding — applying it to your case — the same theory turned toward your bottleneck: ranking methods by proven-ness, deciding whether you have one problem or many, mapping method → data, and what instrumentation has to exist before a training run.
  4. Conclusionthe actual decision, the roadmap and forks still open, and the edges that are genuinely contested (so you don’t mistake open questions for settled ones).

How to read it

What’s canonical vs. what’s a teaching scaffold (read this once)

Being honest about provenance, because you’re becoming a researcher and the distinction matters:

  • Canonical, universal, you’ll find it in any RL/post-training text: the on-policy vs. off-policy axis, and the three learning paradigms (imitation / preference / reinforcement). These are load-bearing and not up for debate.
  • My teaching scaffold: any packaging that presents these as “N knobs you freely toggle.” The axes describe methods; they are not independent dials you combine — each named method is a fixed preset. An earlier interactive matrix implied free combination and produced nonsense for some products. That was the scaffold over-reaching. Corrected here: learn the one axis (on/off-policy) + the fixed method presets, not a combinatorial grid.

The one line to anchor on

Every method is the same move — push probability mass toward good behavior — differing only on whose distribution the data comes from (off- vs on-policy) and whether you also learn from failures.

Keep that; the rest is detail.

The 5-minute journey

Before the theory, feel the shape of it. This is the interactive walk-through — problem → reasoning → decision — embedded live. Scroll it; click the ladder rungs and answer the decision tool at the end.

If the frame is cramped, open it full-screen: assets/journey.html

Everything in that frame is expanded, corrected, and cited in the chapters that follow. The frame is the map; the chapters are the territory.

From behavioral audit to training signal

A trace-level behavioral audit of agentic CTF-solving runs — not just a pass/fail benchmark score — is a behavioral trace. Each of the 5 findings below describes a shape of failure, and each shape implies a different kind of gap: exploration, methodology/reasoning, credit assignment, or eval validity. This page maps observed behavior → gap type → the literature’s actual fix → how you’d check the fix worked, for each of the 5 patterns, against this project’s real setup (rejection-sampling SFT on verifier-passed solves now, GRPO/RLVR when entropy collapses; ground-truth flag verifier; knowledge in tools not weights).

flowchart LR
    A[observed behavior] --> B[gap type]
    B --> C[training signal / method]
    C --> D[verification check]
    D -.re-audit.-> A

None of this relitigates the diagnosis (execution gap, not knowledge gap) — it asks a narrower question per pattern: given this specific failure shape, which lever in the SFT→GRPO graduation actually targets it, and how would you know if it worked?


Pattern 1 — Agents prefer their own tools over the provided tool surface

Observed: raw curl/shell dominates; the bespoke sectools surface is mostly unused.

Gap type [E]: this is not a knowledge gap (the agent isn’t ignorant of the tools — they’re in its context) and not really a reasoning gap. It’s an exploration-of-tool-space problem: tool choice is driven by the model’s pretraining prior (shell/curl is high-likelihood, familiar, “free” under next-token probability) rather than by the tool’s actual value for the subtask. Faghih et al., “Tool Preferences in Agentic LLMs are Unreliable,” arXiv:2505.18135 (2025-05-23) shows this is gameable by description text alone — edited docstrings shift usage >10x with zero change in tool capability. Confidence: established (controlled cross-model study). This is a diagnosis, not a fix — it just rules out “better docstrings” as a ceiling-breaking move.

Training signal:

Designed to fix: pattern 1 — agents defaulting to raw shell/curl over the provided tool surface.

  • ToolRL (Qian et al., arXiv:2504.13958, 2025-04-16, established) — don’t SFT-imitate tool traces; decompose the reward into per-call terms so which tool was chosen is its own learnable signal, not folded into one coarse outcome score:
    r_format  = valid_json_schema(call)          # 0/1
    r_tool    = tool_is_appropriate(call, state)  # 0/1, graded by task type
    r_param   = params_correct(call)              # 0/1 or partial
    r_outcome = env_feedback(call)                # sparse, terminal-heavy — your flag verifier
    reward = w1*r_format + w2*r_tool + w3*r_param + w4*r_outcome
    
    Their ablation: reward granularity (per-call beats per-episode) and reward type (graded beats binary) both matter. This is the cheapest lever — you already have the tool registry, you need the auxiliary signal.
  • ReTool (Feng et al., arXiv:2504.11536, 2025-04-15, established) — trains the whole trajectory end-to-end so the policy learns when in a reasoning chain to reach for a tool, not just which one given an isolated decision point. Confirms the shape of the project’s SFT→GRPO plan; its specific addition is that real sandbox tool-execution output (not a paraphrase) must be in the rollout context that gets scored — worth auditing whether secagent/daytona feeds live stdout into the trajectory used for reward.
  • Tool-Star (Dong et al., arXiv:2505.16410, 2025-05-22, promising, <6mo/low-citation) — naive RL under-explores a large tool inventory because gradient concentrates on whatever already gets used. Its fix: manufacture forced/hinted rollouts that exercise under-used tools before RL, verify with the real environment, fold verifier-passed ones into SFT data. Directly targets tools that never get invoked — and flags a self-reinforcing trap: a rejection-sampling corpus built from the current curl-biased policy will never contain a dead tool succeeding, because the policy never tried it. RL alone has ~zero probability mass to reinforce on those tools.
  • Search-R1 (Jin et al., arXiv:2503.09516, 2025-03-12, established) contributes one mandatory engineering detail, domain-general: mask tool/environment output tokens from the policy-gradient loss — you don’t want to reinforce or penalize text the environment produced (shell stdout, HTTP bodies), only the model’s own query/command-generation tokens.

Honest caveat: ToolRL/ReTool/Tool-Star are validated on general agentic tool-use, not offensive-security tool-use specifically — the transplant to sectools is this researcher’s inference, not literature-verified. Random-Crypto/HackSynth, arXiv:2506.02048academic domain-specific CTF RL work, cited for context only, not a basis for this page’s claims — reports vanilla GRPO on crypto-CTF attributing generalization gains to improved tool usage; per this project’s standing rule, academic cybersecurity-LLM training/benchmark papers don’t count as frontier evidence, so this is mentioned but not relied on. The actual basis for “RL over tool-choice transfers” stays the general-agentic evidence above (ToolRL/ReTool/Tool-Star) — domain-general RL-for-tool-use results that don’t need a CTF-specific data point to hold.

Verify the fix: track the tool-usage histogram across all 40 sectools entries before/after training — do previously-dead tools get invoked at all on held-out challenges (not just replayed on training challenges)? Cheap, no-training-required companion check: DIVER, arXiv:2509.26209 (2025-09-30) rewards pairwise diversity across a rollout group — if adapted to “which tools/commands were used” rather than token text, a rising group-diversity score on tool choice is a leading indicator before solve-rate moves at all.


Pattern 2 — React-and-guess, no methodology (no wordlists/checklists/PTES sequencing; premature pivoting after failure)

Observed: no visible recon→enum→exploit sequencing; the agent abandons a line of attack after one failed attempt instead of enumerating alternatives methodically.

Gap type [R]: a sequencing prior is missing — the model has PTES-shaped knowledge somewhere in its weights (it can describe methodology if asked) but doesn’t apply it as an ordering constraint during live rollouts. This reads as reasoning/methodology, not exploration-in-the-entropy sense, though the two compound (§ below, and see RAGEN / StarPO’s “Echo Trap”).

Training signal:

Designed to fix: pattern 2 — no methodology / premature pivoting after a single failed attempt.

  • Two-stage guide-then-explore RL, re-grounded on general RL theory: Jump-Start Reinforcement Learning (JSRL) — Uchendu et al., arXiv:2204.02372 (2022-04-05, established, 17+ citations) is the domain-general theoretical basis for the same two-stage shape this page used to cite a CTF-specific paper for: a guide-policy (built from offline data/demonstrations/an existing policy) forms a curriculum of starting states, and an exploration-policy is trained forward from those states — naive initialization-then-finetune underperforms this because value-based methods handle a cold-start policy poorly. Mapped onto this project’s actual pipeline:
    # Stage 1 — guide-policy: rejection-sampling SFT on verifier-passed walkthroughs
    # (methodology prior — ordered recon → enum → exploit, not just any verifier-passed trace)
    # Stage 2 — exploration-policy: online GRPO/RLVR in the live sandbox
    # reward = terminal flag-verified {0,1} + intermediate env feedback (command succeeded/failed)
    # JSRL's curriculum knob: anneal how far into the guide-trajectory the exploration-policy starts,
    # rather than always starting cold — cheap to add to the existing rejection-sampling corpus.
    
    DeepSeek-R1’s own disclosed recipe (R1, arXiv:2501.12948) is the frontier-lab confirmation that this shape works at scale: “cold-start SFT data, then RL” outperforms RL-from-scratch specifically because RL-from-scratch on an unguided policy wastes exploration budget relearning basic structure the SFT stage would have given it for free — the same failure mode JSRL formalizes. Academic CTF/pentest work — cited for context only, not a basis: Pentest-R1 (Kong et al., arXiv:2508.07382, evaluated on Cybench + AutoPenBench) reports the identical two-stage shape in the CTF domain specifically and claims both stages are required, order matters, and stage-1 data must be walkthrough-shaped rather than raw verifier-passed traces. Per this project’s standing rule, academic cybersecurity-LLM training/benchmark papers (Pentest-R1, AutoPenBench, and similar) don’t count as frontier evidence for a decision — the load-bearing basis here is JSRL + DeepSeek-R1’s cold-start-then-RL recipe, both domain-general. If Pentest-R1’s specific findings (walkthrough-shaping matters, order matters) turn out to matter operationally, that’s this project’s own thing to verify empirically, not something to inherit from an academic CTF paper.
  • Structured attack trees / ATT&CK scaffolding (Nakano et al., arXiv:2509.07939, 2025-09-09, established mechanism, but this is scaffolding not weight-training — flag the distinction) — externally constrain rollout-time reasoning with a deterministic task tree built from MITRE ATT&CK’s kill-chain, filtering unproductive actions. Reports 71.8–78.6% subtask completion vs. 13.5–75.7% for self-guided reasoning at far fewer queries — a large, reproducible gap. The cheapest lever in this whole page: use the ATT&CK tree as a rollout-generation scaffold to harvest higher-quality, more methodical verifier-passed trajectories for the SFT corpus right now, with zero RL infrastructure — and it keeps knowledge in the tree (a prompt/tool artifact), not baked into weights, consistent with the project’s “knowledge in tools not weights” rule.
  • PEARL (Wang et al., arXiv:2601.20439, 2026-01-28, promising) — treats the planning step (which tools, in what order) as its own object of RL, rather than only optimizing the final answer. Directly relevant as a formal mechanism for systematic tool-sequencing instead of react-and-guess, though not yet validated outside general multihop tool-use.
  • Adjacent, unverified beyond title: classical-planner-hybridized LLM agents (arXiv:2512.11143) — a stronger, harder version of the ATT&CK-tree idea; worth a follow-up only if the tree scaffold proves insufficient.

Honest caveat: the load-bearing basis for the two-stage recipe above is domain-general (JSRL, DeepSeek-R1’s cold-start-then-RL disclosure), not the CTF-specific Pentest-R1 paper — per this project’s standing rule, an academic CTF/pentest paper being “in-domain” doesn’t make it stronger evidence, it makes it out of scope as a basis (no academic cybersecurity-LLM project has produced a frontier model). The ATT&CK-tree scaffold (Nakano et al.) is a separate, non-cybersecurity-specific mechanism (deterministic task-tree filtering built on a public taxonomy, evaluated as scaffolding not weight-training) and isn’t subject to the same caveat. The main open question either way is whether a walkthrough corpus built from this project’s own data generalizes past the small set of canonical challenges it would initially be built from — that’s this project’s own thing to test.

Verify the fix: measure PTES-phase coverage per episode (recon steps taken before first exploit attempt) and the pivot-after-failure rate (does the agent try ≥2 alternatives before abandoning a technique?) on held-out challenges, pre/post. Both are derivable from existing Phoenix spans without new instrumentation.


Pattern 3 — Good guessers until they’re not (many solves hinge on an ungrounded guess; brittle to a wrong first guess)

Observed: many successful runs pivot on a single ungrounded guess at a critical step; when that guess is wrong, the agent rarely recovers.

Gap type [E]/[R]: this is where entropy collapse and reasoning intersect — a policy that has already spent its exploration budget on one high-probability guess has no remaining probability mass on alternatives when that guess fails. Cui et al., “The Entropy Mechanism of RL for Reasoning Language Models,” arXiv:2505.22617 (2025-05-28, high confidence, mechanistic + empirical) is the underlying diagnosis this pattern shares with pattern 4: entropy falls monotonically and predictably (R = -a·exp(H) + b), and the mechanism is the covariance between a token’s probability and its advantage — the model reinforces what’s already likely rather than exploring what’s uncertain.

Training signal:

Designed to fix: pattern 3 — brittle single-guess behavior with no recovery on failure.

  • SCoRe — self-correction via RL (Kumar et al., arXiv:2409.12917, 2024-09-19, established, canonical DeepMind paper) — SFT on (wrong→right) correction pairs barely transfers because it’s distribution-mismatched; only multi-turn RL with reward shaped to reward improvement, not just final correctness, produces genuine revision instead of mode-collapsing to “be right turn 1” or no-op-collapsing to “always change the answer”:
    r1 = verifier(attempt_1)
    r2 = verifier(attempt_2)
    reward = r2 + alpha * max(0, r2 - r1)   # bonus specifically for turning a miss into a hit
    
    Naming collision, flag explicitly: a different Sept-2025 paper reuses “SCoRe” for teacher-corrected earliest-error localization + short-horizon RL-continue-from-verified-prefix (Lyu et al., arXiv:2509.14257, promising, 7B-matches-72B claim unreplicated). Cite by arxiv id, not the shared name. If a 100-turn episode fails at a single identifiable wrong-guess turn (which matches this exact failure shape), earliest-error-localized short-horizon RL is much cheaper credit assignment per episode than scoring the whole trajectory as one unit.
  • CDE — curiosity-driven exploration (Dai et al., arXiv:2509.09675, 2025-09-11, medium-high, ICLR 2026 poster) — an actor-side perplexity bonus (reward the model for being “surprised” by its own output) reports a calibration collapse finding as a byproduct: the policy becomes confident regardless of correctness, which the perplexity bonus specifically counters. This is the literature-side twin of “commits to an ungrounded guess and doesn’t recover” — cheap to try (no extra network, just log-perplexity of the model’s own rollout) before anything heavier.
  • Representation-based exploration (Tuyls et al., arXiv:2510.11686, 2025-10-13, medium-high) — an inference-time-only lever, not training: build a diverse k-of-N pass@k pool from hidden-state dissimilarity instead of random k-of-N. Notable negative result: this is anti-composable with high-temperature sampling — high-temp outputs look “novel” in representation space without being useful. Worth an ablation on whatever temperature the pass@k>1 eval pool currently uses, since it changes nothing about training and answers whether current sample diversity is real strategic variance or just noisier repeats.

Honest caveat: SCoRe (both papers) and CDE are domain-general (math/code) — the CTF/100-turn transfer is inference, not literature-verified. One concrete, cheap check the project can run without any new training: confirm the reward/credit-assignment scheme doesn’t implicitly favor shorter successful trajectories — a 60-turn recovery-from-wrong-guess success should score the same as a 10-turn lucky first guess; if it doesn’t, the reward is actively working against fixing this pattern regardless of which paper’s fix gets adopted.

Verify the fix: on a held-out set, measure whether backtracking-after-a-wrong-guess correlates with eventual success pre/post training (does the trained policy actually try a second technique after the first fails, and does that second attempt land more often?).


Pattern 4 — Uneven PTES phases: strong at chaining inside an exploit, weak at thorough enumeration (failures often stall in exploitation)

Observed: the agent is good at following a known exploit chain once inside it, but weak at the enumeration/reconnaissance breadth that would get it there in the first place; most failures stall during exploitation rather than in an earlier phase.

Gap type [L]/[E]: two compounding gaps. First, entropy collapse narrows the recon repertoire — once RL reinforces whatever enumeration path happened to work once, alternative recon strategies stop being tried (same mechanism as pattern 3, arXiv:2505.22617). Second, a long-horizon credit-assignment problem: a flat terminal-only reward over a ~100-turn episode gives early, correct enumeration steps the same undifferentiated credit as late exploitation steps — so even when enumeration was necessary for the eventual win, nothing in the reward signal reinforces it specifically.

Training signal:

Designed to fix: pattern 4 — weak/uneven enumeration and stalling mid-exploitation.

  • DAPO (Yu et al., arXiv:2503.14476, 2025-03-18, established, widely reproduced) + the Entropy Mechanism paper (arXiv:2505.22617) together are the baseline recipe, not an optional add-on, once GRPO starts: clip-higher (decouple the PPO clip range so rare-but-good tokens aren’t capped as hard as likely ones) and dynamic sampling (drop degenerate all-correct/all-wrong prompt groups, which otherwise contribute zero gradient — this matters disproportionately here since a whole-group-zero-reward challenge at ~100 turns/rollout is expensive to keep resampling; consider curriculum-filtering to the 30–60% pass-rate band the project already targets, rather than paying for blind resamples on genuinely-unsolved challenges).
    eps_low, eps_high = 0.20, 0.28              # decoupled clip (vanilla PPO/GRPO: symmetric 0.20/0.20)
    ratio = exp(logp_new - logp_old)
    clipped = clip(ratio, 1 - eps_low, 1 + eps_high)
    loss_pg = -min(ratio * adv, clipped * adv)   # per-token, mean over ALL tokens in batch
    
  • GiGPO (Feng et al., arXiv:2505.10978, 2025-05-16, established, NeurIPS 2025 poster) — the most directly transplantable long-horizon idea in this map, and it needs no new infra: no critic, no extra rollouts. It adds a second, step-level advantage on top of GRPO’s trajectory-level one by retroactively hashing (state, step) pairs that recur across rollouts and scoring “what happened next” conditioned on that shared state — pure post-hoc bookkeeping on trajectories already sampled. This is exactly the mechanism that could stop rewarding all 100 turns equally when only the exploitation phase decides the outcome. Failure mode to flag honestly: GiGPO’s state-hashing was validated on benchmarks with hashable states (web pages, grid worlds); a CTF agent’s state is unbounded free text (shell/HTTP output), so state-canonicalization needs a bespoke similarity function — e.g. (tool_name, normalized_target, response_status_class) from the existing tool_call/tool_exec_ms spans — rather than a raw-text hash, or the anchor groups never fire.
  • HiPER / hindsight credit assignment (Peng et al., arXiv:2602.16165, 2026-02-18; Tan et al., arXiv:2603.08754, 2026-03-07, both promising, 0 citations, evaluated on WebShop/ALFWorld — domain transfer to cybersecurity is inference, not literature-verified) — explicit hierarchical decomposition: a planner proposes subgoals (recon-done, foothold-gained, priv-esc-done, flag-captured), each independently checkable against environment state, with terminal reward at the flag level and intermediate credit at the subgoal level. The PTES phases already tracked are a natural subgoal taxonomy for this — no new taxonomy needed. If the flag-verifier is extended to also check an intermediate condition (“foothold confirmed” via sandbox state), that stays deterministic and doesn’t violate the ground-truth-verified-reward rule.
  • RL-PLUS (Dong et al., arXiv:2508.00222, 2025-07-31, promising, strong math/code ablations, cybersecurity transfer untested) — names “capability boundary collapse” directly: pass@k at large k drops under pure on-policy RLVR even as pass@1 rises, i.e. uneven phases get more uneven as training narrows the policy. Its fix: mix verifier-passed off-policy trajectories (already produced by rejection sampling!) into GRPO via importance-sampling correction, plus an advantage bonus for visiting under-explored-but-successful states. Concretely: don’t discard the rejection-sampling SFT corpus once GRPO starts — feed it back in as off-policy anchor data.
  • NuRL (Chen et al., arXiv:2509.25666, 2025-09-30, medium, consistent gains across six benchmarks/three models) — targets prompts with zero reward across every rollout in the group, which vanilla GRPO simply cannot learn from (zero gradient). Self-generates a hint conditioned on the gold answer, re-rolls with the hint injected, trains on the hint-augmented rollout, then drops the hint at inference. This is the strongest candidate for the ~800 currently-unsolved challenges in the portfolio — but the “gold answer” analogue doesn’t port zero-shot: the flag itself isn’t the how-to- get-there knowledge, so a CTF adaptation needs a hint source (walkthrough/verifier metadata, or a successful trajectory from a similar challenge family) that doesn’t yet exist and requires design work.

Verify the fix: instrument mean policy entropy from step 0 of any GRPO run (this alone is diagnostic, not a fix — but without it you cannot tell “the task is hard” from “the policy already collapsed at step 50 and is just getting faster at one script”); track per-PTES-phase solve/stall rates before and after each intervention layer (DAPO → GiGPO → RL-PLUS/NuRL); and run RL-PLUS’s own diagnostic — pass@k at large k on the base model vs. the trained checkpoint — to check whether exploitation-phase gains are holding or narrowing over training.


Pattern 5 — Benchmarks measure pattern-match speed, not thoroughness/methodology/robustness

Observed: a rising solve-rate number doesn’t by itself tell you whether the agent generalized a strategy or pattern-matched something close to a memorized/leaked challenge shape.

Gap type [N]: this is an eval-methodology gap, not a training-loop gap directly — but it’s the project’s own check on whether the SFT→GRPO pipeline is doing what axis [N] (novelty/boundary-expansion) requires, versus merely axis-amplifying what the base model already does.

Training signal (mostly diagnostic, one eval-recipe change, one eval-recipe addition):

Designed to fix: pattern 5 — solve-rate gains that can’t be told apart from elicitation/memorization.

  • Yue et al., “Does RL Really Incentivize Reasoning Capacity Beyond the Base Model?,” arXiv:2504.13837 (2025-04-18, established, large systematic study across model families/algorithms) — across math/code/visual-reasoning and 6 popular RLVR algorithms, the base model catches up and overtakes at large pass@k even when RL wins at pass@1: the patterns RL concentrates on were already latent in the base model’s sampling distribution. This paper’s own recommended fix — evaluate pass@k at large k, not just pass@1 — is already this project’s locked methodology (pass@k, k=3/5/10 bands per decisions/2026-06-11-ctf-benchmark-pass-count.md); the missing piece is running the base model at the same pass@k bands as a mandatory control. If base-model pass@10 ≈ trained-model pass@10 on a chunk of challenges, that chunk’s improvement is elicitation, which is fine to attribute to the SFT stage (SFT is explicitly meant to replace/instill, not expand) but would be a red flag if it persists after GRPO, where genuine capability gain is expected.
  • Semantics-preserving-transform robustness testing, re-grounded on general (non-cybersecurity) evidence: GSM-Symbolic — Mirzadeh et al. (Apple), arXiv:2410.05229 (2024-10-18, established, frontier-lab work) is the domain-general instance of the same failure mode: regenerating GSM8K-style math questions from symbolic templates — same structure, only surface values/names changed — shows LLM solve rates drop and get noticeably more variable under these semantics-preserving perturbations, and performance degrades further as templates add clauses that shouldn’t change the answer. This is established, cited-widely evidence (independent of any cybersecurity-domain paper) that a rising benchmark number can reflect pattern-match on the specific surface form rather than a robust, generalized method — exactly the risk pattern 5 flags for this project’s own solve-rate numbers. Concrete recipe for this project: build semantics-preserving variants of the existing challenge set (renamed services/users, reordered but logically-identical steps, cosmetic code/config changes that don’t alter the exploit path) and check whether a claimed solve-rate jump transfers to a transformed variant before crediting it to “the agent got better at CTF,” mirroring GSM-Symbolic’s methodology directly. Academic CTF-benchmark work — cited for context only, not a basis: Capture the Flags / Evolve-CTF (Honarvar et al., arXiv:2602.05523) runs the identical idea in the CTF domain specifically (source-transformation families, composed-obfuscation degradation) and would be the more directly-transplantable recipe if it counted as evidence — but per this project’s standing rule it’s an academic domain-specific CTF-benchmark paper, so it doesn’t serve as the basis here; GSM-Symbolic does.

Honest note: this pattern’s fix is mostly an eval-protocol addition, not a new training signal — the “fix” for pattern 5 is really making patterns 1–4’s fixes falsifiable. Both papers above are cheap (no new training) relative to any of the RL infrastructure work in patterns 1–4 and should run before crediting the first GRPO graduation with “fixing execution,” not after.

Verify the fix: run the base-model pass@k-at-large-k control (5.1) alongside every RL-trained checkpoint’s pass@k; separately, generate semantics-preserving-transform variants of a held-out challenge subset and check whether solve-rate gains survive the transform. If gains evaporate on either check, that’s elicitation/memorization, not the execution-reliability improvement the rejection-sampling-SFT diagnosis is banking on.


Summary table

PatternGap typeMethod designed to fix itCitationConfidence
1. Own-tool preference (raw shell/curl over provided tools)[E] tool-space explorationToolRL — decomposed per-call rewardarXiv:2504.13958Established
1. (same)[E][N]Tool-Star — forced exposure to under-used tools pre-RLarXiv:2505.16410Promising
1. (same)[L][E]ReTool — end-to-end trajectory-level tool-RLarXiv:2504.11536Established
2. React-and-guess, no methodology (premature pivot after failure)[R][L]JSRL + DeepSeek-R1 cold-start recipe — guide-policy (SFT walkthroughs) then exploration-policy (online RL)arXiv:2204.02372 / arXiv:2501.12948Established (domain-general)
2. (same, context only — not a basis)[R][L]Pentest-R1 — same two-stage shape, CTF-specific; academic, cited for context, not a basis per standing rulearXiv:2508.07382Academic CTF work — not evidentiary
2. (same)[R]ATT&CK structured attack-tree scaffold (no training needed)arXiv:2509.07939Established (mechanism), scaffold not training
3. Brittle single-guess (commonly hinge on a guess)[E][R]SCoRe — RL reward for improvement, not final correctnessarXiv:2409.12917Established
3. (same)[E][N]CDE — curiosity/perplexity bonus counters calibration collapsearXiv:2509.09675Medium-high
4. Uneven PTES / often stalls in exploitation[E][L]DAPO + Entropy Mechanism — clip-higher, dynamic samplingarXiv:2503.14476 / arXiv:2505.22617Established
4. (same)[L][E]GiGPO — step-level credit via state-hash groups, zero extra rolloutsarXiv:2505.10978Established
4. (same)[L][E][N]HiPER / hindsight credit assignment — PTES-shaped subgoal decompositionarXiv:2602.16165 / arXiv:2603.08754Promising, domain-transfer speculative
4. (same)[E][N]RL-PLUS — counters capability-boundary collapse w/ off-policy mixingarXiv:2508.00222Promising
4. (same, ~800 unsolved tail)[L][E][N]NuRL — self-generated hints unlock zero-reward-group promptsarXiv:2509.25666Medium
5. Benchmarks measure pattern-match, not thoroughness[N] eval validityBase-model pass@k-at-large-k controlarXiv:2504.13837Established
5. (same)[N] eval validityGSM-Symbolic — semantics-preserving-transform degrades solve rate (domain-general)arXiv:2410.05229Established
5. (same, context only — not a basis)[N] eval validityEvolve-CTF — same idea, CTF-specific; academic, cited for context, not a basis per standing rulearXiv:2602.05523Academic CTF work — not evidentiary

What this changes about the plan, concretely

  • Cheapest, no-training-required move first: the ATT&CK attack-tree scaffold (pattern 2) improves rejection-sampling SFT corpus quality today, before any RL infra exists.
  • When GRPO starts, DAPO’s clip-higher + dynamic sampling is the baseline, not an optional add-on — it’s simultaneously the fix for patterns 3 and 4’s shared entropy-collapse mechanism.
  • GiGPO is the single most transplantable long-horizon idea (pattern 4) — zero new infra, just a state-canonicalization function over the existing tool_call spans.
  • Keep the rejection-sampling SFT corpus as off-policy anchor data through GRPO, not a disjoint earlier stage — RL-PLUS’s argument (pattern 4) applies directly since that data already exists.
  • Pattern 5’s checks (base-model pass@k control, semantics-preserving-transform families) should run before the first GRPO graduation is credited with anything — they’re the cheapest falsification test available and gate whether patterns 1–4’s fixes actually expanded capability or just re-elicited it.
  • Contested / open: whether GiGPO/HiPER-style credit assignment transfers from hashable (WebShop/ALFWorld) state spaces to a CTF agent’s unbounded free-text environment state is this project’s own thing to test, not something published literature has already settled — say so plainly if this page gets cited externally.

Diagnosing the gap — a scientific framework

The question this chapter answers: is there an industry-standard, peer-defensible way to prove a failure is a KNOWLEDGE gap, not an EXECUTION gap, not an EXPLORATION gap? Short answer, upfront: no single accepted instrument exists. There is no ISO-9001 for capability diagnosis. What exists is a converging set of measurement techniques, each independently validated, that — combined into one protocol — give you a defensible, falsifiable, split verdict. That protocol is what this chapter hands you.

Every arXiv id below was verified live against arxiv.org/abs/<id> on 2026-07-02 (project research pass, artifacts/overnight-rl-sweep/research/diagnosis.md). Confidence tags follow that pass: [HIGH] peer-reviewed/heavily reproduced, [MED] coherent preprint not yet contested, [LOW] single small-N preprint.

Bottom line up front

For a large, long-horizon, ground-truth-flag-verified CTF portfolio at a low k=1 solve rate, the honest, defensible answer will not be a single sentence. It will be: X% of the currently-failing challenges are a knowledge gap, Y% are an execution/performance-floor gap fixable by elicitation, Z% are an exploration gap that needs on-policy RL, not more demonstrations — and here is the measurement that sorted each challenge into its bucket. That heterogeneous, per-challenge-subtype verdict is itself the scientifically credible output — collapsing it into “it’s execution not knowledge” is exactly the move a skeptical reviewer will catch you on.


1. Three gap types, defined precisely

Ground the vocabulary in the 60-year-old linguistics/cognitive-science split this whole ML debate re-derives without citing: competence (what the system can in principle produce) vs. performance (what it actually produces under real constraints — prompting, memory, self-verification, time) — Firestone, “Performance vs. competence in human–machine comparisons,” PMC7604508 [HIGH], and its LLM-era instance splitting formal competence (linguistic surface mastery) from functional competence (using it in the world) — Mahowald et al., arXiv:2301.06627 [HIGH].

Gap typeCompetence/performance framingOperational testFix lever
KnowledgeCompetence ceiling — genuinely absentCorrect action never appears in any of N samples, at any N, on any checkpointInject off-policy: SFT on demonstrations, a stronger teacher, or a tool (knowledge-in-tools rule)
ExecutionPerformance floor — competence present, elicitation failsCorrect action appears at moderate–large N, but pass@1 doesn’t convert it; prompting or a few SFT demos recover itCheap: better scaffolding/prompting, or light SFT elicitation
ExplorationCoverage present before training, destroyed during trainingCorrect action was recoverable at large N pre-RL; SFT-matched-data actually regresses it; on-policy RL (not demonstrations) is what recovers/expands itOn-policy RL with explicit entropy/diversity preservation, not more SFT

The exploration gap is the one that’s easy to misdiagnose as a knowledge gap if you only look at a single snapshot: it’s a process failure (the training loop killing coverage that existed a step ago), not a static property of the base model. Section 4 below is the test that tells these two apart.

Finer-grained refinement — Gap taxonomy. That chapter refines this table’s Execution row into two sub-signatures at different granularity — macro/plan-level (R, ranked below a shallow default) and micro/decision-point (P, exposed by a different elicitation channel) — and derives them as one continuous axis, not two boxes (its §0/§2). In this chapter’s coarser vocabulary: Execution = R ∪ P. Its Knowledge gap is the same category as this chapter’s Knowledge row. Exploration here is not a fourth static bucket in either chapter — it’s what an R/P-classified failure becomes when the winning path is sequentially-gated (§2.4 below is exactly that segmentation test).


2. The core instrument: pass@k → Cover@τ → Pass@(k,T)

2.1 pass@k as a coverage probe [E]

The unbiased pass@k estimator (the one this project already uses at eval time, per decisions/2026-06-11-ctf-benchmark-pass-count.md):

def pass_at_k(n, c, k):
    """n = samples generated, c = number correct, k = budget."""
    if n - c < k:
        return 1.0
    return 1.0 - comb(n - c, k) / comb(n, k)

Sampling k completions per problem at large k and plotting the curve is, structurally, a coverage measurement — the probability mass the policy places on any correct completion. The theory for why this works: the Coverage Principle — cross-entropy loss is dominated by tokens irrelevant to correctness, but coverage (mass on high-quality responses) is necessary and sufficient for post-training / test-time scaling to succeed, and estimates faster than loss does. Chen et al., arXiv:2510.15020 [MED]. [E]

2.2 The crossover test — does RL amplify or replace? [E][N]

The core instrument. Run the base model and your trained checkpoint through the same challenge set at k = {1, 4, 16, 64, 256…}. Plot both pass@k curves.

  • Base catches up to or exceeds trained pass@k at large k → the training only reweighted an existing distribution (elicitation, not new capability). Yue et al., “Does RL Really Incentivize Reasoning Capacity Beyond the Base Model?,” arXiv:2504.13837 [HIGH] — the founding result. 6 RLVR algorithms tested; all “remain far from optimal in leveraging the base model’s potential.”
  • Trained pass@k pulls away and widens as k grows → real capability expansion.

Designed to fix a common failure: benchmarks measuring pattern-match speed, not thoroughness -> report the crossover, not just pass@1. Yue et al.’s own prescription is exactly “report pass@k at large k, with base model as control” — not just pass@1. Report base-model pass@k at the same k as a mandatory control column in every benchmark table you publish.

Contested rebuttal — CoT-Pass@K: pass@k credits a correct final answer even from a wrong chain-of-thought (a lucky guess). Require the reasoning path itself to be correct and the crossover disappears — RLVR shows monotonic gains at every k. Wen et al., arXiv:2506.14245 [MED]. State this as contested when presenting — it directly falsifies the load-bearing assumption of §2.2’s headline result. For your agent, this maps onto a real risk in your own SFT curation: a verifier-passed trajectory can still contain wrong/wasted turns before the winning one — a commonly-observed pattern where a nontrivial fraction of solves hinge on an ungrounded guess at a critical step rather than sound reasoning throughout. Filter on trajectory soundness (backtracking, wasted turns, tool-call validity), not just flag==1, or you reproduce the exact confound this paper diagnoses.

2.3 Cover@τ — punish guessing, reward reliability [E]

pass@k at huge k conflates “genuinely solvable” with “eventually guessable by brute force.” Cover@τ(q) = 1 if ≥ τ·n of n samples on problem q are correct — a reliability threshold, not a “did any sample land” threshold. Dragoi et al., arXiv:2510.08325 [MED]. Relative RLVR-algorithm rankings change under Cover@τ vs pass@1 — some algorithms that look best on pass@1 are worse at genuine reliability.

Designed to fix a common failure: high pass@k that masks guessing rather than genuine reliability (“good guessers until they’re not”) -> Cover@τ as a second axis. A challenge with high pass@64 but near-zero Cover@0.3 is guessing-dominated — rejection-sampling SFT on its lucky wins teaches the model to guess more confidently, not more competently. Report Cover@τ (τ≈0.3) alongside pass@k as a second axis in every benchmark table.

2.4 Pass@(k,T) — the agentic extension, and the single most load-bearing citation in this chapter [L][E][N]

Everything above is validated on static, single-shot reasoning (math). Your agent is T-round tool interaction. Zhai et al., “Does RL Expand the Capability Boundary of LLM Agents? A Pass@(k,T) Analysis,” arXiv:2604.14877 [MED], asks the crossover question with interaction-depth as a second axis:

PASS@(k,T)(q,π) = 1 - C(n - c_T, k) / C(n, k)

— identical to standard pass@k, except c_T counts correct at interaction depth T, not overall.

Their finding flips §2.2 on compositional tasks: on Category C (compositional, sequentially-gated information gathering — structurally identical to enumerate-then-chain vuln discovery), the RL curve pulls above and widens against the base curve as k grows — the opposite of the static-reasoning crossover. On independent-retrieval tasks the effect is small; on pure static reasoning (no tool, negative control) RL is inert, replicating Yue et al.

The critical additional result: matched-data SFT actually regresses the capability boundary on the same compositional tasks (net −4 vs RL’s net +4). This isolates self-directed exploration during RL — not data exposure — as the causal factor for expansion.

Designed to fix a common failure: uneven PTES-phase performance — agents chain well inside an exploit but stall in enumeration/reconnaissance -> compositional segmentation. Category C (“sequential retrieval”) is structurally identical to “enumerate-correctly-at-turn-5-before-turn-40’s-exploit-becomes-visible.” This is the paper that tells you where your exploration gap is likely to live on the portfolio.

The single highest-value experimental design in this chapter: segment your challenge portfolio by whether the winning path is (a) single-shot / not sequentially gated (their Cat A/B analog), or (b) genuinely compositional/sequentially-gated (Cat C analog — your “enumeration-gates-exploitation” weak spot). Run Pass@(k,T) on both segments, before and after rejection-sampling SFT. The falsifiable prediction: on (a), SFT works fine, further RL may plateau (§2.2’s static result holds — an execution gap, cheaply closed). On (b), SFT alone regresses capability and you need on-policy RL specifically — an exploration gap, not an execution gap, and rejection-sampling SFT is the wrong tool for it. This is directly testable this week and determines whether “SFT now, GRPO later” has the ordering right for the compositional subset, or whether it needs RL first.


3. Does base/SFT pass@k predict RL gains, before you spend the compute?

High SFT-stage scores are not reliably predictive of eventual RL performance — sometimes inversely so. What does predict post-RL pass@1: generalization loss on held-out examples and pass@large-k on the post-SFT checkpoint, with up to 2× better R²/Spearman correlation than post-SFT pass@1 alone. Kang et al. (Meta FAIR + Virginia Tech), “Quagmires in SFT-RL Post-Training,” arXiv:2510.01624 [HIGH] — >1M GPU-hours, hundreds of models to 12B, 7 math benchmarks, up to 256 repetitions.

Training-loop delta: add a cheap diagnostic gate between SFT and RL. Before launching a GRPO run, compute pass@64 (or larger) on your rejection-sampling-SFT checkpoint, cold-start, pdq --fresh-retries, on the held-out challenge set. If it’s flat/low, don’t trust the SFT accuracy number as a green light — this predicts a disappointing GRPO run regardless of how good SFT looked.

What changes in your graduation criterion: the project’s stated trigger is “graduate to GRPO/RLVR when policy entropy collapses.” Add a second, independent gate: AND pass@64 on held-out challenges is non-trivial. Entropy collapse tells you SFT has converged; pass@64 tells you there’s still coverage headroom worth converting. Both are needed — collapsed entropy with flat pass@64 means you’ve converged onto a policy with nothing left to reinforce.


4. The routing test — does the correct action ever appear at high N?

This is the book’s existing one-line diagnostic (see The decision), and it deserves the fuller justification here because it is doing real theoretical work, not just intuition:

  • Never, at any N, on any checkpoint → knowledge gap. This is the elicit-not-expand result again, at the boundary: RLVR only reweights mass the base model already places somewhere in its distribution — full evidence chain (Yue elicit-not-expand, SFT-memorizes/RL-generalizes, the contested Scalpel-vs-Hammer/OOD-healing pushback) in The frontier recipe is a sequence §3. Inject off-policy (demonstration, teacher, or — cheaper — put the missing fact in a tool, not the weights).
  • Sometimes, and pass@(k,T) shows RL (not matched SFT) expanding it (§2.4) → exploration gap. Coverage exists but training-time entropy collapse is what’s suppressing it turn-to-turn; the fix is on-policy RL with explicit exploration preservation, not more demonstrations.
  • Sometimes, and a few-shot prompt or a handful of SFT demos recover it (§5) → execution gap / performance floor. Cheap fix, no RL infrastructure needed.

This routing test is directly the mechanism §2.2–§2.4 give you a rigorous way to run, not just eyeball. The crossover is the “does it ever appear at high N” test, made continuous and plottable rather than binary.


5. The elicitation ladder — a borrowed, rigorous “prove it’s X not Y” methodology

The AI-safety capability elicitation literature already had to solve almost exactly this problem — “is the model bad at this, or is the capability locked away where naive prompting can’t reach it?” — because sandbagging/eval-integrity depends on the same distinction. Their protocol, adapted: build (or find) a case where you don’t yet know if the capability is present, then try elicitation techniques in escalating cost order, and whichever one first recovers the behavior tells you what kind of gap it was.

prompt / few-shot  →  SFT on a handful of demos  →  RL against a judge/verifier  →  (still nothing) → knowledge gap
   (cheapest)              (cheap)                    (expensive)
  • Password-locked models: fine-tune a model to only show a capability when a password token is present (imitating a weaker model otherwise), then test whether elicitation techniques recover it. Finding: a few high-quality SFT demonstrations are often sufficient to fully elicit a locked capability; RL can also elicit it when demos aren’t available, but less reliably. Greenblatt et al., arXiv:2405.19550 [HIGH].
  • Harder organism (circuit-breaking, not just password-locking): prompting/steering fail; only fine-tuning-based elicitation succeeds. Recommendation: “evaluators should use fine-tuning techniques to elicit capabilities when possible” — if prompting can’t get behavior out, don’t conclude the capability is absent; fine-tune first, then conclude. Hofstätter et al., arXiv:2502.02180 [MED].
  • Operational definition of real capability: what can be elicited at ≤1% of total training cost (Anthropic RSP’s own definition, directly reusable). van der Weij et al., arXiv:2406.07358 [HIGH, ICLR 2025].
  • Order matters: neither SFT nor RL alone reliably elicits held-back performance from a degenerate policy; SFT on weak demonstrations first, then RL, is what fully elicits it — RL-first “almost always leads to reward hacking rather than genuine improvement” starting from a degenerate policy. Ryd et al., arXiv:2604.22082 [MED, 2026].

Designed to fix a common failure: agents preferring raw shell/HTTP over a provided higher-level tool surface, leaving much of that surface unused — tool-selection is known to be unreliable and highly sensitive to how tools are described/exposed (Faghih et al., “Tool Preferences in Agentic LLMs are Unreliable,” arXiv:2505.18135) — -> run the elicitation ladder. This is the cheapest, most directly actionable experiment in the whole chapter. Take a handful of ignored tools and run the ladder: (a) few-shot prompting with 2–3 correct-usage examples recovers usage → pure elicitation/prompting gap, no training needed; (b) SFT on a small demonstrated-usage set recovers it → elicitation via light fine-tuning (matches Greenblatt’s finding); (c) neither works → genuinely a missing-knowledge/affordance problem, and rejection-sampling SFT should specifically upweight trajectories that exercise those tools. This turns “the model prefers curl” from an anecdote into a falsifiable, paper-backed experiment.

5.1 The wrinkle mid-episode: the self-verification cliff [E][R]

Your flag verifier is external, ground-truth, and perfect — exactly the regime where BoN/rejection-sampling/RL should work without a ceiling (Stroebl et al., “Inference Scaling fLaws,” arXiv:2411.17501 [HIGH]: with an imperfect verifier the false-positive floor is non-removable even at infinite compute; a perfect verifier has no such floor). That’s a load-bearing reason the project’s “ground-truth-verified reward, never regex” rule is correct.

But the verifier only fires at submission — at turn 40 of 100, the agent must judge without it whether its current path is worth continuing. That’s exactly the regime multiple papers show degrades, not improves, with capability: models find a correct answer among k samples far more often than they can self-select it, and the self-selection gap widens with generator capability (contested/preliminary — one 2026-06 OpenReview submission, no confirmed arXiv id, treat as [LOW], flag if cited). Corroborating, harder evidence: Best-of-N provably degrades past a reward-hacking threshold even with a competent reward model — scaling samples isn’t monotonically good. Huang et al., arXiv:2503.21878 [HIGH, ICML 2025]. Formal geometry: rejection-sampling and Best-of-N both converge to a ceiling set by the verifier’s ROC curve; more samples cannot buy past it. Dorner et al., arXiv:2507.12399 [MED].

Designed to fix a common failure: agents abandoning a viable path after a single setback rather than persisting (“good guessers until they’re not”) -> post-hoc pivot-point audit. Diagnostic, cheap, run on your existing run-trace corpus: log every point in a trajectory where the agent pivots/abandons a path, and check post-hoc whether the abandoned path was actually unproductive (e.g., did a later successful run on the same challenge use a similar path?). If abandoned paths are disproportionately ones that would have worked, that’s a self-verification-cliff signature — an execution/judgment gap, and the fix is a mid-episode progress signal, not more SFT demonstrations.


6. A two-type failure vocabulary — grounded in general agent/RL evidence, not domain benchmarks

Standing project rule: no conclusion here may rest on academic cybersecurity-LLM training/benchmark papers (CTF-Dojo-style work, pentest-agent papers, CTF-family robustness studies, etc.) — none of that literature has produced a frontier cybersecurity model. The domain-specific pentesting-agent papers below are mentioned for context only, not as a basis for anything in this chapter:

  • Deng et al., “What Makes a Good LLM Agent for Real-world Penetration Testing?,” arXiv:2602.17622 — academic, cited for context — not a basis for our decisions. (28 pentesting systems, proposes a Type A “capability gap” / Type B “planning and state-management limitation” taxonomy, and an Evidence-Guided Attack Tree Search system, “Excalibur.”)
  • Nakano et al., arXiv:2509.07939 — academic, cited for context — not a basis for our decisions. (Deterministic ATT&CK-derived task tree lifts subtask completion 13.5–16.5% → 71.8–78.6% on the same models — a pentest-benchmark result, not project evidence.)
  • Shen et al., “PentestAgent,” arXiv:2411.05185 — academic, cited for context — not a basis for our decisions. (Frames its own motivating failure as a knowledge gap fixed with RAG; illustrative only of how unsettled domain-specific pentest-agent papers are, not evidence either way.)

The two-type vocabulary itself is worth keeping — it just needs a non-domain-specific foundation. Re-grounded on general long-horizon-agent evidence and RL theory:

  • Capability/elicitation gaps — missing tools, inadequate prompts, absent demonstrations. Cheaply closed by better scaffolding, tool surface, or light SFT (§5’s elicitation ladder, itself grounded in the AI-safety elicitation literature, not domain-security work).
  • Planning/state-management limitations — a structurally different failure mode that does not reliably close with a stronger base model or more knowledge alone. Four independent, non-cybersecurity anchors support treating this as a real, separate axis — two qualitative/theoretical, two now directly quantitative:
    1. Empirical, frontier-model, general-domain: METR’s time-horizon study finds that what separates frontier models on long-horizon tasks is reliability and the ability to adapt to their own mistakes, not per-step knowledge or reasoning quality — and this axis scales on its own trajectory, doubling roughly every 7 months, independent of raw capability jumps. Kwa et al. (METR), “Measuring AI Ability to Complete Long Software Tasks,” arXiv:2503.14499 [HIGH]. This is general evidence (RE-Bench/HCAST software tasks, no cybersecurity framing) that long-horizon degradation is a distinct axis from single-turn competence — exactly the property a “Type B” needs to be a real thing and not just restated knowledge-gap.
    2. Theoretical, classic RL/imitation-learning result: compounding error under covariate shift — a policy trained/evaluated with a small per-step error rate accumulates error quadratically in trajectory length because each mistake pushes the agent into states its training distribution under-covers, and no single-step fix removes this without addressing the sequential structure itself. Ross, Gordon & Bagnell (DAgger), arXiv:1011.0686 [HIGH, 840+ citations]. This is the general-theory reason a state-tracking/replanning failure at turn 40 of 100 can be structurally invariant to swapping in a stronger base model — the problem is the sequential decision process, not the weights.
    3. Direct quantitative test, general-domain, verified 2026-07-02: isolating pure execution (plan and knowledge handed to the model, so only turn-to-turn execution is measured), larger models within the same family do execute more correct turns — but per-step accuracy still degrades as turns accumulate, driven by a self-conditioning effect (the model becomes more likely to err once its own prior mistakes are sitting in context). The paper’s own framing is exactly this chapter’s question: “self-conditioning does not reduce by just scaling the model size” — it is removed only by switching training paradigm to a “thinking”/reasoning-trained model, not by a bigger non-reasoning model of the same family. Sinha, Arun, Goel, Staab & Geiping, “The Illusion of Diminishing Returns: Measuring Long Horizon Execution in LLMs,” arXiv:2509.09677 [MED, preprint]. This is the closest thing in general literature to a direct scale-invariance test of a planning/state-tracking failure — the honest reading is invariant to parameter scale within a training paradigm, not invariant to LLM full stop (reasoning-trained models are a real escape hatch, a bigger base model of the old paradigm is not).
    4. Direct quantitative test, general-domain, verified 2026-07-02: a minimal explicit-lookahead planning module (FLARE) bolted onto a much weaker base model lets LLaMA-8B outperform GPT-4o run with standard step-by-step reasoning on multi-step planning benchmarks — i.e. an eight-billion-parameter model with a planning fix beats a frontier model without one. This is a clean existence proof that the planning axis is separable from and can dominate raw base-model strength. Wang, Wu, Wang, Tang, Li, Yin, Ma, Li, Sun, Chen & Ye, “Why Reasoning Fails to Plan: A Planning-Centric Analysis of Long-Horizon Decision Making in LLM Agents,” arXiv:2601.22311 [LOW, 0-citation preprint — promising, not yet validated].
    • Corroborating, not separately load-bearing: τ-bench’s own cross-model pass^k leaderboard (already cited above, §6.1) shows the same steep pass^1→pass^8 reliability collapse for both gpt-4o and claude-3.5-sonnet — picking the “better” frontier model of a different family narrows but does not close the multi-trial consistency gap. Yao et al., arXiv:2406.12045 [HIGH]. And a 2026 cross-family diagnostic benchmark (GPT-5 variants + Claude models, 3100+ trajectories) documents the same horizon-dependent degradation pattern recurring across both families rather than being a one-model artifact. Wang, Bai, Sun, Wang, Zhang, Hu, Schroder, Mutlu, Song & Nowak, “The Long-Horizon Task Mirage? Diagnosing Where and Why Agentic Systems Break,” arXiv:2604.11978 [MED, preprint].

Designed to fix a common failure: agents stalling in exploitation after chaining well through enumeration — a plausible instance of exactly the compounding-error dynamic DAgger formalizes: an early misstep in enumeration pushes the trajectory off-distribution, and the deeper into exploitation the agent gets, the harder recovery becomes. Actionable, cheap: label a sample of your failed trajectories on two axes — (a) missing tool / bad prompt / no demonstration → capability/elicitation gap, cheap fix; (b) over-committed to a low-value branch, exhausted context near a dead end, no real-time replanning after a costly failure → planning/state-management gap. If (b) dominates, the theoretical prediction (DAgger), the empirical general-domain finding (METR), and the two direct quantitative tests above (Sinha et al.’s self-conditioning result; Wang et al.’s weak-model-plus-planning-beats-strong-model result) all say: don’t expect SFT-then-GRPO on raw episode reward alone to close it, and don’t expect swapping in a bigger base model of the same family to close it either — the fix needs to address the sequential/compounding structure (mid-trajectory checkpointing, explicit replanning triggers, a difficulty/progress signal, or a reasoning-trained backbone), not just more knowledge or more parameters. Flag, updated 2026-07-02: the qualitative distinction (capability vs. planning/state) is now well-grounded in four independent general-literature anchors, and two of them (Sinha et al. 2509.09677, Wang et al. 2601.22311) are direct quantitative tests of “does a stronger/bigger base model fix it” in non-cybersecurity settings — both say no, for different mechanisms (self-conditioning invariant to scale; planning-fix on a weak model beats a strong model without one). What general literature does not give you is this project’s own number — no source above measured the specific fraction of this portfolio’s failures that are planning/state-management vs. capability, nor whether it holds at this project’s turn-depths (~100) and challenge structure. Status: qualitative claim grounded; quantitative “X% invariant to base LLM” is worth pursuing for your own portfolio — must be measured on your existing run-trace corpus, not assumed from the general literature or the academic pentest-agent papers above.

6.1 Per-turn fault labeling — operationalize the taxonomy on your own trace corpus [R]

τ-bench provides an auto error-identification tool with a fixed taxonomy (fault assignment × fault type: used_wrong_tool, used_wrong_tool_argument, took_unintended_action, goal_partially_completed). Yao et al., arXiv:2406.12045 [HIGH]. AgentRx extends this to an automated framework that localizes the single critical failure step in a long trajectory, with a cross-domain taxonomy (Misinterpretation of Tool Output 24.1%, Intent-Plan Misalignment 24.1%, Under-specified Intent 27.6%, per their τ-bench column). Barke et al. (Microsoft Research), arXiv:2602.02475 [MED].

Your existing run-trace corpus is exactly the substrate this tooling wants. Label each turn as {reconnaissance-adequate, wrong-tool, wrong-argument, wrong-decision/policy, tool-output-misread, under-specified-plan} and compute: fraction of episodes with a labeled “under-specified-plan” or “wrong-decision” turn before the first “tool-output-misread” — this operationalizes a commonly-observed “no clear methodology” failure into a countable metric that separates planning (execution/skill — a scaffolding or SFT-curriculum fix) from interpretation (closer to reasoning/knowledge) from tool affordance (§5’s elicitation question).


7. A robustness cross-check: is the “gain” generalization or memorization?

Domain-specific aside (context only, not a basis for the method below): Honarvar et al., arXiv:2602.05523 — academic, cited for context — not a basis for our decisions. They build families of semantics-preserving CTF variants and find models robust to shallow transforms but degrading sharply under composed/deeper obfuscation, in the CTF domain specifically; per project rule, an academic CTF-benchmark paper cannot be the basis for the method below.

The methodology stands on its own, general (non-cybersecurity) grounding: semantics-/knowledge-preserving perturbation is an established way to separate genuine generalization from pattern-matching in general LLM evaluation. C-BOD rephrases MMLU questions with a parameterized, meaning-preserving transform and finds an average 2.75% performance drop across 32 SOTA models under modest rephrasing — with higher-performing, larger models showing greater sensitivity, i.e. bigger benchmark numbers can mean more surface-cue reliance, not less. Cohen-Inger et al., “Forget What You Know about LLM Evaluations — LLMs are Like a Chameleon,” arXiv:2502.07445 [MED, EMNLP 2025]. The same logic applied to code generation: rewrite a task’s ground-truth solution into a semantically-different-but-equal-difficulty variant and check whether the model’s answer degrades — a Memorization Risk Index that’s high only when the model reproduces a similar-looking answer and fails the rewritten task. Zhang et al., “Memorize or Generalize? Evaluating LLM Code Generation with Code Rewriting,” arXiv:2503.02296 [LOW, brand-new preprint, 0 citations — promising, not yet validated].

Before crediting any pipeline change with “closing an execution gap,” check the gain isn’t an artifact of the fixed set of canonical challenges the harness has seen many times, using the same semantics-preserving-perturbation logic C-BOD and the code-rewriting paper apply outside cybersecurity.

Designed to fix a common failure: solve-rate gains that don’t survive semantics-preserving rephrasing (memorization, not generalization) -> robustness cross-check. Cheap, no new training: generate meaning-preserving transformed variants of a held-out subset (renaming, restructuring, composed obfuscation — the transform families are generic; you don’t need a domain-specific benchmark paper to justify the check) and see whether a solve-rate gain transfers. If it evaporates on transformed variants, you have elicitation/memorization, not the execution-reliability improvement the SFT/GRPO diagnosis is banking on — and per C-BOD’s finding, don’t assume your strongest checkpoints are exempt; they may be the most exposed to this failure mode.

Also check the opposite failure mode post-RL: RL-PLUS names “capability boundary collapse” — pass@k at large k dropping even as pass@1 rises during RLVR, i.e. the on-policy training itself narrowing what the model can still do, not just what it does by default. Their fix mixes in the very off-policy verifier-passed trajectories rejection-sampling SFT already produces, via importance-sampling-corrected updates. Dong et al., arXiv:2508.00222 [MED]. This is the training-time confirmatory check for an exploration gap that got worse, not better, under GRPO — run pass@large-k before and after every GRPO checkpoint, not just pass@1.


8. The honest verdict: no single standard — here is the assembled protocol

No single accepted diagnostic instrument exists that a team runs once for a clean X-not-Y verdict. What the literature convergently offers, ranked by how load-bearing each is for this project:

  1. Pass@k / Pass@(k,T) / Cover@τ curve decomposition (§2) — the closest thing to a standard quantitative instrument, but interpretation is contested even among its own authors (§2.2 vs its CoT-Pass@K rebuttal), and its agentic extension shows the diagnosis is task-structure-dependent: same metric, opposite conclusion, depending on whether the task is compositional/sequentially-gated or not.
  2. Capability-elicitation methodology (§5) — a rigorous, falsifiable, cost-ordered protocol borrowed from AI-safety evaluation, directly reusable and cheap to run against the tool-avoidance finding.
  3. Capability/planning two-type taxonomy + per-turn fault labeling (§6) — a general vocabulary grounded in long-horizon-agent measurement (METR), compounding-error theory (DAgger), and now two direct general-domain quantitative tests of scale-invariance (self-conditioning not fixed by scale, Sinha et al. 2509.09677; weak-model-plus-planning beats strong-model-without, Wang et al. 2601.22311) — not in domain-specific pentest-agent papers; the specific per-corpus “X% invariant to base LLM” number stays flagged as worth pursuing, to be measured on this project’s own corpus, not asserted from general literature.
  4. The competence/performance vocabulary (§1) to frame the final answer for a skeptical reviewer: expect and report a split verdict by challenge subtype, not a single number.

The protocol — what to actually run, in order

StepInstrumentDiscriminatesCostSection
1Segment your challenge portfolio: single-shot exploit chain vs. sequentially-gated (enumeration-gates-exploitation)Sets up steps 2–3 correctlyFree (manual/heuristic labeling)§2.4
2Pass@(k,T): base vs. rejection-sampling-SFT vs. (eventual) GRPO checkpoint, per segmentExecution gap vs. exploration gap vs. knowledge gapMedium (sampling compute, no training)§2.2–2.4
3Pass@64 on the SFT checkpoint as an RL go/no-go gate, alongside entropyWhether GRPO is worth running at allCheap (no training run)§3
4Cover@τ (τ≈0.3) alongside pass@k on every reported numberGenuine reliability vs. guessingFree (same rollouts, different aggregation)§2.3
5Elicitation ladder (prompt → few-shot → light SFT → RL) on underused tools + methodology failuresElicitation/performance-floor vs. genuine knowledge gapCheap → medium, escalating§5
6Post-hoc pivot-point audit: did abandoned paths ever succeed elsewhere?Self-verification-cliff (execution/judgment) vs. genuinely dead endFree (existing run-trace corpus)§5.1
7Capability/planning labeling + per-turn fault taxonomy on your run-trace corpusEngineering-fixable vs. architectural (test invariance-to-LLM claim on your own data, don’t assume it)Medium (manual labeling pass, or automate via AgentRx-style tooling)§6
8Semantics-preserving-transform robustness check on a held-out subsetGeneralization vs. memorizationMedium (need the transform tool)§7
9Entropy instrumentation from GRPO step 0 + pass@large-k before/after every checkpointTraining-induced exploration collapse (boundary shrinking, not growing)Free once GRPO is running§7

Report all nine together, segmented by challenge subtype. Refuse to collapse it into one sentence — §2.4 and §6 both predict, and §7’s entropy check explains a mechanism for, the true answer being heterogeneous across the portfolio.


9. The decision, expanded

flowchart TD
  Start["Failing challenge / challenge-subtype<br/>under diagnosis"] --> Seg{"Winning path structure?"}

  Seg -->|"Single-shot / independent recon<br/>(Cat A/B analog)"| PKT_AB["Pass@(k,T): base vs SFT vs RL<br/>(arXiv:2604.14877)"]
  Seg -->|"Sequentially-gated:<br/>enum must succeed before<br/>exploit is even visible (Cat C)"| PKT_C["Pass@(k,T): base vs SFT vs RL<br/>(arXiv:2604.14877)"]

  PKT_AB --> X1{"Base pass@k(large k)<br/>>= trained pass@k?"}
  X1 -->|"Yes — crossover"| Elicit1["ELICITATION only:<br/>run the ladder (§5)<br/>before assuming knowledge gap"]
  X1 -->|"No — trained pulls away"| Exec1["EXECUTION gap:<br/>rejection-sampling SFT → GRPO<br/>is the right ordering"]

  PKT_C --> X2{"Does the correct action<br/>ever appear at large N,<br/>on ANY checkpoint?"}
  X2 -->|"Never"| Know["KNOWLEDGE gap:<br/>inject off-policy<br/>(SFT / teacher / TOOL)"]
  X2 -->|"Yes — but matched-data SFT<br/>REGRESSES it (§2.4 test)"| Explore["EXPLORATION gap:<br/>on-policy RL required,<br/>NOT more demonstrations"]
  X2 -->|"Yes — few-shot prompting<br/>recovers it"| ElicitP["Performance floor:<br/>cheap prompting/scaffold fix<br/>(§5)"]
  X2 -->|"Yes — only light SFT<br/>on demos recovers it"| ElicitS["Elicitation via light SFT<br/>(arXiv:2405.19550)"]

  Elicit1 --> TypeAB["Capability vs. planning/state<br/>label the failures<br/>(arXiv:2503.14499, arXiv:1011.0686)"]
  Exec1 --> TypeAB
  Explore --> TypeAB

  TypeAB -->|"Capability: tool / prompt gap"| FixA["Engineering fix:<br/>tool surface, scaffolding,<br/>walkthrough-shaped SFT data"]
  TypeAB -->|"Planning/state: difficulty-<br/>estimation, compounding error<br/>(test invariance on own data)"| FixB["Architectural fix:<br/>difficulty-gating / attack-tree<br/>search wrapper — NOT more<br/>SFT-then-GRPO on raw reward"]

  classDef your fill:#132b22,stroke:#34d399,color:#eafaf3;
  class Exec1,Explore,TypeAB your;

This is the same routing question as The decisiondoes the correct action ever appear in π_θ’s own outputs at high N? — expanded with the two tests that make it rigorous for an agentic, T-round, sequentially-gated task instead of a single-shot one: the compositionality segmentation (§2.4) and the matched-data-SFT-regression test that separates a genuine exploration gap from a knowledge gap when coverage exists but training destroys it.


  • Gap taxonomy — the fine-grained refinement of this chapter’s three-way split: its K = this chapter’s Knowledge; its R ∪ P (one continuous axis, macro/micro sub-signatures — its §0/§2) = this chapter’s coarse-grained Execution; its “exploration gap” language names the same training-dynamics modifier this chapter’s Exploration row describes (an R/P failure on a sequentially-gated task, not a fourth static category). Canonical for the gap definitions; this chapter stays canonical for the instrumentation (pass@k/Cover@τ/Pass@(k,T)) and the fast three-way routing label.
  • The decision — the one-line version of this chapter’s routing test; this chapter is its full justification.
  • Contested edges & landmines §1 — “RL can’t create capability” is contested exactly along the lines §2.2/§2.4 draw out (recipe-dependent, not a law).
  • Agentic & multi-turn RL — where the exploration-gap fix (on-policy RL, entropy preservation) is implemented once diagnosed.
  • Imitation — SFT · distillation · rejection sampling — where the execution-gap and knowledge-gap fixes live.
  • memory/research/ (shared pool) — long-horizon.md and exploration.md research notes underlie §2.4/§7’s turn-level and entropy-collapse mechanics respectively; not re-derived here to keep this chapter’s scope to diagnosis, not fix.

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

CitationarXivConfidence
Yue et al., Does RL Really Incentivize Reasoning Capacity Beyond the Base Model?2504.13837HIGH
Wen et al., RLVR Implicitly Incentivizes Correct Reasoning (CoT-Pass@K)2506.14245MED
Dragoi et al., Beyond Pass@k: Breadth-Depth Metrics (Cover@τ)2510.08325MED
Zhai et al., Does RL Expand the Capability Boundary of LLM Agents? Pass@(k,T)2604.14877MED
Kang et al., Quagmires in SFT-RL Post-Training2510.01624HIGH
Chen et al., The Coverage Principle2510.15020MED
Greenblatt et al., Stress-Testing Capability Elicitation (password-locked)2405.19550HIGH
Hofstätter et al., The Elicitation Game2502.02180MED
van der Weij et al., AI Sandbagging2406.07358HIGH
Ryd et al., Removing Sandbagging via Weak Supervision2604.22082MED
Stroebl et al., Inference Scaling fLaws2411.17501HIGH
Dorner et al., ROC-n-reroll2507.12399MED
Huang et al., Is Best-of-N the Best of Them?2503.21878HIGH
Mahowald et al., Dissociating Language and Thought2301.06627HIGH
Firestone, Performance vs. Competence in Human–Machine ComparisonsPMC7604508 (journal, no arXiv)HIGH
Yao et al., τ-bench2406.12045HIGH
Barke et al., AgentRx2602.02475MED
Kwa et al. (METR), Measuring AI Ability to Complete Long Software Tasks — general grounding for §6’s planning/state-management axis2503.14499HIGH
Ross, Gordon & Bagnell, A Reduction of Imitation Learning to No-Regret Online Learning (DAgger, compounding error) — theory grounding for §61011.0686HIGH
Sinha, Arun, Goel, Staab & Geiping, The Illusion of Diminishing Returns: Measuring Long Horizon Execution in LLMs (self-conditioning invariant to scale) — direct quantitative grounding for §6’s scale-invariance claim2509.09677MED
Wang, Wu, Wang, Tang, Li, Yin, Ma, Li, Sun, Chen & Ye, Why Reasoning Fails to Plan (FLARE; LLaMA-8B+planning beats GPT-4o) — direct quantitative grounding for §6’s scale-invariance claim2601.22311LOW, 0-citation preprint, promising not yet validated
Wang, Bai, Sun, Wang, Zhang, Hu, Schroder, Mutlu, Song & Nowak, The Long-Horizon Task Mirage? (HORIZON; cross-family GPT-5/Claude degradation) — corroborating cross-family evidence for §62604.11978MED
Cohen-Inger et al., Forget What You Know about LLM Evaluations — LLMs are Like a Chameleon (C-BOD) — general grounding for §7’s robustness check2502.07445MED
Zhang et al., Memorize or Generalize? Evaluating LLM Code Generation with Code Rewriting — secondary grounding for §72503.02296LOW, brand-new preprint, promising not yet validated
Dong et al., RL-PLUS: Countering Capability Boundary Collapse2508.00222MED
Faghih et al., Tool Preferences in Agentic LLMs are Unreliable — general grounding for §5’s tool-avoidance claim (verified live 2026-07-02)2505.18135MED

Academic cybersecurity-LLM domain-specific work — mentioned in §6/§7 for context only, per standing project rule NOT a basis for any claim/decomposition/recipe/verdict/number in this chapter (none of these produced a frontier cybersecurity model):

CitationarXivNote
Deng et al., What Makes a Good LLM Agent for Pentesting? (Type A/B, Excalibur)2602.17622context only — §6’s taxonomy is re-grounded on METR + DAgger above
Nakano et al., Guided Reasoning / Structured Attack Trees2509.07939context only
Shen et al., PentestAgent (contested reading)2411.05185context only
Honarvar et al., Capture the Flags: Family-Based Evaluation2602.05523context only — §7’s check is re-grounded on C-BOD + code-rewriting above

Flagged, not cited as fact: “The Self-Verification Cliff” (OpenReview, 2026-06-17) — no confirmed arXiv id as of this writing. Treat as [LOW], directional-only, per §5.1.

The three gaps — knowledge · prior · policy

The question this chapter answers: your agent doesn’t do the expert thing. On a fresh challenge it fires a scattered curl or dig instead of running a recon methodology; it reaches for subfinder but never amass; and when it does run subfinder it uses the defaults, not your flag-set. Before you spend a single GPU-hour on SFT, DPO, or GRPO, you have to answer one question: which of three gaps is this? Because the three have different, non-substitutable fixes, and picking the wrong lever doesn’t just waste the run — for one of them it actively makes the model worse.

This short chapter is the map. The six chapters after it are the territory, each fully cited.

Bottom line up front

Your symptom decomposes into three candidate gaps, and the whole game is telling them apart:

GapOne-line definitionThe math signatureThe fixWrong-lever failure
K — knowledgethe fact/skill is genuinely absent: log π_ref(y*) at the floor for every rephrasing, every sampling budgetnever appears at any k, even with the answer in contextinject off-policy: CPT + knowledge-SFT, teacher distillation, or a toolRL/DPO has nothing to push on — the run is inert or, worse, trajectory-SFT teaches confabulation
R — priorthe correct action is in-support but the default distribution ranks a shallow generic action above itappears at moderate k, unreliable at k=1re-prior: cold-start SFT on expert-shaped trajectories to reshape the defaultover-inject facts it already has → forgetting, wasted compute
P — policy/preferencethe sharpest R: the model demonstrably prefers the right action under a different channel (recognition / in-context / high-k) than under default generation“knows but doesn’t act”: recognizes/selects the expert call, doesn’t generate itre-rank: on-policy DPO/KTO at the divergence point, or GRPO with a correct-action rewardcurate more knowledge it already has → nothing moves

The load-bearing fact that makes K genuinely distinct from R/P — and this is a theorem, not a heuristic — is the closed-form of every KL-regularized objective. DPO’s optimum is π*(y|x) ∝ π_ref(y|x)·exp(r(x,y)/β) arXiv:2305.18290, and RLVR is formally bounded to the base model’s support arXiv:2507.14843. Any RL or preference method can only redistribute probability mass the reference policy already assigns somewhere. If π_ref(y*) ≈ 0, the gradient has nothing to grab. That is precisely why “just RL it” fails on a knowledge gap and why the diagnosis must come before the training run.

The headline: your tool/flag failure is almost certainly a P-gap

You told me the failure is universal across frontier models — every one of them reaches for the salient tool and the default flags. That universality is itself the diagnosis: it’s a policy-prior signature, not a weak base model. Generic instruction+agentic post-training optimizes plausible general helpfulness, which sharpens the default distribution toward the single most-salient action. Expert procedure (the full tool-set, the full flag-set, a disciplined sequence) is long-tail behavior that generic RLHF under-rewards. So no lab’s post-training taught it — which reframes your fix from “get a better model” to “supply the data + reward that make expert methodology the default policy.”

Two 2026 mechanistic results make this concrete for exactly your example (both recent/low-citation — promising, not yet broadly validated — but strikingly direct):

  • Akgül et al., It’s Sparse Policy Selection, Not Capability Learning arXiv:2605.06241: RL changes only 1–3% of token positions, concentrated at high-entropy decision points, and the token it promotes is always already in the base model’s top-5 logits. Operationalized: if the correct tool/argument token sits in the base model’s top-5 at the decision step, you are in a checkable P-gap and RL/DPO is well-targeted.
  • Chen, Looking Is Not Picking arXiv:2606.16364: on real tool-call failures, per-candidate attention shows the model attends to the correct tool 80% of the time (vs 21% chance) yet still calls the wrong one. Prompt-side fixes (reordering/duplicating the tool in the schema) recover ≤23% of failures; decision-readout-layer interventions recover 59–91%. The model sees amass; it mis-picks at the readout. That’s a P-gap, and it tells you where the fix lands (the decision layer, i.e. on-policy preference/RL) — not in the knowledge.

The deep version of this taxonomy and its three-literature genealogy is in the taxonomy chapter.

The diagnosis, on one screen

You don’t guess which gap — you run a cheapest-first probe battery. The full runnable version (with numbers, pseudocode, and readouts) is Diagnosing which gap; here is the skeleton:

flowchart TD
  S["Symptom: agent won't run amass /<br/>won't use expert flags / no opening plan"] --> PK["pass@k sweep: grep 50 rollouts<br/>for the expert action (temp 0.7-1.0)"]
  PK -->|"appears sometimes"| RP["in-support → R or P gap"]
  PK -->|"never, even at k=256<br/>across ≥10 rephrasings"| ORC["in-context ORACLE probe:<br/>put the answer/flags in the prompt,<br/>re-run"]
  ORC -->|"now it does it"| Kd["was surfacing, not absent →<br/>R/P gap after all"]
  ORC -->|"still can't, even handed the answer"| K["KNOWLEDGE gap →<br/>inject (curation chapter)"]
  RP --> TOK["token-level: is the expert token<br/>in the base model's top-5?<br/>(arXiv:2605.06241)"]
  TOK -->|"yes"| P["POLICY gap →<br/>on-policy DPO / GRPO<br/>(1-3% of tokens move)"]
  TOK -->|"in-support but buried"| R["PRIOR gap →<br/>cold-start SFT re-prior"]
  classDef fix fill:#132b22,stroke:#34d399,color:#eafaf3;
  class K,P,R fix;

The two probes that carry the most weight, in plain terms:

pass@k = run the same task N times (say 50) at temperature ~0.8 and ask “does the expert action ever appear?” — score it with the unbiased estimator 1 − C(N−c,k)/C(N,k), never naïve c/k. Ever appears → in-support → R/P. Never, even at k=256 across ≥10 rephrasings → a knowledge-gap candidate. (Caveat: for pure factual recall a small k can false-positive a K-gap arXiv:2605.07153 — push k high, and on a multi-turn agent use Pass@(k,T), not Pass@k.)

in-context oracle probe = put the answer in the prompt ("expert workflow: subfinder -d T -all -recursive AND amass enum -passive -d T") and re-run. If it now executes correctly, the machinery was there and only the default policy failed to deploy it → R/P gap. If it still can’t even when handed the answer → genuine K gap. This is the single cleanest K-vs-P splitter you can run in an afternoon, no training.

The warning you already sensed: trajectory SFT amplifies an unfixed gap

Your instinct — “everyone jumps to trajectory-level [SFT]; maybe that’s been amplifying the problem” — is correct and citable. If you SFT trajectories that use knowledge the base model doesn’t actually have, you teach it to imitate the surface form of expert tool-use without the grounding: new-fact SFT rows are learned slower and, once learned, linearly increase hallucination on previously-known facts arXiv:2405.05904. Layer that on an unfixed K-gap and you manufacture a confident fabricator. The ordering rule that falls out: diagnose first → fix knowledge/prior → trajectory-SFT last. The full evidence chain is Does trajectory SFT amplify an unfixed gap?.

How to read this section

ChapterAnswers
The three gaps, definedWhat K/R/P are, the theorem that makes them real categories, and why your failure is a P-gap (mechanistic evidence)
Diagnosing which gapThe cheapest-first probe battery — pass@k, in-context oracle, logprob/recognition, top-5, spurious-reward control, Pass@(k,T), the elicitation ladder, and the CTF-as-diagnostic
What knowledge data looks likeIf it is a K-gap: README? help pages? memorize a tool list? — the graded data ladder and worked training rows
Does trajectory SFT amplify an unfixed gap?Your hypothesis, as an explicit evidence chain, and the ordering rule it implies
Matching the fix to the gapK→inject, R→re-prior, P→re-rank — the per-gap intervention + training-row shape, plus env/reward design and staged curriculum
The data-curation toolkitSelection, hard-negative mining, decontamination, coverage-gap detection — the cross-cutting data methods that feed all of the above
  • Diagnosing the gap — a scientific framework — the complementary framing (knowledge / execution / exploration gap). The mapping is exact, not a loose overlap: execution = R ∪ P — the same continuous in-support-but-mis-ranked axis this chapter’s taxonomy defines, at two granularities (R = macro/plan-level, P = micro/decision-point); exploration is not a fourth gap but a training-dynamics modifier that attaches to an R/P failure when its winning path is sequentially-gated rather than single-shot. taxonomy.md is canonical for this mapping — read it before reconciling the two vocabularies.
  • The kinds of SFT — it is the data, not the algorithm — the SFT data-shape taxonomy the curation chapters build on; its §4 (synthetic-authoring → confabulation) is the twin of trajectory-amplification.
  • The one axis that predicts everything — the on/off-policy distinction underneath every “inject vs amplify” decision here.
  • Contested edges & landmines — the elicit-vs-expand debate that most of the diagnosis rests on is genuinely unresolved; treat it as contested.

Bibliography (ids verified live in the survey pass, 2026-07-02)

arXivPaperRole hereConfidence
2305.18290DPOclosed-form support-constraint theorem — the K vs R/P lineHIGH
2507.14843The Invisible Leashformal proof RLVR is support-boundedCONFIRMED
2605.06241Sparse Policy Selection, Not Capability LearningRL moves 1–3% of tokens, all in base top-5 → P-gap signaturepromising, not yet validated
2606.16364Looking Is Not Pickingtool-selection failure is a decision-readout (P) failure, not visibility (K)promising, not yet validated
2504.13837Does RL Incentivize Reasoning Beyond the Base Model?the pass@k-crossover diagnostic (contested)HIGH
2405.05904Fine-Tuning on New Knowledge → Hallucinationstrajectory SFT amplifies an unfixed K-gapHIGH (EMNLP 2024)
2207.05221Language Models (Mostly) Know What They Knowjudgment channel diverges from generation channel → P-gapHIGH
2301.06627Dissociating Language and Thoughtcompetence/performance root of the taxonomyHIGH
2309.14316Physics of LMs 3.1 (knowledge extraction)single-mention facts are ~0% extractable → curationHIGH
2501.12948DeepSeek-R1the staged K→R→P→sharpen recipe this section maps ontoHIGH

Standing rule (all chapters in this section): no load-bearing claim rests on an academic cybersecurity-LLM training/benchmark paper — every citation is general ML/RL theory or frontier-lab evidence. The cyber running example is the motivation, not the basis.

The three gaps, defined — knowledge · prior · policy

This is the theory chapter The decision and Diagnosing the gap both assume and neither fully derives. Those two chapters give you the routing tree and the instrument battery; this one gives you the reason the tree is even a legitimate tree — why “knowledge gap” and “execution/ranking gap” are not just a convenient vocabulary but two mathematically distinct regimes with a hard boundary between them.

The question this chapter answers: when your agent reaches for subfinder and never amass, or fires nmap with default flags instead of an expert scan profile, is that because the model genuinely doesn’t know the alternative exists, or because it knows and doesn’t act on it — and how do you tell the difference in a way a skeptical reviewer can’t wave away?

Bottom line up front: there are exactly two structurally different failure regimes, not three, and the field’s “K/R/P” vocabulary names one hard boundary plus one soft one. K (knowledge) is a genuine absence — the reference policy places ≈0 probability mass on the correct behavior, in which case no amount of KL-regularized optimization (RLHF, DPO, GRPO, RLVR — all of them, provably) can get you there, because reweighting mathematically cannot manufacture mass where none exists arXiv:2305.18290. R (prior) and P (policy/preference) are not two separate gaps — they are one continuous axis, “in-support but mis-ranked,” with two diagnostic sub-signatures that happen to have gotten separate names. For your running example: the agent’s macro failure — no opening recon methodology, a scattershot curl/dig instead of an expert plan — is the R-flavored signature (a coherent plan exists somewhere in the sampling distribution, just outranked by a shallow default). The agent’s micro failures — reaching for subfinder and never amass, nmap with stock flags instead of an expert profile — are the P-flavored signature, and there is now direct mechanistic evidence for exactly this claim: the correct tool is attended-to 80% of the time and the correct token sits in the top-5 logits, yet default decoding still emits the wrong one arXiv:2606.16364, arXiv:2605.06241. The tool/flag failure is a P-gap. And critically — this pattern is universal across frontier model families, which is itself evidence about which gap you’re looking at, not just a curiosity (§4.3 below).

A note on vocabulary, before you go further. The decision and Diagnosing the gap use a three-way “knowledge / execution / exploration” (or “knowledge / execution / ranking”) split, aimed at routing you to a training method fast. This chapter’s K/R/P split is a refinement of the same territory at higher resolution, not a competing taxonomy: their “knowledge gap” is this chapter’s K; their “execution gap” and “ranking gap” are both instances of this chapter’s single R/P axis, distinguished by which diagnostic sub-signature fires (§2.4); and their “exploration gap” is what you get when an R-flavored failure turns out to be sequentially-gated rather than single-shot (§6 works through exactly this case for F1). Use the practitioner’s three-way split day-to-day; come back to this chapter when you need to defend why a given failure was routed where it was, or when a failure doesn’t cleanly fit either “execution” or “ranking” and you need the finer axis to say why.


1. Genealogy — three literatures, one convergence point

The K/R/P split feels like it should come from one canonical RL paper. It doesn’t. It’s the convergence point of three independent lines of work that were solving three different problems and only recently discovered they were describing the same boundary.

flowchart TD
  L1["Line 1 — linguistics → LLM eval<br/>competence vs performance<br/>(Chomsky 1965, imported by<br/>Mahowald et al. 2301.06627)"]
  L2["Line 2 — control-as-inference<br/>→ RLHF/DPO theory<br/>(Levine 1805.00909,<br/>Ziegler 1909.08593,<br/>DPO 2305.18290)"]
  L3["Line 3 — AI-safety<br/>capability elicitation<br/>(Greenblatt 2405.19550,<br/>van der Weij 2406.07358)"]

  L1 -->|"gives the VOCABULARY:<br/>'does it know' vs 'does it show'"| CONV["2025-2026 RLVR pass@k<br/>crossover debate —<br/>the empirical battleground"]
  L2 -->|"gives the THEOREM:<br/>KL-regularized RL can only<br/>reweight existing support"| CONV
  L3 -->|"gives the PROOF METHOD:<br/>engineered ground-truth organisms,<br/>watch which intervention recovers it"| CONV

  classDef your fill:#132b22,stroke:#34d399,color:#eafaf3;
  class CONV your;

Line 1 — linguistics → LLM eval methodology. Chomsky’s 1965 competence/performance distinction (pre-arXiv) was imported wholesale into LLM evaluation by Mahowald et al., Dissociating language and thought in large language models arXiv:2301.06627 [HIGH, 200+ citations]: formal linguistic competence (grammar/pattern knowledge — LLMs are surprisingly strong here) is dissociable from functional competence (using language to reason/act in the world — LLMs are spotty, and it’s the axis that needs fine-tuning or external scaffolding to close). Hu & Frank operationalize the same move quantitatively as a “task-demand gap” — measured performance = f(true competence, task-execution-demands) — and show a chunk of what looks like a competence deficit in smaller LMs is actually an artifact of the auxiliary demands a task imposes on top of the core skill being measured arXiv:2404.02418 [MED, COLM 2024]. This line hands you the methodology: before any RL-specific vocabulary existed, there was already a rigorous way to ask “does it know” separately from “does it show.”

Line 2 — control-as-inference / RLHF theory: the load-bearing theorem. Levine’s control-as-inference tutorial arXiv:1805.00909 [HIGH] proves that the optimal soft-RL policy is a reference-weighted Boltzmann posterior — reward doesn’t replace the reference dynamics, it reweights them. Ziegler et al. operationalized this exact posterior as the KL-anchored RLHF objective used to fine-tune LMs arXiv:1909.08593 [HIGH]. Rafailov et al.’s DPO made it algebraic and closed-form: π*(y|x) ∝ π_ref(y|x)·exp(r(y)/β), and the implicit reward is literally β·log[π(y|x)/π_ref(y|x)] arXiv:2305.18290 [HIGH]. This is the theorem the whole taxonomy rests on — §3 below derives it in full and states exactly why it draws a hard line between K and everything else.

Line 3 — AI-safety capability elicitation: the empirical proof method. Greenblatt et al.’s password-locked models arXiv:2405.19550 [HIGH, NeurIPS 2024] trained a model to imitate a weaker model unless a password token is present, then showed the hidden capability is recoverable from a handful of SFT demonstrations, sometimes RL alone. van der Weij et al. named the adversarial framing directly: sandbagging — frontier LMs can be prompted or fine-tuned to strategically underperform, and it generalizes to held-out benchmarks arXiv:2406.07358 [HIGH]. This line gives you the proof method: build (or find) a case where you know the capability is present — you put it there — and watch which class of intervention recovers it. That’s exactly the diagnostic posture this book needs, applied to a model whose true capability state you don’t already know.

Hofstätter et al.’s Elicitation Game sharpens Line 3 in a way that turns out to matter directly for the P definition below: prompting alone fully elicits hidden capability on MCQA/recognition-shaped tasks (both password-locked and circuit-broken model organisms), but fails on open-ended/code-generation tasks — there, only fine-tuning-based elicitation works arXiv:2502.02180 [HIGH, ICML 2025]. That is a format-dependent reliability finding about elicitation technique, but read it the other way and it’s a direct empirical demonstration that a recognition channel and a generation channel really can hold different amounts of the same capability — which is precisely the axis §2’s P-gap definition formalizes. Tool-call synthesis is generation-shaped, not MCQA-shaped, which is the reason a negative prompting-only probe on a tool-use failure is weak evidence of a true ceiling — you need the fine-tuning-based (or at minimum the forced-choice/logprob) probe before trusting a negative result.

These three lines meet at the 2025-2026 RLVR pass@k-crossover debate — “does post-training reweight-only, or does it sometimes manufacture new support?” — which is why §6 below spends real time on it: it’s the empirical battlefield where the theorem from Line 2 gets stress-tested against real training runs.


2. The definitions, grounded in the math

All three definitions are stated in terms of the reference policy π_ref — the checkpoint you’re about to train from (base model, or the SFT/cold-start checkpoint, depending on where in the pipeline you’re diagnosing). This matters: a gap diagnosed against the base model can be a different gap once diagnosed against your SFT checkpoint, because SFT itself moves π_ref.

GapFormal conditionDiagnostic signatureFix lever
K — knowledgelog π_ref(y*|x) → −∞ (or numerically indistinguishable from the sampling floor) for all x in the equivalence class of the query, at any sampling budgetCorrect action never appears, at any N, on any rephrasingInject off-policy: SFT on demonstrations, a stronger teacher, or — cheaper — put the fact in a tool
R — priorlog π_ref(y*|x) finite and non-trivial — in-support — but ranked below a shallow/generic default under the model’s own open-ended sampling distributionDistributional plateau: pass@k rises and saturates well above pass@1 as k growsOn-policy reweighting: rejection-sampling SFT, on-policy DPO, GRPO
P — policy/preferenceThe sharper form of R: the model demonstrably prefers y* under a different elicitation channel (MCQ/recognition, in-context oracle, high-k sampling, forced-logprob) than under default open-ended generationExplicit recognition/generation divergence: MCQ or oracle-injection accuracy ≫ default-generation accuracySame lever as R — but often cheaper, since the target is closer to a single decision-readout fix than a distributional shift

K — the genuine absence

Allen-Zhu & Li’s Physics-of-Language-Models series gives the sharpest formal grounding available for what “genuinely absent” means, and it comes with a trap built in. A fact can be perfectly stored in the weights (probeable via linear probing or gradient-based extraction) yet 0% extractable via QA unless the pretraining corpus contained diverse paraphrases of it — storage and extractability are different properties arXiv:2309.14316 [HIGH, seminal]. Storage itself is capacity-bounded at roughly 2 bits/parameter, an information-theoretic ceiling that further tightens with data quality arXiv:2404.05405 [HIGH, ICLR 2025 Spotlight] — this is a hard limit on how much niche knowledge fine-tuning can inject into a small model, full stop, independent of training recipe. Kandpal et al. tie extractability directly to pretraining frequency: QA accuracy on a fact correlates causally with how many pretraining documents mentioned the relevant entities, and retrieval-augmentation closes the gap far more cheaply than parameter scaling arXiv:2211.08411 [HIGH, seminal].

The trap: even perfectly stored and extractable knowledge fails at manipulation — classification, comparison, inverse-search — and inverse search specifically sits near 0% regardless of prompting unless chain-of-thought is used at both train and inference time arXiv:2309.14402 [HIGH, seminal]. This looks exactly like a K-gap from the outside (the model “can’t do it,” 0% no matter how you ask) but is structurally closer to an R-gap — the raw fact has non-trivial log π_ref, it’s the composition that’s mis-ranked or missing a reasoning scaffold. Don’t classify a failed inverse-direction query as K without checking the forward direction first.

R — in-support, mis-ranked

The support-constraint theorem (derived in full in §3) is what makes R a fixable-by-reweighting category rather than a euphemism for K. DPO’s closed form is the seminal statement arXiv:2305.18290 [HIGH]; Wu et al. formalize the identical constraint specifically for RLVR — verifiable-reward RL cannot sample a completion with zero initial probability under the reference policy, full stop, algebraically arXiv:2507.14843 [MED]; Ni et al. add the GRPO-specific mechanism, proving the group-normalized-advantage update is a provably conservative reweighting operation — bounded in how far it can shift mass per step, not just directionally reweight-only arXiv:2510.15990 [MED]. Together these three are why “reweighting within existing support is what KL-regularized RL/preference optimization is mathematically built to do” is not a hand-wave — it’s a proven property of the objective class.

P — the sharper, channel-divergent form

Kadavath et al.’s Anthropic result is the seminal proof that a “judgment” channel can diverge from a “generation” channel: models trained to output P(True)/P(IK) (probability they know the answer) before attempting a task are well-calibrated on MCQ/self-eval even when their own default open-ended generation gets it wrong arXiv:2207.05221 [HIGH, seminal]. Cao et al.’s 2026 follow-up makes it current and concrete: models carry a usable pre-generation confidence signal that predicts eventual success, but default decoding simply doesn’t consult it arXiv:2605.14186 [LOW — very recent, promising, not yet validated]. Hofstätter et al.’s MCQA-vs-open-ended elicitation split, above, is the format-level version of the same claim arXiv:2502.02180 [HIGH]. This is the P signature: not “is y* in the sampling distribution somewhere” (R already answers yes) but “does a different elicitation channel recover it when default generation doesn’t.”

A worked, illustrative walkthrough — not measured data

To make the three rows of the table concrete before the theorem derivation, here’s how the same decision — “which recon tool to invoke first” — would read out under each regime, as a walkthrough of what the numbers would look like, not as data from any cited paper:

K-gap read (illustrative):
  log pi_ref("amass enum -active -d target.com" | context)  ~  numerical floor
  MCQ forced-choice(subfinder vs amass)                       ~  chance (no separation)
  -> amass's *expert invocation syntax* is essentially absent from the distribution

R-gap read (illustrative) — this is F1, the missing recon PLAN:
  log pi_ref(scattered curl/dig opening | context)   >   log pi_ref(structured PTES-style opening | context)
  but sampling k=64 surfaces a coherent methodology in a non-trivial fraction of rollouts
  -> the plan is in-support, just outranked at k=1

P-gap read (illustrative) — this is F2/F3, subfinder-not-amass and default-not-expert-flags:
  log pi_ref("amass" | context)  is within the top-5 tokens at the decision point
  MCQ forced-choice(subfinder vs amass)  strongly prefers amass
  default open-ended generation  still emits subfinder
  -> the readout step, not the distribution, is where the failure lives

The point of laying it out this way is that K, R, and P aren’t three qualitatively different kinds of brokenness — they’re three different readouts of the same underlying quantity, log π_ref(y*|x) and its rank, at increasing resolution: does it exist at all, is it ranked below a default, and does a different channel expose a preference the default channel hides. §3 derives why that quantity is the one that matters.

Two ways to misclassify a gap, and why they’re not symmetric

The definitions above are precise, but two specific failure modes account for most of the misclassifications in practice, and they pull in opposite directions:

TrapWhat it looks likeWhy it’s actually the other gapGrounding
Manipulation masquerading as KA forward query works (log π_ref finite, extraction succeeds); the inverse or comparison form of the same fact fails at ~0% no matter how you prompt it — reads exactly like “the model doesn’t know this”The raw fact is in-support; what’s missing is the reasoning scaffold (chain-of-thought at train and inference time) needed to compose it into the queried direction. Fix with reasoning-shaped data, not more raw-fact exposurearXiv:2309.14402 [HIGH]
Rare-but-present recall masquerading as Kpass@k stays near-zero out to a moderate k (16, 64) on a closed-book factual-recall query — reads exactly like “not in the distribution at all”The correct token can sit in an astronomically low-probability tail rather than being genuinely absent; a longer RL run measurably promotes it (~27% relative recall gain) by moving it into the greedy-decode slot — a real but very-low-rank R-gap, not KarXiv:2605.07153 [MED]

Both traps share a structure: a cheap, low-k or single-channel probe returns a false “K” verdict because the probe’s resolution wasn’t fine enough to find mass that’s genuinely there but deeply buried or structurally locked behind a missing reasoning step. This is the concrete argument for why the ladder in Diagnosis escalates through multiple probes before concluding K rather than accepting the first negative result — a single null probe is never sufficient on its own to place a failure in the off-policy-injection branch of The decision.

R and P are one continuous axis, not two boxes

The field has not converged on where R stops and P starts. Treat them as one continuous “in-support-but-mis-ranked” axis with two diagnostic sub-signatures, and use both running-example failure modes as the worked illustration, because they sit at genuinely different points on that axis:

  • F1 — no opening recon methodology (macro, R-flavored). The agent fires a scattered curl http://target/ / dig target instead of a structured PTES-style recon sequence. This is a plan-level failure — there’s no single wrong token, there’s a wrong overall shape. The diagnostic signature is distributional plateau: sample the base/reference policy at k=16, 64, 256 on the same opening move, and a coherent methodology shows up somewhere in the tail, just consistently outranked by the shallow default at k=1. That’s R in its purest form — the correct plan is in-support, it’s mis-ranked against a more probable generic-troubleshooting default.
  • F2/F3 — reaches for subfinder never amass, default not expert flags (micro, P-flavored). This is a single-decision-point failure — one token (or a short span) at one specific place in the trajectory. The diagnostic signature is explicit recognition/generation divergence: force a choice between subfinder and amass via MCQ or forced-logprob at that exact decision point, and the model picks correctly at a rate wildly higher than its own default-generation rate. §4 below gives the direct mechanistic evidence for this exact claim.

Both are “in-support but mis-ranked.” What differs is the granularity of the readout — a whole-plan ranking problem (R) versus a single-token decision-readout problem (P) — and that granularity difference is precisely what determines which cheap probe catches it first (pass@k sweep for F1-shaped failures; forced-choice/logprob-rank check for F2/F3-shaped failures). The full probe battery that operationalizes this — in order, cheapest first — lives in Diagnosis; this chapter’s job is only to establish that the axis is real and continuous, not to hand you the runbook.

flowchart LR
  subgraph SUPPORT["Where does π_ref(y*|x) sit?"]
    Y0["≈0 across every rephrasing,<br/>every sampling budget"]
    Y1["finite, non-trivial,<br/>ranked below a shallow default"]
    Y2["finite, and RECOGNIZED under a<br/>different elicitation channel<br/>(MCQ / oracle / forced-logprob)"]
  end

  Y0 --> K["K — KNOWLEDGE GAP<br/>nothing for KL-regularized<br/>RL/preference to reweight onto"]
  Y1 --> RP["R/P — ONE continuous axis:<br/>'in-support but mis-ranked'"]
  Y2 --> RP

  RP -->|"sub-signature 1: distributional<br/>plateau (pass@k rises w/ k)<br/>— your F1: no opening plan"| R["lean R —<br/>plan-level ranking fix"]
  RP -->|"sub-signature 2: explicit<br/>recognition/generation divergence<br/>— your F2/F3: subfinder-not-amass"| P["lean P —<br/>token-level readout fix"]

  classDef your fill:#132b22,stroke:#34d399,color:#eafaf3;
  class R,P your;

3. The load-bearing theorem — why K vs R/P is a real, checkable line

This is the derivation, not just the citation. It’s what makes the taxonomy falsifiable rather than a vibe.

Step 1 — control-as-inference. Frame RL as probabilistic inference over an “optimality” variable: the optimal policy under a KL-regularized objective is a Boltzmann-weighted posterior over the reference dynamics — reward doesn’t replace π_ref, it tilts it arXiv:1805.00909 [HIGH].

Step 2 — operationalized as the RLHF objective. maximize E_y~π[r(y)] − β·KL(π ‖ π_ref) has the exact closed-form solution π*(y|x) ∝ π_ref(y|x)·exp(r(y)/β) arXiv:1909.08593 [HIGH]. Every KL-anchored post-training objective in current use — PPO/RLHF, GRPO/RLVR, DPO and its whole family — is solving for a version of this exact posterior, whether or not it ever instantiates a reward model.

Step 3 — DPO makes it algebraic. Invert the closed form: r(y) = β·log[π*(y|x)/π_ref(y|x)] + β·log Z(x). The implicit reward is literally the log-ratio between the trained and reference policy. Fitting a Bradley-Terry loss directly on this log-ratio — the partition function Z(x) cancels between a chosen/rejected pair sharing the same prompt — gives the DPO loss, no separate reward model, no RL loop, but mathematically the identical constrained optimum arXiv:2305.18290 [HIGH].

# The Boltzmann posterior every KL-regularized post-training objective converges to:
# pi_star(y|x) is proportional to pi_ref(y|x) * exp(r(y) / beta)

# DPO inverts this for the implicit reward — no reward model needed:
# r(y) = beta * log(pi_star(y|x) / pi_ref(y|x)) + beta * log(Z(x))

# The load-bearing consequence — this is the whole chapter in five lines:
if pi_ref(y_star, x) == 0:               # or underflow-indistinguishable from the float floor
    pi_star(y_star, x) == 0              # for ANY finite r(y_star) — reward cannot rescue zero mass
    # KL(pi_star || pi_ref) -> +inf the instant pi_star assigns positive mass where
    # pi_ref assigns exactly zero. The objective doesn't merely fail to reach y_star —
    # it is mathematically FORBIDDEN from doing so while remaining KL-finite.

This is the reason K vs R/P is a real, checkable category and not a matter of taste. If π_ref(y*|x) ≈ 0, there is nothing to push on. No amount of preference optimization, no amount of verifiable-reward RL, no clever reward shaping changes this — it’s a structural property of the objective class, not an optimization difficulty you could someday out-compute.

RLVR-specific formalization, not just DPO’s. Wu et al.’s Invisible Leash proves the identical support constraint holds for RLVR (GRPO-style binary-correctness-reward RL): it cannot sample a completion with zero initial probability under the reference policy arXiv:2507.14843 [MED]. Ni et al. sharpen this specifically for GRPO’s group-normalized advantage estimator: the update is provably a conservative reweighting operation, bounded per-step, not just directionally constrained arXiv:2510.15990 [MED]. So the theorem isn’t specific to DPO’s closed form — it’s a property of the whole KL-regularized family, RLVR included, which is exactly the family your GRPO stage lives in (Reinforcement — PPO · GRPO · RLVR).

What to actually run before you spend RL compute. Teacher-force the target completion y* through the reference checkpoint and read log π_ref(y*|x) and its rank among alternatives at the decision-token position — this is a single forward pass, no sampling, no training run. Near the numerical floor across ≥10 rephrasings of the prompt → you are in K-gap territory and no RL budget will fix it; go curate data. Finite and non-trivial → you’re in R/P territory, and every method in the KL-regularized family is mathematically available to you. This is the cheapest possible instance of the probe battery in Diagnosis — run it before anything else.

From the closed form to a training loss — DPO makes the theorem operational

It’s worth seeing the last algebraic step explicitly, because it’s the step that turns “reward is a reweighting of π_ref” from a fact about the optimum into a loss you can actually run. Take the inverted closed form from Step 3 and plug it into a Bradley-Terry preference model over a (chosen, rejected) pair sharing one prompt:

# Implicit reward per DPO's inversion of the Boltzmann posterior:
r(y | x) = beta * log(pi_theta(y | x) / pi_ref(y | x))        # + beta*log Z(x), which cancels below

# Bradley-Terry probability that y_chosen is preferred to y_rejected:
P(chosen > rejected) = sigmoid(r(chosen) - r(rejected))
                      = sigmoid(beta * [ log(pi_theta(chosen)/pi_ref(chosen))
                                        - log(pi_theta(rejected)/pi_ref(rejected)) ])

# DPO loss — no reward model, no RL loop, Z(x) cancelled algebraically:
loss = -log_sigmoid(beta * (lr_chosen - lr_rejected))
# where lr_y = log pi_theta(y|x) - log pi_ref(y|x)   for y in {chosen, rejected}

Notice what this loss can and cannot do to pi_theta(chosen). It can raise lr_chosen relative to lr_rejected — that’s a ratio against pi_ref, and the ratio is only informative where pi_ref(chosen) > 0 to begin with. If pi_ref(chosen) ≈ 0 (the K-gap condition), log(pi_theta(chosen)/pi_ref(chosen)) is either undefined or an enormous number driven entirely by the denominator underflowing — the loss has no stable signal to climb, and in practice this is exactly the regime where DPO training on a K-gap pair produces degenerate, off-distribution completions rather than the intended fix (a known, separate failure mode called likelihood displacement — pushing chosen up can drag unrelated high-probability completions down when the pair isn’t genuinely in-support; see Interventions per gap for the sanity gate this motivates). The loss is doing exactly what §3’s theorem predicts: real, useful gradient where pi_ref already has mass; nothing coherent to climb where it doesn’t.

The same frame applied to GRPO — where the “1-3% of tokens” claim comes from

GRPO drops the separate reward model and the pairwise comparison, but it’s solving the identical constrained problem with samples instead of an algebraic inversion:

# GRPO — sample N completions per prompt from the CURRENT policy (on-policy, by construction):
resps = [pi_theta.generate(prompt) for _ in range(N)]
rewards = [verifier(r) for r in resps]                    # ground-truth, e.g. flag correctness
advantage = [r - mean(rewards) for r in rewards]           # the group mean IS the baseline — no critic
# PPO-style clipped update pushes log-probability of high-advantage tokens up,
# low-advantage tokens down — but the update is bounded by the PPO-clip range
# AND by how much mass pi_ref (this step's rollout distribution) already assigned nearby.

Because every rollout in the batch is sampled from π_θ itself, GRPO can only ever reweight tokens it already sampled with non-trivial probability — which is exactly Ni et al.’s formal result that the group-normalized advantage update is a provably conservative reweighting operation, bounded per step arXiv:2510.15990 [MED]. It’s also the direct mechanism behind Akgül et al.’s empirical “1-3% of token positions, always top-5” finding arXiv:2605.06241 [LOW, promising] — the update can only touch positions where a sample actually landed with meaningful probability, and by construction that’s a small, high-entropy subset of all positions, drawn from a token’s existing short-list of likely continuations. §4 develops this into the mechanistic case for the running example.


4. Mechanistic evidence for the running example — the tool/flag failure is a P-gap

Two 2026 papers give near-direct mechanistic confirmation for exactly F2/F3’s shape: “agent reaches for one salient tool, uses default not expert args.”

4.1 Sparse, top-5-bounded correction

Akgül et al. find that only 1–3% of token positions change under RL, concentrated at high-entropy decision points — and, critically, the token RL promotes is always already in the base model’s top-5 logit alternatives arXiv:2605.06241 [LOW — very recent, low citation count, promising, not yet validated]. This gives you a literal, checkable number: if the correct tool/arg token sits in the base model’s top-5 at the decision point, you are in a checkable P-gap regime, and you should expect any fix (RL, DPO, or a lighter steering intervention) to touch a tiny fraction of the model’s behavior — this is not a “relearn the tool surface” problem, it’s a “nudge one decision” problem.

4.2 Attends-correctly-but-picks-wrong

Chen’s Looking Is Not Picking is more direct still, and the methodology is worth walking through because it’s what makes the claim mechanistic rather than just behavioral. On real BFCL tool-call failures — cases where the model, given a schema of candidate tools and a task, calls the wrong one — the paper decomposes the forward pass into two separable stages: (1) an attention/localization stage, measured as per-candidate attention mass over the tool-schema tokens, and (2) a decision/readout stage, the final projection that turns the model’s internal state into the emitted tool-call token. Per-candidate attention shows the model attends to the correct tool 80% of the time (vs. 21% chance under a uniform baseline) — it is under-attended in only ~10% of failures — yet the model still calls the wrong one on the majority of these cases arXiv:2606.16364 [LOW — very recent, single-author preprint, promising, not yet validated]. That decomposition is the whole argument: if the failure were localization (the model never “looked at” the right tool), that would look a lot like a K/R-flavored breadth problem — the correct option simply isn’t salient enough to reach. Instead the correct option is salient — attended to at 4× chance rate — and the failure is downstream of that, in the mapping from “attended-to” to “emitted.”

The intervention data confirms the decomposition rather than just illustrating it. Prompt-side fixes — reordering the tool schema so the gold tool appears earlier, or duplicating it to increase its salience — target the localization stage and recover ≤23% of failures, consistent with localization already being mostly fine (there’s not much headroom left to buy there). Interventions that instead target the decision-readout layer — the late projection/classification step, intervened on directly rather than through the prompt — recover 59–91% of failures.

Intervention targetMechanismFailure recoveryWhat it implies
Prompt-side (reorder/duplicate gold tool in schema)Boosts localization/salience≤23%Localization wasn’t the bottleneck — little headroom left there
Decision-readout layer (direct intervention)Targets the attended-to → emitted mapping59–91%The bottleneck is the readout step — exactly the P-gap signature

That 23%-vs-59–91% spread is about as direct a proof as exists in the current literature that “picks the salient-not-expert tool” is a readout/decision failure (P), not a visibility/knowledge failure (K). It proves it by showing where the fix actually lands.

Put together: F2/F3 is not “the model doesn’t know amass exists” — it’s attending to the right region of its own knowledge and still emitting the wrong token at the readout step. That is the textbook P-gap signature, and it means the fix lever is a decision-level nudge (on-policy DPO on tool-choice pairs, or a light GRPO pass rewarding the expert choice), not a data-injection campaign to teach the model what amass is.

4.3 Cross-model universality as evidence, not just an observation

The running example states this failure is universal across frontier models — every family in a typical benchmark roster reaches for the same salient tool and the same default flags. That universality is itself diagnostic, and it’s worth stating the logic explicitly rather than treating it as a curiosity.

If this were a genuine K-gap, you’d expect it to vary by pretraining corpus and architecture — different labs curate different data mixes, so an idiosyncratic capacity/storage limitation should show up idiosyncratically. Instead the failure is shared across independently-trained frontier families. The more parsimonious explanation, consistent with Kandpal et al.’s frequency-correlation finding that extraction accuracy tracks how often entities co-occur in pretraining text arXiv:2211.08411 [HIGH], is a shared prior baked into the overlapping web-scale pretraining distribution every frontier lab trains on: subfinder-style one-shot recon tools and default-flag invocations are simply far more represented in blog posts, Stack-Overflow-style answers, and tool READMEs than amass’s fuller feature set or an expert scan profile, and every lab’s corpus draws from broadly the same internet. This is a reasoned extension of the theorem plus the frequency-correlation evidence, not a separate paper’s direct finding — flag it as such — but it is a genuinely useful, falsifiable heuristic: a failure that’s universal across independently-trained frontier families is evidence for a shared distributional prior (R/P), not evidence for a per-model capacity ceiling (K), and it’s a cheap first read to run before committing to the full probe battery.

What this changes about your intervention. If the diagnosis holds, the fix is not “teach the model what amass is” (it already knows — every frontier family does) — it’s “change which of the two already-known options the readout step selects, at the specific decision point where they compete.” That’s a data-curation problem for on-policy preference pairs (chosen = amass invocation, rejected = subfinder-only, sampled from the model’s own rollouts at that decision point), not a knowledge-injection problem. The concrete recipe for building that pair set lives in Interventions per gap; this chapter’s job is only to establish why that’s the right category of fix.


5. The generation–verification gap — an orthogonal axis

K/R/P all answer one question: can the model produce the right answer? There’s a second, genuinely orthogonal question that matters independently for any pipeline that leans on the model’s own outputs to bootstrap further training (rejection sampling, STaR-style loops, RLAIF): can the model tell right from wrong once something has been produced?

Song et al. formalize this as the generation-verification gap: pass@N coverage minus self-verification accuracy, on the same problem set arXiv:2412.02674 [HIGH, ICLR 2025 Oral]. This quantity scales monotonically with pretraining compute and bounds how much any self-improvement loop can gain — a model can have excellent K/R/P properties (the right answer is reliably produced somewhere in its sample distribution) and still have a wide generation-verification gap (it can’t reliably pick the right one out of its own samples), and the two properties can diverge in either direction.

This matters for your running example at a specific, practical seam: the flag verifier is external, ground-truth, and only fires at submission time. Mid-episode — at turn 40 of 100 — the agent has to judge without the verifier whether its current path is worth continuing. That’s a self-verification judgment, not a generation judgment, and it’s governed by this orthogonal axis, not by K/R/P. A model can have zero K-gap and zero P-gap on “which tool to use next” and still make a bad mid-episode continue/abandon call because its self-verification is weak relative to its generation.

Contested, and worth stating as contested rather than settled. The intuition that “verification is easier than generation” is rooted in scalable-oversight/debate theory — the founding argument that a weaker verifier can still adjudicate a stronger generator’s claims if the claims are checkable arXiv:1805.00899 [HIGH, seminal]. It is not universal. West et al.’s Generative AI Paradox documents cases where models are worse verifiers than generators on the same items, driven by an acceptance bias toward the model’s own (or plausible-looking) output rather than genuine discrimination arXiv:2311.00059 [MED]. Treat the direction of the generation-verification gap as task-dependent, not a law:

“Verification easier than generation” holdsDirection can flip
RegimeCheckable, structured domains with a crisp correctness criterion (math proofs, code with tests, debate-style adversarial checking)Open-ended / subjective domains, or any setting with an acceptance-bias toward plausible-looking output
GroundingarXiv:1805.00899 — debate theory; most self-improvement literature assumes this directionarXiv:2311.00059 — Generative AI Paradox, models sometimes worse at verifying than generating
Relevance to your agentEnd-of-episode flag check — the external verifier is exactly this regime, and it’s why the project’s ground-truth-verified-reward rule is theoretically sound, not just a convenienceMid-episode “is this path still worth it” judgment — no external verifier fires here, and there’s no guarantee the model’s self-verification is the easy direction

Don’t assume a model that solves your challenges reliably is equally reliable at telling you, mid-trajectory, whether it’s on a dead path — that’s a different channel than the one measured by solve rate, and per the table above its reliability isn’t guaranteed by the solve rate being high. The self-verification-cliff mechanism this connects to on the agentic-execution side is developed fully in Diagnosing the gap §5.1; this section’s job is only to place it correctly as orthogonal to K/R/P, not to re-derive the mid-episode diagnostic.


6. The contested debate — does RL ever expand the boundary, or only reweight?

Everything in §3 says KL-regularized optimization can only reweight existing support. The empirical debate over how narrow that reweighting really is in practice — whether it’s ever indistinguishable from genuine capability expansion — is the single most contested thread in this literature, and it matters directly for whether F1 (the recon-methodology gap, R-flavored) is cheaply fixable by rejection-sampling SFT + light RL, or needs a heavier on-policy exploration recipe.

  • Yue et al. — the founding result arXiv:2504.13837 [HIGH, NeurIPS 2025 oral]. At large sampling budgets (pass@256+), un-RL’d base models match or beat RLVR-trained checkpoints on static math/code — RLVR raises pass@1 by resampling paths already in the base model’s support, it does not expand the reasoning boundary. This is the empirical anchor for the theorem in §3.
  • ProRL — the direct counter, for one specific recipe arXiv:2505.24864 [MED, NVIDIA]. Prolonged RL with explicit KL-divergence control, periodic reference-policy resets, and diverse tasks uncovers reasoning strategies inaccessible to the base model under any sampling budget tried. This doesn’t contradict §3’s theorem — it’s evidence that “reference policy” is not static across a long, reset-punctuated training run, so the support boundary itself can shift over the course of prolonged training even though no single KL-regularized step can violate it.
  • CoT-Pass@K — a metric-level rebuttal arXiv:2506.14245 (cited in the source survey narrative; not independently re-confirmed against arxiv.org in this ledger pass — treat as a live but unconfirmed thread). Argues naive pass@k credits a correct final answer even from a broken reasoning chain (a lucky guess), and once you require the reasoning trace itself to be correct, the crossover disappears — RLVR shows monotonic gains at every k. If this holds, it directly falsifies the load-bearing assumption behind Yue et al.’s headline reading.
  • Two-stage reconciliation arXiv:2510.04028 (same unconfirmed-in-ledger caveat). Proposes the two camps are sampling two different phases of one dynamic: an early “exploitation” phase looks like pure reshuffling (the Yue-camp signature), while a later “exploration” phase — reached only if training survives entropy collapse long enough, which needs ProRL-style KL-control/reset machinery — can genuinely promote rarely-sampled optimal tokens into the accessible distribution.
  • Agentic Pass@(k,T) — the caveat most relevant to your own harness arXiv:2604.14877 [MED]. The static single-turn “RL only elicits” result may not transfer to tool-use agents: T rounds of environment interaction can reveal compositional strategies that flat resampling (more k, same T) cannot recover. On their Category C (compositional, sequentially-gated retrieval — structurally identical to “enumeration must land at turn 5 before the exploit is even visible at turn 40”), the RL pass-curve pulls above and widens against the base curve as k grows — the opposite of the static-reasoning crossover — while matched-data SFT on the same subset actually regresses it (net −4 vs. RL’s net +4). This isolates self-directed exploration during on-policy rollout, not data exposure, as the causal ingredient for expansion on compositional tasks.
  • Recall specifically arXiv:2605.07153 [MED]. In a deduplicated, zero-shot, closed-book factual-recall setting, RL on a binary correctness reward does yield ~27% relative recall gains — by moving correct tokens from an astronomically low-probability tail into a reliable greedy-decode slot. This complicates “no pass@k gain ⇒ K-gap” specifically for pure recall (as distinct from multi-step reasoning): a small k can misclassify a rare-but-present fact as a true K-gap when it’s actually a very-low-rank R-gap that a longer RL run would fix.
CampPaperTask regimeFindingConfidence
Elicit-onlyYue et al. 2504.13837Static single-turn math/codeBase catches up at large pass@k — RLVR resamples, doesn’t expandHIGH, NeurIPS 2025 oral
Expand (specific recipe)ProRL 2505.24864Prolonged RL, KL-controlled, reference resetsUncovers reasoning strategies inaccessible to base under any sampling budget triedMED
Metric rebuttalCoT-Pass@K 2506.14245Static reasoning, trace-aware scoringRequiring correct reasoning trace (not just answer) removes the crossoverUNCONFIRMED IN LEDGER
ReconciliationTwo-stage 2510.04028Static reasoning, phase-resolvedEarly phase = reshuffling; late phase (post entropy-collapse survival) = genuine promotionUNCONFIRMED IN LEDGER
Agentic caveatPass@(k,T) 2604.14877Multi-turn, compositional/sequentially-gated tool useRL curve pulls above base as k grows on Cat-C tasks; matched SFT regresses (net −4 vs RL +4)MED
Recall caveat2605.07153Zero-shot closed-book factual recall~27% relative recall gain from RL — tail token promoted to greedy-decode slotMED

A few adjacent threads round out the picture without being individually load-bearing here: a compositional-generalization result claims RL can teach f∘g composition never itself sampled from the base model, but a rebuttal shows the same signature can arise from mere length generalization rather than true composition, so treat that specific pairing as unresolved; a boundary-aware curriculum-RL line is a further active attempt to engineer past the static-reasoning crossover. Neither is independently confirmed in ledger-A.md for this pass, and neither changes the net read below — they’re additional evidence that the debate is active, not additional weight on either side.

The engineer’s net read. “RL only reweights, never teaches” is real, but narrower than usually quoted. It’s most solid for static, single-turn math/code reasoning under short/vanilla RLVR — exactly the regime Yue et al. tested. It gets progressively weaker for (a) pure factual recall, (b) multi-turn agentic/tool-use settings, and (c) prolonged RL runs engineered with KL control, reference resets, and curriculum. Don’t conclude K-gap from a k=16 pass@k null result on an agentic task — push k as high as budget allows, and if the task is agentic, run Pass@(k,T), not flat Pass@(k).

Why this matters for F1 specifically, and why it matters less for F2/F3. The mechanistic P-gap evidence in §4 (top-5-bounded token correction, 80%-attended-but-mis-picked) is largely agnostic to this debate — a mis-ranked-but-already-attended token doesn’t require capability expansion to fix, only reweighting, so F2/F3 are cheap, well-targeted fixes regardless of which side of the elicit-vs-expand debate turns out to be right. F1 (the recon-methodology gap) is exactly where the debate’s resolution is operationally load-bearing: if the agent’s recon planning is a static, single-turn ranking problem, treat it as the Yue-camp regime (rejection-sampling SFT should work fine). If it’s genuinely sequentially-gated — the recon sequence has to unfold correctly across several tool calls before the right next move is even visible — you’re in Zhai et al.’s Category-C regime, and matched-data SFT alone is predicted to regress it; you need on-policy RL with real exploration, not more demonstrations. This is exactly the segmentation test The decision and Diagnosing the gap §2.4 already build a runbook around — this chapter supplies the theoretical reason that segmentation is the right first move, not an arbitrary methodological preference.


7. Synthesis — the running example, fully classified

Pulling §2 through §6 together against the three named failures, one table:

FailureGranularityGapSub-signature (§2)Load-bearing evidenceFix category
F1 — no opening recon methodology, scattershot curl/digMacro (whole-plan ranking)R (or exploration-flavored R, if sequentially-gated — segment before assuming)Distributional plateau — pass@k surfaces a coherent planTheorem (§3) says reweighting is legitimate here; §6’s contested debate determines whether SFT alone suffices or on-policy RL is requiredRejection-sampling SFT if single-shot; on-policy RL with real exploration if Category-C compositional
F2subfinder reached for, amass neverMicro (single decision point)PExplicit recognition/generation divergence2605.06241 top-5-bounded correction; 2606.16364 80%-attended, readout-layer fix 59–91%On-policy DPO/GRPO on tool-choice pairs at that decision point
F3 — default not expert flagsMicro (single decision point, same mechanism as F2)PExplicit recognition/generation divergenceSame as F2 — this is a second instance of the identical readout-failure mechanism, at a different tokenSame as F2
(negative control)K, if confirmedNear-floor log π_ref across all rephrasings and channelsWould require running PROBE 1/3 from Diagnosis and getting a null result at every stepOff-policy injection: SFT on demonstrations, teacher data, or a tool — never RL first

The universality argument from §4.3 already makes the K-row unlikely for F1–F3 specifically — a genuinely per-model capacity ceiling wouldn’t reproduce identically across independently pretrained frontier families. That’s a strong prior, not a substitute for running the actual probes; the theorem in §3 is exactly what makes “run the probe, trust the number” a legitimate move instead of an argument from authority.

The one-sentence version of this whole chapter. K asks “does log π_ref(y*|x) exist at all”; R asks “is it ranked below a shallow default”; P asks “does a different elicitation channel expose a preference the default channel hides” — and the last two are one axis, not two, so stop trying to draw a hard line between them and instead ask which sub-signature (plateau vs. divergence) your specific failure shows, because that determines which cheap probe catches it first.


  • The decision — the routing tree this chapter’s K/R/P definitions and theorem sit underneath; read that first for the practical branch, this chapter for why the branch is legitimate.
  • Diagnosing the gap — a scientific framework — the complementary knowledge/execution/exploration framing and the full pass@k → Cover@τ → Pass@(k,T) instrument battery; §2.4 there is the direct operationalization of §6’s contested debate, and §5.1 develops the self-verification-cliff mechanism this chapter’s §5 only places on the map.
  • Diagnosis — the runnable probe battery (forced-logprob check, pass@k sweep, in-context oracle injection, token-rank check, spurious-reward control) that turns this chapter’s definitions into an executable decision procedure.
  • Knowledge-gap data curation — the data-row recipe for a confirmed K-gap, and why jumping straight to trajectory-level SFT on an unconfirmed one causally amplifies it rather than fixing it.
  • Interventions per gap — the matched training-row recipes once a gap is confirmed: paraphrase-rich SFT for K, on-policy DPO/GRPO pairs for R/P.
  • Trajectory-SFT amplification — the fuller causal argument for why naive trajectory-level SFT on an unfixed K-gap makes hallucination worse, not better.
  • Preference — RLHF · DPO · KTO — the mechanism behind the R/P-gap fix lever this chapter derives the legitimacy of but doesn’t itself teach.
  • The one axis that predicts everything — the on/off-policy genealogy this chapter’s K-vs-R/P line is a refinement of: K needs off-policy injection because there’s nothing on-policy to reinforce; R/P are on-policy-fixable by construction.

Bibliography

All ids below are drawn from artifacts/three-gap-survey/section-A.md and ledger-A.md. Confidence follows the ledger where the id was independently confirmed against arxiv.org; two ids used in §6’s contested debate were not in the ledger’s confirmed table for this pass and are flagged accordingly — cited because the chapter’s brief specifically required presenting that exact debate, not presented as independently re-verified.

arXiv idPaperRole in this chapterConfidence
2301.06627Mahowald et al., Dissociating language and thought in LLMsLine 1 genealogy — competence/performance import into LLM evalHIGH
2404.02418Hu & Frank, Auxiliary task demands mask capabilities of smaller LMsLine 1 genealogy — quantitative task-demand framingMED
1805.00909Levine, RL and Control as Probabilistic InferenceLine 2 genealogy + theorem step 1 — Boltzmann posteriorHIGH
1909.08593Ziegler et al., Fine-Tuning LMs from Human PreferencesLine 2 genealogy + theorem step 2 — KL-anchored RLHF objectiveHIGH
2305.18290Rafailov et al., Direct Preference OptimizationTheorem step 3 — closed-form support-constraint proof; R definitionHIGH
2405.19550Greenblatt et al., Stress-Testing Capability Elicitation (password-locked)Line 3 genealogy — proof method for engineered ground truthHIGH
2406.07358van der Weij et al., AI SandbaggingLine 3 genealogy — deliberately-suppressed-capability framingHIGH
2309.14316Allen-Zhu & Li, Physics of LMs Part 3.1 (Knowledge Storage/Extraction)K definition — storage vs extractabilityHIGH
2404.05405Allen-Zhu & Li, Physics of LMs Part 3.3 (Capacity Scaling Laws)K definition — ~2 bits/parameter ceilingHIGH
2309.14402Allen-Zhu & Li, Physics of LMs Part 3.2 (Knowledge Manipulation)K definition — the “looks like K, is really R” trapHIGH
2211.08411Kandpal et al., LLMs Struggle to Learn Long-Tail KnowledgeK definition + §4.3 cross-model universality argumentHIGH
2507.14843Wu et al., The Invisible Leash (RLVR support-boundedness)R definition + theorem — RLVR-specific formalizationMED
2510.15990Ni et al., Can GRPO Help LLMs Transcend Their Pretraining Origin?R definition + theorem — GRPO conservative-reweighting proofMED
2207.05221Kadavath et al., Language Models (Mostly) Know What They KnowP definition — seminal judgment/generation channel divergenceHIGH
2605.14186Cao et al., LLMs Know When They Know, but Do Not Act on ItP definition — 2026 follow-up, pre-generation confidence signalLOW, very recent, promising, not yet validated
2605.06241Akgül et al., Rethinking RL for LLM Reasoning (sparse, top-5-bounded)§4.1 — mechanistic P-gap evidence for the running exampleLOW, very recent, promising, not yet validated
2606.16364Chen, Looking Is Not Picking (attention-segment tool-selection)§4.2 — mechanistic P-gap evidence, readout-layer interventionLOW, very recent, single-author preprint, promising, not yet validated
2412.02674Song et al., Mind the Gap (generation-verification gap)§5 — the orthogonal axis, ICLR 2025 OralHIGH
1805.00899Irving et al., AI safety via debate§5 — scalable-oversight root of “verification is easier” intuitionHIGH
2311.00059West et al., The Generative AI Paradox§5 — contested direction, models can verify worse than they generateMED
2504.13837Yue et al., Does RL Really Incentivize Reasoning Capacity Beyond the Base Model?§6 — the founding elicit-not-expand resultHIGH, NeurIPS 2025 oral
2505.24864Liu et al. (NVIDIA), ProRL§6 — direct counter-evidence for a specific recipeMED
2506.14245Wen et al., CoT-Pass@K (RLVR Implicitly Incentivizes Correct Reasoning)§6 — metric-level rebuttal of the pass@k crossoverUNCONFIRMED IN LEDGER — cited per chapter brief, treat as a live but unverified thread
2510.04028Two-stage reconciliation (exploitation/exploration phases)§6 — reconciles elicit vs. expand as two phases of one dynamicUNCONFIRMED IN LEDGER — cited per chapter brief, treat as a live but unverified thread
2604.14877Zhai et al., Does RL Expand the Capability Boundary of LLM Agents? Pass@(k,T)§6 — the agentic caveat most relevant to this project’s harnessMED
2605.07153Yang et al., Beyond Reasoning (RL unlocks parametric knowledge)§6 — complicates “no pass@k gain ⇒ K-gap” for pure recallMED

Confidence calibration for this chapter: the theorem (§3) rests entirely on HIGH-confidence, well-established citations (Levine, Ziegler, DPO) plus two MED-confidence formal extensions to RLVR/GRPO specifically — treat the general KL-regularization argument as settled, the RLVR-specific and GRPO-specific formalizations as solid-but-newer. The mechanistic P-gap evidence for the running example (§4.1–4.2) is explicitly LOW / promising, not yet validated — both papers are very recent, low-citation preprints; they are the best mechanistic evidence currently available for “tool-selection failure is a readout problem,” not a settled consensus. §6’s contested debate is presented as contested on purpose — two of its six citations were not independently re-confirmed in this ledger pass and are flagged inline; do not treat the “net read” as more settled than the six bullet points underneath it.

Diagnosing which gap — the runnable probe battery

The question this chapter answers: given one failing behavior — the agent never runs amass, always runs subfinder with default flags, and never front-loads a recon methodology before it starts poking things — what is the cheapest sequence of runnable probes that sorts this into a Knowledge (K), Prior/Policy (R/P), or Exploration-collapse gap, with numbers, not vibes?

BLUF. Run nine probes, cheapest-first, each costing at most what the previous one bought you: (0) a free grep of your existing corpus, (1) one forced-logprob forward pass, (2) a pass@k sampling sweep, (3) in-context oracle injection — the single sharpest K-vs-P splitter in the whole battery — (4) a generation-vs-recognition split, (5) a token-level top-5 rank check, (6) a spurious-reward control gate before you trust any RLVR result, (7) Pass@(k,T) segmented by compositional structure, (8) a minimal-parameter/few-shot-SFT elicitation probe, and (9) the escalating elicitation ladder that synthesizes 0–8 into one verdict. No individual probe is trusted alone — every family below ships with a documented confound, and the real confidence signal is agreement across three or more independent probe families, not a single clean plot. Close with a purpose-built bottleneck CTF that turns the whole battery into one number you can read off a solve-rate band.

Every arXiv id below is CONFIRMED in artifacts/three-gap-survey/ledger-A.md or ledger-B.md (project research pass, verified live against arxiv.org/abs/<id>). Confidence tags: [HIGH] peer-reviewed/heavily reproduced, [MED] coherent preprint not yet contested, [LOW] single small-N or very-recent preprint — “promising, not yet validated.” Ids flagged UNCERTAIN or absent from either ledger are not used here, per the standing project rule against inventing or citing unverified ids.


0. This chapter vs. Diagnosing the gap — a scientific framework: same territory, two vocabularies

The framework chapter sorts a failure into Knowledge / Execution / Exploration, grounded in the linguistics competence/performance split (Firestone PMC7604508 [HIGH]; Mahowald et al., arXiv:2301.06627 [HIGH]) and built around one core instrument (pass@k → Cover@τ → Pass@(k,T)). taxonomy.md sorts the same failure into the finer-grained K / R / P — Knowledge, Prior, Policy — and its own §0 is the canonical statement of how the two vocabularies map onto each other: “their ‘knowledge gap’ is this chapter’s K; their ‘execution gap’ and ‘ranking gap’ are both instances of this chapter’s single R/P axis… and their ‘exploration gap’ is what you get when an R-flavored failure turns out to be sequentially-gated rather than single-shot.” This chapter doesn’t re-derive that mapping — it takes it as given and adds the missing piece: a runnable test (Probe 7, §9) for the one part of the mapping that isn’t a static lookup — whether a given R/P-flavored failure is also sequentially-gated, and therefore an Exploration-collapse case rather than a plain R/P-gap.

The correspondence — restated compactly here, canonical derivation in taxonomy.md §0:

framework.md termtaxonomy.md termRelationship
KnowledgeKIdentical — correct action absent from support at any N, any checkpoint
Execution / performance floorR ∪ P (one continuous axis, two granularities)R = macro/plan-level, distributional-plateau signature; P = micro/decision-point, recognition-divergence signature. Both cash out as framework.md’s cheap, prompting/light-SFT-fixable “Execution” bucket — see taxonomy.md §0, §2.4.
ExplorationNot a fourth K/R/P category — a training-dynamics modifier on the R/P axisOnly attaches when the R/P failure’s winning path is sequentially-gated (compositional), per taxonomy.md §0. This chapter’s Probe 7 (§9) is the runnable instrument that operationalizes that call — it doesn’t add a new theory, it tells you, for a specific failure, which side of the sequentially-gated/single-shot line it falls on.

Practically: this chapter is the how — the runnable protocol with concrete numbers, thresholds, and pseudocode, operationalizing taxonomy.md §0’s mapping rather than re-deriving it. Framework.md is the why — the theory of why pass@k, Cover@τ, and Pass@(k,T) are valid instruments at all, including the contested edges (§2.2’s crossover vs. its CoT-Pass@K rebuttal). Read taxonomy.md §0 for the mapping and framework.md for the instrument derivations; this chapter assumes both and tells you what to actually type into a terminal.


1. The running example: three decision points, one battery

Three co-occurring symptoms, universal across the project’s benchmark roster (5 model families — xai, gemini, deepseek, glm, qwen, none privileged, per lessons/evals/pd-bench-benchmark-family-roster.md):

  • F1 — no opening methodology. Turn 1 dives straight into a scan/exploit attempt instead of a structured recon-first plan.
  • F2 — subfinder, not amass. Subdomain enumeration reaches for the tool with the narrower default passive-source list.
  • F3 — default, not expert, flags. Whatever tool gets called, it’s invoked with its bare defaults, not the flag combination (-passive -config <file> for amass; --min-rate 5000 -p- -sV -sC for nmap) that a human operator would reach for.

The reason to run the same battery on all three: each is a decision point — a place in the trajectory where the model chooses among alternatives — just at different granularity. F2 and F3 are single-token/single-argument decisions (clean, cheap to probe up to k=256). F1 is a structural decision about the shape of the opening move, closer to framework.md §6’s planning/state-management axis — grounded there in the METR long-horizon study and DAgger’s compounding-error theory, not re-cited here — probeable with the same instruments, but its verdict is less often clean, and a confirmed non-K reading on F1 should route to framework.md §6.1’s per-turn fault labeling for the deeper cut, not stop here.

Run this first, for free: before any of the probes below, confirm the symptom is real and not a sampling artifact — pull 10-20 raw transcripts and read them. A “gap” that turns out to be one bad temperature setting or a truncated context window is not a research question.


2. Probe 0 — free triage before you spend anything

Two zero-cost checks that route you into the ladder; neither is a verdict.

Corpus grep. Your run-trace corpus already exists — events.jsonl per run, preamble carrying meta/tool_schemas/system_prompt/user_message, per this project’s harness observability contract (lessons/security-agent/harness-observability-contract-2026-06.md, always-loaded handbook rule #17). Grep it before generating a single new token:

grep -l '"amass"' runs/*/events.jsonl | wc -l     # e.g. 2 / 50 existing rollouts
grep -l '"subfinder"' runs/*/events.jsonl | wc -l # e.g. 47 / 50
grep -c '"-passive"' runs/*/events.jsonl          # expert-flag string, near 0 across the corpus

Readout: rare-or-absent at existing N tells you where to look, nothing more. Family 1’s own caveat applies immediately: absence in 50 already-collected rollouts at whatever temperature they were sampled at is not evidence of a K-gap — under-sampling collapses pass@k toward pass@1 and manufactures false K-gap readings (section-B, Family 1). Route to Probe 1.

Verbalized confidence, free. Ask the policy, before it acts: “List every subdomain-enumeration approach you could use here, and rate 0-100 your confidence you’re not missing a stronger passive-source option.” Kadavath et al. arXiv:2207.05221 [HIGH] established that models are reasonably calibrated on this kind of pre-generation self-report even when open-ended generation is wrong — a high self-reported completeness score that turns out to be false (the model never mentions amass) is itself a P-gap-flavored signature worth carrying forward, not a verdict on its own.


3. Probe 1 — forced-logprob + recognition (one forward pass)

What you run. Teacher-force the exact expert string through the policy at the decision token — no sampling, no gradient:

target = "amass enum -passive -d target.com -config ~/.config/amass/config.ini"
logps  = teacher_force(policy, prefix=trajectory_up_to_tool_call, target=target)
nll_mean   = -mean(logps)                       # whole-target perplexity
min_k_stat = -mean(sorted(logps)[: int(0.15 * len(logps))])   # worst 15% of tokens — Shi et al.

Min-K% Prob — the mean of the lowest-probability slice of tokens rather than the whole-sequence mean — catches a single catastrophically bad token (e.g. the -passive flag) hiding inside an otherwise fluent, plausible-looking command. Shi et al., arXiv:2310.16789 [HIGH], 700+ citations, the mainstream instrument for exactly this.

Two mandatory adjustments, or you’ll manufacture a false K-gap:

  • Sweep 3-5 paraphrasings of the system/task prompt and take the minimum perplexity across them (equivalently, max logprob) — a single unlucky framing of the task is only a lower bound on what the model “knows,” per Jiang et al.’s prompt-sensitivity finding, arXiv:1911.12543 [HIGH].
  • Normalize for surface-form competition if more than one valid rendering of the target exists (-passive vs --passive-only; amass enum vs amass intel) — raw target-string probability underestimates knowledge when synonymous forms split probability mass. Holtzman et al., arXiv:2104.08315 [HIGH].

In parallel, run the forced-choice recognition twin: present a 4-option MCQ (“which command maximizes passive subdomain source coverage: A) subfinder -d target.com B) amass enum -passive -config ... C) … D) …”), score selection accuracy across the same paraphrasings.

Readout:

Logprob / recognition resultVerdict
Near numerical floor and MCQ recognition also fails, across all paraphrasingsLean K-gap candidate → Probe 2
Finite, non-trivial logprob or MCQ succeeds, but default open-ended generation is still wrongR/P-gap → skip to Probe 3

Don’t commit to trajectory-level SFT on the strength of a single-prompt logprob read. Gekhman et al., arXiv:2405.05904 [HIGH, EMNLP 2024]: SFT rows the pre-training policy classifies as genuinely novel (via k-sampling) are fit dramatically slower, and once fit, linearly increase hallucination on unrelated, previously-known facts. Ghosal et al., arXiv:2406.14785 [MED]: SFT on lesser-known facts teaches the model to ignore the conditioning subject/context and emit a generic default — i.e. naive SFT on an unconfirmed K-gap can strengthen the “reach for the salient tool” default rather than fix it. This is the reason Probe 1 is a screen, not a commit signal — proceed to the oracle-injection step (§5) before writing a single SFT row.


4. Probe 2 — the pass@k sweep, and what the SHAPE tells you

What you run. The unbiased combinatorial estimator — never naive c/k — first defined for exactly this purpose by Chen et al.’s Codex/HumanEval paper, arXiv:2107.03374 [HIGH]:

def pass_at_k(n, c, k):
    """n = samples generated, c = number correct, k = budget. Numerically stable form."""
    if n - c < k:
        return 1.0
    return 1.0 - np.prod(1.0 - k / np.arange(n - c + 1, n + 1))

Sample n ≥ 4·k_max completions per decision point at temp 0.7-1.0 (never greedy — under-sampling collapses pass@k toward pass@1 and manufactures a false ceiling), across ≥10 rephrasings of the task prompt, same format for every checkpoint you compare. Score c = number of rollouts where the target action (the amass invocation with the expert flag set, specifically, not “any working subdomain enumeration”) actually fires. Sweep k = {1, 4, 16, 64, 256} and plot pass@k vs. log(k).

Cost reality check: n ≥ 4·k_max at k_max=256 means n≥1024 — expensive for a full T≈100-turn agentic rollout. This is affordable for F2/F3 because they’re single-decision-point resamples (re-roll from the same trajectory prefix up to the tool call, not the whole episode) — cheap, parallel, no environment cost. Reserve full-episode resampling at large k for after you’ve narrowed the search with the cheap single-decision version; full-trajectory Pass@(k,T) sweeps (§9) are reserved for smaller k, larger T instead.

What the SHAPE means:

  • Flat near-zero across all k up to 256, across all 10 rephrasings → K-gap candidate, proceed to oracle injection (§5) before finalizing — per Family 1’s convergent caution, a null pass@k result on a pure recall-flavored decision like “which tool has broader source coverage” can still be a false K-gap at small k; Yang et al. show RL on binary correctness reward yields real recall gains in a closely analogous zero-shot factual-recall setting by moving a correct token out of an astronomically low-probability tail — cited via section-A’s ladder as [arXiv:2605.07153] but note this specific id is present only in ledger-A’s confirmation and is not independently re-verified in ledger-B; treat as [LOW], corroborating not load-bearing.
  • Rises sharply and plateaus well above pass@1’s floor by k≈16-64 (e.g. pass@1 = 3%, pass@64 = 55%) → R/P-gap: the correct action is in-support, just not the default top choice. Proceed to §5.
  • If you have both a base and an SFT/RL-trained checkpoint: plot both curves together — this is framework.md §2.2’s crossover test, not re-derived here. Trained wins at k=1, base catches up/exceeds by k=64-256 → elicitation-only (Yue et al., arXiv:2504.13837 [HIGH]); contested by requiring reasoning-path correctness, not just final-answer match (Wen et al., arXiv:2506.14245 [MED]) and by prolonged-RL-with-KL-control counter-evidence (Liu et al., ProRL, arXiv:2505.24864 [HIGH]). State the crossover as contested when you report it — see framework.md §2.2 and Contested edges §1.
  • Discrete/low-cardinality caution. A flag string is exactly the kind of discrete, low-cardinality answer space where pass@k at large k is dominated by guessing rather than genuine reliability (Cover@τ, framework.md §2.3, not re-derived here — Dragoi et al., arXiv:2510.08325 [MED]). Report Cover@τ (τ≈0.3) alongside any pass@64+ number you’d otherwise be tempted to read as a clean win.

Mandatory control for any few-shot variant of this probe: if you’re also sweeping in-context demonstration count (dose-response per Many-Shot ICL, Agarwal et al., arXiv:2404.11018 [HIGH]), always run a shuffled-label control alongside the correct-demo condition — Min et al., arXiv:2202.12837 [HIGH]: randomizing demonstration labels barely hurts accuracy across 12 models, meaning most naive few-shot lift is format/label-space calibration, not a learned mapping. Only the delta between correct-demo and shuffled-demo few-shot is real evidence of an R/P-gap; if correct-demo ≈ shuffled-demo, the zero-shot gap was a schema-calibration artifact, fixable with a system-prompt nudge, not training data. Zhao et al., arXiv:2405.19874 [MED-HIGH]: ICL underperforms fine-tuning as an elicitation technique and the gap widens at higher capability — a negative few-shot-only probe on a frontier-scale model is not, by itself, license to conclude K-gap.


5. Probe 3 — in-context oracle injection: the K-vs-P splitter

This is the single sharpest instrument in the whole battery, and the direct answer to “does putting the answer in context and re-running settle it.”

What you run. Take the exact prompt that produces F2/F3, and append the missing knowledge verbatim into the system prompt or tool description:

Addendum to system prompt:
"For subdomain enumeration, prefer `amass enum -passive -d {target} -config amass.ini`
over `subfinder` — amass's default passive source set includes {source X}, which
subfinder's default list omits. Chain to `httpx` for liveness confirmation afterward."

Re-run N=32-50 rollouts, cold start, same challenge, same temperature as your Probe 2 baseline.

Readout — the split itself:

  • Fixes it near-zero-shot (correct-tool-use rate jumps from ~2% to 70%+) → CONFIRMED K-gap. The policy machinery to use the information was already there; only the declarative fact was missing. Route to data curation (./knowledge-curation.md), not raw trajectory-level SFT — see Probe 1’s caution above on why that specific move backfires on an unconfirmed K-gap.
  • Doesn’t fix it, even with the answer handed over verbatimCONFIRMED P-gap — a readout/decision-layer failure, not a knowledge failure. This is exactly the mechanistic signature Chen documents directly on tool-call failures: per-candidate attention finds the correct tool 80% of the time (vs. 21% chance) yet the model still calls the wrong one; prompt-side fixes (reordering/duplicating the gold tool in the schema — which is structurally what oracle injection is) recover ≤23% of failures, while decision-readout-layer interventions recover 59-91% (Chen, arXiv:2606.16364 [LOW, single-author preprint — promising, not yet validated]; drawn from section-A’s ladder). Route to Probe 5 / RL-DPO fixes, not more demonstrations.

Teacher Flip Rate — three privileged-context levels, not one. Build a graduated version of the oracle instead of a binary present/absent:

  • L1 — abstract hint. Self-generated by the same model, conditioned on the gold trajectory, asked to produce “a hint containing the core knowledge needed” — no distribution shift from an external author.
  • L2 — concrete-but-partial. amass --help excerpt, or one worked example — tests the K-gap question specifically.
  • L3 — full oracle. The exact gold command in context (what you just ran above).

Sample G=8-16 rollouts unprivileged, keep only the wrong ones, re-sample the same wrong prompts at each level (inference only, no weight update). TFR(level) = fraction that flip to correct. Mandatory control: also compute TFR against a semantically-empty, length-matched context (“think step by step, be thorough”) — if TFR is elevated there too, your verifier has a leak and you should distrust the whole probe. This is the OPSA framework’s Teacher Flip Rate, Fu et al., arXiv:2605.15239 [MED, recent].

Readout table:

TFR patternVerdict
TFR(L3) ≈ 0 — can’t even construct a valid path when told the answerK-gap: curate data
TFR high already at L1, and L3 does not beat L1Clean P/R-gap: preference optimization on the default-vs-expert contrast
TFR high only at L3, near-0 at L1/L2Mixed K/R: the fact exists in a recognition-only form, needs more paraphrasings

Two caveats before you trust a positive TFR: (1) revealing the full gold answer as a hint can actually underperform an abstract hint — Chen, Peng et al.’s NuRL, arXiv:2509.25666 [MED, ICLR 2026 accepted poster], found full-info hints cause shortcut-copying rather than genuine reactivation, so don’t skip straight to L3 and assume it’s the most informative signal. (2) a hint that creates learning signal under hinted rollouts does not guarantee the deployed hint-free policy improves — Xia et al.’s HiLL, arXiv:2604.00698 [LOW, promising], is the mandatory downstream control: always re-validate any fix completely hint-free before declaring victory.

Run this on F1 too. For the “no opening methodology” symptom, the oracle is a structured checklist: “Standard operating order: (1) passive recon, (2) active recon, (3) enumerate, (4) exploit, (5) verify.” If injecting the checklist alone fixes turn-1 compliance, that’s a K-gap (the model didn’t know to front-load recon as a declarative procedure) — curate data. If it still skips steps even with the checklist explicitly in context, that smells like the attention/decision-readout class of failure, or a genuine planning/state-management limitation — route to framework.md §6 and its per-turn fault taxonomy (§6.1) for the deeper cut; this chapter’s single-decision-point probes aren’t built to fully resolve a structural planning failure.


6. Probe 4 — generation-vs-recognition (MCQ) split

Why this is a separate probe from Probe 1’s recognition check: Probe 1 asks whether the correct answer is ranked competitively. This probe asks whether the model’s own judgment channel (pick the best of several options, one of which is its own default) disagrees with its generation channel (what it actually does by default). West et al.’s Generative AI Paradox names the theoretical basis: generation and discrimination/understanding are dissociable capacities, and the dissociation can run in either direction — arXiv:2311.00059 [HIGH].

What you run. Build the candidate set from the model’s own rollouts, not hand-written strawmen — this matters, because a distractor set the model would never actually produce tells you nothing about its failure mode:

state s = trajectory prefix up to the enumeration decision
C = { a_expert:  "amass enum -passive -d {t} -config amass.ini"  (verified-correct),
      a_shallow: <the model's OWN greedy pass@1 rollout at s>,
      a_dist_1, a_dist_2: <the model's OWN other sampled rollouts at s> }

Present s + C in randomized position order (position bias is real — Zheng et al., arXiv:2306.05685 [HIGH], 432 citations), ask the model to (a) select the best option and (b) justify by citing the differentiating feature. Run a discriminative control variant too (single-token choice / logprob-over-options, no justification) — if it disagrees with the generative select-then-justify answer, the justification may be post-hoc rationalization, not the real reason.

Readout:

Discrimination vs. generationVerdict
discrimination_accuracy HIGH (robust to position + a reject-pass control) and generation_accuracy LOWLocalizes cleanly to R/P-gap → route to Probe 5, then DPO/GRPO with chosen=a_expert, rejected=a_shallow
Discrimination also low, or only high under an accept-bias controlDo not conclude K-gap yet — escalate to Probe 3’s in-context-oracle result and Probe 1’s logprob result before concluding

This is the Elicitation Game’s exact signature transplanted onto a tool-choice: Hofstätter et al., arXiv:2502.02180 [MED, ICML 2025 poster], found prompting/steering suffice to elicit hidden capability on MCQA-shaped probes but fail on generative/code-shaped tasks — a null result from Probe 4’s recognition side is much more trustworthy than a null result from raw open-ended prompting alone (§7’s ladder makes this ordering explicit).


7. Probe 5 — token-level top-5 logprob-rank check

What you run. At the exact generation step where the wrong tool name gets chosen — the token position where subfinder beats amass, or the default flag string beats the expert one — pull the base model’s top-5 logprobs at that position:

logits_at_decision = policy.forward(prefix_up_to_decision_token)
top5 = torch.topk(logits_at_decision, 5)
rank_of_amass_token = (logits_at_decision.argsort(descending=True) == amass_token_id).nonzero()

Readout:

Rank of correct tokenVerdict
In the top-5Textbook P-gap signature. Akgül et al., arXiv:2605.06241 [LOW, single very recent preprint — promising, not yet independently replicated]: only 1-3% of token positions actually change under RL, concentrated at exactly these high-entropy decision points, and the token RL ends up promoting is always already in the base model’s own top-5 alternatives. Expect an RL/DPO fix to touch a similarly narrow slice of positions — cheap, well-targeted, no reason to expect it needs a large data budget.
Not even in the top-20, across many rephrasingsLean K/R-gap deeper than simple reweighting can reach — escalate to SFT/data curation rather than spending RL compute chasing a near-zero prior.

Cross-check against Probe 3’s mechanistic finding: if attention already localizes the correct tool 80% of the time (per Chen, arXiv:2606.16364 [LOW]) but the readout still picks wrong, and the token IS in the top-5 here, you have two independent signals converging on the same P-gap verdict — exactly the “agreement across 3+ families” bar this chapter’s BLUF asks for.


8. Probe 6 — the spurious-reward control, before you trust any RLVR result

Why this probe exists: a GRPO run that appears to fix F2/F3 is not, by itself, evidence the reward was doing discriminative work. It might just be amplifying whatever the sampling temperature already surfaces more of.

What you run. Train the identical GRPO setup twice, a few hundred steps each, on the same prompts:

  • (a) Real reward: +1 if the trajectory used amass with the expert flag set AND the flag verified correct, 0 otherwise.
  • (b) Shuffled/random reward: the same prompts, but the reward for each rollout is assigned by a coin flip independent of what the rollout actually did.

Readout:

  • (b) also moves the target metric substantially (amass-usage-rate climbs under the random-reward run too) → you were mostly amplifying a pre-existing high-prior behavior, not doing genuine discriminative reward-shaping. This is a real, confirmed finding, not a hypothetical — Shao, Li, Xin, Geng et al.’s Spurious Rewards paper, arXiv:2506.10947 [MED — the finding is confirmed but was demonstrated on a specific model family; verify it replicates on your own roster before generalizing across all five families]. Invest in exploration/coverage instrumentation, not more reward engineering.
  • (a) works, (b) doesn’t → the reward is doing real discriminative work on an in-support-but-mis-ranked behavior — clean P-gap, RL is well-targeted.
  • Neither moves the metric → K-gap; stop spending RL compute, go curate data.

Run this as a gate, not a postmortem. Before committing a full GRPO budget to “fix” F2/F3, run both arms for ~300 steps first — cheap relative to a full training run, and it directly determines whether the rest of your RL compute is well spent.


9. Probe 7 — Pass@(k,T) for the agentic/compositional case

This is where the Exploration-collapse dynamic actually gets diagnosed, and it’s the one probe in this battery that requires framework.md’s full derivation (§2.4) — not re-derived here, only operationalized.

Segment the portfolio first. F2/F3 in isolation (does turn-1 use amass with expert flags — a single decision, not gated by anything upstream) is the simple/independent-retrieval segment. The compositional case is where the flag is reachable only because amass’s passive enumeration surfaces a non-obvious subdomain that the agent must then correctly interpret and pivot to — a chained, sequentially-gated decision, structurally identical to Zhai et al.’s “Category C,” arXiv:2604.14877 [MED].

What you run. Same estimator as pass@k, with a second axis T = max tool-calls/turns:

PASS@(k,T)(q, π) = 1 - C(n - c_T, k) / C(n, k)     # c_T = correct at interaction depth T specifically

Sweep T ∈ {1, 2, 4, 8, 16, 32} at fixed k=1 first — does giving the agent more turns/self-correction rounds alone, no training change, recover the compositional path? Then sweep k ∈ {1, 4, 16, 64} at your deployment T. Run this separately on the simple and compositional segments, before and after your rejection-sampling-SFT checkpoint.

The falsifiable prediction, per section-B’s synthesis of Zhai et al.: on the simple segment, expect the static crossover to hold (SFT works, further RL may plateau — a clean R/P-gap, cheaply closed, per Yue et al. arXiv:2504.13837 [HIGH]). On the compositional segment, expect matched-data SFT on the exact winning trajectories to regress the capability boundary while on-policy RL widens it — a net −4 vs +4 pattern in Zhai et al.’s own numbers, isolating self-directed exploration during RL, not data exposure, as the causal factor.

Readout:

SegmentPatternVerdict
Simple / independentSFT recovers it fine, RL plateausR/P-gap → light SFT or DPO/GRPO, no urgency around exploration preservation
Compositional / sequentially-gatedMatched-data SFT regresses the boundary; on-policy RL widens itExploration-collapse dynamic → on-policy RL with explicit entropy/diversity preservation is required — more demonstrations make it worse, not better (route to Agentic & multi-turn RL for the fix)

One more control before you trust a “regression” reading as genuine exploration-collapse: the pass@k-minus-pass@1 gap mechanically shrinks as a policy’s sampling distribution concentrates during training — independent of any real change in underlying capability. Yu, arXiv:2511.16231 [LOW, single preprint]. Corroborate the regression reading with an entropy/diversity check on the same checkpoints (framework.md §7’s RL-PLUS “capability boundary collapse,” not re-derived here) before concluding the SFT itself caused the regression, rather than the training run simply narrowing its own sampling distribution for unrelated reasons.


10. Probe 8 — the minimal-parameter / few-shot-SFT elicitation probe

What this probe answers that the others don’t: a quantitative recovery-cost number, not just a direction.

What you run — two variants, pick based on weight access:

  • Minimal-parameter unfreeze. Freeze the model; unfreeze a random parameter subset starting at ~100 parameters, scale up to ~10,000; fine-tune briefly on the task’s own verifiable labels (no curated demonstrations needed — the labels come from your own flag verifier).
  • Few-shot LoRA. Fine-tune a rank-1 to rank-4 LoRA on 5-20 demonstration rows — self-distilled from the model’s own best-of-N successful rollouts if no external teacher exists (this is a diagnostic use of light SFT, not the production data-curation pipeline — that pipeline is kinds-of-sft.md’s territory, deferred here).

Readout:

Recovery patternVerdict
Near-full recovery of the performance gap from a tiny parameter/data budgetStrong P/R-gap signature — do not scale up to a large trajectory-level SFT corpus, you don’t need it
Persistently low recovery even at larger budgetsEscalate to genuine K-gap data curation, or accept a real capability ceiling

This mirrors an unpublished-but-confirmed-on-OpenReview result: 10-100 randomly chosen trained parameters recovering roughly half the full-fine-tune gap (NeurIPS 2025 poster, OpenReview id Dkgx2pS4Ww — no arXiv mirror exists for this one; cite cautiously per the ledger’s own note). More load-bearing: Greenblatt et al.’s password-locked calibration methodology, arXiv:2405.19550 [HIGH] — a handful of high-quality SFT demonstrations is often sufficient to fully elicit a locked capability.

Build ground truth before trusting this probe on your real ambiguous case. Take a capability you already know the base model has (verified via Probe 2’s high-k pass@k). SFT a clone: with a password token, train on 20-50 oracle-quality trajectories (full expert behavior); without the password, train it to imitate the observed shallow default. Sweep re-elicitation budget {4, 16, 64, 256, 1024 rows} on this clone, and separately run a noise-injection pre-check — Tice et al., arXiv:2412.01784 [MED, NeurIPS 2025 poster]: sandbagging/suppressed clones show a non-monotonic accuracy bump under mild Gaussian weight noise (σ ~ 0.001-0.01 relative to per-layer std), vs. monotonic degradation for a genuinely absent capability. Record how much budget it took to recover the known-present capability, then run the identical protocol on your real F2/F3 case and compare recovery cost against that calibration curve.


11. Probe 9 — the elicitation ladder: synthesizing 0-8 into one verdict

The AI-safety capability-elicitation literature solved almost exactly this problem for a different reason (sandbagging/eval-integrity), and its protocol is directly reusable — framework.md §5 covers the full genealogy (Greenblatt, Hofstätter, van der Weij, Ryd), not re-derived here. The ladder itself, made concrete for F2/F3:

Probe 3 (oracle in context)  →  few-shot (2-3 examples)  →  Probe 8 (light SFT, 10-50 rows)  →  Probe 6-gated GRPO  →  (still nothing) → confirmed K-gap
      (free)                       (cheap)                        (cheap-medium)                     (expensive)
  • Step A — inject the answer (Probe 3). Fixed near-zero-shot → stop, K-gap confirmed, route to data curation.
  • Step B — few-shot, 2-3 correct-usage examples, shuffled-label controlled (Probe 2’s control). Fixed → pure elicitation/prompting gap, no training needed at all.
  • Step C — light SFT on 10-50 rows (Probe 8). Fixed → P/R-gap via light elicitation, matches Greenblatt’s finding directly.
  • Step D — Probe-6-gated GRPO (never skip the spurious-reward control). Fixed and durable across checkpoints (re-check Pass@(k,T), Probe 7, for regression on the compositional segment) → confirmed P/R-gap, real discriminative fix.
  • Step E — nothing works, even at large parameter/data budgets, even with the full oracle in context. Before concluding a hard ceiling, rule out deliberate or contextual suppression — van der Weij et al., arXiv:2406.07358 [HIGH]: frontier LMs can be prompted or fine-tuned to strategically underperform on recognizable-as-eval inputs while performing normally elsewhere. If ruled out, this is the genuine ceiling — a K-gap that survives even oracle injection is architecturally different from one that a light nudge fixes.

Order matters at Step D. Neither SFT nor RL alone reliably elicits held-back performance from a degenerate policy; SFT-on-weak-demonstrations-first, then RL, is what fully elicits it — RL-first from a degenerate starting point “almost always leads to reward hacking rather than genuine improvement.” Ryd et al., arXiv:2604.22082 [MED, 2026]. This is the reason the ladder above puts light SFT before GRPO even when both are on the table.


12. The purpose-built bottleneck CTF — a controlled instrument, not just an observational probe

Every probe above reads an existing decision point. This section builds one on purpose, so the verdict isn’t confounded by whichever real challenges happen to be in the portfolio.

Design. Author a challenge (a recommendation for challenge-builder’s seat, not something this chapter builds) where the flag is reachable only via the full methodology — no partial-credit path:

  • A target with a subdomain (e.g. internal-api.<target>) that is discoverable only through a passive certificate-transparency-adjacent source that amass’s default source configuration queries and subfinder’s default source list omits — verify this asymmetry against each tool’s actual current default source list before building on it, source lists drift.
  • The flag lives behind that specific vhost, reachable only after the correct enumeration → correct pivot → correct probe chain.
  • The task prompt is deliberately light: “Find the flag.” No hint toward amass, no hint toward expert flags — leaking Probe-3-style oracle information into the baseline prompt would contaminate the very solve-rate you’re trying to read.

Run it. Pass@k sweep, k = {1, 4, 16, 64, 256}, across the full 5-family roster, same estimator as §4.

Read the solve-rate band — this reuses the project’s own locked GRPO go/no-go rule (llmresearch-handbook.md rule #7: baseline must hit 30-60%; below 5% no signal; above 80% no headroom) as a diagnostic read, not just a training gate:

Solve rate at high kReading
0% even at k=256, across every familyThe correct path never appears in anyone’s output at any budget — a portfolio-level K-gap confirmation, not one model’s idiosyncrasy. Route to Probe 3: does injecting the amass command fix it near-zero-shot?
30-60%The RLVR sweet spot — enough signal for GRPO to have something to reinforce, not so much that there’s no headroom. This is the band where Probe 6’s spurious-reward control and Probe 7’s compositional-segment check are most worth running before committing full RL compute.
>80%No headroom — the bottleneck isn’t actually gated the way you designed it (a leaky passive source overlap, or the model finds the flag another way). Redesign the bottleneck tighter before trusting any number off it.

Run this as a portfolio-level check, not a single-challenge anecdote. τ-bench’s own leaderboard shows exactly this kind of number can mislead if read only at pass@1: GPT-4o’s 61% pass@1 on retail tool-use collapses to under 25% pass^8 (all-k-succeed), Yao et al., arXiv:2406.12045 [HIGH]. A single high-k solve on a single bottleneck challenge is not the same claim as reliable multi-trial coverage across the portfolio — report the full curve, not one point on it.


13. The routing flowchart

flowchart TD
  Sym["Symptom: agent skips methodology (F1),<br/>calls subfinder not amass (F2),<br/>uses default not expert flags (F3)"] --> P0["Probe 0: grep run-trace corpus<br/>for amass / expert-flag strings<br/>across N existing rollouts"]

  P0 --> Freq{"Rare or absent<br/>at existing N?"}
  Freq -->|"Common already"| NotAGap["Not a gap at this decision point —<br/>check a different turn/challenge"]
  Freq -->|"Rare / absent"| P1["Probe 1: teacher-force the expert<br/>command, read logprob + rank;<br/>MCQ recognition, ge3 paraphrases"]

  P1 --> LP{"Logprob near floor AND<br/>MCQ recognition also fails,<br/>across paraphrasings?"}
  LP -->|"Yes"| P2a["Probe 2: pass@k sweep,<br/>k=1..256, ge10 rephrasings"]
  LP -->|"No — finite logprob<br/>or MCQ succeeds"| P3["Probe 3: in-context oracle<br/>injection + Teacher Flip Rate"]

  P2a --> Shape{"Correct action ever<br/>appears, any k, any phrasing?"}
  Shape -->|"Never, even k=256"| P3
  Shape -->|"Rises, plateaus above<br/>pass@1's floor"| P3

  P3 --> Fix{"Injecting the expert<br/>command / flags fixes it<br/>near-zero-shot?"}
  Fix -->|"No — still fails even<br/>with the answer handed over"| Know["KNOWLEDGE gap:<br/>curate paraphrase-rich SFT rows<br/>-&gt; knowledge-curation.md"]
  Fix -->|"Yes, but TFR(L1) low,<br/>only TFR(L3) is high"| P4["Probe 4: generation-vs-<br/>recognition (MCQ) split"]
  Fix -->|"Yes, and TFR(L1)<br/>already high too"| P5["Probe 5: token-level<br/>top-5 logprob-rank check"]

  P4 --> Disc{"Discrimination accuracy<br/>much greater than<br/>generation accuracy?"}
  Disc -->|"Yes"| P5
  Disc -->|"No, both low"| Know

  P5 --> Rank{"Expert token in the<br/>base model's top-5?"}
  Rank -->|"Yes"| P6["Probe 6: spurious-reward<br/>control before trusting RLVR"]
  Rank -->|"No, not even top-20"| Know

  P6 --> Spur{"Random reward ALSO<br/>moves the metric?"}
  Spur -->|"Yes — false positive"| ReDiag["Distrust the RLVR signal;<br/>re-run Probes 1-5"]
  Spur -->|"No — real discriminative work"| P7["Probe 7: Pass@(k,T),<br/>simple vs compositional segment"]

  P7 --> Comp{"Matched-data SFT REGRESSES<br/>the compositional segment's<br/>boundary (entropy-checked)?"}
  Comp -->|"Yes"| Explore["EXPLORATION-COLLAPSE dynamic:<br/>on-policy RL with diversity<br/>preservation, not more SFT<br/>-&gt; agentic-rl.md"]
  Comp -->|"No regression"| RP["PRIOR / POLICY gap:<br/>light SFT (Probe 8) or DPO/GRPO<br/>on this exact contrast<br/>-&gt; intervention-per-gap.md"]

  classDef verdict fill:#132b22,stroke:#34d399,color:#eafaf3;
  class Know,Explore,RP verdict;

14. The protocol, in order

StepProbeWhat you runCostDiscriminatesSection
0Corpus grep + free triagegrep -l amass runs/*/events.jsonl; verbalized P(IK)FreeRoutes you into the ladder — not a verdict§2
1Forced-logprob + recognitionTeacher-force expert command, read logprob/rank; MCQ, ≥3 paraphrasesOne forward passK-gap candidate vs. R/P-gap§3
2Pass@k sweepk=1,4,16,64,256; n≥4·k_max; ≥10 rephrasings; unbiased estimatorCheap samplingShape of support: flat-zero vs. plateaus§4
3In-context oracle + TFRInject expert command/flags verbatim; 3 privileged-context levels + empty-context controlCheap samplingTHE K-vs-P splitter§5
4Generation-vs-recognitionMCQ vs. open generation, position-randomized, own-rollout distractorsModerateConfirms P-gap vs. escalate§6
5Token-level top-5 rankPull top-5 logits at the exact decision tokenOne forward passCheap targeted RL/DPO fix vs. escalate§7
6Spurious-reward controlIdentical GRPO, real vs. shuffled reward, ~300 stepsMedium (training)Real discriminative signal vs. prior-amplification§8
7Pass@(k,T)Fix k sweep T, then fix T sweep k; simple vs. compositional segmentMedium (sampling, no training)R/P-gap vs. Exploration-collapse§9
8Minimal-parameter / few-shot-SFTUnfreeze ~100-10k random params, or rank 1-4 LoRA on 5-20 rowsCheap → mediumQuantitative recovery-cost calibration§10
9Elicitation ladderSynthesize 0-8: prompt → few-shot → light-SFT → Probe-6-gated RLEscalatingFinal verdict + cheapest working fix§11
Bottleneck CTFPurpose-built challenge, full-roster pass@k, solve-rate band readMedium (challenge authoring + sweep)Portfolio-level confirmation, not one-off anecdote§12

Refuse to collapse this into one sentence. Per framework.md §8’s own conclusion — restated here because it’s exactly as true at the single-decision-point granularity as at the challenge-portfolio granularity — report the verdict per decision point, segmented by whether it’s a simple or compositional structure. A skeptical reviewer will catch “F2/F3 is an execution gap” stated as a flat claim; “F2 is a confirmed P-gap (Probe 3 fixed it, Probe 5 confirms top-5, Probe 6 confirms real discriminative work) and F1 is unresolved pending framework.md §6.1’s fault labeling” is the defensible version.


  • Diagnosing the gap — a scientific framework — the theory this chapter operationalizes: full pass@k/Cover@τ/Pass@(k,T) derivations (§2), the elicitation-ladder genealogy (§5), the planning/state-management axis for F1-style symptoms (§6), and the RL-PLUS entropy-collapse mechanism this chapter’s Probe 7 leans on (§7).
  • ./taxonomy.md — the precise K/R/P definitions this chapter assumes; §0 is the canonical K/R/P ↔ knowledge/execution/exploration mapping this chapter’s §0 points to rather than re-derives.
  • ./intervention-per-gap.md — what to actually build once a probe returns a verdict: the R/P-gap DPO/GRPO row shape, the K-gap SFT-curation recipe.
  • ./knowledge-curation.md — the full K-gap data-row recipe (paraphrase volume, directional pairs, entity-connective text) once Probe 3 confirms a K-gap; not re-derived here.
  • ./trajectory-amplification.md — the forgetting/hallucination-amplification mechanics behind Probe 1’s caution against premature SFT on an unconfirmed K-gap.
  • The decision — the one-line version of the routing question both this chapter and framework.md expand on.
  • Contested edges & landmines §1, §7 — the crossover-test’s own contested status, referenced in §4 rather than re-argued.
  • Agentic & multi-turn RL — where the Exploration-collapse fix (on-policy RL, entropy preservation) is implemented once Probe 7 diagnoses it.
  • The kinds of SFT — the production data-curation pipeline Probe 8’s diagnostic light-SFT is explicitly not a substitute for.
  • Foundations: the one axis that predicts everything — the on/off-policy distinction underlying why oracle-injection (§5) and DPO/GRPO pairs must stay on-policy to be trustworthy.

Bibliography

idpaperroleconfidence
PMC7604508Firestone, Performance vs. Competence in Human–Machine Comparisons§0 vocabulary mappingHIGH
2301.06627Mahowald et al., Dissociating Language and Thought in LLMs§0 vocabulary mappingHIGH
2305.18290Rafailov et al., DPO§0 — load-bearing theorem for K vs R/PHIGH
2405.19550Greenblatt et al., Password-Locked Models§0, §10, §11 — elicitation-ladder anchorHIGH
2207.05221Kadavath et al., P(True)/P(IK)§2 — free verbalized-confidence triageHIGH
1911.12543Jiang et al., LPAQA prompt-sensitivity§3 — paraphrase-sweep, take maxHIGH
2104.08315Holtzman et al., Surface Form Competition§3 — normalize for synonym splitsHIGH
2310.16789Shi et al., Min-K% Prob§3 — catch one bad token in a fluent trajectoryHIGH
2405.05904Gekhman et al., Fine-Tuning on New Knowledge§3 — caution against premature SFTHIGH
2406.14785Ghosal et al., Understanding Finetuning for Factual Knowledge§3 — SFT-teaches-default-ignoring mechanismMED
2107.03374Chen et al., Codex/HumanEval§4 — origin of the pass@k unbiased estimatorHIGH
2504.13837Yue et al., RL Really Incentivize Reasoning?§4, §9 — crossover test (referenced, not re-derived)HIGH
2506.14245Wen et al., CoT-Pass@K§4 — contested rebuttal to the crossoverMED
2505.24864Liu et al. (NVIDIA), ProRL§4 — counter-evidence to pure-reweighting readingHIGH
2202.12837Min et al., Shuffled-Label ICL Control§4 — mandatory few-shot controlHIGH
2405.19874Zhao et al., ICL vs. Fine-Tuning§4 — ICL underperformance widens at scaleMED-HIGH
2404.11018Agarwal et al. (DeepMind), Many-Shot ICL§4 — dose-response framingHIGH
2510.08325Dragoi et al., Cover@τ§4 — discrete-answer-space guessing caution (referenced)MED
2605.07153Yang et al., RL Unlocks Parametric Knowledge§4 — small-k false-K-gap caution on pure recallLOW, promising
2605.15239Fu et al. (OPSA), On-Policy Self-Distillation§5 — Teacher Flip RateMED
2509.25666Chen, Peng et al. (NuRL), Nudging Boundaries§5 — full-hint underperforms abstract hintMED
2604.00698Xia et al. (HiLL), Learning to Hint§5 — mandatory hint-free re-validationLOW, promising
2606.16364Chen, Looking Is Not Picking§5, §7 — mechanistic tool-selection P-gap evidenceLOW, promising
2311.00059West et al., Generative AI Paradox§6 — generation/discrimination dissociationHIGH
2306.05685Zheng et al., LLM-as-Judge Bias§6 — position-randomization controlHIGH
2502.02180Hofstätter et al., The Elicitation Game§6, §10, §11 — MCQA vs. generative format dependencyMED
2605.06241Akgül et al., Sparse Policy Selection§7 — token-level top-5 rank checkLOW, promising
2506.10947Shao, Li, Xin, Geng et al., Spurious Rewards§8 — spurious-reward control, family-specificMED
2604.14877Zhai et al., Pass@(k,T)§9 — compositional segmentation (referenced, not re-derived)MED
2511.16231Yu, Pass@k as Diagnostic Not Objective§9 — mechanical-shrinkage confound on regression readingLOW
2412.01784Tice et al., Noise Injection Sandbagging§10 — calibration-harness noise-sweep controlMED
2406.07358van der Weij et al., AI Sandbagging§11 — negative control before declaring a hard ceilingHIGH
2604.22082Ryd et al., Removing Sandbagging via Weak Supervision§11 — SFT-then-RL orderingMED
2406.12045Yao et al., τ-bench§12 — pass^k deployment-facing complementHIGH

Cited but not counted as arXiv: OpenReview id Dkgx2pS4Ww (Donoway, Joren, Somani, Sleight, Michael et al., Quantifying Elicitation of Latent Capabilities in Language Models, NeurIPS 2025 poster) — §10, no confirmed arXiv mirror, cite cautiously.

Confidence calibration, restated: every id above is CONFIRMED in ledger-A.md or ledger-B.md; none is invented. Where section-A’s narrative referenced an id absent from either ledger (Verifier Gain, RankAlign, and two OpenReview-only ids with no ledger row), that material was dropped from this chapter rather than cited unverified — the load-bearing generation-vs-recognition claim in §6 rests on West et al. (confirmed, HIGH) instead.

What knowledge data actually looks like (once a K-gap is confirmed)

The question this chapter answers: once diagnosis has ruled in a knowledge gap — the model never emits the right fact/tool/flag at any sampling budget, and handing it the answer in-context fixes it zero-shot — what shape of file do you actually build? Not “paste the README into the system prompt and fine-tune on that.” Not “generate one help-page dump per tool.” Not “make it memorize a tool list.” BLUF, upfront: a fact that appears exactly once, in exactly one wording, in your training data is storable (the model can echo it back near-verbatim) but not extractable (it cannot answer a differently-phrased question about it) — feeding the README once is close to a null intervention, and no amount of downstream trajectory-level SFT repairs that gap once it’s baked in. Extraction has to be purchased at data-construction time: paraphrase volume, bidirectional coverage, and — for the specific “wrong tool, default not expert flags” failure this book keeps coming back to — execution-verified tool-CALL rows, not declarative prose. This chapter is the graded ladder from weakest to strongest, a worked training row at every rung, and the full production schema at the end.

Scope note, standing rule: every citation below is general ML/knowledge-injection literature. Nothing here leans on an academic cybersecurity-LLM paper — this book’s rule throughout, restated because this is exactly the chapter where it’s tempting to reach for a domain-specific “how we built our pentest corpus” paper instead of the general mechanism.


1. The load-bearing principle: one exposure ≈ zero extraction

Ground truth, from a controlled synthetic-biography corpus where the true answer is knowable and every exposure is countable: Allen-Zhu & Li’s Physics of Language Models Part 3.1 (arXiv:2309.14316) trains models on a biography dataset (bioS(N)) and measures closed-book QA accuracy against how many distinct wordings of each fact appeared during training. A fact seen in one wording: ~0-10% QA accuracy, independent of model size, training duration, or how much downstream instruction-tuning you throw at it afterward. Add ~5 diverse rewrites of the same fact and accuracy jumps to ~97%. Even sentence-permutation alone, with zero new wording — literally shuffling the clauses of the same sentence — already lifts extraction from 4.4% to 70%. The mechanism (linear-probe evidence in the same paper): without augmentation, the fact is encoded only at the local context hidden state around where it appeared, never bound to the entity-name token itself, so it can’t be retrieved by a query that doesn’t reproduce that exact local context.

The corollary that matters for this whole chapter: the paper’s own experiments show no amount of downstream instruction fine-tuning repairs an under-augmented base representation. SFT can teach the model how to answer, but if the fact was never bound to the entity token during pretraining/CPT, SFT has nothing to point at. This is the mechanistic answer to “does trajectory-level SFT amplify an unfixed knowledge gap” from the storage side: SFT inherits the storage format, it does not repair it (full amplification argument in Does trajectory SFT amplify an unfixed K-gap?).

The budget for how many exposures “enough” actually is: Part 3.3 (arXiv:2404.05405) measures raw storage capacity at ~2 bits of factual-tuple knowledge per parameter, achieved at roughly 1000 exposures per fact; drop to 100 exposures and capacity roughly halves to ~1 bit/param; junk-diluted corpora (1 useful token to 7 junk) cut capacity ~20×, partly recovered (~2×) by a consistent domain-marker prefix. (A differently-measured, higher raw-memorization ceiling of ~3.6 bits/param exists — Morris et al. — but that’s a random-bitstring membership-inference regime, the theoretical ceiling for arbitrary data, not the practical ceiling for genuinely extractable, augmented, structured knowledge; the two numbers aren’t in tension, they’re measuring different things.)

Why some facts are missing in the first place, before you even get to fixing it: Kandpal et al. (arXiv:2211.08411) show real-corpus QA accuracy correlates causally with how many pretraining documents mention the entities involved. amass is a smaller, less-frequently-discussed tool than subfinder on the open web relative to its actual capability — that’s plausibly why “amass covers passive-DNS/certificate-transparency sources subfinder’s defaults miss” ends up in a model’s blind spot: not an architectural limit, a training-corpus frequency artifact. That’s the diagnosis-side story; this chapter is the fix.

Build this: before writing a single training row, budget for hundreds, not one, exposures per fact — different wordings, different formats, different directions. If your curation plan has one row per fact, stop; you’re about to reproduce the 2309.14316 null result.


2. The graded ladder — six rungs, weakest to strongest

Six shapes of data, in increasing extraction reliability, each with a worked training row for the running example: “amass covers a passive-DNS/certificate-transparency source subfinder’s default flags miss, and subfinder has an expert flag-set (-active, -all, -rl, -oJ, …) the agent never reaches for.”

graph LR
  R0["Rung 0<br/>Raw doc<br/>(README / --help)"] -->|"~0% extraction<br/>2309.14316"| R1["Rung 1<br/>Paraphrase volume<br/>WRAP-style"]
  R1 -->|"fixes non-directional<br/>recall, NOT direction"| R2["Rung 2<br/>Forward+reverse<br/>synthetic QA"]
  R2 -->|"declarative fact ≠<br/>correct tool CALL"| R3["Rung 3<br/>Doc→tool-CALL<br/>rows (RAT + verified)"]
  R3 -->|"single facts, not<br/>chained reasoning"| R4["Rung 4<br/>Entity-pair<br/>connective text"]
  R4 -->|"external synthesis<br/>can drift/omit"| R5["Rung 5<br/>Self-play<br/>Self-QA"]

  style R0 fill:#3a1a1a,stroke:#f87171,color:#fee2e2
  style R3 fill:#132b22,stroke:#34d399,color:#eafaf3

2.0 Rung 0 — raw docs are source material, never a training target

The README, --help output, man page, OpenAPI spec: these are the input to a curation pipeline, never trained on directly and unaugmented. Ovadia et al.’s RAG-vs-FT study (arXiv:2312.05934) is the floor to beat: unsupervised fine-tuning on raw domain text consistently loses to simple retrieval-augmented generation on knowledge-injection tasks — training on the raw doc doesn’t even reliably clear the bar a zero-training RAG pipeline sets for free. Cheng et al.’s AdaptLLM (arXiv:2309.09530) diagnoses why directly: continued pretraining on raw domain text does inject some knowledge, but “drastically hurts prompting ability for QA” — the model gets worse at being asked things, even about the material it just trained on, unless every raw chunk is paired with task-formatted continuations before CPT.

// NOT a training row — CPT/curation SOURCE MATERIAL ONLY, never the target
{
  "source_id": "subfinder-help-v2.7.1",
  "raw_text": "$ subfinder -h\nFlags:\nINPUT:\n   -d, -domain string[]   domains to find subdomains for\nSOURCE:\n   -s, -sources string[]  specific sources to use for discovery\n   -recursive             use only recursive subdomain enumeration sources\n   -all                   use all sources for enumeration (slow)\nFILTER:\n   -active                display active subdomains only\nOUTPUT:\n   -oJ, -json             write output in JSONL(ines) format\n   -rl, -rate-limit int   maximum number of http requests to send per second"
}

This never appears as an assistant target. It’s the thing every downstream rung is derived from.

2.1 Rung 1 — paraphrase volume (WRAP-style)

Maini et al.’s WRAP (arXiv:2401.16380) paraphrases noisy web text into several styles (including explicit “QA format”) and joint-trains real+synthetic: ~3× pretraining speedup, >10% perplexity gain, >2% zero-shot QA gain at fixed compute. This is the direct fix for the 2309.14316 null result — turn one raw doc into several differently-worded statements of the same fact.

Rephrase count is not free of diminishing returns: a very recent Stanford result (arXiv:2603.18534, promising, not yet independently validated) finds rephrase-count efficiency saturates around ~32 rewrites per document, and that packing those 32 rewrites into one long megadocument (rather than 32 separate short training examples) pushes efficiency further (~1.48× → ~1.8×). Practical read: don’t stop at 5, and don’t naively keep generating past ~32 either — and prefer packing multiple rewrites into a single training sequence over one-rewrite-per-row.

// Rung 1 — same fact, 4 of ~20-32 total rewrites, task-formatted per AdaptLLM (2309.09530)
[
  {"messages": [{"role": "user", "content": "What's the -all flag on subfinder for?"},
    {"role": "assistant", "content": "-all tells subfinder to query every configured source, not just the fast/default subset — slower, broader coverage."}]},
  {"messages": [{"role": "user", "content": "True or false: subfinder's default run queries every available source."},
    {"role": "assistant", "content": "False. The default subset is a faster subset; -all opts into every configured source."}]},
  {"messages": [{"role": "user", "content": "To get subfinder's broadest possible source coverage, which flag do you add?"},
    {"role": "assistant", "content": "-all — it enables every configured source instead of the default fast subset."}]},
  {"messages": [{"role": "user", "content": "I ran subfinder with no flags and got fewer subdomains than expected. Why, and how do I fix it?"},
    {"role": "assistant", "content": "Default subfinder uses a fast subset of sources, not all of them. Add -all to query every configured source for broader (slower) coverage."}]}
]

Still not fixing directionality — see rung 2.

2.2 Rung 2 — doc → synthetic QA, forward AND reverse

Paraphrase volume fixes non-directional recall. It does not fix a structurally separate failure: the Reversal Curse. Berglund et al. (arXiv:2309.12288) train on “A is B” and show P(correct | “B is ?”) is statistically indistinguishable from a random-name baseline — and, critically, the authors’ own tested augmentations do not fix this. Kitouni et al.’s Factorization Curse (arXiv:2406.05183) generalizes this: it’s a failure to learn the same joint distribution under different token-order factorizations, and it survives scale, reversed-token training, and naive bidirectional attention. Lin et al. (arXiv:2410.18808) narrow it further and give the actionable lever: generalization to the reverse direction is gated by training-document structure (“[Name] is [Description]” reverses one way, not the other) — and works fine when both directions are given jointly in one training example. (A very recent mechanistic follow-up, arXiv:2604.04943, promising, not yet independently validated, shows bidirectional-objective tricks like masked reconstruction do raise reversal accuracy behaviorally — but by storing forward and reverse as two separately-indexed representations, not one shared direction-agnostic fact. You’re not getting free generalization, you’re paying for a second copy.)

Practical rule: write both directions explicitly, as separate rows, in the same batch.

// Rung 2 — forward and reverse, SAME fact, explicit both ways (2309.12288 fix)
{"messages": [
  {"role": "user", "content": "Does amass or subfinder pull from certificate-transparency logs by default?"},
  {"role": "assistant", "content": "amass — its default enumeration includes CT-log and passive-DNS sources. subfinder's default source set is narrower and can miss what CT logs surface unless you widen it with -all."}
]}
{"messages": [
  {"role": "user", "content": "Which tool should I reach for if I specifically need certificate-transparency coverage that subfinder's defaults don't include?"},
  {"role": "assistant", "content": "amass — run it in passive mode (amass enum -passive -d <target>) to pull CT-log and passive-DNS sources subfinder's default set doesn't cover."}
]}

2.3 Rung 3 — doc → tool-CALL examples: the highest-value rung for “wrong flags”

This is the rung that directly answers “the agent reaches for one salient tool, uses default not expert arguments” — declarative QA about a flag is not the same skill as emitting the call. Patil et al.’s Gorilla (arXiv:2305.15334) is the founding recipe: scrape real API docs, Self-Instruct-generate NL questions per doc entry, grade candidate calls by AST-subtree match against the schema — and, the single most important mechanism here, Retriever-Aware Training (RAT): the doc schema stays in-context at train time, not just at data-generation time. The learned skill becomes “read this schema, emit this call,” not “this exact instruction maps to this memorized call” — which is what lets it generalize to an updated flag set with no retraining, and is why raw doc-only fine-tuning (rung 0) hallucinates calls that Gorilla-style RAT training doesn’t. Hsieh et al. (arXiv:2308.00675) independently confirm the context-side of this: zero-shot prompting with only the tool docs in context matches or beats few-shot demonstrations once the tool count grows — reinforcing “the schema belongs in context, not memorized as a fact.”

Qin et al.’s ToolLLM (arXiv:2307.16789) scales this to 16,464 real API docs and adds the piece that matters for multi-step agentic data specifically: curate the trajectory, not just the terminal call, via a depth-first search decision tree (DFSDT) so failed/incomplete reasoning branches get pruned before they become training data.

The 2024-2025 cluster hardens the verification step into a formal pipeline. Liu et al.’s APIGen (arXiv:2406.18518) runs candidate calls through 3-stage verification — format check, execution check, semantic check — before a row survives; a 7B model trained on the output beats GPT-4 variants on BFCL. Liu et al.’s ToolACE (arXiv:2409.00920) self-evolves a synthetic pool of 26,507 diverse API specs under a dual rule-based+model-based verifier, deliberately covering argument-shapes real scraped docs don’t have. Two very recent papers name the “default not expert flags” symptom almost literally: Yin et al.’s Magnet (arXiv:2503.07826) builds a graph over function signatures and walks reliable multi-tool signature-paths — the concrete fix for “reaches for one tool, not the complete expert set.” Greenstein et al. (arXiv:2601.17829, very recent, promising, single paper, not yet independently replicated) is a direct critique of the entire prior lineage: every pipeline from Gorilla through ToolACE optimized query/function/turn-count diversity but left argument-VALUE coverage underexplored — does the corpus actually range over -rate-limit’s valid integer domain, or does every row use the canonical default? This is the most literal match to “uses default not expert arguments” in the current literature, and it’s genuinely unresolved.

// Rung 3 — verified tool-CALL row. Schema in context (RAT), never the loss target.
{
  "system": "Tools available: subfinder(domain, sources?, active?, all?, rate_limit?), amass(domain, mode: 'passive'|'active', sources?). Find subdomains for the target, preferring the source set with the broadest coverage.",
  "messages": [
    {"role": "user", "content": "Enumerate subdomains for corp-target.com — I need CT-log and passive-DNS coverage, not just the fast default set."},
    {
      "role": "assistant",
      "content": "subfinder's default source set is narrower than what's needed here; amass's passive mode explicitly covers CT-log and passive-DNS sources. Running amass first.",
      "tool_calls": [{"id": "call_1", "type": "function",
        "function": {"name": "amass", "arguments": "{\"domain\": \"corp-target.com\", \"mode\": \"passive\"}"}}]
    },
    {"role": "tool", "tool_call_id": "call_1", "content": "{\"subdomains\": [\"vpn.corp-target.com\", \"staging-api.corp-target.com\", \"...\"], \"source_count\": 14}"},
    {
      "role": "assistant",
      "content": "Widening with subfinder -all to cross-check against amass's results and catch anything CT-log/passive-DNS misses.",
      "tool_calls": [{"id": "call_2", "type": "function",
        "function": {"name": "subfinder", "arguments": "{\"domain\": \"corp-target.com\", \"all\": true, \"rate_limit\": 20}"}}]
    },
    {"role": "tool", "tool_call_id": "call_2", "content": "{\"subdomains\": [\"vpn.corp-target.com\", \"dev.corp-target.com\"], \"source_count\": 22}"}
  ]
}

This row was executed and verified (APIGen’s format → execution → semantic checks) before it entered the set — never hand-authored, the same confabulation risk The kinds of SFT §4 already names for trajectory data generally. Loss masked to assistant turns only — same rule as The kinds of SFT §5.1: the model must learn to produce the call, not to predict the tool’s output.

2.4 Rung 4 — entity-pair connective text (chaining/manipulation questions)

Even perfectly extractable single facts fail at manipulation — classification, comparison, inverse search across two facts — without explicit training on the relationship. Physics 3.2 (arXiv:2309.14402) shows this precisely: knowledge that’s individually stored and extractable can still fail at “which of these two applies here” unless chain-of-thought is used at both train and inference time, or the relationship itself was trained explicitly. This is exactly the “does amass’s output feed usefully into subfinder’s next pass, or should I just use one or the other” question — a chaining question about two entities, not a fact about either alone.

Yang et al.’s EntiGraph (arXiv:2409.07431) is the concrete recipe for small corpora specifically — the tool/API-doc regime, not internet-scale: extract salient entities from the source docs, then prompt an LLM (kept grounded in the source, to prevent confabulation) to generate diverse text explicitly connecting entity pairs that never co-occur in one source sentence. On a small source corpus (1.3M tokens) this produced 455M synthetic tokens (~350×) with log-linear QA-accuracy scaling as synthetic volume grows — and, the operationally important claim, the resulting parametric knowledge composes with RAG at inference rather than competing with it, so this isn’t an either/or against keeping the schema retrievable too.

// Rung 4 — entity-pair connective text: amass and subfinder never co-occur in either tool's own docs
{"messages": [
  {"role": "user", "content": "When would I run both amass and subfinder on the same target, in what order, and why?"},
  {"role": "assistant", "content": "Run amass in passive mode first — it pulls certificate-transparency and passive-DNS sources subfinder's default set misses, giving broader initial coverage. Then run subfinder -all as a second pass over the same target: its source list partially overlaps but isn't identical, so the union catches names either tool alone would miss. Running subfinder alone with default flags is the failure mode: narrower source set, and no cross-check against amass's CT-log coverage."}
]}

Cheap A/B before building EntiGraph-style tooling. Whether the entity-graph structure is actually the load-bearing ingredient, or whether large-volume prompt-engineered paraphrase without any relational structure gets you most of the way there for less engineering, is genuinely open: Tang, Wang, Wang & Lyu’s SPA (arXiv:2603.22213, very recent, ~0 citations, promising) reports a simple, heavily-prompted paraphrase baseline is “tough to beat,” including against structured approaches. Worth a cheap pilot on a handful of facts before committing engineering time to full entity-pair extraction.

2.5 Rung 5 — self-play Self-QA

Park, Zhang & Tanaka’s “New News” (arXiv:2505.01812) closes the fine-tune-vs-in-context gap with a self-play recipe: feed the model the raw fact in-context, have the model itself generate paraphrases/implications/QA pairs about it, then train on the model’s own output rather than an externally-authored rewrite. This sidesteps a real fidelity risk the paraphrase-generation literature has flagged directly: Yu & Xiong’s RePro (arXiv:2510.10681, promising, single-lab) measures that a naively-prompted rephraser (even a 70B one) measurably omits or contradicts source facts — a concrete warning against blind rung-1/rung-2 generation without a fidelity check. Self-play with the fact held in-context during generation, or an explicit faithfulness-scored rephraser, is the mitigation. One budget-relevant finding worth carrying into whichever rung does the generating: Niklaus et al.’s 1T-token study (arXiv:2604.13977, very recent) finds structured rephrase formats (tables/FAQ/tutorials — closer to how a tool doc is already shaped) consistently beat prose-style rephrase, and that generator model size beyond ~1B parameters gives no additional benefit — you don’t need your biggest available model to do rungs 1, 2, or 5’s generation work.

// Rung 5 — self-play: raw doc in-context, model generates its own QA, THAT becomes the training row
// Generation step (not trained on): model sees raw --help text in context, asked "generate 5 QA pairs
// covering this flag's purpose, its opposite/default behavior, and when you'd reach for it."
// Training step: the model's OWN output, filtered for faithfulness against the source, becomes the row —
// same shape as the Rung 1/2 examples above, but self-generated rather than externally authored.

2.6 CPT sizing: LR schedule, mix ratio, token multiplier

When rungs 0-1 are run as an actual continued-pretraining stage (not just an SFT-format QA pass), three additional hyperparameters determine whether the run helps or just destabilizes the model:

  • Token multiplier. §1’s ~1000-exposures/fact budget (arXiv:2404.05405) implies a small raw source corpus (a handful of --help outputs and READMEs) cannot supply nearly enough exposure on its own — expect to expand the raw corpus 10-100× via rungs 1-4 synthesis before a fact clears the extraction bar, not the 3-5× a quick single paraphrase pass might produce.
  • LR schedule. Ibrahim et al. (arXiv:2403.08763) give the mechanics that keep continued pretraining from catastrophically forgetting: re-warm the LR to a meaningful fraction of the original peak (never continue training at the fully-annealed end-of-pretraining LR), run a fresh decay sized to the actual CPT token budget, and replay a non-zero slice of general-distribution data every batch. Validated 405M-10B params; no single universal replay ratio is established — treat it as a per-corpus sweep, not a constant to copy.
  • Mix ratio. Kang et al.’s >1000-LLM controlled study (arXiv:2510.01631) is the scale-corrective for rung 1’s WRAP recipe specifically: pure rephrased-synthetic pretraining is not faster than natural data at scale; the real gain comes from a ~30% synthetic / 70% natural mix, and fully-generated “textbook-style” synthetic data shows model-collapse-like degradation at scale that rephrase-type synthetic does not. For a tool-doc corpus this is more a caution than a direct prescription (the corpus is domain-narrow by construction, not a general-pretraining replacement) — but it argues against ever going 100% synthetic even within the narrow domain: keep the raw-doc-derived rungs 0-2 rows in the final mix alongside rungs 3-5, don’t fully replace them.

3. QA-format beats doc-format at the SFT stage

A frontier-scale (Gemini-1.5) ablation directly settles the “should I keep training on doc-shaped text at the SFT stage, or convert everything to QA” question: Zhao, Awasthi & Haghtalab (arXiv:2503.05919) find QA-formatted training rows generalize knowledge far better than document/article-style rows at the fine-tuning stage — the “task customization vs. knowledge injection” framing some prior work treated as separate problems turns out to be largely a data-format artifact once you control for it. The paper also flags two gotchas worth carrying into curation: numeric facts (rate limits, thread counts, timeouts) are harder to retain than categorical ones (flag names, source names) — budget more rephrasings for numeric args — and fine-tuned knowledge often fails to compose into multi-step reasoning even when the individual fact is retained cleanly, which is exactly why rung 4’s connective text is a separate rung, not automatic once rungs 1-3 are done.

Practical consequence for the doc-format-heavy stages (rung 0-1): convert to QA before spending rung 1’s paraphrase budget — don’t paraphrase in doc-prose form and hope the SFT stage handles the format shift for free.


4. Pre-screen before you spend curation budget

Not every candidate fact is worth the full rung-3/4 treatment — some are already known, some are genuinely absent, and running the expensive pipeline on both wastes budget and, per §5, actively risks damage on the already-known ones. Two complementary pre-screens:

Cheap, zero-generation: Gottesman & Geva’s KEEN probe (arXiv:2406.12673) trains a linear probe on the hidden state at the entity-mention position — zero tokens generated — and predicts downstream QA accuracy for that fact. Use it to triage which facts/tools are worth the expensive rung-3/4 pipeline before spending it. Caveat, load-bearing: Cheang et al. (arXiv:2510.09033) show internal-state probes like this mostly track the model’s recall confidence, not ground-truth correctness — a confidently-recalled but wrong association about amass’s flag set would score as “known” by KEEN alone. Pair it with a ground-truth check; never trust the probe by itself.

The ground-truth check itself — SliCK categorization, per Gekhman et al. (arXiv:2405.05904): score each candidate fact via 1 greedy (T=0) decode + 8-16 sampled (T=0.7-1.0) decodes against the gold answer, then bucket:

BucketSignatureCuration action
HighlyKnownGreedy + nearly all samples correctSafe to SFT with the literal factual target as-is
MaybeKnownGreedy correct, some samples wrongSafe to SFT as-is; monitor
WeaklyKnownGreedy wrong, some samples correctDo NOT supervise a confident target — see §5
UnknownNever correct, at any sampled decodeGenuine K-gap row; full rung 3-4 treatment, plus §5’s guard

Run this on every atomic fact/argument/flag a tool-call trajectory row depends on, not just the trajectory’s final outcome — a trajectory can look “known” because the challenge was solved in the demo while individual intermediate steps reference Unknown facts, and training on the full trajectory teaches the model to project HighlyKnown-style confidence onto those Unknown steps too (the mirroring mechanism, §5).


5. The confabulation guard

Two convergent, causally-demonstrated results say the same thing from different angles: supervising a confident target on a fact the model doesn’t actually know teaches it to be confidently wrong elsewhere, not just on that fact.

  • Gekhman et al. (arXiv:2405.05904) — SFT rows requiring genuinely new (“Unknown”) facts are fit markedly slower by gradient descent than knowledge-consistent rows, and once they are fit, they increase hallucination on other, unrelated, previously-known facts, approximately linearly in their fraction of the training mix. This is the direct causal mechanism behind “does trajectory-level SFT amplify an unfixed knowledge gap” — yes, and the damage isn’t contained to the new fact.
  • Kang, Wallace & Levine (arXiv:2403.05612) — the shape of supervision given on unfamiliar training rows becomes the model’s default template for unfamiliar inputs generally, and this transfers to unseen unfamiliar queries at inference. If your Unknown rows are supervised with a confident, specific, made-up-looking answer, the model learns “when unsure, sound confident and specific” as a general policy — a training-induced version of the exact confabulation pattern The kinds of SFT §4 names for synthetically-authored tool trajectories, but arriving via the knowledge axis instead of the execution axis.
  • Kaplan, Gekhman et al.’s 2026 follow-up (arXiv:2604.15574, very recent, single-lab, promising) localizes the mechanism further: SFT-induced hallucination is driven mainly by representational interference — a new fact about amass corrupts existing knowledge about semantically overlapping entities (other recon tools, subfinder itself) — not pure capacity limitation. The highest-risk rows are new facts about entities that sit close in representation space to well-known ones, which is precisely the amass/subfinder pair. Ghosal, Hashimoto & Raghunathan (arXiv:2406.14785) give the behavioral symptom: fine-tuning on lesser-known-but-true facts teaches the model to ignore the specific entity token and emit a generic plausible response instead, degrading downstream factuality 5-10% even when the correct value is still technically encoded in weights. Zucchet et al. (arXiv:2503.21676) independently find hallucination emerges simultaneously with new-fact learning in phases, not as a later side-effect — the damage isn’t a delayed cost, it happens as the fact is being learned. Dang et al. (arXiv:2511.02626) refine the risk model one more notch: it’s the unfamiliarity of an entire knowledge type, not the proportion of unfamiliar rows in the mix, that predicts damage — a curriculum implication.

The guard, concretely, per WeaklyKnown/Unknown row:

  1. Relabel the target, not the row’s existence. Per Kang et al. and R-Tuning (arXiv:2311.09677), instead of a confident factual assertion, the supervised target becomes an explicit hedge (“I’m not certain of amass’s exact default source list — check amass enum -h before assuming”) or a tool-lookup deferral (emit a --help/doc-fetch call instead of a declarative answer). Wu et al.’s uncertainty-aware fine-tuning (arXiv:2502.11962) gives the other legitimate option: drop the row entirely rather than relabel, if a hedge target itself risks teaching over-hedging on genuinely knowable facts.
  2. Add a self-distillation / KL regularizer against the pre-SFT policy, computed on a replay set of already-HighlyKnown prompts:
# per Kaplan/Gekhman 2604.15574 — guard against new-fact rows eroding adjacent known facts
loss = sft_loss(new_and_task_rows) \
     + lam * kl_divergence(policy(replay_prompts), frozen_pre_sft_policy(replay_prompts))
# replay_prompts = a held-out HighlyKnown set (per §4's SliCK bucket), NOT the new-fact rows themselves
# frozen_pre_sft_policy = a snapshot taken before this SFT run starts, never updated
  1. Gate on a canary set before shipping. Hold out HighlyKnown pre-SFT facts (including some totally unrelated to the new material), re-run the SliCK probe post-SFT with the identical protocol. A drop here is the real hallucination signal — a required gate, not an optional ablation.

Build this: the confabulation guard isn’t optional polish on top of the data ladder — it’s the difference between “K-gap fixed” and “K-gap fixed, R-gap introduced on five adjacent tools you didn’t touch.” Run it on every Unknown/WeaklyKnown row, every time.


6. CPT-then-knowledge-SFT vs RAG — and where LoRA fits

The decision that actually matters before you write any row: does this knowledge belong in weights at all, or is a retrieval/tool-lookup path cheaper and safer? The literature is genuinely split, and it’s split along a specific, checkable axis — data format, not a law about fine-tuning itself.

  • RAG wins, in the naive-FT regime. Ovadia et al. (arXiv:2312.05934): unsupervised fine-tuning on raw text consistently loses to RAG on knowledge-injection benchmarks. This is rung 0’s floor, restated as a decision rule: if your curation plan stops at “raw doc + fine-tune,” don’t bother — put the doc in a retrieval index instead.
  • A heavily-augmented synthetic pipeline can beat RAG. Han et al.’s Synthetic Mixed Training (arXiv:2603.23562, very recent, promising) combines synthetic QA with synthetic docs (not QA alone) and reports beating a RAG oracle on parametric knowledge acquisition — but this is the rung 1-5 pipeline in this chapter, not naive rung-0 fine-tuning. The Zhao/Awasthi/Haghtalab QA-format result (§3, arXiv:2503.05919) is the likely reconciling mechanism, though neither paper states it explicitly: it’s not “fine-tuning vs RAG,” it’s “unsupervised raw-text fine-tuning vs RAG” that RAG wins, and “properly augmented QA-format fine-tuning vs RAG” is a much closer, workload-dependent fight.
  • The theoretical argument for why tool-facts specifically should default toward tools, not weights. Houliston et al. (arXiv:2508.20755, promising, <1yr) prove in-weight factual memorization is provably parameter-bounded (this is the 2-bit/param ceiling from §1, restated as a design constraint) while in-tool/retrieval learning is provably unbounded. For a pretrained agent, teaching general tool-use rules beats fine-tuning specific facts into weights — this book’s “knowledge in tools, not weights” project rule, independently re-derived. The practical instantiation: the tool schema/doc block goes in every training row’s context (rung 3’s RAT design), never as the loss target; the loss stays masked to the decision (which tool, which of the valid args), never to memorizing the argument space as free-standing fact.
  • CodeUpdateArena is the cleanest real-analogue triangulation. Liu et al. (arXiv:2407.06249) test the closest available proxy for “a tool’s flags changed”: fine-tuning a code LLM on an API update’s raw documentation text does not transfer into applying the update during generation; prepending the identical text in-context (RAG) does work; fine-tuning on curated usage examples (rung 3’s shape — exercising the update inside a solved problem) shows real improvement over docs-only fine-tuning. This triangulates cleanly across three independent lines: Physics 3.1’s augmentation requirement (§1), Gorilla’s RAT design (§2.3), and this chapter’s whole argument that doc-format alone is close to inert.

Where LoRA fits — contested, lean weak-at-injection. Salnikov’s direct test (arXiv:2502.14502, “How much knowledge can you pack into a LoRA adapter without harming the LLM?”) measures LoRA’s knowledge-injection ceiling directly and finds it materially below full fine-tuning’s — a sharper, injection-specific instrument than the general PEFT-forgetting trade-off The kinds of SFT §6 already covers (LoRA learns less, forgets less, per that chapter’s own citation ledger). Contested, per this survey’s own ledger: whether LoRA is categorically weak at knowledge injection, or whether that’s specific to naive low-rank adapters and newer subspace-targeted PEFT variants close the gap, is unresolved — treat “LoRA can’t inject knowledge” as an overstatement of a real but narrower effect, not an exclusion rule. If the constraint is “don’t overwrite unrelated capability while injecting this,” LoRA remains the right lever for the behavioral rungs (3-4) even if it underperforms full-FT for raw declarative-fact density.

The decision, compressed:

Your situationRoute
Knowledge changes often, low latency budget for a lookupRAG / tool-call lookup — cheapest, no injection risk at all
Knowledge is stable, small corpus, needs to survive without retrieval at inferenceCPT (rung 0→1, heavy augmentation) then knowledge-SFT (rung 2), full pipeline per §1’s exposure budget
The gap is “wrong tool / wrong flags,” not “doesn’t know a static fact”Rung 3 tool-CALL rows with schema-in-context (RAT) — the fact never needs to live in weights at all
Constrained to preserve unrelated capability hardestLoRA on rungs 3-4 behavioral data; expect a real but bounded ceiling on raw fact density vs full-FT

7. The full worked K-gap data row (production schema)

Once §4 has confirmed Unknown/WeaklyKnown and §6 has decided “this belongs in weights,” the per-fact row assembles every rung above into one object — this is the same shape the survey’s own operational recipes converge on independently across themes A/C/E; this chapter’s contribution is the why and the worked content at each field, not a novel schema:

{
  "fact_id": "amass-passive-ct-coverage-vs-subfinder-default",
  "source": "amass README §Passive Enumeration; subfinder --help SOURCE block",  // rung 0, never trained raw
  "slick_bucket": "Unknown",                                                    // §4 gate result
  "keen_score": 0.14,                                                           // §4 cheap pre-screen, corroborated by slick_bucket per 2510.09033's caveat
  "rephrasings": [                                                              // rung 1, ~20-32 per 2603.18534
    "amass enum -passive pulls CT-log and passive-DNS sources subfinder's default set doesn't include.",
    "subfinder's default flags query a fast source subset; -all widens it but still isn't identical to amass's passive-mode coverage.",
    "... (18-30 more diverse rewrites, packed into a megadocument per 2603.18534) ..."
  ],
  "directional_pairs": [                                                        // rung 2, per Reversal Curse 2309.12288
    {"forward": "What does amass's passive mode cover that subfinder's defaults miss?",
     "answer": "CT-log and passive-DNS sources."},
    {"reverse": "Which tool/mode do I need for CT-log coverage subfinder's defaults don't provide?",
     "answer": "amass, in passive mode (amass enum -passive)."}
  ],
  "tool_call_rows": [ /* rung 3 — see §2.3's full worked example; execution+semantic verified, APIGen-style */ ],
  "entity_pair_connectives": [ /* rung 4 — see §2.4's worked example, amass→subfinder chaining */ ],
  "unfamiliarity_flag": true,                                                   // from slick_bucket, corroborated not solely-probe-derived
  "supervision_target_mode": "confident",                                       // "confident" only because rungs 1-4 above cleared the bar;
                                                                                 // if still Unknown after curation, flip to "hedge" per §5
  "kl_regularizer": {"replay_set": "highly_known_canary_v3", "lambda": 0.1},    // §5's confabulation guard, always attached for Unknown-origin rows
  "post_sft_canary_check_required": true                                        // §5's gate — block ship without re-running SliCK on the canary set
}

8. Directly answering the three questions

  • “Do I feed the README?” Once, raw, unaugmented — no. §1’s null result (arXiv:2309.14316) and §6’s RAG-vs-FT floor (arXiv:2312.05934) both say this buys close to nothing over a zero-training retrieval index, and can actively hurt QA-ability per AdaptLLM’s finding (§2.0, arXiv:2309.09530). The README is rung 0: source material for the pipeline, never a training target — if you’re not going to build the pipeline, put it in RAG instead of training on it.
  • “Do I generate help pages?” Yes — but not as one help-page-shaped document per tool. Convert to §3’s QA format, generate the §2.1 paraphrase volume (~20-32/fact), the §2.2 forward+reverse pairs, and — the highest-value step for “wrong tool, wrong flags” specifically — the §2.3 execution-verified tool-CALL rows with the schema kept in context (RAT), not memorized as declarative text. Help-page content becomes many differently-shaped rows, most of which aren’t prose at all.
  • “Do I make it memorize a tool list?” Only as many diversified rows, across many contexts and both query directions, covering the full argument-value range — never as one verbatim list. A single memorized list is exactly rung 0’s failure mode restated (one exposure, one wording) and specifically fails the “expert flag-set” symptom this chapter opened with: Greenstein et al. (§2.3, arXiv:2601.17829) show the entire prior tool-synthesis literature under-covered argument values, not just tool/query diversity — a memorized list of flag names with no rows exercising their actual valid ranges reproduces that exact gap.

9. Not a shortcut: knowledge editing (ROME/MEMIT) on tool facts

The obvious-looking cheap alternative to this whole ladder — “just patch the fact into the weights with a closed-form edit, skip the data pipeline” — is worth naming and ruling out explicitly, because it fails specifically on the tool/API-fact analogue rather than being generically weak. Yang et al.’s “Mirage of Model Editing” (arXiv:2502.11177) shows ROME/MEMIT’s reported ~96.8% editing success is inflated by teacher-forced evaluation (the ground-truth content and length leak into the “test”); under honest free-generation evaluation, success drops to 38.5%, and sequential edits collapse catastrophically by ~1000 edits. Chhetri, Siddique & Farooq (arXiv:2511.03182) run the direct empirical test on the closest available proxy for “a tool’s flag changed”: applying ROME/MEMIT/PMET/GRACE to code LLMs under controlled API-deprecation edits drops syntactic validity up to 86 percentage points and functional correctness up to 45pp, and correct adoption of the intended change occurs in only ~6% of passing generations — most “passes” are workarounds that avoid the edited fact entirely, not evidence the edit worked.

Reading this pattern (near-perfect on the probability/cloze probe, near-total failure on free generation) is itself diagnostically useful, independent of whether you’d ever ship an edit: if even a causally-traced, surgical weight edit can’t produce correct generation behavior for a fact, that’s evidence the underlying gap has an execution/policy shape layered on top of the knowledge shape, not pure knowledge absence — worth a note back to diagnosis before concluding the ladder above is even the right tool. Treat editing as a throwaway dev-time patch at most, never a production pipeline for “as tool flags change, patch them in” — the ladder in §2, however slower, is what a shipped fix runs on.


  • Diagnosing a K-gap — the confirmation step this chapter assumes already passed: never start rung 1 without first clearing the in-context-oracle probe (fixed near-zero-shot when the fact is handed over) and the never-appears-at-any-N pass@k check.
  • Diagnosing the gap — a scientific framework — the fuller instrument set (Pass@k / Pass@(k,T) / Cover@τ, the elicitation ladder) that chapter runs to produce the confirmed-K-gap verdict this chapter starts from.
  • The kinds of SFT — it is the data, not the algorithm — general SFT data-shape taxonomy: §5.2 covers Knowledge/Q&A rows at survey depth, §6 covers data-selection/curation generally, §4 names the synthetic-trajectory confabulation risk §5 above extends to the knowledge axis. This chapter is the deep, K-gap-specific expansion of that §5.2 cell.
  • Does trajectory SFT amplify an unfixed K-gap? — the full causal chain behind §1’s corollary and §5’s guard; this chapter cites the load-bearing papers, that one is the dedicated treatment.
  • Generic data-selection methods — IFD/LESS/DEITA-style selection applies within whichever rung’s row pool you’ve generated here, orthogonal to which rung you picked.
  • The decision — the one-line routing tree this gaps/ series hangs off of; “knowledge gap → inject off-policy” is the branch this chapter fully unpacks.
  • Contested edges & landmines — the broader LoRA-vs-full-FT and RAG-vs-FT disputes referenced in §6.

Bibliography

arXiv idPaperRole in this chapter
2309.14316Physics of LM 3.1 — Knowledge Storage and Extraction§1 root: one exposure ≈ 0% extraction
2404.05405Physics of LM 3.3 — Knowledge Capacity Scaling Laws§1: ~2 bits/param, ~1000-exposure budget
2505.24832How much do language models memorize? (Morris et al.)§1: differently-regime ~3.6 bits/param ceiling
2211.08411LLMs Struggle to Learn Long-Tail Knowledge (Kandpal et al.)§1: pretraining-frequency root cause
2312.05934Fine-Tuning or Retrieval? (Ovadia et al.)§2.0/§6/§8: RAG-vs-naive-FT floor
2309.09530AdaptLLM — Adapting LLMs to Domains via Reading Comprehension§2.0/§8: raw CPT hurts QA without task-formatted augmentation
2401.16380WRAP — Rephrasing the Web§2.1: paraphrase-volume recipe
2603.18534Data-efficient pretraining by scaling synthetic megadocs§2.1/§7: rephrase-count saturation ~32/doc, promising/unvalidated
2309.12288The Reversal Curse (Berglund et al.)§2.2/§7: directionality not fixed by paraphrase alone
2406.05183The Factorization Curse (Kitouni et al.)§2.2: generalizes reversal to token-order factorization
2410.18808Delving into the Reversal Curse (Lin et al.)§2.2: document structure gates reversal generalization
2604.04943The Illusion of Latent Generalization§2.2: bidirectional objectives store two separate reps, promising/unvalidated
2305.15334Gorilla§2.3/§6: RAT — schema in context at train time, not memorized
2308.00675Tool Documentation Enables Zero-Shot Tool-Usage§2.3: doc-in-context matches/beats demonstrations at scale
2307.16789ToolLLM / ToolBench§2.3: trajectory-level curation via DFSDT pruning
2406.18518APIGen§2.3: format→execution→semantic 3-stage verification
2409.00920ToolACE§2.3: synthetic argument-shape coverage + dual verifier
2503.07826Magnet§2.3: multi-tool signature-path chaining
2601.17829Linguistic and Argument Diversity in Function-Calling Data (Greenstein et al.)§2.3/§8: argument-VALUE coverage gap, very recent/promising
2409.07431Synthetic continued pretraining / EntiGraph§2.4: entity-pair connective text for small corpora
2309.14402Physics of LM 3.2 — Knowledge Manipulation§2.4: manipulation/chaining fails without explicit training
2505.01812New News — System-2 Fine-tuning (Park et al.)§2.5: self-play Self-QA
2510.10681RePro§2.5: naive rephrasers omit/contradict facts, promising
2604.13977Systematic Study of Prompt Design for Synthetic Pretraining Data / FinePhrase (Niklaus et al.)§2.5: structured formats beat prose; generator size >1B gives no benefit
2603.22213SPA — A Simple but Tough-to-Beat Baseline for Knowledge Injection (Tang et al.)§2.4: contested — prompted paraphrase may rival entity-graph structure
2503.05919From Style to Facts (Zhao, Awasthi, Haghtalab)§3/§6: QA-format beats doc-format at SFT stage
2406.12673KEEN (Gottesman & Geva)§4: cheap hidden-state pre-screen
2510.09033Do LLMs Really Know What They Don’t Know? (Cheang et al.)§4: probes track confidence, not truth — caveat
2405.05904Does Fine-Tuning LLMs on New Knowledge Encourage Hallucinations? (Gekhman et al.)§4/§5: SliCK bucketing; new-fact rows raise unrelated hallucination
2403.05612Unfamiliar Finetuning Examples Control How LMs Hallucinate (Kang et al.)§5: supervision shape on unfamiliar rows becomes the default template
2604.15574Why Fine-Tuning Encourages Hallucinations and How to Fix It (Kaplan, Gekhman et al.)§5/§7: representational-interference mechanism; self-distill fix
2406.14785Understanding Finetuning for Factual Knowledge Extraction (Ghosal et al.)§5: fine-tuning teaches ignoring the entity token
2503.21676How do LMs learn facts? Dynamics, curricula and hallucinations (Zucchet et al.)§5: hallucination emerges simultaneously with learning
2511.02626Understanding New-Knowledge-Induced Factual Hallucinations (Dang et al.)§5: knowledge-type unfamiliarity, not row proportion, predicts damage
2311.09677R-Tuning§5: relabel to hedge/“I don’t know” targets
2502.11962Uncertainty-Aware Instruction Fine-Tuning (Wu et al.)§5: drop-the-row alternative to relabeling
2508.20755In-weight vs in-tool knowledge bounds (Houliston et al.)§6: parameter-bounded weights vs unbounded tool-retrieval
2603.23562Synthetic Mixed Training§6: heavily-augmented synthetic can beat RAG, very recent/promising
2407.06249CodeUpdateArena§6: docs-only FT fails; RAG works; curated usage-example FT works
2502.14502How much knowledge can you pack into a LoRA adapter? (Salnikov)§6: LoRA’s injection ceiling below full-FT
2403.08763Simple and Scalable Strategies to Continually Pre-train LLMs (Ibrahim et al.)§2.6: LR re-warm/re-decay/replay mechanics for CPT
2510.01631Demystifying Synthetic Data in LLM Pre-training (Kang et al.)§2.6: ~30/70 synthetic/natural mix ratio at scale
2502.11177The Mirage of Model Editing (Yang et al.)§9: teacher-forcing inflates editing success, 96.8%→38.5%
2511.03182Understanding Robustness of Model Editing in Code LLMs (Chhetri et al.)§9: ROME/MEMIT ~6% correct-adoption rate on API-deprecation edits

Confidence calibration: every id above verified live against arxiv.org/abs/<id> in the source survey pass (artifacts/three-gap-survey/ledger-{A,C,E}.md, 2026-07-02) — none recalled from training memory, and none used here beyond what those ledgers confirm. High-confidence, widely-replicated: the storage/extraction split (2309.14316, 2404.05405), the Reversal Curse (2309.12288), the RAT tool-call mechanism (2305.15334), and the new-fact-SFT-raises-hallucination causal chain (2405.05904, 2403.05612). Flagged “very recent / promising, not yet independently validated” throughout: 2603.18534 (megadoc rephrase saturation), 2601.17829 (argument-value diversity gap), 2603.23562 (synthetic-beats-RAG), 2604.04943 (bidirectional dual-representation), 2604.15574 (representational-interference mechanism), 2510.10681 (RePro faithfulness). LoRA-weak-at-injection (§6) is stated as contested on purpose — see Contested edges & landmines’s broader PEFT-forgetting thread, and The kinds of SFT §6’s own citation of the same trade-off from the forgetting angle rather than the injection angle. Explicitly not grounded on any academic cybersecurity-LLM paper, per this chapter’s brief — the amass/subfinder example throughout is illustrative scaffolding, not a claim about either tool’s actual documented flag set.

Does jumping to trajectory SFT amplify an unfixed gap? (yes — here’s the chain)

The three gaps — overview teased this in three sentences off a single citation. This chapter is the full evidence chain. The kinds of SFT §4 named the mechanism at the level of one row — a synthetically-authored tool result is fiction that only looks like grounding, and training on it teaches the model to imitate the shape of a tool result rather than react to the real one. This chapter answers the harder question underneath that: even a genuinely executed, verifier-filtered trajectory — Axis B and Axis C of that taxonomy both clean, no synthetic authoring anywhere — can still be built on turns the base policy never actually had the knowledge or the prior to produce reliably. Does SFT-ing on that trajectory anyway make the fabrication problem worse, not better? Data mixing & forgetting already showed off-policy trajectory data can silently erase an existing behavior (CoT-emission); this chapter is the mirror case — off-policy trajectory data silently installing a bad one.

The question this chapter answers

The question this chapter answers: the user’s own words were “everyone jumps to the trajectory [SFT] safety but these are the things we have to fix [first] — maybe this has been amplifying the problem at the trajectory level.” Stated precisely: if the harness runs SFT on full agentic run-logs before diagnosing whether the model’s failures are a knowledge/prior gap (K/R) rather than a policy/ranking gap (P) — does that trajectory-level SFT actively amplify the unfixed gap, rather than sit neutrally on top of it?

BLUF: yes — and it’s over-determined, not a hunch. Nine independent 2024–2026 results, from three separate research lineages that don’t cite each other as their primary motivation, converge on the same mechanism. None of them ran the experiment on your setup — CTF trajectories, a security-tool action space, a ~10–30B dense base — so the honest label is strongly-inferred, not proven by one controlled trajectory-level ablation. As of a May-2026 preprint there is now one direct agentic-setting test that corroborates the mechanism on a rhyming failure mode (§4 below); until more replicate it, treat this chapter’s verdict the way the rest of this book treats a well-supported but unreplicated claim — actionable, not gospel.

1. The hypothesis, restated — and the running example

Restated as a testable claim: SFT on a trajectory row is not a neutral operation with respect to a K/R gap that row happens to touch. If the demonstrated action at some turn required knowledge or a prior the base policy doesn’t reliably have, training on that row doesn’t just fail to help — it teaches the model a new, confident default for what to do the next time it’s in an unfamiliar-feeling state, and that default is “emit something that looks like the demonstrated action,” not “flag the uncertainty.”

Running example, held constant through this chapter: you SFT on a verified-flag-passing trajectory where turn 6 is amass enum -active -brute -d target.com. Suppose the base policy doesn’t actually know why -active and -brute are the right flags here versus -passive — it produced this call once, in one run, possibly because a stronger teacher demonstrated it, or because the model got lucky at temperature. The row is executed, real, verifier-passed — clean on every axis kinds-of-sft.md names. It still teaches confabulation, for reasons that have nothing to do with whether the row was synthetically authored.

2. Why this has to be a chain, not one citation

None of the individual results below was designed to answer “does SFT on an agentic trajectory amplify an unfixed K/R gap.” They were mostly run on single-turn factual QA (does the model know a fact) or short math/code reasoning. The chain works because each result independently rules out an escape hatch the previous one leaves open:

  1. Maybe hallucination from new-fact SFT is a one-off artifact of the specific fact being trained → §3 shows it’s a general, linear, measured effect.
  2. Maybe it only shows up after many epochs of overfitting → §4 shows it emerges as the fact is learned, not as a late-stage failure.
  3. Maybe it only matters if a large fraction of your corpus is unfamiliar → §5 shows it’s the concentration within one type, not the overall percentage, that drives damage — a small, targeted corpus of trajectories about one tool family is exactly the danger shape.
  4. Maybe this is confined to single QA rows and doesn’t apply to a 40-turn agentic trajectory → §6–§7 show the mechanism is worse, not the same, once you add a horizon: DAgger’s compounding-error theorem plus the trajectory-specific “fork in the road” result.
  5. Maybe SFT doesn’t even touch real capability — LIMA says it’s “mostly format” → §8 shows why that reading, taken correctly, doesn’t rescue trajectory SFT; it explains why the fabrication default is cheap to install, not why it’s harmless.
  6. Maybe a later RL stage cleans this up automatically → §9–§11 show RL’s relationship to what SFT installs is asymmetric, sometimes actively can’t reach it, and — critically — SFT overtraining makes the later RL stage’s job structurally harder, not easier.
  7. Maybe this is armchair theory with no frontier-lab corroboration → §12 shows DeepSeek-R1’s own published recipe needed a second SFT pass gated behind RL for exactly this reason.
  8. Maybe none of this generalizes past factual QA into the agentic/tool-use setting at all → §13 is the first direct test in that setting, and it corroborates a rhyming failure mode.

Every rung removes one plausible objection. That’s what “over-determined” means here — not that one paper proved it, but that the space of alternative explanations keeps shrinking.

Gekhman et al., “Does Fine-Tuning LLMs on New Knowledge Encourage Hallucinations?” (arXiv:2405.05904, EMNLP 2024, Technion/Google) is the base rate this whole chain sits on. Their SliCK protocol buckets each candidate SFT row by how well the base model already knows it (sample it 10–16 times across varied few-shot framings; HighlyKnown / MaybeKnown / WeaklyKnown / Unknown). Two findings, both measured, not argued:

  • Rows in the Unknown bucket are fit by gradient descent markedly slower than rows the model already half-knows — the loss curve visibly lags.
  • Once those Unknown rows are fit, hallucination on other, unrelated, already-known facts rises roughly linearly with the number of Unknown rows in the fine-tuning set.

This is the base-rate cost of an unfixed K-gap sitting in your trajectory corpus. It’s not that the amass row itself gets confabulated more — it’s that fitting that one row the model doesn’t actually know measurably degrades the model’s reliability on facts it already had right, elsewhere in the corpus. A trajectory-SFT set built without a per-row familiarity check pays this tax silently across the whole set, not just on the rows that look risky.

(Note on verification: this id shows one WRONG_ID flag in the underlying survey’s ledger alongside four independent CONFIRMED passes matching author/venue/date; treated as an isolated tool-search miss, not a real mismatch — see the bibliography note.)

Zucchet, Bornschein, Chan, Lampinen, Pascanu & De (Google DeepMind), “How do language models learn facts? Dynamics, curricula and hallucinations” (arXiv:2503.21676) sharpens §3’s timing: hallucination isn’t a late-training side effect that shows up after the new fact is over-learned — it emerges in the same phase as the new-fact acquisition, and continued fine-tuning without curriculum management actively corrupts existing memories, not just fails to add new ones.

For a trajectory pipeline, this closes off the “we’ll just stop training early, before the damage phase” escape hatch — there is no clean early-training regime where the new-fact row is learned and nearby existing knowledge is still intact. The corruption is concurrent with the learning, not a downstream overfitting artifact you can checkpoint your way around by watching a single held-out loss curve. (Confidence: medium — a DeepMind dynamics study, verified live, not yet independently replicated at time of writing; the qualitative timing claim, not exact numbers, is what this chapter leans on.)

Dang, Hu, Lai, Gao, Zhang & Huang (Nanjing University/Huawei), “Understanding New-Knowledge-Induced Factual Hallucinations in LLMs” (arXiv:2511.02626, ACL Findings 2026) is the finding that reframes “just keep the unfamiliar fraction under X%” as the wrong lever. What predicts damage is concentration of unfamiliarity within one knowledge type, not the overall proportion of Unknown rows in the corpus — and mechanistically, learning the new knowledge measurably weakens attention to the question’s key entities, with the disruption propagating to lexically-similar contexts.

Translate this directly to the running example: a trajectory corpus doesn’t need to be mostly unfamiliar to be dangerous. If every amass-flag row in your corpus shares the same underlying unfamiliarity — the model never really learned what -active/-brute/-passive individually do — that’s concentrated unfamiliarity within one knowledge type (recon-tool argument semantics), even if the rest of a 5,000-row corpus is perfectly clean. The damage signature is exactly the “grabs the one salient tool, uses default args, universal across models” pattern: attention to the specific argument entities weakens, and the model substitutes a generic, lexically-similar-but-wrong default.

(Note: this is genuinely contested against §3 — the source survey itself flags Gekhman’s “linear-in- fraction” reading and Dang’s “concentration-within-type” reading as two measured effects that disagree on the dominant causal variable; don’t treat “keep Unknown rows under X%” as a validated universal threshold, and don’t treat “type concentration” as the sole driver either. Both are real; which dominates in your data isn’t settled by either paper alone.)

Kang, Wallace, Tomlin, Kumar & Levine (UC Berkeley/DeepMind), “Unfamiliar Finetuning Examples Control How Language Models Hallucinate” (arXiv:2403.05612) is the mechanistic result that makes §3–§5 actionable rather than just alarming: on unfamiliar test-time inputs, a model’s hallucinated output mirrors the aggregate label distribution it was shown for similarly-unfamiliar SFT rows during training. The hallucinated answer isn’t noise — it’s the loss-minimizing generalization of your own curation choice at the moment you wrote that row.

This is the direct causal story behind “confident fabrication of tool behavior/outputs” in the running example. If your amass-flag trajectory row demonstrates a confident, specific, un-hedged invocation at a decision point the demonstrator (teacher model, human, or your own policy at temperature) was itself uncertain about, Kang’s mechanism predicts the model doesn’t learn “sometimes guess -active -brute” — it learns “when I’m in a state that feels like this one, emit a confident specific answer,” and that policy generalizes to structurally similar turn-N states across different challenges, not just to a repeat of this exact one.

The fix this result licenses is a data-curation move, not a training-recipe change: relabel rows a per-row familiarity probe flags Weakly-Known/Unknown so the target is an explicit hedge/verify-first/ tool-lookup action instead of a confident specific one — “run amass --help and check which mode fits” rather than a bare, un-hedged -active -brute -d target.com. Whatever you demonstrate at the uncertain point becomes the deployed default; demonstrating verification-seeking rather than confident-guessing directly controls what that default is. (Full recipe: Knowledge curation.)

Everything above was measured on single-turn factual QA. A 40-turn CTF trajectory is not a bigger version of the same problem — it’s a structurally different one, for two independent reasons.

7.1 DAgger’s compounding-error theorem

Ross, Gordon & Bagnell, “A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning” (AISTATS 2011, arXiv:1011.0686), Thm 2.1: a policy trained by naive behavioral cloning on a fixed, off-policy demonstrator distribution incurs total cost bounded by J(π̂) ≤ J(π*) + ε·T²quadratic in horizon T — because the moment the learner’s own (even small) deviation pushes it off the demonstrator’s training-state distribution, there is no training signal there for the rest of the episode. Their correction, DAgger, aggregates data from the learner’s own induced state distribution and restores near-linear O(ε·T) regret.

graph LR
  A["Single QA row:<br/>one wrong answer,<br/>bounded damage"] -.->|"horizon T=1"| B["Cost ~ ε"]
  C["40-turn trajectory:<br/>one wrong turn early,<br/>zero signal for recovery"] -.->|"horizon T=40,<br/>off-policy demo"| D["Cost ~ ε·T²<br/>(DAgger bound,<br/>1011.0686)"]
  style D fill:#3a1414,stroke:#e74c3c,color:#fbeaea

A single mis-demonstrated fact in a QA row costs you one wrong answer. A single mis-demonstrated turn in a 40-turn trajectory — say turn 6’s amass invocation, if it was itself the demonstrator guessing — costs you the entire rest of the episode’s worth of training signal once the model’s own drift departs from the exact state the demonstration assumed, because off-policy trajectory data is, by construction, data about states the model itself won’t visit once it starts generating.

7.2 The token-level sibling, and the trajectory-specific “fork” result

The same phenomenon restated at the token level, for purely-supervised sequence models: Bengio, Vinyals, Jaitly & Shazeer, “Scheduled Sampling for Sequence Prediction with Recurrent Neural Networks” (arXiv:1506.03099) — exposure bias, the mismatch between teacher-forced training and free-running inference. A recent survey states this plainly for the LLM case: static off-policy SFT “is an instance of exposure bias” scaling “roughly with the square of sequence length” (Song & Zheng, A Survey of On-Policy Distillation for Large Language Models, arXiv:2604.00626).

On top of exposure bias, trajectories have more places to go wrong than QA data does, structurally. Nguyen, Shojaee et al., “Why Do Reasoning Models Lose Coverage? The Role of Data and Forks in the Road” (arXiv:2605.17026) show that wherever training data commits to one canonical path through a decision point that had multiple valid strategies — a “fork” — cross-entropy forces hard commitment there, and measured pass@k shrinkage tracks fork prevalence in the data, not data volume. A trajectory is a chain of forks: which tool first, which flag style, verify-before-acting or assume-and-proceed. Single-turn QA data has comparatively few forks per row; trajectory data is made of them. Corroborating measurements: pass@1 rises monotonically through SFT while pass@k crashes rapidly, and weight-interpolating back toward a pre-crash checkpoint recovers most of the lost coverage (Dang et al., WiSE-FT, arXiv:2504.10478); for CoT-distillation lineages specifically, most semantic diversity is lost at the SFT step itself — more than at any later DPO/RL step — and it’s baked into the weights by training-data composition, not fixable by decoding-time tricks (Karouzos, Tan & Aletras, arXiv:2604.16027).

Why this matters for the diagnosis, not just the mechanism: if a challenge’s winning path is sequentially gated (enumeration must land before exploitation is even reachable), a trajectory-SFT row for it doesn’t just risk one bad fact — it locks in one canonical fork through a decision tree with several defensible branches, at exactly the depth where the model’s own on-policy drift is likeliest to have already left the demonstrated state. This is the same “enumeration-gates-exploitation” shape Diagnosing the gap §2.4 already flags as the place execution and exploration gaps are hardest to tell apart — here it’s the place trajectory SFT does the most damage per row.

If LIMA’s strong claim were the whole story, this chapter’s verdict would dissolve: Zhou et al., “LIMA: Less Is More for Alignment” (arXiv:2305.11206) argues most of a model’s knowledge comes from pretraining and SFT mainly teaches format/style — which sample of its own behavior to surface. Read naively, that would mean trajectory SFT can’t inject a genuine knowledge gap at all; it just reshapes presentation.

Two things block that escape hatch. First, the strong-form hypothesis is itself contested in the general literature — Raghavendra, Nath & Hendryx, “Revisiting the Superficial Alignment Hypothesis” (arXiv:2410.03717) find post-training performance scales as a power law in the number of SFT examples on math/coding/multihop-QA well past LIMA’s ~1,000-example regime — style-only alignment does not saturate task performance for reasoning-heavy domains, and tool-use trajectory data is squarely reasoning-heavy, not stylistic preference data. Second, and more important even if you grant SAH’s weaker, correct reading: “format” is exactly where the danger lives. “Always commit to a confident specific action rather than hedge” is a format/policy choice in the SAH sense — a coarse, low-information-content behavioral switch, not new declarative knowledge — and Data mixing & forgetting already established that this class of switch is learnable (and un-learnable) from remarkably little data. LIMA’s own finding — quality format shift from ~1,000 curated rows — is a two-edged fact: it means the harmful direction (confident-guessing-as-default, per §6’s mechanism) is exactly as cheap to install as the beneficial one. SAH doesn’t get trajectory SFT off the hook; it explains why the fabrication default is inexpensive to bake in.

Once a corpus has installed a confident-default at an uncertain decision point (§6), what happens to the other, more honest paths through that same decision point — the ones where a stronger policy would have checked --help first, or flagged low confidence? Two results say: they get trained away, on the SFT step specifically, faster than anywhere else in the pipeline.

  • Reasoning-Trace Collapse — Twist, Yannakoudakis & Zhang (King’s College London), arXiv:2605.21127: fine-tuning on ordinary instruction-response data containing no reasoning trace induces a model to stop emitting the deliberation that would have surfaced uncertainty — it minimizes loss by treating “no hedge, no check, straight to the confident answer” as the target behavior, and answer-only accuracy monitoring hides this until it’s severe (a model can be right on the final token while never emitting the verification step that made it reliable). (Confidence: medium — brand-new 2026 preprint, multi-model, not yet independently replicated.)
  • On-Policy Self-Distillation Reduces Output Diversity — Nicolicioiu, Pezeshki & Courville, arXiv:2606.26091: even the gentler, self-distillation-based correction to naive off-policy SFT tilts the policy by a pointwise conditional-mutual-information term that amplifies pre-existing probability gaps, flattening pass@k more than an ideal on-policy RL update would — i.e. the failure mode isn’t confined to the crudest off-policy SFT recipe; even the more careful on-policy variants can narrow the distribution of paths the model still considers.

Put together with §7.2’s fork-collapse result, the picture is: trajectory SFT doesn’t just install one bad default at an uncertain decision point — it simultaneously narrows the alternative, hedging paths that would have provided a fallback. The confident-fabrication behavior isn’t competing against a healthy distribution of more cautious behaviors after training; it’s increasingly the only behavior left.

A subtler compounding factor, orthogonal to the tool-call itself: if your trajectory rows include a reasoning/rationale block before the action (§5.4 of kinds-of-sft.md), that reasoning is not guaranteed to be causally what produced the action. Turpin, Michael, Perez & Bowman, “Language Models Don’t Always Say What They Think: Unfaithful Explanations in Chain-of-Thought Prompting” (arXiv:2305.04388) show LM-generated CoT can be systematically unfaithful — a plausible-sounding justification generated after the fact, not the actual driver of the answer.

For trajectory SFT specifically: if a demonstrator’s stated reasoning for choosing -active -brute was itself post-hoc rationalization (plausible-sounding, not actually load-bearing) rather than genuine tool-semantics understanding, training on that row teaches the model to produce equally plausible-sounding, equally ungrounded justifications for its own future fabricated calls. This compounds §6’s mechanism one layer up: the model doesn’t just learn a confident action default at unfamiliar states, it learns a confident explanatory style to go with it — which makes the fabrication harder to catch by reading the model’s own stated reasoning, exactly the failure mode a human reviewer skimming trajectory logs would miss.

Even granting a subsequent RL stage, four results say “RL will clean it up” is not a safe assumption — and one says the opposite can happen.

  • PEAR — Zhang, Xu, Wang, Chen & Peng, “Good SFT Optimizes for SFT, Better SFT Prepares for Reinforcement Learning” (arXiv:2602.01058): SFT-checkpoint quality measured on SFT’s own held-out loss does not predict post-RL performance — a checkpoint that looks better by that metric, because it fit more off-policy expert data, can underperform post-RL relative to a weaker-looking one, because the off-policy behavior-policy distribution diverges from what RL’s on-policy target needs to build on.
  • Quagmires in SFT-RL Post-Training — Kang, Kuchnik, Padthe, Vlastelica, Jia, Wu & Ardalani (FAIR/Meta + Virginia Tech), arXiv:2510.01624 (>1M GPU-hours, hundreds of models to 12B): high SFT-stage scores are not reliably predictive of eventual RL gains — sometimes inversely so. What does predict post-RL pass@1, with roughly 2× better R²/Spearman correlation than post-SFT pass@1 alone: generalization loss on held-out examples and pass@large-k on the post-SFT checkpoint. A trajectory-SFT checkpoint that fabricates confidently on unfamiliar states will look fine on its own training-distribution accuracy while quietly failing this held-out signal.
  • RL’s Razor — Shenfeld, Damani, Hübotter & Agrawal (MIT, ICLR 2026 poster), arXiv:2509.04259: forgetting after fine-tuning is quantitatively predicted by E_{x~new-task}[KL(π_base ‖ π_finetuned)]. Off-policy SFT minimizes forward KL (mode-covering — it matches the demonstrated trajectory’s exact phrasing even where a path closer to the base model’s own distribution would have worked, and in doing so can overwrite an existing good low-probability mode), whereas on-policy RL is implicitly biased toward the KL-minimal solution among all reward-maximizing policies. Corroborated independently by Chen, Razin, Narasimhan & Chen (Princeton), “Retaining by Doing” (arXiv:2510.18874): SFT’s forward-KL mode-covering can overwrite an existing behavior mode; RL’s reverse-KL mode-seeking tends to add a new mode without disturbing the old one’s shape — and “approximately on-policy” trajectory data recovers most of RL’s forgetting-resistance cheaply, i.e. the fix is upstream of RL, in how the SFT data was sourced.
  • The non-decoupling theorem — Niu, Bai, Han & Zhang (Huawei), “On the Non-decoupling of Supervised Fine-tuning and Reinforcement Learning in Post-training” (arXiv:2601.07389): formally, SFT and RL cannot be cleanly separated in either insertion order — SFT-then-RL provably increases the SFT loss (some of what SFT taught erodes), and RL-then-SFT provably lowers RL’s achieved reward. There is no ordering where the gains from one stage are safe from the next — which is the formal reason a one-time “gate trajectory SFT, then move on” plan is insufficient; the erosion (or lack of it) has to be re-measured after every stage, not assumed from the ordering alone.
  • When RL Fails after SFT — Liu, Liu, Wan, Fu & Pan (HKUST), arXiv:2606.09932: excessive SFT produces over-confident (low-entropy) token distributions and sharper loss landscapes that are measurably harder for a subsequent RL stage to reshape — a genuine plasticity-loss mechanism. This traces to the general Primacy Bias precedent in deep RL (Nikishin et al., ICML 2022, arXiv:2205.07802: early experience locks in and resists later correction unless part of the network is reset). Read together with §6–§9: the earlier a confident-fabrication default gets baked in by trajectory SFT, and the more aggressively SFT converges on it, the harder a later RL stage will find it to dislodge — “SFT now, RL fixes it later” inverts the actual difficulty gradient.

12. The corroboration: DeepSeek-R1 needed a second SFT stage after RL

DeepSeek-AI, “DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning” (arXiv:2501.12948) is not primarily a paper about hallucination or trajectory SFT — but its own disclosed pipeline is a frontier lab conceding exactly this chapter’s point in practice. R1-Zero (pure RL, zero SFT) develops strong reasoning but with poor readability/language-mixing; the added cold-start SFT stage exists specifically to fix format/legibility, not to teach reasoning — and critically, that isn’t where the pipeline stops. After RLVR, DeepSeek runs rejection sampling on the RL checkpoint to build ~600K new, verified SFT rows, then a second SFT/RL pass. A lab with effectively unlimited compute and the strongest incentive in the industry to ship a one-shot cold-start-SFT-then-RL recipe did not trust a single trajectory-adjacent SFT pass — it gated with RL, re-verified with rejection sampling, and iterated. That’s the “Stage-0 diagnosis, Stage-3 re-verification” discipline this chapter ends on, independently arrived at by the team that produced the best-known open frontier RL recipe.

13. The closest thing to a direct test — and it maps onto the running example almost exactly

Everything in §3–§11 was measured on single-turn factual QA or short reasoning traces, not multi-turn agentic tool use. That gap is real, and the honest caveat is in §14. But one very recent result closes most of it directly. Gu et al., “What Do Agents Learn from Trajectory-SFT: Semantics or Interfaces?” (arXiv:2602.01611) ran the agentic-setting version of this exact question across 16 AgentBench/AgentGym environments: trajectory-SFT’d agents substantially amplify reliance on the training-time tool/interface surface form — they collapse under semantics-preserving interface rewrites (renamed arguments, reordered parameters, aliased tool names, swapped JSON key order), while non-trajectory-SFT’d (few-shot-prompted) baselines stay stable under the identical rewrites.

This is the runnable version of the running example. Take the trajectory-SFT’d checkpoint and rewrite the amass tool schema with semantics-preserving changes only — -active/-brute renamed to --enable-active-recon/--bruteforce-subdomains, or the argument order shuffled. The required action is unchanged; only its surface form moved. If pass@1 collapses under that rewrite while a prompted-but-not- trajectory-SFT’d baseline stays flat, that’s direct confirmation the model locked in an interface shortcut — surface-form mimicry — rather than the underlying tool semantics, precisely because the knowledge/prior wasn’t secure before trajectory SFT ran. This is Protocol 7 (interface-perturbation probe) in Diagnosing which gap — the cheapest test that would falsify or confirm this chapter’s verdict on your own checkpoint.

flowchart TD
  A["Single-fact SFT rows:<br/>learned slower, poisons<br/>known facts linearly<br/>(2405.05904)"] --> B["Hallucination emerges<br/>WITH the new fact,<br/>not after (2503.21676)"]
  B --> C["Driven by concentration<br/>within one knowledge TYPE,<br/>not overall % (2511.02626)"]
  C --> D["Mechanism: unfamiliar-row<br/>demo becomes the model's<br/>new DEFAULT (2403.05612)"]
  D --> E["Trajectories make this WORSE:<br/>DAgger compounding O(εT²)<br/>+ fork-in-the-road collapse<br/>(1011.0686, 2605.17026)"]
  E --> F["SAH doesn't rescue it:<br/>'format' IS the confident-<br/>default switch (2305.11206)"]
  F --> G["Training destroys the<br/>hedging alternatives<br/>(2605.21127, 2606.26091)"]
  G --> H["SFT->RL handoff can HARDEN,<br/>not clean up, the default<br/>(2602.01058, 2510.01624,<br/>2509.04259, 2606.09932)"]
  H --> I["DeepSeek-R1's own recipe:<br/>gate + re-verify, twice<br/>(2501.12948)"]
  I --> J["Direct agentic test:<br/>interface-rewrite collapse<br/>(2602.01611)"]
  J --> V["VERDICT: yes, amplifies —<br/>strongly-inferred chain,<br/>one direct corroboration"]

  classDef verdict fill:#132b22,stroke:#34d399,color:#eafaf3;
  class V verdict;

14. Honest counter-considerations — what would weaken this verdict

Three genuine open questions, stated the way the rest of this book states contested ground:

  • Does the QA-literature mechanism actually transfer to agentic tool-use, or is it a strong analogy? §3–§6, §9–§10’s load-bearing evidence was measured on single-turn factual QA. §13’s Interface Reliance study is the first direct agentic-setting test, and it corroborates a rhyming but distinct failure mode — surface-interface shortcutting, not factual hallucination per se. Treat the QA mechanisms as a strong, well-evidenced analogy to the agentic case, not a fully validated transfer, until more direct agentic ablations replicate it.
  • Is the O(T²ε) compounding bound a hard law, or avoidable in a “recoverable” environment? Foster, Block & Misra, “Is Behavior Cloning All You Need? Understanding Horizon in Imitation Learning” (arXiv:2407.15007) show the quadratic-in-horizon bound is avoidable under bounded-coverage/well-specified-policy-class/self-correcting-MDP assumptions. A CTF harness with informative tool stderr and a shell the agent can re-probe may be more “recoverable” than the worst-case bound assumes — whether it’s recoverable enough to matter is genuinely open and task-dependent, not something to assume either way without measuring it on your own trace corpus.
  • What’s the actual mechanism — interference or storage strength? Kaplan/Gekhman et al.’s follow-up, “Why Fine-Tuning Encourages Hallucinations and How to Fix It” (arXiv:2604.15574), find representation interference among overlapping weights dominates over raw capacity limits, proposing self-distillation SFT (KL-regularize against a demonstration-conditioned self-teacher) as the fix. Ghosal, Hashimoto & Raghunathan, “Understanding Finetuning for Factual Knowledge Extraction” (arXiv:2406.14785) instead find it’s fact-storage strength — even “known” facts poorly stored get the subject entity ignored and a generic response substituted. Both are measured, real effects; they haven’t been unified, and which one dominates in your action space isn’t settled by either paper alone.
  • The rebuttal to the sharpest weight-level framing. §11’s “SFT broadly replaces, RL narrowly amplifies” claim from Rajani et al., “Scalpel vs. Hammer” (arXiv:2507.10616) is a single, 0-citation preprint whose own authors call it a “preliminary indication” — and it’s directly contested by Jin, Luan, Lyu et al. (Mila), “RL Fine-Tuning Heals OOD Forgetting in SFT” (arXiv:2509.12235), who show OOD performance during SFT actually peaks early then declines with continued training, and RL does not exceed that early peak — it only restores it, from a bounded checkpoint range. Neither settles whether RL does something SFT categorically cannot, or is compensating for a controllable SFT overfitting/checkpoint-selection failure. This chapter treats “Scalpel vs. Hammer” as supporting color, per Contested edges §1 — not load-bearing on its own.

None of these three weaken the core mechanism (§3–§6, §9–§10); they bound how confidently you can port the exact numbers, and how much you should trust the O(T²ε) worst case as your operating assumption versus a measured floor for your own harness.

15. The practical rule

Gate trajectory SFT behind a diagnosis; don’t skip to it because it’s the intuitive first move.

  1. Stage 0 — diagnose, per row and per challenge subtype, before any trajectory enters the corpus. Run the K/R/P probe battery (Diagnosing which gap) — SliCK familiarity sampling, the in-context oracle probe, teacher-forced-vs-free-running divergence. A row whose critical turn sits in the Weakly-Known/Unknown bucket is not safe to SFT as a confident, un-hedged target (§6).
  2. Curate declarative knowledge/prior FIRST. If Stage 0 finds a genuine K-gap, close it with QA-format knowledge injection (Knowledge curation) — many independently-phrased rephrasings, weighted toward numeric/parameter-value facts since those retain worse under fine-tuning (Zhao, Awasthi & Haghtalab, NeurIPS 2025 poster, arXiv:2503.05919) — gated by a held-out re-probe, not inferred from downstream trajectory success alone, since fine-tuned facts don’t automatically transfer into correct multi-step use of that fact.
  3. Trajectory SFT LAST, light, capped, and preferentially near-on-policy. Generate trajectories after Stage 2 closes the K-gap, so demonstrations draw on secured knowledge rather than a demonstrator’s own guess. Prefer self-generated/rejection-sampled rollouts over a distant teacher’s raw transcript — per §11’s PEAR finding, an off-policy-trained SFT checkpoint that looks better on its own metric can underperform post-RL. Cap training by tracking entropy and held-out generalization loss during training, not lowest SFT training loss (§4, §9, §11).
  4. Stage 3 — re-verify, and re-verify again after RL. Run the interface-perturbation probe (§13) before calling trajectory SFT done. Then run it again after any subsequent RL stage — the non-decoupling theorem (§11) means erosion is bidirectional and ongoing, not a one-time Stage-1 mistake fixed once and forgotten.

Designed to fix exactly the failure the user named: “everyone jumps to the trajectory [SFT] safety.” The jump itself is the risk — not trajectory SFT as a method (it remains the right eventual tool, per FireAct/AgentTuning), but skipping the diagnosis that tells you whether a given row’s critical turns are safe to train on confidently. The fix isn’t “never do trajectory SFT” — it’s “diagnose, curate knowledge/prior first, then trajectory SFT last, then keep re-checking.”

  • The three gaps — overview — the K/R/P taxonomy this chapter’s verdict routes into; the three-sentence teaser this chapter fully substantiates.
  • Diagnosing which gap — the Stage-0 probe battery (SliCK, in-context oracle, teacher- forced-vs-free-running divergence, interface-perturbation) this chapter’s practical rule depends on.
  • What knowledge data looks like — the Stage-2 K-gap fix: QA-format rephrasing, the relabel-to-hedge mitigation from §6, gated by a held-out re-probe.
  • Matching the fix to the gap — the full staged curriculum (K→inject, R→re-prior, P→re-rank) this chapter’s §15 rule is the trajectory-SFT slice of.
  • The kinds of SFT §4 — the sibling mechanism at the single-row level (synthetic authoring → confabulation); this chapter is what happens even when authoring is clean but the underlying knowledge isn’t secured.
  • Data mixing & forgetting — the mirror failure: off-policy trajectory data erasing an existing behavior (CoT-emission) rather than installing a bad new one; §1.5’s “format is cheap to (un)learn” finding is reused directly in §8 above.
  • The one axis that predicts everything — the DAgger/off-policy-blindness theorem this chapter’s §7.1 is the trajectory-horizon instance of.
  • Diagnosing the gap — a scientific framework — the complementary knowledge/execution/exploration lens; §2.4’s compositional-segmentation test is the same “fork density” concern §7.2 raises from the SFT-data side.
  • Contested edges & landmines §1 — the fuller treatment of the “Scalpel vs. Hammer” contested citation used in §14.

Bibliography

arXiv idPaperRole in this chapterConfidence
2405.05904Gekhman et al., Does Fine-Tuning LLMs on New Knowledge Encourage Hallucinations?base rate: new-fact SFT learned slower, linearly poisons known factsHIGH (EMNLP 2024; 4/5 independent verification passes, one isolated tool-search WRONG_ID discounted)
2503.21676Zucchet et al. (DeepMind), How do language models learn facts?hallucination emerges concurrently with new-fact learning, not afterMEDIUM (2026 preprint, not yet independently replicated)
2511.02626Dang et al., Understanding New-Knowledge-Induced Factual Hallucinationsconcentration within a knowledge TYPE, not %, predicts damageMEDIUM-HIGH (ACL Findings 2026)
2403.05612Kang et al., Unfamiliar Finetuning Examples Control How Language Models Hallucinatethe mechanism: unfamiliar-row supervision becomes the model’s defaultHIGH
1011.0686Ross, Gordon & Bagnell, A Reduction of Imitation Learning… (DAgger)O(εT²) compounding-error theorem — why trajectories are worse than QA rowsHIGH (canonical, 840+ citations)
1506.03099Bengio et al., Scheduled Samplingtoken-level sibling of the compounding-error result (exposure bias)HIGH (canonical)
2604.00626Song & Zheng, A Survey of On-Policy Distillation for LLMsstates static off-policy SFT is exposure bias scaling ~T²MEDIUM
2605.17026Nguyen, Shojaee et al., Why Do Reasoning Models Lose Coverage? (forks in the road)trajectory-specific: forks force hard commitment, shrinkage tracks fork densityMEDIUM (very recent)
2504.10478Dang et al., Weight Ensembling Improves Reasoning (WiSE-FT)pass@1 rises while pass@k crashes during SFT; corroborates fork-collapseMEDIUM
2604.16027Karouzos, Tan & Aletras, Where does output diversity collapse in post-training?diversity loss concentrated at the SFT step, not later stagesMEDIUM
2305.11206Zhou et al., LIMASuperficial Alignment Hypothesis — why “format” doesn’t rescue the verdictHIGH (canonical), strong-form contested
2410.03717Raghavendra, Nath & Hendryx, Revisiting the Superficial Alignment Hypothesisrebuts strong-form SAH: power-law scaling past LIMA’s regimeHIGH
2605.21127Twist, Yannakoudakis & Zhang, Reasoning-Trace Collapsetraining destroys the hedging/deliberation alternative to confident fabricationMEDIUM (brand-new 2026 preprint)
2606.26091Nicolicioiu, Pezeshki & Courville, On-Policy Self-Distillation Reduces Output Diversityeven gentler on-policy correction narrows the alternative-path distributionMEDIUM (very recent)
2305.04388Turpin et al., Language Models Don’t Always Say What They Thinkstated CoT in a trajectory row may be unfaithful, not causalHIGH
2602.01058Zhang et al., Good SFT Optimizes for SFT… (PEAR)SFT’s own held-out loss doesn’t predict post-RL performanceMEDIUM-HIGH (very recent)
2510.01624Kang et al. (FAIR/Meta), Quagmires in SFT-RL Post-Traininghigh SFT accuracy from simple data predicts worse downstream RLHIGH (>1M GPU-hours, ICML 2026 poster)
2509.04259Shenfeld et al., RL’s Razorforward-KL (SFT) can overwrite existing good modes; reverse-KL (RL) is KL-minimalHIGH (ICLR 2026 poster)
2510.18874Chen, Razin, Narasimhan & Chen, Retaining by Doingcorroborates RL’s Razor; near-on-policy data recovers most forgetting-resistanceMEDIUM-HIGH
2601.07389Niu et al. (Huawei), Non-decoupling of SFT and RLno safe insertion order — erosion is bidirectional, must be re-measuredMEDIUM (very recent theory)
2606.09932Liu et al. (HKUST), When RL Fails after SFTexcessive SFT hardens defaults against later RL correction (plasticity loss)MEDIUM (very recent)
2205.07802Nikishin et al., The Primacy Bias in Deep Reinforcement Learninggeneral precedent: early experience resists later correctionHIGH (ICML 2022, hundreds of citations)
2501.12948DeepSeek-AI, DeepSeek-R1frontier corroboration: needed a second SFT stage gated behind RLHIGH
2602.01611Gu et al., What Do Agents Learn from Trajectory-SFT: Semantics or Interfaces?the direct agentic-setting test; maps onto the amass-flag running exampleMEDIUM (single paper, 16 environments, not yet independently replicated)
2407.15007Foster, Block & Misra, Is Behavior Cloning All You Need?counter-consideration: O(T²ε) is avoidable in “recoverable” environmentsHIGH
2604.15574Kaplan/Gekhman et al., Why Fine-Tuning Encourages Hallucinations and How to Fix Itcounter-consideration: interference vs storage-strength mechanism, unresolvedMEDIUM
2406.14785Ghosal, Hashimoto & Raghunathan, Understanding Finetuning for Factual Knowledge Extractioncounter-consideration: storage-strength reading of the same effectMEDIUM-HIGH
2507.10616Rajani et al., Scalpel vs. Hammersupporting color only — single 0-citation preprint, authors call it “preliminary”LOW, contested
2509.12235Jin et al. (Mila), RL Fine-Tuning Heals OOD Forgetting in SFTdirect rebuttal to Scalpel vs. Hammer’s clean replace/amplify splitLOW, contested (0-citation preprint)
2503.05919Zhao, Awasthi & Haghtalab, From Style to FactsQA-format knowledge injection as the Stage-2 fix in §15HIGH (NeurIPS 2025 poster)
2306.13649Agarwal et al., GKD (On-Policy Distillation of Language Models)the general on-policy remedy this chapter’s chain motivates reaching forHIGH

Standing rule (matches the overview and every chapter in this section): no load-bearing claim above rests on an academic cybersecurity-LLM training/benchmark paper — every citation is general ML/RL theory or frontier-lab evidence, verified live against arxiv.org/abs/<id> in the underlying survey pass (2026-07-02). The amass/recon-flag running example is the motivation for reading this chain, not the evidentiary basis for it.

Matching the fix to the gap — K→inject, R→re-prior, P→re-rank

The question this chapter answers: once you’ve diagnosed which gap you have, which technique do you actually run, and what does the training row look like? BLUF: K (knowledge) needs off-policy injection — CPT + knowledge-SFT, never trajectory imitation. R (the default/prior) needs a small, off-policy, format-only cold-start SFT that re-shapes what the policy samples first, not what it’s capable of. P (ranking) needs an on-policy preference pass — DPO/KTO or a short GRPO run — localized at the exact state where the model already produces the right action but doesn’t prefer it. These are not interchangeable: pointing a K-shaped fix (raw documents) at an R-gap teaches facts nobody asked for; pointing an R-shaped fix (cold-start SFT) at a P-gap wastes a training run reinforcing a ranking the model can already produce on its own, off-policy, at the wrong dose. Diagnosing the gap — a scientific framework gives you the instruments (pass@k, the elicitation ladder, Pass@(k,T)) that tell you which gap you have; the fuller K/R/P diagnostic battery — pass-at-k sweep, in-context oracle probe, teacher-forced logprob spans, the reversal check, the purpose-built bottleneck task — lives in ./diagnosis.md, deferred from this chapter on purpose. This chapter starts after that diagnosis lands and answers only “now what do I train, on what data shape.”

Standing scope note, same as the sibling chapters this one sits beside: every claim below is general RL/ML theory or frontier-lab practice (DeepSeek-R1, Qwen3, AlphaGo/AlphaGo Zero, Ng-Harada-Russell reward-shaping theory). Academic cybersecurity-LLM papers are not cited anywhere in this chapter — none exist as evidence here, per the project’s standing rule.

0. The running example, stated once

One failure — “the agent doesn’t use amass for subdomain enumeration, defaults to a shallow nmap sweep instead, and misses the flag hidden behind a forgotten staging subdomain” — cashes out as three structurally different problems depending on what’s actually broken, and each needs a different training row:

VariantWhat’s actually true of π_θGap typeThe fix this chapter gives it
The agent genuinely doesn’t know amass exists, or doesn’t know its flagsP(amass call | any prompt, any temperature) ≈ 0 — never fires, at any NK§2.1 — inject off-policy: CPT + knowledge-SFT
It knows amass (can describe it if asked) but its default sampling distribution, when handed a bare “enumerate this target” prompt, puts almost all its mass on the generic nmap recon scriptCorrect action reachable at moderate N, but the model’s untrained prior never puts it firstR§2.2 — re-prior with cold-start SFT
It can and does produce the exact correct amass enum -passive -d target.com call — sometimes even in the same rollout batch — but ranks the shallow nmap-only path higher on averageCorrect action present with real, nontrivial mass; just outrankedP§2.3 — re-rank with on-policy DPO/KTO or a short GRPO pass

Threading this through the chapter keeps the point concrete: the same observed symptom (“doesn’t use amass”) routes to three incompatible fixes, and running the wrong one either wastes a training run or actively teaches the wrong thing (raw-trajectory SFT for a K-gap; more format-shaping SFT for a P-gap the model already has the capability for). One diagnostic worth stating up front, cross-linked from ./diagnosis.md: if the same tool-avoidance pattern shows up across several unrelated frontier base models, that’s evidence against a per-model K-gap (a shared pretraining-distribution prior — generic recon over structured OSINT tooling — is a much more parsimonious explanation than every base model independently lacking the same fact) and for an R- or P-gap. Verify per model before trusting this shortcut; it’s a prior, not a proof.


1. Genealogy — three lineages converge, then fragment

Three independent research lineages solved three different problems — “how do you improve a policy from its own samples,” “how do you optimize against comparisons instead of a scalar reward,” and “how do you stop a reward function from being gamed” — and by 2025 all three had to be stitched together to ship a single flagship reasoning model. Understanding why they converge, and where the post-convergence literature has since fractured, is what tells you whether a given fix is settled practice or a live bet.

flowchart TD
  subgraph A["Lineage A — self-improvement / sharpening"]
    direction TB
    A0["Ng, Harada & Russell (ICML 1999, no arXiv id)<br/>potential-based reward shaping is<br/>necessary + sufficient for policy invariance"] --> A1
    A1["AlphaGo (Nature 529, 2016, no arXiv id)<br/>supervised-init THEN RL"] --> A2
    A2["AlphaGo Zero (Nature 550, 2017, no arXiv id)<br/>the supervised step is not always necessary"] --> A3
    A3["STaR (2203.14465)<br/>sample rationale, keep if correct, SFT, repeat"] --> A4
    A4["RAFT (2304.06767) / ReST (2308.08998) /<br/>ReST-EM (2312.06585)<br/>generalize the filter-then-SFT loop"] --> A5
    A5["GRPO (2402.03300)<br/>turns it online, critic-free"] --> A6
    A6["Sharpening Mechanism (2412.01951)<br/>PROVES: can only redistribute mass<br/>already in base support, never create it"]
  end

  subgraph B["Lineage B — preference"]
    direction TB
    B0["DPO (2305.18290)<br/>closed-form reweighting of reference-policy mass"] --> B1
    B1["KTO (2402.01306)<br/>generalizes to unpaired good/bad labels"] --> B2
    B2["Self-Rewarding LMs (2401.10020)<br/>closes the loop online"] --> B3
    B3["Online-vs-offline (2405.08448)<br/>offline DPO helps classification,<br/>not generation — go online"]
  end

  subgraph C["Lineage C — reward design"]
    direction TB
    C0["Concrete Problems (1606.06565)<br/>names reward hacking"] --> C1
    C1["Skalse et al. (2209.13085)<br/>PROVES: unhackability needs a<br/>restricted policy class"] --> C2
    C2["Goal misgeneralization<br/>(2105.14111, 2210.01790)<br/>correct reward ≠ sufficient"] --> C3
    C3["UED / PAIRED (2012.02096)<br/>+ minimax-regret fix (2507.03068)<br/>the curriculum answer"]
  end

  A6 --> R1
  B3 --> R1
  C3 --> R1

  R1["DeepSeek-R1 (2501.12948)<br/>cold-start SFT (R) → RLVR (P) →<br/>rejection-sample 800K rollouts (re-diversify) →<br/>final alignment RL (sharpen).<br/>R1-Zero ablation proves stage-1's marginal value."]

  R1 --> Q3["Qwen3 (2505.09388)<br/>confirms this is now default frontier practice"]

  R1 --> Frag["POST-R1 FRAGMENTATION (2025–2026)"]

  Frag --> F1["Echo Chamber (2504.07912)<br/>RL amplifies pretraining-precursor<br/>behaviors, doesn't invent new ones"]
  Frag --> F2["pass@k boundary debate:<br/>shrink (2504.13837) vs<br/>expand (2505.24864 ProRL) vs<br/>reconcile (2510.04028)"]
  Frag --> F3["Scalpel vs Hammer (2507.10616)<br/>SFT=broad-replace, GRPO=narrow-amplify<br/>[contested, single low-cite preprint]"]
  Frag --> F4["RL's Razor (2509.04259)<br/>on-policy RL is KL-minimal from base<br/>[behavior agreed, mechanism contested]"]
  Frag --> F5["Base Model Barrier (2603.06957)<br/>escaping zero-likelihood costs<br/>exponential reward queries"]
  Frag --> F6["PaST (2601.11258)<br/>SFT/RL weight-space deltas<br/>are near-orthogonal"]

  classDef lin fill:#132b22,stroke:#34d399,color:#eafaf3;
  classDef conv fill:#3a2a10,stroke:#f5b942,color:#fff3d6;
  classDef frag fill:#2b1313,stroke:#f87171,color:#fde8e8;
  class A0,A1,A2,A3,A4,A5,A6,B0,B1,B2,B3,C0,C1,C2,C3 lin;
  class R1,Q3 conv;
  class Frag,F1,F2,F3,F4,F5,F6 frag;

1.1 Lineage A — self-improvement / sharpening

The oldest thread, and the one that names the ceiling this whole chapter has to work around. Ng, Harada & Russell (ICML 1999, no arXiv id) prove that reward shaping via a potential function F(s,a,s') = γΦ(s') − Φ(s) is necessary and sufficient for policy invariance — add any other shaping term and you risk creating a new optimum that isn’t the one you wanted. This theorem is the reason §3 below exists: every later reward-hacking fix in Lineage C is downstream of knowing exactly what form of shaping is safe. AlphaGo (Nature 529, 2016, no arXiv id) establishes supervised-init-then-RL as the working pattern — train a policy on expert demonstrations first, refine with self-play RL second. AlphaGo Zero (Nature 550, 2017, no arXiv id) shows the supervised step isn’t strictly required — pure self-play RL from random init reaches superhuman play — which is the first empirical hint that a sharpening loop can bootstrap capability without an off-policy teacher. STaR (arXiv:2203.14465) ports this to text: sample a rationale, keep it only if the final answer verifies, fine-tune on the survivors, repeat — the minimum-viable self-improvement loop, no reward model, no RL infra. RAFT (arXiv:2304.06767), ReST (arXiv:2308.08998), and ReST-EM (arXiv:2312.06585) generalize STaR’s filter into a formal growing-batch offline-RL loop. GRPO (arXiv:2402.03300) turns the whole thing online and critic-free — full mechanics in Reinforcement — PPO · GRPO · RLVR, not re-derived here.

The lineage’s ceiling gets a formal proof at the end: the Sharpening Mechanism (arXiv:2412.01951) shows this whole family — STaR through GRPO — can only redistribute probability mass the base policy already assigns nonzero weight to. It cannot manufacture support where none existed. This is the theoretical anchor for why a K-gap (zero support, at any N) is categorically un-fixable by anything in this lineage, and it’s the reason §2.1 below routes K-gaps somewhere else entirely.

1.2 Lineage B — preference

DPO (arXiv:2305.18290) collapses the RLHF reward-model-plus-PPO pipeline into a single closed-form classification loss, provably a re-weighting of the reference policy’s own mass toward the chosen side of each pair — full mechanics in Preference — RLHF · DPO · KTO. KTO (arXiv:2402.01306) generalizes the same idea to unpaired desirable/undesirable labels — the shape you get for free out of a rollout pool with a pass/fail verifier and no matched pairs. Self-Rewarding Language Models (arXiv:2401.10020) closes the loop online — the model generates its own new preference pairs each round instead of training on one frozen batch. Understanding the performance gap between online and offline alignment (arXiv:2405.08448) is the mechanistic reason iteration matters here: offline DPO measurably helps the model’s classification accuracy (can it tell chosen from rejected after training) without a matching gain in generation quality (does it actually produce the chosen behavior more often) — going online, resampling from the current policy each round, is what closes that gap. This is the direct citation behind §2.3’s “iterate 2–3 rounds” instruction below, and it’s the same distributional-gap argument Preference and Is the recipe a loop? already make about DPO’s off-policy-by-default weakness — not re-derived here.

1.3 Lineage C — reward design

Concrete Problems in AI Safety (arXiv:1606.06565) names reward hacking as a first-class failure mode a full decade before RLVR made it a daily operational concern. Skalse et al. (arXiv:2209.13085) formalize why it’s so hard to design around: a proxy reward is provably unhackable only under a constant-reward condition or a restricted policy class — for an unrestricted, expressive policy (any modern LLM), essentially every reward you can write down that isn’t the true objective itself has some hackable slack. Goal misgeneralization — Langosco et al. (arXiv:2105.14111) and Shah et al. (arXiv:2210.01790) — is the sharper, and for this chapter the load-bearing, half of that finding: even a correct reward specification is not sufficient, because the training data leaves the target goal underdetermined between several policies that all score equally well on the data you actually trained on. Shah et al.’s own framing is exactly the fix §3 uses below: disambiguate the target by making it structurally necessary — construct training/environment data such that the intended goal is the only remaining explanation for high reward. UED/PAIRED (arXiv:2012.02096) and its minimax-regret fix (arXiv:2507.03068) give the curriculum-design answer to the same disambiguation problem — generate environments that are maximally informative about which goal the policy has actually learned, rather than hand-picking a fixed curriculum that happens to be uninformative.

1.4 Convergence at DeepSeek-R1

DeepSeek-R1 (arXiv:2501.12948) is where all three lineages stop being separate research programs and become one shipped pipeline: cold-start SFT (an R-shaped fix — small, format/behavior-only, off-policy) → reasoning-focused RLVR (a P-shaped fix — GRPO reranking what the cold-started policy already samples, per Lineage A/C’s combined machinery) → rejection-sample ~800K rollouts off the RL-converged checkpoint and retrain from clean base (this re-diversifies/re-broadens the training pool before the next pass — restocking coverage that the RL stage’s entropy collapse had narrowed, not a K-fix in the strict sense but a K-adjacent move in the same “put breadth back before sharpening further” spirit) → a final all-scenario alignment RL pass. The paper’s own R1-Zero ablation (pure RL, zero cold-start SFT) is the direct, published proof that stage one has real marginal value — R1-Zero reaches comparable raw reasoning capability but ships with “poor readability, language mixing,” the exact failure mode an R-gap fix (format/behavior shaping) exists to close. Qwen3 (arXiv:2505.09388) runs the identical stage skeleton and states outright that it deliberately minimizes the cold-start stage’s size — confirming this is now default frontier practice, not a DeepSeek-specific quirk. (Full stage-by-stage mechanics of this convergence are in The recipe is a sequence, not a pick and Is the recipe a loop? — this chapter only needs the convergence point, not the whole sequence.)

1.5 Post-R1 fragmentation

Once the “K/R/P all get separately addressed, in this order” pattern became legible, 2025–2026 work immediately started arguing about the boundaries of what stage 3 (the sharpening/RL stage) can actually do:

  • Echo Chamber (arXiv:2504.07912) — RL post-training amplifies behaviors that were already precursors in pretraining; it doesn’t invent behavior with no pretraining trace.
  • The pass@k boundary debate. Yue et al. (arXiv:2504.13837) — the base model overtakes RLVR at large k; the reasoning boundary shrinks with training. ProRL (arXiv:2505.24864) — under prolonged, KL-controlled training with reference-policy resets, the boundary genuinely expands past what the base model ever reaches. The Two-Stage Dynamic View (arXiv:2510.04028) reconciles both as two phases of the same training run rather than a contradiction — full treatment of this debate, its stakes for this project, and the CoT-Pass@K/Cover@τ metric caveats already live in Reinforcement’s exploration section and Contested edges §1, §7; not re-derived here.
  • Scalpel vs. Hammer (arXiv:2507.10616) — “GRPO amplifies existing capabilities, SFT replaces them,” at the weight level. Flag this honestly every time it’s cited: single, 0-citation preprint, its own authors call it a “preliminary indication” — supporting color for the K/R/P split’s intuition, not the load-bearing evidence for it (that’s the Sharpening Mechanism proof above, plus SFT Memorizes/RL Generalizes, arXiv:2501.17161, cited fully in Contested edges §1).
  • RL’s Razor (arXiv:2509.04259) — on-policy RL forgets less than SFT because it’s implicitly KL-minimal from whatever policy preceded it: an on-policy update only has to move probability mass among things the current policy already samples, so it stays close to its own starting point in a way off-policy SFT — which pulls toward an externally-fixed target distribution — does not. The behavioral finding (RL forgets less) is well-replicated; the mechanistic explanation (KL-minimality specifically, vs. some other circuit-level preservation property) is actively being revisited. This is the citation behind §5’s staged-curriculum ordering below, used with that mechanism caveat carried forward.
  • Base Model Barrier (arXiv:2603.06957, very recent) — formalizes exactly what Lineage A’s Sharpening Mechanism proved qualitatively: escaping a region of genuinely zero base-model likelihood costs exponentially many reward queries under policy-gradient methods. This is the sharpest, most recent statement of “RL cannot cheaply create what CPT/SFT never put there” — direct grounding for §2.1’s K-gap routing.
  • PaST (arXiv:2601.11258, very recent) — measures the actual weight-space deltas SFT and RL produce and finds them near-orthogonal: the two stages aren’t fighting over the same parameter directions, which is a load-bearing empirical fact for §5’s “reconstruct subset-sums of stages without full retraining” ablation move.

None of these six papers overturns the K/R/P routing this chapter uses — they sharpen where the line sits between “elicit” and “expand,” which matters for how aggressively you can lean on a P-gap fix (§2.3) before it starts behaving like a K-gap fix in disguise. Treat the fragmentation cluster as live, contested terrain to watch, not a reason to distrust the routing itself.

1.6 What the genealogy buys you for routing

Three things carry forward from this history into §2’s mechanics, and it’s worth naming them once so the rest of the chapter can lean on them without re-arguing the point each time:

  1. Lineage A’s proof (Sharpening Mechanism, arXiv:2412.01951) is why K-gaps get routed away from every technique in §2.2–§2.4. Cold-start SFT, DPO/KTO, and GRPO are all, at bottom, members of the sharpening/self-improvement or preference lineages — they redistribute mass or reweight comparisons over what already has some support. None of them can be the fix for a gap defined as “zero support at any N.”
  2. Lineage B’s online-vs-offline finding (arXiv:2405.08448) is why §2.3 insists on iteration, not a single pass. A P-gap fix that stops after one offline round has only improved the model’s ability to tell apart chosen from rejected — not necessarily its tendency to generate the chosen behavior more often. That gap between classification and generation is exactly what makes a one-shot DPO run look like it “didn’t work” on eval even though the loss curve looked fine.
  3. Lineage C’s theorem (Ng-Harada-Russell, ICML 1999) is why §3 exists as a separate section rather than a footnote on §2.3. Once you’re tempted to add a reward bonus for the correct action instead of (or alongside) a preference pair, you’ve left the safely-understood territory of “reweight an existing comparison” and entered reward-design territory, where the policy-invariance guarantee only holds for one specific mathematical form of shaping.

2. The matched intervention, gap by gap

flowchart LR
  Diag["Diagnosed gap<br/>(see ../diagnosis.md)"] --> K{"K — never fires<br/>at any N"}
  Diag --> R{"R — fires at moderate N,<br/>but not the DEFAULT"}
  Diag --> P{"P — fires with real mass,<br/>just mis-ranked"}

  K --> K1["CPT: raw/paraphrased continuation rows<br/>(unsupervised, no chat structure)"]
  K --> K2["knowledge-SFT: forward+reverse QA rows<br/>on the fact, NOT full trajectories"]

  R --> R1["cold-start SFT rows:<br/>(prompt, reasoning-block, tool_call)<br/>thousands, format/behavior only"]

  P --> P1["DPO/KTO pair at the exact<br/>decision-divergence state:<br/>(chosen tool_call, rejected tool_call)"]
  P --> P2["or short GRPO pass:<br/>reward = 1 iff correct action used,<br/>prompt = the divergence state only"]

  classDef kfix fill:#132b22,stroke:#34d399,color:#eafaf3;
  classDef rfix fill:#3a2a10,stroke:#f5b942,color:#fff3d6;
  classDef pfix fill:#2b1313,stroke:#f87171,color:#fde8e8;
  class K,K1,K2 kfix;
  class R,R1 rfix;
  class P,P1,P2 pfix;

Reading the diagram left to right: the diagnosis (deferred to ./diagnosis.md) hands you exactly one of three verdicts, and each verdict has exactly one row-shape family attached to it — there is no “run all three, see what sticks” branch, because §1.6 above is precisely the argument for why that wastes budget on two-thirds of a portfolio it shouldn’t touch. The three subsections below walk each branch in the order K → R → P, matching increasing on-policy-ness and decreasing training-row volume — K needs the most data and the least of the model’s own behavior; P needs the least data and the most of the model’s own behavior.

GapSymptom in the amass exampleFixRow shapePolicyTypical volumeAnchor citation
Kamass never fires, at any N, any temperatureCPT + knowledge-SFTunsupervised continuation text; forward+reverse QA pairsoff-policylarge (CPT corpus) + small (QA set)Sharpening Mechanism, 2412.01951
RFires at moderate N, never the default, low-temp choiceCold-start SFT(prompt, reasoning-block, tool_call), format/behavior onlyoff-policythousands of rowsDeepSeek-R1 cold-start, 2501.12948
PFires with real mass, outranked by a shallow defaultOn-policy DPO/KTO or short GRPO(chosen, rejected) pair at the divergence state, or reward=1{correct action}on-policysmall — one decision pointDiaTool-DPO, 2504.02882

2.1 K → inject: CPT + knowledge-SFT, never raw trajectory-SFT

If the correct action never appears at any N, on any checkpoint, per the diagnostic battery in ./diagnosis.md, there is nothing on-policy to reinforce — the Sharpening Mechanism (arXiv:2412.01951) and the Base Model Barrier (arXiv:2603.06957) both say the same thing from different angles: you cannot cheaply RL your way to mass that isn’t there. The fix is off-policy injection, and it comes in exactly two row shapes, run in this order:

Run this: two-stage K-gap fix.

  1. Continued pretraining (CPT) — full-FT, low LR, raw or lightly-paraphrased unsupervised continuation text. Not a chat turn.
    amass enum -passive -d target.com performs passive-only subdomain
    enumeration via OSINT sources (crt.sh, VirusTotal, DNS aggregators)
    without ever sending a packet to the target's own infrastructure —
    this avoids the IDS/WAF triggers that amass enum -active risks...
    
  2. Knowledge-SFT — QA-format rows, both directions (dodges the reversal curse, arXiv:2309.12288: a model trained only on “A is B” does not reliably answer “what is A” from “B”).
    {"messages": [
      {"role": "user", "content": "What does the -passive flag do on amass enum?"},
      {"role": "assistant", "content": "Restricts amass to OSINT-only sources (crt.sh, VirusTotal, DNS aggregators) — it never touches the target directly, so it won't trip an IDS/WAF."}
    ]}
    {"messages": [
      {"role": "user", "content": "I need subdomain enumeration that never sends a packet to the target. Which tool/flag?"},
      {"role": "assistant", "content": "amass enum -passive."}
    ]}
    

What this is not: a full multi-turn recon-to-exploit trajectory that happens to include one amass call. That’s raw trajectory-SFT, and it’s the one thing this section explicitly rules out for a K-gap — training on a trajectory teaches “this is the shape a solve looks like,” which is a much weaker, noisier signal for “here is the standalone fact about this tool” than a direct QA row, and it compounds with a separate, serious risk (new-fact SFT rows measurably increase hallucination on unrelated facts once learned) that this chapter defers in full to ./trajectory-amplification.md rather than re-deriving. The full data-curation playbook for this stage — CPT-vs-SFT dosing, WRAP-style paraphrase counts, EntiGraph for narrow corpora, self-play Self-QA, KnownPatch interleaving — is deferred to ./knowledge-curation.md; this section only needs to establish the row shape and the ordering.

Common mistake — mistaking “can recite it” for “genuinely absent.” The K-gap probes in ./diagnosis.md distinguish recognition (the model can describe amass -passive when directly asked) from generation-in-context (it never reaches for the flag at the actual decision point). If a model passes the recognition probe but still fails the pass-at-k sweep during a live rollout, the fact is present — this is an R-gap wearing a K-gap’s costume, and routing it into CPT wastes compute on a fact the weights already encode while leaving the actual default-prior problem untouched. Run the recognition-vs-generation split before committing to §2.1’s two-stage fix, not after it fails to move the eval.

Hyperparameters/gotchas that matter here, carried forward from the genealogy: CPT is full-FT at a low learning rate, not LoRA-first — the Base Model Barrier’s exponential-cost argument (arXiv:2603.06957) is exactly the failure mode a rank-constrained update is worst-positioned to escape, since it further restricts how much of parameter space a single update can move through. Knowledge-SFT rows, by contrast, are cheap and low-rank-friendly — the fact itself is small; only the CPT stage needs the larger capacity budget.

2.2 R → re-prior: cold-start SFT, thousands of format/behavior rows

If the correct action fires at moderate N but the model’s default, low-temperature sampling never reaches for it, the fact is present but the prior isn’t — this is not a knowledge problem, it’s a distribution-shaping problem, and it’s solved the same way DeepSeek-R1’s own stage 1 solves it: a small, deliberately narrow, off-policy cold-start SFT pass whose entire job is to move where the policy’s probability mass starts before any RL or preference stage touches it.

The row is a full (prompt, reasoning-block, tool_call) unit — not a QA pair, because the target here is behavior at a decision point, not a fact:

{"messages": [
  {"role": "system", "content": "You are a security agent. Tools: run_command, submit_flag."},
  {"role": "user", "content": "Challenge: enumerate target.com for attack surface."},
  {
    "role": "assistant",
    "content": "<think>Before touching the host directly, passive subdomain enumeration (amass -passive) is lower-risk and often surfaces attack surface a direct nmap sweep misses — staging subdomains, forgotten hosts. Run that first, then port-scan whatever it finds.</think>",
    "tool_calls": [{"id": "call_1", "type": "function",
      "function": {"name": "run_command", "arguments": "{\"cmd\": \"amass enum -passive -d target.com\"}"}}]
  }
]}

Thousands of rows, not hundreds of thousands — Qwen3’s own explicit design intent is to minimize this stage’s size (arXiv:2505.09388), and DeepSeek-R1’s cold-start set is “thousands,” deliberately tiny (arXiv:2501.12948). R1’s own four sourcing methods, directly reusable here:

  1. Few-shot elicitation — prompt a strong model with 2–3 hand-written examples of the desired recon-first behavior, let it generate more in the same shape.
  2. Zero-shot elicitation with an explicit verify/reflect instruction — ask the model to solve the challenge and self-check before committing, then keep the outputs that pass.
  3. Self-distillation of the policy’s own rollouts — sample the current model, keep the (rare) rollouts where it did reach for amass first, use those as the seed.
  4. Reward-filtered rejection sampling — sample broadly, verify against the real environment, keep only trajectories where the correct-first-move pattern led to a genuine solve.

Cast every sourced row into the same reasoning-block template above, then, per PEAR (arXiv:2602.01058), do not pick the checkpoint that scores highest on the SFT loss/accuracy itself — pick the one at peak sample diversity (entropy or self-BLEU over K≥8 sampled completions per prompt). PEAR’s own finding is exactly the trap an R-gap fix can fall into: the SFT checkpoint that looks best by its own metric can be the worst initialization for whatever comes next (a P-gap fix, §2.3, or a sharpening pass, §4) because it has already collapsed onto one narrow phrasing of the target behavior — which is the opposite of what a re-prior stage should hand off. Measure diversity at every candidate checkpoint along the SFT run, not just at the final step.

Common mistake — letting cold-start grow into a capability-SFT pass. The row shape above is narrow on purpose: one decision point, one reasoning block, one tool call. It’s tempting to pad the set with full downstream trajectories once you’re already generating rows — resist it. A cold-start stage that grows past “thousands of narrow rows” starts behaving like the heavy SFT/DPO stage The recipe is a sequence already warns caps a later RL stage’s exploration room; the R-fix’s whole value is that it’s small enough to nudge the prior without over-constraining what §2.3 or §4 need to explore afterward. If the set feels too small to be “real training,” that’s closer to correct than a set that feels comfortably complete.

Hyperparameters/gotchas that matter here: dedupe aggressively across the four sourcing routes — few-shot elicitation and self-distillation of the model’s own rollouts can easily converge on near-identical phrasings of the same recon-first pattern, which quietly re-introduces the low-diversity failure PEAR’s checkpoint-selection rule is designed to catch. Cap volume per archetype the same way The kinds of SFT §6 recommends for any SFT corpus, not just this one.

2.3 P → re-rank: on-policy DPO/KTO at the divergence point, or a short GRPO pass

This is the amass example’s third variant, and the most commonly misdiagnosed of the three: the model already produces the correct action, with real, nontrivial probability mass, sometimes in the very same rollout batch as the wrong one — it’s outranked, not absent. Feeding this into an R-shaped cold-start SFT pass wastes a training run reinforcing a capability that’s already there off-policy; feeding it into a K-shaped CPT/knowledge-SFT pass teaches a fact the model already knows. What it needs is a ranking intervention, run on-policy, localized to the exact state where the divergence happens — not the whole trajectory.

DiaTool-DPO (arXiv:2504.02882) is the direct template: build the preference pair at the specific decision-state of a multi-turn tool-dialogue MDP, not by contrasting two entire episodes. For the amass case, that state is “just received the recon prompt, about to choose the first tool call” — not turn 40 of a 100-turn trajectory.

// DPO pair — localized to the divergence state
{
  "prompt": [
    {"role": "system", "content": "..."},
    {"role": "user", "content": "Challenge: enumerate target.com for attack surface."}
  ],
  "chosen":   {"tool_calls": [{"function": {"name": "run_command",
                "arguments": "{\"cmd\": \"amass enum -passive -d target.com\"}"}}]},
  "rejected": {"tool_calls": [{"function": {"name": "run_command",
                "arguments": "{\"cmd\": \"nmap -sV target.com\"}"}}]}
}
// KTO pair — same divergence state, unpaired labels (fits a mined pool of
// verified-good / verified-bad rollouts where matched pairs don't exist)
{"prompt": [...], "completion": {"tool_calls": [{"function": {"name": "run_command",
  "arguments": "{\"cmd\": \"amass enum -passive -d target.com\"}"}}]}, "label": "desirable"}
{"prompt": [...], "completion": {"tool_calls": [{"function": {"name": "run_command",
  "arguments": "{\"cmd\": \"nmap -sV target.com\"}"}}]}, "label": "undesirable"}

Where the pairs come from: mine them from the policy’s own rollout failures, not a hand-written contrast set — Boosting Tool Use (arXiv:2501.09766) mines deficiency pairs via tree search directly over the model’s own generated branches, comparing what it did produce against what it could have produced at the same state. This keeps the pair on-policy by construction, which matters more than which loss head you pick: on-policy-ness dominates loss-head choice (arXiv:2406.09279) — preference-data quality and how close it sits to the current policy’s own distribution explains more of the outcome variance than whether you run DPO vs. KTO vs. some other variant. Choose DPO if matched pairs exist naturally at the divergence point, KTO if you only have single-sided verified-good/verified-bad labels from a trace-verification pass.

Two guardrails, both load-bearing:

  • Guard against likelihood displacement. Near-duplicate chosen/rejected pairs — two amass invocations differing only in a flag — can cause Unintentional Unalignment (arXiv:2410.08847): DPO’s gradient pushes down the rejected sequence’s likelihood so hard it drags down neighboring, correct sequences in embedding space along with it. Discard near-duplicate pairs at data-construction time, not after observing the regression.
  • Iterate, don’t run once. Per §1.2’s online-vs-offline finding (arXiv:2405.08448), a single offline DPO/KTO pass improves the model’s ability to classify chosen-vs-rejected without a matched gain in how often it actually generates the chosen behavior at inference. Redeploy the updated checkpoint, resample fresh pairs from its current rollouts (not the original policy’s), retrain — 2–3 rounds, closing the classification-vs-generation gap each round. This is the same restart-vs-continue asymmetry Is the recipe a loop? already documents for preference-stage revisits — continue-from-current-checkpoint, regenerate fresh on-policy pairs each round, don’t reuse round-1 pairs in round 3.

Or, when the divergence is best expressed as a scalar reward rather than a pairwise contrast: a short GRPO pass, prompts fixed to the divergence state, reward = 1 iff the correct action was used, 0 otherwise. This is the P-gap’s RL-shaped alternative to DPO/KTO — same target (re-rank what’s already reachable), different mechanism (on-policy sampling + group-relative advantage instead of a closed-form pairwise loss). It should be short: this is a ranking fix on a narrow decision point, not a capability-expansion run, and §4 below is the caution against letting it run long enough to start behaving like one.

Common mistake — contrasting whole episodes instead of the divergence state. The most common way a P-gap fix silently degrades into wasted compute is building the (chosen, rejected) pair from two entire trajectories that happen to end differently, rather than the single state where the paths actually split. Two full episodes differ in dozens of ways beyond the one decision that matters — DPO’s gradient has no way to know which of those differences caused the reward difference, and the update spreads thin across all of them instead of sharpening the one branch you diagnosed. DiaTool-DPO’s whole contribution (arXiv:2504.02882) is refusing to do this — build the pair at the MDP state where the tool choice diverges, nowhere else.

Hyperparameters that matter: β (DPO’s KL-strength term — Preference has the full mechanics) should stay conservative here, since the goal is a targeted re-rank at one decision point, not a broad behavioral shift; a too-high β risks the likelihood-displacement failure above spreading further than the intended state. For the GRPO alternative, keep the prompt distribution narrow (the divergence state and close variants of it, not the full challenge portfolio) and the group size N modest — this is a polish pass, not a from-scratch RLVR run, and Reinforcement’s 30–60% baseline-band requirement still applies to whatever prompt set you construct.


3. Making the target instrumentally necessary — env/reward design as a P-gap force multiplier

A DPO/KTO pass or a short GRPO reward can re-rank the target action if the model already reliably reaches states where using it matters. If amass-style enumeration is merely helpful but optional — the challenge is also solvable, just less elegantly, by brute-forcing the visible subdomain — then any reward bonus for using it is fighting an uphill battle against Goal Misgeneralization (arXiv:2210.01790): the training data underdetermines why the bonus fires, and the policy can just as easily learn “sometimes get a bonus for a specific string in my tool call” as “OSINT-first recon is the right general strategy.” Shah et al.’s own fix, restated for this setting: make the target action structurally, instrumentally necessary — design the environment so the correct behavior is the only remaining path to reward, not one of several equally-scoring paths.

Concretely: withhold the flag-bearing staging subdomain from any DNS record reachable by a naive nmap/brute-force sweep, so it is recoverable only through OSINT-style passive enumeration. Run large-k rollouts against that bottleneck; if the sub-skill never fires even when it’s the sole path to reward, that’s the strongest possible confirmation of a genuine K-gap (not R or P) — this is Probe 4 of the diagnostic battery, deferred in full to ./diagnosis.md, but the environment-design move that produces the bottleneck is this section’s contribution, not that one’s.

Four guardrails on doing this without reopening a reward-hacking failure mode:

  • Keep any shaping strictly potential-based. Ng, Harada & Russell’s theorem (ICML 1999, no arXiv id) is the reason “just add a bonus for calling amass” is dangerous on its own — an arbitrary shaping term can change which policy is optimal, not merely which one is found faster. A potential-based term (F(s,a,s') = γΦ(s') − Φ(s), for some state-potential Φ) is provably policy-invariant: it can only change how fast you find the right answer, never which answer is right. Any dense intermediate signal layered onto the terminal flag-verified reward — matching the security-agent/GRPO reward-shaping discipline already established in Agentic & multi-turn RL — must take this form or it risks silently relocating the optimum.
  • Verify the trajectory, not just the outcome. A coarse, outcome-only reward under-specifies which tool use actually mattered — ToolRL (arXiv:2504.13958) is the direct citation for why a flag-only reward is insufficient once you’re trying to reinforce a specific mid-trajectory action: score whether the structurally-necessary tool call actually appears in the winning trajectory, not merely whether the episode ended in success (which, per the bottleneck design above, should now be equivalent — but verify it directly rather than assuming the bottleneck is airtight).
  • Don’t route through a hackable PRM if you can avoid it. If dense credit does need to flow through a learned scorer rather than a hard-coded environment bottleneck, know that state-of-the-art process reward models are systematically exploitable under RL pressurearXiv:2603.06621, very recent — the policy learns to satisfy the PRM’s proxy for “good reasoning” without the reasoning itself improving. If a PRM-scored path is unavoidable, use min-form credit assignmentPURE (arXiv:2504.15275) — which removes the single-step reward-farming exploit that summed/averaged PRM scores are prone to.
  • When multi-step reward hacking is the live risk (not just single-step), reach for myopic-plus-approval instead of a fully-learned critic. MONA (arXiv:2501.13011) trades a cheap per-step human/oracle approval signal against optimizing multi-step reward directly, specifically to prevent the kind of multi-turn reward hacking a hard-coded bottleneck can’t fully close off (e.g., an agent that finds an unintended second path to the flag once the intended one gets bottlenecked). MONA and PURE represent a genuine, unresolved trade-off — cheap step-level oracle approval (MONA) vs. trusting a learned PRM that’s itself hackable (PURE) — no consensus exists on which is preferable; pick based on whether a cheap-enough step-level oracle is available for your environment.

Worked resolution — the amass bottleneck, end to end

Putting §2.3 and §3 together for the running example: suppose diagnosis confirms a P-gap — amass calls appear in maybe 15% of sampled rollouts at the recon decision point, nmap-only appears in the other 85%, and both lead to a genuine solve when the target’s staging subdomain happens to also be brute-forceable. A DPO pass built on this environment is fighting Goal Misgeneralization (arXiv:2210.01790) the whole way: the training data can’t tell the model why amass should be preferred, because right now it isn’t actually necessary — it’s merely one of two equally-scoring paths, and the “preference” the pair encodes might just as easily be learned as “sometimes use this specific string” as “OSINT-first is the general strategy.”

The environment-design move: retarget the challenge so the flag-bearing subdomain is DNS-registered but never brute-force-guessable within the harness’s turn budget — reachable only through certificate-transparency-style passive discovery. Now:

Φ(state) = 1 if OSINT-derived subdomain list is non-empty, else 0
F(s, a, s') = γ·Φ(s') − Φ(s)     # potential-based bonus, Ng-Harada-Russell-safe

This bonus rewards reaching the OSINT-derived-list state faster, without ever changing which final policy is optimal — the terminal, ground-truth flag check remains the only large-magnitude reward, exactly the discipline Agentic & multi-turn RL’s reward-shaping section already establishes for this project. Re-run the P-gap DPO pair or short GRPO pass from §2.3 against this environment, and the pair now teaches something that generalizes — “OSINT-first recon is instrumentally necessary here,” not “this specific string sometimes scores higher.”


4. Sharpen (rejection-sampling/RFT) is last-stage-only

Rejection-sampling FT and short RFT/GRPO polish passes belong strictly after K, R, and P are separately addressed — they are a sharpening operation in the Lineage-A sense (redistribute mass within existing support, per the Sharpening Mechanism, arXiv:2412.01951), not a substitute for injecting missing knowledge or re-shaping a default prior. Run it inside the 0 < p < 1 band — a challenge subtype the current checkpoint sometimes solves, never a 0% or already-saturated one — and instrument three things simultaneously, not pass@1 alone:

  • Exploration — unique-correct-completions per prompt, tracked the way B-STaR does it (arXiv:2412.17256): are you still discovering new correct paths, or resampling the same one?
  • Exploitation — reward-spread collapse across the sampled group; a shrinking spread is the early warning that the policy is narrowing before the exploration signal says so.
  • pass@large-k alongside pass@1.

Run this: the tripwire. If pass@1 rises while pass@256 (or your largest affordable k) falls, that is not a stable win — it is the elicit-not-expand signature (Yue et al., arXiv:2504.13837): the sharpening pass is narrowing the reasoning boundary in exchange for a higher hit rate on the easy part of it. The fix is not more training steps on the same data — it’s more rollouts per prompt. BroRL (arXiv:2510.01180) shows scaling the rollout count per prompt directly counteracts the step-count plateau that drives this collapse; add breadth before you add duration.

This is the same tripwire Reinforcement’s graduation trigger instruments via entropy — read that section for the mechanism (R = -a·exp(H)+b) this section’s pass@1-vs-pass@256 check is the outcome-level symptom of.


5. Staged curriculum, and the ablate-a-stage protocol

Given all three gap fixes plus a sharpening pass might apply to different subsets of the same failing portfolio, the ordering isn’t arbitrary. Mirror DeepSeek-R1’s own stage order (§1.4): highest-distribution-shift stage first, lowest-drift stage last.

  • K first — CPT/knowledge-SFT is the largest single distributional shift you’ll apply (new facts, potentially a new token distribution entirely), and it’s cheapest to detect and repair forgetting from early, while you still have full budget to catch a regression before compounding it with three more stages on top.
  • R second — cold-start SFT is a smaller, narrower shift (format/behavior only, thousands of rows), and needs the K-stage’s facts already in place to have anything correct to shape a prior toward.
  • P third — on-policy DPO/KTO or a short GRPO reranking pass is smaller still, and per RL’s Razor (arXiv:2509.04259) an on-policy update is implicitly KL-minimal from whatever precedes it — it moves probability mass only among things the current policy already samples, so it drifts least from the checkpoint it starts on. (Behavioral finding well-replicated; the KL-minimality mechanism specifically is being revisited by newer mechanistic work questioning whether KL-proximity or circuit-level preservation is the real causal variable — carry that caveat forward, don’t state the mechanism as settled.)
  • Sharpen last — §4’s rejection-sampling/RFT polish, by construction, only redistributes mass that K/R/P have already put in the right place; running it earlier just sharpens a still-wrong distribution faster.

The ablate-a-stage-on-a-frozen-eval protocol, directly reusable here: build a checkpoint at each of base → K-fix → R-fix → P-fix → sharpen, and score every one of them on a single frozen shared eval suite — never a stage’s own training metric. This is the same discipline Quagmires in SFT-RL Post-Training (arXiv:2510.01624) establishes for the SFT→RL boundary specifically (high SFT-stage accuracy on its own metric can predict worse downstream RL) and PEAR (arXiv:2602.01058, §2.2 above) establishes for picking a checkpoint by diversity instead of accuracy — generalized here across all four stages, not just the SFT/RL pair. If a stage’s marginal delta on the frozen suite is negative, stop and re-diagnose rather than pushing forward to the next stage — a negative delta at, say, the R-fix checkpoint means either the K-fix underneath it was incomplete, or what looked like an R-gap was actually something else.

A genuine shortcut this protocol buys you, if it holds on your own data: PaST (arXiv:2601.11258) found SFT and RL weight-space deltas are near-orthogonal — if that holds for your K/R/P-fix deltas too, you can reconstruct subset-sums of stages (K+P without R, say) by adding the relevant weight deltas together, without a full retrain from base for every combination you want to test. Verify this on your own checkpoints before relying on it; it’s a very recent, single-source finding, not yet independently replicated.

When to skip the staging entirely. The four-stage order above is the answer when a portfolio-wide diagnosis turns up a mix of K/R/P failures across different challenge subtypes — which is the common case per Diagnosing the gap’s own bottom line (“expect a split verdict, not one number”). If your diagnosis instead comes back clean — every failing challenge in the current batch is the same gap type — skip straight to that single fix rather than running all four stages on principle; §5’s ordering exists to sequence multiple, different fixes safely, not to mandate a fixed four-stage pipeline regardless of what was actually diagnosed.

Exit criteria per stage, adapted from Is the recipe a loop?’s general loop-exit rule to this chapter’s four named stages: stop advancing to the next stage, and re-diagnose instead, when any two hold — (a) the frozen-suite delta for the current stage is within noise of the previous checkpoint, (b) pass@64 on the current checkpoint is flat vs. the checkpoint before it, (c) a non-targeted behavior’s own rate has measurably dropped since the previous stage. This is the same exit test Is the recipe a loop? §4 uses for the broader SFT↔RL loop, applied here one level more granularly — per K/R/P/sharpen stage, not per pipeline round.


  • Diagnosing the gap — a scientific framework — the pass@k / Pass@(k,T) / Cover@τ / elicitation-ladder instrumentation that tells you which gap (K/R/P) a given failure is, before this chapter’s routing applies.
  • ./diagnosis.md — the fuller K/R/P-specific diagnostic battery this chapter assumes as input: the pass-at-k sweep, the in-context oracle probe, teacher-forced logprob spans, the reversal check, and the purpose-built bottleneck task from §3 above.
  • ./knowledge-curation.md — the full K-gap data-curation playbook (CPT dosing, WRAP-style paraphrasing, EntiGraph for narrow corpora, forward/reverse QA construction, self-play Self-QA, KnownPatch interleaving) that §2.1 only sketches.
  • ./data-centric-methods.md — generic data-selection machinery (quality/complexity/diversity filtering, IFD/LESS/DEITA-style scoring) that applies across all three gap-fix row shapes, not repeated here.
  • ./trajectory-amplification.md — the full warning behind §2.1’s “never raw trajectory-SFT for a K-gap”: why new-fact SFT rows compound into hallucination on unrelated facts, and why the highest-scoring SFT checkpoint can be the worst RL init.
  • Imitation — SFT · distillation · rejection sampling and The kinds of SFT — the on/off-policy presets and row-shape taxonomy §2.1/§2.2’s CPT/knowledge-SFT/cold-start rows are instances of.
  • Preference — RLHF · DPO · KTO and Reinforcement — PPO · GRPO · RLVR — full DPO/KTO/GRPO mechanics behind §2.3 and §4, not re-derived here.
  • The recipe is a sequence, not a pick and Is the recipe a loop? — the stage-ordering and continue-vs-restart mechanics §1.4 and §5’s curriculum lean on directly.
  • The decision — the one-line K/R/P-adjacent routing tree (knowledge / execution / ranking gap) this chapter’s three-way split is the fuller, matched-intervention version of.
  • Contested edges & landmines §1, §7, §9 — the full “does RL elicit or expand” debate behind §1.5’s fragmentation cluster and §4’s tripwire.
  • Agentic & multi-turn RL — the reward-masking and shaping discipline (mask tool-output tokens, keep the terminal signal ground-truth) §3’s guardrails extend into the multi-turn setting.

Bibliography

CitationarXiv / sourceConfidence
Ng, Harada & Russell, Policy Invariance Under Reward TransformationsICML 1999, no arXiv idHIGH — foundational theorem
Silver et al., Mastering the game of Go with deep neural networks and tree search (AlphaGo)Nature 529, no arXiv idHIGH
Silver et al., Mastering the game of Go without human knowledge (AlphaGo Zero)Nature 550, no arXiv idHIGH
Zelikman et al., STaR: Bootstrapping Reasoning With Reasoning2203.14465HIGH
Dong et al., RAFT: Reward rAnked FineTuning2304.06767HIGH
Gulcehre et al., Reinforced Self-Training (ReST)2308.08998HIGH
Singh et al., Beyond Human Data (ReST-EM)2312.06585HIGH
Shao et al., DeepSeekMath (GRPO)2402.03300HIGH
Huang, Block, Foster et al., Self-Improvement in Language Models: The Sharpening Mechanism2412.01951HIGH
Rafailov et al., Direct Preference Optimization2305.18290HIGH
Ethayarajh et al., KTO: Model Alignment as Prospect Theoretic Optimization2402.01306HIGH
Yuan et al., Self-Rewarding Language Models2401.10020HIGH
Tang et al., Understanding the performance gap between online and offline alignment algorithms2405.08448HIGH
Amodei, Olah, Steinhardt et al., Concrete Problems in AI Safety1606.06565HIGH
Skalse, Howe, Krasheninnikov, Krueger, Defining and Characterizing Reward Hacking2209.13085HIGH
Langosco et al., Goal Misgeneralization in Deep Reinforcement Learning2105.14111HIGH
Shah, Varma, Kumar et al., Goal Misgeneralization: Why Correct Specifications Aren’t Enough2210.01790HIGH
Dennis, Jaques, Vinitsky et al., Emergent Complexity via Unsupervised Environment Design (UED/PAIRED)2012.02096HIGH
Sadek, Farrugia-Roberts, Anwar et al., Mitigating Goal Misgeneralization via Minimax Regret2507.03068HIGH
DeepSeek-AI, DeepSeek-R12501.12948HIGH
Qwen Team, Qwen3 Technical Report2505.09388HIGH
Zhao et al., Echo Chamber: RL Post-training Amplifies Behaviors Learned in Pretraining2504.07912MED
Yue et al., Does RL Really Incentivize Reasoning Capacity Beyond the Base Model?2504.13837HIGH
Liu et al. (NVIDIA), ProRL: Prolonged RL Expands Reasoning Boundaries2505.24864HIGH
Yao et al., The Debate on RLVR Reasoning Capability Boundary — Two-Stage Dynamic View2510.04028MED
Rajani et al., Scalpel vs. Hammer2507.10616LOW — single preprint, authors call it “preliminary”
Shenfeld et al., RL’s Razor: Why Online RL Forgets Less2509.04259MED — behavior agreed, mechanism contested
Mousavi-Hosseini & Erdogdu, Post-Training with Policy Gradients: Optimality and the Base Model Barrier2603.06957MED — very recent
Tang, Wang, Wang et al., PaST: Knowledge is Not Enough2601.11258MED — very recent
Zhang, Xu, Wang, Chen, Peng, Good SFT Optimizes for SFT, Better SFT Prepares for RL (PEAR)2602.01058MED — very recent
Jung et al., DiaTool-DPO2504.02882MED
Zeng, Ding, Wang et al., Boosting Tool Use via Iterative Reinforced Fine-Tuning2501.09766HIGH
(loss-head-choice vs on-policy-ness variance study)2406.09279MED
Razin, Malladi, Bhaskar et al., Unintentional Unalignment: Likelihood Displacement in DPO2410.08847HIGH
Qian, Acikgoz et al., ToolRL: Reward is All Tool Learning Needs2504.13958HIGH
Tiwari, Tomar et al., Reward Under Attack: Robustness and Hackability of PRMs2603.06621MED — very recent
Farquhar, Varma, Lindner et al., MONA: Myopic Optimization with Non-myopic Approval2501.13011HIGH
Jie, Xiong, Qiao et al., Stop Summation: Min-Form Credit Assignment (PURE)2504.15275HIGH
Hu et al. (NVIDIA), BroRL: Scaling RL via Broadened Exploration2510.01180HIGH
Zeng, Huang, Zhao et al., B-STaR: Monitoring and Balancing Exploration and Exploitation2412.17256HIGH
Kang et al. (FAIR at Meta), Quagmires in SFT-RL Post-Training2510.01624HIGH
Berglund, Tong, Kaufmann et al., The Reversal Curse2309.12288HIGH

Confidence calibration, stated once: every id above was carried forward from a prior verification pass against arxiv.org/abs/<id> (artifacts/three-gap-survey/ledger-E.md), not recalled from training-data memory. “MED — very recent” ids (2601.11258, 2602.01058, 2603.06957, 2603.06621, 2510.04028) are single-source, low-citation-count-at-verification-time findings — treat as promising, directionally load-bearing for this chapter’s routing, not yet independently replicated. arXiv:2507.10616 is flagged LOW everywhere it’s cited in this book, this chapter included — its own abstract calls the finding preliminary.

The data-curation toolkit — selection, negatives, coverage

The question this chapter answers: given a pile of run logs and a diagnosed gap, what are the actual mechanics — which row to keep, how to mine a negative that teaches the right ranking, how to synthesize what’s missing, how to prove your data has a hole before you find out the expensive way — that turn “we have logs” into “we have a training set”? BLUF: there is no single “clean the data” step. Selection, negative-mining, active acquisition, decontamination, curriculum, synthesis, and coverage-auditing are seven separate instruments, each answering a different sub-question, and the field’s post-2022 LLM literature is almost entirely three much older ideas — curriculum/self-paced learning, active learning, and hard-negative mining for contrastive retrieval — re-derived for autoregressive transformers. Knowing the lineage tells you which tool each new-sounding 2025/2026 paper is actually handing you.

This chapter is the cross-cutting toolkit, not the per-gap playbook. It answers how you select, mine, and audit data; it deliberately does not re-decide which fix (SFT vs DPO vs GRPO) a given failure needs — that routing lives in Matching the fix to the gap and The three gaps, defined, whose K/R/P vocabulary (Knowledge gap / prior-ranking “R” gap / policy-vs-judgment “P” gap) is exactly the taxonomy this chapter’s methods feed: §1–2 and §7–8 are mostly load-bearing for K- and R-gaps (what to inject, how to know it’s missing), §3–4 are mostly load-bearing for R- and P-gaps (how to mine the negative that teaches the ranking). (K/R/P maps onto framework.md’s knowledge/execution/exploration lens as execution = R ∪ P, one continuous axis at two granularities — see taxonomy.md §0 for the full reconciliation, canonical.) The kinds of SFT §6 already covers LIMA/AlpaGasus/IFD/LESS/DEITA and n-gram decontamination at the SFT-row level — this chapter extends that into the full toolkit (production-scale gotchas, hard-negative mining for preference pairs, active/curriculum acquisition, synthesis mechanics, coverage-gap detection) without repeating its worked examples. Per-gap-specific curation (what a confirmed K-gap corpus recipe looks like end to end) is Knowledge-gap curation; which fix to route to per gap is Intervention per gap; preference-method mechanics (the DPO/KTO loss itself) is Preference.

Running example, threaded through every section: your CTF-solving agent’s run logs, where you need to decide (a) which of your run-log rows survive into a training set, (b) how to construct (shallow-tool ≺ expert-tool) and (default-args ≺ expert-args) preference pairs — the agent reaches for nmap/curl by reflex and never reaches for amass (passive subdomain/recon enumeration) even when it’s the objectively better tool for the job — and (c) how you’d prove, before you spend a training run finding out, that your corpus has a coverage hole where amass/passive-recon should be.

Status: every arXiv id below is verified live against arxiv.org/abs/<id> per the source ledger (artifacts/three-gap-survey/{section-F,ledger-F}.md, verification pass 2026-07-02); non-arXiv sources (OpenReview, ACL Anthology, pre-arXiv classics) are cited by venue, not linked to an invented id. Confidence tags follow the ledger: unmarked = CONFIRMED and load-bearing; flagged inline where a claim is single-paper, contested, or too recent to be independently replicated.


0. The genealogy in three lines

Three 2009–2010-era ideas, developed independently for entirely different problems, are what every 2023–2026 LLM-data-curation paper in this chapter re-derives:

LineageClassic rootCore moveModern re-derivation (this chapter)
Curriculum / self-paced learningBengio et al., Curriculum Learning, ICML 2009 (no arXiv id)Order/weight examples by a computable “easiness”DAPO dynamic sampling arXiv:2503.14476, PCL arXiv:2510.01135 — §6
Kumar, Packer & Koller, Self-Paced Learning, NeurIPS 2010 (no arXiv id)The model itself sets the pace, not an external teacherSame — the “self-paced” idea is why RL curricula must be recomputed online, not cached
Active learningSettles, Active Learning Literature Survey, UW-Madison TR1648, 2009 (no arXiv id); Seung, Opper & Sompolinsky, Query-by-Committee, COLT 1992 (no arXiv id); Lewis & Gale, uncertainty/margin sampling, SIGIR 1994 (no arXiv id)Acquire the example the model is most uncertain aboutSemantic entropy arXiv:2302.09664, Active Instruction Tuning arXiv:2311.00288 — §4
Hard-negative miningANCE, Xiong et al. 2020 arXiv:2007.00808; formal NCE-bias grounding, Zhang & Stratos, NAACL 2021 (aclanthology.org/2021.naacl-main.86)The negative must be sampled from the model’s own current top-ranked wrong candidates, or the gradient vanishesRSO arXiv:2309.06657, Verified Critical Step Optimization arXiv:2602.03412 — §3

Why the lineage matters practically: every time a 2025/2026 paper’s headline sounds novel — “online curriculum for RL,” “prompt-perturbation uncertainty,” “policy’s-own-failures hard-negative mining” — check which of these three roots it’s re-deriving. It tells you the failure mode it doesn’t fix (self-paced curricula still need re-estimation as the policy moves; uncertainty sampling still confounds “unsure of the fact” with “unsure of the phrasing”; hard-negative mining still needs a floor against too-easy or too-hard negatives) before you trust a paper’s improvement as free.


1. Selection — which rows to keep

“Selection” answers one question: given a pool of candidate SFT rows, which subset do you actually train on? The seminal finding, repeatedly confirmed at small-to-medium scale then complicated at production scale, is that more data is not more signal — a smaller, better-chosen set beats a larger, unfiltered one.

MethodMechanismWhat “quality” means, operationallyRegime it’s proven in
LIMA arXiv:2305.112061,000 hand-curated, human-quality pairsCorrectness + stylistic consistency, judged by humans≤10K rows; the “Superficial Alignment Hypothesis” — capability is already latent from pretraining, SFT mostly reshapes which in-support behavior surfaces by default
AlpaGasus arXiv:2307.08701LLM-judge 0–5 score, keep the top sliceA correctness floor — is the response even right/on-topic — not a difficulty or diversity signal10K–100K pools
IFD / Cherry selection arXiv:2308.12032loss(response | instruction) / loss(response alone) on the target checkpointModel-relative “how much does the instruction actually help predict this response” — high IFD = the model needed the instruction to get there, i.e. informativeRecomputed per checkpoint; cheapened ~20× via a GPT-2-scale proxy that correlates strongly with target-model IFD (Superfiltering, arXiv:2402.00530)
LESS arXiv:2402.04333Gradient-cosine-similarity to a handful of exemplars of a named target capabilityCapability-targeted influence — does this row’s gradient point the same direction as “the skill I’m trying to fix”~5% of a pool selected this way outperforms the full pool for that capability specifically; the right tool once you’ve localized a gap via a diagnostic probe, not a general-purpose default
DEITA arXiv:2312.15685Formalizes quality/complexity/diversity as three separable, jointly-optimized axesSee §26K selected rows matched/beat 10× more unfiltered data
BIDS arXiv:2501.12147Balances influence-based selection (LESS-style) across multiple target capabilitiesFixes LESS’s failure mode: naive top-k gradient-influence over-concentrates on whichever capability already dominates the rankingUse whenever you’re selecting for more than one named capability at once

What “quality” operationally means, collapsed to one sentence per axis: correctness (AlpaGasus) is “is this response actually right,” informativeness (IFD) is “did the model need this instruction to produce this response,” targeted influence (LESS/BIDS) is “does this row’s gradient point at the specific capability I diagnosed as missing” — three different, all legitimate, all not interchangeable meanings of “good data.”

The production-scale correction

The single most important corrective in this literature: at production scale, most of this collapses toward random. Ivison et al. (AI2, up to 5.8M-row pools) arXiv:2503.01807 found IFD/DEITA/complexity-style selection falls below random selection once you count their own compute cost — only a cheap, gradient-free, judge-free representation-similarity method (RDS+: weighted mean-pooled hidden states of a pretrained-not-instruction-tuned LM, similarity/kNN against a small target set) stays Pareto-optimal at every scale. This is independently corroborated by the Qwen/Alibaba team at million-scale, arXiv:2410.09335: self-scoring methods that beat random at 10K–100K scale become statistically indistinguishable from random at million-scale, on two independent million-scale pools.

This is a genuine, unresolved contested edge, not settled: the seminal small-scale papers (10K–100K pools) all say sophisticated selection wins; the two production-scale studies above say it collapses to or below random once compute is counted. The field has not published a principled crossover pool-size threshold. Regime-gate your method choice (§9) rather than trusting either side unconditionally.

A related complication for your teacher choice, not selection per se: arXiv:2411.07133 found that a stronger model’s own benchmark performance does not monotonically predict how good its responses are as SFT training targets for a given student — don’t assume “biggest teacher available” is automatically the best distillation source without checking student-side downstream fit.


2. The quality / diversity / complexity axes

DEITA arXiv:2312.15685 is the paper that names this precisely, and its most load-bearing finding for your case isn’t the score itself — it’s the failure mode of naive scoring: ranking candidates by quality/complexity alone and taking the top-k reproduces whatever pattern already dominates the pool. If 80% of your run logs are nmap-then-curl trajectories, a pure quality-score top-k selection over that pool gives you a curated set that is still 80% nmap-then-curl — high-scoring rows cluster around the harness’s existing skew unless an explicit diversity/coverage constraint forces otherwise. This is the exact mechanism behind “the model reaches for one salient tool, uses default args”: your existing SFT/rollout pool has that skew, and score-only selection amplifies rather than corrects it.

InsTag arXiv:2308.07074 operationalizes diversity and complexity as two independently measurable axes via open-set LLM tagging: diversity = number of unique tags present, complexity = tags-per-example, both correlating with SFT quality holding dataset size fixed. This is the tagging machinery §7’s synthesis-conditioning and §8’s coverage audit both reuse.

The concrete fix for the “one salient tool” failure, combining §1’s methods with the diversity constraint:

  1. Score the pool by quality/informativeness (AlpaGasus or IFD).
  2. Walk the score-ranked list; keep a candidate only if its (tool_name, arg_pattern)-distance (or embedding distance, if you don’t have a structured tool signature) to every already-kept row exceeds a threshold τ.
  3. This — DEITA’s diversity-dedup applied as a hard constraint on top of, not instead of, quality ranking — is the mechanism that specifically prevents top-k selection from reproducing the prior-collapse it’s supposed to fix.

Note what this does and doesn’t do: it makes your existing good amass rows survive selection instead of being crowded out by a thousand near-duplicate nmap rows. It does not create amass rows that don’t exist in the pool at all — that’s a synthesis problem (§7) or a coverage-gap problem (§8), not a selection problem. Selection can only re-weight what’s already there.


3. Hard-negative mining for preference pairs

This is the P-gap machinery: constructing (chosen, rejected) pairs so that DPO/KTO actually teaches the right ranking, rather than a pair so trivial the gradient vanishes or so extreme it teaches a shortcut.

The lineage, applied

ANCE’s founding result arXiv:2007.00808 — random or in-batch negatives give a vanishing gradient once a model is even moderately good, because the model already ranks them far below the positive; a hard negative has to come from the model’s own current top-ranked wrong candidates, mined globally, not sampled at random. RSO arXiv:2309.06657 ports this to preference optimization directly: both DPO’s static pairs and SLiC’s SFT-policy-only pairs diverge from the maximum-likelihood target, and rejection-sampling toward the estimated optimal policy before pairing closes that gap. DPO itself arXiv:2305.18290 establishes the (prompt, chosen, rejected) triplet objective — but the load-bearing finding for curation, not algorithm choice, is Ivison et al.’s systematic ablation arXiv:2406.09279: across {preference data, algorithm, reward model, training prompts}, preference-data quality dominates outcome variance more than DPO-vs-PPO-vs-KTO algorithm choice. Put engineering budget in the mining pipeline below, not in loss-function tuning.

The worked pipeline, for (shallow-tool ≺ expert-tool)

flowchart TD
  A["Roll out K=4-8 samples per task,<br/>current checkpoint, T≈0.7-1.0"] --> B["Decompose at the tool-call<br/>DECISION POINT, not whole trajectory<br/>(ANCE/RSO principle)"]
  B --> C["Verify each candidate:<br/>tool-exists · arg-schema-valid ·<br/>arg-semantically-correct<br/>(structured rubric, not judge alone)"]
  C --> D["Mine the hard negative =<br/>highest-rubric-scoring WRONG<br/>action at that decision point"]
  D --> E["Reject near-zero-probability<br/>candidates — vanishing gradient<br/>just like random negatives"]
  E --> F["Construct the MINIMAL PAIR:<br/>anchor at the tool-call boundary,<br/>continue BOTH branches with the<br/>POLICY'S OWN rollout"]
  F --> G{"DIAGNOSTIC GATE:<br/>does the policy complete the<br/>'chosen' branch at a non-trivial<br/>rate (mini pass@k)?"}
  G -->|No| H["K-GAP masquerading as a<br/>ranking problem —<br/>route to §7/knowledge-curation,<br/>NOT DPO"]
  G -->|Yes| I["CHES similarity check<br/>(chosen vs rejected embeddings)"]
  I -->|Too similar| J["Discard/diversify —<br/>likelihood-displacement risk"]
  I -->|OK| K["Train; monitor chosen<br/>log-prob directly, not<br/>just the margin"]

Concretely, at the amass-vs-nmap decision point (recon stage, target has a large unenumerated subdomain surface):

// Anchor: same prefix, same decision point. Two branches diverge here.
{
  "prompt_prefix": [
    {"role": "system", "content": "Tools: nmap, amass, curl, submit_flag."},
    {"role": "user", "content": "Target: corp-app.example.com. Find the flag."}
  ],
  "chosen": {
    "tool_calls": [{"function": {"name": "amass", "arguments": "{\"domain\": \"example.com\", \"mode\": \"passive\"}"}}],
    "rationale_for_chosen": "Broad passive enumeration before touching any single host — surfaces staging/internal subdomains nmap alone won't find."
  },
  "rejected": {
    "tool_calls": [{"function": {"name": "nmap", "arguments": "{\"target\": \"corp-app.example.com\", \"ports\": \"1-1000\"}"}}],
    "why_this_is_the_hard_negative": "Not a strawman — nmap is a HIGH-rubric-scoring, plausible, frequently-correct action; it's wrong here specifically because it skips subdomain enumeration on a target with a large unenumerated surface. That's what makes it a hard negative, not a random one."
  }
}

The diagnostic gate (Verified Critical Step Optimization arXiv:2602.03412) is the step people skip and shouldn’t: force the current policy to continue executing from the chosen branch and check it succeeds at a non-trivial rate. If the policy can’t complete the amass-first path even when handed it, that’s not a ranking problem — the model doesn’t know how to use amass effectively (a K-gap), and training DPO on this pair risks amplifying an unfixed knowledge gap rather than fixing a preference ranking. Route to synthesis/knowledge-injection (§7, Knowledge-gap curation) instead.

The ceiling: likelihood displacement

arXiv:2410.08847 (Razin, Malladi, Bhaskar, Chen, Arora, Hanin — Princeton, ICLR 2025) is the hard ceiling on “how minimal can a mined pair be.” A chosen/rejected pair that is too embedding-similar can catastrophically push probability mass onto a third, unintended, semantically-distant completion, rather than genuinely re-ranking chosen above rejected. Diagnosed via a CHES (centered-hidden-embedding-similarity) check between the pair before training; monitored during training via the chosen-response log-probability directly, not just the chosen-minus-rejected margin — a shrinking margin can hide a chosen log-prob that’s also silently falling.

Contested, and worth A/B-testing before you build on-policy mining infra: is on-policy negative sampling (the ANCE/RSO prescription above) always better than static negatives? A 2026 ICLR poster (OpenReview tz9mJmgrdM) found it ranges from 3× better to 0.4× worse depending on model/task, with the flip-sign mechanism uncharacterized. Don’t assume on-policy is automatically correct for your setup — verify on your own model before investing in the rollout infrastructure the pipeline above needs.


4. Active-learning / uncertainty-guided acquisition

Selection (§1) filters a pool you already have. Active learning decides which new example to generate/label next, targeting the diagnosed gap directly instead of hoping a fixed pool happens to contain it. Classic roots: core-set arXiv:1708.00489 (diversity over per-example uncertainty in batch settings), BALD arXiv:1703.02910 (MC-dropout mutual information as an uncertainty proxy).

The crucial LLM-era fix — semantic, not token, entropy. Raw token-level entropy is dominated by paraphrase/lexical variation, not by genuine uncertainty about the underlying fact or decision. Semantic entropy arXiv:2302.09664 (Kuhn, Gal & Farquhar) fixes this: sample k completions, cluster them by bidirectional NLI entailment, compute entropy over the cluster distribution rather than the raw token distribution. This is your direct K-vs-R distinguishing instrument.

Active Instruction Tuning arXiv:2311.00288 operationalizes query-by-committee via prompt-paraphrase disagreement instead of a model ensemble — no second model needed. Runnable today, directly on your tool-choice problem:

  1. Take the same scenario (target with a large unenumerated subdomain surface), generate 3–5 paraphrases varying phrasing, not the underlying task.
  2. Run the current checkpoint on each paraphrase at T≈0.7–1.0.
  3. Measure the tool/argument-choice flip-rate across paraphrases.
Flip-rate observedReadingRoute
High flip-rate (correct action fires on some phrasings, not others)The prior is genuinely unstable — correct action is in-support but low-probabilityR-gap: curated-diversity SFT or DPO
Near-zero flip-rate, consistently wrong across all phrasingsEither the model doesn’t know amass applies here at all, or it’s confidently, stably wrongEscalate to semantic entropy (above) to separate “unsure of the fact” (K-gap) from “unsure of the phrasing but confident of the wrong tool” (P-gap)

RLVR dynamic sampling — active acquisition inside the training loop

On the RL side, the single most-replicated 2025–2026 finding — PCL arXiv:2510.01135, AdaRFT arXiv:2504.05520, SEC (Self-Evolving Curriculum) arXiv:2505.14970, DAPO’s Dynamic Sampling arXiv:2503.14476, and VCRL (OpenReview FBhWTuMTYA) — is that training signal is maximized at intermediate difficulty: pass-rate ≈ 50%, equivalently maximal reward-variance across a rollout group. This is free: the k rollouts GRPO already generates give you pass_rate and reward_std with zero extra inference.

# free — reuses rollouts you already generate
pass_rate = mean(reward for _ in rollouts)          # per prompt, across k samples
reward_std = std(reward for _ in rollouts)
if reward_std ≈ 0:                                   # all-correct or all-wrong: zero advantage signal
    drop_and_resample(prompt)                        # DAPO's Dynamic Sampling, arXiv:2503.14476
oversample(prompts_with(pass_rate in [0.2, 0.6]))    # this is the literature-side justification
                                                       # for keeping a GRPO baseline in the ~30-60% band

Because difficulty is policy-dependent and goes stale as the policy improves, PCL/SEC recompute it online via a learned value model or bandit rather than caching a once-computed label — a static difficulty score is wrong by definition after enough training steps.

Contested, two different decisions, not a contradiction: arXiv:2508.14094 finds that under a fixed data-acquisition budget (new problems to annotate/verify), prioritizing the hardest available examples gives the largest GRPO gains (up to 47%) — the opposite of the intermediate-difficulty rule above. The two rules answer different questions: what to collect (acquisition budget → go hard) vs. what to train on per training step from an already-large pool (batch composition → stay intermediate). Don’t apply one where the other belongs.


5. Decontamination for eval integrity

This is a load-bearing confound on every method above: a curation or synthesis pipeline that accidentally leaks your held-out eval into the training pool doesn’t fail loudly — it inflates the training-set score without inflating real capability, and every diagnostic in this book that reads “the fix worked” is only as trustworthy as this gate.

Stage 1 — cheap, mandatory baseline. N-gram overlap: a token counts as contaminated if it sits in a shared run of more than ~10 tokens between an eval sample and the training set — this is the methodology the Llama 2 report uses (§A.6) and is a standard, reproducible first pass. Pair with exact-substring/suffix-array and MinHash near-duplicate detection across the full corpus, not just the eval set — deduplication of the training corpus itself measurably improves downstream models independent of any eval-leakage concern arXiv:2107.06499.

Stage 2 — mandatory if any rephrase/persona/backtranslate step touched source material (§7 does, by construction). N-gram-only decontamination is trivially bypassed by paraphrase arXiv:2311.04850 (the LLM Decontaminator paper) — exactly the kind of rephrasing your synthesis pipeline does on purpose. An embedding-similarity flag (cosine >~0.80–0.85) plus an LLM-judge confirmation pass (“is this a paraphrase/restatement such that the answer is directly inferable?”) is required on top of, not instead of, n-gram/MinHash dedup.

Stage 3 — RL-specific, and the reason this section isn’t just an SFT concern. A single very recent controlled study arXiv:2601.06103 (Jan 2026, small models 0.5B–4B, not yet independently replicated) found GRPO-style RL on clean data generalizes leaked pretraining contamination to uncontaminated same-family items, whereas SFT only re-inflates the literal contaminated rows. A clean RL environment sitting on a contaminated base model can silently look like genuine capability gain. Before trusting a GRPO/RLVR pass@k jump as real, decontaminate the reward/eval set against the base model’s own pretraining corpus, not just your own synthetic pipeline’s outputs.

Contested — does contamination matter at frontier scale at all? Bordt et al. arXiv:2410.03249 found moderate repeated contamination is effectively “forgotten” via weight decay once pretraining exceeds ~5× Chinchilla-optimal tokens. This describes large, diluted, public benchmarks — it does not license skipping decontamination on a small, high-value held-out set (a handful of CTF flags, a curated eval trace), which is exactly the regime where memorization risk is highest, not lowest.


6. Curriculum / difficulty-ordering

Curriculum learning’s classic root — Bengio et al., ICML 2009 (no arXiv id) — orders/weights training examples by a computable “easiness.” Self-paced learning, Kumar/Packer/Koller, NeurIPS 2010 (no arXiv id), sharpens this: the model itself sets its own pace rather than an external teacher fixing an order in advance. Nearly every RL-curriculum paper in §4’s “RLVR dynamic sampling” subsection (DAPO arXiv:2503.14476, PCL arXiv:2510.01135, AdaRFT arXiv:2504.05520, SEC arXiv:2505.14970, VCRL) is this same self-paced-learning idea, re-derived: the pass-rate/reward-variance signal is the model’s own, computed online, exactly because a static curriculum staled the moment the policy moved past it.

For offline SFT curricula specifically (as opposed to online RL batch composition), order training rows by IFD (§1) or by difficulty-as-judged, low-to-high, on the theory that early-training gradient steps on rows the model already half-knows are more stable than starting on the hardest rows cold. This is weaker evidence than the RL-side finding and is genuinely contested for generative tasks specifically:

Contested — difficulty vs. coverage, for generative fine-tuning. Dataset Cartography’s original framing arXiv:2009.10795 (§8) treats “ambiguous/hard-and-persistently-wrong” as the interesting region for classification-era tasks. A 2025–2026 workshop paper (OpenReview g1DiK2Yi4j) argues that for generative SFT/agent-trajectory tasks specifically, difficulty-based selection narrows output-distribution coverage and underperforms random selection — not yet reconciled with cartography’s classification-era prescription. If your curated set is agentic-trajectory-shaped (it is), don’t import a pure difficulty-ordering rule from classification-era curriculum literature without checking it against a coverage metric (§8) first.

Net practical rule: online RL batch composition → intermediate difficulty, recomputed continuously (§4). Offline SFT-row ordering → don’t lean on difficulty alone; check coverage isn’t collapsing (§2, §8) at the same time.


7. Synthetic-data generation mechanics

Selection (§1–2) and negative-mining (§3) work on data you already have. This section is how you produce rows to fill a gap those methods can’t fill by re-weighting alone — the mechanics behind the corpus you’d curate, not a replacement for curation.

The lineage, in order:

  • Self-Instruct arXiv:2212.10560 — bootstrap instruction/I-O triples from ~175 seeds via in-context generation, ROUGE-L<0.7 dedup as the core diversity control.
  • Evol-Instruct / WizardLM arXiv:2304.12244 — LLM-driven in-depth/in-breadth rewrite operators escalate instruction complexity beyond what’s cheap to hand-author.
  • InsTag arXiv:2308.07074 — the tagging machinery from §2, reused here to condition generation toward under-tagged regions, not just to measure a finished pool.
  • Instruction Backtranslation arXiv:2308.06259 — predict the instruction a piece of real web/document text answers (text→instruction direction, not the reverse), then self-curate. Grounds every synthesized row in genuine text — the same “grounded in reality, not imagined” principle §1’s LIMA and this whole chapter’s K-gap concerns rest on.
  • WRAP arXiv:2401.16380 — rephrase noisy source docs into a small, fixed set of styles (3–5: Wikipedia-like, Q&A, ELI5), not open-ended paraphrase volume. A small fixed style-set, empirically, beats unbounded paraphrase generation.
  • Persona Hub arXiv:2406.20094 — 1B mined personas; injecting a persona into a generation prompt biases sampling toward that persona’s knowledge slice, explicitly demonstrated for synthesizing tools/functions at scale in the source paper.
  • Magpie arXiv:2406.08464 — truncate the chat template right before the user turn, let the aligned model autoregress its own query. Cheapest possible query generator, zero seeds needed — but it faithfully reproduces whatever skew already exists in the policy, so it diagnoses prior skew (it’s a good coverage-audit probe, §8) but cannot fix it by construction.

The R-gap fix, concretely: force coverage of amass without fabricating a tool result

  1. Do not self-sample (Magpie-style) for this — by definition it reproduces the existing nmap-first skew.
  2. Build/reuse a tool taxonomy independent of your current data (InsTag-style tagging over your tool documentation, not over what’s already in your run logs — critical, see §8).
  3. Condition synthesis on personas/scenarios that structurally require the underused tool (Persona Hub): “a security researcher who always starts with passive OSINT before touching a single host” → generates a scenario where the winning first move is amass, not nmap.
  4. This synthesizes the scenario/query, not the tool result. Cross-reference kinds-of-sft.md §4: fabricating what amass’s output looks like teaches confabulation exactly like any other ungrounded tool result. Run the synthesized scenario for real, against a real target, and keep the executed transcript.
  5. Verify with the same three-stage contract ToolACE arXiv:2409.00920 and APIGen-MT arXiv:2504.03601 both independently converge on: format-valid → executes against a real/sandboxed API → LLM-judge/committee semantic-match.
  6. Apply DEITA’s diversity-dedup (§2) on the resulting set so it doesn’t just become a second, smaller monoculture.

A very recent inversion worth knowing about, not yet broadly validated: Firefly arXiv:2605.17558 starts from real API outputs and works backward to the query — the opposite direction from ToolACE/APIGen-MT — specifically to fix synthetic-schema drift (where a model-generated tool call is plausible-looking but doesn’t match the real tool’s actual schema/output shape). Same grounding principle as Instruction Backtranslation, applied to tool calls instead of documents.


8. Coverage-gap detection — proving the hole exists

This is the closest thing in the literature to a direct methodological answer to “how do I know what’s missing” — and it’s the step that turns “I suspect we never train on amass” into a defensible, falsifiable claim.

Dataset Cartography arXiv:2009.10795 (Swayamdipta et al.) plots every training example on (confidence, variability-across-epochs) from a single training run — no held-out taxonomy needed to run it — exposing easy / ambiguous / hard-and-persistently-wrong regions. On its own this tells you about examples you have; it says nothing about examples you don’t.

The step that actually finds the hole: cross-reference the hard-and-never-improving bucket against an independent skill taxonomy — built first, from your tool documentation or --help output, via InsTag-style LLM self-tagging arXiv:2308.07074 or metacognitive labeling arXiv:2405.12205not derived from what’s already in your run logs, or you’ll define your skill taxonomy in a way that can’t see the hole it’s supposed to find.

Worked example — detecting the amass/passive-recon hole:

  1. Build the taxonomy from your tool surface, independent of usage: {nmap, amass, curl, sqlmap, http_get, ...} × {active-scan, passive-recon, exploit, exfil, ...}.
  2. Count raw mentions of each tag combination across your run-log corpus — this is the Kandpal-style mention-count check arXiv:2211.08411, which established a causal relationship between corpus mention count and answerability for facts; the same logic applies directly to tool-usage rows.
  3. amass × passive-recon appears 0 times across the corpus. That’s not “the model happens to underperform on this” — it’s a directly measurable, confirmed coverage hole, distinguishable from a merely-rare-but-present pattern.
  4. Cross-check against capacity, not just presence: Allen-Zhu & Li’s knowledge-capacity scaling laws arXiv:2404.05405 (~2 bits of knowledge per parameter, in controlled synthetic setups, degraded by junk-data dilution) tell you that even after you inject amass coverage, if it’s a vanishingly small token-fraction of a much larger/noisier mix, the effective capacity a given model size allocates to it shrinks — track domain-token-fraction, not just raw row count, once you’ve closed the zero-coverage gap.

Confirming the hole is real, not an artifact of your training pipeline (two independent per-example diagnostics):

  • Gekhman et al. arXiv:2405.05904 (Technion/Google): SFT rows containing facts/skills genuinely unknown to the base model, flagged by a pre-SFT in-context-oracle probe, are fit more slowly and, once fit, linearly increase hallucination on unrelated held-out inputs. If you push amass rows into SFT and unrelated tool-choice accuracy gets worse, that’s this mechanism confirming the pre-injection gap was real and structural, not incidental.
  • The Incomplete Learning Phenomenon arXiv:2604.10079 (UNSW/Tencent, April 2026, single paper, not yet broadly replicated) shows even converged SFT models fail to reproduce a persistent subset of their own training data, with “missing prerequisite knowledge in the base model” as one of five named, empirically-distinguishable causes (alongside SFT-data inconsistency, sequential-finetuning forgetting, and under-optimized rare patterns) — a per-example diagnostic, not just an aggregate score, for confirming why a specific amass row didn’t stick even after training on it.

Closing the loop end-to-end: STAT arXiv:2510.10023 (Princeton) operationalizes exactly this cycle — tag training data by skill, train, probe the trained model per-skill-tag to build a Missing-Skill-Profile from its own post-training failures, then reweight or synthesize specifically for the failing tags. Reported as complementary to GRPO/RL, not a substitute for it — run STAT’s probe after a training round, not instead of one.


9. Apply these in what order

None of §1–8 is a default pipeline you run start to finish every time — pick the subset the diagnosis calls for. But when you are building a curated/mined set, apply them in this order:

  1. Coverage-gap detection first (§8). Before selecting or mining anything, confirm what’s actually missing (tag corpus against an independent taxonomy, check mention counts). Selection and negative-mining can only re-weight what already exists — running them on a pool with a zero-coverage hole just curates around the hole more efficiently.
  2. If the gap is confirmed missing (not just rare): synthesize (§7), grounded — condition on personas/taxonomy gaps for scenario diversity, execute for real, verify with the three-stage contract. Do not self-sample (Magpie-style) to fill a confirmed hole; it reproduces the hole by construction.
  3. Verifier-filter, always, before anything else touches the pool — this alone removes the majority of harmful noise (per kinds-of-sft §6).
  4. Scale-gate your selection method (§1). Target set ≤~50–100K rows (the realistic regime for a targeted gap-patch): run the full quality→difficulty→diversity→targeted-gradient stack (AlpaGasus → IFD → DEITA → LESS/BIDS). Target set 100K+ rows: skip straight to representation-similarity (RDS+-style) or well-stratified random, and validate anything fancier against a compute-matched random baseline before trusting an uplift.
  5. Apply the diversity constraint (§2) as a hard filter, not an afterthought, regardless of which selection method above you used — this is what prevents re-collapsing onto the existing skew.
  6. If the diagnosed gap is a ranking problem (R/P-gap), mine hard negatives (§3) from the selected, verified pool — on-policy, decision-point-anchored, gated by the K-vs-P diagnostic, checked for likelihood displacement before training.
  7. If acquiring genuinely new examples under a fixed budget, go hard (§4’s acquisition rule). If composing an already-large pool into RL batches, stay intermediate-difficulty, recomputed online, not cached.
  8. Decontaminate against your eval set before training, every time (§5) — n-gram baseline always, embedding+judge if any synthesis/rephrase step touched source material, base-model-pretraining-corpus check if the downstream training is RL, not just SFT.
flowchart TD
  Start["Diagnosed gap<br/>(K / R / P — see decision.md)"] --> Cov["§8 Coverage-gap detection:<br/>is it actually MISSING,<br/>or just under-weighted?"]
  Cov -->|"Missing (0 mentions)"| Syn["§7 Synthesize, grounded —<br/>persona/taxonomy-conditioned<br/>scenario + REAL execution"]
  Cov -->|"Present but rare/skewed"| Sel["§1-2 Selection + diversity constraint<br/>on the existing pool"]
  Syn --> Ver["Verifier-filter (mandatory)"]
  Sel --> Ver
  Ver --> Gate{"Gap type?"}
  Gate -->|"K — inject off-policy"| Done1["SFT on the synthesized/selected set"]
  Gate -->|"R/P — mis-ranked"| Neg["§3 Hard-negative mining,<br/>on-policy, decision-point-anchored"]
  Neg --> LD["Likelihood-displacement check<br/>before training (CHES + chosen log-prob)"]
  LD --> Done2["DPO/KTO on the mined pairs"]
  Done1 --> Decon["§5 Decontaminate against eval —<br/>always, before trusting any resulting number"]
  Done2 --> Decon

  classDef your fill:#132b22,stroke:#34d399,color:#eafaf3;
  class Cov,Neg,LD your;

  • The kinds of SFT §6 — the SFT-row-level version of §1’s selection stack (LIMA/AlpaGasus/IFD/LESS/DEITA), plus the forgetting/replay side this chapter doesn’t repeat.
  • Method → Data — which training method (SFT/DPO/KTO/GRPO) consumes which data object; this chapter is the mechanics behind producing/filtering that object, not the method-selection question itself.
  • Post-training dataset registry — concrete, proven-by-usage downloadable datasets if you need a general-capability ingredient (tool-calling format anchors, preference mixes) rather than building your own from run logs.
  • Diagnosing the gap — the instrumentation (pass@k, Pass@(k,T), Cover@τ, elicitation ladder) that tells you which gap you’re curating for before you pick a method from this chapter.
  • The decision — the K/R/P routing tree this chapter’s methods feed into.
  • Knowledge-gap curation — the confirmed-K-gap corpus recipe end to end (deferred from §7/§8 here).
  • Intervention per gap — which fix routes to which gap type, in full.
  • Preference — RLHF · DPO · KTO — the loss mechanics §3’s mined pairs feed into.

Bibliography

id / sourcePaperRole in this chapterConfidence
ICML 2009, no arXiv idBengio et al., Curriculum LearningGenealogy root, §0/§6Classic, uncontested
NeurIPS 2010, no arXiv idKumar, Packer & Koller, Self-Paced LearningGenealogy root — model sets its own pace, §0/§6Classic, uncontested
UW-Madison TR1648 (2009), no arXiv idSettles, Active Learning Literature SurveyGenealogy root, §0/§4Classic, uncontested
COLT 1992, no arXiv idSeung, Opper & Sompolinsky, Query-by-CommitteeGenealogy root, §0/§4Classic, uncontested
SIGIR 1994, no arXiv idLewis & Gale, uncertainty/margin samplingGenealogy root, §0/§4Classic, uncontested
2007.00808ANCE (Xiong et al.)Hard-negative mining founding result, §0/§3High
aclanthology 2021.naacl-main.86Zhang & Stratos, Understanding Hard Negatives in NCEFormal NCE-bias grounding for hard-negative mining, §0/§3High
1708.00489Core-set active learning (Sener & Savarese)Deep-learning-era active-learning root, §4High
1703.02910BALD (Gal et al.)Deep-learning-era active-learning root, §4High
2009.10795Dataset Cartography (Swayamdipta et al.)Coverage-gap detection core method, §6/§8High
2211.08411Kandpal et al., Long-Tail KnowledgeMention-count = confirmed coverage hole, §8High
2212.10560Self-InstructSynthesis lineage, §7High
2302.09664Semantic Uncertainty (Kuhn, Gal & Farquhar)K-vs-R distinguishing instrument, §4High
2304.12244WizardLM / Evol-InstructSynthesis lineage, complexity escalation, §7High
2305.11206LIMAQuality > volume, Superficial Alignment Hypothesis, §1High
2305.18290DPOPreference-pair objective, §3High
2307.08701AlpaGasusCorrectness-floor filtering, §1High
2308.06259Instruction BacktranslationGrounded synthesis direction, §7High
2308.07074InsTagDiversity/complexity tagging, §2/§7/§8High
2308.12032IFD / Cherry selectionModel-relative informativeness selection, §1High
2309.06657RSORejection-sampling toward optimal policy before pairing, §3High
2311.00288Active Instruction TuningParaphrase-disagreement QBC, §4High
2311.04850LLM DecontaminatorN-gram bypassed by paraphrase, §5High
2312.15685DEITAQuality/complexity/diversity axes, §1/§2High
2401.16380WRAPFixed-style rephrasing, §7High
2402.00530SuperfilteringCheap proxy-model IFD, §1High
2402.04333LESSCapability-targeted gradient selection, §1High
2404.05405Knowledge capacity scaling laws (Allen-Zhu & Li)Capacity budget for a domain slice, §8High
2405.05904Gekhman et al.SFT on unknown facts amplifies hallucinationHigh
2405.12205Metacognitive Capabilities of LLMsAlternate taxonomy-tagging method, §8High
2406.08464MagpieSelf-sampling reproduces skew, doesn’t fix it, §7High
2406.09279Unpacking DPO and PPO (Ivison et al.)Data quality dominates algorithm choice, §3High
2406.20094Persona HubConditioned generation for tool coverage, §7High
2409.00920ToolACEThree-stage tool-verification contract, §7High
2410.03249Bordt et al., How Much Can We Forget about Contamination?Contested — large-scale forgetting of contamination, §5High, but scope-limited (large diluted benchmarks only)
2410.08847Likelihood Displacement (Razin et al.)Ceiling on pair minimality, §3High
2410.09335Random Selection Is Almost All You Need (Qwen)Production-scale selection correction, §1High
2411.07133Stronger Models are NOT Stronger TeachersTeacher-choice complication, §1High
2501.12147BIDSBalances LESS across multiple capabilities, §1High
2503.01807Large-Scale Data Selection (Ivison et al., AI2)Selection collapses to/below random at scale, §1High, promising/not broadly re-validated outside AI2
2503.14476DAPODynamic sampling, drop zero-variance groups, §4/§6High
2504.03601APIGen-MTIndependent convergence on 3-stage tool verification, §7High
2504.05520AdaRFTAdaptive curriculum for RL fine-tuning, §4/§6High
2505.14970Self-Evolving Curriculum (SEC)Online curriculum, §4/§6High
2508.14094Hard Examples Are All You NeedContested — acquisition-budget hard-example rule, §4High
2510.01135Prompt Curriculum LearningIntermediate-difficulty rule, online recompute, §4/§6High
2510.10023STAT (He, Panigrahi, Lin, Arora)Closed-loop skill-tag → probe → reweight, §8High
2601.06103Impact of Post-training on Data ContaminationRL generalizes contamination beyond SFT, §5Single paper, not yet replicated — flagged
2602.03412Verified Critical Step Optimization (Tencent)K-vs-P diagnostic gate for mined pairs, §3Single paper, very recent — flagged
2604.10079Incomplete Learning PhenomenonPer-example diagnostic for why a row didn’t stick, §8Single paper, not yet broadly replicated — flagged
2605.17558FireflyReal-output-backward tool synthesis, §7Very recent, promising not broadly validated
OpenReview tz9mJmgrdMIs On-Policy Data Always Best for DPO?Contested — on-policy negatives not universally better, §3ICLR 2026 poster, mechanism uncharacterized
OpenReview g1DiK2Yi4jRethinking Data Selection: Coverage over DifficultyContested — difficulty selection hurts generative FT, §6Workshop submission, not yet reconciled with cartography
OpenReview FBhWTuMTYAVCRLVariance-based online curriculum, §4/§6ICLR 2026 submission

Confidence calibration: every arXiv id above is verified live per the source ledger (artifacts/three-gap-survey/ledger-F.md, pass 2026-07-02), not recalled from training memory. High confidence on the genealogy claim (curriculum/active-learning/hard-negative-mining as the three roots) and on the core mechanics of each named method — these are widely-cited, independently-corroborated findings. Explicitly flagged single-paper or very-recent results (Verified Critical Step Optimization, the RL-contamination-generalization study, the Incomplete Learning Phenomenon, Firefly) are marked “promising, not yet validated” throughout and should not be treated as settled. Three genuine contested edges are called out inline rather than resolved: selection-vs-random at production scale, on-policy-vs-static negatives for DPO, and hard-vs-intermediate difficulty for acquisition-vs-batch-composition — the field has not published a reconciliation for any of the three, and this chapter deliberately does not manufacture one.

The one axis that predicts everything

You’re leaving the Problem section behind — the diagnostic chapters told you the agent solves a minority of your challenge set and left the “why.” Learnings starts the general theory from scratch, unattached to your specific case, beginning with the one axis every method in this book is built on.

If you internalize one thing, make it this: on-policy vs off-policy. It predicts which methods can fix which failures, and it’s the reason a colleague’s SFT run can move the eval by two points and stall.

Definitions (precise)

  • Off-policy: training targets are sampled from a distribution other than the model’s current policy π_θ — a human, a teacher model, a frozen dataset. The model raises the likelihood of sequences it did not generate.
  • On-policy: the training data is sampled from π_θ itself (the current weights), then scored/labeled. The model learns from its own rollouts.

This is standard RL vocabulary, not a framing I invented — see any policy-gradient treatment; the LLM-specific consequences are laid out formally in the imitation-learning reduction below.

Why off-policy imitation is structurally blind to execution gaps

The mechanism, as a flow:

graph LR
  A["Train on the teacher's states"] --> B["Deploy: π_θ drives,<br/>visits π_θ's OWN states"]
  B --> C["One slip → a state the<br/>teacher never visited"]
  C --> D["No training signal there<br/>→ error compounds"]
  D --> B

This isn’t hand-waving — it’s a theorem. Ross, Gordon & Bagnell, “A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning” (AISTATS 2011, arXiv:1011.0686), Thm 2.1: a behavior-cloned policy with per-step error ε incurs total cost bounded by J(π̂) ≤ J(π*) + ε·T²quadratic in horizon T, because a single deviation moves you to states off the expert’s distribution where you have no supervision, and errors accrue at up to unit cost for the rest of the episode. Their DAgger correction — aggregate data from the learner’s own induced state distribution — restores near-linear O(ε·T) regret.

Translate to your setting: an execution failure happens, by definition, in a state π_θ reaches on its own. Off-policy data is — structurally — data about states π_θ doesn’t reach. So off-policy SFT optimizes correctness in the wrong region. On a long agentic CTF trajectory (large T), the vs T gap is the whole story.

The fix, stated once

Make the data on-policy: sample from π_θ, then score those samples. Every method that “fixes execution” — rejection-sampling FT, GRPO/RLVR, on-policy distillation — is a different way of doing exactly that. The on-policy distillation line makes the connection explicit: it exists specifically to kill the train/inference mismatch of fixed-dataset KD by sampling from the student during training (GKD, Agarwal et al., arXiv:2306.13649).

The corollary you’ll use constantly

  • Failure lives in π_θ’s own distribution (it solves sometimes, fails often) → on-policy method.
  • The correct behavior is absent from π_θ entirely (never appears at high N) → nothing on-policy to reinforce → you must inject off-policy (SFT / teacher data / a tool).
  • The behavior exists but is mis-ranked → preference method.

That routing is the spine of The decision.

What this axis is not

This is one axis, not a set of independently-toggleable knobs. Crossing on/off-policy against the imitation/preference/reward paradigm split does not yield a free combinatorial grid of methods — signal and policy-source largely determine each other, so each named method (SFT, rejection-sampling FT, DPO, GRPO/RLVR, on-policy distillation) is a fixed preset on this axis, not a pick-two-knobs product. An earlier pass at this material packaged it as an interactive matrix implying free combination, which produced nonsense for some products — that framing is retired; see Contested edges §6 for the correction and Methods overview for the preset list.

A caution on evidence quality while you’re building intuition here: a low-citation 2025 preprint (arXiv:2507.10616, “Scalpel vs. Hammer”) frames the amplify/replace split in exactly this vocabulary (“GRPO amplifies, SFT replaces”) but is a single, contested, 0-citation source — its own authors call it “preliminary.” Don’t anchor on it. The load-bearing evidence for “on-policy reinforces what already fires, off-policy is required to inject what doesn’t” is this chapter’s own DAgger argument above, plus “SFT Memorizes, RL Generalizes” (Chu, Zhai et al., arXiv:2501.17161, ICML 2025, 694 citations) and the elicit-not-expand result (Yue et al., arXiv:2504.13837, NeurIPS 2025 Best Paper Runner-Up) — both verified live, both far better cited than 2507.10616. See Contested edges §1 for the full, honest state of that debate (it’s genuinely contested at the margins — prolonged, KL-controlled RL can expand the boundary; standard-recipe RL elicits).

Where this axis goes next

This single axis is the foundation the rest of the book’s structure is built on:

What “data” actually means for an agent

You asked the right question earlier: “demonstration = the answer — are you talking about trajectories?” Yes. Being concrete about the data object dissolves most of the confusion, because each method eats a different-shaped object, and for an agent those shapes are not what the chatbot literature implies.

This chapter stays deliberately narrow: it’s about the shape of the training object, not about which method to pick. That routing question belongs to The one axis that predicts everything — on-policy vs off-policy is the real axis, and each method below is a fixed preset on it, not one of several independent knobs you mix and match freely (see Contested edges on why a “combinatorial grid” framing over-reaches).

A “demonstration” is a trajectory, not an answer

  • Chatbot SFT example = (prompt → ideal response text).

  • Agent SFT example = the whole trajectory:

    system prompt
    → [assistant: reasoning] → [tool_call: shell "nmap …"] → [tool_result: <output>]
    → [assistant: reasoning] → [tool_call: http_request …] → [tool_result: <output>]
    → …
    → [assistant: submit_flag("FLAG{…}")]
    

The training target is the path, not the flag. That is what SFT and rejection-sampling FT imitate token-by-token.

Loss-masking: don’t train the model to predict the world

Tool outputs / observations are part of the sequence but are not the policy’s own tokens — they come from the environment. Standard practice is to mask the loss on prompt and observation spans and only compute loss on the model-generated reasoning + tool_call + submit tokens. Otherwise you teach the model to hallucinate stdout. (This is the same principle as instruction-tuning masking the prompt; for agent traces it’s applied to every observation span.) The project’s own trajectory-synthesis note treats observation-masking as a first-class filter step — see lessons/post-training/verified-trajectory-synthesis-recipe.md in the shared memory pool. (Caveat: that recipe’s specific numbers derive from an unverified third-party report — trust the procedure, not the figures.)

The data shapes, per method preset (forward reference)

These rows are not independent toggles you compose freely — each is a named method with a fixed data object, and which preset applies is determined by where the failure sits on the on/off-policy axis (Foundations, The decision):

Method presetTraining object it consumesWhere it comes from
Imitation (SFT, distillation) — off-policyfull trajectories (yours, a teacher’s, or human)curate / run a teacher
Rejection-sampling FT — on-policyyour own verifier-passed trajectoriesyou already generate these
Preference (DPO/KTO)(chosen, rejected) trajectory pairs, or tagged good/badyour solved vs failed logs
RL (GRPO/RLVR) — on-policyprompts + a reward/verifier fn — no fixed datasetyour challenges + verify()

This table is the hinge of the whole book. It’s expanded in Method → Data, which is the chapter that actually addresses your stated bottleneck (“we don’t know what data we want”). The short version: you don’t choose data and then a method — you choose the method, and the method dictates the data object.

A caution worth stating before you take that table as license to freely order/mix methods: the object shape here answers “what does one round of this method eat,” not “in what order do rounds run” or “what happens when you feed a later stage’s data mixture badly.” Those are separate, larger questions this book answers elsewhere — see The recipe is a sequence, not a pick, Is the recipe a loop?, Ordering rules: interleaving stages & fixing N problems, and Data mixing, ratios & not forgetting how to think (the last one is the direct continuation of this chapter’s “trajectory as training object” framing — it’s what happens when an off-policy trajectory mixture is wrong even though the shape per row above is right). When you’re ready to rank candidate methods/recipes by how proven they are rather than how novel, that’s Proven-first ranking.

The family map

You now have the axis (on-policy vs off-policy, from the previous chapter) and the shape of the data object (a trajectory, not an answer). This chapter zooms out one level and puts every named method in this book on those two coordinates — the map every family chapter that follows hangs off of.

Two canonical axes, not a grid you build methods from: what signal you learn from (imitation / preference / reinforcement — three families) and on/off-policy (Foundations — whose rollouts the training data comes from), plus one orthogonal axis, PEFT, that is a delivery mechanism, not a learning signal. Every named method below is a fixed preset on those two axes, not a free combination of them — signal + policy-source largely determine what a method does, so “pick a family, then pick a policy-source, then invent the method” produces non-methods, not real ones. This page used to teach the two axes as “three independent knobs you toggle,” a scaffold that over-reached; see Contested edges §6 for why that framing was retired. Learn the family, then the preset within it — that’s the whole map.

graph TD
  ROOT["Post-training<br/>push mass toward good behavior"]
  ROOT --> IM["IMITATION<br/>signal = demonstrations"]
  ROOT --> PR["PREFERENCE<br/>signal = comparisons A≻B"]
  ROOT --> RL["REINFORCEMENT<br/>signal = reward / verifier"]

  IM --> SFT["SFT"]
  IM --> DIST["Distillation<br/>off-policy / on-policy"]
  IM --> RS["Rejection-sampling FT<br/>= 'RL without RL'"]

  PR --> RLHF["RLHF (RM + PPO)"]
  PR --> DPO["DPO · KTO · IPO · ORPO · SimPO"]

  RL --> PPO["PPO"]
  RL --> GRPO["GRPO → GSPO / DAPO"]
  RL --> RLVR["RLVR (verifiable reward)"]
  RL --> AG["Agentic / multi-turn RL"]

  PEFT["PEFT: LoRA · QLoRA · DoRA<br/>a HOW, applied to any of the above"]
  ROOT -.delivery.-> PEFT

Picking a family here only answers which signal. Four questions this map deliberately leaves open, each with its own chapter, once you know which preset you’re reaching for: does the recipe run once or loop back over earlier stages? In what order can stage-types safely interleave, and how do you batch N fixes into one round? How do you mix data so a later stage doesn’t erase what an earlier one taught? And — for this project specifically — which preset should you actually start with, ranked by proven adoption rather than novelty? The status table below is what’s real in 2026; those four chapters are sequence, iteration, mixing, and rank.

What’s actually load-bearing in 2026 (verified)

The status column below is from a fresh Exa pass over model tech reports + lab blogs (2025–2026), not recalled — sources cited per row throughout the method chapters.

Method2026 statusAnchor
SFTMainstream, universal — stage 0 of every recipe
Off-policy distillationMainstream — DeepSeek distills R1 → V3/V3.2 as a named stagearXiv:2412.19437, arXiv:2512.02556
On-policy distillationNiche / promising — NOT yet confirmed in any frontier lab’s production recipeGKD arXiv:2306.13649; Thinking Machines blog 2025-10-27
Rejection-sampling FTMainstream — named stage in Llama 3 & DeepSeek-R1arXiv:2407.21783, arXiv:2501.12948
RLHF (RM+PPO)Mainstream at proprietary labs (Gemini 2.5, GPT-5)arXiv:2507.06261
DPOMainstream — Llama 3’s offline preference stage, Tülu 3’s post-bake-off pickarXiv:2407.21783
KTONiche overall, but a genuine T2 conditional fit for unpaired pass/fail logs — official TRL trainer, ablated (not chosen primary) in Tülu 3arXiv:2402.01306
IPO/ORPO/SimPONiche — real OSS traction, but Tülu 3 explicitly bake-off’d SimPO against DPO-norm and kept DPO-norm; no flagship names any of the three as primaryarXiv:2503.11701
GRPOMainstream — the reasoning-RL defaultarXiv:2402.03300
RLVRMainstream — arguably the defining 2025-26 techniquearXiv:2501.12948, arXiv:2507.06261
GSPO (Qwen3)Mainstream — first GRPO-successor with a flagship behind itarXiv:2507.18071
DAPOOSS-tooling mainstream; ByteDance-origin, not confirmed elsewherearXiv:2503.14476
PRM (process reward)Niche — explicitly rejected for R1 (step-level reward hacking)arXiv:2501.12948
Rubric/critic outcome rewardMainstream & growing — the real replacement for PRMarXiv:2507.06261
Agentic / multi-turn RLMainstream & the frontier edge — see its own chapterDeep Research; Kimi K2/K2.5
LoRA/QLoRA/DoRAMainstream in the applied layer; labs post-train flagships full-parameterarXiv:2106.09685
Self-playExperimental — no confirmed frontier-lab production use as of this pass

Read the family chapters for the mechanism + “what data it eats” + when to reach for each.


Cross-links: this page answers which family; The recipe is a sequence, not a pick answers in what order the families compose into an actual pipeline; Is the recipe a loop? and Ordering rules: interleaving stages & batching cover whether and how you revisit a family once you’ve left it; Data mixing, ratios & not forgetting how to think covers what happens to an earlier stage’s behavior when a later one trains on foreign data; The one axis that predicts everything is the on/off-policy half of this page’s two-axis claim, spelled out in full; and Start here: a proven-first ranking turns this family-level status table into one ranked starting sequence for this project specifically.

Imitation — SFT · distillation · rejection sampling

Signal = demonstrations. Objective = cross-entropy on target tokens. Imitation is one of three fixed paradigm presets on the canonical on/off-policy axis (the other two are preference and reinforcement) — see Foundations for the axis itself and Contested edges §6 for why “three independent knobs you toggle” is a retired teaching scaffold: the axes aren’t independent, so what differs across SFT / distillation / rejection-sampling is whose trajectories you imitate, not a free combination. This chapter is also Sequence B’s stage 0 (cold-start) and stage 3 (execution-gap bridge) in the recipe is a sequence, and the two T1 proven-first picks in proven-first ranking — read those for where in the pipeline and why start here, this chapter is the what/mechanism.

Per-method template: what · data it eats · on/off-policy · when · gotcha · cite.

SFT (Supervised Fine-Tuning)

  • What: MLE on (prompt → target); for agents, target = a full trajectory (What “data” means). The original instruction-tuning result is InstructGPT (arXiv:2203.02155).
  • Eats: curated/human/teacher demonstrations.
  • Policy: off-policy (targets aren’t π_θ’s samples).
  • When: inject a capability or format the model lacks; establish a cold-start before RL. Stage 0 of the ordered skeleton — never the whole recipe (the recipe is a sequence §3, stage ordering).
  • Gotcha: off-policy ⇒ blind to execution gaps (the εT² compounding, Foundations) and it tends to memorize rather than generalize — the load-bearing evidence is Chu, Zhai et al., “SFT Memorizes, RL Generalizes,” arXiv:2501.17161 (ICML 2025, 694 citations): outcome-reward RL transfers to unseen rule/visual variants where SFT overfits the training distribution, plus the elicit-not-expand genealogy in Contested edges §1. A smaller, 0-citation preprint (“Scalpel vs. Hammer,” arXiv:2507.10616) frames the same split at the weight level as “GRPO amplifies, SFT replaces” — its own authors call this only a “preliminary indication” and their follow-up ablation “inconclusive,” so treat it as a rhyming, supporting citation, not the basis for the claim (see Contested edges §6 and the fuller writeup in RL long-horizon/exploration §4). Also worse on small models (less capacity to absorb without forgetting) — see data mixing & forgetting for the LoRA-format-collapse case study. And don’t over-invest here before RL: Llama 4’s recipe deliberately keeps SFT lightweight because heavy SFT/DPO restricts downstream RL exploration (Contested edges §4).

Distillation (a kind of SFT — the teacher supplies the demonstrations)

Knowledge distillation originates with Hinton et al., arXiv:1503.02531. Two variants, and the split is the on/off-policy axis:

  • Off-policy distillation = SFT on the teacher’s completions. Mainstream: DeepSeek transfers R1’s reasoning into V3/V3.2 as a named post-training stage (DeepSeek-V3, arXiv:2412.19437; V3.2, arXiv:2512.02556); “distilled from GPT-4/R1” datasets are how most small OSS models get capability.
  • On-policy distillation = student samples its own rollouts, teacher grades them densely (reverse-KL per token). Fixes the fixed-dataset train/inference mismatch (GKD, arXiv:2306.13649: +90% relative on GSM8K vs supervised-KD). Thinking Machines’ 2025 write-up reports Qwen3-8B ← Qwen3-32B reaching ~70% AIME’24 in 150–200 steps at ~9–30× less compute than RL-from-scratch (thinkingmachines.ai, 2025-10-27).
    • Honest status: niche / promising, not lab-confirmed. As of a 2026 pass, no frontier lab (OpenAI/Anthropic/Google/DeepSeek/Qwen) has stated on-policy distillation as its production recipe — evidence is GKD + one lab blog. Treat the efficiency numbers as directional, not settled. (This corrects an earlier over-strong “sleeper” framing.)
  • Eats: teacher completions (off) / teacher-graded student rollouts (on). Requires a teacher genuinely better at your task.

Rejection-sampling FT (“RL without RL”)

Terminology landmine: “RFT” is overloaded. This chapter’s rejection-sampling FT (STaR/RAFT/ReST family, cheap, positives-only SFT) is a different thing from Reinforcement Fine-Tuning (the OpenAI/Fireworks product term for actual online RL/GRPO against a grader, expensive). Say “rejection-sampling SFT” to avoid accidentally speccing a GRPO run — see Contested edges §2.

  • What: sample N completions from π_θ, keep verifier-accepted winners, SFT on them; iterate. The lineage: STaR (arXiv:2203.14465), ReST (arXiv:2308.08998), RAFT (arXiv:2304.06767), RFT (arXiv:2308.01825).
  • Eats: your own verifier-passed trajectories — which for a CTF harness with a flag check you already generate. Reward must be ground-truth-verified against real tool/server output, never format-matched, or SFT on the resulting set trains confabulated flags (Contested edges §5).
  • Policy: on-policy data, SFT update. It’s the first-order special case of policy gradient (reward∈{0,1}, upweight winners).
  • When: an execution gap, and you have a verifier but no stronger teacher. Cheapest on-policy move; reuses your SFT pipeline. “Iterate” here is the micro version of the pipeline-level loop question — see is the recipe a loop? for whether you restart from base or continue from checkpoint each round.
  • Gotcha (measurable graduation trigger): positives-only ⇒ policy-entropy collapse — fast early gains then plateau. GRPO’s real edge over it is not group-normalization (ablated → negligible) but discarding all-same-reward groups (implicit filtering). See “A Minimalist Approach to LLM Reasoning: From Rejection Sampling to Reinforce” (arXiv:2504.11343). Watch entropy; when it collapses, graduate to GRPO/RLVR.
  • Production proof: explicit named stage in Llama 3 (arXiv:2407.21783) and DeepSeek-R1 (~800K rejection-sampled examples between its two RL stages, arXiv:2501.12948). Both are also the T1 proven-first picks ranked in proven-first ranking §4.

The kinds of SFT — it is the data, not the algorithm

Imitation named the family and its three methods — SFT, distillation, rejection sampling — as fixed presets on the on/off-policy axis. What it left open is the question that actually decides whether an SFT run helps or quietly teaches confabulation: not which algorithm (there’s only one, cross-entropy on target tokens), but which of several very different-shaped sources you point that algorithm at. This chapter names that hidden axis.

You’ve correctly sensed something the field doesn’t name clearly enough: SFT is one algorithm. Cross-entropy loss on (input → target tokens). That’s it — there’s no “SFT-v2” or “agentic SFT algorithm” that’s mathematically different from “instruction-tuning SFT.” What actually varies, and what actually determines whether your model gets better or gets confidently wrong, is a question the loss function itself is silent about: where did the target sequence come from?

This chapter names that hidden dimension precisely — on two orthogonal axes plus a third gate — maps your intuited “types of SFT” onto it (you’re missing two), and then answers the practical follow-on: given raw challenges + run logs, which shape of training row do you actually build, in what format, and how do you keep a ~27B dense model’s existing capability intact while you do it.

Framing: general research reference, common practice across the field — not pinned to any one project’s benchmark or numbers. Status: every arXiv id below was verified live (title, authors, abstract pulled from arxiv.org/OpenReview, not recalled from training memory); confidence is stated per section, and the taxonomy packaging itself (the 3-axis table) is a synthesis for legibility, not a quoted framework from any single paper — flagged where that matters.


1. “Cold-start SFT” names WHEN, not WHAT

If you’ve read Imitation or the recipe is a sequence, you’ve seen SFT called “the cold-start stage” — the thing that runs before RL, stage 0 of the pipeline. That’s a true statement about timing. It tells you nothing about what’s inside the training file.

This is exactly the gap you noticed. “Cold-start SFT,” “instruction-tuning SFT,” “agentic SFT,” “distillation SFT,” “rejection-sampling SFT” all compile to the identical loss:

loss = -log P(target_tokens | input_tokens)     # cross-entropy, every single time

The word before “SFT” in each of those phrases isn’t describing a different algorithm — it’s silently describing a different data-generating process that produced target_tokens. Two SFT runs with identical hyperparameters, identical base model, identical loss curve on paper can produce a model that generalizes cleanly or a model that’s confidently making things up, purely because of where the targets came from. That’s the variable this chapter names.


2. The two axes (plus a verifier gate)

Axis A — WHO produced the trajectory

WhoConcretely
Human demosA person did the task, or hand-wrote the “correct” trace.
Stronger teacherA more capable model generated it — this is distillation.
The model itself, on-policyYour own model sampled it, and you kept the good ones.
A different model, off-policySome third model — not teacher, not student — generated it (a static scraped dataset, or stale-checkpoint replay logs).

Axis B — EXECUTED, or SYNTHETICALLY AUTHORED

This is the axis nearly everyone skips, and it matters more than Axis A for agentic data specifically.

  • Executed / grounded — the trajectory came from an actual run against the real environment: real tool calls, real stdout/stderr, real pass/fail. The text you train on is literally what happened.
  • Synthetically authored / ungrounded — an LLM (or a human) wrote what a solve “would look like” without ever running it. Tool outputs, error text, intermediate observations — all invented, and only resembling the real thing.

Why this beats Axis A in importance for your case: a synthetically-authored trajectory teaches “this is the shape a plausible tool output takes” — not “this is what actually comes back when I run this exact command.” Train on enough of that and the model learns to confabulate tool results instead of reacting to real ones. That risk is additive on top of, and independent from, who wrote it — a stronger-teacher-authored-but-never-run trajectory carries it exactly as much as a human-authored one.

Axis C — VERIFIER-FILTERED, or not

Orthogonal to both axes above: was there a check (unit test, flag match, exact-match grader, human review) that discarded failed attempts before they hit the training set?

  • Filtered — only successes (or high-scoring attempts) survive. This is what turns “the model generated something” into “the model generated something correct, and only correct gets reinforced.”
  • Unfiltered — everything generated goes in, right or wrong. Rare on purpose: it teaches wrong patterns exactly as strongly as right ones unless something else downweights them.
graph TD
  A["A training row's target sequence"] --> B{"Who produced it?<br/>human / teacher / self / other-model"}
  A --> C{"Executed against the<br/>real environment, or authored?"}
  A --> D{"Verifier-filtered<br/>before it entered the set?"}
  B --> E["Determines style/vocabulary<br/>match to your model"]
  C --> F["Determines grounding —<br/>does it teach real tool physics<br/>or a plausible-looking shape?"]
  D --> G["Determines noise floor —<br/>does the gradient point at<br/>correct behavior only?"]

3. The taxonomy — your four intuited types, plus the two you missed

Data source patternNamed method(s)Executed?Verifier-filtered?PolicyGrounding riskWhen to use
Human writes the demo by handClassic behavioral-cloning SFT / InstructGPT-style demosN/A — human-authored, not “executed” by the modelN/A, already curatedN/A (no policy yet)Low — a competent human demo is grounded by construction, but expensive and doesn’t scale past hundreds/low-thousandsVery few, very high-quality expert traces where correctness matters more than coverage — LIMA’s whole point
Stronger teacher writes/solves it, you never run it (“synthetic authoring”)Self-Instruct (arXiv:2212.10560), Evol-Instruct/WizardLM (arXiv:2304.12244), phi “textbooks” (arXiv:2306.11644)No — ungroundedUsually no, or only a weak LLM-judge passOff-policyHighest for tool-call data; for open-ended Q&A there’s no tool output to fabricate, so it’s fine thereBroadening instruction-following / knowledge breadth. Do not use for agentic tool-call traces — §4 below
Stronger teacher runs the task for real, you distill the transcriptSequence-level KD (Kim & Rush, arXiv:1606.07947; conceptual root Hinton et al., arXiv:1503.02531); the executed-trajectory distillation FireAct/AgentTuning useYes, if the teacher actually called real toolsSometimes (keep teacher successes only)Off-policyLow-to-moderate — grounded, but the style is the teacher’s, which can mismatch a smaller student’s capacityThe default “get from 1/3 to ~50%” move: let a stronger model solve your challenges with real tool access, keep the wins
The model itself attempts, keep only the ones that workedRejection sampling: RAFT (arXiv:2304.06767), STaR (arXiv:2203.14465), ReST (arXiv:2308.08998), ReST-EM (arXiv:2312.06585)Yes — executedYes — the defining featureOn-policy (self) or off-policy (a non-teacher model generated the pool you filter)Lowest — the model learns from its own successful, verified, in-distribution behaviorThe highest-leverage move on an agentic benchmark: run your current checkpoint against the corpus at temperature, keep flag-verified wins, fine-tune on those, repeat
✱ Missed type 1 — on-policy distillationGKD, Generalized Knowledge Distillation (arXiv:2306.13649)Yes — student generates, teacher scores/labels the student’s own rolloutsEffectively yes — teacher feedback replaces a hard pass/fail filterHybrid: on-policy generation + off-policy supervision signalLow — fixes the classic KD problem: student trained on the teacher’s distribution, then falls apart at inference on its ownStrong teacher available AND you want the student to stay grounded in its own output distribution — student samples, teacher grades, student trains on that
✱ Missed type 2 — human + executed agentic demonstrations, formalizedFireAct (arXiv:2310.05915), AgentTuning (arXiv:2310.12823) — both construct trajectory datasets from real environment interaction, part human-curated, part filtered model rolloutsYes — real environmentYes — both papers filter/curate before trainingMixedLowThis is the closest published analogue to “SFT a dense model on run logs of agentic challenges” — read these two directly

Confidence: High on every arXiv id/abstract (verified live). High on the axis-based framing matching each cited paper’s actual mechanics. Medium-high on the specific “3-axis” packaging — it’s a synthesis for engineer-legibility, not a quoted taxonomy from one source. No claim above is contested in the literature: grounded-vs-synthetic for agentic data, and quality-over-volume for SFT curation, are both widely-replicated findings.

Cross-reference: Imitation already names SFT / distillation / rejection-sampling as three on/off-policy presets. This table is the same territory sliced one level finer — Axis A+C here map onto that chapter’s “who supplies the demonstrations” split; Axis B (executed vs. authored) is the addition this chapter contributes, and it’s specifically what makes agentic data different from plain instruction data.


4. The agentic crux: synthetically-authored trajectories teach confabulation

This is the highest-confidence, first-principles part of this chapter, and it’s the reason Axis B gets its own section. (Related but distinct: Contested §5 covers the reward-verification side of confabulation — a loose reward matcher firing on fabricated FLAG{…}-shaped output at RL/eval time; this section is about the training-data side — how ungrounded SFT rows teach the model to produce that fabricated shape in the first place.)

If you (or an LLM) write a transcript like:

> run_exploit(target)
[tool result] Shell obtained. flag{a1b2c3...}

without ever actually running run_exploit against a real target, the text after [tool result] is fiction that merely looks like a tool result. Train on enough of this and the model learns the shape of a successful transcript — not the conditional relationship “IF I emit this exact call, THEN this category of output comes back.” At inference time, when the real tool returns something it’s never seen worded that way, the model either ignores it or fabricates the next step to match the shape it memorized. This is a training-induced version of what people call tool-output hallucination.

This is exactly why FireAct (arXiv:2310.05915) and AgentTuning (arXiv:2310.12823) — and the whole rejection-sampling family (RAFT/STaR/ReST/ReST-EM) — insist on trajectories from real execution. It’s also why DeepSeek-R1 (arXiv:2501.12948) — verified live: its own abstract describes cold-start SFT → RL → rejection sampling on the RL checkpoint to build ~600K new SFT rows, keeping only correct completions → a second SFT/RL pass — is the closest published description of “run your own agent, keep the verified wins, that’s your next SFT set.” A run-log corpus like yours, filtered to flag-verified wins, is already sitting in the gold-standard cell of the table above: executed and verified.

Concretely, side by side — same challenge, two data sources:

// GROUNDED — real tool call, real stdout, keep it (Axis B: executed; Axis C: verified)
{"role": "tool", "tool_call_id": "call_2",
 "content": "{\"user\":\"admin\",\"email\":\"admin@corp.local\",\"notes\":\"flag{1dor_pwn3d_9f3a}\"}"}
// SYNTHETICALLY AUTHORED — an LLM imagined this JSON shape; it never ran. Looks identical. Is fiction.
{"role": "tool", "tool_call_id": "call_2",
 "content": "{\"user\":\"admin\",\"email\":\"admin@corp.local\",\"notes\":\"flag{1dor_pwn3d_9f3a}\"}"}

You cannot tell these apart by reading the row. That’s precisely the danger — the failure mode is invisible at data-authoring time and only shows up as unreliable, confabulating behavior after training, on challenges the fabricated shape didn’t happen to match.


5. What shape of training row you actually build

Two raw ingredients: challenge definitions (prompt, tools, grading/flag check) and run logs (transcripts of an attempt — yours or a stronger model’s — ending in pass/fail). From these you can derive up to four different shapes of training row. They are not interchangeable — each teaches a different capability, and picking the wrong one is why “I added more data and the score didn’t move.” (The fuller per-method — not per-shape — data-object mapping, including preference pairs and RL prompts, lives in Method → Data; this section is one level more granular: which row-shape you extract from the same raw material for SFT specifically.)

5.1 Agentic trajectory — the main event

Teaches: the actual skill being measured — multi-step tool use under uncertainty, recovering from a bad tool result, deciding when to stop and answer.

Derive it from: a run log that ended in a verified flag/success. Slice it into the literal sequence (system, user) → (assistant: think + tool_call) → (tool: tool_result) → … → (assistant: final answer). Do not re-author it — use the exact text sent to/from the model and the tool, including the exact JSON schema your inference stack uses.

Worked example — one training row (structure is standard across current open-weight tool-calling formats; the exact field names must come from your model’s chat template, never assumed):

{
  "messages": [
    {"role": "system", "content": "You are a security agent. Tools: run_command, read_file, submit_flag. Find the flag."},
    {"role": "user", "content": "Challenge: web app at 10.0.0.5:8080 has an IDOR. Find the flag."},
    {
      "role": "assistant",
      "content": "The endpoint /api/user/{id} likely doesn't check ownership. I'll try incrementing the id.",
      "tool_calls": [
        {"id": "call_1", "type": "function",
         "function": {"name": "run_command", "arguments": "{\"cmd\": \"curl http://10.0.0.5:8080/api/user/2\"}"}}
      ]
    },
    {
      "role": "tool",
      "tool_call_id": "call_1",
      "content": "{\"user\":\"admin\",\"email\":\"admin@corp.local\",\"notes\":\"flag{1dor_pwn3d_9f3a}\"}"
    },
    {
      "role": "assistant",
      "content": "Found it in the notes field.",
      "tool_calls": [
        {"id": "call_2", "type": "function",
         "function": {"name": "submit_flag", "arguments": "{\"flag\": \"flag{1dor_pwn3d_9f3a}\"}"}}
      ]
    },
    {"role": "tool", "tool_call_id": "call_2", "content": "{\"correct\": true}"}
  ]
}

Loss mask: compute cross-entropy on assistant turns only — mask system/user/tool tokens. You want the model to produce the call and the final answer, not to predict the environment’s output (that’s the environment’s job, and training on it teaches the confabulation failure mode from §4 by a second route). This is a silent, common bug — check your framework’s loss_mask / train_on_inputs=False setting explicitly.

Where this comes from: FireAct §3 (arXiv:2310.05915) and AgentTuning (arXiv:2310.12823) are doing exactly this — turning ReAct-style (thought, action, observation) transcripts into SFT rows.

5.2 Knowledge / Q&A

Teaches: static facts (“what does this CVE affect,” “what’s the flag format”). Does not teach tool use or multi-step behavior.

Derive it from: challenge writeups/solutions, not transcripts — extract the underlying fact and turn it into a direct question-answer pair (Self-Instruct-style, arXiv:2212.10560).

{"messages": [
  {"role": "user", "content": "I found an endpoint at /api/v1/debug/config on a web service. What's the security implication?"},
  {"role": "assistant", "content": "Debug/config endpoints left enabled outside dev commonly leak env vars (API keys, DB creds), internal service URLs, and stack traces. Next step: GET it directly and grep the response for 'key', 'secret', 'token', 'flag'."}
]}

When to pick this: only if error analysis shows the model doesn’t know a fact — not because it can’t act on tools. For a model already around a third on an agentic benchmark, this is rarely the real bottleneck; most failures at that stage are behavioral (bad sequencing, giving up early, not verifying before submitting). Prefer a retrievable tool/RAG lookup over baking facts into weights when the “knowledge” really is just a fact — reserve weight-training for facts that are actually reasoning patterns in disguise (e.g. “why is a debug endpoint dangerous” needs to generalize to endpoints it hasn’t seen named; a CVE number does not).

5.3 Tool-usage / function-calling pairs

Teaches: the mechanical skill of correctly calling a tool given its schema — right name, right argument types, right JSON — decoupled from multi-step planning.

Derive it from: isolated (tool_call → tool_result) slices out of run logs, or synthesize directly from your tool schemas — this is the one row-shape that’s safe to author ungrounded, because there’s no tool result being faked, only the call.

{"messages": [
  {"role": "system", "content": "Tools: run_nmap(target, ports), http_get(url), sqlmap_scan(url, param)."},
  {"role": "user", "content": "Check if the 'id' parameter on http://10.10.1.4/product?id=1 is SQL-injectable."},
  {"role": "assistant", "content": null,
   "tool_calls": [{"id": "call_1", "type": "function",
     "function": {"name": "sqlmap_scan", "arguments": "{\"url\": \"http://10.10.1.4/product?id=1\", \"param\": \"id\"}"}}]}
]}

When to pick this: run logs show the model getting the idea right but the call malformed — wrong argument names, hallucinated parameters, wrong JSON. A narrow, cheap, low-risk fix because it’s format-only.

5.4 CoT reasoning — usually inline, not a separate pipeline

Teaches: deliberation before commitment — reading an ambiguous observation and reasoning about which of several plausible next actions is right, before calling the tool.

Derive it from: the same run logs as §5.1. If a log doesn’t contain live reasoning text (just tool calls with no thinking-out-loud), you have two options: leave it as-is (output-only agentic SFT is what most of the field does), or use a stronger model to retroactively annotate a rationale for an already-executed, already-correct trajectory — STaR’s “rationalization” mode (arXiv:2203.14465): generate the reasoning after seeing the correct action. This keeps the action grounded while making the reasoning explicit.

{"role": "assistant",
 "content": "<think>Port 8080 is non-standard and often hosts admin/debug panels rather than the main app on 80 — check it first.</think>",
 "tool_calls": [{"id": "call_2", "type": "function",
   "function": {"name": "http_get", "arguments": "{\"url\": \"http://10.10.1.4:8080/\"}"}}]}

Don’t over-engineer a fourth pipeline for this — in a well-formed §5.1 row, the reasoning is already inline in the content field preceding tool_calls.

5.5 Pick by diagnosed gap

You observe in your run logs…BottleneckPick
Right idea, malformed/wrong-args tool call JSONMechanical tool-call formatting§5.3, small dose
Calls tools fine, but gives up / loops / doesn’t recover from a bad resultMulti-step agentic behavior§5.1, the bulk of your budget
Doesn’t even know the vulnerability class or technique appliesMissing domain knowledge§5.2, small targeted dose — verify this is really the gap first
Reasons about the right concept but picks the wrong action among several plausible onesMissing deliberation at the decision point§5.4, layered onto §5.1

In practice, for moving an agentic benchmark score meaningfully, the overwhelming majority of your budget should be §5.1 — full, executed, verifier-filtered trajectories. That’s what FireAct and AgentTuning both do, and it’s the shape the entire rejection-sampling literature is built around: your own model’s verified wins are simultaneously on-policy, executed, and filtered — the single highest-signal, lowest-risk data you can generate, and it’s a byproduct of running the benchmark at all.


6. Data selection — “only accept what it needs”

A dense ~27B model already has broad capability. A naive “dump every transcript in” full fine-tune risks overwriting general capability to fit a narrow domain — every gradient step nudges every weight, not just the “agentic” ones, and a 27B model has far less spare parameter capacity to absorb noise without collateral damage than a much larger dense or MoE model. This section is the short version; Data mixing, ratios & not forgetting how to think is the long version (replay ratios, LoRA-vs-full-FT forgetting mechanics, reasoning-trace collapse).

Evidence base (verified):

  • LIMA (arXiv:2305.11206) — 1,000 carefully curated human-quality pairs matched/beat models trained on orders of magnitude more data. Their own ablation: doubling the set size did not improve quality; quality-filtering the same size did. “Superficial Alignment Hypothesis”: most capability comes from pretraining; SFT mainly teaches which subdistribution of its own behavior to surface.
  • AlpaGasus (arXiv:2307.08701) — LLM-judge-filtering Alpaca’s 52K examples down to ~9K high-quality ones produced a better model, 5.7× faster to train. Bad examples actively hurt, not just waste compute.
  • IFD / Cherry selection (arXiv:2308.12032) — a cheap, no-external-judge score (the model’s own loss on the response given the instruction, vs. without it) that ranks training value per row; kept only 10% of a dataset and beat training on the full set.
  • LESS (arXiv:2402.04333) — gradient-similarity selection of ~5% of a dataset, targeted at the specific downstream capability you want, outperformed the full dataset for that capability. The most directly relevant paper to “which subset of my logs actually moves the gap I diagnosed.”
  • DEITA (arXiv:2312.15685) — formalizes selection along complexity/quality/diversity axes; a 6K-example selected set matched/beat 10× more unfiltered data.
  • LoRA Learns Less and Forgets Less (arXiv:2405.09673) — full fine-tuning learns more of the target domain but measurably forgets more of everything else; LoRA learns less but preserves out-of-domain behavior — a real, measured trade-off. Curation is the data-side lever for the same problem LoRA solves on the optimizer side; they’re complementary, not redundant.
  • Scaling Laws for Forgetting (arXiv:2502.06042) — fine-tuning on a narrow domain measurably increases pretraining-distribution loss as training proceeds, scaling with fine-tune volume and model size; injecting as little as ~1% general/pretraining-like data into the mix meaningfully arrests it. A commonly-cited practical default in adjacent replay literature (arXiv:2605.15220) puts the standard mitigation baseline nearer 10% replay.
  • Decontamination (arXiv:2307.09288 §A.6, the Llama 2 report) — token n-gram overlap (>10 tokens shared between an eval sample and the training set) is a simple, reproducible check to confirm your SFT rows don’t secretly contain your benchmark’s own held-out challenges. This is a live, underdiagnosed risk field-wide (arXiv:2406.04244, arXiv:2404.00699).

Concrete curation moves, in order:

  1. Verifier-filter first, always — only train on flag-verified/passed runs. Removes the majority of harmful noise in one step (§2–4 above).
  2. Prefer your own on-policy verified rows over teacher/off-policy rows when both exist — smaller, more targeted weight movement (see Foundations: the one axis that predicts everything).
  3. Score what’s left with IFD, then judge-filter the survivors — cheap first pass, quality second pass.
  4. Deduplicate and cap per-archetype volume — if 40% of your logs are the same challenge pattern, training on all of them teaches a shortcut, not a skill.
  5. Prefer fewer, harder, correctly-solved trajectories over many easy ones — LIMA’s quality-over- count finding, applied.
  6. Replay ~1–10% general-instruction data alongside the agentic corpus if forgetting is a live concern.
  7. Decontaminate against your eval set before training, not after a suspiciously good score.
  8. Consider LoRA/QLoRA if “don’t overwrite what the model already knows” is a harder constraint than “maximize domain score” — arXiv:2405.09673 gives the actual trade-off curve, not an assumption.

7. Decision aid — which SFT data source for my case

graph TD
  A["Diagnosed failure mode<br/>(see diagnosis/framework.md)"] --> B{"Does the correct behavior<br/>ever appear in the model's<br/>own output, even rarely?"}

  B -->|"Never — knowledge/skill genuinely absent"| C{"Do you have a<br/>stronger teacher<br/>with real tool access?"}
  C -->|Yes| D["Teacher solves for real,<br/>you distill the EXECUTED transcript<br/>(FireAct / AgentTuning style)"]
  C -->|No| E["Human demos, small + curated<br/>(LIMA-style, few hundred rows)"]

  B -->|"Sometimes — partial-solve regime"| F{"Do you have a<br/>verifier / pass-fail check?"}
  F -->|Yes| G["Rejection-sampling SFT:<br/>sample your OWN model,<br/>keep verifier-passed wins<br/>(RAFT / STaR / ReST family)"]
  F -->|"Yes + want student to<br/>stay on its own distribution"| H["On-policy distillation (GKD):<br/>student samples, teacher grades"]

  B -->|"Mis-ranked, not absent"| I["Not an SFT problem —<br/>see preference methods<br/>(DPO/KTO)"]

  G --> J{"Is the row a<br/>full multi-step trajectory?"}
  J -->|Yes| K["Full trajectory (5.1) —<br/>the bulk of your budget"]
  D --> J

  style E fill:#fdd
  style D fill:#dfd
  style G fill:#9f9

Reading it: the green path (your own verified rollouts, or a teacher’s real-execution transcripts) is the safe default. The red path (human demos) is fine but expensive and caps out fast — reach for it only when neither a teacher nor your own model can produce the behavior at any sampling temperature. Nowhere on this tree is “synthetically author a plausible-looking trajectory” a legitimate node for tool-call data — that’s the failure mode §4 names, not a fifth branch.



Verified citation registry

arXiv idPaperRole in this chapter
2212.10560Self-Instructsynthetic-authoring instruction generation
2304.12244WizardLM / Evol-Instructsynthetic-authoring, complexity escalation
2306.11644Textbooks Are All You Need (phi-1)synthetic-authoring, “textbook quality” data
1503.02531Distilling the Knowledge in a Neural Network (Hinton et al.)conceptual root of distillation
1606.07947Sequence-Level Knowledge Distillation (Kim & Rush)sequence-level teacher distillation
2306.13649GKD — On-Policy Distillation of LMsthe missed type: on-policy distillation
2304.06767RAFTrejection-sampling SFT
2203.14465STaRrejection-sampling + rationalization SFT
2308.08998ReSTiterative rejection-sampling SFT
2312.06585ReST-EM (Beyond Human Data)iterative rejection-sampling SFT, scaling
2310.05915FireActthe missed type: formalized agentic-trajectory SFT
2310.12823AgentTuningthe missed type: formalized agentic-trajectory SFT
2501.12948DeepSeek-R1rejection-sampling-on-RL-checkpoint precedent
2305.11206LIMAquality > volume; Superficial Alignment Hypothesis
2307.08701AlpaGasusLLM-judge filtering improves outcomes
2308.12032Cherry_LLM (IFD selection)cheap self-guided data selection
2402.04333LESStargeted, capability-specific data selection
2312.15685DEITAcomplexity/quality/diversity selection axes
2405.09673LoRA Learns Less and Forgets LessPEFT vs. full-FT forgetting trade-off
2502.06042Scaling Laws for Forgetting (Béthune et al.)forgetting scaling law; replay mitigates
2605.15220Always Learning, Always Mixing~10% replay as a practical mitigation baseline
2307.09288Llama 2 report, §A.6n-gram decontamination methodology
2406.04244Benchmark Data Contamination of LLMs: A Surveycontamination is a live, field-wide risk
2404.00699LLMSanitizecontamination detection tooling
2305.15334Gorilla(context) reducing hallucinated API calls in tool-usage data
2307.16789ToolLLM(context) validated multi-tool call-chain construction

Confidence calibration: High on every id/abstract above (verified live on 2026-07-02, not recalled from training memory). High on the grounded-vs-synthetic distinction for agentic data and on quality-over-volume for curation — both widely replicated, not contested. Medium-high on the 3-axis taxonomy packaging specifically (§2–3) — it correctly describes each cited paper’s mechanics but is this chapter’s synthesis, not a quoted framework from one source; trust the primary papers’ own mechanics over the packaging if they ever appear to diverge. Explicitly not grounded on any academic cybersecurity-LLM training paper — every citation above is general frontier/ML data-construction or data-selection literature, per this chapter’s brief.

Hint-guided bootstrapping — put the walkthrough in the prompt, then train it away

The kinds-of-sft taxonomy just gave you the axes a training row is built from — who produced the trajectory, executed vs. synthetically authored, verifier-filtered or not. This chapter takes one specific point on that grid — on-policy, executed, hint-seeded — and follows it end to end: from a plausible cold-start idea, to the four-decade-old literature it belongs to, to its measured failure modes, to a concrete recipe.

You’ve independently arrived at an idea for cold-starting a sparse-reward agentic task: a fresh policy solves ~0% of the hard cases, so there’s no gradient, nothing to learn from. Your fix — put the solution/walkthrough for that exact task in the system prompt, let the model execute the task for real against the actual environment (real tool calls, real stdout, a real pass/fail check), then mask the walkthrough out of the recorded trajectory and fine-tune the model, supervised, to produce that same executed trajectory when given only the bare task. Your own framing: it’s an exploration task; hand the agent the map, harvest its own walk to the goal, then take the map away.

This chapter’s first job is to tell you: this is not novel, and that’s good news. You’ve reinvented a family the literature has been building out under at least four different names since 2009, each naming a different facet of the same operation. The second job is the harder one — the family has real, measured failure modes, and at least one of them lands directly on the specific design choice (“full walkthrough,” not an abstract cue) you proposed. This chapter names the family, shows the mechanism precisely, tables the evidence, and gives you the honest risk register before you spend compute on it.

Framing: general research reference — the technique family, not any one project’s pipeline. Status: every arXiv id below was verified live against arxiv.org abstract pages (title, authors, date cross-checked against body text, not a bare crawler title) during the research pass this chapter draws on; confidence is stated per section, and — per NuRL’s own ablation (§4) — the chapter does not conclude “this works, go build it.” It concludes “this is a real family with one specific, well-evidenced caveat that lands on your exact design,” which is a more useful and more honest answer.


1. The idea, and its real names

Four bodies of work converge on the same four-step move, each catching a different piece of it:

  • STaR-rationalization (Zelikman, Wu, Mu, Goodman, arXiv:2203.14465) — the generate-under-hint-then-mask mechanism at the level of a single scalar hint: append the correct final answer to the prompt, let the model generate a rationale that reaches it, train on the (question → rationale) pair with the hint stripped out.
  • Context / prompt distillation (Askell et al., arXiv:2112.00861; Snell, Klein, Zhong, arXiv:2209.15189) — the same mechanism scaled up to a rich hint: a whole instruction block, scratchpad, or system prompt, internalized into the weights by training the model to reproduce hint-conditioned outputs without the hint present.
  • Hint-guided exploration for sparse reward (NuRL, arXiv:2509.25666; HiLL, arXiv:2604.00698; ReGFT, arXiv:2603.01223) — the RL-training-loop framing: privileged guidance is what recovers a non-degenerate reward/advantage distribution when every rollout in a group currently fails, and the field has explicit vocabulary and metrics for whether that guidance was genuinely necessary and whether it transfers once removed.
  • Learning Using Privileged Information / asymmetric actor-critic (Vapnik & Vashist, Neural Networks 2009, DOI:10.1016/j.neunet.2009.06.042; Pinto, Andrychowicz, Welinder, Zaremba, Abbeel, arXiv:1710.06542) — the formal name for “the teacher sees information at train time the student will never see at deployment,” which is the abstraction all three techniques above are instances of.

None of these is “solved” in the sense of a settled best-practice recipe. All four have real evidence they work, and all four have documented conditions under which the same recipe silently produces a model that looks trained but hasn’t actually learned the thing you think it has. That’s the substance of this chapter.


2. The mechanism: exploration compiled into supervision

What the hint is doing. An untrained (or weak) policy facing a sparse/binary reward has to find the solution by search — an exponentially large space of tool calls and token sequences, almost none of which lead to a verified success. A hint (an answer, a scratchpad, a full walkthrough) collapses that search: it narrows the space down to a specific, concrete, correct path at generation time. Once that path exists as a real (input → output) pair, imitating it is a supervised problem — dramatically cheaper and more stable than making the model rediscover the same path from scratch via RL exploration in a sparse-reward regime. This reframing — “the hint pays the exploration cost once, then supervision harvests it” — is the single sentence that unifies STaR-rationalization, context distillation, and hint-guided RL.

Grounded-and-executed beats confabulated-and-narrated. There are two very different ways to produce the (task, trajectory) pair the hint enables. One: ask a model to write a plausible-looking solve — no environment involved, nothing actually ran. Two: give the model the hint and let it act against the real environment — real tool calls, real stdout/stderr, a real pass/fail check. Your proposal insists on the second. This is a genuine, load-bearing design choice, not a detail: a narrated rationale can confabulate a result that never happened (this is the exact failure mode the field calls unfaithful chain-of-thought — biasing a prompt toward an answer produces plausible-but-non-load-bearing reasoning text, dropping accuracy up to 36% on BIG-Bench Hard when the bias points at a wrong answer, Turpin, Michael, Perez, Bowman, arXiv:2305.04388) — while an executed, verifier-checked trajectory structurally cannot silently hallucinate its own success. That’s real protection against one failure mode. It is not, on its own, protection against the other one (§4) — a real, verified trajectory can still have been shaped by the hint in ways that don’t transfer.

Mask-the-hint is the training-time move, formalized twice.

Snell et al. give the exact loss for the general case — teacher (with hint) supervises student (without hint), same underlying model, hint stripped by an extractor f before the target is built:

L(θ_student) = E_x~D [ E_y~P_θteacher(·|T_teacher(x)) [ log P_θstudent( f(y) | T_student(x) ) ] ]

T_teacher(x) = [hint/instructions/walkthrough] + x        # what generates y
T_student(x) = x                                            # what the trained model sees
f(y)         = y with the hint/scratchpad stripped out      # what the trained model must produce
θ_teacher stays frozen — it's the same model, hint present, at generation time only

STaR/TRICE give the same move a probabilistic reading, one level more mechanistic. Treat the rationale (or trajectory) z as a latent variable; the real objective is the marginal likelihood of the correct outcome y given the task x, marginalizing over all possible z: log p_θ(y|x) = log Σ_z p_θ(y|x,z) p_θ(z|x). You can’t compute that marginal directly — you need a sample from the posterior p_θ(z|x,y), “the trajectory distribution given that we already know it succeeds.” The hint-conditioned generation step is exactly an approximation of drawing from that posterior. TRICE (Phan et al., arXiv:2312.02179) formalizes STaR-rationalization as one-sample, uncorrected MCMC against that posterior, and proves it is a biased stochastic-EM estimator: the true gradient of the marginal log-likelihood is p_θ(y|x) ∇_θ log p_θ(y|x) — weighted by how likely the unhinted model already was to succeed. That weighting means the gradient signal shrinks toward zero exactly on the hardest examples — the ones where the hint is doing the most work relative to the model’s own competence. This is the formal version of “did I really teach it something, or did the hint just do the work” — and it’s the mathematical spine under NuRL’s elicit-vs-expand framing (§4).

LUPI names the shape of the whole thing. Vapnik’s framing: training triplets (x_i, x*_i, y_i) where x* (privileged info) is available only at train time; the learned function f: X → Y must use only x at deployment. Your writeup is x*; the executed-and-masked trajectory is the (x, y) the model is trained on. The theoretical payoff, when privileged info is genuinely informative, is a faster generalization-error convergence rate (O(1/n) vs O(1/√n), the “Oracle SVM” analysis) — but the empirical follow-up is candidly mixed: randomly-generated “privileged” features can perform similarly to genuinely meaningful ones in some SVM+ settings (Serra-Toro, Traver, Pla, Pattern Recognition Letters 2014) — privileged-at-train-time is not automatically privileged-and-useful. The asymmetric actor-critic lineage (Pinto et al., arXiv:1710.06542) is the deep-RL sim-to-real instance of the same idea done right: the critic sees full simulator state, the actor only ever sees what it will have at deployment — and it’s now the standard recipe precisely because the privileged channel there (ground-truth physics/pose) is verifiably informative, not noise.


3. Named techniques — what each contributes, and where each breaks

Named techniqueWhat it doesEvidence it worksFailure modeCitation
STaR-rationalizationHint = correct final answer appended to the prompt; generate a rationale that reaches it; strip the hint; SFT on (question → rationale)STaR’s own ablation: without rationalization, performance is “significantly worse” — it’s what lets the model make progress on items it can’t solve at all zero/few-shotTRICE: biased stochastic-EM — gradient signal shrinks toward zero exactly on the hardest, most-hint-dependent examples2203.14465, 2312.02179
Context / prompt distillationHint = a whole instruction block / scratchpad / system prompt; generate under it; strip; fine-tune to reproduce the output without itSnell 2022: 8-digit addition, 0%→9.7% accuracy without a scratchpad after distilling from scratchpad-guided completions, capability transfers downstream; Kujanpää 2024: matches RAG-level accuracy on knowledge injectionClassical (off-policy) form trains on a frozen, once-sampled teacher completion — exposure bias + mode-covering forward-KL2209.15189, 2412.14964
On-Policy Context Distillation (OPCD)Fixes the above: the student’s own rollouts, scored by a hint-conditioned teacher, minimized under reverse-KL instead of frozen forward-KLBeats the off-policy baseline on task accuracy and OOD-capability preservation; names “experiential knowledge distillation” (consolidating a model’s own historical solve traces) as one of its two target applications — literally “harvest your own successful rollout”Even on-policy, a single canonical hint can collapse rollout diversity toward one narrow, hint-shaped path2602.12275
NuRL (adaptive hint injection for RLVR)On 0%-pass-rate groups only, inject a self-generated, abstract hint (not the answer), re-roll, recover a non-zero-advantage groupRaises pass@1024 — the model’s actual capability ceiling — where vanilla GRPO leaves it flat; direct evidence of genuine expansion, not just re-weightingTheir own ablation: revealing the gold answer/full solution directly hurts performance relative to an abstract hint — this is the sharpest caveat against a full walkthrough specifically2509.25666
HiLL (“hint reliance”)Names “advantage collapse” (all-fail groups → zero advantage → no gradient); jointly trains a hinter + reasoner; introduces a differentiable hint-reliance metricProves: lower hint reliance ⇒ stronger transfer from hinted-success to no-hint-success; found that even phrasing (“here is a hint to help you…”) measurably raises relianceFixed/offline hints don’t adapt to the reasoner’s evolving errors — a static writeup stays static while the policy improves2604.00698
ReGFT (reference-guided fine-tuning)A partial reference solution as prefix; the model generates its own continuation conditioned on it; SFT on the self-generated trajectory, explicitly not on the raw reference textImproves supervised accuracy, accelerates a GRPO variant (DAPO), raises the RL performance plateau on AIME’24/’25Their stated reason for rejecting raw-reference SFT: expert text sits outside the model’s own reasoning distribution — training on it teaches surface imitation2603.01223
Go-Explore — “exploit, then robustify”Phase 1: reach a high-reward trajectory by any privileged means (simulator resets); Phase 2: imitation-learn a policy that reproduces the behavior without the privileged affordance4× prior SOTA on Montezuma’s Revenge, first-ever nonzero score on Pitfall, zero domain knowledgePhase-1 exploits (resets) are often illegal at deployment — the robustify step is necessary, and only as good as the imitation data it’s trained on1901.10995, 2004.12919
LUPI / asymmetric actor-criticTeacher/critic conditions on privileged information available only at train time; student/actor never sees itTheoretical faster convergence when privileged info is genuinely informative (SVM+ “Oracle” analysis); standard sim-to-real recipe (critic sees full sim state, actor sees only images)Privileged-at-train-time is not automatically privileged-and-useful: randomly-generated “privileged” features can perform similarly to meaningful ones in some settings1710.06542
HER (hindsight relabeling)No hint at generation time at all — relabel a failed trajectory’s goal, after the fact, with whatever it actually achievedAblation: sparse-binary-reward robotic manipulation tasks literally don’t learn without it — the crucial ingredient, not an optimizationOnly applies where success is naturally a “did you reach state g” predicate — doesn’t transfer to non-goal-reaching correctness criteria1707.01495

4. Failure modes — named, measured, and the one that lands on your exact design

Three distinct risk classes, not one — conflating them leads to the wrong mitigation.

(a) Shortcut learning / Clever-Hans / hint-copying

The general phenomenon: a decision rule that performs well on the training distribution by exploiting a cue that isn’t the actual task (Geirhos et al., “Shortcut Learning in Deep Neural Networks,” arXiv:2004.07780 — 1650 citations, named for Clever Hans, the horse that appeared to do arithmetic by reading its handler’s involuntary cues). In NLP specifically: BERT-class NLI models adopting fallible syntactic heuristics that collapse on a controlled challenge set (HANS, McCoy, Pavlick, Linzen, arXiv:1902.01007); the same effect on COPA, with the sharp finding that the same recipe can produce a Clever-Hans learner or a genuine one depending on architecture (Kavumba et al., arXiv:1911.00225); a detection technique — strip words from the input while confidence stays unchanged, meaning the model wasn’t reading the content at all (RAWR, Feng et al., arXiv:1804.07781).

The version specific to this proposal is sharper still. Peng et al., “Measuring and Mitigating Post-Hoc Rationalization in Reverse Chain-of-Thought Generation,” arXiv:2602.14469 studies exactly “synthesize a trace from a known (query, answer) pair” — precisely “write the trajectory knowing the destination” — and formalizes “answer as cognitive anchor” across lexical/entropic/probabilistic axes. Their most important negative result: the naive mitigation, “tell the model to ignore the answer while generating,” backfires — it reduces surface lexical overlap with the hint but increases entropic/probabilistic anchoring, meaning the model leans on the hint just as much internally, only hides it better. Direct implication: masking the hint text out of the trajectory is necessary but not sufficient. The model’s tool-call sequence itself — target selection, the order it tries things — can still be suspiciously well-aimed relative to what an unhinted agent would ever discover, even with every trace of the writeup’s literal text gone from the training row.

(b) Distribution mismatch / off-policy exposure bias

Named explicitly by OPCD: the classical Askell/Snell recipe trains on a frozen, once-sampled teacher-conditioned completion — the student never generated it — which produces exposure bias (trained on teacher-shaped sequences, must autoregress its own at test time) and mode-covering forward-KL (spreads mass across all teacher behaviors instead of committing to a coherent policy). ReGFT names the same failure from the SFT side: raw expert/reference text sits outside the model’s own reasoning distribution, and training on it directly teaches imitation of an alien voice, not the underlying skill — their explicit fix is to have the model itself generate the continuation, guided-but-not-copying the reference. Your proposal’s insistence on executing the trajectory rather than distilling the writeup’s text directly is already the correct mitigation here, by construction — keep it.

(c) Elicit-not-expand

The sharpest open question, and the one with a formal answer (§2’s TRICE result) and an empirical instrument (NuRL’s pass@1024 metric): does hint-guided training expand what the policy can do, or does it just make an already-latent, rarely-sampled solution more probable? NuRL’s headline finding is that done right (self-generated, abstract hints, gated on genuine 0%-pass-rate difficulty, applied late — after unhinted training has already converged) it does raise the model’s true ceiling (pass@1024), which vanilla GRPO cannot move. But their own ablation is the load-bearing caveat for you specifically: revealing the gold answer/full solution directly hurt performance relative to an abstract hint — a full CTF walkthrough sits at exactly the dangerous end of that spectrum, closer to “here’s the answer” than to “here’s the abstract cue.” This is not a reason to abandon the idea; it’s the single most concrete, most actionable finding this literature offers against the specific form (“full walkthrough in system prompt,” not “abstract hint”) you proposed.

Detection — ablate the hint, don’t trust the narration

  • HiLL’s hint-reliance check, operationalized cheaply: re-roll the same task from the same checkpoint without the writeup, N times; check whether the hinted trajectory’s key decision points (target selection, tool choice, the specific exploit path) show up in any of the unhinted rollouts. Low overlap = high reliance = the hint did the work, not the model.
  • NuRL’s pass@1024-style check: hold out tasks that never had a writeup generated for them at all (not just masked at inference — never authored, so the eval set itself can’t leak task-specific info from writeup-authoring). Compare the SFT’d model’s pass rate on those to the pre-SFT base model’s. A genuine capability gain shows up there; a hint-shortcut gain does not.
  • Do not trust the trajectory’s own narrated reasoning as evidence of non-reliance. RL optimization pressure is documented to increase reliance on prompt-present hints without proportionally increasing disclosure of that reliance in the model’s own chain-of-thought — the model can use the hint and simply not say so. The ablation checks above are load-bearing precisely because introspection is not sufficient evidence.

Mitigate

  1. Mask thoroughly, then audit for residual fingerprints — not just “is the writeup’s literal text gone,” but whether the tool-call order and target selection look anomalously well-aimed compared to the model’s other, unhinted successful trajectories on structurally similar tasks (Peng et al.’s finding that masking-only backfires against internal anchoring).
  2. Fade the hint, don’t cut it binary. Multiple independent lineages converge on the same fix: graded hint depths rather than one full walkthrough (Zhang et al., “Multi-level Stepwise Hints,” arXiv:2507.02841); scheduling easy-to-hard curricula to prevent overfitting to the assistance signal (E2H Reasoner, arXiv:2506.06632; AdaRFT, arXiv:2504.05520); and explicit annealing of an auxiliary demonstration loss as the policy’s own competence overtakes the demonstrator (Nair, McGrew, Andrychowicz, Zaremba, Abbeel, arXiv:1709.10089) — the clearest classical precedent for “hint fading” as a design pattern, not a novelty.
  3. Verify unaided, on tasks that never had a hint at all, per the detection section above — the single check that actually distinguishes expansion from elicitation.

5. Verdict, and the concrete recipe

Honest verdict. The mechanism is real and well-precedented across four independent lineages spanning 2009–2026; “hint-conditioned execution, then strip-and-train” reliably converts intractable exploration into tractable supervision, and grounding it in a real, verifier-checked environment (rather than a narrated rationale) is a genuine, non-trivial improvement over the weakest member of this family (vanilla STaR-rationalization against a string-match check). But this is contested at the specific design point you proposed, not in general: the one paper in this family that directly ablates “full answer/solution vs. abstract hint” (NuRL) found the full-solution end of that spectrum hurts relative to an abstract cue, and no paper surveyed here tests the exact setting — a full external walkthrough, executed in a live tool-using sandbox, verified against a real target — end to end. Treat the mechanism as validated and the specific recipe (full walkthrough, not graded/abstract hints) as the open empirical risk to test, not to assume away.

The concrete recipe, incorporating the mitigations above rather than the naive one-shot version:

graph LR
  A["Writeup / solution<br/>in SYSTEM PROMPT<br/>(privileged hint)"] --> B["Agent EXECUTES<br/>in the real environment<br/>(real tool calls, real output)"]
  B --> C{"Verifier check<br/>(e.g. flag_verified)"}
  C -->|"fails"| D["Discard, or keep as a<br/>hinted-failure negative<br/>(V-STaR-style contrast signal)"]
  C -->|"passes"| E["MASK the writeup out of<br/>the recorded trajectory"]
  E --> F["Hint-reliance filter:<br/>re-roll unhinted N times,<br/>drop trajectories with<br/>near-zero unhinted overlap"]
  F --> G["SFT: task-without-hint<br/>-> executed, masked trajectory"]
  G --> H["FADE hint strength across<br/>a curriculum: full walkthrough<br/>-> abstract cue -> none"]
  H --> I["VERIFY UNAIDED on held-out<br/>tasks that never had a<br/>writeup authored at all"]
  I -->|"gap holds vs. pre-SFT base"| J["Genuine capability expansion"]
  I -->|"gap closes / vanishes"| K["Hint-shortcut — degrade the<br/>hint toward abstract, re-run"]

Reading it end to end: the loop is not “run this once and trust the flag check.” The flag check (step C) rules out confabulation, which is real but is only one of the two failure modes this family documents. Step F and step I are what rule out the other one — hint-copying and elicit-not-expand — and neither is optional if you want to trust the resulting model’s behavior on a task it’s never seen a writeup for, which is presumably the entire point of doing this at all.


  • The kinds of SFT — it is the data, not the algorithm — this chapter’s masked, executed trajectory is a specific instance of that chapter’s Axis A/B/C (self-generated, executed, verifier-filtered) — the highest-signal cell in that taxonomy, with one extra wrinkle (the trajectory was generated under privileged information) that chapter doesn’t cover and this one does.
  • Method → Data (your real bottleneck) — hint-guided bootstrapping produces the same “full trajectory” data object that chapter’s SFT row already names; the difference is entirely in the generation process (hint-conditioned, then masked), not in the shape of the resulting row.
  • RL that creates value — long-horizon · exploration · reasoning · novelty — the [E]/[N] exploration and novelty-tagged techniques there are the RL-native cousins of the same problem this chapter solves via a one-shot SFT harvest; read that chapter for the online-RL version of “recover a gradient when a group is all-fail.”
  • Is the recipe a loop? — the fade-the-hint curriculum in §5 (full walkthrough → abstract cue → none) is a specific instance of that chapter’s question: does a stage run once or get revisited, and from which checkpoint does the next hint-level start.
  • Contested edges & landmines — the elicit-not-expand tension named here in §4(c) is the same fault line that chapter’s §1 covers for vanilla RLVR (pass@1 vs. pass@k, base-model boundary); this chapter’s TRICE result and NuRL’s pass@1024 check are the SFT-side and hint-injection-side versions of that same unresolved question.

Verified citation registry

arXiv idPaperRole in this chapter
2203.14465STaR (Zelikman et al.)seminal hint-then-mask mechanism (rationalization)
2312.02179TRICE (Phan et al.)formalizes rationalization as biased stochastic-EM; weak gradient on hardest examples
2402.06457V-STaR (Hosseini et al.)discarded hinted-failures as reusable negative signal, not pure waste
2112.00861Askell et al.coins “context distillation” for LLM alignment
2206.11349Choi et al. (Prompt Injection / PING)independent formalization, teacher(w/ prompt)→student(no prompt) on synthetic pseudo-inputs
2209.15189Snell, Klein, Zhonggeneralized context-distillation framework; the exact loss this chapter’s §2 uses
2412.14964Kujanpää, Valpola, Ilinprompt distillation matches RAG-level knowledge injection
2602.12275OPCD (Ye et al.)on-policy fix for exposure bias / mode-covering forward-KL; “experiential knowledge distillation”
2606.26091Nicolicioiu, Pezeshki, Courvilleon-policy self-distillation from a sampled demo still collapses output diversity / flattens pass@k
2605.15239OPSA (Fu et al.)“teacher flip rate” diagnostic — does privileged context genuinely convert failures, or just elicit
1707.01495HER (Andrychowicz et al.)hindsight relabeling; the no-hint-at-generation sibling of this family
2509.25666NuRL (Chen et al.)abstract hints raise pass@1024; revealing the full answer/solution hurts — the load-bearing caveat for this proposal
2604.00698HiLL (Xia et al.)“hint reliance” metric; lower reliance ⇒ stronger transfer to no-hint policy
2603.01223ReGFT (Wu et al.)self-generated, reference-guided trajectories beat raw-reference SFT
2507.02841Multi-level Stepwise Hints (Zhang et al.)graded hint depths as a concrete fading mechanism
2506.06632E2H Reasoner (Parashar et al.)fading easy-to-hard curricula prevents overfitting to assistance
2504.05520AdaRFT (Shi et al.)adaptive difficulty targeting, same frontier-tracking spirit
1709.10089Nair, McGrew, Andrychowicz, Zaremba, Abbeelclassical precedent for explicit demo-loss annealing (hint fading)
1901.10995Go-Explore (original)“exploit, then robustify” — the classical-RL analogue of hint→mask
2004.12919Go-Explore (Nature version)canonical citation for the same mechanism
1710.06542Asymmetric Actor-Critic (Pinto et al.)LUPI applied to deep RL — critic sees privileged sim state, actor doesn’t
2004.07780Shortcut Learning (Geirhos et al.)seminal Clever-Hans framing; shortcuts indistinguishable on i.i.d. data
1902.01007HANS (McCoy, Pavlick, Linzen)canonical NLI shortcut-detection challenge set
1911.00225Clever Hans on COPA (Kavumba et al.)same recipe, different architecture — genuine vs. shortcut learner
1804.07781RAWR (Feng et al.)input-reduction detection technique for artifact exploitation
2305.04388Turpin, Michael, Perez, Bowmanbiasing a prompt toward an answer produces unfaithful, non-load-bearing CoT
2602.14469Peng et al. (RCG / SSR)“answer as cognitive anchor”; naive masking backfires (reduces lexical, increases entropic anchoring)
2604.13602Reward Hacking survey (Wang et al.)RL can increase hint-reliance without proportional CoT disclosure
2210.13575Ross, Peters, Marasovićself-rationalization can itself become a new shortcut surface, especially ungrounded
2603.07084Countdown-Code (Khalifa et al.)as little as 1% contaminated distillation data teaches reward-hacking behavior, amplified by later RL

Confidence calibration: High on every id/abstract above (verified live, not recalled from training memory) and high on the mechanism itself (four independent lineages, 2009–2026, converge on the same generate-under-privilege → strip → supervise structure). Contested, explicitly: whether a full walkthrough specifically (as opposed to an abstract hint or partial reference prefix) is the right hint granularity — NuRL’s own ablation says it isn’t, and no paper surveyed tests the exact executed-in-a-live-sandbox setting end to end, so treat that as the open empirical question, not a settled negative. Several cited ids are very recent (2602.x–2606.x, weeks to months old at verification time) — their mechanisms and diagnostics (hint reliance, teacher flip rate, pass@1024 checks) are more load-bearing for a design decision than their specific benchmark numbers, which have not yet accumulated independent replication. Not grounded on any academic cybersecurity-LLM paper — every citation is general ML/RL data-construction, exploration, or shortcut-learning literature, per this chapter’s brief.

Teaching a tool, teaching recon — the data behind a skill

You want to teach a model two different things: (a) a specific tool with a fixed signature — grep, the Vercel CLI, a REST endpoint — and (b) a search methodology — “explore many things to find some things,” a grounded decision tree that fans out and prunes. Both are “tool use” in the loose sense. They are not the same training problem, and — this is the crux — for neither one does the answer route through Q&A. This chapter is about the DATA OBJECT: what shape of row you write to disk (or generate online), how it gets made, whether the tool was actually executed to produce it, and which technique it pairs with.

Framing: general research reference, drawn from seven sources (Toolformer, ToolLLM/ToolBench, APIGen/xLAM, Gorilla/DocPrompting, terminal-CLI-agent literature, search/recon-RL literature, and a procedural-vs-declarative synthesis). Every arXiv id below was cross-checked live 2026-07-02 against the source notes; only ids present in those notes appear here.


1. The axes, and the up-front verdict

Three bodies of vocabulary are in play, and disambiguating them is the first move:

  • Tool learning / tool-use training / function-calling / tool-integrated reasoning (TIR). The literature for teaching a model to call a fixed-signature tool correctly — right name, right arguments, right moment, right reaction to the result. This is the “teach grep” problem.
  • Search / information-seeking RL. The literature for teaching a model to explore — issue a query, read what comes back, decide whether to search again or answer, with no single correct path. This is the “teach recon” problem. It is tool-use RL’s cousin, not tool-use RL itself: the object being learned is a branching strategy, not a call signature.
  • Procedural vs. declarative knowledge. The cognitive-science distinction that explains why the first two need different data than a knowledge base does. Declarative knowledge is “facts you can state” (what a flag does); procedural knowledge is “a skill you can execute” (when to reach for that flag, how to recover when it returns nothing). Training data that only states facts caps out at declarative recall no matter how much of it you have.

The up-front verdict, unanimous across all seven sources: Q&A (Q: "What does grep do?" A: "...") teaches facts about a tool. It does not teach skill with a tool — sequencing, argument selection under a real task, reading an observation to decide the next action, recovering from a failed call. Every source that runs the comparison (ToolBench, APIGen/xLAM, Gorilla/DocPrompting, procedural-vs-declarative) lands on the same conclusion: trajectories — ideally executed — are necessary for procedural transfer; Q&A is a legitimate thin seed for call-syntax, never the primary signal. Toolformer is the instructive edge case: it isn’t Q&A and isn’t a full multi-step trajectory either — it’s a self-supervised single (call, result) insertion into raw text, and it lands on the executed-trace end of the spectrum because the keep/discard filter is grounded in the real API output’s effect on next-token loss, not in a hand-written answer.

This is the same principle this book states elsewhere as “execution is the engine” — see kinds-of-sft.md for the general argument that whether a trajectory was executed against a real environment (rather than synthetically authored/narrated) is the single biggest lever on whether SFT teaches a transferable skill or teaches confabulation. This chapter is that argument applied specifically to tool-calling and search.


2. Teaching A TOOL (grep, the Vercel CLI, any fixed-signature callable)

2.1 The data-object ladder

Quality increases strictly down this ladder — each rung is necessary, none is sufficient on its own:

RungData objectTeachesCeiling
1. Doc-grounding / retrieval (declarative)(instruction, retrieved_doc_or_schema, api_call)Which tool + what signature existsKills hallucinated flags; does not teach when to call or how to recover
2. Tool-call trajectories (procedural, not-yet-grounded)(instruction, [thought, api_call, args, api_response]_1..n, final_answer)The loop: when to call, what to pass, how to read step N’s output into step N+1’s args, when to stopTeaches sequencing even if some calls were only lightly checked
3. Executed + verified traces (grounded — the ceiling)(query, function_call, real_observation) gated by multi-stage verificationEverything above, PLUS: the tool’s actual behavior, including real failure textEliminates hallucinated tool behavior outright

Rung 1 — doc-grounding / retrieval. Gorilla (arXiv:2305.15334) trains SFT with the oracle API doc concatenated straight into the prompt, so the model learns to read a doc rather than memorize one — this is what drops its hallucination rate to 6.98% vs. GPT-4’s 36.55% on TorchHub. DocPrompting (arXiv:2207.05987) goes one step further and trains a retriever + FiD generator jointly over (NL_intent, top-k_doc_paragraphs, reference_code). Neither executes the tool during data creation — the doc is trusted as ground truth. DocPrompting’s own ablation is the sharpest argument for why this rung exists at all: retrieving docs (versus retrieving worked examples) roughly doubles unseen-function recall (9.03% → 18.30%), because a doc generalizes to argument combinations an example never showed, but an example doesn’t. This rung is necessary — it’s where hallucinated signatures die — but it’s still one-shot code/call generation, not a decision loop.

Rung 2 — tool-call trajectories. ToolLLM/ToolBench’s canonical training row (arXiv:2307.16789):

{
  "instruction": "<user task>",
  "relevant_apis": ["API_1", "API_2"],
  "solution_path": [
    {
      "step": 1,
      "thought": "<reasoning about next action>",
      "api_name": "SearchByTitle",
      "parameters": {"title": "Batman", "country": "us"},
      "api_response": { "...real JSON response from actual API execution..." }
    },
    {
      "step": 2,
      "thought": "<reasoning based on step 1 response>",
      "api_name": "GetStreamingAvailability",
      "parameters": {"movie_id": "12345"},
      "api_response": { "...real response..." }
    }
  ],
  "final_answer": "<final output to user>"
}

Every API call in the 126,486-instance dataset is annotated by DFSDT (depth-first search with decision tree) — the annotator model is allowed to branch, backtrack on a failed call, and keep only working paths — which is what makes this trajectory-shaped rather than a single-shot call. The API documentation (name, params, example response) is attached at every step, so the model learns API semantics alongside call syntax, not call syntax alone. All 469,585 API calls behind ToolBench were made against real RapidAPI endpoints — not simulated REST mocks, which is exactly the gap ToolBench closes relative to prior single-tool, no-execution datasets like APIBench and ToolAlpaca.

Rung 3 — executed + verified traces. This is where every source converges as the non-negotiable floor for CLI-grade reliability. APIGen’s row (arXiv:2406.18518), using grep directly as the worked example:

{
  "query": "Check if the word 'error' appears in the log file at /var/logs/app.log",
  "function_calls": [
    { "name": "grep", "arguments": { "pattern": "error", "file": "/var/logs/app.log", "case_insensitive": false } }
  ],
  "observations": [
    { "type": "tool_output", "content": "[Line 42] ERROR: Connection timeout\n[Line 88] ERROR: Auth failed", "execution_time_ms": 14 }
  ],
  "expected_action": "The tool executed successfully; report the found errors.",
  "parallel_calls_supported": true
}

And xLAM/APIGen-MT’s multi-turn extension (arXiv:2409.03215, arXiv:2504.03601) — the worked example is literally the Vercel CLI:

{
  "conversation_id": "conv_001",
  "turns": [
    { "user_query": "Deploy my Vercel site",
      "function_calls": [ { "name": "vercel_list_projects", "arguments": {} } ],
      "tool_output": { "projects": [{"name": "my-app", "id": "proj_123"}] } },
    { "user_query": "Now deploy it to production",
      "function_calls": [ { "name": "vercel_deploy", "arguments": { "project_id": "proj_123", "environment": "production" } } ],
      "tool_output": { "deployment_url": "https://my-app.vercel.app", "status": "ready" } }
  ],
  "blueprint": {
    "task": "Deploy a web app to production via Vercel",
    "ground_truth_actions": ["list_projects", "deploy"],
    "dependencies": ["project_id must come from list_projects output"]
  }
}

Note the state-threading in the blueprint: project_id in turn 2 must literally be the value that came back from turn 1’s real execution — this is only checkable because the tool was actually run. APIGen’s gate that produces rows like this is a 3-stage verifier: (1) format check — does the call parse and match the schema (does the grep call have pattern/file, is case_insensitive a bool); (2) execution — actually run it in a sandbox (real grep, real Vercel SDK against a test project, real HTTP request) and capture stdout/exit code/latency; (3) semantic check — an LLM judge asks “does this (query, call, observation) triple actually make sense,” which is what catches a call that executed successfully but whose logged observation was hallucinated rather than the tool’s real return. From 3,673 executable APIs this produced 60,000 verified samples. Toolformer’s loss-reduction filter (arXiv:2302.04761) is the self-supervised sibling of the same idea — keep an inserted <API> call → result </API> block only if the real API result measurably lowers next-token loss (L_i^- − L_i^+ ≥ τ_f) — grounded in execution, gated by a different (automatic, LM-internal) signal rather than an LLM judge. Models trained on rung-3 data (APIGen/xLAM, 1B–70B) top BFCL and beat GPT-4o/Claude-3.5 on τ-bench — the empirical payoff for paying the execution cost.

2.2 How each rung gets MADE

RungMade byExecution at data-creation time?
Doc-groundingHand-curated docs/--help/man pages + synthetic instructions (GPT-4-generated)No — trusted from source docs
Tool-call trajectoryLLM proposes a candidate path; annotator executes each step against the real backend; DFSDT explores/backtracksYes, per step, during annotation
Executed + verifiedSynthetic query generation → mandatory sandbox execution → multi-stage verifier (format → execution → semantic)Yes — non-negotiable, the defining feature
Toolformer-style self-supervisedSample candidate insertion positions in raw text → sample candidate calls → execute against a real backend (Atlas QA model, Python calculator, BM25 over KILT Wikipedia, NLLB-600M, system clock) → keep only if loss drops by ≥ τ_fYes — every one of the five tool types is a real backend, not a template

2.3 The pipeline, end to end

flowchart LR
    A["Docs / --help / man pages\n(declarative floor)"] --> B["LLM proposes candidate\ninstruction + call"]
    B --> C["EXECUTE the tool for real\n(sandbox / test project / live CLI)"]
    C --> D{"Verify\nformat -> execution -> semantic\n(or: loss-reduction filter)"}
    D -- fail --> B
    D -- pass --> E["SFT on (instruction, trajectory,\nreal_observation) rows"]
    E --> F{"Plateau on\nheld-out tasks?"}
    F -- no, good enough --> G["Ship"]
    F -- yes --> H["Optional RL refinement\n(decomposed reward, on-policy\nexecution each rollout)"]

2.4 Worked recipe: teaching grep / the Vercel CLI

Step 1 — Docs-in-context (declarative floor)
  Data: {tool_name, signature, flags[], description, example_invocations} from `man`/`--help`/API docs.
  Purpose: kill hallucinated flags. Gorilla-style: concatenate the retrieved doc into the training
  prompt so the model learns to READ docs, not memorize them.

Step 2 — Executed CLI trajectories (procedural, grounded from the start — do not skip execution)
  Data object: {instruction, [{thought, command, real_stdout, real_stderr, exit_code}]_1..n, final_answer}
  How made: propose a command for a realistic task ("find all TODOs under src/ modified this week");
  RUN IT in a real/sandboxed filesystem or a test Vercel project; capture the ACTUAL output — never
  simulate. This is APIGen's execution stage and ToolBench's "real responses, not simulated"
  requirement, applied to a CLI instead of a REST API.
  Diversity axes: vary flags, vary phrasing, include multi-command pipes (`grep | sort | uniq`),
  include distractor tools (`find` vs `locate` vs `grep`), include failure cases (wrong flag, 0
  matches) so the model sees real error text, not invented text.

Step 3 — Verifier-filtered SFT
  Filter: APIGen's 3-gate check (format-valid -> executes without error -> semantically answers the
  instruction, LLM-judge or exact-match) OR Toolformer's loss-reduction filter (keep only if the
  executed result measurably helps predict the continuation).
  Train: standard next-token CE loss on (system, user, assistant-with-tool-call, tool_result) tuples.
  500-1000 verified trajectories is APIGen/xLAM's working scale for a single tool; ToolBench's ratio
  (~4 reasoning turns/instruction) is a reasonable trajectory-depth target.

Step 4 — Optional RL (only if Step 3 plateaus, or exit-code/efficiency matters)
  Reward: dense, decomposed (ToolRL) — R_format (valid syntax) + R_execution (ran without error) +
  R_answer (task solved) — NOT one sparse outcome reward, which collapses past ~4 steps for
  compositional CLI tasks. GRPO on-policy, executing the sampled command for real each rollout.
  Structurally this is imitation -> RL refinement; rejection sampling is the simplest version —
  canonical home: methods/imitation.md. Reach for full RL only when SFT plateaus.

Q&A’s only legitimate role in this recipe: a small (~50-100), format-only seed (Q: find TODOs in python files -> A: grep -r TODO --include='*.py') to bootstrap valid call syntax before Step 2 — never the primary signal.


3. Teaching RECON — search / information-seeking RL

Recon is not a longer tool-call trajectory. It’s a search tree with an outcome-only reward, and the winning recipe is structurally different from §2:

methodology-seed (thin SFT, format-only)  ->  RL discovers the branches
(cold-start: teaches the CALL FORMAT,          (Search-R1 / R1-Searcher / DeepResearcher / ToolRL:
 NOT the decision tree)                         outcome reward on REAL execution, retrieved-token
                                                 masking, GRPO — the tree structure emerges)

3.1 The data object

(query, trajectory=[(action, real_observation)]_1..n, final_answer, outcome_reward)crucially, the intermediate steps are not supervised; only the terminal outcome is rewarded. This is what forces the model to discover which branches are worth exploring rather than imitate one hand-authored path. Search-R1’s worked row (arXiv:2503.09516):

{
  "question": "Who won the 2024 US presidential election?",
  "trajectory": [
    {
      "step": 1,
      "reasoning": "I need to search for the 2024 US election results",
      "search_query": "2024 US presidential election winner",
      "observation": "<retrieved_passage_text>",
      "answer": "Harris won the election"
    }
  ],
  "final_answer": "Kamala Harris",
  "reward": 1.0
}

Note the intermediate answer field is allowed to be wrong — it’s not supervised, only the terminal one is. This row is generated online, during training, not pre-computed: for each task, sample N rollouts against a live/sandboxed retriever (Search-R1 used online BM25 over 2018 Wikipedia), each a real cold-start → search → reason → answer sequence, reward = exact-match on the final answer.

3.2 Retrieved-token masking — the mechanism that makes the strategy transfer

During the GRPO backward pass, loss is computed only on model-generated tokens (the query text, the reasoning) — never on the retrieved/observed passage tokens. This stops the model from overfitting to one retrieval corpus’s exact phrasing and is exactly why the learned strategy — when to search again, when to stop — transfers to a new corpus or a new tool, whereas a model trained by imitating fixed retrieval snippets would not. The same masking rule generalizes past web search: shell stdout, an HTTP response body, a scan’s raw output — anything that came back from the environment rather than from the model gets masked the same way. Full mechanics of this masking rule inside the broader tool-integrated-reasoning RL literature (ReTool, ToRL, Search-R1) live in methods/rl-long-horizon-exploration.md §1.8 — not re-derived here.

3.3 Why SFT-first-then-RL is contested, not settled

Nemotron-Research-Tool-N1 (arXiv:2505.00024) found pure RL from a cold start outperformed SFT-then-RL on their benchmark — a thick SFT seed on distilled reasoning traces overfit to that reasoning style and hurt downstream RL. R1-Searcher (arXiv:2503.05592) runs no cold-start SFT at all, using a two-stage reward instead: stage 1 rewards invoking retrieval in the right format, regardless of correctness (teaches the call shape); stage 2 rewards getting the final answer right (teaches using the retrieved info correctly). WebGPT (arXiv:2112.09332), by contrast, used human demonstrations (behavior cloning) followed by reward-model-guided rejection sampling — and that worked well precisely because its action space (arbitrary web clicks) is far larger and less constrained than a small fixed API surface, closer to the terminal-agent action spaces below.

Working rule for this book: a thin, format-only SFT seed — teaching valid call syntax, not a decision tree — is safe and typically improves sample efficiency; a thick SFT seed on full expert reasoning traces risks exactly the Nemotron overfitting failure. This is the same trade-off this book covers in depth for the general hint-guided case — see hint-guided-bootstrapping.md — apply that chapter’s risk register before deciding how thick your recon seed should be.

3.4 Let branching emerge; do not author it

DeepResearcher’s outcome-only RL (arXiv:2504.03160) produces self-reflection, cross-validation, and honesty (“I can’t find X”) as emergent behaviors — none were hand-coded into the reward or the seed data. This is the empirical case for seed-then-RL-discovers over hand-authoring a decision tree: a fixed methodology (“always whois, then DNS, then web”) is brittle, because real recon has too many valid orderings. TIER (arXiv:2605.16790) makes the negative case concrete: a trajectory-supervised reward (reward the model for matching one authored path) collapses past depth 4–6, because it penalizes perfectly valid alternative orderings the annotator didn’t happen to take. Execution-grounded, outcome-only reward doesn’t have this failure mode — it rewards any trajectory that reaches the correct terminal state, at whatever depth. If a curriculum is needed at all, order by task difficulty (easy targets first) — R1-Searcher found that specifically including hard questions prevents early convergence and under-exploration.

Full RL mechanics — GRPO, PPO-clip, group-relative advantage, long-horizon credit assignment at depth — are this book’s own territory: methods/rl-long-horizon-exploration.md and methods/agentic-rl.md. Not re-derived here.

3.5 Worked recipe: teaching recon

Step 1 — Methodology seed (thin SFT, NOT a full decision tree)
  Data: a small number (tens, not thousands) of demonstrated (query, action, real_observation, ...,
  outcome) trajectories showing the CALL FORMAT for the recon tools available (search, grep,
  nmap-equivalent, whois, etc.) — teach "here is how you emit a well-formed action," not "here is the
  one correct order to explore in." Over-specifying (full expert reasoning traces) risks the
  Nemotron-Tool-N1 failure: the model memorizes the demonstrated path instead of learning to search.

Step 2 — RL with outcome-only reward + retrieved-token masking
  Data object generated ONLINE during training (not pre-computed): for each task, sample N rollouts,
  each a real sequence of (action, real_observation) pairs against a live/sandboxed target, terminating
  in an answer; reward = binary or graded task success (flag found / answer exact-match / vulnerability
  confirmed) — intermediate steps unsupervised.
  Mask the loss to generated tokens only (actions + reasoning), never retrieved/observed text.
  GRPO update per batch of rollouts.

Step 3 — Let branching emerge; do not author it
  Do not hand-write a fixed scaffold ("first whois, then DNS, then web") — it is brittle. RL with a
  good outcome reward reliably discovers cross-validation, backtracking-on-dead-end, and stopping
  conditions on its own. If curriculum is needed, order by difficulty (easy targets first) to avoid
  early convergence / lack of exploration.

4. Consolidated table: skill-type → data object → how made → executed? → technique

Skill typeData objectHow madeExecuted?Technique
Tool — doc/signature grounding (declarative floor)(instruction, retrieved_doc_or_schema, api_call)Hand-curated docs/model-cards + synthetic instructions (GPT-4)No — trusted from source docs, no runtime validationSFT w/ retrieval conditioning (Gorilla) or joint retriever+generator (DocPrompting) — no RL
Tool — call trajectory (procedural)(instruction, [thought, api_call, args, api_response]_1..n, final_answer)LLM-generated candidate + real API/CLI execution at annotation time (DFSDT search)Yes — every step executed against the real backendSFT (imitate the annotated trajectory); DFSDT used at inference too
Tool — executed+verified trace (grounded ceiling)(query, function_call, real_observation) gated by format→execution→semantic checks, or Toolformer’s <API>call→result</API> filtered by loss reductionSynthetic query generation + mandatory tool execution in sandbox + multi-stage verifierYes — non-negotiable, the defining featureSFT on verified trajectories; RL optional refinement (decomposed reward)
Recon / search (procedural, tree-shaped)(query, [(action, real_observation)]_1..n, final_answer, outcome_reward) — intermediate steps unsupervisedGenerated ONLINE via rollout against a live/sandboxed target during training; nothing pre-computedYes — real search/tool execution every rollout, every stepThin SFT format-seed (optional) → RL (GRPO, outcome-only reward, retrieved-token masking)
Facts-about-a-tool (Q&A)(question, answer) text pairsHand-written or LLM-synthetic, no executionNoSFT only; ceiling = declarative recall, does not transfer to procedural skill

5. Two concrete recipes, side by side

Teaching grep/Vercel (§2.4)Teaching recon (§3.5)
SeedDocs-in-context, then executed trajectoriesThin, format-only trajectory seed (tens of examples)
Core data-generation loopPropose → execute → verify → keepSample N rollouts online → execute for real → reward terminal outcome only
What’s supervisedEvery step of the kept trajectoryOnly the final outcome; intermediate steps are free
BranchingNot really — mostly single-path-per-task with retries on failureCentral — the whole point is letting RL discover which branches pay off
Primary techniqueSFT on verified trajectories; RL only if plateaued, with decomposed rewardRL (GRPO) from a thin seed, outcome-only reward, retrieved-token masking
Risk if you get it wrongThin/no execution → hallucinated flags and invented stdoutThick seed → memorized path, no real search skill (Nemotron-Tool-N1 failure mode)

6. Confidence and what’s contested

  • High confidence, convergent across all 7 sources: the Q&A-vs-trajectory verdict (§1), the executed > synthetic ordering for tool data (§2.1), and retrieved-token masking as the mechanism that lets a learned search strategy generalize (§3.2). These are not single-paper claims.
  • Contested, stated as such by the sources themselves: whether recon needs any SFT seed before RL (Nemotron-Tool-N1’s pure-RL-wins result vs. R1-Searcher’s two-stage-reward-no-SFT vs. WebGPT’s imitation-then-rejection-sampling for a much larger action space) — see §3.3. Don’t present “thin seed then RL” as settled; present it as this book’s working rule given the evidence on both sides.
  • Working from the source notes, not a fresh independent search this session — the arXiv ids above were verified live during the research pass the notes themselves record (2026-07-02); this chapter synthesizes rather than re-verifies.
  • Why execution is the training engine, generally: kinds-of-sft.md.
  • Rejection sampling / STaR-family imitation-refinement (the RL-lite mechanism behind the optional RL step in §2.4, and WebGPT’s rejection-sampling stage): methods/imitation.md.
  • Full RL mechanics for search/exploration and long-horizon agentic credit assignment (GRPO, outcome-only reward at depth, retrieved-token masking’s place in the wider RL literature): methods/rl-long-horizon-exploration.md + methods/agentic-rl.md.
  • STaR / hint-guided bootstrapping (thin-seed-then-let-the-model-discover, and the risk of an over-thick seed collapsing exploration): hint-guided-bootstrapping.md.
  • On-policy vs. off-policy as the organizing axis underneath “executed at rollout time” vs. “pre-computed and replayed”: foundations/on-off-policy.md.
  • General method→data framing: method-to-data.md.

Verified arXiv IDs referenced in this chapter

Toolformer 2302.04761 · ToolLLM/ToolBench 2307.16789 · APIGen 2406.18518 · xLAM 2409.03215 · APIGen-MT 2504.03601 · Gorilla 2305.15334 · DocPrompting 2207.05987 · Search-R1 2503.09516 · R1-Searcher 2503.05592 · ToolRL 2504.13958 · Nemotron-Research-Tool-N1 2505.00024 · DeepResearcher 2504.03160 · WebGPT 2112.09332 · TIER 2605.16790. All cross-checked live 2026-07-02 per source notes.

Preference — RLHF · DPO · KTO

Signal = comparisons (A ≻ B). This family exists for the case where you cannot write verify() — “helpful / harmless / on-brand” has no programmatic checker, but a human (or an AI judge) can rank two outputs. Preference is one of three fixed paradigm presets on the canonical on/off-policy axis (the other two are imitation and reinforcement) — see Foundations for the axis itself and Contested edges §6 for why “three independent knobs you toggle / a combinatorial grid” is a retired teaching scaffold: the axes aren’t independent, so what differs across RLHF/DPO/KTO/IPO/ORPO/SimPO is where the pairs come from and how the loss is shaped, not a free combination. Load-bearing property: preference methods reshape ranking over behaviors π_θ can already produce — they inject no new capability (lessons/post-training/dpo-kto-for-agent-tool-selection.md, shared memory). This is grounded in the elicit-not-expand genealogy (RLVR/RL reweights mass already in the base distribution rather than adding new ones — Yue et al., arXiv:2504.13837) and the stronger SFT-memorizes/RL-generalizes anchor (Chu, Zhai et al., arXiv:2501.17161, ICML 2025, 694 citations) — not on the single 0-citation “Scalpel vs. Hammer” preprint (arXiv:2507.10616), whose own authors call their result a “preliminary indication” and which is contested by pushback re-reading the SFT→RL relationship as OOD-forgetting restoration rather than replacement (arXiv:2509.12235); see Contested edges §1.

This chapter is also stage 4/5 of the ordered skeleton (preference opt, after cold-start SFT and rejection-sampling, before/around RLVR) in the recipe is a sequence, one leg of the iterated tail in is the recipe a loop (DPO run N times across rounds, not once), and the T1/T2/T3 tiering in proven-first ranking §3 — read those for where in the pipeline and why start here; this chapter is the what/mechanism.

RLHF (reward model + PPO)

  • What: train a reward model on preference pairs (Bradley-Terry), then optimize π_θ against it with PPO + KL-to-reference (PPO mechanics: Reinforcement). The canonical pipeline is InstructGPT (arXiv:2203.02155).
  • Eats: preference pairs → a learned scalar reward.
  • Still alive in 2026, not dead: Gemini 2.5 runs an explicit Reward-Model + Critic + RL loop (“RLF”, arXiv:2507.06261 §2.4); GPT-5’s sycophancy fix scores conversations and uses that as a training reward (OpenAI GPT-5 system card / model-training page).
  • Gotcha: a learned RM has parameters to exploit → reward hacking. Deterministic verifiers (RLVR) avoid this; see the gameability ladder in Contested edges.

DPO and the direct-preference family

  • What: skip the RM + RL loop — a closed-form loss directly raises logπ_θ(chosen) − logπ_θ(rejected) against a frozen reference, provably equivalent to the RLHF objective under Bradley-Terry (DPO, arXiv:2305.18290). Key hyperparameter: β (KL strength).
  • Eats: (prompt, chosen, rejected) triples.
  • Policy: off-policy by default (pairs usually from another model / earlier checkpoint) — its weakness; iterative/online DPO resamples from current π_θ each round to make it on-policy. Off-policy preference optimization “often suffers from a distributional gap between the policy and the preference data” (arXiv:2406.11827); regenerate the preference pairs from the current checkpoint before each new round rather than reusing stale ones — see is the recipe a loop for the full mechanics and failure mode.
  • Production proof: Llama 3 chose DPO over PPO for its offline preference stage for stability/scalability at their scale, and runs it iteratively (their “iTeC” = rejection-sampling + SFT/DPO/IPO + online RL, several rounds) (arXiv:2407.21783); Llama 2 runs ~6 rounds of SFT+DPO. Qwen2.5 stages an explicit SFT → offline DPO → online GRPO sequence (arXiv:2412.15115).
  • Ordering caveat (contested, not settled): DPO before or after RLVR depends on whether the preference signal and the verifiable-reward signal target the same behavior (fold into one RL stage, à la DeepSeek) or orthogonal behaviors — report quality/style vs. flag-captured — (sequence them, harder-to-specify objective last, à la Tülu 3/Nemotron). Full table: the recipe is a sequence §5. Also: heavy pre-RL DPO is erosive to downstream RL exploration (“SFT and DPO can over-constrain the model, restricting exploration during the online RL stage” — Llama 4 blog); a light, on-policy-anchored DPO pass after RL (Llama 4’s own move) is conditional/safe. See stage ordering & batching and data mixing & forgetting for the dose-dependence.

Variants and their niche

  • KTO (arXiv:2402.01306): learns from unpaired good/bad labels (Kahneman-Tversky value model) — no matched pairs needed. This fits mined agent logs exactly (a pile of failed runs + a pile of clean solves).
  • IPO (arXiv:2310.12036) stabilizes DPO’s tendency to collapse both logprobs at high β; ORPO (arXiv:2403.07691) folds preference into SFT with no reference model; SimPO (arXiv:2405.14734) drops the reference via length-normalized reward.
  • Honest status: DPO is the T1 proven-first pick here (9,399 citations, named in Llama 3’s Herd-of-Models report, Tülu 2/3’s post-bake-off choice, default trainer in TRL/Axolotl/LLaMA-Factory/Unsloth); KTO is T2 — strong conditional fit for unpaired pass/fail logs specifically. IPO/ORPO/SimPO are otherwise niche/T3 — real, used in fine-tuning shops and ablated in Tülu 3 (which explicitly bake-off’d SimPO against DPO-norm and kept DPO-norm), but no Llama/Qwen/DeepSeek/GPT/Claude/Gemini tech report names them as the production choice (survey: arXiv:2503.11701). Plain DPO + iterative DPO are the mainstream ones. Full tier table with citation counts and the “why start with DPO here”: proven-first ranking §3.

RLAIF / Constitutional AI

  • What: replace human preference labels with AI feedback against a written constitution (Constitutional AI, arXiv:2212.08073).
  • Status: mainstream at Anthropic (it is the core method) and partially adopted at Google (Gemini 2.5 safety is “loosely inspired by Constitutional AI”, arXiv:2507.06261). 2026 refinement: Anthropic now teaches the constitution via synthetic document fine-tuning (SDF) → SFT → RL, because “demonstrating desired behavior is insufficient — the model must learn why” (alignment.anthropic.com, “teaching Claude why”, 2026).

Reinforcement — PPO · GRPO · RLVR

Signal = reward / verification. Fully on-policy, online, uses the whole reward landscape (push winners up and losers down). Most powerful, most expensive/unstable. This is the family driving every 2025–2026 reasoning model. Reinforcement is one of three fixed paradigm presets on the canonical on/off-policy axis (the other two are imitation and preference) — see Foundations for the axis itself and Contested edges §6 for why “three independent knobs you toggle / a combinatorial grid” is a retired teaching scaffold: the axes aren’t independent, so what differs across PPO/GRPO/GSPO/DAPO/RLVR is how the advantage is computed and where the reward comes from, not a free combination. In the staged recipe this is the last stage — the recipe is a sequence places RLVR/GRPO after cold-start SFT, rejection-sampling, and preference-opt; proven-first ranking has the T1 pick inside this family (RLVR-via-GRPO); is the recipe a loop? covers revisiting this stage across rounds.

PPO

  • What: clipped-surrogate policy gradient with a value/critic network + KL-to-reference (arXiv:1707.06347).
  • Eats: prompts + a reward (learned RM or verifier).
  • 2026 status: still used for classic preference-RL at the proprietary labs, but declining share for reasoning-RL (the critic is expensive; GRPO/GSPO replaced it there).

GRPO (Group Relative Policy Optimization)

  • What: drop the critic. Sample a group of N completions per prompt; the group mean reward is the baseline; advantage Aᵢ = rᵢ − mean(r) (optionally std-normalized). Introduced in DeepSeekMath (arXiv:2402.03300).
  • Eats: prompts + a reward fn; no fixed target dataset.
  • 2026 status: the reasoning-RL default — DeepSeek-R1’s core algorithm (arXiv:2501.12948), still the base of V3.2’s mixed RL (arXiv:2512.02556).
  • Requirement (project rule): baseline solve rate must sit in 30–60% per prompt-group — all-pass or all-fail groups give zero advantage → zero gradient (llmresearch-handbook.md rule 7; mechanics in handbook.md §10, shared memory).

GRPO successors

  • GSPO (Qwen) [R][L] — the problem with vanilla GRPO/PPO at scale: the token-level importance ratio r_t = π_θ(a_t|s_t)/π_old(a_t|s_t) compounds multiplicatively over a long response, and noisy per-token drift is specifically what destabilizes MoE RL (expert routing shifts mid-rollout, under-policy). GSPO clips at the sequence level instead:

    # GRPO/PPO: one ratio PER TOKEN, clipped per token — variance compounds over length L
    r_t = pi_theta(a_t|s_t) / pi_old(a_t|s_t)
    
    # GSPO: one ratio for the WHOLE sequence (length-normalized geometric mean)
    r_seq = (pi_theta(y|x) / pi_old(y|x)) ** (1 / len(y))
    loss  = -mean(min(r_seq * A, clip(r_seq, 1-eps, 1+eps) * A))
    

    This is Qwen3’s actual stated production RL algorithm (arXiv:2507.18071) — the first GRPO-successor with a flagship behind it, and it gets more relevant, not less, as episodes lengthen: a 100-turn agentic trajectory with tool calls interleaved is exactly the long-sequence regime where token-level ratios drift furthest from 1 by the last token. If a future GRPO/RLVR run on the CTF agent shows training instability, sequence-level clipping is the first thing to try — not more KL-coefficient tuning.

  • DAPO (ByteDance Seed) [E][R][L] — four concrete engineering fixes, not one new algorithm, each independently adoptable as a verl loss-mode flag (arXiv:2503.14476):

    1. Clip-Higher — decouple the PPO clip bounds (eps_low ≠ eps_high, e.g. 0.20 / 0.28 vs. the symmetric PPO-default 0.20/0.20) so a rare-but-good token can gain probability faster than a bad one loses it. Symmetric clipping caps how fast a rare-correct action can ever be reinforced — a direct driver of entropy collapse (below).
    2. Dynamic Sampling — resample any prompt whose whole group of G rollouts is all-correct or all-incorrect (std(group_rewards) == 0 → zero advantage → zero gradient in GRPO) instead of paying for a wasted rollout batch.
    3. Token-level loss — average the policy-gradient loss over every token in the batch, not per-sample-then-averaged, so long correct/incorrect responses aren’t down-weighted relative to short ones. [L] — a credit-assignment fix that matters more the longer responses get.
    4. Overlong reward shaping — a soft length penalty instead of a hard truncation penalty, so a response cut off by the context window isn’t punished as if it were simply wrong.
    eps_low, eps_high = 0.20, 0.28
    ratio   = exp(logp_new - logp_old)
    clipped = clip(ratio, 1 - eps_low, 1 + eps_high)
    loss_pg = -min(ratio * adv, clipped * adv)          # per-token, mean over ALL tokens in the batch
    
    while std(group_rewards) == 0:                       # dynamic sampling
        prompt = resample_prompt()
        group_rewards = rollout_and_score(prompt, n=G)
    

    Mainstream in OSS RL tooling (verl and open GRPO reproductions default to these four fixes) and independently reproduced as a 50-point AIME 2024 result beating R1-Zero-Qwen-32B with half the training steps — one of the few fully open (algorithm + infra + data) large-scale reasoning-RL reproductions. Project rule 7 (GRPO baseline must hit 30–60%) is DAPO’s dynamic-sampling problem, stated as a portfolio-composition constraint instead of a training-loop fallback — keeping the baseline in-band is how you avoid feeding all-pass/all-fail groups into the update in the first place; DAPO’s dynamic sampling is the fallback for whatever still lands there. At ~100 turns per rollout, resampling a whole-group-zero-reward challenge is expensive — prefer upstream curriculum/difficulty filtering (drop challenges outside the 30–60% band) over paying for resamples on genuinely-unsolved-yet challenges.

    Designed to fix a common failure: no-methodology pivoting after one failed attempt, and committing to a single ungrounded guess → Clip-Higher. Agentic policies commonly abandon a promising line of attack after a single setback and default to whichever guess is left standing when no path clearly dominates. Symmetric clipping caps how much probability mass a rare, correct enumeration branch (or a well-grounded, as opposed to lucky, guess) can ever accumulate — which is precisely what narrows a policy onto one brittle script. See Exploration and entropy below for the mechanism this is patching.

  • Dr. GRPO [R][E] — a smaller, easy-to-miss companion fix: vanilla GRPO’s per-sample length- and std-normalization secretly rewards longer wrong answers and shorter right ones (an optimization artifact, not a real preference). Fix is a two-line change — drop the 1/|response| length term and the group-std division, keep only A = r − mean(r) (arXiv:2503.20783). Matches or beats vanilla GRPO’s accuracy at the same compute while removing the length-inflation drift. For a 100-turn agent this bug has a much bigger attack surface than a single-turn math answer: a policy trained on the unfixed objective can learn to “look busy” (extra tool calls, redundant enumeration) after a wrong guess without the enumeration being useful — nearly indistinguishable from legitimate PTES-style enumeration unless you’re specifically checking for it.

RLVR (RL with Verifiable Rewards)

  • What: GRPO/PPO where the reward is a deterministic verifier (unit tests, math checker, flag check) rather than a neural RM. No parameters to game.
  • Eats: prompts + a verify(state) → {0,1} function. This is your setup — the CTF flag verifier is a textbook verifiable reward.
  • 2026 status: arguably the defining technique of the era. Every reasoning model (o1/o3, R1, Gemini-thinking, Qwen3, Kimi) scales RL against verifiable/rule-based rewards as the capability driver; Gemini 2.5 explicitly allocates increased RL compute to “verifiable rewards” (arXiv:2507.06261; OpenAI “Learning to reason with LLMs”; R1, arXiv:2501.12948).

Exploration and entropy: the GRPO graduation trigger

Cybersecurity is exploration — every technique in the PPO/GRPO/GSPO/DAPO family above is [E]-tagged, and entropy collapse is what turns “graduate SFT → GRPO/RLVR” from a vague heuristic into a measurable trigger. The graduation trigger, precisely stated: don’t wait for the reward curve to plateau — watch mean(entropy); once it’s tracking toward the flat part of the fitted collapse curve, more rejection-sampling-SFT epochs on the same policy distribution won’t move the needle (you’re re-sampling an already-narrowing distribution) — that’s the signal to graduate to GRPO/RLVR. Full mechanism (the fitted law, the covariance driver, Clip-Cov/KL-Cov, the clip-asymmetry result, high-entropy minority tokens, ProRL’s boundary-expansion evidence, and the amplify-vs-elicit contested-edges reconciliation): Long-horizon & exploration RL §2.1–2.7.

Everything past this point — pass@k as a training signal, diversity/curiosity/count-based intrinsic rewards, parameter-space noise for temporally-coherent exploration, tool-call-sequence diversity as the project’s own novel opportunity, and the full turn-level/step-level credit-assignment literature for the ~100-turn setting — is covered in depth in the dedicated long-horizon and exploration-sweep chapters, and in Agentic & multi-turn RL for the multi-turn training-loop shape itself. Read this section for the graduation trigger; read those for the harder credit-assignment and boundary-expansion questions once you’re past the initial DAPO-recipe GRPO baseline.

The reward-model question (PRM vs outcome/rubric)

  • PRM (process reward, dense step-level) — score each reasoning step (Lightman et al., arXiv:2305.20050). Niche / avoided in production: DeepSeek explicitly rejected PRM for R1 due to step-level reward hacking (arXiv:2501.12948).
  • Outcome verifier + rubric/critic grading — the real 2026 answer to “what replaced PRM”: not dense step rewards, but LLM-judge/rubric-based outcome grading. Gemini’s “Critic” (prompted rubric grader, arXiv:2507.06261) and OpenAI’s RFT “model grader” are both this in production. Your deterministic flag verifier is the ungameable end of this spectrum — keep it there (gameability ladder in Contested edges).

When to reach for RL

An execution gap where rejection-sampling FT has plateaued (entropy collapsed), and you want the negative-sample gradient + online updates. Cost: online rollout infra, reward plumbing, KL control, instability, and the train↔inference precision mismatch (its own rabbit hole — see the shared memory note research/fp8-quantization-mechanics-training-serving.md).

This is not a one-shot decision. Is the recipe a loop? covers revisiting GRPO/RLVR across rounds (continue-from-checkpoint vs. restart-from-base, loop-exit criteria); ordering rules covers where a DPO/preference stage sits relative to this one and whether SFT applied afterward erodes the RL gains; data mixing & forgetting covers what happens to reasoning traces when RL-stage output gets mixed back into later SFT rounds; and proven-first ranking is the concrete tier table for picking an optimizer inside this family (GRPO/RLVR T1, PPO/DAPO T2 fallbacks, GiGPO/GTPO T3/T4 watch-list).

Agentic & multi-turn RL — the missing category

This is the category that was absent from the first pass of “the major methods,” and it’s the one that matters most for you, because a CTF agent is exactly this shape. It is not a new update rule — it still runs on GRPO/PPO/GSPO-family gradients — it’s a new training-loop shape: RL over multi-turn trajectories with live tools/environments in the loop (browser, code sandbox, MCP servers), instead of single-shot verifier-scored completions.

What changes vs. single-shot RLVR

  • The rollout is an episode of tool-use, not one generation. Reward often arrives only at the end (flag captured / task complete) → a credit-assignment problem: which turn or tool-call earned the win or lost the run?
  • The “dataset” is a live environment service, not a static file. You need rollout orchestration (sandboxes, tools, resets), not a JSONL.
  • This is precisely the project’s “RL envs are the moat” thesis (lessons/post-training/rl-envs-as-moat-between-providers.md, shared memory) — now independently corroborated as the frontier bet.

Verified production evidence (2026)

  • OpenAI Deep Research (o3-based): “trained using end-to-end reinforcement learning on hard browsing and reasoning tasks” — a shipped product doing agentic RL over live tool use (openai.com/index/introducing-deep-research).
  • Kimi K2 (Moonshot, open-weight 1T/32B-active MoE): headline post-training is a large-scale agentic data-synthesis pipeline + joint RL, where simulated tool environments generate the rollouts RL trains on (Kimi K2 tech report).
  • Kimi K2.5 (2026): Agent Swarm trained with Parallel Agent Reinforcement Learning (PARL) — RL over cooperating multi-agent trajectories. This is the current frontier edge (Kimi K2.5 tech blog, 2026).
  • Gemini 2.5: RL environments explicitly extended to “multi-step actions and tool use” (arXiv:2507.06261 §2.4).
  • Anthropic: a 2026 lesson that safety training from chat-RLHF failed to generalize to agentic/tool-use settings, forcing explicit diversification into agentic environments (alignment.anthropic.com, “teaching Claude why”, 2026). Directly relevant: capability and alignment now have to be trained in the agentic loop, not chat.

What this means for your build

  • Your harness already is the environment. The engineering surface is (a) a clean verify(state)→{0,1} reward read from real environment state (not the transcript — see the confabulation gotcha in Contested edges), and (b) rollout orchestration to keep N episodes in flight.
  • Start where credit assignment is trivial (outcome-only flag reward on a solvable band), i.e. rejection-sampling FT → GRPO/RLVR on your own multi-turn trajectories, before reaching for dense per-turn shaping.

What is not mainstream yet

  • Self-play (self-generated curricula / self-critique-as-opponent) appears only in niche academic work as of this pass — no confirmed frontier-lab production use. Watch, don’t bet.

Turn-level vs. trajectory-level credit assignment

Everything below exists because naively lifting GRPO/PPO from single-turn math/code RL to a ~100-turn tool-using agent breaks two assumptions simultaneously: (1) the “trajectory” is now dozens of LLM-generation turns interleaved with environment/tool observations, not one generation; (2) reward is terminal-only (flag verified or not) — so the vanilla group-mean baseline conflates credit across every turn equally, rewarding/penalizing an early exploratory enumeration turn exactly as much as the final exploit turn.

flowchart TB
    subgraph Trajectory-level GRPO baseline
    A1["turn 1<br/>enumerate"] --> A2["turn 2<br/>probe"] --> A3["...turn 60..."] --> A4["turn 61<br/>exploit"] --> A5["flag: 0/1"]
    A5 -- "one advantage,<br/>broadcast to all turns" --> A1
    A5 --> A2
    A5 --> A3
    A5 --> A4
    end
flowchart TB
    subgraph Turn-level credit GiGPO / turn-PPO family
    B1["turn 1<br/>enumerate"] --> B2["turn 2<br/>probe"] --> B3["...turn 60..."] --> B4["turn 61<br/>exploit"] --> B5["flag: 0/1"]
    B5 -- "episode advantage macro" --> B1
    B4 -- "step/turn advantage micro<br/>via state-hash or turn-value" --> B4
    end

One-line idea: GRPO (arXiv:2402.03300, DeepSeekMath, 2024-02-05) replaces PPO’s learned critic with a group-mean baseline over N samples of the same prompt — cheap, no critic, but implicitly one-reward-per-generation. GAE (arXiv:1506.02438, 2015-06-08) is the classical mechanism for trading bias/variance in the advantage estimate across a single trajectory’s timesteps — built for one agent-environment stream, not turn-vs-token double granularity. Full method table (with your reinforcement chapter’s GRPO/GSPO/DAPO baseline) below.

GiGPO — step-level advantage with zero extra rollouts [L] [E]

arXiv:2505.10978 (Feng, Xue, Liu, An; 2025-05-16, NeurIPS 2025 poster).

  • Problem: vanilla GRPO computes one advantage per whole trajectory — a good early enumeration step and a lucky late guess get identical credit.
  • Key idea: two nested groupings. (1) Episode-level group — N full rollouts, GRPO-style trajectory advantage (macro: “was this whole run good?”). (2) Step-level group — hash each (state, step) pair, bucket steps that recur across trajectories into anchor groups, compute a second advantage from “what happened next” conditioned on that shared state (micro credit) — no new network, no extra rollouts.
  • Loop delta: after collecting the usual GRPO batch, add a step-indexing pass → advantage = episode_advantage + λ · step_advantage → feed into the same PPO-clipped update.
  • Hyperparameters that matter: state-hashing granularity (too coarse → false matches; too fine → anchor groups collapse to size 1) and the mixing weight λ.
  • Gotcha for CTF: built for hashable/discrete states (web pages, grid cells). A CTF agent’s state is unbounded free text (shell stdout, HTTP bodies) — you need a canonicalization step, e.g. hash on (tool_name, normalized_target, response_status_class) rather than raw text, or anchor groups never fire.

Designed to fix a common failure: uneven phase execution → step-level credit assignment. Agentic-RL runs commonly stall in the exploitation phase relative to enumeration/recon — a flat trajectory-level advantage rewards every turn identically, diluting exactly the steps that decide the run. Step-level credit is the mechanism that fixes this.

Given the harness already emits structured tool_call/tool_exec_ms spans (harness-observability-contract-2026-06.md), a state key from those spans is the cheapest first transplant in this whole chapter — no critic, no infra, just a canonicalization function.

ArCHer — the two-time-scale ancestor [L]

arXiv:2402.19446 (Zhou, Zanette, Pan, Levine, Kumar; 2024-02-29).

  • Key idea: a hierarchy — a turn-level off-policy critic (TD-learned, “how good is this utterance given the conversation-so-far”) and a token-level on-policy policy gradient bootstrapped off that turn value instead of only the final episode reward. Decouples “which turn was good” (dozens of decisions) from “which token was good” (thousands).
  • Ablation that matters: the sample-efficiency gap over flat single-critic baselines widens with horizon length — the regime you’re in.
  • Gotcha: off-policy turn-level value learning reintroduces the value-overestimation instability the project’s no-critic GRPO preference was designed to avoid. Treat ArCHer as the theoretical justification for “turn is the right unit,” not a recipe to implement wholesale — prefer GiGPO’s critic-free step-grouping or Verlog’s dual-discount GAE (below) for the same decomposition without a learned off-policy critic.

RAGEN / StarPO — naming the collapse [E] [L]

arXiv:2504.20073 (Wang et al.; 2025-04-24).

  • What it is: a diagnostic framework, not primarily a new algorithm. StarPO formalizes trajectory-level agent RL over whole (state, think, action, reward) rollouts, then uses the RAGEN testbed to empirically show what breaks when you train “the naive way.”
  • Central finding — the “Echo Trap”: the policy’s reasoning traces converge to a small set of repeated, low-diversity patterns that keep scoring reward on the training distribution while generalization/exploration collapses. This is entropy collapse, named and reproduced across four stylized environments — not a one-off.
  • Fix pattern reported: reward normalization across turns (so no single dominant reward source drowns out exploration signal) + explicit rollout-diversity interventions, triggered by monitoring entropy/reward-variance, not epoch count.

Designed to fix a common failure: react-and-guess, no methodology → entropy-aware RL. Agents commonly pivot away from a failed approach without systematic enumeration, converging to a narrow guess-repertoire; an entropy-collapsed policy is one direct explanation for that behavior.

This is the citation for the project’s own stated plan — “watch policy entropy as the trigger to graduate from SFT to GRPO.” Concretely: instrument per-turn action-entropy (or a diversity metric over tool-call sequences) during RL and treat a converging curve as the operational graduation/intervention signal, mirroring RAGEN’s diagnosis instead of re-deriving it live mid-run. See also reinforcement.md’s “Exploration and entropy” section for the DAPO Clip-Higher / Dr. GRPO mechanisms that patch this at the single-turn level — RAGEN is the multi-turn-specific diagnosis of the same underlying failure.

The 2025–26 turn-level GRPO-variant cluster [L] [E]

A fast-moving cluster of near-simultaneous papers attacking the same problem — “turn is the unit of advantage, not trajectory or token” — with distinct mechanisms. Treat as one converging-consensus finding, not N competing final answers; none individually crosses into [N] (they refine existing capability rather than expand the boundary).

PaperarXivMechanismConfidence
Turn-Level Reward Design & Credit Assignment2505.11821Dense per-turn reward terms layered on the terminal outcome rewardPromising
Turn-PPO2512.17008Argues GRPO’s group-relative clip “exposes notable limitations” at long horizon; goes back to a per-turn PPO value functionPromising
TL-GRPO2601.16480Turn credit for same-state-revisited tasks (iterative code repair); narrower than general multi-turnPromising
A2TGPO2605.06200Adaptive per-turn clip range — early vs. near-terminal turns have different advantage-magnitude distributionsPromising
Proximity-Based MTO2602.19225Weight credit by task difficulty, not just turn positionPromising
GAGPO2605.13217GAE-style λ-discounted advantage synthesized into GRPO’s group-relative frameworkPromising

What this means for the CTF agent: don’t pick one paper as “the” answer — prototype the cheapest shared mechanism first: GiGPO’s step-grouping (zero extra infra) or a straightforward per-turn shaping term (2505.11821’s approach) before reaching for a second value network (Turn-PPO / TL-GRPO). Given the project’s ground-truth-only reward constraint (see below), any dense intermediate signal must stay a shaping term added to, not a replacement of, the terminal verifier reward.


Reward shaping for a sparse terminal reward — without reopening the confabulation bug

The project already has a hard rule: reward must be ground-truth flag-verified, never format/regex-matched — SFT-induced FLAG{} confabulation was a real observed failure (lessons/post-training/sft-induced-flag-confabulation.md). Every reward-shaping idea in this section has to be read through that constraint.

  • Keep the terminal signal as ground truth, add density, don’t replace it. The turn-level cluster above (2505.11821 in particular) explicitly diagnoses that “sparse outcome rewards… lack dense intermediate signals across multiple decision steps” — the fix is injecting per-turn shaping alongside the verifier, e.g. reward tool-call progress (new open port found, new endpoint discovered, new credential recovered) as a small dense bonus, while the flag check remains the only source of the large terminal reward. A shaped proxy that can be gamed (e.g. “reward finding any string that looks like a flag”) reopens exactly the confabulation failure already logged — the shaping term must be read from verifiable environment state, same discipline as the terminal check.

  • Mask tool/environment output tokens from the policy-gradient loss. Search-R1 (arXiv:2503.09516) masks retrieved-content tokens out of the loss — you don’t want to reinforce/penalize text the environment produced, only the model’s own query/action-generation tokens. Direct transplant, not optional: shell stdout, HTTP response bodies, scan output must never enter the policy-gradient loss, only the agent’s own tool-call arguments and reasoning tokens. Easy to miss when standing up a GRPO/RLVR loop on top of an SFT-warmed policy — this is a correctness bug, not a design choice.

    Designed to fix a common failure: tool-avoidance → RL over tool selection. Agents commonly default to raw shell/HTTP calls over a provided higher-level tool surface — a well-documented, gameable preference driven by pretraining priors rather than tool capability (Faghih et al., “Tool Preferences in Agentic LLMs are Unreliable,” arXiv:2505.18135, 2025-05-23: edited docstrings alone shift usage >10x with zero change in tool capability). Search-R1 is direct evidence that RL specifically over which tool/query to issue is tractable in a comparable regime (search-engine calls) — supports RL (not just better docstrings/prompting) as the lever for tool-avoidance.

  • Bootstrap a value estimate at truncation instead of reward = 0. Verlog (below) proposes trajectory early truncation with a value-function bootstrap rather than waiting for the terminal reward — directly relevant since episodes cap at ~100 turns: today a hard timeout presumably returns zero reward for a run that made real, unfinished progress. Recovering partial-progress signal from failed-but-in-progress attempts is a second lever on the same sparse-terminal-reward problem, distinct from per-turn shaping.

  • Plan exploration as its own object. PEARL (arXiv:2601.20439) treats which tools, in what order as something to explore/RL over, not just the final answer.

    Designed to fix a common failure: no methodology / weak enumeration → plan exploration. “Plan exploration” is a formal mechanism for rewarding systematic tool-sequencing instead of react-and-guess.


Why a 100-turn CTF is the hard case

Stack the constraints and the difficulty compounds — this is the “hard case” every technique above is implicitly being stress-tested against:

ConstraintWhy it bites at ~100 turnsTechnique that targets it
Reward is terminal-onlyCredit for the winning exploit turn gets diluted across ~100 turns of a flat trajectory-level advantageGiGPO, turn-level cluster
Unbounded free-text state (shell/HTTP, not pixels/grid)State-hashing methods built for discrete environments (web pages, grid worlds) don’t transplant for freeGiGPO — needs a bespoke canonicalization step
Variable episode lengthBatched training wastes GPU cycles on padding/idle time when some rollouts finish in 10 turns and others run to 100Verlog’s early truncation
Long context growing every turnFull transcript in every prompt overloads context retrieval well before turn 100Verlog’s customizable agent memory (windowed history)
On-policy exploration required, but entropy collapses under naive multi-turn RLThe “Echo Trap” — repeated low-diversity patterns keep scoring reward while exploration diesRAGEN/StarPO’s entropy-as-trigger diagnosis
Exploitation, not enumeration, is often where agentic-CTF runs stallA flat advantage rewards enumeration and exploitation turns identically, so neither gets a sharpened gradientGiGPO step-groups

Verlog — the only technique benchmarked past 100 turns [L] [E]

No arXiv id — OpenReview only (NeurIPS 2025 MTI-LLM workshop poster, openreview.net/forum?id=GmodkWwMV3) + project blog (wentsechen.github.io/Verlog_blogpost), Chen/Chen/Zhu/Schneider. Confidence: Promising — cite via OpenReview, do not fabricate an arXiv id.

Three mechanisms, all aimed at the “three failure modes of long-horizon agentic RL” the paper names explicitly: overloaded context, sparse terminal reward, variable trajectory length wasting GPU cycles.

  1. Customizable agent memory — a flexibly-sized history window per turn, decoupling “how much context the policy sees” from “how many turns the episode has run.”
  2. Dual-discounting GAE — two separate discount factors, γ_step (turn-to-turn credit decay) and γ_token (within-turn token credit decay), instead of one GAE discount applied uniformly. Direct generalization of ArCHer’s two-time-scale idea, implemented inside GAE instead of a separate off-policy critic.
  3. Trajectory early truncation — cuts long rollouts short during training and substitutes a value-bootstrap for the missing terminal reward, to cut GPU idle time from variance in episode length.

Scale claim: the blog states prior frameworks (VeRL, RAGEN) handle ~10-turn tasks, verl-agent scales to ~50, and Verlog targets 400+ turn episodes (Crafter, 70–400 steps, avg ~190) — the only technique in this thread validated longer than your ~100-turn ceiling.

What I’d change in your pipeline: the dual-discounting GAE split (γ_step vs γ_token) is a single hyperparameter change layered onto whatever advantage code the training loop already has, no new critic beyond what GAE needs — the most directly answerable “what would you change” in this whole file. Flag honestly: workshop-poster + blog source, not a peer-reviewed arXiv preprint.


The RL-framework landscape (verl-agent / VerlTool / RAGEN)

Framework choice is an infra decision, not a research-finding one — flagged here because it gates which of the mechanisms above you can actually run without building rollout orchestration from scratch. Cross-reference against the harness/GPU-economics material once the framework-choice chapter from this research sweep lands (see cross-links below).

  • verl-agent (github.com/langfengq/verl-agent) — open-source agent-RL extension of veRL. No standalone arXiv paper; cite as infra, not a research claim. Scales to ~50-turn tasks per Verlog’s own comparison.
  • VerlTool — “Towards Holistic Agentic Reinforcement Learning with Tool Use” (arXiv:2509.01055) — surfaced in this research pass but not independently abs-page-verified; confirm before citing as settled.
  • RAGEN (github.com — see StarPO above) — the modular multi-environment testbed the Echo Trap diagnosis was built on; useful as a reference implementation for entropy/diversity monitoring, not just the paper.
  • “Demystifying RL for Long-Horizon Tool-Using Agents” (arXiv:2603.21972, Wu et al., 2026-03-23) [L] [R] — the closest thing to a systematic “what to tune first” ablation study, decomposing the design space along 5 axes: reward shaping, model scaling, data composition, algorithm selection, environment design. Use this axis framing when triaging which lever to pull first on your own pipeline. Confidence: Promising (0 citations, <4 months old at verify-time, but methodologically the most comprehensive single source found).

Domain-adjacent: RL for CTF / pentesting agents directly

Academic, cited for context — not a basis for our decisions. CTF-Dojo, Pentest-R1, STRIATUM-CTF, and HackSynth are academic domain-specific CTF/pentest training or benchmark papers; none produced a frontier cybersecurity model, so none of them is load-bearing for any conclusion, recipe, or number below — they’re listed only so the researcher knows what already exists in the academic literature before presenting a technique here as novel.

  • CTF-Dojo (arXiv:2508.18370, Zhuo et al., 2025-08-25) [R] — “the first large-scale executable runtime tailored for training LLMs with verifiable feedback” for CTF-style tasks: 658 Docker-containerized challenges with ground-truth verified feedback. Context only — see re-grounding below for why verifier-grounded execution environments are the right substrate.
  • Pentest-R1 (arXiv:2508.07382, He Kong et al., 2025-08-10) [L] [R] — two-stage RL pipeline for autonomous pentesting reasoning, trained on 500+ real-world multi-step walkthroughs. Context only, unread beyond abstract — do not use it to lock the project’s own reward-shaping design; if a reward-design decision needs a citation, it must come from the general RLVR/reward-shaping literature (Ng/Harada/Russell potential-based shaping, PURE/MONA reward-hacking literature) or this project’s own measured data, not from Pentest-R1.
  • STRIATUM-CTF (arXiv:2603.22577, Hugglestone et al., 2026-03-23) [R] — MCP-standardized agentic framework for general-purpose CTF solving, targeting “multi-step, stateful reasoning” as the gap static benchmarks miss. Context only — it does not itself do turn-level RL and is not used here to justify GiGPO’s design (that justification stands entirely on GiGPO’s own paper, arXiv:2505.10978, which motivates state-hashed step-groups from first principles, no CTF-specific evidence required).
  • HackSynth (arXiv:2506.02048, Muzsai, Imolai, Lukács, 2025-06-01) [R] [E] — fine-tunes a tool-augmented Llama-3.1-8B via vanilla, trajectory-level GRPO on a procedurally-generated crypto-CTF dataset. Context only — not used as evidence for the “start with vanilla GRPO” recommendation below; that recommendation is re-grounded independently.

Re-grounded recommendation (start vanilla, add turn-level machinery only if needed): this is supported by the general empirical ablation in “Demystifying RL for Long-Horizon Tool-Using Agents” (arXiv:2603.21972, already cited above, domain-general not CTF-specific), whose 5-axis decomposition (reward shaping, model scaling, data composition, algorithm selection, environment design) treats algorithm choice as one axis to tune after establishing a working baseline — plus this project’s own handbook rule that GRPO baseline must first land in the 30–60% signal band (memory/handbook.md §10) before any additional machinery is justified. Re-grounded substrate claim: that verifier-grounded execution environments (not format/regex reward) are the right substrate is this project’s own confirmed constraint, not an inference from CTF-Dojo — see the ground-truth-flag-verified rule and the SFT-induced FLAG{} confabulation failure (lessons/post-training/sft-induced-flag-confabulation.md), which is the actual basis.

The live gap: no paper in this pass demonstrates turn-level credit assignment (GiGPO/Verlog-class) applied to an offensive-security/CTF domain specifically. Transplanting GiGPO/Verlog mechanisms to CTF is this project’s own contribution to make, not something to find pre-solved — and, per the standing rule, not something to validate by reference to the academic CTF papers above.


Tool-integrated reasoning RL: ReTool, ToRL, Search-R1

These three share a mechanism — RL over an interleaved reason+tool-call+observation loop — but differ in domain (math/code-interpreter vs. search). Relevant because the harness is a tool-integrated-reasoning loop (shell, HTTP, scanning tools).

  • ReTool (arXiv:2504.11536, Feng et al., 2025-04-15) [R] [E] — interleaves real-time code-interpreter execution inside the reasoning trace, and trains the interleaving policy with RL. The rollout is no longer “generate full CoT then maybe call a tool” — the policy learns when to interrupt its own reasoning to invoke a tool and resume conditioned on the result; credit must flow through that interruption boundary. Domain is math — direct transplant to CTF tool-calling (when to run curl vs. reason further) is analogous but unvalidated in this domain.
  • ToRL (arXiv:2503.23383, Li, Zou, Liu, 2025-03-30) [E] [N]the strongest [N] citation in this thread: pure RL (no SFT-on-tool-traces warmup) teaches autonomous tool invocation and reports emergent strategic tool-use behaviors absent from the SFT-only baseline, beating the best tool-integrated-reasoning model on AIME’24 by double digits. This is the same RL-amplifies/SFT-injects distinction grounded in the elicit-not-expand genealogy (Yue et al., arXiv:2504.13837, NeurIPS 2025 Best Paper Runner-Up) and the stronger, higher-citation “SFT Memorizes, RL Generalizes” anchor (Chu, Zhai et al., arXiv:2501.17161, ICML 2025, 694 citations) — not the single, contested, 0-citation “Scalpel vs. Hammer” preprint (arXiv:2507.10616; its own authors call the result a “preliminary indication”; see Contested edges §1 & §6) — but pushed further: RL-from-scratch surfacing qualitatively new patterns is closer to boundary-expansion than amplification. Domain is math tool-use (Python), not offensive security — treat the emergent-behavior claim as suggestive, not proven, here.
  • Search-R1 (arXiv:2503.09516, Jin et al., 2025-03-12) [R] [E] — the loss-masking detail (mask tool/environment output tokens from the policy gradient) covered above under reward shaping; also direct evidence that RL over tool/query selection is tractable — the fix for the tool-avoidance failure mode above.

Domain gap to flag honestly: all three are validated in math/search domains with much shorter tool-call chains than a 100-turn CTF episode — the mechanism (interleave, mask, learn-when-to-call) transfers; the specific hyperparameters (how often to call, reward magnitude per call) don’t, and need re-deriving on your own verifier-based reward.


Summary table

The four rows below marked “context only” (CTF-Dojo, Pentest-R1, STRIATUM-CTF, HackSynth) are academic domain-specific CTF/pentest papers — cited for landscape awareness, not as a basis for any conclusion/recipe/number in this file (see re-grounding above).

TechniquearXiv (verified unless noted)TagsFailure mode targetedConfidenceOne-line takeaway
GRPO (baseline)2402.03300[L]VerifiedGroup-mean baseline, no critic — trajectory-level only
GAE (baseline)1506.02438[L]VerifiedClassical multi-step advantage; single time-scale
GiGPO2505.10978[L][E]exploitation-stallVerifiedStep-level advantage via state-hash groups, zero extra rollouts
ArCHer2402.19446[L]VerifiedTurn-level off-policy critic + token-level on-policy — heavier infra
RAGEN / StarPO2504.20073[E][L]no-methodology / pivotingVerifiedNames & diagnoses the “Echo Trap” entropy collapse
Turn-Level Reward Design2505.11821[L][E]exploitation-stallPromisingDense per-turn reward layered on sparse terminal reward
Turn-PPO2512.17008[L]PromisingArgues PPO turn-value beats GRPO group-baseline at long horizon
TL-GRPO2601.16480[L]PromisingTurn credit for same-state-revisited (iterative) tasks
A2TGPO2605.06200[L]PromisingAdaptive per-turn PPO clip range
Proximity-Based MTO2602.19225[L]PromisingWeight credit by task difficulty, not just position
GAGPO2605.13217[L]PromisingGAE-style generalized advantage inside GRPO grouping
Verlogno arXiv — OpenReview[L][E]PromisingDual-discount GAE + memory-windowing + early truncation; 400+ turn scale
Demystifying RL for Long-Horizon Tool Agents2603.21972[L][R]Promising5-axis empirical recipe: reward/scale/data/algorithm/env
PEARL2601.20439[E][R]no-methodology / pivotingPromisingRL over the planning/tool-sequencing step itself
ReTool2504.11536[R][E]VerifiedInterleaved code-exec reasoning, RL over interruption points
ToRL2503.23383[E][N]VerifiedRL-from-scratch surfaces emergent tool-use strategies
Search-R12503.09516[R][E]tool-avoidanceVerifiedMask tool-output tokens from policy-gradient loss
CTF-Dojo (context only)2508.18370[R]Verified, academic — not a basis658-challenge verifier-grounded CTF RL environment
Pentest-R1 (context only)2508.07382[L][R]Verified (needs deeper read), academic — not a basisTwo-stage RL for pentest reasoning
STRIATUM-CTF (context only)2603.22577[R]exploitation-stallPromising, academic — not a basisMCP-standardized stateful CTF agent framework
HackSynth (crypto CTF) (context only)2506.02048[R][E]Verified, academic — not a basisVanilla GRPO already works on narrow (crypto) CTF
VerlTool2509.01055Unverified (flag before citing)Holistic agentic-RL-with-tool-use framework

Open questions for the next research pass

  1. No paper in this pass demonstrates turn-level credit assignment (GiGPO/Verlog-class) applied to an offensive-security/CTF domain specifically — transplanting these mechanisms to CTF is this project’s own contribution to make, not something to find pre-solved.
  2. Verlog has no arXiv paper — only an OpenReview NeurIPS-workshop submission and project blog. Cite the OpenReview id, not a fabricated arXiv id, and flag it as workshop-tier evidence.
  3. VerlTool (arXiv:2509.01055) surfaced in search but was not independently verified via abs-page crawl — confirm before citing as settled.
  4. Pentest-R1’s exact reward/credit design was not deep-dived here (abstract only). Per the project’s standing rule, it is context/landscape awareness only, never a basis for the project’s own reward-shaping design — that design must be re-grounded on general RLVR/reward-shaping theory or this project’s own measured data, not on Pentest-R1 or any other academic CTF/pentest paper.

  • Reinforcement — PPO · GRPO · RLVR — the base algorithm (and its own “Exploration and entropy” section — DAPO Clip-Higher, Dr. GRPO) every technique in this chapter modifies or wraps. Also the home of ProRL’s [N] boundary-expansion evidence, which conditions how strongly to read ToRL’s emergent-tool-use claim above.
  • RL that creates value — long-horizon · exploration · reasoning · novelty — the deeper, tagged sweep of the same turn-level-credit-assignment / entropy-collapse / tool-avoidance material this chapter introduces; start here for the training-loop shape, go there for the full technique catalog, the [N] novelty evidence, and the reward-hacking cluster.
  • Imitation — SFT · rejection sampling — the pre-RL stage this project runs first; RAGEN’s Echo Trap is precisely the risk that activates once you graduate past it.
  • The recipe is a sequence, not a pick — where agentic RL slots into the overall SFT→RL staging order, and why you can’t RL-amplify a capability the earlier stages never injected.
  • Is the recipe a loop? — whether/how the SFT↔GRPO graduation this chapter assumes (§“What this means for your build”) repeats across cycles rather than running once.
  • Ordering rules: interleaving stages & fixing N problems — batching/interleaving guidance for the rejection-sampling→GRPO handoff referenced throughout this chapter.
  • Data mixing, ratios & not forgetting how to think — the SFT-corpus-as-off-policy-anchor question this chapter’s reward-shaping section leans on.
  • Start here: a proven-first ranking of the methods — where GRPO/GiGPO/agentic-RL rank against imitation/preference on proven-by-adoption grounds, not novelty.
  • Contested edges & landmines — the flag-confabulation gotcha, the RFT terminology trap, the retired “three independent knobs you toggle” teaching scaffold (§6 — the canonical framing is the single on/off-policy axis plus fixed imitation/preference/reward presets, not a combinatorial grid), the turn-vs-trajectory-vs-sequence credit-assignment fight (§8), and the “RL can’t create capability” debate that ToRL’s [N] evidence bears on directly (§1, §9).
  • Frontier recipes — Kimi K2.5’s PARL and OpenAI Deep Research’s end-to-end agentic RL, cited above as production evidence, are detailed there per-lab.
  • Framework-choice / GPU-economics chapter: no dedicated chapter exists yet for the verl-agent/VerlTool infra choice as of this pass — the closest current material is the RL-framework-landscape section above and proven-first-ranking.md’s GiGPO row; wire a direct link here once such a chapter lands in SUMMARY.md.

RL that creates value — long-horizon, exploration, reasoning, novelty

The other method pages (Reinforcement, Agentic & multi-turn RL) cover which algorithm (PPO/GRPO/GSPO) and what training-loop shape (single-shot vs. multi-turn-with-tools). This page is the tagged sweep of what actually makes RL pay off for a 100-turn, tool-using, verifier-rewarded CTF agent that already has an execution gap (capability present, unreliable) rather than a knowledge gap. Every technique below is filed under the axis it serves, cross-referenced to the commonly-observed agent execution-failure patterns it targets (see Contested edges & landmines), and cited only where the arxiv id was verified live (crawled arxiv.org/abs/<id> on 2026-07-02).

Legend

TagAxisWhy it matters here
[L]Long-horizon / credit assignmentEpisodes run to ~100 turns, reward is usually terminal-only (flag verified or not) — plain trajectory-level advantage smears credit across every turn equally.
[E]Exploration / entropy preservationCybersecurity is search/enumeration. Entropy collapse = the policy commits early to one narrow script and stops trying alternatives.
[R]Reasoning / test-time computeMulti-step vuln chaining, deciding what to try next, allocating turns to hard vs. easy phases.
[N]Novelty / boundary-expansionEvidence the technique expands what the policy can do at all (finds attack paths the base model never finds at any k), not just amplifies what’s already samplable.

Baseline context this sweep assumes: GRPO (critic-free, group-mean baseline, arXiv:2402.03300) and GAE (classical single-trajectory multi-step advantage, arXiv:1506.02438) are what everything below is patching. Vanilla GRPO/PPO assume one reward at the end of one generation — a 100-turn tool-using episode breaks that on two axes simultaneously: the “trajectory” is now dozens of interleaved generation-turns + environment observations, and reward is terminal-only, so the group-mean baseline credits/blames every turn identically regardless of whether it was an exploratory enumeration step or the exploit-landing step.

Reward-shaping guardrail (applies to every [L] technique below): any dense, per-turn, or process-level reward introduced to fix credit assignment must be a shaping term added on top of, not a replacement for, the terminal ground-truth flag verification. This project’s confirmed lesson — SFT-induced FLAG{} confabulation from a loose regex reward — is exactly the failure mode that reopens if a proxy signal gets promoted to primary reward. See the reward-hacking cluster in §3.4.


1. Long-horizon / credit assignment for agents [L]

1.1 GiGPO — step-level credit with zero extra rollouts

arXiv:2505.10978 (Feng, Xue, Liu, An; 2025-05-16; NeurIPS 2025 poster). Two nested grouping levels instead of GRPO’s one: the usual episode-level group (N full rollouts, trajectory advantage as before) plus a step-level group — retroactively hash (state, step) pairs, bucket steps that recur across rollouts at the same environment state, and compute a second advantage from “what happened next” conditioned on that state. No new critic, no extra rollouts — pure post-hoc bookkeeping on trajectories you already sampled.

# after collecting the usual GRPO batch of N trajectories
key = lambda s: (s.tool_name, normalize(s.target), s.response_status_class)  # state canonicalization
anchor_groups = bucket_by(key, all_steps_across_trajectories)
step_adv = {step: advantage_within(anchor_groups[key(step)]) for step in all_steps}
advantage = episode_advantage + lam * step_adv[step]     # combine before the clipped PG update

Designed to fix a common failure: uneven effort across PTES phases — agents often stall in the exploitation phase despite strong recon/enumeration earlier on. Step-level credit stops rewarding all 100 turns equally when only the exploitation phase decides the outcome.

Gotcha: needs a hashable notion of state recurrence — a CTF agent’s state is unbounded free text (shell/HTTP output), so the state key above needs bespoke canonicalization, not raw-text hashing. Confidence: Verified. For this agent: the single most directly transplantable idea in this sweep — no new infra, just a state-canonicalization function over the harness’s existing tool_call/tool_exec_ms spans.

1.2 ArCHer — turn-level vs. token-level, two time-scales

arXiv:2402.19446 (Zhou, Zanette, Pan, Levine, Kumar; 2024-02-29). High-level off-policy TD critic at turn granularity + low-level on-policy token PG bootstrapped off it — decouples “which turn was good” from “which token was good.” The conceptual ancestor of “turn is the right credit unit,” but the off-policy critic reintroduces exactly the instability/infra weight the project’s critic-free GRPO preference was chosen to avoid. Confidence: Verified. Takeaway: use the decomposition, not the off-policy mechanism — GiGPO or Verlog (§1.6) get the same turn/token separation without a learned critic.

1.3 RAGEN / StarPO — naming the collapse in multi-turn RL

arXiv:2504.20073 (Wang et al.; 2025-04-24). Diagnostic paper: trajectory-level RL on multi-turn agents reproducibly collapses into the “Echo Trap” — reasoning traces converge to a small repeated repertoire that keeps scoring reward on the training distribution while generalization/exploration dies. Fixes center on reward normalization across turns + explicit rollout-diversity interventions.

Designed to fix a common failure: react-and-guess behavior with no coherent methodology — agents that pivot away after a single failed attempt instead of exploring alternatives. An entropy-collapsed policy is one explanation for an agent that stops trying diverse enumeration and converges to a small set of guesses.

Confidence: Verified. For this agent: the citation for “watch policy entropy as the graduation trigger” — instrument per-turn action-entropy or tool-sequence diversity during RL and treat a converging curve as the operational signal, not epoch count.

1.4 The turn-level-advantage cluster (2025–26 convergence)

A fast-moving cluster of near-simultaneous papers, all attacking “vanilla GRPO’s trajectory advantage is too coarse for multi-turn agents” with distinct mechanisms. Treat as one finding: turn is the unit of advantage is now cross-group consensus, even though no implementation is yet the default.

PaperarXivAngle
Turn-Level Reward Design2505.11821Dense per-turn reward layered on the sparse terminal reward; on tool-use benchmarks, trajectory-level baselines can fail to invoke tools at all (20-30% exact-match) vs. 100% tool-exec-success with turn-level reward.
Turn-PPO2512.17008Goes back to a per-turn value function (PPO-style) instead of GRPO’s group baseline, arguing GRPO’s clipped-group-relative update has “notable limitations” specifically for long-horizon reasoning.
TL-GRPO2601.16480Turn credit for same-state-revisited tasks (iterative code repair) — narrower than general multi-turn, but overlaps GiGPO’s step-grouping idea.
A2TGPO2605.06200Adaptive per-turn PPO clip range — early-episode and near-terminal turns have different advantage-magnitude distributions; one fixed clip under/over-constrains one of the two.
Proximity-Based MTO2602.19225Weight credit by task difficulty, not just turn position — a success on a hard task is more informative than a success on a trivial one.
GAGPO2605.13217Brings GAE’s λ-discounted multi-step advantage directly into GRPO’s group-relative framework.

Designed to fix a common failure: uneven effort across PTES phases — dynamic/turn-level signal keeps hard-exploitation-phase prompts from silently degenerating to all-zero-reward groups.

Confidence: all Promising (recent, 0-few citations at verify time) except Turn-Level Reward Design (workshop-validated). For this agent: don’t pick one paper as “the” answer — prototype the cheapest version (GiGPO’s step-grouping, zero extra infra, or a per-turn tool-exec-success shaping term) before reaching for a second value network (Turn-PPO/TL-GRPO).

1.5 GSPO — sequence-level clipping stabilizes as sequences get long

arXiv:2507.18071 (Qwen team, 2025-07). Import from Reinforcement: clip/importance-sample at the whole-sequence level instead of per-token, because token-level ratios compound multiplicatively over long sequences — exactly the failure mode a 100-turn tool-interleaved trajectory maximizes. This is Qwen3’s actual production RL algorithm. Tags: [L] [R] [E] (more stable optimization = less premature collapse). For this agent: if a future GRPO run destabilizes on long trajectories, GSPO-style sequence-level ratios should be the first thing tried, not more KL tuning.

1.6 Verlog — the only technique benchmarked past 100 turns

No arXiv id — OpenReview only (NeurIPS 2025 MTI-LLM workshop poster, openreview.net/forum?id=GmodkWwMV3; Chen, Chen, Zhu, Schneider). Cite the OpenReview id, not a fabricated arXiv one. Three mechanisms: (1) customizable agent memory — a flexible history window decoupled from episode length, (2) dual-discounting GAE — separate discount factors for turn-to-turn (γ_step) vs. within-turn token (γ_token) credit decay, generalizing ArCHer’s two-time-scale idea into a single GAE, (3) trajectory early truncation — bootstrap a value estimate instead of paying full wall-clock for variable-length rollouts.

gamma_step, gamma_token = 0.95, 0.99   # two discounts instead of one uniform GAE gamma
# ... standard GAE recursion, but decayed across turns with gamma_step and within a turn with gamma_token

Scale claim: prior frameworks (RAGEN ~10 turns, verl-agent ~50 turns) top out well below this project’s ~100-turn ceiling; Verlog is validated on Crafter at 70–400 steps (avg ~190). Confidence: Promising, workshop-tier — flag as such if cited externally. For this agent: the dual-discount split is a single-hyperparameter change on top of whatever GAE code already exists, no new critic required; trajectory early truncation directly targets the “100-turn hard timeout returns reward=0” problem by recovering partial-progress signal instead of discarding it.

1.7 verl-agent and the framework landscape

verl-agent (github.com/langfengq/verl-agent) — an open-source veRL extension for agent RL, ~50-turn scale per Verlog’s own comparison. No arXiv paper of its own; cite as infrastructure, not a research claim. Adjacent: “Demystifying RL for Long-Horizon Tool-Using Agents” (arXiv:2603.21972, Wu et al., 2026-03-23) decomposes the agentic-RL design space along 5 axes — reward shaping, model scaling, data composition, algorithm selection, environment design — the most systematic “what to tune first” ablation study found for this domain. [L][R], Promising. PEARL (arXiv:2601.20439, Wang et al., 2026-01-28) treats plan exploration (which tools, what order) as its own RL object, directly relevant to the common no-methodology failure mode. [E][R], Promising.

1.8 Tool-integrated reasoning RL: ReTool, ToRL, Search-R1

Three papers sharing a mechanism — RL over an interleaved reason→tool-call→observation loop:

  • ReTool (arXiv:2504.11536, Feng et al., 2025-04-15): interleaves real-time code-interpreter execution inside the reasoning trace and RL-trains when to interrupt reasoning to invoke a tool. [R][E], Verified, math domain.
  • ToRL (arXiv:2503.23383, Li, Zou, Liu, 2025-03-30): pure RL, no SFT-on-tool-traces warmup, reports emergent strategic tool-invocation behaviors absent from an SFT-only baseline. [E][N] — see §4.2.
  • Search-R1 (arXiv:2503.09516, Jin et al., 2025-03-12): masks retrieved/tool-output tokens out of the policy-gradient loss — the policy didn’t generate them, don’t backprop through them.
# retrieved/tool-output masking — a correctness detail, not a design choice
loss_pg = -(mask_model_generated_tokens * min(ratio * adv, clipped * adv))
# shell stdout / HTTP response body / scan output: masked out, same rule as search results

Designed to fix a common failure: agents preferring raw shell/HTTP calls over a richer provided tool surface, leaving much of it unused — tool-selection is empirically unreliable in agentic LLMs even when better tools are available and described (arXiv:2505.18135, Faghih et al., 2025-05-23). The literature-backed fix is tool-use RL / preference-tuning on tool selection itself, not more prompting. Search-R1 is direct evidence RL over “which tool/query to issue” is solved-enough in a comparable regime (search-engine calls).

For this agent: the loss-masking detail is a must-have engineering correctness fix regardless of which algorithm gets chosen — easy to miss when standing up a GRPO/RLVR loop.

1.9 ARPO — fusing turn-level credit and entropy-triggered exploration at the tool call

arXiv:2507.19849 (Dong, Mao, Ma et al., 2025-07-26; ICLR 2026 poster). The single most tightly-fit paper in this sweep to the “100-turn, tool-heavy agent” brief: an RLVR algorithm built specifically for multi-turn LLM tool-use agents, motivated by an entropy-spike finding the authors report directly from their own trajectories — token entropy jumps sharply immediately after a tool-call/observation returns, i.e. the model is most uncertain right where it just received new information. Instead of treating credit assignment ([L], §1.1) and exploration ([E], §2.1) as two separate problems, ARPO folds them into one mechanism: an entropy-based adaptive rollout that branches into step-level sampling exactly at those post-tool-call high-entropy steps (spending the exploration budget where the entropy spike says it’s needed) while staying at cheaper trajectory-level sampling elsewhere, plus an advantage-attribution estimation that assigns credit per tool-use step rather than smearing one trajectory-level advantage across the whole episode. Reports beating trajectory-level RL baselines (GRPO-class) across 13 benchmarks spanning computational reasoning, knowledge reasoning, and deep search — using only half the tool-use budget of prior methods.

# entropy-triggered branching, not a fixed global sampling schedule
for step in trajectory:
    entropy_t = token_entropy(step)
    if just_returned_from_tool_call(step) and entropy_t > threshold:
        branch_rollouts(step, k=step_level_k)     # extra step-level samples right here
    else:
        continue_trajectory_level_sampling(step)  # cheap elsewhere
advantage = attribute_advantage_per_tool_step(trajectory)  # not one trajectory-level scalar

Designed to fix two common failures together — tool-surface bypass (raw shell/HTTP over higher-level tools) and uneven PTES-phase credit — are exactly the two things ARPO’s mechanism targets at the same decision point: what happens right after a tool call returns.

Confidence: Medium-high — ICLR 2026 poster, 13-benchmark validation, but 1 citation at verify time (recent) and math/knowledge/search domains, not offensive security. For this agent: cross-reference against Cui et al.’s entropy-collapse mechanism (§2.1) — ARPO is effectively that same “entropy signals where exploration is needed” finding, but used to trigger branching rather than to mask the PG update; and against GiGPO’s step-level credit (§1.1) — ARPO’s advantage attribution is a lighter-weight alternative to GiGPO’s state-hash grouping, with the branching decision keyed directly to tool-call boundaries the harness already logs (tool_call_id/tool_exec_ms). Worth a pointer from Agentic & multi-turn RL and decomposition-vs-monolithic §3, since ARPO’s entropy-triggered branching is itself a lightweight, training-time decomposition mechanism, not just a credit-assignment fix.

1.10 Domain precedent — CTF/pentest RL (academic, context only)

These are academic domain-specific CTF/pentest training/benchmark papers — cited for context only, not a basis for any conclusion, decomposition, recipe, or number on this page (per the project’s standing rule: none of this line of work has produced a frontier cybersecurity model). Every claim they might otherwise appear to license is re-grounded below on general frontier/theory evidence or the project’s own confirmed data instead.

  • CTF-Dojo (arXiv:2508.18370, 2025-08-25) — academic, cited for context only: 658 Docker-containerized CTF challenges with verified feedback. Re-grounded: this page’s “ground-truth-verified reward, not format-matched” requirement rests on the project’s own confirmed lesson (SFT-induced FLAG{} confabulation from a loose regex reward — see the reward-shaping guardrail above §1) and on the Spurious Rewards finding (§3.6, arXiv:2506.10947) that a wrong reward can still look like it’s working — not on CTF-Dojo.
  • Pentest-R1 (arXiv:2508.07382, 2025-08-10) — academic, cited for context only: a two-stage offline-RL-on-walkthroughs → online-RL-in-Intercode-CTF pipeline. Re-grounded: the project’s own SFT→RL staging decision is grounded on DeepSeek-R1’s four-stage recipe at frontier scale (§3.1, arXiv:2501.12948) and on RAFT/Reinforce-Rej’s controlled ablation of rejection-sampling SFT (§2.6, arXiv:2504.11343) — do not lock the project’s reward shape off Pentest-R1’s design.
  • STRIATUM-CTF (arXiv:2603.22577, 2026-03-23) — academic, cited for context only: an MCP-standardized framework targeting “multi-step, stateful reasoning.” Re-grounded: GiGPO’s state-hashing (§1.1) is justified on GiGPO’s own general-agent-RL evidence (arXiv:2505.10978), not on STRIATUM-CTF’s framing.
  • HackSynth / Random-Crypto (arXiv:2506.02048, 2025-06-01) — academic, cited for context only: fine-tunes Llama-3.1-8B with vanilla GRPO on procedural crypto-CTF. Re-grounded: the claim that turn-level machinery matters more as horizon/challenge-length grows is instead supported by Verlog’s own turn-count comparison (§1.6, OpenReview) and PSN-RLVR’s length-scaling result (§2.8, arXiv:2602.02555) — general long-horizon-RL evidence, not a domain-specific CTF result.

Open gap: none of the above academic CTF-domain papers demonstrate turn-level credit assignment (GiGPO/Verlog-class) applied to offensive security — transplanting it is this project’s own contribution to make, not something pre-solved by this (academic, context-only) body of work.


2. Exploration & entropy preservation [E]

2.1 The entropy-collapse law, and its surgical fix

One-line idea: policy entropy collapses sharply and monotonically early in RLVR, and performance is bound by a fitted law R = -a·exp(H) + b — you are trading entropy for performance, hitting a hard, predictable ceiling at H=0. Mechanism: entropy change is driven by the covariance between a token’s action-probability and its logit update, which is proportional to advantage — high-probability, high-advantage tokens keep getting pushed toward certainty, and that covariance term stays positive almost everywhere.

Fix — Clip-Cov / KL-Cov: identify the small set of highest-covariance tokens per batch and either drop the PG update on them or scope an extra KL penalty to just them, leaving the rest untouched. Already merged into verl as a loss-mode flag.

cov = (logp - logp.mean()) * (adv - adv.mean())
mask = cov > percentile(cov, 1 - clip_frac)        # top ~0.2-2% of tokens
loss_pg[mask] = loss_pg[mask].detach()              # Clip-Cov
# or: loss = loss_pg + kl_coef * kl_per_token * mask   # KL-Cov

Designed to fix: patterns 2 and 3 (no methodology / brittle single-guess) — both are symptoms of a policy that already spent its entropy budget on a narrow, high-probability action sequence.

Confidence: High (mechanistic + empirical, 342 citations within a year, adopted upstream into verl within a month). Source: Cui et al., arXiv:2505.22617 (2025-05-28). For this agent: instrument mean(entropy) from RLVR step 0 — the single cheapest, highest-leverage move in this whole sweep, with no design decisions required. Cross-ref: ARPO (§1.9) reports the agentic-specific version of this same signal — entropy spikes right after a tool call returns — and uses it to trigger step-level branching rather than to mask the PG update; the two mechanisms are complementary, not competing.

2.2 Clip asymmetry — Clip-Low and Clip-High are not symmetric

arXiv:2509.26114 (Park, Kim et al., 2025-09-30). Raising the low-side PPO clip bound increases entropy; raising the high-side decreases it — they are independent exploration knobs, not one symmetric hyperparameter. Mechanistic complement to DAPO’s clip-higher (§2.3). Confidence: Medium-high, single paper. For this agent: if clip-higher alone doesn’t fully solve collapse, look at the low-side clip too.

2.3 DAPO — four engineering fixes, one entropy-preserving

arXiv:2503.14476 (Yu, Zhang et al., 2025-03-18). Clip-Higher (decoupled ε_low/ε_high, ~0.20/0.28, so rare-but-good tokens gain probability faster than they’re suppressed) + Dynamic Sampling (resample any prompt whose whole rollout group is all-correct or all-incorrect — zero-advantage groups give zero gradient) + token-level loss aggregation + overlong-response soft penalty.

eps_low, eps_high = 0.20, 0.28
loss_pg = -min(ratio * adv, clip(ratio, 1-eps_low, 1+eps_high) * adv)   # per-token, mean over ALL tokens
while std(group_rewards) == 0:            # dynamic sampling — degenerate groups contribute nothing
    group_rewards = rollout_and_score(resample_prompt(), n=G)

Designed to fix: patterns 2, 3, and indirectly 4 — dynamic sampling keeps gradient flowing even on hard-exploitation prompts that would otherwise silently degenerate to all-zero-reward.

Confidence: High — open weights/code/data, one of the most widely adopted open RLVR recipes. For this agent: at ~100 turns/rollout, resampling degenerate groups is expensive — pair with curriculum/difficulty filtering (drop challenges outside the project’s own 30–60% band) rather than paying for resamples on genuinely-unsolved challenges.

2.4 High-entropy minority tokens — where the exploration budget actually lives

arXiv:2506.01939 (2025-06, NeurIPS 2025). Only ~20% of CoT tokens carry high entropy (the semantic “forking” decision tokens); restricting RLVR gradient to only those matches full-gradient RLVR at 8B and beats it at 32B (+11 AIME25), while training on the low-entropy 80% actively degrades performance. Confidence: Medium-high, math/code domain only. For this agent: in an agentic trace, boilerplate tool-call JSON/restated context is plausibly an even larger low-entropy fraction than in pure CoT — the potential leverage of masking gradient to just the “which tool/branch” decision tokens may be higher here, though unverified for this domain.

2.5 Positive-Advantage Reweighting — independent confirmation

arXiv:2511.05993 (Jin, Gao et al., 2025-11-08). Independently re-derives that positive-advantage tokens drive entropy collapse (converging with §2.1 via a different route) and proposes direct reweighting of the loss on those tokens as a simpler alternative to covariance-thresholding. Confidence: Medium — but the cross-group convergence with §2.1 raises confidence in the underlying mechanism.

2.6 RAFT / Reinforce-Rej — the project’s current recipe, validated

arXiv:2504.11343 (Xiong, Yao et al., 2025-04-15). Rejection-sampling SFT (train only on positively-rewarded samples) is competitive with GRPO/PPO; ablation shows GRPO’s real edge over vanilla policy gradient is discarding all-fail groups, not reward normalization. Reinforce-Rej extends this by filtering both all-wrong and all-right groups.

positives = [r for r in [gen(prompt) for _ in range(N)] if verifier(r) == 1]
sft_loss(positives)                        # this project's current recipe
if not (all_correct(group) or all_incorrect(group)):
    policy_gradient_update(group)          # Reinforce-Rej: same degenerate-group filter as DAPO §2.3

Designed to fix: nothing behaviorally — this is a validation, not a fix. It confirms the project’s rejection-sampling-SFT phase is a literature-grounded baseline, not an ad hoc placeholder.

Confidence: High for the ablation (clean controlled comparison). For this agent: the single most directly actionable paper for where the project is right now — and its degenerate-group filter is the same requirement DAPO’s dynamic sampling encodes, independently derived.

2.7 KL-regularization design space

arXiv:2505.17508 (Zhang, Liu et al., 2025-05-23). Systematic study of KL-term design choices (forward vs reverse, applied to reward vs loss vs both, against which reference policy) — the “why” behind ProRL’s reference-resetting (§4.1) and KL-Cov’s token-scoped KL (§2.1). Confidence: Medium — theoretical framing.

2.8 Parameter-space noise — temporally coherent exploration, classic and revived

Classic (arXiv:1706.01905, Plappert, Houthooft et al., 2017; 364 citations, well-established): perturb the policy’s parameters before a rollout instead of the action distribution (temperature/top-p) — produces a temporally-consistent “perturbed persona” for the whole episode rather than incoherent per-token jitter.

2026 revival, PSN-RLVR (arXiv:2602.02555, Bai, Wang et al., 2026-01-30): applies parameter noise to RLVR specifically because standard RLVR has an exploration ceiling that grows more visible at large sampling budgets. Corrects the resulting off-policy mismatch with truncated importance sampling; reports gains that get larger as reasoning length grows (marginal on ~738-token AMC responses, +8.9% pass@256 on ~1978-token AIME responses).

theta_noisy = theta + sigma * noise            # perturb before rollout (typically MLP/FFN blocks)
rollout = generate(theta_noisy, prompt)
importance_weight = clip(pi_theta(a|s) / pi_theta_noisy(a|s), max_val)   # truncated importance sampling
loss = -importance_weight * advantage * logp_theta(a|s)                  # update the CLEAN theta

Designed to fix: patterns 2 and 3 — and directly relevant since these episodes run to ~100 turns, far longer than the paper’s single-CoT setting, where token-level noise decorrelation would compound into incoherence exactly as the paper predicts.

Confidence: classic — High. PSN-RLVR — Low-medium, single very-recent paper, unreplicated. For this agent: the single technique in this sweep whose stated advantage scales with trajectory length instead of against it — worth a dedicated small pilot.

2.9 Multi-temperature — spend exploration budget where it helps

arXiv:2510.08892 (Zhuang, Zhou et al., 2025-10-10). Classify tokens into high-entropy “reasoning/fork” vs. low-entropy “knowledge/fact” tokens; sample fork tokens at higher temperature, knowledge tokens at lower — don’t want the agent “exploring” whether a CVE number or flag format is correct. Confidence: Medium. For this agent: directly portable — higher temperature at “which tool next” decision points, lower temperature inside verbatim payload/command construction.

2.10 DIVER — reward group-level diversity as an intrinsic bonus

arXiv:2509.26209 (Hu, Zhang et al., 2025-09-30). Rewards global sequence-level diversity across a rollout group (pairwise dissimilarity) using potential-based reward shaping (Ng et al. 1999 invariance) so diversity-seeking doesn’t distort what “correct” means. Reports beating GRPO-w/-clip-higher, entropy-RL, and pass@k training on both pass@1 and pass@k, in- and out-of-domain.

D = pairwise_dissimilarity_matrix(responses)          # G x G over a group
diversity_of_i = mean(D[i, :])
r_intrinsic = diversity(state_t) - diversity(state_t_minus_1)   # potential-based shaping
reward_total = reward_task + lambda_div * r_intrinsic

Designed to fix common failures: tool-surface bypass and the narrow-guess pattern — a direct counter to “agents commonly bypass the rich tool surface for raw shell/HTTP” if “different approach” is defined over which tools/commands were used, not token-level text.

Confidence: Medium-high, single paper. For this agent: the strongest concrete [N]-flavored opportunity surfaced in this whole sweep — reward a rollout group for trying genuinely different tools/approaches against the same challenge, not just for eventually finding the flag.

2.11 CDE — curiosity as cheap perplexity + critic-variance bonus

arXiv:2509.09675 (Dai, Song et al., 2025-09-11, ICLR 2026). Actor-side bonus = perplexity of the model’s own response (high = “surprised,” i.e. exploring); critic-side = variance across a multi-head critic. Reports a calibration-collapse finding as a byproduct — the policy becomes confident regardless of correctness, which the actor-bonus specifically counters.

Designed to fix a common failure: agents that are good guessers until they’re not — overconfident-wrong is the literature-side twin of committing to an ungrounded guess and not recovering.

Confidence: Medium-high, modest empirical gain (+~3pt AIME) but genuinely useful framing. For this agent: the actor-side perplexity bonus is cheap (no extra network, GRPO is critic-free) — a reasonable first experiment before anything heavier.

2.12 MERCI — count-based novelty, with a domain caveat

arXiv:2510.16614 (Zhang, Li et al., 2025-10-18, ICLR 2026 poster). Classical count-based exploration adapted to the autoregressive LLM MDP via a lightweight Coin Flipping Network pseudo-count estimator — cheaper than general count-based bonuses because the token-sequence MDP has known, deterministic transitions. Confidence: Medium — but that deterministic-transition assumption is exactly what a live sandboxed CTF environment violates (server responses/subprocess stdout are stochastic, environment-dependent). For this agent: treat as inspiration for a tool/command-novelty bonus, not a drop-in.

2.13 Representation-based exploration — a negative result worth acting on

arXiv:2510.11686 (Tuyls, Foster et al., 2025-10-13). A diversity bonus from the base LM’s own hidden states, usable at inference time (build a diverse k-of-N pool) or as an RL bonus. Notable negative result: the bonus improves verifier efficiency across sampling strategies except high-temperature sampling — high-temp outputs look “novel” in representation space without being useful. Temperature-driven and representation-driven exploration are not naively composable.

pool = [gen(prompt, temp=1.0) for _ in range(N)]
selected = top_k_by([hidden_state_diversity(r, pool) for r in pool], k)   # diverse k-of-N, not random

Confidence: Medium-high (>50% verifier-efficiency gain reported, single group). For this agent: the actionable finding is at eval time, not training — if the harness uses high temperature to get sample diversity for pass@k>1 runs, this paper says that may be producing noisier repeats of the same strategy, not genuinely different ones. Cheap to ablate, changes nothing about training.

2.14 Pass@k as diagnostic, not objective — and how to fix that if you insist

arXiv:2511.16231 (Yu Yang, 2025-11-20): optimizing pass@k directly is mathematically just a positive reweighting of pass@1, whose gradient vanishes exactly where exploration is most needed (a concentrated policy). Use pass@k as a diagnostic (is the ceiling still rising with more samples?), not a training objective.

arXiv:2505.15201 (Walder & Karkhanis, PKPO, 2025-05-21): if you do want a pass@k-shaped reward anyway, derives an unbiased, low-variance estimator that keeps gradient on harder problems where pass@1 gives near-zero signal but pass@k still has coverage — the same unbiased-estimator family this project already uses at eval time (1 - C(N-c,k)/C(N,k)).

arXiv:2508.10751 (Chen, Qin et al., Pass@k Training, 2025-08-14): a lighter-weight alternative — use pass@k as the reward signal itself to adaptively balance exploration/exploitation.

Designed to fix a common failure: benchmarks that measure pattern-match speed rather than thoroughness — §2.14’s diagnostic-not-objective framing is the formal version of that same critique, applied to the training objective.

For this agent: treat the pass@1-vs-pass@5-vs-pass@10 gap (already the project’s locked methodology) as the diagnostic signal — a shrinking gap while pass@1 stays flat is the entropy-collapse warning from §2.1, not “the model learned the task.”

2.15 NuRL — unlocking prompts GRPO currently can’t learn from at all

arXiv:2509.25666 (Chen, Peng et al., 2025-09-30, Salesforce AI Research + UNC). Standard GRPO/RLVR gets zero gradient from any prompt where every rollout in the group fails (the same degeneracy DAPO resamples and RAFT filters). NuRL instead unlocks these: generate a self-conditioned hint (model, given the gold answer, produces its own CoT + hint), inject it for 0%-pass-rate groups, re-roll with the hint — now training on a hint-augmented group with real signal; hint dropped at inference.

group = rollout(prompt, n=G)
if pass_rate(group) == 0.0:                          # dead for GRPO/DAPO/RAFT alike
    hint = self_generate_hint(prompt, gold_answer)
    group = rollout(prompt + hint, n=G)               # re-roll WITH the hint; hint dropped at inference

Designed to fix a common failure: uneven PTES-phase effort, and directly relevant to a challenge portfolio with a low overall solve rate — the still-unsolved majority of challenges are plausibly many all-zero-reward-group cases today, exactly NuRL’s target regime.

Confidence: Medium, single paper, six-benchmark/three-model validation. For this agent: needs design work to adapt — the flag itself isn’t the how-to-get-there knowledge, so a CTF-shaped hint needs a walkthrough/verifier-metadata analogue or a previously-successful trajectory for a similar challenge family; doesn’t port zero-shot from math/code.

2.16 Cybersecurity RLVR precedent — the entropy-preservation gap in-domain (academic, context only)

Pentest-R1, HackSynth/Random-Crypto, and a Linux-privesc RLVR paper (arXiv:2603.17673, Normann, Happe et al., 2026-03-18 — SFT-then-RLVR on a 4B model, 95.8% success vs. 97.5% for Claude Opus 4.6 at >100x lower inference cost) are academic domain-specific security-training papers — cited for context only, not a basis for this page’s conclusions. They’re mentioned here purely to note an absence: none report an explicit entropy-preservation mechanism. The project’s actual grounding for the two-stage SFT→RLVR pipeline is DeepSeek-R1’s staged recipe at frontier scale (§3.1, arXiv:2501.12948) and RAFT/Reinforce-Rej’s controlled ablation (§2.6, arXiv:2504.11343), not these academic security papers. The entropy-preservation gap itself is this project’s own [N] opportunity to make, not something pre-solved: no cybersecurity-specific RL paper found combines DAPO/entropy-mechanism/curiosity/parameter-noise with a multi-vuln-class, ~100-turn, tool-rich CTF setting.


3. Reasoning & test-time compute [R]

3.1 The staging lesson from DeepSeek-R1

arXiv:2501.12948 (2025-01). R1-Zero (pure RL, binary rule-based reward, long CoT emerges) then R1’s four-stage fix (cold-start SFT → reasoning RL → rejection-sampling SFT on the RL checkpoint’s own correct trajectories → second RL pass). The middle-to-late stage — rejection-sampling SFT on verifier-passed solves — is literally this project’s chosen path, validated at frontier scale. Gap: R1’s reward is single-turn/terminal on math/code; the sparser, later-arriving terminal signal of a 100-turn CTF episode is the part R1 does not solve (that’s §1 of this page).

3.2 Dr.GRPO — the length-bias trap gets worse with more turns

arXiv:2503.20783 (2025-03). Vanilla GRPO’s length + group-std normalization secretly rewards longer wrong answers, shorter right ones. Fix: drop both normalizations, keep only advantage = reward - mean(rewards). Matches/beats GRPO accuracy at same compute.

Designed to fix a common failure: agents that are good guessers until they’re not — if the base algorithm rewards length-padding on failure, an agent could learn to “look busy” (redundant tool calls, extra enumeration) without the enumeration being useful — a bigger attack surface for this bug in a 100-turn setting than a single-turn math answer.

Confidence: High. For this agent: use Dr.GRPO’s advantage normalization, not vanilla GRPO’s, if/when graduating to RL — specifically check whether the policy is learning to burn turns on unproductive tool calls after a wrong guess, which is nearly indistinguishable from legitimate enumeration unless checked for.

3.3 LIMO — SFT data quality over quantity

arXiv:2502.03387 (2025-02). 817 carefully-curated SFT examples beat >100k loosely-curated ones on AIME/MATH500 plus strong OOD transfer — SFT works as “cognitive templates” for knowledge the base model already has, not a knowledge source.

For this agent — directly relevant to the immediate next step: when building the rejection-sampling SFT set from the agent’s own verifier-passed runs, prioritize trajectory quality/technique diversity over raw count. A smaller set of clean, full-PTES-phase, well-enumerated solves may generalize better than a larger set of lucky-guess successes — training on lucky-guess trajectories specifically risks teaching the “guess and hope” failure mode LIMO’s framing predicts generalizes poorly.

3.4 Test-time compute is a resource-allocation problem, not a skill problem

arXiv:2408.03314 (Snell et al., 2024-08, 1772+ citations). Difficulty-adaptive test-time compute allocation can match a 14x larger model at fixed budget; uniform allocation is wasteful. Related, arXiv:2502.15631 (o3-mini vs o1-mini, Feb 2025): higher accuracy achieved WITHOUT longer reasoning chains — accuracy generally declines as CoT length grows within a fixed model, even controlling for difficulty.

For this agent: the 100-turn budget IS test-time compute allocation, just framed as episode length. Maps onto the common strong-at-chaining/weak-at-thorough-enumeration imbalance as a resource-allocation problem: the agent should spend more of its turn budget on thorough enumeration for hard/unfamiliar challenge types and less on easy/familiar ones, rather than a flat per-phase turn count. Track turns-per-solve alongside solve rate — more turns is not automatically better.

3.5 The contested question — does RL expand or just narrow the reasoning boundary?

Two papers, opposite conclusions, genuinely contested:

  • “Does RL Really Incentivize Reasoning Capacity Beyond the Base Model?” (arXiv:2504.13837, 2025-04): under pass@k with large k, RLVR-trained models’ correct paths are all already samplable from the base model — pass@1 improves, pass@256 decreases over training. RLVR-as-typically-run narrows.
  • ProRL (arXiv:2505.24864, Liu, Diao et al., 2025-05-30, NeurIPS 2025): with KL control + periodic reference-policy resetting + a diverse task suite, sustained over 2000+ steps, RL-trained models solve problems the base model never solves at any k — genuine boundary expansion, correlating with training duration and base-model competence.
loss += kl_coef * KL(policy || ref_policy)              # (a) adaptive KL control
if step % reset_interval == 0:
    ref_policy.load_state_dict(policy.state_dict())     # (b) periodic reference reset — the non-obvious piece
# (c) diverse multi-task training suite, not a narrow curriculum

Reconciliation (this page’s synthesis, not either paper’s claim): RLVR as typically run (short, KL-to-frozen-init) narrows/amplifies; RLVR prolonged, KL-controlled, reference-resetting, diverse-task can expand. Training duration + KL management is the resolving variable — treat as a hypothesis to validate with your own entropy instrumentation (§2.1), not settled fact.

Designed to fix a common failure: uneven PTES-phase effort and weak enumeration — a reasoning boundary that hasn’t been expanded keeps failing the same class of enumeration-heavy step no matter how much RL polishing it gets.

For this agent: don’t expect boundary expansion from a short RL run — that’s expected behavior matching §2504.13837, not a bug. Periodic reference-policy resetting is cheap, orthogonal to GRPO/DAPO/GSPO choice, and worth adopting from the start of any RL run.

3.6 Spurious rewards — a methodology warning before trusting any result

arXiv:2506.10947 (2025-06, 93+ citations fast). For Qwen2.5-Math specifically, RLVR improves MATH-500 almost as much with completely spurious rewards (random, wrong-label, format-only) as with ground-truth ones — RL surfaces a latent pretrained quirk, not the reward’s information content. Does not replicate on Llama3/OLMo2 — a model-family-dependent finding.

For this agent: strengthens the project’s own confirmed lesson (ground-truth-verified reward, never format-matched) — a completely wrong reward can look like it’s working if the base model has the right latent bias, a scarier version of “format reward causes confabulation.” Sanity-check any future “the reward design worked” claim with a brief spurious-reward ablation on the same base model.

3.7 The reward-hacking cluster — what to pre-mortem before scaling RL

Three independent, very recent (2026) papers converging on one warning:

  • arXiv:2605.02269 — “Towards Understanding Specification Gaming in Reasoning Models”: RL reasoning training causally increases specification-gaming rate (32–170% across model pairs); test-time mitigations reduce but don’t eliminate it.
  • arXiv:2604.15149 — “LLMs Gaming Verifiers”: RLVR-trained models abandon intended generalizable behavior and exploit the gap between a verifier’s extensional (checks-the-output) and intensional (checks-the-process) correctness — the verifier admits false positives, RL finds exactly that gap.
  • arXiv:2604.13602 — “Reward Hacking in the Era of Large Models”: the “Proxy Compression Hypothesis” — reward hacking is near-inevitable when optimizing an expressive policy against any compressed proxy of a high-dimensional true objective. Framework/survey, not a novel empirical result.

For this agent — a concrete pre-mortem, not a hypothetical: a binary flag-match check IS an extensional verifier. §2604.15149’s mechanism predicts RL will find and exploit any gap between “produces the correct flag string” and “actually exploited the intended vulnerability” (info leak, predictable flag generation, a scoring bug) at a higher rate than the SFT-only regime already run. Audit the flag-verification harness for exactly these extensional gaps before scaling RL, and consider periodic trajectory-level spot-audits (not just flag-match) once RL training starts. All three: Medium confidence (very recent, unreplicated) — but the engineering precaution is warranted regardless of replication.

3.8 Process reward models — context, and why they stay off the table

Lightman et al. (arXiv:2305.20050, 2023, foundational) and its 2025 continuation “Process Reward Models That Think” (arXiv:2504.16828) are the step-level-verification lineage — DeepSeek explicitly rejected PRM for R1 due to step-level reward hacking. For this agent: the natural alternative if credit-assignment sparsity (§1) becomes a bottleneck, but a PRM is itself a learned (not ground-truth) reward — any PRM-style process reward would need its own anti-gaming safeguards on top of §3.7’s warnings, not a naive “good step = positive reward” scheme. Keep the terminal flag verifier as the ungameable primary signal.


4. Novelty / boundary-expansion [N]

The techniques above earn an [N] tag when they have direct evidence of expanding what the policy can do (solving what the base model never solves at any k), not just sharpening what it already sometimes does. Collected here as the load-bearing case for or against the routing principle “RL amplifies existing capabilities; SFT/distillation injects, RL elicits — you can only reinforce what already fires.” That principle is grounded primarily in the elicit-not-expand result above (§3.5, arXiv:2504.13837) and the on-/off-policy genealogy, not in any single confirmatory paper. The stronger, higher-confidence anchor for the general SFT-memorizes/RL-generalizes direction is arXiv:2501.17161 (“SFT Memorizes, RL Generalizes: A Comparative Study of Foundation Model Post-training,” Chu, Zhai et al., 2025-01, ICML 2025, 694 citations verified live) — it studies a different axis than the papers below (generalization to unseen rule/visual variants on GeneralPoints/V-IRL, not weight-level “amplify vs. replace”), but is the well-established result that RL trained with an outcome-based reward generalizes while SFT memorizes/overfits the training distribution. arXiv:2507.10616 (“Scalpel vs. Hammer: GRPO Amplifies Existing Capabilities, SFT Replaces Them,” 2025-07, 0 citations) is weaker, supporting-only evidence for the same intuition specifically at the weight/capability level on math SFT vs. RL — its own authors call the result “a preliminary indication,” and their own parameter-freezing follow-up is “inconclusive.” It is contested: arXiv:2509.12235 (“RL Fine-Tuning Heals OOD Forgetting in SFT,” 2025-09) argues the post-SFT RL stage doesn’t cleanly “amplify vs. inject” so much as restore OOD capability that SFT itself had degraded — a different causal story. Treat 2507.10616 as a low-citation preprint that rhymes with the load-bearing evidence above, not as independent confirmation of it; lean on 2501.17161 for the confidence weight instead.

4.1 ProRL — the strongest counter-evidence to “amplification only”

Already covered in §3.5 — restated here because it’s the anchor [N] citation: prolonged, KL-controlled, reference-resetting RL demonstrably expands the reasoning boundary. The qualifier that makes this actionable: boundary expansion correlates with training duration and base-model competence — a short GRPO polish pass should be expected to behave like the narrowing result (§3.5), not ProRL’s.

4.2 ToRL — RL-from-scratch surfaces qualitatively new tool-use strategies

arXiv:2503.23383 (2025-03-30, math domain). No SFT-on-tool-traces warmup at all; pure RL discovers when and how to invoke tools and reports emergent invocation strategies absent from the SFT-only baseline, outperforming the best tool-integrated-reasoning model on AIME’24 by double digits. This is the strongest citation in this whole sweep for [N]: the explicit contrast “RL discovers emergent patterns vs. SFT imitates them” pushes past mere amplification — RL-from-scratch surfaced qualitatively new patterns. Domain gap: math tool-use (Python), not offensive-security tool-use — suggestive, not proven, for CTF.

4.3 Absolute Zero — self-play with zero external data

arXiv:2505.03335 (2025-05). A model proposes its own tasks (validated by a code executor, rewarded by a “learnability” signal peaking at the frontier of current competence — an automatic curriculum) and solves them, beating models trained on tens of thousands of curated examples with zero external labeled data.

For this agent — speculative but worth flagging cross-seat: architecturally similar to a self-generated CTF-challenge curriculum, IF the flag-verifier concept generalizes from “check code output” to “check flag capture in a sandbox.” Math/code domain only — flag to challenge-builder/main as a longer-term idea for auto-scaling challenge difficulty to agent capability rather than a fixed static portfolio, not a near-term recipe.

4.4 NuRL, DIVER, MERCI — engineered novelty-seeking

Already covered in §2.15, §2.10, §2.12 — grouped here as the [N]-tagged mechanisms that explicitly target “escape local routines to discover better solutions” (MERCI’s phrase) rather than sharpen an existing one: NuRL raises the model’s upper bound on prompts it currently cannot solve at all; DIVER rewards genuinely-different group-level strategies; MERCI’s novelty bonus (with the deterministic-MDP caveat) targets repetitive, suboptimal reasoning patterns directly.

4.5 Parameter-space noise (PSN-RLVR) — explicitly framed as boundary-expanding

Already covered in §2.8. Framed by its authors as “expanding the effective reasoning capability boundary,” with gains growing as reasoning length grows — the property most aligned with this project’s long-horizon axis of any [N]-tagged technique in this sweep.

4.6 Kimi K2 and MUA-RL — agentic capability as a distinct training target

Kimi K2 (arXiv:2507.20534, 2025-07): frontier labs increasingly treat agentic/tool-use capability as requiring dedicated training investment, not an emergent side-effect of reasoning-RL — validates not expecting math/code RLVR gains to automatically transfer to 100-turn agentic CTF competence. MUA-RL (arXiv:2508.18669, 2025-08): trains against a dynamic, LLM-simulated counterpart in the RL loop instead of a static script, generalizing better per-parameter on multi-turn tool-use benchmarks. For this agent: the project’s live sandboxed CTF environment already satisfies MUA-RL’s “train against the real, dynamic, reactive counterpart” principle — validating evidence, not a design change.


Decision flow — which lever to pull first

flowchart TD
    A["Rejection-sampling SFT plateaus"] --> B{"Entropy instrumented\nfrom step 0?"}
    B -- "not yet" --> B0["Add entropy logging NOW\n(§2.1) — do this regardless"]
    B0 --> C
    B -- "yes" --> C{"GRPO baseline in\n30-60% band?"}
    C -- "no, too low/high" --> C0["Curriculum-filter challenges\nto the 30-60% band first"]
    C0 --> D
    C -- "yes" --> D["Start RL with DAPO recipe\n(clip-higher + dynamic sampling, §2.3)\nnot vanilla GRPO"]
    D --> E{"Entropy still\ncollapsing?"}
    E -- "yes" --> F["Add Clip-Cov / KL-Cov\n(§2.1) — one-line verl flag"]
    E -- "no" --> G
    F --> G{"Credit smeared across\nall 100 turns equally?"}
    G -- "yes" --> H["GiGPO step-groups (§1.1)\nor turn-level reward shaping (§1.4)"]
    G -- "no" --> I
    H --> I{"Large fraction of\nchallenges still\nall-zero-reward?"}
    I -- "yes" --> J["NuRL-style hints (§2.15)\nor more rejection-sampling data"]
    I -- "no" --> K
    J --> K{"Tool avoidance persists?"}
    K -- "yes" --> L["DIVER / MERCI-style\ntool-sequence diversity bonus (§2.10, §2.12)"]
    K -- "no" --> M["Budget real training duration +\nreference-policy resets for boundary\nexpansion (ProRL, §3.5/§4.1)"]
    L --> M

Ranked shortlist — what to reach for FIRST

Given the diagnosis (execution gap, not knowledge gap), the chosen path (rejection-sampling SFT → GRPO/RLVR at entropy collapse), the commonly-observed agent failure modes catalogued above, and the binary terminal verified-flag reward:

  1. Instrument entropy from step 0 of any future RL run (§2.1). Free, no design decisions, do this before anything else — you cannot diagnose a collapse you didn’t measure.
  2. Start the RL stage with DAPO’s four fixes as the baseline recipe (§2.3), not vanilla GRPO — clip-higher and dynamic sampling are exactly the entropy/degenerate-group guarantees the project’s own “30–60% baseline” rule is implicitly reaching for, made explicit. Reinforce-Rej (§2.6) independently validates the same direction.
  3. If entropy still collapses under DAPO, add KL-Cov/Clip-Cov as a one-line verl loss-mode flag (§2.1) before building anything custom.
  4. Adopt GiGPO’s step-level credit (§1.1) as the first turn-level fix — zero extra rollouts, zero new critic, just a state-canonicalization function over the harness’s existing tool-call spans. Reach for the turn-PPO/TL-GRPO cluster (§1.4) only if GiGPO’s assumptions (hashable state recurrence) don’t hold in practice. If entropy instrumentation (§2.1) shows the collapse concentrating right after tool-call returns specifically, ARPO’s entropy-triggered step-level branching (§1.9) is the more tightly-fit alternative — it fuses this credit-assignment fix with the exploration fix in one mechanism, keyed to the same tool-call boundaries.
  5. Separate the never-solved challenges from the 30–60%-band ones and treat them as NuRL-territory (§2.15) — a distinct problem requiring hints or more SFT data before they’re GRPO-ready at all, not more training on the same recipe.
  6. Pilot parameter-space noise (§2.8) as the one technique whose stated advantage scales with the 100-turn horizon rather than against it — small-scale, given PSN-RLVR is unproven outside math.
  7. Build a tool-call-sequence-level diversity bonus (DIVER §2.10 / MERCI §2.12, adapted) — the strongest concrete [N] opportunity surfaced anywhere in this sweep, and the most direct counter to tool-surface bypass that isn’t a prompting fix.
  8. Do not optimize pass@k directly as a training reward (§2.14) without the PKPO estimator; use the pass@1/pass@k gap as a diagnostic, and ablate whether pass@5/pass@10 sampling diversity is real or just noisier repeats (§2.13) — cheap, changes nothing about training, tells you whether the eval methodology measures what you think.
  9. Audit the flag verifier for extensional gaps before scaling RL (§3.7) — a pre-mortem, not a reaction; RL is empirically expected to find gaming opportunities at a higher rate than the SFT-only regime already run.
  10. Budget real training duration + periodic reference-policy resets (ProRL, §3.5/§4.1) once past the initial GRPO baseline — boundary expansion (genuinely new attack paths, not just more reliable execution of known ones) is a function of how long and how KL-controlled the run is, not available from a short polish pass.

Summary table

TechniquearXiv (verified)[L][E][R][N]Failure modeConfidenceOne-line takeaway
GRPO (baseline)2402.03300HighGroup-mean baseline, no critic — trajectory-level only
GAE (baseline)1506.02438HighClassical multi-step advantage, single time-scale
GiGPO2505.10978uneven-PTESHighStep-level advantage via state-hash groups, zero extra rollouts
ArCHer2402.19446HighTurn-level off-policy critic — heavier infra than needed
RAGEN / StarPO2504.20073no-methodologyHighNames and diagnoses the “Echo Trap” entropy collapse
Turn-level reward cluster2505.11821 +5uneven-PTESPromising (cluster)Turn is the unit of advantage — cross-group consensus
GSPO2507.18071Med-HighSequence-level clip; stability grows more relevant with length
VerlogOpenReview onlyPromisingDual-discount GAE + memory-window + early truncation; 400+ turns
Demystifying long-horizon RL2603.21972Promising5-axis empirical recipe: reward/scale/data/algo/env
PEARL2601.20439no-methodologyPromisingRL over the planning/tool-sequencing step itself
ReTool / ToRL / Search-R12504.11536 / 2503.23383 / 2503.09516ToRL:✓tool-bypassHigh/VerifiedTool-output tokens masked from PG loss; ToRL = emergent tool strategies
ARPO2507.19849tool-bypass / uneven-PTESMed-HighEntropy-triggered step-level branching right after tool calls; fuses §1.1+§2.1
CTF-Dojo / Pentest-R1 / HackSynth (academic, context only)2508.18370 / 2508.07382 / 2506.02048Context onlyNOT a basis for this page’s claims — see §1.10 re-grounding on DeepSeek-R1/RAFT/GiGPO/Verlog/PSN-RLVR
Entropy Mechanism / Clip-Cov / KL-Cov2505.22617no-methodology / brittle-guessHighFitted entropy-vs-performance law; surgical per-token fix
Clip-Low/Clip-High asymmetry2509.26114no-methodology / brittle-guessMed-HighTwo independent clip knobs, not one symmetric one
DAPO2503.14476no-methodology / brittle-guess / uneven-PTESHighClip-higher + dynamic sampling — the RL baseline recipe
High-entropy minority tokens2506.01939brittle-guessMed-HighOnly ~20% of tokens carry the exploration-relevant decisions
Positive-Advantage Reweighting2511.05993no-methodology / brittle-guessMediumIndependent confirmation of the entropy-collapse mechanism
RAFT / Reinforce-Rej2504.11343HighValidates this project’s own rejection-sampling-SFT phase
Parameter-space noise / PSN-RLVR1706.01905 / 2602.02555no-methodology / brittle-guessHigh / Low-medTemporally-coherent exploration; gains grow with length
Multi-temperature2510.08892no-methodologyMediumHigh temp on fork tokens, low temp on payload/syntax tokens
DIVER2509.26209tool-bypass / no-methodology / brittle-guessMed-HighReward group-level diversity, potential-based shaping
CDE2509.09675brittle-guessMed-HighPerplexity + critic-variance curiosity bonus; calibration fix
MERCI2510.16614tool-bypass / no-methodologyMediumCount-based novelty; deterministic-MDP assumption breaks for live envs
Representation-based exploration2510.11686brittle-guessMed-HighNegative result: high temp and rep-diversity fight each other
Pass@k diagnostic / PKPO / Pass@k Training2511.16231 / 2505.15201 / 2508.10751benchmark-thoroughnessHigh/Med/MedPass@k’s gradient vanishes as policy concentrates unless corrected
NuRL2509.25666uneven-PTESMediumSelf-generated hints unlock currently-0%-pass-rate prompts
DeepSeek-R12501.12948no-methodologyHighThe staging recipe this project’s own path mirrors
Dr.GRPO2503.20783brittle-guessHighRemoves GRPO’s length-bias reward artifact
LIMO2502.03387brittle-guessMed-HighSFT set quality/technique-diversity over raw count
Test-time compute scaling2408.03314uneven-PTESHighTurn budget is a resource-allocation problem, not a skill one
ProRL2505.24864uneven-PTESMed-HighProlonged + KL-control + reference-reset genuinely expands boundary
Does RL Really Incentivize…2504.13837✓(neg)MediumCONTESTED vs. ProRL — short-run RLVR narrows, doesn’t expand
Spurious Rewards2506.10947✓(neg)High (scope-ltd)A wrong reward can still “work” — validate across model families
Reward-hacking cluster2605.02269 / 2604.15149 / 2604.13602✓(neg)MediumRL causally increases spec-gaming; audit the verifier’s extensional gaps
Absolute Zero2505.03335MediumSelf-play, zero external data — speculative curriculum idea
Kimi K2 / MUA-RL2507.20534 / 2508.18669Med/MedAgentic capability is a distinct training target, not RLVR side-effect

PEFT is orthogonal — LoRA · QLoRA · DoRA

Every method chapter so far — imitation, hint-guided bootstrapping, preference, reinforcement, agentic and long-horizon RL — has been about what signal moves the weights. This closing chapter of the methods survey is about something orthogonal: how much of the weight matrix is even allowed to move, and why that’s a separate decision from the method itself.

Common confusion worth killing outright: PEFT is not a fine-tuning method — it’s a mechanism for applying one. Any of SFT / DPO / GRPO / RLVR can be delivered full-parameter or via a PEFT adapter. It changes which parameters get gradients and how much memory you burn, not what signal you learn from.

The methods

  • LoRA — freeze W, train a low-rank update ΔW = B·A (rank r), so y = Wx + (BA)x·(α/r). Only A, B get gradients (Hu et al., arXiv:2106.09685).
  • QLoRA — quantize the frozen base to 4-bit NF4, keep adapters in BF16; lets a large base fit a small GPU (Dettmers et al., arXiv:2305.14314).
  • DoRA — decompose the update into magnitude + direction for a bit more accuracy at the same budget (arXiv:2402.09353).

Engineering facts that matter

  • It’s a knob on top of a method. “Should I do LoRA or GRPO?” is a category error — you do GRPO, via LoRA. On-policy distillation reproductions run rank-128 LoRA; OpenAI/Fireworks/Google Vertex customer-RFT products are LoRA-first — LoRA lives in the applied/enterprise fine-tuning layer. The frontier labs post-train their own flagship checkpoints full-parameter (Llama/Qwen/DeepSeek/GPT/Claude/Gemini reports; verified 2026 pass).
  • LoRA bounds drift magnitude, not behavioral direction — it is not an unconditional forgetting guarantee. The low-rank cap does measurably protect broad, high-rank capability (held-out benchmarks stay closer to base than full-FT’s, across code/math — Biderman et al., “LoRA Learns Less and Forgets Less,” TMLR 2025, arXiv:2405.09673). But format/policy switches (e.g. “always emit <think>”, “always refuse X”) are themselves low-rank — a rank-8–64 adapter has ample capacity to flip them if the training signal is consistent, and LoRA-trained weight matrices develop “intruder dimensions” with no analog in full-FT that compound across sequential adapter rounds (Shuttleworth et al., arXiv:2410.21228; safety-refusal collapse case study, Lermen et al., arXiv:2310.20624). Full protect-vs-doesn’t-protect table, the rank/α/LR knobs that actually help, and the CoT-collapse-under-LoRA case study relevant to the small-model overwrite problem in Imitation: Data mixing, ratios & not forgetting how to think §2.
  • It is startlingly learning-rate-sensitive — more so than which adapter variant you pick. The 2026 unified LoRA-variant study finds a well-tuned vanilla LoRA matches or beats most fancy variants, and LoRA needs a higher LR than full-FT to learn comparably (recommended range 5e-5 to 5e-4) — a double-edged knob, since cranking LR to make LoRA learn also erodes the forgetting protection above (arXiv:2601.22708; LR-sensitivity finding corroborated by Biderman et al., arXiv:2405.09673 and Thinking Machines, “LoRA Without Regret” (2025)). Tune LR before you tune adapter architecture. Two lower-profile knobs worth knowing: rsLoRA rescales by α/√r instead of α/r to stop high-rank configs from destabilizing (use_rslora in HF PEFT, Kalajdzievski, arXiv:2312.03732); DoRA and rsLoRA are learning-capacity accelerants (close the LoRA-vs-FFT gap faster/further), not forgetting fixes.

Practical default for your scale

At ≤~9–16B, LoRA/QLoRA is the sane default for iteration cost; go full-parameter only when you have a concrete reason (measured OOM headroom aside, the project’s stance is LoRA-by-default, full-FT as a deliberate escalation — see lessons/post-training/ in shared memory). It composes with every method chapter here — the same on/off-policy axis and fixed method presets apply whether the gradients land in the full weight matrix or a rank-r adapter (Foundations: the one axis).

One stage is the recipe’s own exception to “LoRA-by-default”: continued/domain pretraining needs to learn too much (new facts, new token distributions) for a low-rank constraint to absorb, so full fine-tuning, not LoRA, is the recommended method there — full-FT learns perturbations at 10–100× the effective rank of typical LoRA configs (The recipe is a sequence, not a pick, stage 1). On-policy distillation reproductions running rank-128 LoRA are a T3 “promising, watch” entry, not yet a flagship-proven default — see the full tier ranking in Start here: a proven-first ranking.

The recipe is a sequence, not a pick

Every other chapter in this book eventually asks “which technique” — SFT or GRPO, DPO or KTO, monolithic or decomposed reward. This chapter retires that framing at the root. None of the frontier reports surveyed below describe a technique choice. They describe a fixed, ordered sequence of stages, each doing a qualitatively different job on qualitatively different data at a qualitatively different scale, and the capability that ships is a function of the order those stages run in and the way they compound — not of which single stage you picked. Skip a stage and a later stage cannot silently make up for it (you cannot RL-amplify a capability pretraining/SFT never injected — §3). Run stages in the wrong order or the wrong dose and a later stage actively regresses (heavy SFT/DPO can cap RL’s exploration room before RL ever starts). This is the organizing thesis of this book’s north star: not “what recipe/technique should I choose,” but “what sequence of stages produces frontier capability, and how do we run it for cyber.”

Two explicit sequences follow, because this project’s actual path and the textbook from-scratch path are different sequences with different stage-skeletons even though every stage-name rhymes:

  • Sequence A (§1) — a foundation model trained from scratch: pretraining → mid-training/annealing → SFT → rejection-sampling → preference opt → RL/RLVR → iterate.
  • Sequence B (§2) — this project’s actual path: fine-tune an already-available open-weight dense checkpoint (Qwen/Llama-class) — base-vs-instruct choice → (optional) continued/domain pretraining → SFT cold-start (often distilled) → rejection-sampling/on-policy SFT → preference (DPO/KTO) → RLVR/GRPO → iterate.

Stance held throughout: no claim below is grounded in an academic cybersecurity-LLM project (CTF-Dojo, Cyber-Zero, Pentest-R1, HackSynth, AutoPenBench, DRLRM-PT) — those appear, if at all, labelled “academic, not a basis.” Grounding is frontier-lab technical reports, frontier open post-training recipes (Tülu 3, OLMo 2, DeepSeek-R1, Qwen, Llama-Nemotron), and general RL/ML theory. Every arXiv id below was checked live via Exa/WebFetch against arxiv.org/abs/<id> or arxiv.org/html/<id>, not recalled from training-data memory — confidence is stated per claim, and “promising, not yet validated” is used honestly where a finding is recent/low-citation.


1. Sequence A — the foundation model, from scratch

This is the textbook path — pretrain a dense model from zero, then run a multi-round post-training loop. Grounded in Llama 3 (arXiv:2407.21783), OLMo 2 (arXiv:2501.00656), DeepSeek-V3/R1 (arXiv:2412.19437, arXiv:2501.12948, cited for pipeline-shape — MoE, flagged where MoE-specific), and Qwen2.5 (arXiv:2412.15115, dense 0.5B–72B). It is not this project’s path — included so Sequence B’s compression ratio (§2) has a baseline to compress against.

flowchart TD
  Pre["Pretraining\n15-18T tokens: web + code + math + multilingual\nLlama 3 405B 15.6T (2407.21783)\nDeepSeek-V3 14.8T (2412.19437)\nQwen2.5 18T (2412.15115)"] --> Mid

  subgraph Mid["Stage 2 — Mid-training / annealing"]
    direction TB
    MidA["5-10% of pretrain FLOPs, curated premium mix\nLR linearly decayed to 0\nOLMo 2: 50/100/300B-token anneals, souped (2501.00656)\nLlama 3: 40B tokens, 30:70 weight (2407.21783)"]
  end

  Mid --> SFT1

  subgraph SFT1["Stage 3 — SFT cold-start"]
    direction TB
    SFT1A["Curated (prompt,response) pairs — human,\ndistilled, or rejection-sampled from a prior round\nDeepSeek-V3 1.5M instances (2412.19437)\nQwen2.5 >1M samples (2412.15115)\nDeepSeek-R1 cold-start: 'thousands' only (2501.12948)"]
  end

  SFT1 --> RS

  subgraph RS["Stage 4 — Rejection sampling"]
    direction TB
    RSA["Sample K per prompt from current policy,\nkeep verifier/RM-filtered correct-only\nDeepSeek-R1: ~600K reasoning + ~200K general\n= ~800K, 2 epochs (2501.12948)"]
  end

  RS --> DPO

  subgraph DPO["Stage 5 — Preference opt (DPO)"]
    direction TB
    DPOA["(chosen, rejected) triplets, closed-form loss\nchosen over PPO for stability/scale (2407.21783)\nQwen2.5 stages SFT -> DPO -> GRPO (2412.15115)"]
  end

  DPO --> RL

  subgraph RL["Stage 6 — RL / RLVR"]
    direction TB
    RLA["GRPO: group-relative advantage, no critic,\nrule-based verifiable reward\nR1-Zero AIME pass@1 15.6% -> 71.0% (2501.12948)"]
  end

  RL -.->|"iterate: rejection-sample the RL-converged\ncheckpoint, retrain SFT from base"| SFT1

  classDef stage fill:#132b22,stroke:#34d399,color:#eafaf3;
  class Pre,MidA,SFT1A,RSA,DPOA,RLA stage;
StageJobData typeApprox size (verified)Contribution / order-rationale
1. PretrainingTeach language structure + load broad-domain knowledge via next-token prediction at massive scale — the only stage that’s affordable at trillions of tokensFiltered/deduped web + code + math/STEM + multilingual, general-purpose15.6T tokens (Llama 3 405B dense, 2407.21783 — mix: 50% general / 25% math-reasoning / 17% code / 8% multilingual); 14.8T (DeepSeek-V3 MoE, 2412.19437); 18T (Qwen2.5 dense family, 2412.15115, up from 7T for Qwen2)Must come first — every later stage assumes a working “reads and represents language” substrate; RL/RLVR only sharpen a distribution pretraining already put mass on, they don’t create it
2. Mid-training / annealingUpsample small, high-quality, capability-specific data that a uniform trillion-token mix would dilute to near-zero; also a cheap diagnostic for “is this new dataset worth anything”Curated high-quality web + synthetic + math/domain-specific; LR decayed to (near) zero5–10% of total pretrain FLOPs. OLMo 2: 832.6B-token curated pool (“Dolmino Mix 1124”), drawn down into 50B/100B/300B-token anneal runs, then checkpoint-averaged (“souped”) 2501.00656. Llama 3: 40B tokens, 30% new-data : 70% default-mix weight 2407.21783Too scarce (tens of B tokens) to survive uniform mixing into a 15T-token stream; too much (needs pretraining-scale volume) for SFT’s ~10⁶-example budget to inject. OLMo 2’s measured delta: +18.7% (7B) / +15.9% (13B) / +12.3% (32B) downstream from mid-training alone (Table 2) — the cleanest “small stage, outsized compounding gain” number in this whole thread
3. SFT cold-startTeach instruction-following / assistant-shaped output; for reasoning pipelines, narrows further to “stabilize RL’s starting point”Curated (prompt, response) pairs — human-written, distilled from a stronger teacher, or rejection-sampled from a prior roundDeepSeek-V3: 1.5M instances, multi-domain 2412.19437; Qwen2.5: >1M samples 2412.15115; DeepSeek-R1 cold-start: “thousands” only, deliberately tiny 2501.12948Must follow pretraining+mid-training (needs the base capability). In multi-round designs, SFT is interleaved with RL, not one-shot — cold-start SFT is ~3 orders of magnitude smaller than “capability” SFT because its only job is fixing format/readability, not teaching the full skill
4. Rejection samplingTurn a trained policy into a data generator for the next SFT round — crystallize RL-gained capability back into cheap-to-train supervised pairsModel-generated completions, filtered by rule-based correctness and/or a reward model/generative judgeDeepSeek-R1: ~600K reasoning + ~200K non-reasoning = ~800K samples, 2 epochs, retrained from DeepSeek-V3-Base 2501.12948; Llama 3: K≈10–30 samples/prompt (medium confidence — secondary source)Sits between an RL stage and the next SFT stage in every multi-round design — cannot happen before a trained policy exists, and its output is consumed entirely by the next SFT round. This is the mechanism that makes the pipeline compounding rather than a single pass
5. Preference opt (DPO)Align to relative preferences without a live RL loop, critic, or continuously-updated reward model(prompt, chosen, rejected) tripletsQwen2.5: explicit SFT → offline DPO → online GRPO staging 2412.15115; Llama 3: ≈6 rounds, each SFT+DPO (medium confidence on the exact count) 2407.21783A deliberate simplicity/stability trade against full online RL, stated directly by Meta: “less stable and harder to scale” for PPO-family algorithms at 405B 2407.21783; needs a policy already producing two plausible candidates to rank
6. RL / RLVRExceed imitation — discover reasoning behaviors never explicitly demonstrated, via a verifiable (not learned) rewardPrompts + a verifier, not response demonstrationsR1-Zero (pure RL, no SFT): AIME 2024 pass@1 15.6% → 71.0% (cons@64 86.7%) 2501.12948; GRPO: group-relative advantage, no critic/value networkPlaced last/final rounds — least stable, most expensive per-sample (live generation + verification per step). R1-Zero is the direct demonstration of running this first: real capability gain, but a documented failure mode (poor readability, language mixing) the paper attributes explicitly to skipping cold-start SFT
7. IterateRepair a failure mode the previous pass introduced; bootstrap the next round’s training data from the current-best policyn/a — reuses stages 3–6DeepSeek-R1: explicit 4-stage loop (cold-start SFT → reasoning RL → RS+SFT → RL-for-all-scenarios) 2501.12948; Llama 3: 6 rounds, self-referential rejection-sampling across rounds 2407.21783Not “more of the same” — round N+1’s data quality is bounded by round N’s model quality (a genuine bootstrapping effect). Llama 2’s own early-version regression (rejection-sampling only from the latest round’s data caused a documented capability loss — “struggled more… to compose rhyming lines”) 2307.09288 is the concrete warning that compounding is not monotonic for free — you must deliberately mix in older-round data

2. Sequence B — fine-tune an open-weight DENSE model (our path)

This is the project’s actual path. Start from a Qwen3/Llama-class dense checkpoint — never pretrain from zero. Grounded in four frontier open post-training recipes: Tülu 3 (arXiv:2411.15124), DeepSeek-R1 (arXiv:2501.12948), Qwen3 (arXiv:2505.09388), and Llama-Nemotron (arXiv:2505.00949). Underneath surface naming differences, all four run the same stage skeleton.

flowchart TD
  Base["Stage 0 — Base-vs-instruct choice\nStart from BASE, not Instruct\nDeepSeek-R1, Qwen3, Tulu 3 all start Base\n(2501.12948, 2505.09388, 2411.15124)"] --> CPT

  subgraph CPT["Stage 1 — (optional) continued /\ndomain pretraining"]
    direction TB
    CPTA["Full-FT (not LoRA), low LR, unsupervised domain tokens\nQwen3 knowledge stage: +5T tokens on ~30T base (2505.09388)\nDeepSeekMath CPT: 120B math tokens on a 7B dense model (2402.03300)\nLoRA-vs-FFT CPT regime: ~20B tokens (2405.09673)"]
  end

  CPT --> SFT

  subgraph SFT["Stage 2 — SFT cold-start\n(often distilled / synthetic)"]
    direction TB
    SFTA["Small, format-focused, often teacher-distilled\nDeepSeek-R1: 'thousands' (2501.12948)\nQwen3: deliberately minimized by design (2505.09388)\nDeepSeek-R1-Distill: 800K samples, no RL,\nbeats RL-on-Qwen2.5-32B directly"]
  end

  SFT --> RS

  subgraph RS["Stage 3 — Rejection-sampling /\non-policy SFT"]
    direction TB
    RSA["Sample K, verify against REAL outcome, keep\ncorrect, retrain — closes the execution gap\nRAFT (2304.06767), STaR (2203.14465)\nDeepSeek-R1: 800K samples built this way (2501.12948)"]
  end

  RS --> Pref

  subgraph Pref["Stage 4 — Preference opt (DPO/KTO)"]
    direction TB
    PrefA["(chosen,rejected) triplets or binary\ndesirable/undesirable labels\nDPO (2305.18290), KTO (2402.01306)\nTulu 3: ~273K pairs, stage 3-of-5 (2411.15124)"]
  end

  Pref --> RLVR

  subgraph RLVR["Stage 5 — RLVR / GRPO"]
    direction TB
    RLVRA["Group-relative advantage, no critic,\nverifiable reward — 2-pass: narrow-reasoning\nthen broad-general (DeepSeek-R1, Qwen3, Nemotron)"]
  end

  RLVR -.->|"iterate: rejection-sample the RL-converged\ncheckpoint -> mint next SFT round"| SFT

  classDef stage fill:#132b22,stroke:#34d399,color:#eafaf3;
  class Base,CPTA,SFTA,RSA,PrefA,RLVRA stage;
StageJobData typeApprox size (verified)Contribution / order-rationale
0. Base-vs-instructPick a starting checkpoint that won’t fight the target behaviorn/an/aBase, not Instruct — no competing “assistant persona”/prior RLHF alignment to fight; DeepSeek-R1, Qwen3, and Tülu 3 all start every reasoning/post-training recipe from Base, never from the vendor Instruct checkpoint 2501.12948, 2505.09388, 2411.15124 — Instruct’s habits (short answers, refusal patterns, chat-template quirks) actively fight a long-CoT/tool-use format install
1. (Optional) continued/domain pretrainingInject genuinely new facts SFT/RL cannot teach at low data volume — RL/DPO reweight existing capability, they don’t teach new factsRaw domain text/code, unsupervised, next-token-prediction objectiveQwen3 knowledge-injection sub-stage: +5T tokens on top of ~30T general 2505.09388; DeepSeekMath: 120B math tokens continued-pretrained onto a dense 7B code checkpoint 2402.03300 — the cleanest Sequence-B-scale CPT anchor; LoRA-vs-FFT benchmark regime: ~20B tokens 2405.09673Full fine-tuning, not LoRA, is the recommended method here — CPT needs to learn too much (new facts, new token distributions) for a low-rank constraint; full-FT learns perturbations at 10–100× the effective rank of typical LoRA configs 2405.09673. Skip this stage if the corpus is small/curated — push knowledge in via tools/retrieval instead (handbook rule: knowledge in tools, not weights)
2. SFT cold-startFix format/readability/tool-syntax so RL has a stable starting point to sharpen, not invent, from scratch; often distilled from a stronger teacherSmall curated set, often off-policy/teacher-distilled long-CoT or tool-use tracesDeepSeek-R1 cold-start: “thousands” 2501.12948; Qwen3 explicitly states design intent: “minimize both the number of training samples and the training steps during this preparatory phase” 2505.09388; DeepSeek-R1-Distill (dense Qwen/Llama, 1.5B–70B): 800K samples, SFT-only, outperforms running RL directly on Qwen2.5-32B 2501.12948Deliberately kept small if it will be followed by RL — over-investing here (turning cold-start into a full capability-SFT pass) is exactly the failure mode §3’s Llama 4 finding warns about: heavy SFT caps the RL stage’s exploration room
3. Rejection-sampling / on-policy SFTClose the execution gap — train on the model’s OWN correct outputs (grounded in its own tool-call results), not just imitation of a teacher’s plausible-looking traceModel-generated completions, filtered by a real verifier (rule-based correctness, not a learned judge where avoidable)DeepSeek-R1: same ~800K-sample set, produced by rejection-sampling the RL-converged checkpoint 2501.12948; RAFT formalizes the loop generically 2304.06767; STaR is the seminal reasoning-specific version, with the “rationalization” (backward-from-answer) trick 2203.14465; a contested finding argues plain rejection-sampling (RAFT) is competitive with full GRPO — the edge attributed to prompt-filtering, not reward-normalization 2504.11343 (low-citation, “promising, worth testing on your own gym”)The on-policy bridge between imitation and RL — the mechanism that actually closes the off-policy execution gap (§5), because now the “reasoning” is grounded in the agent’s own tool-call outputs, not a teacher’s
4. Preference opt (DPO/KTO)Align the softer, harder-to-verify axis (style, report quality, tool-use elegance) where no ground-truth checker exists(prompt, chosen, rejected) triplets, or binary desirable/undesirable labelsDPO: closed-form classification loss, β the hyperparameter that actually matters 2305.18290; KTO: binary labels only, HALO framing, “matches or exceeds DPO from 1B–30B” 2402.01306; Tülu 3: ~272,898 pairs (8B mixture), stage 3-of-5 2411.15124Ordering here is genuinely contested — Tülu 3/Nemotron run preference-opt before/after RLVR depending on whether the preference signal and the verifiable-reward signal target the same behavior (fold into one RL stage, à la DeepSeek) or orthogonal behaviors (sequence them, harder-to-specify objective last, à la Tülu 3/Nemotron)
5. RLVR / GRPOSharpen and stabilize on-policy behavior against a ground-truth verifier — the stage that can exceed what imitation/preference-opt cap out atPrompts + a verifier, no response demonstrationsEvery 2025 open recipe surveyed (DeepSeek-R1, Qwen3, Llama-Nemotron) runs this in two passes: narrow reasoning-only RL, then a broader general-domain pass — this two-pass structure is close to a settled convention across 3/3 recipesGRPO needs no critic/value network — tractable to bolt onto an existing dense checkpoint without training a same-size value model; the RAFT-vs-GRPO ablation above (2504.11343) applies directly — test whether gains come from reward-normalization or from prompt-filtering before committing to full GRPO infra
6. IterateRepeat RL ↔ rejection-sampling ↔ light-SFT round-tripsn/a — reuses stages 2–5DeepSeek-R1’s pipeline literally loops this (SFT → RL → rejection-sample → SFT → RL); AdaSTaR formalizes efficient iteration (curriculum sampling, −58.6% training FLOPs at equal-or-better accuracy) 2505.16322Budget at least two RL↔rejection-sampling round-trips, not one — “RL once, done” undersells what every recipe surveyed here actually does

The Sequence A → B compression, cited: the entire 1000×+ data-volume saving of “fine-tune, don’t pretrain” comes almost entirely from skipping/shrinking the pretraining stage — SFT (500K–1.5M examples either way), preference pairs (10⁵–10⁶ either way), and RLVR prompts (10³–10⁴ either way) are roughly the same absolute order of magnitude whether you’re doing full pretraining or just fine-tuning an existing dense checkpoint. This is a genuinely useful correction to the naive assumption “Sequence B is smaller at every stage” — it isn’t; only the pretraining/CPT stage shrinks by orders of magnitude.


3. Why ORDER matters, and why stages COMPOUND (not add)

Three mechanisms recur across every source in this thread, each backed by a controlled comparison or a direct frontier-lab disclosure — this is what “order is load-bearing” cashes out to concretely.

Cold-start SFT before RL changes RL’s stability and convergence, not just its ceiling. DeepSeek-R1 vs. R1-Zero is the cleanest natural experiment: same base model (DeepSeek-V3-Base), same RL algorithm (GRPO), only the presence of an SFT stage differs. R1-Zero (pure RL, zero SFT) gets real reasoning gains (AIME 15.6%→71.0%) but “poor readability, language mixing” — the paper’s own stated reason cold-start SFT exists: “starting RL training from an uninitialized model can lead to instability and slow convergence” 2501.12948. “SFT Memorizes, RL Generalizes” reaches the same conclusion from a different testbed (GeneralPoints/V-IRL): even a paper whose headline is “SFT bad, RL good” finds “SFT stabilizes the model’s output format, enabling subsequent RL to achieve its performance gains” 2501.17161 (medium-high confidence, ICML 2025 poster).

Heavy SFT/DPO can cap RL exploration — a frontier lab’s own production disclosure, not theory. Meta’s Llama 4 blog states directly: “SFT and DPO can over-constrain the model, restricting exploration during the online RL stage and leading to suboptimal accuracy, particularly in reasoning, coding, and math domains.” Their fix: drop >50% of data tagged “easy,” train only on the harder remainder before RL. This is the single cleanest concrete counter-example to “more SFT/DPO is always better” — high confidence on the mechanism (first-party engineering account), unquantified on magnitude (no ablation numbers disclosed).

RL’s gains are bounded by what the base/SFT policy can already sample — distillation is the one mechanism shown here to inject genuinely new capability. “Does RL Really Incentivize Reasoning Capacity in LLMs Beyond the Base Model?” (NeurIPS 2025 Best Paper Runner-Up, ICML 2025 AI4Math Best Paper — high confidence, well-vetted): RLVR-trained models win at small k, but base models overtake at large k — “the reasoning capability boundary of LLMs often narrows as RLVR training progresses… reasoning paths generated by RLVR models are already included in the base models’ sampling distribution” 2504.13837. RL narrows toward existing high-reward paths; it does not expand pass@large-k beyond the base model. Distillation, by contrast, transplants a stronger teacher’s genuinely new reasoning patterns — DeepSeek-R1’s own finding: “direct distillation from DeepSeek-R1 outperforms applying RL on [Qwen2.5-32B]” directly 2501.12948. A mechanistic (low-citation, “promising not validated”) companion result frames the same split via parameter-update analysis: “RL amplifies existing capabilities, while SFT replaces old skills with new ones” 2507.10616. A contested push-back worth flagging honestly: “RL Fine-Tuning Heals OOD Forgetting in SFT” reframes this as “SFT forgets, RL recovers” rather than “SFT memorizes, RL generalizes” — RL mostly restores an early-SFT peak rather than exceeding it 2509.12235 (medium confidence, newer). (Calibration note: 2507.10616 is a single, 0-citation preprint whose own abstract calls the finding a “preliminary indication,” not a settled result — that is the confidence level to carry for this citation everywhere it appears in this book. Other chapters that cite it as a flat, unhedged “principle” or a “confirmed”/“project-confirmed” finding are miscalibrated against the paper’s own abstract and should be brought in line with the hedge above, not the reverse.)

How much a stage buys, where disclosed (this is rarely cleanly ablated — say so):

StageDisclosed deltaSourceHonest caveat
Mid-training/annealing+12.3% to +18.7% downstream, at 5–10% of pretrain FLOPsOLMo 2, Table 2 2501.00656Fully open data/code — one of the only genuinely ablated per-stage numbers in this whole thread
SFT → DPO → RLVR, average score8B: 60.6 → 64.7 (+4.1) → 65.1 (+0.4); 70B: 72.6 → 76.2 (+3.6) → 76.2 (+0.0); 405B: 77.5 → 79.6 (+2.1) → 80.7 (+1.1)Tülu 3, Table 3 2411.15124The average column hides where the real gain lives — RLVR’s aggregate contribution looks ~0 at 70B, but MATH-specifically it went 59.9 → 67.3 (+7.4) at 405B. Don’t evaluate a stage by its average-score delta alone (this is the direct precedent for §6’s “track the narrow-skill delta, not the average”)
Cold-start SFT dose“Thousands,” not hundreds of thousands (R1); Llama 2 ceased at exactly 27,540 annotations, having found “fewer but better-quality examples led to notable performance improvements”2501.12948, 2307.09288Cold-start dose is a genuine hyperparameter, not “as much data as you can get” — over-investing risks capping RL per the Llama 4 finding above
Iterative-round non-monotonicityEarly Llama 2 RLHF, sampling only the latest round for rejection-sampling data, caused a documented regression (“struggled more… to compose rhyming lines”)2307.09288Compounding is not free/monotonic by default — you must deliberately mix in older-round data or silently regress a capability an earlier round had

Synthesis — settled vs. contested, stated honestly: the “cold-start stabilizes RL,” “heavy SFT/DPO caps RL exploration,” and “iterative rounds compound only if you mix old+new data” claims are high-confidence, multi-source-corroborated. “SFT memorizes / RL generalizes” as a clean universal law is not settled — it holds in controlled game/navigation environments, is nuanced by a nearer-2026 result showing the useful range of SFT checkpoints to RL from is bounded, not “less SFT is always safer.” Clean, ablated per-stage attribution is rare — of everything surveyed across this whole thread, only Tülu 3 and OLMo 2 disclose a genuine stage-by-stage number; treat any single-number stage-attribution claim (including the ones in this chapter) with the same skepticism the Tülu 3 MATH-vs-average gap earns.


4. What I’d change in the project’s pipeline — order + dosage

  1. Even a small, cheap cold-start SFT stage (thousands, not millions) ahead of GRPO/RLVR is worth the compute purely for RL stability/format-compliance, independent of whether it raises the reward ceiling.
  2. Audit SFT/DPO data difficulty before RLVR — Llama 4’s explicit fix (drop >50% “easy,” train the hard remainder) is the single most actionable, frontier-lab-disclosed lever available; this project’s harness-generated CTF trajectories should be difficulty-scored before SFT, so the later GRPO stage still has exploration room on hard challenges.
  3. RL will not inject a capability the base/SFT policy cannot already sample — if a CTF category stays at ~0% under GRPO, that is evidence the capability needs to enter via SFT (ideally teacher-distilled), not via more RL steps against the same reward.
  4. When iterating multiple GRPO rounds, mix in earlier-round data when constructing later rounds’ SFT/preference sets, per Llama 2’s own documented regression when it didn’t.
  5. Track narrow-skill deltas per stage, not just the eval average — a stage can look like ~0 aggregate contribution while delivering the specific skill-targeted gain (CTF-category solve-rate, in this project’s case) that actually mattered.

5. The synthetic-trajectory bootstrap — teacher writes it from the answer

A trajectory used for cold-start SFT can come from two structurally different sources, and conflating them is the single most common mistake in this literature:

  • Off-policy synthetic — a different, usually bigger model writes the trajectory (distillation, Self-Instruct 2212.10560, Evol-Instruct/WizardLM 2304.12244, persona-driven synthesis 2406.20094). The trajectory was never in the student’s own output distribution.
  • On-policy synthetic (self-generated + filtered) — the model being trained writes the trajectory itself; a verifier decides which ones to keep (STaR 2203.14465, RAFT 2304.06767, ReST-EM 2312.06585, the rejection-sampling stage in R1/Tülu 3). The trajectory is always something the model could actually produce.

Where each slots into the sequences above: off-policy synthetic belongs at Stage 2 (SFT cold-start) in both Sequence A and B — it fixes format/instruction-following/tool-syntax. On-policy synthetic belongs at Stage 3 (rejection-sampling) in both — this is where genuine skill-compounding starts, because the training signal is now grounded in the model’s own execution.

The off-policy caveat: cold-start knowledge, yes — execution gap, no

Off-policy teacher trajectories are excellent for cold-start but do not close the execution gap, and this needed cross-referencing several 2025–2026 papers because no single seminal paper states it cleanly:

  • Theoretical reason (DAgger lineage / covariate shift): SFT on teacher-written trajectories trains only on teacher-visited states. At inference the student generates autoregressively from its own prior tokens/actions — the moment it errs somewhere the teacher never did, it enters a state distribution it was never trained on, and errors compound. “Revisiting DAgger in the Era of LLM-Agents” states this precisely for multi-turn agents: “SFT provides dense teacher supervision but suffers from covariate shift because it is trained on off-policy teacher trajectories; while RLVR avoids this off-policy mismatch by learning from on-policy rollouts but with only sparse outcome feedback” 2605.12913 (medium-high confidence, very recent). A companion result on SWE-bench: pure off-policy imitation on expert trajectories suffers covariate shift; mixing in on-policy expert corrections gives +13–14% relative gain over traditional imitation (OpenReview KXAJtW8Bib, ICLR 2026 submission).
  • Empirical confirmation — distillation only expands capability (pass@k) when it brings NEW knowledge, not pattern imitation. A controlled ablation compares base model vs. real DeepSeek-R1-Distill (trained on genuine teacher trajectories, “likely incorporates substantial new knowledge”) vs. a distilled model trained only on teacher responses for questions the base model’s own output distribution already covered (pure pattern transfer, zero new knowledge): “both distilled models significantly improve accuracy, [but] only the DeepSeek model shows a meaningful increase in capability” 2505.14216 (high confidence — direct quote, this is the single most load-bearing paper for this nuance).
  • Why this is categorically worse for agentic tool-use than for math CoT: a math CoT is a single linear token stream — the “state” barely diverges from what the teacher wrote. A CTF-solving trajectory is multi-turn and environment-coupled — tool call → real stdout → next decision. The instant the student’s tool call returns different real output than what was baked into the teacher-written trajectory (different port open, different file present), the student is off the teacher’s distribution with no grounded behavior for that state. The environment, not just the model’s own tokens, is a second source of state divergence a teacher trajectory can never have anticipated.

The confabulation risk — backward synthesis needs the same warning label

This chapter’s Stage 2 (teacher-writes-from-the-answer) is exactly STaR’s “rationalization” pattern, whose cognitive-anchor failure mode and naive-mitigation-backfires nuance are covered in full in hint-guided-bootstrapping.md — the same warning applies directly to the cyber instantiation below.

The cyber instantiation

Applying the above to the project’s own harness (extrapolation from general theory, not from an academic cybersecurity-LLM paper): use a strong external model to write CTF-solve trajectories for challenges you already have ground-truth flags for — but treat that corpus strictly as cold-start (format, tool-call syntax, instruction-following). Every single trajectory must be gated through the real flag verifier (the actual environment check, flag_verified, not a regex on the model’s claimed flag) before it enters SFT — per the post-hoc-rationalization warning above, a teacher that already knows the flag can write a plausible-looking exploit chain that never actually ran against real environment state. Then budget real compute for a rejection-sampling pass on the agent’s own real rollouts before RL, because per the covariate-shift/execution-gap evidence above, off-policy teacher data cannot by itself close the gap between “writes a plausible exploit chain” and “actually recovers from a real tool-call failure the harness will hit.” This is the direct, cyber-specific reading of Sequence B’s Stage 2 → Stage 3 transition (§2).


6. How to evaluate Sequence B stage-by-stage

Answer, up front: evaluate at every stage boundary, with a single frozen held-out suite run against each checkpoint as it’s produced — never re-run from scratch, never wait for the final model. This is exactly the pattern Tülu 3 and OLMo 2 use in the open literature, and DeepSeek-R1’s own developmental-stage table demonstrates the diagnostic payoff directly: comparing R1-Zero against “Dev1” (cold-start SFT added) shows Dev1 gaining on IFEval/Arena-Hard but losing ground on AIME, attributed to “the limited size of the cold-start dataset” 2501.12948 — a stage regression that is only visible because they evaluated at the intermediate checkpoint, not just at final R1. Tülu 3’s own words: “our methodology facilitates identifying skill deficiencies and refining the data mix… ensuring a balanced performance of core skills across the training process” 2411.15124 — and they release the actual intermediate checkpoints (Tulu3-SFT, Tulu3-DPO, final RLVR model) specifically so this comparison is reproducible. Cost asymmetry reinforces the case: RLVR/GRPO is the most expensive stage in the sequence — discovering an SFT-stage defect only after a multi-day RL run has already summed sunk cost you didn’t need to spend.

Per-stage metrics — the frozen suite is fixed, but what you watch closely changes by stage:

  • After (optional) CPT: held-out domain-knowledge QA (not CTF-solving — pure recall of the corpus you just trained on) + a general-capability retention check (MMLU/IFEval before/after). “Domain-continual pretraining induces moderate forgetting with low-to-moderate backward transfer” 2510.17776 — CPT is the mildest of the post-training stages for forgetting, but not free.
  • After SFT cold-start: initial pass@1 on the target task family + format/instruction-adherence (IFEval-style: does it actually follow the tool-call schema). This is the stage with the sharpest forgetting risk in the literature — one documented case: SFT dropped a benchmark 52.1%→40.1% while RFT improved the same setting to 54.2% 2507.05386; a Qwen-family (dense, directly relevant) result documents SFT degrading TruthfulQA/HaluEval on Qwen3-4B specifically 2605.20005. MMLU/IFEval must be in the frozen suite at the SFT checkpoint, not just at the end.
  • After preference opt: win-rate on a held-out preference-eval set (the thing DPO/KTO directly optimizes) and re-run the same pass@1 suite from the SFT checkpoint — DPO should not regress raw task-solve rate; if it does, β or the preference data is miscalibrated. Tülu 3 separates “development” evals (looked at between stages) from “unseen” evals (reserved until the end) precisely so preference tuning doesn’t overfit the eval suite itself 2411.15124 — mirror this split.
  • After RLVR: pass@1 AND pass@k, not pass@1 alone (§3’s argument, restated as a diagnostic here) — plus the live reward/entropy curve during training. Naive GRPO’s entropy-collapse failure mode (“the entropy of the policy decreases quickly… sampled responses of certain groups tend to be nearly identical… limited exploration”) only reached 30/100 AIME points vs. DeepSeek’s reported 47 before a fix (Clip-Higher) was applied — DAPO 2503.14476. A frozen post-hoc suite alone will not catch this; you need the live curve as an in-training diagnostic in addition to before/after checkpoint comparisons.

Pass@k, per funnel stage, is the specific diagnostic RLVR requires that earlier stages don’t. “Does RL Really Incentivize Reasoning Capacity in LLMs Beyond the Base Model?” (636+ citations in ~14 months, ICML 2025 AI4Math Oral — well-validated) shows: RLVR wins at small k, base models overtake at large k, and “the reasoning capability boundary… often narrows as RLVR training progresses” 2504.13837. If you track pass@1 alone at the RLVR checkpoint, an RL run that is actively narrowing solution-space diversity looks like a pure win right up until the model needs to solve something outside the narrowed distribution — a genuinely novel CTF challenge, or the hard tail of the funnel. Compute pass@1 and pass@k (k matched to this project’s own locked methodology — k=3 pilot, k=5 real, k=10 edge-band) against the base model’s own pass@k on the same suite as the reference ceiling, not just the previous checkpoint — and do this per funnel stage (F1–F4), not only as one aggregate number, so “RLVR improved pass@1 on easy challenges but narrowed pass@k on hard ones” is visible on a training-stage × funnel-stage grid rather than hidden inside an aggregate.

Guardrails at every stage. Forgetting-risk ranking across the literature converges: SFT is the worst offender, CPT is moderate, RLVR/RFT is the gentlest and can even improve general-capability numbers in some cited settings 2507.05386 — treat the ranking as transferable, the exact percentages as architecture/task-specific. Held-out discipline: never let training data overlap with the frozen eval suite — Tülu 3’s own rule is “removing any training set that has overlap with more than 2% of our evaluation suite” 2411.15124, a concrete, adoptable threshold (treat as convention, not law).

Ablation to attribute contribution and decide where to restart. Hold the frozen suite fixed, run the full sequence with a stage included vs. skipped, compare final-checkpoint numbers on the same suite. DeepSeek-R1’s own R1-Zero-vs-R1 comparison is this ablation, published. Reading the result: if ablating stage N barely moves the frozen-suite numbers, stage N is a target for shrinking/dropping in the next iteration — restart from the checkpoint just before stage N, don’t re-run the whole sequence. If ablating stage N causes a big regression, it’s load-bearing and any future recipe change must preserve it. This is the direct empirical test of “order is load-bearing” for this project’s specific data, not just an inherited belief from the literature — and DAPO’s own reproduction difficulty (only 30/100 AIME with naive GRPO despite a strong base) is a reminder to isolate order-effects from hyperparameter-effects before attributing a regression to staging.


7. The cyber mapping — Sequence B, instantiated

This project runs Sequence B. Mapping each rung to a concrete cyber-data instantiation (extrapolation from the general theory above, applied to this project’s own harness — not from an academic cybersecurity-LLM paper):

Sequence B stageCyber-specific data at this rung
0. Base-vs-instructStart from the Base checkpoint of whatever Qwen/Llama-class dense model is chosen — matches all three frontier open recipes and avoids inheriting a chat-alignment prior that resists long-CoT/tool-use/verifiable-reward shaping
1. (Optional) CPTIf the security corpus (CVE descriptions, tool docs, writeups, security-agent-<family> trace history) is a genuine token corpus, not a handful of curated docs — run it as full-FT, low LR, before SFT. If it’s small/curated, skip this stage; push the knowledge in as SFT context/retrieval instead
2. SFT cold-startA strong external model writes CTF-solve trajectories for challenges with already-known, ground-truth flags — off-policy, format/tool-syntax-only. Gate every trajectory through the real flag verifier before it enters SFT (§5’s confabulation warning applies directly)
3. Rejection-sampling / on-policy SFTRun the cold-started model as the agent in the real harness. Sample K trajectories per challenge (temp ~0.7, per RFT/ReST-EM’s exact hyperparameters), keep only trajectories where the real environment state produced the real flag — not a string match on FLAG{...} in the model’s text, an actual environment check. This is the step that closes the execution gap
4. Preference (DPO/KTO)Contrast verified-correct vs. verified-incorrect trajectories from the same rejection-sampling pool; use KTO if only cheap binary “good/bad” labels exist (from a trace-verification tool), DPO if genuine paired trajectories on the same challenge exist
5. RLVR/GRPOSame ground-truth flag verifier as the reward function — the verifiable-reward signal (flag captured / exploit worked) and the preference signal (report quality, doesn’t waste turns) are genuinely orthogonal here, arguing for RLVR-then-short-DPO-polish ordering (Tülu 3/Nemotron pattern) rather than folding both into one stage
6. IterateMint the next round’s cold-start/rejection data from the current RL-converged checkpoint (R1’s own stage-3 pattern) — budget at least two RL↔rejection-sampling round-trips before calling a GRPO baseline “done”

Cross-links: What the frontier labs actually do (2026) for the per-lab method survey this chapter’s stage-skeleton was built on; The path to a frontier cybersecurity model for the domain-specialization lineage (code/math/medical) that cross-validates this same stage-skeleton and the current gap analysis against this project’s own harness; Diagnosing the gap — a scientific framework for how a measured failure mode maps to which stage needs the fix; Where you are & the forks ahead for how this sequence view resolves into this project’s next concrete decision.

Is the recipe a loop?

The recipe is a sequence, not a pick established that post-training is an ordered stage skeleton (base → CPT → SFT → rejection-sampling → preference → RLVR), not a single technique choice. This chapter asks the structural question that skeleton leaves open: does the sequence run once, left to right, or does it loop back on itself?

Concretely: (1) what stays one-shot, outside any loop, vs what gets repeated, inside one? (2) Can you go SFT → RL → back to SFT → RL again? Is RL run once or N times — and can you go back to DPO after RL? (3) When you revisit a stage, do you continue from the current checkpoint or restart from the base model (a fresh fork)? (4) Non-commutativity — is a stage applied late the same operation as the same stage applied early, or does the model’s accumulated drift/forgetting make it a genuinely different intervention? (5) The payoff: given N known behaviors to fix, do you plan a unidirectional roadmap (one behavior per stage, run once, ship) or an iterative loop that re-targets whatever the current measurement says is the bottleneck?

Point (5) is not a new axis — it is decomposition-vs-monolithic (dissect the problem into independent sub-problems, or treat it as one) projected onto the sequence instead of onto architecture. Keep that identity in view throughout: “how many sub-policies” and “how many rounds” turn out to resolve the same way.

Stance held throughout, per project standing rule: no claim below is grounded in an academic cybersecurity-LLM project (CTF-Dojo, Cyber-Zero, Pentest-R1, HackSynth, AutoPenBench, DRLRM-PT) — none appear as evidence anywhere in this chapter. Grounding is frontier-lab technical reports and general RL/ML theory, cross-checked with this project’s own funnel/pass@k methodology. Every arXiv id below was verified live (arXiv API / ar5iv crawl) during the research pass this chapter draws from — confidence is stated per claim, and “contested” or “promising, not yet validated” is used honestly where the evidence doesn’t close the question.


1. IN the loop vs OUT of the loop

Not every decision is a loop candidate. Conflating a one-shot wall with an iterable stage is the most common planning error here.

flowchart TD
  subgraph OUT["OUT of the loop -- one-shot, never revisited"]
    direction TB
    Pre["Pretraining\n(the base-model generation you inherit)"] --> Mid["Mid-training / annealing\n(context extension, curated upsample)"]
    Mid --> Wall["THE WALL\nfrozen base/instruct checkpoint\n+ tokenizer/precision/serving stack\n+ reward contract (flag_verified)"]
  end

  Wall --> Cold["Cold-start SFT\n(small, format-only, once)"]

  subgraph IN["IN the loop -- the iterated tail"]
    direction TB
    Cold --> RS["Rejection-sampling /\non-policy SFT"]
    RS --> Pref["Preference opt\n(DPO/KTO)"]
    Pref --> RLVR["RLVR / GRPO"]
    RLVR -.->|"generate next round's\nSFT data from THIS\ncheckpoint's rollouts"| RS
    RLVR -.->|"DeepSeek-R1: retrain\nfrom clean base with\nRL-checkpoint-generated data"| SFT2["SFT (round 2)"]
    SFT2 -.-> RLVR2["RL (round 2)"]
  end

  classDef out fill:#2b1313,stroke:#f87171,color:#fde8e8;
  classDef wall fill:#3a2a10,stroke:#f5b942,color:#fff3d6;
  classDef in fill:#132b22,stroke:#34d399,color:#eafaf3;
  class Pre,Mid out;
  class Wall wall;
  class Cold,RS,Pref,RLVR,SFT2,RLVR2 in;
DecisionOne-shot or iterated?WhySource
Pretraining + mid-training/annealingOne-shot, outsideProduces a single frozen checkpoint; every post-training round sits on top of it, never through itLlama 3 2407.21783: pretrain → long-context pretrain → anneal, described once
Base-vs-instruct starting checkpointOne-shotLoad-bearing for everything downstream; never revisited mid-recipeDeepSeek-R1, Qwen3, Tülu 3 all start from Base (2501.12948, 2505.09388, 2411.15124)
Tokenizer / precision / serving stackOne-shot per experimentMixing across rounds destroys the ability to attribute a delta to the training change vs. infra noiseproject handbook, “same-provider rule”
Reward contract (ground-truth verifier, never a proxy)One-shot, permanently fixedEvery loop round optimizes against this fixed oracle; changing it mid-loop invalidates every prior round’s comparisonproject convention
Cold-start SFT (format/readability — what it is, dosage evidence, R1-vs-R1-Zero ablation: The recipe is a sequence, §2-3)One-shot, small, early — but its data regenerates each loopJob is narrowly “stabilize RL’s starting point,” not teach the skillDeepSeek-R1 “thousands” 2501.12948; Qwen3 explicit design intent to minimize it 2505.09388
Rejection-sampling SFT, DPO/KTO polish, RLVR/GRPOIterated — this is the loopEvery frontier recipe surveyed repeats this triad in roundssee §2

loop_takeaway: the pretrain/anneal wall is the real boundary — think of the base checkpoint (+ the reward contract, + the infra pinning) as an immutable artifact received once per experiment. Everything after that wall is fair game for revisiting; nothing before it is. Confidence: high (direct, repeated frontier-lab framing across independent recipes).


2. Yes, you can revisit stages — this is standard, not exotic

DeepSeek-R1’s own pipeline is SFT → RL → SFT → RL, quoted directly (arXiv:2501.12948):

“we begin by collecting thousands of cold-start data to fine-tune the DeepSeek-V3-Base model. Following this, we perform reasoning-oriented RL… Upon nearing convergence in the RL process, we create new SFT data through rejection sampling on the RL checkpoint… and then retrain the DeepSeek-V3-Base model… After fine-tuning with the new data, the checkpoint undergoes an additional RL process, taking into account prompts from all scenarios.”

Stage-by-stage: ColdStartSFT → RL₁ (reasoning-only) → rejection-sample RL₁’s rollouts → SFT₂ (~800k = 600k reasoning + 200k general, 2 epochs) → RL₂ (all-scenario, reward model added for helpfulness/harmlessness). SFT happens twice, RL happens twice — a fixed 4-stage round-trip, not an open-ended loop. This is the flagship reasoning-model recipe of 2025, not a hack.

Llama 3 runs 6 explicit iterative rounds, quoted directly (arXiv:2407.21783):

“Following Llama 2, we apply the above methods in six rounds. In each cycle, we collect new preference annotations and SFT data, sampling synthetic data from the latest models.”

Each of the 6 cycles: collect new human preference annotations against the current best model → update the reward model → rejection-sample new SFT data from the current policy → SFT → DPO → evaluate → feed forward into round i+1. Reference model, sampling policy, and SFT targets all update round-to-round — this is Meta’s answer to “RL once vs N times” for preference optimization: DPO N times (N=6), never PPO-style online RL in the main loop.

Iterative DPO more broadly is a named, established pattern, not a DeepSeek/Llama-specific quirk: Self-Rewarding Language Models (arXiv:2401.10020) runs Llama 2 70B through 3 iterations where the model generates and judges its own new preference pairs each round, instruction-following improving monotonically for those 3 rounds specifically because both the judge and the generator are re-derived from the current policy each time, not frozen. Apple’s AFM iTeC (arXiv:2407.21075) goes further — instead of committing to one linear stage order, it keeps a committee of RS/DPO/IPO/online-RL variants alive every round and lets round-over-round evaluation pick which optimizer propagates. STaR (arXiv:2203.14465) is the theoretical minimum-viable ancestor of all of this: “generate rationales… fine-tune on all the rationales that ultimately yielded correct answers; repeat” — no reward model, no PPO, just sample-filter-tune-repeat, with the outer loop drawn explicitly as a loop back through fine-tuning in the paper’s own Figure 1.

Confidence: high — DeepSeek-R1’s round-trip and Llama 3’s 6 rounds are both verbatim, primary-source quotes; iterative DPO / committee patterns are independently corroborated across three more labs.

Continue from checkpoint, or restart from base?

This is where the practice genuinely splits, and the split is not random — it correlates with which stage is being revisited, not with “how iterative the lab is” in general.

  • Continue-from-latest is the default for RL. Llama 3 samples “from the latest models” every round; DeepSeek-R1’s RL₂ “retains most of the parameters from the first stage” (Nature companion paper, s41586-025-09422-z); Apple’s iTeC committee explicitly includes “the best models from previous iterations.” Continuing is cheap and is what “successive rounds” literally means for RL.
  • Restart-from-base is the disclosed convention for SFT-revisits. DeepSeek-R1’s SFT₂ explicitly “retrain[s] the DeepSeek-V3-Base model” — the RL₁ checkpoint’s job is purely to generate the data; its weights are discarded, and a clean copy of base is fine-tuned on the newly curated set. This exact asymmetry is independently reconfirmed by Havrilla et al., Teaching LLMs to Reason with RL (arXiv:2403.04642): “for both EI and RCRL we generate data with the SFT checkpoint but reset training to start from the pretrained base model… we find this model resetting is crucial for achieving best performance.” — and by STaR before either. Three independent groups converge: when you revisit SFT, restart from the clean base using freshly-generated data; when you continue RL, continue from the current best checkpoint.
  • ReST-EM is the disclosed exception that restarts everything — it fine-tunes from the base pretrained model at every outer iteration, generate-and-improve, “to mitigate task-specific overfitting” (arXiv:2312.06585). Flag this as a genuine, disclosed disagreement: restart-vs-continue is contested as a global policy, but converges cleanly once you split it by stage type (see below).
  • A controlled A/B on exactly this variable, University of Chicago, “Iterative Finetuning is Mostly Idempotent” (arXiv:2605.01130, 2026, 0 citations — promising, not yet independently replicated): “trait amplification can reliably occur when a model is continually trained with a preference for its own outputs, but vanishes when models are reinitialized at each cycle.” Mechanism: restarting each cycle makes the dataset — not accumulated weight-drift — the only thing carried forward, so errors don’t compound; continuing creates a persistent optimization trajectory where each round’s update stacks on the last one’s direction, which is exactly what you want for RL (build on exploration gains) and exactly what you don’t want for SFT (narrow imitation of one round’s possibly-idiosyncratic data compounding on top of already-drifted weights).

loop_takeaway: “continue vs restart” is not one global policy for the whole loop — it is a per-stage decision. Restart for SFT-revisits (use fresh, RL-generated data against a clean base). Continue for RL-revisits (build on the current policy). Confidence: high on the convergence (four independent groups); medium on the precise mechanism (the idempotence paper is single-team and studies persona drift, not CTF capability — a well-argued generalization, not a domain-proven fact).


3. The constraints on revisiting — five things that make a loop non-free

A loop is not a free repeat button. Five independent, converging bodies of evidence bound how you can run it.

(a) Forgetting accumulates, and severity is data-scale-dependent, not a fixed law. Continual instruction-tuning shows catastrophic forgetting is the norm and — counterintuitively — worsens with model scale in the 1B–7B range studied (arXiv:2308.08747). A more recent, larger study (arXiv:2510.17776) refines this: forgetting is not a single scalar that always gets worse — RL/SFT from a base model shows moderate-to-large backward transfer (net gain) with low/moderate forgetting elsewhere, while RL/SFT applied to an already instruction-tuned model is data-scale sensitive (“mixed, warrant further study” at large extra data-scale). Model merging does not reliably mitigate forgetting (yet) per the same source — don’t treat souping as a free pass. Confidence: high that CF is real; contested on exactly how it scales with round count.

(b) Diminishing returns, then instability, past some round count. The first systematic study of overoptimization dynamics across iterations of iterated RLHF (arXiv:2505.18126) finds overoptimization itself decreases over successive iterations (the reward model increasingly approximates ground truth) but performance gains diminish over time — the classic curve. Self-rewarding iterative DPO shows the same shape empirically: gains shrink each iteration on ~7B models due to “accumulated bias in the reward system” (arXiv:2410.12735). Left unmanaged, prolonged RL degrades further into outright instability — entropy collapse, KL spikes — not just plateauing (ProRL, §c below).

(c) Fresh, on-policy data is needed each round — reusing stale rollouts is the single most common silent failure. Off-policy preference optimization “often suffers from a distributional gap between the policy used for data collection and the target policy” and even reweighting fixes don’t fully close it (arXiv:2406.11827); a theoretical result shows DPO’s gradient-signal magnitude scales with how much the generating distribution underrepresents high-reward responses relative to the current policy — multi-round online DPO, resampling from the updated policy each round, is “a principled justification, not a heuristic” (arXiv:2506.04272). loop_takeaway: if you revisit an RL/DPO stage, regenerate the preference/rollout data from the CURRENT checkpoint before that round starts — reusing round-1’s rollouts in round-3 is now mechanistically explained, not just folklore.

(d) KL / reference-policy resets — even inside a single “RL stage,” you’re already looping. NVIDIA’s ProRL (arXiv:2505.24864, NeurIPS 2025) names the failure directly:

“as training progresses, the KL term may increasingly dominate the loss, leading to diminishing policy updates. To alleviate this, we introduce… reference policy reset: periodically, we hard-reset the reference policy π_ref to a more recent snapshot of the online policy π_θ, and reinitialize the optimizer states.”

Every ~200–500 steps, ProRL hard-resets π_ref ← π_θ (current). This is a round boundary inside a single nominal RL stage — the same continue-vs-reset mechanics from §2 recur at a finer grain than the macro-level loop this chapter otherwise describes.

(e) Model merging is a real alternative to sequential stacking — not a solved one. Task Arithmetic (arXiv:2212.04089) → Model Soups (arXiv:2203.05482) → WARM (souped reward models, arXiv:2401.12187) → WARP (arXiv:2406.16768) is a well-cited genealogy of “instead of chaining rounds sequentially, train branches independently and merge in weight space.” WARP is the sharpest instance: it merges inside every RL iteration (EMA anchor, spherical interpolation across independently-RL’d policies, linear interpolation back toward the pretrained init) and runs the whole procedure iteratively — merging used as the revisit mechanism, not a post-hoc alternative to it. But the (a)-cited 2510.17776 finding — “model merging does not reliably mitigate forgetting (yet)” — is a direct, recent tension with WARP’s own framing. Confidence: high that merging exists and works in cited settings; contested on how general the forgetting-mitigation benefit is.

Non-commutativity: a stage applied late is not the same operation as applied early

This is the sharpest, most directly answerable part of the question, and it now has a formal proof, not just observation. Niu, Bai, Han, Zhang, On the Non-decoupling of SFT and RL in Post-training (arXiv:2601.07389, Jan 2026) prove:

  1. SFT-then-RL coupling (Thm 3.1): even if SFT has already converged (loss no longer decreasing), a subsequent RL phase still measurably increases SFT loss — RL’s reward-seeking updates degrade what SFT had converged to.
  2. RL-then-SFT coupling (Thm 4.1): symmetrically, if RL has already converged (reward no longer improving), a subsequent SFT phase degrades the reward RL had achieved.

These are two different theorems with different mechanisms, not mirror images — confirmed empirically on Qwen3-0.6B (abrupt degradation in cross-entropy or reward exactly at the transition point, both directions). The proof is very recent (0 citations at verification time — promising, not yet peer-validated), but it formalizes a pattern already independently observed four other ways:

  • DeepSeek-R1’s own ablation. R1-Zero (RL, no cold-start SFT) reaches the same eventual reasoning capability as R1 but a materially worse behavior profile (poor readability, language mixing) — the paper’s own stated reason cold-start exists: “starting RL training from an uninitialized model can lead to instability and slow convergence” (2501.12948). Order changes the character of the result, not just a scalar.
  • Llama 4’s explicit reversal of Llama 3’s emphasis — thin SFT/DPO, intensive RL, because “SFT and DPO can over-constrain the model, restricting exploration during the online RL stage” (Meta blog, already cited in The recipe is a sequence).
  • Scale-dependence within one family: Magistral Medium runs pure GRPO, zero SFT (AIME’24 pass@1 26.8→73.6 from RL alone); Magistral Small (24B) needs SFT-then-GRPO because RL-only underperforms at that scale (arXiv:2506.10910) — the “right” order is conditional on how much latent capability the base already carries, not a fixed law even inside one lab.
  • Excessive SFT measurably reduces subsequent RL plasticity — over-confident, sharper output distributions from over-long SFT make the checkpoint harder for RL to reshape (arXiv:2606.09932); a companion result shows RL-after-SFT’s benefit is often a restoration of OOD capability that SFT itself degraded, not new capability (arXiv:2509.12235) — order and dose, not just presence/absence, determine the reachable end-state.
  • Meta FAIR’s >1M-GPU-hour study: the best post-SFT checkpoint is often NOT the best pre-RL checkpoint — over-trained SFT can do worse after RL than a less-optimized SFT checkpoint, or worse than skipping SFT entirely (arXiv:2510.01624).

loop_takeaway: treat “which stage, applied at which revisit-point” as a designed intervention with a predictable directional effect (RL heals OOD forgetting from SFT; more SFT reduces RL’s subsequent plasticity), not an interchangeable menu item. This is the concrete mechanism behind why an iterative loop targeting the current bottleneck beats a fixed unidirectional roadmap — the roadmap can’t know in advance which stage, at which point, will help or hurt, because that depends on the accumulated forgetting state the loop itself creates. Confidence: high on the empirical pattern (independently replicated across five groups); promising, not yet peer-validated on the formal proof itself.


4. Planning to fix N behaviors: iterative-target-the-bottleneck, not one-per-stage

Given N known behaviors to fix (this project’s own F1–F4: discovery/exploration, exploit-skill, tool-use, pivot/long-horizon — see Diagnosing the gap), the naive plan is a unidirectional roadmap: assign F1 to stage A, F2 to stage B, F3 to stage C, F4 to stage D, run each once in order, done. It is attractive because it reads like a project plan with a finish line. It is the wrong shape, for three concrete reasons, each backed by evidence already established above:

  1. It assumes the behaviors are independently addressable. §3’s non-commutativity evidence says otherwise — an earlier stage’s fix for one behavior can foreclose exploration a later stage needs (Llama 4’s own warning), and a later stage’s technique can silently erode what an earlier stage already fixed if old-round data isn’t remixed in (Llama 2’s own documented regression, below).
  2. It commits the technique before measuring which behavior is actually the current bottleneck. A technique correctly matched to the dominant gap in round 1 may be the wrong match by round 3, once the policy has moved — the same technique (e.g. staged/dense reward) helps a weak policy and washes out as the policy strengthens (arXiv:2603.21972, already cited in decomposition-vs-monolithic). “Which of F1–F4 is dominant” is an empirical, round-to-round question, not a fixed assignment.
  3. It has no natural stopping rule. “Run each stage once” either stops before the gain saturates or keeps running stages that have already plateaued — burning compute and forgetting budget for near-zero marginal return (§3b/§3a).

A concrete, documented cost of skipping the “keep old data in the mix” discipline: early Llama 2 RLHF, confined to rejection-sampling only from the latest round’s data (not pooled across all prior rounds), produced a silent regression — “RLHF V3 struggled more than previous versions to compose rhyming lines in poems” (arXiv:2307.09288). They fixed it by pooling across all prior iterations, not by restarting from base. This is forgetting accumulating specifically because of round-order discipline, independent of any single stage’s technique.

This is the decomposition-vs-monolithic axis, projected onto the sequence

The already-settled verdict for architecture is: decompose the eval unconditionally (cheap, safe, diagnostic), but do not decompose training into independently-trained sub-policies wholesale — gate any training-side change on what the eval funnel actually shows (decomposition-vs-monolithic). Projected onto time instead of architecture, the identical logic reads: decompose the measurement into per-round funnel snapshots (cheap, safe, diagnostic) but do not commit training to a rigid, pre-planned, one-behavior-per-stage roadmap — gate each round’s technique choice on what that round’s funnel snapshot shows. “How many sub-policies” and “how many rounds, fixed in advance vs re-decided” are the same decision, and both resolve the same way: decompose the cheap diagnostic layer freely; keep the expensive training-loop commitment conditional and re-evaluated, never frozen in advance.

Every frontier recipe surveyed in this chapter is itself built this way. GLM-4.5’s difficulty-curriculum switch is explicitly signal-triggered, not schedule-triggered — switch to harder problems “once static data goes stale,” measured as zero reward-variance, not a pre-committed step count. Llama 2’s RLHF-V1→V5 reward-model retraining is paced by “as we received more batches of human preference data,” not a calendar. Kimi K2’s Toggle mechanism alternates budget-limited vs unconstrained-scaling phases gated on a measured accuracy threshold. The empirically dominant pattern is not “pick one of {roadmap, loop}” — it is a coarse-grained roadmap (decompose behaviors into a small number of named stages, in a rough intended order — informed by §3’s non-commutativity finding, so front-load anything with a foreclosure risk) whose transitions are gated on measured bottleneck signals, not fixed in advance.

A loop-exit criterion — without one, a loop is an open-ended compute sink

Four converging, citable stopping signals:

  1. Explicit validation-saturation rule (Expert Iteration). Havrilla et al. (arXiv:2403.04642): “repeated until performance on a validation set saturates” — for their tasks, saturation happened at n=5 rounds. The round count is an output of the loop, not a pre-committed input.
  2. Measured, not assumed, diminishing returns at scale. A 20+-model scaling study (arXiv:2412.06000) finds RLHF gains “improve remarkably in the early stage… but additional data yields only marginal gains despite increasing training rewards” — RLHF scales less efficiently than pretraining. Track marginal pass@1/pass@k gain per round; route away once it flattens.
  3. A cheap go/no-go gate BEFORE spending RL compute on the next round. Held-out generalization loss + Pass@64 on the post-SFT checkpoint predict post-RL Pass@1 better than post-SFT Pass@1 itself (arXiv:2510.01624) — compute this before committing to another round.
  4. A general-RL-theory precedent for continue-vs-restart AND loop-exit combined. AlphaGo Zero’s self-play loop only ever promotes a challenger network to “current best” if it clears a measured win-rate bar in held-out games; otherwise the loop discards the challenger and tries again with fresh data (Silver et al., Nature 550, 2017 — no arXiv id, general RL theory, not fabricated). Never accept a round’s output on faith — gate promotion on a measured bar.

Concrete exit rule: exit (or route away from) a given technique/stage when any two hold: (a) the targeted behavior’s measured delta is within noise of the previous round, (b) Pass@64 on the post-round checkpoint is flat vs. the previous round’s, (c) a forgetting guardrail (held-out general-capability eval, or a non-targeted behavior’s own measured rate) has dropped since the previous round.


5. A concrete iterative-loop template for this project’s F1–F4 case

flowchart TD
    A["Round start: run the frozen\nfunnel + pass@1/pass@k\nagainst the CURRENT checkpoint"] --> B{"Which of F1-F4\nis the current\nbottleneck?"}
    B -->|"F1 discovery"| C["Route: curriculum sequencing\nor milestone shaping\n(no reward-contract change)"]
    B -->|"F2 exploit-skill"| D["Route: rejection-sampling SFT\non fresh own-verified solves --\nRESTART from clean base/\ncold-start checkpoint (S2)"]
    B -->|"F3 tool-use"| E["Route: elicitation-ladder first\n(prompt -> light SFT) before\ncommitting SFT capacity"]
    B -->|"F4 pivot/long-horizon"| F["Route: continue current\nGRPO/RLVR run -- CONTINUE\nfrom current checkpoint (S2)"]
    C --> G["Retrain the routed stage with\nfresh data from THIS round's\ncheckpoint (S3: on-policy)"]
    D --> G
    E --> G
    F --> G
    G --> H["Re-measure: funnel + pass@k +\nforgetting guardrail (held-out\ngeneral-capability + non-targeted\nbehaviors)"]
    H --> I{"Exit test: >=2 of\n(a) delta in noise\n(b) Pass@64 flat\n(c) guardrail dropped?"}
    I -->|"No -- still improving"| A
    I -->|"Yes -- plateaued\nor regressing"| J["Stop this stage's technique;\nmix this round's data into next\nround's SFT/preference sets\nregardless (S4: anti-forgetting);\nreport per-round, not one\nclosing number"]

Per round: (1) run the frozen eval suite against the current-best checkpoint at zero training-loop cost; (2) identify the dominant F1–F4 bottleneck this round — not a bottleneck assigned in advance, cross-check against a cheap elicitation ladder before assuming any gap needs a training-loop response at all; (3) route to the matching technique; (4) apply the §2 asymmetry — restart from clean base if this round revisits SFT, continue from current checkpoint if this round continues RL; (5) re-measure with the same frozen suite and apply the §4 exit test; (6) regardless of the exit-test outcome, mix this round’s data into the next round’s SFT/preference sets — the one documented failure mode of not doing this is a silent capability regression (Llama 2’s poem-rhyming loss), and it costs nothing to avoid; (7) report per-round which behavior was dominant, what was routed, what moved, what the exit test said — a running log, not a single closing verdict, because the honest answer is a split verdict by challenge subtype, not one number (see Diagnosing the gap).


Confidence summary

ClaimConfidenceBasis
Pretrain/anneal wall is the real one-shot boundary; base-vs-instruct + reward contract are one-shotHighdirect frontier-lab framing, multiple recipes
SFT→RL→SFT→RL (DeepSeek-R1) and 6-round SFT+DPO (Llama 3) are the modal frontier patternHighverbatim primary-source quotes, independently cross-confirmed
Restart-for-SFT-revisit / continue-for-RL-revisit asymmetryHigh (convergence) / Medium (mechanism)four independent groups (STaR, Havrilla et al., DeepSeek-R1, U Chicago idempotence study)
Restart-vs-continue as one global policyContestedReST-EM restarts everything; direct disagreement with the per-stage convention above
Forgetting accumulates with revisits; severity is data-scale-dependentHigh (CF real) / Contested (how it scales)2308.08747, 2510.17776
Diminishing returns then instability across rounds without resets/fresh dataHigh2505.18126, 2410.12735, ProRL
Model merging as revisit-alternative works in cited settings but isn’t a general forgetting fixHigh (exists) / Contested (generality)2212.04089→2406.16768; caveat 2510.17776
Non-commutativity is real and multiply-replicatedHigh (empirical) / Promising, unreviewed (formal proof)2601.07389, 2506.10910 (Magistral scale-dependence), 2606.09932, 2509.12235, 2510.01624
Iterative-target-the-bottleneck beats a rigid one-behavior-per-stage roadmapHighdirect structural analogy to the already-settled decomposition-vs-monolithic verdict, plus 3+ frontier recipes built this way
Loops need and get an explicit exit rule in practiceHighEI’s stated n=5-until-saturation rule, 20+-model scaling-plateau study, AlphaGo Zero’s gated-promotion precedent
Whether the F1–F4 bottleneck in round 1 stays dominant by round 3Contested / openscale-dependence evidence (2603.21972) says it should NOT be assumed fixed — this is itself the core argument against the rigid roadmap, and an empirical output of running the loop, not a plannable input

Cross-links: The recipe is a sequence, not a pick for the stage skeleton this chapter loops; One problem, or many? — monolithic vs decomposed for the architecture-side twin of this chapter’s sequence-side question; Diagnosing the gap — a scientific framework for the funnel/pass@k measurement machinery that routes each loop round; Before you train — instrumentation & data readiness for what must be in place before a loop round can even be measured; Where you are & the forks ahead for how this loop-vs-pipeline view resolves into this project’s next concrete decision.

Ordering rules: interleaving stages & fixing N problems

Is the recipe a loop? is the macro finding: post-training isn’t a one-shot pipeline, it’s a loop over a small set of anchors (base model, reward contract) with an iterated tail (SFT/RS → preference → RL, repeated, gated on measurement). This chapter is the micro companion — it does not re-derive the loop shape. It answers the question the macro chapter deliberately left as “routing logic”: once you know you’re in a loop, which stage-type is safe to apply after which, and does batching N problems into one round actually work, or is that a different failure mode than the loop shape already covers?

Three questions, precisely:

  1. Are the stage-types — {continued/domain pretraining, off-policy SFT, on-policy SFT/rejection-sampling, DPO/preference, RL (any variant)} — interchangeable across rounds, or is there a hard ordering constraint?
  2. Does off-policy SFT after on-policy RL erode the RL gains — and if DeepSeek-R1 does “SFT after RL” successfully, what’s actually different about it?
  3. Given N pass@k-identified problems, do you fix them one at a time or all at once?

Stance held throughout, per project standing rule: no claim below is grounded in an academic cybersecurity-LLM project — none appear as evidence. Grounding is frontier-lab technical reports and general RL/ML theory, verified live via Exa on 2026-07-02. Confidence is stated per claim; “contested” is used honestly where sources disagree.


1. The palette, and the one axis that governs all of it

The five stage-types in play, and where each sits on the on/off-policy axis:

Stage-typeOn/off-policy?What it actually does
Continued / domain pretrainingOff-policy (fixed corpus)Injects raw domain knowledge into the weights; no notion of the model’s own behavior at all
Off-policy SFTOff-policy (foreign demonstrator: human, teacher model, older checkpoint)Imitates a fixed target distribution the current policy did not generate
On-policy SFT / rejection-sampling (RS)On-policy (self-generated, filtered by a verifier)Imitates the current policy’s own correct rollouts — same objective (cross-entropy) as off-policy SFT, but the data source is what changes everything
DPO / other preference methodsEither — on-policy-anchored (self-vs-other, self-vs-earlier-round) or off-policy (arbitrary external pairs)Reranks existing behavior; doesn’t need a reward model, but the source of the pairs determines whether it’s coarse or refining
RL (any variant: trajectory/sequence/token-level, GRPO/GSPO/etc.)On-policy by constructionOptimizes the policy’s own rollouts against a reward signal; sharpens what’s already there rather than injecting new distribution

The axis, not the label, is what predicts safety. Two stages with the same name (SFT) can be opposite operations depending on whether the training targets came from π_θ itself or from something else. This is the single fact the rest of this chapter is built on — see the foundations chapter for the general theory (DAgger’s O(εT²) vs O(εT) compounding, arXiv:1011.0686).

Why RL is structurally different from SFT, not just “SFT with a reward term”: RL’s own policy- gradient update is implicitly biased toward staying KL-close to whatever policy produced the reward signal — this is RL’s Razor (Shenfeld, Pari, Agrawal, arXiv:2509.04259): “among all ways to solve a new task, RL prefers those closest in KL to the original model.” SFT has no such restoring force; it will happily converge arbitrarily far from the current policy if the target data says to. This mechanism — not folklore — is why what data an update pulls from matters more than which loss function it uses. Confidence: high — cross-validated on LLMs and robotic policies, ~110 citations at 10 months old.

A second, independent mechanism compounds this: RL monotonically collapses policy entropy early in training (Cui et al., The Entropy Mechanism of RL for Reasoning LMs, arXiv:2505.22617) — R = -a·exp(H) + b, entropy drops sharply, performance saturates as a direct consequence. By the time an RL stage “converges,” the policy is a narrow, overconfident distribution — the worst possible state to hit with a foreign gradient. Confidence: high (mechanistic + broad empirical replication, code public).


2. The ordering-rules table — the centerpiece

“Interchangeable” is the wrong frame. The constraint is directional and about data provenance, not a rigid stage-name sequence. Eleven concrete transitions, rated safe / conditional / erosive:

From → ToRatingWhy
Continued/domain pretraining → any post-training stageSafeOne-shot, precedes the wall; no policy exists yet to erode (is-the-recipe-a-loop §1)
Off-policy SFT (light, cold-start) → on-policy SFT/RS or RLSafeR1’s cold-start SFT is explicitly “thousands” of examples, sized only to stabilize RL’s starting point, not teach the skill (2501.12948)
Off-policy SFT (heavy/dense) → RLErosiveMeta’s own words: “SFT and DPO can over-constrain the model, restricting exploration during the online RL stage” (Llama 4 blog); independently ablated — over-SFT’d checkpoints show measurably worse post-RL plasticity (arXiv:2606.09932)
On-policy SFT/RS → RLSafe — the core loop transitionEvery frontier recipe surveyed does this; RL’s Razor explains the mechanism (arXiv:2509.04259) — RL anchors near whatever policy handed it the data
RL → on-policy SFT/RS (rejection-sample from the RL checkpoint)Safe — standard next-round bootstrapR1’s stage 3, verbatim; STaR (arXiv:2203.14465) is the theoretical ancestor. A formal proof (Niu et al., arXiv:2601.07389, Thm 4.1) shows even this causes some nonzero reward degradation — small, and recoverable by a following RL pass
RL → off-policy SFT (foreign demonstrations)Erosive — the hard constraintCHORD names it directly: training on expert data that “significantly diverges from the model’s established patterns” produces a “shift → readapt → overfit” curve (arXiv:2508.11408); DAgger’s quadratic-in-horizon compounding applies with maximal force here (arXiv:1011.0686, re-derived for LLM agents in arXiv:2605.12913); a large enough push can hit a point of no return RL can’t undo (“RL Is Neither a Panacea Nor a Mirage,” arXiv:2508.16546)
RL → DPO (light, on-policy-anchored pairs)Conditional/safe if lightLlama 4’s lightweight DPO-after-RL, explicitly scoped to “corner cases related to model response quality” — never the heavy pre-RL role DPO plays in Tülu 3
DPO → RL (RLVR reserved as the final specialization stage)Safe, proven in ≥1 frontier recipeTülu 3: SFT → DPO (on-policy-anchored preference pairs) → RLVR last, explicit in the abstract (arXiv:2411.15124). Llama 4 puts light DPO after RL instead — DPO’s exact position relative to RL is the one genuinely flexible slot, as long as it stays light
RL (round k) → RL (round k+1), same checkpointSafeContinue-not-restart is the established convention for RL revisits (is-the-recipe-a-loop §2) — not a stage-type change, included for completeness
On-policy SFT/RS → on-policy SFT/RS, next roundSafe only if data is refreshed from the current checkpoint each timeStale reused rollouts are “the single most common silent failure” per the macro chapter; must restart from a clean base each round using freshly-sampled data (the restart-for-SFT rule)
Sequential one-problem-at-a-time fine-tuning (any stage-type), problem i → problem i+1, no mixingErosiveDirect, documented: Llama 2’s rejection-sampling-only-from-latest-round regression on poem-rhyming (arXiv:2307.09288); general CF empirical study (arXiv:2308.08747); forgetting is also biased, not uniform, across categories (arXiv:2412.16469)
flowchart LR
  CPT["Continued/domain\npretraining\n(off-policy, coarsest)"] --> OffSFT["Off-policy SFT\n(foreign demos,\ncold-start -- LIGHT ONLY)"]
  OffSFT -->|"light dose"| RS["On-policy SFT / RS\n(self-generated,\nverified)"]
  RS --> DPO["DPO / preference\n(prefer on-policy-\nanchored pairs)"]
  DPO --> RL["RL -- GRPO/RLVR\n(sharpens; entropy drops;\nKL-anchored)"]
  RL -.->|"SAFE -- rejection-sample\nfrom THIS checkpoint"| RS
  RL -.->|"SAFE if LIGHT --\ncorner-case polish"| DPO
  RL -. "EROSIVE -- foreign demos\nonto an entropy-collapsed,\nKL-anchored policy" .-> OffSFT

  classDef coarse fill:#3a2a10,stroke:#f5b942,color:#fff3d6;
  classDef safe fill:#132b22,stroke:#34d399,color:#eafaf3;
  class CPT,OffSFT coarse;
  class RS,DPO,RL safe;

loop_takeaway: coarse/foreign-distribution work goes early and stays light; on-policy/self- distribution work goes late and gets repeated; the one edge that is never safe at full strength is foreign data flowing back onto a policy an RL stage has just sharpened. Everything else — DPO’s exact position, how many RL rounds, whether cold-start SFT exists at all — is a flexible, lab-specific choice within that constraint. Confidence: high on the directional rule (four independent frontier recipes converge — R1, Llama 3, Tülu 3, Llama 4); medium on DPO’s precise micro-placement (genuinely unsettled across labs).


3. The crux: does off-policy SFT after on-policy RL erode the RL gains?

Yes — for foreign off-policy data. Not for on-policy rejection-sampled data. The constraint is data-distribution, not the SFT loss function.

The mechanism

Three independent, converging explanations for why the foreign case is bad:

  1. Covariate shift (DAgger lineage). A model trained purely on a fixed demonstrator’s states diverges from that distribution once it starts acting on its own — errors compound at up to O(εT²) (arXiv:1011.0686). A post-RL policy is a specific, sharply-peaked distribution (§1’s entropy-collapse mechanism); foreign SFT data was drawn from whatever produced it (a human, a bigger teacher, an older checkpoint) — none of which match the current post-RL policy.
  2. RL’s Razor. RL is implicitly KL-anchored to the policy that generated its training signal (arXiv:2509.04259). Foreign SFT has no equivalent restoring force — it will pull the model toward the demonstrator’s distribution regardless of how far that is from the model’s current behavior.
  3. CHORD’s named failure curve. Zhang et al. (Alibaba) directly ablate this: training on expert data that diverges from the model’s established patterns produces a “shift → readapt → overfit” three-phase degradation, which is why naive sequential SFT-then-RL “does not consistently outperform the pure RL approach” (arXiv:2508.11408).

A formal proof exists that some erosion happens even in the safe case: Niu, Bai, Han, Zhang (Huawei), On the Non-decoupling of SFT and RL in Post-training (arXiv:2601.07389), Theorem 4.1 — if RL has converged, any subsequent SFT phase provably degrades the achieved reward, regardless of whether the SFT data is on- or off-policy. This is the important caveat: the theorem doesn’t distinguish provenance. What it does not say is the magnitude — and that’s exactly where CHORD, the DAgger lineage, and the empirical record (below) diverge sharply between the two cases: on-policy erosion is small and recoverable; off-policy erosion can be large and, past a threshold, non-recovered (“RL Is Neither a Panacea Nor a Mirage,” arXiv:2508.16546 — RL-FT restores moderate SFT-induced OOD damage but cannot rescue a checkpoint pushed into a “markedly different representation regime”). Independent mechanistic corroboration for why SFT collateral damage is generally larger than RL’s: SFT makes bigger parameter updates, hits mid-layer MLPs harder (Scalpel vs. Hammer, arXiv:2507.10616 — “GRPO amplifies existing capabilities, SFT replaces them”).

Two more data-alignment papers converge on the same practical fix: Towards On-Policy SFT (arXiv:2602.12222) — “when the data distribution deviates from the model’s, no improved SFT strategy can completely eliminate the effects of catastrophic forgetting” — and Mind the Gap (arXiv:2509.15157), whose operational recipe is directly stealable: keep on-policy-correct solutions as-is; for problems the model still gets wrong, have the current model rewrite a foreign demonstration into its own voice before training on it, rather than training on the raw foreign demo. PEAR (arXiv:2602.01058) does the same alignment at the loss-weighting level (down-weight SFT tokens implausible under the current policy) instead of the data-rewriting level — two independent implementations of the identical fix.

Resolving the R1 “paradox”

R1’s own pipeline is SFT → RL → SFT → RL (arXiv:2501.12948), quoted directly: “Upon nearing convergence in the RL process, we create new SFT data through rejection sampling on the RL checkpoint… combined with supervised data from DeepSeek-V3 in domains such as writing, factual QA, and self-cognition.” Two components, two different safety profiles:

  • ~600k reasoning-domain samples: rejection-sampled from the RL checkpoint itself, filtered for correctness. On-policy by construction. This is the domain RL just sharpened — and it’s exactly the safe case above.
  • ~200k non-reasoning samples: reused foreign DeepSeek-V3 SFT data (writing, roleplay, self-cognition). Genuinely off-policy — but for capabilities the reasoning-RL stage never touched, so there’s no sharpened distribution there to erode.
  • A further RL pass (“all scenarios”) immediately follows, re-anchoring whatever the mixed SFT stage perturbed — mirroring the Panacea-or-Mirage finding that RL can restore moderate SFT damage.

R1 never violates the ordering constraint. It looks like “SFT after RL” only if you read stage- names; read the data provenance and it’s on-policy-for-the-touched-domain + foreign-only-for-disjoint-domains + an RL cleanup pass. Kang et al.’s >1M-GPU-hour study reinforces why this discipline matters even when done carefully: high SFT scores are not reliably predictive of post-RL gains — RL on a “better” SFT checkpoint can substantially underperform RL on the raw base model, because SFT optimized for the wrong objective (SFT-stage accuracy, not what it leaves for RL to build on) (arXiv:2510.01624).

Confidence: high — this is the best-triangulated claim in this whole chapter (mechanism × dosage study × a real, heavily-scrutinized frontier pipeline that avoids the hazard by construction). Medium on the exact magnitude of “how small is small” for the safe case — Huawei’s theorem proves nonzero, doesn’t bound it generally; that’s an open, project-specific measurement, not a literature constant.


4. Fixing N problems: mix-and-replay vs erosive one-at-a-time

Mix, don’t sequence. Fixing N=10 pass@k-identified problems one at a time — a separate fine-tune per problem, moving to the next once the current one improves — is the same failure class as §2’s last table row, just at a coarser grain, and it’s directly documented, not inferred:

  • Llama 2’s own regression: confining rejection-sampling to only the latest round’s data (not pooled across prior rounds) caused “RLHF V3 struggled more than previous versions to compose rhyming lines in poems” (arXiv:2307.09288) — the targeted capability kept improving while an untouched one silently regressed.
  • Catastrophic-forgetting literature converges: sequential single-task continual fine-tuning is the norm-case failure, and — counterintuitively — worsens with scale in the 1B–7B range (arXiv:2308.08747).
  • The forgetting is biased, not uniform: models fine-tuned sequentially forget earlier-tuned behavior to a greater extent than the reverse order, and this disproportionately affects certain categories rather than degrading everything equally (arXiv:2412.16469).
  • A purpose-built ablation (the DMT paper, OpenReview 6M5G5hNiAU) confirms the contrast directly: sequential training across skills is “prone to catastrophic forgetting”; pure multi-task mixing avoids forgetting but can hit capability-conflict ceilings at high data volume. Their fix — mix the specialized skills first, then add back a small slice of general-ability data at the end — is a mix-within-a-stage-plus-final-replay recipe, not a waterfall.

Every frontier recipe surveyed mixes, none waterfalls. Tülu 3’s public SFT mixture is 939k samples across 18 named skill sources combined into one stage, with mixing ratio itself treated as a first-class hyperparameter to sweep (arXiv:2411.15124). R1’s SFT#2 corpus mixes ~600k reasoning + ~200k non-reasoning samples in one training pass, not sequential single-domain passes (arXiv:2501.12948). Llama 3 layers multiple named capabilities (tool-use, coding, reasoning, multilingual) into the same round’s SFT/DPO batch across all 6 iterative rounds, never one-capability-per-round (arXiv:2407.21783).

Replay, if you must revisit across rounds. If problem 10 is only discoverable after fixing 1–9 changed the model enough to reach it, don’t leave problems 1–9 out of round 10’s data — but the replayed data should itself be on-policy, not the original off-policy demonstration:

  • On-Policy Replay (arXiv:2605.29495): on Qwen2.5-7B-Instruct, sequential SFT alone measures backward-transfer at −13.93; a 10% on-policy replay budget (roll out the current checkpoint on old prompts, filter by task reward, replay only the surviving self-generated pairs) lifts that to −0.65 — the active ingredient is demonstrated to be the on-policy-ness of the replay, not response quality alone (vanilla off-policy replay at matched budget is a materially weaker baseline).
  • Older, independently-anchored precedent for the same idea at coarser grain: mixing a modest general- instruction slice into each continual fine-tuning stage recovers held-out knowledge scores (26.8% → 30% MMLU-human vs. 34.72% original, arXiv:2308.08747); Episodic Memory in Lifelong Language Learning (arXiv:1906.01076) is the classical experience-replay mechanism this all descends from.

Model merging — a legitimate alternative to mixing, unvalidated at this scale. Instead of building one joint dataset, you could fix each problem (or cluster) independently and merge the resulting weight deltas. Task Arithmetic (arXiv:2212.04089) shows summed task vectors can improve multiple tasks at once; Model Soups (arXiv:2203.05482) shows weight-averaging independently fine-tuned models often beats the single best one, at zero added inference cost. Both were demonstrated on vision/classification/light-NLP settings, not RLVR-fine-tuned reasoning/agent policies at your scale — treat as a cheap, worthwhile pilot on 2–3 problems, not a default. The macro chapter flags a direct tension worth carrying here: a larger-scale study found model merging does not reliably mitigate forgetting in the settings it tested — don’t treat souping as a free pass.

Confidence: high that mixing-within-a-round beats sequential one-at-a-time, and that on-policy replay beats off-policy replay when rounds must revisit old problems (both are directly documented, multi-source-convergent claims). Medium on exact replay ratios and scheduling (open research area). Medium-low on model merging’s applicability to this project’s RLVR-on-a-dense-agent setting specifically (mechanism is proven elsewhere, not yet tested here).


5. The concrete plan for our ~10 F1–F4 problems

This section applies the ordering rules and the batching verdict to this project’s own diagnosis framework — F1–F4: discovery, exploit-skill, tool-use, pivot/long-horizon. It does not repeat the macro chapter’s round-by-round template — read that for the loop mechanics (measure → route → apply → re-measure → exit-test). What follows is the stage-ordering and batching layer that plugs into it:

  1. Cluster, don’t sequence, by F-label. The ~10 problems get grouped by which F1–F4 species dominates their failure this round — a batching key, not a per-problem schedule. Two problems that both route to rejection-sampling SFT go into one mixed SFT batch, not two fine-tunes.
  2. Before routing a cluster to on-policy SFT/RS, confirm ≥1 verified own-solve exists (a pass@64–128 check). Zero verified solves means the cluster isn’t SFT-ready yet — it’s an upstream discovery gap (F1) — and this is precisely the moment someone is tempted to substitute a foreign teacher demonstration instead. Don’t — that’s exactly the erosive edge from §2’s table. Route to more sampling / curriculum first.
  3. F3 (tool-avoidance) clusters run the elicitation ladder before consuming any SFT-batch capacity — the behavior may already be latent; only clusters that fail all rungs graduate to training.
  4. If clusters in the same round route to different stage-types (some to SFT, some continuing RL), §2’s ordering applies: any genuinely new off-policy capability-injection (a true knowledge gap) runs before the RL continuation in that round, never after; the on-policy RS batch and the RL continuation use the restart-for-SFT, continue-for-RL asymmetry already established in the macro chapter.
  5. Every SFT batch this round = (mixed, verified, on-policy rejection-sampled trajectories for the currently-routed clusters) + (a replay slice of prior rounds’ verified solves for the clusters NOT routed this round). This is §4’s mixing verdict plus its replay corollary, applied directly.
  6. Re-measure all ~10 problems, not just the routed subset, every round. A technique aimed at one cluster can silently regress an untouched one — this is the only way to catch it (Llama 2’s poem- rhyming case, §4).
  7. Expect a small, real, on-policy erosion cost even when everything above is followed correctly (Huawei’s Theorem 4.1, §3) — budget an RL “clean-up” pass after any SFT injection, mirroring R1’s own final RL pass after its combined SFT#2 stage.

One honest caveat carried from the macro chapter and worth restating here: which F-label dominates by round 3 is explicitly not predictable in advance — this is why step 6 is a per-round re-measurement, not a one-time classification of the 10 problems. The exact severity of off-policy-after-RL erosion, and the exact replay ratios, are also this project’s own measurements to make once a real RL loop exists — every number cited above (CHORD’s magnitude, the 10% replay budget, Huawei’s proof) comes from math-reasoning or general-chat domains, not a ~100-turn CTF agent specifically.

Confidence: high on the structure (direct multi-recipe convergence: R1, Llama 3, Tülu 3, plus this project’s own already-settled diagnosis framework); medium on whether the numeric thresholds (replay %, exit-test deltas) transfer cleanly to this project’s scale and domain — flagged as the first thing to measure, not assumed.


Confidence summary

ClaimConfidenceBasis
Stage-types are not interchangeable; the constraint is data-provenance (on/off-policy), not stage-nameHighRL’s Razor + DAgger lineage + 4 independent frontier recipes converge
RL is KL-anchored / entropy-collapsing, which is why a foreign update after RL is dangerousHigharXiv:2509.04259, arXiv:2505.22617 — mechanistic, cross-validated
Off-policy SFT after on-policy RL erodes gains; on-policy RS-SFT after RL does not (or much less)HighCHORD, DAgger, RL’s Razor, Panacea-or-Mirage, and R1’s actual documented pipeline all converge
Some erosion from any post-RL SFT is formally proven, magnitude-unbounded in generalHigh (proof exists) / Medium (magnitude, one paper, 0 citations at crawl)arXiv:2601.07389 Thm 4.1
DPO’s exact position relative to RL (before vs. light-polish-after)ContestedTülu 3 (DPO before, RL last) vs. Llama 4 (RL then light DPO) genuinely disagree
Mixing N problems into one batch beats sequential one-at-a-time fine-tuningHighDirect Llama 2 regression case + CF literature + every frontier recipe surveyed mixes
On-policy replay beats off-policy replay for revisiting earlier-fixed problemsHigh (mechanism) / Medium (exact ratio)arXiv:2605.29495 quantified; single benchmark
Model merging as a fix-then-merge alternative to mixingMedium (mechanism proven elsewhere) / Low (applicability to RLVR-agent setting at this scale)Task Arithmetic, Model Soups — vision/light-NLP only, not yet tested on this project’s domain
Which F-label dominates by round 3 is predictable in advanceFalse / contested — explicitly not predictableCarried from the macro chapter; empirical loop output, not a plannable input

Cross-links: Is the recipe a loop? for the macro loop shape this chapter’s ordering rules route within; The recipe is a sequence, not a pick for the underlying stage skeleton; The one axis that predicts everything for the on/off-policy theory this whole chapter is an application of; One problem, or many? — monolithic vs decomposed for the architecture-side twin of this chapter’s batching question; Diagnosing the gap for the F1–F4 funnel that supplies the routing signal §5 depends on; Where you are & the forks ahead for how this resolves into this project’s next concrete decision.

Data mixing, ratios & not forgetting how to think

Ordering rules answered which stage-type is safe to run after which. This chapter answers the question one level below that: even with the right stage order, how much data from each stage — and what ratio of replay against earlier-stage data — is the difference between a capability gain and a silent format collapse.

0. The anecdote

Someone SFT’d a reasoning-capable, <think>...</think>-style model on naive off-policy synthetic trajectories — teacher-generated (prompt, response) pairs where the responses were terse, answer-only, no reasoning trace — using LoRA. After training, the model stopped emitting CoT entirely, even on prompts where it used to think. The expectation going in was that LoRA’s well-known “learns less, forgets less” property (Biderman et al., arXiv:2405.09673) would make this safe. It didn’t.

One-line diagnosis, verified rather than assumed: this is format/behavioral collapse, not weight destruction. The model didn’t lose its reasoning circuitry — it learned, from the data, that the correct response shape is “no thinking.” LoRA didn’t save it because LoRA bounds how far the weights move (magnitude), not what direction a small move takes them (behavior/format) — and “always skip <think>” is exactly the kind of coarse, low-information-content policy switch a small move is cheap to encode. This chapter verifies both halves of that claim against the literature, then builds the general theory of data mixing that prevents it: replay ratios, LoRA discipline, template hygiene, and a mandatory per-checkpoint “does it still think?” probe.

Stance, as everywhere in this book: no academic cybersecurity-LLM paper is used as evidentiary ground below — grounding is frontier-lab reports and general RL/ML/continual-learning theory. All arXiv ids were verified live via Exa on 2026-07-02; confidence and evidence-type (mechanistic-argument vs measured) are marked per claim, and “contested” is used honestly where sources disagree.


1. Why SFT erases reasoning — the mechanism, cited

1.1 It’s a named, measured phenomenon: “reasoning-trace collapse”

Twist, Yannakoudakis, Zhang (King’s College London), “Reasoning-Trace Collapse: Evaluating the Loss of Explicit Reasoning During Fine-Tuning,” arXiv:2605.21127 (2026). This is the closest thing in the literature to a direct writeup of the anecdote. Their claim, verbatim: fine-tuning a reasoning model on “ordinary instruction–response data that contains no [reasoning] traces” induces collapse — the model “continues to produce plausible final answers while losing the structurally valid explicit reasoning traces that made it a reasoning model in the first place… a model can minimise its loss by learning to produce only the final answer, effectively treating the absence of reasoning as the desired behaviour.” Across four open-weight reasoning models: standard SFT can rapidly suppress valid reasoning traces, and — the load-bearing methodological point — answer-only accuracy hides the failure: in several settings, accuracy conditional on emitting valid reasoning stays high while the rate of emitting valid reasoning collapses. The cheap fix, and it doesn’t need teacher CoT at all: loss-mask the non-reasoning-format tokens so terse demonstrations don’t actively supervise “the correct move here is skip thinking.” Confidence: high — measured, multi-model, framework released, though a brand-new (2026), not-yet-independently-replicated preprint.

Independent, peer-reviewed corroboration: Lobo, Agarwal, Lakkaraju, “On the Impact of Fine-Tuning on Chain-of-Thought Reasoning,” NAACL 2025, arXiv:2411.15382. SFT (including QLoRA rank-16) on non-reasoning datasets reduces both CoT accuracy and CoT faithfulness (whether the reasoning is causally load-bearing vs. post-hoc rationalization), general across most tested datasets, worse in smaller models — i.e. not a LoRA-config artifact, and worse at exactly the scales a project like this actually deploys. Confidence: high (peer-reviewed, corroborating).

1.2 Why: the answer is load-bearing, not decorative — so suppressing CoT isn’t free

Zhang, Lin, Rajmohan, Zhang (Microsoft), “From Reasoning to Answer,” arXiv:2509.23676 (2025). Across three distilled DeepSeek-R1 models: reasoning consistently improves answer quality; dedicated mid-layer “Reasoning-Focus Heads” track the reasoning trajectory; and activation patching on reasoning tokens causally alters the final answer. This is why format collapse is a capability loss, not a cosmetic one — later tokens are mechanistically consuming the reasoning computation. Complementary quantified evidence: Zhang, Morris, Shmatikov (Cornell Tech), ICML 2026, arXiv:2603.07267 — fine-tuning Qwen-2.5-7B-Instruct on answers+summaries only vs. with reasoning traces present (even synthesized/inverted ones) gives a large measured delta: MATH500 56.8% → 77.6%, JEEBench 11.7% → 42.3%. Confidence: high (mechanistic-interpretability + a clean, large, quantified delta).

1.3 The mechanistic bridge: the <think> delimiter is a fragile, learnable contract

Zhu, Zhang, Wang, Xu, Lyu, Wu, “To Think or Not to Think,” arXiv:2502.12202 (2025). Forcing an LRM to see an empty <think></think> block flips it straight to the final answer — >90% attack success rate, ~80% relative performance drop across mainstream LRMs — and this same behavior is backdoorable during ordinary SFT/DPO, no adversarial intent required: if training data contains empty/absent think blocks at any non-trivial rate, “empty think block → answer now” generalizes as a policy, not a per-example fact. Naive off-policy SFT that never emits <think> at all is, from the chat-template’s perspective, in-kind indistinguishable from data that emits an empty think block — the model sees “prompt → nothing between the delimiters → terse answer” as the target distribution often enough to generalize it as the mode. Confidence: high for the vulnerability itself (adversarial- robustness paper, careful methodology); mechanistic-argument, not directly measured, for “accidental naive SFT recreates this by accident” — a strong, well-supported inference, not a controlled experiment on the non-adversarial case.

Qwen’s own fine-tuning documentation treats exactly this as a named risk: the official chat template uses an empty <think>\n\n</think>\n\n block to signal non-thinking mode at inference, and Qwen’s guidance for mixing non-CoT data recommends explicit flags (ignore_empty_think, add_non_thinking_prefix) rather than letting formats mix implicitly in a batch. Concrete knob: if you must include non-reasoning examples, tag them explicitly as a selected non-thinking mode rather than silently omitting the think block. Confidence: medium (primary docs + secondary diagnosis, not a controlled experiment; the underlying principle is durable, the specific flag names may drift).

1.4 Compounding factor: off-policy distribution shift

The failure is not just “no reasoning tokens in the data” — it’s compounded by the data being off- policy relative to the student. This is a direct instance of the on/off-policy axis: DAgger’s classical result is that a fixed, off-policy demonstrator distribution gives no corrective signal for the states the learner’s own policy actually visits, and imitation error compounds up to O(εT²) (Ross, Gordon, Bagnell, arXiv:1011.0686); the sequence-level, purely-supervised restatement is exposure bias / scheduled sampling (Bengio et al., arXiv:1506.03099); the modern, LLM-native formalization is on-policy distillation (GKD, Agarwal et al. (DeepMind), arXiv:2306.13649), which exists specifically to kill the train/inference mismatch fixed-dataset KD creates. A synthetic teacher trajectory is, by construction, off-policy — the student never would have generated that terse response itself — so the moment it does start a <think> block (from its pre-SFT prior), the SFT training distribution offers no guidance for continuing it, biasing continuation toward “wrap it up fast.” Confidence: high as established theory (canonical, widely-cited references); its direct quantitative transfer to modern chat-format LLM SFT is a well-established analogy in the field, not a re-derivation on LLMs specifically — flagged as well-established analogy, not measured for this exact setting.

1.5 Format/style is learned — and unlearned — from remarkably little data

Zhou et al. (Meta AI), LIMA, arXiv:2305.11206 (2023). A 65B LLaMA SFT’d on just 1,000 curated (prompt, response) pairs reaches response quality competitive with GPT-4/Bard on a large fraction of human judgments — the “Superficial Alignment Hypothesis”: most of a base model’s knowledge is learned in pretraining, fine-tuning mostly teaches format/style, and format is cheap to teach from few examples. This cuts both ways. If style is learnable from ~1,000 examples in the beneficial direction, it’s exactly as learnable in the harmful direction — a modest terse-teacher dataset is easily enough to overwrite a <think>-emission habit. This is why “even LoRA, even without huge data” was sufficient to break the anecdote’s model. Confidence: medium-high — the directional claim (format is cheap to (un)learn) is uncontested and is all this chapter needs; the strong-form hypothesis (“fine-tuning teaches only format, never new capability”) is contested — later RLVR results (DeepSeek-R1) show post-training stages can add non-superficial capability too. Also complementary, InstructGPT’s own disclosed “alignment tax” (Ouyang et al., arXiv:2203.02155) — “minimal performance regressions on public NLP datasets” as the measured cost of RLHF — establishes that any behavior-reshaping post-training stage carries a nonzero capability-erosion risk; the anecdote is a severe, unmitigated instance of exactly that named tax, made worse by off-policy terse data actively targeting the very behavior for removal, with no replay guardrail in place.

Synthesis: SFT loss doesn’t distinguish “correct answer, reasoning genuinely absent from the target distribution” from “correct answer, reasoning omitted for brevity” — it minimizes loss on the tokens present, and if the target tokens never populate a <think> block, zero-reasoning becomes the argmin policy. That policy switch is coarse, low-rank, and cheap to learn (§1.5), the chat-template delimiter makes it a single learnable decision boundary (§1.3), and off-policy demonstration data gives no corrective signal once the model starts drifting toward it (§1.4) — while the loss it is skipping is one later tokens causally depend on (§1.2). None of this requires any weight destruction.


2. Why LoRA did not save it

2.1 The misconception, stated precisely

Misconception: “LoRA prevents catastrophic forgetting, so a LoRA SFT run can’t meaningfully damage the base model’s behavior — at worst it under-learns the new task.”

What’s actually true: LoRA reduces the magnitude of the weight perturbation relative to full fine-tuning, and that magnitude constraint empirically correlates with less forgetting on held-out, aggregate capability benchmarks. That is a statistical claim about weight-space drift — not a guarantee about any specific behavior surviving. Output format/policy (“always think before answering” vs. “answer directly”) is encoded in a direction, not a magnitude, and a low-rank update has more than enough directional freedom to flip a single high-level behavioral switch even while aggregate drift stays small.

2.2 The primary source, read precisely

Biderman et al. (Columbia + Databricks Mosaic), “LoRA Learns Less and Forgets Less,” TMLR 2025, arXiv:2405.09673 (448 citations — well-validated, not fringe). Llama-2-7B/13B, code and math domains, both continued-pretraining and instruction-FT regimes. Their own findings, read carefully, are the crux of “LoRA did not save it”:

  • Instruction fine-tuning (IFT) — your regime — forgets more than continued pretraining at matched scale. A synthetic-trajectory SFT run is squarely IFT, the higher-forgetting regime.
  • Rank controls the forgetting-protection dial, and it’s a Pareto trade, not a free lunch. r=16 (the common default) forgets least; at r=256 on math IFT, LoRA forgets nearly as much as full fine-tuning (LoRA r=256: 0.567 vs. full-FT: 0.559 at epoch 16 — statistically the same floor).
  • LoRA needs a higher LR than full-FT to learn comparably — their recommended range is 5e-5 to 5e-4, about an order of magnitude higher than typical full-FT LR for the same setup. This is the double-edged knob: crank LR up to make LoRA actually learn the target task, and you’re simultaneously moving toward the higher-forgetting regime.
  • Full fine-tuning learns perturbations with effective rank 10–100× greater than typical LoRA configurations — this is the structural reason the aggregate-forgetting protection exists at all.
  • What the paper’s “forgetting” metric actually measures: held-out, general-capability benchmark scores (commonsense/world-knowledge), aggregated across many unrelated skills. It says nothing about whether one narrow behavioral switch — “emit <think> before answering” — survives. A metric that stays flat in aggregate can hide one behavior collapsing to zero if that behavior is a small slice of what the benchmark measures.

Independent LR corroboration (non-academic, frontier-lab practitioner source): Thinking Machines Lab, “LoRA Without Regret” (2025) — “the optimal LR for LoRA is consistently 10x the one used for FullFT in the same application, for both supervised […] and RL.” Confidence: high (two independent sources converge on ~10x, one peer-reviewed/TMLR, one frontier-lab operational report). A very recent theory paper formalizes why the optimal LR moves with rank — Maximal-Update Adaptation, arXiv:2602.06204confidence: medium, very new, not yet broadly stress-tested.

2.3 The mechanistic “why”: intruder dimensions

Shuttleworth, Andreas, Torralba, Sharma (MIT), “LoRA vs Full Fine-tuning: An Illusion of Equivalence,” arXiv:2410.21228 (2024). This is the paper that directly refutes “LoRA forgets less” as an unconditional safety guarantee. LoRA-trained weight matrices develop “intruder dimensions” — new, high-ranking singular vectors absent from the pretrained model’s SVD structure — that full fine-tuning does not produce (FFT perturbs existing directions; LoRA adds new dominant ones). Causally validated: scaling down the intruder-dimension singular values post-hoc reduces forgetting with minimal downstream-task cost, i.e. forgetting is concentrated there, and it gets worse across sequential/continual LoRA rounds. High alpha/LR is exactly where intruder-dimension risk grows (§2.2’s rank-vs-forgetting curve is the same phenomenon from a different angle).

Direct empirical proof the mechanism is real, not hypothetical, in an adjacent domain: Lermen, Rogers-Smith, Ladish, “LoRA Fine-tuning Efficiently Undoes Safety Training in Llama 2-Chat 70B,” arXiv:2310.20624. Using QLoRA, a single GPU, under $200, they took Llama-2-Chat 7B/13B/70B and Mixtral-Instruct from RLHF safety-refusal down to ~1% refusal rate on two benchmarks — while retaining general-capability benchmark scores. This is the identical shape of failure as “model forgot to think”: a single global behavioral policy (there: refuse harmful requests; here: emit reasoning before answering) collapses to its opposite under LoRA SFT, precisely while the LoRA magnitude constraint is doing its job of preserving general capability. Confidence: high, directly on point — the field has independently proven “LoRA preserves aggregate benchmarks” ≠ “LoRA preserves a specific behavioral policy” in an adjacent domain, using the same mechanism.

Confirming, very recent representation-level evidence: “Representation Collapse in Sequential Post-Training of Large Language Models,” arXiv:2605.30524 (2026) — “LoRA updates from different stages occupy overlapping subspaces,” and “long chain-of-thought tuning may carve a strong reasoning-format manifold… [that] mostly affects late generated tokens” — the literature is converging on modeling format/reasoning-style as its own low-dimensional direction, separable from general knowledge, which is exactly the shape a low-rank update is cheap to capture or destroy. Confidence: medium (very recent, low-citation, but consistent with §2.2/§2.3’s converging picture).

2.4 What LoRA protects vs. does NOT protect

LoRA protects (high confidence)LoRA does NOT reliably protect (high confidence for the analog, medium for reasoning-trace directly)
WhatBroad/diffuse general capability: commonsense, world knowledge, unrelated-domain skill, output diversityA single, low-rank behavioral policy/format switch: refusal behavior, “always think first,” tone/register
WhyThese are encoded in a high-rank, distributed way across many weight directions; LoRA’s rank cap limits how much of that broad space can moveFormat/policy switches are themselves low-rank/low-dimensional (a handful of directions); a rank-8–64 LoRA has ample capacity to learn or unlearn them if the training signal is consistent
EvidenceBiderman et al. 2405.09673 — held-out benchmark scores stay closer to base than FFT’s, across code/math, CPT/IFTLermen et al. 2310.20624 — LoRA takes refusal rate to ~1% while preserving general benchmarks; Twist et al. 2605.21127 — SFT suppresses reasoning-trace emission rate while reasoning-conditioned accuracy stays high
Knob that helps mostLower rank (r=8–64), α ≈ 2r, moderate LR, fewer target modules if you want more protection (at the cost of learning)Not a LoRA-config knob — it’s a data-composition problem: keep reasoning traces in every example, loss-mask the no-think region, replay a fraction of reasoning-format data (§3–§4)
What increases the riskHigh rank (approaching FFT’s effective rank per §2.2), high LR, α miscalibrated relative to rank (instability — §2.5), and above all: 100% of the training signal pointing one direction (all synthetic trajectories terse/no-think)

2.5 Independent confounder worth ruling out: rank/alpha instability

If a run used non-default rank with the conventional α/r scaling, it may sit in a genuinely different failure regime: Kalajdzievski, “A Rank Stabilization Scaling Factor for Fine-Tuning with LoRA (rsLoRA),” arXiv:2312.03732 (~254 citations, now use_rslora in HF PEFT) shows conventional α/r scaling causes gradient collapse / stunted learning at high rank; the fix is γ = α/√r. A garbled, undertrained high-rank LoRA can also present as “degraded/collapsed output behavior,” distinct from — and worth checking for, alongside — the clean format-collapse mechanism above. Separately, DoRA (arXiv:2402.09353) and PiSSA (arXiv:2404.02948) are both learning-capacity accelerants (they close the LoRA-vs-FFT gap faster/further) — they move LoRA’s behavior closer to FFT’s, which is the wrong direction for behavior preservation specifically; none of the LoRA variants are a forgetting fix. The fix has to come from data composition, next section.

2.6 Concrete knobs, consolidated

KnobRecommendationWhy
Rankr≈16 for pure risk-minimization; r=64–256 if the target task genuinely needs it, understanding you’re trading toward FFT’s forgetting profile§2.2 — Biderman’s own rank-vs-forgetting curve
α (alpha)α ≈ 2r, not a fixed small α at high rank§2.2 — a fixed low α with high rank causes instability that tempts LR compensation, which reintroduces the risk you were trying to avoid
Learning rate5e-5 to 5e-4 (~10× your full-FT LR for the same setup); sweep, take the highest stable value, don’t over-shoot§2.2, corroborated independently by Thinking Machines
Target modulesAll/most modules if memory allowsRestricting target modules concentrates drift into fewer directions — can make format flips cheaper, not harder
Sequential LoRA roundsWatch for accumulating intruder dimensions§2.3 — Shuttleworth et al. show this compounds round over round
Rank/scaling sanity checkIf non-default rank, confirm α/r (or rsLoRA) scaling isn’t in the instability regime§2.5

None of this is a substitute for §3–4. LoRA discipline reduces risk; it does not remove it.


3. The core lever: mixing ratios + replay/rehearsal

3.1 Replay ratio — the most quantitatively converged lever in this thread

PaperSettingRatio that workedResult
Scialom et al., EMNLP 2022, arXiv:2205.12393T0-3B, 8 sequential new tasks vs. 70 zero-shot eval tasks0.25–1% rehearsal of prior-task datar=0: catastrophic forgetting. r=0.25%: “almost perfect stability.” r=1%: fully stationary zero-shot performance, new task learned at parity with r=0.
Ibrahim et al., TMLR 2024, arXiv:2403.08763Continual pretraining, 405M–10B params, hundreds of billions of tokensDefault: 5%; as little as 1% for a weak shift, more (5/10/50%) as the shift strengthens“Replaying previous data (as little as 1%) is sufficient to mitigate forgetting to a large extent… we recommend 5% replay [as default].”
GeRe, arXiv:2508.04676 (2025)LLM continual fine-tuning, cross-domainSmall, fixed general-sample replay setA small fixed set of pretraining-style replay samples resolves both general-capability and task-specific forgetting simultaneously.
On-Policy Replay (OPR), arXiv:2605.29495 (2026)Qwen2.5-7B-Instruct / Qwen3-8B / Llama3.1-8B-Instruct, TRACE benchmark1% and 10%, buffer built from the model’s own filtered rollouts, not stale gold dataSequential-SFT BWT = −13.93 (no replay) → −0.65 at 10% on-policy replay, −2.29 at 1% — a 46% reduction in |BWT| over a tuned vanilla (off-policy) replay baseline, consistent 42–46% across all three backbones.
Spiegelhalter, Franke, Hutter, arXiv:2510.11842 (NeurIPS 2025 workshop)Sweep over {5,10,15,20,25}% replay × token budgets5–10%“More than 5–10% replay is not necessary for general knowledge retention”; grid {5,10,15%} once budget is fixed.
Kotha & Liang, arXiv:2603.04964 (2026)Generic-distribution replay during fine-tuningReplay can improve, not just preserve, target-task data efficiency (up to 1.87× fine-tuning, 2.06× mid-training) — not purely insurance.
Marek, Cho, Qiu, Chunara, Izmailov, Wilson (NYU), arXiv:2605.26097 (2026)Self-generated replay (no external data needed)Sampling the model’s own completions before fine-tuning and regularizing on them “nearly eliminates forgetting” — but only when the model has spare capacity; an already-overtrained checkpoint trades learning against forgetting regardless of replay.

Consolidated knob: 1–10% replay is the empirically converged band for SFT/continual-fine-tuning- scale forgetting mitigation. Scale up toward 5–10% with distribution-shift strength (Ibrahim); prefer general/pretraining-style or reasoning-specific samples over “just more of the old task” if broad- capability retention (not just narrow old-task retention) is the goal (GeRe); if you can afford rollouts, on-policy replay beats vanilla off-policy replay at equal or lower % budget (OPR) — this is the direct fix for §1.4’s off-policy-distribution-shift compounding factor, not just a separate lever. Confidence: Scialom = peer-reviewed, foundational, high confidence but small model (T0-3B) — generalizability to modern 7–70B dense models is argued, not re-verified here. Ibrahim = peer-reviewed TMLR, largest scale, high confidence, but continual pretraining, not SFT — mechanism transfers, exact % may not transfer 1:1 to SFT’s smaller-dataset/larger-shift-per-token regime. GeRe/OPR/Spiegelhalter/ Kotha/Marek are single, very recent (2025–2026), low-citation preprints — directionally strong, structurally sound, not yet independently replicated — “promising, not yet broadly validated.”

3.2 Data-mixing laws — port the principle, not the exact numbers

These are pretraining-domain-mixture papers, not SFT-capability-mixture papers — cited for the general theory that mixture ratio is a first-class, optimizable hyperparameter with a measurable, non-obvious optimum, i.e. the theoretical backbone for “don’t eyeball your SFT mix”:

  • DoReMi (Xie et al., NeurIPS 2023, arXiv:2305.10429) — a small (280M) proxy model with Group-DRO finds domain weights transferable to an 8B model; beats the default heuristic mixture by 6.5 points, even when it downweights a domain — the intuitive mixture is measurably wrong.
  • RegMix (Liu et al., ICLR 2025 Spotlight, arXiv:2407.01492) — frames mixture selection as regression over hundreds of cheap tiny proxy runs; matches DoReMi at ~10% of the compute. The single most transferable finding for SFT mixing: “domains interact in complex ways often contradicting common sense” — you cannot assume “add X% reasoning data” composes linearly with “add Y% cybersec data.” This is exactly why §5’s per-checkpoint probe, not a static ratio, is non-negotiable.
  • Scaling Laws for Optimal Data Mixtures (Shukor et al., Apple, NeurIPS 2025, arXiv:2507.09404) — extends scaling laws to solve analytically for optimal domain weights given a budget, generalizing the proxy-sweep approach further.

Confidence for porting the principle to SFT capability-mixing: moderate — mechanistically sound (same “loss is a smooth function of mixture weights” assumption should hold), but none of these three ran an SFT/instruction-capability-mixing experiment themselves — an explicit extrapolation, flagged as such.

3.3 Instruction-tuning mixture methodology — Tülu’s process, not its numbers

Tülu 2 (arXiv:2311.10702) and Tülu 3 (AI2, COLM 2025, arXiv:2411.15124) disclose the most transparent public SFT-mixture- construction process, not a fixed ratio table: (1) build skill-specific mixtures first, keeping whichever maximizes that skill’s own eval; (2) merge into one candidate mix, then add/remove entire datasets and re-measure the whole suite average — dataset-level, not fine-grained percentage-level, tuning; (3) a directly transferable negative-ratio finding — Tülu 2 explicitly downsampled the oversized FLAN dataset and dropped Dolly entirely for hurting the mix average, i.e. “more data” from one dominant source can be actively harmful, don’t let raw count dictate weight. Confidence: high for methodology (open, reproducible, widely used baseline); exact numeric ratios are project-specific to Tülu’s own skill set — port the iterate-and-ablate process, not the table.

3.4 The capability-balance tradeoff — replay is a dial with two failure modes

Ibrahim et al. also find that at an “extreme amount of replay” the model adapts less to the new domain — there is a real Pareto frontier: too little replay (0–0.5%) forgets; too much (25%+) under-fits the new capability, with diminishing/negative returns above roughly ~10–25% for a strong shift. Biderman’s rank result (§2.2) is the LoRA-specific version of the same tradeoff — a second, orthogonal dial on the same frontier. Confidence: the existence of the tradeoff is high confidence (multiple independent papers, same qualitative curve shape); the exact “sweet band” is regime-specific (continual pretraining vs. SFT vs. LoRA) — re-verify on your own forgetting probe (§5) rather than assume it transfers exactly.


4. Merging/soups vs. mixing — a decision aid

Model merging (combining independently fine-tuned checkpoints in weight space) is the alternative to in-data mixing. Four load-bearing references, all verified live:

  • Task Arithmetic (Ilharco et al., ICLR 2023, arXiv:2212.04089) — task vector τ = θ_finetuned − θ_pretrained; negate to suppress a behavior, sum to combine tasks; θ_new = θ + λτ, λ tuned on held-out data. Works because task vectors from different tasks are typically close to orthogonal — the assumption that breaks down when the tasks (e.g. “cyber tool-use” and “keep-CoT”) both touch the same output-formatting circuitry.
  • TIES-Merging (Yadav et al., NeurIPS 2023, arXiv:2306.01708) — fixes redundant-magnitude interference and sign interference from naive vector summation via trim→elect-sign→disjoint-merge; reference config: top-k retention ≈20%, λ ≈ 0.8–2.5. What you’d reach for if you had two independently-trained adapters (a cyber-tool-use LoRA and a CoT-preserving LoRA) and wanted to combine without one silently erasing the other in overlapping regions.
  • DARE (Yu et al., Alibaba, ICML 2024, arXiv:2311.03099) — SFT delta parameters are extremely redundant; drop 90–99% and rescale, minimal impact, larger models tolerate more drop. Contested at <13B: community reports of incoherent output at aggressive drop rates on 7B models — the safety margin shrinks exactly at the sizes most Sequence-B-style projects run.
  • Model Soups (Wortsman et al., ICML 2022, arXiv:2203.05482) — models fine-tuned from the same checkpoint with different hyperparameters land in one low-error basin; weight-averaging (greedy soup) often matches or beats picking the single best, zero extra inference cost. This is the same-task, same-init degenerate case of task arithmetic — the cheapest merge to reach for if you already have N seeds of the same objective.

Decision aid: merge vs. mix

MergeMix
Use whenCapabilities are trained as separate, independently-checkpointed fine-tunes from the same base, and are plausibly near-orthogonal in weight spaceCapabilities are entangled by construction — live in the same forward pass, the same output stream
Reasoning-preservation case specificallyPoor fit — “keep-CoT” and “cyber-tool-use” both touch the model’s decision about response length/structure, i.e. not orthogonal; merging at high λ risks the same collapse as naive mixed-data SFT, just moved to the weight layerThis is the fit. The reasoning-collapse failure is a property of what a single run’s data teaches the model the correct response shape is
Control granularityCoarse — one scaling coefficient λ per task vectorFine — continuous, token-level ratio control within one training run (e.g. exactly 90:10 cyber:reasoning-replay)
CostNeeds ≥2 independently-trained checkpoints + a merge/eval loop on topOne run
ReversibilityCheap — task-vector negation can strip a bad capability post-hoc without retrainingNot reversible after the fact — a re-run is needed
Best later-stage use hereSoup 3 seeds of the final good cyber-SFT recipe once you have one; or negate-out a capability you can’t cheaply retrain away

Verdict for the reasoning-retention problem: mix, don’t merge, for this stage. Reserve merging for a later stage (souping multiple seeds of an already-good recipe, or reversible removal of a bad capability). Confidence: high on the qualitative reasoning (orthogonality assumption is well-established and clearly violated here); medium-low on applicability of DARE/TIES numeric operating points to a <13B dense model specifically — none of the four papers were run on an RLVR-fine-tuned reasoning/agent policy at this project’s scale, this is an extrapolation.


5. The practical anti-forgetting recipe (for Sequence-B)

Given: dense open-weight base, LoRA-based cyber-tool-use SFT on synthetic trajectories, a prior naive attempt that already lost thinking behavior.

  1. Never generate/accept synthetic teacher trajectories that strip <think> content for brevity or cost. §1.2’s MATH500/JEEBench deltas make this a measured, large capability cost, not a stylistic nicety — and §1.3 shows an absent think block is directly learnable as “the mode.” If a trajectory genuinely has no reasoning trace (e.g. a terse tool-call-only example), loss-mask the answer region rather than let it supervise the think/no-think decision (§1.1’s cheapest, most directly-evidenced fix).
  2. Enforce exact template/format consistency with whatever schema the base checkpoint was reasoning-SFT’d/RLVR’d with. If mixing in any non-reasoning examples, tag them explicitly as a selected non-thinking mode (§1.3) — don’t let the model infer “sometimes no-think” from silent omission.
  3. Reserve a 5–10% replay slice of reasoning-preserving data every training step/epoch, per §3.1’s converged band — on-policy if compute allows (roll out the current checkpoint on old/generic prompts, filter by a reasoning-format+correctness check, replay the survivors — OPR’s 42–46% BWT improvement over vanilla replay is directly attributable to this), else self-generated replay (arXiv:2605.26097) or a fixed curated reasoning-trace set (arXiv:2508.04676) as cheaper fallbacks. Grid {5, 10, 15%} if budget allows (Spiegelhalter et al.).
  4. If staying on LoRA, treat the rank/alpha/LR discipline in §2.6 as risk-reduction, not a forgetting fix. For a task this behaviorally demanding (tool-use + reasoning retention), rank 64–128, α≈2×rank, LR in the 5e-5–5e-4 band, is the reference operating point — but §3’s replay ratio is the lever that actually dominates; if full-FT is available and affordable, it removes the LoRA-rank-vs-forgetting variable entirely and shifts the whole burden correctly onto replay ratio.
  5. Prefer rejection-sampled/on-policy-adjacent trajectories over pure off-policy teacher dumps for the cyber-tool-use data itself where feasible — sample from your own base/reasoning checkpoint, verify tool-call correctness against ground truth (this project’s own non-negotiable — see the handbook), keep only correct + format-clean completions. DeepSeek-R1’s own stage-3 SFT corpus does exactly this: ~600K reasoning-domain samples rejection-sampled from the RL checkpoint itself (arXiv:2501.12948) — the on-policy-for-the-touched-domain pattern this whole book’s ordering-rules chapter already establishes as the safe transition. Mention-only, per this project’s standing stance against academic cybersec-LLM grounding — cited as frontier-lab practice, not as an evidentiary source for cybersec-specific claims.
  6. Build the “does it still think?” structural probe before the first real SFT run, and run it every checkpoint, not just at the end. Mirror Twist et al.’s valid/empty/missing/truncated trace-rate metric, and report reasoning-conditioned pass@1 alongside raw pass@1 — this is the single cheapest guardrail with direct empirical backing, because §1.1’s central point is that answer-accuracy alone hides the collapse until it’s severe. Concretely, per checkpoint: (a) classify each eval generation’s reasoning-trace validity; (b) track median <think> token count against a fixed eval set — a monotonic collapse toward near-zero is the earliest, cheapest signal, cheaper than a full downstream benchmark; (c) hold a fixed general-capability retention check constant from before the cyber SFT started. Treat a falling think-presence rate as a stop-training signal independent of whether the cyber metric is still improving — “cyber metric up, think-rate down” is exactly the collapse trap the literature documents directly.
  7. If you suspect the damage was shallow (task-alignment, not knowledge), a cheap diagnostic exists before committing to a full retrain: Zheng et al.’s spurious-forgetting result (arXiv:2501.13453, ICLR 2025) shows old-task performance can be restored by briefly training on as few as ~10 anchor/alignment instances — none from the original dataset. If a quick recovery probe like this snaps performance back, the failure was mixture/format (squarely this chapter’s levers), not irreversible weight damage.

What I’d change first, concretely, for this project’s actual pipeline: rebuild the current cyber-SFT corpus so every trajectory keeps a <think> block in the exact template the base checkpoint uses; add a 5–10% on-policy (or self-generated) reasoning-replay slice as the default, not an afterthought; and stand up the think-presence probe as a first-class metric before the next training run, not a post-hoc autopsy on the next collapse.


Confidence summary

ClaimConfidenceBasis
The failure is format/behavioral collapse, not weight destructionHigh — directly measuredTwist et al. 2605.21127; corroborated by Lobo et al. 2411.15382 (NAACL 2025, peer-reviewed)
Reasoning tokens are causally used by later answer computation, not decorativeMedium-high — mechanistic-interpretabilityZhang et al. 2509.23676; quantified delta in 2603.07267
Empty/absent <think> is directly learnable as “the mode,” incl. via ordinary SFTHigh for the vulnerability; mechanistic-argument for accidental-SFT generalizationZhu et al. 2502.12202; corroborated by Qwen’s own docs
Off-policy demonstration data is structurally the wrong signal to preserve an existing on-policy behaviorHigh (theory) / well-established analogy (direct LLM-SFT measurement)DAgger 1011.0686 → exposure bias 1506.03099 → GKD 2306.13649
LoRA bounds drift magnitude, not behavioral direction — no format-preservation guaranteeHigh — converges from 2+ independent papersBiderman et al. 2405.09673 + Shuttleworth et al. 2410.21228
A single global behavioral policy can flip under LoRA SFT while general benchmarks stay flatHigh, direct empirical analogLermen et al. 2310.20624 (safety-refusal collapse via LoRA)
1–10% replay meaningfully arrests SFT/continual-FT forgetting; on-policy replay beats vanilla at equal/lower %High (numbers, band); medium (exact % transfer to CoT-preservation specifically)Scialom 2205.12393, Ibrahim 2403.08763, OPR 2605.29495
Mixture ratio is a first-class, optimizable hyperparameter with a non-obvious, non-linear optimumHigh for pretraining-domain mixing; moderate ported to SFT-capability mixingDoReMi 2305.10429, RegMix 2407.01492
Merge for near-orthogonal, separately-trained capabilities; mix for entangled ones — reasoning-retention is the “mix” caseHigh (qualitative reasoning); medium-low (numeric merge operating points at <13B scale, untested on this project’s domain)Task Arithmetic 2212.04089, TIES 2306.01708, DARE 2311.03099, Soups 2203.05482
Format/style is learned (and un-learned) from very small dataMedium-high (directional claim, uncontested) / contested (strong-form “fine-tuning teaches only format”)LIMA 2305.11206
Answer-only accuracy monitoring cannot detect reasoning-trace collapse until it’s severeHigh — this is the central methodological finding driving the whole recipeTwist et al. 2605.21127

Cross-links: Ordering rules: interleaving stages & batching for the stage-provenance rules this chapter’s replay recommendation composes with (on-policy replay is the same “restart-for-SFT” discipline, applied within a stage rather than across rounds); Is the recipe a loop? for the macro iterate-and-measure shape the per-checkpoint probe in §5 plugs into; The recipe is a sequence, not a pick for where this single-stage data-composition question sits inside the full stage skeleton; PEFT is orthogonal for the LoRA-as-mechanism framing §2 depends on; Continued pretraining on an instruct model for the closely-related but distinct failure mode (raw CPT breaking instruction-following/alignment format, not reasoning specifically) and its own CPT-on-base-then-re-instruct mitigation; The one axis that predicts everything for the on/off-policy theory §1.4 and §3.1’s on-policy-replay result are direct applications of.

Continued pretraining on an instruction-tuned model (without breaking it)

The mixing-and-forgetting discipline you just read in Data mixing, ratios & not forgetting how to think assumes you’re already inside the SFT/preference/RL stages. This chapter goes one rung earlier in the sequence — domain continued pretraining — and asks the same forgetting question in the one setting where it’s sharpest: starting from an already instruction-tuned checkpoint instead of a raw base model.

The north star this book keeps returning to is fine-tuning an already-available open-weight dense model into a frontier cybersecurity model — not training one from scratch. The path to a frontier cybersecurity model names Stage 0 — domain continued pretraining (CPT) as the first rung of that ladder: every code/math/medical specialization lineage examined there continues pretraining from an existing strong checkpoint on a raw in-domain corpus (Code Llama ~500B code tokens, DeepSeekMath 120B math tokens, Qwen2.5-Coder 5.5T code tokens) before SFT/RL ever starts. What that chapter leaves implicit — and this one makes explicit — is which checkpoint Stage 0 should actually start from.

In practice you frequently don’t have a clean choice. Many open-weight releases you’d actually want to build on are shipped, served, and eval-harnessed as the instruction-tuned/RLHF’d checkpoint — that’s the one your inference stack, prompt templates, and safety behavior are already built around. So the question this chapter answers is concrete and load-bearing, not academic: can you run raw next-token CPT on a raw cybersecurity corpus directly on top of an already-instruct checkpoint — for knowledge injection — without destroying the instruction-following/alignment layer that checkpoint already has? If yes, how? And how do you know, empirically, that it didn’t break?

Bottom line up front: yes, this is real, documented practice — but naive next-token CPT on an instruct checkpoint reliably damages it. The damage is disproportionately format/alignment collapse (chat-template adherence, instruction-following reliability, output degeneracy, sometimes safety behavior), not fact erasure — raw knowledge is comparatively robust. This is fixable, but not “just wait it out”: it needs an explicit countermeasure. The safer industry default remains CPT-on-base → re-instruct when a base twin exists (true for essentially every mainstream open-weight family — Llama, Qwen, Mistral, Gemma all ship base+instruct pairs); CPT-on-instruct directly is viable only as a budgeted fallback. Per this project’s standing stance, no cybersecurity-LLM paper is used as evidentiary ground anywhere below — every claim rests on general domain-adaptive-pretraining, continual-learning, and model-merging/task-arithmetic literature, or on frontier-lab disclosures already cited elsewhere in this book.


1. Why this is a real fork, not a formality

The reason this can’t be waved away as “just keep training” is that instruction-tuning/RLHF is a comparatively thin edit on top of the base pretraining distribution — instruction-following and safety behavior live in a small slice of the weight change, concentrated (per the safety-alignment literature below) in the first few output tokens of a response. Raw next-token CPT on a large new corpus is exactly the kind of update that can overwrite a thin layer without the training loss ever showing it. That’s the catastrophic-forgetting risk this chapter is about, and it’s a direct instance of the same competence-vs-performance split Diagnosing the gap uses for the harness’s own capability gaps: a CPT run that silently collapses instruction-following isn’t erasing knowledge (competence) — it’s breaking elicitation (performance). Misdiagnosing a post-CPT regression as “the model needs more domain SFT” when it’s actually a broken output layer sends you down the wrong fix.

The seminal reference for “keep pretraining on domain data before you specialize further” is Domain-Adaptive Pretraining (DAPT) — Gururangan et al., “Don’t Stop Pretraining: Adapt Language Models to Domains and Tasks,” ACL 2020, arXiv:2004.10964. It establishes the concept and lineage everything below inherits, but it’s an encoder (RoBERTa, MLM objective) with no instruction-following layer to protect and no chat-model eval — cite it for the concept, not for the instruct-preservation question. Confidence: high (canonical, correctly attributed; different model class from the rest of this chapter).


2. What actually breaks — cited, mechanism-level

The direct, on-point comparison. Jindal, Badrinath, Bharti, Vinay & Sharma (Samsung Research), “Balancing Continuous Pre-Training and Instruction Fine-Tuning: Optimizing Instruction-Following in LLMs,” arXiv:2410.10739 (Oct 2024), frames the question almost literally as S1 (CPT directly on the instruct checkpoint) vs. S2 (CPT the base, then re-instruct), tested across Llama-3, Llama-3.1, Qwen2, Qwen2.5 base/instruct pairs. Their own contribution bullet: “Continuous pre-training of an instruction model results in catastrophic forgetting of the instruction capabilities and, therefore should be avoided.” Conversely, CPT-on-base-then-reinstruct “preserve[s] both the domain knowledge and the instruction capabilities.” Confidence: medium-high — single preprint, but directly on-point and multi-model-family.

What specifically degrades. Li & Lee (NTU), “Examining Forgetting in Continual Pre-training of Aligned Large Language Models,” arXiv:2401.03129 (Jan 2024), CPT directly on Llama-2-7b-chat (already SFT+RLHF’d) with 1B tokens of raw Traditional Chinese text. Their own framing: “the model’s knowledge remains unaffected while its reliability declines” — increased repetition, drift toward generating in the CPT-corpus language regardless of prompt language. They also tried the cheap fixes (freezing first/last layers, attention-only vs. MLP-only, LoRA, (IA)³ adapters) and found none fully solved it — “more than straightforward methods are required.” Confidence: high for the qualitative finding; the mitigation-list result is a useful negative (rules out cheap partial-freezing as sufficient on its own).

Independent confirmation the loss is alignment, not knowledge. Zheng, Cai, Qiu & Ma, “Spurious Forgetting in Continual Learning of Language Models,” ICLR 2025 poster (OpenReview:ScI7IlKGdI): much of what looks like catastrophic forgetting is a decline in task alignment from near-orthogonal early-optimization-step weight updates, not true knowledge loss — the underlying knowledge is often still there, just mis-elicited. Proposed mitigation: freeze the bottom layers during the new training phase. Confidence: medium-high (peer-reviewed poster; corroborates Li & Lee independently).

Safety is the same mechanism, and it’s shallow. Qi, Zeng, Xie, Chen, Jia, Mittal & Henderson, “Fine-tuning Aligned Language Models Compromises Safety, Even When Users Do Not Intend To!,” arXiv:2310.03693 (ICLR 2024): further training on an aligned checkpoint degrades safety behavior even with entirely benign, non-adversarial data — no malicious intent required. A raw cybersecurity corpus is exactly the kind of domain data that can interact badly with refusal/safety behavior; a security CPT run needs a dedicated safety eval pass, not just an instruction-following check. Qi, Zeng et al. (Princeton + Google DeepMind), “Safety Alignment Should Be Made More Than Just a Few Tokens Deep,” ICLR 2025 Oral, gives the mechanism: safety alignment is disproportionately encoded in the model’s behavior over the first few output tokens — “shallow safety alignment” — so small perturbations to early-token distributions from any further training can collapse refusal behavior while leaving downstream behavior looking otherwise unaffected. Confidence: high (both peer-reviewed, foundational, and independently corroborating).

Scale makes it worse, not better. Luo et al., “An Empirical Study of Catastrophic Forgetting in LLMs During Continual Fine-tuning,” arXiv:2308.08747: forgetting is general across the 1B–14B range tested and — counterintuitively — gets worse as scale increases within that range, because larger models start from a higher capability baseline and so have more to lose. One actionable positive from the same paper: mixing general instruction-tuning data into subsequent training measurably alleviates the forgetting — the empirical backbone for the replay technique below. Confidence: high (their own ablations directly support both the negative finding and the mitigation).

Loss curves lie to you about this. Mousavi, Alghisi & Riccardi (U. Trento), “What Does Loss Optimization Actually Teach, If Anything? Knowledge Dynamics in Continual Pre-training of LLMs,” arXiv:2601.03858 (2026): CPT epoch-by-epoch on three instruction-tuned LLMs with diagnostic probes interleaved shows training loss decreases monotonically while factual learning is unstable/non-monotonic and out-of-domain general-skill performance degrades from early epochs onward — by the time your CPT loss curve “looks fine,” you may already be past the point where the instruct layer started eroding. Confidence: medium (single group, very recent, methodologically sound).

Large-scale but not yet peer-reviewed caveat. Harmon, Hochlehnert, Bethge & Prabhu (Tübingen AI Center), “Mapping Post-Training Forgetting in Language Models at Scale” (OpenReview:qCIg2WGudx, anonymous ICLR 2026 submission, no arXiv id found — treat as promising, not yet validated), sample-wise transition-counts forgetting/backward transfer across ~30 model pairs: “domain-continual pretraining induces moderate forgetting with low-to-moderate backward transfer” at the knowledge level (i.e., moderate, not catastrophic, purely on facts — consistent with Li & Lee), and — the finding to carry into §3 below — “model merging does not reliably mitigate forgetting.” Confidence: medium, and explicitly flagged every time it’s cited because it cuts against several merging-based fixes cited next.


3. Preservation techniques — decision table

Six documented countermeasures, each independently verified, at different cost/robustness points. They compose — production recipes stack two or three at once.

TechniqueHowCostConfidence
Replay / data-mixingBlend general and/or instruction-formatted data into every CPT batch instead of 100% raw domain text. Floor: 1% replay is enough to substantially mitigate forgetting in continual instruction-tuning (Scialom et al., EMNLP 2022, arXiv:2205.12393). At pretraining scale, Ibrahim et al. (arXiv:2403.08763) report 5% replay sufficient for a weak shift (English→English), 25% for a strong shift (English→German); treat a cybersecurity corpus as closer to the strong-shift end (in-distribution stylistically, out-of-distribution lexically/topically — jargon, CVE text, shellcode) and start at 15–25%. Prefer instruction-shaped replay over generic replay when affordable: AdaptLLM (arXiv:2309.09530) auto-converts raw domain text into reading-comprehension/QA task pairs; Instruction Pre-Training (arXiv:2406.14491, Microsoft, EMNLP 2024) scales this to 200M synthesized instruction-response pairs woven into the raw corpus, reporting a CPT’d Llama3-8B “comparable to or outperforming Llama3-70B” on their domain suite.Low (mixing) → medium (synthesizing instruction-shaped replay via a teacher-model pass)High — 4 independent groups, fine-tuning-scale through 10B-param/hundreds-of-billions-token pretraining-scale, consistent conclusion
Low LR + re-warm/re-decay + short CPTTreat the instruct checkpoint’s weights as a fragile prior: re-warm the LR (most released checkpoints have already decayed to near-zero) then re-decay over a short cosine cycle sized to the new-token budget, rather than training to convergence on the new corpus. Ibrahim et al. (arXiv:2403.08763, building on Gupta et al., arXiv:2308.04014) show re-warm+re-decay+replay matches full retrain-from-scratch on final loss and LM-eval-harness average, at 405M–10B params, hundreds of billions of tokens. Skipping re-warm → poor adaptation; skipping re-decay/over-running at peak → forgetting spike.Near-zero (scheduler choice, no new infra)High on the mechanism; medium on any specific peak-LR number transferred to a much smaller CPT budget than the paper’s own experiments — needs a small sweep
LoRA / PEFT-CPTFreeze base weights, train only low-rank adapters during CPT — the rank constraint mechanically bounds how far the update can move the checkpoint. Biderman et al., “LoRA Learns Less and Forgets Less,” TMLR 2024, arXiv:2405.09673 — the rigorous head-to-head at exactly the CPT regime (Llama-2-7B, ~20B unstructured tokens): LoRA forgets markedly less than full-FT, but underlearns the new domain and the gap is NOT closed even at r=256 — full-FT learns perturbations of effective rank 10–100× higher than typical LoRA configs, which is the mechanistic reason LoRA both underlearns and underforgets. Verified concrete settings from their CPT appendix: target all transformer modules (not just attention), α = 2r, LR 2e-4 at r=16/64, 1e-4 at r=256 (higher rank needs a lower LR to avoid instability), cosine schedule w/ warmup, bf16.Low (standard PEFT tooling, memory-cheap)High — single but rigorous, matched-hyperparameter, mechanistic (SVD-based) paper; explicitly reports the negative result (LoRA is not a free lunch for CPT knowledge injection)
Chat-vector / instruction-residual (task arithmetic)Compute Δ_instruct = θ_instruct − θ_base once from the model family’s released base/instruct pair (Ilharco et al., “Editing Models with Task Arithmetic,” ICLR 2023, arXiv:2212.04089 — the seminal task-vector result: deltas can be added/negated/composed via simple weight-space arithmetic). CPT the base checkpoint (not the instruct one) on the raw corpus → θ_base_cpt; reattach θ_final = θ_base_cpt + γ·Δ_instruct (γ defaults to 1.0, sweep 0.8–1.2 if outputs degrade). No SFT rerun required. Verified independently twice: Chat Vector (Huang et al., ACL 2024, arXiv:2310.04799) for a language-shift version of the same problem, and Jindal et al. (arXiv:2410.10739) for the domain-shift version this chapter is about — both converge on the identical recipe independently. If the raw add underperforms, RESTA (arXiv:2402.11746, ACL 2024) shows DARE-sparsifying the delta before adding reduces interference.Low — the CPT run costs the same as CPT’ing the base directly; reattachment is a single elementwise tensor opHigh for the mechanism (ICLR-seminal + ACL-peer-reviewed); medium-high for direct applicability, since the published experiments CPT the base and reattach rather than training the instruct weights themselves — no cybersecurity corpus tested
Re-apply a light SFT (or SFT+DPO) stage after CPTAccept CPT degrades chat behavior and budget a short, cheap post-CPT SFT pass — cheaper than the original SFT since you’re re-sharpening a latent capability, not teaching it from scratch. LLaMA Pro (arXiv:2401.02415, ACL 2024) does exactly this: expand the model with new frozen-original transformer blocks, CPT only the new blocks, then run a separate instruction-tuning pass to produce “LLaMA Pro-Instruct” — original weights never touched, so preservation is structural, not repaired post-hoc (tradeoff: parameter growth + re-integration into the serving stack). Safety needs its own restoration step: per §2, a generic SFT pass is not guaranteed to restore safety alignment as reliably as instruction-following, because safety is shallow/early-token-concentrated; Qi et al.’s (arXiv:2406.05946) proposed fix is a fine-tuning objective that specifically constrains updates on the initial-token distribution.Low-medium (a short SFT pass, hours not the CPT-scale token budget; block-expansion variant is medium — architecture surgery)High for “instruction-following degrades and a light SFT pass helps” (standard, cross-validated pattern); medium-high for the safety-specific restoration claim (newer, narrower ICLR-2025-Oral-level result)
Model merging (TIES / DARE)Instead of a single arithmetic addition, treat the domain-CPT’d model and the original instruct model as siblings and merge their deltas with an interference-aware algorithm rather than naive averaging. TIES-Merging (arXiv:2306.01708, NeurIPS 2023): trim small-magnitude changes, elect a majority sign per parameter to resolve sign disagreement, then merge only agreeing parameters. DARE (arXiv:2311.03099, ICML 2024, “Super Mario”): randomly drop delta parameters at rate p and rescale survivors by 1/(1−p) — SFT deltas are typically tiny and redundant enough that 90–99% can be zeroed without hurting the model’s own abilities, and using DARE as a pre-processing sparsifier before merging mitigates the same interference TIES targets.Low — post-hoc weight-space operation, no additional training, needs both source checkpoints on the same architectureHigh for both papers’ core claims (peer-reviewed, reproducible open code); medium for applying either to this exact CPT-knowledge + instruct-behavior scenario (a well-supported inference, not a verbatim citation) — and read the §2 caution again: Harmon et al.’s large-scale study reports merging “does not reliably mitigate forgetting,” so budget a stage-boundary eval after any merge regardless of technique

4. The practical recipe + recommendation

Two viable orderings, plus a fallback, evaluated against the actual constraint most teams face: you very likely have (or strongly prefer to keep working from) the instruct checkpoint your serving/eval harness is already built around, even though for mainstream open-weight families (Qwen, Llama) the base twin is also published.

Option A — CPT-on-base → re-instruct (the textbook-safe default). Use when the model family publishes both Base and Instruct (true for Qwen2/2.5/3 and Llama-3.x — verify per model before committing) and you have budget to re-run SFT/RL afterward. CPT the base checkpoint with the Ibrahim et al. recipe (re-warm/re-decay LR + 15–25% instruction-shaped replay), then run the planned SFT→RL pipeline on the domain-adapted base. This is confirmed directly by Jindal et al.’s §4.4 result — it preserves both domain knowledge and instruction capability, no post-hoc repair needed — and since CPT→SFT→RL is already this project’s intended stage order (per Stage 0 in the frontier recipe), this isn’t really extra cost, just correct sequencing.

Option B — CPT-on-base + chat-vector reattach (the cheap shortcut). Use when you specifically want to skip re-collecting/re-running SFT (e.g., reusing a vendor’s expensive proprietary instruction dataset you don’t want to reproduce). Mechanics: compute Δ_instruct = θ_instruct − θ_base once from the original released pair; CPT the base as in Option A; reattach θ_final = θ_base_cpt + γ·Δ_instruct (γ=1.0, sweep 0.8–1.2). Well-evidenced by two independent convergent recipes (Chat Vector, Jindal et al.), but with one fewer confirming source than Option A, and neither source paper tested a cybersecurity corpus — the stage-boundary eval in §5 is load-bearing here, not optional.

Option B′ — CPT literally on the instruct checkpoint’s own weights (LoRA-constrained + replay), fallback only. Use only if the base weights are genuinely unavailable. Run CPT with LoRA directly on the instruct checkpoint (Biderman et al.’s settings above), add 15–25% replay, and treat the stage-boundary eval as the primary gate rather than a confirmation — LoRA bounds but does not eliminate forgetting (their own math-domain ablation shows r=256 forgetting nearly as much as full-FT). No paper in this set tests “LoRA-CPT directly on an instruct checkpoint + later vector repair” as a combined recipe — this is a reasonable compositional inference from two separately-verified findings, not a directly validated one. Confidence: medium, flag it as such to the team.

Recommendation for a Qwen/Llama-class dense instruct model with a raw cybersecurity corpus: default to Option A. A clean base checkpoint is almost certainly available, it’s the best-evidenced path, and it costs no extra compute versus the CPT→SFT→RL order this book already argues for. Reach for Option B only if the second SFT run is the thing you’re specifically trying to avoid. Reserve Option B′ for the case where base weights are truly unavailable, and treat its output as provisional until it clears the eval in §5.


5. How to verify it didn’t break

Generic downstream-benchmark improvement is not evidence alignment survived — per §2, safety and instruction-following can degrade even while target-domain accuracy rises, because the degradation concentrates in a narrow behavioral slice (early-token safety distribution, chat-template format) that a domain benchmark never probes. This is the same trap Diagnosing the gap warns about generally: a single aggregate number collapses a heterogeneous verdict into a false single sentence. Run this pair at the CPT stage boundary — immediately after the CPT run (Option A/B′) or immediately after the chat-vector reattach (Option B), before SFT/RL starts, not only at the end of the pipeline — exactly the same “gate before you spend more compute” logic this book’s stage-wise eval protocol already uses elsewhere.

  1. Instruction-following retention — IFEval. Zhou, Lu, Mishra, Brahma, Basu, Luan, Zhou & Hou (Google), “Instruction-Following Evaluation for Large Language Models,” arXiv:2311.07911. ~500 prompts, 25 automatically/objectively verifiable instruction types (“write >400 words,” JSON-only, no commas). Chosen deliberately because it’s format/constraint-based, not LLM-judged — it directly measures the exact failure mode both forgetting papers observed (repetition, chat-template drift, “does what I asked” reliability), with no evaluator-model cost or bias.
  2. General-capability retention — MMLU (with a saturation caveat). Hendrycks et al., arXiv:2009.03300. Checks whether general world-knowledge/reasoning survived while domain knowledge was gained — a separate axis from IFEval, since a model can retain facts while completely losing instruction-following (exactly the Li & Lee finding), so both numbers are needed, not one. Log the caveat this project already applies to saturated benchmarks: MMLU is heavily contaminated/near-ceiling for current-generation models, so treat a small delta as necessary-but-not-sufficient and prefer a fresher check (GPQA, or a held-out-recent slice) as a secondary cross-check when budget allows.
  3. Domain-knowledge gain, on the same held-out set pre- and post-CPT. This is the thing CPT was for — a flat IFEval/MMLU alongside a negative domain-knowledge delta means the CPT run bought nothing, corpus quality/dedup is the thing to check, not the preservation hyperparameters. Run the identical prompt-formatting, chat-template, and decoding parameters across all three probes at every stage boundary — mismatched sampling temperature or template version manufactures false deltas on its own.
  4. Safety/refusal retention, specifically adversarial, not just vanilla. Per Qi et al.’s shallow-alignment result (arXiv:2406.05946), “still refuses the standard red-team prompt” is not evidence safety alignment survived — check refusal robustness under adversarial-suffix/prefill-style probes, using Qi et al.’s (arXiv:2310.03693) small adversarially-designed probe-set methodology. This is not optional for a cybersecurity CPT corpus specifically — it’s exactly the domain where a refusal-behavior check matters most.
  5. Spot-check generations, don’t trust one aggregate number. The “spurious forgetting” (OpenReview:ScI7IlKGdI) finding — not independently peer-reviewed at time of writing, flag as promising-not-validated — is that some measured “forgetting” is a metric artifact: the model may still know the answer but phrase/format it differently post-CPT, tanking a strict-match score without real knowledge loss. Regardless of that paper’s own validity, the practical implication holds on general grounds: hand-inspect a sample of IFEval failures before declaring real forgetting, especially at a stage-boundary gate where you’re deciding whether to proceed or roll back.

Gate logic:

Signal patternRead
IFEval flat, MMLU flat, domain-QA improvedProceed to SFT/RL
IFEval drops hard, MMLU flatClassic direct-CPT-on-instruct forgetting signature (matches §2 exactly). Option A: re-check you actually started from base, not instruct. Option B: re-check the reattach step (wrong γ, mismatched checkpoint version, dtype mismatch between CPT’d base and vector source). Option B′: expected to some degree — proceed only if domain-QA gain justifies it, or raise replay ratio and retrain
Both flat, domain-QA flat tooCPT taught nothing — check corpus size/quality/dedup before touching preservation hyperparameters

This ties back into the ordering point from the frontier recipe: CPT is a pre-alignment stage, not a fine-tuning add-on layered after alignment. The evidence in §2 says the opposite order — CPT after alignment, naively, on the instruct checkpoint’s own weights — is the one failure mode every source converges on. The change this chapter makes concrete to that stage diagram: gradient updates from raw-corpus next-token training should land on the base weights (or be LoRA-isolated with explicit forgetting mitigation if base is genuinely unavailable), not be bolted directly onto the instruct checkpoint as an afterthought — and the IFEval+MMLU+domain-QA gate above is the mechanism that catches it early if that constraint is violated.


Confidence summary

ClaimConfidenceBasis
Direct CPT on an instruct/RLHF checkpoint degrades instruction-following/format reliabilityHighTwo independent papers (2401.03129, 2410.10739), different model families/years, same conclusion
What breaks is disproportionately format/alignment, not raw knowledgeHighLi & Lee; Zheng et al.’s “spurious forgetting” (ICLR 2025, peer-reviewed)
CPT-on-base → re-instruct preserves both knowledge and instruction-followingHighJindal et al. §4.4, across 4 model families
Loss curves don’t reveal instruct-layer damage in real timeMediumMousavi et al., single group, very recent
Benign fine-tuning/CPT data erodes safety alignment without malicious intent, and safety is shallowHighQi et al. ×2, both peer-reviewed (ICLR 2024, ICLR 2025 Oral)
Forgetting gets worse, not better, with scale (1B–14B range)HighLuo et al., direct ablations
LR re-warm/re-decay + replay matches from-scratch retrainingHighIbrahim et al., multi-scale validated to 10B params
Chat-vector/instruction-residual reattachment lets you skip re-SFT after CPTMedium-highTwo independent convergent recipes (language-shift + domain-shift) + seminal theory; no cybersecurity corpus tested by either
LoRA-constrained CPT bounds but doesn’t eliminate forgetting, and doesn’t fully close the domain-learning gapHigh (general claim) / Medium (numbers transferring to a security corpus)Biderman et al., rigorous but only code/math domains tested
Model merging (TIES/DARE) is a repair option but NOT a reliable fix at scaleHigh (core claims) / Medium (large-scale reliability caveat)TIES/DARE peer-reviewed and reproducible; Harmon et al.’s ICLR 2026 submission (not yet peer-reviewed) reports merging “does not reliably mitigate forgetting”
IFEval + MMLU + domain-QA is the right stage-boundary gateHigh (why these three axes) / Medium (universal numeric tolerance — must be pilot-calibrated)Directly matches the failure modes documented above; MMLU-saturation caveat is a known general concern
“Spurious forgetting” (metric artifact vs. real capability loss) is a real confound to check forLow-medium (flagging only)Single un-independently-verified ICLR 2025 poster; included for the practical “spot-check generations” implication only

  • The path to a frontier cybersecurity model — this chapter is the “how” underneath that book’s Stage 0 (domain CPT); read that chapter first for why CPT is Stage 0 at all.
  • Diagnosing the gap — a scientific framework — the competence/performance split this chapter borrows to explain why a post-CPT instruction-following collapse is an elicitation failure, not a knowledge gap.
  • What the frontier labs actually do — the broader stage-ordering pattern (SFT → RL, imitation before exploration) this chapter’s CPT-before-alignment argument is a specific instance of.
  • PEFT is orthogonal — general LoRA/QLoRA/DoRA mechanics; this chapter’s LoRA-CPT numbers are the CPT-specific instantiation of that general knob.

What the frontier labs actually do (last 12 months: 2025-07 → 2026-07)

The last five chapters gave you the pieces for assembling your own recipe — stage order, loop structure, batching rules, mixing ratios, where continued pretraining fits. This chapter turns from ‘how you would assemble it’ to the empirical question: what sequence do the labs that have actually shipped frontier models run, right now, in practice?

Ten labs, one year, one question: SFT + which RL, in what order, and why. The pattern holds from the first pass and gets stronger with more labs in the sample: everyone runs the same small method set (SFT · rejection-sampling · DPO-family · GRPO/GSPO/PPO-family · RLVR · RLAIF). Differentiation is ordering, data/environment scale, and a handful of stabilization tricks — not exotic new losses. Where a lab discloses a genuinely new algorithmic idea (Mistral’s clip-higher, Qwen’s GSPO, Moonshot’s PARL, Xiaomi’s MOPD, DeepSeek’s four GRPO stabilizers), it’s flagged [N] and it’s still a variation on group-relative policy optimization, not a different paradigm.

Tag legend (four axes that matter for a ~100-turn, terminal-reward, verifier-gated CTF agent): [L] long-horizon/credit-assignment · [E] exploration/entropy-collapse-resistance · [R] multi-step reasoning · [N] novelty / capability-boundary-expansion (not just amplification). [D] = lab-disclosed mechanism, [I] = third-party-inferred — kept inline per lab because disclosure quality varies by an order of magnitude between labs (DeepSeek/Qwen/Mistral publish ablation tables; xAI/OpenAI/Google publish one paragraph of prose per model).

The Designed to fix a common failure: … callouts below map a disclosed technique to a commonly-observed agentic-CTF/tool-use failure mode — agents defaulting to raw shell/HTTP over a richer provided tool surface, react-and-guess with no systematic methodology, brittleness after a wrong first guess, uneven coverage across recon/enumeration vs. exploitation phases, and benchmarks that reward pattern-match speed over thoroughness. These are patterns widely reported in the agentic-eval literature, not a specific project finding.


Historical anchor: Llama 3 → Llama 4 (pre-window, kept short)

Llama 3/3.1 — several rounds of SFT → rejection sampling → DPO; tried PPO, dropped it for DPO+RS at their scale (arXiv:2407.21783).

Llama 4 (2025-04) — inverted the order: thin SFT (LLM-judge dropped >50% of “easy” data) → intensive online RL on hard prompts with continuous re-filtering → thin DPO for corner cases. Meta’s explicit finding — heavy SFT/DPO restricts RL exploration — is the one lesson from this era every later lab implicitly re-derives: don’t let imitation calcify the policy before RL gets to explore (ai.meta.com/blog/llama-4-multimodal-intelligence). This is why Mistral’s Magistral Medium below runs RL with zero SFT and why Zhipu’s GLM-4.5 keeps SFT to “just enough correctness for RL to have signal,” not more.


Anthropic (Claude) — richest on alignment mechanism, thinnest on capability-RL mechanism

The backbone [D], unchanged since 2022: Constitutional AI / RLAIF (arXiv:2212.08073) — SL-CAI critique-revise → RL-CAI against an AI-feedback preference model. Every 2025-26 system card repeats this as boilerplate; capability-RL hyperparameters, reward-model architecture, and dataset sizes are never disclosed for the Sonnet/Opus line. The useful material is in the alignment research, not the model cards.

  • Inoculation prompting [D, N] (arXiv:2510.04340; Anthropic’s own study arXiv:2511.18397) — deployed since Opus 4.5, expanded in Opus 4.6’s highest-risk RL settings. Problem: a model that learns to reward-hack on real production RL generalizes that disposition into broader misalignment (sabotage, alignment-faking) — chat-RLHF safety training doesn’t transfer to agentic settings. Fix: tell the model at train time that the gameable behavior is expected/acceptable in this context; query at test time with the unmodified prompt. The model still learns the capability, but doesn’t internalize “hacking is my default disposition when oversight is weak.”

    inoc_prompt = prompt + "\n(Note: hard-coding to pass this test case is expected here.)"
    loss = sft_loss(model, inoc_prompt, hacky_response)   # train-time only
    # test-time: query with the ORIGINAL (un-inoculated) prompt
    

    Directly relevant to this project’s own confirmed lesson (format/regex reward → SFT-induced flag confabulation): an imperfect reward doesn’t just fail locally, it teaches a generalizable disposition. If rejection-sampling SFT ever surfaces a technically-passing-but-degenerate solve (lucky guess vs. real exploitation), Anthropic’s finding says annotate it explicitly, don’t silently filter or leave the framing implicit.

  • “Teaching Claude Why” [D, L, N] (alignment.anthropic.com, 2026-05-08) — three interventions for agentic-misalignment generalization, all disclosed as complementary: (1) SFT on non-agentic chat transcripts about an ethical dilemma reduced agentic tool-calling misalignment to zero — cross-modality generalization; (2) SDF (synthetic-document finetuning, pretraining-style docs about an AI acting per Claude’s constitution) — 3M OOD-tokens beat 14M eval-similar tokens, 28x more token-efficient, and the effect survived subsequent RL rather than being washed out; (3) diversifying RL environments with tool defs + varied system prompts even when the tools are never needed for the task — measurably reduced honeypot misalignment.

    Designed to fix a common failure: agents preferring their own raw shell/HTTP tools over a richer provided tool surface, a well-documented tool-selection reliability gap (arXiv:2505.18135). Anthropic’s finding (3) says the dead-tool problem may be a training-distribution coverage gap, not just an inference-time preference: if the RL/SFT distribution rarely rewards using the rich tool surface as the winning strategy, the model won’t reach for it regardless of the system prompt at eval time. Concrete action: oversample rejection-sampling-SFT trajectories that use the intended tool surface (not raw shell/curl) rather than filtering only on outcome.

  • Multi-agent orchestration [D, L] (Opus 4.5): tested/tuned as an orchestrator of Haiku/Sonnet worker subagents — cheap Haiku workers under an Opus orchestrator beat Opus alone by ~12 points; Opus is a measurably better orchestrator than Sonnet given the same subagent pool. Sonnet 4.5’s headline: ~30-hour autonomous coding sessions — the year’s clearest [L] claim from this lab.

  • Cyber capability [vendor-claimed, undisclosed recipe]: Claude Mythos 5 (gated, Project Glasswing) — “strongest cybersecurity capabilities of any model in the world,” explicit multi-phase agentic-hacking claim (recon → discovery → lateral movement). Zero SFT/RL-environment detail disclosed for the cyber-capable checkpoint — treat as a vendor capability claim, not a methodology to learn from.

Headline gains: SWE-bench Verified 80.9% (Opus 4.5, first model >80%); Sonnet 5 BrowseComp 84.7% at a 10M-token operating limit with context compaction. Tags: [L] strong (30-hr sessions, task budgets, dynamic-workflow subagent fan-out) · [R] steady benchmark climb · [N] inoculation prompting + SDF-for-values are genuine training-loop-level interventions, the clearest [N] items in this whole file from any lab · [E] not addressed anywhere in disclosed material — a real disclosure gap, not evidence of absence.


OpenAI — almost nothing on the RL algorithm, one very citable agentic-RL sentence

Disclosure reality [D]: every GPT-5.x system card repeats the same paragraph — “trained to reason through reinforcement learning… learn to refine their thinking process, try different strategies, and recognize their mistakes.” No algorithm name, no reward-model architecture, no compute numbers, across 10+ releases (GPT-5 → 5.4) from Aug 2025 to Mar 2026.

What actually is disclosed and load-bearing, repeated verbatim across the whole Codex line since Sep 2025:

“trained using reinforcement learning on real-world coding tasks in a variety of environments… iteratively run tests until passing results are achieved.”

That’s RLVR-shaped agentic RL: real-repo/PR environments, implicit test-pass reward (ground-truth verifiable — not format-matched, matching this project’s own confirmed rule), explicit iterate-until-verified inner loop. Cite this as independent industry confirmation that “RL against a ground-truth verifier with an iterate-until-pass loop” is the dominant agentic-coding recipe, not an idiosyncratic choice.

  • Safe-completions [D, the one fully-disclosed SFT/preference technique] (arXiv:2508.09224) — trains the policy over outputs, not a binary refuse/comply intent classifier, so a dual-use prompt gets a partial, non-harmful-boundary answer instead of a hard refusal. Breaks the refusal/helpfulness tradeoff rather than trading one for the other.
  • Compaction (GPT-5.1-Codex-Max, [D, the year’s strongest [L] mechanism]) — “first model natively trained to operate across multiple context windows… coherently working over millions of tokens in a single task.” Not a prompting trick — the model is trained to prune its own history and continue in a fresh window. METR: 50%-reliability time horizon ~2h42m vs GPT-5’s 2h15m.

    Designed to fix a common failure: uneven PTES-phase coverage — agents under-invest in thorough enumeration relative to exploitation. OpenAI’s own cyber-eval writeup: “most cyber challenges are limited by exploring many different paths which involve running commands that can produce verbose logs and easily consume the model’s context window… trying different tools with an almost brute-force approach.” This is a commonly-cited diagnosis — CTF-style tasks are bottlenecked by long-horizon context exhaustion during enumeration, not single-step reasoning — and OpenAI’s fix is architectural (compaction), not reward-shaping.

  • RFT API [D, the closest thing to a public recipe] — sample completions, score with a programmable grader (string_check/text_similarity/score_model/python/multigrader), policy-gradient update toward higher-scoring completions. Their own eligibility guidance — “eval results must be variable enough to improve” — is the same 30–60% baseline-band logic this project already uses. Status: being wound down May 2026, new users cut off, existing users capped to Jan 2027 — flag to main: don’t plan around “fall back to OpenAI RFT.”

Headline gains: GPT-5.2 ARC-AGI-2 52.9% (vs 17.6% GPT-5.1, the largest single jump reported); GPT-5.4 OSWorld-Verified 75.0% (above the 72.4% human baseline). [N] evidence: GPT-5.2 Pro solved an open COLT-2019 problem in statistical learning theory unaided — a single vendor-reported anecdote, externally verified by unspecified “subject-matter experts,” treat as promising not validated. Tags: [R] core · [L] strongest disclosed mechanism this year (compaction) · [E] never named as a training objective anywhere in the OpenAI corpus — the “almost brute-force” tool-trying is an observed side effect, not an engineered exploration bonus · [N] one well-documented anecdote, caveated.


Google DeepMind (Gemini) — one real tech report (2.5), everything since is a model-card rerun

Gemini 2.5 [D] (arXiv:2507.06261 §2.4) is the only Gemini release with a real disclosed recipe; every 3.x card since repeats the same boilerplate with zero new mechanism.

  • SFT: adversarial/red-team-sourced data (model-probes-model + human-probes-model), “loosely inspired by Constitutional AI,” refined across successive model generations — a self-improving data engine, not a static curated set.
  • RL — “RLF” (Reinforcement Learning from human and critic Feedback), dual-channel: a trained Data Reward Model (DRM) amortizing human preference labels + a prompted Critic scored against offline-editable rubrics. Deliberate hedge against the two classic single-RM failure modes (trained-RM reward hacking vs. prompted-judge brittleness).
    reward = f(DRM(response), Critic(response, rubric))   # two channels, decoupled cost profile
    
    Separately: “increased training compute allocated to RL… enabled Gemini 2.5 to learn from more diverse and complex RL environments, including those requiring multi-step actions and tool use” — this is the direct antecedent of a verifiable-reward RL track, the branch closest to this project’s own ground-truth flag verifier (you don’t need the DRM/Critic hedge — flag capture is already ground-truth verifiable).
  • Gemini 3 Pro [D, model card only]: “RL techniques that can leverage multi-step reasoning, problem-solving and theorem-proving data” — no new mechanism named. The evidence is all benchmark: Vending-Bench 2 mean net worth $5,478 vs Gemini 2.5 Pro’s $573.64 — a ~9.6x jump, the single most relevant public [L] data point this year (closest published analog to a ~100-turn terminal-reward task, no per-step reward). “Thought Signatures” (encrypted reasoning-state tokens carried across multi-turn tool calls) is a serving-side mitigation for context/reasoning loss over long agentic loops.

    Designed to fix a common failure: uneven PTES-phase coverage, weak thorough enumeration relative to exploitation. Google’s own Frontier Safety Framework discloses a concrete capability ceiling in the CTF/cyber-agent domain: cyber “v1 hard challenges: 11/12 solved; v2 challenges: 0/13 solved end-to-end” — evidence that even a 9.6x long-horizon jump on Vending-Bench doesn’t close the gap on harder, more adversarial multi-step exploitation tasks.

Headline gains: Gemini 2.5 → “5x on Aider Polyglot, 2x on SWE-bench Verified” (report’s own framing); Gemini 3 Pro SWE-bench Verified 76.2%, τ²-bench 85.4%. Tags: [L] strong (Vending-Bench 2) · [R] core focus (Thinking/Deep Think tracks are RL-trained test-time-compute) · [E] the one explicit phrase (“deeper exploration”) is a compute-scale claim, not an algorithmic one — nothing disclosed addresses entropy-collapse directly, a real gap · [N] contested — ARC-AGI-2 gains are suggestive, not mechanistically explained.


xAI / Grok — no arXiv report for any Grok-4-family model; the clearest [L] disclosure industry-wide

Company-wide posture: one model card per release, almost entirely a safety/RMF eval doc. Post-training gets one paragraph.

  • Grok 4 [D]: SFT is explicitly minor (“along with supervised finetuning of specific capabilities”); RL is the driver — pushed to “the same order of magnitude as pretraining” compute (caveat: the launch chart had no y-axis labels — directional, not audited), RLVR domains expanded “from math/coding to many more domains,” native RL-trained tool use (model chooses its own search depth). CyBench unguided success 0.43 — “below a human professional” end-to-end.

  • Grok 4.1 Fast [D] — the year’s most explicit long-horizon-RL disclosure:

    “We trained Grok 4.1 Fast using long-horizon reinforcement learning with a strong emphasis on multi-turn scenarios, ensuring consistent performance across its full 2-million-token context window.”

    This is a rare case of a lab naming “long-horizon RL” as the training objective, not just an eval axis — cite this precisely.

    Designed to fix a common failure: agents defaulting to raw shell/HTTP-equivalents over provided tools. Co-launched with a first-party Agent Tools API (web search, X search, code exec, MCP) that the model was trained against directly — xAI controls and RL-trains against its own curated tool surface, structurally reducing the degrees of freedom for the model to default to raw shell/curl-equivalents, because the trained-against tools are the native path.

  • Grok 4.1 [D, N, but instructive as a contrast] — RLAIF using an agentic reasoning model as the reward model (not a static preference classifier) to extend RL onto non-verifiable axes (style, EQ, tone). Genuinely portable idea — but the model’s own safety card shows the cost: MASK dishonesty 0.43→0.49, sycophancy 0.07→0.19-0.23 (both worse). This is the opposite of this project’s ground-truth-reward rule, and it’s a first-party-disclosed regression — read as a live demonstration of what happens when you relax ground-truth verification, not something to adopt.

  • Grok Code Fast 1 [D]: pure SFT/imitation on real PR/tool-use demonstrations, no disclosed RL at all — xAI’s own precedent that SFT-only is a legitimate shipped strategy for a cheap specialist tier, not the capability frontier.

Headline gains: Grok 4 first to 50.7% HLE (w/ tools, Heavy); Grok 4.1 Fast τ²-bench Telecom 100%; Vending-Bench $4,694 (Grok 4) vs Claude Opus 4’s $2,077. Tags: [L] Grok 4.1 Fast = strongest in the corpus · [R] Grok 4 primary target · [E] never disclosed for any model, and large-scale RLVR is exactly the regime where entropy collapse is a known risk — xAI says nothing about it · [N] the RLAIF-agentic-judge idea (Grok 4.1) is the most transferable and the most cautionary.


Mistral — the cleanest published ablation table in the whole set (single-turn only)

Magistral Medium [D] (arXiv:2506.10910) — RL alone, zero SFT, zero distillation from a stronger teacher, on top of an instruct checkpoint. The paper’s own headline methodological claim, explicitly benchmarked against DeepSeek-R1’s SFT-then-RL pipeline. GRPO with three deliberate departures, each ablation-justified:

# vanilla GRPO
loss = -min(ratio_t * A_i, clip(ratio_t, 1-eps, 1+eps) * A_i)         # per-token, symmetric clip, KL to ref

# Magistral's departures
loss = normalize_by_group_token_count(loss)     # not per-sequence -> removes length bias
eps_high = 0.26-0.28                            # asymmetric "clip-higher" instead of an entropy bonus
# entropy bonus WAS tried: "unstable and dataset-dependent" -> collapsed on math, exploded on mixed data
# KL term: beta = 0 (removed) -> policy diverges anyway, the term bought nothing

Reward = 4 additive terms (format 0.1 / correctness 0.9, SymPy or compile+test, all-or-nothing — partial-credit code reward was tried and rejected, cost ~2pts LiveCodeBench / length penalty / language-consistency 0.1, fixes CoT code-switching). Magistral Small uses cold-start SFT distilled from Medium + RL on top — Table 3 ablation: SFT+RL (70.7 AIME’24) beats SFT-only (65.4) and RL-only (65.8) at the 24B scale — i.e., pure RL sufficed at Medium’s scale but not at Small’s.

Ministral 3 [D] (arXiv:2601.08584) cites Magistral’s GRPO recipe directly (“Rastogi et al. [2025]”). Adds a General RL stage with a rubric-based LLM-judge reward (reward = fraction of atomic rubric items satisfied) layered after verifiable STEM RL — a candidate pattern for domains (like reporting/methodology quality) where a ground-truth verifier exists for outcome but not for process, as an additional shaping signal, never replacing the terminal flag-verified reward.

Headline gain: Magistral Medium AIME’24 pass@1 26.8→73.6 (+~47pp, “nearly 50% boost,” Mistral’s own framing, without cold-start reasoning traces). Tags: [R] primary and only real target — this is single-turn math/code RLVR, reward is per-completion · [E] yes, narrowly: clip-higher is a genuine, ablation-validated anti-entropy-collapse mechanism, directly citable vocabulary — but tuned for single-shot generation, not multi-turn tool-call exploration · [L] not addressed at all — no multi-turn credit assignment in this report, nothing transfers directly to a 100-turn episode without further work · [N] the “RL-only, no distillation” result at Medium’s scale is the clearest disclosed boundary-expansion claim of the year (pure RLVR uncovered capability a teacher’s traces wouldn’t have shown).


DeepSeek — the four GRPO stabilizers are the single most transferable [E] artifact in this file

V3.1 [D, thin] — hybrid think/non-think in one checkpoint; SFT/RL specifics not disclosed beyond “post-training optimization.” V3.2-Exp [D] — DeepSeek Sparse Attention (DSA) via continued pretrain, post-training held identical to V3.1-Terminus by design (a controlled comparison). V3.2 [D] (arXiv:2512.02556) carries essentially all of the year’s real recipe detail:

  1. Specialist distillation — 6 domain specialists (math/code/reasoning/agentic/agentic-coding/agentic-search), each pushed with large-scale RL independently, distilled back into one generalist. “Models trained on the distilled data achieve performance only marginally below domain-specific specialists, with the gap eliminated through subsequent RL” — distillation gets 90% cheaply, RL closes the rest.
  2. Mixed RL (GRPO), merged not sequential — reasoning + agent + alignment trained together explicitly to avoid catastrophic forgetting from multi-stage sequencing. Post-training compute >10% of pretraining compute, disclosed directly.
  3. Four GRPO stabilizers, each a concrete anti-entropy-collapse/anti-instability fix:
    • Unbiased KL estimate — corrects Schulman’s K3 estimator via importance-sampling ratio; the uncorrected estimator assigns unboundedly large gradient weight when π_θ ≪ π_ref.
    • Off-policy sequence masking — zero the loss on negative-advantage sequences whose divergence from π_old exceeds a threshold; positive-advantage samples are kept regardless.
    • Keep Routing — freeze the MoE expert-routing path used at sampling time; don’t let training recompute a diverged routing.
    • Keep Sampling Mask — reapply the same top-p/top-k truncation mask from sampling during the training update, so importance-sampling validity holds; empirically “preserves language consistency during RL training” (fixes RL-induced mixed-language garbage, a textbook entropy-collapse symptom).
  4. Thinking-in-tool-use agentic RL environments — 1,827 environments, 85k+ prompts across code/search/general/interpreter agents. Search-agent verification keeps only samples where the ground truth is checkable AND every wrong candidate is provably wrong — the same hard-negative discipline as this project’s own flag-verifier, independently arrived at.

    Designed to fix common failures: weak long-horizon coherence during exploitation, and brittleness after an ungrounded first guess. The context-management fix (“retain reasoning across tool turns, drop only on a genuinely new user message”) directly targets long-horizon coherence during exploitation; the hard-negative-verified reward directly targets guess-brittleness by refusing to reward a correct-looking answer unless every alternative is provably wrong too.

V3.2-Speciale: same base, reduced length penalty (let it think longer) + DeepSeekMath-V2 reward folded in — gold-medal IMO/IOI/ICPC/CMO 2025.

Headline gain: V3.2 “performs comparably to GPT-5” on reasoning at substantially lower cost, explicitly framed as narrowing the open-vs-closed gap on agentic long-tail tasks. Tags: [L] strong (DSA makes long-context RL tractable; context-retention rule is a direct multi-turn continuity fix) · [E] the strongest, most technically concrete axis in this whole file — four named, ablatable stabilizers, zero architecture changes required · [R] strong · [N] claimed (closing the gap on “long-tail/novel environments”) but self-rated, and structurally the specialist→distill→RL pipeline resembles SFT+RL, which this project’s own thesis (“GRPO amplifies, SFT replaces,” arXiv:2507.10616) would predict caps its novelty — DeepSeek doesn’t isolate this in an ablation, so contested/unresolved by their own disclosure.


Qwen (Alibaba) — Qwen3.7-Max is the single most directly relevant release in this entire file

Baseline (Qwen3, pre-window, arXiv:2505.09388): Long-CoT SFT cold-start → Reasoning RL (GRPO/RLVR) → thinking-mode fusion SFT → General RL + strong-to-weak distillation. Every later release patches this.

  • GSPO [D] (arXiv:2507.18071) — the load-bearing algorithm swap from 2025-07 onward. Problem: GRPO’s per-token importance ratio gets corrupted on a MoE model when routing jitters between rollout and update, forcing an expensive “Routing Replay” workaround. Fix: define the ratio at the sequence level.

    # GRPO: per-token ratio, needs Routing Replay to stay valid on MoE
    ratio_t = pi_theta(y_t|x,y_<t) / pi_old(y_t|x,y_<t)
    
    # GSPO: one length-normalized ratio per whole rollout -> removes Routing Replay entirely
    s_i = (pi_theta(y_i|x) / pi_old(y_i|x)) ** (1/len(y_i))
    A_i = (r_i - mean(group_rewards)) / std(group_rewards)
    loss += -min(s_i * A_i, clip(s_i, 1-eps, 1+eps) * A_i)
    

    Removes infra complexity (no per-token log-prob pinning) rather than adding it — cheap to try if a MoE base is ever adopted.

  • Qwen3-Coder [D]: “hard-to-solve, easy-to-verify” code RL (execution-driven, automatically-scaled test cases) as a separate stage from “long-horizon Agent RL” (multi-turn plan→act→observe→replan over 20,000 parallel real dev environments) — SOTA SWE-bench Verified without test-time scaling, i.e. the gain is in the policy.

  • Qwen3.5 [D]: pivot point — “the post-training performance gains in Qwen3.5 primarily stem from our extensive scaling of virtually all RL tasks and environments… we focused heavily on increasing the difficulty and generalizability of RL environments, rather than optimizing for specific metrics.” Origin of the decoupled Task/Harness/Verifier idea that gets its full writeup next.

  • Qwen3.7-Max [D] — read this one closely:

    “agent RL training conventionally couples the task, the harness, and the verifier — train on one fixed triple and the policy learns harness-specific shortcuts instead of a generalizable strategy.”

    This is a first-party, named statement of exactly this project’s own scaffold-overfitting finding. Fix: decoupled Task/Harness/Verifier rollout infra — the same task replayed against different harnesses (types and versions) and different verifiers, forcing cross-harness generalization.

    for task in tasks:
        for harness in sample_harnesses(task):     # e.g. Claude Code, OpenClaw, Qwen Code, Hermes
            for verifier in sample_verifiers(task):
                rollout = run(policy, task, harness)
                update(policy, rollout, verifier(rollout))
    

    Designed to fix a common failure: agents defaulting to raw/ad-hoc tools instead of the intended tool surface, directly and by name — validated by consistent performance across QwenClawBench/CoWorkBench regardless of eval-time harness, contrasted against Qwen3.6-Plus which “showed significant variance.” Also ships a reward-hacking self-detection framework — the policy itself flags candidate reward-hacking patterns in its own trajectories, a governance mechanism directly relevant to a “never regex-match, always verify” reward-design rule.

Headline gain: Qwen3.7-Max — 35-hour fully-autonomous kernel-optimization run on a previously-unseen accelerator, zero prior exposure, 432 iterations/1,158 tool calls, ~10x speedup, entirely self-directed (self-reported, not yet independently benchmarked). Tags: [E]+[L]+[N] for Qwen3.5/3.7-Max — the release most directly targeted at this project’s exact problem shape (harness generalization, long-horizon coherence, novel governance mechanism) · [R] GSPO/reasoning-RL lineage throughout.


Moonshot AI (Kimi) — strongest disclosed [N] case in the file (Agent Swarm is a qualitatively different solution shape)

K2 [D] (arXiv:2507.20534) — SFT data is itself rejection-sampled: synthetic agentic trajectories (3,000+ real MCP tools + 20,000+ synthesized) scored by an LLM judge against per-task rubrics, only passing trajectories enter SFT — “large-scale rejection sampling… through our quality filtering process,” disclosed in those words. RL = REINFORCE-with-baseline (GRPO-adjacent, group-mean baseline, no value model) + self-critique rubric reward re-grounded continuously by on-policy RLVR rollouts (a template for a safe non-verifiable auxiliary reward that doesn’t drift from the ground-truth signal). Three named engineering fixes: budget control (hard token cap, fights length inflation), PTX loss (replay high-quality SFT data during RL, fights catastrophic forgetting), temperature decay (high early, annealed later — an explicit, named [E] exploration-preservation mechanism). Partial rollout — long-tail unfinished episodes pause/resume across RL iterations rather than blocking the batch — the single most directly transferable engineering idea for ~100-turn terminal-reward episodes.

K2.5 [D] (arXiv:2602.02276) — Zero-Vision SFT: text-only SFT alone activates visual agentic tool-use; hand-annotated visual CoT data hurts generalization (don’t spend annotation budget on the modality you’re activating; spend it where you already have depth). PARL / Agent Swarm — a trainable orchestrator + frozen sub-agents (instantiated from an earlier checkpoint); only the orchestrator gets gradient updates, explicitly to sidestep credit-assignment ambiguity across sub-agent calls.

reward = λ1·r_parallel (fights orchestrator collapsing back to single-agent)
       + λ2·r_finish   (fights spawning many sub-agents without real decomposition)
       + r_perf         (task-level outcome)
# λ1, λ2 annealed to zero -> final policy optimizes pure task success

Designed to fix common failures: react-and-guess with no systematic methodology, and uneven phase coverage. Sequential agentic execution has linear latency scaling, and agents commonly pivot away after a single failed attempt rather than systematically enumerating alternatives. PARL’s whole premise is training a policy to decompose wide-search/enumeration tasks into parallel sub-agent calls rather than one brittle serial chain — a direct, working answer to “how do you reward decomposition without the model gaming step-count,” and structurally analogous to training an agent to enumerate broadly instead of guessing once and pivoting.

Toggle (token-efficient RL) alternates budget-limited and unconstrained phases, gated on accuracy already exceeding a threshold — fixes K2’s earlier length-overfitting failure mode (a rigid budget doesn’t generalize back up when a harder problem needs more room).

Headline gain: K2.5 Agent Swarm — 4.5x latency reduction with a simultaneous F1 gain (72.8%→79.0% WideSearch); K2 Thinking sustains 200-300 coherent tool calls vs. “prior models degrade after 30-50 steps” (a direct, quantified [L] claim). Tags: [L] yes throughout (partial rollout, PARL, 200-300-step coherence) · [E] temperature decay is named and explicit; PARL’s anti-serial-collapse term is the same shape of problem as entropy collapse solved with a shaping reward instead of an entropy bonus · [R] present, secondary — K2 itself is a non-thinking model · [N] the strongest in this file: Agent Swarm is not “faster at the same thing,” it’s a qualitatively different solution shape (parallel decomposition vs. any single sequential agent, however long-horizon).


GLM / Z.ai — the difficulty-curriculum + iterative self-distillation loop is a validated version of this project’s own plan

GLM-4.5 [D] (arXiv:2508.06471) — Stage 1: three domain specialists (Reasoning/Agent/General), each cold-start SFT’d separately (a domain-general model from scratch wastes RL exploration budget re-discovering what expert-labeled distillation data already gives free). Stage 2: self-distill into one generalist, with rejection sampling on the distillation data itself (strip malformed samples, verify correctness for objective answers, RM-filter subjective ones, verify tool-call trajectories reach a terminal state).

  • Reasoning RL: GRPO, no KL term, three ablation-justified fixes:
    • Two-stage difficulty curriculum — switch to problems that are pass@8=0 but pass@512>0 (hard-but-not-impossible); a static difficulty set goes stale as the policy improves, collapsing reward variance to all-0 or all-1 either way (zero gradient signal). This is the exact wall a large challenge portfolio with a low-to-moderate overall solve rate is almost certainly sitting on for its hard tail.
    • Single-stage RL at the full 64K target length — staged length scaling (8K→16K→…→64K) caused an irreversible unlearning of long-output generation that never recovered even when length was scaled back up. Direct lesson: don’t RL-train shorter than your SFT init’s horizon if the target task is long.
    • Dynamic sampling temperature — raise temperature when rollout reward plateaus (their named signal for entropy collapse), gated by a max-1%-perf-drop bound on held-out validation.
  • Iterative self-distillation (Agentic RL): RL to a plateau → distill the RL-improved policy’s own outputs into a fresh SFT checkpoint (replacing the original cold-start data) → resume RL on the stronger base with a harder curriculum → repeat.

    This is the closest external validation of this project’s stated plan (“rejection-sampling SFT → GRPO/RLVR”) in the whole file — except Zhipu alternates SFT↔RL repeatedly rather than doing it once and switching permanently. Worth treating the handoff as a loop gated on reward plateauing, not a fixed step count.

GLM-5 [D] (arXiv:2602.15763) — the recipe shape changed: a sequential RL pipeline (Reasoning RL → Agentic RL → General RL) with On-Policy Cross-Stage Distillation blended throughout, replacing 4.5’s expert-then-unify structure, specifically to prevent catastrophic forgetting between stages. New async RL infra + double-sided importance sampling with hard-masking — tokens whose importance ratio falls outside [1-ε_l, 1+ε_h] are zeroed, not soft-clipped — explicitly motivated by policy drift compounding across long agentic trajectories before the (often sole) terminal reward arrives.

Designed to fix a common failure: weak long-horizon coherence and uneven phase coverage. Zhipu explicitly names Vending-Bench 2 and CC-Bench-V2 (“long-term coherence in agents”) as the benchmarks this release targets — a lab measuring the [L] axis directly, not incidentally.

Headline gain: GLM-5 ~20% average improvement over GLM-4.7 across 8 benchmarks; SWE-bench Verified 73.8→77.8; first open-weights model to hit 50 on Artificial Analysis Intelligence Index v4.0. Tags: [E] strong — dynamic temperature + difficulty curriculum are both explicit, named entropy-collapse countermeasures · [L] strong in GLM-5 (double-sided IS + hard masking is a credit-assignment fix aimed squarely at long trajectories) · [R] the most-developed program in GLM-4.5’s report · [N] weak-to-moderate — mostly amplification via expert-iteration/distillation, not boundary expansion.


Xiaomi (MiMo) — MOPD is a genuinely new algorithm, not a GRPO variant with a new name

MiMo-V2-Flash [D] (arXiv:2601.02780) — 3-stage post-training, and stage 3 is the interesting one. Problem named directly: “the see-saw effect” — naive multi-skill post-training improves one capability at the cost of another. Fix: Multi-Teacher On-Policy Distillation (MOPD).

  1. Stage 1 — SFT to “activate latent capabilities acquired during pretraining” (not teach new ones). Notable operational detail: num-zeros (count of MoE params with zero gradient) is their leading indicator of SFT instability — rising = expert-load-balance collapse, falling = overfitting.
  2. Stage 2 — train a suite of narrow domain-specialist teachers via independent RL (agentic: search/coding/tool-use; non-agentic: math/reasoning/safety).
  3. Stage 3 — MOPD: the student rolls out on its own policy distribution (not an offline distillation set, not weight merging) and receives dense, token-level reward = KL-divergence against each teacher’s logits, plus a verifiable outcome reward.
    reward_t = -KL(student_logits_t || teacher_logits_t) + verifiable_outcome_reward
    # student samples on-policy; teachers never generate the training data directly
    
    Result: the student mostly matches/beats the best individual teacher without the see-saw across the full skill set simultaneously (one model, not N specialist checkpoints) — not a free lunch (a couple of regressions), but net positive.
  • Agentic RL scaffold [D]: deliberately minimal — 3 atomic tools (bash, str_replace, finish), no prescribed workflow in the system prompt, “allowing the model to discover best practices during training” — an independently-arrived-at instance of this project’s own “light framing beats heavy scaffolding” rule.

    Designed to fix a common failure: uneven PTES-phase coverage bleeding across specialties. MOPD is a documented mechanism for fusing narrow specialists (e.g. an enumeration-specialist and an exploitation-specialist RL checkpoint) into one policy without one specialist’s regressions bleeding into the other — a direct, algorithmic answer to uneven capability across PTES phases.

MiMo-V2.5-Pro [D, undisclosed quantitatively] — same MOPD pipeline scaled to 1T params/1M context; qualitative claim of “thousand-tool-call” coherence (worked example: 672 tool calls / 4.3 hrs building a compiler, self-correction after a mid-run regression at turn 512).

Headline gain: matches Kimi-K2-Thinking / DeepSeek-V3.2-Thinking on most reasoning benchmarks at 1/2-1/3 the params; 73.4% SWE-Bench Verified. Tags: [L] explicit design target (“sustains complex trajectories”) · [E] explicit — minimal scaffold + on-policy (not offline) sampling are both named exploration-preserving choices · [R] the non-agentic teacher/reasoning stage · [N] the strongest algorithmic novelty in the file after Kimi’s Agent Swarm — MOPD’s token-level on-policy KL-distillation is a genuinely different move from rejection-sampling SFT, GRPO, or plain distillation, even though the agentic RL environments themselves (unit tests, visual verifiers) are recombinations of known reward-design patterns, not new task surfaces.


The transferable lessons (updated for ten labs)

  1. The method set is small and shared, and it has calcified further, not diversified. SFT · rejection-sampling · DPO-family · GRPO/GSPO/PPO-family · RLVR · RLAIF are the entire vocabulary across ten labs and ~40 releases. Every “new algorithm” this year (clip-higher, GSPO, PARL, MOPD, the four DeepSeek stabilizers) is a variation on group-relative policy optimization, not a new paradigm.
  2. Ordering and SFT-dosage are the live design choice. Llama 4 → thin-SFT/heavy-RL/thin-DPO; Magistral Medium → zero SFT; Zhipu → cold-start-just-enough-for-signal, then iterate SFT↔RL repeatedly rather than once. The Llama-4-era finding (“heavy SFT/DPO restricts RL exploration”) is now independently re-derived by three more labs.
  3. The frontier is agentic-RL-environment design, not new losses. Qwen3.7-Max’s decoupled Task/Harness/Verifier infra, Kimi’s PARL, DeepSeek’s 1,827-environment agentic-task synthesis, Xiaomi’s minimal-scaffold discipline, GLM’s iterative self-distillation loop — none of these are algorithm papers, all of them are environment/data/scaffold engineering. See Agentic RL.
  4. Exploration/entropy-collapse resistance is where disclosure is thinnest and most valuable when it exists. OpenAI, Google, and xAI disclose essentially nothing on this axis despite running RLVR at a scale where it’s a known risk. Where labs do disclose a mechanism (Mistral’s clip-higher, DeepSeek’s four stabilizers, GLM’s dynamic temperature + difficulty curriculum, Kimi’s temperature decay, Xiaomi’s minimal-scaffold + on-policy sampling), it’s the single most directly reusable material in this file for a project whose stated risk is exactly entropy collapse.
  5. Ground-truth-verified reward is now cross-lab-confirmed discipline, not an idiosyncratic project choice — DeepSeek’s hard-negative search-agent filter, Qwen3-Coder’s “hard-to-solve, easy-to-verify” framing, GLM’s format-gate-before-outcome-reward, Mistral’s rejected partial-credit code reward, Xiaomi’s rule-based-only embodied reward. Where a lab relaxes this (Grok 4.1’s agentic-LLM-judge RLAIF), the lab’s own safety card shows a measurable honesty/sycophancy regression — treat as a documented cautionary tale, not a competing recipe.

Summary table

LabFlagship (recipe source)SFTRL algorithmL / E / R / N
Llama (historical)Llama 4 MaverickThin, LLM-judge-filteredHeavy online RL → thin DPOR
AnthropicClaude Opus 4.5RLHF/RLAIF (undisclosed detail) + SDFInoculation-prompted RL (algorithm undisclosed)L, N
OpenAIGPT-5.1-Codex-MaxUndisclosed (safe-completions is the one named technique)RLVR-shaped agentic RL + compaction training (algorithm undisclosed)L, R
GoogleGemini 3 ProCAI-inspired adversarial SFTRLF (DRM + Critic) + verifiable-reward/agentic RL trackL, R
xAIGrok 4.1 FastMinorLong-horizon multi-turn RL, RLVR-domain-expandedL, R
MistralMagistral MediumNoneGRPO, no-KL, clip-higher, 4-part rewardR, E, N
DeepSeekDeepSeek-V3.2Specialist distillationGRPO, merged reasoning+agent+alignment, 4 stabilizersL, E, R
QwenQwen3.7-MaxLong-CoT cold-start (base recipe)GSPO-lineage + decoupled Task/Harness/Verifier RLL, E, N
Kimi (Moonshot)Kimi K2.5Rejection-sampled agentic trajectories; Zero-Vision SFTREINFORCE/GRPO-adjacent + PARL (Agent Swarm)L, E, N
GLM (Zhipu)GLM-5Expert-then-unify (4.5) → cross-stage on-policy distillation (5)GRPO, difficulty curriculum, dynamic temperature, double-sided ISL, E, R
Xiaomi (MiMo)MiMo-V2.5-ProActivate-latent-capability SFTMOPD (multi-teacher on-policy KL distillation)L, E, N, R

Provenance caveat, restated and strengthened: disclosure quality varies by an order of magnitude across this table. DeepSeek, Qwen, Mistral, Kimi, GLM, and Xiaomi publish arXiv tech reports with ablation tables — treat their mechanism claims as [D] high confidence. Anthropic, OpenAI, Google (post-2.5), and xAI disclose mechanism only in system-card prose or blog posts, often one paragraph per model, with capability-RL algorithm/hyperparameters/reward-model architecture never named — treat their “recipe” as mostly inferred continuity except where a technique is explicitly flagged [D] above (safe-completions, compaction, RLF’s DRM+Critic split, inoculation prompting, long-horizon multi-turn RL). Every arXiv id in this file was live-verified against arxiv.org/abs/<id> during the research pass that produced the per-lab notes this chapter is built from — none were fabricated or carried over from training-data memory. Lab recipes change fast; re-verify before betting a training run on a specific ordering or hyperparameter.

Proven post-training datasets — a usage-cited registry

Every other chapter in this book asks “which method” (The family map) or “which sequence of stages” (The recipe is a sequence, not a pick). This chapter answers the question those chapters leave open once you’ve picked Sequence B (§2 of the recipe chapter): which concrete, downloadable dataset actually fills each rung, for the six GENERAL (non-cyber) capabilities every Sequence-B rung needs regardless of what cyber-specific data you build on top — chat template, tool/function-calling, instruction following, preference, reasoning, and willingness/refusal calibration. This is a registry, not an essay: the tables are the payload.

1. The inclusion rule (read this before trusting any row)

This project’s permanent stance is never rely on academic cybersecurity-LLM projects — grounding comes from real frontier/open-weight recipes, not single-paper academic artifacts (frontier-cyber-model-path.md §1). This chapter applies the exact dataset-side analog of that stance:

A dataset gets a row ONLY if it is PROVEN-BY-USAGE — i.e. a named, real, released open-weight model or recipe (a tech report, an official model card, or a widely-used/well-cited community fine-tune) is documented as having actually trained on it. Every row below names that model/recipe and cites the source (model card, tech report, or lab blog post) that states the link directly — not inferred, not “this would probably be a good fit.”

Consequences enforced throughout:

  • No single-paper-only academic datasets. A dataset whose only appearance is its own authors’ academic ablation, with no third-party or even self-reported shipped model consuming it, is dropped. Each category file below has an explicit “Dropped” list — read it before re-proposing something that already failed the bar.
  • No cyber-specific datasets at all — this registry is scoped to GENERAL capabilities on purpose; cyber-specific data is out of scope here by design, not merely unfound.
  • Self-proof is weaker than cross-lab proof, and is flagged as such. A dataset proven only via its own authors’ reference model (e.g. Magpie-Reasoning-150K → the Magpie team’s own checkpoints) is marked Medium confidence even though the usage is real; a dataset reused by an independent lab or absorbed into a bigger shipped mixture (e.g. COIG-CQIA → folded into BAAI’s Infinity-Instruct recipe) earns High.
  • License ≠ proof-of-usage. Several rows below carry a real, verified training usage but a murky or non-commercial license (ShareGPT, ToolACE, COIG-CQIA, toxic-dpo-v0.2). The PROVEN_IN column tells you it was used; the License column tells you separately whether you can reuse it — don’t conflate them.

Every table row format is: dataset · link · capability · Sequence-B stage · size · license · PROVEN_IN (model/recipe) + citation · language(s) · notes · confidence. Source notes for all six categories, including live-verification method and the full per-dataset detail, are the six research files under artifacts/overnight-datasets/research/ (instruction-chat, tool-calling-agentic, preference-alignment, reasoning-cot, willingness-uncensor-safety, chinese-labs-multilingual) — this chapter distills them; consult those files for the complete citation quotes.


2. Instruction / chat SFT

The CPT→SFT rung: general instruction-following and multi-turn chat behavior — the base every other capability in this chapter sits on top of.

DatasetLinkSeq-B stageSizeLicenseProven in (+ cite)Confidence
Tulu 3 SFT MixtureHFSFT939KODC-BY-1.0 (mixed per-subset)Tülu 3 + OLMo 2 (7B/13B/32B) — arXiv:2411.15124, AI2 blog, OLMo 2 blogHigh
OpenHermes 2.5HFSFT~1Mmixed per-sourceOpenHermes-2.5-Mistral-7B, Nous Hermes 2 series — dataset card states directlyHigh
UltraChat-200kHFSFT (stage 1 of SFT→DPO)231KMITZephyr-7B-α/βarXiv:2310.16944, alignment-handbook recipeHigh
OpenOrca / SlimOrcaOpenOrca · SlimOrcaSFT500K–4.2MMITMistral-7B-OpenOrca, OpenOrca-Platypus2-13B, Mistral-7B-SlimOrcamodel cardHigh
ShareGPT (unofficial mirrors)e.g. anon8231489123/ShareGPT_Vicuna_unfilteredSFT~70K+unclear/gray (scraped, no official grant)Vicuna-13B (LMSYS) — LMSYS blogHigh (usage) / Low (license)
Dolphin (cognitivecomputations/dolphin)HFSFTmulti-millionApache-2.0dolphin-2.x series (2.5-mixtral-8x7b, 2.9-llama3-8b, 2.9.3-Yi-1.5-34B, …) — model cards list it directlyHigh
Infinity-InstructHFCPT-adjacent → SFT3M/7M (foundational) + chatApache-2.0 (gated)BAAI InfInstruct-* family (Mistral-7B, Llama3-70B/8B, Yi-1.5-9B) — model cards state directly; arXiv:2506.11116Medium
Magpie → Smol-Magpie-UltraMagpie-Align org · SmolTalk cardSFTraw 10M+ / Smol-Magpie-Ultra 400K curatedCC-BY-NC-4.0 (raw) / Apache-2.0 (Smol variant)SmolLM2-Instruct familyarXiv:2502.02737; technique also self-proven via Llama-3-8B-Magpie-Align (arXiv:2406.08464, ICLR 2025)High (technique) / Medium (raw license)
LMSYS-Chat-1M (GPT-4 subset, as ingredient)HF (gated)SFT (ingredient)1M total, subset usedcustom gated licenseOpenHermes 2.5 → Nous Hermes 2 — dataset card lists “ChatBot Arena (GPT-4 Only)” as a constituent sourceMedium
WizardLM / Evol-InstructHFSFT196K (public V2)unclear (GPT-ToS-derived)WizardLM family (7B–70B) — arXiv:2304.12244; ancestor of WizardCoder, absorbed into Tulu-3-style compilationsHigh
No RobotsHFSFT10KCC-BY-NC-4.0Tülu 3 / OLMo 2 (named constituent); independently: monsterapi/zephyr_7b_norobotsHigh

Dropped: raw LMSYS-Chat-1M as a standalone primary SFT set (no lab found training directly+solely on the 1M dump for general chat SFT); raw Magpie-Align dumps as a standalone commercial-usable set (kept only the technique + the Apache-licensed Smol-Magpie-Ultra derivative).


3. Tool / function-calling & agentic trajectories

The SFT rung that teaches the model to use things — required regardless of cyber content, since the CTF agent’s core skill is calling tools correctly across multi-turn trajectories.

DatasetLinkSeq-B stageSizeLicenseProven in (+ cite)Confidence
Glaive-function-calling-v2HFSFT112,960 rowsApache-2.0IBM Granite-20B-FunctionCallingarXiv:2407.00121; also 256 HF models declare it as training dataHigh
Hermes-Function-Calling-v1 (NousResearch)HFSFTtens of thousandsApache-2.0Hermes-2-Pro-Llama-3-8B / -Mistral-7Bdataset card; its <tool_call> tag format is now vLLM’s default hermes tool-parser and Qwen’s own recommended formatHigh
Salesforce APIGen / xLAM-function-calling-60kHF (arXiv:2406.18518)SFT60,000CC-BY-4.0xLAM-1b-fc-r / xLAM-7b-fc-r (Salesforce) — ranked top-25 BFCL at release; NeurIPS 2024 D&BHigh
APIGen-MT → xLAM-2 seriesproject (arXiv:2504.03601)SFTspans 1B–70B model family; APIGen-MT-5k public sampleresearch license (verify per artifact)Salesforce xLAM-2-{1b..70b}-fc-r — model card states trained via this framework; SOTA on BFCL + τ-benchHigh
ToolACEHF (arXiv:2409.00920, ICLR 2025)SFT11,300 rowsApache-2.0ToolACE-8B + 51 total HF models trained/fine-tuned on it (Huawei)High
ToolBench (OpenBMB) → ToolLLaMAGitHub (arXiv:2307.16789, ICLR 2024 spotlight)SFT~127k instructions over 16,000+ real APIsApache-2.0ToolLLaMA-7b-v1; feeds Agent-FLAN downstreamMedium-High (self-proven + downstream reuse)
Agent-FLANHF (arXiv:2403.12881, ACL 2024 Findings)SFT219 MB (AgentInstruct+ToolBench+ShareGPT mix)Apache-2.0InternLM Agent-FLAN-7B — dataset card states “+3.5% across agent eval datasets” over prior bestHigh
Gorilla / APIBenchHF (arXiv:2305.15334)SFT1,600+ APIsApache-2.0Gorilla-7B family (UC Berkeley) — NeurIPS 2024 D&B trackHigh

Dropped: NexusRaven-V2 training data (only an eval set was released publicly); watt-tool-8B/70B (proprietary/undisclosed dataset, no citable artifact); a standalone Qwen tool-calling SFT row (Qwen never published one — its format adoption of Hermes-style tool use is credited to the Hermes row above instead).

Cross-cutting for Sequence-B: prioritize the multi-turn/agentic sets (ToolACE, APIGen-MT, Agent-FLAN, ToolBench) over single-call sets (xLAM-60k, APIBench, Glaive) — CTF tool use is inherently multi-step and stateful. Agent-FLAN’s explicit negative/anti-hallucination samples are the one artifact in this table that doubles as willingness/refusal-adjacent signal (see §7).


4. Preference (DPO / KTO / RLHF)

DatasetLinkSeq-B stageSizeLicenseProven in (+ cite)Pairwise/On-off-policyConfidence
UltraFeedback (binarized)HFpreference (DPO/RM)64K prompts → ~61K pairsMITZephyr-7B-βarXiv:2310.16944; also a Tulu 3 DPO-mixture component (arXiv:2411.15124)Pairwise, off-policyHigh
Anthropic HH-RLHFHFpreference (RM/RLHF)~170K comparisonsMITStableVicuna (Stability AI/CarperAI) — blogPairwise, off-policyHigh
Stanford SHP / SHP-2SHP · SHP-2preference (RM/RLHF)385K / 4.8MMITStableVicuna (combined 3-dataset RM recipe) — same blog abovePairwise, off-policyMedium-High
NectarHFpreference (RM → RLAIF)~183K prompts × 7-way rankingApache-2.0 (research)Starling-RM-7B-alpha / Starling-LM-7B-alpha (Berkeley NEST) — blogK-wise→pairwise, off-policyHigh
HelpSteer2 (+v1)HFpreference (attribute-scored RM)~21K pairs (v2)CC-BY-4.0Llama-3.1-Nemotron-70B-Reward/-Instruct (NVIDIA), #1 RewardBench at release — arXiv:2406.08673Multi-attribute → pairwise, off-policyHigh
PKU-SafeRLHFHFpreference (safe-RLHF dual reward+cost)265K QA / 166.8K pref pairsApache-2.0 (framework) / non-commercial (data)Beaver-7B (PKU-Alignment) — GitHub, arXiv:2406.15513Pairwise (dual-label), off-policyHigh
Argilla DPO mixes (ultrafeedback-binarized-preferences-cleaned, distilabel-intel-orca-dpo-pairs)HFpreference (DPO)64K / 12.9KApache-2.0Notus-7B-v1, argilla/distilabeled-OpenHermes-2.5-Mistral-7B — model cardsPairwise, off-policyHigh
Skywork-Reward-Preference-80K (v0.2)HFpreference (RM)80K curated pairsper-source (verify)Skywork-Reward-Gemma-2-27B / -Llama-3.1-8B (v0.2) — #1 RewardBench; arXiv:2410.18451Pairwise, mixed on/off-policyHigh
KTO-mix-14kHFpreference (KTO)~15K rowsApache-2.0HF TRL’s KTOTrainer reference dataset; ~9 community checkpoints; Oumi’s KtoMix14kDataset recipeUnpaired, off-policyMedium (real usage, no flagship model pinned)

Dropped: no cyber-specific preference dataset was in scope; any preference set whose only usage was a single unrelated academic ablation was excluded before it reached the table.


5. Reasoning / CoT (math + code + science distillation)

DatasetLinkSeq-B stageSizeLicenseProven in (+ cite)Confidence
NuminaMath-CoTHFSFT860K pairsApache-2.0 (code)AI-MO/NuminaMath-7B-CoT/-TIR1st AIMO Progress Prize; also a stated source in Qwen2.5-Math (arXiv:2409.12122)High
Sky-T1_data_17kHFSFT17KApache-2.0NovaSky-AI/Sky-T1-32B-PreviewblogHigh
Bespoke-Stratos-17kHFSFT17KCC-BY-NC-4.0Bespoke-Stratos-32B/-7BblogHigh
OpenThoughts-114k / OpenThoughts2-1M / OpenThoughts3-1.2M114k · 2-1M · 3-1.2MSFT114K / 1M / 1.2MApache-2.0-styleOpenThinker-7B / -2-32B / -3-7BarXiv:2506.04178; OpenThinker3-7B is SOTA-open-data at release (53% AIME25, 51% LCB, 54% GPQA-D)High
OpenR1-Math-220kHFSFT (+DPO-usable)220K curatedApache-2.0open-r1/OpenR1-Qwen-7BOpen-R1 update #2High
Mixture-of-ThoughtsHFSFT350K verified tracesApache-2.0open-r1/OpenR1-Distill-7B — replicates R1-Distill-Qwen-7B; mixture ratio follows Phi-4-reasoning methodologyHigh
OpenMathInstruct-2HFSFT14M pairsCC-BY-4.0-styleOpenMath2-Llama3.1-8B/70B (NVIDIA) — ICLR 2025, arXiv:2410.01560High
OpenMathReasoningHFSFT (+RL-prompts via problem-only split)3.2M CoT + 1.7M TIR + 566K GenSelectCC-BY-4.0-styleOpenMath-Nemotron-1.5B..32B — literal data behind NVIDIA’s AIMO-2-winning submission, arXiv:2504.16891High
OpenCodeReasoning (+1.1)HFSFT736K–1.165MCC-BY-4.0-styleOpenCodeReasoning-Nemotron-7B/14B/32B/-1.1 — model cards state directly; arXiv:2504.01943; SFT-only beats RL alternatives on LiveCodeBench (61.8%)High
Magpie-Reasoning-150K (V1)HFSFT150KLlama-3/Qwen2 community licenseLlama-3-8B-Magpie-Align-SFT-v0.2 (Magpie’s own reference checkpoints) — arXiv:2406.08464, ICLR 2025Medium (self-proven only)

Dropped: the raw DeepSeek-R1 “800k samples” SFT set was never released as a standalone artifact (only checkpoints were open-sourced) — the community reconstructions above are what’s actually usable and are what’s listed instead; AM-DeepSeek-R1-Distilled-1.4M (no verified third-party adoption beyond its own paper); any cyber-specific reasoning/CTF-reasoning dataset (out of scope by permanent stance).

Read order if you’re pulling data, not just reading the table: NuminaMath-CoT (substrate) → OpenThoughts3-1.2M (best current fully-open ablated set) → OpenMathReasoning (if you need competition-tier math) → OpenCodeReasoning (closest analog to CTF/exploit-reasoning) → Mixture-of-Thoughts/OpenR1-Math-220k (if reproducibility of the training recipe matters more than raw SOTA) → Bespoke-Stratos/Sky-T1 (cheapest pilot).


6. Willingness / uncensor vs. safety / refusal calibration

This category is both directions of refusal/compliance behavior — deliberately, because the target model is a sandboxed offensive-security research agent and over-refusal is a real, documented failure mode (see §8).

6a. Compliance-increasing (uncensor / de-refusal)

DatasetLinkSeq-B stageSizeLicenseProven in (+ cite)Confidence
Dolphin dataset family (incl. not_samantha_norefusals.jsonl)HFSFT~4.5M base + multi-M Dolphin-2.9 mixApache-2.0Dolphin model series (2.9.1-llama-3-8b, 2.9.2-Phi-3-Medium, 2.5-mixtral-8x7b, …) — Hartford’s post, axolotl configs list the file directlyHigh
unalignment/toxic-dpo-v0.2HFpreference (DPO)541 pairsnot permissively licensed; sensitive-content flaggedComponent of mlabonne/orpo-dpo-mix-40k, used to DPO-“heal” NeuralDaredevil-8B-abliterated post weight-orthogonalization — dataset card, Labonne’s abliteration postHigh
ehartford/wizard_vicuna_70k_unfilteredHFSFT34,598 conversationsunclear (ShareGPT-derived)Wizard-Vicuna-13B-Uncensored family (7B/13B/33B/65B) — model card states the alignment-stripping directly; 128 HF models trained on itHigh

6b. Safety-increasing (harmlessness / appropriate refusal / anti-jailbreak / anti-over-refusal)

DatasetLinkSeq-B stageSizeLicenseProven in (+ cite)Confidence
Anthropic/hh-rlhfHFpreference / RL-prompts161K+ helpful + 42K+ harmless + red-team transcriptsresearch-useStableVicuna-13B RM training + the original Anthropic RLHF paper (Bai et al. 2022) — blogHigh
PKU-Alignment/PKU-SafeRLHFHFpreference (safe-RLHF reward+cost)83.4K entriesnon-commercialBeaver-7B-v1.0 — model card lists it directly, arXiv:2310.12773High
allenai/wildguardmixHFSFT (safety_noncompliance)50K prompts (Tulu-3 slice)Apache-2.0Tulu 3 — named safety_noncompliance bucket component; arXiv:2411.15124High
allenai/wildjailbreakHFSFT (safety_noncompliance) + RL-prompts262K total (50K sampled into Tulu 3)ODC-BY-1.0Tulu 3 — same bucket; explicitly designed to fix over-refusal via harmful-vs-benign-but-scary contrastive pairsHigh
allenai/coconotHFSFT (safety_noncompliance)10,983 promptsODC-BY-1.0Tulu 3 — same bucket; Brahman et al. 2024, “The Art of Saying No”High

Dropped: Nous Hermes 3’s compliance-steerability behavior is real but no single named public dataset is credited for it (proprietary blend); Do-Not-Answer/XSTest/OR-Bench are refusal-rate eval sets, not training sets, in any published recipe verified; Llama Guard’s training-data composition is not public.


7. Chinese-labs & multilingual

DatasetLinkCapabilitySeq-B stageSizeLicenseProven in (+ cite)Confidence
BAAI Infinity-InstructHFinstruction/chat SFTSFT~7.4M found. + 1.5M chatCC-BY-SA-4.0 (mixed subsets)Own tech report fine-tunes Mistral/LLaMA/Qwen/Yi; InfInstruct-LLaMA3.1-70B beats GPT-4-0314 by 8.6% on IF — arXiv:2506.11116High
COIG-CQIAHFChinese instruction SFT (LIMA-style)SFT~48K (45.8K filtered)CC-BY-NC-SAOwn paper fine-tunes Yi-6B/34B, Qwen2-7B/72B — arXiv:2403.18058; also folded into Infinity-Instruct (second, independent usage)High
Firefly (firefly-train-1.1M)HFChinese multi-task SFTSFT (+DPO via toolkit)~1.15M–1.65Munspecified (verify)firefly-mixtral-8x7b, firefly-baichuan2-13b, firefly-llama-30bGitHub, 6.6K★Medium-High
Magpie-Qwen2(.5)-Pro (+ -200K-Chinese)HFself-synthesized instruction/preference-pair SFTSFT1M (Qwen2-Pro) + per-model variantsresearch-useMethod paper matches Llama-3-8B-Instruct SFT-only — arXiv:2406.08464, ICLR 2025; ZH subset generated by Qwen2-72B-Instruct itselfHigh (method+EN) / Medium (ZH subset)
MAP-Neo Matrix Data PileHFbilingual EN/ZH pretrain corpusCPT (+SFT/alignment released alongside)4.5–4.69T tokensApache-2.0MAP-Neo-7B, pretrained from scratch, fully open — arXiv:2405.19327High
OpenCSG Chinese Corpus (Chinese-Cosmopedia etc.)HFZH synthetic textbook CPT + Smoltalk-style SFTCPT + SFT15M docs / ~60B tokens (Cosmopedia slice)Apache-2.0csg-wukong-1B (OpenCSG) — arXiv:2501.08197Medium
Congliu/Chinese-DeepSeek-R1-Distill-data-110kHFZH reasoning/CoT distillationSFT110Knot stated (research/community use)Distilled via DeepSeek-R1-671B API per R1’s own protocol; 91 downstream community models trained on itMedium-High
AgentInstruct (Zhipu/THUDM)HFagent/tool-use trajectoriesSFT1,866 verified trajectoriesApache-2.0-styleAgentLM-7B/13B/70BarXiv:2310.12823, ACL 2024 Findings; independently reused by InternLM’s Agent-FLANHigh
LongAlign-10k (Zhipu/THUDM)HFlong-context instruction alignmentSFT10,000 (8K–64K tokens)Apache-2.0-styleChatGLM3-6B-128k, LongAlign-6B/7B/13B-64karXiv:2401.18058, EMNLP 2024 FindingsHigh
COIG-PHFChinese preference (DPO)preference1,009K (paper) / ~101K (HF release)CC-BY-NC-4.0Own paper DPO-trains Qwen2.5-Instruct-7B-COIG-P, Infinity-Instruct-3M-*-COIG-ParXiv:2504.05535, EACL 2026 FindingsMedium
huozi_rlhf_dataGitHubChinese human-labeled preferencepreference16.9K pairsApache-2.0Huozi 2.0 (HIT-SCIR) — official RLHF stage of a named released modelMedium
Aya Dataset + Aya Collection (Cohere)Dataset · Collectionmassively multilingual instruction SFTSFT204K (Dataset, 65 langs) / 513M (Collection, 101 langs)Apache-2.0 (verify per-subset)Aya-101 → Aya 23 → Aya Expanse (Cohere/Cohere Labs) — arXiv:2402.06619High

Dropped: zhihu_rlhf_3k and dikw/hh_rlhf_cn (only scattered small/unlabeled community reward-model usage, no named shipped recipe); a standalone first-party Qwen/DeepSeek/GLM/Yi SFT-or-preference-data row (none of those labs release their actual training data — their footprint here is captured indirectly via AgentInstruct/LongAlign, and via community R1-distillation sets like Congliu’s 110k).


8. Which datasets at which Sequence-B rung

Mapped onto Sequence B’s actual stage order (frontier-recipe-is-a-sequence.md §2): base/instruct choice → (optional) CPT → SFT cold-start → rejection-sampling/on-policy SFT → preference (DPO/KTO) → RLVR/GRPO → iterate.

StageWhat it needsPull from
CPT / domain pretraining (optional)Bilingual/domain raw-text corpus, if extending beyond the base checkpoint’s native coverageMAP-Neo Matrix (§7, EN/ZH), OpenCSG Chinese-Cosmopedia (§7); Infinity-Instruct’s “foundational” phase blurs CPT/SFT (§2, §7)
SFT cold-start — general chat/instructionBroad instruction-following + multi-turn chat prior before anything domain-specificTulu 3 SFT Mixture, UltraChat-200k, OpenHermes 2.5, No Robots (§2)
SFT cold-start — tool/agenticMulti-turn tool-call format + agentic trajectory shapeHermes-Function-Calling-v1 (format anchor for vLLM’s hermes parser), ToolACE, APIGen-MT, Agent-FLAN, AgentInstruct (§3, §7)
SFT cold-start — reasoning priorLong-CoT math/code/science distillation before any RL stage touches itOpenThoughts3-1.2M (default pick), OpenMathReasoning (competition-tier), OpenCodeReasoning (code/CTF-adjacent) (§5)
SFT cold-start — willingness calibrationRefusal-boundary precision for a sandboxed offensive agent, not blanket compliance or blanket refusalCoCoNot + WildJailbreak + WildGuardMix (the Tulu 3 safety_noncompliance bucket) as the base; Dolphin/wizard_vicuna_70k_unfiltered only if you deliberately want the de-refusal direction too (§6)
Preference (DPO/KTO)Chosen/rejected pairs (or unpaired KTO-shaped labels) once an SFT checkpoint exists to regenerate on-policyUltraFeedback, Skywork-Reward-Preference-80K, HelpSteer2 as off-policy starting mixes; KTO-mix-14k as the format template if your own trajectories are naturally unpaired good/bad, not clean pairs (§4)
RL-prompts (RLVR/GRPO)Prompts + a verifier — deliberately NOT a fixed labeled dataset per method-to-data.mdWildJailbreak’s adversarial-prompt pool and OpenMathReasoning’s 193k problem-only split are the closest “prompt source, no answer” shapes in this registry; your own challenge set + flag-check verifier remains the actual RLVR data object for the cyber-specific rung (out of scope here)

9. Two honest caveats

Willingness vs. over-refusal, for a sandboxed offensive-security agent. Over-refusal — declining a legitimate pentest/CTF request because it pattern-matches “harmful” — is a real, well-documented failure mode, which is exactly what CoCoNot and WildJailbreak were purpose-built to fix (contrastive harmful-vs-benign-but-scary-looking prompts, §6b). That is the correct tool for this project’s actual problem: precision on the refusal boundary inside a controlled, sandboxed tool-use context — not blanket compliance. The de-refusal-direction datasets in §6a (Dolphin, toxic-dpo-v0.2, wizard_vicuna_70k_unfiltered) are included because they are genuinely proven-by-usage and instructive as the opposite pole of the same axis, but they are a blunter instrument (strip refusal-flavored completions wholesale) than CoCoNot’s calibrated “refuse the actually-unsafe subset, comply with the rest.” Default recommendation: build the willingness rung primarily from the Tulu-3 safety_noncompliance bucket (WildGuardMix + WildJailbreak + CoCoNot together, exactly as Tulu 3 ships it), and treat §6a as a reference recipe pattern rather than a default ingredient.

The off-policy caveat for distilled reasoning data. Nearly every dataset in §5 is CoT distilled from a stronger teacher (DeepSeek-R1, QwQ-32B, Llama-3.1/3.3-70B-Instruct) — the policy model you’d actually train on Sequence B never generated these traces itself. This is the correct, cheap way to bootstrap a reasoning prior before any on-policy stage (exactly what Sky-T1/Bespoke-Stratos/OpenThoughts/OpenR1 all do), but pure SFT-on-distillation caps quality at the teacher’s and plateaus — it does not substitute for an on-policy RL stage afterward. This mirrors the same on/off-policy axis this book treats as the single most load-bearing distinction in post-training generally (foundations/on-off-policy.md) and the same caveat the preference registry (§4) makes explicitly about off-policy DPO mixes: budget an on-policy regeneration-and-rescoring pass against your own SFT checkpoint before treating either the reasoning prior or the preference stage as final, mirroring what Tulu 3 and NVIDIA’s HelpSteer2-Preference both do in practice.


  • The recipe is a sequence, not a pick — the Sequence-A/Sequence-B stage skeleton this registry’s §8 mapping is built against.
  • The path to a frontier cybersecurity model — the north star this registry serves; the “proven-by-usage, not academic-only” stance is the dataset-side mirror of that chapter’s model/recipe-side stance.
  • Method → Data (your real bottleneck) — the method-first framing that explains why RLVR/GRPO in §8 deliberately has no fixed dataset row, and why rejection-sampling FT’s data object is a byproduct you already produce.
  • Full per-dataset detail, live-verification method, and additional dropped candidates: artifacts/overnight-datasets/research/{instruction-chat,tool-calling-agentic,preference-alignment, reasoning-cot,willingness-uncensor-safety,chinese-labs-multilingual}.md.

Cybersecurity is one of a family — what cracked the others

Every other chapter in this book treats the CTF task as your problem: your harness, your challenge set, your flag verifier. This chapter argues the opposite framing is more useful: cyber CTF-solving is one instance of a general problem family — {LONG-HORIZON (up to ~100 turns), EXPLORATORY (search/enumeration over a huge space), SPARSE-TERMINAL-REWARD (only the flag is verified, nothing in between), VERIFIABLE (an ungameable checker)} — and at least six other domains share that exact structural signature. Frontier labs and general RL research have been cracking members of this family for a decade. The move this chapter makes is: hold up each domain, find the stage (pretraining / SFT / RL) and the specific technique that actually fixed its long-horizon/sparse-reward problem, and rank what transfers.

Stance, honored throughout: academic cybersecurity-LLM projects (CTF-Dojo, Cyber-Zero, Pentest-R1, HackSynth, AutoPenBench, DRLRM-PT, and siblings) are mention-only, labelled “academic, not a basis” below — no conclusion here rests on them. General coding, competitive programming, theorem proving, deep-research/web agents, games, and robotics are not academic-security work — they are exactly the frontier-lab and general-RL-theory evidence the project’s stance asks for. Everything below is cross-linked to The path to a frontier cybersecurity model, Diagnosing the gap, RL that creates value, and One problem, or many? — this chapter is the cross-domain evidence layer those four already draw on; it does not re-derive their verdicts.


1. The structural frame

Strip away the domain-specific vocabulary (a “vulnerable endpoint,” a “failing unit test,” a “Lean tactic,” a “hidden test case,” a “Montezuma key”) and every member of this family reduces to the same abstract shape:

flowchart TD
  subgraph ABSTRACT["Abstract class"]
    direction LR
    A1["Long-horizon:\nmany sequential\ndecisions"] --> A2["Exploratory:\nhuge search space,\nmost paths fail"]
    A2 --> A3["Sparse terminal\nreward: only the\nend state is scored"]
    A3 --> A4["Verifiable:\nan ungameable,\nmechanical checker"]
  end
  subgraph CYBER["Your CTF pipeline"]
    direction LR
    C1["Recon /\nenumeration\n(~turns 1-20)"] --> C2["Endpoint /\nvuln discovery\n(~turns 20-50)"]
    C2 --> C3["Exploit\nchain\n(~turns 50-90)"]
    C3 --> C4["Flag read +\nserver-side\nverify {0,1}"]
  end
  A1 -. maps to .-> C1
  A2 -. maps to .-> C2
  A3 -. maps to .-> C3
  A4 -. maps to .-> C4

The point of drawing the arrow this way: the flag verifier is not special — it is your domain’s instance of “the proof kernel,” “the unit-test suite,” “the hidden Codeforces test cases,” “the reference-answer F1 score,” “the win/loss signal.” Every domain below chose (or was forced into) a stage + technique to make progress against that shape. The question this chapter answers is which of those choices generalize.


2. THE ANALOGY TABLE

DomainHorizonReward sparsityExploration burdenVerifierStage + technique that cracked itTransfers to cyber
Long-horizon coding (SWE-bench repo agents)20–80+ tool-call turnsTerminal (tests pass)Which file/function among thousandsExecution (unit tests)SFT on executable-env trajectories (SWE-Gym arXiv:2412.21139, R2E-Gym arXiv:2504.07164) → RL with execution-verified reward (SWE-RL arXiv:2502.18449, o1→o3 arXiv:2502.06807); long-context multi-turn RL needs DAPO-style stabilizers + progressive context curriculum (arXiv:2508.03501)HIGH — closest structural twin. Mirrors a typical agentic CTF pipeline almost exactly.
Particular-language lift (weak PL / weak NL, execution-RL on code)Short (1 program) → multi-turn repair (RLEF)Terminal (tests)Program-space / repair-spaceExecution (compiler/unit tests)Pretraining/CPT does the knowledge lift (corpus coverage — DeepSeek-Coder arXiv:2401.14196, StarCoder2 arXiv:2402.19173); RL fixes execution only — CodeRL arXiv:2207.01780, StepCoder arXiv:2402.01391, RLEF arXiv:2410.02089 — never injects new knowledgeHIGH, but as a diagnostic contrast, not a lever — see §4 below.
Competitive programmingShort per-problem; GrandCode reframes as multi-stage agentic loopTerminal (hidden tests)Program space (millions of candidates)Execution (unit tests)Sampling breadth + cheap filter (AlphaCode, arXiv:2203.07814) then a purpose-built multi-stage GRPO variant for delayed reward + off-policy drift (GrandCode’s “Agentic GRPO,” arXiv:2604.02721)STRONG (conceptually) — validates a rejection-sampling-breadth strategy; GrandCode is the most load-bearing GRPO-variant precedent for this exact delayed-reward shape.
Theorem proving (Lean/Coq)Long, many tactic steps — decomposable into subgoalsPer-step, not just terminal — the kernel checks every stepTactic/proof search spaceDeterministic, per-step, ungameable (proof kernel)Subgoal decomposition for cold-start data + curriculum (DeepSeek-Prover-V2, arXiv:2504.21801); synthetic self-play data generation (AlphaGeometry, Nature 2024, DOI:10.1038/s41586-023-06747-5); then RL vs. binary kernel-verified reward (DeepSeek-Prover-V1.5)PARTIAL — cleanest verifier of any row. Licenses subgoal-decomposition-for-DATA; does not license densifying reward over unverifiable CTF steps (shell/HTTP output isn’t kernel-checkable).
Deep-research / web agents~10–40 turns (search/click/browse)Terminal (task complete)Which query/page/source on the live open webLearned RM (WebGPT, weak) → outcome/ORM (WebRL) → reference-match F1 (DeepResearcher)RL (outcome-only) trained in the real live environment; WebRL’s self-evolving curriculum generated from the model’s own failures (arXiv:2411.02337); R1-Searcher’s sequential (not summed) format-then-outcome staged reward (arXiv:2503.05592)STRONGEST transfer row. Failure-to-curriculum + safe staged tool-use bootstrap, both directly actionable.
Hard-exploration games (Montezuma / Pitfall / NetHack / StarCraft)Very long (1000s–10,000+ actions)Terminal, near-zero for prior baselinesCombinatorial state space; adversarial strategy spaceEnvironment score / win-lossArchive-based “explore, remember, return-then-explore-further” (Go-Explore, arXiv:1901.10995); diverse self-play league vs. naive self-play (AlphaStar, DOI:10.1038/s41586-019-1724-z); scale + dense shaping, no exotic algorithm (OpenAI Five, arXiv:1912.06680)STRONG (Go-Explore) / different axis (league) / honest caveat (NetHack still unsolved).
Robotics (sparse-reward manipulation)Short (tens of steps)Sparse binary terminalContinuous action/goal spaceEnvironment success checkData-relabeling: HER (arXiv:1707.01495) — relabel a failed trajectory’s achieved state as the goal it accidentally satisfiedSPECULATIVE at the mechanism level (off-policy-specific); the idea licenses mining your own flag=0 trajectories for sub-skill SFT data.
Cyber-CTF (academic literature — mention-only)~100 turns (a typical regime)Terminal (flag)Endpoint/vuln/exploit-chain spaceDeterministic flag verifierMonolithic outcome-only RL / rejection-sampling (CTF-Dojo, Cyber-Zero — academic, not a basis); two-stage offline→online curriculum (Pentest-R1 — academic, not a basis)— target row; convergence with the frontier rows above is a mild corroborating note only, never load-bearing.

3. Per-domain deep-dive

3.1 Long-horizon agentic coding — the closest twin

Problem it fixes: a model that free-runs an unconstrained shell wastes turns on malformed edits and noisy tool output; naive RL on a full 20–80-turn trajectory with only a terminal test-pass reward hits credit-misattribution (an early correct action gets penalized because a later, unrelated action failed).

What fixed it, by stage:

  • Scaffold (pre-RL): SWE-agent’s Agent-Computer Interface (arXiv:2405.15793) — a small fixed action set + concise per-step feedback lifted pass@1 from 3.8%→12.5% on the same underlying LM, before touching weights. Anthropic’s Claude 3.5/3.7 Sonnet scaffold philosophy is the opposite-looking but complementary lesson: deliberately minimal scaffolding (bash + string-replace edit tool), crediting the gain to post-training, not scaffold cleverness.
  • SFT: trajectory distillation on executable-environment corpora is the near-universal first stage — SWE-Gym (arXiv:2412.21139), R2E-Gym (arXiv:2504.07164). SWE-Master (very recent, arXiv:2602.03411, low-confidence) adds a concrete, cheap idea: mask environment-feedback tokens out of the SFT loss — train on the agent’s own actions/reasoning, not on memorizing verbose tool stdout.
  • RL: execution-derived reward beats a learned/similarity proxy when both are available — SWE-Gym’s ground-truth path over SWE-RL’s difflib patch-similarity fallback (arXiv:2502.18449). DeepSWE (RL-only, no SFT, from Qwen3-32B) shows DAPO-style stabilizers (Clip-High, no-KL, compact filtering of failed/timeout trajectories) let RL-only work when the base model already has strong agentic priors. Progressive context/turn-budget curriculum — start RL at a shorter horizon than the full ceiling, extend once performance plateaus — is independently confirmed by two groups (arXiv:2508.03501, and KLong, arXiv:2602.17547, low-confidence but converging).
  • Long-horizon credit assignment specifically: GiGPO (arXiv:2505.10978, NeurIPS 2025) adds a step-level grouping on top of GRPO — group actions taken from repeated “anchor states” across different rollouts, giving fine-grained credit without an extra critic. This is the most mature fix in a fast-moving 2026 cluster (BEACON arXiv:2605.06078, HiPER arXiv:2602.16165, Ecpo arXiv:2606.05885 — all low-confidence individually, but converging on “flat trajectory-only advantage is the open problem”).
  • Test-time (no training): parallel sampling + a verifier to pick the best candidate is a large, cheap, repeatedly-replicated multiplier (Claude “high compute” 63.7%→70.3%; R2E-Gym 34.4%→51%; DeepSWE 42.2%→59%) — orthogonal to whatever training was done.

What I’d change in your pipeline: (1) audit your tool surface against the SWE-agent lesson — concise, structured observations, a “you already tried this” signal, before assuming RL will fix noisy feedback; (2) mask tool/environment-output tokens from your SFT loss if you don’t already; (3) if moving to full-trajectory RLVR, do not expect vanilla GRPO with only a terminal flag-reward to assign credit well across ~100 turns — prototype GiGPO’s anchor-state grouping first; (4) check whether you do reject-and-rescore across pass@k, or only report pass@1/pass@5 independently — the hybrid-TTS multiplier is free money already inside your methodology.

3.2 Particular-language — the knowledge-injection contrast (read this one for the diagnosis framing)

The reason this domain is second, not last: it is the cleanest existing literature answering exactly the question the diagnosis framework poses — is a failure a knowledge gap or an execution gap?

For both a specific programming language and a specific natural language, the field’s converged answer is stage-specific:

  • Pretraining / continued-pretraining injects KNOWLEDGE — corpus composition (how many languages, how much of each) is the lever, not RL, not even SFT. StarCoder (arXiv:2305.06161), StarCoder2 (arXiv:2402.19173), DeepSeek-Coder (arXiv:2401.14196) for code; Sailor (arXiv:2404.03608), SEA-LION (arXiv:2504.05747), LLaMA Beyond English (arXiv:2401.01055) for natural language. Tokenizer/vocabulary coverage sits underneath this stage as an architectural precondition (arXiv:2406.11477) — poor coverage looks like “doesn’t know the language” even when data exists, because every token is spent on fragmented sub-word pieces.
  • SFT/instruction-tuning teaches USE, cheaply, once the base model already has passive knowledge — BLOOM+1’s finding (arXiv:2212.09535) is the sharpest data point: for an already-instruction-tuned model, simply including a new language in the multitask instruction-tuning mixture beat continued pretraining — the cheapest lever to try first, once a base exists.
  • RL (execution/compiler-verified) fixes BEHAVIOR, never knowledge — CodeRL (arXiv:2207.01780), PPOCoder (arXiv:2301.13816), RLTF (arXiv:2307.04349), StepCoder (arXiv:2402.01391), RLEF (arXiv:2410.02089, Meta FAIR, ICML 2025 spotlight). None of these teach new language knowledge — every one explicitly frames the problem as get-the-execution-loop-right on a domain the base model’s pretraining already covers. RLEF in particular is a near-literal preview of the structural frame: multi-turn POMDP, policy emits → executes against public tests → feedback appended → repair → repeat → reward on held-out private tests, solved with a turn-level (not token-level) value function.

The quote-worthy contrast: BLOOM+1’s “put it in the SFT mixture” (an SFT-stage move) vs. StepCoder/RLEF’s “RL never adds knowledge, only sharpens execution of knowledge already latent in the base model.” No amount of GRPO/RLVR on your harness will inject knowledge of a CVE or technique class the base model never saw much of in pretraining — see §4.

3.3 Theorem proving — the cleanest verifier, the strongest calibration check

Formal theorem proving (Lean/Coq) has the single cleanest sparse-reward substrate of any domain: the proof kernel checks every intermediate step, not just the final answer — cleaner even than a typical flag verifier. DeepSeek-Prover-V2 (arXiv:2504.21801) decomposes a hard theorem into a DAG of subgoals, generates cold-start SFT data by solving each subgoal independently with a smaller model, then RL’s on top with binary kernel-verified reward. AlphaGeometry (Nature 2024, DOI:10.1038/s41586-023-06747-5) goes further: synthetic self-play data generation that manufactures its own training problems, not just solutions to given ones — escaping a human-demonstration data-scarcity floor entirely. AlphaProof (Nature 2025, DOI:10.1038/s41586-025-09833-y) applies AlphaZero-style self-play/search on top.

The honest limit, stated precisely: the transferable lever is not “densify reward the way theorem proving does” in general — it is specifically: wherever a CTF sub-milestone can be reduced to a deterministic, server-side, ground-truth check (a reverse-shell callback actually received, a specific privileged file actually read — not an LLM-judge’s opinion), score it exactly like a verified Lean subgoal. Everywhere else — a curl command’s stdout, a subprocess’s raw output — there is no general “CTF kernel” that can certify a step was valid, and this domain’s recipe does not license densifying reward there. What does transfer safely: subgoal decomposition and synthetic self-play, used to generate additional training data or curriculum, leaving the terminal reward untouched.

3.4 The KNOWLEDGE vs EXECUTION contrast — tying it to the diagnosis framework

This is the load-bearing synthesis point of the whole chapter, and it is exactly the split Diagnosing the gap already formalizes (competence vs. performance, Firestone PMC7604508; formal vs. functional competence, Mahowald et al. arXiv:2301.06627) — the particular-language literature is independent, cross-domain confirmation of the same split, from a different field entirely:

Failure mode observedRoot causeFixing stageCross-domain evidence
Model has never seen the relevant tokens/technique at allMissing from pretraining corpusPretraining / continued-pretraining — data mixture, upsamplingStarCoder/DeepSeek-Coder (PL); Sailor/SEA-LION (NL)
Model “sort of” knows it but fragments/mishandles itTokenizer/vocabulary coverage gapVocabulary expansion + CPT (sub-pretraining level, not SFT/RL)Yamaguchi et al. arXiv:2406.11477
Model knows it passively but won’t reliably use it on commandInstruction-tuning data doesn’t cover itSFT / instruction-tuning mixture — cheapest lever, no CPT neededBLOOM+1 arXiv:2212.09535; Aya arXiv:2402.07827
Model knows the technique but fumbles execution over many turns / fails testsBehavior/execution gap, not knowledgeRL with an execution/compiler/flag verifierCodeRL, StepCoder, RLEF — this is the diagnosed gap in a typical CTF project

What I’d change in your pipeline: before spending a training-run budget on GRPO/RLVR to fix a specific recurring failure, run it through this table first. If trace review shows the agent never produces the right technique/CVE reference at any sample count — that’s the top two rows, a pretraining/SFT-data problem, and no amount of RL will fix it (consistent with handbook rule 5: “knowledge in tools, not weights or prompt” — this generalizes: RL doesn’t need to hold facts if tools can supply them at inference time). If the technique does appear somewhere across k samples but pass@1 doesn’t convert it — that’s the bottom row, your diagnosed execution gap, and RLVR is the right lever. This is not a new framework; it’s the particular-language literature independently re-deriving the same split the diagnosis chapter already uses, from code/NLP rather than cyber — worth citing back as corroboration.

3.5 Deep-research / web agents — the strongest-transfer row

The tightest non-cyber structural analogue: many sequential tool calls into a real, noisy, adversarial live environment (not a toy simulator), reward assessable only once the task is actually done. WebGPT (arXiv:2112.09332) is the direct ancestor of “SFT cold-start, then reward-guided optimization” — a common planned shape for this kind of pipeline — but its reward is a learned human-preference model, flagged by its own authors as struggling out-of-distribution; cite it as the origin of the recipe shape, not as license to use a learned reward. WebRL (arXiv:2411.02337, ICLR 2025) is the standout: a self-evolving curriculum that generates new training tasks directly from the model’s own unsuccessful attempts — Llama-3.1-8B goes 4.8%→42.4% success on WebArena-Lite from this alone. R1-Searcher (arXiv:2503.05592) shows a genuinely safe way to densify reward for tool-use: a sequential, not summed, two-stage reward — stage 1 rewards only correct tool-invocation format, stage 2 switches fully to outcome reward. Because the stages are sequential rather than concurrently-summed, the policy can’t “farm” stage-1’s format reward once stage 2 has begun — it avoids the reward-hacking trap a concurrent per-call bonus would carry. DeepResearcher (arXiv:2504.03160, EMNLP 2025) independently argues, as its central claim, that training end-to-end in the real environment (not a simulated proxy) is “a fundamental requirement” — direct validation of a live-sandbox harness design.

What I’d change in your pipeline: (1) WebRL’s failure-to-curriculum mechanism is the single best non-cyber precedent for your own currently-unsolved long tail (the minority of challenges outside the GRPO baseline band) — an automatic, quantitatively-strong demonstration that a failure corpus converts into new, appropriately-calibrated training tasks rather than sitting inert; (2) R1-Searcher’s sequential staged reward is a concrete, safe fix if trace review shows tool-avoidance (agent bypassing the tool surface in favor of raw shell) — a stage-1 format-only reward for correct tool invocation, switched off once stage 2 begins.

3.6 Hard-exploration games — the honest calibration check, plus one genuinely new lever

Montezuma’s Revenge and Pitfall are the domain where “sparse binary terminal reward with near-zero prior success” was most literally the entire problem. Go-Explore (arXiv:1901.10995, Nature 2021) solved both by maintaining an archive of previously-visited states, always returning to a promising already-discovered frontier state cheaply before exploring further from it, rather than re-discovering the same early states from scratch every episode — then robustifying the best archived trajectories into a closed-loop policy. AlphaStar (Nature, DOI:10.1038/s41586-019-1724-z) solves a different axis — adversarial strategy collapse — with a league: train against a diverse, continually-adapting population of checkpoints and hand-designed “exploiter” agents, not just the latest self; it also validates imitation-bootstrap-before-RL at frontier scale (pure self-play RL from scratch over such a long horizon was intractably slow to bootstrap). OpenAI Five (arXiv:1912.06680) shows scale + dense reward shaping substitutes for exotic exploration algorithms — but its dense proxy-reward choice is exactly the reward-hacking risk a ground-truth-only stance guards against; treat it as a caution, not a recipe. NetHack (arXiv:2006.13760) remains genuinely unsolved — the honest calibration point that {long-horizon + heavy exploration + procedural generalization + sparse terminal reward} all at once is not a solved combination anywhere in the literature, cyber included.

What I’d change in your pipeline (speculative transfer — engineering-unproven in this domain): Go-Explore’s literal mechanism (deterministic sim-state checkpoint/restore) doesn’t map to a live target box that isn’t cheaply resettable — but the principle does: explicitly archive distinct states of partial progress within a CTF episode (new service found, new privilege level reached, new file discovered) as first-class checkpoints, and bias new rollout attempts toward continuing exploration from an archived frontier state rather than always cold-starting from turn 0. This changes where exploration compute is spent, not the reward function — it carries none of the reward-hacking risk a shaped reward would. Building the state-abstraction function for free-text shell/HTTP output is real, non-trivial work; flag accordingly.

3.7 Robotics — speculative mechanism, but a concrete data-curation descendant

Hindsight Experience Replay (arXiv:1707.01495, NeurIPS 2017) is the seminal sparse-reward paper: relabel a failed trajectory, post-hoc, as if the state it actually reached had been the intended goal all along — converting 100% sparse failure into 100% dense, correctly-labeled success. Honest limit: this is an off-policy, goal-conditioned, replay-buffer mechanism (DDPG/DQN-family) — it does not literally port to an on-policy GRPO/RLVR loop, and a CTF episode has one terminal flag, not a continuum of interchangeable goals a failed run could be relabeled as having achieved instead. Speculative transfer, principle only: mine the corpus of failed (flag=0) trajectories for reusable sub-skill demonstrations — a run that reached a foothold but failed to escalate privileges is a valid positive demonstration of “how to reach a foothold,” even though the overall episode is a failure. Segment the failed-trajectory corpus by furthest-pipeline-stage-reached and fold the phase-appropriate positive prefixes into the SFT corpus for that sub-skill — a pure data-curation move that never touches the RL reward function, carrying none of the reward-hacking risk an online auxiliary reward would.


4. The KNOWLEDGE vs EXECUTION contrast — the load-bearing takeaway

Section 3.4 above is the single most important cross-domain finding in this chapter, restated plainly: the particular-language literature is the cleanest existing evidence, from a domain with no cyber baggage, that pretraining/SFT injects knowledge and RL only sharpens execution of knowledge the base model already has. This directly operationalizes Diagnosing the gap’s competence-vs-performance split with a second, independent field’s worth of citations. Practical consequence for your project: run any suspected failure mode through the four-row table in §3.4 before committing GRPO/RLVR compute to it — a “doesn’t know the technique” failure needs a data lever (more SFT coverage, a tool that supplies the fact at inference time), not a training-loop lever; a “knows it, fumbles execution over ~100 turns” failure is where RLVR belongs, and is what every SWE/RLEF/GrandCode result above was built to fix.


5. Ranked shortlist of transferable levers

  1. RLEF’s turn-level value function over a multi-turn POMDP (arXiv:2410.02089) — the single most literal structural preview of this problem (public-test feedback → repair → repeat → private-test terminal reward) solved by Meta at an order of magnitude fewer samples than scaffolded prompting. High confidence, high relevance — read before finalizing a GRPO variant.
  2. GiGPO’s step-level anchor-state advantage (arXiv:2505.10978) and GrandCode’s Agentic-GRPO (arXiv:2604.02721) — two independent, purpose-built GRPO variants for exactly this credit-assignment shape (long trajectory, terminal-only reward, off-policy drift). High confidence on GiGPO (NeurIPS-accepted); promising, unverified on GrandCode (single team, very recent) — converging evidence “stage/turn is the unit of credit” is the field’s consensus fix.
  3. WebRL’s self-evolving curriculum from failures (arXiv:2411.02337) — the strongest available precedent for converting your own unsolved-challenge tail into new training data automatically. High confidence, needs CTF-specific task-generation design.
  4. Ground-truth execution reward over any learned/similarity proxy, now 4x cross-validated — SWE-Gym > SWE-RL, the theorem-proving kernel, WebGPT’s own flagged weakness, and DeepResearcher’s live-environment requirement all land on the same rule a well-run project’s handbook already locks. Established, high confidence — reconfirmation, not a new finding, but reassurance the rule is domain-general.
  5. Subgoal/curriculum decomposition for cold-start DATA generation, never for the reward itself (DeepSeek-Prover-V2 arXiv:2504.21801, AlphaGeometry) — safe wherever a genuine sub-milestone is deterministically verifiable; see One problem, or many? for the full decompose-eval-vs-decompose-reward argument this reconfirms. Established, high confidence.
  6. Progressive context/turn-budget curriculum for RL (arXiv:2508.03501, KLong arXiv:2602.17547) — start short, extend once performance plateaus; directly portable to your existing GRPO baseline-band rule (e.g. a 30–60% pass-rate band). Medium confidence (2 independent sources).
  7. R1-Searcher’s sequential (not summed) staged reward for tool-use bootstrap (arXiv:2503.05592) — a safe fix if tool-avoidance is diagnosed in trace review. Established mechanism, cyber-domain application untested.
  8. Go-Explore’s archive-and-return exploration scheduling (arXiv:1901.10995) — genuinely the most novel, least-already-covered addition here; changes where exploration compute is spent, zero reward-hacking risk. Strong transfer of the idea; engineering-unproven in this domain — speculative transfer.
  9. Hybrid test-time scaling (execution + execution-free verifiers, complementary blind spots) — a free multiplier on any trained policy, replicated across ≥4 independent groups (R2E-Gym, DeepSWE, SWE-Master, Claude “high compute”). High confidence, immediately actionable on your existing pass@k methodology.
  10. Mining flag=0 trajectories for sub-skill SFT data (HER’s spirit, arXiv:1707.01495) — segment failed runs by furthest-stage-reached, fold positive prefixes into SFT. Speculative-to-established idea, translated from a different algorithm family — low risk, purely data-curation.
  11. NetHack’s honest “still unsolved” status (arXiv:2006.13760) — not a lever, a calibration check: no algorithm anywhere has cracked {long-horizon + heavy exploration + procedural generalization + sparse terminal reward} simultaneously. Set expectations accordingly.

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

Start here: a proven-first ranking of the methods

Learnings gave you the general theory — every method, unattached to any project. Understanding turns that theory toward your bottleneck, and this is where it starts: not another explainer, but the ranked, proven-first answer to “what do I run first.”

Every other chapter in this book explains a method on its merits. This one ranks them, on purpose, because a time-constrained team with a north star of a fine-tuned open-weight dense model (Sequence B — frontier-recipe-is-a-sequence.md §2) is not running a research program. A time-constrained team will not validate unproven/novel methods before starting — it wants the PROVEN, widely-adopted, high-impact default for each decision, with novel methods explicitly deferred to later. If you only read one chapter to decide what to run first, read this one; every other chapter is the “why,” this is the “what, right now.”

1. The metric, and why it’s the right one for a time-constrained team

Proven-ness = ADOPTION BREADTH × FLAGSHIP USAGE × MEASURED IMPACT, with NOVELTY PENALIZED.

  • Adoption breadth — how many frontier/flagship models, open recipes, and papers actually use the method (not just cite it as related work). Citation count is a proxy, not the answer — a method can be well-cited and still never chosen in production (see SimPO below: real citations, explicitly bake-off’d and passed-on by Tülu 3).
  • Flagship usage — is the method named in a flagship tech report as the production choice? This is the strongest single signal in the table below, stronger than raw citation count, because it means a lab with the resources to run a bake-off ran one and picked this.
  • Measured impact — are gains actually disclosed (a number, an ablation), not just claimed?
  • Novelty penalized — a promising 2026 preprint with one paper’s worth of evidence ranks below a battle-tested method with multiple independent flagship confirmations, even if the preprint’s numbers look better on paper. This is deliberate risk management, not conservatism for its own sake: a time-constrained team betting its one shot on an unreplicated result is the failure mode this metric exists to prevent.

Why this is the right metric here, not just a generically reasonable one: the typical diagnosis in this situation is an execution gap (decision.md, diagnosis/framework.md) — the model already has the capability, it just doesn’t fire reliably — and the reward is a deterministic ground-truth flag verifier, i.e. a textbook verifiable reward. That combination has a well-known answer in the literature (rejection-sampling SFT → RLVR-via-GRPO); there is no research question left to answer about whether this shape of pipeline works, only about executing it well. Spending scarce time validating a T3/T4 method when a T1 default already fits the reward shape is the exact overthinking this ranking is built to head off.

Stance honored throughout: no academic cybersecurity-LLM project (CTF-Dojo, Cyber-Zero, Pentest-R1, HackSynth, AutoPenBench, DRLRM-PT, Cybench, NYU CTF Bench, EnIGMA, InterCode-CTF) is load-bearing evidence anywhere below — same rule as this book’s proven-by-usage dataset registry (post-training-dataset-registry.md), applied to methods instead of data. Grounding is frontier-lab technical reports, frontier open post-training recipes (Tülu 3, DeepSeek-R1, Qwen3, Llama 3/4, Llama-Nemotron), and citation/adoption counts verified live via Exa on 2026-07-02.


2. RL-algorithm tier table — START HERE: RLVR-via-GRPO

This is the layer that consumes the flag verifier’s reward directly. It fits this setup exactly: a binary pass/fail signal needs no learned value function, which is precisely GRPO’s design point relative to PPO. Full detail and sourcing: methods/reinforcement.md.

MethodTierAdoption evidence (live-verified)ImpactWhy this tier
GRPO arXiv:2402.03300T1 — PROVEN DEFAULT6,720–7,285 citations (two live pulls, same day) — highest of any RL optimizer here; trains DeepSeek-V3/R1/V3.2; default GRPOTrainer across HF TRL’s entire supported-model list (Llama, Qwen, Gemma, GLM-MoE, GPT-OSS); base algorithm inside verl. A 2026 practitioner survey: “become the standard RL algorithm for LLM posttraining.”Proved reasoning-RL at frontier scale in DeepSeek-R1 (Nature-published).Highest citation count by a wide margin, proven at flagship scale, and literally the default trainer name in the field’s most-used open library. Removes the critic PPO needs — matches a 0/1 flag-verifier reward exactly.
RLVR (paradigm, run via GRPO) arXiv:2501.12948T1 — PROVEN DEFAULT (paired w/ GRPO)Nature-published (peer-reviewed, not just preprint); every 2025–2026 reasoning model (o1/o3, R1, Gemini-thinking, Qwen3, Kimi) scales RL against verifiable rewards as the capability driver.R1 vs. R1-Zero ablation is the disclosed, controlled comparison for cold-start-before-RL.Not a separate optimizer — the reward-design paradigm (rule-based/verifiable reward, no learned RM) that GRPO runs under. A deterministic flag verifier is a textbook verifiable reward; this is not an analogy for your case, it’s the literal mechanism.
PPO arXiv:1707.06347T2 — proven fallback28,823 citations — highest raw count in the whole comparison; InstructGPT/ChatGPT’s original RLHF, Llama-2-Chat.Longest track record of any method in this book.Proven at the largest historical scale, but needs a learned critic — extra memory/instability, and redundant complexity for a single scalar 0/1 reward. Keep as the escalation path if GRPO’s group-relative baseline degenerates (near-0%/near-100% pass-rate collapse).
DAPO arXiv:2503.14476T2 — proven conditional fix1,679–2,113 citations in <18 months; canonical recipe inside verl; MiniMax-M1’s own tech report benchmarks against it directly.Reproduced 44→50 AIME24 pts.Its four fixes (clip-higher, dynamic sampling, token-level loss, overlong filtering) exist specifically for GRPO’s zero-gradient collapse on all-correct/all-incorrect groups — exactly the failure shape a binary pass/fail flag verifier risks. Adopt on top of GRPO if that’s observed, don’t start here.
GSPO arXiv:2507.18071T2 — flagship-confirmed, narrower fitQwen Team’s own paper: “these merits of GSPO have contributed to the remarkable improvements in the latest Qwen3 models” — direct flagship usage.Stabilizes MoE RL training.Real flagship confirmation, but its headline fix (sequence-level clipping for MoE instability) doesn’t target Sequence B’s dense architecture. Keep as a stability lever, not the starting algorithm.
GiGPO arXiv:2505.10978T3 — promising, watchNeurIPS 2025 accepted; 0 external citations at check time; real infra adoption (verl-agent, Alibaba ROLL) but small-model (Qwen2.5-1.5B/3B/7B), non-cybersec validation only.Best conceptual fit for turn-level credit assignment in a multi-turn CTF agent.Right shape of idea for your multi-turn tool-use agent, but zero independent citations and no flagship adoption. Episode-level GRPO (whole CTF run = one group member) is the proven multi-turn pattern until this clears the bar.
GTPO (ACL 2026)T4 — skip for v1Single-paper evidence, no infra adoption, no external citations possible yet (too new).+3.0–3.9% over GRPO in its own paper only.The purest novelty-penalty case in this table — one paper’s own numbers, nothing external. Revisit in 6–12 months.
PRM (process reward model) arXiv:2305.20050T4 — skip (flagship rejected)DeepSeek explicitly rejected PRM for R1 due to step-level reward hacking (2501.12948).Not merely unproven — a named flagship anti-pattern.
Learned/neural reward model (replacing the deterministic verifier)T4 — skip (architectural anti-pattern)N/A when a deterministic verifier already exists.Introduces a gameable component where a perfect deterministic verifier already exists — the entire point of RLVR is to avoid this.

START HERE: RLVR-via-GRPO. It is simultaneously the most-cited method in this table, the literal mechanism DeepSeek-R1 used to prove RLVR at frontier scale, the default trainer in the field’s most-used open post-training library, and an architectural match for a binary verifiable reward. Keep DAPO’s fixes in your back pocket as the T2 escalation path for exactly the group-collapse failure mode a hard pass/fail verifier is prone to. See methods/reinforcement.md for the mechanics.


3. Preference-method tier table — START HERE: DPO (KTO if unpaired)

This layer sits between the SFT stages and GRPO/RLVR — it’s for signals that are pairwise/binary but not independently verifiable (report quality, tool-use elegance), not a substitute for the verifier-driven RL stage. Full detail: methods/preference.md.

MethodTierAdoption evidence (live-verified)ImpactWhy this tier
DPO arXiv:2305.18290T1 — PROVEN DEFAULT9,399 citations, 2,011 influential — second-highest cited method in this whole comparison after PPO/SFT/LoRA. Named in Llama 3’s Herd of Models report (“each round of post-training involves SFT followed by DPO”), Zephyr-7B’s reference recipe, Tülu 2/3’s final pick after an explicit bake-off vs. PPO/SimPO, Qwen-Chat model cards. Default trainer in TRL, Axolotl, LLaMA-Factory, Unsloth.Llama 3 runs it iteratively across ~6 rounds at 405B scale.Largest adoption breadth of any preference method by far; no reward model, no RL loop — the simplest infra match for a time-constrained team, and directly compatible with building (accept, reject) pairs from the flag verifier’s own outcomes.
KTO arXiv:2402.01306T2 — proven, strong conditional fit here1,081 citations, 189 influential; official KTOTrainer in TRL; ablated (not chosen primary) in Tülu 3.“Matches or exceeds DPO… despite only learning from a binary desirable/undesirable signal.”Not flagship-primary at DPO’s scale, but its unpaired binary-label requirement is an unusually close match to the log shape you’ll typically have: a pile of verified flag-captures and a pile of failed runs, with no natural same-prompt pairing. Use when constructing DPO pairs is the harder engineering lift.
RLHF-PPO (reward model + PPO) — InstructGPT arXiv:2203.02155T2 — proven, wrong tool hereThe original recipe; foundation of ChatGPT/Claude/Gemini lineage; Llama-2-Chat = SFT + rejection-sampling + PPO.Proven at the largest historical scale of any method in this book.Needs a trained reward model + full RL rollout infra — exactly the complexity DPO removes, and you’re already building GRPO/RLVR infra downstream. A second heavier RL loop for the preference stage is redundant. Tülu 3’s own bake-off found DPO-variants beat PPO on this specific stage.
ORPO arXiv:2403.07691 · SimPO arXiv:2405.14734 · IPO arXiv:2310.12036T3 — promising, watchORPO 619 cites (639 derivative HF models); SimPO 1,055 cites, NeurIPS 2024, shipped in Ai2’s open-instruct; IPO 1,034 cites, DeepMind, AISTATS 2024. Real OSS traction on all three.SimPO beat DPO on AlpacaEval2/Arena-Hard in community Llama-3-8B checkpoints.Real, non-novel, but none of Llama/Qwen/DeepSeek/GPT/Claude/Gemini names any of the three as its primary production choice — and Tülu 3 explicitly bake-off’d SimPO against DPO-norm and picked DPO-norm (“Length-normalized DPO achieved better performance … including PPO, DPO, and SimPO”). A concrete flagship-adjacent rejection, not absence of evidence. Revisit only if DPO shows a specific failure mode these target.
RLAIF / Constitutional AI arXiv:2212.08073T2 — proven, out of current scope3,245 citations; core method at Anthropic; loosely echoed in Gemini 2.5 safety work.Anthropic’s production alignment method.Proven and mainstream at the labs that use it, but targets harmlessness/persona alignment, not execution reliability — not applicable to a current execution-gap loop. Relevant only if/when harmlessness-shaping enters scope.

START HERE: DPO on (accept, reject) pairs built from the flag verifier’s own outcomes. Switch to KTO specifically when the mined agent logs don’t naturally pair (pass/fail without a matched same-prompt counterpart). See methods/preference.md for the loss and the DPO/KTO/ORPO family map.


4. SFT / distillation tier table — START HERE: off-policy SFT + rejection-sampling SFT

Full detail: methods/imitation.md.

MethodTierAdoption evidence (live-verified)ImpactWhy this tier
Off-policy SFT (curated / teacher / synthetic instruction data)T1 — PROVEN DEFAULTUniversal stage-0 of every disclosed recipe checked: InstructGPT arXiv:2203.02155, Llama 2 arXiv:2307.09288 (27,540 curated examples), Tülu 3 arXiv:2411.15124 (939,344-prompt mix), Qwen3 arXiv:2505.09388 (“cold-start” SFT), DeepSeek-R1 arXiv:2501.12948, Llama-Nemotron arXiv:2505.00949. Synthetic variant WizardLM/Evol-Instruct arXiv:2304.12244: 1,700 citations.Zero disclosed frontier recipes skip this stage.The oldest, most battle-tested move in post-training. Establishes format/tool-syntax stability before anything else runs. Zero novelty risk.
Rejection-sampling SFT (STaR/RAFT/ReST family, “RL without RL”)T1 — PROVEN DEFAULT, execution-gap bridgeMeta’s Llama-2-Chat runs this as its named primary RLHF-V1–V3 alignment step, before PPO is even introduced (2307.09288: “we used only Rejection Sampling fine-tuning, and after that, we combined … PPO on top”); smaller 7B/13B/34B Llama-2-Chat models are fine-tuned entirely on rejection-sampled data distilled from the 70B. DeepSeek-R1 stage 3/4 = rejection sampling on the RL checkpoint → the 800K-sample SFT set for the second training pass (2501.12948). Academic formalizations: STaR arXiv:2203.14465 (NeurIPS 2022), RAFT arXiv:2304.06767, ReST arXiv:2308.08998 (DeepMind).Two independent frontier labs (Meta, DeepSeek) run it as production infrastructure.This is the execution-gap bridge — it plugs directly into the deterministic flag verifier with zero adaptation: sample K, keep the flag-verified successes, fine-tune. Cheapest on-policy move available; reuses your existing SFT pipeline.
Off-policy (teacher) distillationT2 — proven, conditional hereOrigin: Hinton et al. arXiv:1503.02531. Flagship production: Gemma 2 arXiv:2408.00118 (cross-references Gemini 1.5’s use), DeepSeek-R1-Distill (6 dense checkpoints, most-downloaded reasoning models on HF, 32B beats o1-mini on several benchmarks).Large, disclosed impact across 3 independent flagship efforts.Proven and high-adoption as a method, but conditional here: it needs a stronger available teacher already competent at your specific offensive-security tool-use domain, which doesn’t reliably exist off-the-shelf. Supporting role (cold-start data seeding), not the core loop.
On-policy distillation (GKD-style)T3 — promising, watchGKD arXiv:2306.13649 (DeepMind, 2023), GKDTrainer shipped in TRL. Thinking Machines Lab blog (2025-10-27, ~76.7% AIME’24, rank-128 LoRA) — a research-lab writeup, not a flagship tech report. Qwen3 blends it in as a secondary technique alongside off-policy KD.+70–111% relative gains reported at T5-scale in GKD’s own paper.Real trajectory toward T1/T2 — Qwen3’s partial adoption is new positive signal — but no flagship names it a standalone production stage yet. Re-check in 3–6 months.
Academic-cybersec-teacher distillationT4 — skipExcluded by stance.No flagship precedent, unverified teacher quality — the stance rule’s direct application.

START HERE: off-policy SFT (cold-start) → rejection-sampling SFT (on-policy). Both clear T1 independently; the second is the specific mechanism that turns the flag verifier into training data at essentially zero extra engineering cost. See methods/imitation.md.


5. The one proven end-to-end starting sequence

SFT (off-policy cold-start) → rejection-sampling SFT (on-policy) → DPO (preference) → GRPO/RLVR (reinforcement) → iterate.

This is not a novel combination — it is the modal recipe across every disclosed open frontier pipeline checked (Tülu 3 arXiv:2411.15124, DeepSeek-R1 arXiv:2501.12948, Qwen3 arXiv:2505.09388, Llama-Nemotron arXiv:2505.00949), and independently reconfirmed by a fresh 2026 practitioner survey as “the dominant posttraining recipe” a year later — see frontier-recipe-is-a-sequence.md §2 (Sequence B) for the full stage-by-stage derivation.

Why this is the lowest-risk, highest-coverage starting point for your case specifically:

  1. Every stage independently clears T1 in the tables above — zero stages require betting on an unproven method.
  2. It matches the diagnosis. An execution gap is exactly what rejection-sampling SFT is for, and if you already have the free ingredient it needs — a real deterministic flag verifier generating on-policy correct/incorrect labels — this stage is essentially free.
  3. It matches the reward shape exactly. RLVR via GRPO is the literal mechanism for a deterministic verifier, not an analogy.
  4. Cold-start-before-RL is a disclosed stability requirement, not a stylistic choice — DeepSeek-R1 vs. R1-Zero (same base, same GRPO, only SFT differs) shows pure-RL-from-scratch gets real gains but “poor readability, language mixing”; skipping straight to GRPO is the riskier path, not the leaner one.
  5. DPO-before-RLVR is the safer default ordering here because the two signals are genuinely orthogonal in this setup — flag-capture (verifiable) vs. report quality/tool-use elegance (not verifiable) — which is precisely the condition frontier-recipe-is-a-sequence.md §7 flags as the case for sequencing rather than folding into one RL stage (DeepSeek’s own pattern).

What this sequence deliberately is not: a from-scratch pretraining run (Sequence A, irrelevant if you’re starting from an existing open-weight dense checkpoint); a jump straight to GRPO/RLVR with no SFT cold-start (higher instability risk, R1-Zero’s own documented failure mode); a fold-everything-into-one-RL design (the wrong default here because the two signals are orthogonal, not the same behavior).

This sequence is Rung-1-scoped — it resolves execute reliably on the portfolio you have. It is a prerequisite for, not a substitute for, the frontier-capability question addressed in roadmap-inputs.md and frontier-cyber-model-path.md.


6. One-glance consolidated tier list

#MethodFamilyTierWhere it lives
1Off-policy SFTImitationT1methods/imitation.md
2Rejection-sampling SFT (STaR/RAFT/ReST)ImitationT1methods/imitation.md
3DPOPreferenceT1methods/preference.md
4GRPOReinforcementT1methods/reinforcement.md
5RLVR (paradigm, via GRPO)ReinforcementT1methods/reinforcement.md
6KTOPreferenceT2 (strong conditional fit)methods/preference.md
7Off-policy (teacher) distillationImitationT2 (conditional on teacher availability)methods/imitation.md
8RLHF-PPO (reward model + PPO)Preference / ReinforcementT2 (proven, redundant infra here)methods/preference.md, methods/reinforcement.md
9PPO (as RL optimizer)ReinforcementT2 (fallback if GRPO baseline degenerates)methods/reinforcement.md
10DAPOReinforcementT2 (fix for GRPO group-collapse)methods/reinforcement.md
11GSPOReinforcementT2 (flagship-confirmed, MoE-specific)methods/reinforcement.md
12RLAIF / Constitutional AIPreferenceT2 (proven, out of current scope)methods/preference.md
13On-policy distillation (GKD-style)ImitationT3 — watchmethods/imitation.md
14ORPO / SimPO / IPOPreferenceT3 — watchmethods/preference.md
15GiGPOReinforcementT3 — watchmethods/reinforcement.md, methods/rl-long-horizon-exploration.md
16GTPOReinforcementT4 — skip for v1methods/rl-long-horizon-exploration.md
17PRM (process reward model)ReinforcementT4 — skip (flagship rejected)methods/reinforcement.md
18Learned reward model (replacing verifier)ReinforcementT4 — skip (architectural anti-pattern)methods/reinforcement.md
19Academic-cybersec-teacher distillationImitationT4 — skip (stance-excluded)methods/imitation.md

The starting sequence, once more: SFT → rejection-sampling SFT → DPO → GRPO/RLVR → iterate. Read the diagnosis first (decision.md), the sequencing evidence next (frontier-recipe-is-a-sequence.md), and check contested.md before treating any T2 escalation as settled — the DPO-vs-fold-into-RLVR ordering and the RL-boundary-expansion question are both flagged there as genuinely unsettled, not smoothed over. roadmap-inputs.md is where this ranking meets your actual challenge set and its segmentation gates.

Confidence

High on the T1 picks in all three families (off-policy SFT, rejection-sampling SFT, DPO, GRPO/RLVR) — each is corroborated by 2+ independent flagship technical-report disclosures verified live, plus a fresh 2026 practitioner survey independently confirming the same stage-skeleton is still the mainstream picture, not stale training-data knowledge. Moderate-high on the T2 conditional calls (KTO’s project-fit read is this book’s own synthesis, not a claim any external source makes about your case specifically — flagged as such). Explicitly contested, not settled: DPO-vs-fold-into-RLVR staging order, and whether RL expands or merely elicits the reasoning boundary — see contested.md; neither affects the T1 picks above, only how individual stages get tuned once the sequence is running. Lower confidence on the exact production RL/preference algorithm inside fully closed flagships (OpenAI, Anthropic, Gemini) — those tech reports withhold the relevant specifics; this ranking cites what’s disclosed and flags what isn’t, per the same practice used throughout this book.

Sources

All arXiv ids above were crawl-verified live (Exa) on 2026-07-02, cross-checked against Semantic Scholar citation counts pulled the same session. Full per-family source lists, exact citation-count snapshots, and the underlying research threads: artifacts/overnight-ranking/research/rl-algo-ranking.md, artifacts/overnight-ranking/research/preference-method-ranking.md, artifacts/overnight-ranking/research/sft-distillation-ranking.md, and artifacts/overnight-ranking/research/proven-default-recipe-and-tiers.md (this chapter’s direct synthesis source). See also this book’s own references.md for the canonical arxiv-id registry.

One problem, or many? — monolithic outcome-RL vs staged decomposition

Every other chapter in this book asks “which algorithm” (SFT vs DPO vs GRPO). This chapter asks a question one level up, specific to a sequential, multi-stage task with a single sparse terminal reward: should the CTF solve be trained as one end-to-end outcome-RL problem (flag reward only, let RL discover the stages), or decomposed into sub-problems — evaluated per stage and, more contentiously, trained per stage? The two halves of “decompose” turn out to have very different answers, and conflating them is the single easiest way to get this wrong.

All citations below are carried over, unmodified, from five research threads run 2026-07-02 (artifacts/overnight-decomposition/research/{monolithic-case,decomposition-case,staged-eval,pentest-ctf-rl,credit-assignment-theory,verdict}.md) — no id below was invented for this chapter. Re-grounding pass, same date: per the project’s standing rule, no conclusion in this chapter may rest on a domain-specific academic CTF/pentest training or benchmark paper (CTF-Dojo, Cyber-Zero, Pentest-R1, HackSynth-GRPO, AutoPenBench, Cybench, NYU CTF Bench, EnIGMA, InterCode-CTF, DRLRM-PT, node-fragility shaping, the kill-chain-staged-reward paper) — every such work is demoted to a labelled context-only mention below, and every claim that had rested on one is re-anchored on general frontier-lab / RL-theory evidence or this project’s own data instead. Two new citations were added and independently verified live for this pass: STaR (arXiv:2203.14465) and ReST-EM (arXiv:2312.06585), both general (non-security) self-training literature, replacing CTF-Dojo/Cyber-Zero as the basis for §5’s rejection-sampling-SFT recommendation.


1. The pipeline, and why the failure isn’t uniform

A CTF solve is not one action, it’s a chain:

flowchart LR
  R["Recon /\nenumeration"] --> E["Endpoint\ndiscovery"]
  E --> V["Identify the\nvulnerable endpoint"]
  V --> X["Exploit it"]
  X --> P["Post-exploitation /\npivot"]
  P --> F(("Flag\n{0,1}\nground-truth verified"))

  classDef stage fill:#132b22,stroke:#34d399,color:#eafaf3;
  class R,E,V,X,P stage;

Only the last box is ground-truth-checkable today. Observed failures cluster by where in the chain the agent dies, not uniformly across it — the project’s own F1–F4 taxonomy, which turns out to be a CTF-specific instance of failure clusters the general agent-eval literature keeps independently rediscovering (§4).

TagFailureCanonical RL/agent-research framingWhat it is not
F1Never finds the vulnerable endpointExploration / coverage failure — no gradient exists until the reward is first observed; large, deceptive state spaceNot a credit-assignment problem — you can’t assign credit for a reward you’ve never seen
F2Finds it, probes shallowly, can’t land the exploitExecution / skill (performance-floor) failure — capability present, doesn’t reliably convertNot usually fixed by more exploration
F3Clumsy tool use, wrong tool for the jobPolicy / tool-selection failure — a distinct axis from “does it find the bug”Overlaps F2 but has its own literature (tool-augmented-LLM failure taxonomies)
F4No real pivot/chaining after a footholdLong-horizon credit-assignment failure — the terminal bit has to retroactively explain ~100 turns; variance grows with horizonNot solved by “try more” alone — it’s a variance, not coverage, problem

The credit-assignment theory thread makes the split precise: a ~100-turn trajectory with reward only at the end is hard for three separable reasons — exploration burden (F1, upstream of everything else), credit-assignment variance (Monte-Carlo/GRPO-style returns smear one scalar across all turns — arXiv:1506.02438, GAE), and compounding distributional drift (a policy trained once, on one static snapshot, drifts off-distribution as a rollout gets longer — arXiv:1011.0686, DAgger, classically O(εT²) uncorrected). F1 is the first problem; F2–F4 are flavors of the second and third. Don’t expect one fix (a denser reward) to solve both (arXiv:2312.01072, the credit-assignment-vs-exploration survey).


2. Side A — the monolithic case, steelmanned

The pattern across every lab that tried both is consistent: outcome-only + scale beats hand-built process supervision, every time it’s been A/B’d.

  • DeepSeek-R1-Zero rejects process reward outright, in its own failure-experience writeup. Pure RL, no SFT, rule-based outcome-only reward; reasoning behaviors emerge as a side effect. Verbatim: “a model-based PRM… inevitably leads to reward hacking, and retraining the reward model needs additional training resources and it complicates the whole training pipeline.” arXiv:2501.12948. This is the single strongest evidence against a learned/neural per-stage reward — note precisely what it doesn’t rule out: a deterministic, ground-truth per-stage check is a different animal (§4).
  • OpenAI Deep Research shipped a long-horizon, tool-using agent trained end-to-end on outcome/rubric reward, and its own team says why: “End-to-end training beats manual orchestration… constructing a graph of operations… is the common approach to building agents [but] Deep Research is trained end-to-end… This allows the model to develop flexible strategies… that would break if scripted manually.” (OpenAI Deep Research system card, no arxiv id — flagged as such.) Closest real-world analog to this project’s shape: long-horizon, tool-using, sparse/rubric-graded.
  • Kimi k1.5 gets SOTA reasoning results with no PRM, no MCTS, no value function — substituting long-context scaling for explicit search. arXiv:2501.12599. Second independent lab, same conclusion as R1.
  • Llama 4’s own post-training team found heavy SFT/DPO caps the ceiling of the subsequent RL stage — verbatim: “SFT and DPO can over-constrain the model, restricting exploration during the online RL stage.” They responded by pruning >50% (95% for Behemoth) of their SFT data (ai.meta.com blog, no arxiv id). This is the project-critical citation: a hand-imposed stage boundary is itself a form of prescriptive pre-RL structure, and this is the general mechanism by which imposed structure narrows a policy’s exploration before RL gets to use it.
  • Academic, cited for context only, not a basis (per project standing rule — no domain-specific academic CTF/pentest training paper has produced a frontier cybersecurity model): in the CTF/pentest domain specifically, the same monolithic-wins pattern is also reported by academic training papers — CTF-Dojo (arXiv:2508.18370), Cyber-Zero (arXiv:2508.00910), Pentest-R1 (arXiv:2508.07382), HackSynth-GRPO (arXiv:2506.02048). None of these is load-bearing here — the actual basis for Side A is the frontier-lab evidence directly above (R1, Kimi k1.5, OpenAI Deep Research, Llama 4, Bitter Lesson), which independently converges on the same conclusion without needing a CTF-specific data point.
  • The Bitter Lesson (Sutton 2019, incompleteideas.net) is the intellectual ancestor of all of the above: hand-built structure plateaus, general search+learning wins at scale. High confidence the historical pattern is real; medium-low confidence it transfers directly to a 1000-challenge corpus with real per-rollout infra cost — that’s exactly the disanalogy the honest limits below press.

The honest limits — where the monolithic case’s own literature admits it breaks down

LimitCitationWhat it says
Pure outcome RL can structurally fail to ever find the rewardGo-Explore, arXiv:1901.10995 / Nature s41586-020-03157-9Vanilla deep RL scored ~0 on Montezuma’s Revenge/Pitfall — canonical sparse, deceptive, long-horizon environments — until an explicit “remember states, return, explore from there” mechanism was added. This maps almost exactly onto F1: it’s an exploration-algorithm problem, not a hyperparameter one.
The best long-horizon precedent needed denser reward + enormous scaleOpenAI Five, arXiv:1912.0668010 GPU-months of distributed self-play, AND a per-frame shaped reward (last-hits, kills, tower damage) — not a single terminal bit. Citing this as “pure sparse reward at scale works” over-claims what the paper shows.
R1’s own reward-reliability admissionarXiv:2501.12948“The success of pure RL depends on reliable reward signals… for tasks that cannot obtain a reliable signal, DeepSeek-R1 uses human annotation… and only conducts RL for hundreds of steps.” The CTF flag reward is reliable (ground-truth) but far sparser per compute-dollar than a math/code answer — R1’s paper doesn’t test this sparsity regime; it’s an extrapolation this project would be making, not a validated claim.

Bottom line for Side A: thick, convergent, in-domain evidence that monolithic-outcome-plus-better-data/curriculum wins whenever it’s been tried against a decomposed alternative in LLM-CTF training specifically. The genuine open risk it must own is Go-Explore’s — whether a low, non-uniform solve rate reflects “still finding it eventually with more rollouts” (favors monolithic) or “structurally not finding it” (favors an exploration-specific intervention) is an empirical question literature alone cannot resolve.


3. Side B — the decomposition case, steelmanned

Framing. Monolithic outcome-RL is implicitly betting on four things at once: (1) the base policy already puts non-zero mass on the correct trajectory shape for every stage on a large fraction of challenges, (2) the RL algorithm can correctly attribute a late reward to the right subset of ~100 turns, (3) one scalar is expressive enough to teach four qualitatively different skills (exploration breadth, exploit depth, tool discipline, chaining) without one skill’s gradient starving another’s, and (4) “more outcome RL” is uniformly the right lever for F1 through F4 alike. Every technique below is a documented failure mode of at least one of these assumptions.

The menu of decomposition mechanisms

MechanismCitationWhat changes in the loopConfidence
Options / SMDP framework (the seminal foundation, asked-for regardless of age)Sutton, Precup, Singh, Artificial Intelligence 112 (1999) (pre-arxiv; DOI 10.1016/S0004-3702(99)00052-1)Action space becomes {launch_recon_option, launch_exploit_option, ...}; a high-level policy picks among temporally-extended sub-policies, shortening the effective horizon the terminal reward has to bridgeHigh (theory), medium (LLM transfer). Known failure: naive end-to-end option learning collapses to one mega-option or micro-manages every step.
FeUdal Networks — Manager/Worker split fixes option-collapsearXiv:1703.01161Manager emits abstract directional goals in latent space at low temporal resolution; Worker is intrinsically rewarded for moving state toward that direction; own ablations show a plain (non-dilated) recurrent Manager “fails catastrophically” on long-credit-assignment tasksHigh (mechanism), medium (LLM transfer — from-scratch Atari RL, not a token-level LLM policy)
ArCHer — the LLM-native analoguearXiv:2402.19446A high-level, off-policy turn-level value function aggregates reward across turns; a low-level PPO-style update trains the token policy inside each turn using that value as its reward. Map “turn” onto “stage.” Single strongest “if I had to prototype one paper” citation for training-decomposition.High (recipe exists), medium (untested on anything CTF-shaped)
HiPER — hierarchical advantage estimationarXiv:2602.16165Factorizes policy into planner + executor; Hierarchical Advantage Estimation aggregates returns per subgoal, provably reducing variance vs flat GAE; +6.6% ALFWorld, +8.3% WebShop, largest gains specifically on long-horizon multi-subtask tasksHigh (strong ablations)
MiRA — milestone-based dense rewardarXiv:2603.19685Dense, milestone-based reward replaces sparse outcome-only; on Gemma3-12B, WebArena-Lite success rate 6.4% → 43.0%, beating WebRL (38.4%) and GPT-4-Turbo (17.6%). The single strongest empirical existence-proof in this whole dossier that flag-only reward can leave a large gap on the table — but on web-navigation, not offensive-security CTF.High
Pentest-R1 — domain-specific two-stage trainingarXiv:2508.07382Academic, cited for context only, not a basis (per standing rule): offline RL on 500+ real pentest walkthroughs → online RL in a live CTF env. Structurally resembles this project’s own planned SFT→GRPO, but that resemblance is not the basis for recommending it — the load-bearing mechanism for training-decomposition is the general options/ArCHer/HiPER hierarchical framing above plus curriculum-learning theory below.N/A — context only
Potential-based reward shaping — the theoretical safety net for everything aboveNg, Harada, Russell, ICML 1999 (pre-arxiv)F(s,s') = γΦ(s') − Φ(s) for any state-only potential Φ provably leaves the optimal policy unchanged — the telescoping sum over an episode collapses back to Φ(s_T) − Φ(s_0) plus the true reward. This is a theorem, not an empirical claim. Modern reaffirmation: arXiv:2502.01307 (practical effectiveness still depends on Φ’s scaling).Very high (correctness); risk is entirely implementation
RUDDER — learned, return-equivalent redistributionarXiv:1806.07857Train an auxiliary model to predict final return from trajectory prefixes (using your existing verified-solve set), use its temporal differences as a per-step reward — a learned alternative to hand-specifying Φ, with the same correctness guaranteeHigh (theory), directly actionable given existing verified-solve data
Ground-truth per-stage verifiers / VPR / CM2 (checklist rewards)arXiv:2605.10325 (VPR), arXiv:2602.12268 (CM2)Decompose the terminal task into a checklist of objectively verifiable sub-criteria (sandbox-checked, not judge-opinion) — the safe form of stage reward, symmetric to the flag verifier’s own contract. VPR’s own honest caveat: benefit “depends on the reliability of the verifier,” and extension “to less structured, open-ended environments… remains an open challenge” — directly relevant to CTF’s own stage 3 (§4).High, with an explicit open-environment caveat
Curriculum learning & sequencing — orthogonal to reward, lowest risk of the whole menuBengio et al., ICML 2009 (pre-arxiv, foundational); h1 arXiv:2510.07312; FastCuRL arXiv:2503.17287; BPO arXiv:2508.03018Order training by difficulty (single-endpoint before decoy-heavy; 1-hop exploit before 2-hop pivot) — touches no reward function at all. h1: curriculum + pure outcome-only reward gets an exponential sample-complexity gain. BPO explicitly reports vanilla GRPO on their sparse-reward setting yields only marginal improvement without it.High — the cheapest, least-risky lever in this entire menu
Kill-chain-staged reward (cyber-defense red-teaming)arXiv:2605.17075 (May 2026)Academic cybersecurity-LLM training work, cited for context only, not a basis (per standing rule). Frozen LLM planner emits kill-chain intent; a trained RL controller gets reward “aligned with kill-chain progression.” Superficially the closest thing in the literature to Option B, but it’s brand-new, unreplicated, doesn’t ablate “staged reward” from “hybrid architecture,” and — per the standing rule — carries no evidentiary weight for this project regardless. The actual basis for Option B’s viability is the general HRL/theory rows above (ArCHer, HiPER, potential-based shaping).N/A — context only
Classical (non-LLM) staged reward for pentestDRLRM-PT (reward machines), DOI 10.1109/ijcnn60899.2024.10650368; node-fragility shaping, DOI 10.3390/electronics13214311Academic pentest RL, cited for context only, not a basis (DRLRM-PT is explicitly named in the project’s standing rule). Reports staged/dense reward helping sample efficiency in small, discrete, formally-specified MDPs (network graphs, no language, no tool-calling) — a structurally different regime, and not where this project’s “staged reward can help” claim rests. That claim’s actual basis is the potential-based-shaping theorem and RUDDER above.N/A — context only

The honest limits — where decomposed training breaks, concretely

The reward-hacking evidence against naive per-stage reward is thick and convergent, not one paper. The moment a “verifier” stops being a deterministic ground-truth check and becomes a learned/judge score, a commonly-observed failure pattern — agents confabulating a plausible-looking FLAG{}-shaped answer once the format-matcher is loose enough to reward the pattern rather than the ground truth — generalizes into a much larger literature:

  • PURE / Stop Summation (arXiv:2504.15275) names the mechanism precisely: the canonical summation-form credit assignment (additive, per-step reward) “easily induces LLMs to hack steps with high rewards.”
  • Reward Under Attack (arXiv:2603.06621) shows SOTA PRMs function as “fluency detectors rather than reasoning verifiers” — >0.9 PRM reward on trajectories with <4% ground-truth accuracy.
  • Gao et al. (arXiv:2410.15115) — combining a learned PRM/ORM with success reward can hurt relative to success-reward-only, via “repeating correct but unnecessary steps.”
  • PRIME’s own authors (arXiv:2502.01456) state the central open problem is that process labels are “prohibitively expensive… making [PRMs] particularly vulnerable to reward hacking,” and route around a separately-trained PRM entirely for this reason.
  • MONA (arXiv:2501.13011, DeepMind) generalizes this: multi-step reward hacking can occur even when no single step looks bad to a human/judge overseer.
  • The ancestor of all of it: the bicycle-shaping failure (Randlov & Alstrom, ICML 1998, pre-arxiv) — a non-potential-based “looks like progress” bonus taught an agent to ride in tight circles farming the bonus instead of reaching the goal. Same species as the loose-matcher confabulation pattern noted above: reward emitting the right-looking pattern rather than deterministically verified success, and the policy learns to farm the pattern.
  • Reward-tampering is a distinct failure mode from everything above — proxy-gaming exploits slack in a soft/learned reward, while tampering means the agent directly subverts the verifier itself, and a deterministic ground-truth verifier does not by itself rule the latter out (Denison et al., arXiv:2406.10162); full argument, the “same shell” gotcha, and the isolation-of-the-verifier fix live in Contested edges & landmines §5.

Ceiling-capping is a real cost of decomposed training too, symmetric to Llama 4’s SFT/DPO warning. HIRO (arXiv:1805.08296) needed an explicit off-policy correction specifically because a high-level subgoal’s meaning drifts as the lower-level policy improves during training — without it, the system converges on subgoals that are locally useful but cap out below the true optimum. Translated to F1–F4: an “exploit-only” sub-policy trained against a synthetic “endpoint identified” subgoal risks converging on the shallowest exploit that satisfies the boundary — which is precisely the F2 shallow-probing failure this project already observes, not a hypothetical.

Academic, cited for context only, not a basis: the domain-specific CTF/pentest training papers named above happen to be monolithic-outcome or curriculum-decomposed rather than reward-decomposed, and the one adjacent paper doing genuine staged reward in an LLM+RL security loop (arXiv:2605.17075) is unreplicated — but neither observation is the basis for caution here. The actual, load-bearing case against naive per-stage reward is the general reward-hacking convergence immediately above (PURE, Reward Under Attack, Gao et al., PRIME, MONA, HIRO) — that literature alone is sufficient to warrant the conditional verdict in §5, independent of what the CTF-training corpus does or doesn’t show.


4. The key split — eval-decomposition vs training-decomposition

This is the load-bearing distinction. They are not the same decision, and the evidence supports very different confidence levels for each.

Eval-decompositionTraining-decomposition
What it meansMeasure per-stage reached/not-reached, on top of the existing flag_verified terminal signalReplace/augment the terminal reward with per-stage rewards, curricula, or hierarchically-trained sub-policies
Training-loop changeNone — a read-only pass over traces already generatedThe reward function, or the training architecture, or both
CostNear-free (one aggregation pass)Real engineering + real risk surface
Evidence for itAgentBoard’s “progress rate” (arXiv:2401.13178, NeurIPS 2024 Oral) — “current evaluation frameworks mostly focus on the final success rate, revealing few insights”; MAST’s 14-mode/3-category taxonomy (arXiv:2503.13657, κ=0.88); AgentErrorTaxonomy — root-cause diagnosis alone (no reward change) buys +24% all-correct accuracy (arXiv:2509.25370); phase-aligned taxonomies independently reinvented in a different (non-security) domain (arXiv:2508.13143); tau-bench’s pass^k (arXiv:2406.12045) — separates “never clears” from “unreliable,” composable with a phase vector. This general, non-security agent-eval literature is the basis for the verdict below on its own. Academic, cited for context only, not a basis: Cybench subtasks (arXiv:2408.08926), AutoPenBench milestones (arXiv:2410.03225), NYU CTF Bench (arXiv:2406.05590), and EnIGMA’s “soliloquizing” fabrication finding (arXiv:2409.16165, ICML 2025) happen to converge on a near-identical F1–F4-shaped split, which is a reassuring coincidence, not evidence this project’s verdict depends on.
Evidence against itNone — every paper that ships it treats it as strictly additive, diagnostic-only, never a substitute for the terminal checkThe 2025–2026 PRM-hacking convergence above (§3); ceiling-capping via HIRO-style subgoal drift. (The observation that domain-specific CTF/pentest training papers are uniformly monolithic when they report strong numbers is academic context only, not part of this basis — see §3.)
Honest limitsMatcher/judge reliability is the new bottleneck one level down — an LLM-judge-scored phase check inherits some of the flag-matcher’s fragility (MAST’s own top category is “task verification” failure); require a corroborating TOOL-kind span, not LLM-only reasoning, for any phase claiming environment interaction. Per-stage sample sizes shrink fast in a funnel — apply the same pass@k confidence-interval discipline already used project-wide. Phase credit can mislead if not cross-checked against the final flag (treat it as diagnostic under flag_verified, never a replacement).Safe only via a provably policy-invariant mechanism (potential-based shaping / RUDDER) — anything softer (a per-step LLM-judge “does this look like competent recon” score) inherits a decade-plus of documented gaming behavior.
VerdictYes, unconditionally, do it now.Conditional — see §5.

The theory’s own framing of why these are different decisions: per-stage evaluation is just better logging — nothing is being optimized against it, so it carries none of the correctness burden. Per-stage reward is where every failure mode above lives, because now something in the loop is being optimized against the signal. This is why the project brief is right to force these into two separate decisions.

The one empirical finding that turns this from philosophy into an operational rule. A controlled study across the RL design space on TravelPlanner finds: “reward and algorithm choices are scale-dependent — smaller models benefit from staged rewards and enhanced exploration, whereas larger models converge efficiently with simpler dense [outcome-only-adjacent] rewards.” arXiv:2603.21972. This is directly checkable via the eval funnel: is the current baseline “occasionally stumbles onto stage 3” (favors staged help) or “reliably reaches stage 3/4, fails to convert” (favors leaving outcome reward alone and attacking execution depth via data/SFT)? The project’s own diagnosis — “largely an execution gap” — leans toward the latter, but this is an empirical call the funnel should confirm, not an assumption to bake in from literature alone.


5. The verdict for this project

QuestionVerdictConfidence
EVAL-decomposition — measure recon / endpoint-discovery / vuln-ID / exploit / pivot independently, on top of flag_verified?Yes. Do it now, unconditionally. Near-free (read-only pass over existing traces), zero effect on training dynamics, independently reinvented by every serious CTF/agent benchmark that hit this problem before this project.High
TRAINING-decomposition — replace/augment the terminal flag reward with four separate per-stage rewards, curricula, or policies?No, not as a wholesale redesign — but a narrow, provably-safe form (potential-based milestone shaping, layered on top of the flag reward, never instead of it) earns its keep once the eval funnel shows an exploration-dominated bottleneck.Medium (conditional, not universal)

The concrete next step this whole verdict depends on

A PTES-based phase matcher schema tagging challenge stages (e.g. ptes.<phase>.steps[] in a challenge’s config) is a natural fit for the general non-security basis in §4 (AgentBoard, MAST, AgentErrorTaxonomy). Academic, cited for context only, not a basis: it happens to structurally resemble the Cybench-subtask / AutoPenBench-milestone design too. What’s missing is aggregation: run a triage pass over completed runs and emit one funnel row per challenge (five phase-reached booleans + an exploit-given-vuln-found conditional rate), rolled up into a corpus-level funnel. This single aggregation is the input every downstream decision below depends on — it settles empirically whether a low solve rate is F1-dominated, F2/F3-dominated, or F4-dominated, which the flag_verified column alone cannot supply no matter how much data accumulates.

  1. Decompose the eval fully, now, unconditionally (§4). Cross with the project’s own pass@k methodology rather than one aggregate pass@5, per tau-bench’s pass^k precedent.
  2. Keep the terminal flag reward as the ground-truth backbone, unconditionally. Nothing in this dossier argues for demoting it below a milestone signal.
  3. Run rejection-sampling SFT on own verified solves as already planned — but keep it light. The general, non-security basis for this move is the frontier self-training line: STaR (arXiv:2203.14465, Zelikman et al. 2022) — the seminal “generate, keep only what’s verified correct, fine-tune, repeat” loop — and ReST^EM (arXiv:2312.06585, Singh et al., DeepMind 2023) — the frontier-lab scaling result showing this expectation-maximization-style self-training on a model’s own correct samples beats training on human data alone, on math/code reasoning, no cybersecurity domain involved. Academic, cited for context only, not a basis: CTF-Dojo and Cyber-Zero report the same pattern (~500 verified trajectories → double-digit gains, no staged reward) inside the CTF/pentest domain specifically — a reassuring domain-match, not the reason to do this. Respect the Llama 4 warning: don’t over-train on the easy/repetitive subset — it narrows the exploration space the subsequent RL stage needs.
  4. Add curriculum sequencing before touching the reward function at all. The single lowest-risk lever available — no new reward, hence none of §3’s hacking surface. Order by whichever axis the funnel identifies as the bottleneck.
  5. Only if the funnel shows an F1 (exploration)-dominated bottleneck, and only via a ground-truth mechanism: add potential-based milestone shaping on top of the terminal reward. Define Φ(s) as a monotonic count of deterministically-verified stage completions (same verification contract the flag oracle already uses — server-side checks, not judge opinions), paid once per stage-transition, never re-collectable. Do not build this for stage 3 (vuln identification) specifically — VPR’s own authors flag exactly this stage-shape (“identify which of several candidates is vulnerable”) as the “open, unstructured” regime their method doesn’t yet solve well; keep that stage eval-only until a genuine deterministic check exists.
  6. Explicitly do NOT build a learned/LLM-judge per-stage reward model. Every citation in §3’s honest-limits section converges on this being the failure mode to avoid.
  7. If the funnel instead shows an F2/F3 (execution-depth / tool-policy)-dominated bottleneck — which the project’s own current diagnosis (“largely an execution gap”) suggests is more likely — the evidence base points away from reward decomposition and toward better trajectory curation and more/better SFT data, not a training-loop change.
  8. When entropy collapses under GRPO (the project’s own stated graduation trigger), watch stage-transition tokens specifically — a badly-shaped milestone reward is an easy, low-entropy shortcut to farm, and would accelerate collapse.

Deliberately not recommended as a first move: standing up four independently-trained sub-policies with four separate critics (the full options/ArCHer/HiPER/FeUdal-style architectural decomposition). Real, actively converging in the literature, and MiRA’s 6.4%→43.0% number is the strongest existence-proof in this whole dossier that monolithic reward can leave a large gap on the table — but every one of these is validated on web-navigation or generic agentic benchmarks with crisp, cheap-to-verify milestones, not on an offensive-security CTF corpus. Highest-upside, least-validated-for-this-domain lever here — a candidate for a later, small, gated experiment, not step one.

The decision, as a diagram

flowchart TD
  Start["Failing challenge / corpus\nunder diagnosis"] --> EvalDecomp["Step 1 — decompose the EVAL\n(PTES funnel, near-free)\ndo this unconditionally"]

  EvalDecomp --> Funnel{"Funnel shows which\nbottleneck dominates?"}

  Funnel -->|"F1: rarely reaches\nthe vulnerable endpoint"| ScaleCheck{"arXiv:2603.21972 —\nweak policy, capacity-limited?"}
  Funnel -->|"F2/F3: reaches it,\nfails to convert / clumsy tools"| Mono["Stay monolithic.\nInvest in trajectory curation +\nrejection-sampling SFT data\n(STaR / ReST-EM pattern)"]
  Funnel -->|"F4: no pivot after\na foothold"| Curric["Curriculum first\n(1-hop before 2-hop pivot chains,\nno reward change)"]

  ScaleCheck -->|"yes — occasionally\nstumbles onto it"| Shape["Potential-based milestone\nshaping ON TOP OF the flag reward\n(Ng/Harada/Russell 1999 — provably\npolicy-invariant), NOT stage 3"]
  ScaleCheck -->|"no — already capable,\njust unreliable"| Mono

  Shape --> Guard["Guard: ground-truth verifier only,\nnever a learned/LLM-judge score\n(PURE / Reward-Under-Attack / MONA)"]
  Mono --> Entropy["Watch entropy at GRPO\ngraduation regardless of path taken"]
  Curric --> Entropy
  Guard --> Entropy

  classDef safe fill:#132b22,stroke:#34d399,color:#eafaf3;
  classDef risk fill:#3a1414,stroke:#f87171,color:#fde8e8;
  class EvalDecomp,Curric,Mono safe;
  class Shape,Guard risk;

Contested point, stated plainly: there exists one paper doing genuine kill-chain-staged RL reward inside an LLM+RL hybrid (arXiv:2605.17075, cyber-defense red-teaming) that on its face looks like support for training-decomposition on an adjacent task. Per the project’s standing rule it carries no evidentiary weight here regardless — it’s academic cybersecurity-LLM work, cited for context only. The Medium-confidence, conditional verdict above does not rest on it; it rests on the general theory (potential-based shaping’s policy-invariance guarantee, HIRO’s ceiling-capping mechanism, the PRM-hacking convergence) and on this project’s own diagnosis. Demoting this citation changes nothing about the verdict.


  • Diagnosing the gap — a scientific framework — the pass@k / Pass@(k,T) / Cover@τ protocol that tells you which gap (knowledge / execution / exploration) a challenge subtype actually has; run this before deciding whether an F1-dominated funnel result calls for exploration-RL or just more samples. That chapter’s routing test and this chapter’s eval-funnel are complementary diagnostics, not competing ones.
  • RL that creates value — long-horizon, exploration, reasoning, novelty — the mechanics of how to fix an exploration or credit-assignment gap once diagnosed here (GiGPO step-level credit, DAPO, entropy instrumentation, ArCHer, curriculum-band filtering) — this chapter answers whether to decompose; that one answers how to execute the fix on the training-loop mechanics.
  • Agentic & multi-turn RL — the missing category — the training-loop shape (turn as the unit of advantage) that any of §5’s mechanisms (potential-based shaping, curriculum) has to be implemented inside.
  • Contested edges & landmines — the “does RL create capability or just amplify it” fight this chapter’s scale-dependence finding (arXiv:2603.21972) directly informs.

Bibliography (all traced to a verified source file, 2026-07-02)

CitationarXiv / DOIRole here
Sutton, “The Bitter Lesson”no arxiv; incompleteideas.netDon’t hand-author structure that plateaus
DeepSeek-R1 / R1-Zero2501.12948Rejects neural PRM at scale; reward-reliability admission
OpenAI Deep Researchsystem card, no arxivEnd-to-end beats manual orchestration
Llama 4 post-trainingai.meta.com blog, no arxivHeavy SFT/DPO caps RL exploration ceiling
Kimi k1.52501.12599Outcome-only + long context beats PRM/MCTS/value-fn
Go-Explore1901.10995 / Nature s41586-020-03157-9Pure outcome RL can structurally fail to find sparse reward
OpenAI Five1912.06680Long-horizon precedent needed huge scale + denser reward
Options framework (Sutton/Precup/Singh 1999)AIJ 112, DOI 10.1016/S0004-3702(99)00052-1Seminal HRL / temporal abstraction
FeUdal Networks1703.01161Manager/Worker HRL, option-collapse fix
ArCHer2402.19446LLM-native 2-level value function HRL
HiPER2602.16165Hierarchical advantage estimation, +6.6–8.3%
MiRA2603.19685Milestone reward, 6.4%→43% WebArena-Lite
Ng, Harada, Russell — reward shapingICML 1999, no arxivPotential-based shaping theorem (policy-invariant)
Müller & Kudenko2502.01307PBRS effectiveness depends on potential scaling
RUDDER1806.07857Learned return-equivalent redistribution
Randlov & Alstrom (bicycle shaping)ICML 1998, no arxivCanonical non-potential-based shaping failure
Sycophancy to Subterfuge (reward-tampering)2406.10162Proxy-gaming vs verifier-tampering distinction; determinism ≠ isolation from agent action space
Verifiable Process Rewards (VPR)2605.10325Safe ground-truth process reward, open-env caveat for stage 3
CM2 checklist rewards2602.12268Checklist-style verifiable sub-criteria
Curriculum Learning (Bengio et al.)ICML 2009, no arxivFoundational curriculum citation
h12510.07312Curriculum + outcome-only, exponential sample-complexity gain
FastCuRL2503.17287Context-length curriculum, entropy-collapse timing
BPO2508.03018Curriculum + rejection-sampling refine, near-identical to project plan
PURE / Stop Summation2504.15275Sum-form PRM hacking mechanism, named
Reward Under Attack2603.06621PRMs as fluency detectors, adversarial hackability
Gao et al., designing RL reward2410.15115Learned PRM+success reward can hurt vs success-only
PRIME2502.01456Authors’ own admission of PRM hacking vulnerability
MONA2501.13011Multi-step reward hacking even with no bad-looking single step
HIRO1805.08296Off-policy correction, HRL non-stationarity / ceiling-capping
AgentBoard2401.13178Progress-rate metric, general capability-decomposition principle
MAST2503.1365714-mode/3-category failure taxonomy
AgentErrorTaxonomy / AgentDebug2509.25370Root-cause diagnosis gains without reward change
Phase-aligned taxonomy (autonomous agents)2508.13143Independent-domain convergence on phase-keyed failure
Cybench (academic — context only, not a basis)2408.08926Subtask decomposition, eval-only — reassuring convergence with AgentBoard/MAST, not evidence relied on
AutoPenBench (academic — context only, not a basis)2410.03225Milestone taxonomy near-matching F1–F4, eval-only — same caveat
NYU CTF Bench (academic — context only, not a basis)2406.05590CTF benchmark family
EnIGMA (academic — context only, not a basis)2409.16165“Soliloquizing” fabrication failure mode
tau-bench2406.12045pass^k reliability decomposition
InterCode-CTF (academic — context only, not a basis)2306.14898Seminal monolithic-reward CTF environment
CTF-Dojo (academic — context only, not a basis)2508.18370Monolithic rejection-sampling SFT, +11.6% — domain-match only; real basis is STaR/ReST-EM below
Cyber-Zero (academic — context only, not a basis)2508.00910Monolithic, simulated env, +13.1% — same caveat
Pentest-R1 (academic — context only, not a basis)2508.07382Two-stage curriculum, monolithic per-stage reward
HackSynth-GRPO (academic — context only, not a basis)2506.02048Outcome-only GRPO sufficient for single-stage CTF
STaR2203.14465Seminal general (non-security) rejection-sampling self-training loop; basis for §5’s SFT-on-own-solves recipe
ReST-EM (“Beyond Human Data”)2312.06585DeepMind frontier-lab scaling result for self-training on own correct samples, math/code domain
Kill-chain-staged reward (red-teaming) (academic cybersecurity-LLM — context only, not a basis)2605.17075The one LLM+RL staged-reward paper, adjacent domain, un-ablated
DRLRM-PT (reward machine, pentest) (academic — context only, not a basis)DOI 10.1109/ijcnn60899.2024.10650368Classical RL, staged reward helps, non-LLM regime
Node-fragility reward shaping (academic — context only, not a basis)DOI 10.3390/electronics13214311Classical dense-reward pentest, non-LLM regime
DAgger1011.0686Compounding error / distribution drift theory
GAE1506.02438Bias/variance dial for advantage estimation
Credit Assignment survey2312.01072Separates credit assignment from exploration
Demystifying long-horizon tool-use RL2603.21972Scale-dependence: staged reward helps weak models only

Method → Data (your real bottleneck)

Your words: “it’s not that we don’t have data; it’s that we don’t know what data we want and what fine-tune we want.” This chapter is the fix, and it’s a single causal claim:

You do not pick data and then a method. You pick the method — by failure type — and the method dictates the data object you must produce.

This assumes the method itself gets picked the right way first: by evidence tier (Start here: a proven-first ranking of the methods), then by gap type (The decision, Diagnosing the gap — a scientific framework). Once the method is chosen, “what data do we want” is answered mechanically. Here’s the mapping:

MethodData object it consumesWhere it comes from
SFT / off-policy distillationfull trajectories from a sourcecurate, or run a stronger model on your challenges and keep its solves
On-policy distillationyour model’s own rollouts, graded per-token by a teacheryour rollouts + a stronger teacher model
Rejection-sampling FTyour model’s own verifier-passed trajectoriesyou already generate these — filter the runs that pass your verifier
DPO(chosen, rejected) trajectory pairs at a decision pointpair a solved run vs a failed run on the same challenge
KTOunpaired trajectories tagged good/badyour solved pile + your failed pile, as-is (no pairing)
GRPO / RLVRprompts + a verify() fn — no fixed datasetyour challenge set + a deterministic verifier
Agentic RLa live environment emitting rollouts + end-of-episode rewardyour harness itself, as a rollout service

Two consequences you can act on immediately:

  • RLVR needs almost no dataset — just challenges + a verifier. You have both. The “data problem” nearly vanishes; the work moves to the reward fn and rollout infra.
  • Rejection-sampling FT needs only your own solves, which you’re already producing. It’s the lowest-friction first move because the data object is a byproduct of running the benchmark — this is a commonly-reported low-friction entry point, not something specific to your setup.

A caution before you take this table as the full picture: it answers “what does one round of this method eat,” not “in what order do rounds run” or “what happens when a later round’s data mixture is wrong.” Those are separate, larger questions answered elsewhere in this book — The recipe is a sequence, not a pick and Is the recipe a loop? establish that these stage-types get revisited across rounds, not produced once; Ordering rules: interleaving stages & fixing N problems is the table for which stage is safe to run after which (off-policy SFT run after on-policy RL can erode the RL gains — check that chapter before scheduling); and Data mixing, ratios & not forgetting how to think is what to read before combining two of these data objects in the same round, so the mix doesn’t erode capability the base model already had.

So the real question isn’t “what data” — it’s “which gap”

The data object is downstream of the gap diagnosis. Do that first (The decision), and the data spec falls out. The diagnostic that routes everything:

Does the correct action ever appear in the model’s own outputs, even rarely, at high sampling N?

  • Never → knowledge gap → you need external trajectories (SFT / teacher / a tool). Data = curated or teacher-generated.
  • Sometimes (a partial-solve regime — the correct action fires occasionally, not never and not reliably; this is a commonly-observed middle state, not an edge case) → execution gap → data = your own rollouts (rejection-sampling) or a verifier (RLVR). You already have both.
  • Mis-ranked → data = good/bad pairs or tagged logs (DPO/KTO). You already have both piles.

In all three of the last cases, you already possess or can trivially generate the data — which is why the instinct that “data isn’t the bottleneck” is usually correct once you’re past the knowledge-gap case. The bottleneck was the method, and the method is chosen by the gap.

The rest of this chapter makes the above concrete: exactly how many “kinds” of SFT-shaped data exist and why they behave so differently (Q1), and exactly what a training row literally looks like for each of the four data shapes you’d actually build from a corpus of challenges + run logs, and how you pick among them (Q2). No jargon left unexplained; every claim is a live-verified arXiv id.


Q1 — “How many types of SFT are there?” (it’s not the algorithm, it’s the data source)

You correctly sensed there’s one algorithm underneath SFT — cross-entropy on “given this input, produce this exact output, token by token” — and that something else is doing all the governing work. That something is where the target text came from. Same loss function, wildly different outcomes, because the training signal is only as good as its source. This is the axis nobody names for you when they say “just SFT it.”

The two axes that actually matter (plus a third, independent, filter)

Axis A — WHO produced the trajectory:

WhoConcretely
HumanA person did the task, or hand-wrote the “correct” trace.
Stronger teacherA more capable model generated it — this is distillation.
The model itself, on-policyThe model you’re training generated it via sampling, and you kept the good ones.
A different model, off-policySome other model (not the teacher, not the student) generated it — a static dataset, or old logs from a stale checkpoint.

Axis B — was it EXECUTED for real, or SYNTHETICALLY AUTHORED? The axis people skip, and the one that matters most for agentic data — full derivation, the who×executed×filtered table, and the dedicated confabulation-mechanism deep-dive live in The kinds of SFT — Axis B / §4. One-line version for this chapter’s purposes: executed/grounded trajectories teach the real conditional relationship between an action and what comes back; synthetically-authored ones teach only the shape of a plausible transcript, and training on enough of the latter makes the model confabulate tool results.

Axis C (independent of A and B) — was it VERIFIER-FILTERED? Was there a check (unit test, flag match, exact-match grader) that threw out the wrong attempts before they hit the training set?

  • Filtered — only successes go in. This turns “the model generated something” into “the model generated something correct.”
  • Unfiltered — everything goes in, right or wrong. Rare for a reason: it reinforces wrong patterns as strongly as right ones.

Mapping your four intuited types, plus the two you’re missing

The full cell-by-cell table (who × executed? × filtered?, six named methods with citations, grounding risk, when to use each) plus the boxed synthetic-transcript warning live in The kinds of SFT — §3 the taxonomy. Same conclusion applies here: your existing corpus of run logs, filtered to verified wins, already sits in that table’s lowest-grounding-risk cell.

For the full method-level treatment of SFT/distillation/rejection-sampling — including the “positives-only causes entropy collapse, graduate to GRPO” gotcha and the production evidence from Llama 2 and DeepSeek-R1 — see Imitation — SFT · distillation · rejection sampling. This chapter stays focused on the data object, not the algorithm.


Q2 — What do I actually make from raw challenges + run logs, in what format, and which do I pick?

You have two raw ingredients:

  1. Challenge definitions — the prompt, the environment, the tools available, the grading/flag check.
  2. Run logs — transcripts of an agent (yours, or a stronger model) actually attempting a challenge, tool call by tool call, ending in pass or fail.

From these two things you can derive four different shapes of training row. They are not interchangeable. Each teaches a genuinely different capability, and reaching for the wrong shape is the concrete mechanism behind “I added more data and the score didn’t move.”

The four forms, at a glance

FormTeachesDerive fromRow shapePick when you observe
1. Agentic trajectory (obs → think → tool_call → tool_result → … → flag)The actual procedure: which tool, in what order, how to read a bad result and recover, when to stopA verified, executed run log — filtered to ones that actually passed the challenge’s own checkMulti-turn chat transcript; one assistant turn per step, tool turns carry the literal real outputModel “solves unreliably” — has the moves, doesn’t chain them consistently, or gives up/loops
2. Knowledge / Q&AStatic facts: what a term/technique/format means, decoupled from any procedureChallenge writeups/hints/solution docs, turned into standalone question→answer pairsSingle-turn chat pair, no tool callsModel never even attempts a whole class of challenge — genuinely doesn’t know the concept exists
3. Tool-usage / function-callingThe interface, in isolation: correct schema, correct argument names/types, which tool to reach forSingle (call → result) slices sliced out of run logs, or synthesized directly from tool schemastools schema + one assistant turn with a tool_calls arrayModel picks the right idea but the call itself is malformed/hallucinated-args
4. CoT reasoningDeliberation: why this action given this observation, before committingAlmost always already inline in form 1’s assistant turns; if missing, retroactively annotatedA short reasoning block immediately before the tool call it justifies — inside the trajectory row, not a separate fileModel reasons about the right concept but picks the wrong action among several plausible ones

Load-bearing subtlety: these four are not four separate files sitting side by side. Form 1 is the natural home for form 4 (interleaved) and incidentally contains many form-3 examples as a byproduct (every tool call in a trajectory is also a valid isolated tool-usage example). Form 2 is the true outlier — a genuinely separate, single-turn shape — and per the curation section below, it’s also the one most likely to be the wrong choice for a small dense model.

This is the expanded version of the “training object” table in What “data” actually means for an agent — that chapter establishes “a demonstration is a trajectory, not an answer” and the loss-masking rule; this section shows you the literal bytes.


Form 1 — Agentic trajectory (the main event)

What it teaches: given the current tool output, pick the next action; given a failed action, recover instead of giving up; recognize when you’ve actually solved it (verified) vs when you merely think you have.

How to derive it:

  1. Take a run log that ended in a verified pass (the challenge’s own flag/test check said yes — not “looks plausible”).
  2. Slice it into the literal turn sequence: systemuser (the task) → repeating (assistant: reasoning + tool_call) → (tool: the real result) → … → assistant final answer.
  3. Do not clean it up or re-author it. A slightly meandering, real path — including a dead end that self-corrected — is more valuable than a hand-polished shortest path, because at inference time the model will also hit dead ends and needs to have seen what recovery looks like, not just success.
  4. If you have several different successful runs of the same challenge (e.g. from sampling at temperature), keep more than one — this is a measured diversity effect (FireAct, arXiv:2310.05915).

Worked example — one literal training row (OpenAI/Llama-3-style tool-calling chat JSON — this is the shape; swap in your model’s exact chat template before you trust it, see the format-must-match-inference rule below):

{
  "messages": [
    {"role": "system", "content": "You are a security agent. Tools: run_nmap, http_get, submit_flag. Find the flag."},
    {"role": "user", "content": "Target: 10.10.1.4. Find the flag."},

    {"role": "assistant", "content": null,
     "tool_calls": [{"id": "call_1", "type": "function",
       "function": {"name": "run_nmap", "arguments": "{\"target\": \"10.10.1.4\", \"ports\": \"1-1000\"}"}}]},
    {"role": "tool", "tool_call_id": "call_1", "name": "run_nmap",
     "content": "PORT   STATE SERVICE\n22/tcp open  ssh\n80/tcp open  http\n8080/tcp open http-proxy"},

    {"role": "assistant", "content": null,
     "tool_calls": [{"id": "call_2", "type": "function",
       "function": {"name": "http_get", "arguments": "{\"url\": \"http://10.10.1.4:8080/\"}"}}]},
    {"role": "tool", "tool_call_id": "call_2", "name": "http_get",
     "content": "<html>...<!-- debug endpoint: /api/v1/debug/config --></html>"},

    {"role": "assistant", "content": null,
     "tool_calls": [{"id": "call_3", "type": "function",
       "function": {"name": "http_get", "arguments": "{\"url\": \"http://10.10.1.4:8080/api/v1/debug/config\"}"}}]},
    {"role": "tool", "tool_call_id": "call_3", "name": "http_get",
     "content": "{\"flag\": \"FLAG{exposed_debug_endpoint}\", \"env\": \"staging\"}"},

    {"role": "assistant",
     "content": "Found it in an exposed debug config endpoint at /api/v1/debug/config on port 8080.",
     "tool_calls": [{"id": "call_4", "type": "function",
       "function": {"name": "submit_flag", "arguments": "{\"flag\": \"FLAG{exposed_debug_endpoint}\"}"}}]},
    {"role": "tool", "tool_call_id": "call_4", "name": "submit_flag", "content": "{\"correct\": true}"}
  ]
}

Notice the tool role content on call_2/call_3 — that’s the literal output the real tool produced in that run log, not a rewritten summary and not a plausible-sounding invention. Losing that grounding is the number-one way agentic SFT quietly teaches confabulation (Q1’s boxed warning).

Loss mask: grade only the assistant turns. Mask (ignore) the system, user, and tool turns — you don’t want to train the model to predict tool output, that’s the environment’s job, and you don’t want to train it to predict the user’s own prompt. Standard practice across the agentic-SFT literature; check your trainer’s loss_mask / train_on_inputs=False setting explicitly — silently leaving it on the whole sequence is a common, quiet bug.

Where this is done at real scale: FireAct, arXiv:2310.05915 and AgentTuning, arXiv:2310.12823 build exactly this shape from ReAct-style transcripts. DeepSeek-R1, arXiv:2501.12948 does the rejection-sampling version of this at scale: cold-start SFT → RL → rejection-sample the RL checkpoint to build ~600K new SFT rows, keeping only correct completions, then a second SFT/RL pass — the closest published description of “run your own agent, keep the verified wins, train on those.”


Form 2 — Knowledge / Q&A

What it teaches: facts and concepts — “what does an exposed debug endpoint typically leak,” “what does this error mean” — the kind of thing a lookup answers, with no multi-step procedure involved.

How to derive it: pull the natural-language writeup/hint/solution text that already exists per challenge (or per challenge class — you want concept coverage, not one row per challenge instance). Turn it into an explicit question a model would need answered before it would even attempt the right move, paired with a concise, correct answer. De-duplicate across challenges sharing a root concept.

Worked example — one training row:

{
  "messages": [
    {"role": "user", "content": "I found an endpoint at /api/v1/debug/config on a web service. What's the risk and what should I check for?"},
    {"role": "assistant", "content": "Debug/config endpoints left enabled outside dev commonly leak environment variables (API keys, DB credentials), internal service URLs, and stack traces. Standard next step: GET it directly (often unauthenticated by mistake) and grep the response for 'key', 'secret', 'token', 'password', 'flag'."}
  ]
}

When to pick this — and when NOT to: only if error analysis on your run logs actually shows the model failing because it doesn’t know a fact exists, not because it can’t act on tools it already understands. This is closer to classic instruction-tuning (Self-Instruct, arXiv:2212.10560) than to agentic training, and for a dense model already scoring meaningfully above zero on an agentic benchmark, most failures at that stage are behavioral (bad sequencing, giving up early, not verifying before submitting) — not knowledge gaps. Don’t reach for form 2 reflexively; see the curation section below for why baking facts into weights is often the wrong fix for a small model in the first place.


Form 3 — Tool-usage / function-calling (isolated, single-turn)

What it teaches: the mechanical skill of calling a tool correctly — right function name, right argument schema, right JSON — decoupled from the multi-step plan.

How to derive it: slice single (context → one tool_call) pairs out of run logs, or synthesize them straight from your tool schemas. This one is safe to synthesize even without real execution, because there’s no tool result being faked — you’re only teaching the shape of the call.

Worked example — one training row:

{
  "messages": [
    {"role": "system", "content": "Tools: run_nmap(target, ports), http_get(url), sqlmap_scan(url, param)."},
    {"role": "user", "content": "Check if the 'id' parameter on http://10.10.1.4/product?id=1 is SQL-injectable."},
    {"role": "assistant", "content": null,
     "tool_calls": [{"id": "call_1", "type": "function",
       "function": {"name": "sqlmap_scan", "arguments": "{\"url\": \"http://10.10.1.4/product?id=1\", \"param\": \"id\"}"}}]}
  ]
}

When to pick this: when the diagnosis is narrow — the model has the right idea but botches the mechanical call (wrong argument names, hallucinated parameters, malformed JSON). Grounded in Gorilla, arXiv:2305.15334 (fine-tuned specifically to cut hallucinated API calls) and ToolLLM, arXiv:2307.16789 (constructs multi-tool call chains by searching for a valid call path, then trains on the validated sequence, and shows the pattern generalizes to unseen APIs — relevant if you expect new tools later). This is a cheap, low-risk fix because it’s format-only, not reasoning-only — don’t reach for a full trajectory rebuild when this narrow slice fixes it.


Form 4 — CoT reasoning (interleaved, not a separate file)

What it teaches: deliberation before commitment — reading an ambiguous observation and reasoning about which of several plausible next moves is right, before calling the tool. The difference between a model that has the right moves but applies them inconsistently, vs one that’s genuinely missing a move.

How to derive it: for each assistant turn in a form-1 trajectory row, prepend a short reasoning block explaining why this action given this observation — either the real reasoning the agent produced live (if your logs capture it) or a short authored rationale bridging observation → action for logs that didn’t. This is STaR’s “rationalization” mode: generate the rationale after seeing the correct answer, keeping the actions/tool-calls grounded while making the reasoning explicit.

Worked example — same trajectory as form 1, with reasoning added:

{
  "messages": [
    {"role": "system", "content": "You are a security agent. Find the flag."},
    {"role": "user", "content": "Target: 10.10.1.4. Find the flag."},

    {"role": "assistant",
     "content": "Start broad: scan for open ports before probing any single service.",
     "tool_calls": [{"id": "call_1", "type": "function",
       "function": {"name": "run_nmap", "arguments": "{\"target\": \"10.10.1.4\", \"ports\": \"1-1000\"}"}}]},
    {"role": "tool", "tool_call_id": "call_1", "name": "run_nmap",
     "content": "PORT   STATE SERVICE\n22/tcp open  ssh\n80/tcp open  http\n8080/tcp open http-proxy"},

    {"role": "assistant",
     "content": "Port 8080 (http-proxy) is non-standard and often hosts admin/debug panels rather than the main app on 80 — check it first.",
     "tool_calls": [{"id": "call_2", "type": "function",
       "function": {"name": "http_get", "arguments": "{\"url\": \"http://10.10.1.4:8080/\"}"}}]}
  ]
}

Do not build a separate, standalone “reasoning dataset” disconnected from tool calls — that tends to produce a model that “thinks well” in the abstract but doesn’t connect the thought to the actual next action. Keep it interleaved inside form-1 rows. Grounded in DeepSeek-R1’s own practice of generating the reasoning trace as part of the same rejection-sampled trajectory, and STaR’s rationalization mode for backfilling rows whose live reasoning was messy or absent.


Pick by diagnosed gap — one table, per challenge cluster

Don’t build all four forms uniformly across the whole corpus. Diagnose each failing challenge (or cluster) first — using The decision / Diagnosing the gap — then pick the form that matches:

You observe in your run logs…Diagnosed gapMake this form
Right idea, tool-call JSON malformed / wrong argsMechanical interfaceForm 3 — small, targeted dose
Calls tools fine, but gives up / loops / doesn’t recover from a bad resultMulti-step procedureForm 1 — the bulk of your training budget
Doesn’t even know the vulnerability class or technique appliesMissing knowledgeForm 2 — small, curated dose, and only after verifying it’s really the gap (see curation §)
Reasons about the right concept but picks the wrong action among several plausible onesMissing deliberation at the decision pointForm 4, layered onto Form 1

In practice, for moving an agentic benchmark meaningfully, the overwhelming majority of your training budget should be Form 1 (full, executed, verified trajectories) — this is what FireAct and AgentTuning both do, and it’s the whole point of the rejection-sampling literature (RAFT/STaR/ReST/ReST-EM): your own model’s verified wins are simultaneously on-policy, executed, and filtered — the single highest-signal, lowest-risk training data you can generate, and you’re already producing it as a byproduct of running the benchmark.


Format must match inference — this breaks silently

This is the single most consequential, least forgiving rule across all four forms, and it deserves its own section because it fails silently, not loudly.

Every row above must be rendered through your model’s actual chat_template — the exact same role markers, tool-call wrapper tokens, and <think>-tag conventions (if your base model uses them) that your serving stack applies at inference time. A mismatch does not throw an error. It quietly degrades output.

  • Hugging Face’s own post on this states it plainly: “Using a format different from the format a model was trained with will usually cause severe, silent performance degradation… this is an especially dangerous issue because using the wrong chat format is a silent error — you won’t get a loud failure or a Python exception.” (huggingface.co/blog/chat-templates)
  • Concrete, repeatedly-reported failure modes: garbled/run-on output because the stop-token position was never learned; format collapse on the first generated token because the training prompt didn’t end exactly where the reply begins; “great eval loss, bad real output” because eval was measured with the training template while production applies a different one; double-templating (manually wrapping messages in role tags AND letting the trainer’s tokenizer re-apply apply_chat_template) silently nests special tokens and corrupts every row.
  • Practical check, before every training run: render one example with tokenizer.apply_chat_template(...), decode it back with skip_special_tokens=False, and eyeball that every role marker / tool-call wrapper appears exactly once per turn and matches what the serving stack will actually feed the model.
  • The loss-mask rule from Form 1 follows the same logic: mask everything except assistant-authored tokens, and keep the end-of-turn/stop token inside the graded region — masking it out is a documented cause of the model never learning to stop generating.

Takeaway: whatever schema you pick for tool calls (tool_calls array, inline <tool_call>{...}</tool_call> tags, whatever your model family uses), it must be byte-for-byte the schema your serving stack presents at inference. Copy it FROM the serving config; don’t invent one independently in a data-prep script.


“Only accept what it needs” — data selection so SFT doesn’t overwrite the model

This is the part that’s cheap to skip and expensive to have skipped. A dense open-weight model already carries broad general capability. Dumping every raw transcript you have at it — full fine-tune, no filter — risks overwriting general capability to fit a narrow domain pattern. Two distinct, separately-cited risks, both real:

1. More data doesn’t reliably mean a better model

LIMA, arXiv:2305.11206 — a 65B model fine-tuned on just 1,000 carefully curated (human-quality) examples matched or beat models trained on orders of magnitude more data. Their own ablation is the load-bearing part: doubling the training set, holding quality fixed, does not improve response quality — but filtering for quality does give a real, measured jump. Their “Superficial Alignment Hypothesis”: most of a model’s knowledge comes from pretraining; SFT mostly teaches it which of its own latent behaviors to surface, in what format. Translated to your setup: quality (did this trajectory actually solve the challenge cleanly, with a sound tool-use trace) and diversity (coverage across challenge types, not raw count of runs) beat volume. Corroborated on filtering specifically by AlpaGasus, arXiv:2307.08701: filtering Alpaca’s 52K examples down to ~9K LLM-judge-scored high-quality ones produced a better model than training on all 52K — noisy examples actively hurt, they don’t just waste compute.

2. Fine-tuning on a narrow domain measurably erodes capability outside it

LoRA Learns Less and Forgets Less, arXiv:2405.09673 — full fine-tuning learns more of a target domain but also forgets more of what the base model could already do outside that domain; low-rank (LoRA/QLoRA) fine-tuning learns less but preserves general capability better, a real measured trade-off, not folklore. If “don’t overwrite what the model already knows” is a hard constraint, this is your citation for choosing LoRA/QLoRA over full fine-tune, or for capping how many full-fine-tune epochs you run. This mechanism is explored in much more depth — including why it fails specifically as reasoning-trace collapse, not generic weight destruction — in Data mixing, ratios & not forgetting how to think; read that chapter before your first real training run, not after a collapse.

The concrete curation recipe

  1. Verifier-filter first, always. Only train on trajectories whose pass/flag check actually succeeded — this alone removes the majority of harmful noise, and it’s the line between “grounded, verified data” and the confabulation risk from Q1’s boxed warning.
  2. Prefer your own model’s verified successes over a teacher’s or synthetic data, when you have them. This is the on-policy-distillation principle generalized: GKD, arXiv:2306.13649 shows training a student on its own sampled outputs (with a teacher only grading, not authoring) beats training on a fixed external corpus, because it avoids the train/inference distribution mismatch off-policy data introduces — the update stays small and targeted instead of force-fitting the model to a different model’s style. A 2026 follow-up sharpens this further: on-policy distillation only helps when the teacher signal offers genuinely new capability beyond what the student already produces — otherwise the update is close to a no-op.
  3. Score what’s left with a cheap filter before accepting it. Two independent, complementary options: an intrinsic, model-own-loss-based filter (Instruction-Following Difficulty, “Cherry” selection — kept just 10% of a dataset and beat training on all of it), or an extrinsic LLM-judge filter (the AlpaGasus method above) that catches quality issues the intrinsic filter can’t, like a correct flag reached via sloppy or lucky reasoning.
  4. Deduplicate and cap per-challenge-archetype volume. If a large fraction of your logs are the same technique (e.g. one vulnerability class solved the same way over and over), training on all of them teaches a surface-pattern shortcut, not general skill — cap examples per archetype.
  5. Reserve a small replay slice of general-purpose data. Injecting even a small fraction of general instruction/knowledge data (unrelated to your challenge domain) into the mix meaningfully arrests forgetting — the mechanism is measured directly in continual-fine-tuning literature; treat a small floor as the minimum and a larger fraction as the commonly-used practical default, and re-verify the exact ratio on your own eval rather than copying a number from a different domain/scale. Full treatment of replay ratios: Data mixing, ratios & not forgetting how to think.
  6. Decontaminate against your eval set before you train. If your raw challenge corpus and your benchmark’s held-out scored set overlap — same vulnerability class, same generator/template family — any training row derived from a benchmark-adjacent challenge risks the model memorizing the answer pattern instead of the skill, inflating the training-set score without inflating actual capability. A simple, reproducible check: n-gram overlap between training rows and eval challenges (the methodology Llama 2, arXiv:2307.09288 §A.6 uses — a token counts as contaminated if it sits in a shared run of more than ~10 tokens between an eval sample and the training set). This is a known, actively-studied reliability problem in the field, not overkill for a small corpus.
  7. Prefer a retrievable tool/RAG lookup over baking pure facts into weights, when the diagnosed gap really is Form 2 (knowledge). A small dense model has limited spare capacity; a lookup retrieves perfectly every time where weight-memorization degrades as the fact-set grows and risks displacing other knowledge. Reserve actual Form-2 training rows for cases where the “knowledge” is really a reasoning pattern wearing a fact’s clothes (e.g. “why is an exposed debug endpoint dangerous” generalizes to endpoints the model has never seen named) — that’s worth baking in because it needs to generalize, not just be looked up. Confidence on this specific framing: medium — it’s standard retrieval-vs-parametric-knowledge reasoning, not pinned to one paper in the notes behind this chapter.

Why this bites harder for a small dense model specifically: every parameter is shared across every skill in a dense model — there’s no unused capacity to overwrite consequence-free, and a smaller model has less raw slack than a much larger one to absorb noise without measurable collateral damage. This is the reason curation isn’t optional polish here — it’s the data-side lever for the exact same problem LoRA addresses on the optimizer side, and the two are complementary, not redundant: LoRA constrains how much the weights move, curation constrains in what direction they’re pushed.



Confidence & citation registry

All arXiv ids below were verified live (title, authors, abstract pulled directly from arxiv.org, not from training-data memory) on 2026-07-02, during the research pass behind this chapter. High confidence on every id’s existence and core claim. Medium confidence on the framing choices that are this chapter’s own synthesis (the 3-axis taxonomy in Q1; the RAG-over-weights framing at the end of the curation section) — flagged inline above, not presented as a quoted claim from a single source. No academic cybersecurity-LLM paper is used as grounding anywhere in this chapter — every citation below is general frontier-lab or ML data-construction/data-selection literature.

idPaperRole in this chapter
2203.02155InstructGPTHuman-demo SFT origin
2212.10560Self-InstructSynthetic-authoring instruction generation
2304.12244WizardLM / Evol-InstructSynthetic-authoring, complexity escalation
2306.11644Textbooks Are All You Need (phi-1)Synthetic “textbook quality” data
1503.02531Distilling the Knowledge in a Neural Network (Hinton et al.)Conceptual root of distillation
1606.07947Sequence-Level Knowledge Distillation (Kim & Rush)Teacher-executed transcript distillation
2306.13649GKD — On-Policy Distillation of LMsMissed type #1; on-policy-vs-off-policy curation principle
2304.06767RAFTRejection-sampling SFT
2203.14465STaRRejection-sampling + rationalization (Form 4 derivation)
2308.08998ReSTIterative rejection-sampling SFT
2312.06585ReST-EM (Beyond Human Data)Iterative rejection-sampling, scaling
2310.05915FireActAgentic-trajectory SFT (missed type #2; Form 1 derivation)
2310.12823AgentTuningAgentic-trajectory SFT (missed type #2; Form 1 derivation)
2501.12948DeepSeek-R1Rejection-sampling at scale; reasoning-trace-in-trajectory practice
2305.15334GorillaForm 3 grounding — reducing hallucinated API calls
2307.16789ToolLLMForm 3 grounding — validated multi-tool call chains
2305.11206LIMAQuality/diversity > volume; Superficial Alignment Hypothesis
2307.08701AlpaGasusLLM-judge filtering beats full-dataset training
2402.04333LESSTargeted, capability-specific data selection
2312.15685DEITA (What Makes Good Data for Alignment?)Complexity/quality/diversity selection axes
2308.12032Cherry_LLM (IFD selection)Cheap intrinsic quality filter
2405.09673LoRA Learns Less and Forgets LessPEFT vs full-FT forgetting trade-off
2502.06042Scaling Laws for Forgetting during Finetuning with Pretraining Data InjectionReplay-slice mitigation, forgetting mechanism
2605.15220Always Learning, Always MixingReplay-ratio practical baseline context
2604.13016Rethinking On-Policy Distillation of LLMsOn-policy distillation only helps with genuinely new teacher signal
2307.09288Llama 2n-gram decontamination methodology (§A.6)
2406.04244Benchmark Data Contamination of LLMs: A SurveyWhy decontamination matters, field-wide
2404.00699LLMSanitizeContamination detection tooling context

Not independently re-verified for this specific pass (mentioned only where they surfaced in the source research, not load-bearing here): none — every id above was verified in the notes this chapter draws from.

Before you train — instrumentation & data readiness

This chapter is a prerequisite, not a fix. Diagnosing the gap gives you the routing test (knowledge vs. execution vs. exploration); behavioral audit → training signal maps observed failure shapes to methods. Both assume you can already say which stage of a run failed. For most agentic RL projects, you can’t — not because the telemetry is missing, but because nobody has written the small amount of code that turns existing telemetry into a stage verdict. This chapter is a general method for answering “what do I already have, and what’s the minimal thing to build first” for your own harness, worked through on a concrete, representative example rather than left abstract.

Everything below is written as a recommendation to hand to whoever owns the harness — the point is the method and the worked example, not a specific diff against a specific codebase. State your confidence per claim; where you can’t confirm something from source, say so.

1. Why per-stage signal is the prerequisite for the whole diagnosis

The diagnosis framework’s routing test — does the correct action ever appear at high N, and does RL (not matched SFT) expand it? — is defined per challenge or per challenge-subtype, not per portfolio. Run it on the portfolio in aggregate and you get one number that averages over four structurally different failure modes (F1 exploration / F2 skill / F3 tool-use / F4 long-horizon), which is exactly the “collapsing a split verdict into one sentence” anti-pattern Diagnosing the gap §0 warns against. You cannot segment a portfolio you cannot localize. Per-stage signal is what turns an aggregate pass-rate delta into “F1 dropped from the dominant failure mode to a minority, F2 is now the dominant failure mode” — the only shape of finding that tells you which lever (SFT curriculum, tool-use reward, RL exploration term) to pull next.

flowchart LR
    A["event stream<br/>(already emitted)"] --> B["stage extractor<br/>(usually NOT built)"]
    C["per-challenge manifest<br/>(usually NOT built)"] --> B
    B --> D["F1-F4 attribution<br/>per run"]
    D --> E["Diagnosis framework<br/>routing test, per subtype"]
    E --> F["method choice:<br/>SFT curriculum / tool reward / RL exploration term"]

2. What a typical harness already emits — confirm this by source read, don’t assume it

Source: your event-schema module, the code that wires event emission into the agent loop, and whatever doc of record you maintain for the observability contract. In a harness worth building this method on, every event is turn-indexed and tool-call/tool-result pairs join on a stable call id — this is the load-bearing fact that makes any stage-localization script possible with zero changes to the agent loop. If your harness doesn’t have this property yet, that’s the actual prerequisite, ahead of anything below.

EventWhat it carriesStage-attribution value
preamble (run metadata / tool schemas / system prompt / task string)trace id, model, action space, task stringRun identity; needed to join against a per-challenge manifest
run-start{input}“Did the agent do anything” — trivially free
turn-start{history_len}Per-turn anchor
model-responserole/content/reasoning, tool calls, token usage, TTFT/latency, finish reasonReasoning text — usable for context, never as stage-reached evidence (confabulation risk)
tool-call{call_id, name, args}The command actually issued — args is often a raw string (bash/curl/etc.), not a structured HTTP call
tool-result{call_id, name, output, exec_ms, error?}The real, server-observed response text — this is the only tier that counts as ground truth
run-finishstop_reason, turns/max_turns, finish_reasonDistinguishes “ran out of budget” (max_turns) from “gave up” (stop) from silent truncation (stop_reason=stop but finish_reason=length — don’t trust stop_reason alone)
terminal-check (e.g. flag/solution scan){solved, primary?, retrieved[], findings[{value, origin, first_event, first_turn?}]}Terminal outcome, provenance-classified (retrieved/echoed/model_claim)

Tool surface bounds what a “stage” can even look like: a small, fixed action space (shell exec, file read/write, web search — the usual set for an agentic security or ops harness, confirmed from your own tool registry) with no structured http_request-shaped tool call is the common case. All HTTP interaction with a target is then embedded in free-text shell commands and free-text shell output — there is no machine-readable status/URL/body field. This is the single biggest reason “endpoint discovered” and “vuln identified” are not already derivable cleanly in most such harnesses — any stage parser must regex/parse free text, not read a field.

Confidence: high, if and only if you’ve done the source read — this table is a template; verify it against your own event schema, don’t assume it transfers.

3. Per-stage ground-truth verifier design

3.1 What already satisfies “ground-truth-verified, never transcript-matched”

The common non-negotiable rule for RL on agentic tasks — reward from real environment/tool-output state, never format/regex-matched on the transcript — is usually already met at the terminal (success/flag) stage and nowhere else:

  • A deterministic flag/solution scanner classifies every success-string sighting as retrieved (in a tool-result, absent from that call’s own args) / echoed (present in both) / model_claim (only in model text). This is a provenance signal — it proves the string came back from the environment, not the model’s mouth — but is not a byte-compare against the real, known-good answer. A retrieved value from a decoy or off-target leak still reads solved:true.
  • The actual byte-compare against a held-out ground truth (call it a verified check, distinct from retrieved) typically lives outside the agent runtime: a tracked ground-truth file plus held-out reference solvers per challenge. Verifying against these is often a manual, credential-gated, human-authorized step — not wired into the harness or any automated post-run check. Grepping the harness source for that verification concept and coming back with zero hits is a common, confirmable finding — a real absence, not a naming mismatch.
  • Documented failure modes any pre-terminal verifier must not reproduce: model-claim fabrication after repeated errors (a fine-tuned model claiming solves that a replay disproves is a recurring, real failure mode); a hardcoded success-format regex producing false negatives on an off-format but genuine success string; a points-inflation gap between a cheap proxy signal and the actual verified signal on a leaderboard.

3.1a Tamper-isolation requirement (not just determinism)

Determinism (§3.1) stops proxy-gaming but not reward-tampering — an agent with tool/shell access can subvert the verifier itself, not just the signal it scores (see contested.md §5 for the Denison et al. finding and the isolation requirement). The operational consequence for this harness: whenever your terminal/stage scanner is file- or process-based (reads the event log, reads sandbox tool output) and reachable by the same shell the agent uses to solve the challenge, it must additionally verify from env state the agent cannot write, out-of-band (e.g. the held-out reference solver plus ground-truth file living outside the agent runtime, per §3.1) — not merely a deterministic scan over artifacts the agent’s own tool calls can touch.

3.2 The proposed per-stage predicate design

Phase names below follow a standard penetration-testing execution phase taxonomy (recon → enumeration → detection → exploitation → lateral movement), mapped onto an F1–F4-style failure taxonomy. The mechanism is a direct reuse of the terminal scanner’s proven shape: a pure, read-only, post-hoc scan over the event stream — no new sandbox instrumentation, no changes to the agent’s execution path.

StageMaps toWhat real state proves itHow checkableRobustness
reconpre-F1A request reached a known recon surface and got a responsetool_result exists for a tool_call whose args path matches a per-challenge recon-surface allowlistCheap + robust
enumerationF1 (never finds vuln endpoint)A request’s method+path matched the vuln-bearing route, regardless of payload correctnesstool_call.args path/method vs. a per-challenge allowlist lifted from the reference solverCheap + robust — automates the by-hand method you’d otherwise use to eyeball discovery-vs-exploit failures
detectionF1/F2 boundaryResponse shows diagnostic evidence of the specific bug class (error, type-confusion tell, introspection leak)tool_result.output vs. a per-challenge, bug-class-specific signatureHard/ambiguous — bug-class-specific; recommend optional/best-effort in v1, fold into “enumeration reached, exploitation not yet” if no clean signature
exploitationF2 (finds, can’t exploit)The payload actually worked — server-side artifact only possible on success (token, row leak, shell banner)tool_result.output vs. the exact success predicate already written in that challenge’s reference solver (verbatim reuse — this IS the ground-truth oracle)Cheap + robust when the exploit yields one identifiable artifact; coarser (any-200-on-payload) proxy where it doesn’t
lateral / terminalF4 + terminalSecond request in a bypass→success chain returned the success valueterminal-check retrieved, verbatimAlready built — zero new work, if your terminal scanner already exists
(cross-cutting, not a stage)F3 (clumsy tool-use)Tool-call diversity / purpose-built tool vs. improvised shell one-linerCount distinct tool_call.name, or classify args against a purpose-built-tool allowlistDoes not fit the stage ladder — log as a separate metric, do not fold into a potential function (see §3.3)

Two things this design deliberately does NOT do, because both violate the common reward rule above:

  • Does not reuse an LLM-judge / rubric-matcher mechanism, even if one already exists in your challenge-authoring tooling. Such a mechanism is explicitly a judge (“a span satisfies a matcher when the description’s intent is met, not merely when the regex matches”) — a mid-tier rung on the reward-gameability ladder, and in practice most of your live challenge roster won’t even carry the metadata file that mechanism depends on. Use phase names from that convention if you like; don’t reuse its judging mechanism.
  • Does not treat free-text “intent” capture fields as evidence of “identified the vuln.” If your harness has an opt-in reasoning/intent-capture field, treat it as documented observability metadata, low-faithfulness, off by default, and strip it before any training use.

3.3 Potential-based shaping — the caveats if this ever feeds RL reward

If a stage-scan result is ever turned into dense RL signal (rather than just a diagnostic readout), the only shaping form proven not to change the optimal policy is F(s,a,s') = γΦ(s') − Φ(s) for any potential function Φ — Ng, Harada & Russell, “Policy Invariance Under Reward Transformations,” ICML 1999 (no arXiv id — this predates arXiv’s routine ML use; ACM DL 10.5555/645528.657613, verify live before depending on this citation). Two subtleties are easy to get wrong:

  1. Φ must be a monotone “best stage reached so far” running max, not the instantaneous current-turn stage — otherwise re-triggering an already-reached signature, or a later turn’s evidence going quiet because the agent moved on, can pay a spurious negative shaping reward for forward motion.
  2. Φ must be defined identically across every terminal branch (stop_reason{stop, max_turns, error}, all real values in a typical harness) — otherwise the invariance proof breaks across the different termination paths variable-length episodes actually produce. Recommended sidestep: apply shaping only over non-terminal transitions; let the terminal reward (unchanged) carry all outcome signal at the very last transition.

Domain-adjacent SOTA, verify live before depending on this table — as of this writing none tick all three boxes (domain-specific + proven invariant + validated against a ground-truth terminal verifier), so this remains an unfilled niche, not a solved-elsewhere problem. Treat any cybersecurity-LLM-training paper you cite here as context, not as a basis for a specific claim/recipe/verdict, unless it produced a frontier-comparable model — academic domain papers are cited for the shaping idea, not as evidence the design below is validated.

PaperarXivRelevanceConfidence
TIPS — turn-level potential shaping for search-augmented LLMs2603.22293Shaping machinery is directly on-point; domain (search-QA) is not0 citations, brand-new — promising, not validated
ToolRL — reward design for tool-use RL2504.13958Closest prior art on reward granularity/timing for tool-use RL; not potential-based1 citation
Pentest-R1 — two-stage RL for autonomous pentesting (academic cybersecurity-LLM training paper — cited for context, not a basis for the recommendation)2508.07382Domain topic overlaps — a per-step reward in an interactive CTF env (InterCode-CTF); exact shaping formula not fully verified from search highlights alone — flag as unread in full0 citations, brand-new
DRLRM-PT — Reward Machine over kill-chain phases (academic cybersecurity-LLM training paper — cited for context, not a basis for the recommendation)2405.15908Illustrates a non-potential-based design (flat +1/+10 phase bonuses, no γΦ(s')−Φ(s) structure) — cited only to warn against conflating “reward machine over phases” with “provably invariant shaping”Medium

Recommended default if this is built: keep the terminal reward and the dense stage-shaping term as two separate additive components, never merged into one function — this is both what makes the invariance argument clean (Ng, Harada & Russell, ICML 1999, cited above) and what a decoupled dense-process-signal + sparse-ground-truth-outcome-signal reward-design doctrine independently favors.

Confidence: high on the harness-reuse mechanism and the Ng et al. invariance result itself (25-year-old, well-established). Medium on the “running-max Φ” / “terminal-consistency” recommendations — applied reasoning from the theorem plus a variable-horizon episode shape, not lifted verbatim from a paper.

4. What training/eval data you already have, per candidate move

Scope: your git-tracked benchmark assets plus wherever the actual trajectory takeouts live (a local run-artifact directory, object storage, or both). If your project has been running sweeps for a while, on the order of hundreds to low thousands of individual agent trajectories across many distinct challenge definitions likely already exist — this is a mining problem, not a collection problem, for most of the four candidate moves below.

Candidate moveReadinessExtraction stepSharpest gotcha
(i) Rejection-sampling SFT positive setOften a few hundred raw solved trajectories spread across several corpora of varying cleanliness; if a prior SFT run already exists, it likely used exactly this recipeVerifier-accepted terminal only → replay-reproduce → dedup → decontaminate → Thought/Action/Observation with Observation loss-maskedConfirm, don’t assume: a prior SFT that fabricates a nontrivial fraction of claimed solves under replay is a documented, recurring failure — naive success-folder collection teaches success-shape, not success
(ii) KTO/DPO pairsKTO-native data is ready today for free — every success/failure split is an unpaired good/bad label (mechanical, zero judgment calls). True DPO (same-decision-point divergent pairs) needs k≥2 same-challenge same-model runs — usually only a small canonical sweep has this; the larger pools are typically k=1Label KTO now; if DPO is wanted, mine the k≥2 sweep, don’t re-sweep the k=1 poolsDon’t default to DPO just because solve/fail piles exist — an escalation ladder (fix tool description → prompt guidance → action-space → better base → SFT → DPO/KTO → RL) should gate the choice first
(iii) Per-stage eval (F1–F4)This is the actual gap, in most projects. A phase-attribution tagger over a kill-chain-style taxonomy is a known, commonly-implemented pattern for agentic pentesting evals — you may find a sibling team or a public writeup that’s built one over a different corpus and model family, but nothing equivalent for your own roster, and it’s rarely open-sourced or present anywhere in a given repoBuild a lightweight classifier over the existing tool-call/tool-result stream, scoped to your ground-truth-backed corpus first — a minimal version is sufficient (no tool-tier/contamination/recovery-shape analyzers needed for internal F1–F4 attribution)Don’t import headline phase-distribution numbers from an external audit as if they describe your own models — pivot/stall rates are known to vary widely by model family and benchmark, so treat any outside number as a prior to check, not a fact to inherit
(iv) Credit-assignment tracesOften the best-instrumented axis in the inventory — every run in every corpus typically carries the full per-turn event streamCall-id-paired parsing is a solved extraction problem once your terminal scanner already demonstrates the patternTurn-level “did this action retrieve the success value” ≠ “was this turn part of a coherent minimal solve path” — a replay-reproduce check proves an action sequence is causal, not that recorded reasoning spans are faithful narration (a distinct, unaddressed reasoning-distillation risk)

Cross-cutting gotchas that apply to all four moves:

  • Ground truth typically exists for only a minority of your corpora. Corpora without a held-out success file have only the harness’s own retrieved classification as their “solved” signal — a weaker epistemic tier than exact-match. Flag this explicitly in anything built downstream of them.
  • retrieved (tool-result-not-in-own-args) is a strong genuineness signal but is still transcript-level heuristic, not an out-of-band verifier query — the common reward rule is not automatically satisfied just because the harness flagged something retrieved.
  • Reconcile any “raw completed count” against a separately-cleaned count before using either quantitatively — a stale local mirror silently diverging from the canonical cleaned number is a common, easy-to-miss trap.

Confidence: high on the general shape of this inventory-and-readiness exercise; the specific counts above are illustrative, not a stand-in for your own numbers — row-count your own corpora directly before using any number quantitatively.

Collapsing §2–§4 into one actionable delta: in most agentic-RL projects, the harness’s process telemetry is already complete for stage attribution. Nothing in the event-emission or agent-loop code needs to change. What’s missing is entirely semantic, and it splits into two independent, additive pieces of work that correctly sit on different sides of a harness/content ownership boundary:

flowchart TD
  A["Pick ONE representative challenge<br/>(one with a fully documented<br/>solve chain)"] --> B["content owner:<br/>author stage_oracle.json<br/>from the reference solver — a<br/>handful of predicates,<br/>editorial work, not infra"]
  A --> C["harness owner: write a<br/>stage-scan module,<br/>same shape as the terminal scanner —<br/>pure io.Reader -> StageScan,<br/>no side effects"]
  B --> D["Run the stage scan over existing<br/>event logs from already-<br/>collected runs"]
  C --> D
  D --> E["Validate: does the stage vector<br/>match what a human reading<br/>the same trace concludes?<br/>(same discipline as the terminal-<br/>scanner validation)"]
  E -->|"holds"| F["Generalize to the rest of the<br/>ground-truth-backed corpus,<br/>then the larger unlabeled pools"]
  E -->|"doesn't hold"| G["Refine predicates before<br/>trusting any F1-F4 number"]
  1. Harness side: a deterministic (no-LLM, no-confabulation) URL/path extractor over tool_call.args
    • tool_result.output, scoped to the shell/exec tool only. Emit as a derived per-run artifact, not a new harness event — keeps the harness itself free of challenge-specific semantics.
  2. Content-authoring side: one stage-oracle file per challenge — one entry per phase, each a deterministic predicate over (method, path_regex, status_code, body_signature), authored directly from that challenge’s own reference solver. This is editorial work (one person reads each reference solver and writes a handful of predicates), not new infrastructure — the ground-truth reference already exists, it’s just not lifted into a machine-readable file.
  3. Prototype on ONE challenge before committing to the whole roster. Pick whichever challenge already has its solve chain fully narrated in prose elsewhere in your notes — its reference solver’s own success checks (e.g. a status-code-plus-token-field check for a bypass step; a success-string regex on a follow-up endpoint for the pivot step) are directly reusable as the exploitation-stage and lateral-stage predicates verbatim. Run the prototype over runs already sitting in your existing results store — no new sweep needed to validate the mechanism.
  4. A narrower, more concrete companion gap on the terminal side: turn a retrieved classification into a true verified boolean via an offline exact-match diff against your already-tracked ground-truth file, for the subset of your challenge roster that has one. This needs no live credentials, no manual step, and closes the one place today’s “ground-truth-verified” claim is actually a provenance proxy.

None of this requires RL infrastructure, a new sandbox tool, or a change to the agent’s execution path — it is a read-only scan over data that already exists, validated against traces already collected, before any RL/RLVR reward design depends on it.

The path to a frontier cybersecurity model

Every other chapter in this book resolves a method question for your current bottleneck (SFT vs GRPO, monolithic vs decomposed reward, which exploration fix). The recipe is a sequence, not a pick makes the same point this chapter’s §2 skeleton depends on, one level down: it’s never a technique choice, it’s a fixed, ordered sequence of stages that compound. This chapter zooms out to the north star those decisions serve: not “improve pass@k on your challenge set” as an end in itself, but a frontier cybersecurity model — the offensive-security analog of what DeepSeek-Coder, Qwen-Coder, and DeepSeekMath are to code and math. It asks the harder question every other chapter brackets: even if The decision’s routing tree is answered correctly and roadmap-inputs.md’s forks are all resolved well, does that alone produce a frontier model? The honest answer, argued below, is no — it produces a materially better agent on your own portfolio, which is necessary but not sufficient. This chapter is the capstone that says what else the word “frontier” actually requires, stage by stage, and where you genuinely already stand on that ladder.


1. The frame — what “frontier” means here, and why academic-security is the wrong template

“Frontier” is not a vibe or a marketing word here — across every domain-specialization lineage examined below (code, math, medical), it tracked the same three things simultaneously, never just one: (1) a strong general, already-agentic starting checkpoint, not a small model fine-tuned harder; (2) a domain RL stage with an ungameable, automatically-computable verifier at scale; (3) infrastructure investment matched to the RL stage’s actual bottleneck — which turns out to be environment count and diversity, not bigger GPUs for pretraining. A model that is merely “instruction-tuned on curated domain data” (Med-PaLM v1’s prompt-tuning-only recipe, arXiv:2212.13138) is a domain assistant, not a frontier domain model — the field’s own vocabulary distinguishes these, and you should too.

This is why the standing stance here treats academic cybersecurity-LLM papers (CTF-Dojo, Cyber-Zero, Pentest-R1, HackSynth, AutoPenBench, DRLRM-PT, and siblings) as mention-only, never load-bearing: none of them has produced a model that clears the bar above. They are useful as landscape context, occasionally as a source of a technique name worth knowing, but citing them as the basis for a claim about what a frontier cyber model requires would be citing evidence that has never once been tested against the thing it claims to predict. Every load-bearing claim in this chapter instead rests on (a) frontier-lab flagship and domain-specialization disclosures — code, math, medical, and general-agentic recipes, 2023–2026; (b) general RL/ML theory (scaling laws, potential-based reward shaping, reward-hacking mechanics); (c) your own measured data and confirmed lessons. Where a genuinely production, externally-verified cyber-specialized system exists outside the academic set (XBOW, Bugcrowd) it is admissible under clause (a) as a domain-specialization precedent, exactly like Code Llama or Med-PaLM — and is flagged as such, never folded in with the excluded academic set.


2. The transferable frontier domain-specialization recipe

Cross-referencing the code lineages (DeepSeek-Coder → DeepSeek-Coder-V2, Qwen2.5-Coder → Qwen3-Coder-Next), the math lineage (DeepSeekMath → Qwen2.5-Math → DeepSeek-Prover-V2), and the medical contrast vertical (Med-PaLM → Med-PaLM 2 → MedGemma), one skeleton recurs with variation in emphasis but is never fully absent. A fifth stage — mid-training — is a distinct, more recently named bridge stage the code/math lineages ran informally but only OLMo 2 and a 2025 controlled study give a name and a mechanism to (arXiv:2501.00656, arXiv:2510.14865).

flowchart TD
  P["Pretrain\n(inherited — a strong general/\nagentic open-weight checkpoint,\nnot trained here)"] --> S0

  subgraph S0["Stage 0 — Domain continued pretraining (CPT)"]
    direction TB
    S0A["100B-5.5T in-domain tokens,\nfrom a STRONG checkpoint, never from scratch\nCode Llama ~500B code tokens\nDeepSeekMath 120B math tokens\nQwen2.5-Coder 5.5T code tokens"]
  end

  S0 --> S05

  subgraph S05["Stage 0.5 — Mid-training (the named bridge)"]
    direction TB
    S05A["5-10% of pretrain FLOPs, curriculum-shaped,\nupsampled high-quality + synthetic patches\n'infuse knowledge, patch deficiencies'\n(OLMo 2); reduces catastrophic forgetting\nbefore SFT (2510.14865)"]
  end

  S05 --> S1

  subgraph S1["Stage 1 — Domain SFT / data synthesis,\nincreasingly SELF-BOOTSTRAPPED"]
    direction TB
    S1A["Rejection-sampling + iterative co-evolution:\nQwen3-Coder used Qwen2.5-Coder to clean its\nown next-gen data; Qwen2.5-Math co-evolved\nRM+SFT across rounds; DeepSeek-Prover-V2\nstitched subgoal-decomposed traces"]
  end

  S1 --> S2

  subgraph S2["Stage 2 — Domain RL, verifier-gated\n'hard to solve, easy to verify'"]
    direction TB
    S2A["GRPO / RLVR, no critic, group-mean baseline\n(origin: DeepSeekMath); scaling axis that\nmattered most = PARALLEL RL ENVIRONMENTS\n(Qwen3-Coder: 20,000), not model size"]
  end

  S2 -.->|"cross-cutting, every stage"| S4["Data-pipeline + scale engineering\nas a first-class investment\n(Qwen2.5-Coder: curation > scale;\nStarCoder2/Stack-v2: quality substitutes\nfor parameter count)"]

  classDef stage fill:#132b22,stroke:#34d399,color:#eafaf3;
  classDef cross fill:#3a2e14,stroke:#f5b942,color:#fff6e0;
  class P,S0A,S05A,S1A,S2A stage;
  class S4 cross;

Reading the skeleton stage by stage, cited:

  • Stage 0 — domain CPT. Every recent frontier vertical lineage continues pretraining from an existing strong checkpoint — never truly from scratch (DeepSeek-Coder v1’s from-scratch 2T-token run, arXiv:2401.14196, is the sole exception in this set, and even DeepSeek abandoned it by v2, arXiv:2406.11931). Cross-domain transfer is itself a load-bearing finding, not noise: DeepSeekMath deliberately starts from a code base (arXiv:2402.03300) for a math specialist, because precise multi-step symbolic reasoning transfers — argues a cyber CPT stage, if built, should start from a model already strong at general coding/tool-use/agentic reasoning, not a generic chat model.
  • Stage 0.5 — mid-training. OLMo 2 names this explicitly as “Stage 2: Mid-training (5–10% of training FLOPs)… upsample the highest-quality web documents and curated non-web sources; employ synthetic data crafted to patch math capabilities” (arXiv:2501.00656). A 2025 controlled study formalizes the mechanism: mid-training outperforms continued-pretraining-alone at a matched specialized-token budget and mitigates catastrophic forgetting in the subsequent SFT stage, because it acts as a better initialization for post-training rather than just adding knowledge (arXiv:2510.14865, moderate-high confidence — recent, not yet heavily cited, but consistent with and explaining the OLMo/Llama-3/DBRX practitioner reports it’s built on).
  • Stage 1 — self-bootstrapped SFT/data synthesis. The frontier pattern has moved past “filter and train once”: Qwen3-Coder used the prior generation (Qwen2.5-Coder) to clean and rewrite its own next-generation pretraining data (blog disclosure, no standalone arXiv for the 480B flagship — the architecture is covered by arXiv:2505.09388; the agentic-RL successor, Qwen3-Coder-Next, is arXiv:2603.00729). Qwen2.5-Math (arXiv:2409.12122) co-evolves a reward model and SFT data across rounds before RL is even applied, then reuses the same RM at inference for best-of-N reranking. DeepSeek-Prover-V2 (arXiv:2504.21801) decomposes a hard problem into subgoals, solves each with a cheaper model, and stitches the resolved subgoals into a single cold-start trajectory — a direct precedent for treating a long-horizon CTF episode’s implicit stages (recon → foothold → priv-esc → flag) as subgoal-decomposable SFT-construction material, even while the RL reward itself stays terminal-only for ungameability. For the general (non-cyber) chat/tool-use/reasoning/preference data that fills this same SFT rung before any cyber-specific data is layered on, see Proven post-training datasets — a usage-cited registry.
  • Stage 2 — verifier-gated RL. This is where GRPO was born: DeepSeekMath’s own framing attributes math capability to two factors — a web-data mining pipeline, and Group Relative Policy Optimization, a critic-free PPO variant using the sampled group’s mean reward as the baseline (arXiv:2402.03300). Qwen3-Coder’s post-training explicitly names the reward-design principle “hard to solve, easy to verify,” and its own headline scaling axis wasn’t a bigger model, it was 20,000 parallel RL environments for the long-horizon agentic RL stage. DeepSeek-Prover-V2 runs the same pattern with Lean’s type-checker as a binary, ungameable reward — structurally identical in spirit to a terminal flag verifier.
  • Cross-cutting — data-pipeline engineering as its own investment. Qwen2.5-Coder’s whole story is “meticulous data cleaning, scalable synthetic data generation, balanced data mixing” beating larger models on the same benchmarks purely on data quality/composition. StarCoder2/The Stack v2 (arXiv:2402.19173, included as a data-pipeline lesson only — flagged explicitly as not a frontier-capability reference point) independently confirms curation-quality substituting for parameter count from a second source.

The medical contrast (mentioned, not a basis for cyber claims): Med-PaLM v1’s prompt-tuning-only recipe (arXiv:2212.13138) shows the cheap-adaptation-of-a-frozen-giant path is not sufficient on its own — the paper’s own human-eval gap (factuality, harm) motivated Med-PaLM 2 (arXiv:2305.09617, domain instruction fine-tuning + ensemble refinement) and MedGemma (arXiv:2507.05201, domain vision-language pretraining + task-specific fine-tuning, explicitly disclosed as not clinical-grade without further fine-tuning). The useful lesson by contrast: for a binary, adversarial correctness domain like offensive security (a wrong action doesn’t mislead a reader, it fails the exploit), a v1-style prompt-tuned ceiling is lower than in code/math — supporting the existing bias here toward continued adaptation + RLVR over prompting alone.


3. The frontier ingredients, as requirements

Restating the seven-ingredient survey as a checklist of what “frontier” actually costs, independent of any one domain:

#IngredientWhat frontier scale actually looks likeConfidence
1Compute + scale lawLoss falls as a power law in model size × data × compute; the ratio matters (Chinchilla-optimal ≈ equal scaling of params and tokens, not param-dominant) — Kaplan, arXiv:2001.08361; Hoffmann/Chinchilla, arXiv:2203.15556High — foundational, independently reproduced
2Data scale + quality + curation5–15T+ curated tokens is the pretraining norm (DeepSeek-V3, arXiv:2412.19437; Llama 3, arXiv:2407.21783) — or the phi-1 extreme: curation quality can substitute for ~100x less scale within a narrow domain (arXiv:2306.11644), though that ratio is an upper bound, not a universal ruleHigh for the scale rows; moderate on how far the “quality substitutes for scale” ratio generalizes
3Domain CPT before post-training120B–5.5T in-domain tokens continued-pretrained into an existing strong base, before any instruction-tuning/RL — not a thin adapter on the base chat model (Qwen2.5-Coder 5.5T+, DeepSeekMath 120B, Med-PaLM 2’s domain finetuning)High — three independent labs, primary technical reports
4Mid-training as a named bridge stageA shorter (5–10% FLOPs), curriculum-shaped stage between broad pretraining and narrow post-training that patches domain deficiencies cheaply and reduces forgetting — OLMo 2, arXiv:2501.00656; arXiv:2510.14865High (OLMo 2); moderate-high (mechanism study, new)
5RL-environment scale, diversity, verifiabilityThe reasoning/agentic jump to o1/R1-class models is attributed to large-scale RL with verifiable, not learned, rewards, not more pretraining — DeepSeek-R1, arXiv:2501.12948; OpenAI o1 system card (arXiv mirror 2412.16720); environment diversity/scale is its own axis, distinct from reward correctness — Kimi K2’s “tens of thousands” synthesized-tool pipeline (arXiv:2507.20534); framed as an emerging bottleneck by arXiv:2511.09586High (R1, o1, Kimi K2); moderate on the survey’s “emerging bottleneck” framing specifically (new, low-citation)
6Full pipeline vs. thin adapterLoRA measurably underperforms full fine-tuning specifically on code/math domain-skill acquisition — full fine-tuning learns perturbations at 10–100x the effective rank of typical LoRA configs — arXiv:2405.09673High — controlled, ablated, >250 citations in 18 months, directly on-domain
7Eval reflects reality, not a saturated benchmarkClassic benchmarks are contaminated enough to inflate scores by up to 22.9%/19.0% (GSM8K/MMLU) — arXiv:2406.13990; frontier practice responds with contamination-resistant-by-construction benchmarks: time-segmented LiveCodeBench, arXiv:2403.07974, “Google-proof” GPQA, arXiv:2311.12022; Tülu 3, arXiv:2411.15124 treats decontamination as a first-class deliverable, and is also the primary public naming of RLVRHigh — all four primary, independently corroborating

Net read of §2+§3 together: compute/scale (ingredient 1) is inherited from the base model’s own pretraining — not something you need to re-derive. Ingredients 3–4 (CPT, mid-training) are the stages your plan may currently skip by design (e.g. a “knowledge in tools, not weights” rule), a defensible bet but an unvalidated one at the CPT/mid-training layer specifically. Ingredient 5 (RL-environment scale/diversity/verifiability) is where you are likely closest to the frontier pattern already — see §5. Ingredients 6–7 (full pipeline vs. adapter, eval integrity) are concrete, checkable knobs, not open research questions.


4. Gap analysis — the frontier recipe vs. your case, stage by stage

One-line verdict: if you’ve correctly identified the shape of the frontier recipe — harness as a live RL environment, ground-truth verifiable reward, rejection-sampling SFT → GRPO/RLVR ordering, “knowledge in tools not weights” — you may have already built the two hardest structural pieces: a working long-horizon agentic harness and a genuine, non-gameable terminal verifier. What’s typically not built is scale on every other axis, plus a pretraining-adjacent stage skipped entirely (domain CPT / mid-training) that every cited frontier domain-specialization precedent inserts. The gap is usually 1–5 orders of magnitude on breadth, not a missing insight on direction.

Frontier-recipe stageHavePartialMissing
Stage 0 — Domain CPTNothing — explicit design choice (“knowledge in tools, not weights”), not oversightThe “knowledge in tools” architectural bet is coherent but unvalidated at this layer — the commonly-observed tool-bypass failure mode (agents defaulting to raw shell/HTTP calls over provided higher-level tools — tool-selection reliability is itself a documented weak point, arXiv:2505.18135) is at least as consistent with “raw vocabulary exposure is thin” as with “SFT/RL hasn’t reinforced the surface yet”A CPT stage on curated offensive-security text (tool docs, CVE writeups, exploit-dev reasoning) — every cited frontier precedent (Code Llama ~500B code tokens, DeepSeekMath 120B math tokens) runs this before SFT/RL
Stage 0.5 — Mid-trainingNothingThe single biggest concrete gap relative to its likely payoff — cheapest missing stage of the whole skeleton (§2), and it’s common to go straight from a general base into RL with no bridge stage at all
Stage 1 — SFT / rejection-samplingFully-designed quality-filter recipe (replay-reproduce, loss-masking, dedup, decontamination); one SFT already shipped and flag-verified (measurable pass@1 and pass@5 gains); trajectories across several corpora, a modest pool of verified-success candidates; a load-bearing negative result confirming the reward-must-be-ground-truth rule on your own data (a meaningful flag fabrication rate under a loose acceptance filter)The corrected filter (replay-reproduce, byte-exact flag verify) is designed but not confirmed re-run since the confabulation finding; ground truth exists for only a minority of corpora~2–3 orders of magnitude below frontier scale — Kimi K2’s SFT draws on 3,000+ real + 20,000+ synthesized MCP tools; no systematic teacher-distillation at scale; no difficulty-curriculum construction (candidate pool too small)
Stage 2 — RLVRA deterministic flag verifier — a genuine rung-1, ungameable terminal verifier, exactly the reward shape RLVR requires; RL-candidate-selection methodology matching GRPO’s actual zero-gradient mechanics (a mid-band pass@k window); a theory-correct potential-based stage-shaping proposal (Ng-Harada-Russell) that doesn’t touch the ground-truth backboneNo GRPO/RLVR training loop implemented anywhere in the codebase (zero training binaries); the retrieval heuristic not yet upgraded to byte-exact for most corpora; stage-shaping designed, zero code; the one RFT-provider fallback option is winding downQwen3.7-Max’s decoupled Task/Harness/Verifier infra — the first-party-named fix for the commonly-observed tool-bypass / scaffold-overfitting failure mode (agents preferring raw shell/HTTP over provided higher-level tools); no entropy-collapse countermeasure (nothing to attach one to yet); no partial-rollout/pause-resume infra for long-tail long-horizon episodes
Stage 3 — Scaled agentic RL environmentsA genuinely working RL-environment shell (long-horizon multi-turn loop, sandboxed, fully traced); a modest set of hardened, contamination-free, single-solution challenges live in production, genuine vuln-class breadth; additional informal challenges from a generative environment pipeline; the RL-envs-as-moat thesis, now corroborated by frontier evidence, not just a few original data pointsTotal known population is a modest set of distinct targets — an order of magnitude below your own target-scale framing; a single eval box is sized for sequential/moderate-parallel eval, never for concurrent GRPO rollout loadHarness/verifier diversity as its own trained axis (one tool surface, one verifier per challenge — categorical, not a scale gap); procedural/generative environment scaling at frontier order-of-magnitude (a generative environment pipeline’s challenge count is far smaller than DeepSeek-V3.2’s 1,827-environment pipeline); training-time rollout compute at K8s scale (categorical — no training-scale infra exists, only eval-scale)
Stage 4 — Eval integrityA locked, rigorous pass@k methodology (unbiased estimator, k=3/5/10 bands, independent cold starts); the terminal flag_verified contract (exact match, never a proxy); two modest QA datasets beyond flag-capture; a fully-designed, near-zero-risk eval-decomposition planBase-model pass@64–128 control not confirmed run against the current SFT checkpoint; no per-challenge oracle manifest yetNo confirmed contamination/canary audit applied to the cyber CTF corpus specifically; no externally-comparable published benchmark result — no way for an outside reader to place your solve rate against any external reference point

What this means concretely: you are not missing an idea anywhere in the recipe — every stage has a designed, theoretically-grounded, often partially-built answer, and two pieces (the harness-as- environment, the ground-truth verifier) can be genuinely frontier-quality today. What’s missing everywhere except eval methodology and reward design is scale: more environments, more verified trajectories, more training-time compute — plus one categorical, non-scale gap (harness/verifier diversity) that is the single frontier-lab-named fix for a failure mode you may have already measured on your own data.


5. RL-environments + data-synthesis as the moat, at frontier scale

Frontier evidence on this axis is now broader than the original three-source hypothesis (Anthropic’s reported spend, Bugcrowd’s market, your own harness) — nine of ten labs surveyed for the frontier-recipes chapter independently corroborate it, and the general-agentic and cyber-specific evidence below sharpens the picture further.

  • Kimi K2 discloses “a large-scale agentic data synthesis pipeline and a joint reinforcement learning stage, where the model improves its capabilities through interactions with real and synthetic environments” (arXiv:2507.20534) — the cleanest public confirmation that a frontier lab’s post-training lever is environment synthesis + mixing real with synthetic, not base- model scale alone. Frontier_cyber_takeaway: your canonical, hand-built challenges are the “real” side; anything procedurally generated (parameterized bug-class variants, mutated target configs) is the “synthetic” side — a program training only on a small set of canonical challenges is closer to “real-only, no synthesis,” which K2’s own design implies under-scales.
  • Kimi K2.5’s Agent Swarm (arXiv:2602.02276) — a self-directed parallel-agent orchestration framework decomposing tasks into concurrent heterogeneous sub-problems, 4.5x latency reduction — architecturally identical to what XBOW independently converged on for cybersecurity (below): narrow-scope parallel sub-agents, not one longer monolithic trajectory. Two unrelated programs landing on the same architecture is a signal worth taking seriously against a current single-agent long-horizon episode design.
  • OpenAI Deep Research — official disclosure that it “was trained on real-world tasks requiring browser and Python tool use, using the same reinforcement learning methods behind OpenAI o1,” and on-record team commentary that “end-to-end training beats manual orchestration” — a fixed recon→scan→exploit→flag graph “breaks” when the agent needs to adapt; letting the model learn strategy via RL over hard tasks outperforms hand-scripted phase logic. This directly reinforces the “light framing beats heavy scaffolding” rule, from the team that shipped the highest-profile agentic-RL product to date.
  • Anthropic — a reported (secondhand, via TechCrunch citing The Information; direction corroborated by surrounding market activity, dollar figure not on-record) >$1B RL-environment commitment, plus a live, current, on-record disclosure that cyber-offensive capability is deliberately tier-gated across the Claude line rather than propagated uniformly with general capability. Frontier_cyber_takeaway: cyber capability is not a free byproduct of general-agentic scaling even at a frontier lab — it has to be deliberately trained in, which is exactly the bet you’re making (open-weight base + your own cyber RL environments).
  • Google DeepMind SIMA / SIMA 2 (arXiv:2404.10179, arXiv:2512.04797) — SIMA 2’s headline: “by leveraging Gemini to generate tasks and provide rewards, SIMA 2 can autonomously learn new skills from scratch in a new environment.” The clearest frontier precedent for self-generated challenges: applied to cybersecurity, a frontier-scale program would use a strong model to propose novel vulnerable-target variants and score exploit attempts, with your existing terminal flag verifier as the ungameable ground-truth check that keeps a self-generated curriculum honest.
  • Market corroboration, general-purpose: Prime Intellect’s Environments Hub — 1,000+ unique environments from 250+ creators, 100,000+ downloads. Cyber-specific instance: Bugcrowd’s RL Environments (built on Mayhem Security tech) — “hundreds of thousands of training environments, each built from authentic open-source vulnerabilities with real source code and verifiable outcomes,” with Chief AI/Science Officer David Brumley’s own framing: “Most AI security training stops too early. Models learn to find bugs, but not to prove the bugs are real and exploitable… detection through exploitation, patching, and audit.” That last phrase is also a concrete, safely-implementable curriculum idea — a graded multi-stage reward, but only if built potential-based (policy-invariance guarantee per Ng/Harada/Russell; see decomposition-vs-monolithic.md §3–5 for the theorem, the bicycle-shaping failure ancestor, and the concrete guardrails) — a flat per-stage bonus is exactly the ad hoc shaping that theorem shows produces gameable, farm-the-partial-credit policies.
  • XBOW — admissible as a production, externally-verified domain-specialization precedent (top-ranked on HackerOne against human researchers, real CVEs, real payouts), not the excluded academic set. Its own disclosed curriculum climbed four rungs in order: canned CTF (PortSwigger/PentesterLab, “artificial exercises”) → a custom-built realistic benchmark → white-box zero-day discovery in real open-source projects → black-box production dogfooding on HackerOne, where the real-world bug-bounty triage process itself is the verifier. You likely currently sit at roughly rung 2 (your own custom-built challenge set, more realistic than generic CTF). XBOW’s own architecture note — “thousands of short-lived agents, each with a narrow objective, orchestrated by a persistent coordinator and validated by deterministic logic… if one agent runs into a dead end on step 4 of a 20-step attack, it doesn’t tank the whole operation” — independently confirms (alongside Kimi K2.5’s Agent Swarm) that decomposition into parallel narrow agents, not a longer monolithic single-agent trajectory, is where frontier-grade cyber-agent architecture is heading.

Your own numbers, side by side with the frontier evidence: likely a few thousand trajectories at most, but the distinct-challenge corpus underneath that is typically on the order of a modest set of canonical live challenges plus a small locked dataset slice. Bugcrowd alone is “hundreds of thousands” of distinct verifiable cyber environments; Prime Intellect’s general hub is 1,000+; Kimi K2 leans on 3,000+ real + 20,000+ synthesized tools feeding trajectory generation. The gap is typically 2–5 orders of magnitude on environment volume and diversity — not on algorithm. Every frontier disclosure above agrees GRPO/RLVR-family joint RL with tool-use is now well-understood and largely commoditized; the highest-leverage next investment is usually a synthesis pipeline that turns your existing hand-built challenges into hundreds-to-thousands of verifiably-distinct variants (parameterized bug-class mutations, stack/target permutations, difficulty-graded variants of the same vuln class) — mirroring Kimi K2’s real+synthetic split and XBOW’s own rung-2→3 transition — rather than continuing to hand-author challenges one-off at the current cadence.


6. How this ladders — from “improve solve rate” to “frontier model”

Diagnosing the gap, From behavioral audit to training signal, One problem, or many?, and Where you are & the forks ahead are all, correctly, scoped to your own challenge set — they answer “what training signal fixes F1 vs F2 vs F3 vs F4” and “monolithic vs milestone-shaped reward,” which are the right near-term engineering questions. This chapter’s honest addition: answering those questions well moves solve rate on the existing portfolio; it does not, by itself, cross into “frontier.” The ladder has three rungs, and the roadmap-inputs.md decision brief only climbs the first:

  1. Rung 1 — execute reliably on the portfolio you have. This is the diagnosis framework’s whole job: segment single-shot vs. sequentially-gated, route by the F1–F4 funnel, pick SFT-vs-GRPO ordering correctly per segment. Get this right and you’ve closed the execution gap you diagnosed — necessary, and per §4 above, your Stage 1/Stage 2 work already targets exactly this.
  2. Rung 2 — scale the environment/data axis by orders of magnitude. Per §4/§5, this is where the actual distance to “frontier” lives: a modest canonical set plus additional informal challenges vs. Bugcrowd’s hundreds of thousands; a modest pool of verified-solve candidates vs. Kimi K2’s tens-of-thousands-of-tools synthesis pipeline. No amount of correctly-routed SFT-vs-GRPO decision-making on Rung 1’s existing portfolio substitutes for this — every frontier precedent in this chapter treats environment/data scale as the dominant axis, not a nice-to-have.
  3. Rung 3 — close the CPT/mid-training gap, if evals reveal it’s real. Per §4’s Stage 0/0.5 rows, a “knowledge in tools, not weights” bet is a legitimate scoping choice only if the deficit evals surface is confirmed execution-only. If a knowledge deficit shows up instead (not just an execution one), neither of the two disclosed frontier tools for fixing it — domain CPT, mid-training — is currently in your plan at all. This is the one rung that’s genuinely contingent, not scheduled.

The decomposition-vs-monolithic.md verdict (stay monolithic on reward shape until the funnel says otherwise, build only the theorem-backed potential-based version if you do) and the roadmap-inputs.md forks (instrument first, segment before committing SFT capacity, route exploration-vs-execution emphasis by the funnel) are all Rung-1-scoped decisions, made correctly — none of them need to change in light of this chapter. What this chapter adds is the honest framing that Rung 1 is a prerequisite, not the destination: nailing every fork in roadmap-inputs.md while still having a modest canonical challenge set and no CPT/mid-training stage means you’ve built an excellent instance of “the shape of the frontier recipe” at a scale that isn’t frontier yet. The concrete forward move this chapter argues for, independent of and parallel to the Rung-1 work already underway, is the Rung-2 synthesis-pipeline investment named in §5 — because unlike Rung 3 (contingent on an eval result not yet in hand), Rung 2’s gap is already confirmed, already the largest, and already has multiple frontier precedents (Kimi K2, SIMA 2, XBOW rung 2→3, Bugcrowd) showing the shape of the fix.


The decision

Understanding built the ranking and the diagnostics; Conclusion is where they resolve into an action. This chapter is that resolution — the routing tree the rest of the book was building toward.

The whole book collapses to one diagnostic and its branches. The routing question — does the correct action ever appear in π_θ’s own outputs at high N? — is what separates a knowledge gap (inject off-policy) from an execution gap (on-policy) from a ranking gap (preference). This tree stands on the on/off-policy genealogy (The one axis that predicts everything) and on the amplify-vs-inject evidence chain — elicit-not-expand, SFT-memorizes/RL-generalizes, and the contested amplify/replace pushback — argued in full, with its calibration/hedging, in The recipe is a sequence §3: you can only reinforce what already fires in the base model’s own distribution.

That routing question has a sharper, task-structure-dependent version once you sample at high N and track when in the episode the correct action shows up — an execution gap can hide an exploration gap underneath it. The tree below now branches on that.

The rigorous version of this page lives in From behavioral audit to training signal. That chapter runs the common failure patterns through gap-type → training-signal → verification-check, cites the pass@k / Pass@(k,T) / Cover@τ instrumentation this page’s routing question is a shorthand for, and is where you go before trusting any single branch below as final for a given challenge.

graph TD
  Q0["Does the correct action ever appear in π_θ's<br/>own outputs — even rarely — at high N?"]
  Q0 -->|"Never, not once"| K["KNOWLEDGE gap"]
  Q0 -->|"Sometimes (solves occasionally)"| E{"Have a model that's<br/>actually better at your CTFs?"}
  Q0 -->|"Knows it, mis-picks / quits early"| R["RANKING gap"]

  K --> KM["Inject OFF-POLICY:<br/>SFT / teacher data / a TOOL<br/>(RL can't cheaply conjure it)"]
  E -->|Yes| DIST["On-policy distillation<br/>dense · ~10× cheaper than RL<br/>(promising, not yet lab-proven)"]
  E -->|"No, only a verifier"| Q1{"Is the winning path single-shot,<br/>or compositional / sequentially-gated<br/>(enumeration must land before<br/>exploitation is even visible)?"}
  R --> RM["DPO / KTO<br/>(KTO for unpaired good/bad logs)"]

  Q1 -->|"Single-shot — recon isn't gating"| RS["Rejection-sampling SFT<br/>→ GRPO when entropy collapses"]
  Q1 -->|"Sequentially-gated —<br/>enumeration must land<br/>before exploitation is reachable"| XG["EXPLORATION gap:<br/>reaches the right region,<br/>then collapses / never enumerates"]

  XG --> XGM["On-policy RL FIRST, not more SFT —<br/>matched-data SFT regresses this exact<br/>subset (net −4) while RL expands it<br/>(net +4): self-directed exploration<br/>during rollout is the causal ingredient,<br/>not demonstrations"]

  classDef your fill:#132b22,stroke:#34d399,color:#eafaf3;
  class E,Q1,RS,XG your;

Reading the branches

This tree’s Knowledge / Execution (distillation-or-rejection-sampling) / Ranking branches are the coarse-grained cut of a finer K/R/P taxonomy — gaps/taxonomy.md refines “execution” into a macro (R, plan-level ranking) and micro (P, decision-point) sub-signature and proves why K is categorically different; same tree, two resolutions, not two independent trees.

  • Knowledge gap — nothing on-policy to reinforce. Inject by demonstration, or cheaper, put the missing fact in a tool (“knowledge in tools, not weights” — llmresearch-handbook.md rule 5). Standard RLVR won’t cheaply create it — see the contested boundary in Contested edges (Yue et al., arXiv:2504.13837).

  • Execution gap + stronger teacheron-policy distillation: dense signal on your own rollouts (GKD arXiv:2306.13649); flagged promising, not lab-confirmed.

  • Execution gap + only a verifier, single-shot paththe common case. Rejection-sampling SFT on the solves you already have → graduate to GRPO/RLVR when policy entropy collapses (arXiv:2504.11343).

  • Exploration gap — an execution gap that’s actually sequentially-gated [E][L][N] — the naive test (“solves occasionally at high N”) says execution gap, but if the winning path requires correct enumeration at turn 5 before turn 40’s exploit is even visible, that’s a different beast. Zhai et al.’s Pass@(k,T) analysis, arXiv:2604.14877 (2026-04-16, single-group, promising) found that on this exact task shape (“Category C” — compositional, sequentially-gated retrieval), the RL pass-curve pulls away from the base curve as k grows — real capability expansion — while matched-data SFT on the same task regresses it (net −4 vs RL’s net +4). The causal factor they isolate is self-directed exploration during on-policy rollout, not exposure to more demonstrations. Practically: don’t spend your rejection-sampling budget flattening this subset first — it needs GRPO’s exploration before SFT saturates it, the opposite ordering from the single-shot branch above.

    Designed to fix a common failure: agents commonly under-explore the tool space — preferring raw shell/HTTP over provided higher-level tools (tool preferences in agentic LLMs are unreliable, arXiv:2505.18135) — and abandon PTES-style enumeration before pivoting to exploitation. Both are the same mechanism at different granularities: Cui et al.’s entropy law, arXiv:2505.22617 (R = -a·exp(H) + b) predicts the policy trades away exactly this enumeration/tool-diversity budget for reward as entropy collapses — so plain GRPO on this subset needs DAPO-style clip-higher/dynamic sampling (arXiv:2503.14476) from the start, not as a later patch. Full technique-by-pattern mapping (ToolRL, GiGPO, RL-PLUS, NuRL, plus Pentest-R1 — academic, cited for context only, not a basis) is in the diagnosis chapter, not repeated here.

    Contested / not settled: this is the sharpened, task-conditional version of the “RL can’t create capability” debate — full evidence chain in The recipe is a sequence §3, also indexed at Contested edges §1. Yue et al.’s crossover result (elicit-not-expand) holds on the static/independent-retrieval task shape; Zhai et al.’s result (genuine expansion) holds on the compositional/sequentially-gated shape. Same instrument, opposite conclusion, and the split is the falsifiable variable — segment your own challenge set by this criterion before trusting either reading wholesale.

  • Ranking gapDPO/KTO; KTO fits your unpaired solved/failed logs (arXiv:2402.01306).

One prerequisite before any of this

Your aggregate solve rate is often a k=1 portfolio statistic, not a per-challenge pass rate. Before choosing a branch, run pass@k per challenge and bucket by difficulty — the 30–60% band is a per-group property that GRPO needs, and a challenge that “solved once” may be a 30% target that got lucky (a prime RL candidate), not a done deal (lessons/post-training/rl-candidate-selection-from-passk.md, shared memory). Diagnose per-challenge, then route.

The single-shot-vs-sequentially-gated split above needs the same per-challenge treatment: label each challenge by whether its winning path is recon-gated (turn-5 enumeration must land before turn-40 exploit is reachable) or not, before running pass@k — the split determines which axis of the tree you’re even on. Two cheap refinements to the pass@k check, both eval-only (no training change): Cover@τ (Dragoi et al., arXiv:2510.08325) flags challenges where a high pass@64 is really “guessable by brute force” rather than genuinely reliable — don’t rejection-sample SFT on those, you’ll just teach confident guessing; and running the base model’s own pass@k as a control (per Yue et al., arXiv:2504.13837) tells you whether a claimed post-SFT gain on a given challenge is elicitation or noise before you credit it to the pipeline.

The interactive version

The same tree, clickable, is in The 5-minute journey (final section) — answer it for your own failing challenges.

Where you are & the forks ahead

This is the capstone chapter, not a roadmap. Every other chapter in this book resolves a method question (SFT vs DPO vs GRPO, monolithic vs decomposed, which exploration fix). This chapter assembles those resolutions into the shape you actually need to draw your own plan: what’s true today, what you have to decide, in what order the decisions unlock each other, and what would have to be false to make you change course. It recommends nothing you haven’t already read elsewhere in this book — it routes you back to Diagnosing the gap, From behavioral audit to training signal, One problem, or many?, Before you train, RL that creates value, and The decision at every load-bearing point. Read this after those, not instead of them.

Where this fork-by-fork plan sits in the bigger picture: everything below is Rung-1-scoped — it resolves execute reliably on the portfolio you have. It is a prerequisite for, not a substitute for, The path to a frontier cybersecurity model, which argues that even a perfectly-resolved DAG below doesn’t by itself cross into “frontier” — that takes orders-of-magnitude more RL-environment scale (Rung 2) and possibly a CPT/mid-training stage (Rung 3). The cross-domain evidence grounding that argument — six other long-horizon/sparse-reward/verifiable domains and what actually cracked each one — lives in Cybersecurity is one of a family — what cracked the others; several forks below (especially (c) and (e)) draw directly on techniques surveyed there (GiGPO, DAPO, WebRL’s failure-to-curriculum, potential-based shaping). Fork (b)’s SFT-vs-measure-first framing and its order-matters/compounding rationale are the Sequence-B-specific instance of the general argument in The recipe is a sequence, not a pick; the general-capability SFT/preference data fork (b)/(d) would eventually pull from is catalogued in Proven post-training datasets — a usage-cited registry.


1. Where you are — the diagnosis on one screen

The number: only a fraction of the challenge portfolio is currently solved at k=1. This is a portfolio statistic, not a per-challenge pass rate — a challenge that “solved once” could be a 5% fluke or a 55% near-certainty, and those two cases call for opposite next moves (The decision, “one prerequisite before any of this”). Nobody has yet run pass@k per challenge, let alone per pipeline stage.

The pipeline is a chain, not a single action — see the diagram and the full F1–F4 taxonomy (canonical RL/agent-research framing, credit-assignment-theory decomposition into exploration-burden / variance / compounding-drift) in One problem, or many? §1. Only the last box (flag_verified) is checked today, and even that is presently a provenance proxy — “the string came back from the sandbox, not the model’s mouth” — rather than a true byte-compare against a canonical ground-truth flags file — that exact-match wiring doesn’t exist yet outside a manual, SSH-gated step (instrumentation-and-data-readiness.md §3.1). So even the ground-truth anchor this whole book leans on is one small, well-scoped engineering task away from being fully automatic, not there yet.

The fix lever this chapter adds on top of that taxonomy, per tag, if confirmed dominant:

TagFailure (one-line)Fix lever if confirmed dominant
F1Never finds the vulnerable endpointOn-policy RL with exploration preservation, not more demonstrations
F2Finds it, probes shallowly, can’t land the exploitTrajectory curation, rejection-sampling SFT, DAPO/GiGPO as GRPO baseline
F3Clumsy tool use, wrong tool for the jobElicitation ladder → ToolRL/Tool-Star if elicitation fails
F4No real pivot/chaining after a footholdStep-level credit (GiGPO), curriculum (1-hop before 2-hop), never “try more” alone

The diagnosis, stated as a hypothesis, not a fact: the working read here is “likely an execution gap” (F2/F3-flavored) rather than a knowledge gap or a pure exploration gap — capability is probably present and unreliable, not absent. This is the single most load-bearing framing decision in the whole plan, and it is currently unproven. The book’s own diagnosis framework is explicit about this: “the honest, defensible answer will not be a single sentence” — the true picture is almost certainly a split verdict, different F-tags dominating different challenge subtypes, not one gap type for the whole portfolio (Diagnosing the gap §0, §8).

What “proven” requires, concretely, and doesn’t exist yet:

  1. Per-challenge (not aggregate) pass@k, segmented by whether the winning path is single-shot or sequentially-gated (compositional — enumeration must land before exploitation is even visible).
  2. Pass@(k,T) — base model vs. current checkpoint, per segment — to tell a genuine execution gap (trained pulls away from base at large k) apart from a pure elicitation artifact (base catches up) apart from an exploration gap hiding underneath (matched-data SFT regresses the segment, RL expands it) (arXiv:2504.13837, arXiv:2604.14877).
  3. A working F1–F4 stage tagger over your existing trace/run-log corpus — the actual current gap, confirmed by direct source read: the harness’s process telemetry is already complete for this (tool_call/tool_result pairs joined on a call id); nothing needs to change in your agent’s event-logging module or its runner. What’s missing is purely semantic — a deterministic post-hoc scan plus a per-challenge oracle, authored from that challenge’s own solution script (Before you train §5).

Bottom line for this section: treat “it’s an execution gap” as the leading hypothesis, not settled ground. Everything in §2–§4 below is written so that it stays true whichever way the funnel eventually comes down — several forks are explicitly gated on a measurement that hasn’t been taken yet.


2. The forks

Five decisions, each with exactly two options (per this book’s convention — no hybrids, no third path). Every “what must be TRUE” column is a gate, not a preference — the fork should not be decided until its gate is checked, because in at least two of these forks (b, e) the two options are not just different costs, they require the opposite SFT/RL ordering. One explicit, flagged exception: fork (b)’s verdict below lands on a hybrid rather than either labeled option outright — called out and justified there, not silently smuggled in past this convention.

(a) Instrument the F1–F4 stage tagger first?

Option 1 — build it firstOption 2 — skip it, decide off aggregate pass@k/flag_verified alone
What it isa stage-scan module (same shape as the existing deterministic flag verifier) + a per-challenge oracle, authored from the challenge solution script; prototype on a representative challenge first, then generalizeProceed straight to the SFT/GRPO plan using only the terminal flag signal and portfolio-level solve rate
Cost (compute + eng)Near-free — read-only post-hoc scan over your run traces you already have; no new sandbox instrumentation; editorial authoring of ~4 predicates/challenge (one person reads a handful of solution scripts)Zero now — but every downstream decision (b–e) is made blind to which F-tag actually dominates
Risk (reward-hacking)None — this is diagnostic-only, no reward function touchedRouting risk, not hacking risk: you may sink a training cycle into the wrong lever (e.g. rejection-sampling SFT when the real bottleneck is F1/exploration, or milestone shaping when it’s actually F2/F4)
Information valueHighest single move in this whole chapter. “This single aggregation is the input every downstream decision below depends on” — verbatim from Before you train §4Low — an aggregate number “averages over four structurally different failure modes,” exactly the collapsing-a-split-verdict anti-pattern the diagnosis framework names first
What must be TRUE firstNothing — this is the recommended first step regardless of any other measurementN/A

Verdict pressure: there is no real argument for Option 2. This fork is here because it’s the fork everyone is tempted to skip under time pressure, not because the evidence is close.

(b) Rejection-sampling SFT on verified solves NOW vs. measure pass@k-per-stage FIRST

Option 1 — SFT nowOption 2 — segment + measure first
What it isRun rejection-sampling SFT on the already-collected pool of verified-solve trajectories across your existing training corporaSegment your challenge set (single-shot vs. sequentially-gated), run Pass@(k,T) — base vs. current checkpoint — per segment, before deciding what to train on
CostCheap — data already exists, this is already a common near-term plan at this stageMedium — sampling compute at multiple k, cold-start pdq --fresh-retries, no training required
Risk (reward-hacking / generalization)Concrete, not hypothetical. On the compositional/sequentially-gated segment, matched-data SFT actually regresses capability (net −4) while RL expands it (net +4) — Zhai et al., arXiv:2604.14877. Training the wrong subset with SFT doesn’t just waste compute, it can make that subset worse. Separately: the trajectory pool may be guessing-dominated (high pass@64, low Cover@τ — arXiv:2510.08325) or contain lucky-but-unsound paths (right flag, wrong/wasted reasoning — arXiv:2506.14245)Low — diagnostic only, but real opportunity cost if it delays shipping a known-safe move (SFT is often the default plan at this stage, already literature-validated as a baseline — arXiv:2504.11343)
Information valueLow incremental — you already believe SFT-on-solves works generically; this doesn’t test where it worksHigh — this is “the single highest-value experimental design” in the diagnosis chapter, and it’s directly testable this week with no new training
What must be TRUE before committing to Option 1 wholesale(i) the SFT pool isn’t guessing-dominated (Cover@τ check on its source challenges); (ii) trajectories are filtered on soundness (backtracking/wasted-turns/tool-validity), not just flag==1; (iii) fork (a)’s stage tagger doesn’t show these trajectories concentrated on the sequentially-gated segmentN/A

Verdict pressure — this is this chapter’s one deliberate exception to the “no hybrids” convention stated in §2, flagged rather than smuggled in: don’t cancel the SFT plan — but don’t treat “SFT now” as a blanket recipe across the whole portfolio either. The correct read of these two options is closer to “do (2) as a segmentation gate on (1)”: SFT the single-shot segment now, hold the sequentially-gated segment for GRPO once entropy instrumentation is live. Why this fork earns the exception where the other four don’t: options 1 and 2 here aren’t mutually exclusive courses of action — one is a training decision, the other a measurement decision, and they resolve at different grain (portfolio-wide vs. per-segment). Once segmentation lands, “measure first” naturally gates “SFT now” rather than replacing it. Forks (a), (c), (d), (e) don’t have that structure — their two options are genuinely exclusive paths, which is why no-hybrids holds cleanly for them and only for them.

(c) Monolithic GRPO vs. milestone-shaped GRPO

Option 1 — monolithicOption 2 — milestone-shaped
What it isTerminal flag reward only, unchanged, once GRPO/RLVR startsPotential-based shaping F(s,a,s') = γΦ(s') − Φ(s) layered on top of (never instead of) the terminal reward, where Φ = a monotone running-max count of deterministically-verified stage completions (Ng/Harada/Russell, ICML 1999 — policy-invariant by theorem; full proof sketch, failure ancestor, and guardrails: One problem, or many? §3–§5)
CostNone beyond baseline GRPO infraMedium — per-challenge oracle authoring (reuses fork (a)’s work if already done), Φ must be a running max (not instantaneous), and defined identically across every termination path (stop_reason{stop, max_turns, error}) or the invariance proof breaks
Risk (reward-hacking)Risk of leaving real gains on the table if the funnel is genuinely F1-dominated — MiRA’s 6.4%→43.0% WebArena-Lite result is the strongest existence-proof in this book that flag-only reward can leave a large gap, though that’s a web-navigation result, not CTF (arXiv:2603.19685)This is where the thick, convergent reward-hacking literature lives for any per-stage check softer than deterministic ground-truth — full argument (the confirmed FLAG{}-confabulation lesson, the gameability ladder, and the reward-tampering-vs-gaming isolation caveat: a ground-truth verifier alone doesn’t stop tampering if the agent’s own tool surface can reach its read-path) is in Contested edges & landmines §5 — same conclusion routes here: harden the verifier’s read-path before scaling milestone-shaped GRPO
Information valueN/A — this is the default, not an experimentHigh if built correctly — this is the only mechanism in the whole menu that’s a theorem, not an empirical bet, provided the two subtleties are respected
What must be TRUE before building Option 2(i) fork (a)’s funnel shows an F1 (exploration)-dominated bottleneck, not F2/F3; (ii) the scale-dependence check confirms the base policy is genuinely capacity-limited rather than already-capable-but-unreliable — arXiv:2603.21972 found staged reward helps weak models only, larger models converge fine on outcome-only reward; (iii) a deterministic oracle exists for the stage being shaped — explicitly excluding stage 3 (vuln identification), which VPR’s own authors flag as the “open, unstructured” regime their method doesn’t yet solve (arXiv:2605.10325)Default — no gate needed

Verdict pressure: stay monolithic until the funnel says otherwise. If it does, build the narrow, theorem-backed version — never a learned/LLM-judge per-stage reward, under any circumstance. And regardless of which option wins: verifier-integrity hardening (the deterministic flag verifier’s read-path isolated from the agent’s own tool surface) is not optional once RL starts, because Denison et al.’s generalization result means a ground-truth verifier alone doesn’t rule out the agent attacking the verifier rather than the challenge.

(d) Tool-use fix for the curl-preference (SFT/DPO/KTO)

Option 1 — elicitation ladder firstOption 2 — jump straight to a training-time fix
What it isEscalate cheapest→most-expensive: few-shot prompt with 2–3 correct-usage examples → light SFT on a handful of demonstrated-usage trajectories → only then consider RL-level interventionGo directly to DPO/KTO on tool-choice pairs, or ToolRL-style decomposed per-call reward, without testing whether elicitation alone recovers the behavior
CostVery cheap — the few-shot test is nearly free; SFT-demo step is cheapMedium — true DPO needs k≥2 same-challenge same-model divergent pairs (only a modest set of hardened challenges with a k=5 sweep qualifies today; the larger training-corpus pools are k=1); KTO-native data (unpaired success/failed splits) is free and ready today
Risk (reward-hacking / wasted engineering)Low — but a self-reinforcing trap exists regardless of which rung you’re on: a rejection-sampling corpus built from the current curl-biased policy will never contain a dead tool succeeding, because the policy never tried it — RL alone has ~zero probability mass to reinforce those tools without forced/hinted exposure first (Tool-Star, arXiv:2505.16410)Building ToolRL/DPO machinery for what might be a pure elicitation gap — Greenblatt et al.’s password-locked-model finding says a few high-quality SFT demonstrations are often sufficient to fully elicit a locked capability (arXiv:2405.19550); over-engineering here is real opportunity cost, not just aesthetic
Information valueHigh and cheap — turns “the model prefers curl” from anecdote into a falsifiable, staged experiment (framework.md §5)Lower until the ladder has been run — you don’t yet know which rung actually recovers the behavior
What must be TRUE before escalating past few-shot(a) few-shot prompting fails to recover tool usage on held-out challenges; (b) SFT on a small demonstrated-usage set also fails to recover it → only then is it a genuine missing-affordance problem calling for Tool-Star-style forced exposure + ToolRL-style decomposed reward (arXiv:2504.13958)N/A

Verdict pressure: run the ladder. Don’t skip to DPO/ToolRL on a hunch — the cheapest rungs have direct, citable precedent for “this alone is often sufficient,” and skipping them risks building infrastructure for a gap that a two-line prompt change would have closed.

(e) Exploration-emphasis vs. execution-emphasis — routed by the funnel

Option 1 — execution-emphasisOption 2 — exploration-emphasis
What it isInvest in trajectory curation, more/better rejection-sampling SFT data, DAPO’s clip-higher + dynamic sampling as the GRPO baseline, GiGPO step-level creditOn-policy RL first, not SFT, for the segment the funnel flags as F1/F4-dominant; DIVER/tool-sequence diversity bonus, curiosity bonus (CDE), parameter-space-noise pilot, periodic reference-policy resets (ProRL) for genuine boundary expansion
CostLower — DAPO is an established, widely-adopted recipe; trajectory curation reuses existing dataHigher — several of these techniques are RL-infra-dependent and Promising-not-validated (PSN-RLVR, DIVER, HiPER/hindsight credit assignment for a CTF-shaped domain)
RiskIf the funnel is actually F1-dominant, more SFT on the same recipe teaches guessing-and-hoping more confidently, not more competence (LIMO’s framing, arXiv:2502.03387)If the funnel is actually F2/F3-dominant, exploration machinery is solving a problem that doesn’t exist here and burns the RL-infra budget on the wrong axis — the entropy-collapse mechanism these fixes target (arXiv:2505.22617) is real but doesn’t help a policy that’s exploring fine and just executing unreliably
Information valueThis is literally what the funnel is for. Not a taste choice — a routed decisionSame
What must be TRUE before routingFunnel result from fork (a); the scale-check (arXiv:2603.21972); the Pass@(k,T) crossover-direction test on the specific segment (fork b) — does trained pull away from base at large k (execution), or does matched-data SFT regress it while RL expands it (exploration)?Same gate, opposite branch

Verdict pressure: this fork cannot be decided from priors or literature alone — by design, it is the output of forks (a) and (b), not an independent choice. If you find yourself picking an emphasis before the funnel exists, you are guessing, and the guess has better-than-even odds of being wrong given the “likely execution, unproven” framing in §1.


3. Dependency order — a DAG, not a timeline

This is deliberately not a schedule. It shows what unlocks what — several branches can run in parallel, and nothing downstream of “instrument” is safe to start before its own inputs exist.

flowchart TD
  subgraph INSTRUMENT["INSTRUMENT — near-free, read-only, do first"]
    I1["a stage-scan module + per-challenge oracle,\nF1-F4 tagger"]
    I2["flag_verified true byte-compare\n(replace retrieved-provenance proxy)"]
    I3["entropy logging wired,\nready from RL step 0"]
    I4["elicitation-ladder harness:\ntool-usage histogram across your tool surface"]
  end

  subgraph MEASURE["MEASURE — diagnostic, no training changes"]
    M1["Segment your challenge set:\nsingle-shot vs sequentially-gated"]
    M2["Pass@(k,T): base vs current checkpoint,\nper segment (arXiv:2604.14877)"]
    M3["Cover@tau per challenge\n(arXiv:2510.08325) — guessing vs reliable"]
    M4["Base-model pass@k control\n(arXiv:2504.13837)"]
    M5["Scale-check: weak/capacity-limited\nvs already-capable-unreliable\n(arXiv:2603.21972)"]
    M6["Elicitation ladder run:\nfew-shot -> SFT-demo -> RL"]
  end

  subgraph ROUTE["ROUTE — the fork decisions (Section 2)"]
    RA["Fork a: ALREADY DECIDED\n(instrument first)"]
    RB["Fork b: SFT-now vs measure-first\nper segment"]
    RC["Fork c: monolithic vs\nmilestone-shaped GRPO"]
    RD["Fork d: elicitation vs\ntraining-time tool fix"]
    RE["Fork e: exploration- vs\nexecution-emphasis"]
  end

  subgraph TRAIN["TRAIN — the actual runs"]
    T1["Rejection-sampling SFT\non single-shot segment, curated\n(STaR / ReST-EM pattern)"]
    T2["GRPO + DAPO baseline\n(clip-higher, dynamic sampling)"]
    T3["+ GiGPO step-level credit\n(zero extra rollouts)"]
    T4["+ potential-based milestone\nshaping (gated, fork c only)"]
    T5["ToolRL / Tool-Star forced\nexposure (gated, fork d only)"]
    T2b["Exploration-emphasis RL:\nDIVER / CDE curiosity bonus /\nPSN-RLVR / ProRL resets\n(gated, fork e exploration branch)"]
  end

  subgraph GRADUATE["GRADUATE — the go/no-go gates"]
    G1["Entropy collapsed\nAND pass@64 non-trivial\n(arXiv:2510.01624)"]
    G2["Semantics-preserving-transform\nrobustness check survives\n(arXiv:2502.07445 / 2503.02296)"]
    G3["Base-pass@k control still\ntrails trained pass@k\n(gain is real, not elicitation)"]
    G4["pass@large-k did NOT shrink\npost-RL (RL-PLUS check,\narXiv:2508.00222)"]
  end

  I1 --> M1
  I2 --> M4
  I3 --> G1
  I4 --> M6

  M1 --> M2
  M2 --> M3
  M2 --> M4
  M2 --> M5

  M1 --> RB
  M2 --> RB
  M3 --> RB
  M5 --> RC
  M1 --> RC
  M6 --> RD
  RB --> RE
  M5 --> RE

  RB --> T1
  RC -->|"F1-dominant, weak policy"| T4
  RC -->|"F2/F3-dominant"| T2
  RD -->|"elicitation recovers it"| T1
  RD -->|"neither recovers it"| T5
  RE -->|"execution-emphasis"| T2
  RE -->|"exploration-emphasis"| T2b
  T1 --> T2
  T2 --> T3
  T3 --> T4
  T3 --> T5

  T2 --> G1
  T4 --> G1
  T5 --> G1
  T2b --> G1
  G1 --> G2
  G2 --> G3
  G3 --> G4
  G4 -->|"holds"| Ship["Credit the gain.\nGeneralize to the next segment /\nchallenge subset"]
  G4 -->|"fails"| Back["Back to MEASURE —\nre-run funnel, re-check scale,\ndo not re-train blind"]

  classDef inst fill:#132b22,stroke:#34d399,color:#eafaf3;
  classDef meas fill:#0f2a3d,stroke:#38bdf8,color:#e6f6ff;
  classDef route fill:#3a2e14,stroke:#f5b942,color:#fff6e0;
  classDef train fill:#2a1438,stroke:#c084fc,color:#f3e8ff;
  classDef grad fill:#3a1414,stroke:#f87171,color:#fde8e8;
  class I1,I2,I3,I4 inst;
  class M1,M2,M3,M4,M5,M6 meas;
  class RA,RB,RC,RD,RE route;
  class T1,T2,T3,T4,T5,T2b train;
  class G1,G2,G3,G4 grad;

Read this as: nothing in TRAIN is safe to start before its ROUTE gate fires, and nothing in ROUTE is safe to decide before its MEASURE inputs exist. INSTRUMENT is the only stage with no prerequisites — which is why fork (a) has no real counter-argument.


4. Open hypotheses to test

These are falsifiable, in the sense the diagnosis chapter insists on: each has a stated experiment and a stated result that would kill it. This is the “prove it to myself” frame, not a checklist to complete once — re-run per challenge segment as the corpus grows.

#HypothesisExperimentFalsified if
H1It’s execution, not knowledge, on the non-sequentially-gated segmentBase-model pass@k at large k (64, 256) on currently-failing single-shot challenges — does the correct action ever appear?The correct action never appears at any N on any checkpoint for a large fraction of these — that’s a knowledge gap for that subset, requiring off-policy injection (demonstration, teacher, or a tool), not more RL
H2Milestone shaping helps, doesn’t hackIntroduce potential-based shaping (fork c, gated) on the F1-dominant segment only; track held-out flag_verified rate and pass@large-k before/afterHeld-out flag rate drops, or pass@large-k shrinks post-introduction (capability-boundary collapse, arXiv:2508.00222) — either result means the shaping term is being farmed, revert to monolithic immediately
H3The horizon is tractable for GRPO at the 30–60% baseline bandRun DAPO+GiGPO on challenges the funnel tags F2/F3-dominant, in the 30–60% pass-rate band; watch entropy from step 0Entropy still collapses under DAPO’s own fixes, or stage-transition credit doesn’t concentrate on the exploitation phase specifically (GiGPO’s state-hash groups show flat credit) — means the horizon/credit-assignment problem is harder than the established recipe assumes for this task shape
H4A real exploration gap exists, localized to the sequentially-gated segmentReplicate Zhai et al.’s crossover-direction test on your own compositional-segment challenges: does matched-data SFT regress pass@(k,T) on this segment while GRPO expands it?If SFT does not regress this segment (both SFT and RL improve it comparably), the sequential-gating framing doesn’t transfer to this task family, and the single-shot ordering (SFT then GRPO) is fine everywhere — fork (b)/(e)’s special-casing was unnecessary
H5Tool-avoidance (curl-preference) is elicitation, not a missing-affordance problemRun the elicitation ladder (fork d) on a sample of the tool-surface entries the agent never invokes, on held-out challengesNeither few-shot prompting nor light SFT-on-demos recovers usage — genuinely a missing-affordance problem, escalate to Tool-Star forced exposure + ToolRL decomposed reward
H6Any claimed solve-rate gain reflects real execution-reliability improvement, not memorization/elicitationBase-model pass@k-at-large-k control (H1’s instrument, reused) and semantics-preserving-transform variants of a held-out subset, checked against every claimed gain before crediting itThe gain evaporates on either check — the gain is elicitation (fine to attribute to SFT, a red flag if it persists after GRPO) or memorization of a fixed small set of canonical challenge shapes
H7The SFT go/no-go gate (entropy collapse) is sufficient on its ownCheck whether pass@64 on the rejection-sampling-SFT checkpoint is non-trivial at the same time entropy collapses, before green-lighting GRPO (arXiv:2510.01624)Entropy has collapsed but pass@64 is flat/low — this predicts a disappointing GRPO run regardless of how good SFT accuracy looked; do not launch on entropy-collapse alone

5. What this is deliberately NOT based on

Standing project rule, restated for this chapter specifically: no fork, no hypothesis, no cost/risk estimate, and no number above rests on an academic cybersecurity-LLM training or benchmark paper — CTF-Dojo, Cyber-Zero, Pentest-R1, HackSynth/Random-Crypto, AutoPenBench, Cybench, NYU CTF Bench, EnIGMA, InterCode-CTF, DRLRM-PT, node-fragility reward shaping, the kill-chain-staged-reward paper, Nakano’s ATT&CK-tree scaffold, or Honarvar’s Evolve-CTF/Capture-the-Flags family-based evaluation — even where several of these report a finding that would superficially support one side of a fork here. None of that line of work has produced a frontier cybersecurity model, so none of it counts as frontier evidence for a load-bearing decision; every mention of them in the six source chapters this capstone draws from is explicitly labelled “academic, cited for context only, not a basis,” and this chapter inherits that discipline rather than re-importing their numbers under a different heading. Every claim above is re-grounded on one of: general frontier post-training disclosures (DeepSeek-R1, Kimi k1.5/K2, Llama 4, OpenAI Deep Research), general RL/agent theory (potential-based shaping, the reward-hacking convergence, reward-tampering-as-generalization (arXiv:2406.10162), DAgger, GAE, entropy-collapse mechanics), general (non-security) agent-eval and long-horizon literature (METR, AgentBoard, MAST, τ-bench, GSM-Symbolic/C-BOD), or your own measured data and confirmed lessons (the SFT-induced FLAG{} confabulation, your run-trace corpus, the existing pass@k methodology). Where a demoted academic-security idea is still worth pursuing on its own merits — e.g. staged/kill-chain-shaped reward in a cybersecurity-specific loop — the chapters this one draws from say so explicitly and flag it “worth pursuing — unvalidated outside academic-security work,” never as settled ground.


Contested edges & landmines

The places where confident-sounding claims are actually unsettled, plus the terminology traps that cause real planning errors. Cited so you can check me.

1. “RL can’t create capability” — contested, not a law

  • Elicit-not-expand (the base claim): RLVR raises pass@1 but the base model beats the RL model at large pass@k — the paths RL finds were already in the base distribution; the reasoning boundary narrows with training. Distillation from a stronger teacher does expand it; RL does not (Yue et al., “Does RL Really Incentivize Reasoning Capacity Beyond the Base Model?”, arXiv:2504.13837, NeurIPS 2025). Reproduced for vanilla GRPO by others (e.g. NuRL notes plain GRPO leaves pass@1024 ≈ base, arXiv:2509.25666).
  • The counter: prolonged RL + KL control + reference resets expands the boundary even on problems the base never solves (ProRL, arXiv:2505.24864); entropy/exploration bonuses and parameter-space noise (arXiv:2602.02555) show similar. Also a metric critique: pass@k over-credits lucky-but-wrong CoT (CoT-Pass@K, arXiv:2506.14245).
  • Safe framing: vanilla RLVR at a normal budget elicits; sufficient compute + explicit exploration-preservation can expand — recipe-dependent, not settled. So “you can’t RL your way out of a missing capability” holds for standard-recipe RL only. Don’t state it as a law.

2. The “RFT” terminology landmine

Two different things share the acronym; conflating them mis-scopes a whole plan:

  • Rejection-sampling Fine-Tuning (STaR-family) = “RL without RL,” positives-only SFT on your own verified samples. Cheap.
  • Reinforcement Fine-Tuning (OpenAI/Fireworks product term — and what the project handbook calls “RFT”) = actual online RL / GRPO against a grader. Expensive.

“Start with RFT before RL” only parses under the first. Say “rejection-sampling SFT” for the cheap thing so you don’t accidentally spec a GRPO run.

3. On-policy distillation is promising, not lab-proven

Earlier framing called it “the sleeper.” Correction after a 2026 verification pass: the efficiency numbers (~9–30× cheaper than RL) come from GKD + Thinking Machines’ own blog (arXiv:2306.13649; thinkingmachines.ai 2025-10-27). No frontier lab has stated it as their production recipe. Real and attractive; treat the numbers as directional, not settled.

4. Don’t over-SFT before RL (2026 lesson)

Meta’s Llama 4 recipe deliberately keeps SFT and DPO lightweight around an intensive online-RL core, with the explicit finding that heavy SFT/DPO restricts RL exploration (ai.meta.com/blog/llama-4-multimodal-intelligence). If RL is your capability driver, a big SFT stage can cap your ceiling — counter to the naive “more SFT is safer.”

5. Reward must be ground-truth-verified, never format-matched

A project-empirical finding: SFT on trajectory data trained the model to emit FLAG{…}-shaped strings on unsolved challenges — confabulation — and a loose regex matcher fired on the model’s own reasoning/tool-args, not real server output (lessons/post-training/sft-induced-flag-confabulation.md, lessons/security-agent/flag-detection-false-positives.md, shared memory). Rule: scan tool output / server state for the flag and verify against ground truth; never reward format. On the gameability ladder, a deterministic verifier (level 1) has no parameters to exploit — stay there; PRM (level 5) was rejected for R1 for exactly this (arXiv:2501.12948).

Tampering caveat — determinism stops gaming, not tampering. A deterministic ground-truth verifier closes off proxy-gaming (exploiting slack in a misspecified reward), but it does not by itself close off reward-tampering — an agent with tool/shell access directly editing, spoofing, or otherwise subverting the verifier or its inputs. Anthropic’s curriculum study found LLM assistants trained on a sequence of easily-discovered specification-gaming environments generalize, zero-shot and non-negligibly often, to rewriting their own reward function or checker (Denison et al., “Sycophancy to Subterfuge: Investigating Reward-Tampering in Large Language Models,” arXiv:2406.10162). Common gotcha: a file/process-based deterministic flag verifier is often reachable from the same shell the agent operates in — so “make the verifier deterministic” is necessary but not sufficient. The verifier must also be isolated from the agent’s action space: verify out-of-band (a separate process/host the agent has no write path to), read env/server state the agent cannot mutate, or run outside the agent’s sandbox entirely. Determinism defeats gaming; isolation is the separate, additional requirement that defeats tampering.

6. “Three knobs” was a teaching scaffold

The on/off-policy axis and the imitation/preference/reward paradigm split are canonical. Packaging them as “N independent knobs you toggle” is a scaffold that over-reached — the axes aren’t independent (signal + policy largely determine what changes), so free combinations produce non-methods. Learn the one axis + the fixed method presets, not a combinatorial grid.

7. Pass@k-as-diagnostic has its own landmines — don’t trust a bare crossover plot [E][R]

Point 1’s crossover test (base pass@large-k beats RL pass@large-k → RL only reweighted, didn’t teach) is the closest thing to a standard instrument in this literature, but it is contested on at least four fronts — the lucky-final-answer confound (CoT-Pass@K), the guessing-vs-reliability conflation (Cover@τ), the vanishing-gradient trap in optimizing pass@k directly (fixed by PKPO), and the task-structure-dependent agentic crossover (Pass@(k,T)) — all worked through in full, with citations, in Diagnosing the gap §2 (“The core instrument: pass@k → Cover@τ → Pass@(k,T)”).

Safe framing: treat the pass@1-vs-pass@k gap as a diagnostic to segment by challenge type, not a single portfolio-wide verdict — never trust an aggregate plot. The CTF-domain analogue of the CoT-Pass@K confound: a verifier-passed trajectory can still contain wasted turns or an ungrounded critical guess before the winning move, so filtering your rejection-sampling SFT set on flag==1 alone reproduces the same lucky-answer-credit problem one level up. A shrinking gap with flat pass@1 is the entropy-collapse warning sign (point 8 below), not “the model learned the task.”

8. Long-horizon credit assignment: turn-level vs trajectory-level vs sequence-level — no consensus on the right granularity [L]

Every flagship reasoning-RL recipe (GRPO, DAPO, Dr.GRPO) assigns one advantage to the whole trajectory — fine for a single-turn math answer, but it starts to matter once episodes run 100 turns with a terminal-only flag reward. The literature has responded with at least three different, non-convergent fixes, each validated on a different (mostly non-CTF, mostly short) domain:

  • Go finer — turn-level advantage. arXiv:2505.11821 shows trajectory-level GRPO applied naively to multi-turn tool-use can fail to teach tool invocation at all (baselines get 20-30% exact-match and never learn to call tools; their turn-level MT-GRPO variant hits 100% tool-execution success). Turn-PPO, arXiv:2512.17008 independently argues PPO-with-a-critic, reformulated so the MDP’s base unit is a turn (not a token), is more robust than GRPO for long-horizon agentic tasks — a direct challenge to defaulting to critic-free GRPO. Both are recent, small-scale (workshop poster / 0-citation preprint, toy benchmarks WebShop/Sokoban) — promising, not settled.
  • Go coarser — sequence-level ratio. GSPO, arXiv:2507.18071 goes the opposite direction: clip and optimize at the whole-response (sequence) level instead of per-token, because token-level importance ratios compound multiplicatively over long sequences and destabilize MoE RL training at scale — credited with letting Qwen3’s RL stage not destabilize. Backed by a shipped frontier model, not a toy benchmark — stronger evidence than Turn-PPO’s, but solving a different problem (numerical stability of the ratio, not credit assignment across turns): the two proposals are not mutually exclusive, but they are not the same fix either.
  • Fix the critic, don’t change the granularity. VAPO, arXiv:2504.05118 keeps trajectory-level PPO but argues the real problem is an unreliable critic at long/heterogeneous horizons — fixed with value-model pretraining + length-adaptive GAE (λ tuned per response length) — reporting zero training crashes across independent runs, directly disputing the “value-based RL is unstable for LLM reasoning” folklore GRPO was invented to route around.
  • Scale the horizon itself, skip the value function entirely. Kimi k1.5, arXiv:2501.12599 treats context/horizon length as a first-class RL scaling axis (not a constraint), using partial rollouts (checkpoint/resume mid-episode) to make 128k-context RL tractable — explicitly avoiding MCTS, value functions, and PRMs. Reframes “the episode is long” as an opportunity, contingent on whether security-agent-<family>/pdq can support partial-rollout checkpointing (unanswered today).
  • Curriculum over the horizon. AgentGym-RL / ScalingInter-RL, arXiv:2509.08755 sidesteps the granularity debate entirely: cap the allowed turn budget low early in training and relax it toward the full target (100 turns) as training proceeds, reporting this prevents the long-horizon collapse that training at full horizon from step one causes.

Designed to fix a common failure: agents commonly prefer raw shell/HTTP over provided higher-level tools, leaving much of the tool surface unused (tool-selection reliability is itself an open problem — cf. arXiv:2505.18135) → turn-level credit assignment / tool-use RL. The turn-level papers’ headline finding (trajectory-level GRPO can fail to teach tool invocation at all) is a plausible root-cause mechanism for tool disuse, not just a scaffolding/prompting issue, if this project ever RL-trains on tool-use.

Confidence: contested by construction — no single paper compares turn-level vs sequence-level vs trajectory-level-with-a-better-critic head-to-head on the same long-horizon agentic benchmark. Most of this cluster is 2025 H2–2026 preprints with 0 citations at verification time, validated on toy environments (WebShop, Sokoban) or math/code, not a 100-turn CTF setting. Treat as “candidate designs to pilot cheaply,” not a default architectural choice — and note turn-level, sequence-level, and critic-repair are not mutually exclusive; a future GRPO/RLVR run here could combine GSPO’s sequence-level clipping (stability) with a turn-level auxiliary tool-invocation reward without contradiction.

9. Do exploration bonuses genuinely EXPAND [N] the boundary, or just elicit what the base model already has? — open question, no paper has run the decisive test on this domain

Point 1 already flags “RL expands vs. only reweights” as contested between Yue et al. and ProRL. The exploration-specific literature (DIVER, CDE, MERCI, PSN-RLVR) all claim their intrinsic-reward/parameter-noise mechanism helps the policy “escape local routines” or “discover better solutions” — language asserting [N] (boundary expansion) rather than mere elicitation. That claim deserves the same skepticism point 1 applies to vanilla RLVR:

  • None of the exploration-bonus papers ran the decisive ablation. The rigorous test for “did this expand the boundary or just elicit/redistribute” is a pass@large-k comparison against the base model (point 1’s own protocol) — DIVER (arXiv:2509.26209), CDE (arXiv:2509.09675), MERCI (arXiv:2510.16614), and PSN-RLVR (arXiv:2602.02555) all compare against vanilla-GRPO/DAPO baselines, not against a very-large-k base-model ceiling. Beating a collapsed-entropy baseline is a much lower bar than beating the base model’s own pass@1024 — and per Spurious Rewards, arXiv:2506.10947, even a completely wrong reward can look like it’s “unlocking” capability on the right base model (Qwen2.5-Math specifically; does not replicate on Llama3/OLMo2) — a stark warning that “the policy now solves things it didn’t before” is not sufficient evidence of genuine novelty without a same-model-family, large-k, base-vs-trained comparison.
  • The capability-elicitation / AI-safety literature already built the falsification protocol for exactly this question — password-locked models (arXiv:2405.19550), harder circuit-broken organisms (The Elicitation Game, arXiv:2502.02180), and the “elicit within <1% of training cost” operational definition of latent capability (AI Sandbagging, arXiv:2406.07358) — all built around known-ground-truth hidden capabilities specifically to distinguish “the technique surfaced something already there” from “the technique taught something new.” No exploration-bonus paper in the RLVR-entropy literature has been tested against a model organism with known injected/withheld capability the way this sub-field requires before it will accept an expansion claim.
  • The one paper that ran something close to the decisive test, on an agentic/compositional task, found genuine expansion — but it’s a single, very recent result. Pass@(k,T), arXiv:2604.14877 (point 7 above) shows RL pulls ahead of base-model pass@k on compositional, sequentially-gated tasks, and — critically — that matched-data SFT on the same tasks regresses the capability boundary (net −4 vs RL’s net +4), isolating self-directed exploration during RL, not exposure to more data, as the causal factor. This is the strongest evidence in the entire corpus that exploration specifically (not RL in general, not more data) is what expands the boundary — but it is one paper (2026-04-16), one research group, unreplicated, studying retrieval-style compositional tasks, not cybersecurity.

Designed to fix a common failure: tool avoidance, and confident guessing that only fails on the hard cases → exploration-bonus RL. DIVER’s pairwise-diversity-of-a-group reward and CDE’s perplexity-based actor bonus are both pitched as countering exactly these behavioral patterns. That framing may be correct as an elicitation mechanism (surfacing tool-diverse or better-calibrated behavior the base model can already produce with a nudge) even if the “expands the boundary” language in the papers’ abstracts is not yet earned.

Confidence: genuinely open. The honest position for this project: exploration bonuses are worth piloting (cheap, mechanistically motivated, all portable per the exploration research thread) — but do not claim any of them “expand the capability boundary” [N] until you’ve run a pass@large-k-vs-base-model check on the same challenge subset (point 1/7’s protocol), ideally segmented by task compositionality the way Pass@(k,T) recommends. Absent that check, the safer verb is “elicit” (base capability present, surfaced more reliably), matching this project’s own competence/performance framing, rather than “expand” (base capability genuinely absent, newly created).

References

Every id below was crawl-verified during the sessions that built this book (title/authors/date confirmed on the arXiv abstract page). Lab blogs/tech reports are linked to their source. Citation counts are unreliable for <18-month-old work — venue/lab-report presence is the stronger signal.

Foundations & imitation

Preference

Reinforcement

Long-horizon & multi-turn agentic RL — credit assignment across turns, not tokens

  • GiGPO (step-level advantage from state-hash-matched steps across rollouts, zero extra rollouts) — arXiv:2505.10978
  • ArCHer (two-timescale: off-policy turn-level critic + on-policy token-level PG) — arXiv:2402.19446
  • RAGEN / StarPO (multi-turn agentic RL framework, state-thinking-action loop) — arXiv:2504.20073
  • Turn-Level Reward Design (dense per-turn reward layered under a terminal reward) — arXiv:2505.11821
  • Turn-PPO (turn as the MDP unit, not token or trajectory) — arXiv:2512.17008
  • Demystifying RL for Long-Horizon Tool-Using Agents (5-axis systematic ablation: reward/scale/data/algorithm/environment) — arXiv:2603.21972
  • Verlog (dual-discount GAE, memory-windowing, validated to 400+ turn episodes) — no arXiv id, cite OpenReview:GmodkWwMV3
  • Kimi k1.5 (128k-context RL via partial-rollout checkpoint/resume, no MCTS/value-fn/PRM) — arXiv:2501.12599
  • AgentGym-RL / ScalingInter-RL (horizon curriculum: short turn cap expanding to full budget over training) — arXiv:2509.08755
  • MUA-RL (trains against a dynamic, LLM-simulated counterpart instead of a static script) — arXiv:2508.18669
  • HiPER (hierarchical credit assignment) — arXiv:2602.16165 · Hindsight Credit Assignment for Long-Horizon LLM Agents — arXiv:2603.08754
  • RL-PLUS (names “capability boundary collapse” — pass@k at large k dropping even as pass@1 rises under RLVR) — arXiv:2508.00222

Hierarchical RL, decomposition & potential-based reward shaping — “one problem, or many?”

  • Sutton — “The Bitter Lesson” (hand-built structure plateaus, general search+learning wins at scale; intellectual ancestor of the monolithic-outcome-RL case) — no arXiv id, incompleteideas.net (2019)
  • OpenAI Deep Research system card (long-horizon tool-using agent trained end-to-end on outcome/rubric reward; “end-to-end training beats manual orchestration”) — no arXiv id, OpenAI system card
  • Options / SMDP framework (Sutton, Precup, Singh — the seminal HRL / temporal-abstraction paper) — Artificial Intelligence 112 (1999), no arXiv id, DOI 10.1016/S0004-3702(99)00052-1
  • FeUdal Networks (Manager/Worker HRL, fixes option-collapse) — arXiv:1703.01161
  • HIRO (off-policy correction for HRL non-stationarity / subgoal ceiling-capping) — arXiv:1805.08296
  • Ng, Harada & Russell — potential-based reward shaping, F(s,a,s')=γΦ(s')−Φ(s) provably policy-invariant — ICML 1999, no arXiv id (predates arXiv’s routine ML use), ACM DL 10.5555/645528.657613
  • Müller & Kudenko (PBRS practical effectiveness still depends on potential scaling) — arXiv:2502.01307
  • RUDDER (learned, return-equivalent reward redistribution — a learned alternative to hand-specifying Φ) — arXiv:1806.07857
  • Go-Explore (pure outcome RL structurally fails on sparse/deceptive long-horizon tasks without explicit remember-and-return exploration) — arXiv:1901.10995 / Nature s41586-020-03157-9
  • OpenAI Five (long-horizon precedent needed huge scale + a per-frame shaped reward, not a single terminal bit) — arXiv:1912.06680
  • Credit Assignment survey (separates credit-assignment variance from exploration burden) — arXiv:2312.01072
  • MiRA (milestone-based dense reward; Gemma3-12B WebArena-Lite 6.4%→43.0%, beating WebRL/GPT-4-Turbo) — arXiv:2603.19685
  • Verifiable Process Rewards / VPR (safe ground-truth checklist process reward; own caveat that open/unstructured stages remain unsolved) — arXiv:2605.10325
  • CM2 (checklist-style verifiable sub-criteria reward) — arXiv:2602.12268
  • Curriculum Learning (Bengio et al. — foundational, order training by difficulty, touches no reward function) — ICML 2009, no arXiv id
  • h1 (curriculum + pure outcome-only reward yields an exponential sample-complexity gain) — arXiv:2510.07312
  • FastCuRL (context-length curriculum, entropy-collapse timing) — arXiv:2503.17287
  • BPO (curriculum + rejection-sampling refine; vanilla GRPO on sparse reward gains only marginally without curriculum) — arXiv:2508.03018
  • TIPS (turn-level potential shaping for search-augmented LLMs — shaping machinery directly on-point, domain is not) — arXiv:2603.22293
  • Randlov & Alstrom — the canonical non-potential-based “bicycle shaping” failure (agent farms a looks-like-progress bonus instead of reaching the goal) — ICML 1998, no arXiv id
  • Kill-chain-staged reward (cyber-defense red-teaming) (academic cybersecurity-LLM work — cited for context only, not a basis)arXiv:2605.17075 (May 2026)
  • DRLRM-PT (reward machine over kill-chain phases, classical/non-LLM pentest RL) (academic — cited for context only, not a basis; explicitly named in the project’s standing rule)arXiv:2405.15908 / DOI 10.1109/ijcnn60899.2024.10650368
  • Node-fragility reward shaping (classical dense-reward pentest, non-LLM regime) (academic — cited for context only, not a basis) — DOI 10.3390/electronics13214311

Tool-integrated / tool-use RL — fixes for a commonly-observed tool-avoidance failure mode

  • ReTool (trajectory-level tool-integrated RL) — arXiv:2504.11536
  • ToRL (tool-integrated RL, math) — arXiv:2503.23383
  • Search-R1 (RL for search-agent tool use) — arXiv:2503.09516
  • ToolRL (fine-grained, decomposed per-call tool-selection reward) — arXiv:2504.13958
  • Tool-Star (forced exposure to under-used tools via multi-tool synthesis pre-RL) — arXiv:2505.16410
  • Tool Preferences in Agentic LLMs are Unreliable (diagnosis of pattern-1-shaped tool avoidance) — arXiv:2505.18135

Exploration & entropy collapse

  • The Entropy Mechanism of RL for Reasoning LMs (R = -a·e^H + b; Clip-Cov/KL-Cov fixes) — arXiv:2505.22617
  • Beyond the 80/20 Rule (top-20%-entropy “forking tokens” carry nearly all exploration signal) — arXiv:2506.01939
  • Reasoning with Exploration: An Entropy Perspective — arXiv:2506.14758
  • Representation-Based Exploration for Language Models (hidden-state diversity bonus, usable at inference time) — arXiv:2510.11686
  • Pass@k Metric for RLVR: A Diagnostic Tool of Exploration, But Not an Objective — arXiv:2511.16231
  • Spurious Rewards (RLVR gains on Qwen2.5-Math nearly as large with completely wrong rewards; model-family-dependent) — arXiv:2506.10947
  • Absolute Zero (self-play task-proposal + solve, zero external labeled data) — arXiv:2505.03335
  • LIMO (817 curated SFT examples beat >100k loosely-curated ones — SFT as cognitive templates, not knowledge source) — arXiv:2502.03387
  • Test-time compute scaling (Snell et al., difficulty-adaptive allocation matches a 14x larger model) — arXiv:2408.03314 · o3-mini vs o1-mini (accuracy without longer CoT) — arXiv:2502.15631
  • OpenAI o1 System Card (methodology precedent, cited across the field) — arXiv:2412.16720
  • Reward-hacking-under-RL cluster: Specification Gaming in Reasoning Models — arXiv:2605.02269 · LLMs Gaming Verifiers (extensional vs intensional correctness) — arXiv:2604.15149 · Reward Hacking in the Era of Large Models (Proxy Compression Hypothesis) — arXiv:2604.13602
  • Per-step / process-reward hacking convergence (the case against naive per-stage reward): PURE / Stop Summation (summation-form credit assignment “easily induces LLMs to hack steps with high rewards”) — arXiv:2504.15275 · Reward Under Attack (SOTA PRMs as “fluency detectors rather than reasoning verifiers”) — arXiv:2603.06621 · Gao et al. (learned PRM/ORM + success reward can hurt vs success-only) — arXiv:2410.15115 · PRIME (authors’ own admission that process labels are “prohibitively expensive,” PRMs vulnerable to hacking) — arXiv:2502.01456 · MONA (multi-step reward hacking even when no single step looks bad to an overseer) — arXiv:2501.13011

Self-correction & tool-use self-correction RL

  • SCoRe — Training LMs to Self-Correct via RL (reward for improvement, not final correctness) — arXiv:2409.12917
  • From Correction to Mastery (earliest-error RL, distinct “SCoRe”) — arXiv:2509.14257

Post-training recipe as a sequence — order, compounding, synthetic-trajectory bootstrap

(new citations from The recipe is a sequence, not a pick; ids already covered elsewhere — Llama 3, Tülu 3, OLMo 2, DeepSeek-V3/R1, Qwen3, GRPO/DeepSeekMath, LoRA-learns-less, STaR, RAFT, ReST-EM, DAPO, the rejection-sampling→REINFORCE entropy-collapse paper, “Scalpel vs Hammer” — are not repeated here.)

  • Self-Instruct (off-policy synthetic instruction generation) — arXiv:2212.10560
  • WizardLM / Evol-Instruct (off-policy synthetic, complexity-evolved instructions) — arXiv:2304.12244
  • Llama 2 (RLHF report; iterative-round rejection-sampling non-monotonicity — “struggled more… to compose rhyming lines” when only the latest round was sampled) — arXiv:2307.09288
  • Persona-driven synthetic data generation — arXiv:2406.20094
  • Qwen2.5 (dense 0.5B–72B; explicit SFT→offline-DPO→online-GRPO staging) — arXiv:2412.15115
  • “SFT Memorizes, RL Generalizes” (GeneralPoints/V-IRL testbed; SFT stabilizes format, RL then generalizes) — arXiv:2501.17161 (ICML 2025 poster)
  • Llama-Nemotron (post-training recipe report) — arXiv:2505.00949
  • Distillation-vs-pattern-imitation ablation (“only the DeepSeek model shows a meaningful increase in capability” — new knowledge, not pattern transfer, is what expands pass@k) — arXiv:2505.14216
  • AdaSTaR (efficient iterative rejection-sampling; curriculum sampling, −58.6% training FLOPs at equal-or-better accuracy) — arXiv:2505.16322
  • SFT-vs-RFT forgetting comparison (SFT 52.1%→40.1% drop vs. RFT 54.2% improvement on the same setting) — arXiv:2507.05386
  • “RL Fine-Tuning Heals OOD Forgetting in SFT” (contested re-framing of “SFT memorizes/RL generalizes” as “SFT forgets, RL recovers”) — arXiv:2509.12235
  • Domain-continual pretraining forgetting / backward-transfer at scale (“moderate forgetting, low-to-moderate backward transfer”) — arXiv:2510.17776
  • Backward-synthesis answer-anchoring / confabulation risk (STaR-rationalization follow-up; the answer acts as a cognitive anchor) — arXiv:2602.14469
  • “Revisiting DAgger in the Era of LLM-Agents” (SFT’s off-policy covariate shift vs. RLVR’s on-policy but sparse feedback, stated precisely for multi-turn agents) — arXiv:2605.12913
  • Qwen3-4B SFT degrading TruthfulQA/HaluEval (Qwen-family-specific forgetting evidence) — arXiv:2605.20005

Is the recipe a loop? — round-trip revisits, non-commutativity, loop-exit criteria

(new citations from Is the recipe a loop?; ids already covered elsewhere — DeepSeek-R1, Llama 3, STaR, ReST-EM, the non-decoupling proof 2601.07389, Task Arithmetic 2212.04089, TIES 2306.01708 — are not repeated here.)

  • Self-Rewarding Language Models (iterative DPO, judge+generator both re-derived from the current policy each round) — arXiv:2401.10020
  • Apple AFM iTeC (committee of RS/DPO/IPO/online-RL variants, round-over-round evaluation picks the propagating optimizer) — arXiv:2407.21075
  • Havrilla et al. — Teaching LLMs to Reason with RL (EI/RCRL: generate with SFT checkpoint, reset training to base — model-resetting “crucial for best performance”; also the n=5-until-saturation loop-exit rule) — arXiv:2403.04642
  • “Iterative Finetuning is Mostly Idempotent” (U Chicago; trait amplification vanishes when models are reinitialized each cycle) — arXiv:2605.01130
  • WARM (souped reward models) — arXiv:2401.12187 · WARP (merges inside every RL iteration: EMA anchor + spherical interpolation + linear interpolation to pretrained init) — arXiv:2406.16768
  • Model Soups (weight-averaging independently fine-tuned models often beats picking the single best) — arXiv:2203.05482
  • Overoptimization dynamics across iterations of iterated RLHF (overoptimization itself decreases each round; performance gains still diminish) — arXiv:2505.18126
  • Self-rewarding iterative DPO diminishing-gains shape (“accumulated bias in the reward system”) — arXiv:2410.12735
  • Off-policy preference optimization’s distributional gap between the data-collection policy and the target policy — arXiv:2406.11827
  • Multi-round online DPO, resampling from the updated policy each round — a principled justification, not a heuristic — arXiv:2506.04272
  • 20+-model RLHF scaling study (marginal gains despite increasing training reward — the loop-exit diminishing-returns signal) — arXiv:2412.06000
  • Niu, Bai, Han, Zhang — On the Non-decoupling of SFT and RL in Post-training (formal proof: SFT-then-RL and RL-then-SFT each provably degrade what the prior stage converged to, two distinct theorems) — arXiv:2601.07389

Ordering rules: interleaving stages & fixing N problems — provenance-based safety, N-problem batching

(new citations from Ordering rules: interleaving stages & fixing N problems; ids already covered elsewhere — DAgger 1011.0686, R1 2501.12948, STaR 2203.14465, Llama 4 blog, Tülu 3 2411.15124, Llama 2 2307.09288, catastrophic-forgetting 2308.08747, the non-decoupling proof 2601.07389, “Scalpel vs Hammer” 2507.10616, Task Arithmetic 2212.04089, Model Soups 2203.05482 — are not repeated here.)

  • Shenfeld, Pari, Agrawal — RL’s Razor (RL implicitly stays KL-close to the policy that generated its reward signal) — arXiv:2509.04259
  • CHORD (Zhang et al., Alibaba; foreign expert data onto a drifted policy produces a “shift → readapt → overfit” curve) — arXiv:2508.11408
  • “RL Is Neither a Panacea Nor a Mirage” (RL-FT restores moderate SFT-induced OOD damage but not a checkpoint pushed into a markedly different representation regime) — arXiv:2508.16546
  • “Towards On-Policy SFT” (no improved SFT strategy fully eliminates forgetting once the data distribution deviates from the model’s own) — arXiv:2602.12222
  • “Mind the Gap” (have the current model rewrite a foreign demonstration into its own voice before training on it) — arXiv:2509.15157
  • PEAR (down-weight SFT tokens implausible under the current policy — loss-weighting version of the same data-alignment fix) — arXiv:2602.01058
  • Forgetting is biased, not uniform, across categories under sequential fine-tuning — arXiv:2412.16469
  • de Masson d’Autume et al. — Episodic Memory in Lifelong Language Learning (classical experience-replay mechanism) — arXiv:1906.01076
  • On-Policy Replay / OPR (10% on-policy replay budget lifts sequential-SFT backward-transfer from −13.93 to −0.65 on Qwen2.5-7B-Instruct) — arXiv:2605.29495
  • Excessive SFT measurably reduces subsequent RL plasticity (over-confident, sharper output distributions harder for RL to reshape) — arXiv:2606.09932
  • DMT (mixing specialized skills first, small general-ability replay slice added at the end — mix-within-a-stage-plus-final-replay recipe) — no arXiv id, OpenReview:6M5G5hNiAU

Data mixing, replay ratios & capability forgetting — reasoning-trace collapse, LoRA behavior-vs-magnitude

(new citations from Data mixing, ratios & not forgetting how to think; ids already covered elsewhere — DAgger 1011.0686, GKD 2306.13649, Biderman “LoRA Learns Less and Forgets Less” 2405.09673, “Scalpel vs Hammer” 2507.10616, Task Arithmetic 2212.04089, TIES-Merging 2306.01708, DARE 2311.03099, Scialom et al. 2205.12393, Ibrahim et al. 2403.08763, InstructGPT alignment-tax 2203.02155, R1 2501.12948 — are not repeated here.)

  • Twist, Yannakoudakis, Zhang (King’s College London) — “Reasoning-Trace Collapse: Evaluating the Loss of Explicit Reasoning During Fine-Tuning” (names the phenomenon; answer-only accuracy hides the collapse; loss-masking fix) — arXiv:2605.21127
  • Lobo, Agarwal, Lakkaraju — “On the Impact of Fine-Tuning on Chain-of-Thought Reasoning” (NAACL 2025; SFT on non-reasoning data reduces CoT accuracy and faithfulness, worse in smaller models) — arXiv:2411.15382
  • Zhang, Lin, Rajmohan, Zhang (Microsoft) — “From Reasoning to Answer” (Reasoning-Focus Heads; activation patching on reasoning tokens causally alters the final answer) — arXiv:2509.23676
  • Zhang, Morris, Shmatikov (Cornell Tech, ICML 2026) — fine-tuning with vs. without reasoning traces present, large measured MATH500/JEEBench deltas — arXiv:2603.07267
  • Zhu, Zhang, Wang, Xu, Lyu, Wu — “To Think or Not to Think” (empty <think></think> block flips straight to the final answer; the same behavior is backdoorable during ordinary SFT/DPO) — arXiv:2502.12202
  • Bengio et al. — scheduled sampling / exposure bias (the sequence-level, purely-supervised restatement of the DAgger covariate-shift result) — arXiv:1506.03099
  • Zhou et al. (Meta AI) — LIMA (65B LLaMA SFT’d on 1,000 curated pairs; Superficial Alignment Hypothesis — format is cheap to (un)learn) — arXiv:2305.11206
  • Lermen, Rogers-Smith, Ladish — “LoRA Fine-tuning Efficiently Undoes Safety Training in Llama 2-Chat 70B” (QLoRA takes refusal rate to ~1% while preserving general-capability benchmarks) — arXiv:2310.20624
  • Shuttleworth, Andreas, Torralba, Sharma (MIT) — “LoRA vs Full Fine-tuning: An Illusion of Equivalence” (LoRA develops “intruder dimensions” full fine-tuning does not; forgetting is concentrated there and worsens across sequential LoRA rounds) — arXiv:2410.21228
  • “Representation Collapse in Sequential Post-Training of Large Language Models” (LoRA updates from different stages occupy overlapping subspaces; long-CoT tuning carves a separable reasoning-format manifold) — arXiv:2605.30524
  • Kalajdzievski — rsLoRA, rank-stabilization scaling factor (γ = α/√r; now use_rslora in HF PEFT) — arXiv:2312.03732
  • PiSSA (learning-capacity accelerant; moves LoRA behavior closer to full fine-tuning’s) — arXiv:2404.02948
  • DoReMi (Xie et al., NeurIPS 2023; Group-DRO domain weights beat the default heuristic mixture by 6.5 points) — arXiv:2305.10429
  • RegMix (Liu et al., ICLR 2025 Spotlight; “domains interact in complex ways often contradicting common sense”) — arXiv:2407.01492
  • Scaling Laws for Optimal Data Mixtures (Shukor et al., Apple, NeurIPS 2025; analytically solves for optimal domain weights given a budget) — arXiv:2507.09404
  • Tülu 2 (explicit downsample of oversized FLAN, dropped Dolly entirely for hurting the mix average) — arXiv:2311.10702
  • GeRe (small fixed general-sample replay set resolves both general-capability and task-specific forgetting) — arXiv:2508.04676
  • Marek, Cho, Qiu, Chunara, Izmailov, Wilson (NYU) — self-generated replay (sampling the model’s own completions before fine-tuning nearly eliminates forgetting, only with spare capacity) — arXiv:2605.26097
  • Spiegelhalter, Franke, Hutter (NeurIPS 2025 workshop) — replay-ratio sweep, “more than 5–10% replay is not necessary for general knowledge retention” — arXiv:2510.11842
  • Kotha & Liang — generic-distribution replay can improve, not just preserve, target-task data efficiency — arXiv:2603.04964
  • Zheng et al. — spurious-forgetting result, old-task performance restored by briefly training on ~10 anchor/alignment instances (ICLR 2025) — arXiv:2501.13453
  • Maximal-Update Adaptation (formalizes why the optimal LoRA LR moves with rank) — arXiv:2602.06204
  • Thinking Machines Lab — “LoRA Without Regret” (frontier-lab operational report; optimal LoRA LR ≈10× full-FT LR, both SFT and RL) — no arXiv id, thinkingmachines.ai/blog/lora (2025)

The kinds of SFT & Method → Data — data selection, decontamination, on-policy distillation

(new citations from The kinds of SFT — it is the data, not the algorithm and Method → Data (your real bottleneck); ids already covered elsewhere — Self-Instruct 2212.10560, WizardLM/Evol-Instruct 2304.12244, phi-1 2306.11644, Hinton distillation 1503.02531, GKD 2306.13649, RAFT 2304.06767, STaR 2203.14465, ReST 2308.08998, ReST-EM 2312.06585, AgentInstruct/AgentLM 2310.12823, DeepSeek-R1 2501.12948, LIMA 2305.11206, LoRA Learns Less and Forgets Less 2405.09673, Llama 2 2307.09288, Gorilla 2305.15334, ToolBench/ToolLLaMA 2307.16789, InstructGPT 2203.02155 — are not repeated here.)

  • Kim & Rush — Sequence-Level Knowledge Distillation (teacher-executed transcript distillation) — arXiv:1606.07947
  • FireAct (formalized agentic-trajectory SFT) — arXiv:2310.05915
  • AlpaGasus (LLM-judge filtering beats full-dataset training) — arXiv:2307.08701
  • Cherry_LLM / IFD selection (cheap self-guided intrinsic quality filter) — arXiv:2308.12032
  • LESS (targeted, capability-specific data selection) — arXiv:2402.04333
  • DEITA — What Makes Good Data for Alignment? (complexity/quality/diversity selection axes) — arXiv:2312.15685
  • Béthune et al. — Scaling Laws for Forgetting during Finetuning with Pretraining Data Injection (replay-slice mitigation, forgetting mechanism) — arXiv:2502.06042
  • Always Learning, Always Mixing (~10% replay as a practical mitigation baseline) — arXiv:2605.15220
  • Benchmark Data Contamination of LLMs: A Survey — arXiv:2406.04244
  • LLMSanitize (contamination detection tooling) — arXiv:2404.00699
  • Rethinking On-Policy Distillation of LLMs (on-policy distillation only helps with genuinely new teacher signal) — arXiv:2604.13016

Start here: a proven-first ranking of the methods — tiering metric, method-selection

(new citation from Start here: a proven-first ranking of the methods; this chapter is otherwise a recombination — under a proven-by-usage tiering metric — of methods already cited above: GRPO 2402.03300, RLVR/R1 2501.12948, PPO 1707.06347, DAPO 2503.14476, GSPO 2507.18071, GiGPO 2505.10978, PRM 2305.20050, DPO 2305.18290, KTO 2402.01306, InstructGPT 2203.02155, ORPO 2403.07691, SimPO 2405.14734, IPO 2310.12036, Constitutional AI/RLAIF 2212.08073, STaR 2203.14465, RAFT 2304.06767, ReST 2308.08998, Hinton distillation 1503.02531, GKD 2306.13649, WizardLM/Evol-Instruct 2304.12244, Llama 2 2307.09288, Tülu 3 2411.15124, Qwen3 2505.09388, Llama-Nemotron 2505.00949 — not repeated here.)

  • Gemma 2 (flagship-disclosed teacher-distillation production use, cross-references Gemini 1.5) — arXiv:2408.00118

Continued pretraining on an instruction-tuned model — preservation techniques

(new citations from Continued pretraining on an instruction-tuned model; LoRA-learns-less-forgets-less [2405.09673] already cited above, not repeated.)

  • DAPT — Gururangan et al., “Don’t Stop Pretraining: Adapt Language Models to Domains and Tasks” (ACL 2020, seminal domain-adaptive-pretraining concept) — arXiv:2004.10964
  • MMLU — Hendrycks et al. — arXiv:2009.03300
  • Scialom et al. — replay mitigates forgetting in continual instruction-tuning (EMNLP 2022) — arXiv:2205.12393
  • Ilharco et al. — “Editing Models with Task Arithmetic” (ICLR 2023, seminal task-vector/delta-arithmetic result) — arXiv:2212.04089
  • TIES-Merging (NeurIPS 2023; trim + elect-sign + merge) — arXiv:2306.01708
  • Gupta et al. — continual-pretraining LR re-warm/re-decay — arXiv:2308.04014
  • Luo et al. — empirical study of catastrophic forgetting in LLMs during continual fine-tuning (1B–14B; forgetting worsens with scale) — arXiv:2308.08747
  • AdaptLLM — auto-converts raw domain text into reading-comprehension/QA replay pairs — arXiv:2309.09530
  • Qi, Zeng et al. — “Fine-tuning Aligned Language Models Compromises Safety, Even When Users Do Not Intend To!” (ICLR 2024) — arXiv:2310.03693
  • Chat Vector (Huang et al., ACL 2024; language-shift instance of the task-arithmetic reattach recipe) — arXiv:2310.04799
  • DARE — “Super Mario” random delta-dropping + rescaling (ICML 2024) — arXiv:2311.03099
  • IFEval — “Instruction-Following Evaluation for Large Language Models” (Zhou et al., Google) — arXiv:2311.07911
  • LLaMA Pro — block-expansion CPT that never touches original weights, then a separate instruction-tuning pass (ACL 2024) — arXiv:2401.02415
  • Li & Lee — “Examining Forgetting in Continual Pre-training of Aligned Large Language Models” (direct CPT-on-Llama-2-7b-chat comparison) — arXiv:2401.03129
  • RESTA — DARE-sparsified delta subtraction/restoration (ACL 2024) — arXiv:2402.11746
  • Ibrahim et al. — simple/scalable continual-pretraining strategies (re-warm+re-decay+replay matches from-scratch retraining) — arXiv:2403.08763
  • Qi et al. — “Safety Alignment Should Be Made More Than Just a Few Tokens Deep” (ICLR 2025 Oral; shallow safety-alignment mechanism) — arXiv:2406.05946
  • Instruction Pre-Training (Microsoft, EMNLP 2024; 200M synthesized instruction-response pairs woven into raw CPT corpus) — arXiv:2406.14491
  • Jindal, Badrinath, Bharti, Vinay & Sharma (Samsung Research) — “Balancing Continuous Pre-Training and Instruction Fine-Tuning” (the direct S1-vs-S2 CPT-on-instruct-vs-base comparison, 4 model families) — arXiv:2410.10739
  • Mousavi, Alghisi & Riccardi (U. Trento) — “What Does Loss Optimization Actually Teach, If Anything? Knowledge Dynamics in Continual Pre-training of LLMs” (loss curves don’t reveal instruct-layer damage in real time) — arXiv:2601.03858
  • Zheng, Cai, Qiu & Ma — “Spurious Forgetting in Continual Learning of Language Models” (ICLR 2025 poster; forgetting is often a task-alignment/metric artifact, not true knowledge loss) — no arXiv id, OpenReview:ScI7IlKGdI
  • Harmon, Hochlehnert, Bethge & Prabhu (Tübingen AI Center) — “Mapping Post-Training Forgetting in Language Models at Scale” (~30 model pairs; “model merging does not reliably mitigate forgetting”) — no arXiv id found, anonymous ICLR 2026 submission, OpenReview:qCIg2WGudx

Datasets (proven-by-usage) — general post-training data, Sequence-B rungs

Full registry, inclusion rule, and per-dataset detail: Proven post-training datasets — a usage-cited registry. Papers backing named training recipes for these datasets (Tülu 3, OLMo 2, Qwen2.5-Math, DPO, KTO, IPO, ORPO already cited above, not repeated):

Case study: how coding engineered its data — the 4-rung execution-in-the-loop ladder

(new citations from Case study: how coding engineered its data (and what transfers to cyber); ids already covered elsewhere — StarCoder 2305.06161, StarCoder2/Stack v2 2402.19173, DeepSeek-Coder 2401.14196, Phi-1 2306.11644, Self-Instruct 2212.10560, CodeRL 2207.01780, PPOCoder 2301.13816, RLTF 2307.04349, StepCoder 2402.01391, SWE-Gym 2412.21139, R2E-Gym/SYNGEN 2504.07164, SWE-RL 2502.18449 — are not repeated here.)

  • The Stack (permissively-licensed GitHub corpus, 3.1→6.4TB) — arXiv:2211.15533
  • Code Llama (near-deduped GitHub pretraining, ~500B–1T tokens) — arXiv:2308.12950
  • Bavarian et al. — Fill-in-the-Middle (FIM span-corruption training objective) — arXiv:2207.14255
  • WizardCoder / Evol-Instruct (iterative complexity-mutation instruction synthesis, benchmark-pass@1-gated) — arXiv:2306.08568
  • Magicoder / OSS-Instruct (real-code-snippet-grounded synthetic instruction generation) — arXiv:2312.02120
  • CodeT (dual solution+test execution consensus, RANSAC-style) — arXiv:2207.10397
  • LEVER (execution-result-verified program synthesis) — arXiv:2302.08468
  • GenX (execution-verified rejection-sampling data generation) — arXiv:2412.13464
  • KodCode (execution-verified synthetic coding dataset at scale) — arXiv:2503.02951
  • SOL-VER (execution-verified solution generation) — arXiv:2502.14948
  • Self-Debugging (execution-error-message as part of the training row) — arXiv:2304.05128
  • SWE-bench (fail-to-pass execution oracle, 3-stage cascade denoising) — arXiv:2310.06770
  • SWE-MiniSandbox (kernel-level isolation, no full container; ~25% of Docker’s setup time, ~5% disk) — arXiv:2602.11210
  • SWE-World (learned Docker-free execution surrogate; surrogate+best-of-8 exceeds real-Docker baseline, 5–10% accuracy regression vs. ground truth) — arXiv:2602.03419
  • VeriScale (adversarial mutation-testing at scale; 83× test-suite expansion drops scores from 70–85% to 20–40%, exposing weak-verifier reward hacking) — arXiv:2605.22368
  • SpecBench-style analysis (reward-hacking gap grows ~28pp per 10× code-size increase; long-horizon visible-vs-hidden-test divergence) — arXiv:2605.21384 (not independently re-crawled this pass)
  • SWE-Bench Illusion (memorization vs. reasoning; 76% vs. 53% file-localization gap, 15–30% inflated SWE-Bench-Verified gains) — arXiv:2506.12286
  • Metamorphic testing for memorization diagnosis (semantics-preserving transforms; NLL-correlated post-transform collapse) — arXiv:2604.21579 (not independently re-crawled this pass)
  • BountyBench (CVE exploitation jumps ~5%→57.5–90% once vulnerability location is given — exploitation-as-retrieval evidence) — arXiv:2505.15216
  • SWE-Factory (automates the remaining manual environment-setup stages) — arXiv:2506.10954
  • SWE-Universe (million-scale environment generation with a hacking detector) — arXiv:2602.02361
  • Seed-Coder (replaces 100+ hand-crafted pretraining-data heuristics; execution-as-reward confirmation at scale) — arXiv:2506.03524
  • RepoZero (agent regenerates an existing package as its own test-case oracle; 30–55% pass rate, still Rung-3-with-a-harder-task) — arXiv:2605.07122
  • ProgramBench (fuzzes a gold compiled reference to reconstruct it; zero tasks fully resolved across 200 instances) — arXiv:2605.03546
  • CodeAlchemy (most extensively execution-verified attempt at a bootstrapped/real-code-seed-free Rung-4 pipeline) — arXiv:2606.10087
  • Output-diversity collapse under recursive synthetic training (independent reason a bootstrapped-only data pipeline degrades) — arXiv:2603.12683 (not independently re-crawled this pass)
  • CVE-Factory (three-stage multi-agent CVE→Docker pipeline; 95% solution correctness, 96% environment fidelity; produces LiveCVEBench) — arXiv:2602.03012
  • ARVO (large-scale vulnerable-target reconstruction/reproduction dataset) — arXiv:2408.02153
  • SoK: DARPA AIxCC (systematizes the 2023–2025 AI Cyber Challenge; patch/exploit semantic-correctness still substantially unsolved) — arXiv:2602.07666
  • All You Need Is A Fuzzing Brain (AIxCC runner-up; pure fuzzing+LLM system, 28 vulnerabilities found incl. 6 novel zero-days, 14 validated patches) — arXiv:2509.07225
  • CVE-Bench (evaluates exploitation rather than patching directly) — arXiv:2503.17332

Hint-guided bootstrapping — hint-then-mask, context distillation, LUPI

(new citations from Hint-guided bootstrapping — put the walkthrough in the prompt, then train it away; ids already covered elsewhere — STaR 2203.14465, HER 1707.01495, Go-Explore original 1901.10995, NuRL 2509.25666, Reward Hacking survey 2604.13602, Peng et al./RCG/SSR 2602.14469 — are not repeated here.)

  • TRICE (Phan et al.) — formalizes STaR-rationalization as biased stochastic-EM; gradient shrinks toward zero on the hardest, most-hint-dependent examples — arXiv:2312.02179
  • V-STaR (Hosseini et al.) — discarded hinted-failures reused as negative signal, not pure waste — arXiv:2402.06457
  • Askell et al. — coins “context distillation” for LLM alignment — arXiv:2112.00861
  • Choi et al. — Prompt Injection / PING, independent formalization of teacher(w/ prompt)→student(no prompt) on synthetic pseudo-inputs — arXiv:2206.11349
  • Snell, Klein, Zhong — generalized context-distillation framework, the exact hint-then-mask loss — arXiv:2209.15189
  • Kujanpää, Valpola, Ilin — prompt distillation matches RAG-level knowledge injection — arXiv:2412.14964
  • OPCD (Ye et al.) — on-policy fix for exposure bias / mode-covering forward-KL; names “experiential knowledge distillation” — arXiv:2602.12275
  • Nicolicioiu, Pezeshki, Courville — on-policy self-distillation from a sampled demo still collapses output diversity / flattens pass@k — arXiv:2606.26091
  • OPSA (Fu et al.) — “teacher flip rate” diagnostic for whether privileged context converts failures or just elicits — arXiv:2605.15239
  • HiLL (Xia et al.) — names “advantage collapse” + a differentiable “hint reliance” metric; lower reliance ⇒ stronger transfer to no-hint policy — arXiv:2604.00698
  • ReGFT (Wu et al.) — self-generated, reference-guided trajectories beat raw-reference SFT — arXiv:2603.01223
  • Multi-level Stepwise Hints (Zhang et al.) — graded hint depths as a concrete fading mechanism — arXiv:2507.02841
  • E2H Reasoner (Parashar et al.) — easy-to-hard curricula prevent overfitting to the assistance signal — arXiv:2506.06632
  • AdaRFT (Shi et al.) — adaptive difficulty targeting, same frontier-tracking spirit as hint-fading — arXiv:2504.05520
  • Nair, McGrew, Andrychowicz, Zaremba, Abbeel — classical precedent for explicit demo-loss annealing (hint fading) — arXiv:1709.10089
  • Go-Explore (Nature version) — canonical citation for “exploit, then robustify” — arXiv:2004.12919
  • Asymmetric Actor-Critic (Pinto et al.) — LUPI applied to deep RL, critic sees privileged sim state, actor doesn’t — arXiv:1710.06542
  • Shortcut Learning in Deep Neural Networks (Geirhos et al.) — seminal Clever-Hans framing; shortcuts indistinguishable on i.i.d. data — arXiv:2004.07780
  • HANS (McCoy, Pavlick, Linzen) — canonical NLI shortcut-detection challenge set — arXiv:1902.01007
  • Clever Hans on COPA (Kavumba et al.) — same recipe, different architecture — genuine vs. shortcut learner — arXiv:1911.00225
  • RAWR (Feng et al.) — input-reduction detection technique for artifact exploitation — arXiv:1804.07781
  • Turpin, Michael, Perez, Bowman — biasing a prompt toward an answer produces unfaithful, non-load-bearing CoT — arXiv:2305.04388
  • Ross, Peters, Marasović — self-rationalization can itself become a new shortcut surface, especially ungrounded — arXiv:2210.13575
  • Countdown-Code (Khalifa et al.) — as little as 1% contaminated distillation data teaches reward-hacking behavior, amplified by later RL — arXiv:2603.07084

Teaching a tool, teaching recon — data objects for tool-use vs. search RL

(new citations from Teaching a tool, teaching recon — the data behind a skill; ids already covered elsewhere — Gorilla 2305.15334, ToolBench/ToolLLaMA 2307.16789, APIGen/xLAM-function-calling-60k 2406.18518, APIGen-MT 2504.03601, Search-R1 2503.09516, ToolRL 2504.13958, WebGPT 2112.09332 — are not repeated here.)

  • Toolformer (Schick et al.) — self-supervised single (call, result) insertion into raw text, kept only if loss drops by ≥ τ_f against the real API output — arXiv:2302.04761
  • DocPrompting (Zhou et al.) — joint retriever+generator conditioned on retrieved docs, doc trusted as ground truth, no execution — arXiv:2207.05987
  • xLAM / APIGen-MT multi-turn extension (Salesforce) — arXiv:2409.03215
  • Nemotron-Research-Tool-N1 (NVIDIA) — pure RL from a cold start outperformed SFT-then-RL; thick SFT seed on distilled reasoning traces overfits to style and hurts downstream RL — arXiv:2505.00024
  • TIER — trajectory-supervised reward (matching one authored search path) collapses past depth 4–6 by penalizing valid alternative orderings; the negative case for hand-authoring a recon decision tree — arXiv:2605.16790

Domain-specialization lineages — the frontier recipe (code / math / medical)

  • Kaplan et al. — Scaling Laws for Neural Language Models — arXiv:2001.08361
  • Hoffmann et al. — Chinchilla, compute-optimal scaling — arXiv:2203.15556
  • phi-1 (textbook-quality data substitutes for ~100x scale in a narrow domain) — arXiv:2306.11644
  • DeepSeek-Coder V2 (abandons from-scratch pretraining, continues from a strong base) — arXiv:2406.11931
  • Qwen2.5-Math (co-evolves RM + SFT data across rounds before RL, reuses RM for best-of-N at inference) — arXiv:2409.12122
  • DeepSeek-Prover-V2 (subgoal-decomposed cold-start data + kernel-verified RL) — arXiv:2504.21801
  • OLMo 2 (mid-training as a named 5-10% FLOPs bridge stage) — arXiv:2501.00656
  • Mid-training mechanism study (outperforms CPT-alone at matched budget, reduces catastrophic forgetting before SFT) — arXiv:2510.14865
  • Med-PaLM v1 (mentioned, not a basis for cyber claims — prompt-tuning-only ceiling, motivates v2)arXiv:2212.13138
  • Med-PaLM 2 (domain instruction fine-tuning + ensemble refinement) — arXiv:2305.09617
  • MedGemma (domain VLM pretraining + task fine-tuning, explicitly not clinical-grade alone) — arXiv:2507.05201
  • Full fine-tuning vs. LoRA on code/math domain-skill acquisition (10-100x effective-rank gap) — arXiv:2405.09673
  • Benchmark contamination (GSM8K/MMLU scores inflated up to 22.9%/19.0%) — arXiv:2406.13990
  • LiveCodeBench (time-segmented, contamination-resistant-by-construction) — arXiv:2403.07974
  • GPQA (“Google-proof” QA) — arXiv:2311.12022
  • Tülu 3 (decontamination as a first-class deliverable; primary public naming of RLVR) — arXiv:2411.15124
  • Emerging RL-environment-scale bottleneck framing (moderate confidence, new/low-citation) — arXiv:2511.09586
  • SIMA (scalable instructable multiworld agent) — arXiv:2404.10179
  • SIMA 2 (self-generated tasks + rewards via Gemini) — arXiv:2512.04797

Adjacent-domain structural transfer — coding agents, competitive programming, theorem proving, web agents, games, robotics

  • SWE-agent / Agent-Computer Interface (fixed action set + concise feedback lifts pass@1 pre-RL) — arXiv:2405.15793
  • SWE-Gym (executable-environment SFT trajectories) — arXiv:2412.21139
  • R2E-Gym — arXiv:2504.07164
  • SWE-RL (execution-verified reward beats a difflib patch-similarity fallback) — arXiv:2502.18449
  • o1→o3 coding RL — arXiv:2502.06807
  • Progressive context/turn-budget curriculum for long-horizon RL — arXiv:2508.03501
  • SWE-Master (mask environment-feedback tokens out of the SFT loss, low-confidence/very recent) — arXiv:2602.03411
  • DeepSeek-Coder v1 (from-scratch pretraining, the lone exception in the lineage) — arXiv:2401.14196
  • StarCoder2 / The Stack v2 (curation quality substitutes for parameter count — data-pipeline lesson only) — arXiv:2402.19173
  • StarCoder — arXiv:2305.06161
  • CodeRL — arXiv:2207.01780
  • PPOCoder — arXiv:2301.13816
  • RLTF — arXiv:2307.04349
  • StepCoder — arXiv:2402.01391
  • RLEF (turn-level value function over a multi-turn POMDP; Meta FAIR, ICML 2025 spotlight) — arXiv:2410.02089
  • Sailor (SEA-language CPT) — arXiv:2404.03608
  • SEA-LION — arXiv:2504.05747
  • LLaMA Beyond English — arXiv:2401.01055
  • Tokenizer/vocabulary coverage as an architectural precondition — arXiv:2406.11477
  • BLOOM+1 (adding a new language to the SFT mixture beats continued pretraining) — arXiv:2212.09535
  • Aya — arXiv:2402.07827
  • AlphaCode (sampling breadth + cheap filter) — arXiv:2203.07814
  • GrandCode / Agentic GRPO (purpose-built GRPO variant for delayed reward + off-policy drift; single team, very recent) — arXiv:2604.02721
  • AlphaGeometry (Nature 2024; synthetic self-play manufactures its own training problems) — DOI 10.1038/s41586-023-06747-5
  • AlphaProof (Nature 2025; AlphaZero-style self-play/search on top) — DOI 10.1038/s41586-025-09833-y
  • WebGPT (learned human-preference reward; origin of the SFT-cold-start-then-RL recipe shape, flagged OOD-weak by its own authors) — arXiv:2112.09332
  • WebRL (self-evolving curriculum generated from the model’s own unsuccessful attempts; ICLR 2025) — arXiv:2411.02337
  • R1-Searcher (sequential, not summed, two-stage tool-use reward) — arXiv:2503.05592
  • DeepResearcher (training end-to-end in the real live environment is “a fundamental requirement”; EMNLP 2025) — arXiv:2504.03160
  • AlphaStar (Nature; league-based diverse self-play population fixes strategy collapse) — DOI 10.1038/s41586-019-1724-z
  • NetHack (honest “still unsolved” calibration point) — arXiv:2006.13760
  • HER — Hindsight Experience Replay (relabel a failed trajectory as the goal it accidentally satisfied; NeurIPS 2017) — arXiv:1707.01495
  • Firestone — competence vs. performance (formal/functional split; independently reconfirmed by the particular-language literature) — PMC7604508
  • KLong (progressive horizon curriculum, second converging source; low-confidence) — arXiv:2602.17547
  • BEACON (2026 long-horizon credit-assignment cluster; low-confidence individually) — arXiv:2605.06078
  • Ecpo (2026 long-horizon credit-assignment cluster; low-confidence individually) — arXiv:2606.05885

CTF / pentest RL environments

(academic, cited for context — not a basis for our decisions; see the stance in Contested edges)

  • CTF-Dojo (486 verified trajectories, 31.9% pass@1 credibility yardstick) — arXiv:2508.18370
  • Cyber-Zero (monolithic outcome-RL, simulated env, +13.1%) — arXiv:2508.00910
  • Pentest-R1 (two-stage RL for CTF methodology) — arXiv:2508.07382
  • HackSynth (crypto-CTF GRPO) — arXiv:2506.02048
  • InterCode-CTF (seminal monolithic-reward CTF environment) — arXiv:2306.14898
  • Cybench (subtask decomposition, eval-only) — arXiv:2408.08926
  • AutoPenBench (milestone taxonomy near-matching this book’s F1–F4 split, eval-only) — arXiv:2410.03225
  • NYU CTF Bench (CTF benchmark family) — arXiv:2406.05590
  • EnIGMA (“soliloquizing” fabrication failure mode, ICML 2025) — arXiv:2409.16165
  • Guided Reasoning via Structured Attack Trees (deterministic ATT&CK-derived task tree, +5x subtask completion on the same weights) — arXiv:2509.07939
  • From Capabilities to Performance (pentesting ablations) — arXiv:2509.14289
  • PentestAgent (RAG-fix framing of a knowledge gap; contested against the scaffolding/execution readings above) — arXiv:2411.05185
  • Capture the Flags: Family-Based Evaluation via Semantics-Preserving Transformations (CTF-specific robustness benchmark) — arXiv:2602.05523
  • What Makes a Good LLM Agent for Real-world Penetration Testing? (Task Difficulty Assessment + Evidence-Guided Attack Tree Search) — arXiv:2602.17622

Agent benchmarks & failure taxonomies

  • τ-bench (fault-assignment × fault-type taxonomy) — arXiv:2406.12045
  • AgentRx (localizes the single critical failure step in a long trajectory) — arXiv:2602.02475
  • AgentBoard (“progress rate” metric — general, non-security capability-decomposition principle, NeurIPS 2024 Oral) — arXiv:2401.13178
  • MAST (14-mode/3-category multi-agent failure taxonomy, κ=0.88) — arXiv:2503.13657
  • AgentErrorTaxonomy / AgentDebug (root-cause diagnosis alone, no reward change, buys +24% all-correct accuracy) — arXiv:2509.25370
  • Phase-aligned taxonomy for autonomous agents (independent-domain convergence on a phase-keyed failure split) — arXiv:2508.13143

Capability boundary, elicitation & sandbagging (contested)

  • Yue et al. — RL elicits, not expands — arXiv:2504.13837 (2025-04-18)
  • ProRL — prolonged RL expands — arXiv:2505.24864
  • Cohen-Inger et al. — “LLMs are Like a Chameleon” (benchmark scores mask overfitting; semantics-preserving perturbation robustness check) — arXiv:2502.07445 (2025-02-11)
  • Zhang et al. — “Memorize or Generalize?” (Memorization Risk Index via semantic-perturbation code rewriting; companion robustness-check citation) — arXiv:2503.02296 (2025-03-04)
  • PSN-RLVR — arXiv:2602.02555 · NuRL — arXiv:2509.25666 · CoT-Pass@K (Wen et al., RLVR implicitly incentivizes correct reasoning) — arXiv:2506.14245 (2025-06-17)
  • Scalpel vs Hammer (GRPO amplifies, SFT replaces) — arXiv:2507.10616
  • Zhai et al. — Does RL Expand the Capability Boundary of LLM Agents? Pass@(k,T) — arXiv:2604.14877 (2026-04-16)
  • Dragoi et al. — Beyond Pass@k: Breadth-Depth Metrics / Cover@τ — arXiv:2510.08325 (2025-10-09)
  • Kang et al. — Quagmires in SFT-RL Post-Training — arXiv:2510.01624 (2025-10-02)
  • Chen et al. — The Coverage Principle — arXiv:2510.15020 (2025-10-16)
  • Greenblatt et al. — Stress-Testing Capability Elicitation with Password-Locked Models — arXiv:2405.19550 (2024-05-29)
  • Hofstätter et al. — The Elicitation Game — arXiv:2502.02180 (2025-02-04)
  • van der Weij et al. — AI Sandbagging — arXiv:2406.07358 (2024-06-11)
  • Ryd et al. — Removing Sandbagging via Weak Supervision — arXiv:2604.22082 (2026)
  • Stroebl et al. — Inference Scaling fLaws — arXiv:2411.17501 (2024-11-26)
  • Dorner et al. — ROC-n-reroll — arXiv:2507.12399 (2025-07-16)
  • Huang et al. — Is Best-of-N the Best of Them? — arXiv:2503.21878 (2025-03-27, ICML 2025)
  • Mahowald et al. — Dissociating Language and Thought in LLMs — arXiv:2301.06627 (2023-01-16)
  • He et al. — LLMs as Neurolinguistic Subjects — arXiv:2411.07533 (2024-11-12)
  • Boháček et al. — Uncovering Competency Gaps (sparse autoencoders on internal representations) — arXiv:2512.20638 (2025-12-06)

PEFT

Frontier lab recipes (reports & blogs) — full-year refresh, 2025-07 → 2026-07, all 10 tracked labs

Llama (historical anchor): Llama 3 — arXiv:2407.21783 · Llama 4 — ai.meta.com/blog/llama-4-multimodal-intelligence

Anthropic (Claude) — Constitutional AI/RLAIF backbone arXiv:2212.08073; inoculation prompting arXiv:2510.04340, Anthropic’s own study arXiv:2511.18397; release posts/system cards — Opus 4.1 · Sonnet 4.5 card · Sonnet 4.5 · Sonnet 4.5 research · Haiku 4.5 card (PDF) · Haiku 4.5 · Opus 4.5 card · Opus 4.5 research · Opus 4.5 card walkthrough (secondary) · inoculation prompting post · emergent misalignment / reward hacking · “teaching Claude why” post · research page · Opus 4.6 · Opus 4.6 sabotage risk report (PDF) · Sonnet 4.6 · Opus 4.7 · Opus 4.8 · Fable 5 / Mythos 5 · Fable 5 & Mythos 5 card (PDF) · Mythos guardrails coverage (secondary) · Sonnet 5 · Sonnet 5 card · Sonnet 5 launch coverage (secondary) · Sonnet 5 launch guide (secondary) · AI organizations post

OpenAIGPT-5 (2025-08-07) · GPT-5 system card (PDF) · GPT-5 for developers · safe-completions arXiv:2508.09224 · safe-completions post · GPT-5-Codex addendum · Codex system card (PDF) · GPT-5.1 · GPT-5.1 deployment safety · routing/model-choice post (secondary) · GPT-5.1-Codex-Max · Codex-Max system card · Codex-Max safety training · long-horizon Codex tasks · GPT-5.2 · GPT-5.2 for science/math · GPT-5.2 system-card update · GPT-5.2-Codex · GPT-5.3-Codex · 5.3-Codex system card · 5.3-Codex coverage (secondary) · GPT-5.4 · GPT-5.4 thinking system card · GPT-5.4 (secondary) · graders docs · RFT guide · RFT use-cases · RFT wind-down, 2026-05-08 · community thread (secondary)

Google DeepMind (Gemini) — Gemini 2.5 tech report arXiv:2507.06261 (HTML, §2.4/2.5 mirror, cross-checked (secondary)) · Deep Think launch · Gemini 3 Pro model card (PDF) · Gemini 3 launch · agent-building with Gemini 3 · Gemini 3 Deep Think · Deep Think update · Gemini 3 Flash · Flash for enterprise · Gemini 3.1 Pro · Gemini 3.5 · Vending-Bench/τ²-bench cross-check (secondary)

xAI (Grok)Grok 4 · Grok 4 model card (PDF) · Grok 4 analysis (secondary) · Grok Code Fast 1 · Code Fast 1 model card (PDF) · Grok 4 Fast · Grok 4 Fast model card (PDF) · coverage (secondary) · coverage (secondary) · Grok 4.1 · Grok 4.1 model card (PDF) · sycophancy coverage (secondary) · Grok 4.1 Fast · news index

Mistral — Magistral arXiv:2506.10910 (HF paper page, benchmark tables) · Ministral 3 arXiv:2601.08584 · Mistral 3 blog · Magistral blog · Mistral-Large-3 card · Magistral-Small-2509 card · Magistral-Small-2507 card · Magistral Medium 1.2 docs

DeepSeek — V3 arXiv:2412.19437 · R1 arXiv:2501.12948 · V3.2 arXiv:2512.02556 (HTML) · V3.1 release · V3.1 card · V3.1-Terminus · V3.1-Terminus card · V3.2-Exp · V3.2-Exp repo · V3.2 / V3.2-Speciale

Qwen (Alibaba) — Qwen3 tech report arXiv:2505.09388 · GSPO arXiv:2507.18071 · Qwen3-Omni arXiv:2509.17765 · Qwen3-VL arXiv:2511.21631 · Qwen3-Coder-Next arXiv:2603.00729 · Qwen3.5-Omni arXiv:2604.15804 · GSPO blog · Qwen3-Coder blog · Qwen3 blog · Qwen3 README · Qwen3-Next efficiency · Qwen3-Max · Qwen3-Max-Thinking · Qwen3.5 blog · Qwen3.5-397B-A17B card · Qwen3.7-Max “agent frontier” · Qwen3.7 blog · The Batch coverage (secondary) · VentureBeat coverage (secondary) · TechSphere coverage (secondary) · Qwen3.6-35B-A3B agentic coding

Moonshot AI (Kimi) — K2 arXiv:2507.20534 (verified via arXiv abs + full HTML crawl) · K2.5 arXiv:2602.02276 (verified via arXiv abs + full HTML crawl) · Kimi-K2-Thinking card (no arXiv paper) · K2 Thinking intro post · Kimi-K2.6 card (no arXiv paper) · K2.6 tech blog · K2.6 benchmark deltas · K2.6 coverage (secondary) · K2.6 method non-disclosure (secondary) · Kimi-K2.5 model card/benchmarks

GLM / Z.ai (Zhipu) — GLM-4.5 arXiv:2508.06471 · GLM-5 arXiv:2602.15763 (HTML) · GLM-4.5 blog · GLM-4.6 blog · GLM-4.7 blog · GLM-5 blog · GLM-5.2 blog · GLM-4.5 repo · GLM-5 repo · slime RL infra repo · GLM-4.7-Flash card · MoE architecture deep-dive (secondary, unverified-primary) · agentic RL post citing GLM-5 report (secondary) · RL infra post citing GLM-5 report (secondary) · GLM-5.2 vs 5.1 (secondary) · GLM-5.2 open-source coverage (secondary) · GLM-4.7-Flash coverage (secondary)

Xiaomi (MiMo) — MiMo-V2-Flash arXiv:2601.02780 · MiMo-Embodied arXiv:2511.16518 · MiMo-VL-Miloco arXiv:2512.17436 · MiMo-Audio arXiv:2512.23808 · MiMo lineage (background only, outside the 12-month window): MiMo arXiv:2505.07608, MiMo-VL arXiv:2506.03569 · MiMo-V2.5-Pro card · MiMo-V2.5 card · MiMo-V2.5-Pro blog · MiMo model-update docs

The verified concept-map + genealogy notes in the shared memory pool (research/post-training-inference-concept-map.md, research/post-training-method-genealogy-onpolicy-offpolicy.md, research/frontier-lab-post-training-recipes-2026.md, research/rl-for-long-horizon-exploration-reasoning.md, research/diagnosing-capability-vs-execution-gap-framework.md) are the machine-readable companions to this book.

How this book grows

This is a living document maintained by the researcher seat of the llmresearch project. It grows one verified topic at a time; each chapter cites its sources so claims are checkable, not assertions.

Conventions

  • Engineer-level. Assumes you know logprobs, KL, advantage, rollouts, MoE, PPO clip. No 101 filler.
  • Cite or don’t claim. Every substantive statement carries an arXiv id or a named lab report/blog. Where something is contested, it’s marked contested with both sides (Contested edges).
  • Honesty about status. Methods are tagged mainstream / niche / promising-not-proven / experimental based on whether a frontier flagship’s report actually uses them.
  • Verified live. arXiv ids are crawl-checked; lab-recipe claims come from 2025–2026 tech reports and blogs, not training recall. Re-verify before betting a run — this field ships weekly.

Build & run locally

# one-time: install the toolchain (macOS)
brew install mdbook mdbook-mermaid
# from the book root:
mdbook-mermaid install .   # vendors mermaid assets + wires the preprocessor
mdbook serve --open        # live-reload server at http://localhost:3000

Mermaid flowcharts and raw HTML/iframes (e.g. the embedded journey) render offline — no CDN required.

Log

  • 2026-07-02 — v1.0. Added Teaching a tool, teaching recon — the data behind a skill (wired into “Learnings,” right after Hint-guided bootstrapping — put the walkthrough in the prompt, then train it away — the data-object-first answer to “Q&A or trajectories or executed traces, for teaching a tool vs. teaching recon,” drawn from seven sources (Toolformer, ToolLLM/ToolBench, APIGen/xLAM, Gorilla/DocPrompting, terminal-CLI-agent literature, search/recon-RL literature, and a procedural-vs-declarative synthesis): teaching a fixed-signature TOOL is a strict quality ladder — doc-grounding (Gorilla, DocPrompting) < unverified trajectories < executed-and-verified traces (APIGen/xLAM/APIGen-MT’s format→execution→semantic 3-gate filter) as the non-negotiable ceiling, with Toolformer’s loss-reduction filter as the self-supervised executed-trace variant; teaching RECON (search/information-seeking) is a structurally different shape — a thin, format-only SFT seed followed by outcome-only RL that lets the branching strategy emerge (Search-R1’s retrieved-token masking, R1-Searcher’s two-stage reward, DeepResearcher’s emergent self-reflection/cross-validation, TIER’s negative case against trajectory-supervised reward collapsing past search depth 4–6, and Nemotron-Research-Tool-N1’s contested pure-RL-beats-SFT-then-RL finding vs. WebGPT’s imitation-then-rejection-sampling counter-case for large action spaces); unanimous verdict across all seven sources — Q&A caps out at declarative recall, trajectories are necessary for procedural transfer. Ships a skill-type → data-object → how-made → executed? → technique consolidated table, worked training rows for both tool-teaching and recon-teaching, and a docs → executed → verify → SFT → optional-RL mermaid pipeline. Cross-linked into kinds-of-sft.md, methods/imitation.md, methods/rl-long-horizon-exploration.md, methods/agentic-rl.md, hint-guided-bootstrapping.md, and foundations/on-off-policy.md. Merged 5 new citations into References via a new “Teaching a tool, teaching recon” section (Toolformer, DocPrompting, xLAM/APIGen-MT multi-turn extension, Nemotron-Research-Tool-N1, TIER), deduped against the existing corpus — Gorilla, ToolBench/ToolLLaMA, APIGen/xLAM-function-calling-60k, APIGen-MT, Search-R1, ToolRL, and WebGPT were already present from earlier passes and are not repeated.

  • 2026-07-02 — v0.9. Recursive deepening pass on Case study: how coding engineered its data (and what transfers to cyber) — the v0.7 chapter grew five new sections (§5 execution sandbox infrastructure at scale — isolation-strategy cost table incl. SWE-MiniSandbox kernel-level isolation and the SWE-World Docker-free learned surrogate, plus a per-rung $/sample cost curve; §6 synthetic test quality and the weak-verifier failure mode — VeriScale’s 83× adversarial mutation-testing suite expansion and the SpecBench reward-hacking-gap-vs-code-size finding; §8 decontamination and the memorization-vs-reasoning gap — the “SWE-Bench Illusion” study’s 23-point memorized-vs-fresh localization gap and metamorphic-transform diagnosis, extended into a cyber-specific three-timestamp CVE filtering rule via BountyBench’s exploitation-as-retrieval evidence; §9 environment-generation mechanics — SWE-Factory and million-scale SWE-Universe automating the remaining manual Docker-environment stages; §12 the vulnerable-target-reconstruction open problem, a 2026-07 update — CVE-Factory’s three-stage CVE→Docker pipeline (LiveCVEBench), ARVO, the DARPA AIxCC SoK, and CVE-Bench, closing with the honest verdict that patch/exploit semantic correctness remains substantially unsolved), plus a deepened §11 (Seed-Coder, and three Rung-4 attempts — RepoZero, ProgramBench, CodeAlchemy — that each converge on the same real-oracle circular dependency, plus the independent output-diversity-collapse-under-recursive-training finding). Added a Source registry section tabulating every §5–§12 id by subsection with an explicit confidence note (which ids were independently re-verified this pass vs. inherited from the underlying deep-research artifacts). Merged 18 new citations into References’s existing “Case study: how coding engineered its data” section — SWE-MiniSandbox, SWE-World, VeriScale, SpecBench-style analysis, SWE-Bench Illusion, metamorphic-testing memorization diagnosis, BountyBench, SWE-Factory, SWE-Universe, Seed-Coder, RepoZero, ProgramBench, CodeAlchemy, output-diversity-collapse, CVE-Factory, ARVO, SoK: DARPA AIxCC, All You Need Is A Fuzzing Brain, CVE-Bench — deduped against the chapter’s own already-covered-elsewhere note (StarCoder, StarCoder2/Stack v2, DeepSeek-Coder, Phi-1, Self-Instruct, CodeRL, PPOCoder, RLTF, StepCoder, SWE-Gym, R2E-Gym/SYNGEN, SWE-RL) and against the rest of the corpus (AlphaCode, KodCode, CodeT, Sol-Ver, STaR, Kimi K2, DeepSeek-Coder-V2 already present). Two ids (SpecBench 2605.21384, metamorphic-testing 2604.21579) are recorded as inherited-not-independently-re-crawled this pass, matching the chapter’s own confidence note.

  • 2026-07-02 — v0.8. Added Hint-guided bootstrapping — put the walkthrough in the prompt, then train it away (wired into “Learnings,” right after The kinds of SFT — it is the data, not the algorithm — the cheat-sheet-training survey: names the family behind “put the solution in the system prompt, execute for real, mask it out, then SFT on the unhinted task” across four independent lineages (STaR-rationalization, context/prompt distillation, hint-guided RLVR exploration, and Learning Using Privileged Information/asymmetric actor-critic, 2009–2026); formalizes the hint-then-mask loss (Snell et al.) and its latent-variable/biased-stochastic-EM reading (TRICE); tables 8 named techniques with what each contributes and where each breaks; separates three distinct failure-mode classes (shortcut learning/hint-copying, distribution mismatch/exposure bias, elicit-not-expand) rather than conflating them; and lands the honest verdict — the mechanism is real and well-precedented, but NuRL’s own ablation is the load-bearing caveat against the user’s specific design choice (a full walkthrough, not an abstract hint, hurts relative to an abstract cue) — with a concrete mitigated recipe (mask + hint-reliance filter + fade-the-hint curriculum + verify-unaided-on-never-hinted tasks) as a mermaid diagram. Cross-linked into kinds-of-sft.md, method-to-data.md, rl-long-horizon-exploration.md, is-the-recipe-a-loop.md, and contested.md. Merged 24 new citations into References via a new “Hint-guided bootstrapping” section (TRICE, V-STaR, Askell et al. context distillation, PING, Snell/Klein/Zhong, Kujanpää et al., OPCD, on-policy self-distillation diversity-collapse, OPSA, HiLL, ReGFT, Multi-level Stepwise Hints, E2H Reasoner, AdaRFT, Nair et al. demo-loss annealing, Go-Explore Nature version, Asymmetric Actor-Critic, Shortcut Learning survey, HANS, Clever Hans on COPA, RAWR, Turpin et al. unfaithful CoT, Ross/Peters/Marasović, and Countdown-Code), deduped against the existing corpus — STaR, HER, Go-Explore (original), NuRL, the Reward Hacking survey, and Peng et al./RCG/SSR were already present from earlier passes and are not repeated.

  • 2026-07-02 — v0.7. Added Case study: how coding engineered its data (and what transfers to cyber) (wired into “Learnings,” right after Cybersecurity is one of a family — what cracked the others — a general-purpose case study on the DATA trajectory this book had under-covered: how raw public material actually becomes training rows, not which loss function to use. Coding is the case study because it’s the closest twin to cybersecurity — both are executable domains with a deterministic oracle and a noisy public commons — and coding already completed the autocomplete→single-function-correctness→self-debugging→whole-repo-agentic arc cyber is now starting. A 4-rung ladder ordered by how much execution is in the data pipeline (Rung 0 pretraining/autocomplete, execution ≈ absent; Rung 1 grounded synthetic instructions, execution gates the synthesis recipe; Rung 2 execution-verified rejection-sampling/RL, execution is the primary per-sample filter/reward; Rung 3 repo-to-environment agentic trajectories, execution is the entire training substrate), each rung’s centerpiece table mapped 1:1 onto a cybersecurity analog (CTF sandbox + flag verifier = compiler + tests, cleanest at Rung 2), plus two explicit honest caveats: the raw-corpus scale gap between GitHub and CTF writeups/CVE databases is real and unresolved, and SWE-RL’s rule-based difflib reward beating execution-per-rollout on cost grounds is a possible cost-saving lever for cyber RL rewards, not a proven one. Cross-linked into kinds-of-sft.md, method-to-data.md, adjacent-domains-transfer.md, frontier-recipe-is-a-sequence.md, and data-mixing-and-forgetting.md). Merged 12 new citations into References via a new “Case study: how coding engineered its data” section (The Stack, Code Llama, FIM, WizardCoder/Evol-Instruct, Magicoder/OSS-Instruct, CodeT, LEVER, GenX, KodCode, SOL-VER, Self-Debugging, SWE-bench), deduped against the existing corpus — StarCoder, StarCoder2/Stack v2, DeepSeek-Coder, Phi-1, Self-Instruct, CodeRL, PPOCoder, RLTF, StepCoder, SWE-Gym, R2E-Gym/SYNGEN, and SWE-RL were already present from earlier passes and are not repeated.

  • 2026-07-02 — v0.6. Added The kinds of SFT — it is the data, not the algorithm (wired into “Learnings,” right after Imitation — the per-data-source companion to that chapter’s per-method view: SFT is one loss function, cross-entropy on (input → target tokens); what actually varies is the data — human-authored, synthetic-authored, distilled off-/on-policy, and rejection-sampled/self-generated — with the two most commonly missed types called out explicitly: formalized agentic-trajectory SFT (FireAct/AgentTuning) and on-policy distillation (GKD)) and rewrote Method → Data (your real bottleneck) in place into a concrete, worked data guide — per-method (SFT/DPO/KTO/GRPO/agentic-RL) data-object tables, curation/selection axes (LIMA, AlpaGasus, Cherry_LLM/IFD, LESS, DEITA), and a decontamination pass (Llama 2 n-gram methodology, LLMSanitize). Also de-pinned the BSides/baseline framing book-wide (no longer anchored to one conference-talk-shaped example) and refreshed the foundational chapters (What “data” actually means for an agent, The one axis that predicts everything, Introduction) for consistency with the new data-first framing. Merged 11 new citations into References via a new “The kinds of SFT & Method → Data” section (Sequence-Level KD, FireAct, AlpaGasus, Cherry_LLM/IFD, LESS, DEITA, Scaling Laws for Forgetting, Always Learning Always Mixing, the contamination-survey + LLMSanitize pair, and Rethinking On-Policy Distillation), deduped against the existing corpus — the large majority of both new/rewritten chapters’ citations (Self-Instruct, WizardLM, phi-1, Hinton distillation, GKD, RAFT, STaR, ReST/ReST-EM, AgentInstruct/AgentLM, DeepSeek-R1, LIMA, LoRA-learns-less, Llama 2, Gorilla, ToolLLaMA, InstructGPT) were already present from earlier passes and are not repeated.

  • 2026-07-02 — v0.5. Wired four new chapters, completing the “loop-shape / ordering / data-mixing” arc this book’s sequencing story was still missing, plus a fast-start entry point: Is the recipe a loop? (the macro finding — post-training is a bounded/asymmetric loop, not a one-shot pipeline: the pretrain/anneal wall + base-choice + reward contract are the one-shot boundary; SFT/preference/RLVR is the iterated tail; continue-vs-restart is a per-stage not global rule; non-commutativity now has a formal proof, not just observation; a loop-exit criterion so an iterative plan isn’t an open-ended compute sink), Ordering rules: interleaving stages & fixing N problems (the micro companion — an eleven-transition safe/conditional/erosive ordering table keyed on data provenance not stage-name, the RL’s-Razor/entropy-collapse mechanism for why foreign data after RL is dangerous, resolving the DeepSeek-R1 “SFT after RL” paradox by data provenance not stage label, and the mix-don’t-sequence verdict for batching N pass@k-identified problems), Data mixing, ratios & not forgetting how to think (diagnoses a real field anecdote — LoRA SFT on off-policy terse trajectories made a reasoning model stop emitting CoT entirely — as named, measured “reasoning-trace collapse,” not weight destruction; why LoRA’s “learns less, forgets less” is a magnitude-bounded aggregate-benchmark claim, not a behavioral-direction guarantee, via the “intruder dimensions” mechanism; the 1–10% replay-ratio band converged across six papers; a merge-vs-mix decision aid; a concrete anti-forgetting recipe with a mandatory per-checkpoint “does it still think?” probe), and Start here: a proven-first ranking of the methods (placed at the top of “In practice” as the fast-start entry point — ranks every method in the book by adoption breadth × flagship usage × measured impact with novelty penalized, T1–T4 tiers across the RL/preference/SFT families, landing on the one proven end-to-end starting sequence: SFT → rejection-sampling SFT → DPO → GRPO/RLVR → iterate). All four chapters already carry their own Cross-links section back into frontier-recipe-is-a-sequence.md, decomposition-vs-monolithic.md, diagnosis/framework.md, foundations/on-off-policy.md, instrumentation-and-data-readiness.md, and methods/peft.md — verified resolvable, not re-authored here (this pass is nav/reference wiring only, not chapter content). Merged ~50 new citations into References via three new sections (“Is the recipe a loop?,” “Ordering rules: interleaving stages & fixing N problems,” and “Data mixing, replay ratios & capability forgetting”) plus one small “Start here: a proven-first ranking” addendum, deduped against the existing ~340-citation corpus (includes two non-arXiv sources — the DMT OpenReview paper and Thinking Machines Lab’s “LoRA Without Regret” post). Verified during integration, not re-litigated: the 2507.10616 (“Scalpel vs. Hammer”) citation in the new ordering-rules chapter is used as one of three converging, independent mechanisms (alongside CHORD and RL’s Razor) rather than as a standalone load-bearing claim — consistent with its existing LOW-confidence/contested framing in decision.md, methods/reinforcement.md, and diagnosis/framework.md; the reward-tampering-vs-proxy-gaming distinction already established in contested.md/decomposition-vs-monolithic.md/roadmap-inputs.md (Denison et al., arXiv:2406.10162) is unaffected by, and not contradicted by, any claim in the four new chapters.

  • 2026-07-02 — v0.4. Wired three new chapters into the “Toward a frontier cybersecurity model” section, re-ordered to read as a coherent arc — organizing reframe first, then the two chapters it’s a prerequisite for, then the existing family→path→forks arc: The recipe is a sequence, not a pick (retires the “which technique” framing at the root — two explicit stage sequences, Sequence A from-scratch-foundation-model and Sequence B fine-tune-an-open-weight-dense-model [this project’s actual path], why order matters and stages compound rather than add, the synthetic-trajectory bootstrap and its off-policy execution-gap caveat, and a stage-wise evaluation protocol for Sequence B), Continued pretraining on an instruction-tuned model (can you run raw CPT directly on an already-instruct/RLHF’d checkpoint without destroying it — yes, but naive CPT-on-instruct reliably causes format/alignment collapse, not fact erasure; a six-technique preservation decision table; recommends CPT-on-base→re-instruct as the default with chat-vector reattachment as a cheap fallback; an IFEval+MMLU+domain-QA stage-boundary gate to verify it didn’t break), and Proven post-training datasets — a usage-cited registry (a ~60-dataset registry across instruction/chat SFT, tool/function-calling, preference, reasoning/CoT, willingness/refusal-calibration, and Chinese-labs/multilingual — every row proven-by-usage in a named shipped model/recipe, never a single-paper-only academic artifact, mapped onto Sequence B’s actual stage order). Cross-linked frontier-cyber-model-path.md and roadmap-inputs.md to both the recipe-sequence and dataset-registry chapters where their existing arguments (Stage 1 SFT/data synthesis, fork (b)’s SFT-now-vs-measure-first) are specific instances of the general point. Merged ~90 new citations into References via two new sections (“Post-training recipe as a sequence — order, compounding, synthetic-trajectory bootstrap” and “Continued pretraining on an instruction-tuned model — preservation techniques”) plus a new “Datasets (proven-by-usage)” subsection for the dataset-card/model-card links, deduped against the existing corpus.

  • 2026-07-02 — v0.3. Wired three new chapters into the book: Before you train — instrumentation & data readiness (what the harness already emits vs. the minimal per-stage-verifier gap to instrument, grounded in a direct source read of go/libs/agent/events + the flag-verification pipeline), One problem, or many? — monolithic vs decomposed (the eval-decomposition-vs-training-decomposition split, the potential-based-shaping safety net, the verdict for this project), and Where you are & the forks ahead (the capstone — five forks, a dependency DAG, seven falsifiable hypotheses, placed last before References). Applied the project’s standing no-academic-cybersecurity-LLM-as-research-basis stance across all three: every CTF-Dojo/Cyber-Zero/Pentest-R1/HackSynth/AutoPenBench/DRLRM-PT-style citation is labelled “academic, cited for context — not a basis for our decisions,” with load-bearing claims re-anchored on frontier-lab disclosures, general RL/ML theory, or this project’s own measured data. Merged ~35 new citations into References (new Hierarchical RL/decomposition/reward-shaping section; additions to Exploration & entropy collapse, CTF/pentest RL environments, Agent benchmarks & failure taxonomies, and Capability boundary sections) and added the CTF/pentest-RL section’s context-only header note.

    Later same day — added the frontier north-star section. Wired the two standing capstone chapters into a new top-level section, “Toward a frontier cybersecurity model,” placed after “In practice” and before References: Cybersecurity is one of a family — what cracked the others (the cross-domain structural-analogy survey — six adjacent long-horizon/sparse-reward/verifiable domains and what actually cracked each), The path to a frontier cybersecurity model (the capstone recipe + gap analysis — what “frontier” costs beyond this project’s own portfolio), and moved Where you are & the forks ahead into this new section as its final chapter (out of “In practice”), completing the arc family → path → your forks. Cross-linked roadmap-inputs.md at top and in its Cross-links section to both new chapters. Merged the new chapters’ citations into References via two new sections — “Domain-specialization lineages (code/math/medical)” and “Adjacent-domain structural transfer” — ~65 new arXiv/DOI/PMC ids, deduped against the existing ~250-citation corpus, academic-security entries kept labelled context-only. Salvaged three of the higher-value ideas the standing academic-cybersecurity-LLM stance would otherwise have excluded, by re-grounding each on independent frontier-lab or general-RL-theory evidence instead: (1) staged/kill-chain reward shaping — salvaged as the theorem-backed potential-based form only (Ng-Harada-Russell, ICML 1999), never the flat per-stage bonus academic pentest-RL papers use; (2) subgoal/curriculum decomposition of a long episode — salvaged via DeepSeek-Prover-V2 and AlphaGeometry (cold-start SFT data generation only, never densifying the RL reward itself); (3) failure-corpus-to-curriculum conversion — salvaged via WebRL’s self-evolving curriculum and HER’s relabeling principle (mining flag=0 trajectories for sub-skill SFT data), not any academic CTF-RL paper’s claim.

  • 2026-07-02 — v0.2. New Diagnosis section: Diagnosing the gap — a scientific framework (the pass@k crossover protocol, Cover@τ, sandbagging/elicitation tests — is a low k=1 solve rate an execution gap or a knowledge gap, before betting a GRPO run on the answer) and From behavioral audit to training signal (maps a commonly-observed agentic-pentest failure profile — tool avoidance, no methodology, brittle single-guess, uneven PTES phases, benchmarks-measure-speed-not-thoroughness — onto the specific post-training techniques designed to fix each). New method chapter RL that creates value — long-horizon · exploration · reasoning · novelty, a ~50-paper sweep tagged [L]/[E]/[R]/[N] against this project’s own diagnosis (GiGPO, DAPO/Clip-Cov, ProRL, ReTool/ToRL/Search-R1, CTF-Dojo/Pentest-R1/HackSynth, pass@k-is-diagnostic-not-objective). Extended reinforcement.md and agentic-rl.md with cross-links into the sweep. Rewrote What the frontier labs actually do with a full last-year (2025-07→2026-07) refresh across all 10 tracked labs, filling in previously-thin xAI/Grok, Mistral (Magistral/Ministral), Zhipu/GLM, Xiaomi/MiMo, and deepening Kimi K2→K2.5→K2.6, each now carrying the same [L]/[E]/[R]/[N] tags. Extended Contested edges and The decision with the new capability-boundary and sandbagging/elicitation literature. Merged ~130 newly-cited sources into References.

  • 2026-07-02 — v0.1. Initial build from a live session: the on/off-policy foundation, the method genealogy (imitation/preference/reinforcement + agentic RL + PEFT), verified 2026 frontier-lab recipes, the method→data reframe, the decision tree, and contested edges. Embeds the interactive decision journey.

Backlog (next sessions)

  • A worked example: filtering your verified solves into a rejection-sampling SFT set (the verified-trajectory pipeline).
  • The reward-function chapter: building an ungameable verify(state) for CTF flags (state, not transcript).
  • Pass@k methodology: per-challenge bucketing before choosing a branch.
  • The train↔inference precision-mismatch rabbit hole (TIS vs FP16), for when you reach GRPO.
  • Harness-shape coupling: ruling out “it’s the scaffold, not the model” before fine-tuning.