arXiv is now an independent nonprofit! Learn more
License: arXiv.org perpetual non-exclusive license
arXiv:2502.07373v1 [cs.LG] 11 Feb 2025

EvoFlow: Evolving Diverse Agentic Workflows On The Fly

Guibin Zhang Affiliation: Tongji University Correspondence to: guibinz@outlook.com    Kaijie Chen Affiliation: Tongji University    Guancheng Wan Affiliation: Wuhan University    Heng Chang Affiliation: Tsinghua University    Hong Cheng Affiliation: The Chinese University of Hong Kong    Kun Wang Affiliation: Nanyang Technological University    Shuyue Hu Affiliation: Shanghai AI Laboratory    Lei Bai Affiliation: Shanghai AI Laboratory
Abstract

The past two years have witnessed the evolution of large language model (LLM)-based multi-agent systems from labor-intensive manual design to partial automation (e.g., prompt engineering, communication topology) and eventually to fully automated design. However, existing agentic automation pipelines often lack LLM heterogeneity and focus on single-objective performance optimization, limiting their potential to combine weaker models for more customized and cost-effective solutions. To address this challenge, we propose EvoFlow, a niching evolutionary algorithm-based framework to automatically search a population of heterogeneous and complexity-adaptive agentic workflows, rather than a single homogeneous, complex workflow. Technically, EvoFlow performs (1) tag-based retrieval to extract parent workflows from an agentic population, evolves new workflows through (2) crossover and (3) mutation, and employs (4) niching-based selection to maintain population diversity and quality. Extensive evaluations across seven benchmarks demonstrate that EvoFlow is: (I) diverse, evolving a population of workflows ranging from simple I/O tasks to complex multi-turn interactions; (II) high-performing, outperforming previous handcrafted and automated workflows by 1.23%29.86%1.23\%\sim 29.86\%; (III) economical, surpassing powerful o1-preview at 12.4%12.4\% of its inference cost using weaker open-source models. The code will be available at https://github.com/bingreeky/EvoFlow.

Keywords: 
Machine Learning, ICML
affiliationnotice: Equal contribution

1 Introduction

Large Language Model (LLM)-based agents (Richards & et al., 2023; Nakajima, 2023; Reworkd, 2023) have exhibited remarkable capabilities across a wide spectrum of tasks, including question answering (Zhu et al., 2024a), data analysis (Hong et al., 2024; Li et al., 2024), decision-making (Song et al., 2023), code generation (Shinn et al., 2023), video gaming (Wang et al., 2023), and autonomous driving (Jin et al., 2023), among others. Recent advancements further highlight that integrating single agents into agentic workflows, i.e., structured sequences of LLM-based agent interactions, can surpass the cognitive and functional limitations of individual agents (Du et al., 2023; Liang et al., 2023; Wang et al., 2023b; Jiang et al., 2023; Shinn et al., 2023; Zheng et al., 2023a; Wu et al., 2023; Zhang et al., 2024a), thereby exhibiting human-esque collaborative intelligence in multi-agent systems (Zhang et al., 2023).

Refer to caption
Figure 1: Paradigm comparison. Baseline methods seek a “one-size-fits-all” complex homogenoues workflow, while EvoFlow optimizes a Pareto set of diverse, heterogenous workflows.

The progress of machine learning consistently reveals a recurring pattern: manually crafted artifacts are often replaced by learnable and optimizable ones (Tyson & Zysman, 2022; Clune, 2019). For natural language processing (NLP), this is exemplified by the replacement of hand-designed representations like Bag-of-Words (Mikolov et al., 2013) with learned embeddings like GloVe (Pennington et al., 2014) and BERT (Devlin, 2018). Similarly, agentic systems have experienced a rapid transition from manual to automated over the past two years: Early attempts, e.g., CAMEL (Li et al., 2023), AutoGen (Wu et al., 2023), and MetaGPT (Hong et al., 2023), relied heavily on manual configurations, while follow-up works significantly reduced dependence on human intervention, like DsPy (Khattab et al., 2023) automating prompt optimization, GPTSwarm (Zhuge et al., 2024) optimizing inter-agent communication, and EvoAgent (Yuan et al., 2024) self-evolving agent profiling. More recent efforts (Hu et al., 2024b; Shang et al., 2024; Zhang et al., 2024c), have demonstrated that these automated pipelines enable the development of surprisingly creative and powerful agentic workflows, marking significant progress toward fully autonomous agentic AI. Despite their success, existing automation pipelines often lack diversity in both LLM heterogeneity and complexity scheduling:

  • Lack of LLM heterogeneity. Mainstream multi-agent workflows are often homogeneous, relying on a single, expensive LLM like GPT-3.5/GPT-4o to instantiate all agents (Zhang et al., 2024c; Chen et al., 2023a). However, as highlighted by studies on LLM routing (Chen et al., 2023c; Hu et al., 2024a), the capabilities of different LLMs are often complementary rather than forming a strict superset relationship. In certain scenarios, smaller LLMs can perform tasks comparably or even outperform their larger counterparts at a significantly lower token cost. Against this backdrop, we advocate for agentic workflows to be heterogeneous, incorporating a diverse ensemble of LLMs with varying sizes, capabilities, and sources.

  • Lack of complexity diversity. Existing automated agentic workflows often prioritize single-objective optimization, focusing on performance or solution quality. This typically results in a singular, complex workflow incorporating elements like CoT ensembles and multi-turn discussions (Hu et al., 2024b; Shang et al., 2024). However, real-world user queries vary significantly in difficulty, as exemplified by the MMLU benchmark (Hendrycks et al., 2021a), which spans tasks from elementary to graduate-level. While complex workflows are essential for the latter, simpler queries can be efficiently addressed by single-agent I/O (Feng et al., 2024). Thus, we advocate for optimizing a diverse set of workflows, tailoring simple workflows to straightforward tasks and reserving complex ones for more intricate challenges.

The above considerations and observations raise critical questions regarding the current paradigm of agentic system design: How can we automatically optimize a set of heterogeneous, complexity-adaptive agentic workflows that provide diverse solutions for varied queries?

To this end, we propose EvoFlow, a niching evolutionary algorithm (EA)-based framework for automatically searching a population of heterogeneous, complexity-adaptive agentic workflows, rather than a single, homogeneous, complex workflow. Technically, EvoFlow innovatively frames the agentic search as a multi-objective optimization problem, considering both cost and performance, ultimately generating a Pareto-optimal set of workflows balancing these factors. EvoFlow uses operator nodes, i.e., a set of LLM-agent invoking nodes, as the fundamental units of its search space. The workflow population is initialized by selecting and combining multiple operator nodes. Afterward, EvoFlow continuously evolves by processing incoming queries. It ❶ tag-based retrieves relevant workflows as parents, performs ❷ crossover to generate offspring workflows, applies ❸ mutation with extensive mutation functions, i.e., LLM/prompt/operator mutation, to evolve the offsprings. Finally, ❹ niching selection is leveraged to maintain diversity and quality in the population. During inference, EvoFlow autonomously retrieves domain-relevant and complexity-adapted agentic systems from the well-optimized population, to swiftly and efficiently address user queries.

We conduct comprehensive evaluations on six widely adopted benchmarks. In heterogeneous settings, EvoFlow surpasses powerful o1-preview at 12.4%12.4\% of its inference cost by utilizing weaker open-source models (e.g., LLaMa-3.1-70b and QWen-2.5-72b); In homogeneous settings, EvoFlow outperforms state-of-the-art (SOTA) agentic workflows by an average of 1.23%29.86%1.23\%\sim 29.86\% in performance. More importantly, EvoFlow is highly economical, with a training cost of only one-third of SOTA baseline AFlow ($0.45\$0.45 vs $1.23\$1.23) and an inference cost of merely one-fifth ($0.51\$0.51 vs $2.62\$2.62), while surpassing AFlow by 5.91%5.91\%\uparrow on the MATH Benchmark.

Briefly put, our contributions can be summarized as:

  • Paradigm Transformation. We for the first time explicitly formulate agentic workflow automation as a cost-performance multi-objective optimization problem, highlighting LLM heterogeneity and complexity diversity as key features for the development of multi-agent systems.

  • Practical Solution. We propose a niching evolutionary algorithm-based framework, EvoFlow, which autonomously evolves a population of heterogeneous and complexity-diverse agentic workflows across various task domains with minimal human intervention.

  • Emperical Evaluation. Extensive experiments on seven benchmarks show that EvoFlow is (I) diverse, evolving a workflow population ranging from simple I/O to complex multi-turn interactions; (II) high-performing, surpassing previous handcrafted and automated workflows by 1.23%29.86%1.23\%\sim 29.86\%; (III) economical, surpassing powerful o1-preview with weaker open-source models.

2 Related Work

LLM-based Autonomous Agents

Building on the success of single agent (Shen et al., 2024; Zhu et al., 2024b; Zhong et al., 2024), studies have shown that interaction among multiple LLM-based agents can substantially enhance individual model capabilities (Wang et al., 2024), as seen in several early frameworks, including CAMEL (Li et al., 2023), AutoGen (Wu et al., 2023), BabyAGI (Nakajima, 2023), and LLM-Debate (Du et al., 2023). However, these initial approaches heavily depended on manually crafted designs, which constrained the adaptability and flexibility of agents in addressing unforeseen challenges (He et al., 2023; Chen et al., 2023d). Consequently, the push toward automating agentic workflows has gained momentum.

Automated Agentic Workflows

Efforts to automate agentic workflows can be broadly categorized into the following types: (1) Prompt Optimization, exemplified by PromptBreeder (Fernando et al., 2023) and DsPy (Khattab et al., 2023); (2) Inter-agent Topology, which focuses on orchestrating interactions among agents, such as GPTSwarm (Zhuge et al., 2024), DyLAN (Liu et al., 2023), EvoMAC (Hu et al., 2024c), and G-Designer (Zhang et al., 2024b); (3) Agent Persona/Profile, represented by AgentVerse (Chen et al., 2023d) and EvoAgent (Yuan et al., 2024). More recently, Hu et al. (2024b) formalized the concept of Automated Design of Agentic Systems, with subsequent advancements by AgentSquare (Shang et al., 2024) and AFlow (Zhang et al., 2024c). However, these automation pipelines are predominantly homogeneous, i.e., utilizing a single-source LLM, and lack the integration of heterogeneous LLM agents of varying sizes and sources. Additionally, they typically produce a fixed workflow (Yuan et al., 2024; Zhuge et al., 2024; Zhang et al., 2024c), which cannot dynamically allocate resources when confronted with tasks/queries of different levels and complexities.

Table 1: Comparison among different automation techniques.
Method Prompt Optimize Agent Topology Agent Profile LLM Backbone Complexity Adaptivity
AgentVerse
GPTSwarm
EvoMAC
EvoAgent
EvoPrompt
ADAS
AFlow
AgentSquare
EvoFlow
Evolutionary Algorithm

Evolutionary algorithms (EAs) are no new to agentic AI (Cetnarowicz et al., 1996; Li & Liu, 2016; Liu et al., 2020). In the era of LLM-based agents, researchers have explored the interplay between EA and LLM agents, including prompt engineering (Xu et al., 2022; Shi et al., 2024), code generation (Romera-Paredes et al., 2024), project planning (Tao et al., 2023) and inference time scaling (Lee et al., 2025). EvoAgent (Yuan et al., 2024) and EvoPrompt (Guo et al., 2023) employ simple genetic algorithms to optimize agent profiles and prompts, whose, however, level of automation is highly constrained, focusing solely on single-agent prompt optimization and failing to evolve at the workflow level, as illustrated in Table 1.

3 Preliminary

In this section, we formally define the search space of EvoFlow and the objective of workflow optimization.

Figure 2: The visualization of notations in EvoFlow.

Search Space. The search space of EvoFlow is defined hierarchically, with the basic unit being the (LLM-)invoking node. These are further assembled into (composite) operator nodes, which are then combined to form the complete workflow 𝒢\mathcal{G}, as visualized in Figure 2. Each invoking node Ii{I}_{i} is defined as follows:

Ii=(Mi,Pi,τi),Pi𝒫,τi[0,1],{I}_{i}=(M_{i},P_{i},\tau_{i}),\;P_{i}\in\mathcal{P},\tau_{i}\in{[0,1]}, (1)

where PiP_{i} represents the associated prompt, with 𝒫\mathcal{P} denoting the feasible prompt space, and τi\tau_{i} is the temperature parameter. Mi=(|Mi|,Ci,Li)M_{i}=(|M_{i}|,C_{i},L_{i}) represents an LLM instance from the feasible model pool ={M1,,M||}\mathcal{M}=\{M_{1},\cdots,M_{|\mathcal{M}|}\}, characterized by its model size |Mi||M_{i}|, token cost CiC_{i}, and inference delay LiL_{i}. Thus, the feasible space for invoking nodes is given by =×𝒫×[0,1]\mathcal{I}=\mathcal{M}\times\mathcal{P}\times\mathbb{R}_{[0,1]}. Notably, prior agentic automation pipelines have generally excluded \mathcal{M} from their search space (Zhang et al., 2024c; Yuan et al., 2024; Zhuge et al., 2024), often preselecting a single LLM MM to instantiate all agents, which constrains the development of more diverse and capability-rich agentic systems. Building upon the invoking nodes, the operator node Oj{O}_{j} is represented by:

Oj=(jo,jo),jo={I1,,In},jojo×jo,{O}_{j}=(\mathcal{I}^{o}_{j},\mathcal{E}^{o}_{j}),\mathcal{I}^{o}_{j}=\{I_{1},\dots,I_{n}\},\mathcal{E}^{o}_{j}\subseteq\mathcal{I}^{o}_{j}\times\mathcal{I}^{o}_{j}, (2)

where jo\mathcal{I}^{o}_{j} is a subset of invoking nodes, and jo\mathcal{E}^{o}_{j} signifies the connectivity relationship among invoking nodes. The overall agentic workflow 𝒢\mathcal{G} is defined as:

𝒢\displaystyle\mathcal{G} =(𝒪S,a),𝒪S={O1,,Om},a𝒪S×𝒪S,\displaystyle=(\mathcal{O}^{S},\mathcal{E}^{a}),\mathcal{O}^{S}=\{O_{1},\dots,O_{m}\},\mathcal{E}^{a}\subseteq\mathcal{O}^{S}\times\mathcal{O}^{S}, (3)
=(S,o),S=j=1moj,o=j=1moja,\displaystyle=(\mathcal{I}^{S},\mathcal{E}^{o}),\mathcal{I}^{S}=\bigcup_{j=1}^{m}\mathcal{I}^{o}_{j},\mathcal{E}^{o}=\bigcup_{j=1}^{m}\mathcal{E}^{o}_{j}\cup\mathcal{E}^{a},

where 𝒪S𝒪\mathcal{O}^{S}\subseteq\mathcal{O}, S\mathcal{I}^{S}\subseteq\mathcal{I}, mm denotes the number of operator nodes in 𝒢\mathcal{G}, a\mathcal{E}^{a}/o\mathcal{E}^{o} denote intra/inter-operator connections.

Refer to caption
Figure 3: The overall framework of EvoFlow. The fundamental unit is the invoking nodes, which collectively form the operator node. EvoFlow initializes the population by combining multiple operator nodes into a workflow (individual), followed by tag-based retrieval and crossover & mutation to generate novel offspring workflows. The population is updated via niching-based selection.

Problem Formulation We first present the optimization objective for traditional agentic automation methods. Given a task domain TT and an performance evaluator function u()u(\cdot), the objective function is defined as:

𝒢=argmax𝒢(,)u(𝒢,T)=argmaxS,S×Su((S,),T),\small\mathcal{G}^{*}=\underset{\mathcal{G}\in\mathcal{H}(\mathcal{I},\mathcal{E})}{\arg\max}\;u(\mathcal{G},T)=\underset{{\scriptsize\mathcal{I}^{S}\subseteq\mathcal{I},\mathcal{E}\subseteq\mathcal{I}^{S}\times\mathcal{I}^{S}}}{\arg\max}\!\!u\left((\mathcal{I}^{S},\mathcal{E}),T\right), (4)

where \mathcal{I} represents the feasible space of invoking nodes, and (,o)\mathcal{H}(\mathcal{I},\mathcal{E}^{o}) denotes the invoking node-based search space for 𝒢\mathcal{G}. As shown in Equation 4, existing methods (Zhang et al., 2024c; Shang et al., 2024; Zhuge et al., 2024) typically perform single-objective optimization. In contrast, the optimization objective of EvoFlow is multi-objective:

𝒢=argmax𝒢(,o)[u(𝒢,T),c(𝒢,T)],\mathcal{G}^{\star}=\underset{\mathcal{G}\in\mathcal{H}(\mathcal{I},\mathcal{E}^{o})}{\arg\max}\;\left[u(\mathcal{G},T),-c(\mathcal{G},T)\right]^{\top}, (5)

where c()c(\cdot) evaluates the system cost, and 𝒢\mathcal{G}^{\star} represents the Pareto optimal set balancing cost and performance, which includes a set of non-dominated agentic workflows that are well-distributed and located near the Pareto front (PF) in the objective space. Detailed explanations are in Appendix C.

However, the optimization in Equation 5 is currently based on invoking nodes, which results in an excessively large search space and does not explicitly account for many already-existing high-performing composite structures, such as CoT (Wei et al., 2022), ToT (Yao et al., 2023a), and Multi-agent Debate (Du et al., 2023). Therefore, we reformulate the search space to be operator node-based:

𝒢\displaystyle\mathcal{G}^{\star} =argmax𝒢(𝒪,a)[u(𝒢,T),c(𝒢,T)],\displaystyle=\underset{\mathcal{G}\in\mathcal{H}(\mathcal{O},\mathcal{E}^{a})}{\arg\max}\;\left[u(\mathcal{G},T),-c(\mathcal{G},T)\right]^{\top}, (6)
=argmax𝒪S𝒪,a𝒪S×𝒪S[u((𝒪S,a),T),c((𝒪S,a),T)],\displaystyle=\!\!\!\underset{\mathcal{O}^{S}\subseteq\mathcal{O},\mathcal{E}^{a}\subseteq\mathcal{O}^{S}\times\mathcal{O}^{S}}{\arg\max}{\!\!\!\!\!\!\![u((\mathcal{O}^{S},\mathcal{E}^{a}),T),-c((\mathcal{O}^{S},\mathcal{E}^{a}),T)]^{\top}},

Where 𝒪\mathcal{O} represents the feasible space for operator nodes.

4 Methodology

As shown in Figure 3, EvoFlow initializes a set of workflows with varying complexities and domain specializations, each tagged with its domain expertise (Section 4.1). As new user queries arrive, EvoFlow performs tag-based retrieval to select the most relevant (workflow) individuals as parents and generates offspring workflows through crossover and mutation (Section 4.2). Upon receiving environmental feedback, the framework evaluates the new workflows in the multi-objective space, and conducts environmental selection to maintain population diversity and efficiency (Section 4.3).

4.1 Population Initialization

EvoFlow initially populates the feasible space of operator nodes with a basket of powerful single-/multi-agent structures, including CoT (Wei et al., 2022), Ensemble (Jiang et al., 2023), Self-Reflexion (Shinn et al., 2023), Multi-agent Debate (Du et al., 2023), etc. Detailed formalizations are in Appendix D. This transforms 𝒪\mathcal{O} into a finite set:

𝒪(0)={OCoT,OReflexion,,ODebate}.\mathcal{O}^{(0)}=\{O_{\text{CoT}},O_{\text{Reflexion}},\cdots,O_{\text{Debate}}\}. (7)

Importantly, thought 𝒪(0)\mathcal{O}^{(0)} is initialized as a finite set, this does not constrain EvoFlow’s potential to explore a broader search space. This is because (1) practitioners can easily customize operator templates as needed, and (2) EvoFlow’s crossover and mutation can generate novel operators.

To initialize the workflow population 𝐏(0)={𝒢1,𝒢2,,𝒢N}\mathbf{P}^{(0)}=\{\mathcal{G}_{1},\mathcal{G}_{2},\cdots,\mathcal{G}_{N}\} (where the population size is set to NN), we generate NN workflows as follows:

𝒢k{𝒪k,ak},ak𝒪k×𝒪k,𝒪k={Oi(k,iS,𝒫k,iS,τk)}i=1m𝒪(0),iUniform(1,|𝒪(0)|),k,1S,𝒫k,iS𝒫,\begin{gathered}\mathcal{G}_{k}\leftarrow\{\mathcal{O}_{k},\mathcal{E}^{a}_{k}\},\mathcal{E}^{a}_{k}\subseteq\mathcal{O}_{k}\times\mathcal{O}_{k},\\ \mathcal{O}_{k}=\{O_{i}(\mathcal{M}^{S}_{k,i},\mathcal{P}_{k,i}^{S},\tau_{k})\}_{i=1}^{m}\subseteq\mathcal{O}^{(0)},\\ i\sim\operatorname{Uniform}(1,|\mathcal{O}^{(0)}|),\mathcal{M}_{k,1}^{S}\subseteq\mathcal{M},\mathcal{P}_{k,i}^{S}\subseteq\mathcal{P},\end{gathered} (8)

where mm denotes the number of operators in workflow 𝒢k\mathcal{G}_{k}, OiO_{i} represents the operator template randomly selected from 𝒪(0)\mathcal{O}^{(0)}, and it is instantiated with LLMs k,iS\mathcal{M}_{k,i}^{S} (sampled from LLM pool \mathcal{M}) and prompts 𝒫k,iS\mathcal{P}_{k,i}^{S}. Upon creating a workflow individual, we assign it multiple utility indicator tags, which suggest the task domains where it might excel. These tags are conducive to a rapid match between user queries and relevant workflows, generated as follows:

{ϰ1k,,ϰκk}ftag(𝒢k),\{\varkappa^{k}_{1},\cdots,\varkappa^{k}_{\kappa}\}\leftarrow f_{\text{tag}}(\mathcal{G}_{k}), (9)

where ϰi\varkappa_{i} represents the ii-th tag of 𝒢k\mathcal{G}_{k}, with a total of κ\kappa tags per workflow, and ftagf_{\text{tag}} is a LLM-powered tag generation function (see Section E.1). Thus, we have initialized the workflow population 𝐏(0)\mathbf{P}^{(0)} prior to iterative evolution.

4.2 Retrieval, Crossover, and Mutation

Upon initializing 𝐏(0)\mathbf{P}^{(0)}, we seek to evolve it driven by incoming task queries. Rather than activating the entire population for each query, we select a subset of workflows that are most relevant and complexity-adapted to it, which prevents the population from converging solely toward high-complexity, single-domain evolution. Specifically, for the tt-th query qtq_{t}, we first select the KK most relevant workflow individuals from the population 𝐏(t)\mathbf{P}^{(t)}, based on utility indicator tags:

{𝒢t1,,𝒢tK}\displaystyle\{\mathcal{G}_{t1},\cdots,\mathcal{G}_{tK}\} =TopK(𝒮({𝒢i}i=1N|qt),K),\displaystyle=\operatorname{TopK}\left(\mathcal{S}(\{\mathcal{G}_{i}\}_{i=1}^{N}\;|\;q_{t}),K\right), (10)
𝒮(𝒢i|qt)\displaystyle\mathcal{S}(\mathcal{G}_{i}\;|\;q_{t}) =j=1κ𝐯(ϰi,j)𝐯(qt)𝐯(ϰi,j)𝐯(qt),\displaystyle=\sum_{j=1}^{\kappa}\frac{\mathbf{v}(\varkappa_{i,j})\cdot\mathbf{v}(q_{t})}{\|\mathbf{v}(\varkappa_{i,j})\|\|\mathbf{v}(q_{t})\|},

where ϰi,j\varkappa_{i,j} is the jj-th tag of 𝒢i\mathcal{G}_{i}, TopK(,K)\operatorname{TopK}(\cdot,K) is a selection function that outputs elements with KK largest values, and 𝐯()\mathbf{v}(\cdot) maps queries/tags to fixed-length embeddings using lightweight models such as SentenceBERT (Reimers, 2019) or MiniLM (Wang et al., 2020). The similarity score 𝒮(𝒢iqt)\mathcal{S}(\mathcal{G}_{i}\mid q_{t}) is computed based on the cosine similarity between the tag/query embeddings. After identifying the KK most relevant workflows, these are treated as parents to generate offspring workflows with crossover function:

𝒢(t)Crossover(𝒢t1,,𝒢tK),\mathcal{G}_{\circ}^{(t)}\leftarrow\operatorname{Crossover}(\mathcal{G}_{t1},\cdots,\mathcal{G}_{tK}), (11)

where 𝒢(t)\mathcal{G}_{\circ}^{(t)} represents the generated workflow, and the Crossover()\operatorname{Crossover}(\cdot) function is LLM-facilitated (see prompts in Section E.2). To further enhance the diversity of the population and foster the evolution of novel agentic architectures, we apply a suite of mutation functions to refine the sketched offspring, as described below:

LLM Mutation μl()\mu^{l}(\cdot) replaces the LLM backbone of an invoking node within an existing workflow. This mutation can be beneficial in scenarios where an agent in the workflow is underperforming, such as when a small 7b agent fails to handle complex subtask decomposition and needs to be replaced by a larger one, or when a simpler 72b model suffices to accomplish a task as a 405b model does. The mutation process empowers EvoFlow to evolve into powerful heterogeneous workflows, formalized as follows:

