← Blog

A Tutorial on Feature Learning in Shallow Neural Networks

1. Introduction

One of the key drivers behind the success of modern deep learning is the ability of deep neural networks, trained via variants of gradient descent, to learn sophisticated features from data. For example, convolutional networks trained on images of dogs and cats can encode both lower-level features such as edges and higher-level features like ears, while language models trained on text corpora can encode features such as semantic information or sentiment. This feature-learning ability is key to the modern paradigm of pretraining and finetuning – pretraining on a large dataset leads to the model learning a diverse set of features, while finetuning extracts the features relevant to that task.

Feature visualizations from successive layers of GoogLeNet: edges, textures, patterns, parts, and objects.

Feature visualizations from successive layers of GoogLeNet trained on ImageNet, progressing from edges and textures in early layers to object parts and whole objects in later layers. Adapted from Olah et al. [1], licensed under CC BY 4.0.

A fundamental open question in developing a scientific theory of deep learning is to understand precisely how features are learned by neural networks during training. In the field of mechanistic interpretability, prior work has made progress towards uncovering the features encoded in the weights of trained models. The goal of learning mechanics, however, will be to explain how these features emerge in the first place, and what role is played by the training data and optimization algorithm.

Making progress towards this question, however, poses a few challenges. First, it is not clear how one should define a “feature,” or what it even means for a neural network to “learn” a feature well. Second, we’ll want to start by studying a toy model where the learning dynamics are tractable, but which also captures the notion of a complex, nonlinear function depending on a simpler set of features.

In this post, I’ll provide an overview of the multi-index model, a simple model of feature learning in shallow neural networks. Multi-index models are functions which take as input a dd-dimensional vector, but only depend on an rr-dimensional projection of this input, where rr is much smaller than dd. Formally, f∗f^* is a multi-index model if f∗(x)=g(Ux),f^*(\mathbf{x}) = g(\mathbf{U}\mathbf{x}), where x∈Rd\mathbf{x} \in \mathbb{R}^d is the input and U∈Rr×d\mathbf{U} \in \mathbb{R}^{r \times d} is a projection matrix1Each direction in U\mathbf{U} is an “index,” and the function ff depends on multiple of these directions, hence the name “multi-index”. Multi-index models are a useful proxy for understanding feature learning, as there is a clear notion of a feature: the low-dimensional projection Ux\mathbf{U}\mathbf{x}!

Over the past couple of years, significant progress has been made towards characterizing the learning dynamics of shallow neural networks trained on data generated by a multi-index model. These analyses have helped to explain how information about features gets encoded in the network weights, how these features help neural networks learn more efficiently, and how properties of the data affect the difficulty of learning certain features. But even beyond feature learning, multi-index models have been useful in modeling a number of phenomena displayed by neural networks in practice, ranging from incremental learning to scaling laws.

I’ll start by motivating why the multi-index model is a natural setting for modeling feature learning, and then summarize the key results and proof intuitions behind learning multi-index models with shallow neural networks. I’ll conclude with a discussion of open directions I find particulary exciting.

2. Background: The NTK and its limitations

I’ll begin by explaining why existing analyses of neural networks fall short when it comes to understanding feature learning. The first generic convergence guarantees for neural networks were based on the neural tangent kernel (NTK) [2] theory. I’ll provide a brief overview of the NTK below, but for a more in-depth discussion, see Eric Regis’s wonderful blog post.

2.1. An overview of the NTK

Let us denote an arbitrary neural network by f(x;θ)f(\mathbf{x}; \boldsymbol{\theta}), where x∈Rd\mathbf{x} \in \mathbb{R}^d is the input, θ∈Rp\boldsymbol{\theta} \in \mathbb{R}^{p} are the parameters, and f(⋅,θ):Rd→Rf(\cdot, \boldsymbol{\theta}) : \mathbb{R}^d \rightarrow \mathbb{R} is the function implemented by a neural network with parameters θ\boldsymbol{\theta}. For instance, if ff is a two-layer neural network with width mm, then θ=({ai}i∈[m],{wi}i∈[m])\boldsymbol{\theta} = (\{a_i\}_{i \in [m]}, \{\mathbf{w}_i\}_{i \in [m]}) is the collection of both the first and second layer weights, and the output of the network is defined as f(x;θ)=∑i=1maiσ(⟨wi,x⟩).f(\mathbf{x}; \boldsymbol{\theta}) = \sum_{i=1}^m a_i \sigma(\langle \mathbf{w}_i, \mathbf{x} \rangle). The NTK theory posits that a neural network is well-approximated by its first-order Taylor expansion, or linearization, about the initialization. In particular, if θ0\boldsymbol{\theta}_0 are the initial parameters, then the NTK approximation of the neural network ff is given by f(x;θ)≈f(x;θ0)+⟨θ−θ0,∇θf(x;θ0)⟩⏟fNTK(x;θ).(1)f(\mathbf{x}; \boldsymbol{\theta}) \approx \underbrace{f(\mathbf{x}; \boldsymbol{\theta}_0) + \langle \boldsymbol{\theta} - \boldsymbol{\theta}_0, \nabla_{\boldsymbol{\theta}} f(\mathbf{x}; \boldsymbol{\theta}_0)\rangle}_{f_{\mathrm{NTK}}(\mathbf{x}; \boldsymbol{\theta})}. \tag{1} While fNTKf_{\mathrm{NTK}} is still a nonlinear function of the input x\mathbf{x}, it is a linear function of the parameters θ\boldsymbol{\theta}; indeed, fitting a dataset with fNTKf_{\mathrm{NTK}} is simply a kernel regression problem with fixed feature map x↦∇θf(x;θ0)\mathbf{x} \mapsto \nabla_{\boldsymbol{\theta}}f(\mathbf{x}; \boldsymbol{\theta}_0).

The key principle behind the NTK theory is that for particular initializations and scaling regimes, the trajectory obtained by running gradient descent on ff remains close to the trajectory obtained by running gradient descent on fNTKf_{\mathrm{NTK}}. In order to prove that gradient descent on ff converges to a solution with small training error, it suffices to prove convergence for the linearized model fNTKf_{\mathrm{NTK}}. But since fNTKf_{\mathrm{NTK}} is linear in the parameters θ\boldsymbol{\theta}, the loss is convex, which immediately implies convergence to a global minimizer of the training loss! This approach led to some of the first convergence guarantees for gradient descent on a variety of neural network architectures [3,4,5].

2.2. The NTK is unable to capture feature learning

However, these NTK-based approaches are missing a key piece of the puzzle of how neural networks are actually trained in practice. Empirically, it has been observed that training a neural network with SGD outperforms training the equivalent NTK [6,7].2This can be due to finite-width effects, large learning rates, minibatch noise, or a variety of other factors. Moreover, the NTK proofs require the approximation in equation (1) to hold throughout the entire training trajectory, which implies that the parameters θ\boldsymbol{\theta} move very little from their initialization θ0\boldsymbol{\theta_0}. Hyperparameter settings under which this NTK approximation holds have thus been called the “lazy regime,” as it is possible for a neural network to fit the training data with each neuron moving very little from its initialization [8]. Being in the lazy regime is viewed as an undesirable property of a neural network, as ideally some neuron moves nontrivially, and the overall neural network is more than just a kernel method.

These desiderata motivated the creation of muP, or the maximal-update parametrization [9], which is a specific initialization and hyperparameter scheme which guarantees that neurons move nontrivially3For a pedagogical discussion of muP and its derivation, see Yang et al. [10].. muP has been referred to as the “feature learning” parametrization, where here feature learning has been operationalized as neurons moving far from their initialization. Under muP, or the closely related “mean-field” parametrization (as described in Eric’s post), asymptotic convergence guarantees have been derived for two-layer neural networks [11,12], albeit requiring the network size mm or time TT required to train to convergence to grow exponentially in the dimension dd.

Unfortunately, this muP/mean-field perspective isn’t detailed enough to explain how neural networks actually learn features in practice. We would like a definition of feature learning which is stronger than simply requiring that the parameters move far from their initialization; we must understand how neural networks can actually recognize and encode the underlying structure present in the training data. Moreover, we also want to capture the fact that neural networks use these features to learn more efficiently!

3. Learning multi-index models with two-layer neural networks

In order to make progress towards this question, we will need to move beyond generic convergence guarantees, and aim to understand how neural networks learn when trained on data from specific distributions (i.e. for a choice over input distribution x\mathbf{x} and a target function f∗f^*). To model feature learning, we will choose the target function f∗f^* to depend on some simple features.

There are two particular notions of feature learning we will study, which go beyond the “parameters move far from initialization” viewpoint:

The class of target functions we will focus on are multi-index models, which are functions of the form f∗(x)=g(Ux).(2)f^*(\mathbf{x}) = g(\mathbf{U}\mathbf{x}). \tag{2} Here, x∈Rd\mathbf{x} \in \mathbb{R}^d is the input, U∈Rr×d\mathbf{U} \in \mathbb{R}^{r \times d} is a low-dimensional projection matrix, and g:Rr→Rg : \mathbb{R}^r \rightarrow \mathbb{R} is the link function. The rank rr is typically assumed to be much smaller than the ambient dimension dd. Multi-index models are useful in modeling feature learning, as there is a clear notion of a feature, which is the low-dimensional projection5We will associate the feature with the matrix U\mathbf{U}, the projection x↦Ux\mathbf{x} \mapsto \mathbf{U}\mathbf{x}, and the subspace spanned by the rows of U\mathbf{U} interchangeably. x↦Ux\mathbf{x} \mapsto \mathbf{U}\mathbf{x}. If a learner can recognize that the target function only depends on the feature Ux\mathbf{U}\mathbf{x}, it is substantially easier for it to learn the rest of the function, which has now reduced to the rr-dimensional problem of learning gg.

