Kaijing Ma

Paper Notes

Deep Learning

Paper Notes

Ian Goodfellow, Yoshua Bengio, Aaron Courville

MIT Press, 2016 · Chapter 4 Numerical Computation only, printed pp. 78 to 95; official online HTML retrieved October 28, 2026; no explicit web revision identifier

Official complete Chapter 4 HTML

Chapter 4 Numerical Computation: problems, representation and algorithms

This unit covers the complete official Chapter 4 Numerical Computation, printed pages 78 to 95. It includes sections 4.1 to 4.5, subsection 4.3.1, equations 4.1 to 4.27 and Algorithm 4.1. This is a complete chapter reading. It is not a whole book completion record. Cited external papers, numerical software and later optimization chapters were not independently read in this unit.

The chapter connects three questions. Finite precision affects the evaluation of an expression. Conditioning determines sensitivity to input perturbations. Optimization determines how an iterate moves toward a solution. Stable evaluation does not remove intrinsic sensitivity. An exact gradient does not certify a global optimum of a nonconvex objective.

Chapter map. The numerical tables, counterexamples, derivations and operation counts below are original analysis. They are not measured experiments from the book.
LayerSource locationQuestion examined
Representation and stability4.1, pp. 78 to 80Equivalent softmax and logarithm expressions can behave differently
Problem sensitivity4.2, p. 80A condition number needs a norm and matrix assumptions
Search and geometry4.3, pp. 80 to 91Direction, step size, curvature and stopping rules
Feasibility and optimality4.4, pp. 91 to 93Constraints, multipliers, regularity and sufficiency
Shared example4.5, pp. 94 to 95Least squares connects gradients, Newton steps and constraints

The chapter uses cost, loss and objective as interchangeable terms. Here f denotes a scalar objective, x an optimization vector, g its current gradient and H its current Hessian. Each local example defines its own variables explicitly.

1 / 20Chapter 4 Numerical Computation only, printed pp. 78 to 95; official online HTML retrieved October 28, 2026; no explicit web revision identifier

Finite precision and the shift invariance of softmax

Section 4.1 starts from finite bit patterns. Real number representation usually introduces rounding, and arithmetic propagates that error. Underflow can turn a small positive value into zero. Overflow can produce infinity. Later expressions such as 0/0, infinity divided by infinity, or infinity minus infinity can produce NaN. Exact thresholds depend on the data type and execution environment.

sᵢ(x)=exp(xᵢ)/Σⱼ₌₁ⁿexp(xⱼ); x∈ℝⁿ, n≥1.

For finite real components, every mathematical softmax probability is positive and the probabilities sum to one. Equal inputs c should give 1/n. Direct evaluation can fail when every exponential underflows or overflows. A common shift factors the same positive scalar from numerator and denominator, so it leaves the exact result unchanged.

sᵢ(x+c1)=sᵢ(x). m=maxⱼxⱼ; zᵢ=xᵢ−m≤0; sᵢ(x)=exp(zᵢ)/Σⱼexp(zⱼ); 1≤Σⱼexp(zⱼ)≤n.

Subtracting the maximum makes at least one exponential equal to one and every other exponential at most one. Exponentiation cannot overflow in this form, and simultaneous underflow cannot make the denominator zero. This reasoning assumes finite real inputs and a representable dimension and sum. It does not define behavior for NaN or an input vector made entirely of negative infinity. Very small numerator probabilities can still round to zero.

Numerical stability describes an evaluation algorithm under finite precision. It is not a property of an algebraic identity alone. The software example in the source provides historical implementation context. It is not evidence of current software availability or a version guarantee.

2 / 20Chapter 4 Numerical Computation only, printed pp. 78 to 95; official online HTML retrieved October 28, 2026; no explicit web revision identifier

Log softmax needs a direct expression in the log domain

LSE(x)=m+lnΣⱼexp(xⱼ−m). log sᵢ(x)=(xᵢ−m)−lnΣⱼexp(xⱼ−m).

Page 79 explains why taking the logarithm after softmax can still fail. A probability that rounds to zero loses its finite logarithm permanently. The direct expression retains the input difference and takes the logarithm of a stable exponential sum. Its final form also avoids adding a large m to the log sum and then subtracting that combined value from x_i.

