Tools as Continuous Flow for Evolving Agentic Reasoning

Tairan Huang, Siyu Shang, Qiang Chen, Xiu Su, Yi Chen

TL;DR

When Large Language Models (LLMs) use external tools, they usually plan like someone walking in the dark with a tiny flashlight—picking one discrete tool at a time and hoping they don't hit a wall ten steps later. FlowAgent replaces this myopic, step-by-step guessing with continuous flow matching, sketching out an entire future trajectory of tools in a semantic space all at once. By combining big-picture continuous planning with step-by-step real-world feedback, it drastically cuts down cascading errors, generalizes smoothly to brand-new tools, and trains in a fraction of the time of reinforcement learning (RL) methods.

What Problem Does This Paper Address?

Teaching LLMs to use APIs, search engines, and databases turns static text generators into capable agents. Standard approaches—whether via prompting, supervised fine-tuning (SFT), or RL—treat tool selection just like next-token prediction: look at the current context, pick one discrete tool ID, execute it, and repeat.

Figure 1: (a-c) Conceptual illustrations of three limitations observed in discrete tool-reasoning paradigms: limited global perspective, error accumulation, and weak generalization to unseen tools. As evidenced in (d), the performance of the traditional step-wise paradigm is inadequate under the plan-level benchmark, highlighting the need for a paradigm shift toward global plan-level reasoning.

On complex, multi-step tasks, this myopic setup hits three walls:

  1. No global perspective: Optimizing solely for the next action ignores how that choice fits into the rest of the workflow.
  2. Severe error accumulation: One slightly suboptimal tool call changes the environment state, knocking the rest of the reasoning chain off the rails like falling dominoes.
  3. Poor generalization to unseen tools: Treating tools as isolated categorical labels (Tool 1, Tool 2, etc.) hides what they actually do. If a new API shows up at test time, the model struggles to adapt.

Methods

Instead of picking tools one by one from a menu, FlowAgent reframes multi-step planning as continuous trajectory generation inside a semantic embedding space. Every tool is represented not as a rigid ID, but as a vector encoding its functional description and constraints.

Figure 2: The overall framework of FlowAgent, which reconceptualizes discrete tool chaining as continuous trajectory generation to shift from myopic step-wise selection to plan-level reasoning, including Conditional Flow Planner, Constructing Plan Supervision, Discrete Decoding and Execu- tion, and Training Objectives.

Here is how the novel pieces fit together:

  • Conditional Flow Planner: Using conditional flow matching (a generative technique that learns an ordinary differential equation, or ODE, to push simple noise along a smooth velocity field toward a target), FlowAgent generates an entire sequence of future "latent plan anchors" in a single pass. Each anchor represents one future step in the plan.
  • Constructing Continuous Supervision: How do you train a continuous flow on discrete expert logs? The authors embed each step of an expert demonstration (combining tool descriptions, rationales, and past observations via a frozen Qwen2.5-7B-Instruct trunk) into dense vectors, then connect the dots using piecewise linear interpolation to form a smooth target path.
  • Receding-Horizon Execution: FlowAgent doesn't blindly execute its whole daydreamed plan. It decodes the latent anchors into specific tools (based on embedding distance) alongside a learned "stop" probability. Crucially, it executes only the very first tool, observes what actually happened in the real environment, updates its context, discards the rest of the provisional plan, and replans a fresh trajectory.
  • Three-Stage Training: The pipeline trains via (1) Continuous Path Imitation to learn the velocity field, (2) Discrete Plan Decoding (cross-entropy for tool matching and stopping), and (3) Plan-Level Refinement, an RL step optimizing holistic plan utility (balancing accuracy, call cost, cyclic redundancy, and context alignment).

Datasets

Rather than building a brand-new simulator from scratch, the authors unify and standardize four public tool-use benchmarks: $\tau^2$-bench (which supplies the stateful executable environment), ToolBench, API-Bank, and GTA.

Their contribution is a plan-level supervision and evaluation protocol: every observed prefix of an expert trace is paired with its complete remaining trajectory. The unified dataset spans 6,865 tasks, 3,930 tool schemas, and 599 strictly held-out test-only tools, evaluated via strict forward-only execution against real tools, policies, and databases (140 executable trajectories in the main split, scaled up to 800 in extended tests).

