AFlow: Automating Agentic Workflow Generation

Jiayi Zhang, Jinyu Xiang, Zhaoyang Yu, Fengwei Teng, Xiong-hui Chen, Jiaqi Chen, Mingchen Zhuge, Xin Cheng, Sirui Hong, Jinlin Wang, Bingnan Zheng, Bangbang Liu, Yuyu Luo, Chenglin Wu

arXiv:2410.10762 · 2026-07-27 공개 · arXiv · PDF

benchmark-datasets cost-efficiency agentic-workflows execution-feedback workflow-optimization monte-carlo-tree-search automated-framework llm-invoking-nodes

Abstract

Large language models (LLMs) have demonstrated remarkable potential in solving complex tasks across diverse domains, typically by employing agentic workflows that follow detailed instructions and operational sequences. However, constructing these workflows requires significant human effort, limiting scalability and generalizability. Recent research has sought to automate the generation and optimization of these workflows, but existing methods still rely on initial manual setup and fall short of achieving fully automated and effective workflow generation. To address this challenge, we reformulate workflow optimization as a search problem over code-represented workflows, where LLM-invoking nodes are connected by edges. We introduce AFlow, an automated framework that efficiently explores this space using Monte Carlo Tree Search, iteratively refining workflows through code modification, tree-structured experience, and execution feedback. Empirical evaluations across six benchmark datasets demonstrate AFlow's efficacy, yielding a 5.7% average improvement over state-of-the-art baselines. Furthermore, AFlow enables smaller models to outperform GPT-4o on specific tasks at 4.55% of its inference cost in dollars. The code is available at https://github.com/FoundationAgents/AFlow.

한국어 요약

한 줄 요약

AFlow는 Monte Carlo Tree Search를 활용해 LLM 기반 작업 흐름을 자동 생성하고 최적화하는 프레임워크로, 기존 방법 대비 5.7% 성능 향상과 4.55%의 저비용으로 GPT-4o를 초과한다.

핵심 기여도

핵심 아이디어

AFlow는 LLM 작업 흐름을 노드와 엣지로 구성된 그래프로 모델링하고, 이를 탐색 공간으로 정의한다. 각 노드는 LLM 실행을 나타내고, 엣지는 논리적 흐름, 조건, 의존성을 포함한다. 이 구조는 다양한 작업에 대한 복잡한 상호작용을 포착할 수 있는 유연한 표현 방식을 제공한다.

기존 연구는 흐름 최적화를 일정한 힌트나 수동 설정에 의존했으나, AFlow는 MCTS를 사용해 자동 탐색을 가능하게 한다. 특히, AFlow는 'Ensemble', 'Review & Revise'와 같은 공통 작업 패턴을 포함하는 '오퍼레이터'라는 개념을 도입해 탐색 효율성을 높인다. 이는 기존 연구에서 다루지 못한 흐름 구조의 다양성을 포괄적으로 표현하는 데 기여한다.

기술적 접근법

주요 결과

의의 및 한계

AFlow는 기존 수동 및 반자동 흐름 설계를 대체하는 첫 단계를 제시하며, LLM의 문제 해결 능력을 최적화하면서도 계산 비용을 절감한다. 특히, 다양한 작업에 대한 유연한 표현과 탐색 알고리즘의 효율성은 실용적 적용 가능성을 높인다.

그러나 AFlow는 여전히 초기 탐색 과정에서 일정 수준의 실행 비용이 발생하며, 복잡한 작업에서는 수렴 속도가 느릴 수 있다. 또한, 오퍼레이터의 사전 정의가 탐색의 유연성에 영향을 줄 수 있어, 더 많은 실험과 개선이 필요하다.

실용적 활용

AFlow는 코드 생성, 데이터 분석, 질문 응답, 의사 결정 등 다양한 도메인에서 LLM의 자동화된 작업 흐름 설계에 활용 가능하다. 특히, GPT-4o보다 저비용으로 동일 또는 우수한 성능을 제공하므로, 비용 효율적인 LLM 활용이 필요한 산업 현장에서 유용할 것으로 기대된다.