arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2602.18851cs.LGcs.AI
收藏

面向稳定低精度训练的注意力logits的秩感知谱界

Rank-Aware Spectral Bounds on Attention Logits for Stable Low-Precision Training

UNC-Chapel Hill, Kenan-Flagler Business School, Chapel Hill, NC, USA(北卡罗来纳大学教堂山分校,肯纳-弗拉格勒商学院)

Seyed Morteza Emadi

AI总结:

本文提出一种基于秩感知谱界的注意力logits缩放方法,通过隐式幂迭代计算每层缩放因子,有效控制低精度训练中的溢出风险,同时保持模型性能。

摘要:

transformer中的注意力分数是双线性形式$S_{ij} = x_i^\top M x_j / \sqrt{d_h}$,其最大幅值决定了低精度训练中的溢出风险。我们推导了一个秩感知的集中不等式:当交互矩阵$M = W^Q W^{K\top}$的秩为$r \ll d$时,$\max_{i,j}|S_{ij}|$的尾部概率衰减速度为$\exp(-d^{2}α^{2}/(γr))$而不是$\exp(-dα^{2})$,其中$γ> 1$是一个典型性参数。对于transformer注意力,当$r = d_h$时,这会产生比现代架构中无秩约束的界更紧$8$--$28\times$的集中性。我们将这一结果应用于FP8训练,推导出具有几何意识的缩放因子,以提供有原则的溢出保证而无需观察激活。该方法通过隐式幂迭代计算每层的缩放因子,利用谱范数$\|W^Q W^{K\top}\|_2$,引入了分组查询注意力公式以避免键扩展,并保持与融合注意力内核的兼容性。在GPT-2 XL到Llama-2-70B之间,具有几何意识的缩放消除了在延迟缩放失败的瞬态场景中的溢出,同时实现了可比的下游MMLU准确性。

英文摘要:

Attention scores in transformers are bilinear forms $S_{ij} = x_i^\top M x_j / \sqrt{d_h}$ whose maximum magnitude governs overflow risk in low-precision training. We derive a rank-aware concentration inequality: when the interaction matrix $M = W^Q W^{K\top}$ has rank $r \ll d$, tail probabilities for $\max_{i,j}|S_{ij}|$ decay as $\exp(-d^{2}α^{2}/(γr))$ rather than $\exp(-dα^{2})$, where $γ> 1$. For transformer attention where $r = d_h$, this yields $8$ to $28\times$ tighter concentration than rank-agnostic bounds in modern architectures. We apply this result to FP8 training, deriving geometry-aware scale factors that provide principled overflow guarantees without observing activations. The method computes per-layer scales from the spectral norm $\|W^Q W^{K\top}\|_2$ via implicit power iteration, includes a grouped query attention formulation that avoids key expansion, and remains compatible with fused attention kernels. Across GPT-2 XL to Llama-2-70B, geometry-aware scaling eliminates overflows in transient scenarios where delayed scaling fails, while achieving comparable downstream MMLU accuracy.

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

↑