Gradient Descent

Volume I, Chapter 2 — Part I. Derivation of gradient descent from the first-order Taylor expansion, convergence proofs for convex and strongly convex objectives, momentum, Adam, and learning rate schedules.

Beginner

Table of Contents

  1. Learning Objectives
  2. Prerequisites
  3. Notation
  4. Core Intuition
  5. First-Order Taylor Expansion
  6. The Steepest Descent Direction
  7. The Gradient Descent Update Rule
  8. Smoothness and the Sufficient Decrease Lemma
  9. Convergence for Convex Functions
  10. Strong Convexity and Linear Convergence
  11. Stochastic Gradient Descent
  12. Momentum and Nesterov Acceleration
  13. Adam: Adaptive Moment Estimation
  14. Learning Rate Schedules
  15. Connection to the Eigenbasis
  16. Common Pitfalls and Misconceptions
  17. Research Perspective
  18. Summary of Takeaways
  19. Exercises

Learning Objectives

After reading this chapter, you should be able to:

  1. Derive the gradient descent update from the first-order Taylor approximation and the Cauchy–Schwarz inequality.
  2. State the LL-smoothness condition and prove the sufficient decrease lemma.
  3. Prove O(1/T)O(1/T) convergence for convex objectives and linear convergence for strongly convex objectives.
  4. Derive SGD as an unbiased gradient estimator and state its variance properties.
  5. Derive momentum as an exponential moving average of gradients and explain its effect on ravines.
  6. Derive Adam including bias correction, and interpret per-parameter adaptive learning rates.
  7. Analyze gradient descent convergence in the eigenbasis of a quadratic objective.

Prerequisites


Notation

  • f:RnRf: \mathbb{R}^n \to \mathbb{R} — Objective function
  • f(x)\nabla f(\mathbf{x}) — Gradient vector
  • H=2f(x)\mathbf{H} = \nabla^2 f(\mathbf{x}) — Hessian matrix
  • α,αt\alpha, \alpha_t — Learning rate (step size)
  • xt\mathbf{x}_t — Parameter iterate at step tt
  • κ(H)\kappa(\mathbf{H}) — Hessian condition number

Core Intuition

Training a machine learning model means finding parameters θRp\boldsymbol\theta \in \mathbb{R}^p that minimize a loss function J(θ)J(\boldsymbol\theta). For differentiable JJ, the gradient J(θ)\nabla J(\boldsymbol\theta) points in the direction of steepest increase. Moving in the opposite direction — gradient descent — is the locally optimal first-order strategy for decreasing the loss.

This chapter derives gradient descent from the Taylor expansion, proves convergence under smoothness and convexity, and extends the basic algorithm to stochastic variants (SGD), momentum, and Adam. The condition number of the Hessian — developed in Eigenvalues & Eigenvectors — governs how difficult the optimization landscape is for first-order methods.

Series context. This opens Chapter 2 (Calculus & Optimization) in Volume I. It connects to Linear Regression in Volume II and Backpropagation in Volume II, Part III.

Gradient Descent Playground

Loss: $f(x, y) = x^2 + 4y^2 + 0.5\sin(3x)\cos(3y)$

Steps: 0

Click anywhere on the surface to set the starting point, then press Run.


First-Order Taylor Expansion

Definition 1. A function J:RdRJ: \mathbb{R}^d \to \mathbb{R} is differentiable at θ\boldsymbol\theta if there exists J(θ)Rd\nabla J(\boldsymbol\theta) \in \mathbb{R}^d such that

J(θ+δ)=J(θ)+J(θ)Tδ+o(δ).(1)J(\boldsymbol\theta + \boldsymbol\delta) = J(\boldsymbol\theta) + \nabla J(\boldsymbol\theta)^T \boldsymbol\delta + o(\|\boldsymbol\delta\|). \tag{1}

The first-order Taylor approximation (linearization) is:

J(θ+δ)J(θ)+J(θ)Tδ.(2)J(\boldsymbol\theta + \boldsymbol\delta) \approx J(\boldsymbol\theta) + \nabla J(\boldsymbol\theta)^T \boldsymbol\delta. \tag{2}

This approximation is accurate for small δ\|\boldsymbol\delta\| and captures the local linear behavior of JJ.

Multivariate chain rule preview. When JJ depends on parameters through a computational graph, J\nabla J is computed via backpropagation (Chapter 8). Here we treat J\nabla J as given.


The Steepest Descent Direction

Problem. Find δ\boldsymbol\delta^* with δ=ϵ\|\boldsymbol\delta\| = \epsilon that minimizes the linear approximation:

δ=argminδ=ϵ[J(θ)+J(θ)Tδ].(3)\boldsymbol\delta^* = \arg\min_{\|\boldsymbol\delta\| = \epsilon} \left[J(\boldsymbol\theta) + \nabla J(\boldsymbol\theta)^T \boldsymbol\delta\right]. \tag{3}

Since J(θ)J(\boldsymbol\theta) is constant in δ\boldsymbol\delta, this minimizes JTδ\nabla J^T \boldsymbol\delta.

Theorem 1 (Steepest Descent Direction). The unit vector minimizing JTδ\nabla J^T \boldsymbol\delta is

δ=ϵJ(θ)J(θ).(4)\boldsymbol\delta^* = -\epsilon \frac{\nabla J(\boldsymbol\theta)}{\|\nabla J(\boldsymbol\theta)\|}. \tag{4}

Proof. By the Cauchy–Schwarz inequality:

JTδJδ=ϵJ,(5)\nabla J^T \boldsymbol\delta \geq -\|\nabla J\| \cdot \|\boldsymbol\delta\| = -\epsilon \|\nabla J\|, \tag{5}

with equality when δ=ϵJ/J\boldsymbol\delta = -\epsilon \nabla J / \|\nabla J\|. \blacksquare

Important equation. Equation (4) proves that the negative gradient is the direction of steepest descent — the geometric foundation of all first-order optimization.


The Gradient Descent Update Rule

Rescaling the step size, define the learning rate α>0\alpha > 0 and the gradient descent update:

θt+1=θtαJ(θt).(6)\boxed{\boldsymbol\theta_{t+1} = \boldsymbol\theta_t - \alpha \nabla J(\boldsymbol\theta_t).} \tag{6}

At each iteration:

  1. Compute the gradient gt=J(θt)\mathbf{g}_t = \nabla J(\boldsymbol\theta_t).
  2. Update parameters in the negative gradient direction: θt+1=θtαgt\boldsymbol\theta_{t+1} = \boldsymbol\theta_t - \alpha \mathbf{g}_t.
  3. Repeat until a stopping criterion is met (e.g., gt<ϵ\|\mathbf{g}_t\| < \epsilon or fixed iteration budget).

Visual description. Imagine standing on a hilly surface (the loss landscape). The gradient points uphill along the steepest slope. Taking a step downhill (opposite to the gradient) decreases elevation locally. Repeating this process traces a path toward a valley (local minimum), though the path may zigzag in narrow ravines.


Smoothness and the Sufficient Decrease Lemma

Definition 2 (LL-Smoothness). JJ has LL-Lipschitz continuous gradients (is LL-smooth) if

J(θ1)J(θ2)Lθ1θ2,θ1,θ2.(7)\|\nabla J(\boldsymbol\theta_1) - \nabla J(\boldsymbol\theta_2)\| \leq L \|\boldsymbol\theta_1 - \boldsymbol\theta_2\|, \quad \forall \boldsymbol\theta_1, \boldsymbol\theta_2. \tag{7}

Lemma 1 (Quadratic Upper Bound). If JJ is LL-smooth, then for all θ,δ\boldsymbol\theta, \boldsymbol\delta:

