Trained layer normalization has an S shape
The paper took trained ViT, wav2vec 2.0, and DiT models and plotted, for every element, the input of each layer normalization against its output (before applying γ and β) (Figure 2 of the paper).
- In shallow layers, the relationship was nearly linear.
- In deeper layers, it became an S-shaped curve like tanh. Most values (about 99%) lie on the nearly linear central part, but some extreme values (in ViT, those above 50 or below −50, for example) were strongly squashed.
Subtracting the mean and dividing by the standard deviation is a linear function (a straight line) within one token. But because the mean and variance differ from token to token, the slope of the line also differs per token: tokens with small variance get steep slopes, and tokens with large variance get shallow ones. Overlaying all these lines makes the whole look like an S (Figure 4 of the paper). The paper suggests that this nonlinear squashing of extreme values may be exactly why normalization layers matter.
Mimicking this shape with tanh and α
DyT mimics this S shape with tanh(αx).
- tanh squashes extreme values. Near the center it is almost linear (tanh(αx)≈αx), and large values approach ±1.
- α sets the horizontal scaling to match the spread of the input. As shown on the right of the figure at the top of the article, the larger α is, the steeper the S becomes, and the smaller it is, the closer the curve gets to a straight line.
As an analogy, layer normalization "remakes the ruler for each token before measuring", while DyT "uses a single stretchable ruler for everything (α) and stops any length that runs off the end at the last mark (±1)".
α learns the reciprocal of the input's standard deviation
According to the paper, α during training behaved much like the reciprocal of the standard deviation of that layer's input (1/std) (Figure 8 of the paper). The final trained α was also strongly correlated with 1/std. In other words, α takes over part of normalization's "divide by the standard deviation" role. However, while layer normalization divides per token, α is a single value for the layer's entire input, so α alone cannot squash extreme values nonlinearly. tanh fills that gap.
Both tanh and α are essential
Experiments on ViT (Tables 7 and 8 of the paper) confirm the role of each.
| Change | ViT-B accuracy |
|---|
| DyT (tanh and α) | 82.5% |
| Replace tanh with hardtanh | 82.2% |
| Replace tanh with sigmoid | 81.6% |
| Remove tanh (αx only) | Rose to 61.0%, then diverged |
| Remove α (tanh(x) only) | 81.1% |
Without a squashing function, training diverged; without α, accuracy dropped. Among the squashing functions, tanh worked best, which the paper attributes to its being smooth and symmetric about 0.