Ensembles provably learn equivariance through data augmentation

## Abstract

Abstract Recently, it was proved that group equivariance emerges in ensembles of neural networks as the result of full augmentation in the limit of infinitely wide neural networks (neural tangent kernel limit). In this paper, we extend this result significantly. We provide a proof that this emergence does not depend on the neural tangent kernel limit at all. We also consider stochastic settings, and furthermore general architectures. For the latter, we provide a simple sufficient condition on the relation between the architecture and the action of the group for our results to hold. We validate our findings through simple numeric experiments.

## 1 Introduction

Consider a learning task with an inherent symmetry. As an illustrative example, we can think of classifying images of, say, apples and pears. The classification should of course not change when the image is rotated, meaning that the learning task is *invariant* to rotations. If we are segmenting the image, the apple segmentation mask should instead rotate with the image – such tasks are called *equivariant*. An a-priori known symmetry like this is a strong inductive bias, that should be used to improve performance of the model.

There are essentially two ’meta-approaches’ to do the latter. The first one is to use data augmentation to generate new data that respects the symmetry – in our example, to add all rotated versions of the training images to the dataset. This is versatile, simple and effective. However, there are of course no guarantees that the model after training exactly obeys the symmetry, in particular on out-of distribution data. To solve this problem, one can use the second meta-approach, namely to use a model that inherently respects the symmetry. Over the last half decade or so, an entire framework concerning achieving this for neural network has emerged under the name of *Geometric Deep Learning* (Bronstein et al., ).

The relations between these two approaches are, from a theoretical point of view, still unclear: there is yet to emerge a definitive question to the question if and when the augmentation strategy is guaranteed to yield an equivariant model after training. Recently, an interesting discovery in this regard was made in Gerken & Kessel (). In this paper, it was shown that *ensembles* of *infinitely wide* neural networks (in the neural tangent kernel limit Jacot et al. ()) are equivariant *in mean*, even though individual members of them are not. See Figure 1 for an illustration. Although this asymptotic result is already interesting, it has some drawbacks. The proofs rely heavily on the simplified dynamics of the NTKs, and therefore do not work at all for network of finite width. Furthermore, the proof only works for finite groups, and is only formulated for the somewhat unrealistic gradient flow training.

The main message of this paper is that the phenomenon of ensembles of neural networks being equivariant in mean is *much more general* than Gerken & Kessel () suggests. Our analysis reveals that the equivariance has nothing to do with the neural tangent kernel limit. Instead, if the geometry of the neural network architecture in a sense is not inherently biased against equivariance (the technical condition is described in Definition 1), and the parameters of the ensemble are initialized in a symmetric way (which can be achieved by Gaussian initialization), the ensemble mean will automatically be equivariant at all points in the training.

Our proofs are non-asymptotic, work for any compact group, for stochastic gradient descent and random augmentation, and apply to a wide range of neural network architectures. Consequently, the analysis is different to the one in Gerken & Kessel (). We will in particular use recent results from Nordenfors et al. () about the dynamics of neural networks trained on symmetric data.

The paper outline is as follows: After a short literature review in Section 2, we need to spend considerable time to properly present the framework and state our assumptions in Section 3. Then, we state our main result, Theorem 4.2 in Section 4, and prove it in a simplified setting – the full proof is given in the appendix. Finally, we perform some simple numerical experiments to showcase our theory in Section 5.

Figure: Figure 1: A graphical explaination of our results. In the example, the symmetry group is $C_{2}$, acting on the parameter space through reflection in the $x$-axis (this is the representation $\rho$ we define below). Parameters on the $x$-axis correspond to equivariant models. We are shown snapshots of the parameters of ensemble members as they are trained on symmetric data. Note that at all times, most individual ensemble members that do not lie on the line of symmetric model. However, since they have been initialized with a symmetric distribution, their distribution stays symmetric throughout training – and therefore, *their mean* always corresponds to an equivariant model.
Refer to caption: extracted/5895514/figures/graphical_depiction_ensembles.png

## 2 Literature review

To give a comprehensive overview of Geometric Deep Learning goes well beyond the scope of this paper. We instead refer to the textbook (Bronstein et al., ).

The question of the effect of symmetries in the data on the training of neural networks has often been understood as a comparison question: Is it better to train a non-equivariant architecture on augmented (that is, artificially symmetric) data, or to use a manifestly equivariant architecture as e.g. Cohen et al. (); Maron et al. (); Kondor & Trivedi (); Weiler & Cesa (); Finzi et al. (); Fuchs et al. ()? Empirical comparisons between the two approaches as part of experimental evaluations of manifestly equivariant architectures have been made more or less since the invention of equivariant networks – more systematic investigations include Gandikota et al. (); Gerken et al. ().

In Chen et al. (), a group theoretical framework for data augmentation was developed, which has inspired many treatises of the question, including ours. Linear (i.e. kernel) models are studied in Elesedy & Zaidi (); Mei et al. (); Dao et al. (). Lyle et al. (, ) study so-called *feature-averaged* networks. So-called *linear neural networks* – i.e., neural networks with a linear activation function – are studied in Chen & Zhu (). In these settings, equivalence between augmenting the data and restricting the networks can be proven. The same has not been established for ’bona-fide’ neural networks with non-linear activation functions – they are studied Nordenfors et al. (), but there, only local guarantees are derived.

The work most tightly related to ours is Gerken & Kessel (). In there, it was realized that equivariance emerges from augmentation in ensembles, and not in individual networks. They provide a formal explaination of this only in the so-called *neural tangent kernel (NTK) limit* (Jacot et al., ). Importantly, the optimization dynamics of neural networks in the NTK-limit turn linear (Lee et al., ), so that that setting is considerably simpler than the one we consider here.

Equivariant flows have been studied before in the context of generative models (Köhler et al., ; Katsman et al., ; Satorras et al., ). In this paper, we use results from Köhler et al. () in a different context, namely to study the flow of the *parameters of the network * under (stochastic) gradient flow (descent).

## 3 Preliminaries

### 3.1 Paper setting

By and large, we adopt the framework from Nordenfors et al. () – which in large is just a particular formalization of the general geometric deep learning framework Bronstein et al. (). Let $(x,y)\in X\times Y$, where $X$ and $Y$ are (finite-dimensional) vector spaces. We are concerned with neural networks $\Phi_{A}:X\to Y$, that are defined as function of the form

$$ $\displaystyle x_{0}\in X,\quad x_{i+1}=\sigma_{i}(A_{i}(x_{i})),\,\forall i\in \{0,1,\ldots,N-1\},\,\Phi_{A}(x_{0})=x_{N}\in Y.$ (1) $$

Here, $A_{i}$ are trainable linear maps, i.e. elements of $\operatorname{Hom}(X_{i},X_{i+1})$, and where $\sigma_{i}$ are fixed non-linearities. Following Nordenfors et al. (), we write $\mathcal{H}=\bigoplus_{i=0}^{N-1}\operatorname{Hom}(X_{i},X_{i+1})$ for the ambient space for the parameter $A=(A_{i})_{i=0}^{N-1}$. This is a faithful model for *fully connected* networks *without bias*. As was realized in Nordenfors et al. (), we may include other architectures in the framework (biases, CNN:s, RNN:s, transformers, …) by confining the linear maps to an *affine subspace* $\mathcal{L}\subseteq\mathcal{H}$. Let us present one example of this construction, that we in the following will use as a running example.

###### Example 3.1 .

For some integers $d_{i}$, let $X_{i}=(\mathbb{R}^{N,N})^{d_{i}}$ – we can and will interpret this as *tuples of images*. We may define a *convolutional operator* between two such spaces as operators $C$ of the form

$$ $\displaystyle(Cx)_{k}=\sum_{\ell\in[d_{i}]}\psi_{k\ell}*x_{\ell},$ $$

where $\psi_{k\ell}$, $k\in[d_{i+1}],\ell\in[d_{i}]$ are filters. In the following, we denote this operator $\langle\psi\rangle$.
The space of all operators of this form, where the filters supports are all contained in a fixed set $\Omega$, form a linear subspace of $\mathcal{H}$. In particular, they define an affine space $\mathcal{L}$, and the corresponding architecture is a CNN.

Common choices for $\Omega$ are $3\times 3$ or $5\times 5$ squares. Just as was done in Nordenfors et al. (), we will here mainly consider the two non-canonical supports in Figure 2, since they illustrate important aspects of our results. We call the left support the *symmetric* support, and the right the *asymmetric* support, and denote the corresponding affine spaces $\mathcal{L}^{\mathrm{sym}}$ and $\mathcal{L}^{\mathrm{as}}$.

Figure: Figure 2: Left: symmetric filter. Right: asymmetric filter. Grey indices correspond to indices where the filter is supported.

Let us now bring equivariance in to the picture. We assume that a group $G$ is acting on both input, intermediate and output spaces by some *unitary representations* $\rho_{i}$ (Fulton & Harris, ) – i.e. maps $\rho_{i}$ from the group $G$ to the set of unitary matrices that respect the group action: $\rho_{i}(gh)=\rho_{i}(g)\rho_{i}(h)$. The representations on the spaces $X_{i}$ yield representations $\widehat{\rho_{i}}$ on $\operatorname{Hom}(X_{i},X_{i+1})$ through $\widehat{\rho}_{i}(g)(A_{i})=\rho_{i+1}(g)\circ A_{i}\circ\rho_{i}(g)^{-1}$, which in turn defines a representation $\rho$ on $\mathcal{H}$ by taking the direct product of the $\widehat{\rho}_{i}$. We will refer to these as the *lifted representations*.

###### Example 3.2 .

The group $C_{4}$, consisting of the four rotations in the plane of multiples of $\pi/2$, naturally acts on tuples of images by rotating each image in the tuple. We will denote this representation $\rho^{\mathrm{rot}}$. The corresponding lifted representation has an important property in relation to the convolutional operators as in Example 3.1: it acts by rotating each filter, $\rho(g)\langle\psi\rangle=\langle\rho^{\mathrm{rot}}(g)\psi\rangle$. This is not hard to show – a proof can for instance be found in Nordenfors et al. ().

###### Remark 1 .

While the representations on the input and output space are fixed – they are given by the symmetries of the problem – the representations on the intermediate spaces are a priori free to choose. This point has subtle but important consequences for the meaning of our main results – we will discuss them when we present it.

