Optimization Methods

Last updated: August 2026

Disclaimer: These are my personal notes compiled for my own reference and learning. They may contain errors, incomplete information, or personal interpretations. While I strive for accuracy, these notes are not peer-reviewed and should not be considered authoritative sources. Please consult official textbooks, research papers, or other reliable sources for academic or professional purposes.

1. The optimization problem, and why convexity matters

Machine learning training is, almost without exception, the problem $\min_\theta L(\theta)$ for a loss $L(\theta)=\frac1m\sum_{i=1}^m\ell(f(x_i;\theta),y_i)$. Fermat's theorem (differentiation note, Section 6, and its multivariable generalization in the multivariable calculus note, Section 7) says a differentiable minimizer must be a critical point, $\nabla L(\theta^*)=0$ — necessary, never sufficient. For a general (non-convex) $L$, that is close to all that can be said in general: finding a global minimizer of an arbitrary smooth function is NP-hard, and gradient information alone cannot distinguish a global minimum from a local one, let alone a saddle.

Convexity is the property that closes this gap. Sections 2–7 build, with full proofs, the classical theory of first- and second-order methods on convex objectives: every critical point is a global minimizer, and — with a quantitative smoothness assumption — the rate at which gradient-based methods approach it can be bounded exactly, not just asserted to converge "eventually." Most deep learning objectives are not convex, but the convex theory is not merely a warm-up: it is the exact theory used in enormous swaths of applied optimization (linear/logistic regression, SVMs, LASSO, many control and finance problems), and its proof techniques — the descent lemma, in particular — are reused essentially unchanged in the local, near-a-minimum analysis of non-convex training dynamics.

2. Convex sets and functions: the first-order characterization

Definitions

$C\subseteq\mathbb R^n$ is convex if $x,y\in C,\,t\in[0,1]\Rightarrow tx+(1-t)y\in C$. $f:C\to\mathbb R$ is convex if $f(tx+(1-t)y)\leq tf(x)+(1-t)f(y)$ for all $x,y\in C$, $t\in[0,1]$.

Theorem (First-order characterization)

For $f$ differentiable on a convex open set $C$: $f$ is convex iff $f(y)\geq f(x)+\nabla f(x)\cdot(y-x)$ for all $x,y\in C$ — the tangent plane at any point lies entirely below the graph.

Proof. ($\Rightarrow$) Fix $x,y\in C$ and let $\phi(t)=f(x+t(y-x))$ for $t\in[0,1]$ (restricting to the segment, exactly the reduction used throughout the multivariable calculus note, e.g. its Section 6). Convexity of $f$ along this segment makes $\phi$ convex on $[0,1]$ in the ordinary one-variable sense. For $0<s<t\leq1$, writing $s=\frac st\cdot t+(1-\frac st)\cdot0$ and applying convexity of $\phi$: $\phi(s)\leq\frac st\phi(t)+(1-\frac st)\phi(0)$, which rearranges to $\frac{\phi(s)-\phi(0)}{s}\leq\frac{\phi(t)-\phi(0)}{t}$ — the secant slope from $0$ is non-decreasing. So $\phi'(0)=\lim_{t\to0^+}\frac{\phi(t)-\phi(0)}{t}=\inf_{t\in(0,1]}\frac{\phi(t)-\phi(0)}{t}\leq\phi(1)-\phi(0)$ (taking $t=1$). By the chain rule (multivariable calculus note, Section 3), $\phi'(0)=\nabla f(x)\cdot(y-x)$, and $\phi(1)-\phi(0)=f(y)-f(x)$, giving $\nabla f(x)\cdot(y-x)\leq f(y)-f(x)$. ($\Leftarrow$) Let $z=tx+(1-t)y$. The hypothesis at $z$ gives $f(x)\geq f(z)+\nabla f(z)\cdot(x-z)$ and $f(y)\geq f(z)+\nabla f(z)\cdot(y-z)$. Multiply by $t$ and $1-t$ respectively and add: $tf(x)+(1-t)f(y)\geq f(z)+\nabla f(z)\cdot\big(tx+(1-t)y-z\big)=f(z)$, since $tx+(1-t)y-z=0$ by definition of $z$. This is exactly $f(tx+(1-t)y)\leq tf(x)+(1-t)f(y)$.

