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

Transformer作为内在优化器:通过能量原理进行前向推断

Transformers as Intrinsic Optimizers: Forward Inference through the Energy Principle

Gaoling School of Artificial Intelligence, Renmin University of China(中国人民大学北京校区人工智能学院)

Ruifeng Ren, Sheng Ouyang, Huayi Tang, Yong Liu

AI总结:

本文提出基于能量原理的Transformer统一框架,通过不同优化算法诱导新型注意力结构,探索Transformer作为内在优化器的潜力。

摘要:

基于注意力的Transformer在广泛的任务中展示了强大的适应性,并已成为现代大语言模型(LLMs)的骨干。然而,其底层机制仍留有进一步探索的空间。基于能量的观点长期以来为理解神经计算提供了一个有价值的原理。在本文中,我们重新审视能量作为理解基于注意力的Transformer模型的视角。我们提出一个统一的能量框架,由三个关键组成部分组成:局部能量E_i、全局能量F以及所采用的优化算法。我们证明,不同的注意力形式,包括未归一化的线性注意力、门控线性注意力和标准softmax注意力,可以通过在该框架中选择相应的配方来诱导。基于此框架,我们提出了基于能量的注意力结构修改。受经典梯度下降(GD)算法的启发,我们将基于标准GD的原始注意力公式扩展到基于动量的GD、Nesterov加速梯度(NAG)和牛顿法,每种方法诱导出相应的新型注意力结构。我们的实验为基于能量的框架设计注意力机制的潜力提供了初步支持。

英文摘要:

Attention-based Transformers have demonstrated strong adaptability across a wide range of tasks and have become the backbone of modern Large Language Models (LLMs). However, their underlying mechanisms remain open for further exploration. The energy-based perspective has long provided a valuable principle for understanding neural computation. In this paper, we revisit the principle of energy as a lens to understand attention-based Transformer models. We present a unified energy-based framework which is composed of three key components: the local energy $E_i$, the global energy $F$, and the employed optimization algorithms. We show that different attention forms including unnormalized linear attention, gated linear attention and standard softmax attention can be induced by choosing their corresponding recipes within this framework. Building on this framework, we propose energy-based modifications of attention structures. Inspired by classical gradient descent (GD) algorithms, we extend the original attention formulation based on standard GD to the momentum-based GD, Nesterov Accelerated Gradient (NAG), and Newton's method, each inducing a corresponding new attention structure. Our experiments provide preliminary support for the potential of the energy-based framework for designing attention mechanisms.

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

↑