atlas

Research map / Optimization / Implicit bias and generalization

On the Optimization and Generalization of Two-layer Transformers with Sign Gradient Descent

ICLR 2025 · Optimization › Implicit bias and generalization · approach: In-context learning as gradient descent · 0 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.

Analyzes the training dynamics of SignGD (a proxy for Adam) on a two-layer transformer with softmax query-key attention and linear head on a linearly separable noisy dataset, showing fast convergence but poor generalization.

Problem

How sign gradient descent (a surrogate for Adam) optimizes and generalizes when training a two-layer transformer with trainable query-key attention on noisy, linearly separable data.

Approach

Characterizes the full SignGD training dynamics of a softmax attention layer with trainable query-key parameters in four stages, proving linear convergence of training loss but constant test loss ("destructive convergence"), and shows Adam behaves similarly.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Train the two-layer transformer with SignGDTwo-layer transformer · Noisy synthetic datasettraining loss: L_S(W^(T)) ≤ εHelped
Train the two-layer transformer with SignGD on noisy dataTwo-layer transformer · Noisy synthetic datasettest loss: L_D(W^(T)) = Θ(1)Hurt
Use Adam instead of GDTwo-layer transformer · Noisy MNIST, classes 3 and 7test lossHurt
Use SignGD instead of GDTwo-layer transformer · Synthetic data, data setting (d)softmax output convergence speedHelped
Use GD instead of SignGDTwo-layer transformer · Noisy data at different noise levelstest lossHelped
Use Adam with β1 and β2 close to 1Two-layer transformer · Synthetic data, Stage IVquery-noise sign alignmentHurt
Increase context length to L = 10 (ablation)Two-layer transformer trained with SignGD · Synthetic data, context length L = 10attention concentration on noise patchesNo clear effect
Add four attention heads (ablation)Simplified transformer trained with SignGD · Synthetic data, four-head modelattention dynamicsNo clear effect
Add residual connections to deeper transformers (ablation)Deeper transformer trained with SignGD · Synthetic data, deeper transformer with residual connectionstheoretical stage behaviorsHelped
Remove residual connections from deeper transformers (ablation)Deeper transformer trained with SignGD · Synthetic data, deeper transformer without residual connectionstheoretical stage behaviorsHurt
Add MLP layers to transformers with residual connections (ablation)Deeper transformer trained with SignGD · Synthetic data, deeper transformercompletion of Stage IV sign alignmentHurt
Use non-orthogonal and/or non-sparse data instead of the default data setting (ablation)Two-layer transformer trained with SignGD · Synthetic data, non-sparse and/or non-orthogonal variantsagreement with theoretical dynamicsNo clear effect

Surprising findings

Limitations

Experimental setup

Datasets: synthetic signal-noise data (Definition 1) MNIST (classes 3 and 7, noised)

Benchmarks: MNIST (noisy, classes 3 and 7)

Metrics: training loss test loss softmax output dynamics 0-1 test loss

Baselines: gradient descent Adam

Builds on: feature learning framework Adam

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