NTK — Complete Guide to Neural Tangent Kernel

NTK : Guide Complet — Noyau Tangent Neuronal

Neural Tangent Kernel: Complete Guide

Summary

The Neural Tangent Kernel (NTK) constitutes one of the most profound theoretical discoveries in modern deep learning. Introduced by Jacot, Gabriel, and Hongler in 2018, this mathematical framework describes the behavior of neural networks when considering the limit where their width tends toward infinity. In this regime, the evolution of the network during gradient descent training becomes entirely determined by a fixed kernel — the NTK — that does not change during optimization. This extraordinary property allows rigorous analysis of the convergence and generalization of wide networks, reducing them to well-understood and mathematically tractable classical kernel regression problems. The NTK has revolutionized our understanding of why deep neural networks manage to converge toward global minima despite the apparent non-convexity of their loss function, and why they generalize remarkably well on unseen data.

Mathematical Principle

The Neural Tangent Kernel describes the behavior of neural networks in the infinite width limit. Consider a neural network parameterized by a vector of parameters $\theta \in \mathbb{R}^P$, which takes an input $x$ and produces a scalar output $f(x; \theta)$. For two input points $x$ and $x’$, the tangent kernel is defined as the sum of the products of the network’s gradients with respect to each of its parameters:

$$
\Theta(x, x’) = \sum_{p=1}^{P} \frac{\partial f(x; \theta)}{\partial \theta_p} \cdot \frac{\partial f(x’; \theta)}{\partial \theta_p}
$$

Equivalently, in compact vector notation, we can write:

$$
\Theta(x, x’) = \nabla_\theta f(x; \theta)^\top \cdot \nabla_\theta f(x’; \theta)
$$

This kernel measures the similarity between the network’s gradients evaluated at two different input points. It encodes how parameter updates simultaneously affect predictions on $x$ and on $x’$.

The Infinite Width Limit

In the limit where the width of the network’s layers tends toward infinity, a remarkable property emerges: the NTK converges to a deterministic kernel that is independent of the parameter initialization. In other words, regardless of how the network is initialized, when its width is sufficiently large, the NTK stabilizes toward a fixed function $\Theta^\infty(x, x’)$ that depends only on the network architecture (activation function, depth, width) and the input data.

This convergence is a profound result. For a finite network, the NTK evolves during training because the parameters $\theta$ change. But in the infinite width regime, the NTK remains constant — it is this fixed kernel property that makes mathematical analysis possible.

Evolution During Training

Consider gradient descent training with a learning rate $\eta$. The parameter evolution follows the differential equation:

$$
\frac{d\theta}{dt} = -\nabla_\theta \mathcal{L}(\theta)
$$

where $\mathcal{L}$ is the loss function. By composition, the evolution of the network output $f(x; \theta(t))$ during training is:

$$
\frac{df(x; \theta(t))}{dt} = \nabla_\theta f(x; \theta(t))^\top \cdot \frac{d\theta}{dt} = -\nabla_\theta f(x; \theta(t))^\top \cdot \nabla_\theta \mathcal{L}(\theta(t))
$$

For a quadratic loss $\mathcal{L} = \frac{1}{2} \sum_{i} (f(x_i; \theta) – y_i)^2$ on a training set ${(x_i, y_i)}_{i=1}^n$, we obtain:

$$
\frac{df(x; \theta(t))}{dt} = -\sum_{i=1}^{n} \Theta(x, x_i; \theta(t)) \cdot (f(x_i; \theta(t)) – y_i)
$$

This equation reveals the fundamental structure of the NTK regime: the evolution of the network is entirely governed by the kernel $\Theta$ applied to the training residuals. In the infinite width limit where $\Theta$ becomes constant, this linear differential equation can be solved analytically — the non-convex training problem of a neural network reduces to kernel regression with the NTK.

Convergence and Kernel Positivity

The NTK explains why wide networks converge to global minima. If the kernel matrix $\Theta$ (evaluated on the training set) is positive definite, then the differential equation above guarantees exponential convergence toward zero error on the training data. Concretely, the smallest eigenvalue $\lambda_{\min}$ of the NTK matrix determines the convergence rate: the larger $\lambda_{\min}$, the faster the convergence.

For common non-polynomial activations (ReLU, sigmoid, tanh), and under fairly general conditions on the data, the NTK in the infinite width limit is strictly positive definite. This means that for any finite set of distinct points, the corresponding matrix is invertible and has strictly positive eigenvalues. This property ensures that gradient descent converges exponentially toward a solution that perfectly interpolates the training data.

Kernel Regime and Generalization

The NTK also explains why wide networks generalize well. In the kernel regime, training is equivalent to ridge kernel regression. The obtained solution minimizes a function norm associated with the NTK kernel, which corresponds to a form of implicit regularization. More precisely, among all functions that zero out the training error, the network converges toward the one that minimizes the RKHS (Reproducing Kernel Hilbert Space) norm associated with the NTK. This implicit regularization property explains why over-parameterized networks do not necessarily overfit: they automatically find the “smoothest” solution compatible with the data.

Intuition

Imagine a neural network as an extremely complex mechanism made up of millions of levers — each lever representing an adjustable parameter (a weight or a bias). When you have a very small number of levers (a narrow network), each individual movement has an enormous and unpredictable impact on the system’s overall behavior. It’s like trying to pilot a small fragile machine: the slightest adjustment can destabilize everything, the movement is jerky, erratic, and difficult to predict.

Now imagine that the same mechanism has millions, even billions of levers. Changing a single lever now has only a microscopic, infinitesimal effect on the overall behavior. The system becomes surprisingly predictable and smooth. It’s like comparing a small motorcycle to an ocean liner: the motorcycle is nervous, reacts violently to every gesture, while the ocean liner moves with majestic regularity, each course correction being gentle and imperceptible. This is exactly what happens in the NTK regime: the neural mechanism runs smoothly, without jolts, like a large perfectly-oiled machine.

In this regime, the network behaves like a linear model in a very high-dimensional function space. The NTK is the analogue of the covariance matrix in this linear model. The network’s predictions on the training data evolve according to a simple linear differential equation, and the solution is entirely determined by this fixed kernel. This emergent linearity at large scale is what makes mathematical analysis possible and explains the convergence and generalization properties of wide networks.

Python Implementation

Here is a complete implementation illustrating the analytical computation of the NTK for a single-hidden-layer MLP, the comparison between the NTK regime and actual neural training, and the visualization of NTK convergence as a function of increasing network width.

"""
Neural Tangent Kernel (NTK) — Analytical and Empirical Implementation
===================================================================

This script computes the NTK for a single-hidden-layer MLP, compares
the NTK regime with actual neural training, and visualizes kernel
convergence as the layer width increases.
"""

import numpy as np
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
import warnings
warnings.filterwarnings("ignore")


# ──────────────────────────────────────────────
# 1. Single-hidden-layer MLP definition
# ──────────────────────────────────────────────
def relu(x):
    """ReLU activation function: max(0, x)"""
    return np.maximum(0, x)


def relu_derivative(x):
    """Derivative of ReLU: 1 if x > 0, 0 otherwise."""
    return (x > 0).astype(np.float64)


class OneLayerMLP:
    """Single-hidden-layer MLP: f(x) = W2 · ReLU(W1 · x + b1)"""

    def __init__(self, input_dim, hidden_dim, output_dim=1, seed=42):
        np.random.seed(seed)
        # He initialization for the first layer
        self.W1 = np.random.randn(hidden_dim, input_dim) * np.sqrt(2.0 / input_dim)
        self.b1 = np.zeros(hidden_dim)
        # The second layer is scalar-normalized based on width
        self.W2 = np.random.randn(output_dim, hidden_dim) * np.sqrt(1.0 / hidden_dim)

    def forward(self, X):
        """Forward pass. Returns (output, pre-activations)."""
        pre_act1 = X @ self.W1.T + self.b1  # (N, H)
        act1 = relu(pre_act1)                 # (N, H)
        output = act1 @ self.W2.T             # (N, O)
        return output, pre_act1, act1


