Gradient Flow

Volume II, Chapter 8 — Part II. The continuous-time limit of gradient descent: derivation of gradient flow ODEs, closed-form solutions for linear models, trainability analysis via eigenvalues of the Gram matrix, parameter evolution, and the connection to the Neural Tangent Kernel.

Intermediate

Table of Contents

  1. Learning Objectives
  2. Prerequisites
  3. Notation
  4. Core Intuition
  5. The Linear Regression Model
  6. From Gradient Descent to Gradient Flow
  7. Gradient Flow for Least Squares Loss
  8. Evolution of the Residual
  9. Closed-Form Solution for Function Evolution
  10. Trainability and Convergence Analysis
  11. Evolution of Parameters
  12. Comparison to the Closed-Form OLS Solution
  13. Evolution of Model Predictions
  14. Distribution Over Predictions
  15. Common Pitfalls and Misconceptions
  16. Research Perspective
  17. Summary of Takeaways
  18. Exercises

Learning Objectives

After completing this chapter, you should be able to:

  1. Derive gradient flow as the continuous-time limit (α0\alpha \to 0) of gradient descent.
  2. Write the gradient flow ODE for least squares loss.
  3. Derive the ODE governing the evolution of the residual vector.
  4. Solve the residual ODE via matrix exponential and interpret the solution.
  5. Characterize trainability and convergence speed from the eigenvalues of XTX\mathbf{X}^T\mathbf{X}.
  6. Derive the closed-form parameter evolution and verify agreement with the OLS solution at tt \to \infty.
  7. Compute the evolution of predictions at new test points.
  8. Describe how a Gaussian prior over initial parameters induces a distribution over predictions.
  9. Explain the connection to the Neural Tangent Kernel.

Prerequisites


Notation

  • ϕRD\boldsymbol\phi \in \mathbb{R}^D — model parameters
  • xiRD\mathbf{x}_i \in \mathbb{R}^D — input vector (augmented with 1 for bias)
  • XRD×I\mathbf{X} \in \mathbb{R}^{D \times I} — data matrix (columns are inputs)
  • yRI\mathbf{y} \in \mathbb{R}^I — target vector
  • f[x,ϕ]=xTϕf[\mathbf{x}, \boldsymbol\phi] = \mathbf{x}^T \boldsymbol\phi — linear model
  • f[X,ϕ]=XTϕRI\mathbf{f}[\mathbf{X}, \boldsymbol\phi] = \mathbf{X}^T \boldsymbol\phi \in \mathbb{R}^I — predictions at all training points
  • L[ϕ]L[\boldsymbol\phi] — loss function
  • α\alpha — learning rate (step size)
  • tt — continuous time variable
  • ϕt\boldsymbol\phi_t — parameters at time tt
  • ϕ0\boldsymbol\phi_0 — initial parameters
  • A+\mathbf{A}^+ — Moore–Penrose pseudoinverse of A\mathbf{A}

Core Intuition

Gradient descent updates parameters in discrete steps of size α\alpha. Gradient flow is what happens when we make the step size infinitesimally small: the discrete update becomes an ordinary differential equation (ODE). For the linear model, this ODE has an exact closed-form solution.

Why is this useful? Because the closed-form solution lets us:

  • Determine whether training will converge (trainability).
  • Compute how fast convergence happens (convergence speed).
  • Track the exact trajectory of parameters and predictions over time.
  • Understand which directions in function space are learned first.

This analysis provides the conceptual foundation for the Neural Tangent Kernel (NTK), which extends these ideas to neural networks.

Series context. This is the first part of a series on gradient-based training dynamics. Part II extends to neural networks and derives the NTK. Part III considers the Bayesian counterpart (see Bayesian Linear Regression).

Gradient Flow

Healthy
L1L2L3L4L5L6L7L8L9L10|∂L/∂W| at each layer8.0e-14.5e-13.6e-12.0e-11.6e-19.0e-27.2e-24.0e-23.2e-21.8e-2Layer 1 (input side)Layer 10 (output)
|W|
0.80
ReLU
1
ReLU slider: 0 = Sigmoid, 1 = ReLUVanishingHealthy
Explore: Small weights → gradients shrink exponentially (vanishing). Large weights → gradients explode. ReLU avoids sigmoid's saturation in the zero region.

The Linear Regression Model

A linear model computes a scalar output:

f[x,ϕ]=xTϕ,(1)f[\mathbf{x}, \boldsymbol\phi] = \mathbf{x}^T \boldsymbol\phi, \tag{1}

where xRD\mathbf{x} \in \mathbb{R}^D is the (augmented) input and ϕRD\boldsymbol\phi \in \mathbb{R}^D are the parameters. For an affine model, we set x[1,xT]T\mathbf{x} \leftarrow [1, \mathbf{x}^T]^T so the first component of ϕ\boldsymbol\phi acts as the bias.

Given II training pairs {xi,yi}i=1I\lbrace \mathbf{x}_i, y_i \rbrace_{i=1}^I, we minimize the least squares loss:

ϕ^=argminϕL[ϕ]=argminϕ12i=1I(xiTϕyi)2.(2)\hat{\boldsymbol\phi} = \arg\min_{\boldsymbol\phi} L[\boldsymbol\phi] = \arg\min_{\boldsymbol\phi} \frac{1}{2} \sum_{i=1}^{I} \bigl( \mathbf{x}_i^T \boldsymbol\phi - y_i \bigr)^2. \tag{2}

In matrix form, collecting all inputs as columns of XRD×I\mathbf{X} \in \mathbb{R}^{D \times I} and targets into yRI\mathbf{y} \in \mathbb{R}^I:

ϕ^=argminϕ12(XTϕy)T(XTϕy).(3)\hat{\boldsymbol\phi} = \arg\min_{\boldsymbol\phi} \frac{1}{2} \bigl( \mathbf{X}^T \boldsymbol\phi - \mathbf{y} \bigr)^T \bigl( \mathbf{X}^T \boldsymbol\phi - \mathbf{y} \bigr). \tag{3}

Geometric picture. The loss landscape is a paraboloid in RD\mathbb{R}^D. Isocontours are ellipsoids whose axes align with the eigenvectors of XXT\mathbf{X}\mathbf{X}^T.


From Gradient Descent to Gradient Flow

Discrete gradient descent applies the update:

ϕt+1=ϕtαLϕ.(4)\boldsymbol\phi_{t+1} = \boldsymbol\phi_t - \alpha \frac{\partial L}{\partial \boldsymbol\phi}. \tag{4}

Rearranging:

ϕt+1ϕtα=Lϕ.(5)\frac{\boldsymbol\phi_{t+1} - \boldsymbol\phi_t}{\alpha} = -\frac{\partial L}{\partial \boldsymbol\phi}. \tag{5}

Taking the limit α0\alpha \to 0 transforms the left side into a time derivative:

dϕdt=Lϕ.(6)\boxed{\frac{d\boldsymbol\phi}{dt} = -\frac{\partial L}{\partial \boldsymbol\phi}.} \tag{6}

Definition (Gradient Flow). Equation (6) is called gradient flow. It is an autonomous ODE describing the continuous-time evolution of parameters under infinitesimal learning rate.

Key properties:

  • The loss is monotonically non-increasing along the trajectory: dLdt=(Lϕ)Tdϕdt=L20\frac{dL}{dt} = \left(\frac{\partial L}{\partial \boldsymbol\phi}\right)^T \frac{d\boldsymbol\phi}{dt} = -\lVert \nabla L \rVert^2 \leq 0.
  • For convex LL, the trajectory converges to the global minimum.
  • For the linear model, the ODE is linear in ϕ\boldsymbol\phi and thus exactly solvable.

Gradient Flow for Least Squares Loss

Expanding the right-hand side of (6) for the quadratic loss:

dϕdt=ϕ[12(f[X,ϕ]y)T(f[X,ϕ]y)].(7a)\frac{d\boldsymbol\phi}{dt} = -\frac{\partial}{\partial \boldsymbol\phi} \left[ \frac{1}{2} \bigl( \mathbf{f}[\mathbf{X}, \boldsymbol\phi] - \mathbf{y} \bigr)^T \bigl( \mathbf{f}[\mathbf{X}, \boldsymbol\phi] - \mathbf{y} \bigr) \right]. \tag{7a}

Applying the chain rule to the quadratic form:

dϕdt=f[X,ϕ]ϕT(f[X,ϕ]y).(7b)\frac{d\boldsymbol\phi}{dt} = -\frac{\partial \mathbf{f}[\mathbf{X}, \boldsymbol\phi]}{\partial \boldsymbol\phi}^T \bigl( \mathbf{f}[\mathbf{X}, \boldsymbol\phi] - \mathbf{y} \bigr). \tag{7b}

For the linear model, f[X,ϕ]=XTϕ\mathbf{f}[\mathbf{X}, \boldsymbol\phi] = \mathbf{X}^T \boldsymbol\phi and fϕ=XT\frac{\partial \mathbf{f}}{\partial \boldsymbol\phi} = \mathbf{X}^T, so:

dϕdt=X(XTϕy)=XXTϕ+Xy.(7c)\frac{d\boldsymbol\phi}{dt} = -\mathbf{X} \bigl( \mathbf{X}^T \boldsymbol\phi - \mathbf{y} \bigr) = -\mathbf{X}\mathbf{X}^T \boldsymbol\phi + \mathbf{X}\mathbf{y}. \tag{7c}

This is a linear ODE with constant coefficients (since XXT\mathbf{X}\mathbf{X}^T does not depend on ϕ\boldsymbol\phi).


Evolution of the Residual

Define the residual vector r(t)=f[X,ϕt]y\mathbf{r}(t) = \mathbf{f}[\mathbf{X}, \boldsymbol\phi_t] - \mathbf{y}. We seek an ODE for r(t)\mathbf{r}(t).

Since y\mathbf{y} is constant:

drdt=dfdt=fϕdϕdt.(8a)\frac{d\mathbf{r}}{dt} = \frac{d\mathbf{f}}{dt} = \frac{\partial \mathbf{f}}{\partial \boldsymbol\phi} \cdot \frac{d\boldsymbol\phi}{dt}. \tag{8a}

Substituting (7b):

drdt=fϕfϕTr.(8b)\frac{d\mathbf{r}}{dt} = -\frac{\partial \mathbf{f}}{\partial \boldsymbol\phi} \cdot \frac{\partial \mathbf{f}}{\partial \boldsymbol\phi}^T \cdot \mathbf{r}. \tag{8b}

Definition (Tangent Kernel). The matrix K=fϕfϕTRI×I\mathbf{K} = \frac{\partial \mathbf{f}}{\partial \boldsymbol\phi} \cdot \frac{\partial \mathbf{f}}{\partial \boldsymbol\phi}^T \in \mathbb{R}^{I \times I} is the tangent kernel (or empirical NTK for neural networks). For the linear model:

K=XTXRI×I.(8c)\mathbf{K} = \mathbf{X}^T \mathbf{X} \in \mathbb{R}^{I \times I}. \tag{8c}

The residual ODE is therefore:

drdt=Kr.(8d)\boxed{\frac{d\mathbf{r}}{dt} = -\mathbf{K} \cdot \mathbf{r}.} \tag{8d}

This is a matrix exponential decay equation.


Closed-Form Solution for Function Evolution

When K\mathbf{K} is constant (which holds exactly for the linear model, since fϕ=XT\frac{\partial \mathbf{f}}{\partial \boldsymbol\phi} = \mathbf{X}^T is independent of ϕ\boldsymbol\phi), equation (8d) has the solution:

r(t)=exp[Kt]r(0).(9)\mathbf{r}(t) = \exp\bigl[-\mathbf{K} \cdot t\bigr] \, \mathbf{r}(0). \tag{9}

Substituting back r(t)=f[X,ϕt]y\mathbf{r}(t) = \mathbf{f}[\mathbf{X}, \boldsymbol\phi_t] - \mathbf{y} and r(0)=XTϕ0y\mathbf{r}(0) = \mathbf{X}^T\boldsymbol\phi_0 - \mathbf{y}:

f[X,ϕt]=y+exp[XTXt](XTϕ0y).(10)\boxed{\mathbf{f}[\mathbf{X}, \boldsymbol\phi_t] = \mathbf{y} + \exp\bigl[-\mathbf{X}^T\mathbf{X} \cdot t\bigr] \bigl( \mathbf{X}^T\boldsymbol\phi_0 - \mathbf{y} \bigr).} \tag{10}