We call a map $f:X\to Y$ *equivariant* if $f\circ\rho_{0}(g)=\rho_{N}(g)\circ f$ for all $g$. The space of $G$-equivariant linear maps between $X_{i}$ and $X_{i+1}$ is denoted $\operatorname{Hom}_{G}(X_{i},X_{i+1})$. We write $\mathcal{H}_{G}=\bigoplus\operatorname{Hom}_{G}(X_{i},X_{i+1})$, i.e., $\mathcal{H}_{G}=\{A\in\mathcal{H}\vcentcolon\rho(g)A=A\}$.

Now let us record and discuss three global assumptions we want to make, which are similar to the ones made in Nordenfors et al. ().

###### Assumption 1 .

The non-linearities $\sigma_{i}$ are all $G$-equivariant.

###### Assumption 2 .

The group $G$ is *compact*.

###### Assumption 3 .

The space $\mathcal{H}_{G}\cap\mathcal{L}$ is nonempty.

As for Assumption 1, note that without it, the common strategy to define equivariant neural networks by restricting the linear layers to lie in this space will not work. Assumption 2 is needed to ensure that the Haar measure of the group (Krantz & Parks, ) is (normalizeable to) a probability measure. It should also be noted that when $G$ is compact, it is no true restriction to assume that the representation is unitary – one can always ensure this via redefining the inner products on $\mathcal{H}$. The assumption is satisfied by all finite groups, but also groups like $\operatorname{SO}(n)$ and $\mathrm{O}(n)$ (albeit not the group of all rigid motions $\mathrm{SE}(n)$.) As for Assumption 3, it ensures that there exists an admissible and $G$-equivariant architecture. It also has a technical consequence that we will need: it lets us write $\mathcal{L}=A_{\mathcal{L}}+\mathrm{T}\mathcal{L}$, for an $A_{\mathcal{L}}\in\mathcal{H}_{G}\cap\mathcal{L}$, and $\mathrm{T}\mathcal{L}$ the tangent space of $\mathcal{L}$.

###### Example 3.1 .

###### Example 3.2 .

###### Remark 1 .

###### Assumption 1 .

###### Assumption 2 .

###### Assumption 3 .

### 3.2 Training algorithms

Let us now assume that we are given data $(x,y)$ distributed according to some distribution on $X\times Y$. We let $\ell:Y\times Y\to\mathbb{R}$ be an invariant loss function ($\ell(\rho_{N}(g)y,\rho_{N}(g)y^{\prime})=\ell(y,y^{\prime})$ for all $g\in G$ and $y,y^{\prime}\in Y$)
, and define a nominal risk through

$$ $\displaystyle R(A)=\mathbb{E}_{\mathcal{D}}(\ell(\Phi_{A}(x),y)).$ $$

We can then train networks via minimizing $A$. Since $A$ is confined to the affine space $\mathcal{L}$, we thereby technically do not change $A$ by applying e.g. gradient descent to $R$ directly – instead, we parametrise $A=A_{\mathcal{L}}+Lc$, where $A_{\mathcal{L}}\in\mathcal{L}$ and $L:\mathbb{R}^{p}\to\mathrm{T}\mathcal{L}$ is a unitary ($L^{*}L=\operatorname{id}$) parametrization of the tangent space of $\mathcal{L}$, and then update $c$ via minimizing the loss $\mathrm{R}(c)=R(A_{\mathcal{L}}+Lc)$.

If the distribution $\mathcal{D}$ is biased, in the sense that $(\rho(g)x,\rho(g)y)$ is not equally distributed to $(x,y)$, training the network with this risk will most likely not lead to an equivarant model. Instead, we need to augment the data. We consider two strategies to do so.

#### (a) Gradient flow with full augmentation.

*Full augmentation* refers to training the networks using data distributed according to $(\rho(g)x,\rho(g)y)$, $(x,y)\sim\mathcal{D}$ and $g$ drawn according to the *Haar measure* Krantz & Parks (). For a finite group, this corresponds to drawing an element uniformly at random – but it can also be defined on any *compact* group, such as $\operatorname{SO}(n)$, as the unique *invariant* probability measure on $G$ – i.e., if $g\sim\mu$, $gh\sim\mu$ as well for any $h\in G$. This change can mathematically be expressed as changing the loss function to the augmented loss

$$ $\displaystyle R^{\mathrm{aug}}(A)=\int_{G}\mathbb{E}_{\mathcal{D}}(\ell(\Phi_{ A}(\rho_{0}(g)x),\rho_{N}(g)y))\mathrm{d}\mu(g),$ $$

and similarly $\mathrm{R}^{\mathrm{aug}}(c)=R^{\mathrm{aug}}(A_{\mathcal{L}}+Lc)$. We consider the simplified setting of using an infinitesemal learning rate, e.g. training the network using *gradient flow*. The latter refers to let the parameters flow accoarding to $\dot{c}^{t}=-\nabla\mathrm{R}^{\mathrm{aug}}(c^{t})$. Note that due to the chain rule and the unitarity of $L$, $A^{t}=A_{\mathcal{L}}+Lc^{t}$ will then follow the *projected gradient flow*

$$ $\displaystyle\dot{A}^{t}=-\Pi_{\mathcal{L}}\nabla R^{\mathrm{aug}}(A^{t}),$ (2) $$

where $\Pi_{\mathcal{L}}=LL^{*}$ is the orthogonal projection onto $\mathrm{T}\mathcal{L}$, the tangent space of $\mathcal{L}$. The differential equation equation 2 induces a flow map $\mathcal{F}^{t}:\mathcal{L}\to\mathcal{L}$: Every $A\in\mathcal{L}$ is mapped to the value at time $t$ of the solution of equation 2 initialized at $A$.

#### (b) SGD with random augmentation.

In addition to the above model, we will also consider training the networks on randomly augmented minibatches. This both escapes the assumption of full augmentation (which is impractical for large, and impossible for infinite, groups) and includes finite learning rates.

Just to fix notation, let us define the procedure formally. We define the *partially augmented and sampled risk* as

$$ $\displaystyle R^{g}(A)=\frac{1}{s}\sum_{k=1}^{s}\ell(\Phi_{A}(\rho_{0}(g_{k})x _{k}),\rho_{N}(g_{k})y_{k}),$ $$

where $(x_{k},y_{k})\sim\mathcal{D}$ are independent, both from each other as well as from the $g_{k}$, which are drawn i.i.d according to $\mu$. Note that $R^{g}$ is a random function. The sample size $s$ is a parameter that is free to chose.

Given a sequence of learning rates $(\gamma_{t})_{t\geq 0}$, we may now iteratively define a sequence of random variables as follows

$$ $\displaystyle A^{t+1}=A^{t}-\gamma_{t}\Pi_{\mathcal{L}}\nabla R^{g}(A^{t}).$ $$

Note that the projected descent emerges in the same way as above via updating the parametrizing coefficients $c^{t}$. Every realization of the process $A^{t}$ corresponds to one run of the SGD.

### 3.3 Ensembles

We define ensembles as in Gerken & Kessel (): For a distribution $p$ on $\mathcal{H}$, we consider the distribution of parameters $A^{t}$ implied by initalizing the parameters of a network according to $p$, and then training the network for time $t$. The corresponding *ensemble model* at time $t$ is then defined as

$$ $\displaystyle\overline{\Phi}_{t}(x)=\mathbb{E}_{\pi}[\Phi_{A^{t}}(x)],$ $$

i.e. the expecation over $\pi$, which denotes $p$ in the deterministic gradient flow setting, and the product of $p$ with the random draw of the minibatches and group elements in the SGD setting. Note that this function can be well approximated by drawing a sample mean, i.e. starting $N$ neural networks with i.i.d. initialisation (drawn according to $p$), training them, and then calculating the mean after $t$ points. This is the strategy we will follow in the experimental section. We will however only make claims about the true mean, and leave the study of the effect of the approximation error to further work. We will refer to such collections of $N$ networks as an *ensemble*, and each individual network an *ensemble member*.

## 4 Theory

This section is devoted to proving the $G$-equivariance of ensembles (Theorem 4.2). Our result will hold under a geometric condition on the space $\mathcal{L}$. Let us present it and discuss it in some detail.

### 4.1 The G 𝐺 G italic_G -invariance condition

###### Definition 1 .

We say that $\mathcal{L}$ is $G$-invariant if $\rho(g)\mathcal{L}\subseteq\mathcal{L}$ for all $g\in G$.

It should be noted that the invariance of $\mathcal{L}$ depends on the representation $\rho$, and not just on $G$. However, we find this terminology more intuitive, and we will make sure to point out the dependence when it matters.

From the view of the neural network architectures, $G$-invariance can be interpreted as saying that there is no *inherent bias* against being $G$-equivariant in the definition of your admissible layers. It has the for us important consequence, which we prove in Appendix A.

###### Lemma 4.1 .

$\mathcal{L}$ is $G$-invariant if and only if $\Pi_{\mathcal{L}}$ is $G$-equivariant.

$G$-invariance is related to the so-called *compatibility condition* that was used in Nordenfors et al. () to prove statements about the stationary points of the augmented risk $R^{\mathrm{aug}}$: that the projection $\Pi_{\mathcal{L}}$ commutes with the orthogonal projection $\Pi_{G}$. In fact, the $G$-invariance was there argued to be sufficient for the compatibility condition to hold. It was furthermore argued that $G$-invariance is satisfied for essentially all commonly used architectures and reasonable representations, such as fully connected ones with and without bias, RNNs, residual connections, etc. Let us here, again, only discuss our running examples.

###### Example 4.1 .

In Example 3.1, it was argued that when using the canonical $\rho^{\mathrm{rot}}$-representations on all the intermediate layers, we have $\rho(g)\langle\psi\rangle=\langle\rho(g)\psi\rangle$. Consequently, a $\langle\psi\rangle\in\mathcal{L}^{\mathrm{sym}}$ will be mapped by $\rho$ onto a tuple of other symmetric filters, and hence $\mathcal{L}^{\mathrm{sym}}$ is $G$-invariant. By the same argument, $\mathcal{L}^{\mathrm{as}}$ is not.

As we previously remarked (Remark 1), there is no need to choose the $\rho^{\mathrm{rot}}$-representations in the intermediate layers. However, it turns out that there aren’t *any* representations on the intermediate spaces which makes $\mathcal{L}^{\mathrm{as}}$ $G$-invariant. The somewhat involved proof for this is given in Appendix C.

###### Definition 1 .

###### Lemma 4.1 .

###### Example 4.1 .

### 4.2 Main result

Let us now state our main result.

###### Theorem 4.2 .

If
(i) the parameters have a $G$-invariant distribution at initialization, $\rho(g)A^{0}\sim A^{0}$
(ii) the affine space $\mathcal{L}$ of the architecture is $G$-invariant,
then the ensemble model trained with either gradient flow with full augmentation or SGD with random augmentation will for all times $t$ be $G$-equivariant.

###### Remark 2 .

It is not hard fulfill condition (i) if $\mathcal{L}$ is $G$-invariant – simply choose the $c$-parameter as a standard Gaussian vector. Then, $A=A_{\mathcal{L}}+Lc$ will also be a Gaussian vector on the space $\mathcal{L}$, invariant to all the unitary transformations $\rho(g)$. A detailed argument is given in Appendix A.1.

###### Remark 3 .

As we remarked in Remark 1, the representations on the intermediate spaces $X_{i}$ are free to choose. One should hence really interpret condition (ii) in Theorem 4.2 as that there *exist* intermediate representations so that $\mathcal{L}$ is $G$-invariant with respect to the corresponding $\rho$.

We will here only prove Theorem 4.2 for the case of gradient flow. The proof in the stochastic case in fact is essentially the same, but needs a little more tools from probability theory, whence we postpone it to Appendix B.

To show that $\overline{\Phi}_{t}(x)$ is equivariant, it is enough to prove an invariance result of the *distribution* of the parameters $A^{t}$, as the following lemma shows.

###### Lemma 4.3 .

If the distribution of $A^{t}$ on $\mathcal{H}$ is group invariant in the sense that $\rho(g)A^{t}\sim A^{t}$ for all $g\in G$, then $\overline{\Phi}_{t}$ is $G$-equivariant.

###### Proof.

In the proof of Lemma 3.9 in Nordenfors et al. (), it is shown that $\Phi_{A}(\rho_{0}(g)x)=\rho_{N}(g)\Phi_{\rho(g^{-1})A}(x)$, for $g\in G$ and $x\in X$ – we give the relevant part of the proof in Appendix A. This formula allows us to argue that if $A^{t}\sim\rho(g)A^{t}$, $\forall g\in G$, we have for any $x$

$$ $\displaystyle\Phi_{A^{t}}(\rho_{0}(g)x)=\rho_{N}(g)\Phi_{\rho(g^{-1})A^{t}}(x) \sim\rho_{N}(g)\Phi_{A^{t}}(x),\quad\forall g\in G.$ $$

Taking the expectation over $\pi$ now gives the claim.
∎

We thus have the clear goal of finding reasonable assumptions under which the condition of Lemma 4.3 is fulfilled. Remember that gradient flow amounts to applying the flow map $\mathcal{F}^{t}$ to the parameters of each ensemle member. If that flow map is equivariant, it will keep an invariant initial distribution of $A$ invariant – this is the content of e.g. Theorem 1 from Köhler et al. (). Let us formulate this as a lemma.

###### Lemma 4.4 .

If $\rho(g)A\sim A$, $\forall g\in G$, and $\mathcal{F}^{t}$ is $G$-equivariant, then $\rho(g)\mathcal{F}^{t}A\sim\mathcal{F}^{t}A$, $\forall g\in G$.

###### Proof.

Note that if $\rho(g)A\sim A$, $\forall g\in G$, then $\mathcal{F}^{t}\rho(g)A\sim\mathcal{F}^{t}A$, since $\mathcal{F}^{t}$ and $\rho(g)$ are Borel measureable, $\forall g\in G$. If we now assume that $\mathcal{F}^{t}$ is $G$-equivariant, then $\rho(g)\mathcal{F}^{t}A=\mathcal{F}^{t}\rho(g)A\sim\mathcal{F}^{t}A$, $\forall g\in G$.
∎

This means that we want to look for assumptions that guarantee $\mathcal{F}^{t}$ is $G$-equivariant. Well, in fact, Köhler et al. () showed that the flow map given by a $G$-equivariant vector field is also $G$-equivariant, the proof of which we include in Appendix A.

###### Lemma 4.5 .

The flow generated by a $G$-equivariant vector field is $G$-equivariant.

This means for us that we only have left to show that $-\Pi_{\mathcal{L}}\nabla R^{\mathrm{aug}}$ is $G$-equivariant, which is the content of the following lemma.

###### Lemma 4.6 .

If $\mathcal{L}$ is $G$-invariant, then $-\Pi_{\mathcal{L}}\nabla R^{\mathrm{aug}}$ is $G$-equivariant.

###### Proof.

Let $\mathcal{L}$ be $G$-invariant. Then by Lemma 4.1 it follows that $\Pi_{\mathcal{L}}$ is $G$-equivariant. Thus, since the composition of $G$-equivariant maps is again $G$-equivariant, we only need to show that $\nabla R^{\mathrm{aug}}$ is $G$-equivariant. To this end it suffices to show that $R^{\mathrm{aug}}$ is $G$-invariant, since the $G$-equivariance of the gradient then follows by the chain rule. To show this, we will use Lemma 3.9 from Nordenfors et al. (), which states that

$$ $\displaystyle R^{\mathrm{aug}}(A)=\int_{G}R(\rho(g)A)\mathrm{d}\mu(g).$ $$

Now the $G$-invariance of $R^{\mathrm{aug}}$ is a straightforward matter. Utilizing that $\rho$ is representation and the invariance of the Haar measure, we obtain for every $h\in G$

$$ $\displaystyle R^{\mathrm{aug}}(\rho(h)A)=\int_{G}R(\rho(gh)A)\mathrm{d}\mu(g)$ $\displaystyle=\int_{G}R(\rho(g)A)\mathrm{d}\mu(g)=R^{\mathrm{aug}}(A),$ $$

This concludes the proof.
∎

Now, let us put all of this together to prove Theorem 4.2.

###### Proof of Theorem 4.2 .

Assume that $\rho(g)A^{0}\sim A^{0}$ and that $\mathcal{L}$ is $G$-invariant. By Lemma 4.6 we have that $-\Pi_{\mathcal{L}}\nabla R^{\mathrm{aug}}$ is $G$-equivariant. Then Lemma 4.5 yields that $\mathcal{F}_{t}$ is $G$-equivariant, from which it follows by Lemma 4.4 that $\rho(g)\mathcal{F}_{t}A^{0}\sim\mathcal{F}_{t}A^{0}$, $\forall g\in G$. Finally, it follows by Lemma 4.3 that $\overline{\Phi}_{t}$ is $G$-equivariant, since $\mathcal{F}_{t}A^{0}=A^{t}$, which completes the proof.
∎

This concludes the proof of Theorem 4.2 in the case of gradient flow and full augmentation.

###### Remark 4 .

As we have earlier noted, full group augmentation is practically impossible when dealing with infinite groups. Theorem 4.2 is however still relevant for it. Namely, we could approximate the full augmentations by just augmenting with finite subset $H$ of $G$. Then, the risk we should optimize is the following

$$ $\displaystyle R^{H}(A)=\frac{1}{|H|}\sum_{h\in H}R(\rho(h)A).$ $$

If $H$ is a subgroup of $G$, this directly corresponds to performing full augmentation with the smaller set $H$. For instance, one could approximate the group of rotations $\mathrm{SO}(3)$ by the subgroup of order $60$ of rotational symmetries of an icosahedron. Our results then immediately imply that the ensemble models will be equivariant with respect to that subgroup.

As stated earlier, in Appendix B we prove that Theorem 4.2 also holds for SGD with random augmentation. The proof follows roughly the same idea as here: First, we show that the gradient field $\nabla R^{g}$ in a sense is equivariant. Importantly, it does not hold in the sense that $\nabla R^{g}$ for a fixed draw of $g$ is an equivariant vector field, but rather that $\nabla R^{g}(\rho(g)A)\sim\rho(g)R^{g}(A)$, for every $g$ and $A$ – i.e., that there holds an equivariance *in distribution*. We then show that the ’flow’ of the SGD with respect to such an equivariant vector field will be equivariant, and thus transform $G$-invariantly distributed parameters $A^{0}$ to $G$-invariantly distributed parameters $A^{t}$ after $t$ steps.

###### Theorem 4.2 .

###### Remark 2 .

###### Remark 3 .

###### Lemma 4.3 .

###### Proof.

###### Lemma 4.4 .

###### Proof.

###### Lemma 4.5 .

###### Lemma 4.6 .

###### Proof.

###### Proof of Theorem 4.2 .

###### Remark 4 .

## 5 Experiments

