Lune

ICLR2025Top-tier venue

What Does It Mean to Be a Transformer? Insights from a Theoretical Hessian Analysis

Weronika Ormaniec, Felix Dangel, Sidak Pal Singh

Abstract

The Transformer architecture has inarguably revolutionized deep learning, overtaking classical architectures like multi-layer perceptrons (MLPs) and convolutional neural networks (CNNs). At its core, the attention block differs in form and functionality from most other architectural components in deep learningto the extent that, in comparison to MLPs/CNNs, Transformers are more often accompanied by adaptive optimizers, layer normalization, learning rate warmup, etc. The root causes behind these outward manifestations and the precise mechanisms that govern them remain poorly understood. In this work, we bridge this gap by providing a fundamental understanding of what distinguishes the Transformer from the other architectures-grounded in a theoretical comparison of the (loss) Hessian. Concretely, for a single self-attention layer, (a) we first entirely derive the Transformer's Hessian and express it in matrix derivatives; (b) we then characterize it in terms of data, weight, and attention moment dependencies; and (c) while doing so further highlight the important structural differences to the Hessian of classical networks. Our results suggest that various common architectural and optimization choices in Transformers can be traced back to their highly nonlinear dependencies on the data and weight matrices, which vary heterogeneously across parameters. Ultimately, our findings provide a deeper understanding of the Transformer's unique optimization landscape and the challenges it poses.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

6 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • The Sharpness Disparity Principle in Transformers for Accelerating Language Model Pre-Training cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • The Sharpness Disparity Principle in Transformers for Accelerating Language Model Pre-Training cites On Layer Normalization in the Transformer Architecture
  • HybridNorm: Towards Stable and Efficient Transformer Training via Hybrid Normalization cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • HybridNorm: Towards Stable and Efficient Transformer Training via Hybrid Normalization cites On Layer Normalization in the Transformer Architecture
  • Avoiding spurious sharpness minimization broadens applicability of SAM cites Fantastic Generalization Measures and Where to Find Them
  • How Do Vision Transformers Work? cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • On Layer Normalization in the Transformer Architecture cites On the Variance of the Adaptive Learning Rate and Beyond
  • Data Selection for Fine-tuning Vision Language Models via Cross Modal Alignment Trajectories cites On Layer Normalization in the Transformer Architecture
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers6

  1. HybridNorm: Towards Stable and Efficient Transformer Training via Hybrid NormalizationZhijian Zhuo, Yutao Zeng, Ya Wang, Sijun Zhang et al.NeurIPS 2025 · 23 citations
  2. Data Selection for Fine-tuning Vision Language Models via Cross Modal Alignment TrajectoriesNilay Naharas, Dang Nguyen, Neslihan Bulut, MohammadHossein Bateni et al.ICML 2026 · 7 citations
  3. The Sharpness Disparity Principle in Transformers for Accelerating Language Model Pre-TrainingJinbo Wang, Mingze Wang, Zhanpeng Zhou, Junchi Yan et al.ICML 2025
  4. Preserving Diversity in Supervised Fine-Tuning of Large Language ModelsZiniu Li, Congliang Chen, Tian Xu, Zeyu Qin et al.ICLR 2025
  5. Avoiding spurious sharpness minimization broadens applicability of SAMSidak Pal Singh, Hossein Mobahi, Atish Agarwala, Yann N. DauphinICML 2025

Builds on16

  1. An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
  2. On the Variance of the Adaptive Learning Rate and BeyondLiyuan Liu, Haoming Jiang, Pengcheng He, Weizhu Chen et al.ICLR 2020 · 2,210 citations
  3. On Layer Normalization in the Transformer ArchitectureRuibin Xiong, Yunchang Yang, Di He, Kai Zheng et al.ICML 2020 · 1,388 citations
  4. Fantastic Generalization Measures and Where to Find ThemYiding Jiang, Behnam Neyshabur, Hossein Mobahi, Dilip Krishnan et al.ICLR 2020 · 705 citations
  5. How Do Vision Transformers Work?Namuk Park, Songkuk KimICLR 2022 · 653 citations

Related papers

  1. Why Transformers Need Adam: A Hessian PerspectiveYushun Zhang, Congliang Chen, Tian Ding, Ziniu Li et al.NeurIPS 2024 · 149 citations
  2. Unraveling the Gradient Descent Dynamics of TransformersBingqing Song, Boran Han, Shuai Zhang, Jie Ding et al.NeurIPS 2024 · 13 citations
  3. Improving Transformer Optimization Through Better InitializationXiao Shi Huang, Felipe Pérez, Jimmy Ba, Maksims VolkovsICML 2020 · 181 citations
  4. Incorporating Residual and Normalization Layers into Analysis of Masked Language ModelsGoro Kobayashi, Tatsuki Kuribayashi, Sho Yokoi, Kentaro InuiEMNLP 2021 · 28 citations
  5. Transformers Learn Nonlinear Features In Context: Nonconvex Mean-field Dynamics on the Attention LandscapeJuno Kim, Taiji SuzukiICML 2024 · 42 citations
Dusk over the sea between two cliffs drawn in fine vertical lines