DynaFlow: Training a Conductor That Writes Fresh Collaboration Code for Every Task

The researchers left the models that actually do the work untouched and trained only a conducting model that decides who handles what and how it gets reviewed. Across six benchmarks it scored 88.08% when collaboration was Forced and 87.94% when the model decided on its own (Dynamic).
← All posts
온
온틀 리서치
2026년 10월 30일 Updated 2026.11.20 38 min read views 7

Some systems tie several AI agents together to solve a single problem. Usually a human lays out the plan ahead of time: who takes on which job, and who hands results off to whom. DynaFlow, from a team at the National University of Singapore, flips that. The blueprint isn't drawn by a person — it's written by the AI itself, as actual code (a JavaScript program), freshly for every single task.

One thing stands out. The models that actually solve the problem (the sub-agents) are left alone; only a single "conducting" model — the one that splits up the work and reviews the results — gets trained. On that setup, across six benchmarks (standard problem sets that measure performance over a range of tasks), it scored 88.08% in Forced mode, where collaboration is mandatory, and 87.94% in Dynamic mode, where the model chooses whether to collaborate at all. In the Forced condition it came out 10.90 points ahead of the strongest comparison system built on the same base model. Keep in mind, though, that what they share is only the base model, and that comparison system is a no-tools baseline — so conditions like access to tools such as search were not held equal. The point worth noticing isn't the number itself; it's that this gap was produced without touching the executors at all, by training the conductor alone.

What was the problem

Systems that chain together multiple LLM (large language model) agents usually have a fixed collaboration structure. Each agent's role, who talks to whom, which stages the work passes through — all of it is baked in at design time. But the shape of collaboration a task needs varies. A simple question is fine with a single agent. Independent sub-tasks are faster run in parallel. A task that leans on an earlier step's output has to receive that output cleanly. Apply one fixed structure to every case, the authors argue, and you pile on needless communication, latency, and compute.

Plenty of work has already tried to break this rigidity, and it splits along three axes.

  • Assemble within a fixed template, or write freely? AFlow searches for effective workflows using execution feedback, while DyFlow revises using feedback but only composes within a predefined set of operator templates.
  • Decide the whole structure up front, or look at intermediate results and rethink? MAS-Orchestra expresses collaboration as function calls but commits to the whole thing before seeing any intermediate execution results. MAS-Zero, by contrast, revises the design based on intermediate results, and DyFlow likewise plans the next step from feedback.
  • What gets trained? MAS-GPT learns "per-query system generation" via supervised learning; FlowReasoner and MAS-Orchestra learn it via reinforcement learning. FlowSteer learns a graph-editing policy from feedback, and MetaAgent-X trains the designer and the executor together.

On each of these three axes, DynaFlow picks "write freely as code," "look at intermediate results and rewrite," and "leave the executors alone, train only the conductor." That last choice is the exact opposite of MetaAgent-X, which trains designer and executor jointly.

How it actually works

Say a math problem comes in. The main agent, playing conductor, picks one of three moves each turn: answer right away, use an ordinary tool (a calculator, a search engine, and so on), or write a collaboration program (a workflow) tailored to this specific problem.

For a hard problem it picks the third. For instance, it splits the work into "the one who expands the expression symbolically" and "the one who plugs in small numbers and computes," and writes code telling them to reconcile the two results. Run the program, and back come each party's intermediate results plus a record of how they got there. The conductor reads that record and decides what's next. If the one doing the computation slipped up on an intermediate expression, it doesn't lock in the answer — it issues fresh instructions to shore things up, or runs the verification one more time. Only when the results are solid enough does it produce an answer and stop.

Here's the crux. It doesn't draw the whole collaboration structure once and call it done. As the reasoning unfolds, it keeps reshaping the collaboration while watching the intermediate results.

