← 返回 2026-10-16

EdgeWise:用选择性云端委托把长程智能体搬到边缘 EdgeWise: Bringing Long-Horizon Agents to the Edge via Selective Cloud Delegation

Zeru Shi, Jindong Jiang, Ryo Hachiuma, Yonggan Fu, Byung-Kwan Lee, Peter Belcak, Saurav Muralidharan, Ayush Agarwal, Ruixiang Tang, Ambrish Dantrey, Pavlo Molchanov, Anjul Patney, Subhashree Radhakrishnan 📅 2026-10-13 👍 27 2026-11-11 18:30
推理成本优化 模型路由 步级强化学习 边缘-云协同 长程智能体

边缘小模型主力解题、按步选择性委托云端大模型,成本最高降62%而性能持平

前置知识

长程智能体任务

指智能体需要在数十乃至上百个交互步骤内持续与环境交互才能完成的任务,例如修复仓库级 bug:需要浏览代码、定位根因、编写补丁、运行测试、根据失败再修改。每一步的输出(执行的命令、观察结果)都会写进轨迹并影响后续所有决策,因此也叫长视界(long-horizon)任务。

本文的问题设定就是这类任务的成本优化,所有分析(按步骤类型统计、按轨迹结算成本)都建立在「任务由一长串异质步骤构成」这一前提上。

SLM 与 LLM(小模型与大模型)

SLM 指可部署在边缘设备(如 NVIDIA DGX Spark)的数十亿参数模型,本文用 Qwen3.5-9B、TMax-9B;LLM 指云端前沿模型,如 GPT-5.5(xhigh 推理档)、Opus 4.8,能力更强但按 token 计费且依赖数据中心服务。两者的能力/价格差是数倍到数十倍。

边缘-云协同的经济动机正来自这个落差:只有理解两类模型的能力与成本差距,才能理解「只把少数关键步骤留给云端」为什么既能省钱又不掉点。

SFT(监督微调)

用(输入,目标输出)成对数据直接最大化条件似然的训练方式,损失为 $\mathcal{L}_{SFT} = -\sum_{(x,y)\in\mathcal{D}_{SFT}} \log p_\theta(y|x)$。本文 SFT 阶段用 GPT-5.5 生成带委托标签的轨迹,只教模型「委托」这种输出格式,不教委托时机。

论文用 SFT-only 与 RL 模型的对比(57.30% 对 71.91%)证明:会委托格式和会判断何时委托是两回事,这是理解两阶段训练设计的关键。

GRPO 与轨迹级优势

Group Relative Policy Optimization 是一种在线强化学习算法:对同一提示采样一组 rollout,用组内奖励的相对高低计算轨迹级优势 $A_{traj}$,通常轨迹内所有 token 共享同一优势值。优点是无需训练价值网络,缺点是无法区分轨迹内哪些具体决策真正贡献了成败。

本文方法正是针对 GRPO 这一缺陷,给委托 token 额外加细粒度优势;理解 GRPO 才能看懂核心公式 $A_t = A_{traj} + \beta\frac{N_{trajectory}}{N_{route}}A^i_{del}$ 的动机。

Pass@1 与 Pass@3

智能体基准的常用指标:Pass@1 是单次尝试的解题率;Pass@3 是允许三次尝试(通常并行三条轨迹)至少一次成功的比例,更接近能力上限但对成本更敏感——三次全用大模型时成本约为 Pass@1 的三倍。

主结果表同时报告两个指标:本文方法在 Pass@3 上常能追平纯大模型(如 Terminal-Bench 2.1 的 82.02%),这是「协作缓解过度思考、增加探索多样性」这一论断的证据来源。

Agent Harness(智能体脚手架)

包裹模型的执行框架,负责把模型输出的动作(命令、代码编辑)放进真实环境(shell、代码仓库)执行、把观察拼回上下文、控制最大轮数等。同一模型换 harness 成绩会明显不同,常见有 Terminus2、OpenHands、mini-SWE-agent。

委托决策发生在 harness 循环的每一步里;论文用三个未见 harness 的迁移实验证明方法不绑定特定脚手架,理解 harness 才能正确评估其泛化性声明。

研究动机

