atlas

Research map / Architectures and efficiency / Attention and transformers

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

ICML 2024 · Architectures and efficiency › Attention and transformers · approach: Transformer expressivity and learnability · 3 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Studies why transformers suddenly learn intermediate sub-tasks ("Eureka-moments") on synthetic two-step tasks, traces the failure to Softmax-induced small gradients for W_Q/W_K, and shows NormSoftmax and heat treatment mitigate it.

Problem

Transformers struggle for hundreds of epochs to learn an unsupervised intermediate step in multi-step decision tasks, with training and validation loss saturating before abrupt, sudden improvements; the cause of this optimization failure is unclear.

Approach

Builds controlled synthetic two-step vision and algorithmic tasks where only the second step is supervised, attributes the plateau to local uniform attention in Softmax producing imbalanced, small gradients for W_Q and W_K, and proposes fixes: NormSoftmax (normalizing QK^T by its empirical std) and Heat Treatment (annealing temperature from low to sqrt(d_k)).

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Replace standard attention scaling with NormSoftmaxViT · Main datasetEureka-ratio: 7/10 -> 10/10Helped
Replace standard attention scaling with NormSoftmaxViT · No Position TaskEureka-ratio: 0/4 -> 3/4Helped
Set attention temperature to 1/3 instead of √d_kViT · Main datasetEureka-ratio: 7/10 -> 10/10Helped
Use Heat Treatment, increasing temperature from 1/3 to √d_kViT · Main datasetaverage Eureka-epoch: 207.43 -> 74.0Helped
Combine NormSoftmax with Heat TreatmentViT · Main datasetaverage Eureka-epoch: 207.43 -> 17.5Helped
Increase temperature from 1/3 to √d_k with Heat TreatmentViT · No Position TaskEureka-ratio: 1/4 -> 1/4No clear effect
Use gradient scaling for W_Q, W_K, and W_VViT · No Position TaskEureka-ratio: 0/4 -> 0/4No clear effect
Use 20 warmup epochs (ablation)ViT · Main datasetaccuracy: 89.48 -> 87.65Hurt
Add weight decay 0.5 (ablation)ViT · Main datasetEureka-ratio: 7/10 -> 5/10Hurt
Use NormSoftmax instead of standard attention scalingViT · Learning-rate sensitivity across schedulesEureka-ratio: 04/36 -> 36/36Helped
Reduce transformer depth from 7 to 4 (ablation)ViT · Main dataset, model-scale experimentEureka-ratio: 2/4 -> 3/4Helped
Increase number of heads from 4 to 6 (ablation)ViT · Main dataset, model-scale experimentEureka-ratio: 2/4 -> 3/4Helped

Surprising findings

Limitations

Experimental setup

Datasets: MNIST Fashion-MNIST Cifar-10 Omniglot Wikipedia ImageNet-100 based dataset

Benchmarks: main synthetic two-step vision task No position task Cifar task 1 Top if above Same color decision task Color or fashion class Digit grouping reasoning task RoBERTa Wikipedia pretraining GPT-2 Omniglot ICL

Metrics: Eureka-ratio accuracy after Eureka-moment average Eureka-epoch validation accuracy steps to 95% of ViT accuracy

Baselines: ViT ResNet9 ViT+Warmup W_QKV gradient scaling ViT+weight decay

Builds on: ViT for small datasets grokking NormSoftmax

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy