NRGPT: An Energy-based Alternative for GPT
Nima Dehmamy, Benjamin Hoover, Bishwajit Saha, Leo Kozachkov, Jean-Jacques Slotine, Dmitry Krotov
TL;DR
This work introduces NRGPT, an energy-based reinterpretation of GPT where each token carries a per-token energy and token states are updated via gradient-based exploration on an energy landscape. By decomposing the energy into an attention component and a feed-forward component, and by using a shared, recurrent block with a learnable inference-rate, the model can reproduce Transformer-like updates through energy descent. Empirically, NRGPT achieves competitive performance with fewer parameters across ListOps, Shakespeare, and OpenWebText, while exhibiting interesting dynamics such as asymptotic stability and reduced overfitting on large data regimes. The framework also clarifies theoretical connections and distinctions with prior energy-based transformer approaches, suggesting advantages for explicit energy modeling, regularization, and potential for adaptable computation.
Abstract
Generative Pre-trained Transformer (GPT) architectures are the most popular design for language modeling. Energy-based modeling is a different paradigm that views inference as a dynamical process operating on an energy landscape. We propose a minimal modification of the GPT setting to unify it with the EBM framework. The inference step of our model, which we call eNeRgy-GPT (NRGPT), is conceptualized as an exploration of the tokens on the energy landscape. We prove, and verify empirically, that under certain circumstances this exploration becomes gradient descent, although they don't necessarily lead to the best performing models. We demonstrate that our model performs well for simple language (Shakespeare dataset), algebraic ListOPS tasks, and richer settings such as OpenWebText language modeling. We also observe that our models may be more resistant to overfitting, doing so only during very long training.