长程智能体任务(如修复仓库级 bug、终端运维)通常依赖云端前沿大模型逐步执行,推理开销随轨迹长度线性放大。以本文实测为例:GPT-5.5(xhigh 档)在 Terminal-Bench 2.1 上单题 Pass@1 平均花费 $90.31、Pass@3 高达 $279.73;在 SWE-ReBench 上 Pass@3 更是达到 $598.08。而轨迹中并非每一步都同等困难——浏览仓库、跑测试等常规步骤本地小模型即可胜任,真正需要强推理的只是少数环节。现有多模型路由方法难以直接套用:query 级路由在解题前就定死模型,无法感知执行中途才暴露的难点;RSD、STEER、MTRouter 等多轮路由依赖额外决策模型和预定义模型池,模型池一变路由就失灵,且大多只在单轮问答或多跳 QA 上验证,缺少在真实长程编码任务上的评估。作者用随机委托实验进一步揭示:即便给 40% 的云端预算,不同随机分配的性能差异巨大——「把钱花在哪几步」比「花多少」更关键,但随机策略无法保证花对地方。

本文的目标是本文目标是构建边缘-云协同框架 EdgeWise:在 DGX Spark 这类本地设备上部署小模型(SLM,Qwen3.5-9B)作为主力解题者,持续与环境交互,只在少数关键步骤把任务委托给云端大模型(GPT-5.5、Opus 4.8),在保持与纯大模型执行相当的任务性能的同时大幅降低云端推理开销。具体包括三件事:(1) 用数据分析回答「哪些步骤值得委托」;(2) 设计并对比两种委托机制——无需训练的外部裁判委托,以及把「是否委托」内化为 SLM 自身动作的自委托,后者通过 SFT+RL 两阶段训练得到,推理时不再需要任何额外决策模型;(3) 系统研究何时委托、如何决策、共享什么上下文、以何种频率调用这四个设计因素,并在真实边缘设备 DGX Spark 上验证端到端可行性,最终目标是将云端成本平均降低约 46%。

与已有工作不同的是,本文的独特切入是把路由粒度从「每次查询/每次回答」细化到「智能体的每一步」,并且先做数据驱动的归因分析再设计机制:作者分析 2.4k 条编码智能体轨迹,把每步归入 Write/Edit、Read/Search、Diagnose/Reproduce、Test/Validate、Discover/Navigate、Wait/Poll 六类动作,用任务-预算组内中心化的 Pearson 相关衡量各类动作的云端覆盖率与成功率的关系,发现 Write/Edit 相关性最强($r=0.200$,95% CI $[0.099, 0.297]$),成功轨迹在 Write/Edit 上的云端覆盖率比失败轨迹高 9.4(TB2.1)/ 5.6(SWE-ReBench)个百分点。另一个差异化角度是把「是否委托」当作 SLM 策略本身的一个动作,用带步级信用分配的强化学习与解题能力联合优化,推理时零额外路由模型,避开了已有方法对预定义模型池的依赖;最后以 DGX Spark 真机部署闭环验证,而非停留在 API 成本模拟。

核心方法

直觉上,长程任务像一台手术:主刀(本地 SLM)全程在场处理常规操作,只在疑难环节请专家会诊(云端 LLM)。技术路线上,SLM 在 agent harness 中循环执行「感知-分析-行动-观察」,每个动作执行前先做一次委托决策。框架提供两种机制:(1) 外部裁判委托——由 GPT-5.4-mini 根据轨迹历史 $h_t$ 输出二值决策 $a_t = J(h_t) \in \{Local, Cloud\}$,或输出连续委托分数 $s_t$ 并与阈值 $\tau$ 比较,$s_t > \tau$ 则上云;每步之后裁判基于更新后的轨迹重新评估,$\tau$ 越低云端介入越频繁,可灵活适配不同云端预算;(2) 自委托——先 SFT 教会 SLM 委托的输出格式,再用带步级信用分配的 RL 让它学会何时值得委托。委托发生时默认把完整历史上下文交给云端 LLM,其输出写回轨迹后控制权立即交还 SLM,继续本地执行。

核心创新是把「少用云」和「用对地方」解耦并分别建模。轨迹级奖励 $R_i = V_i + \mathbb{I}(V_i=1)\frac{1}{1+\lambda C_i}$($V_i$ 为任务是否成功,$C_i$ 为云端调用次数,$\lambda=0.1$ 按训练数据的云端调用统计设定)只控制委托总量,不指明该委托哪几步。为此引入步级信用分配:用 GPT-5.4-mini 作轻量 critic,按关键步骤标准逐个评判委托决策——与 critic 一致记 $A^i_{del}=+1$,不一致记 $-1$,本地执行已充分时不加额外优势;委托 token 的最终优势为 $A_t = A_{traj} + \beta \frac{N_{trajectory}}{N_{route}} A^i_{del}$,比例因子 $N_{trajectory}/N_{route}$ 防止稀疏的委托信号被稀释。与标准 GRPO 中所有 token 共享同一轨迹优势不同,这让模型学到「哪些步骤值得上云」而非单纯少上云;与已有路由方法的本质区别是:没有独立路由器,委托作为策略自身的动作与解题联合优化。

