arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.08447cs.LGcs.AIcs.CLstat.ML
收藏

初始化对 LoRA 微调动态的影响

The Impact of Initialization on LoRA Finetuning Dynamics

Simons Institute(西蒙斯研究所);UC Berkeley(加州大学伯克利分校);Dept of Statistics(统计系)

Soufiane Hayou, Nikhil Ghosh, Bin Yu

AI总结:

本文分析 LoRA 两种零乘积初始化方案,证明 B 零初始化、A 随机初始化因支持更大稳定学习率而平均性能更优,并通过 LLM 实验验证。

摘要:

本文研究了 Hu 等人(2021)最初提出的低秩适配(Low Rank Adaptation,LoRA)中初始化的作用。本质上,为了从预训练模型开始作为微调的初始化,人们可以将 B 初始化为零、将 A 初始化为随机值(PEFT 软件包中的默认初始化),也可以反过来。在这两种情况下,乘积 BA 在初始化时都等于零,这使得微调从预训练模型开始。这两种初始化方案看似相似,原则上应产生相同的性能,并共享相同的最优学习率。我们证明这是一种错误的直觉:第一种方案(将 B 初始化为零、将 A 初始化为随机值)平均而言比另一种方案产生更好的性能。我们的理论分析表明,其背后原因可能是,与第二种初始化相比,第一种初始化允许使用更大的学习率(且不会导致输出不稳定),从而使第一种方案的学习更高效。我们通过在 LLM 上的大量实验验证了这些结果。

英文摘要:

In this paper, we study the role of initialization in Low Rank Adaptation (LoRA) as originally introduced in Hu et al. (2021). Essentially, to start from the pretrained model as initialization for finetuning, one can either initialize B to zero and A to random (default initialization in PEFT package), or vice-versa. In both cases, the product BA is equal to zero at initialization, which makes finetuning starts from the pretrained model. These two initialization schemes are seemingly similar. They should in-principle yield the same performance and share the same optimal learning rate. We demonstrate that this is an incorrect intuition and that the first scheme (initializing B to zero and A to random) on average yields better performance compared to the other scheme. Our theoretical analysis shows that the reason behind this might be that the first initialization allows the use of larger learning rates (without causing output instability) compared to the second initialization, resulting in more efficient learning of the first scheme. We validate our results with extensive experiments on LLMs.

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

↑