If you want a single image for this: it's less like a manager who pulls out the same meeting template every time, and more like a conductor who writes a fresh work order on the spot for each task. Some jobs it handles alone; some it splits into two branches run in parallel; and after seeing the first round of results, it adjusts the next set of instructions.

Only the conductor is trained, in two stages

The most distinctive choice is that only the conductor (the main agent) is trained. The sub-agents that actually solve the problems are all left as-is (frozen). The idea is to reuse already-trained models as executors without retraining them, and concentrate training purely on the "conducting" ability. In fact, across every evaluation the sub-agents used the untrained base checkpoint (the bundle of model weights at a particular point in time) with no conducting training at all.

Training runs in two stages.

Stage one is learning by imitating good instruction examples. A stronger teacher model (GLM-5.3 Max) produces records of solving problems with the same tools and the same frozen sub-agents. From those, only the records where the final answer is correct and the delegation rules (the agreed-upon convention for who handles what) were followed are kept, and the conductor is trained to imitate their opening move. That said, the number of examples used here is reported inconsistently within the paper itself — 2,031 in the main text (§4) versus 2,257 in the appendix (C, Table 3) — so it's hard to pin down a single figure.

Stage two is one more round of learning, this time only on examples free of collaboration flaws. The starting observation: a correct answer doesn't mean the collaboration was done right. The paper shows cases where the conductor passes information incorrectly or makes a bad conducting call, and that leads to a wrong answer. So, even among the correct-answer examples, an LLM acting as judge filters out those with three kinds of flaws, keeping only the clean ones.

  • Premise injection: the conductor plants a claim that isn't in the problem and that determines the answer, treating it as an established fact.
  • Verification flaw: a review instruction or output constraint pushes the verifier toward a particular answer, or blocks it from checking independently.
  • Information-flow flaw: needed information fails to reach the sub-party — missing context, a wrong reference, a lossy handoff.

Every one of these flaw judgments has to come with evidence pulled from the program or the execution record. Training continues on top of the stage-one model using the 712 examples that pass this check (per Appendix E, drawn from the 2,254 examples that include a workflow).

What matters here is that collaboration quality did not replace correctness. Stage one already keeps only correct-answer examples, and only then does stage two filter within those by collaboration quality. The 712 are what's left after layering a collaboration-quality screen on top of examples that have already passed the correctness bar.

Technique note: the "imitation learning" in stage one is trajectory distillation, using teacher records as ground-truth data; the actual fine-tuning uses QLoRA, which changes only part of the model rather than all of it to save memory.

How they compared it

The results make more sense once you know the three execution modes.

  • Direct: answer immediately, no tools, no collaboration.
  • Dynamic: decide for itself whether to answer directly or call a collaboration program.
  • Forced: require it to call a collaboration program before solving the problem.

Forced strips out the "when to collaborate" judgment and looks purely at "how well does it write the collaboration." Dynamic captures the real-world ability, including the decision of "when to collaborate." Because these two are separated, you can later put a number on "does it know when to economize on collaboration."

The comparison systems all use the same base model (Qwen3.5-27B, the "backbone" from here on): CoT (writing reasoning out in steps), CoT-SC (sampling the answer 5 times and taking the majority), Self-Refine (repeatedly self-critiquing and fixing), and AFlow, an automatic multi-agent method. But these share only the base model; whether they use tools differs. CoT, CoT-SC, and Self-Refine are tool-free, reasoning-only baselines, whereas DynaFlow uses tools like computation and search depending on the task. So the aggregate accuracy difference is a comparison between "whole systems, tools included," not a comparison with tool conditions controlled. It's also worth noting that AFlow does not search for new workflows on the evaluation tasks; it reused the published MATH workflow on AIME and PolyMATH, and the HotpotQA workflow on HotpotQA and GPQA.

Overall results

Aggregate accuracy across the six benchmarks (micro-average, i.e., weighted by number of items) comes out like this.