# ──────────────────────────────────────────────
# 2. Empirical NTK computation
# ──────────────────────────────────────────────
def empirical_ntk(model, X1, X2):
    """
    Computes the empirical NTK between two sets X1 and X2.

    The NTK is the sum of gradient products:
    Theta(x, x') = Σ_p (∂f(x)/∂θ_p) · (∂f(x')/∂θ_p)

    Uses analytical gradient computation for
    a moderate-sized network.
    """
    _, pre_act1_X1, act1_X1 = model.forward(X1)
    _, pre_act1_X2, act1_X2 = model.forward(X2)

    # W2 contribution: Θ_W2 = act1_X1 @ act1_X2^T / hidden_dim
    ntk_W2 = act1_X1 @ act1_X2.T / model.W2.shape[1]

    # ReLU gradients
    mask_X1 = relu_derivative(pre_act1_X1)  # (N1, H)
    mask_X2 = relu_derivative(pre_act1_X2)  # (N2, H)

    # W1 contribution
    W2_sq = (model.W2[0] ** 2)  # (H,)
    weighted_mask_X1 = mask_X1 * W2_sq[np.newaxis, :]  # (N1, H)
    weighted_mask_X2 = mask_X2 * W2_sq[np.newaxis, :]  # (N2, H)
    ntk_W1 = (weighted_mask_X1 @ weighted_mask_X2.T) * (X1 @ X2.T) / model.W1.shape[1]

    # b1 contribution: similar without the x·x' term
    ntk_b1 = weighted_mask_X1 @ weighted_mask_X2.T / model.W1.shape[1]

    ntk_matrix = ntk_W2 + ntk_W1 + ntk_b1
    return ntk_matrix


# ──────────────────────────────────────────────
# 3. Theoretical NTK in the infinite width limit
# ──────────────────────────────────────────────
def theoretical_ntk_relu(x1, x2):
    """
    Computes the theoretical NTK for a ReLU activation
    in the infinite width limit (order 0 and 1 ARC-COS kernel).

    For a single-hidden-layer MLP, the limit NTK is:
    Σ^(∞)(x, x') = (1/π) · ||x|| · ||x'|| · (sin(θ) + (π - θ)cos(θ))
    where θ = arccos( (x·x') / (||x|| · ||x'||) )

    References: Cho & Saul (2009), Jacot et al. (2018)
    """
    dot_product = np.dot(x1, x2)
    norm1 = np.linalg.norm(x1)
    norm2 = np.linalg.norm(x2)

    if norm1 < 1e-10 or norm2 < 1e-10:
        return 0.0

    # Normalized angle between vectors
    cos_angle = np.clip(dot_product / (norm1 * norm2), -1.0, 1.0)
    theta = np.arccos(cos_angle)

    # Order 1 ARC-COS kernel (ReLU derivative)
    k_dot = (1.0 / np.pi) * norm1 * norm2 * (np.sin(theta) + (np.pi - theta) * cos_angle)

    # Exact form of the theoretical NTK for ReLU:
    ntk_value = dot_product * (1.0 - theta / np.pi) + k_dot

    return ntk_value


def theoretical_ntk_matrix(X1, X2):
    """Computes the theoretical NTK matrix for all pairs of points."""
    n1, n2 = X1.shape[0], X2.shape[0]
    result = np.zeros((n1, n2))
    for i in range(n1):
        for j in range(n2):
            result[i, j] = theoretical_ntk_relu(X1[i], X2[j])
    return result


# ──────────────────────────────────────────────
# 4. Gradient descent training
# ──────────────────────────────────────────────
def train_model(model, X, y, learning_rate=0.01, epochs=500):
    """Trains the model with gradient descent on the quadratic loss."""
    losses = []
    for epoch in range(epochs):
        output, pre_act1, act1 = model.forward(X)

        # Mean squared loss
        loss = 0.5 * np.mean((output.flatten() - y) ** 2)
        losses.append(loss)

        # Gradients
        residual = (output.flatten() - y)  # (N,)

        # Gradient with respect to W2
        grad_W2 = np.outer(residual, act1) / len(y)  # (O, H)

        # Gradient with respect to hidden layer
        grad_hidden = np.outer(residual, model.W2.flatten()) * relu_derivative(pre_act1)

        # Gradients W1 and b1
        grad_W1 = grad_hidden.T @ X / len(y)  # (H, D)
        grad_b1 = np.mean(grad_hidden, axis=0)  # (H,)

        # Parameter update
        model.W2 -= learning_rate * grad_W2
        model.W1 -= learning_rate * grad_W1
        model.b1 -= learning_rate * grad_b1

    return losses