方法步骤详情

训练分两阶段。第一阶段 SFT:用 GPT-5.5 生成任务求解轨迹,并在每步标注「若由小模型执行是否需要委托」,共 2K 条样本;标签只作格式监督(让委托成为合法动作),不作时机监督,优化 $\mathcal{L}_{SFT} = -\sum_{(x,y)\in\mathcal{D}_{SFT}} \log p_\theta(y|x)$。第二阶段 RL:在 SWE-Smith 上训练,云端 LLM 用 Kimi-K3,40 张 A100 80GB 跑 175 步,batch size 8、每例 16 个 rollout,得到 EdgeWise-9B。推理流程:harness 给出当前观察 → SLM 输出分析并做委托决策 → 本地执行则自己生成动作,委托则把上下文(默认全历史)发给云端 LLM 并把其输出写回轨迹 → 环境执行动作返回观察,进入下一步。裁判式变体中 GPT-5.4-mini 每步基于全历史重新打分;阈值消融显示 $\tau \in [0.2, 0.4]$ 时性能-成本权衡最佳,对应约 50%–53% 云端调用率,$\tau=0.8$ 时降至约 28%。

技术新颖性

技术新颖性体现在四点。其一,用受控的相关性分析(组内中心化消除任务难度与委托预算的混杂,cluster bootstrap 估计 95% 置信区间)把「哪些步骤值得上云」变成可量化的经验事实,而非直觉假设。其二,步级信用分配:标准 GRPO 只给轨迹级优势,无法区分关键委托与例行委托;本文用外部 critic 给委托 token 打 ±1 的细粒度优势,配合 $\beta N_{trajectory}/N_{route}$ 缩放因子,是把「过程监督」思想落到智能体委托决策上的具体方案。其三,训练动态自证机制有效:云路由率从 SFT 后的约 71% 先降到 21.9%,再随 token 级优势生效回升并稳定在约 42%,critic-SLM 一致度从初期下滑后回升到 90% 以上峰值,说明模型学到的是时机而非单纯减少委托。其四,完整的设计空间消融(何时/如何/什么上下文/多频繁)加上 DGX Spark 真机部署,把一个想法做成了可运行的系统而非只停留在离线模拟。

The upper panel illustrates the overall pipeline of EdgeWise, while the lower panel provides an example of how EdgeWise operates during task execution.
Figure 2: The upper panel illustrates the overall pipeline of EdgeWise, while the lower panel provides an example of how EdgeWise operates during task execution.
The left panel shows the accuracy and inference cost under three different context configurations provided to the judge. The right panel shows the accuracy and inference cost under five different context configurations passed from the SLM to the LLM.
Figure 6: The left panel shows the accuracy and inference cost under three different context configurations provided to the judge. The right panel shows the accuracy and inference cost under five different context configurations passed from the SLM to the LLM.
LLM delegation rate in answer trajectories throughout the training process.
Figure 8: LLM delegation rate in answer trajectories throughout the training process.
Learning curve during the training. From left to right, the three panels illustrate entropy loss, reward and the advantage of judge tokens.
Figure 9: Learning curve during the training. From left to right, the three panels illustrate entropy loss, reward and the advantage of judge tokens.
The critic and SLM agreement with the training steps.
Figure 10: The critic and SLM agreement with the training steps.

实验结果

主结果(Table 1):GPT-5.5(xhigh)下,SWE-ReBench 上 Self-Delegation Pass@1 58.18%/$97.80、Pass@3 66.36%/$283.02,对比纯 LLM 56.36%/$200.50、63.64%/$598.08,精度反超 1.82/2.72pp、成本降 51.2%/52.7%;TB2.1 上 Pass@1 71.91%/$56.96(−2.25pp、−36.9%),Pass@3 82.02%/$181.88(持平、−35.0%)。换 Opus 4.8 结论一致,SWE-ReBench 成本降 62.7%/62.1%(摘要所称最高 62%)。方法对随机委托、RSD、STEER、MTRouter 全面占优;免训练 Binary Delegation 也有 98%/93% 相对精度,成本 $61/$124 对纯云 $93/$199(Figure 5)。消融:SFT-only 仅 57.30%,RL 后 71.91%(Table 2);去掉 token 级优势降至 65.17%,Write/Edit 委托占比 42.82%→29.20%,每题委托 8.97→5.80 次(Table 3);「先 GRPO 提解题再 SFT」对照组仅 32.58%(Table 4),证明关键在学「何时委托」。泛化:换 TMax-9B 仍同精度省 30.6% 成本(Table 6);迁移到三个未见 harness 成本降 25.1%–46.3%、精度最多降 3.4pp(Table 7);裁判换开源 Qwen3.8-27B 也有 70.79%(Table 5)。真机 DGX Spark(11.19 tokens/s,平均每题 11.72 分钟)Pass@3 与 A100 相当,较纯云降本约 50%。

