AdaptFlow: Adaptive Workflow Optimization via Meta-Learning

Runchuan Zhu, Bowen Jiang, Lingrui Mei, Fangkai Yang, Lu Wang, Haoxiang Gao, Fengshuo Bai, Pu Zhao, Qingwei Lin, Saravan Rajmohan, Dongmei Zhang · DOI

Introduction

To solve complex reasoning tasks, developers increasingly organize Large Language Models (LLMs) into agentic workflows—structured pipelines involving planning, tool use, and self-reflection. However, manually designing these workflows is tedious and often fails to generalize across diverse problem types. While automated search methods exist, they frequently produce static workflows that lack adaptability or suffer from "code bloat."

AdaptFlow introduces a meta-learning framework that automatically designs these workflows using textual gradients. By borrowing the "learning to learn" paradigm from deep learning, AdaptFlow creates a highly generalizable workflow initialization that can rapidly specialize for new, unseen tasks.

Methodology: Textual Gradients and Bi-Level Optimization

Textual-Gradient Optimization

Traditional neural network optimization relies on mathematical gradients to update weights. In the discrete space of Python-based agent workflows, AdaptFlow utilizes textual gradients: LLM-generated critiques and suggestions that refine the workflow's code structure based on performance feedback.

Textual-Gradient Optimization for Agent Workflows

The AdaptFlow Framework

Inspired by Model-Agnostic Meta-Learning (MAML), AdaptFlow employs a bi-level optimization loop to learn a robust starting point for workflows.

AdaptFlow's Bi-level Optimization Framework
  1. Inner Loop (Exploration): Training tasks are clustered into semantically coherent subtasks. For each subtask, the workflow is iteratively refined using LLM feedback. To prevent code bloat, updates are only retained if they strictly improve validation performance.
  2. Outer Loop (Exploitation): The best subtask-specific workflows are aggregated into a shared, global initialization. This step includes a "reflection" phase to analyze failure cases and patch remaining blind spots.
  3. Test-Time Adaptation: When faced with a new task, the system generates a high-level semantic description of the problem to quickly specialize the global workflow before execution.

Evaluation and Key Insights

AdaptFlow was evaluated across eight public benchmarks spanning Question Answering (HotpotQA, DROP), Code Generation (HumanEval, MBPP), and Mathematical Reasoning (GSM8K, MATH, AIME, OlympiadBench).

  • State-of-the-Art Performance: AdaptFlow achieved an overall average score of 68.5, outperforming manual baselines (62.7) and automated search methods like AFlow (65.6).
  • Excellence in Mathematics: The framework showed significant gains in complex reasoning, scoring 61.5% on the MATH dataset compared to 56.2% for the previous best baseline.
  • Model Agnostic: Workflows generated by AdaptFlow transfer effectively across different LLM backbones, including GPT-4o, DeepSeek-V2.5, and Claude-3.5-Sonnet.
  • Stability: The use of a binary continuation signal in the inner loop successfully prevents the common issue of automated agents over-complicating and breaking their own code.

Conclusion

AdaptFlow demonstrates that meta-learning principles are highly effective for optimizing discrete agentic workflows. By treating LLM feedback as a symbolic gradient and implementing a bi-level optimization strategy, the framework provides a scalable path toward self-evolving AI agents capable of rapid adaptation to novel challenges.

Summary updated

BibTeX
@misc{zhu2025adaptflow,
  author = {Runchuan Zhu and Bowen Jiang and Lingrui Mei and Fangkai Yang and Lu Wang and Haoxiang Gao and Fengshuo Bai and Pu Zhao and Qingwei Lin and Saravan Rajmohan and Dongmei Zhang},
  title = {{AdaptFlow: Adaptive Workflow Optimization via Meta-Learning}},
  year = {2025},
  eprint = {2508.08053},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2508.08053},
}
Figure