TL;DR
Replacing LayerNorm in transformers with simpler, S-shaped curves like Dynamic Tanh (DyT) or Dynamic erf (Derf) looks great on paper, because their input-output shapes mimic normalization. However, at initialization, this seemingly innocent swap pushes deep transformers out of a stable "critical" state and into a fragile "subcritical" regime where gradients amplify rapidly across layers. While standard pre-LayerNorm transformers forgive sloppy hyperparameter choices, normalization-free variants demand careful tuning of depth, learning rates, and initialization scales just to get off the ground.
What Problem Does This Paper Address?
To train a deep neural network, signals and gradients need to travel across dozens of layers without vanishing into nothing or exploding into NaNs. Physicists and ML theorists call this sweet spot criticality. Standard pre-LayerNorm (pre-LN) transformers naturally live in this critical regime at initialization, making them remarkably robust out of the box.
Recently, researchers proposed "normalization-free" transformers—like DyT and Derf—which ditch LayerNorm in favor of simple elementwise squashing functions like $\tanh(\alpha h)$ or $\text{erf}(\alpha h)$ (where $\alpha$ is a learnable input-scaling parameter). Because these S-curves look a lot like LayerNorm's input-output curve, they work surprisingly well. But how does swapping global vector normalization for a local elementwise curve change the physics of signal propagation at step zero? And what does that mean for training stability?
Methods
To track how gradients behave across layers at initialization, the author uses a metric called the Averaged Partial Jacobian Norm (APJN)—essentially a scalar speedometer measuring how much gradients get amplified or squashed as they backpropagate from deep layers to shallow ones.
While APJN analysis previously existed for standard residual networks, this paper extends the mathematical framework to transformers with bidirectional self-attention. To make the math tractable and derive clean layer-by-layer recurrence relations, the author relies on three standard mean-field assumptions at initialization:
- Large-width Gaussian approximation: Activations behave like clean Gaussian variables.
- Uniform attention: At step zero, attention acts as a uniform mixer across tokens.
- Permutation-symmetric tokens: Every input token starts with the same norm and pairwise similarity to every other token.
Using these recurrences, the author calculates the exact large-depth asymptotic behavior of pre-LN versus tanh-like architectures, and then tests those theoretical predictions against real Vision Transformers (ViTs) during early training.
Datasets
- Synthetic token configurations: Generated specifically to obey exact permutation symmetry, serving as a controlled sanity check for the math.
- CIFAR-100: Used both to measure empirical APJNs on real image patches in deep ViTs (up to 128 blocks) and to run early-training stability sweeps (10–90 epochs).
- TinyStories: Mentioned briefly for preliminary causal language modeling experiments (detailed in the paper's appendix). No new benchmarks are introduced.
Key Insights and Ideas
- Similar curves, wildly different derivatives: In both pre-LN and Derf/DyT, activation variance ($q$) grows linearly with depth. The catch is how their Jacobians scale with that growing variance. LayerNorm's Jacobian variance scales as $1/q$, whereas squashing functions saturate at their flat tails, causing their Jacobian variance to decay much slower—like $1/\sqrt{q}$.
- Critical vs. Subcritical growth: That $1/q$ vs. $1/\sqrt{q}$ difference changes everything. Pre-LN exhibits gentle power-law APJN growth with depth (critical), governed by a bounded exponent. Tanh-like functions cause stretched-exponential growth ($e^{\sqrt{b/\lambda}}$, termed subcritical), which outpaces any power law and has an unbounded scale parameter—meaning bad weight initializations can make gradient amplification arbitrarily steep.
- Real images become symmetric in the deep: Even though real CIFAR-100 images violate the theory's idealized symmetry assumptions at layer zero, token statistics naturally homogenize as they pass through attention and MLPs, making the math surprisingly accurate in middle and deep layers.
- The $\alpha$ trade-off: Shrinking the initial scale $\alpha$ in $\text{erf}(\alpha h)$ tames gradient amplification and pushes the instability boundary to deeper networks—but there is no free lunch. Making $\alpha$ too small chokes signal flow and noticeably slows down convergence.
Key Results
- Theory matches real ViTs: In a 128-block ViT evaluated on CIFAR-100, the theoretical APJN predictions match empirical measurements in middle and deep blocks within a typical multiplicative error (Geometric Mean Fold Error) below 1.25.
- Sensitivity to depth and weight scale: In 20-epoch CIFAR-100 sweeps, pre-LN maintains a steady ~21–22.5% test accuracy from depth 12 all the way to depth 36 without retuning. Meanwhile, Derf ($\alpha=0.5$) drops from 26.11% at depth 12 to 6.49% at depth 36. Similarly, multiplying weight initialization standard deviations by $4\times$ leaves pre-LN unfazed (23.68% at 15 epochs) while crashing Derf ($\alpha=0.5$) from 24.97% down to 4.97%.
- Hyperparameter rescues and traps: Larger-$\alpha$ Derf models can be stabilized with longer warmups or smaller learning rates (dropping LR from
1e-3to1e-4boosts 10-epoch accuracy for $\alpha=0.7$ from 5.63% to 17.93%). Conversely, setting $\alpha=0.1$ avoids blowups but lags significantly behind $\alpha=0.2$–$0.5$ over a 90-epoch run.
Limitations and Future Work
- No causal masking in the math: The theoretical framework relies on bidirectional, uniform attention. Causal masks in autoregressive LLMs break positional symmetry—and notably, preliminary experiments on TinyStories did not hit a comparable instability boundary, leaving open how normalization-free causal language models behave.
- Step-zero lens and short runs: Signal propagation theory strictly describes initialization, not full training dynamics once weights start moving (including $\alpha$ itself). Likewise, truncating ViT runs at 10–20 epochs diagnoses early trainability crashes, not final converged accuracy.
- Scope: Experiments focus on ViTs on CIFAR-100; extending the theory to richer token geometries and testing larger-scale modalities remain open directions.
Summary updated