Post · 7 min read· pp. 390–394

Studying inductive biases of random networks via local volumes

In this post, we will study inductive biases of the parameter-function map of random neural networks using star domain volume estimates. This builds on the ideas introduced in Estimating the Probability of Sampling a Trained Neural Network at Random and Neural Redshift: Random Networks are not Random Functions (henceforth NRS).

Inductive biases

To understand generalization in deep neural networks, we must understand inductive biases. Given a fixed architecture, some tasks will be easily learnable, while others can take an exponentially long time to learn (see here and here).

We would like to understand what training tasks different architectures are (un)able to solve, what kind of solutions they find, and whether they have some shared properties, especially relating to the geometry of the parameter-function map. More precisely, we would hope that properties of neural networks at initialization already determine properties of the network over training. This would enable us to make predictions about the trained network ahead of time. To do this, we built on NRS. We summarize a few hypotheses based on their observations:

  1. The Neural redshift hypothesis: Popular architectures have an inductive bias toward simple functions, and this can be observed at initialization.
  2. Complexity of the function represented by a neural net increases with training.
  3. Extreme simplicity bias leads to shortcut learning, the phenomenon where models learn simpler, but more spurious, features of the training distribution. Thus models which are victims of shortcut learning learn worse or not at all.

Parameter-function maps

Say we have a supervised learning task f:X→Yf:X\to Y, where XX and YY are finite sets, and a neural network with weights w∈Ww\in W. While the weights ww induce a function fw:R∣X∣→R∣Y∣f_w :\mathbb{R}^{|X|} \to \mathbb{R}^{|Y|}, the association w↦fww\mapsto f_w is very much non-identifiable, i.e. there are usually many different w,w′∈Ww,w'\in W that induce the same function fw=fw′f_w=f_{w'} (see e.g. here). The map w↦fww\mapsto f_w, called the parameter-function map, has been extensively studied and its properties attributed to the generalization behaviour of neural networks (e.g. here, here and references therein). Thus we can think of the loss landscape as a composition of the parameter-function map and the induced loss function

L:W→pF→LFRL:W\xrightarrow{p} \mathcal{F} \xrightarrow{L_{\mathbb{F}}} \mathbb{R}

where F=fw:R∣X∣→R∣Y∣∣w∈W\mathcal{F}=\\{ f_w:\mathbb{R}^{|X|} \to \mathbb{R}^{|Y|} \mid w\in W \\} is the function space of all possible fwf_w. We stress that the parameter-function map is completely task-independent! It does not take into account the training distribution. In practice, we need to specify a distribution D\mathcal{D} to compare and compute metrics related to fwf_w, but these will still be label-independent. For our experiments we tried both uniform distributions and distributions based on the training data, but we did not observe any significant differences.

That said, our choice of metric, or divergence, on the space of functions is somewhat task-dependent. We could choose a simple, task-agnostic metric, like the maximum distance between the outputs of two functions (f,f′)(f, f') on any input x∈Xx\in X. However, this may not be very useful in practice, as it would not take into account the distribution of the inputs, and in some cases it may not even be defined (if the distance between the functions is unbounded). As soon as we have a distribution D\mathcal{D} over XX, we can define a more informative divergence function, the average KL-divergence between the two functions:

DKL(fw∣∣fw′)=Ex∼D[DKL(fw(x)∣∣fw′(x))]D_{KL}(f_w \mid\mid f_{w'}) = \mathbb{E}_{x\sim \mathcal{D}}[D_{KL}(f_w(x) \mid\mid f_{w'}(x))]

This is a measure of how different the two functions are, weighted by the distribution D\mathcal{D}. It assumes the output of the functions is a probability distribution, but we could also use a different divergence, such as the squared Euclidean distance. While the average KL is data-dependent, it has the nice property that it does not depend on the labels. We therefore use it in our experiments.

Local volume

