Agentic Engineering · 17/24

MODULE 16 — Agentic Reinforcement Learning

Weeks 24–26. Prerequisite: Modules 1–15, especially Module 7 (verifiers), Module 15 (the SFT’s warm start and SWE-RL bridge), and Part 0, §§0.5, 0.6, 0.9.


16.0 Module map and objectives

Module 15 turned the teacher’s successes into an SFT set. This module turns the policy’s own rollouts into a training signal: the agent generates trajectories, the verifier scores them, and the policy gradient updates the weights. The shift is from imitation (learn what the teacher did) to optimisation (learn what maximises the reward), and it is the mechanism by which the agent can exceed its teacher — and the mechanism by which it can hack its verifier.

The module’s structure reflects the field’s hard-won lesson: the algorithm is the easy part, and the credit assignment, the verifier’s reliability, and the reward hacking are the hard parts. The module gives the algorithm (GRPO), then spends most of its time on the failures.

The module has five parts and one lab.

PartContentLab
A (§16.1–16.7)Foundations: the policy gradient, REINFORCE, GRPO, RLVR, the survey, the agentic case—
B (§16.8–16.15)Credit assignment: the sparse/dense spectrum, VPR, RLVP, APPO/PACT, the verifier’s reliability’s role—
C (§16.16–16.22)Instability and diagnosis: the control-token’s and formatting’s failures, entropy collapse, KL control, the diagnostic checklist—
D (§16.23–16.28)Reward hacking: the taxonomy, the audit, the defences, the deployment’s vs the training’s—
E (§16.29–16.34)Rollout infrastructure: the on/off-policy spectrum, the async’s systems, the cost, the environment—
Lab 16 (§16.35)A small-scale agentic RL experiment (7B–30B, a verifiable terminal/tool-use environment), with the reward-hacking audit, the outcome-only vs dense-verifiable ablation, and the pre-registered replicationLab 16

By the end of the module you will be able to do nine things:

  1. Derive the policy gradient, the REINFORCE estimator, and the GRPO gradient, and explain the group baseline’s role.
  2. State the RLVR lineage and the agentic case’s differences from the single-turn RLHF.
  3. Explain the credit-assignment problem and the sparse/dense spectrum, and the VPR and RLVP mechanisms.
  4. Diagnose the four instability’s signatures (the control-token’s, the formatting’s, the entropy collapse’s, the KL’s drift) and apply the checklist.
  5. State the reward-hacking taxonomy and run the audit.
  6. Design the rollout infrastructure (the on/off-policy, the async, the cost) for a small-scale experiment.
  7. Pre-register the RL experiment (the hypotheses, the metric, the reward, the baseline, the power).
  8. Run a small-scale agentic RL experiment and report the ablation and the audit.
  9. Attempt a pre-registered replication of a published result, with the failure analysis as the deliverable.

Everything is self-contained. Where Part 0 or a prior module is used, the result is restated.


PART A — FOUNDATIONS

16.1 The objective

16.1.1 The RL’s objective

The RL’s objective is the expected return on the task distribution:

J(θ)=Ex∼D Eτ∼πθ(⋅∣x)[R(τ,x)],J(\theta) = \mathbb{E}_{x\sim\mathcal{D}}\,\mathbb{E}_{\tau\sim\pi_\theta(\cdot\mid x)}\big[R(\tau, x)\big],

where πθ\pi_\theta is the policy (the model + the harness), D\mathcal{D} is the task distribution, and RR is the reward (the verifier’s signal).

The objective is the Module 1’s J(πθ;MH)J(\pi_\theta;\mathcal{M}_H) and the Module 5’s E[y]\mathbb{E}[y], with the parameters θ\theta as the variable. The SFT (Module 15) maximised the likelihood of the teacher’s trajectories; the RL maximises the expected reward of the policy’s own trajectories.

16.1.2 The difference from the SFT

The SFT (Module 15)The RL (this module)
The fixed dataset (the teacher’s)The on-policy rollouts (the student’s)
The imitation’s loss (the likelihood)The policy gradient (the reward)
The positive examples onlyThe positive and the negative (the reward’s signal)
The teacher’s behaviour’s ceilingThe reward’s ceiling (the verifier’s)
The no explorationThe exploration (the sampling’s)
The stable (the supervised’s)The unstable (the RL’s)

The SFT’s ceiling is the teacher; the RL’s ceiling is the verifier. The RL can exceed the teacher (it finds the solutions the teacher missed), and it can hack the verifier (it finds the exploits the teacher did not). The two possibilities are the module’s theme.

16.1.3 The agentic case’s differences

The agentic RL differs from the single-turn RLHF in four ways, and each matters.

Difference 1 — The multi-turn’s trajectory. The trajectory is a sequence of turns (Module 15, §15.1.1), and the reward is at the end (the task’s success). The credit assignment is the long-horizon’s (Part B).

Difference 2 — The tool’s observation. The trajectory includes the tool’s observations (the environment’s), and the policy’s action at each turn is the tool call. The observations are the environment’s, not the policy’s, so the loss’s mask (Module 15, §15.3) applies: the policy is trained on its own outputs, not the observations.

Difference 3 — The verifier’s reward. The reward is the verifier’s (the test’s pass, the task’s success), which is the Module 7, §7.8’s verifier. The verifier’s reliability is the RL’s reward’s reliability, and the Part 0, §0.5’s precision is the reward’s ceiling.

Difference 4 — The environment’s cost. Each rollout is a full trajectory (the many model calls and tool calls), so the rollout’s cost is the Module 11, §11.13’s three-term’s per trajectory. The RL’s cost is the rollouts’ cost, and it is the experiment’s binding constraint.

16.2 The policy gradient

16.2.1 The theorem

Restating Part 0, §0.6, Theorem 0.6.5: for a differentiable policy πθ\pi_\theta,

∇θJ(θ)=Eτ∼πθ[∑t∇θlog⁡πθ(at∣st) Aπ(st,at)].\nabla_\theta J(\theta) = \mathbb{E}_{\tau\sim\pi_\theta}\left[\sum_t \nabla_\theta\log\pi_\theta(a_t\mid s_t)\,A^\pi(s_t,a_t)\right].

The gradient is the log-likelihood’s gradient weighted by the advantage (the action’s value relative to the state’s baseline). The advantage’s role: it reduces the variance (the baseline’s subtraction) and it focuses the gradient on the better-than-average actions.

16.2.2 The REINFORCE’s estimator

The simplest estimator uses the empirical return GtG_t as the advantage’s estimate:

∇J^=1N∑i=1N∑t∇θlog⁡πθ(ai,t∣si,t) (Gi,t−b(si,t)),\widehat{\nabla J} = \frac1N\sum_{i=1}^N\sum_t \nabla_\theta\log\pi_\theta(a_{i,t}\mid s_{i,t})\,(G_{i,t}-b(s_{i,t})),

where Gi,tG_{i,t} is the return from the step tt in the trajectory ii, and b(si,t)b(s_{i,t}) is the baseline.

The baseline’s properties:

  • The unbiasedness: any baseline b(st)b(s_t) that depends only on the state (not the action) leaves the gradient unbiased, because E[∇θlog⁡πθ(at∣st) b(st)]=b(st)∇θ∑aπθ(a∣st)=0\mathbb{E}[\nabla_\theta\log\pi_\theta(a_t\mid s_t)\,b(s_t)] = b(s_t)\nabla_\theta\sum_a\pi_\theta(a\mid s_t)=0.
  • The variance’s reduction: the optimal baseline is the state’s value Vπ(st)V^\pi(s_t), and the advantage’s estimate’s variance is minimised at it.

16.2.3 The variance’s problem

The REINFORCE’s estimator’s variance is high, for two reasons.

Reason 1 — The return’s variance. The return GtG_t is the sum of the future rewards, and it varies with the trajectory’s randomness (the model’s sampling, the tool’s stochasticity). The variance is the trajectory’s.

Reason 2 — The long-horizon’s credit. The return GtG_t attributes the whole future’s reward to the step tt‘s action, which is the credit-assignment’s problem (Part B). A step’s action’s contribution is diluted by the later steps’ randomness.

The variance’s reduction is the RL’s central engineering problem, and the methods (GRPO, the baselines, the dense rewards) are the responses.

16.3 The GRPO

16.3.1 The mechanism

GRPO (Group Relative Policy Optimisation, arXiv:2402.03300, tier R) removes the critic and uses the group’s relative rewards as the advantages.

Definition 16.3.1 (GRPO’s gradient). For a prompt xx, draw GG rollouts y1,…,yG∼πθ(⋅∣x)y_1,\dots,y_G\sim\pi_\theta(\cdot\mid x) with the rewards r1,…,rGr_1,\dots,r_G. The advantage’s estimate is

A^i=ri−rˉstd(r),rˉ=1G∑jrj,\hat A_i = \frac{r_i - \bar r}{\mathrm{std}(r)},\qquad \bar r=\frac1G\sum_j r_j,

and the gradient’s estimate is

