EvoFlow: Evolving Diverse Agentic Workflows On The Fly

Guibin Zhang, Kaijie Chen, Guancheng Wan, Heng Chang, Hong Cheng, Kun Wang, Shuyue Hu, Lei BaiarXiv 2025 · DOI

TL;DR

This paper introduces EvoFlow, a novel framework that uses evolutionary algorithms to automatically design diverse and cost-effective multi-agent workflows. Instead of optimizing for a single, complex workflow, EvoFlow generates a population of heterogeneous workflows that adapt to varying query complexities and leverage a mix of LLMs, significantly reducing costs while maintaining high performance.

What Problem Does This Paper Address?

The field of LLM-based multi-agent systems has rapidly advanced from manual design to automated workflow generation. However, current automated approaches often suffer from two key limitations: they tend to use a single, expensive LLM (lack of LLM heterogeneity) and focus on optimizing for a single, complex workflow (lack of complexity diversity). This means they can't effectively leverage the complementary strengths of different LLMs (including smaller, cheaper ones) or adapt to the varying difficulty of user queries, leading to suboptimal performance and high costs. EvoFlow aims to solve this by automatically discovering a diverse set of agentic workflows that are tailored to specific tasks and query complexities, while also being cost-efficient.

Methods

EvoFlow employs a niching evolutionary algorithm to search for agentic workflows. The core components are:

  • Operator Nodes: The fundamental building blocks of workflows, representing LLM-invoking actions. These are defined by the LLM used, its prompt, and temperature.
  • Operator Repository: A predefined set of powerful operator types (e.g., Chain-of-Thought, LLM-Debate, Self-Consistency) that can be combined.
  • Workflow Initialization: The process starts by creating an initial population of workflows by combining operator nodes. Each workflow is assigned "utility tags" that indicate its domain expertise and complexity.
  • Tag-Based Retrieval: For a given query, EvoFlow retrieves relevant parent workflows from the population based on tag similarity.
  • Crossover and Mutation: New "offspring" workflows are generated by combining parent workflows (crossover) and then refining them through mutations. These mutations can alter the LLM used in an operator, modify prompts, or change the operator structure itself.
  • Niching-Based Selection: To maintain diversity and quality, EvoFlow uses a niching selection mechanism. This involves executing candidate workflows, updating their cost and performance records, and then selecting the best-performing ones within identified "niches" (clusters of similar workflows) to form the next generation. This ensures that a range of solutions, from simple to complex, are preserved.

Datasets

EvoFlow was evaluated on six public benchmarks across four domains:

  • Math Reasoning: GSM8K, MATH, MultiArith
  • Code Generation: HumanEval, MBPP
  • Embodied: ALFWorld

The MATH benchmark used a harder subset of 617 problems, focusing on specific problem types and difficulty levels.

Key Insights and Ideas

  • Diversity is Key: Optimizing a single, complex workflow is less effective than generating a diverse population of workflows that can adapt to different query complexities.
  • LLM Heterogeneity Pays Off: Combining various LLMs, including smaller and cheaper ones, can achieve comparable or better performance than using a single, large LLM, at a fraction of the cost.
  • Cost-Performance Trade-off: EvoFlow explicitly frames workflow optimization as a multi-objective problem, balancing performance (accuracy) with cost, leading to Pareto-optimal solutions.
  • Query-Aware Adaptation: The tag-based retrieval and niching selection allow EvoFlow to dynamically select the most appropriate workflow (simple and cheap for easy queries, complex and powerful for hard ones) from its evolved population.

Key Results

  • High Performance: EvoFlow outperformed previous handcrafted and automated workflows by 1.23% to 29.86% in homogeneous settings (using the same base LLM for all methods).
  • Economical: EvoFlow achieved this performance while using only 12.4% of the inference cost of the powerful o1-preview system, by leveraging weaker open-source models.
  • Cost Savings: Training EvoFlow was significantly cheaper than baselines like AFlow (one-third the cost), and inference costs were also substantially lower (one-fifth).
  • Diverse Workflows: EvoFlow successfully evolved a population of workflows ranging from simple I/O tasks to complex multi-turn interactions.

Limitations and Future Work

  • Computational Cost of Evolution: While EvoFlow is cost-effective at inference, the evolutionary process itself can be computationally intensive.
  • Operator Customization: The paper notes that users can easily customize operator templates, suggesting future work could explore more automated ways to discover or generate novel operators.
  • Generalizability: While tested across diverse domains, further exploration of EvoFlow's performance on a wider range of tasks and problem types would be beneficial.

Summary updated

BibTeX
@misc{zhang2025evoflow,
  author = {Guibin Zhang and Kaijie Chen and Guancheng Wan and Heng Chang and Hong Cheng and Kun Wang and Shuyue Hu and Lei Bai},
  title = {{EvoFlow: Evolving Diverse Agentic Workflows On The Fly}},
  year = {2025},
  eprint = {2502.07373},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.07373},
}
Figure