Summary (Overview)
- DynaFlow is a framework that integrates free-form executable workflow synthesis into the action space of a main agent, enabling it to decide when collaboration is needed and generate task-specific programs coordinating sub-agents.
- The main agent is trained via two-stage supervised fine-tuning (SFT): first on distilled trajectories, then on a curated subset filtered for orchestration defects (unsupported premises, biased verification, information-flow defects).
- All sub-agents remain fixed during training, decoupling orchestration learning from executor capability improvement.
- DynaFlow achieves 88.08% overall accuracy in Forced mode across six benchmarks, outperforming the strongest baseline by 10.90 percentage points with the same Qwen3.5-27B backbone.
- In Dynamic mode, it answers 47.1% of questions directly while maintaining accuracy close to Forced execution, using 41% fewer sub-agents on average.
Introduction and Theoretical Foundation
Multi-agent systems (MAS) built on large language models (LLMs) often rely on predefined collaboration structures—fixed agent roles, communication patterns, or workflow components. However, coordination requirements vary across tasks: simple queries may need only one agent, independent subtasks benefit from parallel execution, and dependent stages require reliable access to upstream results. Applying a fixed structure across all settings introduces unnecessary communication, latency, and computation.
The authors argue for Free Orchestration: the ability to decide when collaboration is useful and construct task-specific workflows during problem solving. Existing approaches (e.g., DyFlow, MAS-Orchestra) retain constraints on workflow construction—using finite operator templates or generating complete coordination structures in a single decision without observing intermediate execution results.
DynaFlow addresses these limitations by:
- Free-form workflow synthesis as a native action of the task-solving agent
- Repeated orchestration decisions informed by execution feedback
- Decoupling orchestration learning from sub-agent training
The action space is formally defined as:
where is the set of ordinary tool-call actions, is a final-answer output action, and denotes a workflow action comprising a JavaScript program and its invocation through the workflow tool .
Methodology
3.1 Free-Form Workflow Orchestration
The main agent follows a policy over three action forms:
- Direct answer ()
- Tool calls ()
- Workflow actions —synthesizing and invoking a JavaScript program
At turn , the agent generates , where is the ordered history of previous actions and observations. The program defines sub-agent roles, stages, and dependencies through:
- Agent calls (sequential or parallel)
- Explicit information passing between stages
- Optional phase labels (e.g., "derive", "verify", "aggregate")
The workflow tool executes under resource constraints, returning an observation combining program output with an execution trace recording the status and output of each sub-agent call.
3.2 Learning the Orchestration Policy
Stage 1: Trajectory distillation. A teacher model (GLM-5.3 Max) generates trajectories using the same workflow interface. Trajectories with correct final answers following the delegation protocol are retained. The supervised target is , where is the first-turn reasoning and is the workflow action. The loss is:
Stage 2: High-quality data selection. An LLM judge assesses orchestration quality by checking for three defect types:
- Premise injection: answer-determining claims beyond task givens presented as established premises
- Verification defects: review instructions steering a verifier toward an expected answer
- Information-flow defects: missing context, incorrect references, lossy transfer, or hard-coded substitutes preventing required information from reaching downstream agents
The curated dataset is:
Training uses QLoRA, with the main agent only; sub-agents remain frozen.
Empirical Validation / Results
Main Results (Table 1: Accuracy % on six benchmarks, Qwen3.5-27B)
| Method | AIME24 | AIME25 | AIME26 | PolyMATH | GPQA-D | HotpotQA | Overall |
|---|---|---|---|---|---|---|---|
| Single-agent baselines | |||||||
| CoT | 96.67 | 93.33 | 86.67 | 83.00 | 85.35 | 46.50 | 74.27 |
| CoT-SC | 90.00 | 93.33 | 96.67 | 84.50 | 85.86 | 50.50 | 76.16 |
| Self-Refine | 96.67 | 93.33 | 93.33 | 87.50 | 88.38 | 48.00 | 77.18 |
| Automated multi-agent | |||||||
| AFlow | 93.33 | 96.67 | 100.00 | 86.00 | 87.37 | 47.00 | 76.45 |
| Untrained Main Agent | |||||||
| Base, Direct | 93.33 | 93.33 | 93.33 | 74.00 | 83.33 | 47.50 | 71.51 |
| Base + Web search | 83.33 | 73.33 | 73.33 | 66.00 | 79.80 | 77.50 | 74.71 |
| Base, Dynamic | 63.33 | 63.33 | 73.33 | 64.00 | 77.78 | 53.00 | 65.12 |
| Base, Forced | 76.67 | 70.00 | 70.00 | 70.00 | 77.78 | 81.50 | 75.87 |
| Trained Main Agent (ours) | |||||||
| DynaFlow (Direct) | 93.33 | 90.00 | 90.00 | 87.00 | 86.87 | 51.50 | 77.18 |
| DynaFlow (Dynamic) | 93.33 | 100.00 | 96.67 | 91.50 | 83.84 | 84.50 | 87.94 |
| DynaFlow (Forced) | 100.00 | 100.00 | 100.00 | 90.50 | 84.85 | 83.50 | 88.08 |
Training Stage × Execution Mode (Table 2: Overall accuracy %)
| Main Agent | Direct | Dynamic | Forced |
|---|---|---|---|
| Base | 71.51 | 65.12 | 75.87 |
| Stage 1 | 76.74 | 84.45 | 85.47 |
| DynaFlow (Stage 2) | 77.18 | 87.94 | 88.08 |
Key Findings
- Mathematical reasoning: Forced execution solves all 90 AIME questions (100% across 2024, 2025, 2026 sets). Workflows pair symbolic derivations with numerical checks to identify errors.
- Scientific reasoning (GPQA-Diamond): Forced execution reaches 84.85%, improving over Base, Forced by 7.07 points; failures stem from incorrect intermediate conclusions misguiding verification.
- Multi-hop retrieval (HotpotQA): Dynamic mode reaches 84.50%, exceeding Base + Web search by 6–7 points. Workflows organize search around intermediate entities and verify connections between hops.
Workflow Analysis
- Hybrid workflows (parallel + sequential stages) increase from 3.4% (Base) to 83.2% (Stage 1) and 85.6% (Stage 2).
- Explicit output passing rises from 12.6% (Base) to 93.3% (Stage 1) and 97.7% (Stage 2).
- Refinement of intermediate results increases from 28.1% (Stage 1) to 35.9% (Stage 2).
- Major information-flow defects decline from 1.9% (Stage 1) to 0.9% (Stage 2).
- Task-specific role allocation: Solvers/verifiers account for >90% of nodes on AIME/PolyMATH; researchers account for 59.6% on HotpotQA; verification is 33.2–43.9% across tasks.
Theoretical and Practical Implications
- Orchestration as learning: The results demonstrate that orchestration can be learned independently of executor capabilities. With fixed sub-agents, training the main agent alone yields substantial gains, supporting the view that coordination—not just capability—is a key bottleneck in MAS performance.
- Information flow as a key dimension: The analysis identifies cross-stage information use (explicit passing, verification, refinement of upstream outputs) as a critical orchestration property, suggesting future MAS designs should emphasize data-flow correctness alongside task decomposition.
- Adaptive collaboration: The Dynamic–Forced gap narrows from 10.75 points (Base) to 0.14 points (DynaFlow), showing that a trained agent can decide when to collaborate, reducing computational cost by ~41% without sacrificing accuracy.
- Practical architecture: Decoupling orchestration from execution allows pretrained models to be reused as fixed executors, enabling scalable deployment without retraining all components.
Conclusion
DynaFlow integrates free-form executable workflow actions with two-stage main-agent training, combining trajectory distillation with demonstration selection based on orchestration quality. Key takeaways:
- Free-form workflows outperform fixed structures by adapting to task requirements.
- Two-stage training (distillation + curated selection) improves both accuracy and orchestration quality.
- Fixed sub-agents validate that coordination learning is distinct from executor improvement.
- Adaptive invocation maintains performance while reducing sub-agent usage by ~41%.
Future directions include:
- Training sub-agents for reliable information transfer and independent verification
- Extending first-turn supervision to multi-turn trajectories containing disagreements and erroneous results
- Strengthening the main agent's ability to independently assess conflicting outputs, identify errors, and select recovery actions
Related papers
- Explorer-Zero: Improving Self-Play for Long-Horizon Tasks
Explorer-Zero jointly generates compositional tasks and verifiable subtask rewards via self-play, outperforming human-data RL on AppWorld without annotations and improving subsequent RL.
- InteractiveWorld: A Verifiable Human-Centric Environment for Building Better Interactive MLLM Assistants
InteractiveWorld and InteractiveBench, the first verifiable closed-loop egocentric AI assistant benchmark, show even the strongest MLLM succeeds on only 41.7% of tasks, with perception and memory errors causing most failures.
- EvalResearchBench: Can AI Agents Build Their Own Feedback for Recursive Self-Improvement?
AI agents can design evaluators achieving only ~75% agreement with target benchmarks, far below the 91% human-benchmark ceiling, revealing a key bottleneck for recursive self-improvement.