Skip to main content
QUICK REVIEW

[论文解读] LoRA-XS: Low-Rank Adaptation with Extremely Small Number of Parameters

Klaudia Bałazy, Mohammadreza Banaei|arXiv (Cornell University)|May 27, 2024
CCD and CMOS Imaging SensorsEngineering被引用 3
一句话总结

LoRA-XS 引入了一种高度参数高效的微调方法,通过使用 SVD 冻结 LoRA 投影矩阵,并在它们之间仅训练一个 $ r \times r $ 的适配器矩阵,使 7B 模型的可训练参数减少超过 100 倍。该方法在参数效率方面优于 LoRA 和 VeRA,性能具有竞争力,对于百万规模个性化模型,存储需求降低了超过 1500 倍。

ABSTRACT

The growth of large language models underscores the need for parameter-efficient fine-tuning. Despite its popularity, LoRA encounters storage and computational challenges when deploying multiple task- or user-specific modules. To address this, we introduce LoRA-XS, a novel fine-tuning method backed by a theoretical derivation. LoRA-XS drastically reduces trainable parameters by incorporating a small, trainable weight matrix between frozen low-rank matrices derived from the Singular Value Decomposition of pre-trained weights. This design enables LoRA-XS to reduce storage requirements by over 100x in 7B models compared to LoRA. Additionally, unlike other methods, LoRA-XS imposes no lower bound on trainable parameters - it can scale from a single parameter per module to arbitrarily large values, adapting to any storage or computational constraint. Evaluations on GLUE, GSM8K, MATH, and commonsense reasoning benchmarks across different model scales reveal that LoRA-XS consistently outperforms or matches LoRA and VeRA in accuracy, offering unmatched parameter efficiency. Our ablation studies highlight the significance of singular vectors in transformer weights, establishing LoRA-XS as a powerful, storage-efficient solution for scaling and personalizing large language models.

研究动机与目标

  • 解决在大规模语言模型上部署大量特定任务或个性化 LoRA 适配器所带来的日益增长的存储与计算负担。
  • 克服现有 PEFT 方法(如 LoRA 和 VeRA)对模型隐藏维度的依赖,从而提升在更大模型中的可扩展性。
  • 在不牺牲性能的前提下实现极端参数效率,从而支持灵活且低内存的个性化模型部署。
  • 通过避免架构修改或推理期间的额外延迟,保持推理效率。
  • 探索在超低参数环境下,不同初始化策略对收敛速度和最终性能的影响。

提出的方法

  • 使用奇异值分解(SVD)将预训练权重矩阵分解为固定且冻结的 LoRA 投影矩阵 $ A $ 和 $ B $,其初始化为原始权重的前主成分。
  • 在冻结的 $ A $ 和 $ B $ 矩阵之间引入一个小型可训练 $ r \times r $ 适配器矩阵 $ R $,用于执行低秩适配。
  • 仅训练 $ r \times r $ 的矩阵 $ R $,使可训练参数数量与模型大小和隐藏维度无关。
  • 在多个注意力层和前馈层(查询、键、值、输出、FFN)中应用 LoRA-XS 适配器,采用低秩 $ r $,实现参数的分布式分配。
  • 采用基于 SVD 的初始化方法对 $ A $ 和 $ B $ 进行初始化,使其与预训练权重的主要奇异分量对齐,从而提升收敛速度和性能。
  • 通过避免任何架构更改或额外模块,保持与标准 Transformer 推理的完整推理兼容性。
Figure 1: Average performance of RoBERTa-large over a selection of GLUE tasks as a function of the number of trainable parameters (in millions) for different adaptation methods: Full Fine-Tuning (FT), LoRA, VERA, and LoRA-XS. LoRA-XS points correspond to various ranks from r=4 up to r=25. LoRA-XS ou
Figure 1: Average performance of RoBERTa-large over a selection of GLUE tasks as a function of the number of trainable parameters (in millions) for different adaptation methods: Full Fine-Tuning (FT), LoRA, VERA, and LoRA-XS. LoRA-XS points correspond to various ranks from r=4 up to r=25. LoRA-XS ou

实验结果

研究问题

  • RQ1我们能否通过将可训练参数与模型隐藏维度解耦,在微调中实现极端参数效率?
  • RQ2基于 SVD 的 LoRA 矩阵初始化是否能提升低秩适配中的收敛速度和最终性能?
  • RQ3在多种基准测试中,LoRA-XS 与 LoRA 和 VeRA 相比,在参数效率和性能方面表现如何?
  • RQ4LoRA-XS 是否能够实现大规模模型的可扩展个性化,同时显著降低存储开销?
  • RQ5在多个低秩 $ r $ 的层上分布 LoRA-XS 模块,对整体性能和参数效率有何影响?

主要发现

  • 与标准 LoRA 相比,LoRA-XS 在 7B 模型中将可训练参数数量减少了超过 100 倍,实现了极端的参数效率。
  • 对于 GPT-3 模型(秩为 16),LoRA-XS 将 100 万个个性化模型的存储需求从 LoRA 的 144TB 降低至仅 96GB,实现了 1500 倍的减少。
  • 在 GLUE、GSM8k 和 MATH 基准测试中,LoRA-XS 在参数效率方面优于 LoRA 和 VeRA,以远少的参数实现了更高或相当的性能。
  • 与随机初始化相比,基于 SVD 的 LoRA 矩阵初始化能实现更快的收敛速度和更好的性能,尤其是在低秩情况下。
  • 在 7B 模型的指令微调任务中,LoRA-XS 保持了具有竞争力的性能,表明其在极少数可训练参数下仍具备强大的泛化能力。
  • 该方法通过低秩 $ r $ 和模块化跨层部署,实现了对可训练参数数量的精确控制,从而支持灵活的内存使用。
Figure 2: Visual comparison of LoRA and LoRA-XS techniques. The key distinction of LoRA-XS lies in its use of a small trainable matrix $R$ between frozen low-rank matrices $A$ and $B$ derived from truncated SVD (to $r$ top components) of pretrained weights.
Figure 2: Visual comparison of LoRA and LoRA-XS techniques. The key distinction of LoRA-XS lies in its use of a small trainable matrix $R$ between frozen low-rank matrices $A$ and $B$ derived from truncated SVD (to $r$ top components) of pretrained weights.

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。