arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2408.13933cs.CL
收藏

MobileQuant:面向端侧语言模型的移动友好量化方法

MobileQuant: Mobile-friendly Quantization for On-device Language Models

Samsung AI Center Cambridge(三星剑桥人工智能中心);University of Cambridge(剑桥大学);University of Edinburgh(爱丁堡大学);Queen Mary University of London(伦敦大学玛丽皇后学院)

Fuwen Tan, Royson Lee, Łukasz Dudziak, Shell Xu Hu, Sourav Bhattacharya, Timothy Hospedales, Georgios Tzimiropoulos, Brais Martinez

AI总结:

针对大语言模型端侧部署的算力与精度矛盾,本研究提出训练后量化方法MobileQuant,通过端到端联合优化权重变换与激活范围,实现8比特激活近无损量化,适配移动硬件并显著降低延迟与能耗。

摘要:

大语言模型(LLM)彻底革新了语言处理领域,在多种应用中取得了出色成果。然而,在边缘设备上部署LLM面临内存、能耗和计算成本方面的诸多挑战,限制了其在手机等设备中的广泛应用。一种颇具前景的解决方案是减少权重和激活值的表示比特数。现有研究在将LLM量化至更低比特宽度(如4比特权重)方面取得了部分进展,但将激活值量化至16比特以下时,往往会因端侧量化支持不足导致计算开销大幅增加,或是出现显著的精度下降。不过,8比特激活值对端侧部署极具吸引力,因为它能让LLM充分利用移动友好型硬件,例如神经处理单元(NPU)。\n在本研究中,我们首次尝试通过纯整数量化推动LLM的端侧部署。我们首先调研了现有量化方法在端侧部署中的局限性,重点关注激活量化问题。随后,我们提出了一种简单的训练后量化方法MobileQuant来解决这些局限,该方法在以往权重等价变换研究的基础上,以端到端的方式联合优化权重变换和激活范围参数。MobileQuant相比现有方法展现出更优的性能:1)在多种LLM基准测试上实现了近无损量化;2)与当前端侧量化策略相比,延迟和能耗降低了20%-50%;3)所需计算预算有限;4)与NPU等移动友好型计算单元兼容。

英文摘要:

Large language models (LLMs) have revolutionized language processing, delivering outstanding results across multiple applications. However, deploying LLMs on edge devices poses several challenges with respect to memory, energy, and compute costs, limiting their widespread use in devices such as mobile phones. A promising solution is to reduce the number of bits used to represent weights and activations. While existing works have found partial success at quantizing LLMs to lower bitwidths, e.g. 4-bit weights, quantizing activations beyond 16 bits often leads to large computational overheads due to poor on-device quantization support, or a considerable accuracy drop. Yet, 8-bit activations are very attractive for on-device deployment as they would enable LLMs to fully exploit mobile-friendly hardware, e.g. Neural Processing Units (NPUs). In this work, we make a first attempt to facilitate the on-device deployment of LLMs using integer-only quantization. We first investigate the limitations of existing quantization methods for on-device deployment, with a special focus on activation quantization. We then address these limitations by introducing a simple post-training quantization method, named MobileQuant, that extends previous weight equivalent transformation works by jointly optimizing the weight transformation and activation range parameters in an end-to-end manner. MobileQuant demonstrates superior capabilities over existing methods by 1) achieving near-lossless quantization on a wide range of LLM benchmarks, 2) reducing latency and energy consumption by 20\%-50\% compared to current on-device quantization strategies, 3) requiring limited compute budget, 4) being compatible with mobile-friendly compute units, e.g. NPU.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