We perform a small numerical experiment both to test the robustness of our theorems to using the sample mean instead of the true expectation when creating the ensemble model, as well as testing the necessity of the assumption that $\mathcal{L}$ is $G$-invariant, and the assumption that the initial distribution of parameters is $G$-invariant. The code, that relies heavily of the code made available from Nordenfors et al. (), can be found
at [github.com/onordenfors/ensemble_experiment](https://github.com/onordenfors/ensemble_experiment),
and additional technical details (such as specification of hardware) in Appendix D.

### 5.1 Experiment description

Each ensemble have a 1000 members. The member of the ensembles are small CNNs of the same structure that is used in Nordenfors et al. () (see Figure 3 as well as Appendix D). We train nearly identical ensembles, the only difference being that the members of one ensemble having filters of symmetric support, whereas those of the other have asymmetric support. The models are trained for $10$ epochs on the MNIST dataset (LeCun et al., ), using SGD with a constant learning rate of $0.01$, a batch size of 32, and cross entropy loss, applying augmentations using $C_{4}$-rotations randomly, as described in Section 3.2. Since $\mathcal{L}^{\mathrm{sym}}$ for this representation is $G$-invariant, but $\mathcal{L}^{\mathrm{as}}$ is not, we expect that the former ensembles become equivariant, whereas the latter do not.

Figure: Figure 3: The architecture used in our neural networks. The convolutions have filters with support as in Figure 2 (left or right).

We initialize the ensembles by drawing the coefficients $c$ from a standard normal distribution, as in Remark 2. Since $\mathcal{L}^{\mathrm{as}}$ is not $G$-invariant, this does not yield an invariant initial distribution. We can mitigate this by setting the ’corner pieces’ of all asymmetric filters equal to zero. We hence get three ensembles: One symmetric, one asymmetric initialized $G$-invariantly, and one asymmetric initialized ”naïvely”.

We use two metrics to evaluate the invariance of the trained models. First, similarly as in Gerken & Kessel (),
we calculate the average *orbit same prediction* (OSP). That is, for each test image, we test how many of the four rotated versions of it are given the same prediction as the unrotated one by the ensemble model. OSP lies between $1$ and $4$, where $4$ indicates perfect invariance. The second metric we calculate is the average symmetric KL-divergence between the class probabilities predicted on an unrotated image with each of the four rotated versions of it. Note that the class probabilities can vary quite a lot but still yield the same prediction, whence this is a finer measure of invariance than the OSP. Both metrics are evaluated both on the MNIST test set, as well the (out-of-distribution) CIFAR-10 (Krizhevsky, ) test set (reshaped and converted to grayscale).

### 5.2 Results and discussion

The results from our experiments can be seen in Figure 4. We notice that with respect to both metrics, the symmetric ensembles outperform the asymemtric ones initialized invariantly, which in themselves outperform the naïvely initialized asymmetric ones. The differences are more prominent on the OOD data, which is to be expected – the networks have actually ’seen’ rotated nines in the MNIST data and can hence have learned to predict them correctly even if the network is not inherently equivariant – the same is not true for rotated cars in the CIFAR10 set. We also give the metrics after epoch $10$ in Table 1

**Table 1: Metrics after the $10$^th epoch of training for ensembles with $1000$ members. The standard deviations are over the test data.**
|  | MNIST | CIFAR–10 |  |  |
| --- | --- | --- | --- | --- |
| Model | OSP | $\log_{10}(\mathrm{KL-DIV})$ | OSP | $\log_{10}(\mathrm{KL-DIV})$ |
| $\mathcal{L}^{\mathrm{sym}}$ | $\mathbf{3.97}$ | $\mathbf{-2.38}$ | $\mathbf{3.89}$ | $\mathbf{-1.50}$ |
| $\mathcal{L}^{\mathrm{as}}$, $\rho(g)A\sim A$ | $3.96$ | $-1.89$ | $3.82$ | $-0.97$ |
| $\mathcal{L}^{\mathrm{as}}$ | $3.91$ | $-1.29$ | $3.66$ | $-0.29$ |

Figure: Figure 4: Top: OSP for ensembles with $1000$ members. (Higher is better) The middle $95\%$ of individual ensemble members are within the shaded area. Bottom: Logarithm of symmetric Kullback–Leibler Divergence for ensembles with $1000$ members. (Lower is better). Best viewed in color.
Refer to caption: x1.png

One should acknowledge that clearly, the ensembles, even the symmetric ones, are never truly invariant, in particular at initialization. This is not what Theorem 4.2 predicts – but note that it only makes a claim about ensemble models defined as the true expectations over the distribution of parameters having the invariant property, whereas the ensembles we train here are finite. Note that it is natural that this effect is especially prominent at initialization, since the networks at initialization are entirely random, and small perturbations could yield different predictions. In fact, in our experiments the OSP at initialization does not increase as ensemble size increases. However, the more fine-grained KL-divergence measure decreases, as can be seen Table 2, where we give the divergence at initialization for two subensembles of size $10$ and $100$, as well as for the full ensemble with symmetric filters. This supports that the non-perfect invariance of the ensembles can be mainly attributed to using a finite ensemble. More results from the tests of ensembles of sizes $10$ and $100$ are presented in Appendix D

One should also note that although the asymmetric ensembles are less invariant than the symmetric ones, they are still remarkably close to being invariant. This cannot be completely explained by our theory. Note that we assume $G$-invariance of $\mathcal{L}$ is order to achieve that $\rho(g)\Pi_{\mathcal{L}}=\Pi_{\mathcal{L}}\rho(g)$. Note that we in our case, $\rho(g)\Pi_{\mathcal{L}}$ is still ”almost” equal to $\Pi_{\mathcal{L}}\rho(g)$ for the asymetric filters – it only differs for the non-zero corners. We investigate this point further in Appendix E. Our results there support this hypothesis somewhat, but more work is needed in the future.

Now let us finally comment on the fact that even the *non-invariantly initialized* ensembles seem to become more equivariant after training. Note that the main result of our paper can be interpreted as a ’stationarity’ result – if we start invariantly distributed, we stay that way. Our experiment indicates that the the invariant distributions even are *attractors*. If this is true, and if so how generally, is an interesting direction of future work.

**Table 2: Divergence at initialization on MNIST test data for the model with symmetric filters. Divergence decreases as ensemble size increases.**
|  | $\log_{10}(\mathrm{KL-DIV})$ |  |  |
| --- | --- | --- | --- |
| Model | $10$ Members | $100$ Members | $1000$ Members |
| $\mathcal{L}^{\mathrm{sym}}$ | $1.13$ | $0.58$ | $-0.17$ |

## 6 Conclusion

The goal of this paper was to extend the results of Gerken & Kessel (), regarding $G$-equivariance of ensembles of infinitely wide neural networks trained with gradient descent under full augmentation, to ensembles of finite–width neural networks trained with SGD and random augmentation.

We succeeded in our goal with Theorem 4.2, where we proved that, modulo an oft–satisfied $G$-invariance condition on the network architecture, ensembles become $G$-equivariant when training with SGD and random augmentation, assuming that the parameters of the network were distributed $G$-invariantly to begin with (e.g., with Gaussian initialization). That is, we have shown that
if the goal is group equivariant model, it suffices to train a neural network ensemble model under data augmentation. Our numerical experiments, while not conclusive, support these conclusions for sample mean ensembles as well.

Interesting directions for future work include bounding the error when using sample mean ensembles, as well as the error when using architectures that violate the $G$-invariance condition. In addition to this, it is an interesting question whether or not the initial distribution of parameters needs to be $G$-invariant or if the ensemble will still be ’pulled into’ a $G$-equivariant state by the augmentation process.

## 7 Acknowledgements

This work was partially supported by the Wallenberg AI, Autonomous Systems and
Software Program (WASP) funded by the Knut and Alice Wallenberg Foundation. The computations were enabled by resources provided by the National Academic Infrastructure for Supercomputing in Sweden (NAISS), partially funded by the Swedish Research Council through grant agreement no. 2022-06725.

#### Reproducability statement

We provide all the code used for the experiments in the supplementary material, along with detailed instructions to reproduce the experiments made in the paper.

#### Ethics statement

This work is of theoretical nature, and in particular do not involve human subjects, and only publicly available datasets. We see no obvious societal impact, positive
or negative, in the short to middle term. The aim of the article is to provide new answers to the question when equivariance of a neural network model can be guaranteed only from training it on augmented data. This has relevance for the ongoing effort of providing more reliable and explainable AI. The authors declare that they have no conflicts of interest, and that they have followed good research practice.

## Appendix A Assorted proofs

In this appendix we collect the proofs that we left out in the main test. Let us begin with the formula $\Phi_{A}(\rho_{0}(g)x)=\rho_{N}(g)\Phi_{\rho(g^{-1})A}(x)$. Note that this proof is merely a reformulation of the one given in Nordenfors et al. () (see Lemma 3.9 of said article), and presented here only for convenience of the reader.

###### Theorem A.1 .

Under the Assumption 1 that all non-linearities are equivariant, we have

$$ $\Phi_{A}(\rho_{0}(g)x)=\rho_{N}(g)\Phi_{\rho(g^{-1})A}(x).$ $$

###### Proof.

The proof is by induction on the number of layers $N$. Let $\Phi^{N}_{A}$ be the network given by the first $N$ layers of $\Phi_{A}$. Let us start with the case $N=1$. For $N=1$ we have

$$ $\displaystyle\rho_{1}(g)\Phi^{1}_{\rho(g^{-1})A}(x)$ $\displaystyle=\rho_{1}(g)\sigma_{0}(\rho_{1}(g^{-1})A_{0}\rho_{0}(g^{-1})^{-1} x)=\sigma_{0}(\rho_{1}(g)\rho_{1}(g^{-1})A_{0}\rho_{0}(g^{-1})^{-1}x)$ $\displaystyle=\sigma_{0}(\operatorname{id}A_{0}\rho_{0}(g)x)=\Phi^{1}_{A}(\rho _{0}(g)x),\quad\forall g\in G,$ $$

where the first equality is by definition of $\rho(g)$, the second equality is by $G$-equivariance of $\sigma_{0}$, and the third equality follows since $\rho_{i}(g)$ is a representation, $\forall i\in\{0,1\}$, $\forall g\in G$.

Now, assume that $\Phi^{K}_{A}(\rho_{0}(g)x)=\rho_{K}(g)\Phi^{K}_{\rho(g^{-1})A}(x)$, $\forall g\in G$. We want to show that $\Phi^{K+1}_{A}(\rho_{0}(g)x)=\rho_{K+1}(g)\Phi^{K+1}_{\rho(g^{-1})A}(x)$, $\forall g\in G$. We have

$$ $\displaystyle\rho_{K+1}(g)\Phi^{K+1}_{\rho(g^{-1})A}(x)$ $\displaystyle=\rho_{K+1}(g)\sigma_{K}(\widehat{\rho}_{K}(g^{-1})A_{K}\Phi^{K}_ {\rho(g^{-1})A}(x))$ $\displaystyle=\rho_{K+1}(g)\sigma_{K}(\rho_{K+1}(g^{-1})A_{K}\rho_{K}(g^{-1})^ {-1}\Phi^{K}_{\rho(g^{-1})A}(x))$ $\displaystyle=\sigma_{K}(\rho_{K+1}(g)\rho_{K+1}(g^{-1})A_{K}\rho_{K}(g^{-1})^ {-1}\Phi^{K}_{\rho(g^{-1})A}(x))$ $\displaystyle=\sigma_{K}(\operatorname{id}A_{K}\rho_{K}(g)\Phi^{K}_{\rho(g^{-1 })A}(x))$ $\displaystyle=\sigma_{K}(A_{K}\Phi^{K}_{A}(\rho_{0}(g)x))=\Phi^{K+1}_{A}(\rho_ {0}(g)x),\quad\forall g\in G,$ $$

where the first equality is by the definition of $\Phi_{A}$, the second equality is by the definition of $\widehat{\rho}_{K}(g)$, the third equality follows by $G$-equivariance of $\sigma_{K}$, the fourth equality follows since $\rho_{i}(g)$ is a representation, $\forall i\in\{K,K+1\}$, $\forall g\in G$, the fifth equality follows by the inductive assumption, and the final equality is just the definition of $\Phi^{K+1}$.

By induction $\Phi_{A}(\rho_{0}(g)x)=\rho_{N}(g)\Phi_{\rho(g^{-1})A}(x)$, $\forall g\in G$.
∎

We move on to the fact that $G$-invariant vector fields yield equivariant flows (Lemma 4.5), where we again give a proof only out of convenience for the reader – it is a slight reformulation of the proof of Theorem 2 in Köhler et al. (), but the statement should probably be well known to the experts.

###### Theorem A.2 .

Let $V:\mathbb{R}^{N}\to\mathbb{R}^{N}$ be a $G$-equivariant, Lipschitz continuous vector field. Then, the flow $\mathcal{F}_{t}$ generated by $V$ also is.

###### Proof.

Let $x_{0}\in\mathbb{R}^{N}$ be arbitrary. By definition of the flow, $\mathcal{F}_{t}(\rho(g)x_{0})$ is the value of the unique solution $x^{g}$ to the initial value problem

$$ $\displaystyle\dot{x}^{g}(t)=V(x^{g}(t)),\quad x^{g}(0)=\rho(g)x_{0}.$ (3) $$

Now let $x$ be the solution of

$$ $\displaystyle\dot{x}(t)=V(x),\quad x(0)=x_{0}.$ $$

Then, the function $u(t)=\rho(g)x(t)$ solves equation 3, since $u(0)=\rho(g)x(0)=\rho(g)x_{0}$, and

$$ $\displaystyle\dot{u}(t)=\rho(g)\dot{x}(t)=\rho(g)V(x(t))=V(\rho(g)x(t))=V(u(t)),$ $$

where we used the equivariance of $V$ in the penultimate step. Because of the uniqueness of the solution, we must then have $u(t)=x^{g}(t)$, i.e.

$$ $\displaystyle\mathcal{F}_{t}(\rho(g)x_{0})=u(t)=\rho(g)x(t)=\rho(g)\mathcal{F} _{t}(x_{0}),$ $$

which is what was to be shown.
∎

We move on to the proof of Lemma 4.1 i.e. that $\mathcal{L}$ is $G$-invariant if and only if $\Pi_{\mathcal{L}}$ is equivariant.

###### Proof of Lemma 4.1 .

Let us begin by proving the *only if* part. Assume that $\rho(g)\mathcal{L}\subseteq\mathcal{L}$, $\forall g\in G$. Clearly, if $\exists B\in\mathrm{T}\mathcal{L}$, $\exists g\in G$, such that $\rho(g)B\notin\mathrm{T}\mathcal{L}$, then $A=A_{\mathcal{L}}+B\in\mathcal{L}$, but $\rho(g)A=\rho(g)A_{\mathcal{L}}+\rho(g)B=A_{\mathcal{L}}+\rho(g)B\notin
\mathcal{L}$. By contraposition, we must have $\rho(g)\mathrm{T}\mathcal{L}\subseteq\mathrm{T}\mathcal{L}$, $\forall g\in G$, since we have assumed that $\rho(g)\mathcal{L}\subseteq\mathcal{L}$, $\forall g\in G$. Now, suppose that $x\in\mathrm{T}\mathcal{L}$ and $y\in\mathrm{T}\mathcal{L}^{\perp}$. Then we have

$$ $\displaystyle\langle\rho(g)y,x\rangle=\langle y,\rho(g)^{*}x\rangle=\langle y, \rho(g)^{-1}x\rangle=\langle y,\rho(g^{-1})x\rangle=0,\quad\forall g\in G,$ $$

where the second equality is by unitarity, the third equality is by definition of representations, and the final equality follows from $\rho(g)\mathrm{T}\mathcal{L}\subseteq\mathrm{T}\mathcal{L}$, $\forall g\in G$. Thus, it holds that $\rho(g)\mathrm{T}\mathcal{L}^{\perp}\subseteq\mathrm{T}\mathcal{L}^{\perp}$, $\forall g\in G$. We can decompose any $z\in\mathcal{H}$ as $z=z_{\mathrm{T}\mathcal{L}}+z_{\mathrm{T}\mathcal{L}^{\perp}}$, where $z_{\mathrm{T}\mathcal{L}}=\Pi_{\mathcal{L}}z$ and $z_{\mathrm{T}\mathcal{L}^{\perp}}=\Pi_{\mathcal{L}}^{\perp}z$. It follows that

$$ $\displaystyle\Pi_{\mathcal{L}}\rho(g)z=\Pi_{\mathcal{L}}\rho(g)(z_{\mathrm{T} \mathcal{L}}+z_{\mathrm{T}\mathcal{L}^{\perp}})=\Pi_{\mathcal{L}}\rho(g)z_{ \mathrm{T}\mathcal{L}}+\Pi_{\mathcal{L}}\rho(g)z_{\mathrm{T}\mathcal{L}^{\perp }}=\rho(g)z_{\mathrm{T}\mathcal{L}}=\rho(g)\Pi_{\mathcal{L}}z,$ $$

$\forall g\in G$, where the second equality is by linearity, the third equality follows by $\rho(g)\mathrm{T}\mathcal{L}\subseteq\mathrm{T}\mathcal{L}$ and $\rho(g)\mathrm{T}\mathcal{L}^{\perp}\subseteq\mathrm{T}\mathcal{L}^{\perp}$, $\forall g\in G$, and the last equality is by definition of $z_{\mathrm{T}\mathcal{L}}$. This concludes the *only if* part of the proof.

Let us now prove the *if* part of the proof. Assume that $\Pi_{\mathcal{L}}$ is $G$-equivariant. Then we have for any $B\in\mathrm{T}\mathcal{L}$ that

$$ $\displaystyle\rho(g)B=\rho(g)\Pi_{\mathcal{L}}B=\Pi_{\mathcal{L}}\rho(g)B\in \mathrm{T}\mathcal{L},\quad\forall g\in G,$ $$

since $\Pi_{\mathcal{L}}$ is a $G$-equivariant projection onto $\mathrm{T}\mathcal{L}$. Thus, we have for any $A\in\mathcal{L}$ that

$$ $\displaystyle\rho(g)A=\rho(g)(A_{\mathcal{L}}+B)=\rho(g)A_{\mathcal{L}}+\rho(g )B=A_{\mathcal{L}}+\rho(g)B\in\mathcal{L},\quad\forall g\in G,$ $$

since $\mathcal{L}=A_{\mathcal{L}}+\mathrm{T}\mathcal{L}$ with $\rho(g)A_{\mathcal{L}}=A_{\mathcal{L}}$ and $\rho(g)$ is linear.
∎

###### Theorem A.1 .

###### Proof.

###### Theorem A.2 .

###### Proof.

###### Proof of Lemma 4.1 .

### A.1 G 𝐺 G italic_G -invariant initialization of the network

Let us now, as advertised in the main paper, prove that a Gaussian initialization of the coefficients $c$ will, as soon as $\mathcal{L}$ is $G$-invariant, yield a $G$-invariant distributions of the parameters $A$,

###### Lemma A.3 .

Let $L:\mathbb{R}^{p}\to\mathcal{L}$ be a parametrization of $\mathcal{L}$, $\mathcal{L}=A_{\mathcal{L}}+L\mathbb{R}^{p}$, with $A_{\mathcal{L}}\in\mathcal{H}_{G}$. Then, if $c$ is a standard Gaussian vector (with i.i.d. entries), and $\mathcal{L}$ is $G$-invariant, $A=A_{\mathcal{L}}+Lc$ will have a $G$-invariant distribution.

###### Proof.

Because $c$ is standard Gaussian, $A$ will also have a Gaussian distribution, with mean $A_{\mathcal{L}}$ and covariance matrix $LL^{*}=\Pi_{\mathcal{L}}$, where the latter follows from the fact that $L$ is unitary. Now, by the same argument, $\rho(g)A=\rho(g)A_{\mathcal{L}}+\rho(g)Lc$ will be Gaussian with mean $\rho(g)A_{\mathcal{L}}=A_{\mathcal{L}}$ – remember that $A_{\mathcal{L}}\in\mathcal{H}_{G}$ – and covariance $\rho(g)L(\rho(g)L)^{*}$. We may now argue

$$ $\displaystyle\rho(g)L(\rho(g)L)^{*}=\rho(g)LL^{*}\rho(g)^{*}=\rho(g)\Pi_{ \mathcal{L}}\rho(g)^{*}=\Pi_{\mathcal{L}}\rho(g)\rho(g)^{*}=\Pi_{\mathcal{L}}.$ $$

The penultimate step follows from the $G$-invariance of $\mathcal{L}$, and the final one from the unitarity of $\rho(g)$. This shows that $A$ and $\rho(g)A$ both are Gaussians with mean $A_{\mathcal{L}}$ and covariance $\Pi_{\mathcal{L}}$, and we are done.
∎

###### Lemma A.3 .

###### Proof.

### A.2 A result about the gradients of random functions

In preparation of our proof of the stochastical version of the main result, let us prove the following very intuitive lemma about random functions: If two random functions, that almost surely are differentiable, have the property that their pointwise distributions are equal, the same is true for their gradients. For the proof, we will invoke the Cramér-Wold Theorem (Cramér & Wold, ).

###### Theorem A.4 (Cramér-Wold) .

A probability distribution $p$ on $\mathbb{R}^{d}$ is uniquely determined by the set of distributions $p\circ\pi_{v}^{-1}$ on $\mathbb{R}$, indexed by the unit vector $v$, where $\pi_{v}:\mathbb{R}^{d}\to\mathbb{R}$, $x\mapsto\langle x,v\rangle$.

We now formulate and prove the statement.

###### Lemma A.5 .

Let $f$ and $g$ be random functions $\mathbb{R}^{d}\to\mathbb{R}$ that almost surely are $C^{1}$. If for every $x\in\mathbb{R}^{d}$, $f(x)\sim g(x)$, then also $\nabla f(x)\sim\nabla g(x)$, for all $x\in\mathbb{R}^{d}$.

###### Proof.

Assume that $f(x)\sim g(x)$, for all $x\in\mathbb{R}^{d}$. Then

$$ $\displaystyle X_{n}\vcentcolon=\frac{f(x+\frac{1}{n}v)-f(x)}{\frac{1}{n}}\sim \frac{g(x+\frac{1}{n}v)-g(x)}{\frac{1}{n}}=\vcentcolon Y_{N},\quad\forall x,v \in\mathbb{R}^{d},\,n\in\mathbb{Z}_{+}.$ $$

Now, for every $x\in\mathbb{R}^{d}$ and every $v\in S^{d-1}$, $X_{n}\to\langle\nabla f(x),v\rangle$ and $Y_{n}\to\langle\nabla_{x}g(x),v\rangle$ a.s. as $n\to\infty$. Thus, the distributions of the limit random variables (i.e., the distributions of the directional derivative in direction $v$) also agree. So that

$$ $\displaystyle\langle\nabla f(x),v\rangle\sim\langle\nabla g(x),v\rangle,\quad \forall x\in\mathbb{R}^{d},\,\forall v\in S^{d-1}.$ $$

Since this holds for every $x\in\mathbb{R}^{d}$ and every $v\in S^{d-1}$, we can apply the Cramér-Wold Theorem to conclude that

$$ $\displaystyle\nabla f(x)\sim\nabla g(x),\quad\forall x\in\mathbb{R}^{d}.$ $$

∎

###### Theorem A.4 (Cramér-Wold) .

###### Lemma A.5 .

###### Proof.

## Appendix B Proof of Theorem 4.2 in the case of SGD with random augmentation

In this appendix we will prove the main result of this paper in the stochastic setting. We will proceed by proving a few lemmas, and finally proving the main result.

In Section 4 we utilize the fact that a $G$-invariant function has a $G$-equivariant gradient. Now, $R^{g}$ is clearly not $G$-invariant for any fixed draw of the $g_{k}$ and $x_{k}$, but as we will see, it is however in a sense $G$-invariant *in distribution*. We will now prove that the implication holds for equality in distribution for random functions.

###### Lemma B.1 .

If $f$ is a random function $\mathcal{H}\to\mathbb{R}$ that almost surely is $C^{1}$ and satisfies $f(A)\sim(f\circ\rho(g))(A)$, for every $g\in G$ and every $A\in\mathcal{H}$, then $\nabla f$ satisfies $\nabla f(\rho(g)A)\sim\rho(g)\nabla f(A)$, for every $g\in G$ and every $A\in\mathcal{H}$.

###### Proof.

We have that

$$ $\displaystyle\nabla f(\rho(h)A)$ $\displaystyle\sim\nabla(f\circ\rho(g))(\rho(h)A)$ $\displaystyle=\rho(g)^{*}\nabla f(\rho(g)\rho(h)A)$ $\displaystyle=\rho(h)\rho(h)^{*}\rho(g)^{*}\nabla f(\rho(g)\rho(h)A)$ $\displaystyle=\rho(h)\rho(gh)^{*}\nabla f(\rho(gh)A)$ $\displaystyle=\rho(h)\nabla(f\circ\rho(gh))(A)\sim\rho(h)\nabla f(A),\quad \forall h\in G,$ $$

where the first equality in distribution follows from Lemma A.5 with $f=f$ and $g=f\circ\rho(g)$, the second is simply the chain rule, the third follows because $\rho(h)$ is assumed unitary so that $\rho(h)\rho(h)^{*}=\operatorname{id}$, the fourth because $\rho$ is a representation, the fifth is again simply the chain rule, and since $gh\in G$, the final equality in distribution follows by Lemma A.5 with $f=f$ and $g=f\circ\rho(gh)$.
∎

We will now show that $R^{g}$ satisfies $R^{g}(A)\sim(R^{g}\circ\rho(g))(A)$, for every $g\in G$ and every $A\in\mathcal{H}$, and thus that the gradient of $R^{g}$ satisfies $\nabla R^{g}(\rho(g)A)\sim\rho(g)\nabla R^{g}(A)$, for every $g\in G$ and every $A\in\mathcal{H}$. This is the counterpart of Lemma 4.6 for SGD with random augmentation.

###### Lemma B.2 .

The gradient of $R^{g}$ satisfies $\nabla R^{g}(\rho(g)A)\sim\rho(g)\nabla R^{g}(A)$, for every $g\in G$ and every $A\in\mathcal{H}$.

###### Proof.

We want to show that $\nabla R^{g}(\rho(g)A)\sim\rho(g)\nabla R^{g}(A)$, for every $g\in G$ and every $A\in\mathcal{H}$. By Lemma B.1 it suffices to show that $R^{g}(A)\sim(R^{g}\circ\rho(g))(A)$, for every $g\in G$ and every $A\in\mathcal{H}$. Applying Theorem A.1, we get that for every $A\in\mathcal{H}$ that

$$ $\displaystyle R^{g}(\rho(h)A)$ $\displaystyle=\frac{1}{s}\sum_{k=1}^{s}\ell(\Phi_{\rho(h)A}(\rho_{0}(g_{k})x_{ k}),\rho_{N}(g_{k})y_{k})$ $\displaystyle=\frac{1}{s}\sum_{k=1}^{s}\ell(\rho_{N}(h)\Phi_{A}(\rho_{0}(h)^{- 1}\rho_{0}(g_{k})x_{k}),\rho_{N}(g_{k})y_{k})$ $$

Invoking the $G$-invariance of $\ell$ and then that $\rho$ is a representation, the above can be rewritten to

$$ $\displaystyle\frac{1}{s}\sum_{k=1}^{s}\ell(\Phi_{A}(\rho_{0}(h)^{-1}\rho_{0}(g _{k})x_{k}),\rho_{N}(h)^{-1}\rho_{N}(g_{k})y_{k})$ $$

Now, by the invariance property of the Haar measure, the tuple of group elements $g_{0},\dots g_{s-1}$ are equidistributed with the tuple $h^{-1}g_{0},\dots h^{-1}g_{s-1}$. Since the data points $(x_{k},y_{k})$ are inpendendent of the draw of the $g_{k}$, we can conclude that the above is equidistributed with

$$ $\displaystyle\frac{1}{s}\sum_{k=1}^{s}\ell(\Phi_{A}(\rho_{0}(g_{k})x_{k}),\rho _{N}(g_{k})y_{k})=R^{g}(A),$ $$

which is what we wanted to show.
∎

We need only prove one additional lemma before we can prove our main result. Namely, we need to show that if we begin with $G$-invariantly distributed parameters $A^{0}$, then SGD with random augmentation will always lead to new parameters $A^{t}$ which are $G$-invariantly distributed. This is the counterpart to Lemma 4.4 for the case of SGD with random augmentation.

###### Lemma B.3 .

If $\rho(g)A^{0}\sim A^{0}$, for every $g\in G$, and $\mathcal{L}$ is $G$-invariant, then $\rho(g)A^{t}\sim A^{t}$, for every $g\in G$, for all $t$.

###### Proof.

We proceed by induction. Assume that $\rho(g)A^{0}\sim A^{0}$ for every $g\in G$ and $\mathcal{L}$ is $G$-invariant. The base case thus follows by assumption, i.e., $\rho(g)A^{0}\sim A$, for every $g\in G$. Let us now carry out the inductive step. We have that if $\rho(g)A^{t}\sim A^{t}$, for every $g\in G$, then

$$ $\displaystyle\rho(h)A^{t+1}$ $\displaystyle=\rho(h)(A^{t}-\gamma_{t}\Pi_{\mathcal{L}}\nabla R^{g}(A^{t}))$ $\displaystyle=\rho(h)A^{t}-\gamma_{t}\rho(h)\Pi_{\mathcal{L}}\nabla R^{g}(A^{t }))$ $\displaystyle=\rho(h)A^{t}-\gamma_{t}\Pi_{\mathcal{L}}\rho(h)\nabla R^{g}(A^{t }))$ $\displaystyle\sim\rho(h)A^{t}-\gamma_{t}\Pi_{\mathcal{L}}\nabla R^{g}(\rho(h)A ^{t}))$ $\displaystyle\sim A^{t}-\gamma_{t}\Pi_{\mathcal{L}}\nabla R^{g}(A^{t}))=A^{t+1 },\quad\forall h\in G,$ $$