An immediate corollary: if $\nabla f(\theta^*)=0$ for convex $f$, the first-order inequality at $x=\theta^*$ reads $f(y)\geq f(\theta^*)$ for every $y$ — a critical point of a convex function is automatically a global minimizer. This is the entire reason convexity matters: Fermat's necessary condition (Section 1) becomes sufficient.

3. $L$-smoothness and the descent lemma

Definition

$f$ is $L$-smooth if $\nabla f$ is $L$-Lipschitz: $\|\nabla f(x)-\nabla f(y)\|\leq L\|x-y\|$ for all $x,y$.

Lemma (Descent lemma)

If $f$ is $L$-smooth, then $f(y)\leq f(x)+\nabla f(x)\cdot(y-x)+\dfrac L2\|y-x\|^2$ for all $x,y$ — a quantitative converse to Section 2's inequality, with a matching quadratic upper bound.

Proof. Let $\phi(t)=f(x+t(y-x))$, $t\in[0,1]$. By the chain rule, $\phi'(t)=\nabla f(x+t(y-x))\cdot(y-x)$, continuous since $\nabla f$ is Lipschitz (hence continuous). By the Fundamental Theorem of Calculus (integration note, Section 5): $f(y)-f(x)=\phi(1)-\phi(0)=\int_0^1\phi'(t)\,dt=\int_0^1\nabla f(x+t(y-x))\cdot(y-x)\,dt$. Subtracting and adding $\nabla f(x)\cdot(y-x)$: $f(y)-f(x)-\nabla f(x)\cdot(y-x)=\int_0^1\big[\nabla f(x+t(y-x))-\nabla f(x)\big]\cdot(y-x)\,dt$. By Cauchy–Schwarz and $L$-Lipschitz continuity of $\nabla f$: $\big|[\cdots]\cdot(y-x)\big|\leq\|\nabla f(x+t(y-x))-\nabla f(x)\|\,\|y-x\|\leq L\,t\|y-x\|\cdot\|y-x\|=Lt\|y-x\|^2$. So the integral is bounded by $\int_0^1Lt\|y-x\|^2\,dt=\frac L2\|y-x\|^2$.

This lemma is the single most-used tool in first-order optimization theory: it turns "the gradient doesn't change too fast" into an explicit, quantitative bound on how much a gradient step can overshoot — exactly what the convergence proofs in Sections 4 and 5 need.

4. Gradient descent: $O(1/T)$ convergence

Lemma (Sufficient decrease)

If $f$ is $L$-smooth and $x_{t+1}=x_t-\frac1L\nabla f(x_t)$, then $f(x_{t+1})\leq f(x_t)-\dfrac1{2L}\|\nabla f(x_t)\|^2$.

Proof. Apply the descent lemma with $y=x_{t+1}$: $f(x_{t+1})\leq f(x_t)+\nabla f(x_t)\cdot(x_{t+1}-x_t)+\frac L2\|x_{t+1}-x_t\|^2=f(x_t)-\frac1L\|\nabla f(x_t)\|^2+\frac L2\cdot\frac1{L^2}\|\nabla f(x_t)\|^2=f(x_t)-\frac1{2L}\|\nabla f(x_t)\|^2$.
Theorem

If $f$ is convex, $L$-smooth, and has a minimizer $x^*$ with $f^*=f(x^*)$, gradient descent $x_{t+1}=x_t-\frac1L\nabla f(x_t)$ satisfies $f(x_T)-f^*\leq\dfrac{L\|x_0-x^*\|^2}{2T}$.

