View a PDF of the paper titled Attention as Intrinsic Optimizers: Forward Inference through the Energy Principle, by Ruifeng Ren and 3 other authors
Abstract:Attention-based Transformers have demonstrated remarkable success across a wide range of tasks and have become the backbone of modern large language models (LLMs). However, a comprehensive understanding of attention mechanisms and how their underlying principles can guide architectural design remains an open research question. In this paper, we revisit the principle of energy as a lens to understand attention-based 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. The forward inference of attention models can be interpreted as an implicit optimization process over the global energy. We show that different attention forms including 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 structures.
Submission history
From: Ruifeng Ren [view email]
[v1]
Sun, 2 Nov 2025 11:58:50 UTC (3,305 KB)
[v2]
Mon, 12 Jan 2026 07:13:15 UTC (5,376 KB)
[v3]
Thu, 3 Dec 2026 07:48:17 UTC (2,206 KB)
