挑战自注意力=核主成分分析的说法,实证发现二者无实质关联。
A Reproduction Study: The Kernel PCA Interpretation of Self-Attention Fails Under Scrutiny
- 通过对比值向量与核主成分的相似性,验证其不匹配
- 发现原论文中重建误差下降被错误解释,量级差达千倍
- 关键实验结果无法复现,依赖未公开的特殊设置
本复现研究重新审视近期关于自注意力实现核主成分分析(KPCA)的主张,即(i)值向量 $V$ 捕获键矩阵格拉姆矩阵的特征向量,(ii)自注意力将查询投影到键矩阵主成分轴上。分析揭示三项关键矛盾:(1)学习到的自注意力值向量与KPCA视角下的预期无对齐,平均相似性指标(最优余弦相似度 ≤0.32,线性中心核对齐≤0.11,核中心核对齐≤0.32)表明对应关系微弱;(2)所谓支持该观点的重建损失 $J_\text{proj}$ 下降,实为量级相差约 $10^3$ 的不同量,存在误读;(3)用于支撑 $V$ 是格拉姆矩阵特征向量的特征值统计结果,需依赖未公开的实现特异性调整方可复现。在10种Transformer架构上,均无法支持自注意力的KPCA解释。
原文摘要 · Abstract (English)
In this reproduction study, we revisit recent claims that self-attention implements kernel principal component analysis (KPCA) (Teo et al., 2024), positing that (i) value vectors $V$ capture the eigenvectors of the Gram matrix of the keys, and (ii) that self-attention projects queries onto the principal component axes of the key matrix $K$ in a feature space. Our analysis reveals three critical inconsistencies: (1) No alignment exists between learned self-attention value vectors and what is proposed in the KPCA perspective, with average similarity metrics (optimal cosine similarity $\leq 0.32$, linear CKA (Centered Kernel Alignment) $\leq 0.11$, kernel CKA $\leq 0.32$) indicating negligible correspondence; (2) Reported decreases in reconstruction loss $J_\text{proj}$, arguably justifying the claim that the self-attention minimizes the projection error of KPCA, are misinterpreted, as the quantities involved differ by orders of magnitude ($\sim\!10^3$); (3) Gram matrix eigenvalue statistics, introduced to justify that $V$ captures the eigenvector of the gram matrix, are irreproducible without undocumented implementation-specific adjustments. Across 10 transformer architectures, we conclude that the KPCA interpretation of self-attention lacks empirical support.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。