iRaven

Paper · Agents and tools · Version v1

RectifyFlow: Plan Upfront, Rectify Selectively for Cost-Efficient Edge-Cloud Tool-Using Agents

First published: arXiv, . Original

Copyright the authors. Licensed under Creative Commons Attribution 4.0 International.

This page holds the text of the paper, converted to HTML; figures may be left out.

Tool-using agents increasingly rely on cloud LLMs to execute complex multi-step workflows, but repeated LLM calls incur substantial monetary cost. Edge-side small models (SMs) offer a cheaper alternative, yet their weaker reasoning can compromise execution quality. Edge-cloud collaboration therefore promises a better quality--cost trade-off, but existing approaches remain inefficient for tool use: iterative execution triggers frequent cloud interactions, while local decision errors can propagate through dependent operations and cause costly replanning. We propose RectifyFlow, a cost-efficient edge--cloud framework that minimizes cloud involvement while containing edge-side execution errors. First, Dual-View Plan Construction produces structured plans that guide the edge SM through multiple dependent operations with limited cloud intervention, avoiding repeated cloud reasoning during execution. Second, when execution deviates from the plan, Dependency-Aware Plan Rectification identifies the deviation source, traces its downstream impact, and selectively repairs only the affected plan components, rather than regenerating the entire plan. Across BFCL and ToolSandbox, RectifyFlow retains 94.6\% and 91.8\% of Cloud-only performance while reducing cloud API cost by approximately 2.5$\times$ and 2.1$\times$, respectively. Against nine representative baselines, RectifyFlow achieves approximately 1.5$\times$ higher task performance at 1.3$\times$ lower cost, demonstrating a substantially improved quality--cost trade-off for tool-using agents.

Abstract

Tool-using agents increasingly rely on cloud LLMs to execute complex multi-step workflows, but repeated LLM calls incur substantial monetary cost. Edge-side small models (SMs) offer a cheaper alternative, yet their weaker reasoning can compromise execution quality. Edge–cloud collaboration therefore promises a better quality–cost trade-off, but existing approaches remain inefficient for tool use: iterative execution triggers frequent cloud interactions, while local decision errors can propagate through dependent operations and cause costly replanning. We propose RectifyFlow, a cost-efficient edge–cloud framework that minimizes cloud involvement while containing edge-side execution errors. First, Dual-View Plan Construction produces structured plans that guide the edge SM through multiple dependent operations with limited cloud intervention, avoiding repeated cloud reasoning during execution. Second, when execution deviates from the plan, Dependency-Aware Plan Rectification identifies the deviation source, traces its downstream impact, and selectively repairs only the affected plan components, rather than regenerating the entire plan. Across BFCL and ToolSandbox, RectifyFlow retains 94.6% and 91.8% of Cloud-only performance while reducing cloud API cost by approximately 2.5× and 2.1×, respectively. Against nine representative baselines, RectifyFlow achieves approximately 1.5× higher task performance at 1.3× lower cost, demonstrating a substantially improved quality–cost trade-off for tool-using agents.

1 Introduction

Recent advances in large language models (LLMs) have enabled tool-use agents capable of autonomously coordinating multi-step tool operations through execution feedback [2, 26]. Such agents have demonstrated practical potential in emerging applications, including software engineering automation (e.g., OpenAI’s Codex) and personal assistance (e.g., Meta’s Muse). To ensure high-quality task execution, existing tool-use agent systems typically rely on cloud LLMs. However, these advanced LLMs introduce prohibitive monetary costs. To mitigate this cost, existing studies explore edge–cloud collaboration as a promising paradigm by deploying small models (SMs) on edge devices and dynamically deciding whether each task step should be executed by the SM or cloud LLM based on its complexity. This paradigm leverages SMs for low-cost execution of simple steps and LLMs for complex steps requiring stronger reasoning capability, thereby reducing inference costs while maintaining task quality [20, 1, 9].

Figure

Figure 1: RectifyFlow achieves a favorable quality–cost trade-off on both datasets.

Existing edge–cloud collaboration methods typically follow two paradigms: iterative model routing [9, 31] and subtask allocation [20, 1]. The former progressively determines whether each step should be processed by an edge SM or a cloud LLM during execution, while the latter first decomposes a task into multiple subtasks and then assigns appropriate models to different subtasks. Despite their demonstrated effectiveness [1], dynamic dependencies in tool use introduce limitations when applying these methods to tool-use agents: (L1) Intermediate tool outputs make subsequent operations and their complexity difficult to anticipate, requiring frequent edge–cloud interactions during execution. This increases cloud invocation overhead and limits the achievable reduction in cost. (L2) Assigning more execution to edge-side SMs can reduce cloud usage, but their lower decision reliability may introduce latent errors into interdependent tool operations [7, 28]. Such errors may remain latent until they affect subsequent dependent operations, requiring additional cloud-side correction or re-execution and increasing overall cost.

To address these limitations, we propose RectifyFlow, a novel cost-efficient edge–cloud collaborative agent framework for tool use. Specifically, inspired by the Plan-and-Execute paradigm [3, 24], we leverage a cloud LLM to generate multi-step execution plans in advance and delegate their execution to an edge-side SM, thereby reducing frequent edge–cloud interactions. Meanwhile, the generated plans provide execution guidance for SMs, constraining their execution process and improving local execution reliability. Together, these designs aim to address the aforementioned limitations, thereby enabling a better quality–cost trade-off. However, realizing this objective still presents two key challenges:

  • Providing sufficient execution guidance. The plan should enable the SM to reliably execute as many steps as possible under limited reasoning capability. However, tool outcomes are unavailable during planning, requiring the plan to capture operational dependencies while leaving runtime decisions to the SM. Insufficient guidance increases the SM’s reasoning burden and error risk, whereas incorrect assumptions may affect subsequent dependent operations.
  • Recovering from execution deviations. Runtime observations may reveal conditions not captured during planning, causing deviations in tool-use tasks. Recovering from such deviations requires identifying their source and affected downstream operations. Without this analysis, replanning may retain invalid decisions or unnecessarily modify valid steps, leading to repeated recovery, redundant execution, and additional cloud invocations.

To this end, RectifyFlow introduces two complementary mechanisms: (i) Dual-View Plan Construction, where the cloud LLM captures tool dependencies in a DAG-based dependency view and derives a linear execution view to guide reliable edge-side execution with fewer cloud interactions. (ii) Dependency-aware Plan Rectification, where RectifyFlow performs dependency-aware rectification when edge execution deviates by localizing the deviation source and its downstream impact, and then selectively patches only the affected nodes. This preserves valid execution results and avoids unnecessary replanning, redundant execution, and additional LLM invocations. As shown in Fig. 1, extensive experiments against nine representative baselines show that RectifyFlow achieves the best observed quality–cost trade-off among the compared methods, retaining about 93% of cloud-only performance while reducing API cost by about 56% on average.

2 Related Work

Tool-Using Agents.

Tool-using agents augment LLMs with external tools for complex task execution [19, 11]. Recent studies further improve tool selection, invocation, and multi-step execution through structured tool representations and reinforcement learning [18, 22, 10]. However, these methods primarily focus on improving the tool-use capability of individual models and rely on cloud LLMs for strong task performance, incurring substantial monetary costs.

Edge–Cloud Collaboration for LLM Agents.

Edge–cloud collaboration aims to balance performance and cost through model routing and task allocation. RouteLLM learns query routing policies from preference data [14], while DoT, AIMS, and Minions optimize subtask allocation or cloud–edge coordination through dependency analysis and local processing [20, 9, 13]. HybridFlow and Hera further explore dependency-aware routing and cost-aware optimization for efficient collaboration [1, 31]. EcoAgent extends device–cloud collaboration to mobile GUI automation through on-device verification and compressed visual feedback, reducing communication and resource overhead [29]. However, as shown in §5, these methods mainly target static reasoning scenarios and remain challenged by tool-use tasks with complex dependencies.

Plan-and-Execute Methods.

Existing planning and execution methods improve agent execution accuracy through explicit execution guidance and error recovery. ReAct [27], ReWOO [24], and LLMCompiler [6] enhance reasoning, planning efficiency, and tool scheduling. ATG further employs DAG-based task decomposition and parallel execution, with minimal subgraph repair upon failures [30], while SPIN improves plan executability through DAG validation and simulator–critic-based early stopping [15]. Plan-and-Act [3] and AgentFlow [8] further optimize planning through replanning and learning. For execution recovery, AdaPlanner [21] refines plans using feedback, and ADaPT [17] recursively decomposes failed subtasks for continued execution. However, applying these methods to edge–cloud collaborative tool use remains challenging due to plan uncertainty in dynamic environments and the need for precise, low-cost plan correction.

3 Problem Formulation

We consider tool-use tasks where an agent ℳ completes a user task q by iteratively selecting tools from a candidate set 𝒯 and constructing their arguments 𝐚t based on interaction history ht: (ut,𝐚t)=ℳ(q,ht). Each tool invocation produces feedback that is appended to the history for subsequent decisions, forming an iterative tool-use process. To reduce the high API cost of repeated cloud LLM calls, we consider an edge–cloud collaborative agent consisting of a cloud LLM ℳC and an edge-side SM ℳE, where ℳC first generates an initial plan 𝒫(0) for task q and ℳE executes it locally based on the plan and interaction history.

Despite this arrangement, tool outcomes and environment changes remain unknown during cloud-side planning, which may invalidate planning assumptions and cause execution deviations. Meanwhile, the limited capability of the edge SM makes reliable execution challenging. The first problem is therefore to construct a plan that captures task dependencies while providing sufficient execution guidance for ℳE. We denote such a plan as 𝒫(0)=(p1,…,pn0), where each pr∈𝒫(0) is a planned step node that provides the edge SM with explicit execution constraints and task-relevant information, thereby enabling reliable plan-guided execution.

Correspondingly, the second problem is to localize execution deviations and selectively rectify affected plan components. When the edge SM cannot proceed, it reports execution evidence ξℓ to the cloud LLM, which identifies the deviation source, determines the affected node set ℛ⊆{p1,…,pn0}, and generates a selective rectification δ that updates affected nodes to obtain the revised plan 𝒫(1). The edge model then resumes execution with the updated plan, and the process iterates until task completion or the predefined limit is reached.

Our goal is to address these two problems and achieve an effective quality–cost trade-off in tool-use tasks. We measure this trade-off by task quality Q=𝔼q[Score(q)] and cloud API cost C=𝔼q[Ccloud(q)]. Ideally, Q approaches the quality of Cloud-only execution (only ℳC), while C approaches the cost of Local-only execution (only ℳE).

4 RectifyFlow

4.1 Overview

We propose RectifyFlow, a cost-efficient edge–cloud collaborative agent framework for tool use, as illustrated in Fig. 2. ❶ RectifyFlow first performs Dual-View Plan Construction: the cloud LLM organizes the required tool operations and their dependencies into a DAG-based dependency view, and derives a linear execution view to guide reliable edge-side execution. ❷ The edge SM follows the execution view sequentially, grounding arguments and invoking applicable tools based on runtime observations. It performs bounded local recovery for recoverable argument errors; when execution cannot be restored locally, it sends the execution context and interruption evidence to the cloud LLM. ❸ The cloud LLM performs dependency-aware plan rectification by tracing backward from the interrupted node to localize the deviation source, then analyzing its downstream dependencies to determine the candidate reconsideration scope and selectively revise affected nodes. ❹ Finally, the cloud LLM returns the revised plan and execution instruction. The edge SM updates its local view, preserves valid results, and resumes execution from the specified point. The process iterates until task completion.

Figure

Figure 2: Overview of RectifyFlow.

4.2 Dual-View Plan-Guided Edge–Cloud Execution

In this section, our goal is to construct a plan that enables reliable edge SM execution with limited cloud intervention. Rule-based executors handle runtime variations through predefined logic with adaptation limited to the cases covered by their rules [6], whereas edge SMs can leverage plan guidance and feedback to adapt tool arguments and recover from minor execution errors. However, their limited reasoning capability requires explicit execution constraints. We therefore introduce a Dual-View Plan that provides step-wise guidance for execution.

Dual-View Plan Construction.

Tool-use tasks often involve interdependent operations, with earlier tool outputs or state changes constraining subsequent actions. We capture these dependencies with a directed acyclic graph (DAG) [28]. Given a user task q, the cloud LLM ℳC selects task-relevant tools 𝒰⊆𝒯 and constructs an initial plan as a dependency-annotated DAG: 𝒢(0)=({p1,…,pn0},E(0)). This graph serves as the plan’s dependency view, representing the planned tool operations and their inferred dependencies. Each node pr∈𝒢(0) specifies a semantic objective dr and a selected tool ur∈𝒰 for achieving it, while E(0) records the data, state, and control dependencies among operations.

The dependency view 𝒢(0) captures operation relationships but does not specify how the edge SM should execute each operation under runtime conditions. Without explicit guidance, the SM must infer dependencies and track execution states, leading to long contexts that strain its limited capacity and increase hallucination risk. RectifyFlow therefore constructs a linear execution view 𝒫(0)=(p1,…,pn0) by selecting a valid topological order from 𝒢(0). It guides ℳE through step-wise execution with explicit dependency information.

In the execution view, RectifyFlow maps the dependencies in E(0) into output references, argument-grounding specifications, and execution criteria, which respectively encode required tool outputs, guide argument construction, and enable ℳE to select applicable nodes based on tool feedback:

• Output references. If operation pr depends on output field f from a preceding operation pi, the dependency is represented in pr by the symbolic reference pi[f]. After pi is executed, its result is stored in the binding map ℬ, allowing ℳE to directly retrieve ℬ(pi[f]) when executing pr. This enables required but unavailable information to be specified in advance, supporting continuous guidance throughout execution.

• Argument grounding. ℳC further generates an argument-grounding specification θr for each node pr, describing how to construct the arguments of tool ur from the task information and outputs of preceding nodes in the execution view. At runtime, ℳE follows θr and uses the preceding-node outputs in ℬ, together with the semantic objective dr, to instantiate the concrete tool arguments 𝐚r.

• Execution criteria. ℳC generates an execution criterion ϕr for each branch-dependent node pr, encoding the corresponding branch condition in the dependency view, while ϕr is left empty for other nodes. At runtime, ℳE evaluates ϕr using the results recorded in ℬ. If the condition is not satisfied, pr is skipped and execution proceeds to the next node pr+1.

Combining these components, each executable node in the execution view is represented as:

pr=(dr,ur,θr,ϕr),pr∈𝒫(0).

We jointly represent the complementary views as Π(0)=(𝒢(0),𝒫(0)). While 𝒫(0) provides execution order and node-level guidance for ℳE, 𝒢(0) guides cloud-side rectification by localizing affected dependencies and avoiding unnecessary updates and re-execution (see §4.3). Since 𝒢(0) may also contain errors, both views are updated consistently during rectification.

Runtime Plan Realization with Conditional Cloud Invocation.

After receiving the initial dual-view plan Π(0), ℳE sequentially executes only 𝒫(0), while retaining 𝒢(0) for subsequent cloud-side rectification. For each node pr, ℳE first evaluates ϕr. If ϕr is empty or satisfied, it instantiates 𝐚r=ℳE(dr,ur,θr,ℬ) and invokes ur; otherwise, pr is skipped. The outputs of each executed node are recorded in ℬ, while hr maintains the interaction history up to pr, including tool calls, arguments, observations, and recovery outcomes.

When tool ur reports invalid arguments 𝐚r, such as missing fields, malformed formats, or incompatible values, ℳE attempts local recovery to obtain 𝐚~r by reinterpreting θr and the tool specification to identify formatting or computation errors. The cloud model ℳC is invoked when (i) feedback at the interruption reveals missing or incorrect plan nodes that block further execution, or (ii) ℳE fails to complete the current node within the predefined recovery budget. In either case, ℳC performs dependency-aware plan rectification based on the accumulated execution evidence.

To support plan rectification by ℳC, ℳE provides the following revision context:

χ=(Π(0),ℬ,h,ξ),

where interruption evidence ξℓ identifies the interrupted node and summarizes the corresponding tool feedback and recovery results.

4.3 Dependency-aware Plan Rectification

Backward Deviation Localization.

When ℳC receives the evidence χ, where ξ identifies pr as the interrupted node, RectifyFlow first locates the interrupted node p_{r} in the initial dependency graph \mathcal{G}^{(0)} and examines its corresponding planned operation in \mathcal{P}^{(0)} against the observed outputs in \mathcal{B} and interaction history h. It then traces backward along the predecessor paths of p_{r} in \mathcal{G}^{(0)}, with the search constrained by the evidence \chi and interaction history h. At each candidate node, it examines whether an erroneous operation caused an incorrect output, and continues tracing backward until no earlier node on the traced paths is supported as erroneous, the earliest such node is identified as the deviation source p_{s}. By preserving 𝒢(0) as the dependency reference, RectifyFlow avoids repeated dependency reconstruction from 𝒫(0), reducing cloud reasoning overhead and preventing inconsistent dependency updates during successive rectifications:

ps=ℳC(χℓ,pr),ps⇝∗pr,

where ⇝∗ denotes reflexive reachability in the dependency view. ps denotes the earliest deviation source that explains the observed inconsistency. It may correspond to an existing node in 𝒫(0), or a missing dependency node revealed by execution feedback. In the latter case, ℳC augments the dependency structure by introducing the missing node and establishing its relation to pr before subsequent rectification.

Forward Impact Analysis.

After identifying the deviation source ps, RectifyFlow performs forward impact analysis over the dependency structure. Although the deviation is observed at the interrupted node pr, the underlying issue at ps may invalidate the execution guidance of subsequent unexecuted nodes in the original plan Π(0). Therefore, RectifyFlow identifies all downstream nodes that depend on ps in the dependency view as candidates for reconsideration:

ℛ={pj∈𝒫(ℓ)∣ps⇝∗pj}.

Selective Plan Rectification.

The candidate scope ℛℓ identifies nodes whose execution may be affected by the deviation. However, modifying these nodes alone may not fully restore execution consistency, since previously executed operations may have introduced environment changes recorded in the interaction history h. Therefore, ℳC jointly considers the dependency-constrained scope ℛ and the observed state changes in h to generate a structured rectification δ:

δ=ℳC(Π(0),ℛℓ,h).

where δ denotes a rectification patch consisting of the nodes selected for plan modification and state-consistency recovery, i.e., δ=(δplan,δstate). The plan-level rectification δplan is a subset of nodes selected from the candidate scope ℛ that require modification to restore execution consistency, while preserving unaffected nodes. The state-consistency rectification δstate adds recovery steps for side effects recorded in h, either restoring reversible state changes through compensating tool operations or invalidating incorrect result bindings and querying them again. Based on δ, the initial plan is updated to obtain the rectified plan Π(1).

Overall, RectifyFlow dynamically refines the dual-view plan based on execution feedback by updating affected operations and dependency relations while preserving unaffected operations and valid results, thereby reducing unnecessary replanning.

Once rectification is complete, ℳC sends the updated dual-view plan Π(1) together with an execution instruction to ℳE. The instruction specifies how to resume execution, including the starting node, nodes that have been successfully completed and can be preserved, and nodes requiring re-execution after rectification. Based on the updated plan and execution instruction, ℳE performs plan realization again, while retaining unaffected nodes and valid execution results. This process iterates over multiple rectification rounds until the task is completed or the execution terminates.

5 Experiment

5.1 Experimental Setup

Table 1: Average performance and cloud API cost on BFCL and ToolSandbox.

MethodsBFCLToolSandbox
Avg. Perf.↑ (×10−2)API Cost↓ (×10−3 $)vs. Cloud-only Perf.↑ / Cost↓Avg. Perf.↑ (×10−2)API Cost↓ (×10−3 $)vs. Cloud-only Perf.↑ / Cost↓
Cloud-only81.095.803100.00% / 100.00%70.652.173100.00% / 100.00%
Local-only6.880.0008.48% / 0.00%38.260.00054.16% / 0.00%
MiniCPM5-2B4.380.0005.39% / 0.00%38.200.00054.07% / 0.00%
GAPG45.632.80956.26% / 48.41%59.951.46984.85% / 67.59%
AIMS37.032.63545.66% / 45.41%53.900.91476.30% / 42.06%
Hera37.032.38345.66% / 41.06%58.781.55083.20% / 71.35%
DoT16.722.64620.62% / 45.60%66.701.96294.41% / 90.28%
Minions48.443.02359.73% / 52.10%44.591.43863.11% / 66.15%
HybridFlow53.132.33765.51% / 40.27%55.851.19479.05% / 54.94%
RectifyFlow76.722.28694.61% / 39.39%64.831.05791.77% / 48.64%

Figure

Figure 3: Comparison of latency and communication overhead across different methods.

Datasets and Splits.

We evaluate RectifyFlow on two tool-use benchmarks: ToolSandbox [11] and BFCL-V4 [16]. ToolSandbox is designed for stateful, multi-turn tool-use scenarios and contains 1,032 tool-use tasks. BFCL-V4 includes 800 multi-turn function-calling samples covering four categories. For baselines requiring training, we randomly sample tasks from each category to construct training and test splits. Specifically, ToolSandbox is divided into 206 training tasks and 826 test tasks, while BFCL-V4 is divided into 160 training tasks and 640 test tasks. All methods are evaluated on the same test sets, whereas RectifyFlow requires no additional training and is directly evaluated in the test phase.

Baselines.

We first include Cloud-only and Local-only as performance boundary baselines. Cloud-only relies entirely on cloud LLMs for reasoning and execution, while Local-only performs all inference using edge-side SMs. We then compare RectifyFlow with nine representative baselines, including edge–cloud collaboration approaches (Hera [31], AIMS [9], Minions [13], GAPG [4], DoT [20], and HybridFlow [1]), plan-and-execute methods (Plan-and-Act [3] and ReWOO [24]), and MiniCPM5-2B [12], an edge-oriented agent model used to examine the impact of stronger SM capabilities on tool-use performance.

Models and Hyperparameters.

We use DeepSeek-V4-Flash [23] as the default cloud LLM and Qwen3-8B [25] as the default edge-side SM. To evaluate the generality of RectifyFlow, we further consider different edge models, including Qwen3-1.7B [25], Qwen3-4B [25], and Llama-3-8B-Instruct (Q4_K_M) [5], as well as GPT-5.6-Terra as the cloud LLM. For hyperparameter settings, we set the maximum local recovery budget of the edge SM to one attempt, balancing edge computation overhead and execution reliability.

Metrics.

For ToolSandbox, we adopt its official similarity score, which measures the consistency between execution trajectories and target states through milestone completion and final task achievement. For BFCL-V4, we use the official task success rate. Both metrics are denoted as Avg. Perf. for unified comparison. API cost refers to cloud-side inference expenditure and is estimated in USD from recorded input/output tokens and official model pricing, following prior work [13]. For system overhead, we report latency, communication volume, RTT, and P95 latency. RTT measures cumulative edge–cloud round-trip communication time, while P95 latency captures tail execution behavior caused by unstable or repeated interactions.

All edge-side components are deployed on a single PC with an NVIDIA RTX 4090 GPU. Unless stated otherwise, models use default configurations without fine-tuning. We report the mean results over three runs. For simplicity, cache-hit input tokens are not separately accounted for; a cache-aware analysis in Appendix C confirms that the main conclusions remain unchanged. Detailed dataset and baseline settings are provided in Appendix B.

Table 2: Performance and cloud API cost of RectifyFlow with different edge models.

Edge ModelToolSandboxBFCL
Avg. Perf.↑ (×10−2)API Cost↓ (×10−3 $)vs. Cloud-only Perf.↑ / Cost↓Avg. Perf.↑ (×10−2)API Cost↓ (×10−3 $)vs. Cloud-only Perf.↑ / Cost↓
Cloud-only70.652.173100.00% / 100.00%81.095.803100.00% / 100.00%
Qwen3-1.7B64.231.08590.91% / 49.93%75.632.32593.27% / 40.07%
Qwen3-4B65.961.16793.36% / 53.70%73.442.44890.57% / 42.19%
Qwen3-8B64.831.05791.76% / 48.64%76.722.28694.61% / 39.39%
Llama3-8B65.641.04392.91% / 48.00%76.412.30694.23% / 39.74%

Table 3: Performance and cloud API cost comparison with Plan-and-Execute methods.

MethodsToolSandboxBFCL
Avg. Perf.↑ (×10−2)API Cost↓ (×10−3 $)vs. Cloud-only Perf.↑/Cost↓Avg. Perf.↑ (×10−2)API Cost↓ (×10−3 $)vs. Cloud-only Perf.↑/Cost↓
Cloud-only70.652.173100.00%/100.00%81.095.803100.00%/100.00%
ReWOO70.102.40299.22%/110.54%69.224.05285.36%/69.83%
Plan-and-Act69.072.14397.76%/98.62%76.417.17394.23%/123.61%
ReWOO (SM)61.061.70486.43%/78.42%48.282.13759.54%/36.83%
Plan-and-Act (SM)63.141.56189.37%/71.84%44.384.19754.73%/72.32%
RectifyFlow64.831.05791.76%/48.64%76.722.28694.61%/39.39%

5.2 Numerical Results

Performance Comparison.

We first evaluate the quality–cost trade-off of RectifyFlow against representative edge–cloud collaboration baselines. As shown in Tab. 1, RectifyFlow achieves competitive performance with substantially reduced cloud API costs. In BFCL, it reaches 76.72 Avg. Perf., retaining 94.61% of Cloud-only performance with only 39.39% of its cost. On ToolSandbox, it achieves 64.83 Avg. Perf. while reducing cost by 51.36% and preserving 91.77% of Cloud-only performance. Compared with existing approaches, RectifyFlow provides a more favorable quality–cost balance. MiniCPM5-2B eliminates cloud usage but suffers from limited performance, while other collaboration methods improve performance at the expense of higher API costs caused by frequent interactions. For example, DoT achieves 66.70 Avg. Perf. on ToolSandbox but requires 1.962×10−3 $, while RectifyFlow achieves comparable performance with only 1.057×10−3 $. This advantage stems from RectifyFlow’s ability to reduce redundant cloud interactions while maintaining reliable tool execution.

Latency and Communication Overhead.

To evaluate the practical applicability of RectifyFlow, we further analyze latency and communication overhead under different edge–cloud collaboration strategies. As shown in Fig. 3, RectifyFlow achieves a lower execution latency while maintaining moderate communication overhead. It reaches 3.68s average latency and 6.29s P95 latency, outperforming methods such as HybridFlow and DoT that rely on frequent cloud decisions. This improvement is enabled by plan-guided execution, where the cloud LLM provides structured guidance in advance, allowing the edge model to execute multiple dependent operations locally with fewer interactions. Meanwhile, RectifyFlow introduces 32.68 KiB/task communication overhead, comparable to other collaboration methods. By triggering cloud-side plan rectification only when local execution becomes unreliable, it balances communication efficiency and execution reliability. Additional edge–side resource analysis shows that RectifyFlow maintains low computational and memory overhead, with detailed results provided in Appendix C.

Generalization Analysis.

We evaluate RectifyFlow under different LLM settings.

Edge SM Generalization.

We evaluate RectifyFlow with four edge-side SMs: Qwen3-1.7B, Qwen3-4B, Qwen3-8B, and quantized Llama3-8B. As shown in Tab. 2, all configurations achieve comparable performance while substantially reducing API costs relative to Cloud-only. These results suggest that RectifyFlow’s quality–cost benefits generalize across the evaluated SMs.

Figure

Figure 4: Cost–performance comparison on BFCL.

Cloud LLM Generalization.

We further evaluate RectifyFlow with GPT-5.6-Terra as the cloud LLM while keeping the edge model and all framework components unchanged. As shown in Fig. 4, RectifyFlow consistently achieves a favorable quality–cost trade-off under the new cloud model, approaching the performance of Cloud-only execution while substantially reducing API expenditure. This result indicates that the effectiveness of RectifyFlow does not rely on a specific cloud LLM, but mainly stems from its framework-level design, including dual-view planning and dependency-aware rectification. By separating task-level guidance from execution-time correction, RectifyFlow can effectively exploit different cloud model capabilities while maintaining reliable tool execution. The complete results table, along with detailed latency, communication, and edge-side resource analyses under GPT-5.6-Terra, is provided in Appendix C, further demonstrating consistent system efficiency across different cloud configurations.

Comparison with Plan-and-Execute.

Tab. 3 compares RectifyFlow with Plan-and-Execute methods adapted to edge–cloud collaboration. We consider cloud-based variants with cloud planning/execution and SM-based variants with cloud planning and edge execution. Cloud-based variants achieve high performance but incur substantial API costs; e.g., Plan-and-Act retains 94.23% of Cloud-only performance on BFCL with 123.61% cost. SM-based variants reduce cloud usage but suffer from limited execution capability. These results highlight the challenges of applying Plan-and-Execute to tool-use tasks. RectifyFlow overcomes these limitations through dependency-aware planning and selective rectification.

Uncaptioned image Figure 5: Execution trajectories of different methods. Figure Figure 6: Average cloud LLM calls.

Case Study.

Fig. 6 presents representative execution trajectories, where ❶, ❷ and ❸ correspond to DoT, Minions, and HybridFlow, respectively. Existing methods frequently alternate between cloud LLM and edge SM, causing repeated cloud calls and redundant execution. In contrast, RectifyFlow enables continuous local execution through plan guidance and selectively rectifies affected nodes, preserving execution progress with fewer cloud interactions. As shown in Fig. 6, RectifyFlow requires only 1.33 cloud LLM calls on average, compared with 9.83 calls for Cloud-only, demonstrating that plan-guided execution and dependency-aware rectification effectively reduce cloud overhead while maintaining reliable execution. Detailed analysis of plan quality and rectification effectiveness is provided in Appendix C, showing that RectifyFlow progressively improves plan alignment through effective rectification. The prompts are provided in Appendix C.

Table 4: Sensitivity analysis of the local recovery budget.

Local Budget K 0 (No local recovery) 1 (Default) 2 3 4 5 Avg. Perf. ↑ (×10−2) 73.28 76.72 74.38 76.88 77.03 76.25

Sensitivity Analysis.

We investigate how the local recovery budget affects performance on BFCL. As shown in Tab. 4, introducing one local recovery attempt (K=1) improves performance from 73.28% to 76.72%, yielding a gain of 3.44 percentage points over the no-recovery setting. Increasing the budget beyond one attempt does not lead to consistent improvements: performance fluctuates across larger budgets, reaching its peak of 77.03% at K=4, only 0.31 percentage points higher than that with K=1. This suggests that most of the benefits can be obtained with a single local recovery attempt, while additional retries offer limited marginal gains. This is also consistent with our design, where complex execution deviations are better handled through dependency-aware plan rectification rather than repeated local retries. Therefore, a small local recovery budget is sufficient to achieve effective error handling.

Ablation Study.

We conduct ablation studies to analyze the contributions of Dual-View Plan Construction (DPC) and Dependency-aware Plan Rectification (DPR), with results summarized in Tab. 5. Removing DPC decreases performance from 64.83 to 50.60 and increases average cloud calls from 1.39 to 2.60, indicating that DPC is crucial for reliable edge execution. Removing DPR (i.e., using full plan updates) maintains comparable performance but increases cloud calls to 1.63 and incurs higher API costs, showing that global updates introduce unnecessary overhead. Overall, DPC reduces cloud dependency through structured execution guidance, while DPR improves correction efficiency through selective plan updates. A fine-grained ablation analysis of components is provided in Appendix C, demonstrating the necessity of each component.

Table 5: Ablation study of RectifyFlow.

Variant Avg. Perf. ↑ (×10−2) API Cost ↓ (10−3 USD/task) Cloud Calls ↓ (per task) RectifyFlow 64.83 1.057 1.39 w/o DPC 50.60 2.052 2.60 w/o DPR 61.93 1.254 1.63

6 Conclusion

The paper addressed the high cost of tool-use agents by proposing a new edge–cloud collaborative framework named RectifyFlow. Specifically, by integrating Dual-View Plan Construction and Dependency-aware Plan Rectification, RectifyFlow improves edge-side execution reliability and enables precise, efficient selective plan updates, substantially reducing cloud API costs with minimal performance degradation. Extensive experiments on tool-use benchmarks demonstrate that RectifyFlow achieves a favorable quality–cost trade-off compared with existing approaches, retaining approximately 93% of Cloud-only performance while reducing cloud API costs by about 56% on average.

References

  • [1] J. Dong, J. Li, T. Zheng, and W. Lin (2026) HybridFlow: resource-adaptive subtask routing for efficient edge-cloud llm inference. arXiv preprint arXiv:2512.22137.
  • [2] A. Drouin, M. Gasse, M. Caccia, I. H. Laradji, M. D. Verme, T. Marty, D. Vázquez, N. Chapados, and A. Lacoste (2024) WorkArena: how capable are web agents at solving common knowledge work tasks?. In Forty-first International Conference on Machine Learning, ICML 2024, Vienna, Austria, July 21-27, 2024,
  • [3] L. E. Erdogan, N. Lee, S. Kim, S. Moon, H. Furuta, G. Anumanchipalli, K. Keutzer, and A. Gholami (2025) Plan-and-act: improving planning of agents for long-horizon tasks. In Forty-second International Conference on Machine Learning, ICML 2025, Vancouver, BC, Canada, July 13-19, 2025,
  • [4] W. Fang, D. Han, L. Yuan, E. Chen, and C. Brinton (2025) Bridging on-device and cloud llms for collaborative reasoning: a unified methodology for local routing and post-training. arXiv preprint arXiv:2509.24050.
  • [5] A. Grattafiori, A. Dubey, A. Jauhri, A. Pandey, A. Kadian, A. Al-Dahle, A. Letman, A. Mathur, A. Schelten, A. Vaughan, et al. (2024) The llama 3 herd of models. arXiv preprint arXiv:2407.21783.
  • [6] S. Kim, S. Moon, R. Tabrizi, N. Lee, M. W. Mahoney, K. Keutzer, and A. Gholami (2024) An LLM compiler for parallel function calling. In Forty-first International Conference on Machine Learning, ICML 2024, Vienna, Austria, July 21-27, 2024,
  • [7] X. Li, K. Chen, Y. Long, X. Bai, Y. Xu, and M. Zhang (2025) Generator-assistant stepwise rollback framework for large language model agent. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, EMNLP 2025, Suzhou, China, November 4-9, 2025,
  • [8] Z. Li, H. Zhang, S. Han, S. Liu, J. Xie, Y. Zhang, Y. Choi, J. Zou, and P. Lu (2026) In-the-flow agentic system optimization for effective planning and tool use. In International Conference on Learning Representations (ICLR),
  • [9] S. Liu, H. Shen, S. Che, M. Ghandi, and M. Li (2026) AIMS: cost-efficient llm-based agent deployment in hybrid cloud-edge environments. In Proceedings of the 21st European Conference on Computer Systems, EuroSys 2026, McEwan Hall/The University of Edinburgh, Edinburgh, Scotland, UK, April 27-30, 2026,
  • [10] W. Liu, X. Huang, X. Zeng, X. Hao, S. Yu, D. Li, S. Wang, W. Gan, Z. Liu, Y. Yu, Z. Wang, Y. Wang, W. Ning, Y. Hou, B. Wang, C. Wu, X. Wang, Y. Liu, Y. Wang, D. Tang, D. Tu, L. Shang, X. Jiang, R. Tang, D. Lian, Q. Liu, and E. Chen (2025) ToolACE: winning the points of LLM function calling. In The Thirteenth International Conference on Learning Representations, ICLR 2025, Singapore, April 24-28, 2025,
  • [11] J. Lu, T. Holleis, Y. Zhang, B. Aumayer, F. Nan, H. Bai, S. Ma, S. Ma, M. Li, G. Yin, Z. Wang, and R. Pang (2025) ToolSandbox: A stateful, conversational, interactive evaluation benchmark for LLM tool use capabilities. In Findings of the Association for Computational Linguistics: NAACL 2025, Albuquerque, New Mexico, USA, April 29 - May 4, 2025,
  • [12] T. MiniCPM (2025) Minicpm4: ultra-efficient llms on end devices. arXiv preprint arXiv:2506.07900.
  • [13] A. Narayan, D. Biderman, S. Eyuboglu, A. May, S. W. Linderman, J. Zou, and C. Ré (2025) Cost-efficient collaboration between on-device and cloud language models. In Forty-second International Conference on Machine Learning, ICML 2025, Vancouver, BC, Canada, July 13-19, 2025,
  • [14] I. Ong, A. Almahairi, V. Wu, W. Chiang, T. Wu, J. E. Gonzalez, M. W. Kadous, and I. Stoica (2025) RouteLLM: learning to route llms from preference data. In The Thirteenth International Conference on Learning Representations, ICLR 2025, Singapore, April 24-28, 2025,
  • [15] Y. Ozaki and D. Patel (2026) SPIN: structural llm planning via iterative navigation for industrial tasks. arXiv preprint arXiv:2605.14051.
  • [16] S. G. Patil, H. Mao, F. Yan, C. C. Ji, V. Suresh, I. Stoica, and J. E. Gonzalez (2025) The berkeley function calling leaderboard (BFCL): from tool use to agentic evaluation of large language models. In Forty-second International Conference on Machine Learning, ICML 2025, Vancouver, BC, Canada, July 13-19, 2025,
  • [17] A. Prasad, A. Koller, M. Hartmann, P. Clark, A. Sabharwal, M. Bansal, and T. Khot (2024) ADaPT: as-needed decomposition and planning with language models. In Findings of the Association for Computational Linguistics: NAACL 2024, Mexico City, Mexico, June 16-21, 2024,
  • [18] C. Qian, E. C. Acikgoz, Q. He, H. Wang, X. Chen, D. Hakkani-Tur, G. Tur, and H. Ji (2025) ToolRL: reward is all tool learning needs. In Advances in Neural Information Processing Systems 38: Annual Conference on Neural Information Processing Systems 2025, NeurIPS 2025, San Diego, CA, USA, December 2-7, 2025 / Mexico City, Mexico, November 30 - December 5, 2025,
  • [19] Y. Qin, S. Liang, Y. Ye, K. Zhu, L. Yan, Y. Lu, Y. Lin, X. Cong, X. Tang, B. Qian, S. Zhao, L. Hong, R. Tian, R. Xie, J. Zhou, M. Gerstein, D. Li, Z. Liu, and M. Sun (2024) ToolLLM: facilitating large language models to master 16000+ real-world apis. In The Twelfth International Conference on Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024,
  • [20] C. Shao, X. Hu, Y. Lin, and F. Xu (2025) Division-of-thoughts: harnessing hybrid language model synergy for efficient on-device agents. In Proceedings of the ACM on Web Conference 2025, WWW 2025, Sydney, NSW, Australia, 28 April 2025- 2 May 2025,
  • [21] H. Sun, Y. Zhuang, L. Kong, B. Dai, and C. Zhang (2023) AdaPlanner: adaptive planning from feedback with language models. In Advances in Neural Information Processing Systems 36: Annual Conference on Neural Information Processing Systems 2023, NeurIPS 2023, New Orleans, LA, USA, December 10 - 16, 2023,
  • [22] R. Wang, X. Han, L. Ji, S. Wang, T. Baldwin, and H. Li (2025) ToolGen: unified tool retrieval and calling via generation. In The Thirteenth International Conference on Learning Representations, ICLR 2025, Singapore, April 24-28, 2025,
  • [23] A. Xu, B. Lin, B. Xue, B. Wang, B. Xu, B. Wu, B. Zhang, C. Lin, C. Dong, C. Ling, et al. (2026) Deepseek-v4: towards highly efficient million-token context intelligence. arXiv preprint arXiv:2606.19348.
  • [24] B. Xu, Z. Peng, B. Lei, S. Mukherjee, Y. Liu, and D. Xu (2023) ReWOO: decoupling reasoning from observations for efficient augmented language models. arXiv preprint arXiv:2305.18323.
  • [25] A. Yang, A. Li, B. Yang, B. Zhang, B. Hui, B. Zheng, B. Yu, C. Gao, C. Huang, C. Lv, C. Zheng, D. Liu, F. Zhou, F. Huang, F. Hu, H. Ge, H. Wei, H. Lin, J. Tang, J. Yang, J. Tu, J. Zhang, J. Yang, J. Yang, J. Zhou, J. Zhou, J. Lin, K. Dang, K. Bao, K. Yang, L. Yu, L. Deng, M. Li, M. Xue, M. Li, P. Zhang, P. Wang, Q. Zhu, R. Men, R. Gao, S. Liu, S. Luo, T. Li, T. Tang, W. Yin, X. Ren, X. Wang, X. Zhang, X. Ren, Y. Fan, Y. Su, Y. Zhang, Y. Zhang, Y. Wan, Y. Liu, Z. Wang, Z. Cui, Z. Zhang, Z. Zhou, and Z. Qiu (2025) Qwen3 technical report. arXiv preprint arXiv:2505.09388.
  • [26] J. Yang, C. E. Jimenez, A. Wettig, K. Lieret, S. Yao, K. Narasimhan, and O. Press (2024) SWE-agent: agent-computer interfaces enable automated software engineering. In Advances in Neural Information Processing Systems 37: Annual Conference on Neural Information Processing Systems 2024, NeurIPS 2024, Vancouver, BC, Canada, December 10 - 15, 2024,
  • [27] S. Yao, J. Zhao, D. Yu, N. Du, I. Shafran, K. R. Narasimhan, and Y. Cao (2023) ReAct: synergizing reasoning and acting in language models. In The Eleventh International Conference on Learning Representations, ICLR 2023, Kigali, Rwanda, May 1-5, 2023,
  • [28] J. Ye, Z. Du, X. Yao, W. Lin, Y. Xu, Z. Chen, Z. Wang, S. Zhu, Z. Xi, S. Yuan, T. Gui, Q. Zhang, X. Huang, and J. Chen (2025) ToolHop: A query-driven benchmark for evaluating large language models in multi-hop tool use. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), ACL 2025, Vienna, Austria, July 27 - August 1, 2025,
  • [29] B. Yi, X. Hu, Y. Chen, S. Zhang, H. Yang, and F. Wu (2026) EcoAgent: an efficient device-cloud collaborative multi-agent framework for mobile automation. In Fortieth AAAI Conference on Artificial Intelligence, Thirty-Eighth Conference on Innovative Applications of Artificial Intelligence, Sixteenth Symposium on Educational Advances in Artificial Intelligence, AAAI 2026, Singapore, January 20-27, 2026,
  • [30] Y. Zhang, S. Chen, Z. Huang, H. Cui, K. Ji, and Z. Wang (2026) Atomic task graph: a unified framework for agentic planning and execution. arXiv preprint arXiv:2607.01942.
  • [31] Y. Zhang, M. Hu, Z. Lin, X. Fan, F. Xie, Z. Fang, J. Yang, W. Zhu, Z. Chen, C. Lv, et al. (2026) Hera: learning long-horizon coordination for device-cloud collaborative llm agents. arXiv preprint arXiv:2605.24598.

Appendix A Algorithm of RectifyFlow

Algorithm 1 Dependency-aware Plan Rectification (DPR)

              1:


            Cloud model \mathcal{M}_{\mathrm{C}},
context \chi_{\ell}=(\Pi^{(\ell)},\mathcal{B},h,\xi_{\ell})



              2:


            Revised plan \Pi^{(\ell+1)}
and execution instruction I_{\ell}



              3:


            (\mathcal{G}^{(\ell)},\mathcal{P}^{(\ell)})\leftarrow\Pi^{(\ell)}



              4:


            Identify interrupted node p_{r} from \xi_{\ell}



              5:


            Backward deviation localization



              6:


            Compare \mathcal{P}^{(\ell)} with
\mathcal{B}, h, and \xi_{\ell}



              7:


            Trace predecessor paths of p_{r}
in \mathcal{G}^{(\ell)}



              8:


            \mathcal{M}_{\mathrm{C}} identifies
the earliest evidence-supported deviation source p_{s}



              9:


            if p_{s} is a missing prerequisite then



              10:


              Add p_{s} and its dependencies
to \mathcal{G}^{(\ell)}



              11:


            Forward impact analysis



              12:


            \mathcal{R}_{\ell}\leftarrow\{p_{j}\in V(\mathcal{G}^{(\ell)})\mid p_{s}\leadsto^{*}p_{j}\}



              13:


            Selective plan rectification



              14:


            \delta_{\ell}\leftarrow\mathcal{M}_{\mathrm{C}}(\chi_{\ell},\mathcal{R}_{\ell})



              15:


              
\delta_{\ell}=(\delta_{\ell}^{\mathrm{plan}},\delta_{\ell}^{\mathrm{state}})



              16:


            \delta_{\ell}^{\mathrm{plan}} specifies
necessary edits within \mathcal{R}_{\ell}



              17:


            \delta_{\ell}^{\mathrm{state}} specifies
recovery nodes for side effects recorded in h



              18:


            Apply \delta_{\ell} to obtain
\Pi^{(\ell+1)}, preserving unaffected components



              19:


            Update dependency relations, execution order,
and node specifications consistently



              20:


            Generate I_{\ell}: starting node,
preserved completed nodes, and nodes to re-execute



              21:


            return \Pi^{(\ell+1)},I_{\ell}

Algorithm 2 RectifyFlow

              1:


            Task q, tools \mathcal{T},
models \mathcal{M}_{\mathrm{C}},\mathcal{M}_{\mathrm{E}},
local repair budget K



              2:


            Task result or termination status for q



              3:


            \ell\leftarrow 0; r\leftarrow 1



              4:


            \mathcal{B}\leftarrow\varnothing; h\leftarrow\varnothing



              5:


            Cloud: dual-view plan construction



              6:


            \mathcal{M}_{\mathrm{C}} selects
\mathcal{U}\subseteq\mathcal{T}
and constructs \mathcal{G}^{(0)} for q



              7:


            \mathcal{M}_{\mathrm{C}} selects a topological order
\mathcal{P}^{(0)} of \mathcal{G}^{(0)}



              8:


            for each node p in \mathcal{P}^{(0)} do



              9:


              \mathcal{M}_{\mathrm{C}} encodes upstream
output references and generates \theta_{p},\phi_{p}



              10:


              p\leftarrow(d_{p},u_{p},\theta_{p},\phi_{p})



              11:


            \Pi^{(0)}\leftarrow(\mathcal{G}^{(0)},\mathcal{P}^{(0)})



              12:


            Send \Pi^{(0)} to \mathcal{M}_{\mathrm{E}}



              13:


            Edge: sequential execution and local recovery



              14:


            while r\leq|\mathcal{P}^{(\ell)}|
and execution has not terminated do



              15:


              p\leftarrow\mathcal{P}^{(\ell)}[r]



              16:


              if p has a retained valid completed result then



              17:


               r\leftarrow r+1; continue
  


              18:


              \mathcal{M}_{\mathrm{E}} evaluates
\phi_{p} using \mathcal{B}



              19:


              if \phi_{p} evaluates to false then



              20:


               Record p as skipped in h



              21:


               r\leftarrow r+1; continue
  


              22:


              Mark p as incomplete; k\leftarrow 0



              23:


              if \phi_{p} is empty or true,
and required bindings are available then



              24:


               \mathbf{a}\leftarrow\mathcal{M}_{\mathrm{E}}(d_{p},u_{p},\theta_{p},\mathcal{B})



              25:


               Invoke u_{p}(\mathbf{a});
record the call and feedback in h



              26:


              else


              27:


               Record the unmet requirements in h
  


              28:


              while p is incomplete and k<K
and feedback indicates a repairable argument error do



              29:


               \mathcal{M}_{\mathrm{E}} revises \mathbf{a}
using \theta_{p}, the tool specification, and feedback



              30:


               Invoke u_{p}(\mathbf{a});
record the retry and feedback in h



              31:


               k\leftarrow k+1
  


              32:


              if p completes successfully then



              33:


               Bind its output fields in \mathcal{B}



              34:


               Record completion in h; r\leftarrow r+1



              35:


              else


              36:


               Form \xi_{\ell} from p,
unmet requirements, and recovery feedback



              37:


               \chi_{\ell}\leftarrow(\Pi^{(\ell)},\mathcal{B},h,\xi_{\ell})



              38:


               Send \chi_{\ell} to \mathcal{M}_{\mathrm{C}}



              39:


            Cloud: dependency-aware rectification



              40:


               (\Pi^{(\ell+1)},I_{\ell})\leftarrow\textsc{DPR}(\mathcal{M}_{\mathrm{C}},\chi_{\ell})



              41:


               Send (\Pi^{(\ell+1)},I_{\ell})
to \mathcal{M}_{\mathrm{E}}



              42:


            Edge: resume the revised plan



              43:


               Adopt \Pi^{(\ell+1)} and apply I_{\ell}



              44:


               Retain valid results and discard invalidated bindings



              45:


               Mark nodes requiring re-execution according to I_{\ell}



              46:


               r\leftarrow the starting position specified by I_{\ell}



              47:


               \ell\leftarrow\ell+1
  


              48:


            return Task result or termination status
for q, based on \mathcal{B} and h

Algorithm 2 illustrates the overall workflow of RectifyFlow. Given a task q, the cloud model ℳC first constructs an initial dual-view plan Π(0)=(𝒢(0),𝒫(0)), where the dependency view captures tool dependencies and the execution view provides an ordered sequence of executable nodes with node-level guidance. Each node is augmented with output references, argument-grounding specifications, and execution criteria, and is then executed sequentially by the edge model ℳE. During execution, ℳE maintains the binding map ℬ and interaction history h, which record generated outputs, execution progress, tool feedback, and environment changes. For each node, the edge model evaluates its execution criterion, constructs tool arguments according to the provided guidance, and performs local recovery within a limited budget for recoverable failures. When execution cannot proceed, RectifyFlow collects the execution evidence χℓ=(Π(ℓ),ℬ,h,ξℓ) and invokes the cloud model for dependency-aware rectification, as detailed in Algorithm 1. The rectification process first identifies the deviation source by tracing backward over the dependency view, then analyzes downstream impact to determine the candidate scope, and finally generates a selective rectification patch that combines necessary plan updates and state-consistency recovery operations. The revised dual-view plan Π(ℓ+1) and execution instruction are sent back to the edge model, which preserves valid results, applies required updates, and resumes execution from the specified point. This iterative process continues until the task is completed or termination is reached.

Appendix B Details of the experimental setup

B.1 Dataset Details.

ToolSandbox [11].

ToolSandbox is a benchmark for evaluating stateful and multi-turn tool-use agents, where agents interact with external tools under evolving task states. Following the official evaluation protocol, we report the similarity score, which measures the alignment between agent execution trajectories and target milestones. ToolSandbox evaluates tool-use capability from two perspectives: scenario complexity and tool robustness. The scenario-based evaluation contains seven categories: Single Tool Call (STC) and Multiple Tool Call (MTC) measure tool invocation complexity; Single User Turn (SUT) and Multiple User Turn (MUT) evaluate interaction length; State Dependency (SD) tests execution under evolving states; Canonicalization (C) assesses input/output normalization; and Insufficient Information (II) evaluates the ability to identify missing information and request necessary clarification. For robustness evaluation, ToolSandbox introduces controlled tool perturbations. The distraction tool settings (0 DT, 3 DT, and 10 DT) vary the number of irrelevant tools to increase selection difficulty, while Tool Name Scrambling (TNS), Tool Description Scrambling (TDS), Argument Description Scrambling (ADS), and Argument Type Scrambling (ATS) evaluate robustness to ambiguous tool semantics and inconsistent tool specifications.

BFCL-V4 [16].

BFCL-V4 is a benchmark for evaluating function-calling capability under realistic multi-turn scenarios. We use the official task success rate as the evaluation metric. The multi-turn test subset consists of four categories: Base, which contains standard function-calling tasks without additional perturbations; Long Context, which evaluates tasks with extended contextual information; Missing Functions, where relevant functions are unavailable and agents must handle incomplete tool specifications; and Missing Parameters, where agents are required to identify and recover missing function arguments.

B.2 Baseline Details.

We compare RectifyFlow with representative edge–cloud collaboration approaches and reference systems. Cloud-only uses the cloud LLM to perform all reasoning and tool-use decisions, providing an upper-bound performance reference without edge-side cost reduction. Local-only relies solely on the edge-side small model to complete planning and tool execution, representing the low-cost but capability-limited setting.

MiniCPM5-2B [12] is a lightweight model optimized for edge-side agent scenarios, which is included as an additional local-model baseline to evaluate the impact of different SM capabilities. GAPG [4] reduces cloud inference cost by learning a model selection policy that determines whether each execution step should be handled by the edge model or the cloud model. AIMS [9] performs adaptive model selection during agent execution by routing requests between edge and cloud models according to estimated execution requirements. Hera [31] introduces an edge–cloud collaborative execution strategy that dynamically assigns computation between local and cloud models to balance performance and inference cost. Minions [13] decomposes agent tasks into smaller units and allocates selected subtasks to local models to reduce cloud dependency. DoT [20] adopts a planning-based approach that generates intermediate execution structures and assigns tool-use operations between edge and cloud models. HybridFlow [1] performs hybrid execution by combining cloud reasoning and edge-side execution through task decomposition and execution allocation. Plan-and-Act [3] decomposes tool-use tasks into planning and execution stages, where the LLM iteratively generates plans and selects actions based on execution feedback. ReWOO [24] separates reasoning from tool execution by generating a tool-use plan in advance and reducing intermediate LLM calls through deferred execution.

For baselines that require training, we use the category-wise randomly sampled training split to train their method-specific edge–cloud allocation components. All baselines are reproduced by following their official open-source implementations or the procedures described in the original papers as closely as possible. We use consistent dataset splits and evaluation protocols across methods to ensure a fair and accurate comparison.

Appendix C Details of the experimental results

Table 6: Performance across ToolSandbox scenario categories and average cloud API cost.

ToolSandbox
MethodPerformance (×10−2)↑API Cost↓ (×10−3 $)Relative to Cloud-only Perf.↑ / Cost↓
STCMTCSUTMUTSDCIIAvg.
Cloud-only95.0176.4885.5863.5181.7573.1819.0470.652.173100.00% / 100.00%
Local-only (Qwen3-8B)70.6719.8633.9516.2733.3814.7778.9438.260.00054.16% / 0.00%
MiniCPM5-2B57.8622.1031.7220.4243.8316.4275.0338.200.00054.07% / 0.00%
GAPG94.7453.8467.3444.5981.8340.2737.0359.951.46984.85% / 67.59%
AIMS80.1141.8452.3139.5174.4529.4159.7053.900.91476.30% / 42.06%
Hera82.3854.3265.1243.4379.9642.5743.6758.781.55083.20% / 71.35%
DoT93.4770.5179.1362.2478.6466.1516.7866.701.96294.41% / 90.28%
Minions65.5633.3940.0137.9041.9028.5864.7844.591.43863.11% / 66.15%
HybridFlow87.1440.3951.9641.1859.7731.8378.6655.851.19479.05% / 54.94%
RectifyFlow92.4865.3376.4752.7872.3658.7435.6764.831.05791.77% / 48.66%

Table 7: Performance across ToolSandbox tool augmentations and average cloud API cost.

ToolSandbox
MethodPerformance (×10−2)↑API Cost↓ (×10−3 $)Relative to Cloud-only Perf.↑ / Cost↓
0 DT3 DT10 DTTNSTDSADSATSAvg.
Cloud-only70.9666.4468.8459.1668.2967.1771.7767.522.173100.00% / 100.00%
Local-only (Qwen3-8B)39.1540.8727.6646.4733.4943.1237.6638.350.00056.79% / 0.00%
MiniCPM5-2B38.5739.3956.5041.8034.3538.4633.9440.430.00059.88% / 0.00%
GAPG64.9850.9956.2851.1757.0455.9257.7956.311.46983.40% / 67.59%
AIMS56.8052.2859.0845.5451.0351.8247.0451.940.91476.93% / 42.06%
Hera60.3261.2048.9055.4254.1949.4659.1255.521.55082.22% / 71.35%
DoT67.0762.6165.6657.4860.6766.0161.8763.051.96293.39% / 90.28%
Minions45.4543.6857.1750.1238.4742.4246.3846.241.43868.49% / 66.15%
HybridFlow53.9755.2152.5856.3451.2057.9958.3455.091.19481.59% / 54.94%
RectifyFlow69.5963.2152.0957.9362.8262.6264.9961.891.05791.67% / 48.66%

Table 8: Task performance on BFCL and average cloud API cost.

BFCL
MethodPerformance (×10−2)↑API Cost↓ (×10−3 $)Relative to Cloud-only Perf.↑ / Cost↓
BaseLong ContextMissing FunctionsMissing ParametersAvg.
Cloud-only91.8875.6276.8880.0081.095.803100.00% / 100.00%
Local-only (Qwen3-8B)8.754.386.887.506.880.0008.48% / 0.00%
MiniCPM5-2B5.003.754.384.384.380.0005.39% / 0.00%
GAPG52.5038.7545.6245.6245.632.80956.26% / 48.41%
AIMS46.8822.5036.8841.8837.032.63545.66% / 45.41%
Minions50.0048.1245.6250.0048.443.02359.73% / 52.10%
Hera43.7531.2536.8836.2537.032.38345.66% / 41.06%
DoT18.1216.8813.1218.7516.722.64620.62% / 45.60%
HybridFlow56.8847.5052.5055.6253.132.33765.51% / 40.27%
RectifyFlow76.8872.5078.1279.3876.722.28694.61% / 39.39%

Detailed Performance Analysis.

To provide a more fine-grained analysis, we further report the performance of different methods across individual task categories in ToolSandbox and BFCL. These results complement the overall comparison in § 5 by analyzing the robustness of each approach under different tool-use scenarios.

ToolSandbox Scenario Analysis.

Tab. 6 presents the performance across different ToolSandbox scenario categories. RectifyFlow consistently achieves strong performance across diverse task types, including single-tool calling (STC), multi-tool calling (MTC), and single- and multi-turn user interactions (SUT/MUT). In particular, it achieves an average performance of 64.83 while requiring only 1.057×10−3 USD/task, preserving 91.77% of Cloud-only performance with less than half of its API cost. Compared with other collaboration methods, RectifyFlow provides a more balanced trade-off across different categories rather than relying on improvements from specific task types.

Tool Augmentation Analysis.

Tab. 7 further evaluates robustness under different tool augmentation settings. As the number and complexity of tool dependencies increase, existing methods exhibit larger performance variations due to frequent routing decisions or insufficient local execution capability. In contrast, RectifyFlow maintains stable performance across different augmentation settings, achieving 61.89 average performance with reduced cloud cost. This indicates that dependency-aware planning and selective rectification effectively handle increasing execution complexity.

BFCL Multi-turn Analysis.

Tab. 8 reports results on the BFCL multi-turn subset, which requires continuous interactions under tool execution. RectifyFlow achieves 76.72 average performance, approaching Cloud-only execution (81.09) while reducing API cost from 5.803×10−3 to 2.286×10−3 USD/task. It also maintains strong performance under challenging cases involving long context, missing functions, and missing parameters, demonstrating that dependency-aware execution guidance and targeted rectification can effectively mitigate execution deviations in multi-turn scenarios.

Figure

Figure 7: Comparison of Edge overhead across different methods.

Figure

Figure 8: Comparison of latency and communication overhead across different methods with GPT–5.6–Terra.

Figure

Figure 9: Comparison of Edge overhead across different methods with GPT–5.6–Terra.

Cache-aware API Cost.

We further evaluate cloud API costs by accounting for prompt caching. Specifically, we distinguish cache-hit and cache-miss input tokens and apply their corresponding API prices, together with output token prices, based on the token usage reported by the API. As shown in Tab. 9, RectifyFlow achieves the lowest API cost among cloud-based methods, at only 0.446×10−3 USD per task. This represents a 67.84% reduction compared with Cloud-only and a 22.57% reduction compared with the next most cost-efficient baseline, AIMS. These results demonstrate that RectifyFlow maintains its cost advantage even when cache discounts are explicitly considered.

Table 9: Cache-aware cloud API costs on ToolSandbox.

MethodsCloud-onlyLocal-onlyGAPGAIMSMinionsHeraDoTHybridFlowRectifyFlow
API Cost ↓ (×10−3 USD/task)1.3870.0000.8030.5761.0090.9301.0540.8360.446

Edge-side Resource Overhead.

We analyze the edge-side resource consumption under the default model configuration. Fig. 7 compares CPU utilization, memory consumption, GPU memory usage, and energy consumption across different methods. RectifyFlow introduces moderate edge-side overhead while enabling reliable local execution. It requires 40.94% average CPU utilization and 1.50 GiB peak RAM, avoiding the high computation burden of Local-only execution and the additional coordination overhead of several collaborative methods. Its GPU memory consumption is 9.9 GiB, comparable to other edge-assisted approaches and substantially lower than DoT (18.5 GiB). Moreover, RectifyFlow consumes only 1.576 Wh GPU energy, reducing energy consumption by 49.1%, 54.0%, and 80.2% compared with Minions, HybridFlow, and DoT, respectively. These results demonstrate that RectifyFlow achieves reliable tool execution without introducing excessive edge-side resource overhead.

Detailed Performance Metrics and System Overhead under GPT-5.6-Terra.

Table 10: Average performance and cloud API cost on BFCL-V4 with GPT-5.6-Terra.

MethodsAvg. Perf.↑ (×10−2)API Cost↓ (×10−3 $)vs. Cloud-only Perf.↑ / Cost↓
Cloud-only82.9735.650100.00% / 100.00%
Local-only5.000.0006.03% / 0.00%
GAPG60.0027.58072.32% / 77.36%
AIMS44.0626.18253.11% / 73.44%
Hera54.0627.12065.16% / 76.07%
DoT29.0629.54435.03% / 82.87%
Minions39.0625.27547.08% / 70.90%
HybridFlow55.9430.55867.42% / 85.72%
RectifyFlow80.0022.37096.42% / 62.75%

As shown in Tab. 10, RectifyFlow achieves an average performance of 80.00, retaining 96.42% of Cloud-only performance while reducing API costs by 37.25%. It also incurs the lowest API cost among cloud-based methods, demonstrating a favorable performance–cost trade-off under GPT-5.6-Terra.

To further evaluate the robustness of RectifyFlow under different cloud LLM configurations, we replace the default cloud model with GPT-5.6-Terra while keeping the edge model and framework unchanged. Fig. 8 presents the corresponding latency and communication overhead. RectifyFlow achieves 27.4s average latency and 67.1s P95 latency, which remain lower than most collaborative baselines that require frequent cloud interactions. The average cloud RTT is 11.68s, and the communication overhead is 36.31 KiB/task, indicating that the plan-guided execution strategy continues to reduce unnecessary cloud exchanges under different cloud models. Fig. 9 further reports the edge-side resource consumption with GPT-5.6-Terra. RectifyFlow maintains a similar resource profile, requiring only 27.6% CPU utilization, 1.5 GiB peak RAM, and 10.07 GiB GPU memory. Its GPU energy consumption is 9.929 Wh, remaining lower than most collaborative baselines. These results confirm that the efficiency advantages of RectifyFlow are not tied to a specific cloud model and remain stable across different cloud LLM configurations.

Table 11: Fine-grained component ablation of RectifyFlow on ToolSandbox. ✓ and ✗ indicate enabled and disabled components, respectively.

Variant DPC DPR Evaluation Output References Argument Grounding Execution Criteria Backward Localization Forward Impact Analysis Selective Patch Avg. Perf.↑ (×10−2) API Cost↓ (10−3 $) Cloud Calls↓ (per task) RectifyFlow ✓ ✓ ✓ ✓ ✓ ✓ 64.83 1.057 1.39 A. Ablating DPC w/o output references ✗ ✓ ✓ ✓ ✓ ✓ 58.32 1.889 1.98 w/o argument grounding ✓ ✗ ✓ ✓ ✓ ✓ 56.61 1.694 2.13 w/o execution criteria ✓ ✓ ✗ ✓ ✓ ✓ 61.68 1.153 1.54 w/o DPC ✗ ✗ ✗ ✓ ✓ ✓ 50.60 2.052 2.60 B. Ablating DPR w/o backward localization ✓ ✓ ✓ ✗ ✓ ✓ 59.28 1.174 1.53 w/o forward impact analysis ✓ ✓ ✓ ✓ ✗ ✓ 62.17 1.094 1.40 w/o selective plan rectification ✓ ✓ ✓ ✓ ✓ ✗ 63.26 1.217 1.42 w/o 𝒢 ✓ ✓ ✓ ✗ ✗ ✓ 61.83 1.262 1.59 w/o DPR ✓ ✓ ✓ ✗ ✗ ✗ 61.93 1.254 1.63

Ablation Implementation.

To provide a more fine-grained understanding of each component, we conduct a detailed ablation study by individually removing the key components of DPC and DPR. For DPC ablations, the removed components are excluded from the execution view, requiring the edge SM to resolve the missing information from available observations. For DPR ablations, removed mechanisms are replaced with simplified recovery strategies: the interrupted node is treated as the deviation source without backward localization, the entire plan is considered as the candidate scope without impact analysis, all candidate nodes are modified without selective rectification, and the dependency graph is removed during graph-free recovery.

Tab. 11 evaluates the contributions of DPC and DPR. The complete framework achieves the highest performance (64.83%) with the lowest API cost (1.057×10−3 USD/task) and cloud invocation count (1.39), demonstrating the effectiveness of combining structured execution guidance with dependency-aware rectification. For DPC, removing the complete guidance mechanism decreases performance to 50.60% and increases API cost to 2.052×10−3 USD/task, confirming that execution guidance substantially reduces the reasoning burden on the edge SM. Among individual components, output references and argument grounding have the largest impact, indicating the importance of explicit dependency binding and tool-argument construction. For DPR, removing backward localization causes the largest performance drop (64.83% to 59.28%), showing that accurately identifying deviation sources is critical for effective recovery. Forward impact analysis further improves recovery quality by reconsidering affected downstream nodes. Removing selective rectification increases API cost from 1.057 to 1.217×10−3 USD/task, demonstrating that minimal updates reduce rectification overhead while preserving execution progress. Finally, removing dependency information results in lower performance (61.83%) and higher cost (1.262×10−3 USD/task), indicating that dependency-aware analysis is essential beyond selective patching alone.

Table 12: Analysis of plan accuracy and the effectiveness of plan rectifications.

Stage Sequence Similarity Mean LCS Recall Mean Tool Recall Mean Median Initial plan (P0) 91.18 92.31 90.97 91.83 First-patch stage (P1) 92.69 94.74 94.37 95.26 Second-patch stage (P2) 93.50 100.00 95.99 96.94

Plan Quality and Rectification Effectiveness.

Tab. 12 analyzes the structural quality of generated plans and subsequent rectifications by comparing them with the corresponding ground-truth on the BFCL test set. The Initial stage is evaluated over all test instances, whereas the First-patch stage includes only instances that undergo at least one rectification, and the Second-patch stage further focuses on those requiring at least two rectifications. The initial plans already achieve high structural alignment, with 91.18% sequence similarity, 90.97% LCS recall, and 91.83% tool recall, indicating that the dual-view plan construction provides reliable initial execution guidance for edge-side SMs. For instances requiring rectification, the First-patch stage achieves 92.69% sequence similarity, 94.37% LCS recall, and 95.26% tool recall. Among instances undergoing at least two rectifications, the Second-patch stage further reaches 93.50%, 95.99%, and 96.94% on these metrics, respectively. These results show that RectifyFlow produces structurally reliable initial plans and that its dependency-aware rectification can progressively improve plan consistency without frequent full replanning.

Figure

Figure 10: Accuracy of backward deviation localization and forward impact analysis.

Mechanism Validation.

We evaluate the reliability of RectifyFlow’s deviation analysis across cloud models and characterize its cloud-side rectification process by examining the number of rectification rounds.

Figure

Figure 11: Distribution of Cloud Rectification Rounds.

Deviation Localization and Impact Identification.

To evaluate the reliability and generalizability of deviation localization and downstream impact analysis, we select ToolSandbox interaction trajectories in which RectifyFlow performs selective rectification. For each trajectory, we compare the deviation source identified through backward tracing with the ground-truth erroneous step, and evaluate forward impact analysis by comparing the identified downstream impact set with the corresponding reachable nodes in the dependency graph. As shown in Fig. 10, backward deviation localization achieves 90.17%–94.43% accuracy, while downstream impact identification reaches 89.66%–100% across the evaluated cloud models. These results demonstrate the reliability of both analyses and their generalizability across different cloud models.

Rectification Round Distribution.

We further examine the distribution of cloud Rectification rounds across ToolSandbox tasks to better understand how frequently execution deviations require repeated cloud-side intervention. As shown in Fig. 11, 54.93% of tasks require no cloud repair, suggesting that they can be completed without additional cloud-side correction. Another 39.41% require only one repair round, while just 5.66% involve two or more rounds. Notably, among tasks that require cloud repair, the vast majority are resolved within a single round. Overall, 94.34% of tasks are completed with at most one cloud repair round, indicating that RectifyFlow can generally handle execution deviations without requiring repeated cloud-side intervention. This distribution also suggests that multi-round repairs are relatively uncommon, helping limit the frequency of additional cloud-side interactions.

Prompt Design.

To instantiate RectifyFlow, we design four role-specific prompts for dual-view plan construction, edge execution, dependency-aware rectification, and final response generation. All prompts enforce structured JSON outputs to facilitate reliable interaction between model decisions and the execution engine. The cloud planning prompt guides ℳC to construct the dual-view plan by selecting relevant tools, building the dependency DAG, deriving the execution order, and annotating nodes with output references, argument-grounding specifications, and execution criteria. The edge execution prompt guides ℳE to execute nodes according to the execution view, instantiate tool arguments, evaluate execution conditions, and perform bounded local recovery for tool-supported errors. The rectification prompt guides ℳC to identify deviation sources through dependency analysis, determine affected nodes, and generate selective plan updates with state-consistency recovery when necessary. The complete prompts are provided below.