Original calculation table. Values come from stable expressions, not a book experiment or hardware measurement. The last row omits the correction ln(1+exp(−1000)).
Original example inputStable resultInterpretation
(1000,999,998)s=(0.6652409558,0.2447284711,0.0900305732)The shifted exponents are 0, −1 and −2
(1000,999,998)log s=(−0.4076059644,−1.4076059644,−2.4076059644)Natural logarithms give nats
(−1000,−1000,−1000)s=(1/3,1/3,1/3); log sᵢ=−ln3A common offset leaves the result unchanged
(0,−1000)log s₂≈−1000A direct probability can underflow while its logarithm remains representable
For class k: −log sₖ(x)=lnΣⱼexp(xⱼ−m)−(xₖ−m); ∂[−log sₖ]/∂xᵢ=sᵢ−1{i=k}.

The final identity is an original connection to cross entropy in Chapter 3. A finite expression connects the probabilistic objective with its evaluation. Lost input differences, long reductions and low precision accumulation still introduce error. Shifting does not eliminate every error source.

3 / 20Chapter 4 Numerical Computation only, printed pp. 78 to 95; official online HTML retrieved October 28, 2026; no explicit web revision identifier

Conditioning describes sensitivity and needs more than eigenvalues

Section 4.2 considers y=A⁻¹b for fixed invertible A. Input perturbations can be amplified even when the inverse is applied exactly. Problem conditioning and algorithm stability are distinct. The Euclidean bound below perturbs only b. It does not cover simultaneous perturbations of A, and it assumes nonzero b and y.

κ₂(A)=||A||₂||A⁻¹||₂=σmax(A)/σmin(A). δy=A⁻¹δb; ||δy||₂/||y||₂≤κ₂(A)||δb||₂/||b||₂.
If A is invertible and normal: κ₂(A)=maxᵢ|λᵢ|/minᵢ|λᵢ|. If A=Aᵀ≻0: κ₂(A)=λmax/λmin.

Equation 4.2 states an eigenvalue magnitude ratio under broad eigendecomposition wording. These notes restrict that equality to normal matrices, including real symmetric matrices. Diagonalizability alone is insufficient for the general Euclidean condition number. Nonorthogonal eigenvectors also affect sensitivity. A singular matrix has no ordinary inverse, and this inverse problem has infinite condition number.

Original counterexample and analytic calculation. The trace of BᵀB is 105 and its determinant is 4, so κ₂(B)=(105+√11009)/4.
Original matrix exampleEigenvalue magnitude ratioEuclidean condition number
A=diag(1,0.001)1000κ₂=1000
B=[[1,10],[0,2]], diagonalizable and nonnormal2κ₂≈52.48094547
C=diag(1,0)Denominator 0C is singular; an ordinary inverse is undefined

For A=diag(1,0.001) and b=(1,0), the solution is (1,0). A perturbation δb=(0,10⁻⁶) gives δy=(0,10⁻³). The relative input error 10⁻⁶ becomes a relative solution error 10⁻³. This reaches the factor of 1000 in exact arithmetic.

4 / 20Chapter 4 Numerical Computation only, printed pp. 78 to 95; official online HTML retrieved October 28, 2026; no explicit web revision identifier

The negative gradient is a local descent direction in Euclidean geometry

Original Figure 4.1, p. 81。 The horizontal axis is x. The blue dashed curve is f(x)=x²/2, and the green solid line is its derivative x. They share a vertical scale. The derivative sign gives a descent direction for a sufficiently small step. The figure does not establish descent for every step size. Optimality at zero also uses the structure of this convex quadratic. Ian Goodfellow, Yoshua Bengio and Aaron Courville, MIT Press, 2016, Figure 4.1, p. 81. Official complete chapter. CC BY-NC-ND 4.0. Original graphics, axes and labels are retained. Only surrounding page content is cropped.

Pages 81 to 84 extend derivatives to gradients. For a differentiable scalar objective and a unit direction u, the directional derivative is uᵀg. The Cauchy Schwarz inequality identifies the negative gradient as the direction with the smallest first order change among Euclidean unit directions. This notion of steepest descent depends on the norm and coordinate scaling.

g=∇f(x); Dᵤf(x)=d f(x+αu)/dα|α=0=uᵀg. min||u||₂=1 uᵀg=−||g||₂, u*=−g/||g||₂ when g≠0.
x⁺=x−ε∇f(x), ε>0. f(x−εg)=f(x)−ε||g||₂²+o(ε) as ε→0.

For nonzero g and sufficiently small positive ε, the expansion gives strict descent. It does not guarantee descent for a large step or every finite precision implementation. At g=0, every first order directional change vanishes. First order information cannot distinguish a minimum, maximum or saddle. Discrete hill climbing shares a local improvement idea but does not use this differential structure.

5 / 20Chapter 4 Numerical Computation only, printed pp. 78 to 95; official online HTML retrieved October 28, 2026; no explicit web revision identifier

Direction, step size and stopping answer different questions

Page 84 discusses fixed learning rates, steps obtained from a zero directional derivative, and line searches that compare objective values. The gradient sets a direction. The learning rate sets its length. A stopping rule decides when computation ends. A descent direction can still overshoot a valley. Comparing candidate steps is not the same as globally optimizing the entire line.

f(x)=x²/2 ⇒ xₖ₊₁=(1−ε)xₖ; xₖ=(1−ε)ᵏx₀. Convergence to 0 for every x₀ requires 0<ε<2.
Exact iterates derived independently from the function in Figure 4.1. They are not an extracted figure trajectory or measured speed.
Step ε in the original exampleStarting from x₀=1Behavior
0.51, 0.5, 0.25, 0.125Contraction on one side
11, 0One step reaches this quadratic solution
1.51, −0.5, 0.25, −0.125Alternating contraction
21, −1, 1, −1No convergence from a nonzero initial value
2.51, −1.5, 2.25, −3.375Divergence

A small gradient indicates approximate first order stationarity. It does not by itself show a low objective, proximity to an optimum or good generalization. A flat region far from the optimum can have a small gradient. The least squares example later states the smallest eigenvalue condition needed to convert a gradient tolerance into a distance bound.

6 / 20Chapter 4 Numerical Computation only, printed pp. 78 to 95; official online HTML retrieved October 28, 2026; no explicit web revision identifier

Jacobians, Hessians and directional curvature

Subsection 4.3.1 distinguishes two derivative matrices. A vector function F:ℝᵐ→ℝⁿ has an n by m Jacobian. A scalar objective on ℝⁿ has an n by n Hessian, which is the Jacobian of its gradient. Continuous second partial derivatives permit an exchange of differentiation order. The Hessian of a C² function is therefore real and symmetric. These statements do not directly apply at nonsmooth points.

Jᵢⱼ(F)=∂Fᵢ/∂xⱼ; Hᵢⱼ(f)=∂²f/(∂xᵢ∂xⱼ). f∈C² ⇒ Hᵢⱼ=Hⱼᵢ.
H=QΛQᵀ, QᵀQ=I. ||d||₂=1 ⇒ dᵀHd=Σᵢλᵢ(qᵢᵀd)²; Σᵢ(qᵢᵀd)²=1; λmin≤dᵀHd≤λmax.

The weights are squared direction cosines, not the cosines themselves. They are nonnegative and sum to one. Along a unit eigenvector, directional curvature equals its eigenvalue. This spectral view turns local geometry into numerical scales.

Original Figure 4.4, p. 85。 The three panels show negative, zero and positive curvature. The axes are x and f(x). Green dashed tangents give first order predictions, and blue curves give the quadratic values. Negative curvature adds descent, zero curvature matches the tangent, and positive curvature reduces descent and can reverse a large step. These are geometric sketches rather than speed measurements. Ian Goodfellow, Yoshua Bengio and Aaron Courville, MIT Press, 2016, Figure 4.4, p. 85. Official complete chapter. CC BY-NC-ND 4.0. Original graphics, axes and labels are retained. Only surrounding page content is cropped.
7 / 20Chapter 4 Numerical Computation only, printed pp. 78 to 95; official online HTML retrieved October 28, 2026; no explicit web revision identifier

A Taylor model gives a local scale for the step

s=x−x₀; g=∇f(x₀); H=∇²f(x₀). f(x₀+s)=f(x₀)+gᵀs+½sᵀHs+o(||s||₂²).
s=−εg ⇒ q(ε)=f(x₀)−εgᵀg+½ε²gᵀHg. q′(ε)=−gᵀg+εgᵀHg. If g≠0 and gᵀHg>0: ε*=gᵀg/(gᵀHg).

Equation 4.10 minimizes the local quadratic model along the current negative gradient. For a quadratic objective the model is exact, so this gives an exact line step. For a general objective, curvature changes away from the expansion point. The proposed step need not minimize the true function. If gᵀHg≤0 with nonzero g, the model has no finite minimum along positive ε. The actual objective need not decrease without bound.

An original example uses q(x)=(x₁²+100x₂²)/2 at x=(1,1). Then g=(1,100), H=diag(1,100), gᵀg=10001 and gᵀHg=1000001. The model gives ε*=10001/1000001. This synthetic example has condition number 100. It is distinct from the source figure with condition number 5.

