Eureka-Moments in Transformers: Multi-Step Tasks Reveal Softmax Induced Optimization Problems

David T. Hoffmann, Simon Schrodi, Nadine Behrmann, Volker Fischer, Thomas Brox
2/12/2026

No official code found. Best implementation: boschresearch/eurekaMoments (4 stars, AGPL-3.0, last commit 2024-08-05).

Abstract

In this work, we study rapid improvements of the training loss in transformers when being confronted with multi-step decision tasks. We found that transformers struggle to learn the intermediate task and both training and validation loss saturate for hundreds of epochs. When transformers finally learn the intermediate task, they do this rapidly and unexpectedly. We call these abrupt improvements Eureka-moments, since the transformer appears to suddenly learn a previously incomprehensible concept. We designed synthetic tasks to study the problem in detail, but the leaps in performance can be observed also for language modeling and in-context learning (ICL). We suspect that these abrupt transitions are caused by the multi-step nature of these tasks. Indeed, we find connections and show that ways to improve on the synthetic multi-step tasks can be used to improve the training of language modeling and ICL. Using the synthetic data we trace the problem back to the Softmax function in the self-attention block of transformers and show ways to alleviate the problem. These fixes reduce the required number of training steps, lead to higher likelihood to learn the intermediate task, to higher final accuracy and training becomes more robust to hyper-parameters.

View on arXivView PDF

Code Implementations(1)

AGPL-3.0

This is the code accompanying our ICML 2024 paper "Eureka-Moments in Transformers: Multi-Step Tasks Reveal Softmax Induced Optimization Problems".

41PythonMay 24, 20242 years agoAGPL-3.0
bcaipaper-resource

Similar Papers

Cite this paper

@article{hoffmann2026eurekamoments,
  title  = {Eureka-Moments in Transformers: Multi-Step Tasks Reveal Softmax Induced Optimization Problems},
  author = {David T. Hoffmann and Simon Schrodi and Nadine Behrmann and Volker Fischer and Thomas Brox},
  year   = {2026},
  eprint = {2310.12956},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2310.12956},
  journal = {ICML 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2310.12956.svg)](https://codeofpaper.com/paper/2310.12956)

Discussion