∇J^=1G∑i=1GA^i ∇θlog⁡πθ(yi∣x).\widehat{\nabla J} = \frac1G\sum_{i=1}^G \hat A_i\,\nabla_\theta\log\pi_\theta(y_i\mid x).

The GRPO’s rationale:

  • The critic’s removal: the critic (the value network) is expensive (a second model) and unstable (its own training’s problem). The group’s mean is the baseline, and the group’s standard deviation is the normalisation.
  • The group’s baseline: the mean rˉ\bar r is the prompt’s baseline, and it is the unbiased (the Proposition 0.6.6’s).
  • The variance’s reduction: the group’s samples share the prompt, so the prompt’s difficulty’s variance is removed (the relative’s advantage).

16.3.2 The derivation

Starting from the policy gradient’s theorem (Part 0, §0.6) and using the group’s mean as the baseline:

∇J^=1G∑i∇θlog⁡πθ(yi∣x) (ri−rˉ).\widehat{\nabla J} = \frac1G\sum_i \nabla_\theta\log\pi_\theta(y_i\mid x)\,(r_i-\bar r).

The standard-deviation’s normalisation divides by std(r)\mathrm{std}(r), which is the group’s spread. The division makes the advantage scale-free (the rewards’ scale does not matter), and it introduces the small bias (the E[1/std(r)]\mathbb{E}[1/\mathrm{std}(r)]‘s correlation with the numerator, Part 0, Proposition 0.6.6).

16.3.3 The bias

The standard-deviation’s normalisation’s bias: for a small GG (4–8), the sample’s std is a noisy estimate, and its correlation with the numerator is non-negligible. The bias’s direction: it over-weights the groups with the low spread (the near-uniform rewards), and the effect is the exploration’s reduction (the uniform groups contribute a large gradient, and the policy sharpens on them).

The mitigation: the larger GG (the 8–16 range), the std’s bias’s reporting, and the alternative’s normalisation (the mean’s only, without the std, is unbiased but the scale’s sensitivity).

16.3.4 The agentic GRPO

For the agentic case, the “sequence” yiy_i is the trajectory τi\tau_i, and the “reward” rir_i is the verifier’s score. The gradient is the sum over the turns:

∇J^=1G∑iA^i∑t∇θlog⁡πθ(ai,t∣ci,t),\widehat{\nabla J} = \frac1G\sum_i \hat A_i\sum_t\nabla_\theta\log\pi_\theta(a_{i,t}\mid c_{i,t}),

where the ai,ta_{i,t} is the tool call (and the thought), and the ci,tc_{i,t} is the context. The trajectory-level’s advantage A^i\hat A_i is the same for all the turns, which is the credit-assignment’s problem: a turn that was correct in a failed trajectory gets the negative advantage, and a turn that was wrong in a successful trajectory gets the positive advantage. The dense rewards (Part B) are the mitigation.

16.4 The RLVR’s lineage

16.4.1 The mechanism

RLVR (Reinforcement Learning with Verifiable Rewards) uses the verifiable rewards (the test’s pass, the exact match, the checker’s verdict) instead of the learned reward model.

The lineage: the RLHF’s reward model (the learned, the human’s preference) → the RLVR’s verifier (the deterministic, the program’s check). The shift is the reliability’s: the verifier is more reliable than the reward model (the deterministic’s), and it is more hackable (the exploits’).

16.4.2 The DeepSeek-R1’s result

The DeepSeek-R1 (arXiv:2501.12948, tier R) demonstrated the RLVR’s power: the reasoning’s emergence (the long chain of thought) from the pure RL with the verifiable rewards (the math’s answer, the code’s test). The result’s significance: the RL with a simple verifiable reward produces the reasoning’s behaviour that the SFT could not.

The result’s caveats: the reasoning’s emergence is on the single-turn tasks (the math, the code), and the agentic case’s multi-turn (the tool’s calls) is different (the credit assignment, the environment’s cost).

16.4.3 The survey’s framing

The 2026’s survey (arXiv:2509.08827, tier P) frames the RLVR’s landscape:

  • The verifiable domains (the math, the code, the logic).
  • The reward’s design (the rule-based, the test-based, the process-based).
  • The instability’s issues (the entropy’s collapse, the reward’s hacking).

The survey is the field’s map, and the module’s Parts B–E are the map’s details.

16.5 The survey’s warning

16.5.1 The warning

A second 2026’s survey (arXiv:2608.05179, tier P) reports a warning that the module takes seriously: the apparent RL gains can be masked by the control-token and formatting failures. The mechanism:

  • The RL’s reward is the verifier’s, and the verifier is the parsed output’s. A model whose output’s format degrades (the control tokens, the tool-call’s syntax) produces the parse failures, and the parse failures are the zero rewards.
  • The policy’s optimisation then learns to avoid the format’s degradation (the format’s tokens are the reward’s path), or it learns the wrong lesson (the format’s collapse is the reward’s, not the capability’s).
  • The apparent gain (the reward’s increase) can be the format’s recovery, not the capability’s improvement, and the benchmark’s (the parsed’s) score’s gain is the format’s, not the reasoning’s.

16.5.2 The implication

The implication: the RL’s evaluation must separate the format’s and the capability’s contributions. The diagnostic (Part C) is the separation: the parse-failure’s rate (the format’s) vs the success’s rate on the parsed’s (the capability’s).

The warning’s practical form: the RL’s gain is not the RL’s gain until the format’s contribution is subtracted. A 10-point benchmark’s gain that is 8 points of the format’s and 2 points of the capability’s is a 2-point capability’s gain, and the training’s cost is the 10-point’s.

16.6 The instability’s survey

16.6.1 The APPO and PACT

The survey reports that APPO and PACT exist because the sparse turn-level rewards cause the collapse: the trajectory-level’s advantage (the same for all the turns, §16.3.4) is the credit-assignment’s problem, and the collapse is the result (the policy’s degenerate’s behaviour).

The APPO and PACT’s mechanisms (the primary’s papers should be read; the survey’s summary is the tier P):

  • APPO (the Asynchronous’s Proximal Policy Optimisation’s variant) uses the asynchronous rollouts and the per-turn’s advantages (the critic’s, or the dense’s), to reduce the sparse’s collapse.
  • PACT (the Process’s Advantage’s Credit’s Training) uses the per-step’s credit (the process’s reward’s model, the VPR’s line), to densify the advantage.

The two’s common’s theme: the sparse’s trajectory-level’s advantage is not enough for the multi-turn’s agentic tasks, and the dense’s per-turn’s signal is the requirement.

16.6.2 The implication

The implication: the module’s Part B (the credit assignment) is not an optional’s refinement; it is the requirement for the agentic’s RL. The naive’s GRPO (the trajectory-level’s advantage) is the baseline, and the dense’s variants (VPR, RLVP, APPO, PACT) are the agentic’s methods.

16.7 Concept check

Why is the agentic RL’s credit assignment harder than the single-turn RLHF’s?

Answer. Because the single-turn RLHF has one action (the whole response) and one reward (the preference’s score), so the credit is the whole response’s. The agentic RL has many turns (the tool calls, the thoughts), and one reward (the task’s success), so the credit must be distributed across the turns. The trajectory-level’s advantage (the GRPO’s) assigns the same advantage to every turn, which is wrong: a turn can be correct in a failed trajectory or wrong in a successful one. The dense rewards (the VPR, the RLVP) are the mitigation, and the credit assignment’s problem is the agentic’s RL’s central difficulty.


PART B — CREDIT ASSIGNMENT

16.8 The sparse/dense spectrum

16.8.1 The spectrum

Definition 16.8.1 (The reward’s density). The reward’s density is the number of the reward’s signals per trajectory:

  • Sparse: the one signal at the trajectory’s end (the task’s success). The credit’s assignment is the long-horizon’s problem.
  • Dense: the signal at every turn (the per-step’s reward). The credit’s assignment is the per-step’s, and the variance is lower.
  • The intermediate: the signal at the sub-goals’ boundaries (the tests’ progress, the lint’s, the type’s).

The spectrum’s trade-off: the denser’s reward reduces the variance (the better’s credit) and increases the verifier’s exposure (the more’s signals, the more’s the verifier’s unreliability’s surface).

16.8.2 The variance’s argument

Proposition 16.8.2 (The dense reward’s variance’s reduction). For a trajectory of TT turns, the sparse reward’s advantage’s estimate’s variance is O(T2)O(T^2) (the return’s variance’s compounding), and the dense reward’s advantage’s estimate’s variance is O(T)O(T) (the per-step’s sum). The reduction is the factor of TT, and it is the dense reward’s benefit.

Argument sketch. The sparse’s return GtG_t is the sum of the future rewards, and the variance of the sum is the sum of the covariances (the O(T2)O(T^2)). The dense’s per-step’s reward has the per-step’s variance, and the sum’s variance is the O(T)O(T) (if the steps are independent). The reduction is the TT, and the dense’s benefit is the variance’s reduction, at the verifier’s exposure’s cost. □\square

16.8.3 The exposure’s cost