J(θ+δ)J(θ)+J(θ)Tδ+L2δ2.(8)J(\boldsymbol\theta + \boldsymbol\delta) \leq J(\boldsymbol\theta) + \nabla J(\boldsymbol\theta)^T \boldsymbol\delta + \frac{L}{2}\|\boldsymbol\delta\|^2. \tag{8}

Proof. Integrate the gradient along the line from θ\boldsymbol\theta to θ+δ\boldsymbol\theta + \boldsymbol\delta and bound using (7). \blacksquare

Theorem 2 (Sufficient Decrease). Under LL-smoothness, gradient descent with step size α\alpha satisfies

J(θt+1)J(θt)α(1Lα2)J(θt)2.(9)J(\boldsymbol\theta_{t+1}) \leq J(\boldsymbol\theta_t) - \alpha\left(1 - \frac{L\alpha}{2}\right)\|\nabla J(\boldsymbol\theta_t)\|^2. \tag{9}

Proof. Apply (8) with δ=αJ(θt)\boldsymbol\delta = -\alpha \nabla J(\boldsymbol\theta_t):

J(θt+1)J(θt)αJ(θt)2+Lα22J(θt)2=J(θt)α(1Lα2)J(θt)2.(10)J(\boldsymbol\theta_{t+1}) \leq J(\boldsymbol\theta_t) - \alpha\|\nabla J(\boldsymbol\theta_t)\|^2 + \frac{L\alpha^2}{2}\|\nabla J(\boldsymbol\theta_t)\|^2 = J(\boldsymbol\theta_t) - \alpha\left(1 - \frac{L\alpha}{2}\right)\|\nabla J(\boldsymbol\theta_t)\|^2. \quad \blacksquare \tag{10}

Descent condition. The factor (1Lα/2)>0(1 - L\alpha/2) > 0 requires α<2/L\alpha < 2/L.

Optimal fixed step size. Maximizing the guaranteed decrease per step:

ddα[αLα22]=0    α=1L.(11)\frac{d}{d\alpha}\left[\alpha - \frac{L\alpha^2}{2}\right] = 0 \implies \alpha^* = \frac{1}{L}. \tag{11}

Substituting into (9):

J(θt+1)J(θt)12LJ(θt)2.(12)J(\boldsymbol\theta_{t+1}) \leq J(\boldsymbol\theta_t) - \frac{1}{2L}\|\nabla J(\boldsymbol\theta_t)\|^2. \tag{12}

Important equation. Equation (12) guarantees progress proportional to the squared gradient norm. When J0\|\nabla J\| \to 0, progress slows — characteristic of convergence to a stationary point.


Convergence for Convex Functions

Definition 3 (Convexity). JJ is convex if for all θ,ϕ\boldsymbol\theta, \boldsymbol\phi and λ[0,1]\lambda \in [0,1]:

J(λθ+(1λ)ϕ)λJ(θ)+(1λ)J(ϕ).(13)J(\lambda\boldsymbol\theta + (1-\lambda)\boldsymbol\phi) \leq \lambda J(\boldsymbol\theta) + (1-\lambda)J(\boldsymbol\phi). \tag{13}

Equivalently (first-order condition): J(ϕ)J(θ)+J(θ)T(ϕθ)J(\boldsymbol\phi) \geq J(\boldsymbol\theta) + \nabla J(\boldsymbol\theta)^T(\boldsymbol\phi - \boldsymbol\theta).

Theorem 3 (O(1/T)O(1/T) Convergence). If JJ is convex and LL-smooth, gradient descent with α=1/L\alpha = 1/L satisfies

J(θT)J(θ)Lθ0θ22T,(14)J(\boldsymbol\theta_T) - J(\boldsymbol\theta^*) \leq \frac{L\|\boldsymbol\theta_0 - \boldsymbol\theta^*\|^2}{2T}, \tag{14}

where θargminJ\boldsymbol\theta^* \in \arg\min J.

Proof sketch. Define the Lyapunov function Δt=θtθ2\Delta_t = \|\boldsymbol\theta_t - \boldsymbol\theta^*\|^2. Using convexity and smoothness:

Δt+1=θtαJ(θt)θ2Δt2αL(J(θt)J(θ)).(15)\Delta_{t+1} = \|\boldsymbol\theta_t - \alpha\nabla J(\boldsymbol\theta_t) - \boldsymbol\theta^*\|^2 \leq \Delta_t - \frac{2\alpha}{L}(J(\boldsymbol\theta_t) - J(\boldsymbol\theta^*)). \tag{15}

Telescoping over t=0,,T1t = 0, \ldots, T-1 and using ΔT0\Delta_T \geq 0 gives (14). \blacksquare

Interpretation. Halving the optimality gap requires doubling the iteration count — sublinear convergence.


Strong Convexity and Linear Convergence

Definition 4 (Strong Convexity). JJ is μ\mu-strongly convex if

J(ϕ)J(θ)+J(θ)T(ϕθ)+μ2ϕθ2.(16)J(\boldsymbol\phi) \geq J(\boldsymbol\theta) + \nabla J(\boldsymbol\theta)^T(\boldsymbol\phi - \boldsymbol\theta) + \frac{\mu}{2}\|\boldsymbol\phi - \boldsymbol\theta\|^2. \tag{16}

Equivalently, 2J(θ)μI\nabla^2 J(\boldsymbol\theta) \succeq \mu \mathbf{I} when twice differentiable.

Theorem 4 (Linear Convergence). If JJ is μ\mu-strongly convex and LL-smooth, gradient descent with α=1/L\alpha = 1/L satisfies

J(θT)J(θ)(1μL)T[J(θ0)J(θ)].(17)J(\boldsymbol\theta_T) - J(\boldsymbol\theta^*) \leq \left(1 - \frac{\mu}{L}\right)^T \left[J(\boldsymbol\theta_0) - J(\boldsymbol\theta^*)\right]. \tag{17}

Proof sketch. Strong convexity gives θt+1θ2(1μ/L)θtθ2\|\boldsymbol\theta_{t+1} - \boldsymbol\theta^*\|^2 \leq (1 - \mu/L)\|\boldsymbol\theta_t - \boldsymbol\theta^*\|^2. Apply to the function value gap via smoothness. \blacksquare

The ratio κ=L/μ\kappa = L/\mu is the condition number. Large κ\kappa means slow convergence — the loss landscape is a long narrow valley. This connects directly to the eigenvalue analysis in Eigenvalues & Eigenvectors.


Stochastic Gradient Descent

For empirical risk J(θ)=1Ni=1NLi(θ)J(\boldsymbol\theta) = \frac{1}{N}\sum_{i=1}^{N} L_i(\boldsymbol\theta), computing J\nabla J requires all NN samples.

Definition 5 (Mini-batch SGD). Given a mini-batch Bt{1,,N}\mathcal{B}_t \subset \{1, \ldots, N\}:

θt+1=θtαt1BtiBtLi(θt).(18)\boldsymbol\theta_{t+1} = \boldsymbol\theta_t - \alpha_t \cdot \frac{1}{|\mathcal{B}_t|}\sum_{i \in \mathcal{B}_t} \nabla L_i(\boldsymbol\theta_t). \tag{18}

Proposition 1 (Unbiasedness). The mini-batch gradient is an unbiased estimator of the full gradient:

EBt[1BtiBtLi(θ)]=J(θ).(19)\mathbb{E}_{\mathcal{B}_t}\left[\frac{1}{|\mathcal{B}_t|}\sum_{i \in \mathcal{B}_t} \nabla L_i(\boldsymbol\theta)\right] = \nabla J(\boldsymbol\theta). \tag{19}

Proposition 2 (Variance). If samples are i.i.d. and batch size is BB,

Var(1BiBLi(θ))=1BVar(Li(θ)).(20)\text{Var}\left(\frac{1}{B}\sum_{i \in \mathcal{B}} \nabla L_i(\boldsymbol\theta)\right) = \frac{1}{B}\text{Var}(\nabla L_i(\boldsymbol\theta)). \tag{20}

