arXiv:2507.19608cs.AIeess.SP2025-07被引 6

无需训练,利用注意力时间稀疏性实现边缘设备高效大模型推理

DeltaLLM: A Training-Free Framework Exploiting Temporal Sparsity for Efficient Edge LLM Inference

  • 通过构建时序稀疏的增量矩阵,动态压缩注意力计算
  • 预填充阶段稀疏度达60%,解码阶段达57%,准确率提升或基本不变
  • 适合资源受限边缘设备,可无缝接入现有推理流程

在边缘设备上部署大语言模型(LLMs)仍面临挑战,因其计算量随序列长度呈二次增长。现有动态注意力剪枝方法针对具备大规模并行计算能力的硬件(如GPU/TPU)设计,适用于长上下文(如64K),不适用于边缘场景。本文提出DeltaLLM,一种无需训练的框架,利用注意力模式中的时间稀疏性,实现在预填充和解码阶段的高效推理。该框架引入兼顾精度与内存的增量矩阵构造策略,实现时序稀疏;并采用上下文感知的混合注意力机制,在局部窗口使用全注意力,外部则用增量近似以提升精度。我们在面向边缘设备的BitNet-b1.58-2B-4T和Llama3.2-1B-Instruct模型上评估,结果表明:在BitNet上,预填充阶段注意力稀疏度从0%提升至60%,WG任务准确率略有上升;预填充与解码阶段整体稀疏度达57%,SQuAD-v2任务F1分数从29.63升至30.97。在Llama模型上,预填充阶段可达60%稀疏度,两阶段综合稀疏度约57%,准确率几乎无损。结果证明,DeltaLLM为边缘部署提供了无需微调、可直接集成的高效解决方案。

原文摘要 · Abstract (English)

Deploying Large Language Models (LLMs) on edge devices remains challenging due to their quadratically increasing computations with the sequence length. Existing studies for dynamic attention pruning are designed for hardware with massively parallel computation capabilities, such as GPUs or TPUs, and aim at long context lengths (e.g., 64K), making them unsuitable for edge scenarios. We present DeltaLLM, a training-free framework that exploits temporal sparsity in attention patterns to enable efficient LLM inference across both the prefilling and decoding stages, on resource-constrained edge devices. DeltaLLM introduces an accuracy- and memory-aware delta matrix construction strategy that introduces temporal sparsity, and a context-aware hybrid attention mechanism that combines full attention in a local context window with delta approximation outside it to increase accuracy. We evaluate our framework on the edge-device-friendly BitNet-b1.58-2B-4T model and Llama3.2-1B-Instruct model across diverse language tasks. The results show that on BitNet, our framework increases the attention sparsity from 0% to 60% during the prefilling stage with slight accuracy improvement on the WG task, and 0% to 57% across both the prefilling and decoding stages, with even higher F1 score from 29.63 to 30.97 on SQuAD-v2 task. On the Llama model, it can also achieve up to 60% sparsity during the prefilling stage and around 57% across both stages with negligible accuracy drop. These results demonstrate that DeltaLLM offers a promising solution for efficient edge deployment, requiring no fine-tuning and seamlessly integrating with existing inference pipelines.

边缘推理注意力稀疏无需训练大模型部署

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。