System Accuracy
DynaFlow (Forced) 88.08%
DynaFlow (Dynamic) 87.94%
Self-Refine (strongest comparison) 77.18%

The gap under Forced is exactly 10.90 points. But don't read this number as a controlled comparison. What the three systems share is only the base backbone, and the strongest comparison, Self-Refine, is a reasoning-only baseline with no tools, whereas DynaFlow uses tools like computation and search depending on the task. The tool-access-matched comparison is handled separately below under multi-hop retrieval.

The picture differs by domain

Math is where it's strongest. The Forced run scored 100% on all three AIME sets — 2024, 2025, and 2026 — solving all 90 problems. On PolyMATH (mathematical reasoning across multiple languages), both modes beat the strongest comparison by 3 to 4 points. The authors attribute this to the generated collaboration programs splitting a math solution into derive, compute, and verify, pairing symbolic expansion with small numerical checks to catch errors in intermediate expressions.

Multi-hop retrieval (HotpotQA — question answering where the answer can't be found in one shot and has to be assembled over several steps) came out at 84.50% in Dynamic and 83.50% in Forced. There's one condition you have to look at alongside this. The task uses web search, and the tool-free comparisons don't have the same search access. So the authors set up a separate Base+Web search (77.50%) that does use search, and DynaFlow beat this search-enabled opponent by 6 to 7 points. A pattern emerged of weaving search around intermediate entities (targets like people and places) and checking that subsequent steps point to the same entity.

Science (GPQA-Diamond — graduate-level biology, chemistry, and physics) saw Forced reach 84.85%, up 7.07 points over the same model's plain Forced. But here Self-Refine (88.38%) and AFlow (87.37%) still come out ahead. Dig into the failures and you find a sub-agent's wrong intermediate conclusion misleading the later verification, or the conductor failing to foreground the correct evidence when assembling the final answer. These failures mean that even with a better collaboration structure, the problem of filtering out bad intermediate judgments remains separate.

Evaluation setup: 688 problems in total, across six benchmarks — AIME 2024, 2025, and 2026 (competition math), PolyMATH (200), GPQA-Diamond (198), and HotpotQA (200), with PolyMATH and HotpotQA sampled using seed 42. The metric is final-answer accuracy, and a run that ends without a valid answer counts as wrong. Collaboration quality is analyzed separately on four criteria (task consistency, decomposition adequacy, logical continuity, and information-flow accuracy), scored from 0 (serious flaw) to 2 (no flaw).

What training actually changed

"Enabling collaboration" and "training it to collaborate well" are not the same thing. Before training, the base model's Forced (75.87) was only slightly better than Direct (71.51), and on every benchmark except HotpotQA, bolting on a collaboration program actually dropped accuracy. In other words, before training, the "right to collaborate" wasn't itself a gain. After stage-one training, Forced reached or exceeded the base model's Direct level on all six benchmarks, coming out 8.73 points ahead of the same model's Direct overall. Collaboration isn't enough just by being "available" — it only turns into a gain once conducting is trained.

Stage two changed how information gets handled. The share of programs that pass an earlier step's output to the next party and explicitly say "use this" rose from 12.6% at baseline to 93.3% after stage one to 97.7% after stage two. Programs mixing parallel and sequential execution grew from 3.4% to 83.2% to 85.6%. Serious information-flow flaws fell from 1.9% to 0.9%, and programs that explicitly say to revise or reinforce intermediate results grew from 28.1% to 35.9%. Meanwhile the average number of sub-agents actually dropped, from 4.35 after stage one to 4.16 after stage two. All of the above improved without adding more participants.

Finally, "when to collaborate." The accuracy gap between Dynamic and Forced was 10.75 points on the base model, but narrowed to 1.02 after stage one and to 0.14 for DynaFlow. Meaning it barely matters anymore whether you force collaboration or let the model decide. DynaFlow in Dynamic mode answered 47.1% of questions directly, without collaboration, and still held 87.94%.

That's as far as the observed change goes. It moved toward answering easy questions alone and calling in collaboration only for hard ones. Whether that amounts to "cost savings" can't be settled on these numbers alone. A higher direct-answer rate could mean fewer collaboration calls, but the real cost depends on tokens per call and latency, which you'd have to measure. That data is outside this paper's scope.

Limitations and open questions

Start with the limitations the authors acknowledge. On science (GPQA) it trails Self-Refine and AFlow. As noted above, there's still the failure mode where a sub-agent's wrong intermediate conclusion misleads verification, and the authors frame this as "the importance of independent verification and reliable final-answer selection." They also point out that the base model's high "logical continuity" score isn't a sign of good performance but a consequence of being a single agent with little dependency between steps.

Two bigger concerns. First, the evaluation was done only on a single backbone (Qwen3.5-27B) and a single teacher (GLM-5.3 Max). Whether the same gap holds across other sizes and model families can't be concluded from this alone. Second, the advantage of freezing the sub-agents is reusability, but flip it over and it means the overall performance ceiling is tied to executor ability. No matter how good the conducting is, if an executor produces a wrong intermediate conclusion, recovery only happens when verification catches it. GPQA laid that limit bare.

Two open questions remain. Stage-two filtering leans on a judge LLM's verdict — so how is that judge's bias controlled? And when collaboration is dialed up, how do latency and compute cost trade off against accuracy? The operational trade-off curve hasn't been drawn yet.

How this plays at ONTLE

A scene we ran into at ONTLE. A user sent a multi-step request: "Research the material along two tracks and merge them, cross-check the figures, then produce a report." Our pipeline has the research, writing, and verification nodes fixed by hand, so this request ran the whole predetermined path too. A deliverable came out — but the figures in the report had no sources attached. The evidence the research node found hadn't made it over to the writing node intact. The answer looked plausible, but the handoff in the middle leaked. That's exactly the type DynaFlow calls an "information-flow flaw."

There's one hypothesis to take from this. Instead of only checking whether the report was correct, check — on a separate criterion — whether the intermediate handoff stayed intact, and you might catch this kind of missing-source problem before it ships. The validation can be scoped small, too. Gather past reports, score "handoff completeness" (did the evidence actually move to the next step? were the sources preserved?) with a human or a judge model, and see whether the low-scoring cases overlap with the reports that were actually wrong. If they do, attach that check as a pre-publish gate.

If we run this small experiment, the checklist narrows to this.

  • For each report, log "final-answer correctness" and "intermediate-handoff integrity" separately.
  • Check whether an earlier step's output was actually used by the next node, or whether it only "pretends to reference" it while recomputing or hardcoding.
  • Check that the verification node's prompt isn't hinting at the answer, turning verification into a rubber stamp.
  • See whether low handoff-integrity scores overlap with actual errors, and if they do, promote that check to a pre-publish gate.

Frequently asked questions

Why have it write the collaboration structure as a JavaScript program of all things?

Because a single chunk of executable code can hold both tool use and collaboration logic together. Within the code you can directly define each party's role, the sequential and parallel dependencies, and the handoff, aggregation, and verification of intermediate outputs — which makes a "free-form" composition possible, not boxed into a predefined set of operator templates.

The teacher model is stronger, so why not just use the teacher model?

Because the goal isn't a "stronger single model" but the "ability to conduct a set of frozen sub-agents." The teacher (GLM-5.3 Max) only plays the role of demonstrating good instructions; the actual executors stay frozen as untrained base checkpoints. Separating the learning of conducting from executor ability is the design intent.

How can we tell whether filtering by collaboration quality in stage two really had an effect?

The paper states that isolating the effect of the curation itself would require a control that compares the 712 collaboration-quality-selected examples against a random subset of the same size. But the results of actually training and running that random control aren't presented in this paper, so whether the selection criterion genuinely contributed remains unconfirmed in numbers for now.

References