Original analytic example. Decimals are rounded evaluations of exact expressions. At ε=0.02, the high curvature mode lies on its stability boundary and does not contract, even though this particular step slightly lowers the total objective.
εNew point x−εgNew objective q
0(1,1)50.5
0.01(0.99,0)0.49005
10001/1000001(0.9899990100,−0.0000989999)0.4900495100
0.02(0.98,−1)50.4802
0.03(0.97,−2)200.47045
8 / 20Chapter 4 Numerical Computation only, printed pp. 78 to 95; official online HTML retrieved October 28, 2026; no explicit web revision identifier

Stationary point classification needs the spectrum and higher order terms

The second derivative test on pages 86 to 88 applies to an interior unconstrained stationary point of a C² objective. A positive definite Hessian implies a strict local minimum. A negative definite Hessian implies a strict local maximum. Positive and negative eigenvalues imply a saddle. A positive semidefinite Hessian is only a necessary condition for a local minimum. Semidefiniteness at one point proves neither a local minimum nor global convexity.

Original counterexamples. The same zero or semidefinite Hessian can accompany different stationary point types. Higher order terms decide the degenerate directions.
Original function, stationary at the originHessian at the originType
x⁴+y⁴0Strict local minimum
−x⁴−y⁴0Strict local maximum
x⁴−y⁴0Saddle
x²+y⁴diag(2,0)Strict local minimum
x²−y⁴diag(2,0)Saddle
Original Figure 4.5, p. 88。 The original surface is f(x₁,x₂)=x₁²−x₂². Its horizontal axes are x₁ and x₂, and its vertical axis is f. The Hessian diag(2,−2) gives upward curvature along x₁ and downward curvature along x₂. A zero eigenvalue is unnecessary for this saddle. The mesh is a function illustration rather than a measured training loss. Ian Goodfellow, Yoshua Bengio and Aaron Courville, MIT Press, 2016, Figure 4.5, p. 88. Official complete chapter. CC BY-NC-ND 4.0. Original graphics, axes and labels are retained. Only surrounding page content is cropped.
9 / 20Chapter 4 Numerical Computation only, printed pp. 78 to 95; official online HTML retrieved October 28, 2026; no explicit web revision identifier

An ill conditioned positive quadratic restricts gradient descent

Original Figure 4.6, p. 89。 The source contour plot has axes x₁ and x₂. The red line is a gradient descent path. The source specifies Hessian condition number 5, maximum curvature along [1,1]ᵀ and minimum curvature along [1,−1]ᵀ. Repeated valley crossings illustrate the conflict between two curvature scales under one step size. These notes do not infer an exact Hessian, learning rate or iteration count from the image. Ian Goodfellow, Yoshua Bengio and Aaron Courville, MIT Press, 2016, Figure 4.6, p. 89. Official complete chapter. CC BY-NC-ND 4.0. Original graphics, axes and labels are retained. Only surrounding page content is cropped.

For an exact quadratic with positive definite H, the error separates in an orthogonal eigenbasis. Mode i is multiplied by 1−ελᵢ. Every mode contracts when 0<ε<2/λmax. A low curvature mode can still move slowly. This conclusion uses positive eigenvalues. An absolute eigenvalue ratio for an indefinite Hessian does not provide a convex convergence guarantee.

f(x)=½(x−x*)ᵀH(x−x*)+c, H≻0. eₖ₊₁=(I−εH)eₖ; ρ=maxᵢ|1−ελᵢ|. εopt=2/(λmax+λmin); ρopt=(κ−1)/(κ+1).

Here εopt minimizes the worst modal contraction for a fixed step. It differs from the current gradient line step in Equation 4.10. For the original H=diag(1,100), ε=0.01 removes the high curvature mode in one step but multiplies the low curvature error by 0.99 per step. The optimal worst mode fixed step 2/101 gives endpoint multipliers 99/101 and −99/101.

Rescaling or preconditioning changes the geometry seen by an algorithm, but constructing and solving with the preconditioner has a cost. For P≻0 and nonzero g, the direction −P⁻¹g satisfies gᵀ(−P⁻¹g)<0. This is a local descent property. It does not guarantee a successful large step or a global solution for a nonconvex objective.

10 / 20Chapter 4 Numerical Computation only, printed pp. 78 to 95; official online HTML retrieved October 28, 2026; no explicit web revision identifier

Newton solves the stationary equation of a local quadratic model

q(s)=f(x)+gᵀs+½sᵀHs; ∇ₛq=g+Hs. H invertible ⇒ Hs=−g, x⁺=x−H⁻¹g. If H≻0, gᵀs=−gᵀH⁻¹g<0 for g≠0.