A multi-index model: a wide r by d matrix U multiplies a tall d-dimensional input x, producing a short r-dimensional feature Ux, which is passed to the link function g.

A multi-index model f∗(x)=g(Ux)f^*(\mathbf{x}) = g(\mathbf{U}\mathbf{x}). The matrix U∈Rr×d\mathbf{U} \in \mathbb{R}^{r \times d} projects the dd-dimensional input x\mathbf{x} down to the rr-dimensional feature Ux\mathbf{U}\mathbf{x}, and the link function gg depends on the input only through this feature.

Concretely, we ask the following question.

Consider a dataset of nn samples D={(xi,yi)}i∈[n]\mathcal{D} = \{(\mathbf{x}_i, y_i)\}_{i \in [n]}, where the xi\mathbf{x}_i are sampled i.i.d from N(0,Id)\mathcal{N}(\mathbf{0}, \mathbf{I}_d), the standard isotropic Gaussian in dd dimensions, and yi=f∗(xi)y_i = f^*(\mathbf{x}_i), where f∗f^* is a multi-index model. If a neural network is trained on D\mathcal{D}, how large does nn need to be to guarantee low test loss?

Remark: On the Gaussian assumption

The standard Gaussian distribution N(0,Id)\mathcal{N}(\mathbf{0}, \mathbf{I}_d) is the “simplest” possible input distribution for the xi\mathbf{x}_i, and ensures the input distribution has no underlying structure. All the “feature learning” the network must perform is thus in recovering the subspace U\mathbf{U}. As we will see later, this Gaussian assumption admits a harmonic decomposition and various symmetries that will be convenient for the analyses. See Section 5 for a discussion on moving beyond this Gaussian assumption.

3.1. The kernel lower bound

The first question we’re interested in is: is feature learning actually needed to learn a multi-index model? While it intuitively makes sense that an algorithm which can extract the low-dimensional representation U\mathbf{U} will obtain a very good sample complexity, could this procedure potentially be implemented with a kernel method like the NTK? The answer to this question turns out to be no: kernel methods require a prohibitively large sample complexity to learn multi-index models.

Theorem 1 [13,14,15], informal. Let gg be a degree pp polynomial. Any rotationally invariant kernel method6When the input data is normalized to lie on the unit sphere, a rotationally invariant kernel depends only on the inner product: K(x,x′)=h(⟨x,x′⟩)K(\mathbf{x}, \mathbf{x}') = h(\langle \mathbf{x}, \mathbf{x}'\rangle). This is satisfied for common kernels such as the RBF kernel, or the NTK for isotropic initializations. requires Ω(dp)\Omega(d^p) samples to learn the multi-index model f∗(x)=g(Ux)f^*(\mathbf{x}) = g(\mathbf{U}\mathbf{x}).

The space of degree ≤p\le p polynomials in dd dimensions has Θ(dp)\Theta(d^p) dimensions (or degrees of freedom), one for each monomial which can be constructed out of the dd coordinates (x1,…,xd)(x_1, \dots, x_d). Learning an arbitrary polynomial in dd dimensions would thus require a sample complexity of Ω(dp)\Omega(d^p). Kernel methods are unable to take advantage of the fact that multi-index models have additional low-rank structure, and simply treat them as an arbitrary polynomial, incurring the poor dpd^p sample complexity. Altogether, this provides a statistical argument demonstrating that kernel methods are unable to perform feature learning.

3.2. Neural networks can learn features

Neural networks, on the other hand, are capable of learning multi-index models with significantly fewer samples. The key phenomenon behind this sample complexity improvement is the following: the gradient of the loss at initialization reveals the hidden subspace U\mathbf{U}. Below, we will provide some derivations of how exactly the learning dynamics are able to uncover the hidden feature. We emphasize that these derivations will be heuristic, and make a number of simplifying assumptions to help the exposition. We encourage the interested reader to check out the relevant papers for the full, rigorous arguments.

Remark: On end-to-end learning guarantees

The goal of this section is to derive end-to-end guarantees for gradient-based learning algorithms. This means we may choose the initialization, learning rates, and other hyperparameters favorably, with the goal of proving that the output of the learning procedure has small loss. This can demonstrate the theoretical power of neural networks in learning various classes of functions. However, the hyperparameter choices here may differ from those made in practice, and proving learning guarantees for “vanilla” gradient descent is an interesting direction of future work; see Section 4.5 for more discussion.

3.2.1. Warmup: single-index model

We will begin by analyzing the dynamics of a neural network trained on a target which is a single-index model, i.e., r=1r=1. In this case, the hidden subspace is simply a vector u∈Rd\mathbf{u} \in \mathbb{R}^d; the target function is thus of the form f∗(x)=g(u⊤x)f^*(\mathbf{x}) = g(\mathbf{u}^\top \mathbf{x}).

Recall that our two-layer neural network is of the form f(x;θ)=∑i∈[m]aiσ(⟨wi,x⟩).f(\mathbf{x}; \boldsymbol{\theta}) = \sum_{i\in[m]} a_i \sigma(\langle \mathbf{w}_i, \mathbf{x} \rangle). Let’s first consider the population (or infinite sample) loss; later, we’ll see that the finite-sample trajectory approximates this population trajectory with relatively few samples. The population square loss is: L(θ):=Ex∼N(0,Id)[(f(x;θ)−f∗(x))2].L(\boldsymbol{\theta}) := \E_{\mathbf{x} \sim \mathcal{N}(\mathbf{0}, \mathbf{I}_d)}\left[(f(\mathbf{x}; \boldsymbol{\theta}) - f^*(\mathbf{x}))^2\right]. By the chain rule, the gradient of LL with respect to some neuron wi\mathbf{w}_i is given by ∇wiL(θ)=∇wiEx[(f(x;θ)−f∗(x))2]=2Ex[∇wif(x;θ)(f(x;θ)−f∗(x))].\begin{aligned} \nabla_{\mathbf{w}_i} L(\boldsymbol{\theta}) &= \nabla_{\mathbf{w}_i}\E_{\mathbf{x}}\left[(f(\mathbf{x}; \boldsymbol{\theta}) - f^*(\mathbf{x}))^2\right]\\ &= 2\E_{\mathbf{x}}\left[\nabla_{\mathbf{w}_i}f(\mathbf{x}; \boldsymbol{\theta}) (f(\mathbf{x}; \boldsymbol{\theta}) - f^*(\mathbf{x}))\right]. \end{aligned} First, one can show that at initialization, the output of the neural network f(x;θ)f(\mathbf{x}; \boldsymbol{\theta}) is close to identically zero.7Under muP or mean field initializations, the second layer weights aia_i are mean zero and have standard deviation ≍1/m\asymp 1/m. Thus for any fixed x\mathbf{x}, the Central Limit Theorem tells us that f(x;θ)f(\mathbf{x}; \boldsymbol{\theta}) is a random variable with standard deviation 1/m1/\sqrt{m}, which converges to 00 once the width mm is sufficiently large.

Next, let’s calculate the model gradient: ∇wif(x;θ)=aiσ′(⟨wi,x⟩)x.\nabla_{\mathbf{w}_i} f(\mathbf{x}; \boldsymbol{\theta}) = a_i \sigma'(\langle \mathbf{w}_i, \mathbf{x} \rangle) \mathbf{x}. We will make the simplifying assumption that wi\mathbf{w}_i is very small at initialization. This implies that ⟨wi,x⟩≈0\langle \mathbf{w}_i, \mathbf{x} \rangle \approx 0, and thus σ′(⟨wi,x⟩)≈σ′(0)\sigma'(\langle \mathbf{w}_i, \mathbf{x} \rangle) \approx \sigma'(0). Plugging back in to the formula for the gradient, we get that ∇wiL(θ)≈−2aiσ′(0)Ex[xf∗(x)].\nabla_{\mathbf{w}_i}L(\boldsymbol{\theta}) \approx -2a_i \sigma'(0)\E_{\mathbf{x}}[\mathbf{x}f^*(\mathbf{x})]. The gradient at initialization thus points in the direction of the vector Ex[xf∗(x)]\E_{\mathbf{x}}[\mathbf{x}f^*(\mathbf{x})].

The key mathematical observation is the following: since the distribution of x\mathbf{x} is rotationally invariant, and f∗(x)f^*(\mathbf{x}) depends only on the inner product x⊤u\mathbf{x}^\top \mathbf{u}, the quantity Ex[xf∗(x)]\E_{\mathbf{x}}[\mathbf{x}f^*(\mathbf{x})] points in the direction of the vector u\mathbf{u}!

