Lucius Bushnaq Jake Mendel Stefan Heimersheim Dan Braun Nicholas Goldowsky-Dill Kaarel Hänni Cindy Wu Marius HobbhahnApollo ResearchCorrespondence to Lucius Bushnaq <lucius@apolloresearch.ai>Cadenza LabsIndependent
Abstract
Mechanistic Interpretability aims to reverse engineer the algorithms implemented by neural networks by studying their weights and activations. An obstacle to reverse engineering neural networks is that many of the parameters inside a network are not involved in the computation being implemented by the network. These degenerate parameters may obfuscate internal structure. Singular learning theory teaches us that neural network parameterizations are biased towards being more degenerate, and parameterizations with more degeneracy are likely to generalize further. We identify 3 ways that network parameters can be degenerate: linear dependence between activations in a layer; linear dependence between gradients passed back to a layer; ReLUs which fire on the same subset of datapoints. We also present a heuristic argument that modular networks are likely to be more degenerate, and we develop a metric for identifying modules in a network that is based on this argument. We propose that if we can represent a neural network in a way that is invariant to reparameterizations that exploit the degeneracies, then this representation is likely to be more interpretable, and we provide some evidence that such a representation is likely to have sparser interactions. We introduce the Interaction Basis, a tractable technique to obtain a representation that is invariant to degeneracies from linear dependence of activations or Jacobians.
1 Introduction
Mechanistic Interpretability aims to understand the algorithms implemented by neural networks (Olah etal., 2017; Elhage etal., 2021; Räuker etal., 2023; Olah etal., 2020; Meng etal., 2023; Geiger etal., 2021; Wang etal., 2022; Conmy etal., 2024). A key challenge in mechanistic interpretability is that neurons tend to fire on many unrelated inputs (Fusi etal., 2016; Nguyen etal., 2016; Olah etal., 2017; Geva etal., 2021; Goh etal., 2021) and any apparent circuits in the model often do not show a single clear functionality and do not have clear boundaries separating them from the rest of the network (Conmy etal., 2023; Chan etal., 2022).
We suggest that a central problem for current methods of reverse engineering networks is that neural networks are degenerate: there are many different choices of parameters that implement the same function (Wei etal., 2022; Watanabe, 2009). For example, in a transformer attention head, only the product of the and matrices influences the network’s output, thus, many different choices of and are parameterizations of the same network (Elhage etal., 2021). This degeneracy makes parameters and activations an obfuscated view of a network’s computational features, hindering interpretability. While we have workarounds for known architecture-dependent degeneracies such as the case, Singular Learning Theory (SLT, Watanabe, 2009, 2013) suggests that we should expect additional degeneracy in trained networks that generalize well.
SLT quantifies the degeneracy of the loss landscape around a solution using the local learning coefficient (LLC) (Lau etal., 2023; Watanabe, 2009, 2013). More degenerate solutions lie in broader ‘basins’ of the loss landscape, where many alternative parameterizations implement a similar function. Networks with lower LLCs are more degenerate, implement more general algorithms, and generalize better to new data (Watanabe, 2009, 2013).These predictions of SLT are only straightforwardly applicable to the global minimum in the loss landscape; a generalization is required to applythese insights to real networks.
In this paper we make the following contributions.First, in Section 2 we propose changes to SLT to make it useful for interpretability on real networks.Then, in Section 3 we characterize three ways in which neural networks can be degenerate.In Section 4, we prove a link between some of these degeneracies and sparsity in the interactions between features.In Section 5, we develop a technique for searching for modularity based on its relation to degeneracy in the loss landscape.Finally in Section 6, we propose a practical technique for removing some of these degeneracies in the form of the interaction basis.
2 Singular learning theory and the effective parameter count
If a neural network’s parameterisation is degenerate, this means there are many choices of parameters that achieve the same loss. At a global minimum in the loss landscape, more degeneracy in the parametrisation implies that the network lies in a broader basin of the loss. We can quantify how broad the basin is using Singular Learning Theory [SLT, Watanabe 2009, 2013; Wei etal. 2022].
In Section 2.1, we provide an overview of the key concepts from SLT that we will make use of. In Section 2.2 we explain why the tools of SLT are not completely suitable for identifying degeneracy in model internals. As a proposal to resolve some of these limitations, we introduce the behavioral loss in Section 2.2.1, and finite data singular learning theory in Section 2.2.2. Together, these concepts will allow us to define the effective parameter count, a measure of the number of computationally-relevant parameters in the network. If we achieved our goal of a fully parameterisation-invariant representation of a neural network, its explicit parameter count would equal its effective parameter count.
2.1 Background: the local learning coefficient
The most important quantity in SLT is the learning coefficient . We define a data distribution and a family of models with parameters, parameterised by a vector in a parameter space . We also define a population loss function which is normalised so that at the global minimum . Then is defined as (Watanabe, 2009):111See Watanabe (2009) for a more rigorous definition of the learning coefficient.
(1)
where is the volume of the region of parameter space with loss less than :
(2)
The learning coefficient quantifies the way the volume of a region of low loss changes as we ‘zoom in’ to lower and lower loss. It is a measure of basin broadness, and SLT predicts that networks are biased towards points in the loss landscape with lower learning coefficient.
Since the loss landscape can have many different solutions with minimum loss, this definition does not necessarily single out a region corresponding to a single solution.Therefore Lau etal. (2023) introduce the local learning coefficient (LLC, denoted by ) as a way to use the machinery of SLT to study the loss landscape geometry in the neighbourhood of a particular local minimum at by restricting the volume in the definition of the learning coefficient to a neighbourhood of that minimum satisfying . Then we define the local volume:
(3)
and the local learning coefficient:
(4)
To see why the LLC can be thought of as counting the degeneracy in the network, consider a network with parameters, with degrees of freedom in the parameterisation (such that of the parameters can be freely varied together or independently, without affecting the loss). Then, we can approximate the loss by a Taylor series around the minimum:
(5)
where is the Hessian at the mininum. Consider the case that all functionally relevant parameters all contribute a quadratic term to the loss to leading order, and degrees of freedom correspond to parameters which the loss does not depend on at all. In this case, Murfet (2020) explicitly calculate the LLC, showing that it equals — i.e. the LLC counts the number of functionally relevant parameters in the model.
There is a sense that in such a model, the nominal parameter count is misleading, and if there are degrees of freedom then there are effectively only actual parameters in the model. Indeed, this is the right perspective to take for selecting a model class to fit data with. Watanabe (2013) demonstrates that for models with parameter-function maps that are not one-to-one, the Bayesian Information Criterion (Schwarz, 1978), which predicts which model fit to given data generalizes best (Hoogland, 2023), should be modified: the parameter count of the model should be replaced with .
In this simple example, the LLC is equal to half the rank of the Hessian at the minimum, and one might wonder if these two quantities are always related in this way. It turns out that they are only the same when the loss landscape can be written locally as a sum of quadratic terms, but this isn’t always true. For example, the loss landscape could be locally quartic in some directions, or the set of points with loss equal to 0 may form complicated self intersecting shapes like a cross. In these cases, it is the LLC, not the rank of the Hessian, that measures how much freedom there is to change parameters and how much we expect a particular model to generalise.
2.2 Modifying SLT for interpretability
We would like to use the local learning coefficient to quantify the number of degrees of freedom in the parameterisation of a neural network — the number of ways the parameters in a neural network can be changed while still implementing the same function, or at least a highly similar function. However, there are some obstacles to using the LLC for this purpose:
1.
The LLC measures the size of the region of equal loss around a particular local minimum in the loss landscape. This loss landscape is defined by a loss function and a dataset of inputs and labels. Unless the network achieves optimal loss on this dataset, points in the region could have equal loss even though they correspond to different functions, if these functions achieve the same average performance over the dataset. We do not want our measure of the number of degrees of freedom to include different functions which achieve the same overall loss.
2.
The local learning coefficient is only well defined at a local minimum of the loss, but we frequently want to interpret neural networks that have not been trained to convergence and are not at a minimum of the loss on their training distribution.
3.
We would like to be able to consider two very similar but not identical functions to be the same function, if they only differ in ways that can be considered noise. This is partially because, after finite training time, a network will not have fully converged on the cleanest version of an algorithm without any noise222Indeed, sometimes it is possible to remove this noise and improve performance (Nanda etal., 2023). However, the formal approach of SLT studies models in the limit of infinite data. This turns out to correspond to taking the limit in the definition of the LLC (equation 4) — after infinite data, the LLC is determined by the scaling of the volume function at loss equal to . This means that the LLC contains information only about exact degeneracies in the parameterization — only about different parameterisations that are at the local minimum. Instead, we would prefer to work with a modified LLC which quantifies the number of parameterization choices which correspond to approximately identical functions.
We introduce the behavioral loss as a resolution to problems (1) and (2), and finite data SLT as a resolution to problem (3).
2.2.1 Behavioral loss
In this section, we describe how we can define the local learning coefficient of a network to avoid problems 1 and 2 listed above.We want to define a new loss function and corresponding loss landscape for the sake of the SLT formalism (we do not train with this loss) such that all the parameter choices in a region with zero loss correspond to the same function on the training dataset: the same map of inputs to outputs.This loss function, which we call the Behavioral Loss, , is defined with respect to an original neural network with an original set of parameters , and defines how similar the function implemented by a different set of parameters is to the original function :
(6)
where is the training dataset and denotes the -norm of 333We arbitrarily chose an MSE loss here, but conceptually we require a loss which is non-negative and satisfies identity of indiscernibles: . For example, when studying an LLM, it may be more suitable to use KL-divergence..By definition, this loss landscape always has a global minimum at the parameters the model actually uses , solving problem 2 above. Additionally, parameter choices which achieve 0 behavioral loss must have the same input-output behaviour as on the entire training dataset, solving problem 1.Note that achieving zero behavioral loss relative to a model with parameters is a stricter requirement than achieving the same loss as the model with parameters on the training data.Therefore, the behavioral loss LLC will be equal to, or higher than the training loss LLC .
2.2.2 Singular learning theory at finite data
Next we want to resolve the problem that standard SLT formulae concern only the limit of infinite data when the model is certainly at a local minimum of the loss landscape. We would like to think of a neural network trained on a finite amount of data as implementing a core algorithm we are interested in reverse engineering, plus some amount of ‘noise’ which may vary with the parameterisation and which is not important to interpret. For example, in a modular addition transformer (Nanda etal., 2023), there are parts of the network which can be ablated to improve loss: these parts of the network may be present because the model has not fully converged to a minimum yet. In this case, if we have two transformers trained on modular addition which have the same input-output behaviour after we have ablated parts to improve performance, then we would like to consider these models as implemtenting the same function ‘up to’ noise before we ablate those parts.
In this section, we sketch how to modify SLT so that the LLC becomes a measure of how many different parameterisations implement nearly the same function, rather than exactly the same function. In this way, we can numerically vary how much the functions two different parameterisations implement are allowed to differ from each other on the training data.
We start by explaining why SLT takes the limit in the definition of the learning coefficient (equation 1). SLT is a theory of Bayesian learning machines: learning machines which start with some prior over parameters which is nonzero everywhere , and which learn by performing a Bayesian update on each datapoint they observe. After a dataset of datapoints, the posterior distribution over parameters is:
(7)
where is the negative log likelihood of the dataset given the model , which we identify with the loss function when making a connection between Bayesian learning and SGD (Murphy, 2012), and is a normalisation factor.
The exponential dependence on ensures that in the limit , a Bayesian learning machine’s posterior is only nonzero at points of minimum loss. This means that the asymptotic behaviour of the learning machine depends only on properties of the loss landscape that are asymptotically close to having zero loss. This is the reason that we take in the definition of the learning coefficient.
However, since the parameters we find after finite steps of SGD correspond to an algorithm plus noise, we want to consider the size of the region of parameter space that achieves a behavioral loss less than the noise size. From a bayesian learning perspective, in equation 7, we can see that for large but finite number of data points, most of the posterior concentrates around the regions of low loss, but it does not fully concentrate on the region with exactly minimum loss.
Therefore, we simply refrain from taking the limit as the loss scale goes to in the definition of the learning coefficient, and consider the learning coefficient at a particular loss scale:
(8)
To understand how the learning coefficient can vary with epsilon, consider an illustrative example: an extremely simple setup with a single parameter , and a loss function with . This is a toy model of a scenario where there is a very small quadratic term in the learning coefficient. This term is only ‘visible’ to the learning coefficient when we zoom in to very small loss values. To see this, we must the calculate how the volume (equation 2) depends on the loss scale .For large , the quartic term dominates the loss and the region of loss less than is roughly the interval .This gives so the learning coefficient is , the same as if the quadratic term were not present.On the other hand, for small enough , the quadratic term becomes visible: , so .
Determining how to choose an appropriate cutoff is still an open problem. We suggest that researchers choose the value of the behavioral loss cutoff in the context of the question they would like to answer. For example, if one trains multiple models with different seeds on the same task, then the appropriate loss cutoff may be on the order of the variance between the seeds.
Finally, we are able to quantify the amount of degeneracy in a neural network. We define the Effective Parameter Count of a neural network at noise scale astwo times the local learning coefficient of the behavioral loss with respect to the network at noise scale epsilon.
(9)
We conjecture that a fully parameterisation invariant representation of a neural network which captures all the behaviour up to noise scale would require parameters.
3 Internal structures that contribute to degeneracy
In this section, we will show three ways the internal structure of neural networks can induce degrees of re-parametrization freedom in the loss landscape. Since , this is equivalent to showing three ways the internal structures of neural networks determine their effective parameter count. We do not expect that these three sources of re-parametrization freedom offer a complete account of all degeneracy in real networks. They are merely a starting point for relating the degeneracy of networks to their computational structure at all.
For ease of presentation, most of the expressions in this section are only derived for the example case of fully connected networks. They can be generalized to transformers, though we do not show this explicitly here.
In Section 3.1, we show a relationship between the effective parameter count and the dimensions of the spaces spanned by the network’s activation vectors (Section 3.1.1) and Jacobians (Section 3.1.2) recorded over the training data.In Section 3.2, we show a relationship between the number of distinct nonlinearities implemented in a layer of the network on the training data and the effective parameter count.
3.1 Activations and Jacobians
In this section, we show how a network having low dimensional hidden activations or Jacobians leads to re-parametrisation freedom.
We begin by bringing the network’s Hessian, which gives the first non-zero term in the Taylor expansion of the loss around an optimum (See equation 5) into a more convenient form.Each local free direction in the loss landscape corresponds to an eigenvector of the Hessian with zero eigenvalue.444The reverse does not hold, due to higher order terms in the expansion in equation 5. See (Watanabe, 2009, 2013). Therefore, the rank of the Hessian can be used to obtain a lower bound for the learning coefficient.
Consider the Hessian of a fully connected network, with parameters , network inputs and network outputs , on a behavioural loss evaluated on a dataset consisting of inputs. Using the chain rule, the Hessian at the global minimum can be written as:
(10)
for . In the second line, we have used that the loss function is MSE from outputs at to simplify the expression, and we have also used that the first derivatives of the loss are zero at the minimum555If we were to use a different behavioural loss such as KL divergence, this would mean that the term would not be equal to This means that different output activations (logits for a language model) would be weighted differently, but the story of this section would be largely the same.. Thus, the Hessian is equal to a Gram matrixof the network’s weight gradients , and linear dependence of entries of the weight gradients over the training set corresponds to zero eigenvalues in the Hessian.
We can apply the chain rule again to rewrite the gradient vector on each datapoint as an outer product of Jacobians and activations:
(11)
where the Jacobian is taken with respect to preactivations to layer :
Thus, every degree of linear dependence in the activations or Jacobians in a layer of the network also causes degrees of linear dependence in the weight gradient of the network, potentially resulting in re-parametrisation freedom for the network. In the next two sections, we explore how linear dependence in the activations and Jacobians respectively impact the effective parameter count.
3.1.1 Activation vectors spanning a low dimensional subspace
Looking at equation 11, each degree of linear dependence of the activations in a hidden layer of width over the training dataset ,
(13)
corresponds to linearly dependent entries in the weight gradient , eigenvectors of the Hessian with eigenvalue zero, and fully independent free directions in the loss landscape than span a fully free dimensional hyperplane. So the effective parameter count will be lower than the nominal number of parameters in the model by for each such degree of linear dependence in the hidden representations.
More generally, we can take a PCA of the activation vectors in layer by diagonalising the Gram matrix of activations
(14)
If there is linear dependence between the activations on the dataset, some of the singular values (eigenvalues of ) will be zero. If wetransform into rotated layer coordinates , then the parameters of the transformed weight matrix in rows which connect to the directions with zero variance can be changed freely without changing the product .
In reality, a gram matrix of activation vectors will never have eigenvalues that are exactly 0. However, if a particular eigenvalue has size for some , the transformed parameters inside can be changed by while only impacting the loss by .
This suggests that, under the finite-data SLT picture introduced in Section 2.2.2, singular values of the set of activation vectors that are less than for noise scale result in a lower effective parameter count, with effective parameters less for every small singular value.So, if we view the PCA components in a layer as the ’elementary variables’ of that layer, then the fewer elementary variables the network has in total, the lower the effective parameter count will be.
Relationship to weight norm
One might be concerned that linear dependencies between the activation vectors on the training dataset might not hold for activation vectors outside the training dataset, such that the entries of the weight matrix that we are treating as free do in fact affect the off-distribution outputs of the network.
However, SOTA optimisers often use weight decay or weight regularisation during training to improve network generalization (Loshchilov and Hutter, 2019). This biases training towards networks with a smaller total -weight norm, .Since the Frobenius norm is invariant under orthogonal transformations, the weight regularisation can equivalently be thought of as biasing training towards low . Since the entries of which connect to the zero principal components do not affect the output, the training will be biased to push them to 0.This is an example of weight regularisation improving generalisation performance: if, at inference time, an activation vector has variation in a direction not seen during training, a regularised model ignores that component of the activation vector.
3.1.2 Jacobians spanning a low dimensional subspace
We have shown that if the set of activation vectors in some layer have linear dependence over a dataset, then some parameters are free to vary without affecting outputs on that dataset. A similar story can be told when the Jacobians do not span the full space of the layer. As with the activations, we look for zero eigenvalues in the gram matrix of the Jacobians:
(15)
Any zero eigenvalue in this gram matrix leads to zero eigenvalues in the Hessian, analogous to the previous section. We can transform into rotated layer coordinates , and the parameters of the transformed weight matrix in columns which connect to the directions with zero variance can be changed freely without changing the product .However, unlike with the activation PCA components, the free directions in the Hessian from Jacobians spanning a low-dimensional subspace may not always correspond to full degrees of freedom in the parametrization. This is due to the potential presence of terms above second order in the perturbative expansion around the loss optimum, see equation 5, which can cause the loss to change if the parameters are varied along those directions despite the Hessian being zero Watanabe (2009).
Jacobians between hidden layers
Note that we can decompose each Jacobian from layer to layer into a product of Jacobians between adjacent layers by the chain rule:
(16)
Thus, any rank drop in a gram matrix of Jacobians from layer to layer necessarily also leads to a rank drop in the gram matrix of the Jacobians from layer to layer , and thus zero eigenvalues in the Hessian.
3.2 Synchronized nonlinearities
In this section, we demonstrate a third example of internal structure that affects the effective parameter count of the model.The two examples we presented in the previous sections might be thought of as showing how the network having fewer relevant variables in its representation in a layer leads to more degeneracy.The example we present in this section shows how the network performing “fewer operations” leads to more degeneracy.
In a dense layer with piecewise linear activation functions (ReLU or LeakyReLU), the effective parameter count is reduced if two neurons have the same set of data points for which they are ‘on’ and ‘off’. We call neurons with this property synchronized with each other. For simplicity, in this section, we will consider a dense feedforward network with ReLU nonlinearities at each layer, and the same hidden width throughout.
We define the neuron firing pattern
(17)
where is the preactivation of neuron .We call two neurons and synchronized if they always fire simultaneously on the training data, .
All synchronized
As a pedagogical aid, and to demonstrate a point on how the effective parameter count is invariant to linear layer transitions, we first consider the case of all the neurons in layer being synchronized together in the same firing pattern . Then we can write:
meaning and effectively act as a single dimensional matrix . Thus, any setting of the weights and that yield the same do not change the network’s outputs on the training data, so long as we avoid changing any of the .We can ensure that the do not change as we vary the weights by restricting ourselves to alternate weight matrices
(18)
Note that a linear layer (without activation function, i.e. ) is just a special case of all neurons being synchronized .When is full rank, the drop in the effective parameter count from full synchronisation is the number of parameters in layer . So we see that from the perspective of the effective parameter count, linear transitions ‘do not cost anything’ — including the linear transition in the model does not meaningfully increase the effective parameter count compared to skipping the layer entirely. We are simply passing variables to the next layer without computing anything new with them.777See (Aoyagi, 2024) for a more complete treatment of effective parameter counts in deep linear networks.
synchronized blocks
Now, we consider the general case of arbitrary neuron pairs in a layer being synchronized or approximately synchronized. We can organise neurons into sets , with the same activation patterns for all neurons in the set. We call these sets synchronized blocks. This works because synchronisation is a transitive property, if and , then .
Each neuron belongs to one block, so . Then we have:
(19)
We can replace , where the matrix has a block-diagonal structure
and
Just as we do not expect activations and gradients to have exact rank drops, we do not expect exact neuron synchronisation to be common in real models. Instead, we can consider two neurons to be approximately synchronized if their activations only meaningfully differ on a few datapoints. Numerically, we can define:
(20)
If is non-zero but small, choosing different weight matrices as above will only increase the loss by an amount proportional to .
Degeneracy counting
: For each pair of synchronized neurons , we can set a pair of off-diagonal entries in to arbitrary positive values when we change the weights to .If is full rank, the rows and are linearly independent, so this synchronized pair will result in two free directions in parameter space. Thus, we have as many free directions in parameter space as we have synchronized neurons. We can also count this as the number of the synchronized neurons in each block squared
We then see that is highest if all the neuron firing patterns are synchronized, and lowest when all neurons have different firing patterns.
However, is not always full rank. Further, if we want to combine the degrees of freedom from neuron synchronisation with other degrees of freedom from this section, we have to be careful to avoid double-counting. If the activations in layer lie in low-dimensional subspaces, then some of the degrees of freedom above may already have been accounted for.If we remove those double-counted degrees of freedom and control for the rank of , each synchronized block only provides additional degrees of freedom equal to the dimensionality of the space spanned by the preactivations of block over the dataset squared, which we denote
(21)
So more generally, the additional amount of degeneracy the effective parameter count is lowered by will be
(22)
The trivial case of self-synchronisation is not excluded here in this formula.It corresponds to the generic freedom to vary the diagonal entries of , of a ReLU layer: scaling all the weights going into a neuron by and scaling all the weights out of the neuron by does not change network behavior.
Attention
A similar dynamic holds in the attention layers of transformers, with the attention patterns of different attention heads playing the role of the activation patterns. If two different attention heads in the same attention layer have synchronized attention patterns on the training data set, their value matrices can be changed to add elements in the span of the value vectors of one head to the other head, with the output matrices that project results back into the residual stream being modified to undo the change. If are full rank, this results in degrees of freedom in the loss landscape for each synchronized attention head, in addition to the generic degrees of freedom per attention head that are present in every transformer model. If is not full rank, we account for this similarly as we did with the neurons above.
4 Interaction sparsity from parameterisation-invariance
In the introduction, we argued that if we can represent a neural network in a parameterisation-invariant way, then this representation is likely to be a good starting point for reverse-engineering the computation in the network.The intuition behind this claim is that in the standard representation, parts of the network which do not affect the outputs act to obfuscate and hide the relevant computational structure — once these are stripped away, computational structure is likely to become easier to see.One way this could manifest is through the new representation having greater interaction sparsity.
In this section, we demonstrate that picking the right representation can indeed lead to sparser interactions throughout the network. Specifically, we show that we can find a representation such that, for every drop in the effective parameter count caused by either (a) activation vectors not spanning the activation space (Section 3.1.1) or (b) neuron synchronisation (Section 3.2), there is at least one pair of basis directions in adjacent layers of the network that do not interact.
The role of this section is to provide a first example of a representation of a network which has been made invariant to some reparameterisations, and show that this representation has correspondingly fewer interactions between variables. The algorithm sketch used to find the representation here is not very suitable for selecting sparsely connected bases in practical applications, since it is somewhat cumbersome to extend to non-exact linear dependencies. We introduce a way to choose a basis for the activations spaces that is more suitable for practical applications in Section 6.
Consider a dense feedforward network with ReLU activation functions, with degrees of freedom in its parameterization that arise from a combination of
1.
The gram matrix of activation vectors in some layers being low rank, see Section 3.1.1.
2.
Blocks of neurons being synchronized, see Section 3.2.
We will now show that we can find a representation of the network that
1.
exploits the degrees of freedom due to low-dimensional activations to sparsify interactions through a re-parametrisation.
2.
exploits the degrees of freedom from neuron synchronisation to sparsify interactions through a coordinate transformation, without losing the sparsity gained in step 1.
Sparsifying using low dimensional activations
Here, we show how to exploit the degrees of freedom in the network due to low-dimensional activations in the input layer to sparsify interactions.
Suppose that the gram matrix of activations of the input layer, is not full rank. This means that we can take a set of neurons as a basis for the space. This will be fewer neurons than the width of the input payer. Writing
(23)
we can replace the weights with new weights
(24)
In this way we can disconnect many neurons from the next layer without changing the activations in layer 2 at all on the training dataset, since .For every degree of linear dependence we may have had in layer , we now have weights set to zero, where is the width of the second MLP layer. Since two neurons that are connected by a weight of 0 do not interact, this means that we can associate each drop in the effective parameter count caused by linear dependence between activations in layer 1 with a pair of nodes in the interaction graph which do not interact.
Sparsifying using synchronized neurons
Now, we show that we can exploit the degrees of freedom in the network from the synchronisation of neurons in the first hidden layer to sparsify interactions without losing any of the sparsity we gained in the previous step.
Taking the example of the second layer , we want to find a new coordinate basis in which there is at least one pair of variables that does not interact for each drop in the effective parameter count caused by neuron synchronisation.
To choose this basis, we start by finding all pairs of neuron firing patterns in layer that are synchronized and group them into sets of synchronized blocks.Continuing with the same notation as in Section 3.2, we denote the blocks of synchronized neurons , with size , and we use the notation to denote the matrix in with entries given by .Then, we choose the transformation to be block diagonal
(25)
with the blocks given by the inverse888Technically the pseudoinverse, because does not need to be invertible. of the blocks of :
(26)
(27)
This coordinate transformation will set one interaction to zero per drop in the effective parameter count caused by neuron synchronisation. To see this, we first consider that commutes with the nonlinearity applied between layers 1 and 2
(28)
The product will thus have block diagonal entries equal to the identity . This means will at minimum have an additional entries that are zero — one non-interacting pair of nodes per degree of non-generic parametrization freedom caused by neuron synchronization, see equations 21, 22.These absent interactions are distinct from those due to the activation vectors in layer 1 not spanning the full activation space we found in the previous step. Thus, the minimum absent interactions add up to be equal or greater to the degrees of freedom in the loss landscape stemming from low dimensional activations in the input layer or synchronized neurons in the first hidden layer .
Repeat for every layer
Now, we can repeat the previous two steps for all layers, moving recursively from the input layer to the output layer. We check if the activation vectors in layer 2 do not span the activation space and pick new weights accordingly. Then we check if any neurons in layer three are synchronized and transform accordingly. We repeat this for every layer in the network.
We thus obtain new weight matrices, and a new basis for the activations of every layer in the network. Treating the new basis vectors in each layer as nodes in a graph, we can build a graph representing the interactions in the network. This graph will have two properties:
1.
It has at least one interaction that is zero for every drop in the effective parameter count introduced by neuron synchronisation or activation vectors spanning a low dimensional subspace
2.
It is invariant to reparameterisations that exploit these degeneracies.
5 Modularity may contribute to degeneracy
A core goal of interpretability is breaking up a neural network into smaller parts, such that we can understand the entire network by understanding the individual parts. In this section we propose a particular notion of modularity that could be used to identify these smaller parts. We argue that this notion of modularity is likely to occur in real networks due to its relation to the LLC.
The core claim of this section is that more modular networks are biased towards lower LLC. We argue that if modules in a network interact less (i.e the network is more modular) this yields a higher total degeneracy and thus a lower LLC. Each module has internal degeneracies: if two modules do not interact then the degeneracies in each are independent of each other, so the total amount of degeneracy in the network (from these modules) is at least the sum of the amount of degeneracy within each module. However, if the modules are interacting, then the degeneracies may interact with each other, and the total amount of degeneracy in the network can be less. Therefore, networks which have non- or weakly- interacting modules typically have more degeneracy and thus a lower LLC, which means that neural networks are biased towards solutions which are modular.
The argument in this section does not preclude non-modular networks from having a lower LLC than modular networks in any specific instance. Instead, this section presents an argument that, all else equal, modularity is associated with a lower effective parameter count. This argument could fail in practice if more modularity turns out to increase the effective parameter count of models for a different reason, or if real neural networks simply do not have low-loss modular solutions.
In Section 5.1 we define interacting and non-interacting degeneracies,and show that the total degeneracy is higher in when individual degeneracies do not interact. In Section 5.2 we quantify how modularity affects the LLC by studying a series of increasingly realistic scenarios. First, we consider the case of twomodules which do not interact at all in Section 5.2.1. Then we explore how to modify the analysis for modules which have a small number of interacting variables in Section 5.2.2. Finally, in Section 5.2.3 we extend our analysis to allow for the strength of interactions to vary. We arrive at a modularity metric which can be used to search for modules in a computational graph.
5.1 Interacting and non-interacting degeneracies
If a network’s parameterization has a degeneracy, then there is some way the parameters of the network can change without changing the input-output behavior of the network. This change corresponds to a direction that can be traversed through the parameter space along which the behavioral loss stays zero. We call such a direction a free direction in the parameter space. It’s also possible for a parameterization to have multiple degeneracies and thus multiple free directions.
We call a set of free directions non-interacting if traversing along one free direction does not affect whether the other directions remain free. In this case, the set of non-interacting free directions span an entire free subspace of the parameter space. In a parameter space with and loss given by , we are free to pick any value of and while remaining at the minimum of the loss provided that . The area of constant loss is a 2-dimensional plane.
The set of free directions is called interacting if traversing along one free direction does affect whether other directions remain free. For an extreme example, consider the loss function (figure 1) at its minimum (0,0). In this case there are two free directions, but when we traverse along one free direction the other direction ceases to be free. The area of constant loss does not span a full subspace (a 2-dimensional plane); here is resembles a cross (see Figure 1) which is a 1-dimensional object.
We can explicitly calculate the number of degrees of freedom (the difference between the effective parameter count (equation 9) and the nominal parameter count) in each of these two loss landscapes. We find that the first landscape has two degrees of freedom but the second has only one. These are two extremes of fully interacting and fully non-interacting free directions. It is also possible to construct intermediate loss landscapes in which the number of degrees of freedom arising from two free directions is a non-integer value between 1 and 2. In general, for a given set of free directions, the lowest the effective parameter count can be is the non-interacting case.
5.2 Degeneracies in separate modules only interact if the modules are interacting
In this section we quantify the increase in the effective parameter count, and equivalently the LLC,from perfect and near-perfect modularity. We show that a network consisting of non-interacting moduleshas a low effective parameter count, and that a network with modules which interact through a single variable has only a slightly higher effective paraeter count.
Consider a modular neural network consisting of two parallel modules and . The modules take in different variables from the input , and the outputof the network is the concatenation of the module outputs .We assign every activation direction in the network to either or .
We split the parameter space into 3 subspaces: . are the parameters inside (i.e.parameters that affect interactions between two activations within ), is the space of the parameters inside , and is the space of parameters which affect interactions between activations of both modules.
5.2.1 Non-interacting case
We start by analyzing a network consisting of two perfectly separated modules; the values of activations in have no effect on activations in , i.e. and the networkoutput is given by
(29)
Consider now two free directions in parameter space, where one lies entirely in , and the other lies entirely in . Since and share no variables and do not interact, there is no way for a change to parameters along one free direction to affect the freedom of the other direction. Therefore, one dimensional degeneracies that are in different disconnected modules must be non-interacting.By contrast, if and were connected, their free directions could interact.
We break up the behavioral loss with respect to this network into three terms:
(30)
and are the parts of the behavioral loss than involve only and respectively, and contains all the other parts. So long as we ensure , we have . Then a calculation shows that the overall number of degrees of freedom () for this behavioral loss, restricted to the subspace in which , is equal to the sum of the number of degrees of freedom in each module.
There could be additional free directions involving moving away from . These free directions are not guaranteed not to interact with the free directions in each module, and our argument says nothing about how large additional contributions to the effective parameter count from varying may be.
5.2.2 Adding in interactions between modules
Next, we consider the case that there are a small set of activations inside that causally affect the value of some activations inside (due to not all the parameters in being 0). This means that the two modules are now interacting with each other.In that case, the only degeneracies in which are guaranteed not to interact with the degeneracies in are those which do not affect the value of any of the .
Picture as a causal graph, where the nodes are activations and the edges are weights or nonlinearities. The nodes inside are connected to the ‘outside’ of via (a) the input layer, where takes in inputs, (b) the output layer, where passes on its outputs, and (c) the ‘mediating’ nodes where variations affect what happens inside .The free directions inside that are guaranteed not to interact with free directions outside are those directions that leave this entire interaction surface invariant: the directions which do not change any of the mediating nodes as we traverse along them. Each mediating node that is present is an additional constraint on which free directions are guaranteed to be non-interacting. The more approximately independent nodes that are part of that interaction surface, the fewer free directions in might be generically expected to satisfy these constraints.
In the previous section, we argued that the degrees of freedom of the network with noninteracting modules, restricted to the subset of parameter space in which , was equal to the sum of the degrees of freedom in each module. In this section, , but modifying the argument to restrict to the subset of parameter space in which is not sufficient to fix the argument, because the degeneracies interact.
To fix the argument, we introduce the constrained loss function for parameters in :
(31)
This loss function is the same as the part of the behavioral loss that depends only on parameters in , except that it has extra MSE terms added to ensure that the points with very small loss also preserve the values of on all datapoints. This means its learning coefficient is higher than for the unconstrained behavioral loss. The key property of the constrained loss landscape is that free directions in are guaranteed to be non interacting with free directions in the loss landscape . Therefore, we are able to say that the total effective parameter count of the network consisting of two interacting modules, when constrained to the subspace , really is twice the sum of the learning coefficient for the loss function , and for the loss function 999For simplicity in this section, we have considered the case in which nodes in affect nodes in but the converse is not true. If we wanted interactions to be bidirectional, we could modify the argument of this section by introducing a second constrained loss function ..
As before, there could be additional free directions involving moving away from , which may interact with the free directions in each module. Since we have not characterized the effect of these free directions on the effective parameter count, we cannot confidently conclude that networks with more separated modules reliably have lower effective parameter counts overall. For example, it may be possible that on most real-world loss landscapes, there are many more non-modular solutions than modular ones, and that typically the place in parameter space with lowest loss and lowest effective parameter count is not modular. However, we are not aware of any compelling reason why non-modular networks have some advantage in terms of having low effective parameter counts, to combat the advantage of modular networks discussed in this section.
5.2.3 Varying the strength of an interaction
In the precious section, we discussed the case that two modules interact via nodes. However, this model had no notion of how strong an interaction is — every node inside either is not on the interaction surface, or it is, and all nodes on the interaction surface affects the nodes inside the same amount. In real networks, the extent to which one activation can affect another is continuous. Therefore, we’d like to be able to answer questions like the following:
Suppose that we have two networks both consisting of two modules, and . In the first network, there is a single node inside that strongly influences , and in the second there are two nodes inside that both weakly influence . Which of these two networks is likely to have a lower effective parameter count?
In this section we’ll attempt to answer this question. To do so, we will make use of the notion of an effective parameter count at a finite loss cutoff (Section 2.2.2). We show that the magnitude of the total connections through different independent mediating nodes seems to add approximately logarithmically to determine the effective ‘size’ of the total interaction surface between modules.
As before, we consider two modules and , connected through a number of mediating variables that are part of and which depends on. Let each of these mediating variables connect to through a single weight, 101010We could also consider to be the sum of weights connecting node to ..
If is sufficiently small relative to the loss cutoff , the connection between modules via will be so small that it can be considered no connection at all from the perspective of interactions between free directions in different modules. This would be if the loss increases when we traverse along both free directions simultaneously by an amount that is smaller than .
Quantitatively, if we traverse along a free direction in that changes the value of , then for small enough (and a network with locally smooth-enough activation functions), the resulting change in the MSE loss of the whole network will be proportional to . If , that means the connection is ‘effectively zero’ relative to the given cutoff , in the sense that the volume of points with is not substantially impacted by the terms in the loss involving .
Now we consider larger connections with .We can model this situation by taking the size of into account in the constrained loss (equation 31). We define the weighted constrained loss by a sum over mean squared errors for preserving each mediating variable, weighted by the size of the variable:
(32)
where we’ve made depend on here because are parameters in .We are interested then in how much smaller the learning coefficient for loss landscape is than the learning coefficient on landscape , as a function of loss cutoff . This depends heavily on the details of the model. If the constraints are completely independent, we could perhaps model the presence of each constraint as destroying some number of degrees of freedom compared to the model in which the constraints were not present (and the modules were fully non-interacting).
Now, we seek an expression for in terms of . Since we require , and each term in is positive, we also have that each constraint must be smaller than . Rearranging, we find that
(33)
Therefore, the weights of each constraint effectively correspond to measuring the volume of points satisfying that constraint at a larger loss cutoff . Now, we make an assumption that if all the weights were 1, then each constraint would be responsible for removing a similar number of degrees of freedom from the network. In other words, each constraint would restrict the volume of parameter space that achieves loss less than by the same amount. Then, we can rescale this region by the factor and we find that:
(34)
Therefore, the size of the logarithm of the weight relative to the logarithm of the cutoff becomes a prefactor reducing the number of degrees of freedom removed by constraint . If , then , and if , then 111111For , this is effectively zero from the resolution available at loss cutoff ..
With this in mind, let us return to the question introduced at the start of this section. We will call the network with two weak interactions between modules network , with two mediating nodes and mediating weights . Likewise, we denote the network with one strong interaction between modules by network , with one mediating node and one mediating weight . How large must be compared to and for the interactions between modules in network to effectively remove the same number of degrees of freedom as the interactions between modules in network ?Using equation LABEL:eq:log_scale, we find that
(35)
So, the analysis in this section implies that connections through different mediating nodes should be considered to add together logarithmically for the purpose of estimating the number of interaction terms between degrees of freedom that live in different modules. In practice, the constraints different mediating variables impose on the loss 32 are likely rarely completely independent, so this should be seen as a rough approximation to be used as a starting guess for the relevant scale of the problem.
If circuits in neural networks correspond to modules, the analysis in this section implies that we could identify circuits in networks by searching for a partition of the interaction graph of the network into modules which minimises the sum of logs of cutoff-normalised interaction strengths between modules.
6 The Interaction Basis
In this section, we propose a technique for representing a neural network as an interaction graph that is invariant to reparameterisations that exploit the freedoms in Sections 3.1.1 and 3.1.2. The technique consists of performing a basis transformation in each layer of the network to represent the activations in a different basis that we call the Interaction Basis.
This basis transformation removes degeneracies in actviations and Jacobians of the layer to make the basis smaller.The basis is also intended to ‘disentangle’ interactions between adjacent layers as much as possible. While we do not know whether it accomplishes this in general, we do show that it does so when the layer transitions are linear. In that case, the layer transition becomes diagonal (appendix A).The interaction basis is invariant to invertible linear transformations,121212Technically, as we will see, it is only invariant to up to the uniqueness of the eigenvectors of a certain matrix. But that usually just amounts to a freedom under reflections of coordinate axes in practice. meaning the basis itself is a largely coordinate-independent object, much like an eigendecomposition (see Section 6.2).
We conjecture that if we apply the interaction basis transformation to a real neural network, the resulting representation is likely to be more interpretable. In a companion paper, Bushnaq etal. (2024), we develop the interaction basis further and test this hypothesis.
6.1 Motivating the interaction basis
To find a transformation of network’s weights and activations that is invariant to reparameterisations based on low-rank activations or low-rank Jacobians, we take equation 10, and use equation 11 to rewrite it as
(36)
Next, we make two presumptions of independence (Christiano etal., 2022), assuming that
1.
We can take expectations over the activations and Jacobians in each layer independently
2.
Different layers are somewhat independent such that the Hessian eigenvectors can be largely localised to a particular layer
Both of these assumptions are investigated in Martens and Grosse (2020), who test their validity in small networks and use it to derive a cheap approximation to the Hessian and its inverse.
This allows us to approximate the Hessian as
(37)
This effectively turns the Hessian into a product of two matrices, a gram matrix of activations in each layer
(38)
and a Gram matrix of Jacobians with respect to the next layer’s preactivations
(39)
We can then find the eigenvectors of this approximated Hessian by separately diagonalising these two matrices.
We would like to find a basis for that excludes directions connected exclusively to zero eigenvectors of the Hessian. That is, we want to exclude directions in that lie along zero eigenvectors of , and directions that are mapped by the weight matrix to lie along zero eigenvectors of .
To do this, we can backpropagate the Jacobians in equation 39 one step further to include the weight matrices :
(40)
and then search for a basis in that diagonalises and at the same time. This basis will have one basis vector less for each zero eigenvalue of the Gram matrices of the activations and Jacobians, respectively. It will also exclude directions that lie in the null space of .
The matrices are symmetric, so we can write and for diagonal and orthogonal .
We can find a basis transformation in which both and are diagonal, in two steps:
1.
Apply a whitening transformation with respect to : , where the plus denotes the Moore-Penrose pseudoinverse. If the activations in layer do not span the full activation space, then the gram matrix must not be full rank, and some diagonal entries of are zero. By choosing this pseudoinverse, we effectively eliminate all the degeneracies from low-rank activations from our final basis. In this basis,
2.
Now that is whitened, we can apply the transformation by which diagonalises without un-diagonalisng since the identity matrix is isotropic131313We need to be careful which coordinate basis we are working in: the entries of in the basis that whitens and in the standard basis are different.. At this point both and are diagonal and is defined up to multiplication by a diagonal matrix. We choose to multiply at the end by because this eliminates degeneracies from low rank Jacobians.
We call the basis the interaction basis. Basis vectors in this basis are aligned with the directions that affect the output most — in the case of a deep linear network, this means that transforming to the interaction basis provably performs an SVD of each weight matrix, resulting in basis directions which are aligned with the principal components of the output of the network (see appendix A).
We made two simplifying assumptions of independence about the Hessian to motivate this basis. While they have been used in other contexts to some success, these are still strong assumptions. Future work might investigate alternative techniques for finding a basis without these assumptions. This might only be possible with an overcomplete basis, which could connect the framework of this paper to superposition.
6.2 Invariance to linear transformations
The Interaction Basis is largely a coordinate-independent object, in the sense that it is invariant under linear transformations.If we apply a transformation to the activation space, the final interaction basis is unchanged () for any up to trivial axis reflections, unless has repeated eigenvalues.
To show this, first note that in the whitened basis , is by definition always transformed to the identity matrix
(41)
So if we whiten after applying the transformation , can only differ from by an orthogonal transformation. Call this orthogonal matrix . In the whitened basis, will then be:
(42)
So and only differ by an orthogonal transformation.The interaction basis will be the eigenbasis of and , respectively.So long as a real matrix does not have degenerate eigenvalues, its eigendecomposition is basis invariant if a convention for the eigenvector normalisation is chosen, up to reflections.So if does not have multiple identical eigenvalues, the interaction basis we end up in is the same up to reflections whether we transformed with first or not. If does have identical eigenvalues, the basis will still be identical up to orthogonal transforms in the eigenspaces of .
7 Related Work
Explaining generalisation
The inductive biases of deep neural networks that leads them to generalise well past their training data has been an object of extensive study (Zhang etal., 2021). Attempts to understand generalisation involve studying simplicity biases (Mingard etal., 2021) and are closely related to attempts to quantify model complexity, for example via VC dimension (Vapnik, 1998), Radamacher complexity (Mohri etal., 2018) or less widely known methods (Liang etal., 2019; Novak etal., 2018). This paper is heavily influenced by Singular Learning Theory (Watanabe, 2009) which uses the local learning coefficient (Lau etal., 2023) to quantify the effective number of parameters in the model via the flatness of minima in the loss landscape. The flatness of minima has been found to predict model generalisation, for example in Li etal. (2018) for networks trained on CIFAR-10. SLT has been used to study the formation of internal structure in neural networks (Chen etal., 2023; Hoogland etal., 2024). Understanding the internals of neural networks through the geometry of their loss landscapes was also proposed as a research direction in (Hoogland etal., 2023).
Local structure of the loss landscape
Other works have investigated the structure of neural network loss landscapes and their degeneracies around solutions found in training.In (Martens and Grosse, 2020), it was proposed that the Hessian matrix of MLPs can be approximated as being factorisable into independent outer products of activations and gradients, and that its eigenvectors might be approximated as being localised in particular layer of the network.This approximation was later extended to CNNs, RNNs, and transformers in Grosse and Martens (2016); Martens etal. (2018); Grosse etal. (2023).The approximation was used to compress models by pruning weights along directions with small Hessian eigenvalues by Wang etal. (2019).For deep linear networks, an analytical expression for the learning coefficient was derived in Aoyagi (2024).Generic degeneracies in the loss shared by all models with an MLP ReLU architecture were investigated in Carrol (2021), and degeneracies of one hidden layer MLPs with tanh activation functions in Farrugia-Roberts (2022).It has been found that most minima in the loss landscape can often be connected by a continuous path of minimum loss, for example in Draxler etal. (2019) for models trained on CIFAR.
Selection for modularity
In Filan etal. (2021), it was found that MLPs and CNNs trained on vision tasks showed more modularity in the weights connecting their neurons than comparable random networks.The observed tendency for biological networks created by evolution to be modular has been widely investigated, with various explanations for the phenomenon being proposed. Clune etal. (2013) offer a good overview of this work for machine learning researchers, and suggests direct minimisation of connection costs between components as a primary driver of modularity in biological networks.Kashtan and Alon (2005) proposes that genetic algorithms select systems to be modular because this makes them more robust to modular changes in the systems’ environments.In Liu etal. (2023), connection costs were used to regularise MLPs trained on various tasks including modular addition to be more modular in their weights, in order to make them more interpretable.
8 Conclusion
We introduced the idea that the presence of degeneracy in neural networks’ parameterizationsmay be a source of challenges for reverse engineering them. We identified some of the sources of this degeneracy, and suggested a technique (the interaction basis) for removing this degeneracy from the representation of the network. We argued that this representation is likely to have sparser interactions, and we introduced a formula for searching for modules in the new represenation of the network based on a toy model of how modularity affects degeneracy. The follow-up paper Bushnaq etal. (2024) tests a variant of the interaction basis, finding that it results in representations which are sparse, modular and interpretable on toy models but it is much less useful when applied to LLMs.
9 Contribution Statement
LB developed the ideas in this paper with contributions from JM and KH. JM and LB developed the presentation of these ideas together. JM led the writing, with substantial support from LB, and feedback from SH and NGD. SH, DB, and NGD ran experiments to provide feedback on early versions of the interaction basis. CW ran experiments to test neuron synchronisation.
10 Acknowledgements
We thank Daniel Murfet, Tom McGrath, James Fox, and Lawrence Chan for comments on the manuscript, to Dmitry Vaintrob for suggesting the concept of finite data SLT, and to Vivek Hebbar, Jesse Hoogland and Linda Linsefors for valuable discussions. Apollo Research is a fiscally sponsored project of Rethink Priorities.
References
Aoyagi (2024)Miki Aoyagi.Consideration on the learning efficiency of multiple-layered neural networks with linear units.Neural Networks, 172:106132, 04 2024.doi: 10.1016/j.neunet.2024.106132.
Bushnaq etal. (2024)Lucius Bushnaq, Stefan Heimersheim, Nicholas Goldowsky-Dill, Dan Braun, Jake Mendel, Kaarel Hänni, Avery Griffin, Jörn Stöhler, Magdalena Wache, and Marius Hobbhahn.The Local Interaction Basis: Identifying Computationally-Relevant and Sparsely Interacting Features in Neural Networks.arXiv e-prints, art. arXiv:2405.10928, May 2024.
Carrol (2021)Liam Carrol.Phase transitions in neural networks.Master’s thesis, School of Computing and Information Systems, The University of Melbourne, October 2021.URL http://therisingsea.org/notes/MSc-Carroll.pdf.
Chen etal. (2023)Zhongtian Chen, Edmund Lau, Jake Mendel, Susan Wei, and Daniel Murfet.Dynamical versus bayesian phase transitions in a toy model of superposition.arXiv preprint arXiv:2310.06301, 2023.
Christiano etal. (2022)Paul Christiano, Eric Neyman, and Mark Xu.Formalizing the presumption of independence.arXiv preprint arXiv:2211.06738, 2022.
Clune etal. (2013)Jeff Clune, Jean-Baptiste Mouret, and Hod Lipson.The evolutionary origins of modularity.Proceedings of the Royal Society B: Biological Sciences, 280(1755):20122863, March 2013.ISSN 1471-2954.doi: 10.1098/rspb.2012.2863.URL http://dx.doi.org/10.1098/rspb.2012.2863.
Conmy etal. (2023)Arthur Conmy, AugustineN. Mavor-Parker, Aengus Lynch, Stefan Heimersheim, and Adrià Garriga-Alonso.Towards automated circuit discovery for mechanistic interpretability, 2023.
Conmy etal. (2024)Arthur Conmy, Augustine Mavor-Parker, Aengus Lynch, Stefan Heimersheim, and Adrià Garriga-Alonso.Towards automated circuit discovery for mechanistic interpretability.Advances in Neural Information Processing Systems, 36, 2024.
Draxler etal. (2019)Felix Draxler, Kambis Veschgini, Manfred Salmhofer, and FredA. Hamprecht.Essentially no barriers in neural network energy landscape, 2019.
Elhage etal. (2021)Nelson Elhage, Neel Nanda, Catherine Olsson, Tom Henighan, Nicholas Joseph, Ben Mann, Amanda Askell, Yuntao Bai, Anna Chen, Tom Conerly, Nova DasSarma, Dawn Drain, Deep Ganguli, Zac Hatfield-Dodds, Danny Hernandez, Andy Jones, Jackson Kernion, Liane Lovitt, Kamal Ndousse, Dario Amodei, Tom Brown, Jack Clark, Jared Kaplan, Sam McCandlish, and Chris Olah.A mathematical framework for transformer circuits.Transformer Circuits Thread, 2021.https://transformer-circuits.pub/2021/framework/index.html.
Farrugia-Roberts (2022)Matthew Farrugia-Roberts.Structural degeneracy in neural networks.Master’s thesis, School of Computing and Information Systems, The University of Melbourne, December 2022.URL https://far.in.net/mthesis.
Filan etal. (2021)Daniel Filan, Stephen Casper, Shlomi Hod, Cody Wild, Andrew Critch, and Stuart Russell.Clusterability in neural networks, 2021.
Fusi etal. (2016)Stefano Fusi, EarlK Miller, and Mattia Rigotti.Why neurons mix: high dimensionality for higher cognition.Current Opinion in Neurobiology, 37:66–74, 2016.ISSN 0959-4388.doi: https://doi.org/10.1016/j.conb.2016.01.010.URL https://www.sciencedirect.com/science/article/pii/S0959438816000118.Neurobiology of cognitive behavior.
Geiger etal. (2021)Atticus Geiger, Hanson Lu, Thomas Icard, and Christopher Potts.Causal abstractions of neural networks.Advances in Neural Information Processing Systems, 34:9574–9586, 2021.
Geva etal. (2021)Mor Geva, Roei Schuster, Jonathan Berant, and Omer Levy.Transformer Feed-Forward Layers Are Key-Value Memories, September 2021.URL http://arxiv.org/abs/2012.14913.arXiv:2012.14913 [cs].
Goh etal. (2021)Gabriel Goh, NickCammarata †, ChelseaVoss †, Shan Carter, Michael Petrov, Ludwig Schubert, Alec Radford, and Chris Olah.Multimodal neurons in artificial neural networks.Distill, 2021.doi: 10.23915/distill.00030.https://distill.pub/2021/multimodal-neurons.
Grosse and Martens (2016)Roger Grosse and James Martens.A kronecker-factored approximate fisher matrix for convolution layers, 2016.
Grosse etal. (2023)Roger Grosse, Juhan Bae, Cem Anil, Nelson Elhage, Alex Tamkin, Amirhossein Tajdini, Benoit Steiner, Dustin Li, Esin Durmus, Ethan Perez, Evan Hubinger, Kamilė Lukošiūtė, Karina Nguyen, Nicholas Joseph, Sam McCandlish, Jared Kaplan, and SamuelR. Bowman.Studying large language model generalization with influence functions, 2023.
Hoogland etal. (2024)Jesse Hoogland, George Wang, Matthew Farrugia-Roberts, Liam Carroll, Susan Wei, and Daniel Murfet.The developmental landscape of in-context learning, 2024.
Kashtan and Alon (2005)Nadav Kashtan and Uri Alon.Spontaneous evolution of modularity and network motifs.Proceedings of the National Academy of Sciences of the United States of America, 102:13773–8, 10 2005.doi: 10.1073/pnas.0503610102.
Lau etal. (2023)Edmund Lau, Daniel Murfet, and Susan Wei.Quantifying degeneracy in singular models via the learning coefficient.arXiv preprint arXiv:2308.12108, 2023.
Li etal. (2018)Hao Li, Zheng Xu, Gavin Taylor, Christoph Studer, and Tom Goldstein.Visualizing the loss landscape of neural nets, 2018.
Liang etal. (2019)Tengyuan Liang, Tomaso Poggio, Alexander Rakhlin, and James Stokes.Fisher-rao metric, geometry, and complexity of neural networks.In The 22nd international conference on artificial intelligence and statistics, pages 888–896. PMLR, 2019.
Liu etal. (2023)Ziming Liu, Eric Gan, and Max Tegmark.Seeing is believing: Brain-inspired modular training for mechanistic interpretability, 2023.
Loshchilov and Hutter (2019)Ilya Loshchilov and Frank Hutter.Decoupled weight decay regularization, 2019.
Martens and Grosse (2020)James Martens and Roger Grosse.Optimizing neural networks with kronecker-factored approximate curvature, 2020.
Martens etal. (2018)James Martens, Jimmy Ba, and Matt Johnson.Kronecker-factored curvature approximations for recurrent neural networks.In International Conference on Learning Representations, 2018.URL https://openreview.net/forum?id=HyMTkQZAb.
Meng etal. (2023)Kevin Meng, David Bau, Alex Andonian, and Yonatan Belinkov.Locating and editing factual associations in gpt, 2023.
Mingard etal. (2021)Chris Mingard, Guillermo Valle-Pérez, Joar Skalse, and ArdA Louis.Is sgd a bayesian sampler? well, almost.Journal of Machine Learning Research, 22(79):1–64, 2021.
Mohri etal. (2018)Mehryar Mohri, Afshin Rostamizadeh, and Ameet Talwalkar.Foundations of machine learning.MIT press, 2018.
Murphy (2012)KevinP Murphy.Machine Learning: A Probabilistic Perspective.MIT press, 2012.
Nanda etal. (2023)Neel Nanda, Lawrence Chan, Tom Lieberum, Jess Smith, and Jacob Steinhardt.Progress measures for grokking via mechanistic interpretability, 2023.
Nguyen etal. (2016)Anh Nguyen, Jason Yosinski, and Jeff Clune.Multifaceted feature visualization: Uncovering the different types of features learned by each neuron in deep neural networks, 2016.
Novak etal. (2018)Roman Novak, Yasaman Bahri, DanielA Abolafia, Jeffrey Pennington, and Jascha Sohl-Dickstein.Sensitivity and generalization in neural networks: an empirical study.arXiv preprint arXiv:1802.08760, 2018.
Olah etal. (2017)Chris Olah, Alexander Mordvintsev, and Ludwig Schubert.Feature visualization.Distill, 2017.doi: 10.23915/distill.00007.https://distill.pub/2017/feature-visualization.
Olah etal. (2020)Chris Olah, Nick Cammarata, Ludwig Schubert, Gabriel Goh, Michael Petrov, and Shan Carter.Zoom in: An introduction to circuits.Distill, 5(3):e00024–001, 2020.
Räuker etal. (2023)Tilman Räuker, Anson Ho, Stephen Casper, and Dylan Hadfield-Menell.Toward transparent ai: A survey on interpreting the inner structures of deep neural networks, 2023.
Schwarz (1978)Gideon Schwarz.Estimating the dimension of a model.The annals of statistics, pages 461–464, 1978.
Wang etal. (2019)Chaoqi Wang, Roger Grosse, Sanja Fidler, and Guodong Zhang.Eigendamage: Structured pruning in the kronecker-factored eigenbasis, 2019.
Wang etal. (2022)Kevin Wang, Alexandre Variengien, Arthur Conmy, Buck Shlegeris, and Jacob Steinhardt.Interpretability in the wild: a circuit for indirect object identification in gpt-2 small.arXiv preprint arXiv:2211.00593, 2022.
Watanabe (2009)Sumio Watanabe.Algebraic geometry and statistical learning theory, volume25.Cambridge university press, 2009.
Watanabe (2013)Sumio Watanabe.A widely applicable bayesian information criterion.The Journal of Machine Learning Research, 14(1):867–897, 2013.
Wei etal. (2022)Susan Wei, Daniel Murfet, Mingming Gong, Hui Li, Jesse Gell-Redman, and Thomas Quella.Deep learning is singular, and that’s good.IEEE Transactions on Neural Networks and Learning Systems, 2022.
Zhang etal. (2021)Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals.Understanding deep learning (still) requires rethinking generalization.Communications of the ACM, 64(3):107–115, 2021.
Appendix A The local interaction basis on deep linear networks
The interaction basis diagonalizes interactions between neural network layers if the layer transitions are linear. We derive this property for this local interaction basis, a modified interaction basis in which gradients to the final layer are replaced with gradients to the immediately subsequent layer, in order to sparsify interactions between adjacent layers. In the experimental follow up to this paper, Bushnaq etal. [2024] discuss the local interaction basis in more detail before testing it on real networks. In this appendix, we show that the local interaction basis diagonalizes the interactions between neural network layers if the layer transitions are linear. The derivation for the non-local interaction basis follows the same structure.
In the absence of nonlinearities, a deep neural network is just a series of matrix multiplications (once an extra component is added to activation vectors with a constant value of 1, to include the bias). The sparsest way to describe this series of matrix multiplications is to multiply out the network into one multiplication, and then to rotate into the left singular basis of this matrix in the inputs, and the right singular basis in the outputs.To see that transforming to the local interaction basis does indeed perform an SVD for deep linear networks, consider the penultimate layer of the network. We neglect mean centering to make this derivation cleaner, and start by transforming in layer to a basis which whitens the activations:
We’ve wrapped these transformations into definitions of and .We’ll show that the other transformations perform an SVD of . First, we have to transform to the (uncentered) PCA basis in the final layer.
where we have leveraged that by definition in the last step. Writing , we have that , so . Since there is no layer after the final layer, the matrix is not defined for the final layer, so the LI basis in the final layer is just the PCA basis141414This is also true in the nonlocal interaction basis, since .
(43)
For the final part of the transformation into the LIB, we need to calculate , which depends on the jacobian from the LIB functions in the next layer to the PCA functions in the current layer:
so = and . Now,
Using equation 43, we have:
(44)
For layers which are not the final layer in the network, the procedure is very similar. As before, we have:
Now, we need to remember that :
Once again, note that this expression for is manifestly diagonal, so
So, is exactly what we need in order to diagonalize the relationship, and we end up with
(45)
So, each layer of the network is the same as the final layer, which is the final activations rotated into the PCA basis, but without whitening.
Address: Apt. 994 8891 Orval Hill, Brittnyburgh, AZ 41023-0398
Phone: +26417467956738
Job: District Marketing Strategist
Hobby: Embroidery, Bodybuilding, Motor sports, Amateur radio, Wood carving, Whittling, Air sports
Introduction: My name is Prof. An Powlowski, I am a charming, helpful, attractive, good, graceful, thoughtful, vast person who loves writing and wants to share my knowledge and understanding with you.
We notice you're using an ad blocker
Without advertising income, we can't keep making this site awesome for you.