Chain of Pull Requests: Unlocking Long-Horizon Agency Data-Efficiently
Anonymous authors
ICLR 2027
TL;DR. Chain of Pull Requests: Unlocking Long-Horizon Agency Data-Efficiently
Abstract. While Large Language Models (LLMs) excel at short-term tasks, scaling them to long-horizon agentic workflows remains challenging for the scarcity of data that captures authentic long-dependency structures and cross-state evolutionary dynamics. Existing synthesis methods either limit tasks to single-feature scenarios or incur prohibitive human annotation costs, failing to provide scalable, high-quality supervision. We address this by reconceptualizing data synthesis through the lens of real-world software evolution. Our key insight: PR sequences naturally embody the very supervision signals needed for long-horizon learning. They decompose objectives into units, maintain iterative coherence, and encode bug-fix refinements. Building on this, we propose Chain of Pull Requests (CoPR), which mines structured supervision from PR sequences through three interlocking mechanisms: (1) progressive task decomposition via continuous commits, (2) long-term consistency enforcement through unified functional objectives, and (3) verifiable refinement from authentic bug-fix trajectories. CoPR preserves causal dependencies and iterative refinements, naturally aligning with full-cycle task modeling. The resulting trajectories are substantial—averaging 85k tokens and 116 tool calls—yet remarkably data-efficient: fine-tuning GLM-4.6 on 239 CoPR samples yields broad benchmark improvements, notably achieving a 47% relative gain on Toolathlon. Further analysis confirms the effective internalization of long-horizon behaviors and unveils training and inference scaling for extended horizons. Our work establishes CoPR as a scalable paradigm beyond limitations of single-feature synthesis, proving that modeling real-world evolutionary trajectories offers a principled path to unlock the intrinsic long-horizon potential of agents.
Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.
Claim this paperedit · history
ICLR 2027
Under review · 4 reviews · OpenReview
Updated 25 Nov 2026, 10:40 UTC.
- Rating
- 3/4
- Confidence
- 4/4
- Soundness
- 2/3
- Presentation
- 3/3
- Informativeness
- 2/3
Read review
Summary
Strengths
- The idea of chaining relevant PRs to construct long-horizon coding tasks intuitively makes a lot of sense, and is potentially very scalable given the number of source PRs on GitHub.
Weaknesses
- My main concern is about the noise in how the evaluation is presented. In table 1, the non-CoPR datasets only make the model worse, and the SinglePR variant has no rejection sampling, leaving SingePRSuccess as the only strong short-horizon baseline. Some of the benchmarks, such as SWE-Bench and DS-1000, are typically not considered to be long-horizon, and that's probably why CoPR does not show a significant gain over the SinglePRSuccess baseline there. I would recommend trying some more recent benchmarks such as DeepSWE, but I'm not sure if the baseline models are strong enough for those tasks.
- How to mine PR chains from a repo is a key component for reproduction of this paper's idea, but is only described very briefly in Section 4.2. Given the number of repos used in this work is pretty small, it would be good to convince readers that the method generalizes to other repos.
Questions for the authors
- Wondering if there can be such an example. Suppose we have chain (PR1, PR2). PR2 asks the agent to fix a bug. However, the agent is able to pass PR1 without even introducing the bug, and there's no need to do PR2 at all.
- Rating
- 3/4
- Confidence
- 3/4
- Soundness
- 2/3
- Presentation
- 3/3
- Informativeness
- 3/3
Read review
Summary
This paper addresses the scarcity of multi-stage long-horizon training trajectories for AI agents. It proposes Chain of Pull Requests (CoPR), which chains multiple PRs into one long-horizon task, aiming to train agent on long-horizon learning. The core of CoPR is not to simply combine PRs, but to ensure latter PR needs to be conditioned on previous PR’s state. Fine-tuning GLM-4.6 on only 239 CoPR trajectories yields a +47% relative improvement on Toolathlon (0.157 →0.231).
Strengths
- The proposed definition of long-horizon is close to stateful multi-stage interaction. Compared to treating each PR independently, it retained the dependency between multiple PRs, and used it for long-term consistency enforcement through unified functional objectives.
- The comparison with CoPR-single PR and the analysis on training horizon, inference budget is valuable.
Weaknesses
- The claim about long-horizon capability is not fully disentangled from trajectory length and training-token budget. The 239 trajectories contain avg 85K tokens and 116 tool calls per each trajectory. The model improvement over CoPR-singple PR could come from longer and richer trajectories, instead of the proposed cross-stage dependencies. 2 The verification mechanism in section 4 may not be reliable enough. It mainly compares the functional-intent similarity between agent patch vs oracle patch. Two patches could have very low implementation similarity, while equivalent functional ability, and verse visa.
Questions for the authors
- How does CoPR compare against baseline with token-matched trajectories concatenated from single PR?
- Is there any human verification on the verification mechanism in section 4?
- Rating
- 3/4(+1)
- Confidence
- 2/4
- Soundness
- 2/3
- Presentation
- 2/3
- Informativeness
- 2/3
Read review
Summary
The paper proposes Chain of Pull Requests (CoPR), which is a paradigm for long-horizon data synthesis for addressing the scarcity of long-horizon agentic task trajectories. CoPR transforms discrete PRs from nine representative GitHub repositories into task chains by feature evolution dependencies, providing structural supervision. Using 239 samples filtered by rejection sampling, CoPR allows efficient fine-tuning of LLMs, outperforming baselines trained on bigger datasets.
Strengths
- The proposed method exhibits significant performance gain with small number of samples, which is the ideal result we can expect from introducing a new method.
- The paper presents several comparisons, against different baselines and across different model architectures. Analyses conducted from various perspectives reinforce the robustness of the proposed method
Weaknesses
While the performance comparisons seem to show significant improvements of the proposed method, the paper does not seem to show standard deviation of the results estimated over multiple seeds. Readers can doubt the results' consistency without this information.
Questions for the authors
Questions
- Could you provide more details of how PR-chain combination in Section 4.2 works? Was the procedure done with LLM agents, or did it rely on hard-coded algorithms? What does "not be contiguous in wall-clock time" mean?
Comments
- Line 203-204: Maybe it is better to explicitly state what corresponds to. Is it ?
- Rating
- 3/4
- Confidence
- 2/4
- Soundness
- 2/3
- Presentation
- 3/3
- Informativeness
- 2/3
Read review
Summary
CoPR constructs agent training data from sequences of related GitHub pull requests. The pipeline generates stage-specific queries, collects coding trajectories over evolving repository states, and retains solutions using a reference-based patch evaluator. Fine-tuning GLM-4.6 on 239 trajectories improves Toolathlon from 15.7% to 23.1% and SWE-bench Verified from 60.8% to 63.2% (Table 1). The paper also evaluates transfer to Qwen models, compares against successful single-PR and temporal-chain data, validates the evaluator against unit-test outcomes, and studies performance under different training horizons and inference budgets.
Strengths
-
Related PRs capture a sequence of implementation, extension, and repair decisions that isolated issue–patch pairs do not explicitly preserve. Organizing these histories into training tasks is a worthwhile contribution. The successful-single-PR and temporal-chain controls in Table 1 are particularly useful: they provide evidence beyond a comparison with the untuned backbone or an unfiltered dataset.
-
The Toolathlon improvement is encouraging, and the Qwen experiments and AgencyBench Code result provide additional evidence of transfer (Tables 3, 6, and 10). I also appreciate the calibration of the patch evaluator against executable tests in Table 2. Taken together, these experiments make a reasonable case for CoPR as a useful training-data construction method, even though they do not fully establish the proposed explanation for its effectiveness.
I lean toward acceptance because the paper introduces a useful data-construction method and supports its practical value with internal controls, transfer experiments, and evaluator validation. My main reservations concern how confidently the gains can be attributed to semantic state evolution and how strongly the paper interprets them as evidence of specific learned behaviors. These limitations should be addressed, but I do not think they outweigh the contribution demonstrated by the current experiments.
Weaknesses
-
Table 1 compares 874 successful single-PR trajectories, 600 temporal chains, and 239 CoPR chains. The successful-single-PR control is an important addition, but the paper does not report comparable training-token exposure and optimization budgets, or establish that the conditions use the same constituent PRs. CoPR improves the reported average from 0.457 to 0.475 over this control, but differences in task selection, trajectory length, and training exposure remain possible explanations. Counting a complete chain as one sample also makes the sample-efficiency comparison difficult to interpret without token-level accounting. These results support the usefulness of the overall recipe more strongly than the conclusion in Section 5.2 that semantic evolutionary structure is the determining factor.
-
The training pipeline supplies stage queries and a global chain overview, while Appendix J provides relevant file paths and abstracted solution logic. This is legitimate supervision, but it leaves open how much the model learns to discover a decomposition itself. Figure 4 illustrates the desired behavior on one task; improvements in success rates and resource use in Figures 5–6 do not directly measure decomposition or preservation of earlier requirements. The AgencyBench Code result is relevant positive evidence, but Table 10 does not include the successful-single-PR or temporal-chain controls. Including those comparisons would make the claimed connection between semantic PR chains and long-horizon capabilities considerably more convincing. As written, the behavioral conclusions should be more restrained.
Questions for the authors
-
What are the total loss-bearing token counts, optimizer-update counts, and checkpoint-selection procedures for CoPR, SinglePRSuccess, and TemporalChain? Do these conditions share the same constituent PRs? A comparison using the same source PRs and matched training exposure would materially strengthen the attribution of the gains to chain structure.
-
How do SinglePRSuccess and TemporalChain perform on AgencyBench Code under the same evaluation settings as CoPR? This would help determine whether the improvement on the most directly relevant long-horizon evaluation specifically benefits from semantic dependencies.
-
In Equation (5), how is each stage’s base snapshot constructed, and how are cumulative agent edits reconciled with earlier reference changes and intervening commits? A concrete worked example, including conflict handling, would help establish precisely which parts of the evolving state are inherited from the agent’s previous decisions.
From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.
Loading the discussion…
This paper proposes a new method to construct long-horizon SWE traces as SFT data by creating tasks from multiple GitHub PRs that are related to one another. To collect training data, the agent is prompted to sequentially solve each PR task one by one. After the agent completes one PR task, rejection sampling is performed using an LLM judge to compare the model-generated patch against the golden patch. Rollout proceeds only on successful trials. This results in a final training set of 239 trajectories, each passing every PR task in a chain. Experiments show that this training dataset, though small, leads to larger gains than baseline datasets in various agentic tasks.