通过边缘预判与云端验证协同,降低大模型在设备端的推理延迟。
Fast and Cost-effective Speculative Edge-Cloud Decoding with Early Exits
- 边缘端用小模型预拟输出,云端大模型分步验证并提前生成后续内容。
- 在Jetson Nano与A100上实测延迟降低35%,预判机制再降11%。
- 适用于机器人等资源受限场景,适合实时智能交互应用。
大型语言模型(LLMs)可在智能手机、可穿戴设备和具身机器人等边缘设备上实现多种应用。然而,其部署常依赖昂贵的云API,带来高运营成本,限制中小机构使用并引发可持续性问题。部分LLM可本地部署,虽降低成本、减少延迟并提升隐私,但受限于算力,模型规模与精度受限,需边缘与云端协同设计。本文提出一种快速且低成本的推测性边缘-云解码框架:服务器部署大目标模型(Llama2-7B),设备端部署小草稿模型(Vicuna-68M)。通过在目标模型中引入早期退出机制,允许客户端在验证过程中提前预拟后续token,利用空闲时间提升边缘与云端并行度。实验使用NVIDIA Jetson Nano(客户端)与A100 GPU(服务端),相比纯云端自回归解码,延迟最高降低35%,预判机制额外提升11%。为验证实际可行性,我们在Unitree Go2四足机器人上基于视觉-语言模型(VLM)控制部署该方法,相较传统云端自回归解码提速21%。结果表明,该框架在资源受限边缘设备上的实时LLM与VLM应用具有巨大潜力。
原文摘要 · Abstract (English)
Large Language Models (LLMs) enable various applications on edge devices such as smartphones, wearables, and embodied robots. However, their deployment often depends on expensive cloud-based APIs, creating high operational costs, which limit access for smaller organizations and raise sustainability concerns. Certain LLMs can be deployed on-device, offering a cost-effective solution with reduced latency and improved privacy. Yet, limited computing resources constrain the size and accuracy of models that can be deployed, necessitating a collaborative design between edge and cloud. We propose a fast and cost-effective speculative edge-cloud decoding framework with a large target model on the server and a small draft model on the device. By introducing early exits in the target model, tokens are generated mid-verification, allowing the client to preemptively draft subsequent tokens before final verification, thus utilizing idle time and enhancing parallelism between edge and cloud. Using an NVIDIA Jetson Nano (client) and an A100 GPU (server) with Vicuna-68M (draft) and Llama2-7B (target) models, our method achieves up to a 35% reduction in latency compared to cloud-based autoregressive decoding, with an additional 11% improvement from preemptive drafting. To demonstrate real-world applicability, we deploy our method on the Unitree Go2 quadruped robot using Vision-Language Model (VLM) based control, achieving a 21% speedup over traditional cloud-based autoregressive decoding. These results demonstrate the potential of our framework for real-time LLM and VLM applications on resource-constrained edge devices.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。