𝒢~=μl(𝒢,)=(,),={(Mi,Pi,τi)Ii,Mi=(Mi𝒫LLM)},\begin{gathered}\tilde{\mathcal{G}}=\mu^{l}(\mathcal{G},\mathcal{R})=(\mathcal{I}^{\prime},\mathcal{E}),\\ \mathcal{I}^{\prime}=\{(M_{i}^{\prime},P_{i},\tau_{i})\mid I_{i}\in\mathcal{I},M_{i}^{\prime}=\mathcal{R}(M_{i}\mid\mathcal{P}_{\text{LLM}})\},\end{gathered} (12)

where 𝒢~\tilde{\mathcal{G}} represents the mutated individual, and l()\mathcal{R}^{l}(\cdot) is an LLM-powered process that determines whether the LLM in IiI_{i} should be changed based on the LLM performance history pool 𝒫LLM\mathcal{P}_{\text{LLM}}. Details of 𝒫LLM\mathcal{P}_{\text{LLM}} and l()\mathcal{R}^{l}(\cdot) are provided in Section F.1 and Section E.3.1, respectively.

Prompt Mutation μp()\mu^{p}(\cdot) involves modifying the prompts of invoking nodes, such as incorporating few-shot examples or providing clearer task instructions, as follows:

𝒢~=μp(𝒢,p)=(,),={(Mi,Pi,τi)Ii,Pi=p(Pi𝒫wf)},\begin{gathered}\small\tilde{\mathcal{G}}=\mu^{p}(\mathcal{G},\mathcal{R}^{p})=(\mathcal{I}^{\prime},\mathcal{E}),\\ \mathcal{I}^{\prime}=\{(M_{i},P_{i}^{\prime},\tau_{i})\mid I_{i}\in\mathcal{I},P_{i}^{\prime}=\mathcal{R}^{p}(P_{i}\mid\mathcal{P}_{\text{wf}})\},\end{gathered} (13)

where 𝒫wf\mathcal{P}_{\text{wf}} is the experience history of the workflow population, the configuration of which is placed at Section F.2. p()\mathcal{R}^{p}(\cdot) is also LLM-powered (see Section E.3.2).

Operator Mutation μo()\mu^{o}(\cdot) refers to the modification of the operators or their topological connections (ao\mathcal{E}^{a}\cup\mathcal{E}^{o}). Practical scenarios include removing redundant Reflexion operators or adding a “format” operator within the workflow to enhance the formatting accuracy of code generation. The process is described as:

𝒢k~=μo(𝒢k,o)=(𝒪k,ka),𝒪k=(𝒪k𝒪del)𝒪add,ka=o(𝒪k𝒫wf)𝒪k×𝒪k,\begin{gathered}\small\tilde{\mathcal{G}_{k}}=\mu^{o}(\mathcal{G}_{k},\mathcal{R}^{o})=(\mathcal{O}^{\prime}_{k},\mathcal{E}_{k}^{a^{\prime}}),\\ \mathcal{O}^{\prime}_{k}=\left(\mathcal{O}_{k}\setminus\mathcal{O}^{del}\right)\cup\mathcal{O}^{add},\\ \mathcal{E}_{k}^{a^{\prime}}=\mathcal{R}^{o}(\mathcal{O}^{\prime}_{k}\mid\mathcal{P}_{\text{wf}})\subseteq\mathcal{O}^{\prime}_{k}\times\mathcal{O}^{\prime}_{k},\end{gathered} (14)

where 𝒪del\mathcal{O}^{del} and 𝒪add\mathcal{O}^{add} are deleted and added operators by o\mathcal{R}^{o}, and ka\mathcal{E}_{k}^{a^{\prime}} denotes the modified topological operator connections. The prompts for o\mathcal{R}^{o} is in Section E.3.3.

The mutated offspring is denoted as 𝒢(t){\mathcal{G}_{\circledcirc}^{(t)}}. With new individuals introduced, the critical challenge is: how can we design an efficient selection mechanism to evolve the population toward greater diversity and higher performance?

4.3 Niching-based Selection

The aforementioned challenge is one that prior agentic automation methods have struggled with: their single-objective optimization approaches often result in increasingly complex workflows, lengthier evaluation/test, and significantly higher API costs (Zhang et al., 2024c). For instance, running ADAS (Hu et al., 2024b) on ARC benchmark (Chollet, 2019) with gpt-3.5-turbo-0125 incurs cost up to $300\$300 USD. In contrast, EvoFlow introduces an efficient niching-based workflow selection mechanism, guiding evolution across multiple domains and complexity.

Niching, in our context, analogous to previous niching EAs (White et al., 2023), refers to clusters of similar individuals where environmental selection is conducted. To determine the niching area for a new individual 𝒢(t){\mathcal{G}_{\circledcirc}^{(t)}}, we compute it based on cost and utility tags as follows:

𝐏NA={𝒢q1,,𝒢qE}=TopK({Rank(𝒢i)}i=1N,E),Rank(𝒢i)=Rank𝒮(𝒢i)+Rankc(𝒢i)=Index(𝒢i,Sort({𝒮(𝒢(t),𝒢j)}j=1N))+Index(𝒢i,Sort({|c(𝒢(t))c(𝒢j)}j=1N))\small\begin{gathered}\mathbf{P}^{NA}=\{\mathcal{G}_{q1},\cdots,\mathcal{G}_{qE}\}=\operatorname{TopK}\left(\{-\operatorname{Rank}(\mathcal{G}_{i})\}_{i=1}^{N},E\right),\\ \begin{aligned} \operatorname{Rank}(\mathcal{G}_{i})&=\operatorname{Rank}_{\mathcal{S}}(\mathcal{G}_{i})+\operatorname{Rank}_{c}(\mathcal{G}_{i})\\ &=\text{Index}\left(\mathcal{G}_{i},\text{Sort}(\{\mathcal{S}({\mathcal{G}_{\circledcirc}^{(t)}},\mathcal{G}_{j})\}_{j=1}^{N})\right)\\ &+\text{Index}\left(\mathcal{G}_{i},\text{Sort}(\{|c({\mathcal{G}_{\circledcirc}^{(t)}})-c(\mathcal{G}_{j})\}_{j=1}^{N})\right)\\ \end{aligned}\end{gathered} (15)

where 𝐏NA\mathbf{P}^{NA} denotes the identified niching area comprising EE individuals. The function Rank()\operatorname{Rank}(\cdot) computes the approximate ranking of an individual 𝒢i\mathcal{G}_{i} relative to the new individual, which is determined by the cost similarity rank Rankc()\operatorname{Rank}_{c}(\cdot) and the tag-based similarity rank Rank𝒮()\operatorname{Rank}_{\mathcal{S}}(\cdot). Subsequently, the parents, offspring, and workflows in the niching area are executed for query qtq_{t}, and their records are updated as follows:

c(t)(𝒢i)\displaystyle c^{(t)}(\mathcal{G}_{i}) =1/ti(c(t1)(𝒢i)ti+c(𝒢iqt)),\displaystyle={1}/{t_{i}^{\prime}}\left(c^{(t-1)}(\mathcal{G}_{i})\cdot t_{i}^{\prime}+c(\mathcal{G}_{i}\mid q_{t})\right), (16)
p(t)(𝒢i)\displaystyle p^{(t)}(\mathcal{G}_{i}) =1/ti(p(t1)(𝒢i)ti+p(𝒢iqt)),\displaystyle={1}/{t_{i}^{\prime}}\left(p^{(t-1)}(\mathcal{G}_{i})\cdot t_{i}^{\prime}+p(\mathcal{G}_{i}\mid q_{t})\right),
𝒢i\displaystyle\mathcal{G}_{i} 𝐏NA{𝒢ti}i=1K{𝒢(t)},\displaystyle\in\mathbf{P}^{NA}\cup\{\mathcal{G}_{ti}\}_{i=1}^{K}\cup\{{\mathcal{G}_{\circledcirc}^{(t)}}\},

where c(𝒢q)c(\mathcal{G}\mid q) measures the economical cost incurred by workflow 𝒢\mathcal{G} in addressing query qq, tit_{i}^{\prime} records the number of times workflow 𝒢i\mathcal{G}_{i} being executed up to iteration tt, c(t)(𝒢i)c^{(t)}(\mathcal{G}_{i}) tracks the cumulative cost of 𝒢i\mathcal{G}_{i}. p()p(\cdot) follows a similar formulation for performance metrics. Finally, the environmental selection is performed within the niching area by calculating the fitness value as follows:

(𝒢)=𝒢𝐏NA{𝒢(t)}(exp𝐈(𝒢,𝒢(t))φ𝐈max),\mathcal{F}(\mathcal{G})=\sum_{\mathcal{G}\in\mathbf{P}^{NA}\cup\{\mathcal{G}_{\circledcirc}^{(t)}\}}\left(\exp\frac{\mathbf{I}(\mathcal{G},\mathcal{G}_{\circledcirc}^{(t)})}{\varphi\cdot\mathbf{I}^{\max}}\right), (17)

where 𝐈(,)\mathbf{I}(\cdot,\cdot) is a Pareto dominance-preserving binary indicator. If individual 𝒢1\mathcal{G}_{1} dominates 𝒢2\mathcal{G}_{2}, i.e., c(𝒢1)<c(𝒢2)c(\mathcal{G}_{1})<c(\mathcal{G}_{2}) and p(𝒢1)<p(𝒢2)p(\mathcal{G}_{1})<p(\mathcal{G}_{2}) (aligning with our objective in Equation 5), then 𝐈(𝒢1,𝒢2)<𝐈(𝒢2,𝒢1)\mathbf{I}(\mathcal{G}_{1},\mathcal{G}_{2})<\mathbf{I}(\mathcal{G}_{2},\mathcal{G}_{1}). The maximum absolute indicator value, 𝐈max\mathbf{I}^{\max}, is defined as 𝐈max=max𝒢1,𝒢2𝐏NA{𝒢(t)}|𝐈(𝒢1,𝒢2)|\mathbf{I}^{\max}=\max_{\mathcal{G}_{1},\mathcal{G}_{2}\in\mathbf{P}^{NA}\cup\{\mathcal{G}_{\circledcirc}^{(t)}\}}|\mathbf{I}(\mathcal{G}_{1},\mathcal{G}_{2})|. The scaling factor φ\varphi is set to 0.050.05, following established practices (Zitzler & Künzli, 2004). A smaller fitness value in Equation 17 corresponds to a better individual. The worst-performing workflow, 𝒢worst\mathcal{G}^{\text{worst}}, which has the largest fitness value in 𝐏NA{𝒢(t)}\mathbf{P}^{NA}\cup\{\mathcal{G}_{\circledcirc}^{(t)}\}, will be eliminated from the population.

4.4 Discussion

The evolution process of EvoFlow operates on a query-by-query basis, continuously evolving, mutating, and niching-selecting workflows in response to incoming queries. This iterative process gradually produces a Pareto set of agentic workflows with varying complexity and superior performance. The overall algorithmic procedure is summarized in Appendix B, with notations clarified in Appendix A.

Table 2: Performance comparison with single agent, hand-craft multi-agent systems, and automated agentic workflows. The base LLM is consistently set as get-4o-mini for all baselines. We bold the best results and underline the runner-ups.
Method GSM8K MATH MultiArith HumanEval MBPP ALFWorld Avg.
Vanilla 87.4587.45 46.2946.29 96.8596.85 87.0887.08 71.8371.83 38.7138.71 71.3771.37
CoT (Wei et al., 2022) 87.1087.10↓0.35 46.4046.40↑0.11 96.3196.31↓0.54 88.1388.13↑1.05 71.8371.83↓0.00 39.9239.92↑1.21 71.6271.62↑0.25
ComplexCoT (Fu et al., 2022) 86.8986.89↓0.56 46.5346.53↑0.24 96.7096.70↓0.15 87.4987.49↑0.41 72.3672.36↑0.53 41.6841.68↑2.97 71.9471.94↑0.57
SC (CoT×5\times 5(Wang et al., 2023a) 87.5787.57↑0.12 47.9147.91↑1.62 96.5896.58↓0.27 88.6088.60↑1.52 73.6073.60↑1.77 40.5540.55↑1.84 72.4772.47↑1.10
MultiPersona (Wang et al., 2023b) 87.5087.50↑0.05 45.4345.43↓0.86 97.4997.49↑0.64 88.3288.32↑1.24 73.1973.19↑1.36 39.1039.10↑0.39 71.8471.84↑0.47
LLM-Debate (Du et al., 2023) 89.4789.47↑2.02 48.5448.54↑2.25 97.3397.33↑0.48 88.6888.68↑1.60 70.2970.29↓1.54 44.6844.68↑5.97 73.1773.17↑1.80
LLM-Blender (Jiang et al., 2023) 88.3588.35↑0.90 46.9246.92↑0.63 97.2997.29↑0.44 88.8088.80↑1.72 77.0577.05↑5.22 43.7943.79↑5.08 73.7073.70↑2.33
DyLAN (Liu et al., 2023) 89.9889.98↑2.53 48.6348.63↑2.34 97.1297.12↑0.27 90.4290.42↑3.34 77.3077.30↑5.47 53.3253.32↑14.61 76.1376.13↑4.76
AgentVerse (Chen et al., 2023d) 89.9189.91↑2.46 47.3547.35↑1.06 97.5097.50↑0.65 89.2989.29↑2.21 74.2874.28↑2.45 45.0345.03↑6.32 73.8973.89↑2.52
MacNet (Qian et al., 2024) 87.9587.95↑0.50 45.1845.18↓1.11 96.0396.03↓0.82 84.5784.57↓2.51 65.2865.28↓6.55 43.6643.66↑4.95 70.4570.45↓0.92
AutoAgents (Chen et al., 2023b) 87.6987.69↑0.24 45.3245.32↓0.97 96.4296.42↓0.43 87.6487.64↑0.56 71.9571.95↑0.12 46.1546.15↑7.44 72.5372.53↑1.16
GPTSwarm (Zhuge et al., 2024) 89.1489.14↑1.69 47.8847.88↑1.59 96.7996.79↓0.06 89.3289.32↑2.24 77.4377.43↑5.60 53.1953.19↑14.48 75.6375.63↑4.26
ADAS (Hu et al., 2024b) 86.1286.12↓1.33 43.1843.18↓3.11 96.0296.02↓0.83 84.1984.19↓2.89 68.1368.13↓3.70 47.6647.66↑8.95 70.8870.88↓0.49
AgentSquare (Shang et al., 2024) 87.6287.62↑0.17 48.5148.51↑2.22 97.7797.77↑0.92 89.0889.08↑3.00 78.4678.46↑6.63 66.4266.42↑27.71 78.1478.14↑6.77
AFlow (Zhang et al., 2024c) 91.1691.16↑3.71 51.2851.28↑3.31 96.2296.22↓0.63 90.9390.93↑3.85 81.6781.67↑9.84 59.1659.16↑20.45 78.4078.40↑7.03
EvoFlow (Ours) 92.90\mathbf{92.90}↑4.85 57.70\mathbf{57.70}↑11.41 98.80\mathbf{98.80}↑1.95 92.85\mathbf{92.85}↑5.77 84.50\mathbf{84.50}↑10.34 68.57\mathbf{68.57}↑29.86 82.55\mathbf{82.55}↑11.18
Table 3: Heterogeneous experiments on MATH and MBPP. “DyLANQwen” indicates that only Qwen-2.5-72b was used to optimize DyLAN. For comparison, we included results from o1-preview, although EvoFlow exclusively utilized four open-source LLMs. We shade the values of the lowest overall cost, the lowest inference token, and the highest performance for both single agents and workflows.
Model MATH MBPP
Training cost (103$10^{-3}\$) Inference cost (103$10^{-3}\$) Overall cost (103$10^{-3}\$) Inference token Acc. (%) Training cost (103$10^{-3}\$) Inference cost (103$10^{-3}\$) Overall cost (103$10^{-3}\$) Overall token pass@1 (%)
Single Llama-3.1-70b - 24.5024.50 24.5024.50 90,67890,678 31.93%31.93\% - 10.6710.67 10.6710.67 38,65338,653 65.11%65.11\%
Qwen-2.5-72b - 32.3032.30 32.3032.30 85,43685,436 63.80%63.80\% - 9.189.18 9.189.18 24,25324,253 69.76%69.76\%
Deepseek-V2.5 - 25.8925.89 25.8925.89 98,98698,986 41.17%41.17\% - 11.9311.93 11.9311.93 44,58944,589 76.74%76.74\%
Hermes-3-70b - 18.1118.11 18.1118.11 68,99468,994 22.60%22.60\% - 9.499.49 9.499.49 30,32830,328 63.28%63.28\%
o1-preview - 7840.517840.51 7840.517840.51 186,701186,701 70.20%70.20\% - 3209.443209.44 3209.443209.44 81,33481,334 89.65%89.65\%
Homogeneous AFlowLlama 653.97653.97 1304.071304.07 1958.051958.05 6,054,6986,054,698 36.97%36.97\% 383.40383.40 356.88356.88 740.29740.29 1,510,0581,510,058 67.42%67.42\%
AFlowQwen 1223.461223.46 2622.632622.63 3846.103846.10 8,614,2378,614,237 66.38%66.38\% 824.48824.48 773.63773.63 1598.111598.11 2,258,2792,258,279 80.84%80.84\%
AFlowDeepseek 815.96815.96 1945.901945.90 2761.862761.86 8,693,4028,693,402 48.65%48.65\% 456.96456.96 418.33418.33 875.29875.29 1,733,8291,733,829 79.14%79.14\%
AFlowHermes 572.09572.09 1045.201045.20 1617.291617.29 4,886,3714,886,371 32.14%32.14\% 353.04353.04 339.71339.71 692.75692.75 1,289,9011,289,901 66.13%66.13\%
DyLANLlama 9317.079317.07 2676.032676.03 11993.1011993.10 11,258,53011,258,530 38.19%38.19\% 5817.095817.09 966.12966.12 6783.216783.21 4,879,5264,879,526 69.92%69.92\%
DyLANQwen 12847.7212847.72 4015.974015.97 16863.6916863.69 15,242,98215,242,982 64.17%64.17\% 7491.787491.78 1480.941480.94 8972.728972.72 3,386,0873,386,087 75.63%75.63\%
DyLANDeepseek 10388.5410388.54 2375.112375.11 12763.6412763.64 13,282,45013,282,450 46.20%46.20\% 6209.416209.41 1084.341084.34 7293.457293.45 4,296,1994,296,199 80.13%80.13\%
DyLANHermes 7103.887103.88 2106.352106.35 9210.239210.23 8,129,7868,129,786 30.14%30.14\% 3965.383965.38 714.55714.55 4679.934679.93 4,150,8874,150,887 65.29%65.29\%
EvoFlow 459.24459.24 513.34513.34 972.58972.58 1,660,2841,660,284 72.90%72.90\% 479.10479.10 286.05286.05 565.15565.15 8,193,6698,193,669 87.62%87.62\%

5 Experiments

5.1 Experiment Setup

Tasks and Benchmarks.

We evaluate EvoFlow on six public benchmarks covering four domains: (1) math reasoning, GSM8K (Cobbe et al., 2021), MATH (Hendrycks et al., 2021b), and MultiArith (Roy & Roth, 2016); (2) code generation, HumanEval (Chen et al., 2021) and MBPP (Austin et al., 2021)); (3) embodied, ALFWorld (Shridhar et al., 2021). For the MATH benchmark, we follow (Hong et al., 2024) in selecting a harder subset (617 problems). The dataset statistics and splits are in Section G.1.

Baselines.

We compare EvoFlow with two series of agentic baselines: (1) manually designed workflows, including Chain-of-Thought (Wei et al., 2022), ComplexCoT (Fu et al., 2022)), Self-Consistency (SC) (Wang et al., 2023a), LLM-Debate (Du et al., 2023), LLM-Blender (Jiang et al., 2023), DyLAN (Liu et al., 2023), AgentVerse (Chen et al., 2023d) and MacNet (Qian et al., 2024); (2) autonomous workflows, including GPTSwarm (Zhuge et al., 2024), AutoAgents (Chen et al., 2023b), ADAS (Hu et al., 2024b), AgentSquare (Shang et al., 2024) and AFlow (Zhang et al., 2024c). Detailed baseline setups are in Section G.2.

LLM Backbones.

We leverage one closed-source model, gpt-4o-mini-0718, along with four open-source models: llama-3.1-70b, Qwen-2-72b, Deepseek-V2.5, and Hermes-3-70b. LLMs are accessed via APIs, with the temperature set to 11.

Parameter Configuration.

We select the following operators to initialize the feasible space of operator nodes: CoT, LLM-Debate, Take-a-step-back, Self-consistency, Self-Refine, Ensemble, ReAct, and ExpertPrompting. Detailed instructions are in Appendix D. The function 𝐯()\mathbf{v}(\cdot) adopts all-MiniLM-L6-v2 (Wang et al., 2020). The number of parent workflows in Equation 10 is set as K=3K=3, and the number of utility indicator tags in Equation 9 is set as κ=5\kappa=5. The population size NN is 1515, and E=5E=5 in Equation 15.

Refer to caption
Figure 4: The cost-performance plane of workflows from EvoFlow, DyLAN, and AFlow.
Figure 5: The ablation study of EvoFlow.
Refer to caption
Figure 6: The parameter sensitivity analysis of EvoFlow. The unit of cost per query (right) and performance (left) is 103$10^{-3}\cdot\$ and accuracy (%), respectively.

5.2 Performance Analysis

We present via three experimental settings: ◼ homogeneous setting, where all methods, including EvoFlow, are equipped with a unified LLM backbone; ◼ heterogeneous setting, where EvoFlow is assigned an LLM pool and optimizes a heterogeneous agentic workflow population; ◼ cross-domain setting, where we mix up multiple cross-domain datasets for training. The analysis is as follows:

Homogeneous Performance

Table 2 demonstrates that EvoFlow outperforms existing hand-crafted or automated agentic workflows across six benchmarks. Specifically, on the MATH benchmark, it exceeds vanilla gpt-4o-mini by 11.41%11.41\% and surpasses the SOTA baseline AFlow by 6.42%6.42\%. On the embodied benchmark ALFWorld, EvoFlow achieves the optimal 68.57%68.57\%, outperforming the second-best AgentSquare by 2.15%2.15\%.

Heterogeneous Performance

qwen-2.5-72b exhibits the best performance among the four open-source models, but even with the sophisticated optimization from AFlow, it only shows a 2.58%2.58\% improvement on MATH, still trailing behind the powerful o1-preview by 3.82%3.82\%\downarrow; however, EvoFlow, through the collective assembly and evolution of the four open-source models, surpasses o1-preview by 2.7%2.7\%. More importantly, the overall cost of EvoFlow is merely 12.4%12.4\% of that of o1-preview. This clearly illustrates both the necessity and potential of optimizing LLM-heterogeneous workflows.

Cross-domain Performance

We also include a cross-domain optimization setting, where training sets from different domain datasets are concatenated to assess whether an agentic automation method can optimize reasonable workflows across domains. As shown in Table 6, cross-domain optimization challenges many existing baselines: vanilla Deepseek-V2.5 achieves 41.17%41.17\% on MATH, and GPTSwarm improves it by 4.19%4.19\% when optimized solely for MATH. However, joint optimization on MATH+MBPP results in a negative gain, reducing performance to 39.18%39.18\%. Other methods like DyLAN and AFlow also suffer from the same issue. In contrast, EvoFlow successfully benefits from cross-domain training on MBPP, improving from 87.62%87.62\% to 88.35%88.35\%, a result attributed to the optimization of the workflow population rather than a single individual.

5.3 Cost Analysis & Case Study

We demonstrate the resource-friendly nature of EvoFlow’s agentic automation system across three dimensions: training/inference API costs and token consumption. As shown in Table 3, optimizing AFlowQwen on MATH incurs a training cost of 1.22$1.22\$ and an inference cost of 2.62$2.62\$. In comparison, EvoFlow requires only 37.5%37.5\% of the training cost and 19.5%19.5\% of the inference cost: this is because EvoFlow ’s workflows do not continuously rely on the most expensive qwen-2.5-72b, and instead opt for more economical models such as llama-3.1 or herme-3-70b when appropriate, without compromising performance.

We further visualize the optimized heterogeneous population of EvoFlow in Figure 4. It can be observed that EvoFlow forms a Pareto front in this performance-cost plane. The population begins with simple and inexpensive workflows, consisting solely of basic I/O and self-refine (accuracy@38.7%38.7\%, cost@0.00018$0.00018\$), and progresses to more complex workflows incorporating multi-agent debate. The most high-performing workflows include iterative generation and ensembling, but at the cost of higher per-query token consumption (accuracy@72.57%72.57\%, cost@0.0037$0.0037\$). This highlights EvoFlow’s query-aware paradigm: for simple queries, it intelligently selects economical workflows for rapid completion, while for more complex ones, it leverages sophisticated workflows to address the increased demands.

5.4 Framework Analysis

Ablation Study

We perform an ablation study on four variants of EvoFlow: w/o tag, where tag-based retrieval is removed and replaced with random selection in Equation 10; w/o LLM mutation, where Equation 12 is discarded; w/o prompt mutation, where Equation 13 is removed; and w/o operator mutation, where Equation 14 is discarded. The results from Figure 5 reveal that removing tag-based retrieval and LLM mutation consistently leads to performance degradation and greater variance. This is because EvoFlow becomes heavily influenced by random parent workflow selection and the LLM backbone chosen during individual initialization. Removing operator mutation, which eliminates the potential for creating new, creative operators, results in a performance drop of 3.5%7.3%3.5\%\sim 7.3\%.

Sensitivity Analysis