Derivation: To see why, take any vector v\mathbf{v} which is orthogonal to u\mathbf{u}. One then has ⟨v,Ex[xf∗(x)]⟩=Ex[⟨x,v⟩g(⟨x,u⟩)]=Ex[⟨x,v⟩]E[g(⟨x,u⟩)]=0,\begin{align*} \langle \mathbf{v}, \E_{\mathbf{x}}[\mathbf{x}f^*(\mathbf{x})] \rangle &= \E_{\mathbf{x}}[\langle \mathbf{x}, \mathbf{v}\rangle g( \langle \mathbf{x}, \mathbf{u} \rangle)]\\ &= \E_{\mathbf{x}}[\langle \mathbf{x}, \mathbf{v}\rangle] \E[g(\langle \mathbf{x}, \mathbf{u}\rangle)]\\ &= 0, \end{align*} where the penultimate equality uses the fact that since u\mathbf{u} and v\mathbf{v} are orthogonal, ⟨x,u⟩\langle \mathbf{x}, \mathbf{u}\rangle and ⟨x,v⟩\langle \mathbf{x}, \mathbf{v} \rangle are independent Gaussians.

The following figure shows a heatmap of f∗(x)f^*(x) on the left, and the quantity Ex[xf∗(x)]\E_{\mathbf{x}}[\mathbf{x}f^*(\mathbf{x})] on the right.

When f(x) = g(<x, u>), the quantity E[x f*(x)] points in the direction of u.

When f∗(x)=g(⟨x,u⟩)f^*(\mathbf{x}) = g(\langle \mathbf{x}, \mathbf{u} \rangle), the quantity Ex[xf∗(x)]\mathbb{E}_{\mathbf{x}}[\mathbf{x}f^*(\mathbf{x})] points in the direction of u\mathbf{u}.

The exact constant of scaling is given by the following key lemma, called Stein’s Lemma:

Lemma 1 (Stein’s Lemma). For any differentiable function f:Rd→Rf : \mathbb{R}^d \rightarrow \mathbb{R}, Ex∼N(0,Id)[xf(x)]=Ex∼N(0,Id)[∇f(x)].\mathbb{E}_{\mathbf{x} \sim \mathcal{N}(\mathbf{0}, \mathbf{I}_d)}[\mathbf{x}f(\mathbf{x})] = \mathbb{E}_{\mathbf{x} \sim \mathcal{N}(\mathbf{0}, \mathbf{I}_d)}[\nabla f(\mathbf{x})].

Applying Stein’s lemma to f∗f^* gives Ex[xf∗(x)]=Ex[∇f∗(x)]=E[g′(⟨x,u⟩)]u\E_{\mathbf{x}}[\mathbf{x}f^*(\mathbf{x})] = \E_{\mathbf{x}}[\nabla f^*(\mathbf{x})] = \E[g'(\langle \mathbf{x}, \mathbf{u} \rangle)] \mathbf{u}. Therefore as long as the quantity E[g′(⟨x,u⟩)]\E[g'(\langle \mathbf{x}, \mathbf{u} \rangle)] is nonzero, the gradient points in the direction of the hidden subspace (in this case, the direction u\mathbf{u}). After one population gradient step, all of the neurons will be pointing in the direction u\mathbf{u}, and thus the neural network will have successfully learned this hidden feature!

3.2.2. A learning guarantee for multi-index models

Let’s now move on to multi-index models, and assume that f∗(x)=g(Ux)f^*(\mathbf{x}) = g(\mathbf{U}\mathbf{x}). The previous derivation showed that the initial gradient of all neurons pointed in the same direction. For multi-index models, however, the neural network must recover many hidden directions, namely all of the directions in the span of U\mathbf{U}.