The one step conclusion on page 90 applies to an exact quadratic with positive definite H. Its model stationary point is the unique global minimum. An invertible indefinite H still defines a Newton equation, but that equation can locate a saddle of the model. A singular H invalidates the ordinary inverse formula. General nonquadratic convergence also needs local regularity, a suitable starting region and step control. The labels first order and second order alone do not establish global reliability.

An original counterexample uses f(x,y)=x²−y² with H=diag(2,−2). Newton reaches the saddle at the origin in one step from every point. Gradient descent instead multiplies its second component by 1+2ε, except when y starts at zero. This example gives a mechanism for Newton attraction to a saddle. It is not a universal claim about every saddle and initialization.

Original algorithmic analysis, not a book benchmark. Implementations usually solve a linear system rather than form an inverse. A positive definite matrix permits Cholesky factorization. An indefinite matrix does not inherit that factorization guarantee.
Original analytic operation countTime orderStorage and conditions
General dense Newton linear solveFactorization O(n³), solve O(n²) per right hand sideH stores O(n²) entries; derivative construction is excluded
Diagonal Hessian solveO(n)O(n) storage when the structure is truly diagonal
Product Hv with an available dense HO(n²)No explicit H⁻¹ is needed
Repeated objective and gradient callsDepends on function structureDerivative order alone does not determine total time
11 / 20Chapter 4 Numerical Computation only, printed pp. 78 to 95; official online HTML retrieved October 28, 2026; no explicit web revision identifier

Lipschitz continuity, smoothness and convexity give different guarantees

|f(x)−f(y)|≤Lf||x−y||₂. ||∇f(x)−∇f(y)||₂≤Lg||x−y||₂.

Equation 4.13 bounds changes in function values. A Lipschitz gradient bounds changes in the gradient and is a different condition. The function x² is not globally Lipschitz on ℝ, while its gradient 2x is 2-Lipschitz. The function |x| is 1-Lipschitz but is not differentiable at zero. Distinct constants Lf and Lg keep these assumptions separate.

If ∇f is Lg-Lipschitz on the step segment: f(x−εg)≤f(x)−ε(1−Lgε/2)||g||₂².

This original bound follows by integrating the change in the gradient along the step. For 0<ε<2/Lg and nonzero g, its right hand side is strictly below f(x). It controls a step without proving global optimality. Convexity also requires a convex domain. For a C² function on an open convex domain, an everywhere positive semidefinite Hessian characterizes convexity. Semidefiniteness at one point is insufficient.

f convex and differentiable ⇒ f(y)≥f(x)+∇f(x)ᵀ(y−x). ∇f(x*)=0 ⇒ x* is a global minimizer. μI≼H(x)≼LI, μ>0 ⇒ μ-strong convexity and unique minimizer if attained.

Every local minimum of a convex function is global, but a minimum can be nonunique or unattained. Strict convexity gives at most one minimizer. Strong convexity adds a quantitative curvature bound. This overview does not give a guarantee for an arbitrary nonconvex network. The explicit conditions refine the limits of the source discussion.

12 / 20Chapter 4 Numerical Computation only, printed pp. 78 to 95; official online HTML retrieved October 28, 2026; no explicit web revision identifier

Constraints change feasible directions and stopping conditions

Section 4.4 restricts x to a feasible set S. An unconstrained gradient can point outside S, so an optimum on the boundary need not have zero ordinary gradient. Projected gradient first takes a step and then projects. Euclidean projection is single valued for a nonempty closed convex set. A nonconvex set can have several nearest points, and computing a projection can itself be difficult.

x⁺=ΠS(x−ε∇f(x)); ΠS(z)=argminy∈S ||y−z||₂². For S={x:||x||₂≤1}: ΠS(z)=z/max(1,||z||₂).

On a smooth equality constraint manifold, a gradient can be projected into a tangent space. Tangency is only a first order feasibility condition, so a finite step can leave the surface. At an inequality boundary, feasible directions usually form a one sided cone rather than an entire tangent space. A manifold tangent formula does not directly apply to an arbitrary set.

x(θ)=(cosθ,sinθ)ᵀ; F(θ)=f(x(θ)); F′(θ)=∇f(x(θ))ᵀ(−sinθ,cosθ)ᵀ.

The source unit circle parameterization enforces ||x||₂=1 and converts the search to an unconstrained angle. It represents the boundary equality, not the full unit ball. Periodicity and repeated representations remain. The constraint is a modeling choice, while parameterization is one way to enforce it.

13 / 20Chapter 4 Numerical Computation only, printed pp. 78 to 95; official online HTML retrieved October 28, 2026; no explicit web revision identifier

A pointwise Lagrangian penalty differs from strong duality

