TL;DR
DaMN (Deleting and Migrating Normalizations) is a novel post-training method that completely removes normalization layers from pretrained Transformer models, unlocking up to 18% faster inference and 17% lower energy consumption. By replacing normalization with moment-matched affine layers and smoothly fine-tuning them away, DaMN avoids the massive computational cost of retraining from scratch while preserving near-lossless model quality.
What Problem Does This Paper Address?
Normalization layers (such as LayerNorm and RMSNorm) are the unsung heroes of modern deep learning, providing the training stability needed to converge deep Transformer architectures. However, during inference, they become a major architectural bottleneck. Because they compute per-input statistics (mean and variance) dynamically, they introduce high memory traffic and computationally expensive reduction operations, severely degrading latency and energy efficiency on hardware.
Existing solutions either attempt to train models without normalization from scratch (which is notoriously unstable) or replace them with alternative operators that still require full retraining. This paper addresses a crucial question: Can we completely remove normalization layers from already pretrained models without destroying their accuracy? Naively deleting them causes immediate signal explosion or collapse, so a more sophisticated migration strategy is required.
Methods
The authors introduce DaMN, a three-step pipeline designed to smoothly transition normalization layers into identity mappings post-training:
- Moment-Matched Affine Surrogate: Instead of naively dropping a normalization layer, DaMN replaces it with a temporary affine layer ($\gamma' \odot x + \beta'$). The parameters are initialized using a small calibration dataset to perfectly match the first and second moments (mean and variance) of the original normalization layer's inputs and outputs.
- Sequential Calibration: Because deep networks compound changes across layers, calibrating all layers simultaneously causes massive distribution drift. DaMN calibrates the surrogate layers sequentially, layer-by-layer in topological order, ensuring downstream layers receive stable inputs during calibration.
- Smooth Removal via $\alpha$-Scheduling: During a brief fine-tuning phase, the model dynamically blends the normalized path and the affine surrogate path using a mixing coefficient $\alpha$: $$y = (1-\alpha)(\text{surrogate}) + \alpha(N(x))$$ $\alpha$ is gradually annealed from 1 to 0 using a cosine schedule. Once $\alpha=0$, the normalization is completely gone, and the remaining static affine parameters are analytically fused into adjacent linear layers, leaving zero inference overhead.
Datasets
The method was evaluated across multiple domains and architectures:
- Image Super-Resolution: Trained and calibrated on the DF2K dataset and evaluated on standard benchmarks: Set5, Set14, BSD100, Urban100, and Manga109 (using SwinIR, MambaIR, and SRFormer).
- Blind Image Denoising: Evaluated on the SIDD dataset using the Restormer architecture.
- Image Classification: Evaluated on ImageNet-1K using Swin-B, ViT-B, and ConvNeXt-B.
- Language Modeling: Evaluated using Modded-NanoGPT on the FineWeb dataset, and a Qwen2.5-1.5B model finetuned on OpenMathInstruct-2 (evaluated on the MATH500 benchmark).
Key Insights and Ideas
- Decoupling Training vs. Inference Needs: The core philosophy is a paradigm shift: use normalization during training for optimization stability, but completely eliminate it at inference for hardware efficiency.
- The Danger of Non-Sequential Calibration: Calibrating all layers at once causes an "activation explosion" where variance grows exponentially in deeper layers, leading to numerical saturation and training failure (NaNs). Sequential calibration acts as a vital stabilizer that keeps variance perfectly bounded.
- Extreme Sensitivity to Noise: The authors found that even a 5% perturbation in the estimated affine parameters causes severe performance drops. Using numerically stable algorithms like Welford's algorithm for tracking running variance is mandatory to prevent training failure.
Key Results
- Hardware Efficiency: On an NVIDIA A100 GPU, completely removing normalization layers resulted in up to 18% faster inference and 17% lower power consumption (e.g., Restormer saw a 17.9% speedup and 16.9% energy reduction).
- Near-Lossless Quality: On super-resolution and denoising tasks, DaMN maintained high performance with less than 0.2 dB PSNR loss compared to the original models, outperforming or matching state-of-the-art methods like DyT and SLAB.
- Finetuning Efficiency: Unlike alternative methods that require 100% retraining from scratch, DaMN achieved its results with a short fine-tuning phase using only around 30% of the original training budget.
Limitations and Future Work
- Not Zero-Shot: The method still requires a calibration dataset (20-30% of training data) and a brief fine-tuning phase, meaning it cannot be applied instantly out-of-the-box without some compute.
- Sensitivity to Statistics: The success of the affine surrogate hinges on highly accurate activation statistics. In extremely deep or highly dynamic networks, inaccurate moment estimation can still lead to training instability.
- Partial Removal in LLMs: For Large Language Models (like Qwen2.5), completely removing all normalization layers led to divergence; the authors had to retain normalization in the final decoder layers, suggesting that future work is needed to fully adapt this to massive autoregressive models.
Summary updated