Skip to content
AI360Xpert
Beta

ResMLP Stabilizes MLP Vision Stacks

ResMLP adds residuals plus simple scaling to token and channel MLPs, so deep attention free stacks train stably.

Residuals plus 0.1 scaling train 24 MLP layers stably
Residuals plus 0.1 scaling train 24 MLP layers stably

Why Does This Exist?

Deep MLPs without attention drift: activations explode and early layers stall.

ResMLP borrows residuals. It follows mlp mixer mixing, steadies like gmlp gating needs, and serves image classification depth.

Think of It Like This

Handrails plus soft steps on stairs

Steep stairs need rails plus shallow risers. You hold steady while climbing higher safely.

Residuals are rails, LayerScale 0.1 is shallow steps. Where it stops: rails cannot fix wrong direction, just as residuals cannot fix bad mixing.

How It Actually Works

Block is x+LayerScale(MLP(LayerNorm(x)))x + LayerScale(MLP(LayerNorm(x))) for token then channel steps. LayerScale multiplies each channel by learned λ\lambda init 0.10.1. Train 1212-2424 layers with heavy augmentation plus distill.

Worked example

Activation norm 10.010.0 through MLP gives 12.012.0. Without scale, x+12.0x + 12.0 jumps. With λ=0.1\lambda = 0.1, add 1.21.2 for 11.211.2, a 1212 percent step not 120120 percent. Over 2424 layers totals stay bounded and gradients flow.

Watch Out For

Dropping LayerScale on 24 layer runs

Plain residuals still spike deep. Symptom: loss NaN after epoch 5. Fix: keep LayerScale init near 0.10.1 and warm up before raising rates.

The Quick Version

  • ResMLP is Mixer plus residuals plus per-channel LayerScale.
  • Init scale 0.10.1 keeps deep steps small and stable.
  • Fixture 10.010.0 to 11.211.2 shows 12 percent steps.
  • Trains 2424 layers to about 81 percent with help.
  • Keep scaling and warmup for deep stacks.