S={x:gᵢ(x)=0, hⱼ(x)≤0}. L(x,λ,α)=f(x)+Σᵢλᵢgᵢ(x)+Σⱼαⱼhⱼ(x), λ∈ℝᵐ, α≥0.
supλ∈ℝᵐ,α≥0 L(x,λ,α)=f(x)+IS(x); IS(x)=0 if x∈S and +∞ otherwise. infx supλ,α≥0 L = infx∈S f(x).

Page 92 uses min and max notation. These notes use extended real infima and suprema to state the boundary precisely. A nonzero equality permits an unrestricted multiplier with a sign that drives the value upward. A positive inequality permits a nonnegative multiplier that grows without bound. At a feasible point, equality terms vanish and the inequality supremum is attained at zero multipliers. A violated constraint normally gives an unbounded supremum rather than a finite multiplier attaining infinity.

The pointwise identity does not exchange optimization order. The dual function d(λ,α)=infₓL provides lower bounds on the primal minimum. The inequality sup d≤inf sup L is weak duality. Equality is strong duality. Convexity and conditions such as Slater regularity give strong duality for many convex problems. They do not establish a zero duality gap for arbitrary nonconvex objectives.

d(λ,α)=infx L(x,λ,α); supλ,α≥0 d(λ,α)≤infx supλ,α≥0 L(x,λ,α).
14 / 20Chapter 4 Numerical Computation only, printed pp. 78 to 95; official online HTML retrieved October 28, 2026; no explicit web revision identifier

Maximization signs and the four KKT conditions

supx∈S f(x)=−infx supλ,α≥0 [−f(x)+λᵀg(x)+αᵀh(x)] = supx infλ,α≥0 [f(x)+λᵀg(x)−αᵀh(x)].

The maximization form on page 93 follows by negating the objective and renaming unrestricted equality multipliers. It is not an arbitrary exchange of min and max for a fixed Lagrangian. The inequality sign follows the minimization or maximization convention. Equality multipliers can have either sign. Suprema and infima also cover values that are not attained.

∇ₓL(x*,λ*,α*)=0; gᵢ(x*)=0; hⱼ(x*)≤0; αⱼ*≥0; αⱼ*hⱼ(x*)=0 for every j.
Precise decomposition of the KKT overview on page 93. The source shorthand is not treated as an unconditional theorem.
ConditionMeaningMisinterpretation
Stationarity in xObjective and constraint normals balanceThe gradient with respect to every multiplier need not be 0
Primal feasibilityg=0 and h≤0A small gradient does not establish feasibility
Dual feasibilityInequality multipliers α≥0Equality multipliers λ have no sign restriction
Complementary slacknessαⱼhⱼ=0 for each jAn active constraint h=0 need not have α>0

KKT necessity at a local optimum requires a suitable constraint qualification, such as linear independence of the active constraint gradients. When f and each h_j are convex and equalities are affine, a KKT point is a global minimizer. Conditions such as Slater regularity often ensure multiplier existence and strong duality at an optimum. KKT conditions are generally insufficient in nonconvex problems.

15 / 20Chapter 4 Numerical Computation only, printed pp. 78 to 95; official online HTML retrieved October 28, 2026; no explicit web revision identifier

Active constraints, zero multipliers and a regularity counterexample

If h_j(x*)<0, complementary slackness forces α_j*=0. That constraint contributes no local first order force at this point. The converse fails. A zero multiplier can accompany either slackness or a point exactly on the boundary. Removing an inactive constraint preserves a sufficiently small feasible neighborhood but can admit better distant solutions, so it need not preserve global optimality.

Original analytic examples rather than book test cases. The last stationarity equation is 1+α·2x=0, which is impossible at zero. This shows why necessity needs regularity.
Original scalar problemOptimum and multiplierInterpretation
min (x−2)²/2, x≤1x*=1, α*=1A boundary normal balances a nonzero objective gradient
min x²/2, x≤1x*=0, α*=0Inactive inequality
min x²/2, x≤0x*=0, α*=0Active inequality with multiplier 0
min x, x²≤0Only feasible x*=0; no KKT multiplierThe constraint gradient is 0 and regularity fails

A simple nonconvex sufficiency counterexample is the unconstrained minimization of −x². The origin satisfies first order stationarity but is a maximum. Constrained second order analysis also concerns feasible directions. KKT supplies candidate conditions and structural information. Solving multiplier equations alone does not complete every optimization problem.

16 / 20Chapter 4 Numerical Computation only, printed pp. 78 to 95; official online HTML retrieved October 28, 2026; no explicit web revision identifier

Least squares connects gradients, rank and the pseudoinverse

