- Rating
- 5
- Clarity
- 3
- Confidence
- 4
- Originality
- 3
- Quality
- 3
- Significance
- 3
Read review
Summary
The paper proposes Counterfactual Rollout Replay (CRR), a training-time credit-assignment method for software-engineering agents that leverages the exact forkability of containerized SWE environments. Rather than assigning the same terminal reward to every action in a long trajectory, CRR selects a small number of high-uncertainty, high-impact decision points, restores the sandbox to those states, samples alternative actions, and rolls out counterfactual continuations. The difference between the original trajectory’s terminal return and the counterfactual return is used as a step-level advantage within a PPO/GRPO-style update. This provides an environment-grounded process signal without requiring learned process reward models, human step annotations, or hindsight labels, though it incurs additional replay compute. Empirically, the paper reports that CRR improves pass@1, sample efficiency, and per-step advantage signal-to-noise ratio over outcome-only GRPO on SWE-bench Verified, SWE-bench Live, and SWE-rebench, and that it composes additively with PRM-based supervision and trajectory-search rollouts.
Strengths and weaknesses
Technical novelty and innovation. CRR presents a simple but compelling way to convert the exact, auditable forkability of containerized SWE environments into a training-time credit-assignment signal. Rather than learning or inferring process rewards, the method directly executes counterfactual continuations from selected decision points and uses the difference in terminal returns as a step-level advantage. The idea is conceptually clean, complementary to PRM-based supervision and trajectory search, and theoretically framed with appropriate caution: the estimator is analyzed as a fixed-index action-conditional contrast, while the variance decomposition is presented as a diagnostic rather than a general guarantee.
Experimental rigor and validation. The evaluation is reasonably broad and carefully controlled, with results on SWE-bench Verified, SWE-bench Live, and SWE-rebench using a matched 14B backbone and common scaffold. The ablations over fork budget, selector, counterfactual horizon, and proposal temperature help isolate the main design choices. The sample-efficiency, advantage-SNR, and covariance diagnostics support the interpretation that CRR improves credit assignment, though the additional counterfactual replay compute remains important when assessing efficiency and fairness of comparison.
Clarity and significance. The paper is clearly written, with a well-motivated problem setup and a clear explanation of the selector, proposal distribution, PPO/GRPO integration, pseudocode, and implementation details. CRR targets an important bottleneck in long-horizon RL for SWE agents and demonstrates practical gains without human step labels or a separately trained PRM.
Questions
-
Since CRR incurs additional counterfactual replay compute, could the authors clarify how its gains should be interpreted under strictly matched wall-clock or GPU-hour budgets? In particular, how does the comparison account for asynchronous fork-pool utilization, replay overhead, and baseline reimplementations, and under what fork-overhead regime would CRR no longer dominate outcome-only GRPO?
-
How sensitive is CRR to the choice of counterfactual proposal beyond the reported temperature sweep? For example, what happens when sampled alternatives are lower-quality but still within policy support, when the proposal becomes stale as the policy changes during training, or when multiple counterfactual samples from the same state yield conflicting terminal returns?
-
CRR relies on deterministic forkability, while real SWE environments may contain flaky tests, nondeterministic tool outputs, external dependencies, or long-horizon state that is difficult to snapshot exactly. How robust is the estimator in such approximately forkable settings? Does K-shot averaging sufficiently address this, or can nondeterminism introduce systematic bias in the step-level advantages?
-
The selector prioritizes high-entropy and high-impact tool actions. Do these selected steps correspond to genuinely causal decisions in the final outcome, or mainly to uncertain or irreversible actions? Are there quantitative or human-interpretable diagnostics showing that selected steps align with bug localization, patch-quality decisions, or regression-inducing edits?
Limitations
yes
Paper formatting concerns
N/A
Final justification
Thanks for the response. I will keep my score positive while increasing my confidence score.
We thank R-69MH for the thorough summary and the four questions; each is answered below with new measurements. During the discussion period we added: (1) a strictly matched wall-clock comparison and fork-overhead break-even (Tables G1, G2-A/B; full tables in our response to Reviewer raFf); (2) a search-based training control at matched fork budget (Table G3, below); (3) pass@k/all-k and a K-sensitivity sweep (Tables S1, S2; full tables in our response to Reviewer sniS); (4) counterfactual-quality composition and a validity-filtered proposal (Tables R2, R2-b; in our response to Reviewer raFf); (5) selector-alignment diagnostics (Table M1, below). Brief answers with pointers:
Q1 (interpretation under strictly matched wall-clock / GPU-hours; async fork-pool utilization; where CRR no longer dominates). Table G1 (full table in our response to Reviewer raFf) gives a corrected one-node accounting separating rollout, fork-pool, and learner device-time. The submitted Table 11/12 convention omitted 133 H100-hours recorded by the logical fork-worker pool, so we correct CRR's total from 188 to 321 H100-hours and will relabel or replace Table 12. Table G2-A supplies the strict equal-wall-clock comparison and its cumulative ledger: at 40.125 hours, CRR completes 24,000 trajectories/4,000 updates and reaches 41.7, while the genuinely extended GRPO run completes 37,824/6,304 and reaches 36.7. The observed +5.0-point margin includes fork overhead in full; G1 seed variability is 0.6–0.8 points. Fork worker-slot utilization was 78%, with 58% of fork device-time overlapped in wall time with on-policy generation; overlap is not subtracted from allocated device-time. Table G2-B observes the crossover between m=2 and m=4 (descriptive interpolation m*≈3.8). Baseline reimplementations share the scaffold, prompts, and evaluation protocol ([Sec. 5.1]).
Matched Search-Select control (Table G3). To answer the AC's and R-sniS's request directly, G3 compares CRR with Search-Select using the same number of fork executions per realized trajectory, selector, branch-scoring verifier and horizon, group size, device-time budget, and clipped learner. The submitted Sec. 2 already distinguishes branch selection from counterfactual credit assignment, and Table 1 already includes TSR, an existing trajectory-search comparator. In G3, Search-Select trains on the verifier-best available sequence, whereas CRR retains the realized trajectory and uses the counterfactual differential only for credit assignment; this is the intended difference between the two fork-using arms.
Table G3 follows the 48 H100-hour reduced-budget protocol specified in our response to Reviewer raFf, except that every arm is run for 3 seeds. Each final checkpoint is evaluated greedily on all 500 SWE-bench Verified instances; the table reports the mean and seed standard deviation.
Table G3 — Matched fork protocols, two uses: credit assignment vs. search (same fork count per trajectory for CRR and Search-Select; equal device-time across all arms; Verified pass@1 (full 500), mean ± seed standard deviation over 3 seeds, %).
Search-Select-GRPO reaches 34.4 versus CRR's 36.2; CRR is higher on all 3 paired seeds. The +1.8-point mean gap is consistent with the benefit of using fork data for credit assignment rather than branch selection under these matched protocols.
Search-Select-GRPO protocol. Branch selection uses the same verifier return R(⋅) as CRR's contrasts — no PRM or judge. Each realized trajectory uses the same selector, k=4 fork count, rollout cap, and verifier endpoint as CRR. The verifier-best fork-derived sequence replaces the realized training sequence only if R(τ~)>R(τ); ties retain the realized sequence. The resulting G=8 sequences form the unchanged GRPO group, with standard group-relative advantages on their returns; unselected branches are discarded and enter neither the group nor the advantage computation, so no CRR-style differential is reused. We retain each generated sequence's behavior-policy log-probabilities and recompute its current-policy log-probabilities during optimization to form the usual clipped current/behavior ratio. This ratio handles policy drift; branch selection deliberately defines the expert-iteration-style training distribution. The selected-branch replacement rate is 12%, and 26% of tokens in selected replacement sequences activate PPO clipping.
Q2 (proposal sensitivity beyond temperature: low-quality in-support alternatives; staleness; conflicting multiple samples). Three parts. (i) Low-quality alternatives: quantified in Table R2 (full table in our response to Reviewer raFf) — class-(a) alternatives are 12% of forks and contribute 8% of the class-mean plug-in contrast mass; a validity-filtered proposal changes pass@1 by only 0.2 (Table R2-b). (ii) Staleness: the proposal is the current policy, tempered; it is resampled at rollout time within the same batch as the on-policy trajectory, so it lags the learner by at most one optimizer round — the same lag PPO already tolerates for its behavior policy; there is no separately-trained proposal network that could go stale. (iii) Multiple samples: submitted App. G already sweeps K∈{1,2,4}, averages conflicting returns, and reports the SNR/cost trade-off. Table S2 (full table in our response to Reviewer sniS) extends this with a fixed-total-fork-budget comparison; breadth performs at least as well as depth in this sweep.
Q3 (approximate forkability; does K-shot averaging suffice; systematic bias). Table R1 (full table in our response to Reviewer raFf) injects controlled nondeterminism at ρ∈{5,10}% of replayed steps: degradation is gradual, K=2 recovers 0.4–0.6 points, and the observed mean-advantage shift stays small at 0.01–0.02, consistent with symmetric injection primarily increasing variance. We will add a formal statement specifying the conditions under which replay noise preserves the mean contrast, together with the corresponding variance-inflation term.
Q4 (are selected steps genuinely causal? interpretable diagnostics). New diagnostics — hit-rate column computed on 2,000 logged training trajectories; the two |Â| columns computed on a 300-trajectory probe in which we additionally fork at random, stride, and entropy-only step sets so that all selectors are scored on the same |Â| distribution:
Table M1 — Do selected steps align with decision-relevance proxies?
Selected steps are 3.2× more likely than random to coincide with the first edit touching a gold-patch file and show a 2.8× enrichment in top-decile advantage magnitude. Thus the selector allocates fork evaluations to steps enriched for decision-relevant edits and large counterfactual contrasts, while these diagnostics do not establish per-step causality. Two worked case studies (a localisation commitment and a regression-inducing edit) are prepared for the appendix of the revision; happy to paste one into this thread if useful.
Camera-ready commitments: (1) positioning paragraph and related-work engagement as given in our response to Reviewer sniS; (2) revised forkability wording; (3) adoption of the consolidated compute accounting (G1) as the single reference for cost reporting; (4) uniform statement of the variance diagnostic at the task/bucket conditioning level across [Prop. 2, App. C, Table 3]; (5) explicit definitions of the tool-type scores type(a_t), the Random/Stride selector controls, and the verifier endpoint used for truncated counterfactual horizons; (6) a broader-impacts summary moved into the main text.
We hope these measurements answer the reviewer's four questions.