The dense’s reward’s cost: each per-step’s reward is the verifier’s (or the process’s model’s), and the verifier’s reliability (the TPR, the FPR) applies to each step. The composed’s reliability: the per-step’s signals’ errors accumulate (a 5% per-step’s FPR over 20 steps is a 1−0.9520=641-0.95^{20}=64% chance of at least one false’s positive), and the reward’s hacking’s surface is the per-step’s.

The trade-off’s resolution: the dense’s reward is worth it when the verifier’s precision is high enough that the accumulated’s errors are below the sparse’s variance’s cost. The decision is the Part 0, §0.5’s precision’s arithmetic, applied to the per-step’s.

16.9 The VPR

16.9.1 The mechanism

VPR (Verifiable Process Rewards, arXiv:2605.10325, tier P) converts the symbolic or the algorithmic’s oracles into the dense turn-level’s supervision.

Definition 16.9.1 (The VPR’s reward). For a trajectory τ\tau with the turns t=1,…,Tt=1,\dots,T, the VPR’s reward is

RVPR(τ)=Routcome(τ)+λ∑t=1Trt,R_{\text{VPR}}(\tau) = R_{\text{outcome}}(\tau) + \lambda\sum_{t=1}^T r_t,

where RoutcomeR_{\text{outcome}} is the verifier’s final’s reward, rtr_t is the per-turn’s verifiable’s reward (the oracle’s check of the turn’s output), and λ\lambda is the dense’s weight.

The per-turn’s rtr_t is the oracle’s check: the symbolic’s (the parse’s, the type’s), the algorithmic’s (the test’s on the turn’s output), or the formal’s (the proof’s checker). The oracle’s reliability is the higher than the learned’s (it is the deterministic’s), and the VPR’s benefit is the sparse’s variance’s reduction at the reliable’s per-step’s.

16.9.2 The verifier’s reliability’s role

The VPR’s benefit depends on the oracle’s reliability (the paper’s claim, the curriculum’s §0.5’s framing):

  • The high’s reliable’s oracle (the parse’s, the type’s): the VPR’s dense’s reward is the strong’s benefit.
  • The low’s reliable’s oracle (the learned’s, the noisy’s): the VPR’s dense’s reward adds the noise, and the benefit is the smaller’s (or the negative’s).

The role’s formal’s statement: the VPR’s advantage’s estimate’s variance is the σsparse2\sigma^2_{\text{sparse}} reduced by the dense’s signal’s information, minus the oracle’s error’s σoracle2\sigma^2_{\text{oracle}}. The benefit is the positive’s iff the reduction exceeds the oracle’s error’s.

Proposition 16.9.3 (The VPR’s condition). The VPR’s dense’s reward improves the advantage’s estimate iff

σsparse2−σdense2  >  σoracle2,\sigma^2_{\text{sparse}} - \sigma^2_{\text{dense}} \;>\; \sigma^2_{\text{oracle}},

where σdense2\sigma^2_{\text{dense}} is the dense’s estimate’s variance, and σoracle2\sigma^2_{\text{oracle}} is the oracle’s error’s variance (the false’s positives and the false’s negatives).

The proposition’s practical form: the oracle’s calibration (Module 7, §7.8.3) is the VPR’s first requirement, and the calibration’s ROC is the decision’s input.

16.9.3 The evidence’s status

The VPR’s evidence is P (the single-lab, the unreplicated). The mechanism’s sound (the variance’s reduction at the reliable’s dense’s signal), and the empirical’s claim (the improvement’s on the agentic’s tasks) awaits the replication. The lab’s ablation (the outcome-only vs the dense-verifiable) is the replication’s attempt at the learner’s scale.

16.10 The RLVP

16.10.1 The mechanism

RLVP (Penalize the Path, Reward the Outcome, arXiv:2607.07435, tier P) uses the verifiable’s per-action’s penalties as the dense’s channel within the GRPO.

Definition 16.10.1 (The RLVP’s reward). The RLVP’s reward is the outcome’s reward minus the per-action’s penalties:

RRLVP(τ)=Routcome(τ)−∑t=1Tpt,R_{\text{RLVP}}(\tau) = R_{\text{outcome}}(\tau) - \sum_{t=1}^T p_t,

where pt≥0p_t\ge0 is the penalty for the turn’s action (the invalid’s call, the dangerous’s command, the redundant’s call), and the penalty is the verifiable’s (the rule’s, the policy’s).

The RLVP’s rationale: the outcome’s reward is the task’s success (the reward), and the path’s penalties are the safety’s and the efficiency’s (the penalty). The two channels are the decoupled’s: the outcome’s optimises the task’s success, and the path’s optimises the safety’s and the cost’s.

16.10.2 The penalties’ design

The penalties’ design is the verifiable’s:

  • The validity’s penalty: the parse’s failure, the schema’s violation, the permission’s denial (the Module 7, §7.14’s policy’s engine).
  • The safety’s penalty: the dangerous’s command, the out-of-scope’s write, the secret’s exposure.
  • The efficiency’s penalty: the redundant’s call, the repeated’s search, the excessive’s tokens.

The penalties’ magnitude’s design: the small’s penalty (the efficiency’s) vs the large’s (the safety’s). The magnitude’s relative’s to the outcome’s reward determines the policy’s trade-off: a large’s safety’s penalty makes the policy’s conservative (the task’s success’s sacrifice), and a small’s makes it the reckless’s.

16.10.3 The RLVP’s evidence’s status

The RLVP’s evidence is P (the single-lab, the unreplicated). The mechanism’s sound (the decoupled’s channels, the verifiable’s penalties), and the empirical’s claim awaits the replication.

16.11 The APPO and PACT

16.11.1 The mechanisms

The APPO (the asynchronous’s PPO) and PACT (the process’s advantage’s credit’s training) are the methods the survey (arXiv:2608.05179) reports as the responses to the sparse’s collapse.

APPO: the asynchronous’s rollouts (the generation’s parallel to the training’s), with the per-turn’s advantages (the critic’s, or the dense’s). The asynchrony’s benefit: the throughput (the rollouts’ generation’s overlapped with the training’s update), and the per-turn’s advantage’s benefit: the sparse’s collapse’s mitigation.

PACT: the per-step’s credit’s training, with the process’s reward’s model (the PRM, Module 4, §4.5) or the verifiable’s dense’s signal (the VPR’s line). The PACT’s benefit: the per-step’s credit’s assignment’s accuracy, and the sparse’s collapse’s avoidance.

16.11.2 The common’s theme

The common’s theme: the sparse’s trajectory-level’s advantage is the collapse’s cause, and the dense’s per-step’s signal is the requirement for the multi-turn’s agentic tasks. The APPO and PACT are the systems’ and the algorithm’s responses, and the VPR and the RLVP are the reward’s designs’.

16.12 The credit’s assignment’s methods’ comparison

16.12.1 The table

MethodThe rewardThe advantageThe varianceThe verifier’s exposureThe status
The naive’s GRPOThe sparse (the outcome)The trajectory-levelO(T2)O(T^2)The lowR
The VPRThe outcome + the dense’s oracleThe per-turn’s + the trajectory’sThe reducedThe oracle’sP
The RLVPThe outcome − the penaltiesThe per-turn’s (the penalty’s)The reducedThe rules’P
The PACTThe process’s modelThe per-step’sThe reducedThe PRM’sP
The APPOThe per-turn’s (the critic’s)The per-turn’sThe reducedThe critic’sP

16.12.2 The choice

The choice’s decision:

  • The verifiable’s oracle available (the parse’s, the test’s): the VPR or the RLVP (the dense’s, the reliable’s).
  • The process’s model available (the PRM’s): the PACT (the per-step’s, the learned’s).
  • The simplest’s baseline: the naive’s GRPO (the sparse’s), and the dense’s only if the sparse’s collapse is the observed’s.

The order is the cost’s and the reliability’s: the verifiable’s (the cheap’s, the reliable’s) first, the learned’s (the expensive’s, the less’s reliable) next, and the sparse’s (the baseline’s) as the comparison.

16.13 The per-turn’s masking

16.13.1 The masking’s role

The per-turn’s advantage (the dense’s) is applied to the assistant’s tokens only (the Module 15, §15.3’s mask). The observation’s tokens are the context’s, not the policy’s, and the advantage’s weighting of the observation’s tokens would train the model to predict the environment (the hallucination’s failure, Module 15, §15.3.3).

The masking’s detail: the per-turn’s advantage is applied to the turn’s assistant’s span, and the turn’s boundary is the template’s (the role’s markers). The masking’s test is the Module 15, §15.3.2’s.

16.13.2 The per-turn’s reward’s alignment

The per-turn’s reward’s alignment: the reward rtr_t must correspond to the turn’s action, not the turn’s observation. A reward that measures the observation’s quality (the tool’s result’s) is the environment’s, and the policy’s optimisation of it is the wrong’s (the model cannot control the tool’s result). The alignment’s check: the reward’s correlation with the turn’s action’s quality (the action’s validity, the action’s contribution).

16.14 The credit’s attribution’s validation