A∈ℝᵐˣⁿ, b∈ℝᵐ; r=Ax−b; f(x)=½||r||₂². df=rᵀA dx ⇒ ∇f=Aᵀ(Ax−b); H=AᵀA≽0.

The differential expansion gives the gradient in section 4.5. The factor 1/2 cancels the derivative of the square. The normal equation Aᵀr=0 says that the residual is orthogonal to the column space of A. It does not require a zero residual. Least squares always has a solution, while exact fitting requires b to lie in the column space.

rank(A)=n ⇒ AᵀA≻0, x*=(AᵀA)⁻¹Aᵀb. General solution: x*=A⁺b+(I−A⁺A)z; min ||x*||₂ attained at A⁺b.

With full column rank, H is invertible and an exact Newton step reaches the unique minimizer from every initial point. With deficient rank, H is singular and the ordinary inverse step is invalid. The pseudoinverse gives a minimum norm solution, while null space directions give other solutions. A pseudoinverse Hessian correction from a general initial point retains its null space component. It does not automatically return the minimum norm solution.

Original small systems. A nonzero residual and nonunique coefficients are different issues. Neither implies the other.
Original systemLeast squares solutionResidual and rank
A=(1,1)ᵀ, b=(1,3)ᵀx*=2r=(1,−1)ᵀ; f=1; full column rank
A=[1,1], b=2(1+t,1−t), t∈ℝ; minimum norm (1,1)r=0; rank 1<2
A=diag(1,10), b=(1,10)ᵀx*=(1,1)H=diag(1,100), κ₂(H)=100
17 / 20Chapter 4 Numerical Computation only, printed pp. 78 to 95; official online HTML retrieved October 28, 2026; no explicit web revision identifier

Gradient tolerances and linear algebra implementations need conditions

Algorithm 4.1 stops when ||AᵀAx−Aᵀb||₂≤δ. With full column rank, g=H(x−x*) for H=AᵀA. Eigenvalues then bound distance and objective error. A small minimum eigenvalue permits a larger parameter error for the same gradient tolerance. A singular H makes the gradient blind to every null space component.

H≻0, μ=λmin(H), L=λmax(H): ||x−x*||₂≤||g||₂/μ; f(x)−f* =½gᵀH⁻¹g≤||g||₂²/(2μ). GD converges if 0<ε<2/L.

For full column rank A, κ₂(AᵀA)=κ₂(A)². This helps explain why explicitly forming normal equations can lose accuracy. A closed form is not a recommendation to compute an inverse. Householder QR or SVD can work directly with A, and SVD exposes numerical rank. These are implementation connections from the notes rather than a measured comparison in the chapter.

Analytic operation counts rather than book experiments, hardware tests or universal speed rankings. The table assumes m≥n and does not silently extend that dimension convention.
Original analytic comparison, dense m≥nOperation and storage orderQualification
Gradient Aᵀ(Ax−b)O(mn) per step; A stores O(mn) entriesNo H is formed; sparsity changes actual work
Explicit AᵀAO(mn²) construction and O(n²) storageLater products cost O(n²); conditioning is squared
Dense H factorization and solveO(n³) factorization and O(n²) per right hand sideDerivative construction is separate; definiteness affects the factorization
Thin Householder QRTypical O(mn²)Stable full rank solve; no timing comparison is claimed
Dense SVDTypical O(mn²), with algorithm dependent constantsSupports rank analysis and a pseudoinverse; a truncation threshold is a numerical choice
18 / 20Chapter 4 Numerical Computation only, printed pp. 78 to 95; official online HTML retrieved October 28, 2026; no explicit web revision identifier

A unit ball constraint adds adjustable curvature to least squares

min||x||₂≤1 ½||Ax−b||₂²; L(x,λ)=½||Ax−b||₂²+λ(xᵀx−1), λ≥0. infx supλ≥0 L = min||x||₂≤1 f(x).

Pages 94 to 95 first test the minimum norm unconstrained solution A⁺b. If its norm is at most one, it is a constrained optimum with λ=0. A rank deficient problem can have other feasible unconstrained minimizers. If even the minimum norm solution is outside the ball, every unconstrained minimizer is infeasible. The ball constraint is active, and this problem has a positive optimal multiplier.

∇ₓL=AᵀAx−Aᵀb+2λx=0 ⇒ (AᵀA+2λI)x=Aᵀb; x(λ)=(AᵀA+2λI)⁻¹Aᵀb if λ>0 or rank(A)=n.
H=V diag(dᵢ)Vᵀ, dᵢ≥0; c=VᵀAᵀb. ||x(λ)||₂²=Σᵢcᵢ²/(dᵢ+2λ)²; d||x(λ)||₂²/dλ=−4Σᵢcᵢ²/(dᵢ+2λ)³≤0, λ>0.

