Counterfactual Rollout Replay: Forkable Environments as Free Process Rewards for Software Engineering Agents
On the map: LLM agents and tool use → Software engineering coding agents also fits: Reinforcement learning for LLM agents
also in 1 more
Abstract (arXiv)
Outcome-only reinforcement learning gives software engineering (SWE) agents a terminal success signal but little direct guidance about intermediate decisions. We introduce Counterfactual Rollout Replay (CRR), a training-time procedure that uses forkable executable environments to obtain step-level return contrasts. CRR selects a small set of decision points, restores each state, samples an alternative action, and rolls the branch forward under the policy. It retains the realised training trajectory and replaces the advantage at selected steps with the difference between its terminal return and the sampled counterfactual return. The method needs no human process labels or learned process reward model; free refers to those supervision costs, not replay compute. With a 14B policy, CRR improves pass@1 on SWE-bench Verified, SWE-bench Live, and SWE-rebench, and combines with process-reward and trajectory-search methods. On SWE-bench Verified, an equal-wall-clock comparison on the same hardware yields 41.7% versus 36.7% for extended outcome-only GRPO, a 5.0-point gain with fork overhead included. These results apply to environments with affordable, reliable state restoration; stochastic continuations and expensive or imperfect replay remain limitations.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 69 of its 90 references that are in the map. First posted on arXiv 27 Sep 2026.
Builds on
69 of 90 references.
Closest ancestors · 11
Same direction, newest first
- 2026SemVerBench: Benchmarking LLM Comprehension of Version-Constraint Resolution Semantics10 Sep
- 2026SWE-TRACE: Optimizing Long-Horizon SWE Agents Through Rubric Process Reward Models and Heuristic Test-Time Scaling16 Apr
- 2026SWE-rebench V2: Language-Agnostic SWE Task Collection at Scale27 Feb
- 2026SWE-MiniSandbox: Container-Free Reinforcement Learning for Building Software Engineering Agents11 Feb
- 2025SWE-RM: Execution-free Feedback For Software Engineering Agents26 Dec
- 2025SWE-rebench: An Automated Pipeline for Task Collection and Decontaminated Evaluation of Software Engineering Agents26 May
- 2024Training Software Engineering Agents and Verifiers with SWE-Gym30 Dec
- 2024HyperAgent: Generalist Software Engineering Agents to Solve Coding Tasks at Scale9 Sep
- 2024OpenHands: An Open Platform for AI Software Developers as Generalist Agents23 Jul
- 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering6 May
- 2024MAGIS: LLM-Based Multi-Agent Framework for GitHub Issue Resolution26 Mar
Other references · 58
- 2017Proximal Policy Optimization Algorithmscited by 14,441
- 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 8,851
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,355
- 2025Qwen3 Technical Reportcited by 8,195
- 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,146
- 2023Let's Verify Step by Stepcited by 3,598
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,193
- 2025Process Reinforcement through Implicit Rewardscited by 478
- 2025rStar-Math: Small LLMs Can Master Math Reasoning with Self-Evolved Deep Thinkingcited by 308
- 2024AutoCodeRover: Autonomous Program Improvementcited by 272
- 2024ArCHer: Training Language Model Agents via Hierarchical Multi-Turn RLcited by 212
- 2024Tree Search for Language Model Agentscited by 148
38 more
- 2024RLEF: Grounding Code LLMs in Execution Feedback with Reinforcement Learningcited by 146
- 2024SWE-Bench+: Enhanced Coding Benchmark for LLMscited by 95
- 2020Counterfactual Data Augmentation using Locally Factored Dynamicscited by 93
- 2025SWE-Fixer: Training Open-Source LLMs for Effective and Efficient GitHub Issue Resolutioncited by 87
- 2025From AI for Science to Agentic Science: A Survey on Autonomous Scientific Discoverycited by 74
- 2025Tree Search for LLM Agent Reinforcement Learningcited by 73
- 2020Counterfactual Credit Assignment in Model-Free Reinforcement Learningcited by 60
- 2025Scaling Test-time Compute for LLM Agentscited by 59
- 2024Alibaba LingmaAgent: Improving Automated Issue Resolution via Comprehensive Repository Explorationcited by 58
- 2020Sample-Efficient Reinforcement Learning via Counterfactual-Based Data Augmentationcited by 57
- 2026Hindsight Credit Assignment for Long-Horizon LLM Agentscited by 51
- 2025Are "Solved Issues" in SWE-bench Really Solved Correctly? An Empirical Studycited by 47
- 2025SkyRL-Agent: Efficient RL Training for Multi-turn LLM Agentcited by 44
- 2024SWE-bench-java: A GitHub Issue Resolving Benchmark for Javacited by 34
- 2026SWE-Lego: Pushing the Limits of Supervised Fine-tuning for Software Issue Resolvingcited by 30
- 2025SoRFT: Issue Resolving with Subtask-oriented Reinforced Fine-Tuningcited by 27
- 2024Question Calibration and Multi-Hop Modeling for Temporal Question Answeringcited by 25
- 2023Dual Path Modeling for Semantic Matching by Perceiving Subtle Conflictscited by 21
- 2021An Information-Theoretic Perspective on Credit Assignment in Reinforcement Learningcited by 20
- 2025A Practitioner's Guide to Multi-turn Agentic Reinforcement Learningcited by 16
- 2025AdaMCoT: Rethinking Cross-Lingual Factual Reasoning through Adaptive Multilingual Chain-of-Thoughtcited by 14
- 2026SafetyRepro: Configuration-Conditional Rank Instability on Alignment Benchmarkscited by 14
- 2025SWE-Dev: Evaluating and Training Autonomous Feature-Driven Software Developmentcited by 13
- 2025Reasoning-Enhanced Domain-Adaptive Pretraining of Multimodal Large Language Models for Short Video Content Governancecited by 13
- 2025Audio-Enhanced Vision-Language Modeling with Latent Space Broadening for High Quality Data Expansioncited by 11
- 2026SWE-ABS: Adversarial Benchmark Strengthening Exposes Inflated Success Rates on Test-based Benchmarkcited by 11
- 2026Scaling Test-Time Compute for Agentic Codingcited by 11
- 2020Learning to Communicate Using Counterfactual Reasoningcited by 9
- 2025CCL-XCoT: An Efficient Cross-Lingual Knowledge Transfer Method for Mitigating Hallucination Generationcited by 9
- 2026Intrinsic Credit Assignment for Long Horizon Interactioncited by 9
- 2025Learning Game-Playing Agents with Generative Code Optimizationcited by 8
- 2025StructCoh: Structured Contrastive Learning for Context-Aware Text Semantic Matchingcited by 8
- 2025Unifying Tree Search Algorithm and Reward Design for LLM Reasoning: A Surveycited by 8
- 2026Understanding the Challenges in Iterative Generative Optimization with LLMscited by 8
- 2026Beyond Accuracy: Measuring Bias Acknowledgment in Chain-of-Thought Reasoning for Responsible AI Evaluationcited by 8
- 2026Why Supervised Fine-Tuning Fails to Learn: A Systematic Study of Incomplete Learning in Large Language Modelscited by 7
- 2026TSR: Trajectory-Search Rollouts for Multi-Turn RL of LLM Agentscited by 6
- 2026Reason Only When Needed: Efficient Generative Reward Modeling via Model-Internal Uncertaintycited by 6
50 most cited of 58 All 58 (JSON)
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026Rollout Pass-Rate Control: Steering Binary-Reward RL Toward Its Most Informative Regime
- 2026FC-SWE: Failure-Conditioned RL for Long-Horizon Software Engineering Agents
- 2026RippleCP: Measuring Counterfactual Checkpoint Advantage in Coding Agents
- 2026SWE-MILE: Asynchronous Potential-Induced Milestone Credit Assignment for Long-Horizon Software Engineering Agents
- 2026TaPR: Test-Aware Policy Refinement for Feedback-Conditioned Code Generation
- 2025Training Long-Context, Multi-Turn Software Engineering Agents with Reinforcement Learning
- 2026Synthesize and Reward -- Reinforcement Learning for Multi-Step Tool Use in Live Environments
- 2025Reinforcement Learning from Compiler and Language Server Feedback