# ──────────────────────────────────────────────
# 5. Kernel Ridge Regression with NTK
# ──────────────────────────────────────────────
def ntk_ridge_regression(ntk_train, y_train, ntk_test, alpha=1e-4):
    """
    Ridge regression with the NTK kernel.

    f_test = K_test · (K_train + αI)^{-1} · y_train
    """
    n = ntk_train.shape[0]
    # Solve the linear system
    K_reg = ntk_train + alpha * np.eye(n)
    coeffs = np.linalg.solve(K_reg, y_train)
    predictions = ntk_test @ coeffs
    return predictions, coeffs


# ──────────────────────────────────────────────
# 6. Experiment and visualization
# ──────────────────────────────────────────────
input_dim = 3
n_train = 50
n_test = 30

# Synthetic data generation
np.random.seed(2024)
X_train = np.random.randn(n_train, input_dim)
X_test = np.random.randn(n_test, input_dim)

# Nonlinear target function
y_train = np.sin(X_train[:, 0]) + 0.5 * X_train[:, 1] ** 2 + 0.3 * X_train[:, 2]
y_test = np.sin(X_test[:, 0]) + 0.5 * X_test[:, 1] ** 2 + 0.3 * X_test[:, 2]

# Normalize inputs and targets
X_train_mean = X_train.mean(axis=0)
X_train_std = X_train.std(axis=0)
X_train_norm = (X_train - X_train_mean) / (X_train_std + 1e-8)
X_test_norm = (X_test - X_train_mean) / (X_train_std + 1e-8)

y_mean = y_train.mean()
y_std = y_train.std()
y_train_norm = (y_train - y_mean) / (y_std + 1e-8)
y_test_norm = (y_test - y_mean) / (y_std + 1e-8)

# ── Experiment 1: NTK convergence as a function of width ──
print("=" * 60)
print("Experiment 1: NTK convergence vs increasing width")
print("=" * 60)

widths = [10, 30, 100, 300, 1000, 3000]
ntk_errors = []

# Reference: Theoretical NTK (infinite)
ntk_theory_train = theoretical_ntk_matrix(X_train_norm, X_train_norm)

for w in widths:
    model_w = OneLayerMLP(input_dim, w, seed=123)
    ntk_empirical = empirical_ntk(model_w, X_train_norm, X_train_norm)

    # Relative error with respect to theoretical NTK
    relative_error = np.linalg.norm(ntk_empirical - ntk_theory_train) / (
        np.linalg.norm(ntk_theory_train) + 1e-10
    )
    ntk_errors.append(relative_error)
    print(f"  Width = {w:>5d} | NTK relative error = {relative_error:.6f}")

# ── Experiment 2: Comparison NTK-KRR vs neural training ──
print("\n" + "=" * 60)
print("Experiment 2: NTK-KRR vs neural training")
print("=" * 60)

# Wide model to approach the NTK regime
large_width = 500
model_large = OneLayerMLP(input_dim, large_width, seed=42)

# Empirical NTK on training and test data
ntk_train_emp = empirical_ntk(model_large, X_train_norm, X_train_norm)
ntk_test_emp = empirical_ntk(model_large, X_test_norm, X_train_norm)

# NTK kernel ridge regression predictions
ntk_pred_test, ntk_coeffs = ntk_ridge_regression(
    ntk_train_emp, y_train_norm, ntk_test_emp, alpha=1e-3
)
ntk_test_mse = np.mean((ntk_pred_test - y_test_norm) ** 2)
print(f"  NTK-KRR (ridge regression) | test MSE = {ntk_test_mse:.6f}")

# Actual neural training
model_trained = OneLayerMLP(input_dim, large_width, seed=42)
train_losses = train_model(model_trained, X_train_norm, y_train_norm,
                           learning_rate=0.05, epochs=1000)
train_output, _, _ = model_trained.forward(X_test_norm)
neural_test_mse = np.mean((train_output.flatten() - y_test_norm) ** 2)
print(f"  Neural training | test MSE = {neural_test_mse:.6f}")
print(f"  Relative gap = {abs(ntk_test_mse - neural_test_mse) / ntk_test_mse * 100:.2f}%")

# ── Experiment 3: Loss convergence during training ──
print("\n" + "=" * 60)
print("Experiment 3: Exponential loss convergence")
print("=" * 60)