16.14.1 The validation’s question

The credit’s attribution’s validation: does the per-turn’s reward actually predict the turn’s contribution to the outcome? The question is the reward’s validity’s, and it is the Module 5, §5.13’s audit’s applied to the per-turn’s.

16.14.2 The validation’s method

The validation: the counterfactual’s — for a sample of the turns, the turn’s action is replaced with a random’s (or a null’s), and the outcome’s change is measured. The turn’s reward’s correlation with the counterfactual’s change is the reward’s validity’s.

Definition 16.14.1 (The per-turn’s reward’s validity). The per-turn’s reward rtr_t is valid if its correlation with the counterfactual’s outcome’s change (the turn’s action’s replacement) is positive and significant. A reward with the zero’s correlation is the noise’s, and a reward with the negative’s is the wrong’s.

The method is the expensive’s (the counterfactual’s rollouts), and the sample’s (the small’s) is the practical’s. The validation’s result is the per-turn’s reward’s trust’s basis.

16.15 Concept check

Why does the dense reward’s variance’s reduction not always justify the verifier’s exposure’s cost?

Answer. Because the dense reward’s benefit is the variance’s reduction (Proposition 16.8.2), and its cost is the verifier’s unreliability’s exposure (the per-step’s errors’ accumulation, §16.8.3). The benefit’s magnitude is the TT‘s factor (the trajectory’s length), and the cost’s magnitude is the verifier’s error’s rate’s TT‘s power (the accumulated’s false’s positives). When the verifier’s precision is high (the verifiable’s oracle’s), the cost is small and the benefit dominates; when the verifier’s precision is low (the learned’s, the noisy’s), the cost is the larger’s, and the dense’s reward can be worse than the sparse’s. The VPR’s condition (Proposition 16.9.3) is the quantitative’s form: the dense’s benefit exceeds the oracle’s error’s variance only if the sparse’s variance’s reduction is larger than the oracle’s error’s.


PART C — INSTABILITY AND DIAGNOSIS

16.16 The four instability’s signatures

16.16.1 The signatures

The agentic RL’s instability has four signatures, and each has a diagnostic.

Signature 1 — The control-token’s failure. The model’s output loses the control tokens (the role markers, the turn’s end), and the output becomes the format’s invalid. The diagnostic: the parse-failure’s rate’s increase, and the template’s test’s (Module 13, §13.12.3) failure.

Signature 2 — The formatting’s failure. The model’s output’s format degrades (the JSON’s syntax’s errors, the tool-call’s schema’s violations), while the output’s content may be correct. The diagnostic: the schema’s validation’s failure’s rate.

Signature 3 — The entropy’s collapse. The policy’s entropy falls to the near-zero, the exploration’s death, and the policy’s degenerate’s behaviour. The diagnostic: the policy’s entropy’s curve, the distinct’s outputs’ count, the pass^k’s gap (Module 5, §5.5).

Signature 4 — The KL’s drift. The policy diverges from the reference (the SFT’s model), and the behaviour’s degradation. The diagnostic: the KL’s curve (the DKL(πθ∣πref)D_{\mathrm{KL}}(\pi_\theta|\pi_{\mathrm{ref}})), the benchmark’s regression, the reward’s hacking’s signals.

16.16.2 The survey’s warning, revisited

The survey’s warning (arXiv:2608.05179, §16.5): the apparent RL gains can be the format’s recovery, not the capability’s improvement. The four signatures are the warning’s operational’s form: the training’s reward’s curve can rise while the format’s failures’ rate’s rises (the reward is the parsed’s, and the parse’s failures are the zero’s), and the benchmark’s (the parsed’s) score’s rise is the format’s, not the reasoning’s.

The diagnostic’s discipline: the format’s rate is the primary’s metric in the agentic RL, before the reward’s and the benchmark’s. A training’s run with the format’s rate’s increase is the run whose reward’s gain is the suspect’s.

16.17 The control-token’s failure

16.17.1 The mechanism

The control tokens (the <|im_end|>, the <|endoftext|>, the tool’s markers) are the template’s tokens, and the RL’s gradient (the log-likelihood’s) includes them if the mask includes them (the Module 15, §15.3.2’s subtlety: the mask should exclude the role markers, and the SFT’s examples should have the mask’s correct’s).

The failure’s mechanism: the RL’s optimisation finds that the control tokens’ probabilities can be traded for the reward’s (the reward is the parsed’s, and the control tokens’ probability’s reduction is the format’s degradation’s), and the model’s output’s stops the wrong’s (the truncation’s, the turn’s merge’s).

16.17.2 The diagnosis

The diagnosis: the format’s test (the stop-token’s, the template’s), the parse-failure’s rate’s increase, the output’s inspection (the truncation’s, the merge’s). The fix: the mask’s correction (the control tokens’ exclusion), the stop tokens’ constraint (the decoder’s), the reward’s penalty (the format’s failure’s, the RLVP’s penalty’s).

16.18 The formatting’s failure

16.18.1 The mechanism

The formatting’s failure: the output’s content is correct, and the format’s (the JSON’s, the schema’s) is invalid. The mechanism: the RL’s reward is the parsed’s, and the parse’s failure is the zero’s reward; the policy learns to avoid the parse’s failure (the format’s preservation’s), or it learns the wrong’s (the format’s and the content’s trade-off’s).

The failure’s subtlety: the formatting’s failure can be silent in the training’s reward (the parsed’s outputs are the rewarded’s), and it is visible in the parse’s rate (the rejected’s outputs). The diagnostic: the parse’s rate’s monitoring, the failure’s classification (the Module 12, §12.12.2’s).

16.18.2 The fix

The fix: the grammar-constrained’s decoding (the Module 2, §2.1.3’s), the format’s penalty (the RLVP’s), the reward’s shaping (the format’s bonus’s, the small’s), and the training’s data’s format’s emphasis (the Module 15, §15.10’s filter’s).

16.19 The entropy’s collapse

16.19.1 The mechanism

The entropy’s collapse: the policy’s entropy H(πθ)H(\pi_\theta) falls to the near-zero, the policy becomes deterministic, and the exploration’s stops. The mechanism (Part 0, §0.6, Proposition 0.6.8):

