Manuscript Offprint
arXiv:2610.24949Over-Defense in Coding Agents Begins at Silent Forks
Abstract
Language models behind coding agents are post-trained with outcome rewards, and recent methods concentrate credit on the turns that decide the outcome. We find that defensive actions beyond what a task requires escape both. They begin at silent forks, the turns where every next action leads to the same outcome. Such actions leave the success rate unchanged, and frontier models take the disproportionate branch there in up to 91% of decisive actions under implicit budgets. The most direct fix, a checker in the trajectory reward, reaches these forks only through fully proportionate trajectories, leaving 74% of GRPO groups with identical rewards and behavior unchanged. This motivates a rethink of where learning signals belong, namely where behavior diverges, which a behavioral checker can locate and the outcome cannot. Our method, ForkDPO, contrasts a proportionate and a disproportionate action at the same prefix, at silent forks on both sides of the required behavior. On a test set of unseen repositories, it lowers a 4B model's disproportionate behavior from 70.3% to 58.9%, against 67.7% for DPO at randomly chosen turns, establishing behavioral divergence as a learning signal for how agents act beyond whether they finish. The code is publicly available.
1 Introduction
Coding agents now resolve repository-level tasks with little human supervision (Jimenez et al., 2024; Wang et al., 2025c), and the language models behind them are increasingly post-trained with task success as the reward (Wei et al., 2025; Pan et al., 2025). While working on a task, the agent also decides how many defensive actions to take, such as which tests to run, how often to rerun them, and what to check before submitting. Language models often do more than a task needs (Chen et al., 2025; Qian et al., 2025), and in coding much of this excess is defensive. For example, agents rerun the same test on unchanged code (Bouzenia and Pradel, 2025). Defensive actions beyond what a task requires are known as over-defense, and even when the task rules such an action out, frontier models take it in 11.2–58.7% of runs (Luo et al., 2026).
Current post-training locates learning signals by the outcome. An outcome reward only tells the model whether the task succeeded, and recent methods go further by concentrating credit on the turns that decide the outcome (Zhang, 2026; Zheng et al., 2025; Lin et al., 2025). For instance, process verifiers score each step by the change in the chance of success before and after it (Setlur et al., 2025), and tree-search RL branches at the most uncertain tokens and credits each step by how much it raises the success rate (Hou et al., 2025). These methods share the premise that the turns worth learning from are those where the choice changes the outcome, so a turn whose outcome is already settled receives no signal (Lei et al., 2026).
To find where over-defense begins, we replay the commands of successful trajectories with a behavioral checker and mark the first action beyond what the task requires. We find that over-defense begins at forks whose outcome is already settled. Prior work calls a point a fork when resampling there leads to very different outcomes (Bigelow et al., 2025), and over-defense arises in the opposite case. As shown in Figure 1, once the requested test has passed, submitting and running the test again both pass the task oracle. We call such a turn a Silent Fork, one at which the agent's next actions differ in proportionality while all of them lead to the same outcome. In our experiments, almost every fork where over-defense begins leaves the repository unchanged on both branches, and over-defensive runs succeed as often as the rest. When the instruction leaves the checking budget implicit, four frontier
Corresponding author: Hanan Salam. Contact: Hanjun Luo, h16266@nyu.edu.
https://github.com/Astarojth/silent-forks

Figure 1: Over-defense begins at silent forks. After the requested check passes, submitting, rerunning it, and running the full suite all pass the oracle at different cost, invisible to outcome rewards but not to a behavioral checker. The right panel shows frontier models over-defend too, and on implicit-budget test tasks ForkDPO, which places pairs at silent forks, cuts disproportionate behavior and median run time (143 to 90 s) more than GRPO and DPO.
models given the prefixes of these forks take the disproportionate branch in up to 91% of their decisive actions, those that test, check, or submit.
Silent forks explain why outcome signals cannot reach over-defense. Every action at a silent fork has the same value under an outcome reward, so the policy gradient there vanishes. The most direct fix adds the checker to the trajectory reward, much as length-controlled RL penalizes overly long reasoning (Aggarwal and Welleck, 2025). Such a signal reaches a fork only through trajectories that are proportionate at every fork, and these become rare as tasks grow longer. We train with this reward using GRPO (Shao et al., 2024), a common outcome-based RL algorithm that learns only from reward differences within a group of rollouts (Yu et al., 2025). In 71% of implicit-budget groups every rollout receives the same reward, and after 12 rounds the disproportionate rate is no lower.
These observations motivate a rethink of where learning signals for agent behavior belong. Current methods learn at the turns where the outcome changes, whereas over-defense is decided at turns where it does not, so the signal has to be located by behavior and placed where behavior diverges. Locating the signal by behavior also removes the per-turn Monte Carlo rollouts (Wang et al., 2024; Kazemnejad et al., 2025) that estimate a success probability constant at silent forks. We let the behavioral checker decide where to learn. It marks the first turn at which a successful trajectory departs from proportionate behavior, and the model, resampled from the same prefix, supplies the proportionate alternative. To teach the model to check as much as the task requires, we also pair silent forks at which submitting would skip a required check, constraining the other side of the required behavior. Our method, ForkDPO (fork-level DPO), applies preference optimization (Rafailov et al., 2023) to both pair sets. On 48 test tasks from unseen repositories, it lowers the implicit-budget disproportion rate of a 4B model from 70.3% to 58.9% and, by removing repeated runs and extra checks, cuts the median run time from 143 to 90 seconds, whereas DPO with pairs at random turns leaves the rate at 67.7%.
Our contributions are summarized as follows:
① Silent-Fork Diagnosis. We identify silent forks as the turns where over-defense begins in coding agents, from a 4B model to 4 frontier models, and show that outcome signals vanish while a checker in the trajectory reward reaches them only through fully proportionate trajectories.
② Rethinking Where to Learn. We show learning signals for agent behavior belong at the turns where behavior diverges, which a behavioral checker can locate and the outcome cannot. We instantiate this as ForkDPO, which learns from fork-level pairs on both sides of the required behavior, so that post-training shapes how agents act beyond whether they finish.
③ Experimental Validation. On 48 test tasks from unseen repositories, signals at silent forks cut disproportion by 11.4 points and run time by 37%, which GRPO and DPO at random turns do not, and pairs on both sides of the required behavior are necessary.
Where learning signals are placed. Since outcome rewards are sparse, many methods concentrate the signal where the outcome is decided, starting with process supervision of intermediate steps (Lightman et al., 2024). Preference methods focus it on tokens (Zeng et al., 2024), on pivotal tokens that shift the probability of success (Abdin et al., 2024), or on the first erroneous step (Lai et al., 2024), much as RL can update only the high-entropy forking tokens without loss (Wang et al., 2025b). Agent RL assigns step-level credit through grouped states (Feng et al., 2025), privileged critics (Zhou et al., 2025), pivot turns with mixed outcomes (Yi et al., 2026), rollout-tree branches whose outcomes differ (Ji et al., 2026), or each tool call's effect on answering correctly (Feng et al., 2026). Agent preference pairs contrast expert trajectories with failed explorations (Song et al., 2024) or expert steps with lower-scoring agent steps (Xiong et al., 2024). All of these give credit or form a pair only where outcomes differ or a step is wrong, so a silent fork, where every next action leads to the same outcome and no step is wrong, gets no weight by construction. In contrast, we locate such turns by behavior and pair two actions at the same state.
3 Preliminaries
Coding-agent trajectories. A task specifies a repository state and an instruction. A model interacts with a sandboxed repository and produces a trajectory , where is the interaction history, is a shell command or a submission, and is the observed output. A task oracle inspects the final repository and returns , the outcome of the run. Outcome-based post-training uses this outcome as a verifiable reward (Lambert et al., 2025; Guo et al., 2025).
Behavioral checker. A checker C replays the commands in and tracks the task state, including which edits have landed and which required checks have run. For each action it decides whether the action is over-defensive, such as rerunning a passed target test, running tests outside the requested scope, or adding unrequested checks, and whether a submission skips a required check. We write when neither holds and when it holds for every action in . The checker also marks a run complete when it does what the instruction asks with every check that the instruction states.
Proportionate Behavior: For a coding task q, a run should satisfy three conditions.
(1) Success. The run passes the oracle, .
(2) Sufficiency. Every check that q requires runs before submission. (3) Necessity. Every defensive action is one that q requires. The oracle verifies (1), and the checker verifies (2) and (3), the two sides of the required behavior.
Explicit and implicit budgets. Each task comes in two arms. In the explicit-budget arm, the instruction states how much checking is required, such as running one named test once. In the implicit-budget arm, the instruction omits this and the agent must infer a proportionate amount from the task, much as reasoning models must decide how many tokens to spend on a problem (Han et al., 2025). We report the violation rate on explicit-budget tasks and the disproportion rate on implicit-budget tasks. Appendix B gives the checker's rules, the thresholds of both rates, and its audits against blind annotation.
4 Silent Forks
Definition (Silent Fork). A silent fork is a turn at which the agent’s next actions differ in proportionality while all of them lead to the same outcome. Formally, turn t is a silent fork if its state satisfies
(1)
At an over-defense fork, the disproportionate action breaks Necessity, and at a skipped-check fork, it breaks Sufficiency.
Setup. Like recent pipelines that synthesize executable software-engineering tasks (Yang et al., 2025; Jain et al., 2025), we generate 368 tasks from 34 Python and Go repositories with templates that read the repository's own tests and constants, and keep a task when its target command passes and, for edit tasks, when the reference patch passes the oracle and a no-op patch fails it. We train on 318 tasks from 30 repositories and test on 48 tasks from 4 repositories unseen in training. The 4B model is Qwen3.5-4B (Qwen Team, 2026) in mini-swe-agent (Yang et al., 2024), with samples served by vLLM (Kwon et al., 2023). We examine its successful trajectories on training tasks and four frontier models, GPT-6.1-sol (OpenAI, 2026), Claude Opus 5.5 (Opus-5.5; Anthropic, 2026), DeepSeek-V4.1-Flash (DS-V4.1-Flash; DeepSeek-AI, 2026), and GLM-5.3 (Z.ai, 2026), both at the 4B model's forks and as end-to-end agents on the test tasks. Appendices C and D describe the tasks and both settings. Our key Observations are presented below.
4.1 Over-Defense Begins at Silent Forks
(a) Over-defense leaves the outcome unchanged

(b) Frontier models at the 4B model's forks
Figure 2: Over-defense leaves the outcome unchanged, and frontier models split. (a) 4B rollouts over 12 GRPO rounds. (b) Four samples per fork and model, in %.
Obs. Over-defense leaves the outcome unchanged. As shown in Figure 2.a, over-defensive runs pass the task oracle as often as the rest: 97.8% against 96.5% over the GRPO rollouts of the 4B model, and 98.0% against 97.1% on implicit-budget tasks, where over-defense is most frequent. Run end to end on our test tasks, the frontier models show the same pattern, with 98.8–100.0% against 100.0%. An outcome reward there- fore never favors over-defense and cannot tell an over-defensive success from a proportionate one. The two differ in cost, as Table 1 shows. Compared with its own proportionate runs of the same task, the 4B model takes as long when it over-defends under implicit budgets, and the frontier models take as long. On the test tasks, the over-defensive runs that do fail are those whose repeated full-suite runs lead the 4B model to rewrite the test configuration or exhaust the time or step limit. Appendix E describes these runs.
| Agent | Budget | Pairs | Over-def. ÷ prop. | ||
|---|---|---|---|---|---|
| Time | Commands | Slower | |||
| 4B model | Explicit | 76 | 1.16× | 1.25× | 78% |
| Implicit | 162 | 1.50× | 1.17× | 80% | |
| Frontier | Both | 76 | 1.46× | 1.46× | 84% |
Table 1: Over-defense costs more at the same outcome. Each pair compares one agent's over-defensive and proportionate runs of the same task that both pass the oracle, and ratios are medians over pairs.
Obs. ② Over-defense begins at forks where neither branch changes the repository. At 316 of the 317 forks where a successful trajectory of the 4B model first becomes disproportionate, neither branch changes the repository: they run tests or checks, install test dependencies, or submit. Since the oracle inspects the repository and the disproportionate branch succeeded, both branches pass it. In the frontier runs of Table 2, the first disproportionate command leaves the repository unchanged in 89.3–100.0% of over-defensive runs.
| Model | Viol. | Disprop. | Oracle (over / other) | No edit |
|---|---|---|---|---|
| GPT-6.1-sol | 2.6 | 64.0 | 100.0 / 100.0 | 89.3 |
| Opus-5.5 | 5.7 | 78.5 | 100.0 / 100.0 | 100.0 |
| DS-V4.1-Flash | 21.4 | 97.9 | 99.3 / 100.0 | 97.4 |
| GLM-5.3 | 3.4 | 82.6 | 98.8 / 100.0 | 98.8 |
Table 2: Frontier models over-defend under implicit budgets and still pass the oracle. Results on the 48 test tasks, in %, where No edit is the share of over-defensive runs whose first violation leaves the repository unchanged.
Obs. ③ Frontier models split at the same forks. We give the 4B model's fork prefixes to four frontier models and label each sampled next action with the same checker. Figure 2.b summarizes the labels. When the instruction states the budget, they rarely take the disproportionate branch, from of samples for GPT-6.1-sol to for GLM-5.3. When it does not, they take it in of their decisive actions at full-suite forks, mostly with full-suite runs. At skipped-check forks, none of them submits early, so the split is specific to over-defense forks.
4.2 Existing Signals Miss Silent Forks
Two properties of silent forks explain why outcome rewards, outcome-located credit, and trajectory-level penalties miss them.
Proposition 1. Let the reward be and let s be the state at a silent fork. Then the contribution of s to the policy gradient, , is zero, and any score of the form is zero for every a in the support.
Proposition 2. Suppose a successful trajectory passes m silent forks and the model acts proportionately at fork i with probability , independently across forks. Under , a group of G rollouts has non-zero reward variance with probability , where .
Proposition 1 explains why outcome-located credit misses silent forks. Turn-level critics (Zhou et al., 2024) fare no better, since under the value they estimate is the same for every action there. Proposition 2 explains why a trajectory-level penalty helps little, as shrinks geometrically with m, whereas a signal at the fork only needs to be non-negligible. Proofs are in Appendix F.
(a) Training signal vs. test

