IN THIS BREAKDOWN · 10 SECTIONS
You can read 18% of this breakdown.
The paper in one minute
Most LLM applications that work well are workflows: several model calls in a fixed arrangement, such as generating five answers and voting, or writing a solution and checking it with code. People design these by hand for each task. Jiayi Zhang, Jinyu Xiang and colleagues at DeepWisdom and several universities built AFlow to search for them automatically. The paper appeared at ICLR 2025.
AFlow writes each workflow as a short Python program. Its building blocks are nodes, single LLM calls defined by a model, prompt, temperature and output format, and operators, hand-written combinations of nodes for common patterns: Generate, Format, Review and Revise, Ensemble (a self-consistency vote), Test, Programmer, and a Custom node. To keep the search manageable it fixes the model, temperature and format, and searches over prompts and code.
The search is a variant of Monte Carlo tree search in which every tree node is a complete workflow. Each round it selects a workflow, mixing a uniform choice with a preference for high scores and always allowing a restart from the blank template. An LLM optimizer (Claude 3.5 Sonnet) expands it with one change, using a log of earlier edits to that workflow, whether they helped, and logs of its predictions against the expected outputs. The new workflow is evaluated five times on a validation set, and the result is backpropagated into the experience log. After 20 rounds, the best workflow is tested.
With GPT-4o-mini executing, the found workflows beat every hand-designed baseline on all six benchmarks (HotpotQA, DROP, HumanEval, MBPP, GSM8K and a level-5 MATH subset), averaging 80.3 against 76.0 for the best. Workflows found with one model mostly transferred to others, and cheap models running them matched or beat GPT-4o on HumanEval at a small fraction of its cost.
Research notes: the problem, approach and results
average across six benchmarks with GPT-4o-mini, against 76.0 for five-sample self-consistency
the gain over the best hand-designed method, reported as 5.7%, which is the relative figure
of GPT-4o's HumanEval cost for a DeepSeek-V2.5 workflow that tied GPT-4o, per the paper's appendix
Agentic workflows (chains of LLM calls with prompts, voting, review and code checks) are designed by hand for each task. Earlier automatic methods tuned prompts inside a fixed workflow, or searched over whole workflows too inefficiently to find good ones.
Represent the workflow as code calling LLM nodes and reusable operators such as Ensemble, Review and Revise, and Programmer. Search with a Monte Carlo tree: select a workflow, have an LLM edit it using the logged results of earlier edits, run it on a validation set, record the outcome.
On six benchmarks with GPT-4o-mini, the found workflows averaged 80.3 against 76.0 for the best hand-designed method and 67.2 for ADAS. Cheap models running a found workflow matched GPT-4o on HumanEval at a small fraction of its cost.
Why it matters to an FDE
You will build workflows by hand for customers: retrieval, then draft, then check, then format. AFlow is a credible way to search for a better arrangement once you have a scored dataset, and its results line up with what practitioners find by hand.
The winners are familiar. On GSM8K the search settled on five samples, a vote, and a code check. That is self-consistency plus a programmatic verifier. The operator set already contained those ideas. Expect a search like this to recombine your building blocks well, not to invent new ones.
You need an evaluation function first. AFlow works on tasks with a numeric score: exact answers, unit tests, F1. If the customer's task has no automatic score, the search has nothing to climb.
A small validation set will fool you. Picking the best of twenty candidates on a small set inflates the winner's score. Our simulation below shows how much, and how to spend the evaluation budget instead.
Count the search, not just the result. The paper reports what the found workflows cost to run, not what the search cost. Twenty rounds, each run five times on a validation set, plus an optimizer model, is a real bill.
Understand the mechanism. Try it on a real problem.
Unlock this breakdown and 99 more papers.
Premium opens every paper in full, plus every answer, concept, course and guide on the site. One payment for six months of access.
6 months · One payment · No auto-renewal
- ◇1 architecture diagram
- </>1 runnable code experiment
- ▦2 results tables
- ?5 interview questions with answers
- 03Key takeaways
The search space, the four steps, the results, and misreadings to avoid
Free account - 04How it works
The workflow representation, the four MCTS steps, the operator set, and the evaluation setup
Premium - 05The numbers that matter
The gains in points, the cost comparison, the transfer table, and how much each can bear
Premium - 06Try it yourself
Check the selection rule's units, then see how a small validation set inflates the winner
Premium - 07Where it breaks
The limits of the method and of the evidence
Premium - 08Using it on a deployment
Running a workflow search for a customer without fooling yourself
Premium - 09Interview angles
Five questions this paper prepares you for, with answer hints
Premium - 10Read next
Where to go from here on this site
Premium