Variance decreases linearly with batch size, trading compute for gradient stability.

Convergence requirement. For SGD to converge, the learning rate must satisfy tαt=\sum_t \alpha_t = \infty and tαt2<\sum_t \alpha_t^2 < \infty (Robbins–Monro conditions), typically αt=O(1/t)\alpha_t = O(1/t).


Momentum and Nesterov Acceleration

Problem. In ravines (elongated level sets), gradient descent oscillates across the narrow direction while making slow progress along the valley.

Polyak Momentum. Maintain a velocity vector:

vt=βvt1+J(θt),θt+1=θtαvt,(21)\mathbf{v}_t = \beta \mathbf{v}_{t-1} + \nabla J(\boldsymbol\theta_t), \qquad \boldsymbol\theta_{t+1} = \boldsymbol\theta_t - \alpha \mathbf{v}_t, \tag{21}

where β[0,1)\beta \in [0, 1) (typically β=0.9\beta = 0.9).

Derivation as exponential moving average. Unrolling (21):

vt=k=0tβtkJ(θk).(22)\mathbf{v}_t = \sum_{k=0}^{t} \beta^{t-k} \nabla J(\boldsymbol\theta_k). \tag{22}

Recent gradients receive weight 1\sim 1; gradients from kk steps ago receive weight βk\sim \beta^k. The effective memory window is 1/(1β)\sim 1/(1-\beta) steps.

Effect. Consistent gradient directions accumulate (acceleration along the valley); oscillating directions partially cancel (damping across the ravine).

Nesterov Accelerated Gradient (NAG). Look ahead before computing the gradient:

vt=βvt1+J(θtβvt1),θt+1=θtαvt.(23)\mathbf{v}_t = \beta \mathbf{v}_{t-1} + \nabla J(\boldsymbol\theta_t - \beta \mathbf{v}_{t-1}), \qquad \boldsymbol\theta_{t+1} = \boldsymbol\theta_t - \alpha \mathbf{v}_t. \tag{23}

For convex LL-smooth functions, NAG achieves O(1/T2)O(1/T^2) convergence — optimal among first-order methods.


Adam: Adaptive Moment Estimation

Adam (Kingma & Ba, 2015) combines momentum with per-parameter adaptive learning rates.

Step 1 — Gradient:

gt=J(θt).(24)\mathbf{g}_t = \nabla J(\boldsymbol\theta_t). \tag{24}

Step 2 — First moment (momentum):

mt=β1mt1+(1β1)gt.(25)\mathbf{m}_t = \beta_1 \mathbf{m}_{t-1} + (1 - \beta_1)\mathbf{g}_t. \tag{25}

Step 3 — Second moment (squared gradient EMA):

vt=β2vt1+(1β2)gt2,(26)\mathbf{v}_t = \beta_2 \mathbf{v}_{t-1} + (1 - \beta_2)\mathbf{g}_t^2, \tag{26}

where gt2\mathbf{g}_t^2 denotes element-wise squaring.

Step 4 — Bias correction. Since m0=v0=0\mathbf{m}_0 = \mathbf{v}_0 = \mathbf{0}, early estimates are biased toward zero:

m^t=mt1β1t,v^t=vt1β2t.(27)\hat{\mathbf{m}}_t = \frac{\mathbf{m}_t}{1 - \beta_1^t}, \qquad \hat{\mathbf{v}}_t = \frac{\mathbf{v}_t}{1 - \beta_2^t}. \tag{27}

Derivation of bias correction. Taking expectations (assuming stationary E[gt]=g\mathbb{E}[\mathbf{g}_t] = \mathbf{g}):

E[mt]=(1β1)gi=0t1β1i=(1β1t)g.(28)\mathbb{E}[\mathbf{m}_t] = (1-\beta_1)\mathbf{g}\sum_{i=0}^{t-1}\beta_1^i = (1-\beta_1^t)\mathbf{g}. \tag{28}

