arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2507.09394cs.LG
收藏

从随机矩阵理论视角看多头潜在注意力的学习动态

A Random Matrix Theory Perspective on the Learning Dynamics of Multi-head Latent Attention

New York University(纽约大学)

Nandan Kumar Jha, Brandon Reagen

AI总结:

本文利用Marchenko-Pastur诊断工具分析多头潜在注意力在预训练中的学习动态,发现共享旋转子向量的MLA-Decoupled变体能有效避免秩崩溃与谱碎片化,从而保留模型的表示容量。

摘要:

在这项工作中,我们研究了多头潜在注意力(MLA)——一种流行的压缩键/值内存的策略——如何在预训练期间影响transformer的内部容量。使用一套轻量级的Marchenko-Pastur(MP)诊断工具,我们在整个训练过程中分析了 $W_{Q}W_{K}^\ op$ gram矩阵的谱,比较了三种变体:标准的MHA基线、在压缩前应用旋转的MLA-PreRoPE,以及在所有头之间共享单个旋转子向量的MLA-Decoupled。我们的随机矩阵分析揭示了三个关键发现:i)容量瓶颈在局部出现:MHA和MLA-PreRoPE在特定层中表现出尖锐的早期尖峰,这些尖峰持续存在并传播,破坏了主体方向和异常值方向之间的平衡;ii)这些尖峰与秩崩溃同时发生,将模型的表达能力集中到狭窄的子空间中;iii)只有解耦变体阻止了这种级联,维持了广泛的谱支持并抑制了跨层的异常值形成。这些结果强调,如何应用旋转嵌入与压缩发生在何处同样关键。在头之间共享旋转组件减轻了谱碎片化并保留了表示能力。

英文摘要:

In this work, we study how multi-head latent attention (MLA), a popular strategy for compressing key/value memory, affects a transformer's internal capacity during pretraining. Using a lightweight suite of Marchenko-Pastur (MP) diagnostics, we analyze the spectrum of the $W_{Q}W_{K}^\top$ gram matrix throughout training, comparing three variants: the standard multi-head attention (MHA) baseline, MLA-PreRoPE with rotary applied before compression, and MLA-Decoupled, which shares a single rotary sub-vector across all heads. Our random matrix analysis reveals \textbf{three key findings:} \textbf{ i)} capacity bottlenecks emerge locally: both MHA and MLA-PreRoPE exhibit sharp, early spikes in specific layers that persist and propagate, disrupting the balance between bulk and outlier directions; \textbf{ ii)} these spikes coincide with rank collapse, concentrating the model's expressivity into narrow subspaces; \textbf{ iii)} only the decoupled variant prevents this cascade, maintaining broad spectral support and suppressing outlier formation across layers. These results underscore that \emph{how} rotary embeddings are applied is just as critical as \emph{where} compression occurs. Sharing rotary components across heads mitigates spectral fragmentation and preserves representational capacity.

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

↑