Key Insights and Ideas

  • Plan globally, act locally: Why generate a whole multi-step trajectory just to throw away steps $2 \dots L$ after executing step $1$? Ablations comparing FlowAgent to a one-step latent predictor (0.7643 vs. 0.7149 success) and multi-step open-loop execution show you need both: supervising the whole future trajectory forces the first step to be globally coherent, while replanning after every step prevents stale assumptions when database states change.
  • Geometry buys zero-shot tool transfer: Because planning happens in a continuous functional space rather than over fixed IDs, an unseen tool simply lands near functionally similar training tools—allowing the agent to use novel schemas without retraining.
  • Flow regression beats RL rollouts on compute: Discrete agentic RL requires expensive, repeated environment rollouts. Learning a conditional velocity field via direct trajectory regression bypasses rollout bottlenecks while still capturing long-horizon structure.
  • Mathematical guardrails: Under specific geometric and contractive feedback assumptions, the authors prove formal bounds showing that continuous flow errors stay bounded during decoding and closed-loop replanning strictly attenuates error buildup compared to open-loop execution.

Key Results

Main benchmark results showing FlowAgent outperforming SFT, RAG, and RL baselines across Qwen and Llama executors.

Table 1: Main results on our proposed plan-level benchmark. All models are evaluated under a strict forward-execution regime. Highlighted are the results ranked first, second, and third.
  • Execution & Planning: On Qwen2.5-7B-Instruct, FlowAgent achieves 76.43% Overall Success (vs. 65.71% for Standard SFT, 47.86% for ToolRL, and 71.86% for Agent-R1) and 77.45% Tool Exact Match (EM). On Llama-3.2-3B-Instruct, it hits 75.71% Overall Success (vs. 62.14% SFT and 69.29% Agent-R1). Gains hold consistently when scaled up to 14B, 32B, and 70B executors.
  • Unseen Tool Generalization: On strictly held-out tools, FlowAgent reaches 78% planning accuracy on Qwen2.5-7B and 76% on Llama-3.2-3B, roughly 16–20 percentage points ahead of ToolRL and RAG Planning.
  • Training Efficiency: Compared to ToolRL, FlowAgent cuts training time nearly 4x—from 48.75 minutes down to 12.29 minutes—and drops average peak GPU memory from 68.36 GiB to 55.14 GiB.

Limitations and Future Work

  • Inference Latency Overhead: Solving the ODE takes 16 velocity-field evaluations per plan, nudging median end-to-end latency up slightly from 244 ms (SFT) to 270 ms.
  • Conditional Theoretical Guarantees: The authors candidly note their theoretical proofs are sufficient-condition results, not universal guarantees—if embedding margins collapse or environment updates become non-contractive/adversarial, the error-attenuation bounds no longer hold.
  • State-Changing Bottlenecks: In complex retail tasks, state-altering database operations remain tough (35.29% success for FlowAgent; even an oracle tool-selector only hits 70.59%), highlighting state-conditioned operation selection and argument grounding as key bottlenecks to solve next.

Summary updated

Abstract

Large Language Models (LLMs) have demonstrated remarkable capabilities in orchestrating tools for reasoning tasks. However, existing methods rely on a step-wise paradigm that lacks a global perspective, which causes error accumulation over long horizons and restricts generalization to unseen tools. To overcome these limitations, we propose Tools as Continuous Flow for Evolving Agentic Reasoning (FlowAgent), which reconceptualizes tool chaining as continuous trajectory generation within a semantic space. To systematically evaluate this paradigm, we introduce the first plan-level closed-loop benchmark dedicated to plan-level agentic reasoning in dynamic real-world environments. Specifically, the proposed FlowAgent leverages conditional flow matching to generate continuous latent trajectories, providing a global planning perspective to ensure coherent and robust tool execution. Theoretically, we establish formal bounds on utility convergence and prove that our continuous formulation fundamentally guarantees robust generalization and error attenuation. Empirical evaluations show that FlowAgent achieves superior robustness and adaptability in long-horizon reasoning tasks.
BibTeX
@inproceedings{huang2026tools,
  author = {Tairan Huang and Siyu Shang and Qiang Chen and Xiu Su and Yi Chen},
  title = {{Tools as Continuous Flow for Evolving Agentic Reasoning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=2MsbN9cHvM},
}
Figure