# Smallest eigenvalue of NTK (indirect measure of convergence rate)
eigenvalues = np.linalg.eigvalsh(ntk_train_emp)
lambda_min = np.min(eigenvalues)
lambda_max = np.max(eigenvalues)
print(f"  λ_min(NTK) = {lambda_min:.6f}")
print(f"  λ_max(NTK) = {lambda_max:.6f}")
print(f"  Condition number = {lambda_max / (lambda_min + 1e-10):.2f}")


# ── Visualization ──
print("\nGenerating visualizations...")

fig = plt.figure(figsize=(16, 12))
gs = GridSpec(2, 2, figure=fig, hspace=0.35, wspace=0.30)

# Plot 1: NTK convergence vs width
ax1 = fig.add_subplot(gs[0, 0])
ax1.loglog(widths, ntk_errors, 'bo-', linewidth=2.5, markersize=10, label='Relative error')
ax1.set_xlabel('Hidden layer width', fontsize=12, fontweight='bold')
ax1.set_ylabel('NTK relative error (log)', fontsize=12, fontweight='bold')
ax1.set_title('Convergence of empirical NTK toward theoretical NTK\nas width increases', fontsize=11, fontweight='bold')
ax1.legend(fontsize=11)
ax1.grid(True, alpha=0.3)

# Annotation: NTK regime zone
ax1.axvspan(500, 3500, alpha=0.15, color='green', label='NTK regime (convergence)')
ax1.fill_between([500, 3500], [1e-5, 1e-5], [1e-1, 1e-1], alpha=0.15, color='green')
ax1.legend(fontsize=10)

# Plot 2: Comparison of NTK-KRR vs neural predictions
ax2 = fig.add_subplot(gs[0, 1])
idx_sorted = np.argsort(y_test_norm)
ax2.scatter(y_test_norm[idx_sorted], ntk_pred_test[idx_sorted],
            c='blue', s=50, alpha=0.8, label='NTK-KRR', edgecolors='darkblue', linewidth=0.5)
ax2.scatter(y_test_norm[idx_sorted], train_output.flatten()[idx_sorted],
            c='red', s=50, alpha=0.8, label='Neural training',
            edgecolors='darkred', linewidth=0.5)
# Reference line y = x
lim = max(abs(y_test_norm).max(), abs(ntk_pred_test).max(), abs(train_output.flatten()).max())
ax2.plot([-lim, lim], [-lim, lim], 'k--', alpha=0.4, linewidth=1.5, label='Reference (y=x)')
ax2.set_xlabel('Normalized true values', fontsize=12, fontweight='bold')
ax2.set_ylabel('Normalized predictions', fontsize=12, fontweight='bold')
ax2.set_title('Comparison NTK-KRR vs neural training', fontsize=11, fontweight='bold')
ax2.legend(fontsize=10)
ax2.grid(True, alpha=0.3)

# Plot 3: Loss evolution during training
ax3 = fig.add_subplot(gs[1, 0])
epochs_axis = np.arange(len(train_losses))
ax3.semilogy(epochs_axis, train_losses, 'g-', linewidth=2, alpha=0.9)
ax3.set_xlabel('Epochs', fontsize=12, fontweight='bold')
ax3.set_ylabel('Quadratic loss (log scale)', fontsize=12, fontweight='bold')
ax3.set_title("Exponential loss convergence\non training data", fontsize=11, fontweight='bold')
ax3.grid(True, alpha=0.3)

# Convergence rate annotation
ax3.annotate(f'\u03BB_min = {lambda_min:.4f}',
             xy=(0.7, 0.15), xycoords='axes fraction',
             fontsize=10, fontweight='bold',
             bbox=dict(boxstyle='round', facecolor='lightgreen', alpha=0.7))

# Plot 4: NTK matrix
ax4 = fig.add_subplot(gs[1, 1])
im = ax4.imshow(ntk_train_emp, cmap='viridis', aspect='equal')
ax4.set_xlabel("Data index x'", fontsize=12, fontweight='bold')
ax4.set_ylabel('Data index x', fontsize=12, fontweight='bold')
ax4.set_title(f'Empirical NTK matrix\n(width={large_width})', fontsize=11, fontweight='bold')
fig.colorbar(im, ax=ax4, label='Kernel value')