We perform an ablation study on three key parameters of EvoFlow: the number of selected parents KK in Equation 10, the number of tags per individual κ\kappa in Equation 9, and the population size NN. As shown in Figure 6, (1) both too small and large KK result in performance degradation, likely because a small KK reduces offspring diversity, while a large KK challenges the LLM’s ability to aggregate multiple workflows; (2) increasing the population size NN consistently improves performance, with a gain of 3.1%3.1\% from N=5N=5 to N=25N=25. However, a larger population also increases complexity, with the per-query cost rising from 8e48e-4 to 2e32e-3. Balancing cost-effectiveness, we set N=15N=15 across all experiments.

6 Conclusion

In this paper, we shift the paradigm of autonomous multi-agent workflow search from single-objective to cost-effectiveness-driven multi-objective optimization. Building on niching-based evolutionary algorithms, we propose EvoFlow, an autonomous framework that evolves a population of heterogeneous, complexity-adapted agentic workflows. Extensive experiments across six benchmarks demonstrate the superior performance of EvoFlow with significantly lower token costs.

Impact Statement

Ethical impacts.

We affirm that our proposed EvoFlow method poses no ethical concerns in terms of its motivation, design, experiments, and data usage. The method is built with a focus on fostering advancements in multi-agent systems, ensuring its responsible contribution to scientific research and the development of more efficient and customized solutions.

Expected societal implications.

EvoFlow presents a transformative approach to multi-agent systems by promoting the automation of heterogeneous agent workflows, optimizing for both performance and cost. By facilitating the use of diverse models for task-specific solutions, it offers new avenues for deploying more adaptive and scalable systems in various practical domains.

References

  • Austin et al. (2021) Austin, J., Odena, A., Nye, M., Bosma, M., Michalewski, H., Dohan, D., Jiang, E., Cai, C., Terry, M., Le, Q., et al. Program synthesis with large language models. arXiv preprint arXiv:2108.07732, 2021.
  • Cetnarowicz et al. (1996) Cetnarowicz, K., Kisiel-Dorohinicki, M., and Nawarecki, E. The application of evolution process in multi-agent world to the prediction system. In Proceedings of the Second International Conference on Multi-Agent Systems, ICMAS, volume 96, pp. 26–32, 1996.
  • Chen et al. (2023a) Chen, G., Dong, S., Shu, Y., Zhang, G., Sesay, J., Karlsson, B. F., Fu, J., and Shi, Y. Autoagents: A framework for automatic agent generation. CoRR, abs/2309.17288, 2023a. doi: 10.48550/ARXIV.2309.17288. URL https://doi.org/10.48550/arXiv.2309.17288.
  • Chen et al. (2023b) Chen, G., Dong, S., Shu, Y., Zhang, G., Sesay, J., Karlsson, B. F., Fu, J., and Shi, Y. Autoagents: A framework for automatic agent generation. arXiv preprint arXiv:2309.17288, 2023b.
  • Chen et al. (2023c) Chen, L., Zaharia, M., and Zou, J. Frugalgpt: How to use large language models while reducing cost and improving performance. arXiv preprint arXiv:2305.05176, 2023c.
  • Chen et al. (2021) Chen, M., Tworek, J., Jun, H., Yuan, Q., Ponde de Oliveira Pinto, H., Kaplan, J., Edwards, H., Burda, Y., Joseph, N., Brockman, G., Ray, A., Puri, R., Krueger, G., Petrov, M., Khlaaf, H., Sastry, G., Mishkin, P., Chan, B., Gray, S., Ryder, N., Pavlov, M., Power, A., Kaiser, L., Bavarian, M., Winter, C., Tillet, P., Petroski Such, F., Cummings, D., Plappert, M., Chantzis, F., Barnes, E., Herbert-Voss, A., Hebgen Guss, W., Nichol, A., Paino, A., Tezak, N., Tang, J., Babuschkin, I., Balaji, S., Jain, S., Saunders, W., Hesse, C., Carr, A. N., Leike, J., Achiam, J., Misra, V., Morikawa, E., Radford, A., Knight, M., Brundage, M., Murati, M., Mayer, K., Welinder, P., McGrew, B., Amodei, D., McCandlish, S., Sutskever, I., and Zaremba, W. Evaluating large language models trained on code, July 01, 2021 2021.
  • Chen et al. (2023d) Chen, W., Su, Y., Zuo, J., Yang, C., Yuan, C., Qian, C., Chan, C.-M., Qin, Y., Lu, Y., Xie, R., Liu, Z., Sun, M., and Zhou, J. Agentverse: Facilitating multi-agent collaboration and exploring emergent behaviors in agents, 2023d.
  • Chollet (2019) Chollet, F. On the measure of intelligence. arXiv preprint arXiv:1911.01547, 2019.
  • Clune (2019) Clune, J. Ai-gas: Ai-generating algorithms, an alternate paradigm for producing general artificial intelligence. arXiv preprint arXiv:1905.10985, 2019.
  • Cobbe et al. (2021) Cobbe, K., Kosaraju, V., Bavarian, M., Chen, M., Jun, H., Kaiser, L., Plappert, M., Tworek, J., Hilton, J., Nakano, R., Hesse, C., and Schulman, J. Training verifiers to solve math word problems. arXiv prepring, abs/2110.14168, 2021.
  • Devlin (2018) Devlin, J. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
  • Du et al. (2023) Du, Y., Li, S., Torralba, A., Tenenbaum, J. B., and Mordatch, I. Improving factuality and reasoning in language models through multiagent debate. CoRR, abs/2305.14325, 2023.
  • Feng et al. (2024) Feng, T., Shen, Y., and You, J. Graphrouter: A graph-based router for llm selections. arXiv preprint arXiv:2410.03834, 2024.
  • Fernando et al. (2023) Fernando, C., Banarse, D., Michalewski, H., Osindero, S., and Rocktäschel, T. Promptbreeder: Self-referential self-improvement via prompt evolution. arXiv preprint arXiv:2309.16797, 2023.
  • Fu et al. (2022) Fu, Y., Peng, H., Sabharwal, A., Clark, P., and Khot, T. Complexity-based prompting for multi-step reasoning. In The Eleventh International Conference on Learning Representations, 2022.
  • Guo et al. (2023) Guo, Q., Wang, R., Guo, J., Li, B., Song, K., Tan, X., Liu, G., Bian, J., and Yang, Y. Connecting large language models with evolutionary algorithms yields powerful prompt optimizers. arXiv preprint arXiv:2309.08532, 2023.
  • He et al. (2023) He, Z., Cao, P., Chen, Y., Liu, K., Li, R., Sun, M., and Zhao, J. Lego: A multi-agent collaborative framework with role-playing and iterative feedback for causality explanation generation. In Findings of the Association for Computational Linguistics: EMNLP 2023, pp. 9142–9163, 2023.
  • Hendrycks et al. (2021a) Hendrycks, D., Burns, C., Basart, S., Zou, A., Mazeika, M., Song, D., and Steinhardt, J. Measuring massive multitask language understanding. Proceedings of the International Conference on Learning Representations (ICLR), 2021a.
  • Hendrycks et al. (2021b) Hendrycks, D., Burns, C., Kadavath, S., Arora, A., Basart, S., Tang, E., Song, D., and Steinhardt, J. Measuring mathematical problem solving with the math dataset. NeurIPS, 2021b.
  • Hong et al. (2023) Hong, S., Zheng, X., Chen, J., Cheng, Y., Wang, J., Zhang, C., Wang, Z., Yau, S. K. S., Lin, Z., Zhou, L., Ran, C., Xiao, L., and Wu, C. Metagpt: Meta programming for multi-agent collaborative framework, August 01, 2023 2023.
  • Hong et al. (2024) Hong, S., Lin, Y., Liu, B., Liu, B., Wu, B., Zhang, C., Wei, C., Li, D., Chen, J., Zhang, J., et al. Data interpreter: An llm agent for data science. arXiv preprint arXiv:2402.18679, 2024.
  • Hu et al. (2024a) Hu, Q. J., Bieker, J., Li, X., Jiang, N., Keigwin, B., Ranganath, G., Keutzer, K., and Upadhyay, S. K. Routerbench: A benchmark for multi-llm routing system. arXiv preprint arXiv:2403.12031, 2024a.
  • Hu et al. (2024b) Hu, S., Lu, C., and Clune, J. Automated design of agentic systems. arXiv preprint arXiv:2408.08435, 2024b.
  • Hu et al. (2024c) Hu, Y., Cai, Y., Du, Y., Zhu, X., Liu, X., Yu, Z., Hou, Y., Tang, S., and Chen, S. Self-evolving multi-agent collaboration networks for software development. arXiv preprint arXiv:2410.16946, 2024c.
  • Jiang et al. (2023) Jiang, D., Ren, X., and Lin, B. Y. LLM-blender: Ensembling large language models with pairwise ranking and generative fusion. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 14165–14178, Toronto, Canada, July 2023. Association for Computational Linguistics.
  • Jin et al. (2023) Jin, Y., Shen, X., Peng, H., Liu, X., Qin, J., Li, J., Xie, J., Gao, P., Zhou, G., and Gong, J. Surrealdriver: Designing generative driver agent simulation framework in urban contexts based on large language model, 2023.
  • Khattab et al. (2023) Khattab, O., Singhvi, A., Maheshwari, P., Zhang, Z., Santhanam, K., Vardhamanan, S., Haq, S., Sharma, A., Joshi, T. T., Moazam, H., et al. Dspy: Compiling declarative language model calls into self-improving pipelines. arXiv preprint arXiv:2310.03714, 2023.
  • Lee et al. (2025) Lee, K.-H., Fischer, I., Wu, Y.-H., Marwood, D., Baluja, S., Schuurmans, D., and Chen, X. Evolving deeper llm thinking. arXiv preprint arXiv:2501.09891, 2025.
  • Li et al. (2023) Li, G., Hammoud, H., Itani, H., Khizbullin, D., and Ghanem, B. CAMEL: communicative agents for ”mind” exploration of large language model society. In NeurIPS, 2023.
  • Li & Liu (2016) Li, Z. and Liu, J. A multi-agent genetic algorithm for community detection in complex networks. Physica A: Statistical Mechanics and its Applications, 449:336–347, 2016.
  • Li et al. (2024) Li, Z., Zang, Q., Ma, D., Guo, J., Zheng, T., Liu, M., Niu, X., Wang, Y., Yang, J., Liu, J., et al. Autokaggle: A multi-agent framework for autonomous data science competitions. arXiv preprint arXiv:2410.20424, 2024.
  • Liang et al. (2023) Liang, T., He, Z., Jiao, W., Wang, X., Wang, Y., Wang, R., Yang, Y., Tu, Z., and Shi, S. Encouraging divergent thinking in large language models through multi-agent debate. CoRR, abs/2305.19118, 2023.
  • Liu et al. (2020) Liu, Z., Chen, B., Zhou, H., Koushik, G., Hebert, M., and Zhao, D. Mapper: Multi-agent path planning with evolutionary reinforcement learning in mixed dynamic environments. In 2020 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pp. 11748–11754. IEEE, 2020.
  • Liu et al. (2023) Liu, Z., Zhang, Y., Li, P., Liu, Y., and Yang, D. Dynamic llm-agent network: An llm-agent collaboration framework with agent team optimization. CoRR, abs/2310.02170, 2023.
  • Madaan et al. (2023) Madaan, A., Tandon, N., Gupta, P., Hallinan, S., Gao, L., Wiegreffe, S., Alon, U., Dziri, N., Prabhumoye, S., Yang, Y., Gupta, S., Majumder, B. P., Hermann, K., Welleck, S., Yazdanbakhsh, A., and Clark, P. Self-refine: Iterative refinement with self-feedback. In NeurIPS, 2023. URL http://papers.nips.cc/paper_files/paper/2023/hash/91edff07232fb1b55a505a9e9f6c0ff3-Abstract-Conference.html.
  • Mikolov et al. (2013) Mikolov, T., Chen, K., Corrado, G., and Dean, J. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781, 2013.
  • Nakajima (2023) Nakajima, Y. Babyagi. https://github.com/yoheinakajima/babyagi, 2023.
  • Pennington et al. (2014) Pennington, J., Socher, R., and Manning, C. D. Glove: Global vectors for word representation. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pp. 1532–1543, 2014.
  • Qian et al. (2024) Qian, C., Xie, Z., Wang, Y., Liu, W., Dang, Y., Du, Z., Chen, W., Yang, C., Liu, Z., and Sun, M. Scaling large-language-model-based multi-agent collaboration. arXiv preprint arXiv:2406.07155, 2024.
  • Reimers (2019) Reimers, N. Sentence-bert: Sentence embeddings using siamese bert-networks. arXiv preprint arXiv:1908.10084, 2019.
  • Reworkd (2023) Reworkd. Agentgpt. https://github.com/reworkd/AgentGPT, 2023.
  • Richards & et al. (2023) Richards, T. B. and et al. Auto-gpt: An autonomous gpt-4 experiment. https://github.com/Significant-Gravitas/Auto-GPT, 2023.
  • Romera-Paredes et al. (2024) Romera-Paredes, B., Barekatain, M., Novikov, A., Balog, M., Kumar, M. P., Dupont, E., Ruiz, F. J., Ellenberg, J. S., Wang, P., Fawzi, O., et al. Mathematical discoveries from program search with large language models. Nature, 625(7995):468–475, 2024.
  • Roy & Roth (2016) Roy, S. and Roth, D. Solving general arithmetic word problems. arXiv preprint arXiv:1608.01413, 2016.
  • Saad-Falcon et al. (2024) Saad-Falcon, J., Lafuente, A. G., Natarajan, S., Maru, N., Todorov, H., Guha, E., Buchanan, E. K., Chen, M., Guha, N., Ré, C., et al. Archon: An architecture search framework for inference-time techniques. arXiv preprint arXiv:2409.15254, 2024.
  • Shang et al. (2024) Shang, Y., Li, Y., Zhao, K., Ma, L., Liu, J., Xu, F., and Li, Y. Agentsquare: Automatic llm agent search in modular design space. arXiv preprint arXiv:2410.06153, 2024.
  • Shen et al. (2024) Shen, Y., Song, K., Tan, X., Li, D., Lu, W., and Zhuang, Y. Hugginggpt: Solving ai tasks with chatgpt and its friends in hugging face. Advances in Neural Information Processing Systems, 36, 2024.
  • Shi et al. (2024) Shi, Z., Wang, Y., Yin, F., Chen, X., Chang, K.-W., and Hsieh, C.-J. Red teaming language model detectors with language models. Transactions of the Association for Computational Linguistics, 12:174–189, 2024.
  • Shinn et al. (2023) Shinn, N., Labash, B., and Gopinath, A. Reflexion: an autonomous agent with dynamic memory and self-reflection. arXiv preprint, abs/2303.11366, 2023. doi: 10.48550/arXiv.2303.11366. URL https://doi.org/10.48550/arXiv.2303.11366.
  • Shridhar et al. (2021) Shridhar, M., Yuan, X., Cote, M.-A., Bisk, Y., Trischler, A., and Hausknecht, M. {ALFW}orld: Aligning text and embodied environments for interactive learning. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=0IOX0YcCdTn.
  • Song et al. (2023) Song, C. H., Wu, J., Washington, C., Sadler, B. M., Chao, W.-L., and Su, Y. Llm-planner: Few-shot grounded planning for embodied agents with large language models. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 2998–3009, 2023.
  • Tao et al. (2023) Tao, N., Ventresque, A., and Saber, T. Program synthesis with generative pre-trained transformers and grammar-guided genetic programming grammar. In 2023 IEEE Latin American Conference on Computational Intelligence (LA-CCI), pp. 1–6. IEEE, 2023.
  • Tyson & Zysman (2022) Tyson, L. D. and Zysman, J. Automation, ai & work. Daedalus, 151(2):256–271, 2022.
  • Wang et al. (2023) Wang, G., Xie, Y., Jiang, Y., Mandlekar, A., Xiao, C., Zhu, Y., Fan, L., and Anandkumar, A. Voyager: An Open-Ended Embodied Agent with Large Language Models. arXiv e-prints, art. arXiv:2305.16291, May 2023.
  • Wang et al. (2024) Wang, L., Ma, C., Feng, X., Zhang, Z., Yang, H., Zhang, J., Chen, Z., Tang, J., Chen, X., Lin, Y., Zhao, W. X., Wei, Z., and Wen, J. A survey on large language model based autonomous agents. Front. Comput. Sci., 18, 2024.
  • Wang et al. (2020) Wang, W., Wei, F., Dong, L., Bao, H., Yang, N., and Zhou, M. Minilm: Deep self-attention distillation for task-agnostic compression of pre-trained transformers. Advances in Neural Information Processing Systems, 33:5776–5788, 2020.
  • Wang et al. (2023a) Wang, X., Wei, J., Schuurmans, D., Le, Q. V., Chi, E. H., Narang, S., Chowdhery, A., and Zhou, D. Self-consistency improves chain of thought reasoning in language models. In The Eleventh International Conference on Learning Representations, 2023a.
  • Wang et al. (2023b) Wang, Z., Mao, S., Wu, W., Ge, T., Wei, F., and Ji, H. Unleashing cognitive synergy in large language models: A task-solving agent through multi-persona self-collaboration, July 01, 2023 2023b. work in progress.
  • Wei et al. (2022) Wei, J., Wang, X., Schuurmans, D., Bosma, M., Ichter, B., Xia, F., Chi, E., Le, Q., and Zhou, D. Chain-of-thought prompting elicits reasoning in large language models, January 01, 2022 2022.
  • White et al. (2023) White, C., Safari, M., Sukthanker, R., Ru, B., Elsken, T., Zela, A., Dey, D., and Hutter, F. Neural architecture search: Insights from 1000 papers. arXiv preprint arXiv:2301.08727, 2023.
  • Wu et al. (2023) Wu, Q., Bansal, G., Zhang, J., Wu, Y., Zhang, S., Zhu, E., Li, B., Jiang, L., Zhang, X., and Wang, C. Autogen: Enabling next-gen llm applications via multi-agent conversation framework, August 01, 2023 2023.
  • Xu et al. (2023) Xu, B., Yang, A., Lin, J., Wang, Q., Zhou, C., Zhang, Y., and Mao, Z. Expertprompting: Instructing large language models to be distinguished experts. arXiv preprint arXiv:2305.14688, 2023.
  • Xu et al. (2022) Xu, H., Chen, Y., Du, Y., Shao, N., Wang, Y., Li, H., and Yang, Z. Gps: Genetic prompt search for efficient few-shot learning. arXiv preprint arXiv:2210.17041, 2022.
  • Yao et al. (2023a) Yao, S., Yu, D., Zhao, J., Shafran, I., Griffiths, T. L., Cao, Y., and Narasimhan, K. Tree of thoughts: Deliberate problem solving with large language models, May 01, 2023 2023a.
  • Yao et al. (2023b) Yao, S., Zhao, J., Yu, D., Du, N., Shafran, I., Narasimhan, K. R., and Cao, Y. React: Synergizing reasoning and acting in language models. In The Eleventh International Conference on Learning Representations, 2023b.
  • Yuan et al. (2024) Yuan, S., Song, K., Chen, J., Tan, X., Li, D., and Yang, D. Evoagent: Towards automatic multi-agent generation via evolutionary algorithms. arXiv preprint arXiv:2406.14228, 2024.
  • Zhang et al. (2024a) Zhang, G., Yue, Y., Li, Z., Yun, S., Wan, G., Wang, K., Cheng, D., Yu, J. X., and Chen, T. Cut the crap: An economical communication pipeline for llm-based multi-agent systems. arXiv preprint arXiv:2410.02506, 2024a.
  • Zhang et al. (2024b) Zhang, G., Yue, Y., Sun, X., Wan, G., Yu, M., Fang, J., Wang, K., and Cheng, D. G-designer: Architecting multi-agent communication topologies via graph neural networks. arXiv preprint arXiv:2410.11782, 2024b.
  • Zhang et al. (2023) Zhang, J., Xu, X., and Deng, S. Exploring collaboration mechanisms for llm agents: A social psychology view. arXiv preprint arXiv:2310.02124, 2023.
  • Zhang et al. (2024c) Zhang, J., Xiang, J., Yu, Z., Teng, F., Chen, X., Chen, J., Zhuge, M., Cheng, X., Hong, S., Wang, J., et al. Aflow: Automating agentic workflow generation. arXiv preprint arXiv:2410.10762, 2024c.
  • Zhang et al. (2022) Zhang, Z., Zhang, A., Li, M., and Smola, A. Automatic chain of thought prompting in large language models. arXiv preprint arXiv:2210.03493, 2022.
  • Zheng et al. (2023a) Zheng, C., Liu, Z., Xie, E., Li, Z., and Li, Y. Progressive-hint prompting improves reasoning in large language models, April 01, 2023 2023a. Tech Report.
  • Zheng et al. (2023b) Zheng, H. S., Mishra, S., Chen, X., Cheng, H.-T., Chi, E. H., Le, Q. V., and Zhou, D. Take a step back: Evoking reasoning via abstraction in large language models. arXiv preprint arXiv:2310.06117, 2023b.
  • Zhong et al. (2024) Zhong, W., Guo, L., Gao, Q., Ye, H., and Wang, Y. Memorybank: Enhancing large language models with long-term memory. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 38, pp. 19724–19731, 2024.
  • Zhu et al. (2024a) Zhu, J.-P., Cai, P., Xu, K., Li, L., Sun, Y., Zhou, S., Su, H., Tang, L., and Liu, Q. Autotqa: Towards autonomous tabular question answering through multi-agent large language models. Proceedings of the VLDB Endowment, 17(12):3920–3933, 2024a.
  • Zhu et al. (2024b) Zhu, Y., Qiao, S., Ou, Y., Deng, S., Zhang, N., Lyu, S., Shen, Y., Liang, L., Gu, J., and Chen, H. Knowagent: Knowledge-augmented planning for llm-based agents. arXiv preprint arXiv:2403.03101, 2024b.
  • Zhuge et al. (2024) Zhuge, M., Wang, W., Kirsch, L., Faccio, F., Khizbullin, D., and Schmidhuber, J. Gptswarm: Language agents as optimizable graphs. In Forty-first International Conference on Machine Learning, 2024.
  • Zitzler & Künzli (2004) Zitzler, E. and Künzli, S. Indicator-based selection in multiobjective search. In International conference on parallel problem solving from nature, pp. 832–842. Springer, 2004.

Appendix A Notations

We present a comprehensive review of the commonly used notations and their definitions in Table 4.

Table 4: Notation and Definitions
Notation Definition
IiI_{i} An LLM-invoking node
PiP_{i} The prompt content of IiI_{i}
𝒫\mathcal{P} The feasible prompt space
MiM_{i} The base LLM invoked by IiI_{i}
τi\tau_{i} Temperature of MiM_{i}
={M1,,M||}\mathcal{M}=\{M_{1},\cdots,M_{|\mathcal{M}|}\} LLM pool
=×𝒫×[0,1]\mathcal{I}=\mathcal{M}\times\mathcal{P}\times\mathbb{R}_{[0,1]} The feasible space for invoking nodes
Oj=(jo,jo)O_{j}=(\mathcal{I}^{o}_{j},\mathcal{E}^{o}_{j}) An operator node composed of multiple invoking nodes
jo={I1,,In}\mathcal{I}^{o}_{j}=\{I_{1},\dots,I_{n}\} The selected invoking nodes in OjO_{j}
jojo×jo\mathcal{E}^{o}_{j}\subseteq\mathcal{I}^{o}_{j}\times\mathcal{I}^{o}_{j} The connectivity of operator nodes in OjO_{j}
𝒪\mathcal{O} The feasible space of operator nodes
𝒢=(𝒪S,a)=(S,o)\mathcal{G}=(\mathcal{O}^{S},\mathcal{E}^{a})=(\mathcal{I}^{S},\mathcal{E}^{o}) An agentic workflow
𝒪S𝒪\mathcal{O}^{S}\in\mathcal{O} A subset of operator nodes used in 𝒢\mathcal{G}
S\mathcal{I}^{S}\in\mathcal{I} A subset of invoking nodes selected in 𝒢\mathcal{G}
u(𝒢,T)u(\mathcal{G},T) An evaluator function assessing 𝒢\mathcal{G}’s performance in task domain TT
c(𝒢,T)c(\mathcal{G},T) An evaluator function assessing 𝒢\mathcal{G}’s cost in task domain TT
𝒢\mathcal{G}^{*} The best workflow searched by baseline methods
𝒢\mathcal{G}^{\star} The Pareto-optimal set of agentic workflows balancing cost and performance
𝐏(t)={𝒢1,𝒢2,,𝒢N}\mathbf{P}^{(t)}=\{\mathcal{G}_{1},\mathcal{G}_{2},\cdots,\mathcal{G}_{N}\} A population of NN agentic workflows at the tt-th iteration
ϰik\varkappa^{k}_{i} The ii-th tag of workflow 𝒢k\mathcal{G}_{k}
𝐯()\mathbf{v}(\cdot) Text embedding function
𝒮(𝒢|q)\mathcal{S}(\mathcal{G}|q) The similarity score of workflow 𝒢\mathcal{G} with respect to query qq
𝒢(t)\mathcal{G}_{\circ}^{(t)} The generated offspring workflow at the tt-th iteration
μl()\mu^{l}(\cdot) LLM mutation function
μp()\mu^{p}(\cdot) Prompt mutation function
μo()\mu^{o}(\cdot) Operator mutation function
𝒢~\tilde{\mathcal{G}} A mutated workflow
𝒢(t)\mathcal{G}^{(t)}_{\circledcirc} A mutated workflow at the tt-th iteration
𝐏NA={𝒢q1,,𝒢qE}\mathbf{P}^{NA}=\{\mathcal{G}_{q1},\cdots,\mathcal{G}_{qE}\} The identified niche area comprising EE individuals
c(t)(𝒢i)c^{(t)}(\mathcal{G}_{i}) The cumulative cost of 𝒢i\mathcal{G}_{i} at the tt-th iteration
u(t)(𝒢i)u^{(t)}(\mathcal{G}_{i}) The cumulative performance of 𝒢i\mathcal{G}_{i} at the tt-th iteration
𝐈(,)\mathbf{I}(\cdot,\cdot) Pareto dominance-preserving binary indicator
(𝒢)\mathcal{F}(\mathcal{G}) The fitness value of 𝒢\mathcal{G}

