YuriiFormer: A Suite of Nesterov-Accelerated Transformers
Aleksandr Zimin, Yury Polyanskiy, Philippe Rigollet
TL;DR
This work reframes transformer blocks as discrete steps in optimizing a composite energy $\mathcal{E}(X)+\mathcal{F}(X)$ over token configurations, where attention updates follow the gradient of an interaction energy and MLPs follow a potential energy gradient. By applying a Nesterov accelerated gradient template within a Lie--Trotter splitting, the authors introduce YuriiFormer, a family of momentum-enhanced transformers that preserves the same attention and MLP oracles. Empirical results on TinyStories and OpenWebText show consistent improvements in validation loss and downstream few-shot accuracy over a vanilla GPT-style baseline of equal size and budget, with Lie--Trotter variants generally outperforming Euler discretizations. The study demonstrates that optimization-theoretic insights can meaningfully guide architectural design in transformers, offering a modular framework to borrow ideas from numerical optimization and apply them to deep learning models with practical performance benefits.
Abstract
We propose a variational framework that interprets transformer layers as iterations of an optimization algorithm acting on token embeddings. In this view, self-attention implements a gradient step of an interaction energy, while MLP layers correspond to gradient updates of a potential energy. Standard GPT-style transformers emerge as vanilla gradient descent on the resulting composite objective, implemented via Lie--Trotter splitting between these two energy functionals. This perspective enables principled architectural design using classical optimization ideas. As a proof of concept, we introduce a Nesterov-style accelerated transformer that preserves the same attention and MLP oracles. The resulting architecture consistently outperforms a nanoGPT baseline on TinyStories and OpenWebText, demonstrating that optimization-theoretic insights can translate into practical gains.