where the first equality is by the recursion formula for SGD with random augmentation, the second equality is by linearity of $\rho(h)$, the third equality follows from Lemma 4.1 since we have assumed that $\mathcal{L}$ is $G$-invariant, the fourth equality in distribution follows from Lemma B.2, the fifth equality in distribution is by our inductive assumption, and the final equality is again by the recursion formula for SGD with random augmentation. Thus, it follows by induction that $\rho(g)A^{t}\sim A^{t}$, $\forall g\in G$, $\forall t$.
∎

We may now prove the stochastic version of our main result.

###### Proof of Theorem 4.2 in the case of SGD with random augmentation.

Assume that $\rho(g)A^{0}\sim A^{0}$ and $\rho(g)\mathcal{L}\subseteq\mathcal{L}$, $\forall g\in G$. Thus, by Lemma B.3 we have that $\rho(g)A^{t}\sim A^{t}$, $\forall g\in G$, by which it follows from Lemma 4.3 that $\overline{\Phi}_{t}$ is $G$-equivariant.
∎

###### Lemma B.1 .

###### Proof.

###### Lemma B.2 .

###### Proof.

###### Lemma B.3 .

###### Proof.

###### Proof of Theorem 4.2 in the case of SGD with random augmentation.

## Appendix C Convolutions asymmetric filters and C 4 subscript 𝐶 4 C_{4} italic_C start_POSTSUBSCRIPT 4 end_POSTSUBSCRIPT -invariance

