Nadam is Adam with Nesterov momentum: instead of stepping along the current averaged gradient, it steps along the momentum it is about to have, which gives the current gradient extra weight and lets the optimiser react a little sooner when the gradient changes direction. Dozat proposed it in 2016; it is a drop-in replacement for Adam. This page covers the update, how the look-ahead changes the numerator, its relation to Nesterov's method and when it helps. In the exercises you show that Nadam's numerator follows a sign change one step sooner, then compare Nadam and Adam at equal learning rates: on quadratics the difference was at most three steps, while on a small network Nadam was never slower and usually a little faster.
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.
Adam with a look-ahead
Nesterov’s trick for momentum (E3-3) was to look where the momentum is about to take you before deciding the step. Nadam brings the same idea to Adam. Its step uses the momentum it will have after this update, in which the current gradient counts for more. When the gradient direction changes, Nadam notices a step earlier than Adam. Everything else (the per-parameter scaling, the defaults) is the same.
Optimizer lab: Nadam versus plain gradient descent
Nadam: final loss 7.3e-6 (target reached at step 52) · gradient descent: final loss 2.2e-9 (step 22)
Orange: the chosen optimizer; grey dashed: plain gradient descent with the same learning rate. Darker shading means higher loss. On the ill-conditioned bowl, raise κ and watch gradient descent zig-zag across the narrow direction; on the saddle it stalls near the flat start; on the plateau its gradients are tiny. Adaptive methods rescale each direction; momentum methods build speed along consistent directions. The target is 1% of the starting loss (for the saddle, a loss below −0.2; its minima are at −0.25).
Why engineers care
Nadam is a one-line swap for Adam that is available in every framework, often gives a small speed-up, and rarely hurts. It is a useful option when training is slow to respond, for example when tracking changes in an online model or fine-tuning a controller network.
📝 Quick check (Level 0)
0/3 answered
1. Nadam combines Adam with…
2. Compared with Adam, Nadam weights the current gradient…
3. Switching from Adam to Nadam usually needs…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.
By hand
Adam’s numerator: m̂ = m/(1 − β₁ᵗ).
Nadam’s numerator (Dozat): β₁m/(1 − β₁ᵗ⁺¹) + (1 − β₁)g/(1 − β₁ᵗ). The first term is the momentum one step ahead; the second adds the current gradient’s share.
Example at t = 1 with β₁ = 0.9 and g = 2: m = 0.2, so the numerator is 0.9 × 0.2/0.19 + 0.2/0.1 ≈ 0.947 + 2 = 2.947, against Adam’s 2.
Weight on the current gradient late in training: 0.1 for Adam; 0.19 for Nadam (0.1 from the look-ahead term plus 0.9 × 0.1 through β₁m).
Constant gradient: both numerators tend to g, so the long-run step is the same.
Denominator: identical to Adam’s, √v̂ + ε.
📝 Quick check (Level 1)
0/3 answered
1. Late in training, Nadam's weight on the current gradient (β₁ = 0.9) is…
2. Under a constant gradient, Nadam's numerator tends to…
3. Nadam changes Adam's…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.
Nadam in code
Exercise 1.
Under a constant gradient, the two numerators agree.
When the gradient flips sign after 30 steps, Adam’s numerator turns negative after 7 steps and Nadam’s after 6. The look-ahead makes it one step faster to follow a change of direction.
Practice.
Use the same hyperparameters as Adam (η = 10⁻³, β₁ = 0.9, β₂ = 0.999).
PyTorch’s NAdam also applies Dozat’s momentum-decay schedule, μₜ = β₁(1 − ½·0.96^(t·ψ)) with ψ = 0.004, so its early momentum is slightly lower than Adam’s. The simple form used here leaves that out.
For decoupled weight decay, PyTorch supports decoupled_weight_decay=True (NAdamW).
Implement Adam's and Nadam's numerators and compare how quickly they follow a change in the gradient's sign.
📝 Quick check (Level 2)
0/3 answered
1. After a sign flip, Nadam's numerator follows…
2. PyTorch's NAdam additionally applies…
3. Nadam's default learning rate in PyTorch is…
Level 3: Advanced
★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.
Theory
From Nesterov to Nadam. Nesterov momentum can be rewritten so that the gradient is evaluated at the current point and the look-ahead is applied to the momentum: step along β·m_new + g instead of m_new (Sutskever et al., 2013). Dozat (2016) applied this rewriting to Adam’s first moment, giving β₁m̂ₜ₊₁-style terms plus the current gradient, with the bias corrections adjusted accordingly.
What it buys.
On a quadratic with constant curvature, the improvement is small in the adaptive (Adam) regime, because Adam’s per-coordinate normalisation already removes most of the ill-conditioning that Nesterov acceleration targets.
Its main effect is responsiveness: more weight on the current gradient means less lag when the landscape changes, which helps in non-stationary or curved regions, as in network training.
No new guarantees. Nadam inherits Adam’s convergence caveats (E3-9). It is an empirical refinement rather than a theoretically accelerated method.
📝 Quick check (Level 3)
0/3 answered
1. Nadam was proposed by…
2. On quadratics Nadam's gain over Adam is small because…
3. Nadam's convergence guarantees compared with Adam's are…
Level 4: Expert
★★★★★ Expert⏱ 25 minResearchers: original papers and open problems.
Is the look-ahead worth it?
History.
Y. Nesterov (1983) introduced accelerated gradients.
I. Sutskever et al. (2013) reformulated Nesterov momentum for deep learning.
T. Dozat (2016) introduced Nadam and found it faster than Adam on word-embedding and language-model tasks.
Nadam is available in Keras, TensorFlow and PyTorch.
Exercise 2. Adam and Nadam at learning rates 0.003, 0.01 and 0.03 on three problems, counting steps to a target:
a 20-dimensional quadratic with κ = 100 (loss below 10⁻³ of its start);
the same with gradient noise (below 5%);
a 2–32–32–3 tanh network on spirals with mini-batches of 64 (training loss below 0.1, checked every 10 steps).
problem
method
η = 0.003
η = 0.01
η = 0.03
quadratic
Adam
2378
801
261
quadratic
Nadam
2377
799
259
noisy quadratic
Adam
782
233
74
noisy quadratic
Nadam
782
232
72
network, seed 0
Adam
290
120
70
network, seed 0
Nadam
280
110
50
network, seed 1
Adam
270
100
60
network, seed 1
Nadam
260
90
50
network, seed 2
Adam
270
110
60
network, seed 2
Nadam
260
100
50
Nadam was never slower than Adam.
On the quadratics the difference was at most three steps. Adam’s normalisation leaves little for the look-ahead to fix.
On the network Nadam was consistently a little faster, usually by one 10-step check interval (3–29% fewer steps), in all three seeds and in two further seeds.
It is a cheap, safe refinement, worth trying when Adam is slow to respond, but not a large speed-up.
🐍 Exercise 2 (research): is the look-ahead worth it?
Compare Adam and Nadam at three learning rates on a quadratic, a noisy quadratic and a small network over three seeds, counting steps to a target loss.
Nadam in AI, robotics and aerospace
Drop-in for Adam in perception and control networks when faster response is wanted.
Online fine-tuning: the extra weight on the current gradient helps models adapt sooner after changes.
Recurrent and language models were Nadam’s original testbed (Dozat, 2016).
References
T. Dozat (2016). “Incorporating Nesterov momentum into Adam.” ICLR Workshop.
I. Sutskever, J. Martens, G. Dahl, G. Hinton (2013). “On the importance of initialization and momentum in deep learning.” Proc. ICML.
D. P. Kingma, J. Ba (2015). “Adam: a method for stochastic optimization.” Proc. ICLR.
Nadam inherits Adam’s convergence caveats; it is an empirical refinement.
Practice
Show:
Level 0
Problem 1Level 0
Adam’s bias-corrected numerator at t = 1 with g = 2?
2.
Problem 2Level 0
m after one step with g = 2, β₁ = 0.9?
0.2.
Problem 3Level 0
Adam’s weight on the current gradient late in training (β₁ = 0.9)?
0.1.
Level 1
Problem 4Level 1
Nadam’s numerator at t = 1 with g = 2, β₁ = 0.9?
0.18/0.19 + 0.2/0.1 ≈ 2.947.
Problem 5Level 1
Nadam’s weight on the current gradient late in training?
0.1 + 0.09 = 0.19.
Problem 6Level 1
Ratio of Nadam’s to Adam’s current-gradient weight?
0.19/0.1 = 1.9.
Problem 7Level 1
EMA after inputs (1, 1) with β = 0.5, from 0?
0.5, then 0.75.
Level 2
Problem 8Level 2
Steps for Adam’s numerator to turn negative after the sign flip in exercise 1?
7.
Problem 9Level 2
Steps for Nadam’s numerator?
6.
Problem 10Level 2
Adam’s steps on the quadratic at η = 0.03 in exercise 2?
261.
Problem 11Level 2
Nadam’s steps on the quadratic at η = 0.03?
259.
Problem 12Level 2
Adam’s steps on the network (seed 0) at η = 0.03?
70.
Problem 13Level 2
Nadam’s steps on the network (seed 0) at η = 0.03?
50.
Level 3
Problem 14Level 3
Show that Nadam’s numerator tends to g under a constant gradient.
With gₜ = g, mₜ = (1 − β₁ᵗ)g. The numerator is β₁(1 − β₁ᵗ)g/(1 − β₁ᵗ⁺¹) + (1 − β₁)g/(1 − β₁ᵗ). As t → ∞ the bias factors tend to 1, giving β₁g + (1 − β₁)g = g, the same limit as Adam’s m̂. ∎
Problem 15Level 3
Explain why Nadam reacts to a sign change sooner.
After a sign flip, the momentum m still points the old way for a while and decays toward the new sign at rate β₁. Adam’s numerator is just m̂, so it turns over when m does. Nadam’s numerator adds an extra (1 − β₁)g term that already has the new sign, and weights m by β₁ < 1, so the combination crosses zero earlier: one step earlier in exercise 1. ∎
Problem 16Level 3
Explain why Nadam’s gain on the quadratics was negligible.
Nesterov acceleration helps most when plain momentum overshoots along high-curvature directions of an ill-conditioned problem. Adam’s per-coordinate normalisation already rescales directions, and with β₂ = 0.999 the effective step per coordinate is close to η·sign(m), so the dynamics are dominated by the normalisation rather than by momentum overshoot. The extra weight on the current gradient changes the trajectory only marginally: one to three steps in hundreds. ∎
Problem 17Level 3
Advise whether to switch a production training pipeline from Adam to Nadam.
Nadam is a low-risk change: same hyperparameters, same memory, never slower in exercise 2 and sometimes 10–30% faster in steps on a small network. But the gain is modest and problem-dependent. Run a controlled comparison with several seeds on the real task, measuring time to target validation loss and final quality. Check framework differences (PyTorch’s momentum-decay schedule). Switch if the gain is consistent; otherwise the change is not worth the revalidation effort. ∎
Level 4
Problem 18Level 4
Nadam’s steps on the network (seed 1) at η = 0.01?
90.
Problem 19Level 4
Nadam’s steps on the noisy quadratic at η = 0.03?
72.
Problem 20Level 4
Adam’s steps on the network (seed 0) at η = 0.003?
290.
Coding practice
🐍 Code 1 (Level 1): Nadam numerator
Look-ahead momentum plus current-gradient share.
🐍 Code 2 (Level 1): Nadam step
Nadam numerator over Adam's denominator.
🐍 Code 3 (Level 1): current-gradient weights
Nadam's and Adam's late-training weights.
🐍 Code 4 (Level 0): first negative entry
1-based index of the first negative value.
🐍 Code 5 (Level 0): exponential moving average
Running EMA of a sequence.
Topic test
A timed test drawn at random from this topic's question bank. Each attempt gets new questions. For a longer test across the whole chapter, see the chapter test, or mix topics in the question bag.
Nadam: topic test
10 questions, drawn at random from a bank of 21. Every attempt is different.
⏱ Time limit: 15 minutes. The test submits itself when time runs out.
Levels covered: 0, 1, 2, 3, 4. No hints or solutions until you submit.