HAT框架通过设备端轻量模型与云端协同推理,显著降低大模型响应延迟。
A Novel Hat-Shaped Device-Cloud Collaborative Inference Framework for Large Language Models
- 将大模型分为三部分,设备端运行轻量适配模型,云端处理核心解码任务。
- 通过分块传输长提示,使首次响应时间减少41%~54%,后续字节时间减少41%~77%。
- 适合资源受限设备上部署高精度大模型,兼顾低延迟与隐私保护。
大语言模型(LLM)的快速发展带来了对服务需求的激增。传统云部署虽满足高精度要求,但难以兼顾低延迟和隐私安全。为此,我们提出HAT——一种新型的设备-云协同推理框架,融合U型推理与推测解码优势。HAT将LLM划分为三个子模型:输入与输出子模型以轻量适配网络部署在终端设备上,形成小语言模型(SLM);中间主干部分由多数解码层构成,部署在云端进行推测解码。推理过程中,设备与云端交换隐藏状态而非原始令牌,有效减少通信开销。针对长提示导致的云端计算延迟问题,HAT引入提示分块机制,将长提示拆分为短块并行传输与处理,并动态优化各设备的最优分块大小。在由30个NVIDIA Jetson设备与8个A6000 GPU服务器组成的物理测试平台上实验表明,相比基线方法,HAT可降低41%~54%的首字响应时间(TTFT)和41%~77%的后续字节时间(TBT),显著提升整体推理效率。
原文摘要 · Abstract (English)
Recent advancements in large language models (LLMs) have catalyzed a substantial surge in demand for LLM services. While traditional cloud-based LLM services satisfy high-accuracy requirements, they fall short in meeting critical demands for low delay and enhanced privacy. To address these limitations, we propose HAT, a novel device-cloud collaborative inference framework that leverages the complementary strengths of U-shaped inference and speculative decoding. HAT partitions the LLM into three submodels, and the input and output submodels, stacked with a lightweight adapter network, are deployed as a small language model (SLM) on each end device. Meanwhile, the middle submodel, encompassing the majority of the LLM's decoder layers, is hosted in the cloud to perform speculative decoding with on-device SLMs. During inference, HAT exchanges hidden states (rather than raw tokens) of input or draft tokens between devices and the cloud, thereby incurring substantial communication delays. Besides, processing hidden states of long prompts will exacerbate computation delays in the cloud, further compromising inference efficiency. To improve efficiency, we introduce a prompt chunking mechanism that segments long prompts into shorter chunks, enabling parallel transmission and processing. Furthermore, HAT is implemented to dynamically determine optimal chunk sizes for devices handling long prompts, thereby improving overall inference speed. Extensive experiments are conducted on a physical testbed comprising 30 NVIDIA Jetson devices and a server with 8 NVIDIA A6000 GPUs. Experimental results demonstrate that HAT achieves promising performance improvements, reducing TTFT by 41% to 54% and TBT by 41% to 77% compared to the baselines.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。