Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Each layer at its own pace
In a deep network, some layers get gradients that are huge compared with their weights, and others get tiny ones. With a single learning rate, a step that is sensible for one layer can be reckless for another. LARS measures, for each layer, how big the weights are relative to the gradient, and scales that layer’s learning rate so that every layer changes by about the same percentage per step. That makes much larger learning rates, and so much larger batches, usable.
Training perception models on large clusters uses very large batches to keep many accelerators busy. Large batches need large learning rates (E3-1), which plain SGD cannot use when layers differ greatly in scale. LARS and its Adam-based sibling LAMB (E3-15) are what made batches of tens of thousands workable for ImageNet-scale vision and BERT-scale language models.
- 1. LARS assigns learning rates…
- 2. The trust ratio is based on…
- 3. LARS was developed to enable…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.By hand
- Trust ratio: for layer l, λₗ = η·‖wₗ‖/(‖gₗ‖ + β‖wₗ‖), with a small trust coefficient η (about 0.001) and weight decay β. Example: ‖w‖ = 5, ‖g‖ = 0.5, η = 0.01 gives λ = 0.1.
- Update with momentum: vₗ ← m·vₗ + γ·λₗ·(gₗ + βwₗ), then wₗ ← wₗ − vₗ, with global rate γ.
- Relative change: ignoring momentum and decay, ‖Δwₗ‖ = γλₗ‖gₗ‖ = γη‖wₗ‖. Every layer changes by the fraction γη of its norm per step, whatever its gradient’s size.
- Example: w = (3, 4), g = (0, 2), γ = 1, η = 0.1 gives a step of 0.1 × 5/2 × (0, 2) = (0, 0.5), so w becomes (3, 3.5), a 10% change of its norm.
- Exclusions: biases and batch-norm parameters usually skip the trust ratio.
- Schedule: You et al. used a polynomial decay γₜ = γ₀(1 − t/T)², plus warm-up.
- 1. Trust ratio for ‖w‖ = 10, ‖g‖ = 1, η = 0.001?
- 2. LARS's per-step relative change of a layer is…
- 3. Usually excluded from LARS adaptation are…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.LARS in code
Exercise 1.
- A momentum-free LARS step changed a weight matrix by exactly 0.1% of its norm (γη = 0.001).
- It did the same with 100 times larger gradients, and with 5 times larger weights.
- LARS’s relative step is independent of the layer’s gradient and weight scales.
Practice.
- Typical settings: η ≈ 0.001, momentum 0.9, a large base rate with warm-up (several epochs), and polynomial or cosine decay.
- Apply the trust ratio per weight tensor (convolution kernel or linear matrix), not per scalar.
- LARS pairs naturally with SGD and momentum for convolutional networks. For transformers and Adam-style training, use LAMB (E3-15).
- Very large batches still hit the critical-batch-size limit (E3-1). LARS extends the regime where scaling works; it does not remove the limit.
# torch: no built-in LARS; common implementations wrap SGD and rescale each parameter's gradient by its trust ratio- 1. LARS's trust ratio is computed per…
- 2. For transformers trained with Adam, the layer-wise method is…
- 3. Does LARS remove the critical batch size?
Level 3: Advanced
★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.Theory
Why layers need different rates. For gradient descent to be stable and efficient, each layer’s step should be small relative to its own scale. In deep networks, ‖g‖/‖w‖ varies by orders of magnitude across layers: input layers with large inputs, normalised layers, the final classifier. A global rate must suit the most sensitive layer, so the others crawl. You, Gitman and Ginsburg (2017) measured ratios differing by over 100× in AlexNet and ResNet, which made large-batch training diverge without warm-up.
Normalisation and scale invariance. For layers followed by batch normalisation, the loss is invariant to rescaling the weights, so only the direction of w matters, and the effective learning rate scales like γ/‖w‖². LARS’s relative step makes training independent of this scale. That also explains why it interacts with weight decay, which shrinks ‖w‖.
Results. LARS trained ResNet-50 on ImageNet with batches of 32k (later 64k), matching small-batch accuracy, with LARS plus warm-up and polynomial decay.
Caveats. The trust ratio uses the noisy mini-batch gradient norm. Very small gradient norms (late in training) give huge local rates, which the momentum and the global schedule must tame. Some later studies found well-tuned standard optimisers match LARS at moderate batch sizes (Nado et al., 2021).
- 1. With batch norm, a layer's loss is invariant to…
- 2. LARS trained ResNet-50 with batch sizes of…
- 3. Nado et al. (2021) found that at moderate batch sizes…
Level 4: Expert
★★★★★ Expert⏱ 25 minResearchers: original papers and open problems.Layers with very different scales
History.
- Y. You, I. Gitman and B. Ginsburg (2017) introduced LARS and trained AlexNet and ResNet-50 with batches up to 32k.
- Y. You et al. (2020) introduced LAMB for BERT.
- Large-batch ImageNet training in minutes (2018–2019) relied on LARS.
- Z. Nado et al. (2021) revisited the baselines.
Exercise 2. A 2–32–32–3 tanh network on spirals whose inputs are multiplied by 30, so the first layer’s gradient is very large relative to its weights. Full-batch training (600 points) runs for 250 steps, with SGD with momentum and with LARS (η = 0.001, momentum 0.9), each over a grid of learning rates. The ratio ‖w‖/‖g‖ per weight matrix at step 1 was 0.051, 7.64 and 2.10, a 150-fold spread.
| method | γ | steps to loss < 0.1 | final loss |
|---|---|---|---|
| SGD + momentum | 0.01 | 169 | 0.052 |
| SGD + momentum | 0.03 | 67 | 0.011 |
| SGD + momentum | 0.1 | 199 | 0.101 |
| SGD + momentum | 0.3 | 161 | 0.446 |
| LARS | 3 | 60 | 0.000 |
| LARS | 10 | 33 | 0.000 |
| LARS | 30 | 21 | 0.177 |
| LARS | 100 | — | 1.384 |
- One global rate could not suit all layers. Above 0.03, SGD became erratic: the first layer’s huge gradients made larger steps unstable, so the other layers were held to tiny steps.
- LARS reached the target in half the steps (33 against 67) and drove the loss to zero, because every layer moved by the same relative amount per step.
- LARS has its own stability limit. At γ = 30 it hit the target fastest (21 steps) but did not stay there, and at 100 it failed. The trust ratio relocates the learning-rate choice; it does not remove it.
LARS in AI, robotics and aerospace
- Large-scale perception training on clusters, where large batches keep many accelerators busy, uses LARS for convolutional backbones.
- Self-supervised pre-training (SimCLR, BYOL) commonly uses LARS with very large batches.
- Heterogeneous inputs: models mixing raw sensor channels with very different scales benefit from layer-wise rate scaling, or from proper input normalisation.
References
- Y. You, I. Gitman, B. Ginsburg (2017). “Large batch training of convolutional networks.” arXiv:1708.03888.
- Y. You et al. (2020). “Large batch optimization for deep learning: training BERT in 76 minutes.” Proc. ICLR.
- T. Chen, S. Kornblith, M. Norouzi, G. Hinton (2020). “A simple framework for contrastive learning of visual representations.” Proc. ICML.
- Z. Nado, J. Gilmer, C. Shallue, R. Anil, G. Dahl (2021). “A large batch optimizer reality check: traditional, generic optimizers suffice across batch sizes.” arXiv:2102.06356.