[论文解读] The Expressive Power of Low-Rank Adaptation
本文提供了对低秩适配(LoRA)的首次理论分析,证明对于全连接网络,当适配器秩达到基于模型深度和宽度的阈值时,LoRA 可以精确匹配任意目标模型。对于 Transformer 模型,秩为 $\text{embedding size}/2$ 的适配器足以实现精确适配,且近似误差随秩增加而减小,实验结果验证了该结论。
Low-Rank Adaptation (LoRA), a parameter-efficient fine-tuning method that leverages low-rank adaptation of weight matrices, has emerged as a prevalent technique for fine-tuning pre-trained models such as large language models and diffusion models. Despite its huge success in practice, the theoretical underpinnings of LoRA have largely remained unexplored. This paper takes the first step to bridge this gap by theoretically analyzing the expressive power of LoRA. We prove that, for fully connected neural networks, LoRA can adapt any model $f$ to accurately represent any smaller target model $\overline{f}$ if LoRA-rank $\geq( ext{width of }f) imes \frac{ ext{depth of }\overline{f}}{ ext{depth of }f}$. We also quantify the approximation error when LoRA-rank is lower than the threshold. For Transformer networks, we show any model can be adapted to a target model of the same size with rank-$(\frac{ ext{embedding size}}{2})$ LoRA adapters.
研究动机与目标
- 为了从理论上理解低秩适配(LoRA)在参数高效微调中的表达能力。
- 为了确定在微调冻结的预训练模型时,精确表示目标模型所需的 LoRA 最小秩。
- 为了量化当 LoRA 秩低于精确适配阈值时的近似误差。
- 为了将理论洞见扩展至 Transformer 架构,特别是注意力机制。
- 为了通过数值实验验证理论发现,包括近似误差与秩缩放的关系。
提出的方法
- 通过低秩更新 $\Delta \mathbf{W}_l = \mathbf{A}_l \mathbf{B}_l$ 分析权重矩阵适配,其中 $\text{rank}(\mathbf{A}_l \mathbf{B}_l) \leq R$。
- 建立约束优化问题,以最小化适配模型与目标模型之间的 Frobenius 范数误差。
- 使用扩展的目标矩阵 $\widetilde{\mathbf{W}}$ 以隔离用于近似的相关子网络。
- 应用矩阵秩分解与低秩逼近理论,推导出必要的秩条件。
- 利用引理 1 推导出精确恢复条件,表明在弱假设下 $R \geq \lfloor \frac{D_{\text{target}}}{L} \rfloor$ 可实现精确适配。
- 通过数值实验验证理论阈值行为,显示当秩超过临界值时,近似误差急剧下降。
实验结果
研究问题
- RQ1在全连接网络中,精确适配冻结模型以匹配目标模型所需的最小 LoRA 秩是多少?
- RQ2当 LoRA 秩低于精确适配的阈值时,近似误差如何随秩变化?
- RQ3LoRA 能否精确表示任意目标 Transformer 模型?此类适配所需的秩是多少?
- RQ4模型深度与宽度如何影响实现精确或近似精确适配所需的最小 LoRA 秩?
- RQ5在表达能力方面,LoRA 与最终层微调相比表现如何?
主要发现
- 对于全连接网络,在弱假设下,若适配器秩满足 $R \geq \text{width}(f) \times \frac{\text{depth}({\hat{f}})}{\text{depth}(f)}$,LoRA 可精确表示任意目标模型。
- 当 LoRA 秩低于该阈值时,本文推导出显式的近似误差边界,表明误差随秩增加而减小。
- 对于 Transformer 模型,秩为 $\frac{\text{embedding size}}{2}$ 的 LoRA 适配器足以精确匹配任意同尺寸的目标模型。
- 数值实验表明,随着秩的增加,近似误差减小,一旦超过临界秩阈值,误差趋近于零。
- 理论框架允许与最终层微调进行比较,结果表明 LoRA 在模型适配方面具有更优的表达能力。
- 研究结果在全连接网络与 Transformer 架构中均得到验证,证明了理论边界的普适性。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。