用大模型做梯度压缩,零样本下效率提升超38倍
Language Models as Zero-shot Lossless Gradient Compressors: Towards General Neural Parameter Prior Models
- 将梯度转为文本格式,结合算术编码实现高效压缩
- 相比现有方法压缩率提升10%至17.2%,最高提速38倍
- 兼容量化与稀疏化,适合分布式训练场景
尽管统计先验模型在多个领域广泛应用,但针对神经网络梯度的建模长期被忽视。其主要难点在于梯度的高维结构与复杂依赖关系。本文首次证明大语言模型(LLMs)可在零样本设置下作为梯度先验。通过损失无损压缩这一分布式学习关键任务,我们提出LM-GC方法,将原始梯度转换为类文本格式,并结合算术编码,使词元效率提升高达38倍。该转换保持了梯度结构与语言模型常用符号的一致性。实验表明,LM-GC在多种数据集和架构上超越现有最优无损压缩方法,压缩率提升10%至17.2%。此外,该方法与量化、稀疏化等有损压缩技术具有良好兼容性。结果表明,大语言模型具备成为通用神经参数先验模型的巨大潜力。代码已开源:https://github.com/hui-po-wang/LM-GC。
原文摘要 · Abstract (English)
Despite the widespread use of statistical prior models in various fields, such models for neural network gradients have long been overlooked. The inherent challenge stems from their high-dimensional structures and complex interdependencies, which complicate effective modeling. In this work, we demonstrate the potential of large language models (LLMs) to act as gradient priors in a zero-shot setting. We examine the property by considering lossless gradient compression -- a critical application in distributed learning -- that depends heavily on precise probability modeling. To achieve this, we introduce LM-GC, a novel method that integrates LLMs with arithmetic coding. Our technique converts plain gradients into text-like formats, enhancing token efficiency by up to 38 times compared to their plain representations. We ensure that this data conversion maintains a close alignment with the structure of plain gradients and the symbols commonly recognized by LLMs. Our experiments indicate that LM-GC surpasses existing state-of-the-art lossless compression methods, improving compression rates by 10% up to 17.2% across various datasets and architectures. Additionally, our approach shows promising compatibility with lossy compression techniques such as quantization and sparsification. These findings highlight the significant potential of LLMs as a model for effectively handling gradients. Code is available at https://github.com/hui-po-wang/LM-GC.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。