SEW: Self-Evolving Agentic Workflows for Automated Code Generation Corresponding author.

Siwei Liu, Jinyuan Fang, Han Zhou, Yingxu Wang, Zaiqiao Meng · 2025

Read SEW: Self-Evolving Agentic Workflows for Automated Code Generation Corresponding author. by Siwei Liu, Jinyuan Fang, Han Zhou, Yingxu Wang, Zaiqiao Meng (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2505-18646.txt.

Introduction

Siwei Liu, Jinyuan Fang, Han Zhou, Yingxu Wang, and Zaiqiao Meng let AI teams design their own work plans in a 2025 paper. Multi-agent systems split coding tasks among specialist agents. Their work plans are still drawn by hand in most projects. Hand plans adapt poorly to new kinds of coding tasks.

Their frame, SEW, grows and tunes its own work plans. It encodes each plan as text that the system can rewrite. Tests ran on three coding benchmarks, one of them very hard. Auto-grown plans beat the base model alone by up to 12 percent. That top gain came on the hardest benchmark, LiveCodeBench. The team also maps which text forms best hold plan data.

Catalog record

CREATORSiwei Liu, Jinyuan Fang, Han Zhou, Yingxu Wang, Zaiqiao Meng
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE56 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2505-18646

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

SEW: Self-Evolving Agentic Workflows for Automated Code Generation Corresponding author. Siwei Liu, Jinyuan Fang, Han Zhou, Yingxu Wang, Zaiqiao Meng Abstract Large Language Models (LLMs) have demonstrated effectiveness in code generation tasks. To enable LLMs to address more complex coding challenges, existing research has focused on crafting multi-agent systems with agentic workflows, where complex coding tasks are decomposed into sub-tasks, assigned to specialized agents. Despite their effectiveness, current approaches heavily rely on hand-crafted agentic workflows, with both agent topologies and prompts manually designed, which limits their ability to automatically adapt to different types of coding problems. To address these limitations and enable automated workflow design, we propose S elf- E volving W orkflow ( SEW ), a novel self-evolving framework that automatically generates and optimises multi-agent workflows. Extensive experiments on three coding benchmark datasets, including the challenging LiveCodeBench, demonstrate that our SEW can automatically design agentic workflows and optimise them through self-evolution, bringing up to 33% improvement on LiveCodeBench compared to using the backbone LLM only. Furthermore, by investigating different representation schemes of workflow, we provide insights into the optimal way to encode workflow information with text 1 1 1 The implementation of SEW can be found at https://github.com/EvoAgentX/EvoAgentX. . 1 Introduction Large Language Models (LLMs) have demonstrated remarkable capabilities in automatic code generation, enabling developers to translate natural language descriptions into executable programs Hong et al. 2023 ; Liu et al. 2024a . However, as coding tasks grow in complexity, relying on a single LLM instance (single-agent) to handle all aspects of code generation becomes increasingly challenging. To address this, recent studies have explored multi-agent systems Huang et al. 2023 ; Islam et al. 2024 where multiple LLM-powered agents collaborate to solve intricate problems through structured workflows Hong et al. 2023 . These multi-agent systems decompose complex programming tasks into sub-tasks, assigning them to specialized agents with tailored prompts, enhancing execution and output quality. Figure 1: Illustration of agent and workflow evolution in code generation. The initialized setup (left) includes agents with naive prompts while the evolved setup (right) is equipped with enhanced prompts generated by SEW and a more sophisticated workflow structure. Despite their effectiveness, current multi-agent systems rely heavily on manually designed workflows, where both the workflow topology and agents’ prompts are manually crafted , hindering their adaptability to more complex coding task . For instance, a workflow optimised for machine learning task Chi et al. 2024 differs significantly from one tailored for software development task Qian et al. 2023 . Manually crafting workflows for each task is inefficient and does not leverage LLM’s full potential for autonomous adaptation. To address these limitations, we propose S elf- E volving W orkflow ( SEW ), a novel framework designed to automatically generate and optimise multi-agent workflow. In particular, SEW achieves this by leveraging a novel evolutionary scheme to improve the workflow, i.e., the topology of workflows and the prompt of each agent. Figure 1 shows the agent and workflow evolution in code generation. In addition, to effectively represent agentic workflows in textual format, we explore and compare five different representation schemes, namely BPMN White 2004 , CoRE Xu et al. 2024b , Python code Zhang et al. 2024c , YAML Zhang et al. 2024b , and pseudo-code Xiao et al. 2024 . We evaluate each scheme based on how well it can be interpreted and optimised by our SEW framework, aiming to identify the optimal scheme for workflow representation and optimization. Our contributions are: (1) We investigate different workflow representation schemes, such as BPMN, Python, CoRE, YAML, and pseudo-code, to determine the most effective format for LLM interpretation; (2) Unlike prior work that builds agents by assembling predefined operators, our framework automatically constructs agentic workflows from scratch, conditioned solely on task descriptions. (3) We introduce a self-evolving workflow design approach, SEW, where LLMs jointly improve workflow structures and agent prompts to optimise performance; (4) We conduct extensive experiments on three benchmark datasets, including MBPP, HumanEval, and LiveCodeBench, demonstrating that SEW can consistently improve workflow performance through self-evolution. 2 Related Work 2.1 Workflow Representations in Agents In multi-agent systems, workflows establish structured information flows and task execution pipelines, enabling agents to solve complex problems Hong et al. 2023 ; Gao et al. 2024 . While natural language can describe workflows, its inherent ambiguity often leads to inconsistent interpretations, hindering precise task execution across agents Xu et al. 2024b . To address this challenge, several studies have introduced specific representation schemes for SOPs. For example, Business Process Model and Notation (BPMN) White 2004 is a graphical modeling language designed to depict workflows by specifying the execution order of activities. Similarly, Code Representation and Execution (CoRE) Xu et al. 2024b provides a unified framework that integrates natural language programming, pseudo-code, and flow-based programming to improve workflow representation and execution. Additionally, Python code Zhang et al. 2024c ; Xu et al. 2024a , YAML Qiao et al. 2023 ; Zhang et al. 2024b , and pseudo-code Xiao et al. 2024 ; Li et al. 2025 are also commonly employed to define and manage agentic workflows. Figure 2: The overall framework of SEW. The process begins with workflow generation , followed by workflow evolution . Then each agent within the evolved workflow will be equipped with enhanced prompts generated by the agent evolution module. Such an agent evolution module is driven by the Direct Evolution (DE) operator and Hyper Evolution (HE) operator, leveraging LLMs, where we use a mutation prompt \mathcal{T}_{mut} or a hyper-mutation prompt \mathcal{T}_{hmut} to enhance the prompt of an agent . 2.2 Self-Evolving Agents Existing agentic methods often yield suboptimal responses when prompts are poorly constructed. To address this, prompt optimization techniques Zhou et al. 2022 ; Fernando et al. 2024 ; Agarwal et al. 2024 ; Liu et al. 2024b have moved beyond static, manually crafted in-context prompts. For instance, automatic prompt engineer (APE) Zhou et al. 2022 enhances prompts by searching through a pool of candidates. Similarly, Promptbreeder Fernando et al. 2024 employs LLMs to mutate and evolve a population of task-specific prompts. MIPRO Opsahl-Ong et al. 2024 is an optimizer designed to enhance multi-stage language model programs by refining both instructions and few-shot examples for each module. In multi-agent systems, recent studies have explored the evolution of agentic workflows and topologies Zhang et al. 2024a ; Zhou et al. 2024 ; Zhou et al. 2025 ; Zhang et al. 2025 . For example, MASS Zhou et al. 2025 exploits the optimization of both prompt and workflow over a configurable topology space. Similarly, AFlow Zhang et al. 2024a employs a Monte Carlo Tree Search to enhance workflow efficiency, while EvoFlow Zhang et al. 2025 introduces a framework for the automated search of heterogeneous agentic workflows. EvoAgent Yuan et al. 2024 is designed to automatically extend expert agents into multi-agent systems using evolutionary algorithms. In contrast, our SEW introduces a self-evolving mechanism that leverages diverse workflow representation schemes, jointly optimising prompts for both agents and their workflow. 3 SEW Task Definition. We focus on the task of code generation, a task that requires multi-agent collaboration Hong et al. 2023 , aiming to produce executable code based on a textual coding problem. To tackle this task, we deploy an LLM-based

Read the complete text