One idea, 4 fields

Gradient Descent Optimization

The unifying principle

Let a state be a vector xRnx \in \mathbb{R}^n and a scalar objective f(x)f(x) we want to minimize. The gradient

f(x)=(fx1,,fxn)\nabla f(x) = \left(\frac{\partial f}{\partial x_1}, \dots, \frac{\partial f}{\partial x_n}\right)

points in the direction of steepest ascent. By first-order Taylor expansion,

f(x+δ)f(x)+f(x)δ.f(x + \delta) \approx f(x) + \nabla f(x)^\top \delta.

To decrease ff maximally for a fixed step size δ\|\delta\|, Cauchy–Schwarz says choose δf(x)\delta \parallel -\nabla f(x). This gives the update

xt+1=xtηf(xt)\boxed{x_{t+1} = x_t - \eta\, \nabla f(x_t)}

with learning rate / step size η>0\eta > 0. A minimum is a fixed point where f(x)=0\nabla f(x^\star) = 0 and the Hessian 2f(x)0\nabla^2 f(x^\star) \succeq 0 (positive semidefinite). Convergence is guaranteed for convex ff with LL-Lipschitz gradient when η1/L\eta \le 1/L. That's the whole engine—everything below is the same equation with ff renamed.

How it shows up in each field

Maths — the pure optimization problem

Here ff is any differentiable objective and descent is a numerical root-finder for f=0\nabla f = 0. Notation is the canonical one above. Continuous-time it becomes the gradient flow ODE: x˙(t)=f(x(t)),ddtf(x(t))=f20,\dot{x}(t) = -\nabla f(x(t)), \qquad \frac{d}{dt}f(x(t)) = -\|\nabla f\|^2 \le 0, so ff is a Lyapunov function—it only ever decreases. Example: minimize f(x)=12xAxbxf(x) = \tfrac{1}{2}x^\top A x - b^\top x (convex, A0A \succ 0). Then f=Axb\nabla f = Ax - b, and descent iteratively solves the linear system Ax=bAx = b.

AI-ML — minimizing loss over parameters

xx becomes model weights θ\theta, and ff is the empirical loss L(θ)=1Ni(yi,hθ(xi))\mathcal{L}(\theta) = \frac{1}{N}\sum_i \ell(y_i, h_\theta(x_i)). Because NN is huge, we estimate the gradient on a minibatch (stochastic gradient descent): θt+1=θtηθLbatch(θt).\theta_{t+1} = \theta_t - \eta \,\nabla_\theta \mathcal{L}_{\text{batch}}(\theta_t). Same idea: the landscape is non-convex, so we settle into some good local basin. Backpropagation is just the chain rule computing θ\nabla_\theta. Example: logistic regression with =[ylogp+(1y)log(1p)]\ell = -[y\log p + (1-y)\log(1-p)], p=σ(θx)p = \sigma(\theta^\top x), gives the clean update θθη(py)x\theta \leftarrow \theta - \eta (p - y)x.

Physics — energy minimization / relaxation to equilibrium

ff is potential energy U(x)U(x); the force is F=U(x)F = -\nabla U(x). Overdamped (friction-dominated) motion is literally gradient flow: γx˙=U(x).\gamma\,\dot{x} = -\nabla U(x). A system relaxes to the state of least energy exactly as descent finds a minimum; stable equilibria are the minima. Adding noise gives Langevin dynamics x˙=U+2Tξ\dot{x} = -\nabla U + \sqrt{2T}\,\xi, the physical analog of stochastic descent—and the thermal cousin of momentum/SGD noise. Example: a spring, U(x)=12kx2U(x) = \tfrac{1}{2}kx^2, U=kx-\nabla U = -kx; the mass slides to x=0x^\star = 0, the potential's minimum.

Stock-Market — portfolio optimization

xx becomes portfolio weights ww (fractions per asset). Markowitz mean–variance minimizes risk penalized against return: f(w)=12wΣwλμw,iwi=1,f(w) = \tfrac{1}{2}\,w^\top \Sigma\, w - \lambda\, \mu^\top w, \qquad \sum_i w_i = 1, with covariance Σ\Sigma, expected returns μ\mu, risk-aversion λ\lambda. Projected gradient descent: wt+1=Π{1w=1} ⁣(wtη(Σwtλμ)).w_{t+1} = \Pi_{\{\mathbf{1}^\top w = 1\}}\!\left(w_t - \eta(\Sigma w_t - \lambda\mu)\right). The "steepest slope" is now steepest reduction in risk-adjusted loss; equilibrium is the efficient-frontier allocation. Example: two anticorrelated assets—descent naturally diversifies, pushing weight into the pair that lowers wΣww^\top\Sigma w, the quadratic risk bowl.

Why this bridge matters

  • Intuition transfer (Physics → ML): thinking of loss as energy explains why momentum helps—it's inertia rolling a ball past shallow ridges: vt+1=βvtηfv_{t+1} = \beta v_t - \eta\nabla f, xt+1=xt+vt+1x_{t+1}=x_t+v_{t+1}. Simulated annealing and Langevin sampling come straight from thermodynamics.
  • Convexity transfer (Maths → Finance): the Markowitz quadratic is convex, so math guarantees a unique global optimum—no bad local minima, unlike deep nets.
  • Landscape transfer (ML → Physics): non-convex loss surfaces, saddle points, and "wide vs sharp minima" import directly into understanding glassy energy landscapes.
  • Shared failure modes: vanishing gradients (flat regions), ill-conditioning (large Hessian eigenvalue ratio → zig-zagging), and step-size instability (η>2/L\eta > 2/L diverges) are the same pathology whether you're training a net, relaxing a crystal, or rebalancing a book.

The unifying takeaway: an objective + a gradient = a dynamical system that flows to equilibrium. Learn it once, wield it four ways.

Connections

#bridge

f = objective

f = loss

f = potential energy

f = portfolio risk

convexity guarantees

momentum / annealing

non-convex landscapes

Steepest Descent
x ← x − η∇f

Maths
minimize f(x), ∇f=0

AI-ML
minimize loss L(θ)

Physics
minimize energy U(x)

Stock-Market
minimize risk wᵀΣw

Connected notes