In the first section we mentioned “the” complexity of a neural network. But there is a large variety of complexity measures (see here, here, and here) with no clear consensus on which one is preferred. In the original NRS paper, the authors used spectral analysis and Lempel-Ziv (LZ) complexity. We were excited to replicate and extend their results using the local volume measure introduced in Eleuther’s recent paper Estimating the Probability of Sampling a Trained Neural Network at Random. Our underlying motivation for a volume based measure is the basin volume hypothesis (see the paper for details):

Let A,B⊂WA,B\subset W be two different regions of the parameter space. Intuitively, we think of them as regions corresponding to different kinds of solutions or behaviours. Then the odds of converging to a solution in AA compared to BB is roughly determined by the ratio of the volumes of the two regions.

We define each region to be a star domain WW such that forallw∈W:C(w)<ϵ\\forall w\in W : C(w)< \epsilon, where CC is some cost function.

A star-shaped region with a line segment from an interior point x_0 to another point x remaining inside the region.

Visualization of the star domain used to estimate local volumes

In our case C(⋅)=KL‾(w0)(⋅)C(\cdot) = \underline{KL}(w_0)(\cdot), but one could also consider the training loss here. We consider star domains because they are a fairly expressive family of shapes, and there exists a tractable algorithm to estimate their volume:

  1. We sample random unit directions uiu_i at w0w_0.
  2. We compute the radii rir_i for which C(w0+r⋅ui)<ϵC(w_0+ r\cdot u_i)<\epsilon for all r<rir<r_i.
  3. We compute a Gaussian integral along the direction uiu_i using the radii rir_i.
  4. Finally, we normalize by taking the average of samples.

The reason for taking a Gaussian integral (rather than the rinr_i ^n) is that the rir_i could be infinite: A direction might not change the cost function at all and therefore the volume would be infinite along this direction. We therefore use the Gaussian integral centered at 00, as this is the distribution of the weights at initialization. Alternative choices such as centering at w0w_0 as done for learning coefficients exist as well. By using a Gaussian measure on the parameter space, we can interpret the volume as a measure of how likely it is to sample a trained network at random.

Experiments

Our setup is as follows. We consider random neural networks, where we vary

  • the number of additional layers from 11 to 55
  • the activation function σ\sigma from ReLU, GELU, Tanh, Sigmoid, Gaussian
  • The weight scale from 10−0.510^{-0.5} to 10{0.5}10 ^\{0.5 \} in logarithmic steps We initialized the network using a uniform distribution scaled by 1sqrtfan{in}\frac{1}{\\sqrt{fan_\{in\}}}, which is the default initialization in PyTorch. We tried other initializations, but they did not change the results significantly.

We ran two types of experiments:

  1. Initialization: We compute the volume of the star domain around the initialization point w0w_0 for different values of ϵ\epsilon across the different architectures. For each set-up we computed volumes for 100100 different seeds.
  2. Training: We train the networks on a simple task (modular addition) and compute the volume of the star domain along the training checkpoints.

1. Initialization

Heatmaps of estimated volumes by weight amplitude and number of additional layers, shown separately for ReLU, GELU, Tanh, Gaussian, and Sigmoid activations.

Overall, we were not able to replicate the findings in NRS. Specifically, we did not observe that higher weight amplitude and additional layers lead to a lower volume of the star domain (as those correspond to more complex solutions according to the basin volume hypothesis).

2. Training

Snapshot of an interactive element (see the live page)

Similarly, we did not find that the volume of the star domain is a good predictor for learning behaviour. While training does generally lead to lower volumes, we observe architectures with similar local volumes (e.g. ReLU and GELU) but different learning behaviour (more GELUs grokked). The final volumes of the star domain do not seem well correlated with the learning behaviour of the networks.

Conclusion

Inductive biases play an important role in the generalization behaviour of neural networks. But it seems unlikely that one single measure can faithfully capture the inductive bias of a neural network via a one-dimensional notion of complexity.

Overall, we could not provide further evidence for the neural redshift hypothesis, as we did not observe a correlation between the volume of the star domain and the learning behaviour of the networks. We remain interested in geometric descriptions of the parameter-function map and the loss landscape, but we will need to explore other measures besides the local volume.