← 🧠 Machine Learning

∇ Hypergradient Lab

Train loss:
Val loss:
Hypergradient dL/dλ:
w* = ()
FPS:
Drag — rotate · Scroll — zoom

∇ Gradient-Based Optimization Mathematics for Hyperparameters

A live bilevel optimization scene: an inner training loss landscape reshaped by a regularization hyperparameter λ, a gradient-descent ball settling at the analytic minimizer w*(λ), and a hypergradient computed via the implicit function theorem to update λ itself.

🔬 What It Demonstrates

The purple bowl is the training loss for weights w given λ. Because w*(λ) has a closed form, differentiating its stationarity condition yields dw*/dλ exactly — the core trick behind implicit-differentiation hypergradients, avoiding unrolling the whole inner optimization.

🎮 How to Use

Drag λ to reshape the bowl and watch the ball re-descend. Take a hypergradient step to run one real outer-loop update of λ using dL_val/dλ, exactly as gradient-based hyperparameter optimization does in practice.

💡 Did You Know?

Full unrolled backpropagation through an inner optimizer needs memory proportional to the number of inner steps; implicit differentiation instead solves one linear system at the optimum, which is why it scales to hyperparameter tuning of deep networks.