Repeating our previous derivation, we can approximate the population gradient by ∇wiL(θ)=−2Ex[∇wif(x;θ)f∗(x)]=−2aiEx[σ′(⟨wi,x⟩)xf∗(x)].\begin{align*} \nabla_{\mathbf{w}_i} L(\boldsymbol{\theta}) &= -2\E_{\mathbf{x}}\left[\nabla_{\mathbf{w}_i}f(\mathbf{x}; \boldsymbol{\theta})f^*(\mathbf{x})\right]\\ &= -2a_i \E_{\mathbf{x}}[\sigma'(\langle \mathbf{w}_i, \mathbf{x}\rangle)\mathbf{x}f^*(\mathbf{x})]. \end{align*} Now, instead of approximating σ′(⟨wi,x⟩)≈σ′(0)\sigma'(\langle \mathbf{w}_i, \mathbf{x}\rangle) \approx \sigma'(0), we will Taylor expand8This requires σ\sigma to be twice-differentiable, but Damian et al. [16] generalize this argument to the ReLU activation. σ′\sigma' to first order: σ′(⟨wi,x⟩)≈σ′(0)+σ′′(0)⟨wi,x⟩.(3)\sigma'(\langle \mathbf{w}_i, \mathbf{x}\rangle) \approx \sigma'(0) + \sigma''(0)\langle \mathbf{w}_i, \mathbf{x} \rangle. \tag{3} Plugging this back into the formula for the population gradient, we get that ∇wiL(θ)≈−2aiσ′(0)Ex[xf∗(x)]−2aiσ′′(0)Ex[f∗(x)xx⊤]wi.\nabla_{\mathbf{w}_i} L(\boldsymbol{\theta}) \approx -2a_i\sigma'(0)\E_{\mathbf{x}}[\mathbf{x}f^*(\mathbf{x})] - 2a_i\sigma''(0)\mathbb{E}_{\mathbf{x}}\left[f^*(\mathbf{x})\mathbf{x}\mathbf{x}^\top\right]\mathbf{w}_i.

This first term is the same as what appeared in the single-index derivation. It points in the same direction – parallel to the vector Ex[xf∗(x)]\E_{\mathbf{x}}[\mathbf{x}f^*(\mathbf{x})] – for every neuron, and so this term alone can’t contain information about every direction in span(U)\mathrm{span}(\mathbf{U}). However, there is now an additional second term, which has the effect of rotating each neuron by the matrix M=Ex[f∗(x)xx⊤]\mathbf{M} = \mathbb{E}_{\mathbf{x}}[f^*(\mathbf{x})\mathbf{x}\mathbf{x}^\top]. It thus suffices to understand the structure of M\mathbf{M}.

By a similar symmetry argument, since f∗f^* only depends on the projection of x\mathbf{x} onto the subspace spanned by U\mathbf{U}, the matrix M\mathbf{M} must be a low-rank matrix with span(M)⊂span(U)\mathrm{span}(\mathbf{M}) \subset \mathrm{span}(\mathbf{U}).

Informal derivation: For any vector v\mathbf{v} with Uv=0\mathbf{U}\mathbf{v} = 0, we have that v⊤Mv=Ex[f∗(x)(x⊤v)2]=Ex[g(Ux)(x⊤v)2]=Ex[g(Ux)]E[(x⊤v)2]=0,\begin{align*} \mathbf{v}^\top \mathbf{M} \mathbf{v} &= \E_{\mathbf{x}}[f^*(\mathbf{x})(\mathbf{x}^\top \mathbf{v})^2]\\ &= \E_{\mathbf{x}}[g(\mathbf{U}\mathbf{x})(\mathbf{x}^\top \mathbf{v})^2]\\ &= \E_{\mathbf{x}}[g(\mathbf{U}\mathbf{x})]\E[(\mathbf{x}^\top \mathbf{v})^2 ]\\ &= 0, \end{align*} where the penultimate equality uses the fact that Ux\mathbf{U}\mathbf{x} and v⊤x\mathbf{v}^\top \mathbf{x} are independent Gaussians, and the final equality uses the assumption that Ex[f∗(x)]=0\mathbb{E}_{\mathbf{x}}[f^*(\mathbf{x})] = 0.

Indeed, two applications of Stein’s Lemma along with the product rule yields: Ex[f∗(x)xx⊤]=Ex[∇x(f∗(x)x)]=Ex[f∗(x)⋅I+∇f∗(x)x⊤]=Ex[∇2f∗(x)].\begin{align*} \E_{\mathbf{x}}[f^*(\mathbf{x})\mathbf{x}\mathbf{x}^\top] &= \E_{\mathbf{x}}\left[\nabla_{\mathbf{x}}\left(f^*(\mathbf{x})\mathbf{x}\right)\right]\\ &= \E_{\mathbf{x}}[f^*(\mathbf{x})\cdot \mathbf{I} + \nabla f^*(\mathbf{x}) \mathbf{x}^\top]\\ &= \E_{\mathbf{x}}[\nabla^2 f^*(\mathbf{x})]. \end{align*}

The matrix M\mathbf{M} thus simplifies as M=Ex[∇2f∗(x)]=U⊤Ez∼N(0,Ir)[∇2g(z)]U.\begin{align*} \mathbf{M} &= \E_{\mathbf{x}}\left[\nabla^2 f^*(\mathbf{x})\right]\\ &= \mathbf{U}^\top\E_{\mathbf{z} \sim \mathcal{N}(\mathbf{0}, \mathbf{I}_r)}[\nabla^2g(\mathbf{z})]\mathbf{U}. \end{align*} M\mathbf{M} therefore has rank at most rr. Moreover, under the nondegeneracy assumption that Ez∼N(0,Ir)[∇2g(z)]\E_{\mathbf{z} \sim \mathcal{N}(\mathbf{0}, \mathbf{I}_r)}[\nabla^2g(\mathbf{z})] is full rank, M\mathbf{M} is exactly a rank rr matrix whose span coincides with that of U\mathbf{U}. Since the neurons wi\mathbf{w}_i were initialized randomly, these components of the gradient are random vectors lying in the hidden subspace U\mathbf{U}. What the first population gradient step is doing is turning the first layer weights into random vectors in the hidden subspace; the neural network thus “encodes” the hidden feature U\mathbf{U} using random vectors in the span of U\mathbf{U}.

Our heuristic derivation so far has focused on the population loss. Damian et al. [16] turn this derivation into an end-to-end finite-sample learning guarantee for multi-index models. Formally, they show the following:

Theorem 2 [16]. Let f∗(x)=g(Ux)f^*(\mathbf{x}) = g(\mathbf{U}\mathbf{x}) be a multi-index model with rank rr, and let gg be a degree pp polynomial. Assume that Ex[f∗(x)]=0,Ex[xf∗(x)]=0\E_{\mathbf{x}}[f^*(\mathbf{x})] = 0, \E_{\mathbf{x}}[\mathbf{x}f^*(\mathbf{x})] = 0,9This can be achieved by a pre-processing step which fits and then subtracts out the linear component. and Ex[∇2f∗(x)]\E_{\mathbf{x}}[\nabla^2f^*(\mathbf{x})] has rank rr. There exists a gradient-based learning algorithm10The learning algorithm is a single gradient step on the first layer with large learning rate, followed by training the second layer with small learning rate until convergence. Dependencies on the width and condition number of M\mathbf{M} are hidden. which with n≳d2r+drp/ε2n \gtrsim d^2r + dr^p/\varepsilon^2 samples obtains a test loss of ε\varepsilon.

The missing ingredients needed to get the sample complexity guarantee in Theorem 2 are the following:

  1. The derivation calculates the gradients with respect to the population loss L(θ)L(\boldsymbol{\theta}). However, we are actually interested in analyzing gradient descent on the empirical loss over nn samples L^(θ)=1n∑i=1n(f(xi;θ)−f∗(xi))2\hat L(\boldsymbol{\theta}) = \frac{1}{n}\sum_{i=1}^n(f(\mathbf{x}_i; \boldsymbol{\theta}) - f^*(\mathbf{x}_i))^2. We need to show that, for nn sufficiently large, the empirical gradients concentrate around their population counterparts. It actually only suffices to show that the empirical estimate of the M\mathbf{M} matrix, M^:=1n∑i=1nf∗(xi)xixi⊤\mathbf{\hat M} := \frac{1}{n}\sum_{i=1}^n f^*(\mathbf{x}_i) \mathbf{x}_i\mathbf{x}_i^\top concentrates close to M\mathbf{M}; this requires a relatively mild sample complexity of n≳d2rn \gtrsim d^2r.
  2. While this shows that the first gradient step can recover the hidden subspace U\mathbf{U}, we’ve still not proven that GD can learn the target f∗f^* with low test error. However, since after the first gradient step the first layer weights are random vectors in the span of U\mathbf{U}, the map x↦σ(W(1)x)\mathbf{x} \mapsto \sigma(\mathbf{W}^{(1)}\mathbf{x}) is a random feature map restricted to the hidden subspace U\mathbf{U}. It thus suffices to keep W(1)\mathbf{W}^{(1)} fixed and train the second layer weights a\mathbf{a} to convergence. This reduces to a kernel regression problem, but in rr, rather than dd dimensions, and thus the sample complexity required to fit f∗f^* to ε\varepsilon error scales as rp/ε2r^p/\varepsilon^2.
  3. On a technical note, one must rigorously control the various error terms from the approximations f(x;θ)≈0f(\mathbf{x}; \boldsymbol{\theta}) \approx 0 and equation (3).

Point 2 above leads to the interesting perspective that neural networks act as an adaptive kernel method; gradient descent learns a subspace on which a kernel method is applied. We’ll discuss this viewpoint further in Section 5.

Altogether, we’ve shown that when the labels are generated by a multi-index model with hidden feature Ux\mathbf{U}\mathbf{x}, gradient descent is able to learn this feature by storing the hidden subspace U\mathbf{U} in the first layer weights (our mechanistic notion of feature learning). As a result, neural networks are able to learn multi-index models in d2r+drpd^2r + dr^p samples, significantly fewer than the dpd^p samples required by kernel methods (our statistical notion of feature learning). This illustrates the adaptivity of neural networks trained via gradient descent: while kernel methods were unable to adapt to the low-dimensionality of f∗f^*, two-layer networks are, and can thus learn much more efficiently.

Two layer neural networks trained on a multi-index model with r=2 and p=4, comparing sample complexity, neuron alignment, and NTK behavior.

Two layer neural networks trained on a multi-index model with r=2r=2 and p=4p=4. (a) Neural networks learn multi-index models in fewer samples than kernel methods (statistical feature learning). (b) Neurons converge to the two-dimensional hidden subspace (mechanistic feature learning). (c) In the NTK regime, most neurons move very little from their initialization.

4. Modeling deep learning phenomena with multi-index models

In the previous section, we saw how two-layer neural networks efficiently learn certain kinds of multi-index models by first learning a low-dimensional feature. Next, we’ll analyze how neural networks learn other families of multi-index models, and how this can shed light on various deep learning phenomena.

4.1. Beyond non-degeneracy: learning hard functions

Multi-index models give us a lens to understand how properties of the target function affect the difficulty of learning.

Recall that guarantee in the prior section relied on the non-degeneracy assumption that M=Ex∼N(0,Id)[∇2f(x)]\mathbf{M} = \E_{\mathbf{x} \sim \mathcal{N}(\mathbf{0}, \mathbf{I}_d)}[\nabla^2 f(\mathbf{x})] had rank exactly rr. There are, however, some natural functions where this condition is violated. Consider the following Gaussian parity function: f∗(x)=x1x2x3x4f^*(\mathbf{x}) = x_1x_2x_3x_4 A simple calculation yields ∇2f(x)=[0x3x4x2x4x2x3x3x40x1x4x1x3x2x4x1x40x1x2x2x3x1x3x1x20],\nabla^2f(\mathbf{x}) = \begin{bmatrix} 0 & x_3x_4 & x_2x_4 & x_2x_3 \\ x_3x_4 & 0 & x_1x_4 & x_1x_3\\ x_2x_4 & x_1x_4 & 0 & x_1x_2 \\ x_2x_3 & x_1x_3 & x_1x_2 & 0\end{bmatrix}, and thus M=0\mathbf{M} = 0. What is the difficulty of learning in such a setting?

Before getting to the Gaussian parity, let’s start with the simpler case of a single-index model, i.e., f∗(x)=g(u⊤x)f^*(\mathbf{x}) = g(\mathbf{u}^\top \mathbf{x}), for a unit vector u\mathbf{u}. The non-degeneracy assumption is then the condition that Ez∼N(0,1)[g′′(z)]≠0\E_{z \sim \mathcal{N}(0, 1)}[g''(z)] \neq 0. To characterize the complexity of learning in this setting, we’ll need to take a detour into Gaussian space and the Hermite polynomials.

4.1.1. Gaussian space and Hermite polynomials

Since the input distribution is the isotropic Gaussian, it will be natural to work with the function space L2(R,μ)L^2(\mathbb{R}, \mu), the space of square-integrable functions with respect to the Gaussian measure μ=N(0,1)\mu = \mathcal{N}(0, 1). This is an infinite-dimensional vector space (i.e., a Hilbert space), where the vectors are actually functions f:R→Rf: \mathbb{R} \rightarrow \mathbb{R}. Similar to how inner products and norms are defined on vectors in Rd\mathbb{R}^d, we can define inner products and norms between functions f,g∈L2(R,μ)f, g \in L^2(\mathbb{R}, \mu) as follows (for ease of notation, we’ll write L2L^2 instead of L2(R,μ)L^2(\mathbb{R}, \mu)): ⟨f,g⟩L2:=Ez∼μ[f(z)g(z)]∥f∥L22:=Ez∼μ[f(z)2].\begin{aligned} \langle f, g \rangle_{L^2} &:= \mathbb{E}_{z \sim \mu}[f(z)g(z)]\\ \norm{f}^2_{L^2} &:= \mathbb{E}_{z \sim \mu}[f(z)^2]. \end{aligned} The Hermite polynomials {hk}k≥0\{h_k\}_{k \ge 0} are a sequence of polynomials, where hkh_k is a degree kk polynomial, which form an orthonormal basis of L2(R,μ)L^2(\mathbb{R}, \mu). What this means is that, for any j≠kj \neq k, Ez∼μ[hj(z)hk(z)]=0andEz∼μ[hj(z)2]=1.\mathbb{E}_{z \sim \mu}[h_j(z)h_k(z)] = 0 \qand \mathbb{E}_{z \sim \mu}[h_j(z)^2] = 1. Here are the first few Hermite polynomials:

The Hermite polynomials h_1, h_2, h_3, h_4.

The Hermite polynomials h1,h2,h3,h4h_1, h_2, h_3, h_4.

Since the Hermite polynomials form a basis, the link function gg admits a Hermite decomposition: g(z)=c0h0(z)+c1h1(z)+c2h2(z)+⋯=∑k≥0ckhk(z),(4)g(z) = c_0 h_0(z) + c_1 h_1(z) + c_2 h_2(z) + \cdots = \sum_{k \ge 0}c_k h_k(z), \tag{4} where the coefficients ckc_k are the inner products between gg and the basis functions ck:=⟨g,hk⟩L2=Ez∼μ[g(z)hk(z)].c_k := \langle g, h_k \rangle_{L^2} = \E_{z \sim \mu}[g(z)h_k(z)]. Analogous to Lemma 1, the ckc_k can also be expressed in terms of the derivatives of gg: ck=1k!Ez∼μ[g(k)(z)].c_k = \frac{1}{\sqrt{k!}}\E_{z \sim \mu}[g^{(k)}(z)].

The kkth Hermite polynomial hkh_k can be interpreted as the degree kk polynomial which is uncorrelated with all degree <k<k polynomials. As such, the coefficient ckc_k quantifies the size of the “degree kk component” present in the link function gg. The non-degeneracy assumptions in Section 3.2 correspond to the terms c1c_1 or c2c_2 being nonzero; in other words, that gg has a nonzero linear or quadratic component. We can interpret this assumption as requiring there to be sufficient signal in the lower-order terms of gg which reveal the hidden direction u\mathbf{u}.

4.1.2. The information exponent

Let’s now see what happens to the dynamics when the lower-order terms in equation (4) are zero. We’re going to focus on the case where the learner network is itself a single-index model (equivalently, a neural network with width m=1m=1): f(x;w)=σ(w⊤x).f(\mathbf{x}; \mathbf{w}) = \sigma(\mathbf{w}^\top \mathbf{x}). For ease of exposition, we will also assume the target is well-specified: the activation function σ\sigma is equal to the link function gg.

Let us begin by calculating the population loss for an arbitrary unit vector w\mathbf{w}11Since we’re restricting w\mathbf{w} to be a unit vector, to make this fully rigorous one needs to analyze the dynamics of spherical gradient descent, where the gradient update gets projected back to the unit sphere. L(w)=Ex∼N(0,Id)[(g(w⊤x)−g(u⊤x))2]=2∥g∥L22−2Ex∼N(0,Id)[g(w⊤x)g(u⊤x)]=2∥g∥L22−2∑j,kcjckEx∼N(0,Id)[hj(w⊤x)hk(u⊤x)].\begin{aligned} L(\mathbf{w}) &= \E_{\mathbf{x} \sim \mathcal{N}(\mathbf{0}, \mathbf{I}_d)}\left[(g(\mathbf{w}^\top \mathbf{x}) - g(\mathbf{u}^\top \mathbf{x}))^2\right]\\ &= 2\norm{g}^2_{L^2} - 2\E_{\mathbf{x} \sim \mathcal{N}(\mathbf{0}, \mathbf{I}_d)}[g(\mathbf{w}^\top \mathbf{x})g(\mathbf{u}^\top \mathbf{x})]\\ &= 2\norm{g}^2_{L^2} - 2\sum_{j, k}c_jc_k\E_{\mathbf{x} \sim \mathcal{N}(\mathbf{0}, \mathbf{I}_d)}[h_j(\mathbf{w}^\top \mathbf{x})h_k(\mathbf{u}^\top \mathbf{x})]. \end{aligned} To calculate this expectation, we will utilize another property of Hermite polynomials, which generalizes the orthogonality formula to correlated Gaussians:

Lemma 3 (Inner product of correlated Hermite polynomials): For any unit vectors u,w\mathbf{u}, \mathbf{w}, Ex∼N(0,Id)[hj(w⊤x)hk(u⊤x)]={⟨u,w⟩kj=k0j≠k.(5)\E_{\mathbf{x} \sim \mathcal{N}(\mathbf{0}, \mathbf{I}_d)}[h_j(\mathbf{w}^\top \mathbf{x})h_k(\mathbf{u}^\top \mathbf{x})] = \begin{cases} \langle \mathbf{u}, \mathbf{w} \rangle^k & j=k\\ 0 & j \neq k \end{cases}. \tag{5}

Applying Lemma 3, the loss simplifies to L(w)=2∥g∥L22−2∑k≥0ck2⟨u,w⟩k,L(\mathbf{w}) = 2\norm{g}^2_{L^2} - 2\sum_{k \ge 0}c_k^2\langle \mathbf{u}, \mathbf{w} \rangle^k, and thus the gradient is ∇wL(w)=−2u∑k≥1ck2k⟨u,w⟩k−1.\nabla_{\mathbf{w}} L(\mathbf{w}) = -2\mathbf{u} \sum_{k \ge 1}c_k^2k \langle \mathbf{u}, \mathbf{w}\rangle^{k-1}. This population gradient is exactly aligned with the true direction u\mathbf{u}!

However, its magnitude depends on the Hermite decomposition of gg. Note that u\mathbf{u} is a fixed unit vector, while w\mathbf{w} is a random unit vector sampled uniformly over the sphere at initialization. As a result, the quantity ∣⟨u,w⟩∣|\langle \mathbf{u}, \mathbf{w} \rangle| is on the order of d−1/2d^{-1/2}.

Explanation Consider the random variable Z=⟨u,w⟩Z = \langle \mathbf{u}, \mathbf{w} \rangle. The vector w\mathbf{w} has covariance 1dI\frac{1}{d}\mathbf{I}, and thus E[Z2]=E[u⊤ww⊤u]=w⊤Iwd=1d.\E[Z^2] = \E[\mathbf{u}^\top \mathbf{w}\mathbf{w}^\top \mathbf{u}] = \frac{\mathbf{w}^\top \mathbf{I} \mathbf{w}}{d} = \frac{1}{d}. ∣Z∣|Z| is therefore typically on the order of 1/d1/\sqrt{d}.

Therefore the kkth term in the gradient scales as d−(k−1)/2d^{-(k-1)/2}, and so the size of the gradient is dominated by the first nonzero term in the Hermite expansion of gg. This first nonzero term is called the information exponent [17]:

Definition 1. For a function σ\sigma with Hermite decomposition σ=∑k≥0ckhk\sigma = \sum_{k \ge 0}c_k h_k, the information exponent of σ\sigma is defined as k∗:=min⁡{k≥1:ck≠0}k^* := \min\{k \ge 1 : c_k \neq 0\}.

The magnitude of the gradient at initialization thus scales as ∥∇wL(w)∥≍d−k∗−12\norm{\nabla_{\mathbf{w}} L(\mathbf{w})} \asymp d^{-\frac{k^* - 1}{2}}. Finally, since the finite-sample gradient concentrates at the rate12While scalar averages concentrate at 1/n1/\sqrt{n} rates, dd dimensional vectors typically have d/n\sqrt{d/n} concentration. d/n\sqrt{d/n}, in order for the true gradient signal to overpower the finite-sample noise one must take d/n≪d−k∗−12\sqrt{d/n} \ll d^{-\frac{k^*-1}{2}}, or n≫dk∗n \gg d^{k^*}.

Altogether, the information exponent characterizes the geometry of the loss landscape at initialization – a larger information exponent corresponds to a flatter loss landscape near the “equator” (i.e the region where ⟨u,w⟩≈0\langle \mathbf{u}, \mathbf{w} \rangle \approx 0), which increases the number of samples required to learn.

4.2. Online SGD: Emergence

So far, the learning algorithm we’ve considered is full-batch gradient descent. In practice, however, one usually trains a neural network using online SGD with a constant batch size. For the case of learning a single-index model, online SGD with a batch size of 1 samples a new input xt\mathbf{x}_t at each time step, and updates the weights wt\mathbf{w}_t as wt+1=wt−η∇w(g(wt⊤xt)−g(u⊤xt))2.\mathbf{w}_{t+1} = \mathbf{w}_t - \eta \nabla_{\mathbf{w}}\left(g(\mathbf{w}_t^\top \mathbf{x}_t) - g(\mathbf{u}^\top \mathbf{x}_t)\right)^2. A similar picture emerges here where the information exponent characterizes the difficulty of learning.

While in expectation the gradient at each timestep points in the direction u\mathbf{u}, since the batch size is one, the actually gradient has very little correlation with u\mathbf{u} and is dominated by noise. The initial stage of SGD is thus a long plateau – the iterate wt\mathbf{w}_t stays close to the equator (i.e ⟨wt,u⟩\langle \mathbf{w}_t, \mathbf{u}\rangle stays close to d−1/2d^{-1/2}), while the loss stays near its initial value. Eventually, however, after very many gradient steps, the noise terms cancel out and the signal in the gradients compound, and the iterate manages to escape the equator and rapidly converge to u\mathbf{u}. Arous et al. [17] show that Θ~(dk∗−1)\tilde\Theta(d^{k^* - 1}) samples13This is a factor of dd improvement over the sample complexity required to recover u\mathbf{u} in a single step, and is due to a refined martingale concentration technique. (or equivalently time steps) are required to learn a single-index model with information exponent k∗k^*.

Qualitatively, one can show that the learning dynamics follow an emergent learning curve, and exhibit a long plateau phase of length Θ~(dk∗−1)\tilde \Theta(d^{k^* - 1}), followed by a rapid descent phase of length Θ(d)\Theta(d):

Learning curve for the single-index model h_4(<u,x>) via online SGD, showing a long plateau followed by a sharp transition.

Learning the single-index model f∗(x)=h4(⟨u,x⟩)f^*(\mathbf{x}) = h_4(\langle \mathbf{u}, \mathbf{x}\rangle) via online SGD. The loss curve exhibits a long plateau as the iterate wt\mathbf{w}_t escapes the high-entropy equator, followed by a sharp transition as wt\mathbf{w}_t converges to u\mathbf{u}.

We remark that while this proof sketch was for the setting where the learner is a single-index model, similar proof techniques hold when the learner is a two-layer ReLU network [18] under a two-stage learning procedure where in the first stage all first-layer weights neurons converge to the direction u\mathbf{u}, and in the second stage the second-layer weights are trained to fit the link function.

4.3. Staircase functions: incremental learning and saddle-to-saddle dynamics

For single-index models, the information exponent governs the difficulty of learning the hidden direction via SGD. For multi-index models, however, the picture can become more complicated. When there are multiple directions in the target subspace which must be recovered, some of these may be easy (i.e., have correlation with low-degree polynomials), while others might be hard.

Let’s return to our example Gaussian parity function f∗(x)=x1x2x3x4.f^*(\mathbf{x}) = x_1x_2x_3x_4. This is a multi-index model with rank r=4r=4. One can check that f∗f^* is orthogonal to all polynomials of degree 3 or fewer14It suffices to consider monomials, which can depend on at most 3 of x1,x2,x3,x4x_1, x_2, x_3, x_4.. As such, f∗f^* requires Ω~(d3)\tilde \Omega(d^3) samples to be learned via online SGD.15This is by analogy to the information exponent 4 setting in the prior section, but is made rigorous for multi-index models in Abbe et al. [19].

Let us compare this to the following target, which is called a staircase function: fstaircase∗(x)=x1+x1x2+x1x2x3+x1x2x3x4.f_{\mathrm{staircase}}^*(\mathbf{x}) = x_1 + x_1x_2 + x_1x_2x_3 + x_1x_2x_3x_4.

fstaircase∗f_{\mathrm{staircase}}^* contains lower-order information which is possible to be learned in fewer samples. Indeed, from Section 3.2.1, we know that in Θ(d)\Theta(d) samples, a neural network can learn the first-order term Ex[xfstaircase∗(x)]=e1.\mathbb{E}_{\mathbf{x}}[\mathbf{x} f_{\mathrm{staircase}}^*(\mathbf{x})] = \mathbf{e}_1. But what about the remainder of the directions in the hidden subspace?

Quite surprisingly, Abbe et al. [19] show that neural networks can utilize the easy directions in order to learn the hard directions in much fewer samples. For fstaircase∗f_{\mathrm{staircase}}^*, once the direction e1\mathbf{e}_1 has been learned, the “missing” component that remains to be learned is f(1)(x):=x2+x2x3+x2x3x4.f^{(1)}(\mathbf{x}) := x_2 + x_2x_3 + x_2x_3x_4. The first-order term of this missing component is Ex[xf(1)(x)]=e2.\mathbb{E}_{\mathbf{x}}[\mathbf{x} f^{(1)}(\mathbf{x})] = \mathbf{e}_2. It turns out that a neural network can recover this direction e2\mathbf{e}_2 in another Θ(d)\Theta(d) samples. This entire procedure proceeds sequentially; once e2\mathbf{e}_2 is learned, the network is able to learn e3\mathbf{e}_3, and then finally e4\mathbf{e}_4. The total sample complexity is Θ(d)\Theta(d) – far smaller than the Θ(d3)\Theta(d^3) sample complexity required to learn the high-degree monomial x1x2x3x4x_1x_2x_3x_4! The learning dynamics thus proceed as a staircase, with the lower-order terms acting as stepping stones which aid in the learning of the higher-order terms.16See Dandi et al. [20] for a fine-grained characterization of which directions can be learned via multiple steps of GD.

Neural networks learn the staircase function much more efficiently than the parity function.

Neural networks can learn the staircase function f∗(x)=x1+x1x2+x1x2x3+x1x2x3x4f^*(\mathbf{x}) = x_1 + x_1x_2 + x_1x_2x_3 + x_1x_2x_3x_4 much more efficiently than the parity function f∗(x)=x1x2x3x4f^*(\mathbf{x}) = x_1x_2x_3x_4.

This staircase picture is one example of the incremental learning phenomenon – learning components of a function in order of increasing difficulty – displayed by neural networks in practice. Moreover, it demonstrates the simplest example of how neural networks can learn hierarchical structure, where low order terms aid in the learning of high order terms. See Section 5 for more discussion and open questions on learning hierarchical targets.

In a later work, Abbe et al. [19] study a more general family of multi-index models, and introduce the leap complexity, which generalizes the information exponent by quantifying the maximum “leap” in degree that must be made in order to learn another direction in the hidden subspace. For example, for sums of monomials of the form f∗(x)=x1⋯xP1+x1⋯xP2+⋯+x1⋯xPL,f^*(\mathbf{x}) = x_1 \cdots x_{P_1} + x_1 \cdots x_{P_2} + \dots + x_1 \cdots x_{P_L}, where P1<P2<⋯<PLP_1 < P_2 < \cdots < P_L, the size of the llth leap is Dl:=Pl−Pl−1D_l := P_l - P_{l-1}, and the leap complexity is defined as max⁡lDl\max_l D_l. Abbe et al. [19] show that a variant of SGD17Layerwise training, and dependent on the basis of the staircase. will learn this function by learning each monomial one at a time, and where the llth monomial is learned with a sample complexity of Θ(dmax⁡(Dl−1,1))\Theta(d^{\max(D_l - 1, 1)}).

From the perspective of the optimization landscape, the training of high leap complexity functions exhibit a saddle-to-saddle dynamics – the llth saddle corresponds to the neural network having learned the first ll monomials, at which the loss will plateau for a length of time proportional to dDl+1−1d^{D_{l+1} - 1} until the (l+1)(l+1)th monomial is learned. This is analogous to saddle-to-saddle dynamics exhibited in simpler models such as deep linear networks [21,22], and captures the stepwise learning dynamics exhibited by deep neural networks in practice.

This leap complexity and saddle-to-saddle picture is generalized to arbitrary multi-index models in Bietti et al. [23]. While their analysis is focused on the population gradient-flow and an idealized “two-timescale” learning procedure, they demonstrate how the learning of a multi-index model proceeds through a sequence of saddles corresponding to sequentially learning directions in the hidden subspace, where the time required to escape each saddle scales with its corresponding leap. However, a finite-sample convergence result for learning multi-index models under “standard” training conditions remains open.

4.4. Scaling Laws

Multi-index models can also be used to model the existence of neural scaling laws. As neural networks are scaled up in compute, they exhibit two seemingly contradictory phenomena – individual task performances exhibit sharp transitions, while the overall loss follows a smooth, power-law decay. To reconcile this, Michaud et al. [24] proposed the quantization hypothesis.18See Eric Michaud’s excellent blog post here. This posits that neural network dynamics consist of a sequence of discrete quanta whose learning curves exhibit sharp transitions; however, since there are many such quanta and these phase transitions occur at different timescales, the overall loss follows a smooth, power-law decay.

Ren et al. [25] prove that this picture precisely occurs when the target function is itself a two-layer neural network f∗(x)=∑i=1Paiσ(⟨wi,x⟩)f^*(\mathbf{x}) = \sum_{i=1}^P a_i \sigma(\langle \mathbf{w}_i, \mathbf{x} \rangle). In Section 4.1.2, we saw that the learning curve for a single-index model exhibited a long plateau followed by a rapid descent. Ren et al. [25] show that for learning the two-layer network, the loss curve for each individual neuron follows a sharp transition at time proportional to 1/ai1/a_i; yet since the overall loss sums over these many neurons, it follows a smooth, power-law decay. The individual neurons are thus precisely the discrete quanta!

4.5. Further Extensions & Generalizations

Boolean data. So far, we have focused on the case where the input distribution is the isotropic Gaussian. A similar picture emerges when the inputs are drawn uniformly from the Boolean hypercube {±1}d\{\pm1\}^d (i.e., each coordinate is sampled independently from Unif({−1,1})\mathrm{Unif}(\{-1, 1\})). Here, the canonical hard learning problem is the kk-sparse parity function. The kk-sparse parity selects some hidden subset S⊂[d]S \subset [d] of size kk, and defines f∗(x)=∏i∈Sxi.f^*(\mathbf{x}) = \prod_{i \in S} x_i. The parameter kk acts analogously to both the rank (i.e., the size of the sparse subset the target depends on) and the information exponent (the lowest degree polynomial which has nonzero correlation with the target). In order to learn f∗f^*, a neural network must learn to recover the hidden sparse subset SS.

Barak et al. [26] show that a two-layer neural network with width Θ(2k)\Theta(2^k) trained via layerwise SGD can learn the kk-sparse parity task with a sample complexity of dO(k)d^{O(k)}.19Kernel methods also succeed in Θ(dk)\Theta(d^k) samples, yet must have a size (i.e., feature dimension) of Θ(dk)\Theta(d^k) as well; the advantage of neural networks in the feature learning regime is that they require a significantly smaller width. The learning dynamics follow a similar story as in the multi-index setting – during the first stage, the first layer weights learn to encode the hidden subset SS, and in the second stage, the second layer weights converge to implement f∗f^*.

The staircase phenomenon described in Section 4.3 holds as well. Abbe et al. [27] show that for Boolean staircase functions of the form f∗(x)=x1+x1x2+⋯+x1x2⋯xk,f^*(\mathbf{x}) = x_1 + x_1x_2 + \dots + x_1x_2\cdots x_k, SGD gradually learns the support {1,…,k}\{1, \dots, k\} and only needs Θ(d)\Theta(d) samples to learn each individual coordinate, thus requiring only Θ(d)\Theta(d) total samples to learn the entire target.

Lower bounds and optimal sample complexities. One may ask whether the dk−1d^{k-1} sample complexity for learning information-exponent kk functions is optimal. The answer here ends up being no – the information exponent is actually a property of the learning algorithm (here online SGD), while the computational complexity of learning can be quite different. Indeed, modifications to the learning procedure can lead to different characterizations of the difficulty of learning. For example, Damian et al. [28] show that explicitly smoothing the loss landscape (roughly speaking, averaging the loss in the neighborhood of the current parameter) amplifies the gradient signal around random initialization, and leads to learning information-exponent kk functions with a sample complexity of Θ(dk/2)\Theta(d^{k/2}).

Even more strikingly, a recent line of work [29,30,31] has shown that reusing samples can also significantly improve the sample complexity of recovering the hidden subspace. The analyses we’ve considered so far focus on one-pass SGD, where each gradient step is computed on a fresh batch of data. As such, if the target function has no low-degree term, then SGD is unable to extract any signal. However, if the same data points are used for multiple updates, dependence between iterates can lead to nonlinear transformations of the input, which may then reveal low-degree signal. For the case of polynomials, Lee et al. [31] show that a specific sample-reuse procedure can lead to learning arbitrary single-index polynomials with Θ~(d)\tilde \Theta(d) samples – independent of the information exponent! This suggests a potentially important mechanism for practical gradient descent; however, it remains open to understand whether neural networks under standard training can exploit this mechanism optimally.

Finally, I will remark that there is a rich recent literature on algorithms and lower bounds for learning multi-index models, beyond SGD; the interested reader should consult the survey [32] and the references therein.

5. Open Directions

Let’s take a step back and summarize what we’ve covered so far. Our motivating question was to understand how neural networks trained via SGD can perform feature learning. For the setting of learning Gaussian multi-index models – a stylized model of feature learning where the feature corresponds to the low-dimensional subspace – we showed how two-layer neural networks trained via SGD can learn features with far fewer samples than kernel methods. While a number of interesting mathematical questions remain open,20Namely: deriving end-to-end learning guarantees for generic multi-index models, and understanding the robustness of the batch-reuse phenomenon. the prior works we’ve covered have painted a clear conceptual picture of how feature learning occurs in this simple sandbox.

So where do we go next? The multi-index model was designed to be a stepping stone towards understanding more sophisticated forms of feature learning performed by neural networks in practice. I think that the most interesting future directions involve coming up with new settings and abstractions to analyze these more general feature learning phenomena. Below are a few directions I find particularly exciting:

Beyond Gaussian data. One of the biggest limitations of the prior works is that they assume the input distribution is the isotropic Gaussian (or uniform over the Boolean hypercube). The proofs we’ve covered rely heavily on this rotational invariance assumption, either to argue that the initial gradient step recovers the hidden subspace, or to reduce the SGD dynamics to only analyzing the overlap of each neuron with the hidden feature. Real-world data distributions such as images, however, are far from Gaussian. Some works have aimed to generalize existing single-index model analyses to distributions which are close to Gaussian [33], or non-isotropic Gaussian [34]. Yet real-world data distributions may themselves possess low-dimensional structure, such as lying on a low-dimensional manifold [35]. One interesting question is thus to understand what features neural networks can learn, and at what statistical and computational complexity, when both the input distribution and the target function depend on a low-dimensional feature.

Open Question #1: How do neural networks learn features when both the input distribution and the target function are “low-dimensional”?

Hierarchical feature learning and the role of depth. The multi-index model captures a basic example of feature learning, as once the learner recovers the feature x↦Ux\mathbf{x} \mapsto \mathbf{U}\mathbf{x}, it is easy for it to learn the remainder of the target function. In practice, however, it is believed that neural networks use depth to learn a hierarchy of features. For example, in image classification, the first layer may detect edges, while the next may use these edge features to detect shapes. Each layer of the neural network is thus learning a progressively more complex feature.

Open Question #2: How do neural networks use depth to learn a hierarchy of features?

Let me summarize initial progress made towards this question. A multi-index model is simply a target function of the form f∗(x)=g(h(x))f^*(\mathbf{x}) = g(h(\mathbf{x})), where the hidden feature is the linear function h(x)=Uxh(\mathbf{x}) = \mathbf{U}\mathbf{x}. By considering more general features hh – say polynomial functions – one obtains a larger family of hierarchical functions. A recent line of work [36,37,38] has shown that three-layer neural networks are capable of efficiently learning such hierarchical functions for a certain class of polynomial features hh. The learning dynamics proceed similarly to Section 3.2 – the first layer encodes a random feature map, and a single large gradient step on the second layer is able to recover the feature h(x)h(\mathbf{x}). Such functions are not learnable via two-layer neural networks, and thus this establishes a separation between the power of two- and three-layer networks from the perspective of learnability via SGD. More generally, [39,40] introduce hierarchical variants of the multi-index model, where each layer in the hierarchy implements a multi-index model of the output of the previous layer. These works demonstrate cases where GD on a deep network can learn this sequence of features and thus the target function with significantly fewer samples than a shallower network.

While the models we’ve discussed so far operate on continuous inputs, natural language is made up of discrete sequences of tokens, yet nonetheless possesses hierarchical structure we may want a neural network to learn. One interesting question is thus to develop simplified theoretical models which capture the hierarchical structure of language, and understand the extent to which neural networks trained via SGD can learn these models. One example is the Random Hierarchy Model (RHM) [41], a generative model for language where the label of each input sequence depends on a hierarchy of progressively higher level features. Ren et al. [42] show that deep convolutional networks trained via GD can efficiently learn an RHM by learning the hierarchy of relevant features. Developing more general models for language, as well as for domains such as formal math or scientific data, and understanding the dynamics of neural networks when trained on such tasks is another exciting future direction.

Open Question #3: What are theoretical models which capture the hierarchical structure of real-world data, and how are they learned by neural networks?

Connections to feature learning in practice. Stylized analyses of feature learning can still provide insight towards how neural networks are trained in practice, and potentially suggest alternate learning procedures. One relevant mechanism is the Neural Feature Ansatz [43], which posits that the features encoded by the llth layer of a neural network are the “average gradient outer product” of the model output with respect to the input to that layer. For the first layer W1\mathbf{W}_1 of a neural network f(x)f(\mathbf{x}), the Ansatz reduces to W1⊤W1∝Ex[∇f(x)∇f(x)⊤].(6)\mathbf{W}_1^\top \mathbf{W}_1 \propto \mathbb{E}_{\mathbf{x}}\left[\nabla f(\mathbf{x}) \nabla f(\mathbf{x})^\top\right]. \tag{6} When the target function is a multi-index model, equation (6) implies that the first layer weights will learn the hidden subspace U\mathbf{U}, coinciding with our derivation in Section 3.2.2. Radhakrishnan et al. [43] also introduce the Recursive Feature Machine algorithm, an adaptive kernel method which alternates between estimating a subspace of relevant features and fitting a kernel method to these relevant features. This aligns with what we observed for two-layer neural networks, where the training of the second layer is a kernel regression problem with a learned kernel depending only on the subspace U\mathbf{U}.

Another proposed mechanism, called Neural LoFi [44], takes direct motivation from the multi-index derivation. In two-layer networks, we saw that the learned features were given by the matrix M=E[f∗(x)xx⊤]\mathbf{M} = \E[f^*(\mathbf{x})\mathbf{x}\mathbf{x}^\top]. Dandi et al. [44] define an idealized learning procedure where the “features” learned by the llth layer are the top eigenvectors of the matrix E[f∗(x)zl−1zl−1⊤]\E[f^*(\mathbf{x})\mathbf{z}_{l-1}\mathbf{z}_{l-1}^\top], where zl−1\mathbf{z}_{l-1} are the outputs of the previous layer. This procedure agrees with performance of neural networks trained with gradient descent in the early stages of training, learns salient feature maps when trained on image data, and casts hierarchical feature learning in deep networks as a composition of simple, low-degree features.

Open Question #4: What else can our existing stylized analyses of feature learning tell us about how neural networks learn features in practice?

Analyses of vanilla gradient descent. The critical reader may point out that none of the algorithms we’ve discussed correspond to gradient descent literally as it is implemented in practice; indeed, each of these algorithms relies on various “tricks” such as layerwise training or well-chosen initializations and learning rates. Empirically, however, the ability of neural networks to learn multi-index models is much more robust, and occurs beyond just the theoretical settings for which we have provable guarantees. While analyzing stylized variants of SGD provides a starting point towards understanding which behaviors can be learned by neural networks, our ultimate goal is to characterize the learning dynamics under “standard training” conditions such as common initialization schemes and joint training of both layers. Some initial progress has been made towards this goal: Glasgow [45] shows that for the task of learning the XOR (or 2-sparse parity) function f∗(x)=x1x2f^*(\mathbf{x}) = x_1x_2, standard training of a two-layer neural network can learn f∗f^* in Θ~(d)\tilde \Theta(d) samples. Deriving similar learning guarantees for more general families of multi-index models remains an interesting open question, and may require fundamentally new techniques.

Open Question #5: Can we analyze the dynamics of gradient descent under “standard” training assumptions?

Acknowledgements

Thank you to Alex Damian, Jamie Simon, Yunwei Ren, and Zach Izzo for helpful feedback on this post!

References

  1. Chris Olah, Alexander Mordvintsev, and Ludwig Schubert. Feature visualization. Distill, 2017.
  2. Arthur Jacot, Franck Gabriel, and Clément Hongler. Neural tangent kernel: Convergence and generalization in neural networks. NeurIPS, 2018.
  3. Mahdi Soltanolkotabi, Adel Javanmard, and Jason D. Lee. Theoretical insights into the optimization landscape of over-parameterized shallow neural networks. IEEE Transactions on Information Theory, 2018.
  4. Simon S. Du, Xiyu Zhai, Barnabas Poczos, and Aarti Singh. Gradient descent provably optimizes over-parameterized neural networks. arXiv:1810.02054, 2018.
  5. Simon Du, Jason Lee, Haochuan Li, Liwei Wang, and Xiyu Zhai. Gradient descent finds global minima of deep neural networks. ICML, 2019.
  6. Sanjeev Arora, Simon S. Du, Wei Hu, Zhiyuan Li, Russ R. Salakhutdinov, and Ruosong Wang. On exact computation with an infinitely wide neural net. NeurIPS, 2019.
  7. Jaehoon Lee, Samuel Schoenholz, Jeffrey Pennington, Ben Adlam, Lechao Xiao, Roman Novak, and Jascha Sohl-Dickstein. Finite versus infinite neural networks: an empirical study. NeurIPS, 2020.
  8. Lenaic Chizat, Edouard Oyallon, and Francis Bach. On lazy training in differentiable programming. NeurIPS, 2019.
  9. Greg Yang and Edward J. Hu. Tensor Programs IV: Feature learning in infinite-width neural networks. ICML, 2021.
  10. Greg Yang, James B. Simon, and Jeremy Bernstein. A spectral condition for feature learning. arXiv:2310.17813, 2023.
  11. Song Mei, Andrea Montanari, and Phan-Minh Nguyen. A mean field view of the landscape of two-layers neural networks. Proceedings of the National Academy of Sciences 115.33 (2018): E7665-E7671.
  12. Lenaic Chizat and Francis Bach. On the global convergence of gradient descent for over-parameterized models using optimal transport. NeurIPS, 2018.
  13. Behrooz Ghorbani, Song Mei, Theodor Misiakiewicz, and Andrea Montanari. Limitations of lazy training of two-layers neural network. NeurIPS, 2019.
  14. Behrooz Ghorbani, Song Mei, Theodor Misiakiewicz, and Andrea Montanari. Linearized two-layers neural networks in high dimension. 2021.
  15. Daniel Hsu. Dimension lower bounds for linear approaches to function approximation. arXiv:2508.13346, 2025.
  16. Alexandru Damian, Jason Lee, and Mahdi Soltanolkotabi. Neural networks can learn representations with gradient descent. COLT, 2022.
  17. Gerard Ben Arous, Reza Gheissari, and Aukosh Jagannath. Online stochastic gradient descent on non-convex losses from high-dimensional inference. JMLR, 2021.
  18. Alberto Bietti, Joan Bruna, Clayton Sanford, and Min Jae Song. Learning single-index models with shallow neural networks. NeurIPS, 2022.
  19. Emmanuel Abbe, Enric Boix Adsera, and Theodor Misiakiewicz. SGD learning on neural networks: leap complexity and saddle-to-saddle dynamics. COLT, 2023.
  20. Yatin Dandi, Florent Krzakala, Bruno Loureiro, Luca Pesce, and Ludovic Stephan. How two-layer neural networks learn, one (giant) step at a time. JMLR, 2024.
  21. Arthur Jacot, François Ged, Berfin Şimşek, Clément Hongler, and Franck Gabriel. Saddle-to-saddle dynamics in deep linear networks: Small initialization training, symmetry, and sparsity. arXiv:2106.15933, 2021.
  22. Scott Pesme and Nicolas Flammarion. Saddle-to-saddle dynamics in diagonal linear networks. NeurIPS, 2023.
  23. Alberto Bietti, Joan Bruna, and Loucas Pillaud-Vivien. On learning Gaussian multi-index models with gradient flow part I: General properties and two-timescale learning. Communications on Pure and Applied Mathematics, 2025.
  24. Eric Michaud, Ziming Liu, Uzay Girit, and Max Tegmark. The quantization model of neural scaling. NeurIPS, 2023.
  25. Yunwei Ren, Eshaan Nichani, Denny Wu, and Jason Lee. Emergence and scaling laws in SGD learning of shallow neural networks. NeurIPS, 2025.
  26. Boaz Barak, Benjamin Edelman, Surbhi Goel, Sham Kakade, Eran Malach, and Cyril Zhang. Hidden progress in deep learning: SGD learns parities near the computational limit. NeurIPS, 2022.
  27. Emmanuel Abbe, Enric Boix Adsera, and Theodor Misiakiewicz. The merged-staircase property: a necessary and nearly sufficient condition for SGD learning of sparse functions on two-layer neural networks. COLT, 2022.
  28. Alex Damian, Eshaan Nichani, Rong Ge, and Jason D. Lee. Smoothing the landscape boosts the signal for SGD: Optimal sample complexity for learning single index models. NeurIPS, 2023.
  29. Yatin Dandi, Emanuele Troiani, Luca Arnaboldi, Luca Pesce, Lenka Zdeborová, and Florent Krzakala. The benefits of reusing batches for gradient descent in two-layer networks: Breaking the curse of information and leap exponents. arXiv:2402.03220, 2024.
  30. Luca Arnaboldi, Yatin Dandi, Florent Krzakala, Luca Pesce, and Ludovic Stephan. Repetita iuvant: Data repetition allows SGD to learn high-dimensional multi-index functions. arXiv:2405.15459, 2024.
  31. Jason D. Lee, Kazusato Oko, Taiji Suzuki, and Denny Wu. Neural network learns low-dimensional polynomials with SGD near the information-theoretic limit. NeurIPS, 2024.
  32. Joan Bruna and Daniel Hsu. Survey on algorithms for multi-index models. Statistical Science, 2025.
  33. Aaron Zweig, Loucas Pillaud-Vivien, and Joan Bruna. On single-index models beyond Gaussian data. NeurIPS, 2023.
  34. Alireza Mousavi-Hosseini, Denny Wu, Taiji Suzuki, and Murat A. Erdogdu. Gradient-based feature learning under structured data. NeurIPS, 2023.
  35. Mikhail Belkin and Partha Niyogi. Laplacian eigenmaps for dimensionality reduction and data representation. Neural Computation, 2003.
  36. Eshaan Nichani, Alex Damian, and Jason D. Lee. Provable guarantees for nonlinear feature learning in three-layer neural networks. NeurIPS, 2023.
  37. Zihao Wang, Eshaan Nichani, and Jason Lee. Learning hierarchical polynomials with three-layer neural networks. ICLR, 2024.
  38. Hengyu Fu, Zihao Wang, Eshaan Nichani, and Jason Lee. Learning hierarchical polynomials of multiple nonlinear features. ICLR, 2025.
  39. Yatin Dandi, Luca Pesce, Lenka Zdeborová, and Florent Krzakala. The computational advantage of depth in learning high-dimensional hierarchical targets. NeurIPS, 2025.
  40. Joan Bruna. The multiscale single-index model: A stylized model for hierarchical feature learning. arXiv:2607.03347, 2026.
  41. Francesco Cagnetta, Leonardo Petrini, Umberto M. Tomasini, Alessandro Favero, and Matthieu Wyart. How deep neural networks learn compositional data: The random hierarchy model. Physical Review X, 2024.
  42. Yunwei Ren, Yatin Dandi, Florent Krzakala, and Jason D. Lee. Provable learning of random hierarchy models and hierarchical shallow-to-deep chaining. arXiv:2601.19756, 2026.
  43. Adityanarayanan Radhakrishnan, Daniel Beaglehole, Parthe Pandit, and Mikhail Belkin. Mechanism for feature learning in neural networks and backpropagation-free machine learning models. Science, 2024.
  44. Yatin Dandi, Matteo Vilucchio, Luca Arnaboldi, Hugo Tabanelli, and Florent Krzakala. Deep learning as neural low-degree filtering: A spectral theory of hierarchical feature learning. arXiv:2605.13612, 2026.
  45. Margalit Glasgow. SGD finds then tunes features in two-layer neural networks with near-optimal sample complexity: A case study in the XOR problem. ICLR, 2024.