Analyzing the Training Dynamics of Image Restoration Transformers: A Revisit to Layer Normalization

MinKyu Lee, Sangeek Hyun, Woojin Jun, Hyunjun Kim, Jiwoo Chung, Jae-Pil Heo

TL;DR

Conventional LayerNorm (LN) forces Image Restoration (IR) Transformers into a pathological state where feature magnitudes explode to a million-scale and channel-wise entropy collapses. To fix this, the authors introduce i-LN, a simple drop-in replacement that normalizes features holistically across both spatial and channel dimensions and adaptively rescales them per input. This elegant modification stabilizes training dynamics, enables robust low-precision inference, and consistently boosts performance across multiple image restoration tasks.

What Problem Does This Paper Address?

Vision Transformers (ViTs) have become the standard backbone for low-level vision tasks like image restoration (e.g., super-resolution, denoising, and deraining). However, these architectures typically inherit LayerNorm (LN) from high-level vision models without modification.

The authors uncover a critical, overlooked anomaly in standard IR Transformers: during training, intermediate feature magnitudes skyrocket to a million-scale while channel-wise entropy drops sharply. The paper demonstrates that this feature divergence occurs because conventional LN is fundamentally misaligned with the needs of image restoration in two ways:

  1. Per-token normalization processes each pixel (token) independently, destroying the spatial correlations crucial for high-fidelity image reconstruction.
  2. Input-independent scaling maps features into a unified normalized space, stripping away the input-specific statistical variability inherent in low-level vision tasks.

When the network attempts to preserve these vital spatial and statistical properties, it forces specific channels to explode in magnitude to bypass LN's constraints. While completely removing normalization layers causes the network to fail to converge entirely, a tailored solution is clearly required.

Methods

The authors propose Image Restoration Transformer Tailored Layer Normalization (i-LN) as a direct drop-in replacement for vanilla LN. It addresses the architectural mismatches through two key mechanisms:

  1. Spatial Holisticness ($LN^*$): Instead of computing normalization statistics per token, $i$-LN derives its mean ($\mu$) and variance ($\sigma^2$) jointly across the entire spatio-channel dimension of the input feature map. Mathematically, this acts as a homothety, preserving relative spatial differences (inter-pixel structure) up to a single global scale factor.
  2. Input-Adaptive Rescaling: To restore the missing global scale and allow range flexibility for internal representations, $i$-LN dynamically rescales the output of the Attention or Feed-Forward Network (FFN) layers. It multiplies the block's output by the standard deviation ($\sqrt{\sigma^2 + \epsilon}$) calculated during the preceding normalization step.
Comparison between vanilla LN and i-LN block architectures

Datasets

  • Training Datasets: Rain13K was utilized exclusively for image deraining tasks. For all other tasks (super-resolution, denoising, and compression artifact removal), the DF2K dataset (a combination of DIV2K and Flickr2K) was used.
  • Evaluation Benchmarks:
  • Super-Resolution (SR): Set5, Set14, BSD100, Urban100, Manga109.
  • Denoising (DN): CBSD68, Kodak24, McMaster, Urban100.
  • JPEG Compression Artifact Removal (CAR): LIVE1, Classic5, Urban100.
  • Deraining (DR): Test100, Rain100L.

Key Insights and Ideas

  • The Bypassing Hypothesis: The million-scale feature explosion isn't a random training bug; it's an explicit mathematical workaround. The network deliberately blows up specific channel values to force per-token statistics to become uniform, effectively fighting back against LN's structure-destroying constraints.
  • The Affine Bias Safety Valve: Despite massive internal feature spikes, vanilla networks still manage to output reasonable images. The authors discovered a compensatory mechanism: the learnable affine bias parameters ($\beta$) in the final LN layer precisely align with and counteract the extreme channel peaks. However, relying on this fragile shortcut leaves the model highly unstable.
  • Scale Exacerbates Pathology: As IR Transformers scale up—becoming either deeper or wider—the feature divergence phenomenon accelerates, and magnitudes reach even higher extremes. This makes fixing the normalization layer a prerequisite for successfully scaling low-level vision networks.
Feature magnitude evolution across network depth, width, and different IR tasks

Key Results

  • Training and Entropy Stabilization: $i$-LN completely eliminates feature magnitude explosion and prevents channel entropy collapse, maintaining a well-distributed and stable activation profile throughout training.
Feature magnitude and entropy stabilization with i-LN
  • Quantitative Performance Gains: Across multiple backbones (SwinIR, HAT, DRCT) and tasks, $i$-LN consistently outperforms vanilla LN and other alternatives (like RMSNorm or InstanceNorm). For example, on the $\times 4$ SR task using the HAT architecture, $i$-LN improves the PSNR on the Urban100 benchmark from 26.55 dB to 27.17 dB.
  • Low-Precision Inference Robustness: Because $i$-LN keeps internal feature values well-bounded, it prevents the network-generated infinity values (which manifest as corrupted black-dot artifacts) that plague vanilla LN during half-precision (FP16) or quantized (INT4/INT8) inference.

Limitations and Future Work

The authors note that the performance gains of $i$-LN are slightly less pronounced in tasks like image denoising and JPEG artifact removal compared to super-resolution or deraining. This is because denoising involves uniformly distributed corruptions across the entire image, which naturally limits the advantage gained from explicitly preserving localized input features.

For future work, the authors suggest exploring the interplay between specific attention mechanisms—such as the Permuted Self-Attention (PSA) found in architectures like SRFormer—and spatial holistic normalization to further optimize spatial correlation modeling.

Summary updated

Abstract

This work analyzes the training dynamics of Image Restoration (IR) Transformers and uncovers a critical yet overlooked issue: conventional LayerNorm (LN) drives feature magnitudes to diverge to a million scale and collapses channel-wise entropy. We analyze this in the perspective of networks attempting to bypass LN's constraints that conflict with IR tasks. Accordingly, we address two misalignments between LN and IR: 1) per-token normalization disrupts spatial correlations, and 2) input-independent scaling discards input-specific statistics. To address this, we propose Image Restoration Transformer Tailored Layer Normalization i-LN, a simple drop-in replacement that normalizes features holistically and adaptively rescales them per input. We provide theoretical insights and empirical evidence that this simple design effectively leads to both improved training dynamics and thereby improved performance, validated by extensive experiments.
BibTeX
@inproceedings{lee2026analyzing,
  author = {MinKyu Lee and Sangeek Hyun and Woojin Jun and Hyunjun Kim and Jiwoo Chung and Jae-Pil Heo},
  title = {{Analyzing the Training Dynamics of Image Restoration Transformers: A Revisit to Layer Normalization}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=SbLj5hJXh6},
}
Figure