揭示LoRA在Transformer注意力中所需秩的理论极限,指导高效参数微调。
How Much Rank Does LoRA Need? Rank-Error Bounds for Transformer Attention
- 基于目标注意力分布推导秩-误差上下界,定量分析不同秩下的近似精度。
- 发现当注意力概率远离零时,误差下界与得分差的平方或线性相关。
- 证明软最大饱和效应可降低所需秩,适用于关注高效微调的研究者。
选择低秩适应(LoRA)更新的秩通常依赖经验。本文为Transformer注意力提供了任务相关的逼近误差理论:固定预训练注意力头、目标注意力函数及下游任务输入分布,给出秩-$r$查询LoRA更新可达到的最小期望KL误差的边界。当目标注意力概率远离零时,误差下界与$ψ("|d\
原文摘要 · Abstract (English)
Choosing the rank of a low-rank adaptation (LoRA) update is usually an empirical task. In this paper, we provide a task-dependent theory of the approximation error achievable at each LoRA rank for Transformer attention. We fix a pretrained attention head, a target attention function, and a distribution over inputs from the downstream task, and bound the smallest expected Kullback--Leibler (KL) error achievable by a rank-$r$ query LoRA update. When target attention probabilities are bounded away from zero, we prove a lower bound of the error proportional to $ψ(\|d\|_2)$, where $d$ is the difference between candidate and target attention scores and $ψ(t)=\min\{t^2,t\}$. We also prove an unconditional upper bound $\min\{\|d\|_2^2/4,\sqrt2\|d\|_2\}$. Under explicit realizability, geometry, and moment conditions, we then bound the best rank-$r$ error between an explicit multiple of $ψ(\sqrt{T_r})$ and $\min\{T_r/4,\sqrt{2T_r}\}$, where $T_r$ is the downstream-weighted tail energy of the target update. We also provide target-Fisher bounds when candidate scores remain within a fixed range of the target scores, and an unrestricted lower bound when a subset of tokens carries most of the probability mass. These spectral bounds describe finite-score approximation. We then construct explicit families in which softmax saturation makes the rank required to match the attention function strictly smaller than the rank required to match the finite logits. Finally, we extend the analysis to fused multi-head LoRA and joint query/key updates, exposing the effects of rank sharing and query/key factorization constraints.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。