arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.09692cs.LGcs.AI
收藏

ALLoRA:自适应学习率缓解 LoRA 的致命缺陷

ALLoRA: Adaptive Learning Rate Mitigates LoRA Fatal Flaws

Google(谷歌公司);Brown University(布朗大学)

Hai Huang, Randall Balestriero

AI总结:

本文指出了LoRA在短训练周期中因Dropout、零初始化和缩放因子导致的三大局限,提出无Dropout、无缩放因子的自适应学习率方法ALLoRA,通过梯度缩放缓解缺陷并减少超参数,在多种LLM上取得更优准确率。

摘要:

低秩微调(LoRA)是大语言模型(LLM)微调的中流砥柱。LoRA 学习预训练矩阵参数 $W$ 的加性低秩扰动 $AB$,通过 $W+AB$ 使模型适应新任务或数据集。我们指出了 LoRA 在微调(即使用有限数据量和训练步数的设置)中的三个核心局限。首先,LoRA 使用 Dropout 防止过拟合。我们证明 Dropout 仅适用于长训练周期,但在短训练周期中无法收敛到可靠的正则化器。其次,LoRA 将 $B$ 初始化为 $0$,在 $A$ 和 $B$ 之间产生了缓慢的训练动态。该动态还会被 Dropout 加剧,进一步减缓 $B$ 逃离 $0$ 的速度,这对短训练周期尤为有害。第三,乘以每个 LoRA 加性扰动的缩放因子在不同层的 LoRA 模块间造成了“短视”的交互。基于对这些局限的原则性分析,我们找到了一种优雅的解决方案:无 Dropout、无缩放因子、具有自适应学习率的 LoRA——命名为 ALLoRA。通过以与参数的 $\ell_2$ 范数成反比的系数对每个样本和每个参数的梯度进行缩放,ALLoRA 缓解了这三个局限。作为副产品,ALLoRA 从 LoRA 中移除了两个超参数:缩放因子和 dropout 率。实证结果表明,ALLoRA 在各种设置下均比 LoRA 具有更好的准确率,包括对比最近的 LoRA 变体,如权重分解低秩微调(DoRA)。消融研究表明,我们的解决方案在包括最新 Llama3 在内的各种 LLM 上,在一系列依赖权重/依赖输出的方法中是最优的。

英文摘要:

Low-Rank Adaptation (LoRA) is the bread and butter of Large Language Model (LLM) finetuning. LoRA learns an additive low-rank perturbation, $AB$, of a pretrained matrix parameter $W$ to align the model to a new task or dataset with $W+AB$. We identify three core limitations to LoRA for finetuning--a setting that employs limited amount of data and training steps. First, LoRA employs Dropout to prevent overfitting. We prove that Dropout is only suitable for long training episodes but fails to converge to a reliable regularizer for short training episodes. Second, LoRA's initialization of $B$ at $0$ creates a slow training dynamic between $A$ and $B$. That dynamic is also exacerbated by Dropout that further slows the escape from $0$ for $B$ which is particularly harmful for short training episodes. Third, the scaling factor multiplying each LoRA additive perturbation creates ``short-sighted'' interactions between the LoRA modules of different layers. Motivated by principled analysis of those limitations, we find an elegant solution: a Dropout-free, scaling-free, LoRA with Adaptive Learning rate--coined ALLoRA. By scaling the per sample and per parameter gradients with a coefficient inversely proportional to parameters' $\ell_2$ norm, ALLoRA alleviates those three limitations. As a by-product, ALLoRA removes two hyper-parameters from LoRA: the scaling factor and the dropout rate. Empirical results show that ALLoRA admits better accuracy than LoRA on various settings, including against recent LoRA variants such as Weight-Decomposed Low-Rank Adaptation (DoRA). Ablation studies show our solution is the optimal in a family of weight-dependent / output-dependent approaches on various LLMs including the latest Llama3.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