acceptodds
Under review as a conference paper at ICLR 2027

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.

Primary area:
foundation or frontier models, including LLMs
Keywords:
coding agent, llm training

Reviews

Among:
Shape:
1234this paper, Top 15%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 3.00 over 3 reviews, above 85% of the others.
Reviewer_bWwqOpenReview ↗
Rating
3
Confidence
4
Informativeness
2
Presentation
3
Soundness
2
Read review
Paper summary

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.

Critical 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.
Critical 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 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.
Reviewer_fjqdOpenReview ↗
Rating
3
Confidence
3
Informativeness
3
Presentation
3
Soundness
2
Read review
Paper 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).

Critical strengths
  1. 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.
  2. The comparison with CoPR-single PR and the analysis on training horizon, inference budget is valuable.
Critical weaknesses
  1. 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 authors
  1. How does CoPR compare against baseline with token-matched trajectories concatenated from single PR?
  2. Is there any human verification on the verification mechanism in section 4?
Reviewer_yM9KOpenReview ↗
Rating
3(+1)
Confidence
2
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper 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.

Critical strengths
  1. 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.
  2. 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
Critical 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 authors

Questions

  1. 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

  1. Line 203-204: Maybe it is better to explicitly state what ata_t corresponds to. Is it ai=(mi,ti)a_i = (m_i, t_i)?

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.