Performance and cost across benchmarks and baselines. Binary and Threshold Delegation costs include the external judge. Bold and underlined denote the best and second-best results excluding vanilla LLM.
Table 1: Performance and cost across benchmarks and baselines. Binary and Threshold Delegation costs include the external judge. Bold and underlined denote the best and second-best results excluding vanilla LLM.
The pass@1 and cost of SFT-model and Self-delegation model.
Table 2: The pass@1 and cost of SFT-model and Self-delegation model.
Ablation study of the token advantage during the RL training stage.
Table 3: Ablation study of the token advantage during the RL training stage.
Comparison of using GRPO train Qwen3.5-9B and self-delegation model.
Table 4: Comparison of using GRPO train Qwen3.5-9B and self-delegation model.
The Pass@1 and cost of using different judge models in the binary delegation method.
Table 5: The Pass@1 and cost of using different judge models in the binary delegation method.
The pass@1 and cost of using Tmax-9B as SLM of our binary delegation method in the framework.
Table 6: The pass@1 and cost of using Tmax-9B as SLM of our binary delegation method in the framework.
Pass@3 using different harness on Terminal-bench 2.1.
Table 7: Pass@3 using different harness on Terminal-bench 2.1.
The two left figures illustrate the trade-off between Pass@3 performance and inference cost for our method and the baselines across different settings and efforts. The right figure further analyzes the delegation behavior of our method by showing the proportions of different types of agent steps that are delegated to the LLM.
Figure 1: The two left figures illustrate the trade-off between Pass@3 performance and inference cost for our method and the baselines across different settings and efforts. The right figure further analyzes the delegation behavior of our method by showing the proportions of different types of agent steps that are delegated to the LLM.
Performance and API cost of our training-free key-step delegation method compared with the pure large-model baseline. All metrics are averaged over three independent runs.
Figure 5: Performance and API cost of our training-free key-step delegation method compared with the pure large-model baseline. All metrics are averaged over three independent runs.
The left 3 figures shows the accuracy and inference cost under three different context configurations provided to the judge. The right figure shows the comparison between accuracy and inference cost on DGXSpark and A100.
Figure 7: The left 3 figures shows the accuracy and inference cost under three different context configurations provided to the judge. The right figure shows the comparison between accuracy and inference cost on DGXSpark and A100.
Distribution of step types handled by the LLM on Terminal-Bench 2.1 and SWE-ReBench.
Figure 11: Distribution of step types handled by the LLM on Terminal-Bench 2.1 and SWE-ReBench.
查看结构化数据
任务指标本文基线提升
SWE-ReBench(Qwen3.5-9B + GPT-5.5 xhigh) Pass@1 准确率 / 单题成本 Self-Delegation:58.18% / $97.80 Vanilla LLM:56.36% / $200.50 准确率 +1.82pp,成本 −51.22%
SWE-ReBench(Qwen3.5-9B + GPT-5.5 xhigh) Pass@3 准确率 / 成本 66.36% / $283.02 Vanilla LLM:63.64% / $598.08 准确率 +2.72pp,成本 −52.68%
Terminal-Bench 2.1(Qwen3.5-9B + GPT-5.5 xhigh) Pass@3 准确率 / 成本 82.02% / $181.88 Vanilla LLM:82.02% / $279.73 准确率持平,成本 −34.98%
SWE-ReBench(Qwen3.5-9B + Opus 4.8) Pass@1 准确率 / 成本 Self-Delegation:57.27% / $74.28 Vanilla LLM:60.00% / $199.06 成本 −62.68%,精度 −2.73pp
Terminal-Bench 2.1(对最强基线) Pass@1 准确率 / 成本 Self-Delegation:71.91% / $56.96 最优基线 MTRouter:68.54% / $73.55 精度 +3.37pp,成本再降约 22.5%
Terminal-Bench 2.1(TMax-9B 作 SLM,换模型泛化) Pass@1 准确率 / 成本 Binary Delegation:74.16% / $62.64 纯 GPT-5.5:74.16% / $90.31 准确率持平,成本 −30.6%

