From Search to Synthesis: Training LLMs as Zero-Shot Workflow Generators

Gan Luo, Zihan QinBing DongWotao Yin · 2026

Read From Search to Synthesis: Training LLMs as Zero-Shot Workflow Generators by Gan Luo, Zihan QinBing DongWotao Yin (2026) 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-2606-30704.txt.

Introduction

Gan Luo and three colleagues train language models to write workflows, step-by-step recipes that solve a whole class of tasks. Single answers from a model vary by instance and are hard to debug. Workflows add structural consistency and reusability, but designing them by hand takes expertise. Earlier automatic methods either solved single instances without learning task-level patterns, or failed to generalise beyond their training setup.

Their system, MetaFlow, treats workflow generation as meta-learning: given a task and a set of allowed building blocks, the model composes a strategy. Training runs in two stages: supervised fine-tuning on synthetic workflows, then reinforcement learning with verifiable rewards, where execution feedback grades each workflow. Across question answering, code generation and maths reasoning benchmarks, MetaFlow matched baselines on trained tasks in a single pass. It also generalised to unseen tasks and new building-block sets with no retraining.

Catalog record

CREATORGan Luo, Zihan QinBing DongWotao Yin
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE91 KB
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2606.30704

Browse the full library · About the Tower of Babel

Full text

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