Proof. By Section 2's inequality at $x_t$ targeting $x^*$: $f(x_t)-f^*\leq\nabla f(x_t)\cdot(x_t-x^*)$. Expand the distance recursion: $\|x_{t+1}-x^*\|^2=\|x_t-x^*\|^2-\frac2L\nabla f(x_t)\cdot(x_t-x^*)+\frac1{L^2}\|\nabla f(x_t)\|^2\leq\|x_t-x^*\|^2-\frac2L\big(f(x_t)-f^*\big)+\frac1{L^2}\|\nabla f(x_t)\|^2$. By the sufficient-decrease lemma rearranged, $\|\nabla f(x_t)\|^2\leq2L\big(f(x_t)-f(x_{t+1})\big)$, so $\frac1{L^2}\|\nabla f(x_t)\|^2\leq\frac2L\big(f(x_t)-f(x_{t+1})\big)$. Substituting and simplifying (the $f(x_t)$ terms cancel): $\|x_{t+1}-x^*\|^2\leq\|x_t-x^*\|^2-\frac2L\big(f(x_{t+1})-f^*\big)$, i.e. $\frac2L\big(f(x_{t+1})-f^*\big)\leq\|x_t-x^*\|^2-\|x_{t+1}-x^*\|^2$. Summing over $t=0,\ldots,T-1$ telescopes the right side: $\frac2L\sum_{t=0}^{T-1}\big(f(x_{t+1})-f^*\big)\leq\|x_0-x^*\|^2-\|x_T-x^*\|^2\leq\|x_0-x^*\|^2$. Since the sufficient-decrease lemma makes $f(x_t)$ non-increasing, $f(x_T)-f^*\leq\frac1T\sum_{t=0}^{T-1}\big(f(x_{t+1})-f^*\big)\leq\dfrac{L\|x_0-x^*\|^2}{2T}$.

The rate is $O(1/T)$: to halve the optimality gap, roughly double the number of iterations — sublinear, but a genuine, quantitative, non-asymptotic guarantee, and it holds for every convex $L$-smooth function with no further assumptions. Section 5 shows a stronger hypothesis buys a qualitatively faster rate.

5. Strong convexity and linear convergence

Definition

$f$ is $\mu$-strongly convex if $f(y)\geq f(x)+\nabla f(x)\cdot(y-x)+\dfrac\mu2\|y-x\|^2$ for all $x,y$ — Section 2's inequality strengthened with a quadratic lower bound, the mirror image of the descent lemma's quadratic upper bound.

Lemma (Polyak–Łojasiewicz inequality)

If $f$ is $\mu$-strongly convex with minimizer $x^*$, then $\|\nabla f(x)\|^2\geq2\mu\big(f(x)-f^*\big)$ for every $x$.

Proof. Fix $x$; strong convexity gives $f(y)\geq f(x)+\nabla f(x)\cdot(y-x)+\frac\mu2\|y-x\|^2$ for every $y$. The right side, as a function of $y$, is a quadratic minimized at $y=x-\nabla f(x)/\mu$ (its own critical point, Fermat, Section 1), with minimum value $f(x)-\frac1{2\mu}\|\nabla f(x)\|^2$. Taking $y=x^*$ on the left: $f^*\geq f(x)-\frac1{2\mu}\|\nabla f(x)\|^2$, which rearranges to the claim.
Theorem (Linear convergence)

If $f$ is $\mu$-strongly convex and $L$-smooth, gradient descent with $x_{t+1}=x_t-\frac1L\nabla f(x_t)$ satisfies $f(x_T)-f^*\leq\left(1-\dfrac\mu L\right)^T\big(f(x_0)-f^*\big)$.

Proof. Combine the sufficient-decrease lemma (Section 4) with the PL inequality: $f(x_{t+1})\leq f(x_t)-\frac1{2L}\|\nabla f(x_t)\|^2\leq f(x_t)-\frac1{2L}\cdot2\mu\big(f(x_t)-f^*\big)=f(x_t)-\frac\mu L\big(f(x_t)-f^*\big)$. Subtracting $f^*$ from both sides: $f(x_{t+1})-f^*\leq\left(1-\frac\mu L\right)\big(f(x_t)-f^*\big)$. Iterating from $t=0$ to $T-1$ gives the claim.

The ratio $\kappa=L/\mu\geq1$ is the condition number: the rate $1-\mu/L=1-1/\kappa$ is close to $1$ (slow) when $\kappa$ is large (an elongated, ill-conditioned bowl) and close to $0$ (fast) when $\kappa\approx1$ (a well-conditioned, near-spherical bowl) — exactly the behavior Figure 1 verifies. Going from $O(1/T)$ (Section 4) to geometric decay is the single biggest lever available to first-order methods, and it costs nothing beyond assuming the extra quadratic lower bound.

Left panel: semilog plot of optimality gap versus iteration for gradient descent on strongly convex quadratics with condition numbers 2, 10, and 50, each a straight line with slope depending on the condition number. Right panel: for condition number 10, the actual optimality gap plotted against the proved geometric bound, staying under it at every iteration.
Figure — Strongly convex GD converges geometrically, at the rate the theorem predicts. Left: $f(x_t)-f^\star$ on a log scale is a straight line for every condition number $\kappa=L/\mu$ tested, confirming geometric decay; larger $\kappa$ gives a shallower line (slower convergence), exactly as $1-1/\kappa$ predicts. Right: for $\kappa=10$, the actual trajectory (dots) stays strictly under the proved bound $(1-\mu/L)^t(f(x_0)-f^\star)$ (dashed) at every iteration — a valid upper bound can be loose (here the specific axis-aligned quadratic converges somewhat faster, Section 12 has the numbers), but it may never be violated, and it never is.

6. Newton's method and local quadratic convergence

Update rule

$\theta_{t+1}=\theta_t-H(\theta_t)^{-1}\nabla L(\theta_t)$, where $H=\nabla^2L$ is the Hessian — the second-order Taylor approximation (multivariable calculus note, Section 6) minimized exactly at each step, rather than descended along its gradient alone.

Theorem (Local quadratic convergence)

If $f\in C^2$ near $x^*$ with $\nabla f(x^*)=0$, $H(x^*)$ positive definite, and $H$ is $M$-Lipschitz near $x^*$, then for $x_t$ close enough to $x^*$, $\|x_{t+1}-x^*\|\leq C\|x_t-x^*\|^2$ for a constant $C$ depending on $M$ and $H(x^*)^{-1}$.

Proof (sketch). $x_{t+1}-x^*=x_t-x^*-H(x_t)^{-1}\nabla f(x_t)=H(x_t)^{-1}\big[H(x_t)(x_t-x^*)-\nabla f(x_t)\big]$. Applying the same integral argument as the descent lemma (Section 3), one order higher — using Lipschitz $H$ in place of Lipschitz $\nabla f$ — bounds $\big\|\nabla f(x_t)-\nabla f(x^*)-H(x_t)(x_t-x^*)\big\|\leq\frac M2\|x_t-x^*\|^2$; since $\nabla f(x^*)=0$, this is exactly $\big\|H(x_t)(x_t-x^*)-\nabla f(x_t)\big\|\leq\frac M2\|x_t-x^*\|^2$. As $x_t\to x^*$, $H(x_t)^{-1}\to H(x^*)^{-1}$ (continuity of matrix inversion at a nonsingular matrix), so $\|H(x_t)^{-1}\|$ is bounded by some constant near $x^*$, giving $\|x_{t+1}-x^*\|\leq C\|x_t-x^*\|^2$.

Quadratic convergence roughly doubles the number of correct digits every iteration, dramatically faster than gradient descent's linear rate (Figure 2) — but the theorem is local: it says nothing about $x_0$ far from $x^*$, where Newton steps can badly overshoot (Section 12 has a concrete divergence example) and $H(\theta_t)$ may not even be positive definite. Forming and inverting $H\in\mathbb R^{n\times n}$ costs $O(n^3)$, prohibitive for the $n$ in the millions or billions typical of deep networks — the practical reason first-order methods, not Newton's method, dominate deep learning despite the worse asymptotic rate.

Left panel: log-scale error versus iteration for Newton's method and gradient descent minimizing e^x - x, Newton reaching machine precision in about 6 steps while gradient descent needs about 90. Right panel: log-log plot of consecutive Newton errors following a slope-2 line, confirming quadratic convergence.
Figure — Newton's method (local quadratic) vs. gradient descent (linear), on $f(x)=e^x-x$. Left: starting from the same point, Newton reaches machine precision ($\sim10^{-16}$) in about $6$ iterations; gradient descent needs roughly $90$ to reach comparable accuracy — the qualitative gap between quadratic and linear convergence, not just a constant-factor speedup. Right: plotting $e_{t+1}=|x_{t+1}-x^\star|$ against $e_t=|x_t-x^\star|$ for Newton's iterates lies almost exactly on the slope-$2$ reference line $0.5\,e_t^2$ — a direct empirical confirmation of the quadratic convergence rate proved above, over roughly $12$ orders of magnitude in $e_t$.