局限与改进

作者在附录 A 中承认:本文只在长程编码任务上验证,尚未覆盖 deep research、computer-use 等其他智能体场景,边缘-云协同的机会能否迁移有待检验。我的补充观察:(1) 多个设置下 Pass@1 有 2–3.4 个百分点回退(如 TB2.1+GPT-5.5 −2.25pp、Opus 4.8 版 −3.38pp),对精度敏感场景需要权衡;(2) Binary Delegation 每步调用裁判引入额外 API 成本与延迟,且裁判本身依赖 GPT-5.4-mini 这类外部闭源模型;(3) 阈值 $\tau$ 只能间接控制云端用量($\tau$ 从 0.2 到 0.8 时云端率约 53% 降到 28%),无法给出硬预算保证;(4) 边缘侧 9B 模型生成仅 11.19 tokens/s、平均每题 11.72 分钟,交互式场景偏慢,且本地算力与电费未计入成本统计;(5) Write/Edit 是关键步骤的结论完全来自编程任务语料,领域迁移性未知;(6) RL 训练需要 40×A100 和外部 critic 模型,复现门槛高。

独立分析的弱点

(1) 关键步骤模式强绑定编程领域:$r=0.200$ 的分析来自编码轨迹,换到 deep research 或 GUI 场景「关键步骤」的定义可能完全不同。改进方向:让 critic 标准随领域自适应,或先在目标领域做小规模覆盖率分析。(2) 训练期依赖 GPT-5.4-mini 作 critic,引入对闭源模型的依赖。改进方向:Table 5 显示开源 Qwen3.8-27B 已能胜任,可改用它,或结合规则+覆盖率统计的混合标准。(3) 预算控制是软性的:阈值只改变委托判据,实际云端率随任务波动(约 53%→28%),无法承诺成本上限。改进方向:把 $C_i$ 写成带拉格朗日乘子的约束优化,或加在线预算控制器动态调 $\tau$。(4) 委托延迟未建模:云端网络往返在高频委托时拖慢轨迹,真机每题 11.72 分钟已不快。改进方向:把时延纳入奖励,或对诊断类步骤做推测性预取。(5) 上下文默认传全历史,长轨迹下成本随步数增长;No SLM Reasoning 取得次优说明存在压缩空间。改进方向:学习式上下文压缩或检索式选取。

未来方向

作者提出的方向:把框架推广到 deep research、computer-use 等更多长程智能体任务,验证关键步骤假设的普适性。基于本文成果可延伸的方向:(1) 把委托输出蒸馏回 SLM——类似 MERA 用大模型调用反哺小模型的思路,让云端解决的关键步骤反过来微调本地模型,逐步降低云端依赖,形成越用越省的飞轮;(2) 多级模型池:目前只有本地/云端两级,可扩展到本地 SLM、中等区域模型、前沿 LLM 的三级委托,细分成本曲线;(3) 联合优化上下文传递:让策略同时学「委托什么」和「带什么上下文上云」,把 3.3 节的五种上下文配置变成可学习动作;(4) 硬预算保证:结合 conformal 方法或约束 RL,给出成本上限下的性能下界;(5) 跨 harness 持续适应:Table 7 显示迁移有 2–3pp 损耗,可用少量目标域 rollout 做轻量校准;(6) 服务端视角的系统研究:多租户下批量调度委托请求、错峰复用 KV 缓存,进一步摊薄边际成本。

复现评估

复现难度中等偏高。数据与评测基本公开:Terminal-Bench 2.1、SWE-ReBench、SWE-Smith 均为公开基准,Terminus2、OpenHands 等 harness 开源;但论文未明确承诺开源代码与 EdgeWise-9B 权重,SFT 数据(2K 条带委托标签轨迹)也未发布。算力是主要门槛:RL 需 40 张 A100 80GB 跑 175 步、batch 8、每例 16 rollouts,多轮环境交互让 rollout 管理相当复杂。推理侧门槛低得多:9B SLM 在单台 DGX Spark(约 78.7GB 统一内存,16.8GiB 权重 + 57.1GiB KV cache,vLLM 0.19.1 BF16)即可运行。依赖的 GPT-5.5、Opus 4.8、Kimi-K3、GPT-5.4-mini 均为商业 API,版本漂移可能影响可比性;作者也提到 Opus 4.8 经 Bedrock 因配置差异表现略低。建议复现路径:先复现免训练的 Binary/Threshold Delegation(只需裁判 API + 关键步骤规则),性价比最高;RL 自委托需相当工程与算力投入。

相似论文推荐