Skip to main content
QUICK REVIEW

[论文解读] LoRA ensembles for large language model fine-tuning

Xi Wang, Laurence Aitchison|arXiv (Cornell University)|Sep 29, 2023
Topic Modeling被引用 5
一句话总结

本文提出LoRA集成方法,一种参数高效的微调技术,通过使用不同随机初始化的多个低秩适配器(LoRA)来提升大语言模型(LLM)微调后的不确定性校准与预测准确性。尽管完整LLM集成存在高昂的显存开销,LoRA集成通过利用LoRA的低存储与推理开销,同时保持模型多样性,在校准与准确性方面均取得显著提升,尤其在正则化条件下表现更优。

ABSTRACT

Finetuned LLMs often exhibit poor uncertainty quantification, manifesting as overconfidence, poor calibration, and unreliable prediction results on test data or out-of-distribution samples. One approach commonly used in vision for alleviating this issue is a deep ensemble, which constructs an ensemble by training the same model multiple times using different random initializations. However, there is a huge challenge to ensembling LLMs: the most effective LLMs are very, very large. Keeping a single LLM in memory is already challenging enough: keeping an ensemble of e.g. 5 LLMs in memory is impossible in many settings. To address these issues, we propose an ensemble approach using Low-Rank Adapters (LoRA), a parameter-efficient fine-tuning technique. Critically, these low-rank adapters represent a very small number of parameters, orders of magnitude less than the underlying pre-trained model. Thus, it is possible to construct large ensembles of LoRA adapters with almost the same computational overhead as using the original model. We find that LoRA ensembles, applied on its own or on top of pre-existing regularization techniques, gives consistent improvements in predictive accuracy and uncertainty quantification.

研究动机与目标

  • 为解决微调后大语言模型中不确定性量化不佳的问题,如对分布外数据的过度自信以及校准性能差。
  • 克服为大语言模型训练完整模型集成所导致的高昂显存与计算成本。
  • 通过仅使用参数量远少于基础模型的低秩适配器(LoRA),实现可扩展、高效的LLM集成。
  • 探究LoRA集成与正则化技术的兼容性,以进一步提升泛化能力与校准性能。
  • 通过实证验证,随机初始化与数据集洗牌对集成多样性与性能具有实质性贡献。

提出的方法

  • 在相同的预训练LLM上,使用不同的随机初始化训练多个LoRA适配器,微调数据保持一致。
  • 所有LoRA适配器均以完整的预训练LLM权重作为基础,确保初始化一致性,同时通过随机初始化适配器权重保持多样性。
  • 在推理阶段,通过平均logits或概率的方式,将所有LoRA适配器的预测结果集成,形成最终的集成预测。
  • 在LoRA训练过程中应用正则化技术(如权重衰减、KL正则化、早停法),以提升泛化能力并减少过拟合。
  • 使用随机梯度下降并配合数据集洗牌,引入额外的随机性(SGD噪声),增强集成组件之间的多样性。
  • 通过在分布内与分布外(OOD)测试集上评估准确率、期望校准误差(ECE)与AUROC等指标,衡量集成性能。
(a)
(a)

实验结果

研究问题

  • RQ1与单个LoRA微调相比,LoRA集成是否能显著提升微调后LLM的准确率与校准性能?
  • RQ2将LoRA集成与正则化技术结合,是否能进一步提升模型的校准性能与泛化能力?
  • RQ3不同随机源——随机初始化与数据集洗牌带来的SGD噪声——如何分别影响集成的多样性与性能?
  • RQ4增加集成组件数量(M)对模型性能有何影响?性能提升是否随M增大而出现边际递减?
  • RQ5在准确率与校准性能方面,LoRA集成相较于蒙特卡洛Dropout或最后一层微调等替代不确定性估计方法表现如何?

主要发现

  • LoRA集成在六个常识推理数据集上均一致地提升了准确率与校准性能,显著降低了期望校准误差(ECE)。
  • 五组件LoRA集成在准确率与ECE方面均优于单个LoRA模型以及蒙特卡洛Dropout、最后一层微调等替代方法。
  • 即使结合正则化,LoRA集成依然有效:权重衰减表现最为稳健,而强KL正则化或早停法可能因抑制多样性而削弱集成优势。
  • 增加集成组件数量(M)可提升性能,但随着M增大,边际收益逐渐减少,表明在某一临界点后收益递减。
  • 随机初始化与数据集洗牌均有助于提升集成多样性,其中SGD噪声(来自洗牌)的影响强于初始化本身,且两者协同作用才能实现最优性能。
(b)
(b)

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。