先说结论
AFlow让一个优化模型反复修改可执行工作流,在验证任务上运行并保留搜索经验。搜索树的节点是完整流程,而不是一次模型调用。它在所测推理、问答和代码任务上优于给定基线,但仍需要评价函数、搜索预算和人工提供的操作积木,跨底座转移也不是无损的。 (原文:PDF p.5, Figure 3;PDF p.6, Sections 3.2–4;PDF p.8, Implementation Details; Metrics;PDF p.8, Table 1;PDF p.9, Table 2;PDF p.6, Initialization; Tasks Scope)
指标:手写工作流必须决定先生成、何时检查、怎样汇总。AFlow把这些调用关系写成代码,使优化器不仅改一句提示,还能增加、删除或重接步骤。树上的一个候选代表整套流程,执行后才知道它在任务上得多少分,不能把搜索树和流程内部调用图混为一谈。
条件:本地全文 arXiv:2410.10762v4,Figure 3;条件及比较对象见陈述
PDF p.5, Figure 3 · PDF p.5
Published as a conference paper at ICLR 2025 Search Space Search via AFLOW Search Result Node Math Workflow Soft Mixed Fixed Parameters LLM-Based Expansion Task Probability Selection Model Temperature Solution Generate Output Format Simplify Refine Detail Variable Parameters PROMPT = """ Think step by step and then answer the question. m m Question: {question} Solution """ n if max N rounds or Question-Answering Workflow no improvement Operators Identity Global Check Test Format Programmer Task Performance Ensemble CodeGenerate Fact Check Review&Revise Experience Executing Analysis ContextualGenerate Backpropagation Evaluation Format Code Represented Edges Answer def __call__(self, …): init_response = await self.generate(…) response = await self.custom(…) Code Generation Workflow if response == 'False': … m m else: Experience Task … return final_response n n … Candidate Workflow Execute True if … else … False performance False Selected Workflow if … True Solution else … Expanded Workflow Fix Code Figure 3: Overall AF LOW framework: By setting a search space composed of nodes with only prompt parameters flexible, a given operator set, and a code representing edge, AF LOW performs an MCTS-based search within this space. Through a variant of MCTS designed for workflow op- timization, AF LOW iteratively executes a cycle of Soft Mixed Probability Selection, LLM-Based Expansion, Execution Evaluation, and Experience Backpropagation until reaching the maximum number of iterations or meeting convergence criteria. S = {(N , E) | E ∈ E}, where N = {N (M, τ, P, F ) | M ∈ M, τ ∈ [0, 1], P ∈ P, F ∈ F}, with M, P, F, E representing the sets of possible language models, prompts, output formats, and edge configurations, respectively. With this formulation, the workflow optimization problem can be expressed as: W = A(S, G, T ), W ∗ = arg max G(W, T ), W ∈S where A is the search algorithm that explores the search space S, and W ∗ is the optimal workflow configuration that maximizes the evaluation function G for the given task T . 3.2 AF LOW OVERVIEW Limitations of Previous Methods Previous approaches Yüksekgönül et al. (2024); Khattab et al. (2024); Zhuge et al. (2024) to workflow optimization have primarily been constrained by the limited scope of their search spaces, based on problem definition in Section 3.1. Another related work, ADAS (Hu et al., 2024), searches in a larger space comprising a combination of prompts N (P, T ) and edges E, but fails to discover effective workflows due to the efficiency limitations of its linear heuristic search algorithm. Formulation To address the limitations of previous methods, we propose AF LOW, a novel frame- work that leverages Large Language Models (LLMs) as optimizers within a variant of Monte Carlo Tree Search (MCTS) to search for optimal workflows. As discussed in Section 3.1, edges can be represented in both graphs and code. To ensure AFLOW can explore the full range of possible agen- tic workflows, we represent nodes N and edges E through code. Specifically, as shown in Figure 3, 5
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
指标:实际搜索固定模型、温度和输出格式,主要修改提示与代码连接。预设操作包括生成、测试、审阅修改、汇总等,也可用基础操作自行构造。循环依次选择旧流程、用模型扩展、执行评价、回传经验;允许重新从空模板探索,以免一直沿局部路径修改。
条件:本地全文 arXiv:2410.10762v4,Sections 3.2–4;条件及比较对象见陈述
PDF p.6, Sections 3.2–4 · PDF p.6
Published as a conference paper at ICLR 2025 AF LOW uses a variant of MCTS to iteratively explore the workflow search space, evaluate different configurations, and backpropagate experiences to refine the workflow optimization process. To enhance search efficiency in practice, we simplify the search space by fixing key parameters such as the model M , temperature τ , and format F . This simplification allows AF LOW to focus its search primarily on the code-represented edges E and prompts. To navigate this still vast search space effectively, we introduce the concept of Operators. These Operators encapsulate common agentic operations (e.g., Ensemble, Review, Revise) by combining N and E into unified interfaces, thereby enabling more efficient utilization by AF LOW. By employing these Operators, we achieve more efficient search and streamlined workflow generation. Formally, given a set of Operators O that represents predefined node combinations, and an edge space E represented through code, the optimization problem can be formalized as: SAFlow = {(P1 , . . . , Pn , E, O1 , . . . , On ) | Pi ∈ P, E ∈ E, Oi ∈ O} (1) W ∗ = AF LOW(SAFlow , G, T ) (2) Tasks Scope and Operations In this paper, we focus on applying AF LOW to reasoning tasks with numerical evaluation functions. We extract common operations from existing literature and define them as part of the operator set O. These operations include: (1) Generate, (2) Format, (3) Review and Revise Madaan et al. (2023), (4) Ensemble Wang et al. (2022), (5) Test Zhong et al. (2024a), (6) Programmer, and (7) Custom as the default operator for basic node construction. The operator set O can be easily expanded to enhance search efficiency for various tasks. Even without any predefined operators, AF LOW can construct different workflow nodes using the basic Custom operator. The efficiency comparison between these approaches is detailed in Section 5.2. For a comprehensive understanding of the operators, we provide their detailed structures in Appendix A.4. 4 T HE D ESIGN D ETAILS OF AF LOW The core concept of AF LOW is to employ Large Language Models (LLMs) as optimizers within a Monte Carlo Tree Search (MCTS) variant to discover effective workflows. In our MCTS structure, each tree node represents a complete workflow rather than individual LLM-invoking node, enabling the discovery of universal solutions for classes of problems. The search process operates through an iterative cycle of soft mixed probability selection, LLM-based optimization expansion, execution evaluation, and experience backpropagation until reaching maximum iterations or conver- gence criteria. A simplified illustration is shown in Figure 3, with detailed algorithm process and theoretical analysis presented in Appendix A.6 and Appendix G, respectively. Existing workflow optimization methods iteratively use past workflow structures to prompt LLMs to discover new structures. However, due to information loss during accumulation (as input tokens increase), this approach struggles to guide LLMs towards specific performance metrics. Combined with the vast search space of code, this reduces search efficiency. Our key idea is to leverage the tree structure of MCTS to preserve workflow-based exploration experiences in Nmax rounds workflow optimization. When a workflow is revisited, we accurately reuse past successful experiences and avoid failures, enabling effective workflow generation and improving search efficiency. To prevent local optima, we introduce a special selection mechanism allowing generation from a blank template at any round. Next, we will introduce the complete process of AF LOW, as shown in Algorithm 1. Initialization AF LOW begins with a template workflow W0 , which provides a framework for invok- ing nodes and operators. The code template, detailed in Appendix A.3, allows the LLM optimizer to complete workflow simply by completing call functions. Prior to initiating the search process, we randomly partition the dataset into a validation set (20%) and a test set (80%), with the random seed fixed at 42. To optimize computational efficiency, AF LOW then executes the blank template five times on the validation dataset. From these executions, we select a subset of problems that exhibit high variance in scores, which becomes the final validation set. Selection Our algorithm forms the initial workflow by evaluating an empty workflow on the val- idation set. And then continuously select workflows based on a soft mixed probability selection strategy. cWe propose this strategy for workflow optimization: combining uniform and score-based 6
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
指标:优化器与执行器分开:前者提出流程,后者真正解题。主表用相同执行底座,比较直接调用、思维链、重复采样、审阅及其他自动搜索。数学看解题率,代码看通过率,问答看F1;平均值汇总的是不同任务指标,不能读成统一现实任务成功率。
条件:本地全文 arXiv:2410.10762v4,Implementation Details; Metrics;条件及比较对象见陈述
PDF p.8, Implementation Details; Metrics · PDF p.8
Published as a conference paper at ICLR 2025 et al., 2024a) in selecting 617 problems from four typical problem types (Combinatorics & Proba- bility, Number Theory, Pre-algebra, Pre-calculus) at difficulty level 5. Baselines We compare workflow discovered by AF LOW against manually designed methods for LLMs, including IO (direct LLM invocation), Chain-of-Thought (Wei et al., 2022), Self Consis- tency CoT (5 answers) (Wang et al., 2022), MultiPersona Debate (Wang et al., 2024a), Self-Refine (max 3 iteration rounds) (Madaan et al., 2023), and MedPrompt (3 answers and 5 votes) (Nori et al., 2023). We also compared against workflow designed by automated workflow optimization method ADAS (Hu et al., 2024). Implementation Details AF LOW utilizes different models for optimization and execution. We employ Claude-3.5-sonnet (Anthropic, 2024) as the optimizer and use models: DeepSeek- V2.5 (Deepseek, 2024), GPT-4o-mini-0718 (OpenAI, 2024b), Claude-3.5-sonnet-0620 (Anthropic, 2024), GPT-4o-0513 (OpenAI, 2024a)) as executors. All models are accessed via APIs. We set the temperature to 1 for DeepSeek-V2.5 and to 0 for the other models. We set iteration rounds to 20 for AF LOW. For ADAS, we use Claude-3.5-sonnet as the optimizer and GPT-4o-mini as the executor, with the iteration rounds set to 30. Metrics. For GSM8K and MATHlv5∗ , we report the Solve Rate (%) as the primary metric. For HumanEval and MBPP, we report the pass@1 metric as presented in (Chen et al., 2021) to assess code accuracy. For HotpotQA and DROP, we report the F1 Score. Additionally, for all datasets, we calculate the cost by tracking token usage to construct a pareto front, visually demonstrating the performance-cost trade-offs between different methods. 5.2 E XPERIMENTAL R ESULTS AND A NALYSIS Main Results The main experimental results, as shown in Table 1, demonstrate the effectiveness of AF LOW. Workflows optimized by AF LOW outperform all manually designed methods by an aver- age of 5.7% and surpass contemporary automatic workflow optimization work by 19.5%. Across six datasets in QA, Code, and Math domains, AF LOW achieves an average performance of 80.3%, marking the capability and usability of this method. Notably, compared to similar works, AF LOW performed better on more challenging tasks, improving over ADAS on MATHlv5∗ and MBPP tasks by 57%, showcasing the robustness of the model on complex datasets. Table 1: Comparison of performance between manually designed methods and workflow generated by automated workflow optimization methods in QA, code, and Math scenarios. All methods are executed with GPT-4o-mini on divided test set, and we tested it three times and reported it on the average. Benchmarks Method Avg. HotpotQA DROP HumanEval MBPP GSM8K MATH IO (GPT-4o-mini) 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 (5-shot) (Wang et al., 2022) 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., 2024a) 69.2 74.4 89.3 73.6 92.8 50.8 75.1 Self Refine (Madaan et al., 2023) 60.8 70.2 87.8 69.8 89.6 46.1 70.7 ADAS (Hu et al., 2024) 64.5 76.6 82.4 53.4 90.8 35.4 67.2 Ours 73.5 80.6 94.7 83.4 93.5 56.2 80.3 To explore whether the workflow searched by AF LOW is model-agnostic, we use GPT-4o-mini and DeepSeek-V2.5 as execution LLMs to search effective workflows with different structures, with the results illustrated in Table 2. When applying these workflows to other models, the vast ma- jority demonstrate stronger performance than the baseline, showcasing the generalizability of the workflows discovered by AF LOW. Simultaneously, we observe that the workflow identified using DeepSeek-V2.5 performs notably weaker on GPT-4o-mini compared to the workflow found using GPT-4o-mini itself. This suggests that different language models require different workflows to achieve their optimal performance. Cost Analysis We demonstrate the comparison of performance and cost between the baselines and the top three workflows found by AF LOW using GPT-4o-mini and DeepSeek-V2.5 as execution LLMs. The comparison is made across four models with different capabilities and price points. 8
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
指标:主表HumanEval中,AFlow为94.7,CoT自一致性为91.6,ADAS为82.4;MBPP对应83.4、73.6、53.4。表注说明在划分后的测试集重复测试并汇报均值。这支持该设定下搜索出的流程更有效,但不能把优势全部当作免费推理收益,搜索本身也耗费模型调用。
条件:本地全文 arXiv:2410.10762v4,Table 1;条件及比较对象见陈述
PDF p.8, Table 1 · PDF p.8
Published as a conference paper at ICLR 2025 et al., 2024a) in selecting 617 problems from four typical problem types (Combinatorics & Proba- bility, Number Theory, Pre-algebra, Pre-calculus) at difficulty level 5. Baselines We compare workflow discovered by AF LOW against manually designed methods for LLMs, including IO (direct LLM invocation), Chain-of-Thought (Wei et al., 2022), Self Consis- tency CoT (5 answers) (Wang et al., 2022), MultiPersona Debate (Wang et al., 2024a), Self-Refine (max 3 iteration rounds) (Madaan et al., 2023), and MedPrompt (3 answers and 5 votes) (Nori et al., 2023). We also compared against workflow designed by automated workflow optimization method ADAS (Hu et al., 2024). Implementation Details AF LOW utilizes different models for optimization and execution. We employ Claude-3.5-sonnet (Anthropic, 2024) as the optimizer and use models: DeepSeek- V2.5 (Deepseek, 2024), GPT-4o-mini-0718 (OpenAI, 2024b), Claude-3.5-sonnet-0620 (Anthropic, 2024), GPT-4o-0513 (OpenAI, 2024a)) as executors. All models are accessed via APIs. We set the temperature to 1 for DeepSeek-V2.5 and to 0 for the other models. We set iteration rounds to 20 for AF LOW. For ADAS, we use Claude-3.5-sonnet as the optimizer and GPT-4o-mini as the executor, with the iteration rounds set to 30. Metrics. For GSM8K and MATHlv5∗ , we report the Solve Rate (%) as the primary metric. For HumanEval and MBPP, we report the pass@1 metric as presented in (Chen et al., 2021) to assess code accuracy. For HotpotQA and DROP, we report the F1 Score. Additionally, for all datasets, we calculate the cost by tracking token usage to construct a pareto front, visually demonstrating the performance-cost trade-offs between different methods. 5.2 E XPERIMENTAL R ESULTS AND A NALYSIS Main Results The main experimental results, as shown in Table 1, demonstrate the effectiveness of AF LOW. Workflows optimized by AF LOW outperform all manually designed methods by an aver- age of 5.7% and surpass contemporary automatic workflow optimization work by 19.5%. Across six datasets in QA, Code, and Math domains, AF LOW achieves an average performance of 80.3%, marking the capability and usability of this method. Notably, compared to similar works, AF LOW performed better on more challenging tasks, improving over ADAS on MATHlv5∗ and MBPP tasks by 57%, showcasing the robustness of the model on complex datasets. Table 1: Comparison of performance between manually designed methods and workflow generated by automated workflow optimization methods in QA, code, and Math scenarios. All methods are executed with GPT-4o-mini on divided test set, and we tested it three times and reported it on the average. Benchmarks Method Avg. HotpotQA DROP HumanEval MBPP GSM8K MATH IO (GPT-4o-mini) 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 (5-shot) (Wang et al., 2022) 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., 2024a) 69.2 74.4 89.3 73.6 92.8 50.8 75.1 Self Refine (Madaan et al., 2023) 60.8 70.2 87.8 69.8 89.6 46.1 70.7 ADAS (Hu et al., 2024) 64.5 76.6 82.4 53.4 90.8 35.4 67.2 Ours 73.5 80.6 94.7 83.4 93.5 56.2 80.3 To explore whether the workflow searched by AF LOW is model-agnostic, we use GPT-4o-mini and DeepSeek-V2.5 as execution LLMs to search effective workflows with different structures, with the results illustrated in Table 2. When applying these workflows to other models, the vast ma- jority demonstrate stronger performance than the baseline, showcasing the generalizability of the workflows discovered by AF LOW. Simultaneously, we observe that the workflow identified using DeepSeek-V2.5 performs notably weaker on GPT-4o-mini compared to the workflow found using GPT-4o-mini itself. This suggests that different language models require different workflows to achieve their optimal performance. Cost Analysis We demonstrate the comparison of performance and cost between the baselines and the top three workflows found by AF LOW using GPT-4o-mini and DeepSeek-V2.5 as execution LLMs. The comparison is made across four models with different capabilities and price points. 8
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
指标:把DeepSeek执行器上搜到的流程转给GPT-4o-mini,HumanEval为90.8,低于在该执行器自身搜索的94.7,也低于CoT自一致性的91.6。流程可以迁移不等于迁移后总是更好,更不能只保存一个“最优流程”就对所有底座通用。
条件:本地全文 arXiv:2410.10762v4,Table 2;条件及比较对象见陈述
PDF p.9, Table 2 · PDF p.9
Published as a conference paper at ICLR 2025 Table 2: Comparison of performance between manually designed methods and workflows generated by AF LOW with two executor LLM: GPT-4o-mini (“Ours”) and DeepSeek-V2.5 (“Ours*”). All workflows are tested thrice on the humaneval test set, with average results reported. “MP” denotes “MedPrompt” (Nori et al., 2023), and “MPD” denotes “MultiPersona Debate” (Wang et al., 2024a). The results demonstrate that workflows obtained through AF LOW exhibit strong transferability. Methods Model IO CoT CoT SC MP MPD SR Ours Ours∗ GPT-4o-mini 87.0 88.6 91.6 91.6 89.3 87.8 94.7 90.8 DeepSeek-V2.5 88.6 89.3 88.6 88.6 89.3 90.0 93.9 94.7 GPT-4o 93.9 93.1 94.7 93.9 94.7 91.6 96.2 95.4 Claude-3.5-sonnet 90.8 92.4 93.9 91.6 90.8 89.3 95.4 94.7 Scatter Plot with Pareto Front of HumanEval pass@1 (%) Cost ($) in Log Scale Figure 4: The cost refers to the total expense of executing the divided HumanEval test set. AF LOW (execution model) refers to workflows found by AF LOW using the execution model to obtain feed- back. The colors in the legend represent the LLM used to execute each workflow in test dataset. The specific numerical values for this Figure can be found in Appendix D. Results demonstrate that AF LOW can identify workflows that allow weaker models to outperform stronger models on the pareto front of cost-effectiveness. This breakthrough effectively removes barriers to the widespread application of agentic workflows across various domains. By automating the design of effective agentic workflows, AF LOW eliminates the human labor costs previously required. Moreover, the ability to achieve superior performance at lower costs compared to stronger models opens up further possibilities for widespread adoption. Ablation Study We introduce operators as human-designed effort to enhance search efficiency. An ablation study on GSM8K (Figure 5) shows that operators help AF LOW discover better workflows more efficiently, achieving incremental improvements. Notably, even without operators, AF LOW maintains strong performance (93.1%), surpassing manual designs. Notably, AF LOW autonomously develops ensemble-like structures without operators, demonstrating its capability for independent workflow design and marking a significant step towards full automation. Details is shown in Ap- pendix B. Case Study AF LOW demonstrates a clear iteration process, as shown in Figure 6, illustrating how it evolves from a blank template (containing only a single Node without prompts) to the structure presented in Figure 5(B). In each iteration, AF LOW employs a single-step modification, meaning it either adds one operator (rounds 2, 3) or makes a targeted modification to a prompt (rounds 8, 10). Among the unsuccessful exploration rounds, AF LOW introduced a custom review node that directly modified answers generated through complex processes without additional reasoning (round 5), which decreased accuracy. In round 14, AF LOW attempted to rephrase the problem but overly focused on “discount” information, leading to a decrease in accuracy. This iteration process showcases how tree-based search allows AF LOW to further optimize known paths while retaining 9
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
指标:方法依赖可数值评价的任务,并用验证反馈引导反复搜索。作者还筛选初始流程表现波动较大的验证问题以节约计算。它不是直接证明开放式写作也能自动找到好流程;评价信号、验证集构造和操作集合都是结论的条件。
条件:本地全文 arXiv:2410.10762v4,Initialization; Tasks Scope;条件及比较对象见陈述
PDF p.6, Initialization; Tasks Scope · PDF p.6
Published as a conference paper at ICLR 2025 AF LOW uses a variant of MCTS to iteratively explore the workflow search space, evaluate different configurations, and backpropagate experiences to refine the workflow optimization process. To enhance search efficiency in practice, we simplify the search space by fixing key parameters such as the model M , temperature τ , and format F . This simplification allows AF LOW to focus its search primarily on the code-represented edges E and prompts. To navigate this still vast search space effectively, we introduce the concept of Operators. These Operators encapsulate common agentic operations (e.g., Ensemble, Review, Revise) by combining N and E into unified interfaces, thereby enabling more efficient utilization by AF LOW. By employing these Operators, we achieve more efficient search and streamlined workflow generation. Formally, given a set of Operators O that represents predefined node combinations, and an edge space E represented through code, the optimization problem can be formalized as: SAFlow = {(P1 , . . . , Pn , E, O1 , . . . , On ) | Pi ∈ P, E ∈ E, Oi ∈ O} (1) W ∗ = AF LOW(SAFlow , G, T ) (2) Tasks Scope and Operations In this paper, we focus on applying AF LOW to reasoning tasks with numerical evaluation functions. We extract common operations from existing literature and define them as part of the operator set O. These operations include: (1) Generate, (2) Format, (3) Review and Revise Madaan et al. (2023), (4) Ensemble Wang et al. (2022), (5) Test Zhong et al. (2024a), (6) Programmer, and (7) Custom as the default operator for basic node construction. The operator set O can be easily expanded to enhance search efficiency for various tasks. Even without any predefined operators, AF LOW can construct different workflow nodes using the basic Custom operator. The efficiency comparison between these approaches is detailed in Section 5.2. For a comprehensive understanding of the operators, we provide their detailed structures in Appendix A.4. 4 T HE D ESIGN D ETAILS OF AF LOW The core concept of AF LOW is to employ Large Language Models (LLMs) as optimizers within a Monte Carlo Tree Search (MCTS) variant to discover effective workflows. In our MCTS structure, each tree node represents a complete workflow rather than individual LLM-invoking node, enabling the discovery of universal solutions for classes of problems. The search process operates through an iterative cycle of soft mixed probability selection, LLM-based optimization expansion, execution evaluation, and experience backpropagation until reaching maximum iterations or conver- gence criteria. A simplified illustration is shown in Figure 3, with detailed algorithm process and theoretical analysis presented in Appendix A.6 and Appendix G, respectively. Existing workflow optimization methods iteratively use past workflow structures to prompt LLMs to discover new structures. However, due to information loss during accumulation (as input tokens increase), this approach struggles to guide LLMs towards specific performance metrics. Combined with the vast search space of code, this reduces search efficiency. Our key idea is to leverage the tree structure of MCTS to preserve workflow-based exploration experiences in Nmax rounds workflow optimization. When a workflow is revisited, we accurately reuse past successful experiences and avoid failures, enabling effective workflow generation and improving search efficiency. To prevent local optima, we introduce a special selection mechanism allowing generation from a blank template at any round. Next, we will introduce the complete process of AF LOW, as shown in Algorithm 1. Initialization AF LOW begins with a template workflow W0 , which provides a framework for invok- ing nodes and operators. The code template, detailed in Appendix A.3, allows the LLM optimizer to complete workflow simply by completing call functions. Prior to initiating the search process, we randomly partition the dataset into a validation set (20%) and a test set (80%), with the random seed fixed at 42. To optimize computational efficiency, AF LOW then executes the blank template five times on the validation dataset. From these executions, we select a subset of problems that exhibit high variance in scores, which becomes the final validation set. Selection Our algorithm forms the initial workflow by evaluating an empty workflow on the val- idation set. And then continuously select workflows based on a soft mixed probability selection strategy. cWe propose this strategy for workflow optimization: combining uniform and score-based 6
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
论文为什么要做这件事
手写工作流必须决定先生成、何时检查、怎样汇总。AFlow把这些调用关系写成代码,使优化器不仅改一句提示,还能增加、删除或重接步骤。树上的一个候选代表整套流程,执行后才知道它在任务上得多少分,不能把搜索树和流程内部调用图混为一谈。 (原文:PDF p.5, Figure 3)
指标:手写工作流必须决定先生成、何时检查、怎样汇总。AFlow把这些调用关系写成代码,使优化器不仅改一句提示,还能增加、删除或重接步骤。树上的一个候选代表整套流程,执行后才知道它在任务上得多少分,不能把搜索树和流程内部调用图混为一谈。
条件:本地全文 arXiv:2410.10762v4,Figure 3;条件及比较对象见陈述
PDF p.5, Figure 3 · PDF p.5
Published as a conference paper at ICLR 2025 Search Space Search via AFLOW Search Result Node Math Workflow Soft Mixed Fixed Parameters LLM-Based Expansion Task Probability Selection Model Temperature Solution Generate Output Format Simplify Refine Detail Variable Parameters PROMPT = """ Think step by step and then answer the question. m m Question: {question} Solution """ n if max N rounds or Question-Answering Workflow no improvement Operators Identity Global Check Test Format Programmer Task Performance Ensemble CodeGenerate Fact Check Review&Revise Experience Executing Analysis ContextualGenerate Backpropagation Evaluation Format Code Represented Edges Answer def __call__(self, …): init_response = await self.generate(…) response = await self.custom(…) Code Generation Workflow if response == 'False': … m m else: Experience Task … return final_response n n … Candidate Workflow Execute True if … else … False performance False Selected Workflow if … True Solution else … Expanded Workflow Fix Code Figure 3: Overall AF LOW framework: By setting a search space composed of nodes with only prompt parameters flexible, a given operator set, and a code representing edge, AF LOW performs an MCTS-based search within this space. Through a variant of MCTS designed for workflow op- timization, AF LOW iteratively executes a cycle of Soft Mixed Probability Selection, LLM-Based Expansion, Execution Evaluation, and Experience Backpropagation until reaching the maximum number of iterations or meeting convergence criteria. S = {(N , E) | E ∈ E}, where N = {N (M, τ, P, F ) | M ∈ M, τ ∈ [0, 1], P ∈ P, F ∈ F}, with M, P, F, E representing the sets of possible language models, prompts, output formats, and edge configurations, respectively. With this formulation, the workflow optimization problem can be expressed as: W = A(S, G, T ), W ∗ = arg max G(W, T ), W ∈S where A is the search algorithm that explores the search space S, and W ∗ is the optimal workflow configuration that maximizes the evaluation function G for the given task T . 3.2 AF LOW OVERVIEW Limitations of Previous Methods Previous approaches Yüksekgönül et al. (2024); Khattab et al. (2024); Zhuge et al. (2024) to workflow optimization have primarily been constrained by the limited scope of their search spaces, based on problem definition in Section 3.1. Another related work, ADAS (Hu et al., 2024), searches in a larger space comprising a combination of prompts N (P, T ) and edges E, but fails to discover effective workflows due to the efficiency limitations of its linear heuristic search algorithm. Formulation To address the limitations of previous methods, we propose AF LOW, a novel frame- work that leverages Large Language Models (LLMs) as optimizers within a variant of Monte Carlo Tree Search (MCTS) to search for optimal workflows. As discussed in Section 3.1, edges can be represented in both graphs and code. To ensure AFLOW can explore the full range of possible agen- tic workflows, we represent nodes N and edges E through code. Specifically, as shown in Figure 3, 5
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
核心方法到底怎么运转
实际搜索固定模型、温度和输出格式,主要修改提示与代码连接。预设操作包括生成、测试、审阅修改、汇总等,也可用基础操作自行构造。循环依次选择旧流程、用模型扩展、执行评价、回传经验;允许重新从空模板探索,以免一直沿局部路径修改。 (原文:PDF p.6, Sections 3.2–4)
指标:实际搜索固定模型、温度和输出格式,主要修改提示与代码连接。预设操作包括生成、测试、审阅修改、汇总等,也可用基础操作自行构造。循环依次选择旧流程、用模型扩展、执行评价、回传经验;允许重新从空模板探索,以免一直沿局部路径修改。
条件:本地全文 arXiv:2410.10762v4,Sections 3.2–4;条件及比较对象见陈述
PDF p.6, Sections 3.2–4 · PDF p.6
Published as a conference paper at ICLR 2025 AF LOW uses a variant of MCTS to iteratively explore the workflow search space, evaluate different configurations, and backpropagate experiences to refine the workflow optimization process. To enhance search efficiency in practice, we simplify the search space by fixing key parameters such as the model M , temperature τ , and format F . This simplification allows AF LOW to focus its search primarily on the code-represented edges E and prompts. To navigate this still vast search space effectively, we introduce the concept of Operators. These Operators encapsulate common agentic operations (e.g., Ensemble, Review, Revise) by combining N and E into unified interfaces, thereby enabling more efficient utilization by AF LOW. By employing these Operators, we achieve more efficient search and streamlined workflow generation. Formally, given a set of Operators O that represents predefined node combinations, and an edge space E represented through code, the optimization problem can be formalized as: SAFlow = {(P1 , . . . , Pn , E, O1 , . . . , On ) | Pi ∈ P, E ∈ E, Oi ∈ O} (1) W ∗ = AF LOW(SAFlow , G, T ) (2) Tasks Scope and Operations In this paper, we focus on applying AF LOW to reasoning tasks with numerical evaluation functions. We extract common operations from existing literature and define them as part of the operator set O. These operations include: (1) Generate, (2) Format, (3) Review and Revise Madaan et al. (2023), (4) Ensemble Wang et al. (2022), (5) Test Zhong et al. (2024a), (6) Programmer, and (7) Custom as the default operator for basic node construction. The operator set O can be easily expanded to enhance search efficiency for various tasks. Even without any predefined operators, AF LOW can construct different workflow nodes using the basic Custom operator. The efficiency comparison between these approaches is detailed in Section 5.2. For a comprehensive understanding of the operators, we provide their detailed structures in Appendix A.4. 4 T HE D ESIGN D ETAILS OF AF LOW The core concept of AF LOW is to employ Large Language Models (LLMs) as optimizers within a Monte Carlo Tree Search (MCTS) variant to discover effective workflows. In our MCTS structure, each tree node represents a complete workflow rather than individual LLM-invoking node, enabling the discovery of universal solutions for classes of problems. The search process operates through an iterative cycle of soft mixed probability selection, LLM-based optimization expansion, execution evaluation, and experience backpropagation until reaching maximum iterations or conver- gence criteria. A simplified illustration is shown in Figure 3, with detailed algorithm process and theoretical analysis presented in Appendix A.6 and Appendix G, respectively. Existing workflow optimization methods iteratively use past workflow structures to prompt LLMs to discover new structures. However, due to information loss during accumulation (as input tokens increase), this approach struggles to guide LLMs towards specific performance metrics. Combined with the vast search space of code, this reduces search efficiency. Our key idea is to leverage the tree structure of MCTS to preserve workflow-based exploration experiences in Nmax rounds workflow optimization. When a workflow is revisited, we accurately reuse past successful experiences and avoid failures, enabling effective workflow generation and improving search efficiency. To prevent local optima, we introduce a special selection mechanism allowing generation from a blank template at any round. Next, we will introduce the complete process of AF LOW, as shown in Algorithm 1. Initialization AF LOW begins with a template workflow W0 , which provides a framework for invok- ing nodes and operators. The code template, detailed in Appendix A.3, allows the LLM optimizer to complete workflow simply by completing call functions. Prior to initiating the search process, we randomly partition the dataset into a validation set (20%) and a test set (80%), with the random seed fixed at 42. To optimize computational efficiency, AF LOW then executes the blank template five times on the validation dataset. From these executions, we select a subset of problems that exhibit high variance in scores, which becomes the final validation set. Selection Our algorithm forms the initial workflow by evaluating an empty workflow on the val- idation set. And then continuously select workflows based on a soft mixed probability selection strategy. cWe propose this strategy for workflow optimization: combining uniform and score-based 6
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
解释性例子:代码题先生成答案,再运行测试;某候选增加一个修复步骤,另一候选让两个答案投票。搜索器比较整套流程在验证题上的效果,而不是凭流程图看起来复杂就选它。
解释性推断,不能当作论文直接支持的主张。
实验怎样检验这个方法
优化器与执行器分开:前者提出流程,后者真正解题。主表用相同执行底座,比较直接调用、思维链、重复采样、审阅及其他自动搜索。数学看解题率,代码看通过率,问答看F1;平均值汇总的是不同任务指标,不能读成统一现实任务成功率。 (原文:PDF p.8, Implementation Details; Metrics)
指标:优化器与执行器分开:前者提出流程,后者真正解题。主表用相同执行底座,比较直接调用、思维链、重复采样、审阅及其他自动搜索。数学看解题率,代码看通过率,问答看F1;平均值汇总的是不同任务指标,不能读成统一现实任务成功率。
条件:本地全文 arXiv:2410.10762v4,Implementation Details; Metrics;条件及比较对象见陈述
PDF p.8, Implementation Details; Metrics · PDF p.8
Published as a conference paper at ICLR 2025 et al., 2024a) in selecting 617 problems from four typical problem types (Combinatorics & Proba- bility, Number Theory, Pre-algebra, Pre-calculus) at difficulty level 5. Baselines We compare workflow discovered by AF LOW against manually designed methods for LLMs, including IO (direct LLM invocation), Chain-of-Thought (Wei et al., 2022), Self Consis- tency CoT (5 answers) (Wang et al., 2022), MultiPersona Debate (Wang et al., 2024a), Self-Refine (max 3 iteration rounds) (Madaan et al., 2023), and MedPrompt (3 answers and 5 votes) (Nori et al., 2023). We also compared against workflow designed by automated workflow optimization method ADAS (Hu et al., 2024). Implementation Details AF LOW utilizes different models for optimization and execution. We employ Claude-3.5-sonnet (Anthropic, 2024) as the optimizer and use models: DeepSeek- V2.5 (Deepseek, 2024), GPT-4o-mini-0718 (OpenAI, 2024b), Claude-3.5-sonnet-0620 (Anthropic, 2024), GPT-4o-0513 (OpenAI, 2024a)) as executors. All models are accessed via APIs. We set the temperature to 1 for DeepSeek-V2.5 and to 0 for the other models. We set iteration rounds to 20 for AF LOW. For ADAS, we use Claude-3.5-sonnet as the optimizer and GPT-4o-mini as the executor, with the iteration rounds set to 30. Metrics. For GSM8K and MATHlv5∗ , we report the Solve Rate (%) as the primary metric. For HumanEval and MBPP, we report the pass@1 metric as presented in (Chen et al., 2021) to assess code accuracy. For HotpotQA and DROP, we report the F1 Score. Additionally, for all datasets, we calculate the cost by tracking token usage to construct a pareto front, visually demonstrating the performance-cost trade-offs between different methods. 5.2 E XPERIMENTAL R ESULTS AND A NALYSIS Main Results The main experimental results, as shown in Table 1, demonstrate the effectiveness of AF LOW. Workflows optimized by AF LOW outperform all manually designed methods by an aver- age of 5.7% and surpass contemporary automatic workflow optimization work by 19.5%. Across six datasets in QA, Code, and Math domains, AF LOW achieves an average performance of 80.3%, marking the capability and usability of this method. Notably, compared to similar works, AF LOW performed better on more challenging tasks, improving over ADAS on MATHlv5∗ and MBPP tasks by 57%, showcasing the robustness of the model on complex datasets. Table 1: Comparison of performance between manually designed methods and workflow generated by automated workflow optimization methods in QA, code, and Math scenarios. All methods are executed with GPT-4o-mini on divided test set, and we tested it three times and reported it on the average. Benchmarks Method Avg. HotpotQA DROP HumanEval MBPP GSM8K MATH IO (GPT-4o-mini) 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 (5-shot) (Wang et al., 2022) 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., 2024a) 69.2 74.4 89.3 73.6 92.8 50.8 75.1 Self Refine (Madaan et al., 2023) 60.8 70.2 87.8 69.8 89.6 46.1 70.7 ADAS (Hu et al., 2024) 64.5 76.6 82.4 53.4 90.8 35.4 67.2 Ours 73.5 80.6 94.7 83.4 93.5 56.2 80.3 To explore whether the workflow searched by AF LOW is model-agnostic, we use GPT-4o-mini and DeepSeek-V2.5 as execution LLMs to search effective workflows with different structures, with the results illustrated in Table 2. When applying these workflows to other models, the vast ma- jority demonstrate stronger performance than the baseline, showcasing the generalizability of the workflows discovered by AF LOW. Simultaneously, we observe that the workflow identified using DeepSeek-V2.5 performs notably weaker on GPT-4o-mini compared to the workflow found using GPT-4o-mini itself. This suggests that different language models require different workflows to achieve their optimal performance. Cost Analysis We demonstrate the comparison of performance and cost between the baselines and the top three workflows found by AF LOW using GPT-4o-mini and DeepSeek-V2.5 as execution LLMs. The comparison is made across four models with different capabilities and price points. 8
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
结果说明了什么
主表HumanEval中,AFlow为94.7,CoT自一致性为91.6,ADAS为82.4;MBPP对应83.4、73.6、53.4。表注说明在划分后的测试集重复测试并汇报均值。这支持该设定下搜索出的流程更有效,但不能把优势全部当作免费推理收益,搜索本身也耗费模型调用。 (原文:PDF p.8, Table 1)
指标:主表HumanEval中,AFlow为94.7,CoT自一致性为91.6,ADAS为82.4;MBPP对应83.4、73.6、53.4。表注说明在划分后的测试集重复测试并汇报均值。这支持该设定下搜索出的流程更有效,但不能把优势全部当作免费推理收益,搜索本身也耗费模型调用。
条件:本地全文 arXiv:2410.10762v4,Table 1;条件及比较对象见陈述
PDF p.8, Table 1 · PDF p.8
Published as a conference paper at ICLR 2025 et al., 2024a) in selecting 617 problems from four typical problem types (Combinatorics & Proba- bility, Number Theory, Pre-algebra, Pre-calculus) at difficulty level 5. Baselines We compare workflow discovered by AF LOW against manually designed methods for LLMs, including IO (direct LLM invocation), Chain-of-Thought (Wei et al., 2022), Self Consis- tency CoT (5 answers) (Wang et al., 2022), MultiPersona Debate (Wang et al., 2024a), Self-Refine (max 3 iteration rounds) (Madaan et al., 2023), and MedPrompt (3 answers and 5 votes) (Nori et al., 2023). We also compared against workflow designed by automated workflow optimization method ADAS (Hu et al., 2024). Implementation Details AF LOW utilizes different models for optimization and execution. We employ Claude-3.5-sonnet (Anthropic, 2024) as the optimizer and use models: DeepSeek- V2.5 (Deepseek, 2024), GPT-4o-mini-0718 (OpenAI, 2024b), Claude-3.5-sonnet-0620 (Anthropic, 2024), GPT-4o-0513 (OpenAI, 2024a)) as executors. All models are accessed via APIs. We set the temperature to 1 for DeepSeek-V2.5 and to 0 for the other models. We set iteration rounds to 20 for AF LOW. For ADAS, we use Claude-3.5-sonnet as the optimizer and GPT-4o-mini as the executor, with the iteration rounds set to 30. Metrics. For GSM8K and MATHlv5∗ , we report the Solve Rate (%) as the primary metric. For HumanEval and MBPP, we report the pass@1 metric as presented in (Chen et al., 2021) to assess code accuracy. For HotpotQA and DROP, we report the F1 Score. Additionally, for all datasets, we calculate the cost by tracking token usage to construct a pareto front, visually demonstrating the performance-cost trade-offs between different methods. 5.2 E XPERIMENTAL R ESULTS AND A NALYSIS Main Results The main experimental results, as shown in Table 1, demonstrate the effectiveness of AF LOW. Workflows optimized by AF LOW outperform all manually designed methods by an aver- age of 5.7% and surpass contemporary automatic workflow optimization work by 19.5%. Across six datasets in QA, Code, and Math domains, AF LOW achieves an average performance of 80.3%, marking the capability and usability of this method. Notably, compared to similar works, AF LOW performed better on more challenging tasks, improving over ADAS on MATHlv5∗ and MBPP tasks by 57%, showcasing the robustness of the model on complex datasets. Table 1: Comparison of performance between manually designed methods and workflow generated by automated workflow optimization methods in QA, code, and Math scenarios. All methods are executed with GPT-4o-mini on divided test set, and we tested it three times and reported it on the average. Benchmarks Method Avg. HotpotQA DROP HumanEval MBPP GSM8K MATH IO (GPT-4o-mini) 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 (5-shot) (Wang et al., 2022) 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., 2024a) 69.2 74.4 89.3 73.6 92.8 50.8 75.1 Self Refine (Madaan et al., 2023) 60.8 70.2 87.8 69.8 89.6 46.1 70.7 ADAS (Hu et al., 2024) 64.5 76.6 82.4 53.4 90.8 35.4 67.2 Ours 73.5 80.6 94.7 83.4 93.5 56.2 80.3 To explore whether the workflow searched by AF LOW is model-agnostic, we use GPT-4o-mini and DeepSeek-V2.5 as execution LLMs to search effective workflows with different structures, with the results illustrated in Table 2. When applying these workflows to other models, the vast ma- jority demonstrate stronger performance than the baseline, showcasing the generalizability of the workflows discovered by AF LOW. Simultaneously, we observe that the workflow identified using DeepSeek-V2.5 performs notably weaker on GPT-4o-mini compared to the workflow found using GPT-4o-mini itself. This suggests that different language models require different workflows to achieve their optimal performance. Cost Analysis We demonstrate the comparison of performance and cost between the baselines and the top three workflows found by AF LOW using GPT-4o-mini and DeepSeek-V2.5 as execution LLMs. The comparison is made across four models with different capabilities and price points. 8
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
把DeepSeek执行器上搜到的流程转给GPT-4o-mini,HumanEval为90.8,低于在该执行器自身搜索的94.7,也低于CoT自一致性的91.6。流程可以迁移不等于迁移后总是更好,更不能只保存一个“最优流程”就对所有底座通用。 (原文:PDF p.9, Table 2)
指标:把DeepSeek执行器上搜到的流程转给GPT-4o-mini,HumanEval为90.8,低于在该执行器自身搜索的94.7,也低于CoT自一致性的91.6。流程可以迁移不等于迁移后总是更好,更不能只保存一个“最优流程”就对所有底座通用。
条件:本地全文 arXiv:2410.10762v4,Table 2;条件及比较对象见陈述
PDF p.9, Table 2 · PDF p.9
Published as a conference paper at ICLR 2025 Table 2: Comparison of performance between manually designed methods and workflows generated by AF LOW with two executor LLM: GPT-4o-mini (“Ours”) and DeepSeek-V2.5 (“Ours*”). All workflows are tested thrice on the humaneval test set, with average results reported. “MP” denotes “MedPrompt” (Nori et al., 2023), and “MPD” denotes “MultiPersona Debate” (Wang et al., 2024a). The results demonstrate that workflows obtained through AF LOW exhibit strong transferability. Methods Model IO CoT CoT SC MP MPD SR Ours Ours∗ GPT-4o-mini 87.0 88.6 91.6 91.6 89.3 87.8 94.7 90.8 DeepSeek-V2.5 88.6 89.3 88.6 88.6 89.3 90.0 93.9 94.7 GPT-4o 93.9 93.1 94.7 93.9 94.7 91.6 96.2 95.4 Claude-3.5-sonnet 90.8 92.4 93.9 91.6 90.8 89.3 95.4 94.7 Scatter Plot with Pareto Front of HumanEval pass@1 (%) Cost ($) in Log Scale Figure 4: The cost refers to the total expense of executing the divided HumanEval test set. AF LOW (execution model) refers to workflows found by AF LOW using the execution model to obtain feed- back. The colors in the legend represent the LLM used to execute each workflow in test dataset. The specific numerical values for this Figure can be found in Appendix D. Results demonstrate that AF LOW can identify workflows that allow weaker models to outperform stronger models on the pareto front of cost-effectiveness. This breakthrough effectively removes barriers to the widespread application of agentic workflows across various domains. By automating the design of effective agentic workflows, AF LOW eliminates the human labor costs previously required. Moreover, the ability to achieve superior performance at lower costs compared to stronger models opens up further possibilities for widespread adoption. Ablation Study We introduce operators as human-designed effort to enhance search efficiency. An ablation study on GSM8K (Figure 5) shows that operators help AF LOW discover better workflows more efficiently, achieving incremental improvements. Notably, even without operators, AF LOW maintains strong performance (93.1%), surpassing manual designs. Notably, AF LOW autonomously develops ensemble-like structures without operators, demonstrating its capability for independent workflow design and marking a significant step towards full automation. Details is shown in Ap- pendix B. Case Study AF LOW demonstrates a clear iteration process, as shown in Figure 6, illustrating how it evolves from a blank template (containing only a single Node without prompts) to the structure presented in Figure 5(B). In each iteration, AF LOW employs a single-step modification, meaning it either adds one operator (rounds 2, 3) or makes a targeted modification to a prompt (rounds 8, 10). Among the unsuccessful exploration rounds, AF LOW introduced a custom review node that directly modified answers generated through complex processes without additional reasoning (round 5), which decreased accuracy. In round 14, AF LOW attempted to rephrase the problem but overly focused on “discount” information, leading to a decrease in accuracy. This iteration process showcases how tree-based search allows AF LOW to further optimize known paths while retaining 9
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
这篇论文哪里最强,哪里最危险
方法依赖可数值评价的任务,并用验证反馈引导反复搜索。作者还筛选初始流程表现波动较大的验证问题以节约计算。它不是直接证明开放式写作也能自动找到好流程;评价信号、验证集构造和操作集合都是结论的条件。 (原文:PDF p.6, Initialization; Tasks Scope)
指标:方法依赖可数值评价的任务,并用验证反馈引导反复搜索。作者还筛选初始流程表现波动较大的验证问题以节约计算。它不是直接证明开放式写作也能自动找到好流程;评价信号、验证集构造和操作集合都是结论的条件。
条件:本地全文 arXiv:2410.10762v4,Initialization; Tasks Scope;条件及比较对象见陈述
PDF p.6, Initialization; Tasks Scope · PDF p.6
Published as a conference paper at ICLR 2025 AF LOW uses a variant of MCTS to iteratively explore the workflow search space, evaluate different configurations, and backpropagate experiences to refine the workflow optimization process. To enhance search efficiency in practice, we simplify the search space by fixing key parameters such as the model M , temperature τ , and format F . This simplification allows AF LOW to focus its search primarily on the code-represented edges E and prompts. To navigate this still vast search space effectively, we introduce the concept of Operators. These Operators encapsulate common agentic operations (e.g., Ensemble, Review, Revise) by combining N and E into unified interfaces, thereby enabling more efficient utilization by AF LOW. By employing these Operators, we achieve more efficient search and streamlined workflow generation. Formally, given a set of Operators O that represents predefined node combinations, and an edge space E represented through code, the optimization problem can be formalized as: SAFlow = {(P1 , . . . , Pn , E, O1 , . . . , On ) | Pi ∈ P, E ∈ E, Oi ∈ O} (1) W ∗ = AF LOW(SAFlow , G, T ) (2) Tasks Scope and Operations In this paper, we focus on applying AF LOW to reasoning tasks with numerical evaluation functions. We extract common operations from existing literature and define them as part of the operator set O. These operations include: (1) Generate, (2) Format, (3) Review and Revise Madaan et al. (2023), (4) Ensemble Wang et al. (2022), (5) Test Zhong et al. (2024a), (6) Programmer, and (7) Custom as the default operator for basic node construction. The operator set O can be easily expanded to enhance search efficiency for various tasks. Even without any predefined operators, AF LOW can construct different workflow nodes using the basic Custom operator. The efficiency comparison between these approaches is detailed in Section 5.2. For a comprehensive understanding of the operators, we provide their detailed structures in Appendix A.4. 4 T HE D ESIGN D ETAILS OF AF LOW The core concept of AF LOW is to employ Large Language Models (LLMs) as optimizers within a Monte Carlo Tree Search (MCTS) variant to discover effective workflows. In our MCTS structure, each tree node represents a complete workflow rather than individual LLM-invoking node, enabling the discovery of universal solutions for classes of problems. The search process operates through an iterative cycle of soft mixed probability selection, LLM-based optimization expansion, execution evaluation, and experience backpropagation until reaching maximum iterations or conver- gence criteria. A simplified illustration is shown in Figure 3, with detailed algorithm process and theoretical analysis presented in Appendix A.6 and Appendix G, respectively. Existing workflow optimization methods iteratively use past workflow structures to prompt LLMs to discover new structures. However, due to information loss during accumulation (as input tokens increase), this approach struggles to guide LLMs towards specific performance metrics. Combined with the vast search space of code, this reduces search efficiency. Our key idea is to leverage the tree structure of MCTS to preserve workflow-based exploration experiences in Nmax rounds workflow optimization. When a workflow is revisited, we accurately reuse past successful experiences and avoid failures, enabling effective workflow generation and improving search efficiency. To prevent local optima, we introduce a special selection mechanism allowing generation from a blank template at any round. Next, we will introduce the complete process of AF LOW, as shown in Algorithm 1. Initialization AF LOW begins with a template workflow W0 , which provides a framework for invok- ing nodes and operators. The code template, detailed in Appendix A.3, allows the LLM optimizer to complete workflow simply by completing call functions. Prior to initiating the search process, we randomly partition the dataset into a validation set (20%) and a test set (80%), with the random seed fixed at 42. To optimize computational efficiency, AF LOW then executes the blank template five times on the validation dataset. From these executions, we select a subset of problems that exhibit high variance in scores, which becomes the final validation set. Selection Our algorithm forms the initial workflow by evaluating an empty workflow on the val- idation set. And then continuously select workflows based on a soft mixed probability selection strategy. cWe propose this strategy for workflow optimization: combining uniform and score-based 6
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
代码从哪里读
已核验作者代码仓库可以访问。先从项目说明核对版本、运行环境与输入格式,再决定是否复现。本次未安装、运行作者代码,也没有验证复现成功。
读完后记住这三件事
搜索的对象是可执行工作流;用验证集反馈选择修改;换执行模型后原有优势不一定保留。 (原文:PDF p.5, Figure 3;PDF p.6, Sections 3.2–4;PDF p.8, Implementation Details; Metrics;PDF p.8, Table 1;PDF p.9, Table 2;PDF p.6, Initialization; Tasks Scope)
指标:手写工作流必须决定先生成、何时检查、怎样汇总。AFlow把这些调用关系写成代码,使优化器不仅改一句提示,还能增加、删除或重接步骤。树上的一个候选代表整套流程,执行后才知道它在任务上得多少分,不能把搜索树和流程内部调用图混为一谈。
条件:本地全文 arXiv:2410.10762v4,Figure 3;条件及比较对象见陈述
PDF p.5, Figure 3 · PDF p.5
Published as a conference paper at ICLR 2025 Search Space Search via AFLOW Search Result Node Math Workflow Soft Mixed Fixed Parameters LLM-Based Expansion Task Probability Selection Model Temperature Solution Generate Output Format Simplify Refine Detail Variable Parameters PROMPT = """ Think step by step and then answer the question. m m Question: {question} Solution """ n if max N rounds or Question-Answering Workflow no improvement Operators Identity Global Check Test Format Programmer Task Performance Ensemble CodeGenerate Fact Check Review&Revise Experience Executing Analysis ContextualGenerate Backpropagation Evaluation Format Code Represented Edges Answer def __call__(self, …): init_response = await self.generate(…) response = await self.custom(…) Code Generation Workflow if response == 'False': … m m else: Experience Task … return final_response n n … Candidate Workflow Execute True if … else … False performance False Selected Workflow if … True Solution else … Expanded Workflow Fix Code Figure 3: Overall AF LOW framework: By setting a search space composed of nodes with only prompt parameters flexible, a given operator set, and a code representing edge, AF LOW performs an MCTS-based search within this space. Through a variant of MCTS designed for workflow op- timization, AF LOW iteratively executes a cycle of Soft Mixed Probability Selection, LLM-Based Expansion, Execution Evaluation, and Experience Backpropagation until reaching the maximum number of iterations or meeting convergence criteria. S = {(N , E) | E ∈ E}, where N = {N (M, τ, P, F ) | M ∈ M, τ ∈ [0, 1], P ∈ P, F ∈ F}, with M, P, F, E representing the sets of possible language models, prompts, output formats, and edge configurations, respectively. With this formulation, the workflow optimization problem can be expressed as: W = A(S, G, T ), W ∗ = arg max G(W, T ), W ∈S where A is the search algorithm that explores the search space S, and W ∗ is the optimal workflow configuration that maximizes the evaluation function G for the given task T . 3.2 AF LOW OVERVIEW Limitations of Previous Methods Previous approaches Yüksekgönül et al. (2024); Khattab et al. (2024); Zhuge et al. (2024) to workflow optimization have primarily been constrained by the limited scope of their search spaces, based on problem definition in Section 3.1. Another related work, ADAS (Hu et al., 2024), searches in a larger space comprising a combination of prompts N (P, T ) and edges E, but fails to discover effective workflows due to the efficiency limitations of its linear heuristic search algorithm. Formulation To address the limitations of previous methods, we propose AF LOW, a novel frame- work that leverages Large Language Models (LLMs) as optimizers within a variant of Monte Carlo Tree Search (MCTS) to search for optimal workflows. As discussed in Section 3.1, edges can be represented in both graphs and code. To ensure AFLOW can explore the full range of possible agen- tic workflows, we represent nodes N and edges E through code. Specifically, as shown in Figure 3, 5
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
指标:实际搜索固定模型、温度和输出格式,主要修改提示与代码连接。预设操作包括生成、测试、审阅修改、汇总等,也可用基础操作自行构造。循环依次选择旧流程、用模型扩展、执行评价、回传经验;允许重新从空模板探索,以免一直沿局部路径修改。
条件:本地全文 arXiv:2410.10762v4,Sections 3.2–4;条件及比较对象见陈述
PDF p.6, Sections 3.2–4 · PDF p.6
Published as a conference paper at ICLR 2025 AF LOW uses a variant of MCTS to iteratively explore the workflow search space, evaluate different configurations, and backpropagate experiences to refine the workflow optimization process. To enhance search efficiency in practice, we simplify the search space by fixing key parameters such as the model M , temperature τ , and format F . This simplification allows AF LOW to focus its search primarily on the code-represented edges E and prompts. To navigate this still vast search space effectively, we introduce the concept of Operators. These Operators encapsulate common agentic operations (e.g., Ensemble, Review, Revise) by combining N and E into unified interfaces, thereby enabling more efficient utilization by AF LOW. By employing these Operators, we achieve more efficient search and streamlined workflow generation. Formally, given a set of Operators O that represents predefined node combinations, and an edge space E represented through code, the optimization problem can be formalized as: SAFlow = {(P1 , . . . , Pn , E, O1 , . . . , On ) | Pi ∈ P, E ∈ E, Oi ∈ O} (1) W ∗ = AF LOW(SAFlow , G, T ) (2) Tasks Scope and Operations In this paper, we focus on applying AF LOW to reasoning tasks with numerical evaluation functions. We extract common operations from existing literature and define them as part of the operator set O. These operations include: (1) Generate, (2) Format, (3) Review and Revise Madaan et al. (2023), (4) Ensemble Wang et al. (2022), (5) Test Zhong et al. (2024a), (6) Programmer, and (7) Custom as the default operator for basic node construction. The operator set O can be easily expanded to enhance search efficiency for various tasks. Even without any predefined operators, AF LOW can construct different workflow nodes using the basic Custom operator. The efficiency comparison between these approaches is detailed in Section 5.2. For a comprehensive understanding of the operators, we provide their detailed structures in Appendix A.4. 4 T HE D ESIGN D ETAILS OF AF LOW The core concept of AF LOW is to employ Large Language Models (LLMs) as optimizers within a Monte Carlo Tree Search (MCTS) variant to discover effective workflows. In our MCTS structure, each tree node represents a complete workflow rather than individual LLM-invoking node, enabling the discovery of universal solutions for classes of problems. The search process operates through an iterative cycle of soft mixed probability selection, LLM-based optimization expansion, execution evaluation, and experience backpropagation until reaching maximum iterations or conver- gence criteria. A simplified illustration is shown in Figure 3, with detailed algorithm process and theoretical analysis presented in Appendix A.6 and Appendix G, respectively. Existing workflow optimization methods iteratively use past workflow structures to prompt LLMs to discover new structures. However, due to information loss during accumulation (as input tokens increase), this approach struggles to guide LLMs towards specific performance metrics. Combined with the vast search space of code, this reduces search efficiency. Our key idea is to leverage the tree structure of MCTS to preserve workflow-based exploration experiences in Nmax rounds workflow optimization. When a workflow is revisited, we accurately reuse past successful experiences and avoid failures, enabling effective workflow generation and improving search efficiency. To prevent local optima, we introduce a special selection mechanism allowing generation from a blank template at any round. Next, we will introduce the complete process of AF LOW, as shown in Algorithm 1. Initialization AF LOW begins with a template workflow W0 , which provides a framework for invok- ing nodes and operators. The code template, detailed in Appendix A.3, allows the LLM optimizer to complete workflow simply by completing call functions. Prior to initiating the search process, we randomly partition the dataset into a validation set (20%) and a test set (80%), with the random seed fixed at 42. To optimize computational efficiency, AF LOW then executes the blank template five times on the validation dataset. From these executions, we select a subset of problems that exhibit high variance in scores, which becomes the final validation set. Selection Our algorithm forms the initial workflow by evaluating an empty workflow on the val- idation set. And then continuously select workflows based on a soft mixed probability selection strategy. cWe propose this strategy for workflow optimization: combining uniform and score-based 6
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
指标:优化器与执行器分开:前者提出流程,后者真正解题。主表用相同执行底座,比较直接调用、思维链、重复采样、审阅及其他自动搜索。数学看解题率,代码看通过率,问答看F1;平均值汇总的是不同任务指标,不能读成统一现实任务成功率。
条件:本地全文 arXiv:2410.10762v4,Implementation Details; Metrics;条件及比较对象见陈述
PDF p.8, Implementation Details; Metrics · PDF p.8
Published as a conference paper at ICLR 2025 et al., 2024a) in selecting 617 problems from four typical problem types (Combinatorics & Proba- bility, Number Theory, Pre-algebra, Pre-calculus) at difficulty level 5. Baselines We compare workflow discovered by AF LOW against manually designed methods for LLMs, including IO (direct LLM invocation), Chain-of-Thought (Wei et al., 2022), Self Consis- tency CoT (5 answers) (Wang et al., 2022), MultiPersona Debate (Wang et al., 2024a), Self-Refine (max 3 iteration rounds) (Madaan et al., 2023), and MedPrompt (3 answers and 5 votes) (Nori et al., 2023). We also compared against workflow designed by automated workflow optimization method ADAS (Hu et al., 2024). Implementation Details AF LOW utilizes different models for optimization and execution. We employ Claude-3.5-sonnet (Anthropic, 2024) as the optimizer and use models: DeepSeek- V2.5 (Deepseek, 2024), GPT-4o-mini-0718 (OpenAI, 2024b), Claude-3.5-sonnet-0620 (Anthropic, 2024), GPT-4o-0513 (OpenAI, 2024a)) as executors. All models are accessed via APIs. We set the temperature to 1 for DeepSeek-V2.5 and to 0 for the other models. We set iteration rounds to 20 for AF LOW. For ADAS, we use Claude-3.5-sonnet as the optimizer and GPT-4o-mini as the executor, with the iteration rounds set to 30. Metrics. For GSM8K and MATHlv5∗ , we report the Solve Rate (%) as the primary metric. For HumanEval and MBPP, we report the pass@1 metric as presented in (Chen et al., 2021) to assess code accuracy. For HotpotQA and DROP, we report the F1 Score. Additionally, for all datasets, we calculate the cost by tracking token usage to construct a pareto front, visually demonstrating the performance-cost trade-offs between different methods. 5.2 E XPERIMENTAL R ESULTS AND A NALYSIS Main Results The main experimental results, as shown in Table 1, demonstrate the effectiveness of AF LOW. Workflows optimized by AF LOW outperform all manually designed methods by an aver- age of 5.7% and surpass contemporary automatic workflow optimization work by 19.5%. Across six datasets in QA, Code, and Math domains, AF LOW achieves an average performance of 80.3%, marking the capability and usability of this method. Notably, compared to similar works, AF LOW performed better on more challenging tasks, improving over ADAS on MATHlv5∗ and MBPP tasks by 57%, showcasing the robustness of the model on complex datasets. Table 1: Comparison of performance between manually designed methods and workflow generated by automated workflow optimization methods in QA, code, and Math scenarios. All methods are executed with GPT-4o-mini on divided test set, and we tested it three times and reported it on the average. Benchmarks Method Avg. HotpotQA DROP HumanEval MBPP GSM8K MATH IO (GPT-4o-mini) 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 (5-shot) (Wang et al., 2022) 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., 2024a) 69.2 74.4 89.3 73.6 92.8 50.8 75.1 Self Refine (Madaan et al., 2023) 60.8 70.2 87.8 69.8 89.6 46.1 70.7 ADAS (Hu et al., 2024) 64.5 76.6 82.4 53.4 90.8 35.4 67.2 Ours 73.5 80.6 94.7 83.4 93.5 56.2 80.3 To explore whether the workflow searched by AF LOW is model-agnostic, we use GPT-4o-mini and DeepSeek-V2.5 as execution LLMs to search effective workflows with different structures, with the results illustrated in Table 2. When applying these workflows to other models, the vast ma- jority demonstrate stronger performance than the baseline, showcasing the generalizability of the workflows discovered by AF LOW. Simultaneously, we observe that the workflow identified using DeepSeek-V2.5 performs notably weaker on GPT-4o-mini compared to the workflow found using GPT-4o-mini itself. This suggests that different language models require different workflows to achieve their optimal performance. Cost Analysis We demonstrate the comparison of performance and cost between the baselines and the top three workflows found by AF LOW using GPT-4o-mini and DeepSeek-V2.5 as execution LLMs. The comparison is made across four models with different capabilities and price points. 8
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
指标:主表HumanEval中,AFlow为94.7,CoT自一致性为91.6,ADAS为82.4;MBPP对应83.4、73.6、53.4。表注说明在划分后的测试集重复测试并汇报均值。这支持该设定下搜索出的流程更有效,但不能把优势全部当作免费推理收益,搜索本身也耗费模型调用。
条件:本地全文 arXiv:2410.10762v4,Table 1;条件及比较对象见陈述
PDF p.8, Table 1 · PDF p.8
Published as a conference paper at ICLR 2025 et al., 2024a) in selecting 617 problems from four typical problem types (Combinatorics & Proba- bility, Number Theory, Pre-algebra, Pre-calculus) at difficulty level 5. Baselines We compare workflow discovered by AF LOW against manually designed methods for LLMs, including IO (direct LLM invocation), Chain-of-Thought (Wei et al., 2022), Self Consis- tency CoT (5 answers) (Wang et al., 2022), MultiPersona Debate (Wang et al., 2024a), Self-Refine (max 3 iteration rounds) (Madaan et al., 2023), and MedPrompt (3 answers and 5 votes) (Nori et al., 2023). We also compared against workflow designed by automated workflow optimization method ADAS (Hu et al., 2024). Implementation Details AF LOW utilizes different models for optimization and execution. We employ Claude-3.5-sonnet (Anthropic, 2024) as the optimizer and use models: DeepSeek- V2.5 (Deepseek, 2024), GPT-4o-mini-0718 (OpenAI, 2024b), Claude-3.5-sonnet-0620 (Anthropic, 2024), GPT-4o-0513 (OpenAI, 2024a)) as executors. All models are accessed via APIs. We set the temperature to 1 for DeepSeek-V2.5 and to 0 for the other models. We set iteration rounds to 20 for AF LOW. For ADAS, we use Claude-3.5-sonnet as the optimizer and GPT-4o-mini as the executor, with the iteration rounds set to 30. Metrics. For GSM8K and MATHlv5∗ , we report the Solve Rate (%) as the primary metric. For HumanEval and MBPP, we report the pass@1 metric as presented in (Chen et al., 2021) to assess code accuracy. For HotpotQA and DROP, we report the F1 Score. Additionally, for all datasets, we calculate the cost by tracking token usage to construct a pareto front, visually demonstrating the performance-cost trade-offs between different methods. 5.2 E XPERIMENTAL R ESULTS AND A NALYSIS Main Results The main experimental results, as shown in Table 1, demonstrate the effectiveness of AF LOW. Workflows optimized by AF LOW outperform all manually designed methods by an aver- age of 5.7% and surpass contemporary automatic workflow optimization work by 19.5%. Across six datasets in QA, Code, and Math domains, AF LOW achieves an average performance of 80.3%, marking the capability and usability of this method. Notably, compared to similar works, AF LOW performed better on more challenging tasks, improving over ADAS on MATHlv5∗ and MBPP tasks by 57%, showcasing the robustness of the model on complex datasets. Table 1: Comparison of performance between manually designed methods and workflow generated by automated workflow optimization methods in QA, code, and Math scenarios. All methods are executed with GPT-4o-mini on divided test set, and we tested it three times and reported it on the average. Benchmarks Method Avg. HotpotQA DROP HumanEval MBPP GSM8K MATH IO (GPT-4o-mini) 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 (5-shot) (Wang et al., 2022) 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., 2024a) 69.2 74.4 89.3 73.6 92.8 50.8 75.1 Self Refine (Madaan et al., 2023) 60.8 70.2 87.8 69.8 89.6 46.1 70.7 ADAS (Hu et al., 2024) 64.5 76.6 82.4 53.4 90.8 35.4 67.2 Ours 73.5 80.6 94.7 83.4 93.5 56.2 80.3 To explore whether the workflow searched by AF LOW is model-agnostic, we use GPT-4o-mini and DeepSeek-V2.5 as execution LLMs to search effective workflows with different structures, with the results illustrated in Table 2. When applying these workflows to other models, the vast ma- jority demonstrate stronger performance than the baseline, showcasing the generalizability of the workflows discovered by AF LOW. Simultaneously, we observe that the workflow identified using DeepSeek-V2.5 performs notably weaker on GPT-4o-mini compared to the workflow found using GPT-4o-mini itself. This suggests that different language models require different workflows to achieve their optimal performance. Cost Analysis We demonstrate the comparison of performance and cost between the baselines and the top three workflows found by AF LOW using GPT-4o-mini and DeepSeek-V2.5 as execution LLMs. The comparison is made across four models with different capabilities and price points. 8
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
指标:把DeepSeek执行器上搜到的流程转给GPT-4o-mini,HumanEval为90.8,低于在该执行器自身搜索的94.7,也低于CoT自一致性的91.6。流程可以迁移不等于迁移后总是更好,更不能只保存一个“最优流程”就对所有底座通用。
条件:本地全文 arXiv:2410.10762v4,Table 2;条件及比较对象见陈述
PDF p.9, Table 2 · PDF p.9
Published as a conference paper at ICLR 2025 Table 2: Comparison of performance between manually designed methods and workflows generated by AF LOW with two executor LLM: GPT-4o-mini (“Ours”) and DeepSeek-V2.5 (“Ours*”). All workflows are tested thrice on the humaneval test set, with average results reported. “MP” denotes “MedPrompt” (Nori et al., 2023), and “MPD” denotes “MultiPersona Debate” (Wang et al., 2024a). The results demonstrate that workflows obtained through AF LOW exhibit strong transferability. Methods Model IO CoT CoT SC MP MPD SR Ours Ours∗ GPT-4o-mini 87.0 88.6 91.6 91.6 89.3 87.8 94.7 90.8 DeepSeek-V2.5 88.6 89.3 88.6 88.6 89.3 90.0 93.9 94.7 GPT-4o 93.9 93.1 94.7 93.9 94.7 91.6 96.2 95.4 Claude-3.5-sonnet 90.8 92.4 93.9 91.6 90.8 89.3 95.4 94.7 Scatter Plot with Pareto Front of HumanEval pass@1 (%) Cost ($) in Log Scale Figure 4: The cost refers to the total expense of executing the divided HumanEval test set. AF LOW (execution model) refers to workflows found by AF LOW using the execution model to obtain feed- back. The colors in the legend represent the LLM used to execute each workflow in test dataset. The specific numerical values for this Figure can be found in Appendix D. Results demonstrate that AF LOW can identify workflows that allow weaker models to outperform stronger models on the pareto front of cost-effectiveness. This breakthrough effectively removes barriers to the widespread application of agentic workflows across various domains. By automating the design of effective agentic workflows, AF LOW eliminates the human labor costs previously required. Moreover, the ability to achieve superior performance at lower costs compared to stronger models opens up further possibilities for widespread adoption. Ablation Study We introduce operators as human-designed effort to enhance search efficiency. An ablation study on GSM8K (Figure 5) shows that operators help AF LOW discover better workflows more efficiently, achieving incremental improvements. Notably, even without operators, AF LOW maintains strong performance (93.1%), surpassing manual designs. Notably, AF LOW autonomously develops ensemble-like structures without operators, demonstrating its capability for independent workflow design and marking a significant step towards full automation. Details is shown in Ap- pendix B. Case Study AF LOW demonstrates a clear iteration process, as shown in Figure 6, illustrating how it evolves from a blank template (containing only a single Node without prompts) to the structure presented in Figure 5(B). In each iteration, AF LOW employs a single-step modification, meaning it either adds one operator (rounds 2, 3) or makes a targeted modification to a prompt (rounds 8, 10). Among the unsuccessful exploration rounds, AF LOW introduced a custom review node that directly modified answers generated through complex processes without additional reasoning (round 5), which decreased accuracy. In round 14, AF LOW attempted to rephrase the problem but overly focused on “discount” information, leading to a decrease in accuracy. This iteration process showcases how tree-based search allows AF LOW to further optimize known paths while retaining 9
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
指标:方法依赖可数值评价的任务,并用验证反馈引导反复搜索。作者还筛选初始流程表现波动较大的验证问题以节约计算。它不是直接证明开放式写作也能自动找到好流程;评价信号、验证集构造和操作集合都是结论的条件。
条件:本地全文 arXiv:2410.10762v4,Initialization; Tasks Scope;条件及比较对象见陈述
PDF p.6, Initialization; Tasks Scope · PDF p.6
Published as a conference paper at ICLR 2025 AF LOW uses a variant of MCTS to iteratively explore the workflow search space, evaluate different configurations, and backpropagate experiences to refine the workflow optimization process. To enhance search efficiency in practice, we simplify the search space by fixing key parameters such as the model M , temperature τ , and format F . This simplification allows AF LOW to focus its search primarily on the code-represented edges E and prompts. To navigate this still vast search space effectively, we introduce the concept of Operators. These Operators encapsulate common agentic operations (e.g., Ensemble, Review, Revise) by combining N and E into unified interfaces, thereby enabling more efficient utilization by AF LOW. By employing these Operators, we achieve more efficient search and streamlined workflow generation. Formally, given a set of Operators O that represents predefined node combinations, and an edge space E represented through code, the optimization problem can be formalized as: SAFlow = {(P1 , . . . , Pn , E, O1 , . . . , On ) | Pi ∈ P, E ∈ E, Oi ∈ O} (1) W ∗ = AF LOW(SAFlow , G, T ) (2) Tasks Scope and Operations In this paper, we focus on applying AF LOW to reasoning tasks with numerical evaluation functions. We extract common operations from existing literature and define them as part of the operator set O. These operations include: (1) Generate, (2) Format, (3) Review and Revise Madaan et al. (2023), (4) Ensemble Wang et al. (2022), (5) Test Zhong et al. (2024a), (6) Programmer, and (7) Custom as the default operator for basic node construction. The operator set O can be easily expanded to enhance search efficiency for various tasks. Even without any predefined operators, AF LOW can construct different workflow nodes using the basic Custom operator. The efficiency comparison between these approaches is detailed in Section 5.2. For a comprehensive understanding of the operators, we provide their detailed structures in Appendix A.4. 4 T HE D ESIGN D ETAILS OF AF LOW The core concept of AF LOW is to employ Large Language Models (LLMs) as optimizers within a Monte Carlo Tree Search (MCTS) variant to discover effective workflows. In our MCTS structure, each tree node represents a complete workflow rather than individual LLM-invoking node, enabling the discovery of universal solutions for classes of problems. The search process operates through an iterative cycle of soft mixed probability selection, LLM-based optimization expansion, execution evaluation, and experience backpropagation until reaching maximum iterations or conver- gence criteria. A simplified illustration is shown in Figure 3, with detailed algorithm process and theoretical analysis presented in Appendix A.6 and Appendix G, respectively. Existing workflow optimization methods iteratively use past workflow structures to prompt LLMs to discover new structures. However, due to information loss during accumulation (as input tokens increase), this approach struggles to guide LLMs towards specific performance metrics. Combined with the vast search space of code, this reduces search efficiency. Our key idea is to leverage the tree structure of MCTS to preserve workflow-based exploration experiences in Nmax rounds workflow optimization. When a workflow is revisited, we accurately reuse past successful experiences and avoid failures, enabling effective workflow generation and improving search efficiency. To prevent local optima, we introduce a special selection mechanism allowing generation from a blank template at any round. Next, we will introduce the complete process of AF LOW, as shown in Algorithm 1. Initialization AF LOW begins with a template workflow W0 , which provides a framework for invok- ing nodes and operators. The code template, detailed in Appendix A.3, allows the LLM optimizer to complete workflow simply by completing call functions. Prior to initiating the search process, we randomly partition the dataset into a validation set (20%) and a test set (80%), with the random seed fixed at 42. To optimize computational efficiency, AF LOW then executes the blank template five times on the validation dataset. From these executions, we select a subset of problems that exhibit high variance in scores, which becomes the final validation set. Selection Our algorithm forms the initial workflow by evaluating an empty workflow on the val- idation set. And then continuously select workflows based on a soft mixed probability selection strategy. cWe propose this strategy for workflow optimization: combining uniform and score-based 6
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。