7. Stochastic gradient descent

When $L(\theta)=\frac1m\sum_i\ell_i(\theta)$ and $m$ is large, computing $\nabla L$ exactly at every step is expensive; SGD instead uses a cheap unbiased estimate $g_t$ (e.g. the gradient of a single random $\ell_i$, or a mini-batch average).

Theorem (SGD convergence in expectation)

Let $f$ be convex, and suppose $\mathbb E[g_t\mid x_t]=\nabla f(x_t)$ (unbiased) and $\mathbb E[\|g_t\|^2\mid x_t]\leq G^2$ (bounded second moment). With constant step size $\alpha$ and $\bar x_T=\frac1T\sum_{t=0}^{T-1}x_t$: $\mathbb E[f(\bar x_T)]-f^*\leq\dfrac{\|x_0-x^*\|^2}{2\alpha T}+\dfrac{\alpha G^2}2$.

Proof. As in Section 4: $\|x_{t+1}-x^*\|^2=\|x_t-x^*\|^2-2\alpha g_t\cdot(x_t-x^*)+\alpha^2\|g_t\|^2$. Taking $\mathbb E[\cdot\mid x_t]$: unbiasedness turns the middle term's expectation into $-2\alpha\nabla f(x_t)\cdot(x_t-x^*)\leq-2\alpha(f(x_t)-f^*)$ (Section 2's inequality), and the bounded-variance assumption bounds the last term by $\alpha^2G^2$. So $\mathbb E\big[\|x_{t+1}-x^*\|^2\mid x_t\big]\leq\|x_t-x^*\|^2-2\alpha\big(f(x_t)-f^*\big)+\alpha^2G^2$. Taking total expectation, rearranging, and summing over $t=0,\ldots,T-1$ (telescoping): $2\alpha\sum_{t=0}^{T-1}\mathbb E\big[f(x_t)-f^*\big]\leq\|x_0-x^*\|^2-\mathbb E\|x_T-x^*\|^2+T\alpha^2G^2\leq\|x_0-x^*\|^2+T\alpha^2G^2$. By Jensen's inequality (the immediate multi-point generalization, by induction, of the two-point convexity definition in Section 2), $f(\bar x_T)\leq\frac1T\sum_{t=0}^{T-1}f(x_t)$, so $\mathbb E[f(\bar x_T)]-f^*\leq\frac1T\sum_{t=0}^{T-1}\mathbb E[f(x_t)-f^*]\leq\dfrac{\|x_0-x^*\|^2}{2\alpha T}+\dfrac{\alpha G^2}2$.

Optimizing $\alpha\propto1/\sqrt T$ balances the two terms and gives rate $O(1/\sqrt T)$ — slower than full-batch GD's $O(1/T)$ (Section 4), the price paid for using a noisy gradient estimate instead of the exact one. The bound does not require the objective to be smooth (only convex), unlike every result in Sections 4–6; this is one reason SGD-family methods remain the default even where full gradients would be affordable.

8. Momentum and adaptive methods, more briefly