Dividing by (1β1t)(1-\beta_1^t) yields an unbiased first-moment estimate.

Step 5 — Parameter update:

θt+1=θtαv^t+ϵm^t.(29)\boldsymbol\theta_{t+1} = \boldsymbol\theta_t - \frac{\alpha}{\sqrt{\hat{\mathbf{v}}_t} + \epsilon} \odot \hat{\mathbf{m}}_t. \tag{29}

Interpretation. The denominator v^tE[g2]1/2\sqrt{\hat{\mathbf{v}}_t} \approx \mathbb{E}[|\mathbf{g}|^2]^{1/2} per parameter. Dividing by it normalizes step sizes — parameters with large historical gradients receive smaller steps. This is diagonal preconditioning that adapts to local curvature estimates.

Default hyperparameters: β1=0.9\beta_1 = 0.9, β2=0.999\beta_2 = 0.999, ϵ108\epsilon \approx 10^{-8}, α=103\alpha = 10^{-3}.


Learning Rate Schedules

Fixed learning rates may be too large near convergence (oscillation) or too small early (slow progress). Schedules modulate αt\alpha_t over training.

Step decay:

αt=α0γt/T0,(30)\alpha_t = \alpha_0 \cdot \gamma^{\lfloor t / T_0 \rfloor}, \tag{30}

where γ(0,1)\gamma \in (0,1) and T0T_0 is the period.

Cosine annealing:

αt=αmin+12(αmaxαmin)(1+cos(tTπ)).(31)\alpha_t = \alpha_{\min} + \frac{1}{2}(\alpha_{\max} - \alpha_{\min})\left(1 + \cos\left(\frac{t}{T}\pi\right)\right). \tag{31}

Warmup. Linear increase from 0 to αmax\alpha_{\max} over the first TwT_w steps:

αt=αmaxmin(1,tTw).(32)\alpha_t = \alpha_{\max} \cdot \min\left(1, \frac{t}{T_w}\right). \tag{32}

Warmup stabilizes early training for large models where initial gradients may be large and Adam's bias correction is active.

Visual description. Learning rate schedules modulate step size over time: warmup gently ramps up to avoid early instability; step decay or cosine annealing gradually shrink steps for fine-grained convergence near the minimum.


Connection to the Eigenbasis

For quadratic J(θ)=12θTHθJ(\boldsymbol\theta) = \frac{1}{2}\boldsymbol\theta^T \mathbf{H}\boldsymbol\theta with H0\mathbf{H} \succ 0, write H=QΛQT\mathbf{H} = \mathbf{Q}\boldsymbol{\Lambda}\mathbf{Q}^T. In coordinates yt=QTθt\mathbf{y}_t = \mathbf{Q}^T \boldsymbol\theta_t:

yt+1,i=(1αλi)yt,i.(33)y_{t+1,i} = (1 - \alpha\lambda_i) y_{t,i}. \tag{33}

Each eigen-direction decouples with contraction rate 1αλi|1 - \alpha\lambda_i|.

Optimal step size: α=2/(λmin+λmax)\alpha^* = 2/(\lambda_{\min} + \lambda_{\max}).

Convergence rate:

ρ=κ1κ+1,κ=λmaxλmin.(34)\rho = \frac{\kappa - 1}{\kappa + 1}, \quad \kappa = \frac{\lambda_{\max}}{\lambda_{\min}}. \tag{34}

Adam and other adaptive methods attempt to reduce effective κ\kappa by per-coordinate scaling — approximating Newton's method, which uses the full Hessian H1\mathbf{H}^{-1} for optimal preconditioning.


Common Pitfalls and Misconceptions

Pitfall 1: Using α>2/L\alpha > 2/L. The sufficient decrease lemma fails; gradient descent may diverge.

Pitfall 2: Expecting global convergence for non-convex JJ. GD converges to stationary points (J=0\nabla J = \mathbf{0}), which may be saddles or local maxima, not global minima.

