Skip to content

Neural tangent kernel

A neural tangent kernel compares parameter sensitivities across inputs. An exact two-observation update separates the finite kernel from the fixed-kernel training regime.

The neural tangent kernel (NTK) measures how similarly two inputs respond to small changes in a model's parameters. For a quant training a neural network on financial features, it offers a way to study how correcting one observation changes predictions on others—and whether training is behaving much like a fixed kernel method.
For a differentiable model with scalar output fθ(x)f_\theta(x) and parameter vector θ∈RP\theta\in\mathbb{R}^P, its finite NTK is
Kθ(x,x′)=∇θfθ(x)⊤∇θfθ(x′).K_\theta(x,x')=\nabla_\theta f_\theta(x)^\top\nabla_\theta f_\theta(x').
The features here are parameter derivatives, not the raw inputs. Two observations can have a large kernel value because the same parameter changes move their predictions together. This is a local, parameterization-dependent relationship: changing parameter scales can change the NTK even if the model can represent the same functions. The finite kernel generally changes during nonlinear training. This definition and its training interpretation come from Jacot, Gabriel and Hongler, §4.

From weight changes to prediction changes

On nn training observations, collect predictions in fθ\mathbf f_\theta and let the n×Pn\times P Jacobian JθJ_\theta have row ii equal to ∇θfθ(xi)⊤\nabla_\theta f_\theta(x_i)^\top. The training Gram matrix is

Kθ=JθJθ⊤.\mathbf K_\theta=J_\theta J_\theta^\top.
It is positive semidefinite: for any vector c\mathbf c, c⊤Kθc=∥Jθ⊤c∥2≥0\mathbf c^\top\mathbf K_\theta\mathbf c=\lVert J_\theta^\top\mathbf c\rVert^2\ge0. It need not be invertible.
Use the half sum of squared errors, with no division by the sample count:
L(θ)=12∑i=1n(fθ(xi)−yi)2.L(\theta)=\frac12\sum_{i=1}^{n}\bigl(f_\theta(x_i)-y_i\bigr)^2.

Ordinary Euclidean gradient descent gives Δθ=−ηJθ⊤(fθ−y)\Delta\theta=-\eta J_\theta^\top(\mathbf f_\theta-\mathbf y). A first-order expansion then gives

Δf≈−ηKθ(fθ−y).\Delta\mathbf f\approx-\eta\mathbf K_\theta(\mathbf f_\theta-\mathbf y).

For a nonlinear model, a finite step has an approximation error. Under continuous-time gradient flow the chain rule instead gives the exact instantaneous identity f˙t=−Kθ(t)(ft−y)\dot{\mathbf f}_t=-\mathbf K_{\theta(t)}(\mathbf f_t-\mathbf y). Neither statement freezes the kernel. Averaging the loss would introduce a factor 1/n1/n; adaptive optimizers require a different update analysis.

An exact two-observation example

Take the affine model fθ(x)=ax+bf_\theta(x)=ax+b, with θ=(a,b)\theta=(a,b), so ∇θfθ(x)=(x,1)⊤\nabla_\theta f_\theta(x)=(x,1)^\top and K(x,x′)=xx′+1K(x,x')=xx'+1. This is a deliberately small linear-in-parameters model, not an approximation to a hidden-layer network.

At inputs 11 and 22,

K=(2335).\mathbf K=\begin{pmatrix}2&3\\3&5\end{pmatrix}.

Start from a=b=0a=b=0, with targets y=(1,0)⊤\mathbf y=(1,0)^\top and step size η=0.1\eta=0.1. Direct differentiation gives ∇L=(−1,−1)⊤\nabla L=(-1,-1)^\top, hence the new parameters are (0.1,0.1)(0.1,0.1). Evaluating the updated model gives predictions (0.2,0.3)⊤(0.2,0.3)^\top.

The kernel calculation agrees exactly:

f1=f0+0.1Ky=(0.20.3).\mathbf f_1=\mathbf f_0+0.1\mathbf K\mathbf y =\begin{pmatrix}0.2\\0.3\end{pmatrix}.
Exact affine toy with unitless inputs 1 and 2 and targets 1 and 0. Starting from zero predictions, a parameter update to a=b=0.1 gives predictions 0.2 and 0.3, matching the kernel calculation.
Exact affine toy with unitless inputs 1 and 2 and targets 1 and 0. Starting from zero predictions, a parameter update to a=b=0.1 gives predictions 0.2 and 0.3, matching the kernel calculation.
Original deterministic example. The blue line is the updated affine model; squares mark targets and circles mark predictions. The second prediction rises because its derivative features overlap those of the first observation.

The second observation initially has zero error, yet its prediction moves away from its target. The update follows the gradient of the aggregate loss; it does not promise to improve every observation separately. Here the derivative features stay fixed because the model is affine in its parameters, making the kernel step exact at any parameter value.

When does a neural network have a fixed kernel?

Jacot and coauthors prove a deterministic, fixed-kernel limit for suitably scaled fully connected networks as hidden-layer widths grow. Their training theorem assumes a Lipschitz, twice differentiable activation with bounded second derivative and bounded integrated training direction over the time interval. The width limit, parameter scaling and regularity assumptions matter; the finite definition alone supplies no such guarantee. See their model and Theorem 2.
Lazy training describes training that remains close to the model's linearization around initialization. Chizat, Oyallon and Bach, §§1.1–1.2 show that scaling is central, and that this behavior is not exclusive to large neural networks. A fixed tangent feature map can still yield nonlinear functions of the input. What it restricts is the evolution of the representation during training.

For financial prediction, a frozen-NTK model can therefore serve as a comparison against a network whose derivative features evolve. Agreement helps diagnose the training regime; disagreement can reveal where the local approximation breaks down. Neither finding establishes out-of-sample forecasting value, protection against changing markets, or calibrated predictive uncertainty. An NTK describes training sensitivity, not automatically a probabilistic forecast distribution.

For the underlying feature-map and Gram-matrix algebra, see The Kernel Trick: Feature Maps and Properties of Kernels (public preview; full lesson requires membership).

Sources

Last updated
  • neural networks
  • kernel methods
  • optimization
  • learning theory
← Back to the glossaryBack to top ↑