Verification. At t=0t = 0: f=y+(XTϕ0y)=XTϕ0\mathbf{f} = \mathbf{y} + (\mathbf{X}^T\boldsymbol\phi_0 - \mathbf{y}) = \mathbf{X}^T\boldsymbol\phi_0. Correct.

Interpretation. The model predictions start at their initial values XTϕ0\mathbf{X}^T\boldsymbol\phi_0 and exponentially decay toward the targets y\mathbf{y}. The rate of decay is governed by the eigenvalues of K=XTX\mathbf{K} = \mathbf{X}^T\mathbf{X}.


Trainability and Convergence Analysis

Spectral decomposition. Let K=XTX=j=1IλjujujT\mathbf{K} = \mathbf{X}^T\mathbf{X} = \sum_{j=1}^I \lambda_j \mathbf{u}_j \mathbf{u}_j^T where λ1λ2λI0\lambda_1 \geq \lambda_2 \geq \cdots \geq \lambda_I \geq 0. Then:

exp[Kt]=j=1IeλjtujujT.(11)\exp[-\mathbf{K} t] = \sum_{j=1}^I e^{-\lambda_j t} \, \mathbf{u}_j \mathbf{u}_j^T. \tag{11}

Theorem 1 (Trainability). The linear model can fit the training data exactly (i.e., r(t)0\mathbf{r}(t) \to \mathbf{0} as tt \to \infty) if and only if K=XTX\mathbf{K} = \mathbf{X}^T\mathbf{X} is full rank.

Proof. The residual at time tt is r(t)=jeλjt(ujTr(0))uj\mathbf{r}(t) = \sum_j e^{-\lambda_j t} (\mathbf{u}_j^T \mathbf{r}(0)) \mathbf{u}_j. Each component decays as eλjte^{-\lambda_j t}. If λj>0\lambda_j > 0 for all jj, every component decays to zero. If λj=0\lambda_j = 0 for some jj, the corresponding component ujTr(0)\mathbf{u}_j^T \mathbf{r}(0) remains unchanged. \blacksquare

Corollary. The matrix XRD×I\mathbf{X} \in \mathbb{R}^{D \times I} has rank(X)min(D,I)\text{rank}(\mathbf{X}) \leq \min(D, I). The kernel KRI×I\mathbf{K} \in \mathbb{R}^{I \times I} is full rank when IDI \leq D (more parameters than data). In the overparameterized regime, the model can interpolate training data.

Theorem 2 (Convergence Speed). The convergence rate is dominated by the smallest nonzero eigenvalue λmin\lambda_{\min} of K\mathbf{K}:

r(t)eλmintr(0).(12)\lVert \mathbf{r}(t) \rVert \leq e^{-\lambda_{\min} t} \lVert \mathbf{r}(0) \rVert. \tag{12}

The direction associated with λmax\lambda_{\max} converges fastest; the direction associated with λmin\lambda_{\min} converges slowest.

Implication. The condition number κ=λmax/λmin\kappa = \lambda_{\max} / \lambda_{\min} of K\mathbf{K} determines how "anisotropic" convergence is. High condition number means some directions converge much faster than others — the loss drops quickly along principal axes but slowly along the minor axis. This motivates preconditioning and adaptive methods (see Gradient Descent).


Evolution of Parameters

We can also derive a closed-form for how the parameters themselves evolve. Start from the Taylor linearization (exact for linear models):

f[X,ϕt]=f[X,ϕ0]+fϕ(ϕtϕ0)=XTϕ0+XT(ϕtϕ0).(13)\mathbf{f}[\mathbf{X}, \boldsymbol\phi_t] = \mathbf{f}[\mathbf{X}, \boldsymbol\phi_0] + \frac{\partial \mathbf{f}}{\partial \boldsymbol\phi} (\boldsymbol\phi_t - \boldsymbol\phi_0) = \mathbf{X}^T\boldsymbol\phi_0 + \mathbf{X}^T(\boldsymbol\phi_t - \boldsymbol\phi_0). \tag{13}

Equating with (10) and solving for ϕt\boldsymbol\phi_t:

XT(ϕtϕ0)=(Iexp[XTXt])(XTϕ0y).(14)\mathbf{X}^T(\boldsymbol\phi_t - \boldsymbol\phi_0) = -\bigl(\mathbf{I} - \exp[-\mathbf{X}^T\mathbf{X} \cdot t]\bigr)(\mathbf{X}^T\boldsymbol\phi_0 - \mathbf{y}). \tag{14}

Applying the pseudoinverse (XT)+(\mathbf{X}^T)^+ to both sides:

ϕt=ϕ0(XXT)1X(Iexp[XTXt])(XTϕ0y).(15)\boxed{\boldsymbol\phi_t = \boldsymbol\phi_0 - (\mathbf{X}\mathbf{X}^T)^{-1}\mathbf{X}\bigl(\mathbf{I} - \exp[-\mathbf{X}^T\mathbf{X} \cdot t]\bigr)(\mathbf{X}^T\boldsymbol\phi_0 - \mathbf{y}).} \tag{15}

This gives the exact parameter trajectory from initialization ϕ0\boldsymbol\phi_0 as a function of continuous time tt.


Comparison to the Closed-Form OLS Solution

Recall from Linear Regression that the OLS solution is:

ϕ^OLS=(XXT)1Xy.(16)\hat{\boldsymbol\phi}_{\text{OLS}} = (\mathbf{X}\mathbf{X}^T)^{-1}\mathbf{X}\mathbf{y}. \tag{16}

Proposition (Asymptotic Agreement). As tt \to \infty, the gradient flow solution (15) converges to the OLS solution (16).

Proof. Rearranging (15):

ϕt=(XXT)1Xy+(XXT)1Xexp[XTXt](XTϕ0y).(17)\boldsymbol\phi_t = (\mathbf{X}\mathbf{X}^T)^{-1}\mathbf{X}\mathbf{y} + (\mathbf{X}\mathbf{X}^T)^{-1}\mathbf{X} \exp[-\mathbf{X}^T\mathbf{X} \cdot t] (\mathbf{X}^T\boldsymbol\phi_0 - \mathbf{y}). \tag{17}

The first term is ϕ^OLS\hat{\boldsymbol\phi}_{\text{OLS}}. In the second term, Xexp[XTXt]0\mathbf{X}\exp[-\mathbf{X}^T\mathbf{X} \cdot t] \to \mathbf{0} as tt \to \infty because any component in the null space of XTX\mathbf{X}^T\mathbf{X} is annihilated by the left-multiplication by X\mathbf{X}. Therefore ϕ=ϕ^OLS\boldsymbol\phi_\infty = \hat{\boldsymbol\phi}_{\text{OLS}}. \blacksquare

Remark. In the underdetermined case (I<DI < D), there are infinitely many solutions with zero training loss. Gradient flow converges to the minimum-norm solution ϕ=X(XTX)1y\boldsymbol\phi_\infty = \mathbf{X}(\mathbf{X}^T\mathbf{X})^{-1}\mathbf{y}, which is the solution closest to the initialization ϕ0\boldsymbol\phi_0 in the Euclidean sense. This implicit regularization is a key insight for understanding neural networks.


Evolution of Model Predictions

For a new test point x\mathbf{x}^*, the prediction at time tt is yt=xTϕty^*_t = \mathbf{x}^{*T}\boldsymbol\phi_t. Substituting (15):

yt=xTϕ0xT(XXT)1X(Iexp[XTXt])(XTϕ0y).(18)y^*_t = \mathbf{x}^{*T}\boldsymbol\phi_0 - \mathbf{x}^{*T}(\mathbf{X}\mathbf{X}^T)^{-1}\mathbf{X}\bigl(\mathbf{I} - \exp[-\mathbf{X}^T\mathbf{X} \cdot t]\bigr)(\mathbf{X}^T\boldsymbol\phi_0 - \mathbf{y}). \tag{18}

As tt \to \infty:

y^=xT(XXT)1Xy.(19)\hat{y}^* = \mathbf{x}^{*T}(\mathbf{X}\mathbf{X}^T)^{-1}\mathbf{X}\mathbf{y}. \tag{19}

