通过激活稀疏性压缩大模型,实现50%内存与计算减少。
Activation Sparsity Opportunities for Compressing General Large Language Models
- 在大模型前馈网络中引入零强制阈值,实现激活稀疏化。
- 关键组件可降低约50%内存与计算开销,精度损失极小。
- 适用于各类通用大模型,特别适合资源受限的边缘设备。
将大型语言模型(LLMs)部署至边缘设备可显著提升设备自主能力,减轻服务器负担并降低响应延迟。尽管已有轻量级小语言模型(SLMs)问世,但将更强大的LLMs部署于边缘仍具巨大潜力。不同于传统模型压缩方法,本文研究激活稀疏性,该方法与现有技术正交且可组合,能最大化压缩率同时保持高精度。由于前馈网络(FFN)占模型参数总量约2/3,优化其结构更易实现高效压缩。本研究系统分析了激活稀疏性与困惑度(精度)之间的权衡,在主流LLMs上验证表明:通过注入零强制阈值,可在关键FFN组件上实现约50%的主存与计算量降低,且精度下降可忽略。这一额外50%稀疏性并非自然存在,需通过调参实现。为此,本文提出面向系统架构师的预测与预取指南,使系统可提前加载有效权重,跳过无效分支及其后续计算,从而减少缓存污染与内存占用,显著缩短边缘设备上的推理时间。
原文摘要 · Abstract (English)
Deploying local AI models, such as Large Language Models (LLMs), to edge devices can substantially enhance devices' independent capabilities, alleviate the server's burden, and lower the response time. Owing to these tremendous potentials, many big tech companies have released several lightweight Small Language Models (SLMs) to bridge this gap. However, we still have huge motivations to deploy more powerful (LLMs) AI models on edge devices and enhance their smartness level. Unlike the conventional approaches for AI model compression, we investigate activation sparsity. The activation sparsity method is orthogonal and combinable with existing techniques to maximize the compression rate while maintaining great accuracy. LLMs' Feed-Forward Network (FFN) components, which typically comprise a large proportion of parameters (around 2/3), ensure that our FFN optimizations would have a better chance of achieving effective compression. Moreover, our findings are beneficial to general LLMs and are not restricted to ReLU-based models. This work systematically investigates the tradeoff between enforcing activation sparsity and perplexity (accuracy) on state-of-the-art LLMs. Our empirical analysis demonstrates that we can obtain around 50% of main memory and computing reductions for critical FFN components with negligible accuracy degradation. This extra 50% sparsity does not naturally exist in the current LLMs, which require tuning LLMs' activation outputs by injecting zero-enforcing thresholds. To obtain the benefits of activation sparsity, we provide a guideline for the system architect for LLM prediction and prefetching. The success prediction allows the system to prefetch the necessary weights while omitting the inactive ones and their successors, therefore lowering cache and memory pollution and reducing LLM execution time on resource-constrained edge devices.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。