Transformer架构已在诸多领域取得显著成果。尽管针对Softmax注意力的高效替代方案已被广泛研究,但探寻具备理论依据、表达能力更强的注意力机制(即便计算成本更高)的相关探索仍相对不足。本研究填补了这一空白,提出局部线性注意力(Local Linear Attention,LLA)——一种从非参数统计出发、以测试时回归视角推导的新型注意力机制。首先,我们通过偏差-方差权衡分析证明,在联想记忆任务上,LLA相比线性注意力与Softmax注意力具备理论优势。其次,我们针对其计算难题提出两种内存高效的基元操作,解决了Θ(n²d)与Θ(nd²)的复杂度问题。随后我们推出FlashLLA,这是一种硬件友好的分块算法,可在现代加速器上实现可扩展的并行计算。此外我们实现并实测了定制化推理内核,大幅降低了内存开销。最后我们在测试时回归、上下文内回归、联想回忆与状态追踪任务上,通过实验验证了LLA的优势与局限。实验结果表明,LLA能有效适配非平稳性,在测试时训练与上下文学习任务中表现优于强基线模型,同时展现出在大模型中具备可扩展性与应用潜力的积极证据。代码可在https://github.com/Yifei-Zuo/Flash-LLA获取。
英文摘要:
Transformer architectures have achieved remarkable success in various domains. While efficient alternatives to Softmax Attention have been widely studied, the search for more expressive mechanisms grounded in theoretical insight-even at greater computational cost-has been relatively underexplored. In this work, we bridge this gap by proposing Local Linear Attention (LLA), a novel attention mechanism derived from nonparametric statistics through the lens of test-time regression. First, we show that LLA offers theoretical advantages over Linear and Softmax Attention for associative memory via a bias-variance trade-off analysis. Next, we address its computational challenges and propose two memory-efficient primitives to tackle the $Θ(n^2 d)$ and $Θ(n d^2)$ complexity. We then introduce FlashLLA, a hardware-efficient, blockwise algorithm that enables scalable and parallel computation on modern accelerators. In addition, we implement and profile a customized inference kernel that significantly reduces memory overheads. Finally, we empirically validate the advantages and limitations of LLA on test-time regression, in-context regression, associative recall and state tracking tasks. Experiment results demonstrate that LLA effectively adapts to non-stationarity, outperforming strong baselines in test-time training and in-context learning, and exhibiting promising evidence for its scalability and applicability in large-scale models. Code is available at https://github.com/Yifei-Zuo/Flash-LLA.
Statistical Advantage of Softmax Attention: Insights from Single-Location Regression
Institute of Mathematics, EPFL(EPFL数学研究所);Statistical Physics of Computation Laboratory, École Polytechnique Fédérale de Lausanne(计算统计物理实验室,瑞士联邦理工学院);Inria, École Normale Supérieure, PSL Research University(Inria,巴黎高等师范学院,PSL研究大学);Laboratoire de Mathématiques d’Orsay, Université Paris Saclay and Institut Universitaire de France(奥赛数学实验室,巴黎萨克雷大学及法国国家科学院);Departement d’Informatique, École Normale Supérieure, PSL & CNRS(信息科学系,巴黎高等师范学院,PSL与CNRS)
A General Theory for Softmax Gating Multinomial Logistic Mixture of Experts
The University of Texas at Austin(德克萨斯大学奥斯汀分校);Univ. Grenoble Alpes(格勒诺布尔大学);Inria(法国国家信息与自动化研究所);CNRS(法国国家科学研究中心);Grenoble INP(格勒诺布尔理工学院);LJK(约瑟夫·傅里叶实验室);The University of Queensland(昆士兰大学)
Instituto Superior Técnico & Instituto de Telecomunicações, Universidade de Lisboa, Portugal(里斯本大学理工学院及电信研究所,葡萄牙);Champalimaud Research, Lisbon, Portugal(Champalimaud研究,葡萄牙里斯本);TransPerfect, Lisbon, Portugal(TransPerfect,葡萄牙里斯本);Carnegie Mellon University, Pittsburgh, USA(卡内基梅隆大学,美国匹兹堡)
In-Context Algorithm Emulation in Fixed-Weight Transformers
Center for Foundation Models and Generative AI, Northwestern University(西北大学基础模型与生成式人工智能中心);Department of Computer Science, Northwestern University(西北大学计算机科学系);Ensemble AI;Engineering Science, University of Toronto(多伦多大学工程科学系);Department of Statistics and Data Science, Northwestern University(西北大学统计与数据科学系)
Fast Model Selection and Stable Optimization for Softmax-Gated Multinomial-Logistic Mixture of Experts Models
School of Computing, National University of Singapore, Singapore.(新加坡国立大学计算机学院);ARC Centre of Excellence for the Mathematical Analysis of Cellular Systems(细胞系统数学分析卓越研究中心);School of Mathematical Sciences, Queensland University of Technology, Brisbane, Australia.(昆士兰科技大学数学科学学院);Department of Statistics and Data Science, University of Texas at Austin, Austin, USA(德克萨斯大学奥斯汀分校统计与数据科学系)
Chair for Dynamics, Control, Machine Learning, and Numerics (Alexander von Humboldt Professorship)(动力学、控制、机器学习和数值学教授席位(亚历山大·冯·洪堡教授职位));Friedrich–Alexander–Universität Erlangen–Nürnberg(弗里德里希-亚历山大-埃尔兰根-纽伦堡大学);Departamento de Matemáticas(数学系);Universidad Autónoma de Madrid(马德里自治大学);Chair of Computational Mathematics(计算数学教授席位);Fundación Deusto(德乌斯基金会)
Center for Foundation Models and Generative AI, Northwestern University(基础模型与生成式人工智能中心,西北大学);Department of Computer Science, Northwestern University(计算机科学系,西北大学);Department of Statistics and Data Science, Northwestern University(统计与数据科学系,西北大学)
High-Dimensional Gaussian Process Regression with Soft Kernel Interpolation
Department of Computing and Mathematical Sciences, California Institute of Technology(计算与数学科学部,加州理工学院);Department of Computer Science, San Francisco State University(计算机科学部,旧金山州立大学);Base26, CA, USA
Optimistic Rates: A Unifying Theory for Interpolation Learning and Regularization in Linear Regression
University of Chicago(芝加哥大学);Simons Institute, University of California at Berkeley(加州大学伯克利分校西蒙斯研究所);University of British Columbia(不列颠哥伦比亚大学);Alberta Machine Intelligence Institute(阿尔伯塔机器智能研究所);Toyota Technological Institute at Chicago(芝加哥丰田技术研究所)
我们研究了高斯数据线性回归的一致收敛的局部概念,称为“乐观率”(Panchenko 2002; Srebro et al. 2010)。我们的精细分析避免了现有结果中的隐藏常数和对数因子,这些因子在高维环境中至关重要,特别是对于理解插值学习。作为一种特殊情况,我们的分析恢复了Koehler et al.(2021)的保证,该保证严格描述了良性过拟合条件下低范数插值器的总体风险。然而,我们的乐观率界也分析了具有任意训练误差的预测器。这使我们能够恢复一些经典的随机设计下的岭和LASSO回归的统计保证,并帮助我们获得一个精确的理解过度参数化制度的过度风险的近插值。