Table of Contents
Fetching ...

daVinci-Agency: Unlocking Long-Horizon Agency Data-Efficiently

Mohan Jiang, Dayuan Fu, Junhao Shi, Ji Zeng, Weiye Si, Keyu Li, Xuefeng Li, Yang Xiao, Wenjie Li, Dequan Wang, Pengfei Liu

TL;DR

The paper tackles the data scarcity barrier for long-horizon agentic tasks by leveraging real-world software evolution through chains of pull requests (PRs). It introduces daVinci-Agency, a paradigm that mines PR chains to provide decomposition, consistency, and refinement signals, producing trajectories on the order of $8.5\times 10^4$ tokens with $116$ tool calls per chain. Fine-tuning GLM-4.6 on only $239$ such samples yields substantial gains, including a $47\%$ relative improvement on Toolathlon, demonstrating remarkable data efficiency and cross-domain robustness. The results show that structured, cross-stage supervision from authentic code evolution can unlock durable long-horizon agency across model families, with longer trajectories offering scalable performance enhancements and broad generalization potential.

Abstract

While Large Language Models (LLMs) excel at short-term tasks, scaling them to long-horizon agentic workflows remains challenging. The core bottleneck lies in the scarcity of training data that captures authentic long-dependency structures and cross-stage evolutionary dynamics--existing synthesis methods either confine to single-feature scenarios constrained by model distribution, 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: Pull Request (PR) sequences naturally embody the supervision signals for long-horizon learning. They decompose complex objectives into verifiable submission units, maintain functional coherence across iterations, and encode authentic refinement patterns through bug-fix histories. Building on this, we propose daVinci-Agency, which systematically mines structured supervision from chain-of-PRs 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. Unlike synthetic trajectories that treat each step independently, daVinci-Agency's PR-grounded structure inherently preserves the causal dependencies and iterative refinements essential for teaching persistent goal-directed behavior and enables natural alignment with project-level, 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 daVinci-Agency samples yields broad improvements across benchmarks, notably achieving a 47% relative gain on Toolathlon. Beyond benchmark performance, our analysis confirms...

daVinci-Agency: Unlocking Long-Horizon Agency Data-Efficiently

TL;DR

The paper tackles the data scarcity barrier for long-horizon agentic tasks by leveraging real-world software evolution through chains of pull requests (PRs). It introduces daVinci-Agency, a paradigm that mines PR chains to provide decomposition, consistency, and refinement signals, producing trajectories on the order of tokens with tool calls per chain. Fine-tuning GLM-4.6 on only such samples yields substantial gains, including a relative improvement on Toolathlon, demonstrating remarkable data efficiency and cross-domain robustness. The results show that structured, cross-stage supervision from authentic code evolution can unlock durable long-horizon agency across model families, with longer trajectories offering scalable performance enhancements and broad generalization potential.

Abstract

While Large Language Models (LLMs) excel at short-term tasks, scaling them to long-horizon agentic workflows remains challenging. The core bottleneck lies in the scarcity of training data that captures authentic long-dependency structures and cross-stage evolutionary dynamics--existing synthesis methods either confine to single-feature scenarios constrained by model distribution, 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: Pull Request (PR) sequences naturally embody the supervision signals for long-horizon learning. They decompose complex objectives into verifiable submission units, maintain functional coherence across iterations, and encode authentic refinement patterns through bug-fix histories. Building on this, we propose daVinci-Agency, which systematically mines structured supervision from chain-of-PRs 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. Unlike synthetic trajectories that treat each step independently, daVinci-Agency's PR-grounded structure inherently preserves the causal dependencies and iterative refinements essential for teaching persistent goal-directed behavior and enables natural alignment with project-level, 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 daVinci-Agency samples yields broad improvements across benchmarks, notably achieving a 47% relative gain on Toolathlon. Beyond benchmark performance, our analysis confirms...
Paper Structure (39 sections, 4 equations, 7 figures, 5 tables)

This paper contains 39 sections, 4 equations, 7 figures, 5 tables.

Figures (7)

  • Figure 1: Unlocking long-horizon agency via chain of pull requests. Left: daVinci-Agency extracts supervision for decomposition, consistency, and refinement from the natural evolution of software features. Right: With only 239 training samples, it achieves over 148% improvement compared to the model trained on 66k samples.
  • Figure 2: Comparison of scope across software engineering horizons. While function level and feature level focus on isolated algorithms or single-feature resolutions, project evolution level demands that agents handle the continuous evolutionary lifecycle of a project.
  • Figure 3: Characteristics of daVinci-Agency data. Left: Domain coverage across daVinci-Agency. Right: Distributions of trajectory length and tool utilization illustrating the significant complexity inherent in long-horizon agentic tasks.
  • Figure 4: Overview of the daVinci-Agency Data Synthesis Paradigm. The pipeline initiates with query construction, mining PRs with dependency structures from GitHub to form topological task chains, providing reliable state evolution signals as supervision.
  • Figure 5: Comparison of behavioral trajectories between the daVinci-Agency and baseline models on the real case in SWE-bench. The daVinci-Agency model demonstrates exceptional long-horizon agency, while the baseline model exhibits a lack of planning, goal drift, and escapism when encountering errors.
  • ...and 2 more figures