arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.03136cs.LGcs.AIcs.CCstat.ML

Transformer模型低秩适配(LoRA)微调的计算极限

Computational Limits of Low-Rank Adaptation (LoRA) Fine-Tuning for Transformer Models

Northwestern University(西北大学);University of Science and Technology of China(中国科学技术大学);National Yang Ming Chiao Tung University(阳明交通大学);Simons Institute UC Berkeley(伯克利Simons研究所)

Jerry Yao-Chieh Hu, Maojiang Su, En-Jui Kuo, Zhao Song, Han Liu

AI总结:

本文从细粒度复杂性理论角度研究LoRA微调的计算极限,通过梯度低秩结构证明SETH下存在效率相变,并利用分层低秩近似证明几乎线性算法的存在性。

摘要:

我们利用细粒度复杂性理论研究基于Transformer的模型进行低秩适配(LoRA)微调的计算极限。我们的关键观察是,LoRA适配的梯度计算中存在低秩分解,这带来了可能的算法加速。这使我们能够(i)在强指数时间假设(SETH)下识别效率的相变行为,以及(ii)通过逐项控制LoRA更新计算项来证明几乎线性算法的存在性。对于前者,我们基于输入序列$X$、预训练权重${W^\star}$和适配器矩阵$αB A/r$相乘所产生的特定范数,识别出Transformer所有可能的秩-$r$ LoRA更新算法效率的急剧转变。具体而言,我们推导出这些范数的共享上界阈值,并证明LoRA的高效(次二次)近似算法仅在该阈值以下存在。对于后者,我们利用LoRA梯度的分层低秩结构,并通过一系列链式低秩近似来近似梯度,证明了LoRA适配的几乎线性近似算法的存在性。为了展示我们的理论,我们考虑两种实际场景:注意力头中权重的部分适配(例如,仅$W_V$和$W_Q$)和完全适配(例如,$W_Q$、$W_V$和$W_K$)。

英文摘要:

We study the computational limits of Low-Rank Adaptation (LoRA) for finetuning transformer-based models using fine-grained complexity theory. Our key observation is that the existence of low-rank decompositions within the gradient computation of LoRA adaptation leads to possible algorithmic speedup. This allows us to (i) identify a phase transition behavior of efficiency assuming the Strong Exponential Time Hypothesis (SETH), and (ii) prove the existence of almost linear algorithms by controlling the LoRA update computation term by term. For the former, we identify a sharp transition in the efficiency of all possible rank-$r$ LoRA update algorithms for transformers, based on specific norms resulting from the multiplications of the input sequence $X$, pretrained weights ${W^\star}$, and adapter matrices $αB A/r$. Specifically, we derive a shared upper bound threshold for such norms, and show that efficient (sub-quadratic) approximation algorithms of LoRA exist only below this threshold. For the latter, we prove the existence of almost linear approximation algorithms for LoRA adaptation by utilizing the hierarchical low-rank structures of LoRA gradients and approximating the gradients with a series of chained low-rank approximations. To showcase our theory, we consider two practical scenarios: partial (e.g., only $W_V$ and $W_Q$) and full adaptations (e.g., $W_Q$, $W_V$, and $W_K$) of weights in attention heads.

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

↑