LayerScale multiplies the output of each residual block in a Transformer (self-attention and feed-forward) by a separate learnable coefficient per channel before adding it to the residual. The coefficients start from a small value . Touvron et al. proposed it in 2021 to make image classification Transformers (CaiT) deeper.
Image Transformers such as ViT and DeiT become unstable to train as layers are added, and when trained on ImageNet alone, accuracy did not improve with depth. In the paper, the DeiT training recipe did not converge well beyond 18 layers without hyperparameter tuning. With LayerScale, even 36 layers trained stably, and accuracy kept rising with depth.
It adjusts the scale of residual block outputs per channel, but unlike Layer Normalization, it does not use the mean or variance of the data; it simply multiplies by learned constants.
The figure at the top of the article shows, on the left, a Transformer layer with LayerScale, and on the right, what LayerScale does (multiplication by a diagonal matrix) compared with earlier methods that multiply by a single scalar.