Appendix B Algorithm Table

We conclude the overall algorithm procedure of EvoFlow in Algorithm 1.

Algorithm 1 Algorithm workflow of EvoFlow
Input : A dataset 𝒟\mathcal{D} containing training set 𝒟train\mathcal{D}_{\text{train}} and test set 𝒟test\mathcal{D}_{\text{test}}, Operator set 𝒪\mathcal{O}
Output : The well-optimized, diverse workflow population 𝐏|𝒟train|\mathbf{P}^{|\mathcal{D}_{\text{train}}|}
/* Initialize workflow population */
for individual k1k\leftarrow 1 to NN do
 𝒢k{𝒪k,ka},ka𝒪k×𝒪k\mathcal{G}_{k}\leftarrow\{\mathcal{O}_{k},\mathcal{E}^{a}_{k}\},\mathcal{E}^{a}_{k}\subseteq\mathcal{O}_{k}\times\mathcal{O}_{k}; \triangleright Eq. 8
 /* Assigning utility tags */
 {ϰ1k,,ϰκk}ftag(𝒢k)\{\varkappa^{k}_{1},\cdots,\varkappa^{k}_{\kappa}\}\leftarrow f_{\text{tag}}(\mathcal{G}_{k}); \triangleright Eq. 9
end for
Obtain initialized population 𝐏(0)={𝒢1,𝒢2,,𝒢N}\mathbf{P}^{(0)}=\{\mathcal{G}_{1},\mathcal{G}_{2},\cdots,\mathcal{G}_{N}\}
for query qtq_{t} in 𝒟train\mathcal{D}_{\text{train}} do
 /* Retrieve relevant workflows via tag-based similarity */
  Locate parent workflows: {𝒢t1,,𝒢tK}=TopK(𝒮({𝒢i}i=1N|qt),K)\{\mathcal{G}_{t1},\cdots,\mathcal{G}_{tK}\}=\operatorname{TopK}\left(\mathcal{S}(\{\mathcal{G}_{i}\}_{i=1}^{N}\;|\;q_{t}),K\right); \triangleright Eq. 10
 /* Crossover and generate the offspring workflow */
  Evolve the offspring workflow via the Crossover function: 𝒢(t)Crossover(𝒢t1,,𝒢tK)\mathcal{G}_{\circ}^{(t)}\leftarrow\operatorname{Crossover}(\mathcal{G}_{t1},\cdots,\mathcal{G}_{tK}); \triangleright Eq. 11
  Mutate the offspring with three mutation functions: LLM mutation μl()\mu^{l}(\cdot), Prompt Mutation μp()\mu^{p}(\cdot) and Operator Mutation μo()\mu^{o}(\cdot); obtain the mutated offspring 𝒢(t){\mathcal{G}_{\circledcirc}^{(t)}}; \triangleright Equations 14, 13 and 12
 /* Niching-based selection & elimination */
  Identify the niching area 𝐏NA\mathbf{P}^{NA}: 𝐏NA={𝒢q1,,𝒢qE}=TopK({Rank(𝒢i)}i=1N,E)\mathbf{P}^{NA}=\{\mathcal{G}_{q1},\cdots,\mathcal{G}_{qE}\}=\operatorname{TopK}\left(\{-\operatorname{Rank}(\mathcal{G}_{i})\}_{i=1}^{N},E\right); \triangleright Eq. 15
 /* Execute parents, offsprings and niching-area workflows */
 for workflow 𝒢i𝐏NA{𝒢ti}i=1K{𝒢(t)\mathcal{G}_{i}\in\mathbf{P}^{NA}\cup\{\mathcal{G}_{ti}\}_{i=1}^{K}\cup\{{\mathcal{G}_{\circledcirc}^{(t)}} do
     Execute 𝒢i\mathcal{G}_{i} on query qq
    /* Record and update its cost */
    c(t)(𝒢i)=1/ti(c(t1)(𝒢i)ti+c(𝒢iqt))c^{(t)}(\mathcal{G}_{i})={1}/{t_{i}^{\prime}}\left(c^{(t-1)}(\mathcal{G}_{i})\cdot t_{i}^{\prime}+c(\mathcal{G}_{i}\mid q_{t})\right)
    /* Record and update its performance */
    p(t)(𝒢i)=1/ti(p(t1)(𝒢i)ti+p(𝒢iqt))p^{(t)}(\mathcal{G}_{i})={1}/{t_{i}^{\prime}}\left(p^{(t-1)}(\mathcal{G}_{i})\cdot t_{i}^{\prime}+p(\mathcal{G}_{i}\mid q_{t})\right)
  end for
 for workflow 𝒢i𝐏NA{𝒢ti}i=1K{𝒢(t)\mathcal{G}_{i}\in\mathbf{P}^{NA}\cup\{\mathcal{G}_{ti}\}_{i=1}^{K}\cup\{{\mathcal{G}_{\circledcirc}^{(t)}} do
    /* Calculate each individual’s fitness value */
     Calculate the fitness value (𝒢)=𝒢𝐏NA(exp𝐈(𝒢,𝒢(t))φ𝐈max)\mathcal{F}(\mathcal{G})=\sum_{\mathcal{G}\in\mathbf{P}^{NA}}\left(\exp\frac{\mathbf{I}(\mathcal{G},\mathcal{G}_{\circledcirc}^{(t)})}{\varphi\cdot\mathbf{I}^{\max}}\right)
  end for
  Locate the individual with the largest (𝒢)\mathcal{F}(\mathcal{G}) as 𝒢worst\mathcal{G}^{\text{worst}}
 /* Update the population */
  Update the population 𝐏(t+1)𝐏(t)𝒢worst𝒢(t)\mathbf{P}^{(t+1)}\leftarrow\mathbf{P}^{(t)}\setminus\mathcal{G}^{\text{worst}}\cup\mathcal{G}_{\circledcirc}^{(t)}
 /* Notably, if the generated workflow performs suboptimally, i.e., it does not Pareto dominate any existing workflows, it is unlikely to be accepted into the population. */
end for

Appendix C Optimization Objective

For a better understanding of the multi-objective optimization in the context of agentic workflows, here, we define some key concepts like dominance, Pareto optimality, and the Pareto set.

A workflow 𝒢1\mathcal{G}_{1} is said to dominate another workflow 𝒢2\mathcal{G}_{2} if and only if:

i{1,2},fi(𝒢1)fi(𝒢2),andisuch thatfi(𝒢1)>fi(𝒢2),\forall i\in\{1,2\},\;f_{i}(\mathcal{G}_{1})\geq f_{i}(\mathcal{G}_{2}),\;\text{and}\;\exists i\;\text{such that}\;f_{i}(\mathcal{G}_{1})>f_{i}(\mathcal{G}_{2}), (18)

where f1()=u(,T)f_{1}(\cdot)=u(\cdot,T) represents the utility or performance metric, and f2()=c(,T)f_{2}(\cdot)=-c(\cdot,T) denotes the negative system cost. This means 𝒢1\mathcal{G}_{1} performs at least as well as 𝒢2\mathcal{G}_{2} in all objectives and strictly better in at least one objective.

A workflow 𝒢(,)\mathcal{G}^{\star}\in\mathcal{H}(\mathcal{I},\mathcal{E}) is considered Pareto optimal if there does not exist any other workflow 𝒢(,)\mathcal{G}^{\prime}\in\mathcal{H}(\mathcal{I},\mathcal{E}) that dominates 𝒢\mathcal{G}^{\star}. The collection of all Pareto optimal workflows forms the Pareto set:

𝒢PF={𝒢(,)𝒢(,),𝒢dominates𝒢}.\mathcal{G}^{*}_{\text{PF}}=\left\{\mathcal{G}\in\mathcal{H}(\mathcal{I},\mathcal{E})\mid\nexists\mathcal{G}^{\prime}\in\mathcal{H}(\mathcal{I},\mathcal{E}),\mathcal{G}^{\prime}\;\text{dominates}\;\mathcal{G}\right\}. (19)

The corresponding objective space of these workflows defines the Pareto front (PF), which represents the trade-off surface between performance and cost:

PF={𝐟(𝒢)=[u(𝒢,T),c(𝒢,T)]𝒢𝒢PF}.\text{PF}=\left\{\mathbf{f}(\mathcal{G})=[u(\mathcal{G},T),-c(\mathcal{G},T)]^{\top}\mid\mathcal{G}\in\mathcal{G}^{*}_{\text{PF}}\right\}. (20)

In the context of agentic workflows, identifying Pareto optimal solutions is critical as it enables the selection of workflows that provide the best possible trade-off between task performance and system cost. These solutions ensure that the agents, composed of invoking nodes and operator nodes, operate efficiently while maintaining high utility for the target tasks. Furthermore, the Pareto set provides diverse design options, offering flexibility in adapting workflows to varying operational constraints and objectives.

Appendix D Operator Repository

In this section, we detail the initialization of operator nodes, which can be categorized into the following seven types:

  1. 1.

    Chain-of-Thought (CoT). CoT (Wei et al., 2022) reasoning encourages the LLM to think step by step rather than directly outputting an answer. This approach enhances its capability to solve complex problems through intermediate reasoning steps, improving task handling and providing greater transparency in the decision-making process.

  2. 2.

    LLM-Debate. LLM-Debate (Du et al., 2023) allows multiple LLMs to debate, leveraging diverse perspectives to identify better solutions. In practice, we initialize three debaters and permit up to two debate rounds.

  3. 3.

    Take a Step Back. As proposed by Zheng et al. (2023b), this operator prompts the LLM to first consider the principles underlying the task. By focusing on foundational principles, the model enhances its reasoning and delivers more accurate solutions.

  4. 4.

    Self-Consistency. Adopting the methodology from Wang et al. (2023a), this operator aggregates five CoT reasoning paths and determines the final answer through majority voting.

  5. 5.

    Self-Refine. Following Madaan et al. (2023), this operator initially generates an answer using CoT reasoning, then prompts the agent to self-reflect iteratively. We set a maximum of five refinement iterations.

  6. 6.

    Ensemble. Inspired by LLM-Blender (Jiang et al., 2023), this operator involves three LLM-powered agents from different sources outputting answers to the same query. The pairwise ranking is used to evaluate and aggregate their responses into a final solution.

  7. 7.

    ReAct. Following (Yao et al., 2023b), this operator enables the agent to leverage versatile tools, including code interpreter, web searching, external knowledge database, etc., to handle diverse user demands.

  8. 8.

    ExpertPrompt. Similar to AutoGPT (Richards & et al., 2023) and expert prompting (Xu et al., 2023), this operator employs dynamic control flows to allow the agent to decide which expert should be utilized for the task.

We respectfully note that the selection of these operators is highly customizable, allowing users the flexibility to incorporate their desired operators into the operator repository of EvoFlow.

Appendix E Prompt Repository

E.1 Tag Generation Prompt

Tag generation TAG_PROMPT = """ **Workflow Information** - **Name:** {NAME} - **Description:** {DESCRIPTION} - **Code:** {CODE} **Your Task** This workflow is designed to address specific problems in the MATH dataset, which contains challenging, competition-level mathematics problems. Please generate five relevant tags for this workflow, focusing on the academic disciplines involved and the workflows level of complexity. Here is the task this workflow has successfully solved: {TASK} **Your goal is to design tags for this workflow so that, when a similar task arises, the workflows tags will have the highest cosine similarity score with the new tasks tags.** **Examples** 1. **Example 1** - **Code:** {MATH} - **Tags:** Right Triangle, Intermediate Combinatorics, Intermediate Computational Mathematics, Intermediate Permutations, Intermediate Geometry 2. **Example 2** - **Code:** {CUSTOM} - **Tags:** Number Theory, Integer Properties, Relatively Prime, Prime Factors, Simple Mathematical Problems **Output Format** - Provide **5 tags**, separated by commas. - Tags should reflect the primary academic disciplines or difficulty level associated with the MATH dataset. **Guidelines** 1. **Focus Areas:** - **Academic Disciplines:** Identify the main fields related to the MATH dataset (e.g., Linear Algebra, Mathematics, Calculus). - **Problem Difficulty:** Assess the complexity level of the problems (e.g., Beginner, Intermediate, Advanced). 2. **Formatting:** - Do not include any additional text or explanations. - Ensure the output is a single line containing exactly five tags. **Important Notes** - **Avoid General Tags:** Do not use overly broad tags such as Artificial Intelligence, Natural Language Processing, or Cognitive Science. - **Relevance to MATH:** Ensure the tags are specifically relevant to the MATH datasets focus on mathematical problems and their difficulty levels. **WRONG Implementation Examples** 1. Artificial Intelligence, Natural Language Processing, Reasoning Systems, Advanced Problem Solving, Cognitive Science, Multi-Agent System, AI-enhanced Problem Solving, Problem Solving - *Issue:* These tags are too general and do not focus on the difficulty level or specific academic disciplines related to the MATH dataset. """

E.2 Offspring Generation Prompt

Offspring generation PROMPT = """ You are an expert machine learning researcher specializing in the design of agent-based workflows. Your goal is to optimize existing architectures and create a highly efficient, effective, and economically viable multi-agent workflow that solves a specific query from the MATH dataset, which contains challenging, competition-level mathematics problems. Leverage your extensive knowledge of LLM prompting techniques and agent workflows from existing literature to analyze the provided architectures. Extract valuable insights and lessons, and draw inspiration from related LLM agent papers or research in other fields to design a novel, creative architecture. THINK OUTSIDE THE BOX. ## Query: Your task is to develop an improved multi-agent workflow that surpasses all existing workflows in accurately and efficiently solving the following query. Consider the difficulty, complexity, and discipline of the query to structure an innovative multi-agent workflow best suited to solve it. {QUERY} ## Reference Multi-Agent Workflow: You have several multi-agent workflow designs to serve as references. {PARENTS} ## Multi-Agent Communication Structure Design Instructions: To improve the efficiency, effectiveness, and cost-effectiveness of communication within the Multi-Agent workflow, refer to the following communication structures when designing the workflow. Successful implementations typically do not rely on complex frameworks or specialized libraries. Instead, they emphasize building with simple, composable patterns. Below are several structures you can consider. You are also encouraged to use your imagination and logical thinking to design even more suitable structures for solving the specific task: {STRUCTURES} ## Output Instruction: {OUTPUT_INSTRUCTION} Your response should be in JSON format, adhering to the structure demonstrated in the example below: {EXAMPLE} ## Common Mistakes: Here are some common mistakes you might make: {WRONG_IMPLEMENTATION} """

E.3 Mutation Prompt

E.3.1 LLM Mutation

LLM Mutation """ 1. **Large Language Model Mutation** You can replace the LLM backbone that initializes the operators. Your options are limited to the following 4 choices: - meta-llama/llama-3.1-70b-instruct - qwen/qwen-2.5-72b-instruct - deepseek/deepseek-chat-v2.5 - nousresearch/hermes-3-llama-3.1-70b """

E.3.2 Prompt Mutation

Prompt Mutation """ 2. **Prompt Mutation** You can modify the prompts used by invoking nodes, such as incorporating few-shot examples or clarifying task instructions. Prompt mutation can enhance the clarity of the agents output. You can also create specific prompts to guide the operator in generating a logical response or facilitate communication between operators. - Write your own prompt and use it in the Custom method within the workflow: ‘‘‘python INSTRUCTION_PROMPT = ’’’Provide a comprehensive, step-by-step solution to the given mathematical problem. Utilize existing mathematical knowledge to solve the problem. Your response should include: 1. A clear restatement of the problem. 2. An explanation of the mathematical concepts and theorems involved. 3. A detailed, logical progression of steps leading to the solution. 4. Clear explanations for each step, including the reasoning behind it. 5. All mathematical expressions and equations in LaTeX format. 6. Visual aids or diagrams if applicable (described in text). 7. Make sure the final answer displayed in a boxed LaTeX format." response = await self.custom(input=task, instruction=INSTRUCTION_PROMPT) ’’’ ‘‘‘ - You can also concatenate previously generated string results in the input to provide more comprehensive contextual information: ‘‘‘python response = await self.custom(input=task + f"xxx:{{xxx}}, xxx:{{xxx}}", instruction=INSTRUCTION_PROMPT) ‘‘‘ The output from the Custom method can be placed anywhere in the workflow: ‘‘‘python solution = await self.generate(problem=f"Here is the task: {{task}}, here is the response from other operators:{{response[’response’]}}") ‘‘‘ **Note**: - Avoid using single quotes in your code, as they may cause execution errors. - In the custom method, the input and instruction are directly concatenated (instruction + input), and placeholders are not supported. Be sure to handle concatenation externally and add comments where necessary. """

E.3.3 Operator Mutation

Operator Mutation """3. **Operator Mutation** You can add or remove operators from the existing reference workflows. Consider their performance and compatibility with the given task. Below are descriptions of the operators you can use. Initialize and call them properly, writing appropriate prompts to organize them and ensure they collaborate efficiently to solve the task. {OPERATORS} Additionally, remember to initialize operators in the __init__ function before calling them! """ OPERATORS = {OPERATORS} """

Appendix F History Management of EvoFlow

F.1 LLM Experience Pool

To evaluate the historical performance of LLMs within agentic workflows, we construct an experience pool, denoted as 𝒫LLM\mathcal{P}_{LLM}. This pool captures the interplay between LLM instances, prompts, and workflow configurations, providing a foundation for analyzing and refining their performance across diverse tasks.

𝒫LLM\mathcal{P}_{LLM} captures both quantitative and qualitative evaluations of LLM’s behavior across workflows. For a given workflow 𝒢k\mathcal{G}_{k} associated with task qq and ground-truth answer aa, the performance of an LLM MiM_{i} is represented as LLM(Mi,𝒢k)=(LLM,𝒞LLM)\mathcal{F}_{LLM}(M_{i},\mathcal{G}_{k})=(\mathcal{R}_{LLM},\mathcal{C}_{LLM}), where LLM{Positive,Negative,None}\mathcal{R}_{LLM}\in\{\text{Positive},\text{Negative},\text{None}\} denotes a quantitative assessment of the LLM’s output correctness. Specifically, Positive indicates that MiM_{i} produced a correct answer, Negative indicates an incorrect answer, and None signifies that MiM_{i} was not utilized in 𝒢k\mathcal{G}_{k}. Additionally, 𝒞LLM\mathcal{C}_{LLM} provides a qualitative evaluation, offering detailed textual feedback on MiM_{i}’s role in the workflow, including how its behavior contributed to or detracted from solving the task. The overall experience pool is thus defined as 𝒫LLM=i=1||{(Mi,{(𝒢k,LLM,𝒞LLM)𝒢k})}\mathcal{P}_{LLM}=\bigcup_{i=1}^{|\mathcal{M}|}\{(M_{i},\{(\mathcal{G}_{k},\mathcal{R}_{LLM},\mathcal{C}_{LLM})\mid\forall\mathcal{G}_{k}\})\}, aggregating performance data across all workflows and tasks. By capturing both the correctness and the nuanced role of each LLM in addressing diverse tasks, 𝒫LLM\mathcal{P}_{LLM} provides a comprehensive resource for understanding the strengths, weaknesses, and contextual suitability of different LLMs. This facilitates informed decision-making for LLM selection and adaptive workflow optimization.

F.2 Workflow Experience Pool

The workflow experience pool, denoted as 𝒫WF\mathcal{P}_{WF}, systematically captures the historical performance of workflows by maintaining a collection of records in the form of triplets (𝒢k,q,WF)(\mathcal{G}_{k},q,\mathcal{E}_{WF}). Here, 𝒢k\mathcal{G}_{k} represents a specific workflow, 𝒬j\mathcal{Q}_{j} denotes a query or task associated with the workflow, and WF\mathcal{E}_{WF} is the corresponding evaluation of the workflow’s performance on the given query. The evaluation WF=(WF,𝒞WF)\mathcal{E}_{WF}=(\mathcal{R}_{WF},\mathcal{C}_{WF}) consists of two components: a quantitative assessment WF{Positive,Negative}\mathcal{R}_{WF}\in\{\text{Positive},\text{Negative}\}, which indicates whether the workflow successfully solved the query (Positive) or failed (Negative), and a qualitative assessment 𝒞WF\mathcal{C}_{WF}, which provides detailed textual feedback on the workflow’s effectiveness, efficiency, and potential limitations in addressing the query. Formally, the experience pool is defined as 𝒫WF={(𝒢k,𝒬j,WF)𝒢k,𝒬j}\mathcal{P}_{WF}=\{(\mathcal{G}_{k},\mathcal{Q}_{j},\mathcal{E}_{WF})\mid\forall\mathcal{G}_{k},\mathcal{Q}_{j}\}, aggregating evaluations across diverse workflows and queries. By systematically storing and analyzing these triplets, 𝒫WF\mathcal{P}_{WF} offers a comprehensive resource for understanding the capabilities and limitations of various workflows, supporting iterative design refinements and enabling the development of more effective and adaptable agentic systems.

Appendix G Experimental Details

G.1 Dataset Statistics and Splits

Following existing practices in workflow automation (Saad-Falcon et al., 2024; Hu et al., 2024b; Zhang et al., 2024c), we partition each dataset with a train:test ratio of 1:4, except from ALFWorld dataset which follows the settings in (Shang et al., 2024). For the MATH benchmark, it is worth noting that we follow (Hong et al., 2024), selecting 617 problems from four representative problem types (Combinatorics & Probability, Number Theory, Pre-algebra, Pre-calculus) at difficulty level 5. The dataset statistics are concluded in Table 5.

Table 5: Dataset Statistics.
Domain Dataset #Train #Test Metric
Code Generation HumanEval 33 131 pass@1
MBPP 86 341 pass@1
Math Reasoning GSM8K 264 1055 Accuracy
MATH 119 486 Accuracy
MultiArith 150 600 Accuracy
Embodied ALFWorld 230 327 Success ratio

G.2 Baseline Setups

We detail the settings for all baselines in this section:

  1. 1.

    CoT. CoT encourages LLM agents to reason step by step rather than directly producing an answer. We adopt the implementation from (Zhang et al., 2022).

  2. 2.

    ComplexCoT. The implementation is based on the code from https://github.com/FranxYao/Complexity-Based-Prompting/tree/main.

  3. 3.

    Self-consistency. We ensemble five CoT-generated solutions and adopt the implementation from https://github.com/geekan/MetaGPT/blob/4954729e7564c806d7e58b3ed8b00ef991f889cc/metagpt/ext/aflow/scripts/operator.py#L93.

  4. 4.

    LLM-Debate. We utilize five instances of the same LLM, assigning them distinct roles. These agents engage in up to two debate rounds, with the final answer determined via majority voting. Implementation follows https://github.com/ucl-dark/llm_debate.

  5. 5.

    LLM-Blender. The LLM-Blender is powered by two gpt-4o-mini, one Qwen-2.5-72b, and one llama-3.1-70b.

  6. 6.

    DyLAN. We directly adopt the implementation from (Liu et al., 2023).

  7. 7.

    AgentVerse. The implementation is adopted from (Chen et al., 2023d).

  8. 8.

    MacNet. For MacNet (Qian et al., 2024), we select the ”MacNet-MESH” variant, which is essentially a densely connected complete graph.

  9. 9.

    GPTSwarm. We follow the original implementation and settings described in (Zhuge et al., 2024).

  10. 10.

    AutoAgents. The setup adheres to the original settings from (Chen et al., 2023b).

  11. 11.

    ADAS. Implementation details are directly adopted from (Hu et al., 2024b).

  12. 12.

    AgentSquare. We employ the modular search framework from (Shang et al., 2024). The base LLM is consistently set to gpt-4o-mini, with early stopping patience fixed at 5.

  13. 13.

    AFlow. In (Zhang et al., 2024c), AFlow utilizes both gpt-4o-mini and the advanced claude-3.5-sonnet. To ensure fairness in homogeneous settings, we limit AFlow to gpt-4o-mini and set max_iteration=20.

Appendix H Supplementary Results

Table 6: Performance comparison of different methods using various LLM backbones and training datasets. ‘’MATH” and “MBPP” represent individual training datasets, while “MATH+MBPP” indicates training using both datasets combined. The two values under “MATH+MBPP” represent the performance on MATH and MBPP, respectively.
Method LLM Backbone MATH MBPP MATH+MBPP
DyLAN Deepseek-V2.5 46.2046.20 80.1380.13 43.85/78.6243.85/78.62
QWen-2.5-72b 64.1764.17 75.6375.63 60.84/71.3460.84/71.34
GPTSwarm Deepseek-V2.5 45.3645.36 77.5277.52 39.18/74.0939.18/74.09
QWen-2.5-72b 65.2265.22 72.4872.48 64.15/70.9064.15/70.90
AFlow Deepseek-V2.5 48.6548.65 79.1479.14 43.22/77.0243.22/77.02
QWen-2.5-72b 66.3866.38 80.8480.84 64.71/74.9064.71/74.90
EvoFlow LLM Pool 72.9072.90 87.6287.62 72.69/88.3572.69/88.35