In the main paper, we have used $\mathcal{L}^{\mathrm{sym}}$ and $\mathcal{L}^{\mathrm{as}}$ as running examples. We have argued that if the canonical representation $\rho^{\mathrm{rot}}$ is used on all intermediate spaces, $\mathcal{L}^{\mathrm{sym}}$ is invariant under all transformations $\rho(g)$, whereas $\mathcal{L}^{\mathrm{as}}$ is not. However, as we remarked in Example 4.1, there is no inherent reason why the actions on the intermediate spaces should always be $\rho^{\mathrm{rot}}$. The purpose of this section is to show that if we fix the representation $\rho^{\mathrm{rot}}$ on $X$, it is not. To do this, it is clearly enough to focus on the space of convolutional maps between $X_{0}=\mathbb{R}^{n,n}$ and $X_{1}=(\mathbb{R}^{n,n})^{d}$.

To make the case clear that this is an important and nontrivial point, let us first show that there are representations other than $\rho^{\mathrm{rot}}$ on $X_{1}$ which makes $\mathcal{L}^{\mathrm{sym}}$ invariant. Let $\rho^{\mathrm{ch}}$ be a representation of $C_{4}$ on $\mathbb{R}^{d}$. Such exist: Note that $C_{4}$ is isomorphic to $\mathbb{Z}_{4}$, the integers equipped with addition modulo $4$, and $\mathbb{Z}_{4}$ naturally acts on the space $\mathbb{R}^{4}$ by shifting the entries, i.e $(\varrho(k)v)_{\ell}=v_{\ell-k}$, which then also does $C_{4}$. In obvious ways, this can be extended to any $\mathbb{R}^{d}$. For any representation $\rho^{\mathrm{ch}}$ of $C_{4}$ on $\mathbb{R}^{d}$, we can combine it with $\rho^{\mathrm{rot}}$ as follows:

$$ $\displaystyle\big{(}(\rho^{\mathrm{ch}}\odot\rho^{\mathrm{rot}})(g)x\big{)}_{k }=\bigg{(}\sum_{\ell\in[d]}\rho^{\mathrm{ch}}(g)_{k\ell}\rho^{\mathrm{rot}}(g) x_{\ell}\bigg{)}_{k}.$ (4) $$

In words, $\rho^{\mathrm{ch}}\odot\rho^{\mathrm{rot}}$ first rotates each entry of a tuple $x$ according to $\rho^{\mathrm{ch}}(g)$, and then transforms the $d$ resulting $\mathbb{R}^{N,N}$-images by $\rho^{\mathrm{ch}}$ as if they were entries in a $\mathbb{R}^{d}$-vector. A straightforward calculation now shows that the lifted representation $\widehat{\rho_{0}}(g)$ then maps $\langle\psi\rangle$ to

$$ $\displaystyle\widehat{\rho_{0}}(g)\langle\psi\rangle=\langle\big{(}\sum_{\ell} \rho^{\mathrm{ch}}(g)_{k\ell}\rho^{\mathrm{rot}}(g)\psi_{\ell}\big{)}_{k}\rangle.$ (5) $$

Consequently, if the filters $\psi_{\ell}$ are symmetric filters, the transformed ones are also. On the other hand, if the $\psi$ are supported on the asymmetric support, the linear combinations in equation 5 will in general not be, and hence $\rho(g)\mathcal{L}\not\subseteq\mathcal{L}$ also for intermediate representations of the form equation 4.

The last point opens up a route to prove that there are no representations $\rho_{1}$ at all that makes $\mathcal{L}^{\mathrm{as}}$ invariant under the corresponding lifted representation: If we show that if $\rho_{1}$ is a representation for which
$\rho(g)\mathcal{L}^{\mathrm{as}}\subseteq\mathcal{L}^{\mathrm{as}}$ for all $g$, then it must be as in equation 4, then we are by the previous discussion done. This is the purpose of the following theorem.

###### Theorem C.1 .

Let $N\geq 3$, and let $C_{4}$ act through $\rho^{\mathrm{rot}}$ on $X$. If $\rho_{1}$ is a representation such that $\mathcal{L}^{\mathrm{as}}$ is $G$-invariant under the lifted representation, it must be as in equation 4. Since no such representations make $\mathcal{L}^{\mathrm{as}}$ $G$-invariant, there are no representations of $C_{4}$ on $X_{1}$ that make $\mathcal{L}^{\mathrm{as}}$ $G$-invariant.

###### Proof.

For any representation $\rho_{1}$ on $X_{1}$, we have

$$ $\displaystyle\rho(g)\langle\varphi\rangle=\rho_{1}(g)\langle\varphi\rangle\rho ^{\mathrm{rot}}(g)^{-1}$ $\displaystyle=\rho_{1}(g)\rho^{\mathrm{rot}}(g)^{-1}\rho^{\mathrm{rot}}(g) \langle\varphi\rangle\rho^{\mathrm{rot}}(g)^{-1}$ $\displaystyle=\rho_{1}(g)\rho^{\mathrm{rot}}(g)^{-1}\langle\rho^{\mathrm{rot}} (g)\varphi\rangle.$ $$

Now, we assume that $\rho_{1}(g)$ is a representation for which $\rho(g)\mathcal{L}\subseteq\mathcal{L}$. Then, the above operator must be of the form $\langle\psi\rangle$ for all $\varphi$ and $g$. Since convolutions commute with any translation $T_{\ell}$, we can then argue that

$$ $\displaystyle T_{\ell}\rho_{1}(g)\rho^{\mathrm{rot}}(g)^{-1}\langle\rho^{ \mathrm{rot}}(g)\varphi\rangle=T_{\ell}\langle\psi\rangle=\langle\psi\rangle T _{\ell}$ $\displaystyle=\rho_{1}(g)\rho^{\mathrm{rot}}(g)^{-1}\langle\rho^{\mathrm{rot}} (g)\varphi\rangle T_{\ell}$ $\displaystyle=\rho_{1}(g)\rho^{\mathrm{rot}}(g)^{-1}T_{\ell}\langle\rho^{ \mathrm{rot}}(g)\varphi\rangle$ (6) $$

where we again did not distinguish between translation representation on $X$ and the direct product of them on $X_{1}$. Since this equality is true for any $\varphi$, this implies that

$$ $\displaystyle T_{\ell}\rho_{1}(g)\rho^{\mathrm{rot}}(g)^{-1}=\rho_{1}(g)\rho^{ \mathrm{rot}}(g)^{-1}T_{\ell}$ (7) $$

for all $g$ and $\ell$. A more technical argument goes as follows: By choosing $\varphi$ equal to the tuple with only a non-trivial filter in the $i$:th channel, that filter to have only one non-zero pixel, and subsequently evaluating equation 6 on a basis of $X$, we get the desired equality of operators on a basis of $X_{1}$.

Now, equation 7 simply means that the operator $\rho_{1}(g)\rho^{\mathrm{rot}}(g)^{-1}$ commutes with translations for every $g$. It is well known that this is equivalent to $\rho_{1}(g)\rho^{\mathrm{rot}}(g)^{-1}$ being a convolution operator $\langle\chi(g)\rangle$ for some filters $\chi_{k\ell}(g)$, $k,\ell\in[d]$. Inserting this form into the definition of $\rho$ yields

$$ $\displaystyle\rho(g)\langle\varphi\rangle=\langle\chi\rangle\langle\rho^{ \mathrm{rot}}(g)\varphi\rangle=\bigg{\langle}\sum_{\ell\in[d]}\chi_{k\ell}(g)* (\rho^{\mathrm{rot}}(g)\varphi_{\ell})\bigg{\rangle}$ (8) $$

Now, suppose that any filter $\chi_{k\ell}(g)$ has a support of more than one pixel. Then, since $N\geq 3$, we can construct a filter $\varphi_{\ell}$ supported on the asymmetric set so that the support of $\chi_{k\ell}(g)*(\rho^{\mathrm{rot}}(g)\varphi_{\ell})$ is not – essentially, the convolution by $\chi_{k\ell}(g)$ would spread out the support of $\varphi_{\ell}$. By letting all other filters in a tuple be zero, we would conclude that the filter

$$ $\displaystyle\sum_{\ell\in[d]}\chi_{k\ell}(g)*(\rho^{\mathrm{rot}}(g)\varphi_{ \ell})$ $$

has a support which is not contained in the asymmetric $\Omega_{0}$. Together with equation 8, this means that $\rho(g)\langle\varphi\rangle\notin\mathcal{L}^{\mathrm{as}}$, which would be a contradiction. Hence, all $\langle\chi_{g}\rangle$ must be multiples of the identity for all $g$, which means that

$$ $\displaystyle[\rho_{1}(g)v]_{k}=\sum_{\ell\in[d]}c_{k\ell}(g)\rho^{\mathrm{rot }}(g)x_{\ell}$ $$

for some numbers $c_{k\ell}(g)$. It is now only left to show that the $c_{k\ell}$ define a representation. We however have for $g,h\in C_{4}$ arbitrary

$$ $\displaystyle[\rho_{1}(gh)x]_{k}$ $\displaystyle=\sum_{\ell\in[d]}c_{k\ell}(gh)\rho^{\mathrm{rot}}(gh)x_{\ell}$ $\displaystyle[\rho_{1}(g)\rho_{1}(h)x]_{k}$ $\displaystyle=\sum_{\ell\in[d]}c_{k\ell}(g)\rho^{\mathrm{rot}}(g)(\rho_{1}(g)x )_{\ell}=\sum_{\ell,m\in[d]}c_{km}(g)\rho^{\mathrm{rot}}(g)c_{m\ell}(h)\rho^{ \mathrm{rot}}(h)x_{\ell}$ $$

Since $\rho_{1}$ and $\rho^{\mathrm{rot}}$ are representations, the above expressions are equal for every $x$ and $g$, which means that

$$ $\displaystyle\forall k,\ell\in[d]:\quad c_{k\ell}(gh)=\sum_{m\in[d]}c_{km}(g)c _{m\ell}(h)$ $$

This is however only another way of saying that the matrices $C(g)=(c_{k\ell}(g))_{k,\ell}$ fulfill $C(gh)=C(g)C(h)$, which is what was to be shown.
∎

###### Theorem C.1 .

###### Proof.

## Appendix D Experiment details

### D.1 Hardware

We trained our ensemble models on a cluster using NVIDIA Tesla T4 GPUs with 16GB RAM per unit. The total compute time for training all 3000 individual models for $10$ epochs each is estimated at $\sim 115$ hours.

### D.2 Architecture

The architecture used for all three networks is the same with the exception of the support of the $3\times 3$ filters. Namely, in the first layer we use a convolution with zero padding, with $1$ channel in and $16$ out, followed by an average pooling with a $2\times 2$ window with a stride of $2$, followed by a $\tanh$ activation, followed by a layer normalization. The second layer is the same except the convolution has $16$ channels in instead of $1$. The third layer is the same as the second, but without the average pooling. The final layer flattens the image channels into a vector, followed by a linear transformation into $\mathbb{R}^{10}$.

All of the nonlinearities involved here are equivariant to rotations, and so do not interfere with the equivariance/invariance of the network.

A prediction of the network is then the $\mathrm{argmax}$ of the output, which yields the predicted label as a one-hot vector.

### D.3 Smaller ensemble sizes

