你需要更好的注意力先验 You Need Better Attention Priors 预印本

⚠️ 本文为 预印本(arXiv 公开版本),尚未经过正式同行评审。作者自发公开,结论未经期刊审稿验证,阅读时请知悉。
发布时间:2026-01-21
👁️ 预览文献
💡 AI 中文简介
这篇论文从熵最优传输的角度重新审视注意力机制,发现标准注意力隐含地假设了一个均匀先验。作者提出GOAT(带可训练先验的广义最优传输注意力),用可学习的连续先验替代这个简单假设,同时保持与FlashAttention等高效内核的兼容。GOAT还能解释并解决注意力汇聚问题,并将空间信息融入注意力计算,学到可外推的位置先验,兼顾灵活性和长度泛化能力。
领域深度学习 / 自然语言处理
适合谁读需要一定专业背景(熟悉Transformer和注意力机制)
核心贡献1. 从熵最优传输视角统一解释注意力机制,揭示标准注意力隐含均匀先验的局限性;2. 提出GOAT,用可学习连续先验替代均匀先验,兼容FlashAttention,并解决注意力汇聚问题,同时实现可外推的位置先验。
关键数据暂无显著硬数据
推荐理由如果你对Transformer的注意力机制感兴趣,这篇论文提供了一个全新的理论视角和实用的改进方案,值得一读。
关键词["注意力机制", "最优传输", "可学习先验", "位置编码", "长度泛化", "注意力汇聚"]

原文摘要

查看英文原文摘要

We generalize the attention mechanism by viewing it through the lens of Entropic Optimal Transport, revealing that standard attention corresponds to a transport problem regularized by an implicit uniform prior. We introduce Generalized Optimal transport Attention with Trainable priors (GOAT), a new attention mechanism that replaces this naive assumption with a learnable, continuous prior. This prior maintains full compatibility with optimized kernels such as FlashAttention. GOAT also provides an EOT-based explanation of attention sinks and materializes a solution for them, avoiding the representational trade-offs of standard attention. Finally, by absorbing spatial information into the core attention computation, GOAT learns an extrapolatable prior that combines the flexibility of learned positional embeddings with the length generalization of fixed encodings.