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.
1The University of Hong Kong · School of Artificial Intelligence, Jiangxi Science and Technology Normal University · 3The Hong Kong University of Science and Technology +2