arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2603.04127cs.LGcs.AI
收藏

面向数据的随机特征核用于变换器

Data-Aware Random Feature Kernel for Transformers

Google DeepMind(谷歌DeepMind)

Amirhossein Farzam, Hossein Mobahi, Nolan Andrew Miller, Luke Sernau

AI总结:

DARKFormer通过数据对齐的随机特征核提升变换器的注意力效率和稳定性,尤其在资源受限场景中表现优异。

摘要:

变换器在多个领域表现出色,但其二次注意力复杂度成为扩展的障碍。随机特征注意力,如Performers中所采用的,可以通过用正随机特征近似softmax核,将成本降低到序列长度的线性。然而在预训练模型中,查询和键通常是各向异性的。这会导致在各向同性采样方案中产生高蒙特卡洛方差,除非重新训练模型或使用大特征预算。重要采样可以通过适应采样分布到输入几何来解决,但复杂的数据依赖的提案分布往往难以处理。我们显示,通过数据对齐softmax核,我们获得一种注意力机制,它既能接受可处理的最小方差提案分布用于重要采样,又能表现出更好的训练稳定性。受这一发现的启发,我们引入DARKFormer,一种面向数据的随机特征核变换器,其特征是数据对齐的核几何。DARKFormer学习随机投影协方差,高效实现其数据对齐核的重要性采样正随机特征估计器。实证表明,DARKFormer在精确softmax注意力的性能差距上有所缩小,尤其是在微调领域,其中预训练表示是各向异性的。通过结合随机特征效率与数据感知核,DARKFormer在资源受限的环境下推进了基于核的注意力。

英文摘要:

Transformers excel across domains, yet their quadratic attention complexity poses a barrier to scaling. Random-feature attention, as in Performers, can reduce this cost to linear in the sequence length by approximating the softmax kernel with positive random features drawn from an isotropic distribution. In pretrained models, however, queries and keys are typically anisotropic. This induces high Monte Carlo variance in isotropic sampling schemes unless one retrains the model or uses a large feature budget. Importance sampling can address this by adapting the sampling distribution to the input geometry, but complex data-dependent proposal distributions are often intractable. We show that by data aligning the softmax kernel, we obtain an attention mechanism which can both admit a tractable minimal-variance proposal distribution for importance sampling, and exhibits better training stability. Motivated by this finding, we introduce DARKFormer, a Data-Aware Random-feature Kernel transformer that features a data-aligned kernel geometry. DARKFormer learns the random-projection covariance, efficiently realizing an importance-sampled positive random-feature estimator for its data-aligned kernel. Empirically, DARKFormer narrows the performance gap with exact softmax attention, particularly in finetuning regimes where pretrained representations are anisotropic. By combining random-feature efficiency with data-aware kernels, DARKFormer advances kernel-based attention in resource-constrained settings.

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

↑