Observation. The final prediction (19) depends on the training data only through Xy\mathbf{X}\mathbf{y} (a sufficient statistic for the linear model). The prediction can be written as y^=k(x)TK1y\hat{y}^* = \mathbf{k}(\mathbf{x}^*)^T \mathbf{K}^{-1} \mathbf{y} where k(x)=XTx\mathbf{k}(\mathbf{x}^*) = \mathbf{X}^T\mathbf{x}^*. This has the same form as a kernel regression prediction — foreshadowing the NTK.


Distribution Over Predictions

Setup. Define a Gaussian prior over initial parameters:

ϕ0N(0,σp2I).(20)\boldsymbol\phi_0 \sim \mathcal{N}(\mathbf{0}, \sigma_p^2 \mathbf{I}). \tag{20}

Since yty^*_t is an affine function of ϕ0\boldsymbol\phi_0 (equation 18), and affine transformations of Gaussians are Gaussian (see Multivariate Gaussian), we can compute:

yt=a(t)+b(t)Tϕ0(21)y^*_t = a(t) + \mathbf{b}(t)^T \boldsymbol\phi_0 \tag{21}

where a(t)a(t) is a scalar offset (from the y\mathbf{y} terms) and b(t)\mathbf{b}(t) is a vector depending on x,X,t\mathbf{x}^*, \mathbf{X}, t.

Result. The prediction follows:

ytN(a(t),σp2b(t)2).(22)y^*_t \sim \mathcal{N}\bigl(a(t), \, \sigma_p^2 \lVert \mathbf{b}(t) \rVert^2 \bigr). \tag{22}