In Figures 5 and 6 we show the results from our experiments for ensemble sizes of $10$ and $100$, respectively. To create the smaller ensembles we randomly selected $10$ and $100$, respectively, of our $1000$ models.

We can see from Figure 5 that for ensembles of size $10$, the performance suffers quite a lot, especially on OOD data. Hence, the invariance of the ensembles only emerges when they are large. There is also much less of a difference between the different models. From Figure 6 we can see that performance is still quite good for in-distribution data for ensembles of size $100$. There is also less of a difference between the models.

Figure: Figure 5: Top: OSP for ensembles with $10$ members. (Higher is better) The middle $95\%$ of individual ensemble members are within the shaded area. Bottom: Logarithm of symmetric Kullback–Leibler Divergence for ensembles with $10$ members. (Lower is better). Best viewed in color.
Refer to caption: x2.png

Figure: Figure 6: Top: OSP for ensembles with $100$ members. (Higher is better) The middle $95\%$ of individual ensemble members are within the shaded area. Bottom: Logarithm of symmetric Kullback–Leibler Divergence for ensembles with $100$ members. (Lower is better). Best viewed in color.
Refer to caption: x3.png

## Appendix E Experiment with larger filters

We perform the same experiment as in Section 5 with convolution filters of size $5\times 5$. The reason for performing this experiment is to test whether the ’small’ error in the approximation $\rho(g)\Pi_{\mathcal{L}}A\approx\Pi_{\mathcal{L}}\rho(g)A$ in the case of $3\times 3$-filters is responsible for the small difference in performance between symmetric and asymmetric models. In a larger filter we can have more energy in the asymmetric parts of the filter, so we want to see if this affects the results. We consider therefore two CNNs with filters as in Figure 7.

Figure: Figure 7: Left: symmetric filter. Right: asymmetric filter. Grey indices correspond to indices where the filter is supported.

As before, we train under augmentation by multiples $\pi/2$ radian rotations of our input images, and to keep the dimensions of input and output the same, we have to modify the convolution to have 2 rows of zero padding. The asymmetric filters are initialized with a $G$-invariant distribution by setting the four indices in the top left corner to 0, in addition to initializing with a standard normal distribution.

The results from this experiment can be seen in Figure 8 and Figure 9, where we show the results of the experiment in Section 5 and the experiment in this section side-by-side. We also give the metrics after epoch $10$ in Table 3

We can see that the difference in performance, with regards to the metrics of OSP and divergence, between the symmetric and asymmetric models is larger in the case of the $5\times 5$–filters, which is what one would predict if the reason for the size of the discrepancy between symmetric and asymmetric models is the size of the error when approximating $\rho(g)\Pi_{\mathcal{L}}A\approx\Pi_{\mathcal{L}}\rho(g)A$.

Figure: Figure 8: Top: OSP on MNIST test data for ensembles with $1000$ members (higher is better). The middle $95\%$ of individual ensemble members are within the shaded area. Bottom: OSP on CIFAR–10 test data for ensembles with $1000$ members (higher is better). The middle $95\%$ of individual ensemble members are within the shaded area. Best viewed in color.
Refer to caption: x4.png

Figure: Figure 9: Top: Kullback–Leibler divergence on MNIST test data for ensembles with $1000$ members (lower is better). Bottom: Kullback–Leibler divergence on CIFAR–10 test data for ensembles with $1000$ members (lower is better). Best viewed in color.
Refer to caption: x5.png

**Table 3: Metrics after the $10$^th epoch of training for ensembles with $1000$ members using $5\times 5$-filters. Standard deviations are over test data.**
|  | MNIST | CIFAR–10 |  |  |
| --- | --- | --- | --- | --- |
| Model | OSP | $\log_{10}(\mathrm{KL-DIV})$ | OSP | $\log_{10}(\mathrm{KL-DIV})$ |
| $\mathcal{L}^{\mathrm{sym}}$ | $\mathbf{3.97}$ | $\mathbf{-2.35}$ | $\mathbf{3.90}$ | $\mathbf{-1.50}$ |
| $\mathcal{L}^{\mathrm{as}}$, $\rho(g)A\sim A$ | $3.94$ | $-1.54$ | $3.76$ | $-0.54$ |

## Peer Reviews

confidence: 4
contribution: 2
initial_rating: 3
presentation: 3
questions: Please see the weaknesses.
soundness: 3
strengths: - The work show the emergence of equivariant in ensemble models
- The work generalizes previous works where the proof relied on NTKs
- Experiments with large ensemble of models show the emergence of equivariance
summary: This paper shows that an ensemble of models when trained with data augmentation leads to emergence of equivariance properties naturally. The results generalize over past known results based on NTKs. The theory assumes some basic assumptions on the architecture and shows that, when the initialization of the weights in an architecture has some symmetry, then, the expected architecture of the ensemble is equivariant. Experimental results with various ensembles validates the results for the C4 group of symmetries.
weaknesses: I have several concerns over the usefulness of the theory and the experimental results.

Usefulness of theory:
- What is the use of the theory in model design or practical use cases? Since equivariant models seems to give perfect equivariance and data augmentation techniques give approximate equivariance. So, I am wondering what is the use of ensemble technique for symmetries, especially, given that we need over 1000 models to get good equivariant results.
- What are the advantages of the proposed technique compared to existing symmetrization and canonicalization methods [1-4] that can convert non-equivariant models into equivariant ones using techniques somewhat similar to ensemble methods but with additional transformations that looks similar to augmentation.

Experimental Results:
- Although the experimental does show that the architecture with symmetric support does give invariant output, but even the asymmetric architecture seems to be giving invariant output, questioning the usefulness of the theory. It is also discussed in the paper about the symmetric states being attractors potentially, but, it still makes the current theory not very useful.
- Experiments are only shown for C4 symmetries

[1] Basu, Sourya, et al. "Equi-tuning: Group equivariant fine-tuning of pretrained models." Proceedings of the AAAI Conference on Artificial Intelligence. Vol. 37. No. 6. 2023.

[2] Mondal, Arnab Kumar, et al. "Equivariant adaptation of large pretrained models." Advances in Neural Information Processing Systems 36 (2023): 50293-50309.

[3] Basu, Sourya, et al. "Efficient equivariant transfer learning from pretrained models." Advances in Neural Information Processing Systems 36 (2024).

[4] Kaba, Sékou-Oumar, et al. "Equivariance with learned canonicalization functions." International Conference on Machine Learning. PMLR, 2023.

---

confidence: 3
contribution: 2
initial_rating: 6
presentation: 2
questions: The results in Table 1 aren't that clear to me. In the asymmetric case where you have a symmetric initialization, shouldn't you get results that are similar to the symmetric case? Yet there is a large gap
soundness: 3
strengths: - It generalizes the results in Gerken & Kessel 
- The topic of invariance/equivariance is important so these results would be of interest to people in that community
summary: The paper expands the results of Gerken & Kessel that show that data augmentation produces equivariant ensembles of models using NTK, by looking at finite network sizes. They then show empirically that their theoretical results indeed hold in practice (up to sampling errors).
weaknesses: My main issue is with the writing: 
- The results presented in the main text are quite trivial, that if you start with an invariant distribution and use an invariant flow you end up with an invariant distribution. The more interesting results are in the appendix (appendix B and C)
- You writing $\mathcal{L} = A_\mathcal{L} + T\mathcal{L}$ with $T\mathcal{L}$ the tangent space is very confusing, as tangent space is defined for a manifold and we are talking about a linear space. It needlessly complicates things as there is no need to involve differential geometry when we are working on linear spaces.

---

confidence: 3
contribution: 3
initial_rating: 6
presentation: 3
questions: 1. Why does the OSP not increase at initialization when ensemble size increases?
1. From the figures, it seems like the results could improve with more epochs (also for baselines). Could you please provide results with a larger number of epochs?
soundness: 3
strengths: 1. The paper is well-structured and easy to follow.
1. The paper extends previous results to more reasonable and applicable settings. This is a significant extension.
summary: The paper presents a theoretical analysis showing that data augmentation can lead to equivariance in deep ensembles. The paper's main result is that under several assumptions (e.g. on initialization, architecture, etc.), deep ensembles trained with data augmentation are equivariant in mean, even when individual models are generally not. A similar result was previously presented, but the paper extends these previous results, which were primarily focused on infinitely wide NNs trained with gradient descent under full augmentation, to ensembles of finite-width trained with SGD and random augmentation.
The paper is mainly theoretical and validates the theoretical results through limited and small-scale empirical experiments.
weaknesses: I like the paper and believe it has a sufficient contribution and interesting results. However, there are several limitations stated below:

1. While the assumptions for the theoretical analysis are more applicable compared to previous works, they still hold only for infinite-size ensembles. Any analysis (including empirical) on the error bounds for finite ensembles would be beneficial.
1. While the results are important, the novelty is somewhat moderate in the sense that the emergent equivariance property of ensembles was previously proposed and the fact that the theoretical analysis heavily relies on previous works [1].
1. From the empirical evidence, it is unclear if some of the assumptions (like symmetric initialization) are indeed necessary. The authors discuss this, but I believe it can be extended further.
1. Empirical evaluation is limited. It would be beneficial to extend it to more settings, even by small modifications like considering cyclic groups C_k of different orders (k), different architectures, model sizes, etc.
1. It would be beneficial to see the impact of ensemble size on the metrics in Table 1, like adding a line plot for ensemble size vs. OSP. The authors show results for different sizes, but summarizing them in one clear view would make it easier to follow.
1. The paper could benefit from a clearer and more explicit discussion of the limitations of the results.
1. Minor:
    - Line 37: “... a definitive question to the question…”.

Reference

[1] Flinth & Ohlsson, Optimization Dynamics of Equivariant and Augmented Neural Networks, 2023.

Meta-review: This paper studies how equivariance emerges in ensembles of neural networks trained with data augmentation. The authors extend prior theoretical results by showing that equivariance holds under weaker conditions that exist in prior work (e.g. without requiring the NTK limit).
The reviewers appreciated the clear writing and sound theoretical development. However, several concerns were raised about both the theory and experiments: The theoretical contribution it appears to be minor, and the empirical validation was quite limited in scope. The was also some apparent disconnect between the theory predictions and experimental results, which brought into question the relevance of the theory.
The authors engaged constructively with reviewers in the rebuttals. 
However, the concerns remain significant enough to prevent me from recommending acceptance.

Decision: Reject