Pitfall 3: Ignoring batch size effects in SGD. Small batches add noise (regularization benefit) but require smaller learning rates or warmup.

Pitfall 4: Treating Adam as always superior to SGD. For some tasks (especially with careful tuning), SGD with momentum matches or exceeds Adam. Adam's adaptive rates can generalize differently.

Pitfall 5: Confusing learning rate with momentum. Momentum (β\beta) controls velocity accumulation; learning rate (α\alpha) controls step magnitude. Both affect convergence but serve different roles.


Research Perspective

Gradient descent dates to Cauchy (1847) and was systematized in convex optimization by Nesterov (1983), who proved the optimal O(1/T2)O(1/T^2) rate for accelerated methods. Stochastic approximation (Robbins & Monro, 1951) laid foundations for SGD.

In deep learning, SGD with momentum dominated until Adam (2015) became the default for transformer pretraining. Recent research revisits SGD with careful learning rate schedules (large-batch training, warmup-decay) and questions whether adaptive methods' generalization properties match their optimization speed.

Gradient flow (continuous-time limit α0\alpha \to 0) connects to neural tangent kernel theory and Bayesian inference — developed in the RBC Borealis series on machine learning from multiple viewpoints. Second-order methods (natural gradient, K-FAC) use curvature information beyond diagonal Adam approximations.


Summary of Takeaways

  • Steepest descentδ=ϵJ/ —J —\boldsymbol\delta^* = -\epsilon \nabla J / \ — \nabla J\ — — Negative gradient is optimal direction
  • GD updateθt+1=θtαJ\boldsymbol\theta_{t+1} = \boldsymbol\theta_t - \alpha \nabla J — Basic optimization step
  • Descent conditionα<2/L\alpha < 2/L — Step size bound for smooth JJ
  • Optimal fixed rateα=1/L\alpha^* = 1/L — Maximizes guaranteed decrease
  • Convex rateO(1/T)O(1/T) — Sublinear convergence
  • Strongly convex rate(1μ/L)T(1 - \mu/L)^T — Linear convergence, κ=L/μ\kappa = L/\mu
  • SGD — Unbiased mini-batch gradient — Scalable to large data
  • Momentum — EMA of past gradients — Ravine acceleration
  • Adam — Per-parameter adaptive rates — Diagonal preconditioning

Next article: Bayes' Theorem — Chapter 3: probability foundations for statistical learning.


Exercises

Exercise 1. Prove Lemma 1 (quadratic upper bound) from LL-smoothness by integrating J(θ+tδ)Tδ\nabla J(\boldsymbol\theta + t\boldsymbol\delta)^T \boldsymbol\delta from t=0t=0 to t=1t=1.

Exercise 2. For J(θ)=12θTHθJ(\boldsymbol\theta) = \frac{1}{2}\boldsymbol\theta^T \mathbf{H}\boldsymbol\theta with H=diag(1,100)\mathbf{H} = \text{diag}(1, 100), find the optimal learning rate and the convergence rate per iteration.

Exercise 3. Derive equation (28) for the bias in Adam's first moment estimate.

Exercise 4 (SGD). Show that with batch size B=1B=1 and learning rate αt=c/t\alpha_t = c/\sqrt{t}, the Robbins–Monro conditions for convergence are satisfied.

Exercise 5 (NAG). Explain intuitively why evaluating the gradient at θtβvt1\boldsymbol\theta_t - \beta\mathbf{v}_{t-1} (look-ahead) improves over standard momentum in ravines.

Exercise 6 (Convexity). Prove that J(θ)=Aθb2J(\boldsymbol\theta) = \|\mathbf{A}\boldsymbol\theta - \mathbf{b}\|^2 is convex and compute its gradient and Hessian. When is it strongly convex?

Exercise 7 (Conceptual). Compare the per-iteration cost and convergence rate of gradient descent with exact line search versus fixed α=1/L\alpha = 1/L for a quadratic objective.