# Global title
fig.suptitle('Neural Tangent Kernel (NTK) — Complete analysis',
             fontsize=15, fontweight='bold', y=0.98)

plt.savefig('ntk_analysis.png', dpi=200, bbox_inches='tight',
           facecolor='white', edgecolor='none')
print("Saved: ntk_analysis.png")

# ── Results summary ──
print("\n" + "#" * 60)
print("RESULTS SUMMARY")
print("#" * 60)
print(f"  Dimensions: {input_dim} inputs, {n_train} train points, {n_test} test points")
print(f"  Maximum width tested: {large_width}")
print(f"  NTK-KRR test MSE   : {ntk_test_mse:.6f}")
print(f"  Neural test MSE    : {neural_test_mse:.6f}")
print(f"  λ_min(NTK)          : {lambda_min:.6f}")
print(f"  Min convergence rate: {2 * lambda_min:.6f}")
print("#" * 60)
print("\nThe NTK faithfully captures the behavior of neural training")

This code concretely demonstrates the three fundamental aspects of the NTK: the empirical convergence toward the theoretical kernel as width increases, the equivalence between NTK kernel regression and actual neural training for sufficiently wide networks, and the exponential convergence of the loss during training — confirming the theoretical prediction of the NTK regime.

Hyperparameters

Three hyperparameters play a central role in the analysis and practical exploitation of the Neural Tangent Kernel.

layer_width — Hidden Layer Width

This is the most important hyperparameter for the NTK regime. The larger the width, the closer the empirical NTK gets to the theoretical kernel in the infinite limit. In practice, a width of 500 to 3000 neurons is sufficient to observe the NTK regime on small-dimensional synthetic problems. For more complex problems, the required width increases, and the NTK regime may become difficult to achieve in practice. The relationship between width and NTK approximation error typically follows an $O(1/\sqrt{\text{width}})$ law.

Recommended values:
– Small problems (d ≤ 10): 300–1000
– Medium problems (d ≤ 100): 1000–5000
– Strict NTK regime: > 5000

num_data_points — Number of Data Points

The number of training points affects the quality of the NTK estimation and the solvability of the linear system in kernel regression. The complexity of NTK-KRR is $O(n^3)$ for matrix inversion, where $n$ is the number of training points. This limits practical applicability to a few thousand points. Beyond that, approximations (Nyström, Random Fourier Features) become necessary.

Recommended values:
– Theoretical analysis: 50–500 points
– Practical NTK regression: 500–5000 points
– Approximations necessary: > 10000 points

regularization_strength — Regularization Strength

In ridge regression with the NTK, the regularization parameter $\alpha$ controls the bias-variance tradeoff. Too little regularization leads to overfitting to training noise, while too much regularization underfits the target function. The optimal choice depends on the signal-to-noise ratio of the data and the intrinsic complexity of the function to be learned.

Recommended values:
– Low-noise data: $10^{-5}$ to $10^{-3}$
– Moderately noisy data: $10^{-3}$ to $10^{-1}$
– Very noisy data: $10^{-1}$ to $10^{0}$

Advantages and Limitations

Advantages

Neural Tangent Kernel theory offers several major advantages over traditional approaches to analyzing neural networks:

Rigorous theoretical understanding. The NTK provides, for the first time, a complete mathematical framework for analyzing the convergence of neural networks. Where non-convex optimization was previously a field of uncertainty (no one could guarantee that a network would reach a global minimum), the NTK establishes formal proofs of exponential convergence for wide networks.

Bridge between deep learning and kernel methods. The NTK creates a deep connection between two domains that seemed distinct: deep learning (empirical but performant) and kernel methods (theoretically elegant but sometimes limited in practice). This connection allows theoretical results to be transferred from one domain to the other.

Explanation of generalization. The NTK sheds light on the over-parameterization paradox: how can networks with millions of parameters generalize without overfitting? The answer lies in the implicit regularization of the kernel regime — the network converges toward the minimum RKHS norm solution, which possesses good generalization properties.

Training diagnostics. Spectral analysis of the NTK (eigenvalues, condition number) provides valuable indicators for diagnosing training difficulties. A high condition number signals potential convergence problems, while a small $\lambda_{\min}$ predicts slow training.

Limitations

Despite its considerable advances, the NTK regime has several important limitations that should be acknowledged:

The infinite width gap. The NTK convergence result applies strictly only in the limit where the width tends toward infinity. Practical networks are finite, and the NTK can vary significantly during training for realistically-sized networks. This gap between asymptotic theory and practice raises questions about the quantitative relevance of the NTK regime for common architectures.

Lower predictive performance. Predictions in the NTK regime are generally less performant than those of real neural networks trained in practice. This suggests that finite-sized networks exploit learning mechanisms that go beyond the purely linear NTK framework — notably a feature learning (evolution of representations) that the kernel regime does not capture, since the kernel is fixed.

Prohibitive computational cost. Computing the NTK requires building and inverting a matrix of size $n \times n$, where $n$ is the number of training points. The cubic complexity $O(n^3)$ makes this approach impractical beyond a few thousand points. Even for moderate sizes, the memory cost of the NTK matrix ($O(n^2)$) can become a bottleneck.

Deep networks and degenerate NTK. For very deep networks with ReLU activations, the NTK can become degenerate: the kernel’s eigenfunctions concentrate on low-frequency directions, making the kernel incapable of capturing complex variations in the data. This is the well-known problem of spectral degeneracy of the NTK in deep networks, which limits the applicability of the theory to ResNet-type architectures or very deep networks with residual connections.

Inability to capture feature learning. The NTK regime assumes a fixed kernel during training. Yet practical neural networks actively learn new data representations: their internal features evolve significantly. This evolution of representations, essential to the ability of deep networks to extract hierarchical abstractions, is absent from the pure NTK model. Alternative frameworks such as Mean Field Theory or the Rich Regime attempt to fill this gap by capturing the dynamics of feature learning.

Sensitivity to data. The NTK depends heavily on the distribution of input data. For data with complex structure (natural images, text, time series), the NTK matrix can be ill-conditioned, making kernel regression unstable and unreliable.

4 Concrete Use Cases

1. Formal Verification of Convergence of New Architectures

When a researcher designs a new neural network architecture (for example, a variant of attention or a modified residual block), the NTK offers a theoretical verification tool. By computing the NTK of the new architecture in the infinite width limit, one can predict whether gradient descent will converge toward a global minimum — a necessary but not sufficient condition for the architecture to be viable. If the NTK is not positive definite for the proposed architecture, this signals a fundamental design problem.

Recent work has used the NTK to analyze variants of residual networks, sparse attention architectures, and networks with batch normalization. In each case, the NTK computation revealed convergence properties that experimentation alone could not have established with certainty.

2. Optimal Initialization of Deep Networks

The NTK provides mathematically grounded criteria for choosing the weight initialization scales. For a ReLU network with $L$ layers, the isometry condition of the NTK at initialization imposes a specific variance scale for each layer, which coincides precisely with He initialization ($\sqrt{2/n_{\text{inputs}}}$) for ReLU activations. This theoretical perspective justifies initialization choices that were previously purely empirical.

For activations other than ReLU (such as GELU, Swish, or Mish), computing the NTK allows deriving optimal initialization conditions specific to each activation function, ensuring that the network operates in a regime favorable to convergence from the start of training.

3. Model Selection and Architecture Comparison

Since the NTK is specific to the architecture (depth, width, activation function), one can compare different architectural choices by evaluating the spectral properties of their respective NTK. An architecture whose NTK has more favorable spectrum (larger minimum eigenvalue, better conditioning) should theoretically converge faster and generalize better.

This approach allows pre-screening of architectures without expensive training: the theoretical NTK is computed for each candidate and those with the most promising spectral properties are retained. This is particularly useful in Neural Architecture Search (NAS), where the space of candidate architectures is vast and training each one to completion is prohibitive.

4. Understanding Learning Dynamics in Vision and Language Models

The NTK has been studied in the context of convolutional networks for vision (CNNs) and, more recently, transformers for natural language processing. In CNNs, the convolutional NTK reveals how translation invariance and spatial locality are encoded in the kernel. In transformers, NTK analysis illuminates the role of multi-head attention and how tokens interact during training.

These analyses have led to concrete improvements: for example, understanding the CNN NTK has led to better normalization strategies and initialization schemes specific to convolutions. For transformers, NTK analysis has revealed the critical importance of attention weight scaling, inspiring architectural modifications such as µ-parameterization, which stabilizes training for extremely wide models.

See Also