From Search to Synthesis: Training LLMs as Zero-Shot Workflow Generators Gan Luo, Zihan QinBing DongWotao Yin Abstract Large language models (LLMs) excel across a wide range of tasks, yet their instance-specific solutions often lack the structural consistency needed for reliable deployment. Workflows that encode recurring algorithmic patterns at the task level provide a principled framework, offering robustness across instance variations, interpretable traces for debugging, and reusability across problem instances. However, manually designing such workflows requires significant expertise and effort, limiting their broader application. While automatic workflow generation could address this bottleneck, existing methods either produce instance-specific solutions without learning task-level patterns, or cannot generalize beyond their training configurations. We present MetaFlow , which casts workflow generation as a meta-learning problem: given a task and an operator set, the model learns to compose solution strategies. MetaFlow trains in two stages: supervised fine-tuning on synthetic workflow data, followed by reinforcement learning with verifiable rewards (RLVR) that uses execution feedback across problem instances in the task to improve end-to-end success. The resulting model produces effective workflows for trained tasks and exhibits strong generalization to untrained tasks and novel operator sets. Across benchmarks in question answering, code generation, and mathematical reasoning, MetaFlow achieves performance comparable to state-of-the-art baselines on in-domain tasks with single inference, while demonstrating remarkable zero-shot generalization capabilities on out-of-domain tasks and operator sets. 1 Introduction Large Language Models (LLMs) have demonstrated significant performance across a wide range of tasks, including code generation, question answering, and mathematical reasoning ( 1 ; 3 ; 33 ; 6 ; 5 ; 15 ; 4 ; 23 ; 36 ) . However, because these models generate instance-specific solutions, they lack the structural consistency and transparency needed for reliable deployment, while also being difficult to adapt to similar tasks. Workflows that encode recurring algorithmic patterns provide a principled alternative, decomposing complex challenges into structured, manageable steps. However, manually designing such workflows requires significant expertise and effort, limiting their broader application. To address this challenge, recent effort have focused on the automatic workflow generation ( 16 ; 19 ; 25 ; 34 ) . Endowing LLMs with this strategy planning capability means lowering the barrier for complex task automation from requiring manual programming by experts to merely providing high-level task descriptions, thereby greatly liberating productivity. Nevertheless, representing the workflow as static graph ( 37 ) or neural network ( 20 ) in many of these methods limits the flexibility of generatable workflows. A promising direction emerges from works like ADAS ( 14 ) , AFlow ( 35 ) , ScoreFlow ( 28 ) and FlowReasoner ( 9 ) , which represent workflows as code (a structured combination of predefined operators ), making the automatic generation of workflows more flexible and expressive, where operator is an encapsulation of common agentic operations introduced by 35 . Within this code-based framework, current approaches adopt two different paradigms for workflow generation. Figure 1: Illustration of instance-level , task-level , and meta-level (ours) workflow generation approaches. Unlike instance-leve methods that generate workflows for individual problems or task-level methods that require costly search for each new task, our meta-learning approach enables zero-shot workflow generation across tasks. The first paradigm comprises task-level approaches, exemplified by ADAS ( 14 ) and AFlow ( 35 ) , which formulate workflow generation as a search problem within predefined task-operator set combination. Both methods employ iterative search strategies, with ADAS using evolutionary algorithms and AFlow using Monte Carlo Tree Search (MCTS), to discover high-performing workflows through repeated refinement. However, this search-based paradigm inherently constrains them to specific task and predetermined operator set. When encountering new tasks or operators, these methods require complete re-optimization from scratch, incurring substantial computational costs ( 28 ) . Conversely, the second paradigm consists of instance-level approaches, exemplified by ScoreFlow ( 28 ) and FlowReasoner ( 9 ) , which generate workflows tailored to individual problem instances in the task. Both methods dynamically construct workflows at inference time, with ScoreFlow leveraging gradient-based optimization to refine agentic workflows, and FlowReasoner employing reasoning chains distilled from advanced models to design query-specific multi-agent systems. While these instance-level methods excel at tailoring workflows to specific problem instances, this granularity comes at the cost of reusability and deployment efficiency. They cannot capture task-level patterns that recur across similar problem instances, leading to redundant workflow generation for each query. In deployment scenarios, this approach foregoes the benefits of having optimized, reusable workflow templates that could be consistently applied to entire task. The limitations of existing paradigms underscore two fundamental challenges that must be addressed to achieve truly general-purpose automatic workflow generation. (1) How can we overcome the re-optimization requirement of task-level approaches when facing new domains (task-operator set combinations)? (2) How can we learn generalizable patterns that avoid redundant instance-level generation while adapting effectively to untrained domains? To systematically overcome the challenges, we propose MetaFlow , which formulates workflow generation as a meta-learning problem. As illustrated in Figure 1 , unlike task-level search-based methods that require expensive re-optimization for new task-operator set combinations, and instance-level methods that generate workflows for individual queries, MetaFlow learns to directly synthesize workflows from task descriptions and operator set specifications, enabling zero-shot generation through a single model inference. To achieve robust zero-shot generalization, MetaFlow employs a two-stage training paradigm with diverse task-operator pairs. Adopting the code-based workflow representation from prior works ( 14 ; 35 ; 28 ; 9 ) , we first synthesize thousands of workflows using Qwen-Max ( 26 ) across four tasks and a single operator set to finetune Qwen3-8B ( 32 ) , establishing the foundation for understanding how tasks and operators relate to workflow structures. Subsequently, we apply online reinforcement learning with GRPO ( 24 ) across expanded domains, where execution feedback on problem instances directly optimizes the generation policy. This training ensures the model learns generalizable workflow construction principles rather than memorizing patterns. At inference, MetaFlow zero-shot generates effective workflows for novel configurations with only a single forward pass. Our main contributions are: • Meta-learning Framework : We introduce MetaFlow , a novel approach that reformulates workflow generation from discrete search within fixed configurations to continuous learning across diverse task-operator set combinations. By conditioning workflow generation on task descriptions and operator specifications, our framework achieves strong zero-shot generalization to unseen domains without any re-optimization, reducing computational cost from thousands of API calls to a single model inference. • Scalable Training Pipeline : We design a two-stage training framework combining supervised learning with online reinforcement learning, utilizing diverse domains to ensure robust generalization to untrained domains. • Comprehensive Evaluation : Extensive experiments demonstrate that MetaFlow achieves competitive performance on in-domain benchmarks while exhibiting remarkable zero-shot generalization to out-of-domain task classes and operator sets, including solving programming problems with novel operator combinations never seen during training and solving question answering problem using the vector database search operator. 2 Related Works 2.1 Agentic Workflow Agentic workflows decompose complex tasks into structured steps through predefined operators and dependencies ( 35 ; 28 ; 9 ) . Unlike autonomous agents that learn through environment interaction ( 37 ; 11 ) , workflows provide interpretable and consistent execution patterns. Recent works adopt code-based representations for superior expressiveness ( 14 ; 35 ; 28 ; 9

Read the complete text