A positive λ makes H+2λI positive definite even when A is rank deficient. The norm decreases strictly if Aᵀb is nonzero. An active solution satisfies ||x(λ)||₂=1, so the monotonic relation supports bracketed root finding. It does not guarantee convergence of multiplier ascent with an arbitrary step. The shift also improves the inner linear system conditioning. Varying λ changes the inner penalized quadratic and its solution. Only a multiplier meeting feasibility and complementarity solves the fixed original constrained problem.

∂L/∂λ=||x||₂²−1. d(λ)=infx L(x,λ); λ⁺=max(0, λ+η[||x(λ)||₂²−1]), η>0.

Equation 4.27 is a partial derivative with x fixed. At an inner minimizer x(λ), it also gives the dual derivative under suitable differentiability conditions. Projection with max(0,·) preserves nonnegativity. An interior primal optimum can have λ=0 and ||x||₂<1. A negative derivative then satisfies the dual boundary condition. A zero derivative is required for the active case with positive λ, not every solution.

19 / 20Chapter 4 Numerical Computation only, printed pp. 78 to 95; official online HTML retrieved October 28, 2026; no explicit web revision identifier

Constrained examples, chapter connections and recall checks

An original scalar example uses A=1 and b=2. The unconstrained solution 2 is outside the unit interval. Its multiplier path is x(λ)=2/(1+2λ). The constrained optimum x=1 has λ=1/2 and objective 1/2. The table separates the primal objective from the constraint residual. Increasing the penalty weight does not necessarily lower the primal objective.

Original exact example. Only λ=1/2 satisfies stationarity, feasibility and complementary slackness for this active solution. Excessive λ yields an interior point but fails the optimal KKT conditions of this primal problem.
λx(λ)x²−1Primal objective (x−2)²/2
0230
1/2101/2
12/3−5/98/9
22/5−21/2532/25

For the original rank deficient example A=[1,1] and b=2, the unconstrained minimum norm solution (1,1) has norm √2. The unit ball is active. Symmetry and Cauchy Schwarz give x=(1/√2,1/√2), residual √2−2, λ=√2−1>0 and objective (2−√2)²/2. The positive shift yields a unique constrained solution despite deficient rank.

Connections are original analysis. Chapters 2 and 3 have separate reading units. These links do not add unexamined sources to the current reading claim.
ConnectionConcrete conclusion from this unitBoundary
Chapter 2 linear algebraSpectra, norms and pseudoinverses explain curvature and rankEigenvalue ratios do not describe general nonnormal conditioning
Chapter 3 probability and information theoryStable log softmax evaluates categorical negative log likelihoodFinite numerical values do not validate a model assumption
Constraints and penaltiesA particular optimal λ connects the ball solution with a quadratic penaltyAn arbitrary fixed penalty is not equivalent to an arbitrary chosen radius
Theory and implementationMathematical invertibility does not imply good conditioningAn exact one step result is not a measured speed guarantee
Original recall checks. They are not answers to book exercises or evidence that the reader has completed them.
Recall questionJudgment to reconstruct
Why can log(softmax) still fail?Numerator underflow destroys information first; a log domain expression retains finite differences
When does an eigenvalue ratio equal κ₂?For an invertible normal matrix; general matrices need singular values
Do g=0 and H≽0 prove a minimum?No; higher order negative terms can decide degenerate directions
Why can Newton approach a saddle?The quadratic model need not be positive definite, so its stationary point need not be a minimum.
Why do all multiplier derivatives not have to equal 0?Inequality multipliers have a boundary, and complementary slackness permits h<0
What does one step least squares Newton require?Full column rank gives an invertible positive Hessian; deficient rank needs a pseudoinverse and null space care
When must a multiplier derivative vanish?In the active positive multiplier case; λ=0 can have a negative derivative

This unit contains no dataset experiment, ablation or training performance result. Numerical tables evaluate small mathematical examples, and costs are analytic orders. All 18 pages and 27 numbered equations were read. Original figures explain the source geometry without creating empirical claims. External references and later chapters remain unread in this unit.

20 / 20Chapter 4 Numerical Computation only, printed pp. 78 to 95; official online HTML retrieved October 28, 2026; no explicit web revision identifier

Original figures and source data come from the cited book chapter. Explanations and derivations are reading notes. Added examples are identified separately. Source versions, pages and figure labels appear beside the material.