The methods below are standard and heavily used in practice, but their sharpest convergence results (Nesterov's $O(1/T^2)$ acceleration, adaptive-method regret bounds) require substantially more technical machinery than this note's scope; formulas and the qualitative mechanism are recorded here, without full proof.

Momentum

Classical: $v_{t+1}=\beta v_t+\alpha\nabla L(\theta_t)$, $\theta_{t+1}=\theta_t-v_{t+1}$ ($\beta\approx0.9$), accumulating a velocity that damps oscillation across narrow (high-curvature) directions while still accelerating along flat ones. Nesterov's accelerated gradient evaluates the gradient at the extrapolated point $\theta_t-\beta v_t$ instead, and provably achieves the optimal $O(1/T^2)$ rate for convex $L$-smooth objectives (Nesterov, 1983) — quadratically faster than Section 4's $O(1/T)$, and provably the best possible for any method using only gradient evaluations at points determined by past gradients.

Adaptive methods

AdaGrad: $G_t=G_{t-1}+\nabla L(\theta_t)^{\odot2}$, $\theta_{t+1}=\theta_t-\frac\alpha{\sqrt{G_t+\epsilon}}\odot\nabla L(\theta_t)$ — a per-coordinate learning rate that shrinks for frequently-updated coordinates. RMSprop replaces the ever-growing sum $G_t$ with an exponential moving average, preventing the learning rate from decaying to $0$. Adam combines an exponential moving average of the gradient itself (momentum) with one of its squared magnitude (RMSprop-style scaling), plus a bias correction for the first few steps: $m_t=\beta_1m_{t-1}+(1-\beta_1)\nabla L(\theta_t)$, $v_t=\beta_2v_{t-1}+(1-\beta_2)\nabla L(\theta_t)^{\odot2}$, $\theta_{t+1}=\theta_t-\alpha\,\hat m_t/(\sqrt{\hat v_t}+\epsilon)$ with $\hat m_t,\hat v_t$ the bias-corrected moments.

9. Constrained optimization: Lagrangian duality and KKT

The multivariable calculus note (Section 9) proves, for a single equality constraint in two variables, that $\nabla f(a,b)=\lambda\nabla g(a,b)$ at a constrained extremum. The identical proof — reduce to the constraint set via the Implicit Function Theorem, apply Fermat's theorem along it, and match gradients via the chain rule — generalizes verbatim to $n$ variables and multiple constraints, giving the general Lagrangian $\mathcal L(x,\lambda,\mu)=f(x)+\sum_i\lambda_ig_i(x)+\sum_j\mu_jh_j(x)$ for inequality constraints $g_i(x)\leq0$ and equality constraints $h_j(x)=0$.

Karush–Kuhn–Tucker (KKT) conditions, stated without proof

Under a regularity condition on the constraints (e.g. Slater's condition), $x^*$ is optimal iff there exist $\lambda^*\geq0,\mu^*$ with: stationarity $\nabla f(x^*)+\sum_i\lambda_i^*\nabla g_i(x^*)+\sum_j\mu_j^*\nabla h_j(x^*)=0$; primal feasibility $g_i(x^*)\leq0$, $h_j(x^*)=0$; dual feasibility $\lambda_i^*\geq0$; complementary slackness $\lambda_i^*g_i(x^*)=0$.

Complementary slackness is the qualitatively new ingredient beyond the equality-constraint case: it says each inequality constraint is either exactly active ($g_i(x^*)=0$, "binding") with a nonnegative multiplier, or strictly inactive ($g_i(x^*)<0$) with multiplier exactly $0$ — a constraint that isn't currently limiting the solution exerts no force on it, the same intuition as a physical constraint (e.g. a wall) only pushing back when actually touched. (See Boyd & Vandenberghe, 2004, Ch. 5, for the full derivation via Lagrangian duality.)

10. Non-convex optimization and saddle points

Deep learning loss landscapes are not convex, so nothing in Sections 2–7 applies rigorously; $\nabla L(\theta)=0$ only guarantees a critical point (Section 1), and the multivariable calculus note's second-derivative test (Section 7.1) is exactly the tool for telling minima, maxima, and saddles apart once such a point is found — $D<0$ there is precisely a saddle, a direction of decrease sitting right next to a direction of increase. High-dimensional loss landscapes are dominated by saddle points rather than poor local minima (empirically and under random-matrix-theoretic models of the Hessian's eigenvalue spectrum — a positive-definite Hessian at a random critical point becomes exponentially rare as dimension grows), which reframes the practical difficulty of deep learning optimization: escaping saddles efficiently, more than avoiding bad local minima. Plain gradient descent provably converges to a strict saddle only for a measure-zero set of initializations (Lee et al., 2016) but can slow to a crawl near one, since $\|\nabla L\|\to0$ there too — the practical motivation behind the momentum and noise-injection techniques of Section 8.

11. Computation

The figures above are generated by optimization/generate_figures.py. The snippet below reproduces the strongly-convex linear-convergence check (actual value against the proved geometric bound) and the Newton iterates on $f(x)=e^x-x$.

import numpy as np

def gd_on_quadratic(mu, L, x0, n_iters):
    A = np.diag([mu, L])
    alpha = 1.0 / L
    x = np.array(x0, dtype=float)
    vals = []
    for _ in range(n_iters):
        vals.append(0.5 * x @ A @ x)
        x = x - alpha * (A @ x)
    return np.array(vals)

mu, L = 1.0, 10.0
vals = gd_on_quadratic(mu, L, [1.0, 1.0], 6)
bound = (1 - mu / L) ** np.arange(6) * vals[0]
for t in range(6):
    print(f"t={t}  f(x_t)-f*={vals[t]:.6e}  bound={bound[t]:.6e}  holds={vals[t] <= bound[t]}")

f = lambda x: np.exp(x) - x
fp = lambda x: np.exp(x) - 1
fpp = lambda x: np.exp(x)
x = 1.2
print()
for t in range(6):
    print(f"Newton t={t}  x_t={x:.10f}")
    x = x - fp(x) / fpp(x)

Actual output:

t=0  f(x_t)-f*=5.500000e+00  bound=5.500000e+00  holds=True
t=1  f(x_t)-f*=4.050000e-01  bound=4.950000e+00  holds=True
t=2  f(x_t)-f*=3.280500e-01  bound=4.455000e+00  holds=True
t=3  f(x_t)-f*=2.657205e-01  bound=4.009500e+00  holds=True
t=4  f(x_t)-f*=2.152336e-01  bound=3.608550e+00  holds=True
t=5  f(x_t)-f*=1.743392e-01  bound=3.247695e+00  holds=True

Newton t=0  x_t=1.2000000000
Newton t=1  x_t=0.5011942119
Newton t=2  x_t=0.1070009778
Newton t=3  x_t=0.0055257722
Newton t=4  x_t=0.0000152390
Newton t=5  x_t=0.0000000001

The proved geometric bound holds at every single iteration (as it must), while the actual value drops noticeably faster after the first step — this particular quadratic has $x_0$ aligned so that gradient descent with $\alpha=1/L$ exactly zeros out the steepest ($L$-curvature) eigendirection in one step, leaving only the slower $\mu$-direction to govern the remaining, still-geometric decay. Newton's iterate count matches Section 6's figure: from $x_0=1.2$ it reaches $x_5\approx1.5\times10^{-10}$, doubling correct decimal digits almost exactly every step.

12. Common pitfalls

Pitfall — Newton's method has no global convergence guarantee

On the same $f(x)=x-\ln x$ used elsewhere, starting from $x_0=4$ (rather than closer to the minimizer $x^*=1$): the update simplifies exactly to $x_{t+1}=x_t(2-x_t)$, giving $x_1=4(2-4)=-8$ — outside the domain $x>0$ where $\ln x$ is even defined, and the method breaks down immediately. Section 6's quadratic-convergence guarantee is explicitly local; nothing in the theorem bounds behavior far from $x^*$, and in practice Newton's method is often run with a line search or trust region specifically to control this failure mode.

Pitfall — a valid convergence bound can be loose, and that is not a contradiction

Section 11's numbers show the actual optimality gap dropping faster than the proved $(1-\mu/L)^t$ bound at every step. A theorem of the form "$X\leq Y$" is not falsified by observing $X\ll Y$ in a particular instance — it is falsified only by finding $X>Y$. Treating a worst-case bound as a prediction of the typical case is a common misreading of this kind of result.

Pitfall — $\nabla L(\theta)=0$ does not mean $\theta$ is a good solution

Sections 1 and 10: without convexity, a critical point can be a saddle or a poor local minimum. Monitoring $\|\nabla L\|\to0$ during training confirms convergence to a critical point, not to a good one — exactly why validation loss, not training gradient norm, is the metric that actually matters for model quality.

Pitfall — SGD's unbiasedness assumption can silently fail

Section 7's guarantee needs $\mathbb E[g_t\mid x_t]=\nabla f(x_t)$ exactly. Mini-batches drawn without replacement from a shuffled dataset are unbiased only if every example is equally likely to appear in a given batch and batch composition doesn't correlate with $\theta_t$; a subtly non-uniform sampler (e.g. one that oversamples recently-misclassified examples without correcting for it) breaks the hypothesis the proof relies on, and the $O(1/\sqrt T)$ guarantee no longer applies, even though the algorithm still runs and produces numbers.

13. Connections

14. References