(b) All-zero groups
Figure 3: A trajectory-level penalty rarely yields a learning signal on implicit-budget groups. (b) All-zero-reward groups by median trajectory length.
Obs. ④ A trajectory-level penalty leaves over-defense unchanged. We train with GRPO for 12 rounds under the reward , which penalizes over-defense explicitly, and Figure 3.a tracks the run. In 71% of implicit-budget groups every trajectory receives the same reward, so most groups contribute no gradient, and in 56% no trajectory is proportionate from start to finish. On implicit-budget test tasks, the disproportion rate stays within 57.3–64.6% over the 12 rounds, and the task-level bootstrap 95% CI of its change from round 0 to round 12 is points. The penalty can punish over-defense in principle, but most groups offer no contrast to learn from, so the signal is too sparse to change behavior.
Obs. ⑤ Proportionate steps stay easy to sample as trajectories grow. As Proposition 2 predicts and Figure 3.b shows, groups with no proportionate trajectory become more frequent as trajectories grow longer, from 26% when the median trajectory has at most 4 commands to 74%, 67%, and 85% for 5–8, 9–15, and more than 15. At the fork itself, however, the alternative is a single step away, as 12 samples from the same prefix contain an action the checker accepts in 264 of 317 cases. The proportionate step is easy to sample, whereas a fully proportionate trajectory grows rare with length and a trajectory-level reward pays only for the latter, so the signal belongs at the fork itself.
5 Learning at Silent Forks
Following this finding, ForkDPO places the learning signal at the fork itself. It applies preference learning at the turns where behavior diverges and contrasts a proportionate and a disproportionate action at the same prefix, as Figure 4 shows.
5.1 Locating Silent Forks and Their Contrasts
Checker state. Replaying the commands and outputs , the checker maintains a task state that records whether the requested edit has landed and how many effective runs of each required check have occurred. From it derives the checks still owed, , and the over-defensive actions, . An action is proportionate, , when it is not over-defensive and does not submit while a check is owed,
Locating over-defense forks. For a successful trajectory, the over-defense fork is its first over-defensive turn,
This takes one replay of the trajectory and no per-turn Monte Carlo estimate of , which is the same for every action at a silent fork.
Same-prefix boundary action. We draw and accept the first

Figure 4: Learning at silent forks with ForkDPO. The checker replays a successful trajectory to locate the first disproportionate turn , the model's own samples at supply the boundary action , and skipped-check forks constrain the other side of the required behavior. A fork-level DPO objective then trains the model on both pair sets.
that lies on the boundary of the required behavior,
where if and otherwise, so the boundary action is to submit once the required checks have run and otherwise run the owed check once. The rejected action is the agent's own, . The accepted sample and the agent's own action come from the same model at the same state, so the pair isolates the decision and stays on-policy, which helps preference fine-tuning (Tajwar et al., 2024) and avoids the squeezing effect that Ren and Sutherland (2025) observe for off-policy DPO. The chosen action is also the least behavior that still suffices, so it cannot be another form of extra work. If no sample is accepted, we take the submission turn of a proportionate trajectory for the task.
Skipped-check forks. Proportionate trajectories supply pairs for Sufficiency, at the turn of the first required check,
where the premature submission is taken from another trajectory for the same task. Like an over-defense fork, this turn is silent once the prefix meets what the oracle requires, and only the checker separates the two actions. These pairs keep Sufficiency in place while over-defense pairs teach Necessity.
5.2 Fork-Level Objective and Training
Let and denote the over-defense pairs and the skipped-check pairs. ForkDPO minimizes
Algorithm 1: ForkDPO: Learning at silent forks
Input : Model , tasks Q, checker C, resample budget K, weight
Output : Updated model
;
for do
Sample trajectories ;
for with do
Replay with C to obtain ;
/* Locate the over-defense fork */
;
▷ Eq. 3
if exists then
/* Boundary action at the same prefix */
Draw ;
;
▷ Eq. 4
Add to ;
/* Skipped-check fork */
if then
;
Add to ;
▷ Eq. 5
Update by minimizing ;
▷ Eq. 6
where weights the skipped-check side, set to so that every pair counts equally, and is the DPO loss (Rafailov et al., 2023). With the implicit reward against the base model ,
Under the token-level view of DPO (Rafailov et al., 2024), the implicit reward is an optimal advantage, , so a pair that shares its prefix raises the optimal-advantage gap at the fork. ForkDPO therefore supplies a checker-defined advantage at exactly the states where Proposition 1 shows the outcome advantage to vanish.
| Method | Explicit budget | Implicit budget | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Violation ↓ | Sub. ↓ | Done ↑ | Oracle ↑ | Disproportion ↓ | Suite ↓ | Other ↓ | Done ↑ | Oracle ↑ | Time ↓ | |||||||
| Py-P1 | Py-P4 | Go-P1 | All | Py-P1 | Py-P4 | Go-P1 | All | |||||||||
| Frontier models, end to end | ||||||||||||||||
| GPT-6.1-sol | 0.0 | 9.6 | 0.0 | 2.6 | 0.0 | 99.2 | 100.0 | 85.3 | 9.6 | 82.1 | 64.0 | 49.7 | 14.3 | 74.1 | 100.0 | - |
| Opus-5.5 | 5.8 | 8.7 | 0.0 | 5.7 | 0.0 | 99.5 | 100.0 | 100.0 | 23.1 | 96.4 | 78.5 | 52.9 | 25.7 | 78.0 | 100.0 | - |
| DS-V4.1-Flash | 14.7 | 37.5 | 17.9 | 21.4 | 0.0 | 97.4 | 99.5 | 100.0 | 94.2 | 96.4 | 97.9 | 54.7 | 43.2 | 90.5 | 100.0 | - |
| GLM-5.3 | 3.1 | 5.8 | 0.0 | 3.4 | 0.0 | 99.5 | 100.0 | 96.4 | 44.2 | 100.0 | 82.6 | 51.1 | 31.6 | 94.7 | 98.9 | - |
| Base | 3.1 | 11.5 | 12.5 | 6.8 | 0.0 | 97.1 | 97.7 | 89.3 | 21.2 | 85.7 | 70.3 | 53.6 | 16.7 | 82.8 | 94.3 | 143 |
| GRPO | ||||||||||||||||
| Round 0 | 0.9 | 15.4 | 3.6 | 5.2 | 2.6 | 92.2 | 96.9 | 75.0 | 11.5 | 85.7 | 59.4 | 54.2 | 5.2 | 82.3 | 88.5 | 123 |
| Round 4 | 0.9 | 11.5 | 3.6 | 4.2 | 1.0 | 91.1 | 93.8 | 71.4 | 34.6 | 85.7 | 63.5 | 53.1 | 10.4 | 82.3 | 90.6 | 124 |
| Round 8 | 0.9 | 21.2 | 0.0 | 6.3 | 3.6 | 91.7 | 94.3 | 71.4 | 15.4 | 78.6 | 57.3 | 51.0 | 6.3 | 80.2 | 93.8 | 123 |
| Round 12 | 0.9 | 11.5 | 0.0 | 3.7 | 4.2 | 89.0 | 93.7 | 73.2 | 34.6 | 85.7 | 64.6 | 53.1 | 11.5 | 92.7 | 94.8 | 117 |
| DPO | ||||||||||||||||
| ForkDPO | ||||||||||||||||
Table 3: Results on 48 test tasks from 4 unseen repositories, in % except Time in median seconds per run. P1 runs a test, P4 edits and verifies, Sub. submits early, Other is disproportion without a full suite, Done is completion, and Oracle is the oracle pass rate. Bold marks the best of Base, DPO, and ForkDPO, and arrows give changes from Base.
In practice, the pairs are mined once from successful runs of the base model on the training tasks, and Eq. (6) is optimized offline. The checker enters only when the pairs are built, so the trained model runs without it at the cost of the base model. Algorithm 1 summarizes the procedure.
6 Experiments
We test whether pairs at silent forks reduce over-defense on unseen repositories, whether both sides are needed, and whether their placement matters.
6.1 Experimental Setup
Training and evaluation. ForkDPO and the GRPO baseline train LoRA adapters (Hu et al., 2022) on the 318 training tasks, ForkDPO with TRL (von Werra et al., 2020). Evaluation samples explicit-budget and implicit-budget runs per test task at temperature 1.0. Guardrail tasks, whose correct behavior is to delete a file or edit without guards, check that training adds no defensive code. Appendix H gives the training configuration and the evaluation protocol.
Baselines. We compare ForkDPO with the base model, with GRPO under the reward , and with DPO on pairs placed at random turns, which keeps the trajectories, pair count, skipped-check forks, acceptance rule, and training schedule of ForkDPO and moves each over-defense pair to a turn drawn uniformly from its trajectory. The explicit-budget arm, which states the required checking, serves as the instruction-only control, and the frontier models we examined as references.
Metrics and checker reliability. We report the violation rate on explicit-budget tasks and the disproportion rate on implicit-budget tasks, the latter split into full-suite runs and other forms, as well as completion, the oracle pass rate, and median wall-clock time. Against two rounds of blind annotation on 177 and 117 runs, the checker reaches precision/recall of at least 0.93/0.92 for over-defense and 0.89/0.94 for completion, and agrees with blind annotation on 92 of 96 single actions at forks.
6.2 Results
Signals at silent forks reduce over-defense on unseen repositories. As shown in Table 3, ForkDPO lowers implicit-budget disproportion from 70.3% to 58.9%, raises completion from 82.8% to 85.9%, and cuts the median run from 143 to 90 seconds. Its implicit-budget disproportion is also lower than that of the four frontier models, which range from 64.0% to 97.9%. The task-level bootstrap 95% CI of the disproportion change is points. Python run tasks change most, from 89.3% to 68.8%, with 11 tasks improving and none worsening, and repeated target runs on Go explicit-budget tasks fall from 12.5% to 0%, while 1.6% of explicit-budget runs submit without the check.
| Set | Done↑ | Viol. ↓ | Sub. ↓ | |||||
|---|---|---|---|---|---|---|---|---|
| None | Over | Both | None | Over | Both | Over | Both | |
| Test run (17) | 100.0 | 83.6 | 100.0 | 4.4 | 4.5 | 5.9 | 11.9 | 0.0 |
| Test scope (10) | 100.0 | 90.0 | 100.0 | 10.0 | 2.5 | 2.5 | 10.0 | 0.0 |
| Guardrail (15) | 100.0 | 91.2 | 100.0 | 0.0 | 5.9 | 0.0 | 2.9 | 0.0 |
| Training dist. (24) | 99.0 | 69.8 | 99.0 | 29.2 | 6.2 | 21.9 | 11.5 | 0.0 |
Table 4: One-sided pairs teach the model to do less. Earlier round: None (base), over-defense pairs only (55), or both sides (+44 skipped-check pairs), with task counts in parentheses and values in %.
Both sides of the required behavior are needed. As shown in Table 4, over-defense pairs alone, with , teach Necessity at the cost of Sufficiency: up to of test runs submit without the required check, completion on training-distribution tasks falls from 99% to 70%, and guardrail tasks acquire new guard code. Mixing in skipped-check pairs at equal weight per pair removes every submit-only run and restores completion on every set, while median time stays 36–50% below the base.

Figure 5: The reduction sits where the forks contrast. Implicit-budget tasks, with (b) on a log scale.
The reduction sits in the behaviors the forks contrast. In Figure 5.a, disproportion without a full-suite run, mostly repeated runs and extra checks, falls from to , so the gain does not rest on the full-suite rule, whereas full-suite runs stay at and . Every remaining violation on Python run tasks under implicit budgets is a full-suite run. Fewer reruns and checks account for the time saved, which Figure 5.b shows falling from 930 to 330 seconds per Python run task.

Figure 6: Silent forks come early in a trajectory. and count the agent actions before each kind of fork.
Pairs away from the fork teach little. At random turns, DPO leaves disproportion at 67.7% and other disproportion at 14.6%, against 58.9% and 6.3% for ForkDPO, while full-suite runs stay at 51–54% under every method, so the methods differ in the behaviors the pairs contrast. A trajectory has one over-defense fork, its first disproportionate turn, and Figure 6 shows that these forks come early, with the median one after two actions and 66% after at most two. A turn drawn uniformly from the trajectory therefore rarely lands on the fork, and only 21.3% of the random-turn pairs land on a disproportionate action.
| Method | Training | Implicit budget | |||
|---|---|---|---|---|---|
| Runs | Updates | Hours | Disprop. (%) | Time (s) | |
| GRPO | 6,883 | 557 | 9.5 | ||
| DPO | 4,660 | 244 | 0.9 | ||
| ForkDPO | 4,660 | 244 | 0.9 | ||
Table 5: Learning at the fork is cheap. Runs are sampled agent runs, updates are optimizer steps, hours are update time, and arrows go from before to after training.
Placement decides success. GRPO puts the same checker into its reward and moves neither rate across 12 rounds, going from 59.4% to 64.6% after 6,883 rollouts and 9.5 hours of updates, whereas ForkDPO learns from 488 pairs in 244 updates and under one hour, as Table 5 shows. The three methods share the checker and differ in where its judgment enters training, over whole trajectories, at random turns, or at silent forks. Figure 7 shows that the reduction follows the share of the signal placed at violating forks, about a fifth of the reduction under ForkDPO at random turns and none over whole trajectories. The ordering matches Proposition 2, since a trajectory-level reward pays only for trajectories that are proportionate at every fork and then spreads that payment over every turn of the rollout, whereas a fork pair needs a single proportionate step and places its judgment on the turn where behavior diverges. Where a behavioral signal is placed, more than how much training it receives, decides whether the model learns it.

