Why does the gradient vanish? The gradient ∇f points in the direction of stepest ascent. At a critical point, there's no direction that immediately increases or decreases f—the function is locally "flat." This doesn't tell us whether we're at a maximum, minimum, or saddle; it just says the first-order behavior is zero.
Derivation from first principles:
For f to have a local extremum at x∗, moving slightly in any direction v shouldn't change f to first order:
f(x∗+ϵv)≈f(x∗)+ϵ∇f(x∗)⊤v
For this to be an extremum, the linear term must vanish for allv, which forces ∇f(x∗)=0.
Once we find ∇f(x∗)=0, we examine the second-order behavior via the Hessian matrix.
Why the Hessian? Taylor expansion around x∗ gives:
f(x∗+d)≈f(x∗)+∇f(x∗)⊤d+21d⊤Hd
Since ∇f(x∗)=0, the behavior is governed by the quadratic form d⊤Hd. The sign of this form determines whether f increases or decreases as we move away.
Why eigenvalues? The eigenvalues of H are the curvatures along the principal axes. If all are positive, the function curves upward in every direction (a bowl). If mixed, it curves up in some directions and down in others (a sadle).
Why sadles dominate in high-D:
For a random symmetric matrix (a rough model of H), the probability of all n eigenvalues having the same sign shrinks exponentially with n. In R1000000, the chance of a local minimum is astronomically small; sadles are the norm.
Implication for optimization: Gradient descent can get stuck near saddles where ∥∇f∥≈0 but the point is not a minimum. Algorithms like Adam, SGD with momentum, and sadle-free Newton methods help escape saddles by adding noise or using curvature information.
Imagine you're playing a video game where you're a marble rolling on a bumpy surface, and you want to find the lowest valley. A critical point is anywhere the ground is perfectly flat—you stop rolling because there's no slope. But "flat" doesn't always mean you're at the bottom of a valley! You could be:
At the bottom of a bowl (minimum)—you found a low point, yay!
At the top of a hill (maximum)—you're at a high point, bad if you want low.
On a saddle (like horse sadle)—flat in the middle, but if you roll forward you go down, and if you roll sideways you go up.
To figure out which, you check the curvature—does the ground curve up like a smile (minimum), down like a frown (maximum), or mixed (saddle)? In math, the Hessian matrix tells us the curvature in all directions at once.
Taylor Series: Second-order Taylor expansion motivates the Hessian classification
#flashcards/ai-ml
What is a critical point of a function f? :: A point x∗ where the gradient vanishes: ∇f(x∗)=0. All partial derivatives are zero.
What does the Hessian matrix represent?
The matrix of second partial derivatives Hij=∂xi∂xj∂2f, capturing the curvature of f at a point.
How do you classify a critical point using the Hessian's eigenvalues?
All positive → local minimum; all negative → local maximum; mixed signs → saddle point; some zero → degenerate (need higher derivatives).
Why are saddle points common in high-dimensional neural network optimization?
In high dimensions, the probability that all n eigenvalues have the same sign is exponentially small. Most critical points have mixed-sign eigenvalues, making them sadles.
What is the quadratic form approximation near a critical point?
f(x∗+d)≈f(x∗)+21d⊤Hd, where the gradient term vanishes at x∗.
How can you escape a saddle point in optimization?
Perturb along the eigenvector corresponding to the negative eigenvalue, or rely on noise from stochastic gradients and momentum to naturally escape.
What does a positive definite Hessian indicate?
The critical point is a local minimum—the function curves upward in all directions (all eigenvalues >0).
What does an indefinite Hessian indicate? :: The critical point is a saddle—the function curves upward in some directions and downward in others (mixed-sign eigenvalues).
Critical points aur saddle points kya hain? Jab ap kisi function ka minimum dhundh rahe hain—jaise neural network ki loss—toh apko pehle wo jagah chahiye jahan gradient zero ho jaye, matlab ∇f=0. Ye critical point kehlata hai. Lekin yahan problem hai: zero gradient ka matlab yeh nahi ki apko minimum mil gaya! Aap maximum par bhi ho sakte hain (jaise pahad ki choti), ya saddle point par—jahan ek direction mein surface neeche jata hai aur dusre mein upar (jaise ghode ki seat).
Classification kaise karein? Hessian matrix dekho—ye second derivatives ka matrix hai jo curvature bata hai. Agar Hessian ke sare eigenvalues positive hain, toh aap minimum mein hain (bowl shape). Agar sare negative, toh maximum (inverted bowl). Agar kuch positive aur kuch negative hain, toh sadle point hai. Deep learning mein problem yeh hai ki bohot saare parameters hone ke wajah se (millions!), critical points mein se zyada tar saddles hote hain, minima bahut rare hain.
Optimization mein kya hota hai? Gradient descent sadle points par slow ho jata hai kyunki gradient zero ke pas hota hai. Lekin modern optimizers (Adam, momentum, SGD with noise) sadles se escape kar lete hain—negative eigenvalue wali direction mein naturally perturb ho jate hain. Isliye practice mein saddleszyada problem nahi bante, bas thoda time lagta hai unse nikalne mein.
Real-world analogy: Socho ek hiker andhera mein pahaad par chal raha hai. Jahan zameen bilkul flat lage (zero slope = zero gradient), wahan ruk jata hai. Par flat zameen teen tarah ki ho sakti hai: valley (minimum—good!), hiltop (maximum—bad), ya saddle (ek taraf down, ek taraf up—confusing!). Hessian eigenvalues se aap batate hain kis tarah ki flatness hai, bina as-paas dekhe.