TL;DR
OrchDAG introduces a synthetic data generation pipeline that represents multi-turn tool execution plans as Directed Acyclic Graphs (DAGs) with controllable complexity. To train models on these complex workflows, the authors design a dense, graph-based reward using Graph Edit Distance (GED) for reinforcement learning (RLVR), significantly boosting small open-source models' ability to orchestrate multi-step, multi-turn tools.
What Problem Does This Paper Address?
In industrial and agentic AI systems, resolving a user query often requires chaining dozens of domain APIs where outputs from one tool feed into another, field names change between tools, and errors or timeouts occur across turns.
Existing function-calling benchmarks either evaluate single-turn, atomic tool calls or focus on computer-use tasks (like OS file manipulation). They fail to model:
- Intricate structural dependencies between tools.
- Cross-turn tool reuse, error recovery, and schema mismatches.
- The need for dense feedback during reinforcement learning—standard binary rewards leave training signals extremely sparse when entire tool-call plans must be correct.
Methods
The authors introduce a two-pronged framework:
- Graph-Driven Synthetic Data Generation Pipeline: Built using LangGraph, the pipeline seeds from real tool definitions and builds multi-layer DAG templates parameterized by graph height and width. Intermediate tools pass JSON arguments between parents and children with schema-aligned, randomized key mappings. It incorporates three realistic multi-turn scenarios:
- Scenario 1: Tool execution errors (timeouts) requiring partial subgraphs to be rescheduled.
- Scenario 2: Follow-up queries requiring new tools dependent on prior results.
-
Scenario 3: Completely independent follow-up user queries. Rigorous validation using Abstract Syntax Tree (AST) matching and JSON schema verification filters out invalid synthetic samples.
-
Graph-Edit-Distance (GED) Reward for RLVR: Rather than giving binary (0 or 1) rewards on whole-graph matches, the authors formulate a reward based on normalized Graph Edit Distance: $$R_{\text{DAG}} = 1 - \frac{\text{GED}(g_1, g_2)}{\text{GED}(g_1, \emptyset) + \text{GED}(g_2, \emptyset)}$$ Combined with a format verification reward, this awards partial credit for structurally valid execution paths, providing dense feedback for algorithms like Group Relative Policy Optimization (GRPO) and DAPO.
[User Query]
│
▼
[First-Layer Tools]
┌──┴──┐
▼ ▼
[Tool 2] [Tool 3] <-- Dependent JSON payload
└──┬──┘
▼
[Final Tool] ──> Reward = R_format + α * R_DAG (via GED)
Datasets
- OrchDAG Benchmark (Introduced): Built using seed tools extracted from APIGEN (2,542 data points) and TOOLACE (1,005 data points). The resulting dataset contains 1,800 training and 250 test instances, featuring multi-turn splits (25–30%), average DAG heights of 2.5–2.7, and widths of 3.1–3.4.
- StableToolBench: Used as an external, out-of-domain benchmark to evaluate generalization across L1, L2, and L3 tool complexity levels.
Key Insights and Ideas
- Step-level success $\neq$ Task-level success: Prior methods like ToolRL achieve ~50–60% step accuracy on OrchDAG, but score 0% full-query accuracy because errors compound without a global plan.
- Topological planning is challenging even for frontier LLMs: Zero-shot pass@1 on predicting complete DAGs is only 18% for GPT-4o and 15% for Claude 4; smaller models (Qwen2.5-7B) achieve just 2%, demonstrating that OrchDAG is solvable but far from saturated.
- Dense structural rewards unlock RL: Training with exact-match 0/1 rewards yields 0% accuracy even after 15 steps. GED-based shaping provides the gradient signal needed for policy improvement.
- Entropy collapse mitigation: Extended GRPO training led to sudden policy degradation around step 51 due to low policy entropy; incorporating DAPO stabilized exploration and prevented collapse.
Key Results
- Reinforcement Learning Gains: Fine-tuning Qwen2.5-7B with GRPO and the graph-based reward on single-turn tasks improved full-query accuracy from 2% to 40.2% ($n=8$ rollouts, 45 steps).
- Multi-Turn Performance: On 2-turn scenarios, Qwen2.5-7B ($n=8$) achieved 35.2% accuracy on independent follow-ups (Scenario 3), 20.3% on dependent follow-ups (Scenario 2), and 15.6% on error recovery (Scenario 1).
- Out-of-Domain Generalization: The OrchDAG-trained 7B model generalized strongly to StableToolBench, rivaling or surpassing GPT-4-0613 (CoT) across several categories (e.g., 47.1% vs. 45.5% on L1 instruction, and 50.7% vs. 48.1% on L3 instruction).
Limitations and Future Work
- Two-Turn Horizon: Current experiments only assess up to two interaction turns; scaling to longer multi-turn trajectories is left for future work.
- Implicit Dependencies Unhandled: OrchDAG explicitly models dependencies through input/output JSON schemas. It currently does not account for implicit dependencies (e.g., file system side-effects or environment states common in computer-use tasks).
Summary updated