Figure 7: The gain tracks how many pairs sit at over-defense forks. Reductions are in points from Base (from round 0 for GRPO) on implicit-budget test tasks, and the band scales the CI of ForkDPO linearly from zero.
7 Conclusion
In this paper, we show that over-defense in coding agents begins at silent forks, the turns where every next action leads to the same outcome. Outcome rewards, outcome-located credit, and trajectory-level penalties cannot reach these turns, and frontier models split there as a 4B model does. Learning from pairs placed there and constrained on both sides, ForkDPO reduces over-defense and run time on unseen repositories more than GRPO and DPO at random turns. We believe that placing learning signals where behavior diverges offers a general recipe for shaping how agents act beyond whether they finish, from checks to tool calls.
Limitations
We note several limitations of our work:
Training frontier models is beyond our budget, as most of them do not release their weights and the open ones are too large for our compute. We therefore diagnose frontier models and train a single 4B model, and the size of the effect may differ for larger models. All tasks come from open-source Python and Go repositories.
All runs use a minimal agent harness with a single bash tool and no dedicated tools for testing, editing, or planning. This keeps every choice at a fork with the model itself and also places our setting at some distance from deployed agents, where richer tools or pipelines that fix the order of localization, repair, and patch validation (Xia et al., 2025) may present different forks.
The checker is written as rules, so every label is reproducible and can be audited against blind annotation, while its coverage bounds what can be taught. Behavior that no pair covers, such as out-of-scope edits on explicit-budget tasks, can also increase (Zhong et al., 2026).
We study tasks whose proportionate amount of checking can be decided from the instruction and the repository, so that proportionate behavior has an objective criterion. Behaviors whose appropriate amount depends on unstated user preferences or on the cost of a failure in deployment are outside this scope.
A fork pair contrasts two actions at one state, so over-defense that only emerges from a sequence of individually proportionate actions has no single turn at which it can be located.
References
Marah Abdin, Jyoti Aneja, Harkirat Behl, et al. 2024. Phi-4 technical report. arXiv preprint arXiv:2412.08905.
Pranjal Aggarwal and Sean Welleck. 2025. L1: Controlling how long a reasoning model thinks with reinforcement learning. In Conference on Language Modeling.
Anthropic. 2026. Introducing Claude Opus 5.5. https://www.anthropic.com/claude-opus-5-5. Released September 22, 2026. Accessed 2026-10-11.
Daman Arora and Andrea Zanette. 2025. Training language models to reason efficiently. In Advances in Neural Information Processing Systems.
Eric J. Bigelow, Ari Holtzman, Hidenori Tanaka, and Tomer Ullman. 2025. Forking paths in neural text generation. In International Conference on Learning Representations.
Islem Bouzenia and Michael Pradel. 2025. Understanding software engineering agents: A study of thought-action-result trajectories. In 2025 40th IEEE/ACM International Conference on Automated Software Engineering (ASE), pages 2846–2857.
Xingyu Chen, Jiahao Xu, Tian Liang, Zhiwei He, Jianhui Pang, Dian Yu, Linfeng Song, Qiuzhi Liu, Mengfei Zhou, Zhuosheng Zhang, Rui Wang, Zhaopeng Tu, Haitao Mi, and Dong Yu. 2025. Do NOT think that much for 2+3=? on the overthinking of long reasoning models. In International Conference on Machine Learning, pages 9487–9499.
Alejandro Cuadron et al. 2025. The danger of overthinking: Examining the reasoning-action dilemma in agentic tasks. arXiv preprint arXiv:2502.08235.
DeepSeek-AI. 2026. DeepSeek-V4.1-Flash: Pushing the limits of KV cache compression. Technical report, https://huggingface.co/deepseek-ai/DeepSeek-V4.1-Flash. Released September 10, 2026; announcement: https://api-docs.deepseek.com/news/news260910. Accessed 2026-10-11.
Lang Feng, Zhenghai Xue, Tingcong Liu, and Bo An. 2025. Group-in-group policy optimization for LLM agent training. In Advances in Neural Information Processing Systems.
Mingkuan Feng, Jinyang Wu, Hao Gu, et al. 2026. TACO: Tool-augmented credit optimization for agentic tool use. arXiv preprint arXiv:2606.30251.
Thibaud Gloaguen, Niels Mündler, Mark Müller, Veselin Raychev, and Martin Vechev. 2026. Coding agents don’t know when to act. arXiv preprint arXiv:2605.07769.
Daya Guo, Dejian Yang, Haowei Zhang, Junxiao Song, Peiyi Wang, Qihao Zhu, Runxin Xu, Ruoyu Zhang, Shirong Ma, Xiao Bi, Xiaokang Zhang, Xingkai Yu, et al. 2025. DeepSeek-R1 incentivizes reasoning in LLMs through reinforcement learning. Nature, 645(8081):633–638.
Tingxu Han, Zhenting Wang, Chunrong Fang, Shiyu Zhao, Shiqing Ma, and Zhenyu Chen. 2025. Token-budget-aware LLM reasoning. In Findings of the Association for Computational Linguistics: ACL 2025, pages 24842–24855.
HfG Schwäbisch Gmünd. 2019. OpenMoji: The open-source emoji and icon project.
Zhenyu Hou, Ziniu Hu, Yujiang Li, Rui Lu, Jie Tang, and Yuxiao Dong. 2025. TreeRL: LLM reinforcement learning with on-policy tree search. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 12355–12369.
Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. 2022. LoRA: Low-rank adaptation of large language models. In International Conference on Learning Representations.
Yiran Hu, Nan Jiang, Shanchao Liang, Anik Dey, Yi Wu, and Lin Tan. 2026. Analyzing and mitigating cost-inefficient behaviors in coding agents. arXiv preprint arXiv:2609.30725.
Naman Jain, Jaskirat Singh, Manish Shetty, Tianjun Zhang, Liang Zheng, Koushik Sen, and Ion Stoica. 2025. R2E-Gym: Procedural environment generation and hybrid verifiers for scaling open-weights SWE agents. In Conference on Language Modeling.
Yuxiang Ji, Ziyu Ma, Yong Wang, Guanhua Chen, Xiangxiang Chu, and Liaoni Wu. 2026. Tree search for LLM agent reinforcement learning. In International Conference on Learning Representations.
Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, and Karthik Narasimhan. 2024. SWE-bench: Can language models resolve real-world GitHub issues? In International Conference on Learning Representations.
Amirhossein Kazemnejad, Milad Aghajohari, Eva Portelance, Alessandro Sordoni, Siva Reddy, Aaron Courville, and Nicolas Le Roux. 2025. VinePPO: Refining credit assignment in RL training of LLMs. In International Conference on Machine Learning, pages 29557–29590.
Woosuk Kwon, Zhuohan Li, Siyuan Zhuang, Ying Sheng, Lianmin Zheng, Cody Hao Yu, Joseph E. Gonzalez, Hao Zhang, and Ion Stoica. 2023. Efficient memory management for large language model serving with PagedAttention. In Proceedings of the 29th Symposium on Operating Systems Principles, pages 611–626.
Xin Lai, Zhuotao Tian, Yukang Chen, Senqiao Yang, Xiangru Peng, and Jiaya Jia. 2024. Step-DPO: Stepwise preference optimization for long-chain reasoning of LLMs. arXiv preprint arXiv:2406.18629.
Nathan Lambert, Jacob Morrison, Valentina Pyatkin, Shengyi Huang, Hamish Ivison, Faeze Brahman, Lester James Validad Miranda, Alisa Liu, Nouha Dziri, Xinxi Lyu, Yuling Gu, Saumya Malik, Victoria Graf, Jena D. Hwang, Jiangjiang Yang, Ronan Le Bras, Oyvind Tafjord, Christopher Wilhelm, Luca Soldaini, and 4 others. 2025. Tulu 3: Pushing frontiers in open language model post-training. In Conference on Language Modeling.
Bin Lei, Yu Li, Prafulla Kumar Choubey, et al. 2026. Fork where the model changes its mind: Belief-shift branching for tree-structured reinforcement learning. arXiv preprint arXiv:2609.11061.
Hunter Lightman, Vineet Kosaraju, Yura Burda, Harri Edwards, Bowen Baker, Teddy Lee, Jan Leike, John Schulman, Ilya Sutskever, and Karl Cobbe. 2024. Let's verify step by step. In International Conference on Learning Representations.
Zicheng Lin, Tian Liang, Jiahao Xu, Qiuzhi Liu, Xing Wang, Ruilin Luo, Chufan Shi, Siheng Li, Yujiu Yang, and Zhaopeng Tu. 2025. Critical tokens matter: Token-level contrastive estimation enhances LLM's reasoning capability. In International Conference on Machine Learning, pages 37906–37918.
Hanjun Luo, Xiucheng Zhang, Zhuoning Xu, Zhimu Huang, Yingbin Jin, Xinfeng Li, and Hanan Salam. 2026. ParanoiaEval: Benchmarking unnecessary defensive work in agentic coding. arXiv preprint arXiv:2610.08662.
Sourab Mangrulkar, Sylvain Gugger, Lysandre Debut, Younes Belkada, Sayak Paul, Benjamin Bossan, and Marian Tietz. 2022. PEFT: State-of-the-art parameter-efficient fine-tuning methods. https://github.com/huggingface/peft.
Microsoft. 2022. Fluent Emoji.
OpenAI. 2026. Introducing GPT-6.1 Sol. https://openai.com/index/introducing-gpt-6-1-sol/. Released September 29, 2026; API model gpt-6.1-sol. Accessed 2026-10-11.
Jiayi Pan, Xingyao Wang, Graham Neubig, Navdeep Jaitly, Heng Ji, Alane Suhr, and Yizhe Zhang. 2025. Training software engineering agents and verifiers with SWE-Gym. In International Conference on Machine Learning, pages 47717–47737.
Cheng Qian, Emre Can Acikgoz, Hongru Wang, Xiusi Chen, Avirup Sil, Dilek Hakkani-Tür, Gokhan Tur, and Heng Ji. 2025. SMART: Self-aware agent for tool overuse mitigation. In Findings of the Association for Computational Linguistics: ACL 2025, pages 4604–4621.
Qwen Team. 2026. Qwen3.5: Towards native multimodal agents. https://qwen.ai/blog?id=qwen3.5. Alibaba. Qwen3.5-4B model card: https://huggingface.co/Qwen/Qwen3.5-4B. Accessed 2026-10-11.
Rafael Rafailov, Joey Hejna, Ryan Park, and Chelsea Finn. 2024. From to : Your language model is secretly a Q-function. In Conference on Language Modeling.
Rafael Rafailov, Archit Sharma, Eric Mitchell, Christopher D. Manning, Stefano Ermon, and Chelsea Finn. 2023. Direct preference optimization: Your language model is secretly a reward model. In Advances in Neural Information Processing Systems.
Yi Ren and Danica J. Sutherland. 2025. Learning dynamics of LLM finetuning. In International Conference on Learning Representations.
Amrith Setlur, Chirag Nagpal, Adam Fisch, Xinyang Geng, Jacob Eisenstein, Rishabh Agarwal, Alekh Agarwal, Jonathan Berant, and Aviral Kumar. 2025. Rewarding progress: Scaling automated process verifiers for LLM reasoning. In International Conference on Learning Representations.
Zhihong Shao, Peiyi Wang, Qihao Zhu, Runxin Xu, Junxiao Song, Xiao Bi, Haowei Zhang, Mingchuan Zhang, Y. K. Li, Y. Wu, and Daya Guo. 2024. DeepSeekMath: Pushing the limits of mathematical reasoning in open language models. arXiv preprint arXiv:2402.03300.
Yifan Song, Da Yin, Xiang Yue, Jie Huang, Sujian Li, and Bill Yuchen Lin. 2024. Trial and error: Exploration-based trajectory optimization of LLM agents. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 7584–7600.
Fahim Tajwar, Anikait Singh, Archit Sharma, Rafael Rafailov, Jeff Schneider, Tengyang Xie, Stefano Ermon, Chelsea Finn, and Aviral Kumar. 2024. Preference fine-tuning of LLMs should leverage suboptimal, on-policy data. In International Conference on Machine Learning, pages 47441–47474.
Leandro von Werra, Younes Belkada, Lewis Tunstall, Edward Beeching, Tristan Thrush, Nathan Lambert, Shengyi Huang, Kashif Rasul, and Quentin Gallouédec. 2020. TRL: Transformers reinforcement learning. https://github.com/huggingface/trl. GitHub repository.
Hongru Wang, Cheng Qian, et al. 2025a. Acting less is reasoning more! teaching model to act efficiently. arXiv preprint arXiv:2504.14870.
Peiyi Wang, Lei Li, Zhihong Shao, Runxin Xu, Damai Dai, Yifei Li, Deli Chen, Yu Wu, and Zhifang Sui. 2024. Math-shepherd: Verify and reinforce LLMs step-by-step without human annotations. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 9426–9439.
Shenzhi Wang, Le Yu, Chang Gao, et al. 2025b. Beyond the 80/20 rule: High-entropy minority tokens drive effective reinforcement learning for LLM reasoning. arXiv preprint arXiv:2506.01939.
Xingyao Wang, Boxuan Li, Yufan Song, Frank F. Xu, Xiangru Tang, Mingchen Zhuge, Jiayi Pan, Yueqi Song, Bowen Li, Jaskirat Singh, Hoang H. Tran, Fuqiang Li, Ren Ma, Mingzhang Zheng, Bill Qian, Daniel Shao, Niklas Muennighoff, Yizhe Zhang, Binyuan Hui, and 5 others. 2025c. OpenHands: An open platform for AI software developers as generalist agents. In International Conference on Learning Representations.
Yuxiang Wei et al. 2025. SWE-RL: Advancing LLM reasoning via reinforcement learning on open software evolution. arXiv preprint arXiv:2502.18449.
Chunqiu Steven Xia, Yinlin Deng, Soren Dunn, and Lingming Zhang. 2025. Demystifying LLM-based software engineering agents. Proceedings of the ACM on Software Engineering, 2(FSE):801–824.
Weimin Xiong, Yifan Song, Xiutian Zhao, Wenhao Wu, Xun Wang, Ke Wang, Cheng Li, Wei Peng, and Sujian Li. 2024. Watch every step! LLM agent learning via iterative step-level process refinement. In Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing, pages 1556–1572.
John Yang, Carlos E. Jimenez, Alexander Wettig, Kilian Lieret, Shunyu Yao, Karthik Narasimhan, and Ofir Press. 2024. SWE-agent: Agent-computer interfaces enable automated software engineering. In Advances in Neural Information Processing Systems.
John Yang, Kilian Lieret, Carlos E. Jimenez, Alexander Wettig, Kabir Khandpur, Yanzhe Zhang, Binyuan Hui, Ofir Press, Ludwig Schmidt, and Diyi Yang. 2025. SWE-smith: Scaling data for software engineering agents. In Advances in Neural Information Processing Systems (Datasets and Benchmarks Track).
Junkeun Yi, Damon Mosk-Aoyama, Baihe Huang, et al. 2026. PivotRL: High accuracy agentic post-training at low compute cost. arXiv preprint arXiv:2603.21383.
Qiying Yu et al. 2025. DAPO: An open-source LLM reinforcement learning system at scale. arXiv preprint arXiv:2503.14476.
Z.ai. 2026. GLM-5.3: Frontier coding with emergent cyber capabilities. https://z.ai/blog/glm-5.3. Zhipu AI. Released August 14, 2026. Accessed 2026-10-11.
Yongcheng Zeng, Guoqing Liu, Weiyu Ma, Ning Yang, Haifeng Zhang, and Jun Wang. 2024. Token-level direct preference optimization. In International Conference on Machine Learning.
Chenchen Zhang. 2026. From reasoning to agentic: Credit assignment in reinforcement learning for large language models. arXiv preprint arXiv:2604.09459.
Congmin Zheng, Jiachen Zhu, Zhuoying Ou, Yuxiang Chen, Kangning Zhang, Rong Shan, Zeyu Zheng, Mengyue Yang, Jianghao Lin, Yong Yu, and Weinan Zhang. 2025. A survey of process reward models: From outcome signals to process supervisions for large language models. arXiv preprint arXiv:2510.08049.
Ziqian Zhong, Aditi Raghunathan, and Nicholas Carlini. 2026. ImpossibleBench: Measuring LLMs' propensity of exploiting test cases. In International Conference on Learning Representations.
Yifei Zhou, Song Jiang, Yuandong Tian, Jason Weston, Sergey Levine, Sainbayar Sukhbaatar, and Xian Li. 2025. SWEET-RL: Training multi-turn LLM agents on collaborative reasoning tasks. arXiv preprint arXiv:2503.15478.
Yifei Zhou, Andrea Zanette, Jiayi Pan, Sergey Levine, and Aviral Kumar. 2024. ArCHer: Training language model agents via hierarchical multi-turn RL. In International Conference on Machine Learning, pages 62178–62209.
Tongyao Zhu, Wei Hern Lim, and Min-Yen Kan. 2026. When models edit too much: On the fidelity of minimal code edits. arXiv preprint arXiv:2609.04061.
Contents of Appendix
A Notation 14
B Checker Rules and Audit 14
B.1 Effective Runs, Completion, and Thresholds 14
B.2 Rules 15
B.3 Audit Protocol and Agreement 16
B.4 Examples of Each Violation Type 16
B.5 Labeling Single Actions at Forks 17
C Task Construction 17
C.1 Generators and Arms 17
C.2 Gates and Splits 18
C.3 Agent Harness 18
D Frontier Diagnosis 19
D.1 Fork Probe 19
D.2 Frontier Models End to End on Our Tasks 20
E Over-Defensive Runs That Fail 21
F Proofs 21
G Fork Mining and Pair Statistics 21
G.1 Composition of the Pair Set 22
G.2 Why the Forks Are Silent 22
H Training Details 23
H.1 ForkDPO 23
H.2 Training Curve 23
H.3 GRPO 24
H.4 DPO at Random Turns 24
H.5 Evaluation Protocol 25
I Additional Results 25
I.1 Test Results by Stratum 25
I.2 Test Results by Repository 25
I.3 Violation Forms 25
I.4 Confidence Intervals 25
I.5 One-Sided and Two-Sided Pairs 25
J Case Studies 26
K Compute and Cost 27
| Symbol | Meaning | Value here |
| Tasks, trajectories, and rewards | ||
| Coding task: repository state and instruction | 368 tasks | |
| Model being trained; frozen reference model of the DPO loss | Qwen3.5-4B | |
| Trajectory of interaction histories, actions, and outputs | at most 50 steps | |
| History before turn ; shell command or submission at ; its output | ||
| Submission action | ||
| Task oracle; inspects the final repository state | ||
| Trajectory reward; or | ||
| Expected reward after taking at and following | ||
| Optimal action value, state value, and advantage (token-level view of DPO) | ||
| Behavioral checker | ||
| Rule-based behavioral checker | ||
| Checker state after replaying : edit landed, effective runs per required check | ||
| Number of runs the task requests | 1, 2, or 3 | |
| Checks still owed at | ||
| Over-defensive actions at | ||
| Boundary actions: if , else | ||
| Action, or every action of , is proportionate | ||
| Silent forks and pairs | ||
| Success probability shared by all actions in the support at a silent fork | ||
| First disproportionate turn of a successful trajectory | median 2 | |
| Turn of the first required check (skipped-check fork) | median 0 | |
| Turn drawn uniformly from the same trajectory (DPO baseline) | ||
| Proportionate and disproportionate action at a fork | ||
| Resample budget at a fork | 12 | |
| Silent forks on a trajectory; probability of acting proportionately at fork ; | ||
| Over-defense and skipped-check pairs | 317 and 190 | |
| Training and evaluation | ||
| DPO loss and its temperature | ||
| Weight of the skipped-check side | ||
| GRPO group size per task and arm | 6 (rounds 9–12: 4 / 8) | |
| Number of GRPO groups | 96 per round | |
| Evaluation runs per task | 8 explicit, 4 implicit | |
Table 6: Notation. Values are those of the experiments.
A Notation
Table 6 collects the symbols used in the main text and in this appendix, with the value each takes in our experiments.
B Checker Rules and Audit
The checker replays a run's commands and outputs, tracks the task state, and labels completion and over-defense with the fixed rules of Table 7.
B.1 Effective Runs, Completion, and Thresholds
The rules below define what counts as a run and when a task is done.
What counts as a run. The checker counts test runs as follows:
-
An effective run is a test command that printed results, such as N passed, N failed, N errors, or Go ok/FAIL/PASS after ANSI codes are stripped, and that shows no hard-failure signature, such as errors during collection, no tests ran, INTERNALERROR, usage: pytest, file or directory not found, command not found, build failed, cannot find package, or no Go files.
-
A run redirected with > file or | tee file counts if it exits with code 0 or 1. Merging streams with 2>&1 alone does not count as redirection.
-
A failed run followed by an environment fix, such as pip install, uv sync, uv add, apt-get, or go mod download, does not count, and the fix is never over-defense.
-
A test command counts only in command position, after echo and printf segments are removed.
| Violation | Definition | Does not count |
|---|---|---|
| Explicit budget (arm A): run and edit-and-verify tasks | ||
| Target rerun | More than n effective runs of the full target, counting equivalent spellings such as a relative path after cd, options that keep the tested set, and python -m pytest, and on edit-and-verify tasks only runs after the final edit | Corrective rerun after a mechanical or environment failure; a run before the edit, recorded as a baseline; runs while the edit never landed |
| Off-target test | Any other test run: another file, a directory, the whole suite, pytest without a path, a widened -k | A corrected path to the same file; collection only; a command that never started |
| Subset recheck | A node id (::) or -k subset of the target after a full target run | A subset without a full run, which leaves the task undone |
| Extra check | An unrequested lint, type, compile, or import check: ruff, flake8, mypy, black, pylint, isort, pyflakes, py_compile, compileall, go vet, gofmt, golangci-lint, staticcheck, python -c "import ..." | A python -c one-liner that edits or imports only utility modules (re, json, os, sys, ...); grep or sed -n to locate the edit; a check right after an environment failure |
| File write | A file inside the repository that the agent named or redirected output to (tee logs, reports, scripts, .bak) | Tool caches and by-products (.pytest_cache, __pycache__, __pypackages__, .pdm-python, build/, dist/, ...); files outside the repository; manifest changes from environment fixes |
| Out-of-scope edit | In the final patch of the edited file, more than one hunk, more than two added lines, or a removed line whose content does not reappear; on run tasks, any change to source or tests | The comma or line break needed to append; intermediate edits the final patch reverts |
| Rollback comparison | git stash, checkout, or restore followed by a test run before the file is edited again, with more than one effective target run | A checkout immediately followed by redoing the edit |
| Implicit budget (arm B): run and edit-and-verify tasks | ||
| Full suite | pytest with no path, options only, or a top-level test directory (tests/, test/, tests/unit/, tests/integration/, unit_test/, sdk/python/tests/); go test with /...; make test*, tox, nox, pdm test, npm test, ./hack/*test*; timed-out attempts count | A specific file, a subdirectory such as tests/unit/infra/, one Go package; a suite command that never started |
| Test runs | More than max(2, n + 1) effective test runs | Failures and their corrective reruns |
| Other | Extra check, file write, out-of-scope edit, rollback comparison as in arm A | Manifest changes from environment fixes |
| Guardrail tasks (both arms) | ||
| Delete | Moved, commented out, or backed up instead of deleted; new files; depreciation or backup wording; asking for permission | |
| Parameter | Guard lines for the new parameter (bounds, raise, isinstance, try, clamping) or invalid-input tests | |
Table 7: Checker rules. A run over-defends if it carries any violation of its arm.
-
Loops and chains count once per execution, with for i in 1 2 3, {1..5}, seq, and range(n) expanded.
-
On edit-and-verify tasks, runs count from the last edit of the target file.
When a task is done. Table 8 gives the completion condition and the run limit of each task type. A submit-only run submits without any command other than reads. An environment-blocked run lands the edit and attempts the target without an effective run.
| Task | Done | Run limit | ||
|---|---|---|---|---|
| Explicit | Implicit | Expl. | Impl. | |
| Run (P1) | n target runs | any result | n | |
| Edit+verify (P4) | edit, then n runs | edit landed | n | |
| Delete (P2) | file deleted | file deleted | - | - |
| Parameter (P3) | oracle passes | oracle passes | - | - |
Table 8: Completion and run limits by task type. n is the number of target runs the task states, 1 unless stated, and runs are effective runs.
B.2 Rules
The explicit-budget arm flags anything beyond the stated check, whereas the implicit-budget arm has no target and flags only disproportionate.
B.3 Audit Protocol and Agreement
Two annotation experts from the author team label every audited run. They are distinct from the team members who wrote the checker. Each run is exported to a sheet with the instruction, the numbered commands with exit codes and output tails, the changed files, the patch, and the final report, without any checker verdict. The experts review each sheet independently, without seeing each other's labels, and record completion, every action beyond the required checking with its form and command numbers, and unsupported claims in the final report. They then compare their records and discuss every disagreement until they reach a consensus, and only consensus labels serve as references. Round 1 samples 177 of the 618 explicit-budget Python runs of the base model, stratified by task type and checker verdict, which gives 99 run and 78 edit-and-verify runs. Round 2 samples 117 runs stratified by model, arm, language, and verdict. Table 9 summarizes both rounds, and Table 10 gives the agreement of the checker with the consensus labels.
Annotation rules. The experts apply the written rules of Table 7 to observable actions. An action counts as over-defense when it tests, checks, or guards beyond what the instruction requires, such as rerunning a passed target, running tests outside the requested scope, or adding an unrequested check. Reading the repository, the required target run, a rerun after an intervening edit, a final inspection of the diff, and steps the environment requires stay within the baseline. Task failure and unsupported claims in the final report are recorded separately and do not by themselves count as over-defense.
| Round 1 | Round 2 | |
|---|---|---|
| Annotated runs | 177 | 117 |
| Coverage | ||
| Edit-and-verify runs | 78 | 32 |
| Most frequent labels | ||
| Target reruns | 37 | - |
| Full-suite runs | - | 37 |
| Repeated runs | - | 26 |
| Extra checks | 17 | - |
| Out-of-scope edits | 14 | 15 |
| File writes | 11 | - |
| Skipped checks | - | 9 |
Table 9: Audit rounds. Label counts list the four most frequent labels of each round, and – marks labels outside them.
| Checker | n | Over-defense | Completion | ||||
|---|---|---|---|---|---|---|---|
| P | R | Counts | P | R | Counts | ||
| Round 1 | |||||||
| All | 177 | 1.00 | 0.92 | 57/0/5 | 1.00 | 0.95 | 166/0/9 |
| Run | 99 | 1.00 | 1.00 | 29/0/0 | 1.00 | 1.00 | 99/0/0 |
| Edit+verify | 78 | 1.00 | 0.85 | 28/0/5 | 1.00 | 0.88 | 67/0/9 |
| Round 2 | |||||||
| All | 117 | 0.93 | 0.95 | 69/5/4 | 0.89 | 0.94 | 92/11/6 |
| Explicit | 51 | 0.96 | 0.96 | 22/1/1 | 1.00 | 1.00 | 47/0/0 |
| Implicit | 66 | 0.92 | 0.94 | 47/4/3 | 0.80 | 0.88 | 45/11/6 |
| Go | 35 | 1.00 | 1.00 | 25/0/0 | 0.97 | 0.94 | 32/1/2 |
| Python | 82 | 0.90 | 0.92 | 44/5/4 | 0.86 | 0.94 | 60/10/4 |
| ForkDPO runs | 35 | 0.79 | 0.94 | 15/4/1 | 0.90 | 1.00 | 28/3/0 |
| Edit+verify | 32 | 0.93 | 0.93 | 13/1/1 | 0.68 | 1.00 | 19/9/0 |
Table 10: Checker agreement with blind annotation. Counts are TP/FP/FN, and indented rows are subsets.
B.4 Examples of Each Violation Type
Violation types in real runs (outputs abridged)
Target rerun (explicit, g35-black-test-ranges, base). Instruction: run pytest tests/test_ranges.py -q once. pytest tests/test_ranges.py -q 38 passed in 0.26s Why: the second effective run of the full target exceeds n = 1. Off-target test (explicit, g35-dynaconf-test-envvar-prefix, base). cd /testbed && pytest tests/test_envvar_prefix.py -q cd: No such file pwd && pytest -q whole repository, 10 errors cd /dynaconf && pytest tests/test_envvar_prefix.py -q 2 passed Why: the second command runs every test, and the first is a mechanical failure that does not count. Subset recheck (explicit, gev2-llama-stac-server-tls-fips-approved-ciphers, fork at turn 21). After a full target run with 1 failed and 27 passed: uv run pytest tests/unit/server/test_tls_config.py -q -k "not test_fips_ciphers_are_aes_gcm_only" Why: a -k subset of the target after a full run. Extra check (explicit, gev-dynaconf-base-reserved-attrs, base). After the edit and one target run: pytest tests/test_core_utils.py -q 2>&1 | tee run1.txt && ... | tee run2.txt && ... | tee run3.txt && echo "=== COMPARISON ===" ... Why: three runs, as requested, but three log files written into the repository. Out-of-scope edit (explicit, gev2-garak-packagehallucination-stub-prompts). After a failed first edit:
sed -i '/^]\/s/\]/ "zz_extra_ entry",\n]/' garak/probes/ packagehallucination.py $ pytest tests/probes/test_probes_ packagehallucination.py -q 14 passed Why: the pattern matches every bare ], so the entry lands in three lists, three hunks in all. The checkout is not a rollback comparison, since the edit is redone before any test.
Full suite (implicit, g35-pdm-test-completion, base). Instruction: see whether the tests pass now. $ pytest -v --tb=short 1426 passed, 15 skipped, 4 errors; 284 s Why: pytest without a path runs the whole suite.
Test runs beyond max(2, n + 1) (implicit, g35v2- haystack-test-document-mrr-x2, base). i ==="; python -m pytest test/components/evaluators/ test_document_mrr.py -q; done Why: five effective runs, above max(2, 2 + 1) = 3.
Premature submission (skipped-check pair, gev2- litellm-router-valid-litellm-environments). After the new entry is already in the list: $ echo COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT Reply: "All tests passed successfully. I've added zz_ extra_entry to the VALID_LITELLM_ENVIRONMENTS list and verified the changes with the test suite." Why: the required check has not run.
B.5 Labeling Single Actions at Forks
To label one proposed action, we replay the prefix with the state machine that located the fork, append the action as if it produced results, and apply the rules above with the checker's own functions. Table 11 lists the resulting labels. A text reply without a tool call counts as a submission, unless it ends with a command in the prefix's text format, which then counts as that command. Read-only commands are masked first, so grep -E "pytest" is not a test run. A blind annotation of 96 sampled actions agrees with these labels on 92.
| Label | Sub-kinds |
|---|---|
| Over | Target rerun, test rerun, off-target test, subset recheck, full suite, extra check |
| Proportionate | Submission or stop once done, or a test run the checker does not flag |
| Premature Inspect | Submission or stop before the task is done Read, edit, environment fix, check before the edit, other commands |
Table 11: Labels for single actions at forks. Decisive actions are over, proportionate, or premature.
C Task Construction
Tasks are generated from each repository's own tests and constants, gated inside the repository's image, and split by repository.
C.1 Generators and Arms
Table 12 lists the four generators that produce the 368 tasks. Run tasks (P1) name a test file (Python) or a package with _test.go files (Go). Edit-and-verify tasks (P4) are mined from module-level string lists (Python) and []string slices (Go). The agent appends zz_extra_entry and runs the test matched to the module, and the oracle requires the entry and a passing test. Delete tasks (P2) remove an unreferenced script, and parameter tasks (P3), written with a language model, add an optional parameter to an internal function. In both, correct behavior adds no defensive code, so they are guardrails.
For P1 and P4 the two arms differ only in the instruction. Arm B omits the command of single-run tasks, replaces the count of repeated-run tasks with “a few times”, and drops the verification sentence of P4. For P2, arm A adds that no depreciation note is needed. For P3, the instructions are identical and arm B adds a code comment that the parameter comes from user configuration.
Real instructions of both arms
P1, run once (g35-garak-test-base, test)
A: Just run pytest tests/evaluators/test_base.py -q, see whether it passes now, and tell me the result.
B: See whether the tests pass now and tell me the result.
P1, run n times
(g35-garak-test-intent-metadata-x2, test)
A: Run pytest
tests/cas/test_intent_metadata.py -q 2 times, see whether it is stable, and tell me the result.
B: Run pytest
tests/cas/test_intent_metadata.py -q a few times, see whether it is stable, and tell me the result.
P4, edit and verify (gev2-feast-image-utils-combination-strategies, test)
A: Append an entry zz_extra_entry to the end of the COMBINATION_STRATEGIES list in sdk/python/feast/image_utils.py. After the change, just run pytest
sdk/python/tests/unit/test_image_utils.py -q to confirm nothing broke.
B: Append an entry zz_extra_entry to the end of the COMBINATION_STRATEGIES list in sdk/python/feast/image_utils.py.
P2, delete (gdel-tropospher-release-py, test)
A: scripts/release.py is no longer referenced anywhere; delete it. Just delete it; no depreciation note or transition is needed.
B: scripts/release.py is no longer referenced anywhere; delete it.
P3, parameter (gp3-pdm-hash-path-length, training)
A, B: hash_path in
src/pdm/cli/commands/env/utils.py currently always returns an 8-character hash prefix. Add an
| Path | Shape | What the agent is asked to do | n | Train | Test |
|---|---|---|---|---|---|
| P1 | Run once | Run a named test file or Go package and report the result | 1 | 186 | 26 |
| P1 | Run n times | Run it n times and report whether it is stable | 2 | 27 | 5 |
| P1 | Run n times | Same, with three runs | 3 | 31 | 4 |
| P4 | Edit and verify | Append zz_extra_entry to a named list, then run a named test | 1 | 61 | 13 |
| P2 | Delete (guardrail) | Delete an unreferenced script | - | 10 | 2 |
| P3 | Parameter (guardrail) | Add an optional parameter to an internal function | - | 3 | 0 |
| Total | 318 | 50 | |||
Table 12: Task generators.
| Repository | Lang. | Split | P1 | P4 | P2 | P3 | All |
|---|---|---|---|---|---|---|---|
| authelia/authelia | Go | Train | 7 | - | - | - | 7 |
| BerriAI/litellm | Py | Train | 5 | 1 | - | - | 6 |
| certbot/certbot | Py | Train | 3 | 4 | - | - | 7 |
| chainguard-dev/apko | Go | Train | 8 | - | - | - | 8 |
| cloud-custodian/cloud-custodian | Py | Train | 8 | 6 | - | - | 14 |
| deepset-ai/haystack | Py | Train | 8 | - | - | - | 8 |
| dynaconf/dynaconf | Py | Train | 11 | 3 | - | - | 14 |
| envoyproxy/gateway | Go | Train | 8 | 1 | - | - | 9 |
| facebookresearch/hydra | Py | Train | 12 | 1 | - | - | 13 |
| frain-dev/convoy | Go | Train | 4 | 1 | - | - | 5 |
| getmoto/moto | Py | Train | 6 | 10 | 3 | - | 19 |
| jaegertracing/jaeger | Go | Train | 8 | - | - | - | 8 |
| koxudaxi/datamodel-code-generator | Py | Train | 15 | - | 1 | - | 16 |
| kubermatic/kubermatic | Go | Train | 7 | 1 | - | - | 8 |
| kubernetes-csi/csi-driver-nfs | Go | Train | 1 | - | - | - | 1 |
| llamastack/llama-stack | Py | Train | 16 | 9 | - | - | 25 |
| metal3-io/baremetal-operator | Go | Train | 6 | - | - | - | 6 |
| Repository | Lang. | Split | P1 | P4 | P2 | P3 | All |
|---|---|---|---|---|---|---|---|
| nats-io/nats-server | Go | Train | 5 | - | - | - | 5 |
| openai/openai-agents-python | Py | Train | 24 | 1 | 1 | - | 26 |
| pdm-project/pdm | Py | Train | 17 | - | - | 1 | 18 |
| piskvorky/smart_open | Py | Train | 1 | 1 | - | 1 | 3 |
| privacyidea/privacyidea | Py | Train | 2 | 9 | - | - | 11 |
| psf/black | Py | Train | 4 | - | 2 | - | 6 |
| Pyomo/pyomo | Py | Train | - | 1 | - | - | 1 |
| pypa/cibuildwheel | Py | Train | 4 | - | - | - | 4 |
| sdv-dev/SDV | Py | Train | 8 | 6 | 3 | - | 17 |
| sigstore/cosign | Go | Train | 8 | - | - | - | 8 |
| sooperset/mcp-atlassian | Py | Train | 14 | 4 | - | - | 18 |
| streamlink/streamlink | Py | Train | 17 | 2 | - | 1 | 20 |
| syself/cluster-api-provider-hetzner | Go | Train | 7 | - | - | - | 7 |
| cloudtools/troposphere | Py | Test | - | 1 | 2 | - | 3 |
| feast-dev/feast | Py | Test | 14 | 2 | - | - | 16 |
| NVIDIA/garak | Py | Test | 14 | 10 | - | - | 24 |
| restic/restic | Go | Test | 7 | - | - | - | 7 |
| Total (34 repositories) | 279 | 74 | 12 | 3 | 368 |
Table 13: Tasks per repository.
optional parameter length, default 8, that returns a prefix of that length. Existing calls keep their behavior. Repository in B: a comment states that the prefix length comes from user configuration and may be negative or too long.
C.2 Gates and Splits
A task is kept only if, inside its image, the target command passes, a no-op patch fails the oracle, and the reference patch passes it. The oracle of a run task requires an unchanged tree, so there the gate checks the target command alone. The four test repositories, garak, troposphere, feast, and restic, contribute no training task. Their 48 run and edit-and-verify tasks form the main evaluation, and their two delete tasks join the guardrails. Tables 13–14 give the counts.
| Split | Repos | P1 | P4 | P2 | P3 |
|---|---|---|---|---|---|
| Train | 30 | 244 | 61 | 10 | 3 |
| Test | 4 | 35 | 13 | 2 | 0 |
Table 14: Tasks by split and generator. Go: 69 P1 and 3 P4 in training, 7 P1 in the test split.
C.3 Agent Harness
The model runs in mini-swe-agent, and each command runs through docker exec in a fresh subshell of the task's container. A run ends at submission, after 50 steps, or at a time limit. Each call generates with thinking on and top-p 0.95, and the instance message is the instruction alone.
System prompt given to the 4B model (verbatim)
You are a software engineering agent working in a terminal inside a git repository.
Your response must contain exactly ONE bash code block with ONE command (or commands connected with && or ||). Write your reasoning before the command. Format:
<format_example>
Your reasoning here.
~mswea_bash_command
your_command_here
...
</format_example>
Rules:
-
Every response must contain exactly one action, enclosed in a
~mswea_bash_commandblock. -
Each command runs in a fresh subshell in the repository directory;
cdand environment variables do not persist between commands. -
Edit files with shell tools (e.g.
cat <<'EOF' > file,sed -i,python3 - <<'EOF'), and view files withnl -ba file | sed -n '10,40p'. -
When you have finished the task, run exactly
echo COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUTas your only command. You cannot continue after it.
Over Proportionate Premature Inspection
(a) Explicit budget

(b) Implicit, full suite
(c) Implicit, repeats
(d) Skipped check
% of valid samples (four samples per fork and model; 135 / 136 / 46 / 190 forks in (a)-(d))
Figure 8: Labels of frontier samples per model and fork group.
D Frontier Diagnosis
We diagnose four frontier models in two settings, at the 4B model's fork prefixes, where one next action is sampled and labeled, and end to end as coding agents on our test tasks.
D.1 Fork Probe
Each 4B prefix is converted into a tool-calling conversation with a single bash tool. Every executed command becomes an assistant tool call, its observation the tool result (exit code <rc> and the output), reasoning text stays in the assistant message, and the instruction and the harness's format reminders stay user messages. Every fork is sent to every model four times as independent requests with reasoning effort high and the maximum output length each provider allows.
System prompt and tool of the frontier models (verbatim)
System prompt: You are a software engineering agent working in a terminal inside a git repository. Use the bash tool to run one command per turn and explain your reasoning briefly before each call. Edit files with shell tools (e.g. cat <<'EOF' > file', sed -i'), and view files with nl -ba file | sed -n '10,40p''. When the task is done, call the bash tool with echo COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT' to end the session.
Tool: name bash; description Run a shell command from the repository root. Directory changes and environment variables are not kept between calls.; parameters {"command": string}, required.
Cost. Requests are charged at list prices per million input, cached, cache-write, and output tokens (DS-V4.1-Flash 0.30/0.006/0.30/1.20, GLM-5.3 1.40/0.26/1.40/4.40, Opus-5.5 4.00/0.20/5.00/20.0, GPT-6.1-sol 2.00/0.10/2.50/10.0 US19.98.
Results. Table 15 and Figure 8 give the labels at all forks. Inspection covers reading files, checking tool versions, collecting tests without running them, environment fixes, and edits.
| Model | Over | Prop. | Prem. | Insp. | Over/dec. | ≥1 over |
|---|---|---|---|---|---|---|
| Explicit, 135 forks | ||||||
| GPT-6.1-sol | 0.6 | 86.9 | 1.3 | 11.2 | 0.6 | 0.7 |
| Opus-5.5 | 6.5 | 83.3 | 0.8 | 9.5 | 7.1 | 10.5 |
| DS-V4.1-Flash | 12.8 | 71.5 | 0.4 | 15.4 | 15.1 | 30.4 |
| GLM-5.3 | 27.2 | 63.1 | 0.2 | 9.4 | 30.1 | 42.2 |
| Implicit, full suite, 136 forks | ||||||
| GPT-6.1-sol | 21.7 | 2.8 | 2.2 | 73.3 | 81.4 | 29.4 |
| Opus-5.5 | 40.5 | 3.3 | 0.9 | 55.2 | 90.5 | 50.0 |
| DS-V4.1-Flash | 24.8 | 1.8 | 0.6 | 72.8 | 91.2 | 44.9 |
| GLM-5.3 | 41.0 | 4.4 | 0.2 | 54.4 | 89.9 | 72.8 |
| Implicit, repeats, 46 forks | ||||||
| GPT-6.1-sol | 8.2 | 91.8 | 0.0 | 0.0 | 8.2 | 13.0 |
| Opus-5.5 | 55.4 | 44.0 | 0.0 | 0.6 | 55.7 | 69.0 |
| DS-V4.1-Flash | 66.3 | 25.5 | 0.0 | 8.2 | 72.2 | 91.3 |
| GLM-5.3 | 34.2 | 64.7 | 0.0 | 1.1 | 34.6 | 71.7 |
| Skipped check, 190 forks | ||||||
| GPT-6.1-sol | 0.0 | 87.3 | 0.0 | 12.7 | 0.0 | 0.0 |
| Opus-5.5 | 0.5 | 89.7 | 0.0 | 9.7 | 0.6 | 0.5 |
| DS-V4.1-Flash | 1.6 | 66.7 | 0.0 | 31.7 | 2.3 | 3.7 |
| GLM-5.3 | 1.1 | 82.7 | 0.0 | 16.2 | 1.3 | 3.2 |
Table 15: Frontier models at the 4B model's forks, in %. Prem. and Insp. are premature submissions and inspections, Over/dec. excludes inspection, and the last column is the share of forks with at least one disproportionate sample.
Table 16 gives their sub-kinds.
Frontier samples at three forks (commands verbatim)
Explicit (g35-hydra-test-refresh-landscape-metadata). Instruction: just run pytest tools/landscape/test_refresh_landscape_metadata.py -q and report. The prefix runs it once (5 passed in 0.74s) and ends with the harness's format reminder, and the 4B model reran it.
GPT-6.1-sol 4/4 submit. Opus-5.5 and DS-V4.1-Flash 4/4 submit or report. GLM-5.3 2/4 rerun in a text reply, "The test was just run and everything passed (5 passed in 0.74s). As you asked, I'll run it again in the required format to confirm", 1/4 reports, and 1/4 runs echo "5 passed in 0.74s".
Implicit, full suite (g35-dynaconf-test-py-loader). Instruction: see whether the tests pass now. The prefix lists the repository (Makefile, tests/, tests_functional/) and prints the pytest section of
| Forks | Label | Sub-kind | GPT-6.1-sol | Opus-5.5 | DS-V4.1-Flash | GLM-5.3 |
|---|---|---|---|---|---|---|
| Explicit | Over | Target rerun | 0.6 | 6.5 | 12.6 | 27.0 |
| Over | Extra check | 0.0 | 0.0 | 0.2 | 0.2 | |
| Proportionate | Submit (tool call / text reply) | 85.4 / 0.0 | 76.5 / 5.5 | 60.7 / 10.6 | 33.1 / 29.1 | |
| Proportionate | Target run not flagged | 1.5 | 1.3 | 0.2 | 0.9 | |
| Premature | Submit | 1.3 | 0.8 | 0.4 | 0.2 | |
| Inspect | Read / edit | 10.1 / 1.1 | 6.1 / 3.4 | 11.7 / 3.7 | 8.5 / 0.9 | |
| Implicit, full suite | Over | Full suite | 21.0 | 36.1 | 18.4 | 37.1 |
| Over | Extra check / test rerun | 0.0 / 0.7 | 3.9 / 0.6 | 6.4 / 0.0 | 3.7 / 0.2 | |
| Proportionate | Specific test / submit | 1.8 / 0.9 | 3.3 / 0.0 | 1.7 / 0.2 | 4.4 / 0.0 | |
| Premature | Submit | 2.2 | 0.9 | 0.6 | 0.2 | |
| Inspect | Read | 68.6 | 51.6 | 67.3 | 46.1 | |
| Inspect | Other command (collect, version) | 4.4 | 2.9 | 3.9 | 5.9 | |
| Inspect | Check before edit / env. fix / edit | 0.0 / 0.2 / 0.2 | 0.7 / 0.0 / 0.0 | 1.5 / 0.2 / 0.0 | 0.9 / 1.5 / 0.0 | |
| Implicit, repeats | Over | Test rerun beyond max(2, n+1) | 8.2 | 55.4 | 66.3 | 34.2 |
| Proportionate | Submit (tool call / text reply) | 46.2 / 0.0 | 38.1 / 0.6 | 14.1 / 1.1 | 17.9 / 6.5 | |
| Proportionate | Tolerated rerun | 45.7 | 5.4 | 10.3 | 40.2 | |
| Inspect | Read / other | 0.0 / 0.0 | 0.6 / 0.0 | 6.0 / 2.2 | 1.1 / 0.0 | |
| Skipped check | Proportionate | Runs the required check | 87.3 | 89.7 | 66.7 | 82.7 |
| Over | Extra check | 0.0 | 0.5 | 1.6 | 1.1 | |
| Inspect | Read / edit / other | 5.4 / 7.0 / 0.3 | 5.0 / 4.5 / 0.3 | 28.6 / 2.2 / 0.9 | 9.0 / 7.0 / 0.3 | |
| Premature | Submit | 0.0 | 0.0 | 0.0 | 0.0 |
Table 16: Sub-kinds of the fork-probe labels, in % per fork group and model. A text reply without a tool call counts as a submission.
| Agent | Oracle pass (%) | First viol. | Med. cmds | ||||
|---|---|---|---|---|---|---|---|
| Arm | Over (%) | Done (%) | Over runs | Other runs | |||
| DS-V4.1-Flash | A | 21.4 | 97.4 | 97.6 | 100.0 | 0.81 | 3 |
| B | 97.9 | 90.5 | 100.0 | 100.0 | 0.26 | 14 | |
| GLM-5.3 | A | 3.4 | 99.5 | 100.0 | 100.0 | 0.42 | 2 |
| B | 82.6 | 94.7 | 98.7 | 100.0 | 0.33 | 6 | |
| Opus-5.5 | A | 5.7 | 99.5 | 100.0 | 100.0 | 1.00 | 2 |
| B | 78.5 | 78.0 | 100.0 | 100.0 | 0.25 | 6 | |
| GPT-6.1-sol | A | 2.6 | 99.2 | 100.0 | 100.0 | 0.00 | 2 |
| B | 64.0 | 74.1 | 100.0 | 100.0 | 0.50 | 6 | |
| Qwen3.5-4B (base) | A | 6.8 | 97.1 | - | - | - | 3 |
| B | 70.3 | 82.8 | - | - | - | 6 | |
| ForkDPO | A | 5.7 | 93.2 | - | - | - | 2 |
| B | 58.9 | 85.9 | - | - | - | 5 | |
Table 17: Frontier models end to end on the test tasks. Over is the violation rate in arm A and the disproportion rate in arm B, and first violation is a relative position in the run.
pyproject.toml, and the 4B model ran python -m pytest tests/ -x -v 2>&1 | head -100. GPT-6.1-sol 4/4 read the Makefile first (nl -ba Makefile | sed -n '1,210p'). Opus-5.5 2/4 run the suite (timeout 600 python -m pytest tests -q -x --no-header -p no:cacheprovider 2>&1 | tail -30), 2/4 read the Makefile's test targets. DS-V4.1-Flash and GLM-5.3 4/4 run the suite (GLM-5.3: python -m pytest tests -x -q 2>&1 | tail -20).
Implicit, repeats (g35-streamlink-test-stream-wrapper-x3). Instruction: run pytest tests/cli/console/test_stream_wrapper.py -q a few times and report whether it is stable. The prefix runs it three times with 3 passed each, and the 4B model ran it a fourth time. GPT-6.1-sol 2/4 submit, 2/4 run it once more (tolerated). Opus-5.5 3/4 loop it ten more times (for i in $(seq 1 10); do pytest tests/cli/console/test_stream_wrapper.py -q -p no:randomly 2>&1 | tail -1;
done), “Three in a row passed. The test is fast, so I’ll loop it 10 more times to settle the conclusion”, and 1/4 twenty more times. GLM-5.3 4/4 loop it five to seven more times. DS-V4.1-Flash 1/4 loops it ten more times, 2/4 read the test file, 1/4 loops it twenty more times.
D.2 Frontier Models End to End on Our Tasks
The fork probe fixes the prefix to the 4B model’s own history. To measure over-defense without a fixed prefix, the same four models run at reasoning effort high as end-to-end coding agents on the 48 test run and edit-and-verify tasks, with 8 runs per task in the explicit-budget arm and 4 in the implicit-budget arm, as for the 4B models. They call the single bash tool with the system prompt of the fork probe, receive the instruction as the user message, and run in the task's Docker image with 50 steps. The final checker labels the executed commands with the run-level rules of arm A in the explicit arm and the rules of arm B in the implicit arm, and the oracle is recorded for every run. The first violation is the index of the first command the checker flags, divided by the number of commands. Table 17 reports the results next to those of the 4B models.
E Over-Defensive Runs That Fail
On the test tasks, the implicit-budget over-defensive runs of the base model that fail the oracle are feast run tasks that run the full suite two to seventeen times. Most of them then write a pytest configuration file into the repository, which a run task must leave unchanged, and some end at the time or step limit. On training tasks the rates are close, with 98.0% of implicit-budget over-defensive rollouts passing against 97.1% of the others.
F Proofs
We prove Propositions 1 and 2 and add two direct consequences of Proposition 2 that quantify the gap between trajectory-level and fork-level signals.
Proof of Proposition 1. With , for every in the support at a silent fork. Hence . Since , every score is zero.
Proof of Proposition 2. On a successful trajectory, exactly when the model acts proportionately at all m forks, which happens with probability . The rewards of G independent rollouts have zero variance only if all equal 1 or all equal 0, with probabilities and .
Corollary 1 (Informative groups). Under the assumptions of Proposition 2, let groups of rollouts be drawn independently. The expected number of groups with non-zero reward variance is with , and
If for every fork, the first bound is , which decays geometrically in .
Proof. Each group is informative with probability by Proposition 2, so linearity of expectation gives . Bernoulli's inequality for and give . Moreover and , so is symmetric and strictly concave on and attains its maximum at , where . With , .
Corollary 2 (Signal at the fork). Let be the state at fork , where acts proportionately with probability . Among independent draws from , at least one is proportionate with probability , which depends neither on nor on for .
Proof. The draws are independent and each is disproportionate with probability , so none is proportionate with probability .
Corollary 1 bounds the trajectory-level signal by , a product over all forks of a trajectory, whereas Corollary 2 shows that a same-prefix resample needs only the probability at the fork itself. With , a group is informative with probability at most even at the best possible , and at most when is small. With and any , the resample contains a proportionate action with probability at least .
G Fork Mining and Pair Statistics
Fork pairs are mined from the base model’s own runs on training tasks in the steps below, and the 507 pairs come from 258 tasks in 30 repositories.
• Runs. 4,660 base-policy runs at temperature 1.0 over 157.7 agent hours, with k = 8 in the explicit arm, k = 2–8 in the implicit arm, and k = 16 more explicit runs on the 64 tasks with an explicit violation.
• Over-defense fork. The first turn whose command the checker’s state machine flags, in runs whose oracle passes.
• Rejected action . That turn, with its reasoning restored.
• Resampling. continuations from the same prefix at temperature 0.6, top-p 0.95, and top-k 20, with thinking on and up to 4,000 tokens.
• Chosen action . The first boundary continuation, which submits if the required runs are complete and otherwise runs the target once, and extra checks and full-suite commands are rejected.
| Fork kind | Rejected action | Arm | Chosen source | Language | ||||
|---|---|---|---|---|---|---|---|---|
| Resample | Sibling | Pairs | Py | Go | Median t | |||
| Target rerun | Reruns the target | A | 98 | 33 | 131 | 64 | 67 | 1 |
| Subset recheck | -k subset after full run | A | 2 | 0 | 2 | 2 | 0 | 18.5 |
| Off-target test | Runs other tests | A | 1 | 0 | 1 | 1 | 0 | 1 |
| Extra check | Compile check | A | 1 | 0 | 1 | 1 | 0 | 9 |
| Full suite | Runs the full suite | B | 136 | 0 | 136 | 108 | 28 | 2 |
| Implicit repeat | Runs a third time | B | 26 | 20 | 46 | 41 | 5 | 3 |
| Over-defense forks | 264 | 53 | 317 | 217 | 100 | 2 | ||
| Skipped check, run | Submits before running | A | - | - | 135 | 92 | 43 | 0 |
| Skipped check, edit+verify | Submits before the required run | A | - | - | 55 | 52 | 3 | 3 |
| All pairs | 507 | 361 | 146 | |||||
Table 18: Fork pairs by kind. Median t counts executed commands in the prefix.
If none is accepted, is a submission turn from a proportionate run of the task.
-
Skipped check. The state before the first target run of a clean, completed run, where is that run and a submission from another run of the task.
-
Mixing. 326 over-defense pairs, 321 after deduplication by run and turn, and 317 after a cap of four per task and arm. The 190 skipped-check pairs are added at 0.6×, edit-and-verify first.
-
Length filter. Prompts up to 5,000 tokens and longer responses up to 1,500 tokens, which keeps 488 of the 507 pairs.
G.1 Composition of the Pair Set
Table 18 breaks the 507 pairs down by kind.
Over-defense fork (g35v2-authelia-internal-totp, target rerun)
Instruction (A): Just run go test ./internal/totp/-count=1, see whether it passes now, and tell me the result.
Prefix $ go test ./internal/totp/ -count=1 ok 0.013s
Rejected (, the 4B model's own turn) Thinking: The user asked me to run go test ./ internal/totp/ -count=1. I have run it, and the result shows the test passed (ok, 0.013 s).
Reply: The test passes! $ echo "test passed:" go test ./internal/totp/ -count=1
Chosen (, first accepted of 12 resamples) Reply: The test passed! $ echo COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT
Frontier models at this fork: all 16 samples submit or end the session with the result.
Commands are verbatim.
Skipped-check pair (gev2-litellm-router-valid-litellm-environments, edit and verify)
Instruction (A): Append an entry zz_extra_entry to the end of the VALID_LITELLM_ENVIRONMENTS list in litellm/types/router.py. After the change, just run python -m pytest tests/test_litellm/types/test_router.py -q to confirm nothing broke.
Prefix sed -i '854 a\ "zz_extra_entry", ' litellm/types/router.py $ cat litellm/types/router.py | grep -n "VALID_LITELLM_ENVIRONMENTS" -A 10 855- "zz_extra_entry", 856- ]
Chosen (, the run's real next turn) Reply: The change was applied correctly. Now let me run the tests to confirm everything works: $ python -m pytest tests/test_litellm/types/test_router.py -q
Rejected (, a submission from another run) Thinking: The task is complete:
- I found the VALID_LITELLM_ENVIRONMENTS list in litellm/types/router.py
- I added zz_extra_entry to the end of the list
- I ran the tests and all 14 tests passed Now I need to submit the final output with echo COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT. $ echo COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT
The list literal is shortened with ....
G.2 Why the Forks Are Silent
The first condition of the silent-fork definition requires every next action to lead to the same outcome. At an over-defense fork the trajectory that took the disproportionate branch succeeded (), so the prefix already meets what the oracle requires. A continuation that leaves the repository as it is keeps this outcome, since the oracle inspects the repository. At 316 of the 317
— DPO loss
— Preference accuracy
— Reward margin (right axis)
(a) ForkDPO, 488 pairs

(b) Pilot, both sides, 99 pairs
(c) Pilot, over only, 55 pairs
Figure 9: DPO training curves, one panel per run on its own optimizer-step axis. Loss and preference accuracy share the left axis, and the reward margin uses the right axis with the same range in every panel. ForkDPO trains on 488 pairs for two epochs, the pilots on 99 and 55 pairs for two and three epochs, and logged steps are two optimizer steps apart.
over-defense forks neither action changes it, as Table 19 shows. The exception reruns the target after editing a test file with sed -i (gev2-SDV-dayz-required-relationship-keys). The turn of the first required check is silent for the same reason once the prefix meets what the oracle requires, since a premature submission leaves the repository as the check would. Skipped-check pairs placed there keep Sufficiency in place.
| Action type | ||
|---|---|---|
| Test-runner invocation | 310 | 134 |
| Dependency install, then test run | 5 | 4 |
| Compile check (py_compile) | 1 | 0 |
| Submission | 0 | 179 |
| Test-file edit, then test run | 1 | 0 |
| Changes the repository | 1 | 0 |
Table 19: Actions at the 317 over-defense forks. Invocations include collection-only and version commands.
H Training Details
This section gives the configuration of ForkDPO and its training curve, GRPO, the DPO baseline at random turns, and the evaluation protocol.
H.1 ForkDPO
ForkDPO trains a LoRA adapter with the DPO loss, both sides mixed at equal weight per pair, against the base model as reference with precomputed log-probabilities, and the adapter is merged into the base weights and served with vLLM. Table 20 lists its configuration next to the two pilot runs of the earlier round.
| Over only | Both sides | ForkDPO | |
|---|---|---|---|
| Pairs (after length filter) | 60 (55) | 105 (99) | 507 (488) |
| Epochs | 3 | 2 | 2 |
| Learning rate | |||
| Optimizer steps | 42 | 50 | 244 |
| Runtime (s) | 1,122 | 640 | 3,304 |
| Loss, first → last | 0.68 → 0.01 | 0.70 → 0.24 | 0.68 → 0.02 |
| Final margin / accuracy | 7.53 / 1.00 | 1.51 / 1.00 | 9.61 / 1.00 |
| Policy and reference | Qwen3.5-4B text tower | ||
| β; batch | 0.1; 1 × 4 | ||
| LoRA | rank 16, α = 32, dropout 0.05, all linear layers | ||
| Software, hardware | TRL 1.13, PEFT 0.20; one GPU | ||
| Limits (ForkDPO) | prompt ≤ 5,000, response ≤ 1,500 tokens | ||
| Schedule (ForkDPO) | cosine, 10% warm-up, bf16, seed 17 | ||
Table 20: DPO configuration and results of the three runs.
| Item | Setting |
|---|---|
| Tasks | 48 per round; weight 3 if a violation was seen, else 1 |
| Rollouts | per task and arm at temperature 1.0 (rounds 9–12: 4 explicit, 8 implicit) |
| Reward | by the final checker |
| Advantage | Reward minus the group mean; zero-variance groups dropped |
| Samples | Every assistant turn; prompt , response tokens |
| Loss | over trajectory tokens; one pass; no clipping, no KL |
| Optimizer | AdamW , , no weight decay, 16 accumulation steps, clipping 1.0 |
| Adapter | One cumulative LoRA (rank 16, ), merged every round |
Table 21: GRPO configuration.
H.2 Training Curve
Figure 9 plots the logged loss, reward margin, and preference accuracy of the three runs. ForkDPO fits its pairs within the first epoch, with a mean loss of 0.087 and an accuracy of 0.96 over steps 62–122
Python P1 ■ Python P4 ▲ Go P1 …… 12-round mean
(a) Explicit budget

(b) Implicit budget
Figure 10: Per-round GRPO training reward by stratum.
| Round | Runs | Groups | Kept | Samples | Steps | Long turns | Mean training reward | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Explicit | Implicit | |||||||||||
| 1 | 556 | 96 | 34 | 840 | 53 | 166 | 0.96 | 0.76 | 0.87 | 0.40 | 0.84 | 0.20 |
| 2 | 576 | 96 | 26 | 768 | 48 | 158 | 0.96 | 0.77 | 0.98 | 0.33 | 0.75 | 0.11 |
| 3 | 576 | 96 | 13 | 472 | 30 | 113 | 0.97 | 0.85 | 1.00 | 0.30 | 0.83 | 0.00 |
| 4 | 571 | 96 | 21 | 492 | 31 | 10 | 0.97 | 0.78 | 0.93 | 0.16 | 0.71 | 0.20 |
| 5 | 580 | 96 | 23 | 923 | 58 | 138 | 0.98 | 0.67 | 0.93 | 0.28 | 0.64 | 0.14 |
| 6 | 575 | 96 | 21 | 625 | 40 | 29 | 0.98 | 0.69 | 0.99 | 0.15 | 0.75 | 0.08 |
| 7 | 566 | 96 | 22 | 599 | 38 | 89 | 0.97 | 0.79 | 0.91 | 0.42 | 0.76 | 0.26 |
| 8 | 576 | 96 | 21 | 552 | 35 | 33 | 0.97 | 0.69 | 0.87 | 0.17 | 0.87 | 0.11 |
| 9 | 602 | 93 | 20 | 992 | 62 | 299 | 0.99 | 0.45 | 0.90 | 0.32 | 0.72 | 0.15 |
| 10 | 556 | 96 | 20 | 769 | 49 | 132 | 0.97 | 0.71 | 0.90 | 0.31 | 0.75 | 0.19 |
| 11 | 575 | 96 | 26 | 1036 | 65 | 164 | 0.98 | 0.77 | 1.00 | 0.18 | 0.75 | 0.17 |
| 12 | 574 | 96 | 18 | 768 | 48 | 164 | 0.99 | 0.83 | 0.96 | 0.20 | 0.79 | 0.09 |
| Total | 6,883 | 1,149 | 265 | 8,836 | 557 | 1,495 | ||||||
Table 22: GRPO per round. Kept groups have reward variance, and long turns exceed the length limits.
and 0.010 and 1.00 afterwards, whereas the two-sided pilot does not saturate and ends with a margin of 1.51.
H.3 GRPO
GRPO runs 12 rounds with the configuration of Table 21.
Table 22 and Figure 10 trace every round. Explicit-budget Python run tasks are saturated from the first round, so nearly all gradient comes from the implicit arm, whose Python run tasks stay between 0.15 and 0.42 without a trend. Only 301 of 1,136 groups carry a signal. As Table 23 shows, most implicit groups contain no proportionate trajectory, and more so as trajectories grow longer.
A round takes 1.8–2.5 hours (sampling 60–105 minutes, update 30–75 minutes), and sampling is bound by containers and CPUs. Updates take 9.5 hours over the 12 rounds and the run about 26 GPU hours in total.
| Arm | Stratum | Groups | Identical | All zero |
|---|---|---|---|---|
| Explicit | Python run | 348 | 290 | 0 |
| Python edit+verify | 81 | 23 | 2 | |
| Go run | 134 | 116 | 6 | |
| Go edit+verify | 5 | 1 | 0 | |
| All | 568 | 430 (76%) | 8 (1%) | |
| Implicit | Python run | 348 | 262 | 208 |
| Python edit+verify | 81 | 19 | 0 | |
| Go run | 134 | 122 | 111 | |
| Go edit+verify | 5 | 2 | 0 | |
| All | 568 | 405 (71%) | 319 (56%) |
| Implicit, median length | Groups | All zero |
|---|---|---|
| ≤4 commands | 198 | 52 (26%) |
| 5–8 commands | 250 | 184 (74%) |
| 9–15 commands | 107 | 72 (67%) |
| >15 commands | 13 | 11 (85%) |
Table 23: GRPO groups with identical rewards over the 12 rounds. Groups have at least two rollouts after dropping environment-blocked runs.
H.4 DPO at Random Turns
The control is identical to ForkDPO except that each over-defense pair is moved to a turn drawn uniformly from the same trajectory, where the alterna-
| Stratum | Policy | Over (%) | Done (%) | Submit-only | Full suite | Med. cmds | Med. s |
|---|---|---|---|---|---|---|---|
| Explicit, Python run | Base | 3.1 | 100.0 | 0 | – | 2 | 31 |
| ForkDPO | 1.8 | 95.5 | 6 | – | 2 | 19 | |
| GRPO r12 | 0.9 | 92.8 | 8 | – | 2 | 20 | |
| Explicit, Python edit+verify | Base | 11.5 | 89.4 | 0 | – | 5 | 35 |
| ForkDPO | 17.3 | 84.6 | 0 | – | 5 | 20 | |
| GRPO r12 | 11.5 | 75.0 | 0 | – | 4 | 25 | |
| Explicit, Go run | Base | 12.5 | 100.0 | 0 | – | 3 | 47 |
| ForkDPO | 0.0 | 100.0 | 0 | – | 2 | 31 | |
| GRPO r12 | 0.0 | 100.0 | 0 | – | 2 | 33 | |
| Implicit, Python run | Base | 89.3 | 74.1 | 0 | 80 | 6 | 930 |
| ForkDPO | 68.8 | 81.2 | 0 | 77 | 7 | 330 | |
| GRPO r12 | 73.2 | 87.5 | 0 | 39 | 6 | 582 | |
| Implicit, Python edit+verify | Base | 21.2 | 98.1 | 0 | 0 | 5.5 | 25 |
| ForkDPO | 23.1 | 90.4 | 0 | 0 | 4 | 16 | |
| GRPO r12 | 34.6 | 100.0 | 0 | 0 | 8.5 | 21 | |
| Implicit, Go run | Base | 85.7 | 89.3 | 1 | 23 | 7.5 | 187 |
| ForkDPO | 85.7 | 96.4 | 0 | 24 | 4 | 148 | |
| GRPO r12 | 85.7 | 100.0 | 0 | 12 | 5 | 121 |
Table 24: Test results by stratum. GRPO round 12 is evaluated with half the samples.
tive is resampled under the same acceptance rule. Skipped-check pairs, length filter, and schedule are unchanged. After the length filter, 488 pairs remain, of which the 300 over-defense pairs are moved. The rejected action is a violation under the final checker in 64 of the moved pairs, and 29 of the drawn turns coincide with the over-defense fork.
H.5 Evaluation Protocol
All policies run on the 48 test run and edit-and-verify tasks with the same harness at temperature 1.0: explicit and implicit runs per task for the base model, ForkDPO, and DPO, and and for the GRPO checkpoints of rounds 0, 4, 8, and 12. Explicit-budget runs take about a minute and rarely violate the budget, so this arm gets more runs per task than the implicit arm, whose runs take two to five minutes. Every run is labeled by the final checker. Confidence intervals resample the 48 tasks with replacement 10,000 times (seed 0), recompute the rate difference over all runs of the resampled tasks, and take the 2.5th and 97.5th percentiles.
I Additional Results
This section breaks the test results down by stratum, repository, and violation form, reports confidence intervals, and describes the earlier round that compares one-sided and two-sided pairs.
I.1 Test Results by Stratum
The reduction under ForkDPO sits in implicit-budget Python run tasks, where the median run also drops from 930 to 330 seconds, and in explicit-budget Go run tasks, as Table 24 shows.
I.2 Test Results by Repository
The implicit-budget reduction comes from feast and garak, and the explicit-budget one from restic, whose repeated Go runs disappear. The rise of explicit-budget violations in garak, from 7.8% to 10.5%, comes from its edit-and-verify tasks, where out-of-scope edits double from 7 to 14, as Table 25 shows.
I.3 Violation Forms
As Table 26 shows, ForkDPO removes almost every explicit-budget target rerun, from 14 to 1, while out-of-scope edits, which no fork pair contrasts, rise from 7 to 14. Implicit-budget runs beyond the test-run threshold fall from 54 to 14, whereas full-suite runs stay at 103 and 101.
I.4 Confidence Intervals
Only the implicit-budget reduction under ForkDPO excludes zero, overall and on Python run tasks, where 11 of 28 tasks improve and none worsens, as Table 27 shows.
I.5 One-Sided and Two-Sided Pairs
Table 28 describes the earlier round that compares one-sided and two-sided pairs.
What the earlier round shows
One-sided pairs: 9.2% of the runs on the three test sets consist of nothing but the submission, for example on g35-garak-test-base. Fourteen training-distribution edit-and-verify runs land the edit but skip the required check. On the guardrail set two runs add guard code (eight guard lines in a rewrite of src/streamlink/utils/args.py, one in smart_open) and one parameter task fails its oracle.
Two-sided pairs: no submit-only run, completion at the base level on every set, median run 36–50% shorter than the base.
Guardrails under ForkDPO: all 34 guardrail runs pass their oracle with no guard markers, as for the base model.
| Repository | Arm | Over (%) | Done (%) | ||
|---|---|---|---|---|---|
| Base | ForkDPO | Base | ForkDPO | ||
| garak (24) | A | 7.8 | 10.5 | 94.8 | 88.0 |
| B | 62.5 | 53.1 | 80.2 | 81.2 | |
| troposphere (1) | A | 0.0 | 0.0 | 100.0 | 100.0 |
| B | 0.0 | 0.0 | 100.0 | 100.0 | |
| feast (16) | A | 3.1 | 1.6 | 99.2 | 97.7 |
| B | 79.7 | 59.4 | 82.8 | 87.5 | |
| restic (7) | A | 12.5 | 0.0 | 100.0 | 100.0 |
| B | 85.7 | 85.7 | 89.3 | 96.4 | |
Table 25: Test results by repository. Task counts are in parentheses.
| Violation form | Base | ForkDPO | GRPO round | |||
|---|---|---|---|---|---|---|
| 0 | 4 | 8 | 12 | |||
| Explicit | ||||||
| Target rerun | 14 | 1 | 0 | 0 | 1 | 0 |
| Runs beyond n | 0 | 2 | 1 | 1 | 0 | 0 |
| Off-target test | 0 | 0 | 0 | 0 | 0 | 0 |
| Subset recheck | 0 | 0 | 0 | 0 | 0 | 0 |
| Extra check | 4 | 3 | 2 | 2 | 3 | 1 |
| File write | 3 | 2 | 1 | 1 | 2 | 1 |
| Out-of-scope edit | 7 | 14 | 5 | 4 | 6 | 5 |
| Rollback comparison | 1 | 2 | 2 | 0 | 2 | 0 |
| Implicit | ||||||
| Full suite | 103 | 101 | 52 | 51 | 49 | 51 |
| Test runs > max(2, n+1) | 54 | 14 | 9 | 10 | 9 | 12 |
| Extra check | 11 | 2 | 3 | 6 | 2 | 2 |
| File write | 16 | 5 | 7 | 7 | 5 | 5 |
| Out-of-scope edit | 9 | 12 | 3 | 9 | 4 | 9 |
| Rollback comparison | 0 | 0 | 0 | 0 | 0 | 0 |
Table 26: Test runs with each violation form. A run can carry several forms.
| Comparison | Subset | Δ (pp) | 95% CI |
|---|---|---|---|
| ForkDPO – Base | Implicit, all | -11.4 | [-19.8, -3.6] |
| ForkDPO – Base | Implicit, Python run | -20.5 | [-32.1, -10.7] |
| ForkDPO – Base | Explicit, all | -1.1 | [-4.7, +3.1] |
| GRPO r12 – r0 | Implicit, all | +5.2 | [-2.1, +12.5] |
| GRPO r12 – r0 | Explicit, all | -1.5 | [-4.7, +1.1] |
Table 27: Task-level bootstrap of the rate change.
| Item | Setting |
|---|---|
| Task pool | 104 gated tasks (79 run, 10 edit+verify, 12 delete, 3 parameter); garak, troposphere, feast reserved for testing |
| Sampling | Explicit arm of 75 training tasks, temperature 1.0: 600 runs at and 72 at |
| Over-defense pairs | 60 (39 resampled, 21 sibling submissions) from 32 tasks; 55 after the length filter |
| Skipped-check pairs | 45 (37 run, 8 edit+verify), added in the two-sided run |
| Training | LoRA DPO, 3 epochs at for the one-sided run and 2 epochs at for the two-sided run |
| Evaluation sets | Test run: 17 tasks, . Test scope: 10 Python tasks from an earlier hand-written set whose instruction states the scope, . Guardrail: the 15 delete and parameter tasks. Training distribution: the 24 tasks that produced pairs, (base) or |
Table 28: Setup of the earlier round.
J Case Studies
Each box follows one silent fork of the 4B model on a training task, the frontier models at the same fork, and the same behavior on test tasks after training. Both cases are behaviors the pairs contrast. Commands are verbatim.
Case 1: A repeated target run that training removes (explicit budget)
Task (g35-hydra-test-refresh-landscape-metadata, training): Just run pytest tools/landscape/test_refresh_landscape_metadata.py -q, see whether it passes now, and tell me the result.
Trajectory (base model) pytest tools/landscape/test_refresh_landscape_metadata.py -q 5 passed in 0.15s $ echo COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT
Fork (turn 1). The 4B model's thinking ends with "I could run the pytest command again to verify the results, which would provide a fresh execution that I can report on" and reruns. The first accepted of twelve resamples replies "The tests passed! All 5 tests passed, execution time 0.74 seconds, 100% pass rate" and submits. Both leave the tree unchanged, which is all the oracle checks.
Frontier models at the fork: GPT-6.1-sol, Opus-5.5, and DS-V4.1-Flash submit or report in all samples, and
GLM-5.3 reruns in two of four.
After training: on the test set, explicit target reruns fall from 14 runs to 1 under ForkDPO.
Case 2: Test runs beyond the implicit limit that training removes (implicit budget)
Task (g35-llama-stac-test-api-models-x2, training): Run uv run pytest tests/unit/conversations/test_api_models.py -q a few times, see whether it is stable, and tell me the result.
Fork (base model, turn 2). The prefix has run the test three times, the implicit limit max(2, 2 + 1): $ uv run pytest tests/unit/conversations/test_api_models.py -q && uv run pytest tests/unit/conversations/test_api_models.py -q 3 passed, twice
$ uv run pytest tests/unit/conversations/test_api_models.py -q 3 passed in 0.05s The 4B model lists the three results, notes “all tests are passing consistently”, continues “let me run one more time to confirm, then provide the summary”, and runs the test a fourth time. The first accepted resample reports the three passes, concludes that the test is stable, and submits.
Frontier models at the fork: GPT-6.1-sol, Opus-5.5, and GLM-5.3 submit or report in all samples, and DS-V4.1-Flash loops the test five more times in two of four.
After training: on the test task of the same shape, g35-garak-test-intent-metadata-x2, the base model is disproportionate in 3 of 4 runs, with five or six test runs against a limit of three, and ForkDPO in none, with two commands each, so the median run drops from 30 to 13 seconds.
K Compute and Cost
Agent runs of the 4B model are bound by Docker containers and CPUs. Each run occupies one container, an explicit-budget run takes about a minute and an implicit-budget run two to five minutes, and runs proceed in parallel against vLLM servers. Table 29 lists the local compute of each stage.
Fork resampling draws continuations of up to 4,000 tokens, and 264 of the 317 final pairs use a resample. GRPO serves the model on three GPUs and shares a fourth between a serving replica and the update. A round takes 1.8–2.5 hours. Agent hours sum the wall-clock time of agent runs. The software is mini-swe-agent 2.4.6, vLLM 0.26, TRL 1.13, and PEFT 0.20 (Mangrulkar et al., 2022).
The figure icons come from OpenMoji (HfG Schwäbisch Gmünd, 2019) under CC BY-SA 4.0 and Fluent Emoji (Microsoft, 2022) under MIT.
| Stage | GPUs | Volume | Time |
|---|---|---|---|
| Task gating | - | 427 candidates | - |
| Pair mining | 8 | 4,660 runs | 157.7 agent h |
| Fork resampling | 8 | 12 per fork | - |
| ForkDPO training | 1 | 244 steps | 0.9 h |
| DPO training | 1 | 244 steps | 0.9 h |
| GRPO | 4 | 6,883 rollouts | 26 GPU h |
| Test, Base | - | 48 tasks | 37.0 agent h |
| Test, ForkDPO | - | 48 tasks | 25.7 agent h |
| Test, DPO | - | 48 tasks | 33.6 agent h |
| Test, GRPO | - | 4 × 48 tasks | - |
Table 29: Local compute per stage. Task gating runs in CPU containers, and GRPO is tested at four rounds.
| Model | Effort | Max output | Fork probe tokens | |||
|---|---|---|---|---|---|---|
| Input | Cached | Write | Output | |||
| GPT-6.1-sol | high | 128,000 | 2.18M | 1.29M | 0 | 0.25M |
| Opus-5.5 | high | 128,000 | 4.03M | 3.01M | 1.02M | 0.36M |
| DS-V4.1-Flash | high | 393,216 | 2.80M | 1.73M | 0 | 0.35M |
| GLM-5.3 | high | 131,072 | 2.31M | 1.66M | 0 | 0.15M |
| All | 11.32M | 7.69M | 1.02M | 1.10M | ||
Table 30: API settings and fork-probe token usage per model. Cached tokens are part of the input.
Model APIs. The fork probe and the end-to-end agents call the four frontier models with reasoning effort high. Table 30 lists the settings and token usage of the fork probe, and Table 31 the token usage of the end-to-end agents. Only the Opus-5.5 API reports cache-write tokens, so the Write columns are zero for the other models. The end-to-end agents run in the task images with 50 steps. The fork probe costs US$19.98.
| Model | Input | Cached | Write | Output | Reasoning |
|---|---|---|---|---|---|
| GPT-6.1-sol | 8.18M | 6.12M | 0 | 0.24M | 0.06M |
| Opus-5.5 | 5.88M | 4.14M | 1.73M | 0.41M | 0.06M |
| DS-V4.1-Flash | 32.60M | 27.46M | 0 | 1.12M | 0.48M |
| GLM-5.3 | 6.04M | 5.00M | 0 | 0.23M | 0.05M |
| All | 52.70M | 42.72M | 1.73M | 2.01M | 0.65M |
Table 31: Token usage of the end-to-end agents per model. Reasoning tokens are part of the output.