NOLA: Compressing LoRA using Linear Combination of Random Basis
作者: Soroush Abbasi Koohpayegani, KL Navaneet, Parsa Nooralinejad, Soheil Kolouri, Hamed Pirsiavash
分类: cs.CL, cs.CV
发布日期: 2023-10-04 (更新: 2024-04-30)
备注: ICLR 2024. Our code is available here: https://github.com/UCDvision/NOLA
🔗 代码/项目: GITHUB
💡 一句话要点
提出NOLA以解决LoRA参数下限问题
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大型语言模型 模型压缩 低秩适应 随机基 参数优化
📋 核心要点
- 现有的LoRA方法在参数数量上受限于秩一分解,无法进一步压缩模型。
- NOLA通过线性组合随机生成的矩阵来重新参数化低秩矩阵,优化混合系数,从而解耦参数数量与秩和架构的关系。
- 在多个任务上,NOLA的性能与LoRA相当,但参数数量显著减少,尤其在LLaMA-2 70B上实现了近20倍的压缩。
📝 摘要(中文)
微调大型语言模型(LLMs)并为每个下游任务或领域存储它们是不切实际的,因为模型体积庞大(例如,GPT-3为350GB)。现有文献如LoRA展示了低秩修改原始权重的潜力,使得任务特定模型的高效适应和存储成为可能。然而,这些方法面临两个主要限制:(1)参数数量受限于秩一分解,(2)减少的程度受到模型架构和选择的秩的影响。我们提出NOLA,通过使用随机生成矩阵的线性组合重新参数化LoRA中的低秩矩阵,仅优化线性混合系数,从而克服了LoRA中的秩一下限。NOLA在自然语言和计算机视觉任务中表现出色,尤其在LLaMA-2 70B上,模型压缩比LoRA的最佳压缩效果高出近20倍,且准确性未受影响。
🔬 方法详解
问题定义:论文要解决的是LoRA方法在参数数量上的下限问题,现有方法无法进一步压缩模型,限制了其在实际应用中的灵活性和效率。
核心思路:论文的核心解决思路是通过线性组合随机生成的矩阵来重新参数化低秩矩阵,仅优化这些线性混合系数,从而突破秩一分解的限制。
技术框架:整体架构包括生成随机基矩阵、线性组合这些基矩阵以形成低秩矩阵,以及优化混合系数的过程。主要模块包括基矩阵生成模块和优化模块。
关键创新:最重要的技术创新点在于通过随机基的线性组合来重新定义低秩矩阵,从而使得可训练参数的数量不再依赖于模型架构和选择的秩,这与现有方法有本质区别。
关键设计:在参数设置上,选择合适的随机基矩阵数量和优化算法,损失函数设计上确保优化过程的有效性,网络结构上保持与原始模型的兼容性。具体细节在实验部分有详细说明。
🖼️ 关键图片
📊 实验亮点
实验结果显示,NOLA在LLaMA-2 70B模型上实现了近20倍的参数压缩,相较于LoRA的最佳压缩效果,且在准确性上没有显著下降。这一结果表明NOLA在模型压缩方面的显著优势。
🎯 应用场景
该研究的潜在应用领域包括自然语言处理和计算机视觉等多个下游任务。通过显著减少模型参数,NOLA能够在资源受限的环境中实现高效的模型部署,提升实际应用的灵活性和可扩展性,未来可能推动更多领域的研究与应用。
📄 摘要(原文)
Fine-tuning Large Language Models (LLMs) and storing them for each downstream task or domain is impractical because of the massive model size (e.g., 350GB in GPT-3). Current literature, such as LoRA, showcases the potential of low-rank modifications to the original weights of an LLM, enabling efficient adaptation and storage for task-specific models. These methods can reduce the number of parameters needed to fine-tune an LLM by several orders of magnitude. Yet, these methods face two primary limitations: (1) the parameter count is lower-bounded by the rank one decomposition, and (2) the extent of reduction is heavily influenced by both the model architecture and the chosen rank. We introduce NOLA, which overcomes the rank one lower bound present in LoRA. It achieves this by re-parameterizing the low-rank matrices in LoRA using linear combinations of randomly generated matrices (basis) and optimizing the linear mixture coefficients only. This approach allows us to decouple the number of trainable parameters from both the choice of rank and the network architecture. We present adaptation results using GPT-2, LLaMA-2, and ViT in natural language and computer vision tasks. NOLA performs as well as LoRA models with much fewer number of parameters compared to LoRA with rank one, the best compression LoRA can archive. Particularly, on LLaMA-2 70B, our method is almost 20 times more compact than the most compressed LoRA without degradation in accuracy. Our code is available here: https://github.com/UCDvision/NOLA