← Latest papers
💬 NLP

SEW: Self-Evolving Agentic Workflows for Automated Code Generation

The paper introduces SEW, a self-evolving framework that automatically generates and optimizes multi-agent workflows for complex code generation tasks, achieving significant performance improvements over baseline models without relying on manually designed prompts or topologies.

Original authors: Siwei Liu, Jinyuan Fang, Han Zhou, Yingxu Wang, Zaiqiao Meng

Published 2026-04-15
📖 4 min read☕ Coffee break read

Original authors: Siwei Liu, Jinyuan Fang, Han Zhou, Yingxu Wang, Zaiqiao Meng

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are trying to build a complex piece of furniture, like a high-tech bookshelf, but you only have a single, very smart robot arm. That robot arm is a Large Language Model (LLM). It's brilliant at following instructions, but if you give it a massive, complicated blueprint all at once, it might get confused, miss a step, or build the shelf upside down.

In the past, to fix this, human experts would manually design a "team" of robots. They would say, "Robot A, cut the wood. Robot B, sand it. Robot C, paint it." They would write specific instructions (prompts) for each robot and draw a flowchart (workflow) connecting them.

The Problem:
The problem with this old way is that it's like using the same team of robots to build a bookshelf, a spaceship, and a cake. It doesn't work well because every job is different. Also, humans have to spend hours manually designing these teams and rewriting the instructions every time the job changes. It's slow and rigid.

The Solution: SEW (Self-Evolving Workflow)
The paper introduces SEW, which is like giving the robot team a "brain" that can teach itself how to organize itself.

Instead of a human drawing the flowchart and writing the instructions, SEW is a system that:

  1. Starts with a rough idea: It creates a basic team of robots to solve the coding problem.
  2. Self-Imitates and Evolves: It acts like a biological organism. It tries the job, sees where it failed, and then "mutates" its own instructions.
    • Analogy: Imagine a chef who tastes a soup, realizes it needs more salt, and then writes a new recipe for themselves. But SEW does this for the entire team structure, not just the recipe.
  3. Two Types of Evolution:
    • Workflow Evolution: It rearranges the team. Maybe it decides, "We don't need a painter; we need a quality inspector first." It changes the flowchart automatically.
    • Agent Evolution: It rewrites the specific instructions for each robot. Maybe it tells the "Code Generator" robot, "Stop being so literal; try to be more creative and check your math twice."

The "Language" of the Team
To talk to the robots, the system needs a language. The paper tested five different "languages" to describe how the team should work:

  • BPMN: Like a formal business flowchart.
  • Python: Actual computer code.
  • YAML: A simple list format (like a grocery list).
  • Pseudo-code: "Fake" code that looks like English.
  • CoRE: A special mix of English and code designed specifically for robots to understand.

The Discovery:
The researchers found that CoRE was the best language. It was like finding the perfect dialect that the robots could both read easily and act upon correctly. The other languages were either too confusing (like trying to draw a complex machine with a stick figure) or too rigid.

The Results:
When they tested SEW on difficult coding challenges (like solving math problems or writing complex software functions):

  • It outperformed the single "super-robot" (the base LLM) by a significant margin (up to 12% better).
  • It beat other advanced methods that required humans to manually tweak the teams.
  • It proved that if you let the AI "evolve" its own team structure and instructions, it gets much better at solving hard problems than if a human tries to micromanage it.

In a Nutshell:
SEW is a system that stops treating AI like a tool you have to manually calibrate every time. Instead, it treats the AI like a self-improving startup. It hires its own employees, writes its own job descriptions, draws its own org chart, and constantly fires and rehires itself until it finds the perfect team to solve the problem. It's the difference between a human manager trying to run a factory and the factory robots organizing themselves to build the perfect product.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →