按层重要性动态量化,让大模型在边缘设备更省资源且保持性能。
LSAQ: Layer-Specific Adaptive Quantization for Large Language Model Deployment
- 按各层输入输出的词元相似度评估重要性,决定量化精度。
- 在多个任务上比现有方法更低困惑度,零样本任务表现更优。
- 适合不同算力的边缘设备,部署灵活可适配多种场景。
随着大语言模型(LLMs)在多个领域展现卓越性能,将其部署于资源受限的边缘设备成为新趋势。量化技术能有效降低模型大小与内存需求,适用于边缘部署。然而,现有统一量化方法难以动态调整内存占用,限制了其在异构边缘设备上的应用。为此,我们提出层特定自适应量化(LSAQ),一种基于层重要性的自适应量化与动态部署系统。LSAQ通过构建每层输入输出的 top-k 词元集合并计算 Jaccard 相似度,评估各层重要性;据此实时调整量化策略——重要层采用更高精度,非重要层则降低精度。实验表明,LSAQ 在困惑度和零样本任务上均优于所选量化基线,并能为不同使用场景生成合适的量化方案,促进 LLM 的实际部署。
原文摘要 · Abstract (English)
As Large Language Models (LLMs) demonstrate exceptional performance across various domains, deploying LLMs on edge devices has emerged as a new trend. Quantization techniques, which reduce the size and memory requirements of LLMs, are effective for deploying LLMs on resource-limited edge devices. However, existing one-size-fits-all quantization methods often fail to dynamically adjust the memory requirements of LLMs, limiting their applications to practical edge devices with various computation resources. To tackle this issue, we propose Layer-Specific Adaptive Quantization (LSAQ), a system for adaptive quantization and dynamic deployment of LLMs based on layer importance. Specifically, LSAQ evaluates the importance of LLMs' neural layers by constructing top-k token sets from the inputs and outputs of each layer and calculating their Jaccard similarity. Based on layer importance, our system adaptively adjusts quantization strategies in real time according to the computation resource of edge devices, which applies higher quantization precision to layers with higher importance, and vice versa. {Experimental results show that LSAQ consistently outperforms the selected quantization baselines in terms of perplexity and zero-shot tasks. Additionally, it can devise appropriate quantization schemes for different usage scenarios to facilitate the deployment of LLMs.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。