arXiv:2410.23918cs.CLcs.AI2024-10被引 12

BitStack实现大模型任意大小压缩,适配不同内存环境。

BitStack: Any-Size Compression of Large Language Models in Variable Memory Environments

  • 通过权重分解动态调整模型大小,每参数约1比特残差块
  • 在极端压缩比下性能优于或媲美强量化基线
  • 无需训练,适合内存波动设备部署

大语言模型(LLMs)虽已革新众多应用,但本地设备的内存限制仍阻碍其部署。随着模型能力提升,瓶颈从「能力」转向「可用性」,亟需高效内存管理。传统压缩方法如量化需预设压缩比,且每种设置需独立压缩,难以适应变化内存环境。本文提出训练无关的新型权重压缩方法 BitStack,可在内存使用与模型性能间实现毫升级别的灵活权衡。通过权重分解,逐次迭代地分解权重矩阵,并考虑参数重要性,每次迭代生成约1比特/参数的残差块。这些块按重要性排序后作为基本传输单元存储,根据当前内存情况加载不同数量。大量实验表明,尽管具备细粒度尺寸控制,BitStack 在各类任务中始终匹配或超越强量化基线,尤其在极端压缩比下表现突出。据我们所知,这是首个有效衔接实际压缩技术(如量化)的基于分解的方法。代码已开源:https://github.com/xinghaow99/BitStack。

原文摘要 · Abstract (English)

Large language models (LLMs) have revolutionized numerous applications, yet their deployment remains challenged by memory constraints on local devices. While scaling laws have enhanced LLM capabilities, the primary bottleneck has shifted from \textit{capability} to \textit{availability}, emphasizing the need for efficient memory management. Traditional compression methods, such as quantization, often require predefined compression ratios and separate compression processes for each setting, complicating deployment in variable memory environments. In this paper, we introduce \textbf{BitStack}, a novel, training-free weight compression approach that enables megabyte-level trade-offs between memory usage and model performance. By leveraging weight decomposition, BitStack can dynamically adjust the model size with minimal transmission between running memory and storage devices. Our approach iteratively decomposes weight matrices while considering the significance of each parameter, resulting in an approximately 1-bit per parameter residual block in each decomposition iteration. These blocks are sorted and stacked in storage as basic transmission units, with different quantities loaded based on current memory availability. Extensive experiments across a wide range of tasks demonstrate that, despite offering fine-grained size control, BitStack consistently matches or surpasses strong quantization baselines, particularly at extreme compression ratios. To the best of our knowledge, this is the first decomposition-based method that effectively bridges the gap to practical compression techniques like quantization. Code is available at https://github.com/xinghaow99/BitStack.

模型压缩大模型内存优化

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