Home Knowledge Base LayerScale

LayerScale is the trainable scaling factor that fades each block's residual updates at initialization so very deep Vision Transformers remain stable — initializing the scale to a tiny value (e.g., 1e-4) makes the block behave like identity early on and gradually lets the network grow complexity as training converges.

What Is LayerScale?

Why LayerScale Matters

Scale Placement

Attention Scaling:

MLP Scaling:

Per-Head Variation:

How It Works / Technical Details

Step 1: Apply a learnable diagonal matrix (scale factor per channel) to the output of the sublayer before adding the residual connection.

Step 2: During backpropagation, the scale parameters adjust so that blocks can gradually emerge from near-identity behavior to full expressivity without destabilizing the network.

Comparison / Alternatives

AspectLayerScaleNo ScalingLayerNorm Tuning
StabilityHighMedium
ParametersPer-channelNone
ExpressivityAdaptiveFixed
ImplementationSimpleSimple

Tools & Platforms

LayerScale is the tiny multiplier that keeps transformer blocks behaving until they learn something worth adding — it lets Vision Transformers grow deep without the instability that usually trips up residual stacks.

layerscalecomputer vision

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.