Command Palette
Search for a command to run...
DynaFlow: 자유 형식 다중 에이전트 오케스트레이션 학습
DynaFlow: 자유 형식 다중 에이전트 오케스트레이션 학습
Ruhao Liu Qi Li Shizun Wang Xinchao Wang
초록
다중 에이전트 시스템은 흔히 사전 정의된 협업 구조에 의존하기 때문에 다양한 작업 요구에 적응하는 능력이 제한된다. 본 연구는 자유 형식의 실행 가능한 워크플로 합성을 주 에이전트의 행동 공간에 통합하는 프레임워크인 DynaFlow를 제안한다. 이 에이전트는 협업이 필요한 시점을 스스로 판단하고, 순차적 또는 병렬적 실행, 구조화된 정보 교환 및 검증을 통해 하위 에이전트들을 조정하는 작업별 프로그램을 생성한다. 실행 결과와 추적은 이후 행동의 기반이 되어, 추론이 진행됨에 따라 에이전트가 협업을 조정할 수 있게 한다. 주 에이전트만 증류된 궤적에 대한 지도 미세조정으로 학습시키고, 이어서 뒷받침되지 않는 전제, 편향된 검증, 정보 흐름 결함을 기준으로 필터링된 예시들로 개선한다. 모든 하위 에이전트는 고정하여 오케스트레이션 학습을 실행기 능력 향상과 분리한다. 수학적 추론, 과학 질의응답, 멀티홉 검색을 아우르는 6개 벤치마크에서 DynaFlow는 Forced 모드에서 88.08%의 전체 정확도를 달성하여, 동일한 Qwen3.5-27B 백본을 사용하는 가장 강력한 평가 기준선을 10.90%포인트 능가한다. 워크플로 분석 결과, 학습 후 선행 단계 출력에 대한 더 명시적인 사용, 검증 및 정제가 나타났으며, 이는 교차 단계 정보 흐름이 다중 에이전트 오케스트레이션의 핵심 차원임을 강조한다.
One-sentence Summary
Researchers at the National University of Singapore introduce DynaFlow, a framework that integrates free-form executable workflow synthesis into the main agent’s action space so the agent generates task-specific programs coordinating fixed sub-agents through sequential or parallel execution, structured information exchange, and verification; trained via supervised fine-tuning on distilled trajectories and refinement on examples filtered for unsupported premises, biased verification, and information-flow defects, DynaFlow achieves 88.08% overall accuracy in Forced mode across six benchmarks spanning mathematical reasoning, scientific question answering, and multi-hop retrieval, outperforming the strongest evaluated baseline by 10.90 percentage points with the same Qwen3.5-27B backbone.
Key Contributions
- DynaFlow integrates free-form executable workflow synthesis into the main agent's action space, enabling it to decide when collaboration is needed and to generate task-specific programs that coordinate sub-agents through sequential or parallel execution, structured information exchange, and verification.
- The main agent is trained via supervised fine-tuning on distilled trajectories and then refined on examples filtered for unsupported premises, biased verification, and information-flow defects, making orchestration quality an explicit selection criterion while keeping all sub-agents fixed.
- Across six benchmarks spanning mathematical reasoning, scientific question answering, and multihop retrieval, DynaFlow achieves 88.08% overall accuracy in Forced mode and outperforms the strongest evaluated baseline with the same Qwen3.5-27B backbone by 10.90 percentage points; Dynamic mode also answers 47.1% of questions without invoking workflows while maintaining accuracy close to Forced execution, and workflow analysis shows more explicit use, verification, and refinement of upstream outputs after training.
Introduction
Multi-agent systems built on large language models often rely on fixed collaboration structures, but coordination requirements vary across tasks, and fixed structures can add unnecessary communication, latency, and computation. Prior automated workflow methods reduce some rigidity, yet DyFlow constructs plans from a finite set of operator templates and MAS-Orchestra generates the full coordination structure in a single decision without observing intermediate execution results. The authors introduce DynaFlow, which treats executable workflow synthesis as a native action of a main task-solving agent. The main agent can answer directly, use ordinary tools, or generate task-specific workflow programs that define subagent roles, dependencies, and output handling in code; a budget-constrained runtime returns outputs and traces that inform later orchestration decisions. The training framework updates only the main agent on distilled demonstrations and filters them for orchestration quality, keeping subagents fixed. Across six benchmarks, DynaFlow reports 88.08% overall accuracy in forced mode, exceeding the strongest evaluated baseline using the same backbone by 10.90 percentage points.
Method
The authors introduce DynaFlow, a framework that integrates free-form executable workflow synthesis directly into the action space of a Main Agent. This design enables the agent to dynamically decide when and how to collaborate with fixed sub-agents, rather than relying on rigid, pre-designed structures. As shown in the figure below, the system operates through a continuous feedback loop where the Main Agent orchestrates tasks, executes workflows, and uses execution traces to guide subsequent decisions.
Given a question q and task instruction I, the Main Agent follows a policy πθ over a unified action space defined as:
A=Atool∪{Aans,(P,W(P))}Here, Atool represents ordinary tool-call actions, Aans denotes the final-answer output action, and (P,W(P)) constitutes a single workflow action. This workflow action comprises both a JavaScript program P synthesized by the Main Agent and its invocation through the workflow tool W. At each turn k, the agent generates an action ak∼πθ(⋅∣I,q,hk−1), where hk−1 is the ordered history of previous actions and observations.
The synthesized program P explicitly defines sub-agent roles, execution stages, and dependencies, allowing independent calls to run concurrently and dependent calls to receive upstream outputs. Once invoked, the workflow tool executes P under resource constraints using frozen sub-agents. It returns an observation ok=W(P) that combines the program output with an execution trace detailing the status and results of each sub-agent call. The Main Agent appends (ak,ok) to its history and determines whether to emit a final answer, invoke another tool, or synthesize a follow-up workflow to refine the results.
To train the orchestration policy πθ, the authors employ a two-stage supervised fine-tuning process that updates only the Main Agent while keeping all sub-agents fixed.
In the first stage, trajectory distillation, a teacher model generates trajectories using the same workflow interface and fixed sub-agents. The authors retain trajectories that yield correct final answers and strictly follow the delegation protocol. The supervised target is the first-turn output s=(r,a1), where r is the reasoning trace and a1=(P,W(P)) is the workflow action. This forms the initial dataset D1. Both training stages minimize the standard supervised fine-tuning loss:
LSFT(θ;D)=−(I,q,s)∈D∑logπθ(r,a1∣I,q)This loss supervises both the reasoning tokens and the action tokens, masking out instructions, questions, and tool definitions to focus on first-turn task analysis and workflow synthesis.
In the second stage, high-quality data selection, the authors filter the initial dataset to address orchestration failures such as poor information transfer and incorrect agent judgments. An LLM judge evaluates the orchestration quality of each trajectory by checking for three specific defects: premise injection, which involves presenting unverified claims as established premises; verification defects, where reviewers are steered toward expected answers; and information-flow defects, characterized by missing context or lossy transfer of upstream outputs. Only examples that pass this evidence-based check are retained, forming the curated subset D2=J(D1). Training then continues from the Stage 1 checkpoint on D2 with a smaller learning rate to refine the orchestration capabilities of the agent.
Experiment
These experiments evaluate a workflow orchestration Main Agent across AIME, PolyMATH, GPQA-Diamond, and HotpotQA, with sub-agents fixed, comparing a Base model, Stage 1 trajectory distillation, and DynaFlow after Stage 2 training on selected high-quality demonstrations. They show that orchestration training converts workflow access into effective collaboration, with DynaFlow achieving the strongest overall results, and that Stage 2 improves workflow design through more connected stages, better information transfer, explicit verification, and task-specific role assignment. Adaptive invocation in Dynamic mode maintains accuracy close to Forced execution while using substantially fewer sub-agents, indicating that the Main Agent learns selective collaboration, though failures on scientific reasoning highlight remaining challenges in independent verification and final-answer selection.
DynaFlow attains the highest overall accuracy in both forced and dynamic execution, exceeding the strongest baseline by more than ten percentage points while training only the main agent and keeping sub-agents fixed. It achieves perfect AIME accuracy in forced mode and the best HotpotQA performance, while on GPQA-Diamond it improves over its base counterparts but remains behind Self-Refine and AFlow. Both DynaFlow execution modes surpass the strongest baseline overall by over ten percentage points. Forced execution solves all AIME questions and both modes beat the strongest PolyMATH baseline by several points. Dynamic and forced modes achieve the highest HotpotQA accuracy, exceeding the search-enabled baseline by six to seven points. On GPQA-Diamond, DynaFlow improves over its base counterparts but does not surpass Self-Refine and AFlow. Workflow training changes the pattern from mostly negative to matching or exceeding direct answering across benchmarks.
Training changes workflow execution from a mode that initially trails direct answering on many benchmarks into an effective collaboration strategy. After Stage 1, forced workflow execution reaches or exceeds the direct baseline across all six benchmarks, and further training narrows the gap between dynamic and forced modes. The final model performs similarly in dynamic and forced modes while using far fewer sub-agents when it can answer directly. Overall accuracy improves from Base to DynaFlow across all execution modes, with the largest gain in Dynamic mode. After Stage 1, Forced execution surpasses Direct within the same checkpoint by 8.73 points overall and reaches or exceeds the Base Direct reference on all six benchmarks. The Dynamic-Forced accuracy gap narrows from 10.75 percentage points at Base to 0.14 points for DynaFlow. In Dynamic mode, DynaFlow answers 47.1% of questions directly and uses about 41% fewer sub-agents than Forced execution while accuracy remains close to forced accuracy.
The experiments evaluate DynaFlow on AIME, HotpotQA, GPQA-Diamond, and PolyMATH using forced and dynamic workflow execution, where only the main agent is trained and sub-agents remain fixed. Workflow training shifts multi-agent execution from often trailing direct answering to matching or exceeding it, with DynaFlow achieving the highest overall accuracy and surpassing the strongest baseline by more than ten percentage points in both execution modes. DynaFlow reaches perfect AIME accuracy in forced mode and the best HotpotQA accuracy, while on GPQA-Diamond it improves over base counterparts but remains behind Self-Refine and AFlow. After Stage 1, forced execution already exceeds direct answering on all six benchmarks, and the final model closes the dynamic-forced accuracy gap while dynamic mode answers 47.1 percent of questions directly and uses about 41 percent fewer sub-agents.