Organizations: School of Data Science, The Chinese University of Hong Kong, Shenzhen, China · College of Computing and Data Science, Nanyang Technological University, Singapore · Huawei Technologies Co., Ltd., China · Artificial Intelligence Thrust, The Hong Kong University of Science and Technology (Guangzhou), China
Automated agentic workflow optimization relies on costly evaluations, making it essential to allocate a limited evaluation budget effectively. Multi-parent fusion can reuse designs from previously discovered workflows, but identifying promising parent combinations requires learning from limited fusion feedback. We introduce DAGO (Directed Acyclic Graph Optimization), a contextual-bandit-guided framework that learns which parent workflows to fuse under a limited evaluation budget. DAGO formulates each candidate parent combination as an arm, represented by pretrained embeddings of its constituent workflows' code and prompts. A diagonal LinUCB policy learns a shared reward model across arms and balances exploitation of arms with high predicted offspring quality against uncertainty-driven exploration. After an arm is selected, an LLM generates a child workflow through summary-guided fusion, and the child's validation score serves as the reward for updating the bandit. A shared directed acyclic graph maintains discovered workflows and their multi-parent lineage, providing an expanding pool of parents for subsequent arm proposals. Across six benchmarks covering mathematical reasoning, code generation, and question answering, DAGO achieves the highest macro-average score among the evaluated baselines. Under matched validation-evaluation budgets, it improves over AFlow from 80.3 to 81.7 while reducing aggregate search expenditure by 11.2%. Ablation studies show that LinUCB-guided arm selection outperforms both random selection and its exploration-free variant, supporting the value of feedback-driven selection and exploration-exploitation balance.
Figures & tables
Figure 1: Overview of the DAGO framework. (a) The DAG stores workflows, validation scores, and parent lineage. (b) Annealed score sampling proposes parent combinations. (c) Diagonal LinUCB selects a combination from code-and-prompt embeddings. (d) Summary-guided fusion generates a child. Validation feedback updates LinUCB and the DAG; the highest-scoring workflow is returned.
Figure 2: Overall performance across benchmarks and average ranking. Selected methods from Table 1 , with test scores averaged over three executions. (a) Solve rate / pass@1 / F1 for math / code / QA; brackets show DAGO’s gains over AFlow in points. (b) Six-task macro averages.
QA
Code
Math
Method
HotpotQA
DROP
HumanEval
MBPP
GSM8K
MATH
Avg.
IO
68.1
68.3
87.0
71.8
92.7
48.6
72.8
CoT Wei et al. (2022)
67.9
78.5
88.6
71.8
92.4
48.8
74.7
CoT-SC Wang et al. (2023)
68.9
78.8
91.6
73.6
92.7
50.4
76.0
MedPrompt Nori et al. (2023)
68.3
78.0
91.6
73.6
90.0
50.0
75.3
MultiPersona Wang et al. (2024)
69.2
74.4
89.3
73.6
92.8
50.8
75.1
Table 1: Main results on six benchmarks. Means over three test executions (%), grouped by task category. Avg. is the six-task macro average; best scores are bold .
Figure 3: Validation best-so-far trajectory during optimization. Running best validation scores on HotpotQA, MATH, and MBPP.
Figure 5Figure 6Figure 7Table 8
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
Category
Parameter
Value
Description / usage
Budget
Initial population size N
10
Number of diverse workflows generated at initialization (inserted into the DAG before bandit-guided fusion).
Max iterations T
30
Maximum number of fusion iterations in Algorithm 1 .
Stopping window Cpatience
5
Check for a lack of relative improvement over the most recent five fusion-round validation scores.
Minimum iterations Tmin
20
Enable early stopping only after at least Tmin iterations.
Arm proposal
Candidate-arm cap M
200
Propose Mt=min{M,(J∣Vt−1∣)} distinct parent tuples in round t .
Parents per arm J
5
Number of parent workflows fused to synthesize one child.
Appendix
Table 8: DAGO hyperparameters (default unless otherwise specified).
Dataset
Domain
Val Size
Test Size
Metric
Notes
GSM8K
Math Reasoning
264
1,055
Accuracy
Grade-school word problems
MATH
Math Reasoning
119
486
Accuracy
Level 5 (hardest) problems only
HumanEval
Code Generation
33
131
Pass@1
Python function synthesis
MBPP
Code Generation
86
341
Pass@1
Mostly Basic Python Problems
HotpotQA
Question Answering
200
800
F1
Multi-hop reasoning required
DROP
Question Answering
200
800
F1
Discrete reasoning over paragraphs
Appendix
Table 9: Benchmark datasets and evaluation protocol used in our experiments (aligned with AFlow). Val Size is the fixed validation subset used for reward estimation during search (held fixed across iterations), and Test Size is the disjoint evaluation subset used for reporting final results.
Component
Parameter
Reported value
Initialization
N , qinit
10 , 1
Fusion budget
T , q , Bmax
30 , 3 , 100
Stopping
Tmin , Cpatience , δstop
20 , 5 , 10−4
Candidate cap / arm size
M , J
200 , 5
Sampling
τinit→τfinal , pmin
2.0→0.5 , 0.01
Bandit
λ , ν
0.2 , 0.1
Appendix
Table 10: Reported settings used to specify the revised procedure. The table does not introduce new tuned parameters.
Metric
GSM8K
MATH
HumanEval
MBPP
HotpotQA
DROP
Total Iterations
28
27
25
25
30
30
Early Stopped
Yes
Yes
Yes
Yes
No
No
Total DAG Nodes
38
37
35
35
40
40
Total DAG Edges
140
135
125
125
150
150
Best Initial Score
95.8%
50.4%
87.9%
83.7%
77.2%
82.9%
Best Fusion Score
95.8%
55.7%
88.9%
86.0%
79.3%
84.0%
Appendix
Table 11: DAGO optimization statistics per benchmark. Initial scores use one execution of the fixed validation split; fusion scores average three executions. Relative improvement is measured against the best initial score. Fusion-reward standard deviations describe variation across evaluated fusion nodes, not variation across independent searches or test executions.
Pattern
GSM8K
MATH
HumanEval
MBPP
HotpotQA
DROP
Multi-Solution Ensemble
✓
✓
✓
✓
✓
–
Computational Verification
✓
✓
✓
✓
–
–
Conditional Retry
–
–
✓
✓
–
–
Explicit Problem Analysis
–
–
✓
✓
✓
✓
Type-Aware Processing
–
–
–
–
–
✓
Format-Aware Generation
–
✓
✓
✓
✓
✓
Appendix
Table 12: Emergent workflow patterns discovered by DAGO across task types. ✓ indicates pattern presence.
Dataset
Best Node
Direct Parents
Unique Ancestors
Max Depth
GSM8K
11
5
5
1
MATH
15
5
5
1
HumanEval
12
5
7
2
MBPP
23
5
13
3
HotpotQA
29
5
21
7
DROP
25
5
18
7
Appendix
Table 13: Ancestral analysis of best fusion workflows. Unique ancestors counts distinct nodes in the ancestral DAG.
Statistic
GSM8K
MATH
HumanEval
MBPP
HotpotQA
DROP
Optimization Configuration
Total Iterations
28
27
25
25
30
30
Early Stopped
Yes
Yes
Yes
Yes
No
No
Stopping Trigger
Stagnation
Stagnation
Stagnation
Stagnation
Max Iter
Max Iter
DAG Statistics
Total Nodes
38
37
35
35
40
40
Appendix
Table 14: DAGO optimization statistics per benchmark. Initial scores use one validation execution; fusion scores average three. Reward-distribution statistics are computed over fusion nodes only, and Δ is measured in percentage points.
Percentile
GSM8K
MATH
HumanEval
MBPP
HotpotQA
DROP
Min (P0)
29.5%
38.7%
66.7%
0.0%
0.0%
34.6%
P25
92.8%
46.2%
84.8%
77.9%
69.2%
74.4%
Median (P50)
93.8%
48.7%
86.9%
81.0%
74.3%
79.0%
P75
94.3%
51.0%
87.9%
83.3%
75.3%
80.9%
Max (P100)
95.8%
55.7%
88.9%
86.0%
79.3%
84.0%
Appendix
Table 15: Percentiles of stored validation scores across all nodes (initial + fusion). Initial scores use one validation execution; fusion scores average three.
Dataset
Best Node
Parent IDs
Parent Scores
Unique Ancestors
Max Depth
GSM8K
11
{4,1,0,7,6}
{95.8,83.3,94.7,94.3,94.3}%
5
1
MATH
15
{1,9,2,3,4}
{44.5,42.9,46.2,50.4,38.7}%
5
1
HumanEval
12
{9,0,7,8,11}
{87.9,87.9,87.9,87.9,86.9}%
7
2
MBPP
23
{8,6,16,13,11}
{77.9,76.7,81.0,81.0,80.2}%
13
3
HotpotQA
29
{19,16,5,14,27}
{75.1,75.3,74.5,73.3,74.9}%
21
7
DROP
25
{23,14,8,9,17}
{79.3,78.5,34.6,82.9,75.6}%
18
7
Appendix
Table 16: Ancestry analysis of best-performing workflows per benchmark.
We study the generation of agentic workflows that jointly optimize multiple objectives, such as accuracy, cost, latency, robustness, and consistency. Existing methods for workflow generation typically optimize accuracy alone or a weighted sum of objectives, so each trained generator commits to one fixed trade-off and must be retrained from scratch when preferences change. To alleviate this, we propose MoFlow, which generates workflows optimized across varied preferences. Specifically, MoFlow formulates workflow generation as a multi-objective Markov decision process and solves it by leveraging Convex-Hull Monte Carlo Tree Search with optimistic set-valued backups, where every node stores a set of reachable trade-offs rather than one weighted score. A single search thus approximately covers the Pareto front, from which MoFlow can return a workflow for any preference by lookup without retraining. We evaluate MoFlow against six strong baselines on six benchmarks spanning mathematics, code, and question answering. Since the baselines are single-scalar optimizers by design, an apples-to-apples comparison is difficult. We instead adopt an evaluation setup that favors the baselines, in that they are rerun for each testing preference, which MoFlow never sees. Even under this stringent setup, MoFlow achieves the highest average hypervolume.
Large Language Model (LLM)-based multi-agent systems are increasingly powerful, but current agentic workflow optimization paradigms make an unsatisfying trade-off. Task-level methods spend substantial offline compute yet deploy only a single workflow, leaving complementary candidates unused, while query-level methods synthesize a new workflow per query at substantial inference cost. Our motivating analysis shows these paradigms are more complementary than competing: workflows discovered during offline search often solve different subsets of queries, and many queries handled by expensive query-level generation can already be solved by cheaper precomputed workflows. This suggests a different objective: rather than searching for one universally best workflow or regenerating one per instance, we should build a compact bank of reusable, complementary workflows and select among them adaptively at inference time. Doing so requires solving three coupled problems: generating complementary rather than redundant candidates, compressing them into a small deployable portfolio, and assigning each query to the right workflow under a performance-cost trade-off. To this end, we present FlowBank, a three-stage framework for portfolio-based agentic workflow optimization. Diversifying proposes DiverseFlow to steer search toward under-covered queries and produce a high-coverage candidate pool. Curating proposes CuraFlow to compress this pool into a compact portfolio with minimal redundancy. Matching casts deployment as edge-value prediction on a query-workflow bipartite graph and routes each incoming query to the portfolio member with the best predicted utility. Across five benchmarks, FlowBank achieves the highest average score among the evaluated methods while remaining cost-competitive, improving over the strongest automated and handcrafted baselines by 4.26% and 14.92% relative, respectively.
Optimizing agentic workflows, such as retrieval-augmented generation (RAG) pipelines, requires navigating a combinatorial space of discrete component choices under tight evaluation budgets. Existing approaches - heuristic search, black-box optimization, and standard tree search methods - do not explicitly exploit the compositional structure of these workflows, leading to redundant computation and inefficient budget allocation. We introduce Agent-UCT (Agent-based Cost-Aware Upper Confidence Bounds Applied to Trees), a tree search algorithm that extends UCT with a reuse-aware regularization term derived from a bipartite prefix reuse graph. Agent-UCT biases selection toward branches that leverage previously materialized configuration prefixes, reducing redundant execution while maintaining effective exploration. Our framework, RAGSpace, unifies heterogeneous RAG components from LongRAG, LightRAG, and Self-RAG into a five-dimensional configuration space, enabling systematic cross-framework recombination. WTB (Workflow Test Bench) provides deterministic replay, content-addressable caching, and transactional consistency, ensuring that intermediate states are materialized once and reused across the search. Experiments on HotpotQA and UltraDomain demonstrate that Agent-UCT identifies configurations with the highest out-of-sample performance among the evaluated fixed framework presets. Under full-pool evaluation, bipartite prefix reuse reduces logical search cost by 73.6% relative to the no-prefix-sharing cost upper bound. Compared with full-pool evaluation, sampling-based evaluation further achieves a 4.2x wall-clock speedup. Agent-UCT, RAGSpace, and WTB together provide a unified framework for cost-aware, reproducible, and compositionally efficient agentic workflow optimization.
Yang Li, Hai Liu, Dian Shao +8
1The University of Hong Kong · School of Artificial Intelligence, Jiangxi Science and Technology Normal University · 3The Hong Kong University of Science and Technology +2