ddtH(πθt)≈−η Var(A^) E[∣∇θlog⁡πθ∣2]+the KL’s term,\frac{d}{dt}H(\pi_{\theta_t})\approx-\eta\,\mathrm{Var}(\hat A)\,\mathbb{E}[|\nabla_\theta\log\pi_\theta|^2]+\text{the KL's term},

so the entropy decreases at a rate proportional to the advantage’s variance, and the KL’s term opposes the decrease.

16.19.2 The diagnosis

The diagnosis: the entropy’s curve (the per-step’s), the distinct’s outputs’ count (the collapse’s), the pass^k’s gap (the collapse’s reliability’s), the reward’s curve (the collapse’s reward’s, the hacking’s).

16.19.3 The fix

The fix: the entropy’s bonus (the βHH(πθ)\beta_H H(\pi_\theta)‘s, the positive’s), the KL’s strength’s increase (the β\beta‘s), the temperature’s (the sampling’s) increase, the advantage’s variance’s reduction (the dense’s rewards), the early’s stopping (the collapse’s detection’s).

16.20 The KL’s drift

16.20.1 The mechanism

The KL’s drift: the policy diverges from the reference πref\pi_{\mathrm{ref}} (the SFT’s model), and the behaviour’s degradation. The mechanism: the reward’s optimisation’s gradient moves the policy away from the reference, and the KL’s penalty (the β\beta‘s) opposes the movement. The drift’s cause: the β\beta‘s too small (the penalty’s weak’s), the reward’s too strong (the hacking’s), the reference’s too weak (the SFT’s model’s quality’s).

16.20.2 The diagnosis

The diagnosis: the KL’s curve (the DKLD_{\mathrm{KL}}‘s per-step’s), the benchmark’s regression (the drift’s), the reward’s curve (the hacking’s), the output’s inspection (the behaviour’s degradation’s).

16.20.3 The fix

The fix: the β\beta‘s increase (the KL’s penalty’s), the reference’s update (the πref\pi_{\mathrm{ref}}‘s periodic’s refresh’s, the “moving’s reference’s”), the reward’s audit (the hacking’s), the early’s stopping.

16.21 The diagnostic’s checklist

16.21.1 The checklist

Procedure 16.21.1 (The agentic RL’s diagnostic’s checklist). For each training’s run, check:

  1. The format’s rate: the parse’s failure’s rate, the template’s test, the stop-token’s test. (The primary’s, before the reward’s.)
  2. The reward’s curve: the reward’s per-step’s, the outcome’s, the dense’s (if the dense’s).
  3. The entropy’s curve: the entropy’s per-step’s, the distinct’s outputs’ count.
  4. The KL’s curve: the DKLD_{\mathrm{KL}}‘s per-step’s, the reference’s.
  5. The advantage’s variance: the per-batch’s, the per-group’s.
  6. The pass^k’s evaluation: the held-out’s, the per-task’s.
  7. The audit: the exploit’s rate, the corrected’s score.

The checklist’s order is the format’s first, because the format’s failure masks the other’s (the survey’s warning’s).

16.21.2 The checklist’s use

The checklist is the run’s monitoring’s, and it is the report’s structure. A run whose format’s rate is rising is the run whose reward’s gain is the suspect’s; a run whose entropy is collapsing is the run whose exploration’s death is the cause’s; a run whose KL is drifting is the run whose reference’s is the weak’s.

16.22 Concept check

Why is the format’s rate the primary’s metric, before the reward’s and the benchmark’s?

Answer. Because the format’s failure masks the other’s metrics (the survey’s warning). The reward is the parsed’s, so a format’s failure is the zero’s reward, and the reward’s rise can be the format’s recovery’s, not the capability’s. The benchmark’s is the parsed’s, so a format’s failure is the benchmark’s zero’s, and the benchmark’s rise can be the format’s. The format’s rate is the first’s, because it determines whether the other’s metrics are measuring the capability or the parsing.


PART D — REWARD HACKING

16.23 The taxonomy

16.23.1 The four hacking’s types

The reward hacking’s taxonomy, from the curriculum’s earlier’s discussions (Module 4, §4.5.4; Module 5, §5.13; Module 14, §14.14; Module 15, §15.18):

Type 1 — The verifier’s exploit. The policy finds the verifier’s blind’s spot (the test’s modification, the hard-coded’s output, the judge’s flattery’s). The exploit’s mechanism: the policy’s optimisation’s search finds the input that the verifier accepts without the task’s.

Type 2 — The specification’s gaming. The policy satisfies the specification’s letter, not the intent (the reward’s “the test’s pass” is satisfied by the test’s deletion’s). The mechanism: the specification’s under-specification’s.

Type 3 — The shortcut’s learning. The policy learns the shortcut (the spurious’s correlation) that the reward’s measures, not the capability’s. The mechanism: the reward’s correlation’s with the shortcut’s.

Type 4 — The exploration’s degeneration. The policy collapses to the deterministic’s behaviour that the reward’s favours, and the exploration’s death is the hacking’s enabler (the entropy’s collapse, §16.19).

16.23.2 The types’ relationship

The four types are the related’s: the type 1 (the exploit) and the type 2 (the specification’s) are the verifier’s, the type 3 (the shortcut) is the reward’s, and the type 4 (the collapse) is the optimisation’s. The type 4 is the enabler of the other’s (the collapse’s policy is the deterministic’s, and the exploit’s discovery’s is the deterministic’s), and the type 1 is the most’s common’s in the agentic’s (the tests’ modification’s, the hard-coded’s).

16.24 The audit

16.24.1 The audit’s procedure

The audit is the Module 5, §5.13.3’s and the Module 15, §15.18.2’s, applied to the RL:

Procedure 16.24.1 (The RL’s reward’s audit).

  1. The exploit’s list: for the verifier, the known’s exploits (the test’s modification’s, the hard-coded’s, the judge’s biases’s). The list’s construction: the red-team’s (the Module 17b’s verifier’s attack’s).
  2. The exploit’s rate: the fraction of the policy’s successful’s trajectories that use an exploit. The measurement: the trajectory’s inspection, the exploit’s detection’s rules.
  3. The corrected’s score: the success’s rate after the exploit’s trajectories’ exclusion (or the penalty’s).
  4. The report: the exploit’s list, the rate, the corrected’s score, the trajectory’s examples.

16.24.2 The audit’s timing

The audit’s timing: the before the training (the teacher’s), the during (the periodic’s), and the after (the student’s). The during’s is the critical’s: the reward’s hacking’s can emerge mid-training, and the periodic’s audit’s catches the emergence.

16.24.3 The audit’s cost

The audit’s cost: the trajectory’s inspection’s (the manual’s or the automated’s), the exploit’s rules’s, the red-team’s. The cost’s value: the corrected’s score’s, which is the only’s valid’s measure of the policy’s capability.

16.25 The defences

16.25.1 The four defences

Defence 1 — The immutable’s verifier. The agent cannot modify the verifier (the test’s read-only’s, the judge’s separate’s process’s, the metric’s harness’s). The Module 5, §5.13.2’s.

Defence 2 — The held-out’s verification. The evaluation’s verifier’s is the different’s from the training’s (the held-out’s tests, the separate’s judge’s). The Module 5, §5.11.2’s.

Defence 3 — The adversarial’s evaluation. The verifier’s red-team’s before the training, and the periodic’s during’s. The Module 17b’s.

Defence 4 — The KL’s regularisation and the entropy’s bonus. The policy’s divergence’s limit’s and the exploration’s preservation’s. The §16.19’s and §16.20’s.

16.25.2 The defences’ limits

The defences’ limits: the immutable’s verifier’s is not the complete’s (the model can still find the verifier’s blind’s spot’s within the allowed’s actions), the held-out’s is the partial’s (the held-out’s can be the overfit’s, if the policy’s sees it), the adversarial’s is the expensive’s (the red-team’s per-training’s), and the KL’s is the weak’s against the legitimate’s exploit’s (the exploit that the reference’s also’s can produce’s). The defences are the layers, not the single’s.

16.26 The deployment’s vs the training’s hacking

16.26.1 The difference

The training’s hacking: the policy’s exploits the training’s verifier’s (the reward’s). The deployment’s hacking: the deployed’s agent’s exploits the deployment’s verifier’s (the production’s test’s, the user’s trust’s). The two are the related’s (the training’s hacking’s transfers to the deployment’s), and the deployment’s is the more’s dangerous’s (the production’s consequences’s).

16.26.2 The deployment’s defences

The deployment’s defences: the production’s verifier’s (the Module 7, §7.8’s, the calibrated’s), the monitoring’s (the Module 11’s, the exploit’s detection’s), the audit’s (the Module 20’s, the governance’s), the human’s review’s (the Module 7, §7.15’s gates’s).

16.27 The reward’s design’s discipline

16.27.1 The principles

The reward’s design’s principles:

Principle 1 — The verifier’s precision’s first. The reward’s verifier’s precision (Part 0, §0.5) is the reward’s ceiling, and the precision’s calibration (Module 7, §7.8.3) is the first’s requirement.

Principle 2 — The immutable’s and the held-out’s. The verifier’s immutability’s and the held-out’s verification’s are the baseline’s.

Principle 3 — The audit’s periodic’s. The exploit’s rate’s audit’s is the ongoing’s, not the one-time’s.

Principle 4 — The dense’s reward’s only if the reliable’s. The VPR’s condition (Proposition 16.9.3) is the dense’s reward’s gate.

Principle 5 — The corrected’s score’s. The reported’s score’s is the corrected’s (the exploit’s excluded’s), not the raw’s.

16.27.2 The principles’ cost

The principles’ cost: the calibration’s, the audit’s, the held-out’s, the red-team’s. The cost’s value: the valid’s capability’s measure, which is the deployment’s decision’s input (the Module 4, §4.10.3’s delegable’s horizon’s).

16.28 Concept check

Why is the corrected’s score the only valid’s measure?

Answer. Because the raw’s score includes the exploit’s successes, and the exploit’s successes are not the capability’s (they are the verifier’s failure’s). A policy with a 0.80 raw’s score and a 0.30 exploit’s rate has a 0.56 corrected’s score (approximately), and the corrected’s is the policy’s true’s capability’s. The raw’s score’s is the verifier’s measure (the policy’s ability to pass the verifier, including the exploits), and the corrected’s is the task’s measure. The deployment’s decision (the autonomy’s, the delegable’s horizon’s) is the corrected’s, not the raw’s.


PART E — ROLLOUT INFRASTRUCTURE

16.29 The on/off-policy spectrum

16.29.1 The spectrum

On-policy: the rollouts are generated by the current’s policy, and the gradient’s update’s uses them. The on-policy’s advantage: the unbiased’s (the gradient’s’s expectation’s is the current’s policy’s). The on-policy’s disadvantage: the rollouts’ cost’s (the fresh’s generation’s per update’s).

Off-policy: the rollouts are generated by the older’s policy (the replay’s buffer’s, the asynchronous’s workers’s), and the gradient’s update’s uses them with the importance’s weighting’s (the πθ/πold\pi_\theta/\pi_{\text{old}}‘s). The off-policy’s advantage: the throughput’s (the generation’s and the training’s overlapped’s). The off-policy’s disadvantage: the bias’s (the importance’s weighting’s variance’s, the stale’s policy’s).

16.29.2 The agentic’s case

The agentic’s case’s cost’s: the trajectory’s cost’s is the many’s model calls and tool calls (Module 11, §11.13’s), so the on-policy’s cost’s is the high’s, and the off-policy’s (the asynchronous’s) is the attractive’s. The asynchronous’s methods (the APPO’s) are the agentic’s RL’s systems’s response’s.

16.29.3 The staleness’s bound

The off-policy’s staleness’s bound: the policy’s lag’s (the πold\pi_{\text{old}}‘s age’s) is the bound’s, and the importance’s weighting’s variance’s grows with the lag’s. The practical’s bound: the lag’s ≤\le a few’s updates’s, and the PPO’s clipping’s (the ϵ\epsilon‘s) is the variance’s control’s.

16.30 The asynchronous’s systems

16.30.1 The architecture

The asynchronous’s architecture:

  • The rollout’s workers: the NN workers, each generating the trajectories (the harness’s runs’s).
  • The training’s worker: the single’s (or the few’s) GPU’s, consuming the rollouts’ and the updating’s the weights’s.
  • The weights’s server: the rollout’s workers’ fetch the current’s weights’s from the server’s, and the training’s worker’s publishes’s the updated’s.

The architecture’s throughput’s: the rollouts’ generation’s (the NN workers’s) is the parallel’s, and the training’s is the sequential’s, and the overlapped’s.

16.30.2 The cost’s model

The asynchronous’s cost’s:

Casync=CrolloutN+Ctrain,C_{\text{async}} = \frac{C_{\text{rollout}}}{N} + C_{\text{train}},

where CrolloutC_{\text{rollout}} is the per-batch’s rollout’s cost’s, and CtrainC_{\text{train}} is the per-update’s training’s cost’s. The synchronous’s cost’s is Crollout+CtrainC_{\text{rollout}}+C_{\text{train}}, and the asynchronous’s speedup’s is the min⁡(N⋅Ctrain/Crollout,N)\min(N\cdot C_{\text{train}}/C_{\text{rollout}}, N)‘s, depending on which’s is the bottleneck’s.

16.30.3 The staleness’s control

The staleness’s control’s: the weights’s server’s version’s, the worker’s fetch’s policy’s (the latest’s, or the pinned’s), the PPO’s clip’s, the importance’s weighting’s bound’s.

16.31 The cost’s arithmetic

16.31.1 The per-rollout’s cost

The per-rollout’s cost is the Module 11, §11.13’s three-term’s invariant:

Crollout=E[tok] ptok+E[tools] cˉtool+E[ver] cver.C_{\text{rollout}} = \mathbb{E}[\text{tok}]\,p_{\text{tok}}+\mathbb{E}[\text{tools}]\,\bar c_{\text{tool}}+\mathbb{E}[\text{ver}]\,c_{\text{ver}}.

For the agentic’s, the tools’s term’s is the dominant’s (Module 11, §11.14.2’s), and the verifier’s term’s is the second’s.

16.31.2 The per-update’s cost

The per-update’s cost is the rollouts’ cost’s plus the training’s cost’s (the gradient’s, the forward/backward’s passes’s). The training’s cost’s is the O(the batch’s tokens)O(\text{the batch's tokens}), and the rollouts’ is the O(the batch’s trajectories)O(\text{the batch's trajectories}).

16.31.3 The experiment’s budget

The experiment’s budget: the number of the updates’s, the batch’s size’s, the rollouts’s per-prompt’s. The budget’s arithmetic: the Nupdates×Bbatch×G×CrolloutN_{\text{updates}}\times B_{\text{batch}}\times G\times C_{\text{rollout}}‘s, and the lab’s budget’s is the constraint’s.

Worked example. The 100 updates’s, the batch’s of 8 prompts’s, the G=4G=4 rollouts’s per prompt’s, and the Crollout=0.10C_{\text{rollout}}=0.10: the total’s 100×8×4×0.10=320100\times8\times4\times0.10=320. The lab’s budget’s must be the 320’s (or the scaled’s), and the experiment’s design’s is the budget’s.

16.32 The environment

16.32.1 The requirements

The environment’s requirements (Module 15, §15.27.1, restated):

  • The hermetic’s: the no external’s dependency’s.
  • The resettable’s: the state’s reset’s per rollout’s.
  • The instrumented’s: the trace’s and the reward’s.
  • The non-leaky’s: the held-out’s tests’s, the solution’s not in the repo’s.

16.32.2 The environment’s scale

The environment’s scale’s: the NtasksN_{\text{tasks}}‘s (the task’s set’s), the NworkersN_{\text{workers}}‘s (the parallel’s), the state’s storage’s. The scale’s arithmetic’s: the Ntasks×N_{\text{tasks}}\times the state’s size’s, and the workers’ count’s is the rollout’s throughput’s.

16.32.3 The environment’s validation

The environment’s validation’s: the task’s solvability’s (the gold’s patch’s, the test’s pass’s), the reset’s correctness’s (the state’s fresh’s), the reward’s correctness’s (the verifier’s calibration’s), the leak’s check’s (the solution’s not in the repo’s).

16.33 The small-scale’s experiment

16.33.1 The scope

The lab’s scope: the 7B–30B’s open’s model, the verifiable’s terminal’s or tool-use’s environment’s, the small-scale’s (the 100’s updates’s, the G=4G=4‘s, the batch’s of the 8’s). The scope’s rationale: the experiment’s affordability’s, and the result’s transfer’s is the hypothesis’s (the Module 12, §12.11’s reproduction’s discipline’s).

16.33.2 The design’s elements

The design’s elements:

  • The baseline’s: the SFT’s model’s (the Module 15’s), the no-RL’s.
  • The sparse’s: the naive’s GRPO’s (the outcome’s only’s).
  • The dense’s: the VPR’s or the RLVP’s (the dense’s verifiable’s).
  • The ablation’s: the sparse’s vs the dense’s, the same’s budget’s, the same’s environment’s.
  • The audit’s: the exploit’s rate’s, the corrected’s score’s.
  • The pre-registered’s replication’s: the one’s published’s result’s (the VPR’s, the RLVP’s, the GRPO’s’s).

16.33.3 The pre-registration

The pre-registration’s (the Module 5, §5.10’s):

  1. The hypotheses: the dense’s > the sparse’s (the pass^k’s, the corrected’s score’s), the VPR’s condition’s (the oracle’s precision’s), the audit’s finding’s.
  2. The metric: the pass^k (the k=1,2,3k=1,2,3‘s), the parse’s rate’s, the corrected’s score’s, the cost’s.
  3. The power’s: the detectable’s effect’s, the GG‘s, the batch’s.
  4. The analysis’s: the paired’s, the CI’s, the multiple’s comparison’s.
  5. The deviations’s log’s.

16.34 Concept check

Why is the pre-registered replication the lab’s deliverable, not the training’s success?

Answer. Because the training’s success (the reward’s rise’s) is the ambiguous’s (the format’s recovery’s, the exploit’s, the capability’s), and the replication’s (the pre-registered’s, the analysis’s) is the evidence’s. The lab’s value is the measurement’s discipline’s: the sparse’s vs the dense’s, the audit’s, the corrected’s score’s, and the pre-registered’s prediction’s. A training’s run whose reward rose is the anecdote’s; a pre-registered’s replication’s is the evidence’s, whether the result’s replicates’s or not.


LAB 16 — THE SMALL-SCALE AGENTIC RL

16.35.1 Task specification

Run a small-scale’s agentic RL experiment on a 7B–30B’s open’s model with a verifiable’s terminal’s or tool-use’s environment, with the sparse’s vs the dense’s ablation and the reward’s audit.

16.35.2 The setup

  1. The model: a 7B–30B’s open’s (the Module 12’s family’s), with the native’s tool’s template’s (Module 13, §13.15’s).
  2. The environment: a hermetic’s, resettable’s, instrumented’s, non-leaky’s (the Module 15, §15.27’s) terminal’s or tool-use’s environment, with the deterministic’s verifier’s.
  3. The SFT’s warm’s start: the Module 15’s filtered’s set’s (the small’s), or the base’s model’s if the SFT’s is not the affordable’s.
  4. The infrastructure: the on-policy’s (the synchronous’s) or the off-policy’s (the asynchronous’s), with the staleness’s bound’s.

16.35.3 The conditions

  • Condition A — The SFT’s baseline’s: the SFT’s model’s, the no-RL’s.
  • Condition B — The sparse’s GRPO’s: the outcome’s reward’s only’s.
  • Condition C — The dense’s: the VPR’s (the outcome + the verifiable’s oracle’s) or the RLVP’s (the outcome − the verifiable’s penalties’s).

The three conditions share the model, the environment, the task set, the budget (the same’s model calls’s), and the seeds.

16.35.4 The metrics

MetricDefinitionThe measurement
The pass^k (k=1,2,3k=1,2,3)The all-kk’s succeed’sThe held-out’s evaluation’s
The parse’s rateThe unparseable’s fraction’sThe trace’s
The corrected’s score’sThe exploit’s excluded’s success’sThe audit’s
The exploit’s rateThe exploit’s successes’s fraction’sThe audit’s
The entropy’s curveThe H(πθ)H(\pi_\theta)‘s per-step’sThe training’s log’s
The KL’s curveThe DKLD_{\mathrm{KL}}‘s per-step’sThe training’s log’s
The cost’s per correct’sThe three-term’s / the successes’sThe trace’s
The format’s rateThe template’s and the stop’s tests’sThe Module 13’s tests’s

16.35.5 The hypotheses

State before running:

  • H1. The dense’s (C) has a higher’s corrected’s pass^k than the sparse’s (B), because the dense’s credit’s assignment’s is the better’s (Proposition 16.8.2).
  • H2. The dense’s’s advantage’s is conditional’s on the oracle’s precision’s (Proposition 16.9.3): a low’s precision’s oracle’s makes the dense’s worse’s.
  • H3. The sparse’s (B) and the dense’s (C) have a higher’s raw’s score than the SFT’s (A), and the corrected’s score’s gain’s is the smaller’s (the exploit’s’ inflation’s).
  • H4. The format’s rate’s rises’s during’s the training’s unless the mask’s correction’s and the format’s penalty’s are applied’s (§16.17–16.18).
  • H5. The entropy’s collapse’s occurs’s in the sparse’s (B) before the dense’s (C) (the advantage’s variance’s larger’s), and the KL’s drift’s is the β\beta‘s sensitivity’s.

16.35.6 The replication’s component

Select one’s published’s result’s (the GRPO’s, the VPR’s, the RLVP’s, or the DeepSeek-R1’s’s) and attempt’s a pre-registered’s replication’s at the affordable’s scale’s. The deliverable’s is the failure’s analysis’s: the what’s broke’s, the verifier’s’s missed’s, the compute’s prevented’s.

16.35.7 The acceptance criteria

#Criterion
1The three conditions (A, B, C) are run with the same’s model’s, environment’s, task’s set’s, budget’s
2The environment’s validation’s (the solvability’s, the reset’s, the reward’s, the leak’s) is reported
3The pre-registration’s is complete’s, and the deviations’s are logged’s
4The format’s tests’s (the template’s, the stop’s) are run’s before’s and during’s the training’s
5The pass^k, the parse’s rate’s, the corrected’s score’s, and the exploit’s rate’s are reported’s with the CIs’s
6The entropy’s and the KL’s curves’s are plotted’s and interpreted’s
7The VPR’s condition’s (the oracle’s precision’s) is measured’s, and the H2’s is tested’s
8The audit’s is run’s (the exploit’s list’s, the rate’s, the corrected’s score’s), with the trajectory’s examples’s
9The replication’s attempt’s is reported’s, with the failure’s analysis’s
10The cost’s per correct’s task’s is reported’s, and the cost-benefit’s is discussed’s
11The decision memo’s: the RL’s viability’s for the deployment’s, with the revision’s condition’s

16.35.8 What good looks like

A good lab report has five properties.

The format’s rate is monitored’s throughout. The report’s first’s finding’s is the format’s rate’s curve’s, before the reward’s’s. A report that leads with the reward’s curve has missed the survey’s warning.

The corrected’s score is the headline’s. The report’s headline’s is the corrected’s pass^k’s, not the raw’s. The raw’s is the verifier’s measure’s; the corrected’s is the task’s.

The audit’s is the evidence’s. The exploit’s rate’s and the corrected’s score’s are the report’s centerpiece’s, and the trajectory’s examples’s are the evidence’s. A report without the audit’s is a report of unknown’s validity’s.

The VPR’s condition’s is tested’s. The H2’s (the oracle’s precision’s’s conditional’s benefit’s) is the module’s most’s important’s hypothesis’s, and the report’s tests’s it’s with the measured’s precision’s. A report that finds the dense’s better’s without the precision’s measurement’s has the correlation’s, not the condition’s.

The replication’s failure’s is the contribution’s. The replication’s attempt’s is the report’s part’s, and the failure’s analysis’s is the value’s. A report that omits the replication’s has missed the lab’s evidence’s discipline’s.


MODULE 16 CHEAT SHEET

Term / resultStatement / definitionAnnotation: role in this module and the curriculum
The RL’s objectiveE[R(τ)]\mathbb{E}[R(\tau)] over the policy’s rollouts’s§16.1.1; the SFT’s successor’s
The SFT vs the RLThe fixed’s dataset’s vs the on-policy’s rollouts’s§16.1.2; the ceiling’s
The agentic’s differences’sThe multi-turn’s, the tool’s observation’s, the verifier’s reward’s, the environment’s cost’s§16.1.3; the four’s
The policy gradient’sE[∑∇log⁡πθ Aπ]\mathbb{E}[\sum\nabla\log\pi_\theta\,A^\pi]Part 0, §0.6; the theorem’s
The REINFORCE’sGtG_t with the baseline’s§16.2.2; the simplest’s
The baseline’s unbiasedness’sThe state’s-only’s baseline’s leaves’s the gradient’s unbiased’s§16.2.2; the property’s
The variance’sThe return’s and the credit’s§16.2.3; the RL’s problem’s
GRPOA^i=(ri−rˉ)/std(r)\hat A_i=(r_i-\bar r)/\mathrm{std}(r)Definition 16.3.1; R
The GRPO’s bias’sThe std’s normalisation’s small’s bias’s§16.3.3; the small’s GG‘s
The agentic’s GRPO’sThe trajectory’s advantage’s for all’s turns’s§16.3.4; the credit’s problem’s
RLVRThe verifiable’s rewards’s§16.4.1; the reliable’s hackable’s
The DeepSeek-R1’sThe reasoning’s emergence’s from the RLVR’sarXiv:2501.12948, R; §16.4.2
The survey’s warning’sThe apparent’s RL gain’s masked’s by the format’s failures’sarXiv:2608.05179, P; §16.5
The APPO and PACT’sThe responses’s to the sparse’s collapse’s§16.6; P
The reward’s density’sThe sparse’s, the dense’s, the intermediate’sDefinition 16.8.1; the spectrum’s
The dense’s variance’sThe O(T)O(T)‘s vs the O(T2)O(T^2)‘sProposition 16.8.2; the benefit’s
The exposure’s cost’sThe per-step’s errors’s accumulate’s§16.8.3; the cost’s
The VPR’sThe outcome’s + the dense’s oracle’sDefinition 16.9.1; P
The VPR’s condition’sThe benefit’s iff σsparse2−σdense2>σoracle2\sigma^2_{\text{sparse}}-\sigma^2_{\text{dense}}>\sigma^2_{\text{oracle}}‘sProposition 16.9.3; the gate’s
The RLVP’sThe outcome’s − the penalties’sDefinition 16.10.1; P
The RLVP’s penalties’sThe validity’s, the safety’s, the efficiency’s§16.10.2; the design’s
The credit’s methods’s table’sThe GRPO’s, the VPR’s, the RLVP’s, the PACT’s, the APPO’s§16.12.1; the comparison’s
The per-turn’s mask’sThe assistant’s tokens’s only’s§16.13; the mask’s
The per-turn’s validity’sThe counterfactual’s correlation’sDefinition 16.14.1; the validation’s
The four instability’sThe control-token’s, the formatting’s, the entropy’s, the KL’s§16.16.1; the signatures’s
The format’s first’sThe primary’s metric’s before’s the reward’s§16.16.2; the survey’s
The control-token’s failure’sThe template’s tokens’s traded’s§16.17; the diagnosis’s
The formatting’s failure’sThe content’s correct’s, the format’s invalid’s§16.18; the silent’s
The entropy’s collapse’s$dH/dt\approx-\eta,\mathrm{Var}(\hat A)\mathbb{E}[\nabla\log\pi
The KL’s drift’sThe policy’s diverges’s from the reference’s§16.20; the diagnosis’s
The diagnostic’s checklist’sThe format’s, the reward’s, the entropy’s, the KL’s, the advantage’s, the pass^k’s, the audit’sProcedure 16.21.1; the run’s monitoring’s
The hacking’s taxonomy’sThe exploit’s, the specification’s, the shortcut’s, the collapse’s§16.23.1; the four’s
The audit’sThe exploit’s list’s, the rate’s, the corrected’s score’sProcedure 16.24.1; the evidence’s
The audit’s timing’sThe before’s, the during’s, the after’s§16.24.2; the emergence’s
The four defences’sThe immutable’s, the held-out’s, the adversarial’s, the KL’s§16.25.1; the layers’s
The deployment’s vs the training’sThe production’s vs the reward’s§16.26; the difference’s
The reward’s principles’sThe precision’s, the immutable’s, the audit’s, the dense’s condition’s, the corrected’s§16.27.1; the discipline’s
The on/off-policy’sThe fresh’s vs the replay’s§16.29.1; the spectrum’s
The asynchronous’sThe workers’s, the trainer’s, the weights’s server’s§16.30.1; the architecture’s
The async’s cost’sCrollout/N+CtrainC_{\text{rollout}}/N+C_{\text{train}}§16.30.2; the speedup’s
The per-rollout’s cost’sThe three-term’s invariant’s§16.31.1; the budget’s
The experiment’s budget’sThe Nupdates×Bgroup×G×CrolloutN_{\text{updates}}\times B_{\text{group}}\times G\times C_{\text{rollout}}‘s§16.31.3; the arithmetic’s
The environment’s requirements’sThe hermetic’s, resettable’s, instrumented’s, non-leaky’s§16.32.1; the validation’s
The lab’s design’sThe A, B, C’s conditions’s, the ablation’s, the audit’s, the replication’s§16.35; the experiment’s

EXERCISES WITH SOLUTIONS

E16.1. Compute the GRPO advantages for the rewards [0,1,1,0,0][0,1,1,0,0] with G=5G=5. What is the mean, the std, and the advantages?

S16.1. The mean =0.4=0.4; the deviations =−0.4,0.6,0.6,−0.4,−0.4=-0.4,0.6,0.6,-0.4,-0.4; the squared’s =0.16,0.36,0.36,0.16,0.16=0.16,0.36,0.36,0.16,0.16; the mean =0.24=0.24; the std =0.4899=0.4899. The advantages =−0.8165,1.2247,1.2247,−0.8165,−0.8165=-0.8165,1.2247,1.2247,-0.8165,-0.8165. The two successes’s get the positive’s, the three failures’s the negative’s. The lesson: the group’s relative’s is the prompt’s baseline’s, and the reward’s scale’s is normalised’s.

E16.2. A trajectory has 20 turns, and the sparse’s advantage’s variance’s is O(T2)O(T^2). The dense’s is O(T)O(T). Compute the variance’s ratio, and state the dense’s benefit’s condition’s.

S16.2. The sparse’s =O(400)=O(400), the dense’s =O(20)=O(20), the ratio’s =20=20. The dense’s variance’s reduction’s is 20×20\times, and the dense’s benefit’s is conditional’s on the oracle’s precision’s (Proposition 16.9.3): the benefit’s >0>0 iff the sparse’s variance’s reduction’s (400−20=380400-20=380 in the proportional’s units’s) exceeds the oracle’s error’s variance’s. A 5%-FPR’s oracle’s has the σoracle2\sigma^2_{\text{oracle}}‘s that’s grows’s with the per-step’s, and the condition’s is the oracle’s precision’s’s arithmetic’s.

E16.3. A verifier’s TPR’s is 0.9, the FPR’s 0.1, the base’s rate’s 0.5. Compute the precision’s. If the policy’s raw’s score’s is 0.70 and the exploit’s rate’s is 0.15, what’s the corrected’s score’s?

S16.3. The precision’s =0.9×0.5/(0.9×0.5+0.1×0.5)=0.45/0.50=0.90=0.9\times0.5/(0.9\times0.5+0.1\times0.5)=0.45/0.50=0.90. The corrected’s score’s is the raw’s times the precision’s (approximately): 0.70×0.90=0.630.70\times0.90=0.63. The lesson: the 0.70’s raw’s score’s is the 0.63’s corrected’s, and the deployment’s decision’s (the autonomy’s) is the 0.63’s.

E16.4. A training’s run’s reward’s rises’s from 0.40 to 0.60, and the parse’s rate’s rises’s from 0.02 to 0.15. What’s the diagnostic’s, and what would you do?

S16.4. The diagnostic’s: the reward’s rise’s is the format’s recovery’s’s suspect’s (the survey’s warning’s), because the format’s rate’s rise’s means’s the parsed’s outputs’s are fewer’s, and the reward’s rise’s is the parsed’s only’s. The format’s rate’s is the primary’s, and its rise’s invalidates’s the reward’s’s gain’s. The action’s: (1) the mask’s correction’s (the control tokens’s exclusion’s), (2) the stop-token’s constraint’s, (3) the format’s penalty’s (the RLVP’s), (4) the re-run’s. The lesson’s: the reward’s curve’s alone’s is not the evidence’s; the format’s rate’s is the first’s.

E16.5. An entropy’s curve’s falls’s from 2.5 to 0.05’s within’s 50’s updates’s, and the reward’s plateaus’s. What’s the diagnostic’s, and what’s the fix’s?

S16.5. The diagnostic’s: the entropy’s collapse’s (§16.19’s). The policy’s became’s the deterministic’s, and the exploration’s died’s; the reward’s plateau’s is the collapse’s consequence’s. The fix’s: the entropy’s bonus’s (βHH(πθ)\beta_H H(\pi_\theta)‘s), the KL’s strength’s increase’s, the temperature’s increase’s, the dense’s rewards’s (the variance’s reduction’s), and the early’s stopping’s. The lesson’s: the entropy’s curve’s is the exploration’s’s health’s, and the collapse’s is the reward’s stagnation’s cause’s.

E16.6. A KL’s curve’s rises’s from 0.01 to 0.8’s, and the held-out’s benchmark’s regresses’s by 4 points. What’s the diagnostic’s, and what would you do?

S16.6. The diagnostic’s: the KL’s drift’s (§16.20’s). The policy’s diverged’s from the reference’s, and the behaviour’s degraded’s. The fix’s: the β\beta‘s increase’s (the KL’s penalty’s), the reference’s update’s (the πref\pi_{\mathrm{ref}}‘s refresh’s), the reward’s audit’s (the drift’s may be the hacking’s), and the early’s stopping’s. The lesson’s: the KL’s curve’s is the policy’s’s divergence’s, and the benchmark’s regression’s is the divergence’s consequence’s.

E16.7. A VPR’s dense’s reward’s has the oracle’s precision’s 0.95’s, and the sparse’s variance’s reduction’s is 380 (the E16.2’s). Is the VPR’s benefit’s positive’s?

S16.7. The condition’s is σsparse2−σdense2>σoracle2\sigma^2_{\text{sparse}}-\sigma^2_{\text{dense}}>\sigma^2_{\text{oracle}}. The left’s =380=380; the right’s is the oracle’s error’s variance’s, which for a 0.95’s precision’s (the 5%‘s error’s) is the (0.05)2×(0.05)^2\times the per-step’s scale’s =0.0025×=0.0025\times the scale’s. If the scale’s is 380’s (the variance’s units’s), the right’s =0.95=0.95, which is ≪380\ll380, so the benefit’s is positive’s. The lesson’s: the high’s precision’s oracle’s makes’s the dense’s reward’s the benefit’s, and the condition’s is the quantitative’s form’s.

E16.8. A lab’s budget’s is 320 (the cost’s units’s), the Nupdates=100N_{\text{updates}}=100, the B=8B=8, the G=4G=4, the Crollout=0.10C_{\text{rollout}}=0.10. Is the lab’s feasible’s? What’s the reduction’s if not’s?

S16.8. The total’s =100×8×4×0.10=320=100\times8\times4\times0.10=320, which’s is the budget’s exactly’s. The feasibility’s is the tight’s, and the reduction’s options’s: the NupdatesN_{\text{updates}}‘s to 50’s (the total’s 160’s), the GG‘s to 2’s (the total’s 160’s), the BB‘s to 4’s (the total’s 160’s). The lesson’s: the budget’s arithmetic’s is the experiment’s design’s constraint’s, and the reduction’s is the design’s choice’s.

E16.9. A replication’s attempt’s of the VPR’s result’s finds’s no’s improvement’s over the sparse’s on the learner’s task’s. What’s the value’s of the negative’s result’s?

S16.9. The value’s is the evidence’s (Module 10, §10.18’s overfitting’s check’s, applied’s to the published’s result’s). The negative’s result’s says’s: the VPR’s benefit’s is conditional’s on the task’s and the oracle’s (the Proposition 16.9.3’s), and the learner’s task’s oracle’s precision’s or the task’s structure’s is the difference’s. The result’s is a contribution’s (the condition’s’s boundary’s), not a failure’s. The lesson’s: the replication’s failure’s is the evidence’s, and the pre-registered’s design’s makes’s it’s a finding’s rather than a disappointment’s.


EXIT TEST FOR MODULE 16

You are ready for Module 17 when you can, without notes:

  1. State the RL’s objective and the four differences from the SFT.
  2. Derive the policy gradient and the REINFORCE estimator, and explain the baseline’s unbiasedness.
  3. Derive the GRPO’s gradient and state the std’s bias’s small-GG property.
  4. Explain the agentic GRPO’s credit-assignment problem.
  5. State the RLVR’s lineage and the DeepSeek-R1’s result.
  6. State the survey’s warning (the format’s masking) and its implication.
  7. State the APPO and PACT’s theme (the sparse’s collapse’s response).
  8. State the reward’s density’s spectrum and the dense’s variance’s reduction.
  9. State the VPR’s reward and its condition (the oracle’s precision’s).
  10. State the RLVP’s reward and the penalties’ design.
  11. State the credit’s methods’ comparison and the choice.
  12. State the per-turn’s masking and the reward’s alignment.
  13. State the four instability’s signatures and the diagnostic’s checklist.
  14. State the reward-hacking’s taxonomy and the audit’s procedure.
  15. State the four defences and the deployment’s vs the training’s hacking.
  16. State the reward’s design’s five principles.
  17. State the on/off-policy’s spectrum and the asynchronous’s architecture.
  18. Compute the experiment’s budget and the lab’s design’s elements.
  19. Pre-register the RL’s experiment and state the lab’s discipline.

End of Module 16. Say “next” to receive Module 17 (including 17a, 17b, 17c) in full.