NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Unit Scaling: Out-of-the-Box Low-Precision Training

Charlie Blake, Douglas Orr, Carlo Luschi

TL;DR

Unit scaling is a novel model design paradigm that enables out-of-the-box deep learning training in low-precision formats (like FP16 and FP8) without the need for tedious loss-scaling hyperparameter sweeps. By introducing fixed scaling factors that ensure all weights, activations, and gradients maintain unit variance at initialization, it prevents numerical underflow and overflow with negligible computational overhead.

What Problem Does This Paper Address?

As deep learning models grow exponentially, training them becomes financially and environmentally expensive. Moving from standard 32-bit floating-point numbers (FP32) to lower-precision formats like FP16 or the newly proposed 8-bit formats (FP8) offers massive savings in compute, memory, and bandwidth.

However, low-precision numbers have a much smaller dynamic range. This leads to two major numerical issues: clipping error (overflowing past the maximum representable value) and rounding error (underflowing to zero because the value is too small). Gradients are particularly prone to underflowing during the backward pass.

The standard industry fix is loss scaling, where the loss is multiplied by a large scalar to shift gradient values into a representable range. However, finding the right loss scale requires empirical hyperparameter tuning sweeps, which are expensive and fragile. Dynamic or per-tensor scaling methods exist but introduce significant runtime overhead and software complexity.

Methods

The authors introduce Unit Scaling, a principled approach to model design where every operation is modified to preserve a standard deviation (scale) of $\sigma = 1$ at initialization.

  1. Operation-Level Scaling Factors: For each basic operation (e.g., matrix multiplication, activations, layer normalization), the authors derive mathematical scaling factors for both the forward and backward passes based on standard distributional assumptions.
  2. Constraint Resolution via Geometric Mean: In a standard computational graph, some tensors are shared or reused (non-cut-edges), creating conflicting requirements for forward and backward scaling factors. Unit scaling resolves these constraints by applying the geometric mean of the conflicting scales, ensuring valid gradients while keeping the variance close to 1.
  3. Residual Weighted Addition: Standard residual connections ($x_{l+1} = x_l + f(x_l)$) cause variance to grow with model depth. Unit scaling replaces these with weighted additions (such as fixed interpolation or running-mean schemes) to keep the output variance stable.
Figure 1. Above: Unit scaling of an FFN layer. We multiply each tensor by a fixed scalar to achieve consistent scale, no longer requir- ing a loss scale to control the scale of ∇x4. Hyperparameters here are the same as those in our BERTLARGE experiments (Table A.5).

Datasets

The method was evaluated using several standard benchmarks:

  • WikiText-103: Used for small-scale raw character language modeling to test a wide variety of architectures.
  • English Wikipedia: Used for pre-training BERT-Base and BERT-Large models.
  • SQuAD v1.1 and SQuAD v2.0: Used for downstream evaluation and fine-tuning of the trained BERT models.

Key Insights and Ideas

  • The Unit Scale "Sweet Spot": The authors demonstrate that a standard deviation of $\sigma = 1$ is a natural compromise for floating-point formats. As shown in their signal-to-noise ratio (SNR) analysis, keeping values near $2^0$ maximizes precision and provides equal headroom against both underflow and overflow.
Figure 2. The signal to noise ratio (SNR) of samples from a nor- mal distribution, quantised in FP16 and FP8, as a function of the distribution’s scale.
  • Local vs. Global Scaling: Instead of shifting all gradients globally using a single loss_scale hyperparameter, unit scaling acts locally at every single operation. This handles cases where different gradient tensors naturally operate at vastly different scales.
  • Zero Runtime Overhead: Because the scaling factors are fixed and precomputed based on the model's structure, they can be fused directly into the preceding operations (e.g., via compilers like XLA). For BERT-Large, the theoretical FLOP overhead is a mere 0.2%.

Key Results

The authors validated unit scaling across a massive 2,092-run sweep of character language models, spanning different sequence layers (Attention, RNN, Convolution), normalization placements, and optimizers (SGD, Adam).

Figure 4. Character language modelling, showing validation bits per character over a wide range of models. Each point represents one combination of: {Conv, RNN, Attention}, {Pre, Post, No norm}, {Fixed, Running-mean residual}, {SGD, Adam}, {2, 8 Layers}. Each point is the best final value over a learning rate sweep.

The headline result is the first-ever successful training of BERT-Large in FP16 and FP8 without any loss scaling. On the downstream SQuAD tasks, the unit-scaled models achieved performance on par with (and occasionally exceeding) the traditionally tuned, loss-scaled baselines:

  • BERT-Large (SQuAD v1.1 F1 score):
  • Standard FP16 (with Loss Scaling): 90.93
  • Unit Scaled FP16 (No Loss Scaling): 92.14
  • Unit Scaled FP8 (No Loss Scaling): 91.77

Limitations and Future Work

The primary limitation acknowledged by the authors is that unit scaling is an initialization-only strategy. It ensures perfect numerical scaling at step zero, but it does not actively adapt if tensor distributions shift drastically during the course of training. While their experiments show that the provided "headroom" is sufficient for BERT and character language models, more complex or unstable architectures might still require dynamic re-scaling. Investigating where dynamic scaling is strictly necessary remains a subject for future work.

Summary updated

BibTeX
@inproceedings{blake2023unit,
  author = {Charlie Blake and Douglas Orr and Carlo Luschi},
  title = {{Unit Scaling: Out-of-the-Box Low-Precision Training}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=A8HOsNfish},
}
Figure