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

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.