Interpretation:

  • At t=0t = 0: high variance (we haven't learned anything yet), mean prediction is zero.
  • As tt increases: variance decreases as the model commits to fitting training data; mean approaches the OLS prediction.
  • Adding observation noise σ2\sigma^2 to the predictive variance accounts for irreducible noise.

This gives a training-time-dependent uncertainty quantification — the model becomes more certain as training progresses.


Common Pitfalls and Misconceptions

Pitfall 1: Gradient flow \neq gradient descent. Gradient flow is the α0\alpha \to 0 limit. With finite learning rate, trajectories can diverge, oscillate, or take different paths (especially near saddle points). Results here hold approximately for small α\alpha.

Pitfall 2: The kernel K\mathbf{K} is constant only for linear models. For neural networks, fϕ\frac{\partial \mathbf{f}}{\partial \boldsymbol\phi} changes as ϕ\boldsymbol\phi evolves. The NTK theory shows that in the infinite-width limit, this change vanishes and the kernel becomes approximately constant — but this is an asymptotic result, not exact.

Pitfall 3: Confusing XTX\mathbf{X}^T\mathbf{X} with XXT\mathbf{X}\mathbf{X}^T. The kernel governing function-space evolution is K=XTXRI×I\mathbf{K} = \mathbf{X}^T\mathbf{X} \in \mathbb{R}^{I \times I} (Gram matrix). The matrix governing parameter-space dynamics is XXTRD×D\mathbf{X}\mathbf{X}^T \in \mathbb{R}^{D \times D}. Their nonzero eigenvalues are the same, but dimensions differ.

Pitfall 4: Minimum-norm is not always desirable. Gradient flow finds the minimum-norm interpolant in the underdetermined case. For neural networks, this implicit bias can help generalization (flat minima), but can also overfit depending on the parameterization.


Research Perspective

Historical context. The ODE perspective on optimization dates to Cauchy (1847). Its application to neural network training was formalized by the Neural Tangent Kernel (Jacot et al., 2018), which showed that sufficiently wide networks behave like linear models in their tangent-space linearization. The gradient flow framework provides the mathematical scaffolding for NTK theory.

Modern relevance:

  • NTK theory uses exactly the framework developed here, replacing the linear model with a first-order Taylor expansion of a neural network around its initialization.
  • Lazy training regime refers to networks where parameters stay close to initialization and the tangent kernel remains approximately constant — the regime where gradient flow analysis is accurate.
  • Feature learning in finite-width networks departs from the NTK regime precisely because K\mathbf{K} evolves during training.
  • Implicit regularization of gradient descent (converging to minimum-norm solutions) is studied extensively through the gradient flow lens.
  • Scaling laws can be partially understood through the spectral structure of the tangent kernel — eigenvalues determine which "features" are learned at what rate.

Connection to subsequent parts:

  • Part II replaces the linear model with a neural network → NTK derivation.
  • Part III: Bayesian approach → posterior over parameters → Bayesian Linear Regression.
  • Part IV: Function-space view → Gaussian Processes.

Summary of Takeaways

  • Gradient flow is gradient descent with infinitesimal step size: dϕ/dt=Ld\boldsymbol\phi/dt = -\nabla L.
  • Residual evolution follows dr/dt=Krd\mathbf{r}/dt = -\mathbf{K}\mathbf{r} where K=XTX\mathbf{K} = \mathbf{X}^T\mathbf{X} is the tangent kernel.
  • Closed-form solution: f(t)=y+exp[Kt](f(0)y)\mathbf{f}(t) = \mathbf{y} + \exp[-\mathbf{K}t](\mathbf{f}(0) - \mathbf{y}).
  • Trainability requires K\mathbf{K} full rank (more parameters than data).
  • Convergence speed is governed by λmin(K)\lambda_{\min}(\mathbf{K}).
  • Parameter evolution converges to OLS as tt \to \infty; in the underdetermined case, to the minimum-norm solution.
  • Predictions at test points can be computed in closed form and have kernel regression structure.
  • Gaussian prior over initialization → Gaussian distribution over predictions at every time tt.
  • This is the linear-model prototype of the Neural Tangent Kernel framework.

Exercises

Exercise 1. Verify directly that L[ϕt]L[\boldsymbol\phi_t] is monotonically decreasing under gradient flow by computing dL/dtdL/dt.

Exercise 2. For a 2×22 \times 2 matrix K\mathbf{K} with eigenvalues λ1=4,λ2=1\lambda_1 = 4, \lambda_2 = 1, compute exp[Kt]\exp[-\mathbf{K}t] explicitly and sketch the residual components over time.

Exercise 3. Suppose I=2I = 2 data points in D=3D = 3 dimensions. What is the rank of K=XTX\mathbf{K} = \mathbf{X}^T\mathbf{X}? Can the model fit both points exactly? How many solutions exist?

Exercise 4. Derive the gradient flow ODE for the regularized loss Lλ=12XTϕy2+λ2ϕ2L_\lambda = \frac{1}{2}\lVert \mathbf{X}^T\boldsymbol\phi - \mathbf{y}\rVert^2 + \frac{\lambda}{2}\lVert\boldsymbol\phi\rVert^2. What is the equilibrium (dϕ/dt=0d\boldsymbol\phi/dt = 0)?

Exercise 5. Show that in the underdetermined case (I<DI < D), gradient flow starting from ϕ0=0\boldsymbol\phi_0 = \mathbf{0} converges to ϕ=X(XTX)1y\boldsymbol\phi_\infty = \mathbf{X}(\mathbf{X}^T\mathbf{X})^{-1}\mathbf{y}, which is the minimum-norm interpolant.

Exercise 6. For the kernel K=XTX\mathbf{K} = \mathbf{X}^T\mathbf{X}, express the convergence time TϵT_\epsilon (time to reduce residual below ϵ\epsilon) in terms of λmin(K)\lambda_{\min}(\mathbf{K}) and r(0)\lVert\mathbf{r}(0)\rVert.

Exercise 7. Starting from equation (18), compute the mean and variance of the prediction yty^*_t under the prior ϕ0N(0,σp2I)\boldsymbol\phi_0 \sim \mathcal{N}(\mathbf{0}, \sigma_p^2\mathbf{I}). Express your answer in terms of x,X,y,σp2,t\mathbf{x}^*, \mathbf{X}, \mathbf{y}, \sigma_p^2, t.

Exercise 8. Consider a neural network with one hidden layer: f(x)=wTσ(Vx)f(\mathbf{x}) = \mathbf{w}^T\sigma(\mathbf{V}\mathbf{x}). Write the tangent kernel K\mathbf{K} for this model and explain why it depends on the current parameters ϕ=(w,V)\boldsymbol\phi = (\mathbf{w}, \mathbf{V}). Under what conditions does it become approximately constant?

Exercise 9. Prove that ϕtϕ0\lVert\boldsymbol\phi_t - \boldsymbol\phi_0\rVert is minimized among all solutions with zero training loss when ϕ0=0\boldsymbol\phi_0 = \mathbf{0} and the system is underdetermined.