Title: The Implicit Bias of Heterogeneity towards Invariance: A Study of Multi-Environment Matrix Sensing
Venue: NeurIPS 2024
Accepted: yes
Keywords: implicit bias

matrix sensing

invariance learning

non-convex optimization
Abstract: Models are expected to engage in invariance learning, which involves distinguishing the core relations that remain consistent across varying environments to ensure the predictions are safe, robust and fair. While existing works consider specific algorithms to realize invariance learning, we show that model has the potential to learn invariance through standard training procedures. In other words, this paper studies the implicit bias of Stochastic Gradient Descent (SGD) over heterogeneous data and shows that the implicit bias drives the model learning towards an invariant solution. We call the phenomenon the implicit invariance learning. Specifically, we theoretically investigate the multi-environment low-rank matrix sensing problem where in each environment, the signal comprises (i) a lower-rank invariant part shared across all environments; and (ii) a significantly varying environment-dependent spurious component. The key insight is, through simply employing the large step size large-batch SGD sequentially in each environment without any explicit regularization, the oscillation caused by heterogeneity can provably prevent model learning spurious signals.  The model reaches the invariant solution after certain iterations. In contrast, model learned using pooled SGD over all data would simultaneously learn both the invariant and spurious signals. Overall, we unveil another implicit bias that is a result of the symbiosis between the heterogeneity of data and modern algorithms, which is, to the best of our knowledge, first in the literature.

The Implicit Bias of Heterogeneity towards Invariance: A Study of Multi-Environment Matrix Sensing

Abstract

Models are expected to engage in invariance learning, which involves distinguishing the core relations that remain consistent across varying environments to ensure the predictions are safe, robust and fair. While existing works consider specific algorithms to realize invariance learning, we show that model has the potential to learn invariance through standard training procedures. In other words, this paper studies the implicit bias of Stochastic Gradient Descent (SGD) over heterogeneous data and shows that the implicit bias drives the model learning towards an invariant solution. We call the phenomenon the implicit invariance learning . Specifically, we theoretically investigate the multi-environment low-rank matrix sensing problem where in each environment, the signal comprises (i) a lower-rank invariant part shared across all environments; and (ii) a significantly varying environmentdependent spurious component. The key insight is, through simply employing the large step size large-batch SGD sequentially in each environment without any explicit regularization, the oscillation caused by heterogeneity can provably prevent model learning spurious signals. The model reaches the invariant solution after certain iterations. In contrast, model learned using pooled SGD over all data would simultaneously learn both the invariant and spurious signals. Overall, we unveil another implicit bias that is a result of the symbiosis between the heterogeneity of data and modern algorithms, which is, to the best of our knowledge, first in the literature.

1 Introduction

In real applications, the machine learning models are often heavily over-parameterized, which means that the number of parameters exceeds the number of data. For over-parameterized models,

Algorithm 1 PooledSGD

Parameter: θ

for

t

= 1

, . . .

do

Batch B from entire dataset

end for

Algorithm 2 HeteroSGD

Parameter: θ

for

t

= 1

, . . .

do

Batch B from environment e t ∼ D

end for

Iters

Value

Core Signal

Spurious Signal

Iters

Value

Core Signal

Spurious Signal

the generalization in the general case becomes ill-posed. One key insight to generalize well is the implicit preference of the optimization algorithm which plays the role of regularization/bias [45, 22]. Nowadays, there are several kinds of implicit bias discovered from optimization algorithms under different models and settings. One common feature of the bias is the simplicity which concludes that (stochastic) gradient-based algorithms perform the incremental learning with the model complexity gradually increasing. Therefore, benign generalization is possible even when the number of training data is limited. For example, Li et al. [31], Gunasekar et al. [18] show that unregularized gradient descent can find the low-rank solution efficiently for matrix sensing models. Kalimeris et al. [27], Gissin et al. [16], Jiang et al. [24], and Jin et al. [25] further show that (Stochastic) Gradient Descent ((S)GD) learn models from simple ones to complex ones. Most of the existing works study the implicit bias of algorithms over a single distributional environment data.

However, data in modern practice are often collected from multiple sources, thus exhibiting certain heterogeneity. For example, medical data may come from multiple hospitals, and training sets for large language models consist of numerous corpus from the Internet [1]. So what is the impact of implicit bias for standard training algorithms over heterogeneous data?

This paper initializes the study and shows that implicit bias of SGD on an over-parameterized model using multi-environment heterogeneous data and shows that the implicit bias can not only save the number of training data but also, more importantly, drive the model learning the invariant relation across diverse environments.

Learning the invariant relation that remains consistent across varying environments [43] has garnered significant attention in recent years. Though the association-based standard machine learning pipelines can achieve a good performance with identical data distributions, a higher requirement is to make predictions robustly generalize over diverse downstream environments. Learning invariance produces reliable, fair, robust predictions against strong structural mechanism perturbation. More importantly, it opens the door to pursue causality blind to any prior knowledge and can unveil direct causes when the heterogeneity among environments is sufficient [17, 43]. While existing works consider specific algorithms to realize invariance learning, this work shows that implicit bias of algorithms over heterogeneous data has the potential to automatically learn the invaraince. We call the phenomenon the implicit invariance learning , partially explains why active invariance learning may not be necessary in practice [42]. Our key insight is:

The heterogeneity of the data, and the large step size adopted in the optimization algorithm jointly provide strong multiplicative oscillations in the spurious signal space, which prevents the model from moving in the direction of unstable and spurious solutions, thus resulting in an implicit bias to the invariant solution.

Weillustrate it rigorously through a simple, canonical but insightful model - multi-environment matrix sensing, where in each environment the signal consists of two parts: an invariant low-rank matrix A ⋆ ∈ R d × d and an environment-varying spurious low-rank matrix A ( e ) ∈ R d × d where environment e ∈ E , the set of environments. For each environment e ∈ E , the joint distribution of ( X ( e ) , y ( e ) ) satisfies y ( e ) = ⟨ X ( e ) , A ⋆ ⟩ + ⟨ X ( e ) , A ( e ) ⟩ with matrix inner product ⟨ A , B ⟩ = Trace( B ⊤ A ) . Here X ( e ) ∈ R d × d is a random linear measurement and y ( e ) ∈ R is the response. We consider the case that association does not coincide invariance (or causality), where averaging over all the environments, the best prediction of y given X is

̸

In this case, it is not surprising that given enough data, the standard empirical risk minimizer algorithm, for example, running SGD on pooled data, will return a solution that converges to f ⋆ , which diverges from the invariant solution. In this paper, we will show that surprisingly, if each batch is sampled from data in one environment rather than data in all the environments, the heterogeneity in the environments together with the implicit regularization effects in the SGD algorithm can drive it towards the invariant solution. This can be stated informally as follows.

Theorem 1 (Main result, informal) . Under a sufficient heterogeneity condition and some regularity conditions in matrix sensing, if we adopt an over-parameterized model and runs stochastic gradient descent where batches are sampled from one environment, i.e., HeteroSGD (Algorithm 3), then

Instead, the standard approach, i.e., PooledSGD , will return solution ˆ θ PooledSGD satisfying

An illustration of our result is shown in Figure 1. Our result demonstrates that implicit bias of commonly used algorithms over heterogeneous data has the potential to drive the model to learn the invariant relation. Such a result thereby provides an explanation for why models may attain some robust and even causal prediction after SGD training.

We emphasize that the previous implicit bias studies are restricted to the same data distribution generalization, under which the population-level minimizer f ⋆ minimizing the loss with infinite data is the target in pursuit. However, both the population-level minimizer and those 'good' solutions under previous studies diverge from an invariant solution in general and are no longer benign in this context, this is termed as 'curse of endogeneity' [12, 13].

Notations. We use the conventional notations O ( · ) , o ( · ) , Ω( · ) to ignore the absolute constants, ˜ O ( · ) , ˜ o ( · ) , ˜ Ω( · ) to further ignore the polynomial logarithmic factors. Similarly, a ≲ b means that there exists an absolute constant C > 0 such that a ≲ Cb . We also denote it as a ≪ b , b ≫ a if a = o ( b ) . Unless otherwise specified, we use lowercase bold letters such as v to represent vectors, and use ∥ v ∥ to denote its Euclidean norm. We use uppercase bold letters such as X to represent matrices and use ∥ X ∥ , ∥ X ∥ F , ∥ X ∥ ∗ to denote its operator norm, Frobenius norm and nuclear norm, respectively. We use κ ( X ) to denote the condition number, which is σ max ( X ) /σ min ( X ) . We define Z = o P (1) if the random variable Z satisfies Z P → 0 .

2 Related Works

Implicit Regularization. It is believed that implicit bias is a key factor in why over-parameterized models can generalize well. Through the analysis of certain settings, existing results suggest that GD/SGD prefers solutions with specific properties [45, 19, 41, 38, 23], or specific local landscapes [3, 9, 32, 38]. For the matrix sensing problem, several works [18, 31, 27, 16, 46, 52, 24, 25] analyze

the (S)GD dynamics to show how (S)GD recovers the ground truth low-rank matrix. Recently, the effects of large step size have aroused much attention, particularly the edge-of-stability phenomenon [8]. Lu et al. [37] investigates the phenomenon 'benign oscillation', which suggests that SGD with a large learning rate can effectively help neural networks learn weak features thereby benefiting generalization. Several works [20, 48, 11] show that label noise with large step size has a sparcifying effect for sparse linear regression. This paper instead studies multi-environment scenarios and fills in the understanding of the impact of randomness on matrix sensing problems.

Federated Learning. Federated learning [39, 26] is a machine learning paradigm where data is stored separately and locally on multiple clients and not exchanged, and clients collaboratively train a model. Extensive work has focused on designing effective decentralized algorithms (e.g. [39, 29]) while preserving privacy (e.g. [10, 7]). The importance of fairness in federated learning has also garnered attention [30, 33]. One important issue in federated learning is to handle the heterogeneity across the data and hardware. Our work shows that by training with certain stochastic gradient descent methods, the system can automatically remove the bias from the individual environment and thus learn the invariant features. Our work provides insights into discovering the implicit regularization effects of standard decentralized algorithms.

Invariance Learning. This research line initiates from causal inference literature [43, 40, 15] since invariant covariates correspond to direct cause . From theoretic aspects, Fan et al. [13] proposes the EILLS method that provably achieves invariant variable selections under mild conditions for linear models. Invariance learning has raised much attention in machine learning since Arjovsky et al. [2] proposes the structural-agnostic framework IRM. Subsequent works analyze its limitations [44, 28] or propose variant methods [50, 36, 34, 35, 21, 51] as regularization and reweighting. About the failure of classical methods, Wald et al. [49] construct a hard problem and show that interpolation-based methods fail to learn invariance.

To the best of our knowledge, all the existing works consider specific algorithms to realize invariance learning or constructing hard cases that classical methods fail. In contrast, this paper studies commonly used training algorithms and aims to understand how the algorithms can go beyond learning associations to achieve invariance learning in certain scenarios.

3 Main Results

3.1 Problem Formulation

Data Generating Process. Suppose we observe data from a set of environments E sequentially. Let D be some distribution on E . At each time t = 0 , 1 , . . . , we receive m samples { ( X ( e t ) i , y ( e t ) i ) } i m =1 ⊂ R d × d × R from environment e t ∼ D satisfying

where A ⋆ is an unknown rank r 1 d × d symmetric and positive definite matrix that represents the true signal invariant across different environments, A ( e t ) is an unknown d × d symmetric matrix with rank at most r 2 that represents the spurious signal that may vary. Here ⟨ A , B ⟩ = trace( B ⊤ A ) . We aim to estimate the A ⋆ using data from heterogeneous environments.

Algorithm. We consider running batch gradient descent on an over-parametrization of the model, where at each step t one gradient update is performed using the data from environment e t . To be specific, we parameterize our fitted model as y = ⟨ A , UU ⊤ ⟩ with a d × d matrix U for the sake of simplicity. One can generally use the parameterization X = UU ⊤ -VV ⊤ by the same technique of HaoChen et al. [20], Fan et al. [14]. We initialize U as U 0 = α I d for some small enough α > 0 . At timestep t , we run a one-step gradient descent on the standard least squares loss using { ( X ( e t ) i , y ( e t ) i ) } i m =1 :

That is, U 0 = α I d and

Algorithm 3 HeteroSGD

Set U 0 = α I d , where α is a small positive constant to be determined later. Set large step size η = Θ(1) .

for t = 0 , . . . , T -1 . See a complete presentation in Algorithm 3.

The algorithm adopts a constant level step size η and log( α -1 ) level number of iterations T , i.e. η = Θ(1) and T = Θ(log( α -1 )) , and use U T U ⊤ T as our estimate of A ⋆ .

Standard Method: Pooled Stochastic Gradient Descent. As a comparison, we consider the standard approach where data in each batch come from different environments and the weights follow from D . To be specific, the pooled stochastic gradient descent over all environments adopted the update rule

3.2 Assumptions

We first impose some standard assumptions used in matrix sensing. Since we are dealing with learning true invariant signals from heterogeneous environments, several conditions on the structure of the invariant signal A ⋆ and the spurious signals A ( e ) should be imposed.

Assumption 1 (Invariant and Spurious Space) . There exists U ⋆ ∈ R d × r 1 and V ⋆ ∈ R d × r 2 both with orthogonal columns, i.e., ( U ⋆ ) ⊤ U ⋆ = I r 1 and ( V ⋆ ) ⊤ V ⋆ = I r 2 such that

In Condition (b), we assume that the singular values of the true signal A ⋆ are the same to simplify the presentation since our main focus is to reduce the spurious signals. It holds for the basic case when there is only one invariant signal, i.e. r 1 = 1 . The analysis for varying singular values using the technique of Li et al. [31] is deferred to Section D in Appendix. Other assumptions are usual and easy to achieve. Condition (a) requires that the total dimension of invariant signals and spurious signals are small relative to the ambient dimension d . Condition (c) resembles the RIP condition [6] in sparse feature selection [5]. Condition (d) says the overlap of invariant subspace and spurious subspace should be small. Such a condition can be easily satisfied for random projections in high dimensions where r 1 + r 2 ≪ d , under which we have ϵ 1 = Θ( √ ( r 1 + r 2 ) /d ) , see Proposition 1 below.

Proposition 1. Let M 1 ∈ R d × r 1 and M 2 ∈ R d × r 2 be two mutually independent random matrix with i.i.d. N (0 , 1) entries. Denote their QR decompositions as M 1 = U ⋆ 1 R 1 and M 2 = U ⋆ 2 R 2 , respectively. Then there exists a universal constant C 1 > 0 such that

with probability at least 1 -4 exp ( -C -1 1 d ) -2 exp ( -C -1 1 ( r 1 + r 2 ) t 2 ) .

Assumption 2 (Regularity on Spurious Signal Σ ( e ) ) . There exists some constant-level quantity M 1 , M 2 such that

where M 1 < C 0 M 2 for some universal constant C 0 > 0 . Moreover, Σ ( e ) is strongly diagonal dominant for any e ∈ E , i.e.,

̸

where c o > 0 is some universal constant.

The first inequality in (6) requires that all the spurious signals have a uniform bound, under which a fixed step size can be adopted. The second inequality in (6) requires that the heterogeneity of the spurious signals be large compared to the bias of the spurious signals. For example, some variables receive different interventions in different environments. The condition (7) is imposed to prevent the explosion of spurious signals during training. When the diagonal and off-diagonal elements are of the same order, empirical studies and theoretical analyses in some toy examples illustrate the failure of recovering A ⋆ . Condition (d) in Assumption 1 and (6) resemble the RIP condition in sparse feature selection. Example 1 can fulfill all our conditions.

Finally, we impose assumptions on measurements. Recall the RIP condition [6]:

Definition 1 (RIP for Matrices [6]) . A set of linear measurements X 1 , . . . , X m satisfy the restricted isometry property (RIP) with parameter ( s, δ ) if the following inequality

holds for any d × d matrix M with rank at most s .

Assumption 3 (RIP Condition for Linear Measurements) . X ( e t ) 1 , . . . , X ( e t ) m satisfies the RIP with parameter s = 4( r 1 + r 2 ) and δ ≲ 1 ( M 2 log( d )) 1 . 5 r 2 . 5 2 √ r 1 + r 2 for all e ∈ E .

It is known from Candès and Plan [6] that for symmetric Gaussian measurements, sample complexity m = ˜ Ω( dsδ -2 , M 2 ) = d poly( r, log( d )) ≪ d 2 suffices.

3.3 Convergence Analysis

The main conceptual challenge in the problem is that any U with UU ⊤ = A ⋆ is no longer a local minimum since E e ∼ D [ Σ ( e ) ] is non-zero and could even be comparable to A ⋆ . This further implies that running stochastic gradient descent on pooled data will fail to recover A ⋆ . However, our main result below shows that simply adopting online gradient descent with 'heterogeneous batches' can successfully recover the true, invariant signal from heterogeneous environments.

Theorem 2 (Main Theorem) . Under Assumption 1-3, suppose further that ϵ 1 < δ/ 2 . Define δ ⋆ := ( c v M 2 log( d )) 1 . 5 δr 2 2 √ r 1 + r 2 for some absolute constant c v . If we choose η ∈ (24 M -1 2 , 1 64 M -1 1 ) and α ∈ (1 /d 4 , 1 /d 2 ) , then running Algorithm 3 in T = Θ(log( α -1 ) /η ) steps, the algorithm outputs U T that satisfies

for some absolute constant C , with probability over 0 . 99 .

Consider the case where r 1 , r 2 , M 1 are sufficiently large but is regarded at constant level, and the batch size m , ambient dimension d satisfy d log 2 ( d ) ≪ m . It follows from the RIP result [6] with δ = Θ( √ d/m ) and Theorem 2 that one can adopt α = Θ( d -1 ) , η = Θ(1) , and early stop T = Θ(log d ) such that

provided ϵ 1 ≤ C -1 1 √ d/m with some large enough constant C 1 > 0 . In this case, it follows from (10) that one can distinguish the true invariant signals from those spurious heterogeneous ones since

The underlying reason why the online gradient descent can recover A ⋆ is that the heterogeneity of A ( e ) and the randomness in the SGD algorithm jointly prevent it from moving in the direction of spurious signals. At the same time, the standard RIP conditions and the almost orthogonality between U ⋆ and V ⋆ in Condition 1 ensure a steady movement towards the invariant signals.

Conversely, running pooled stochastic gradient descent using all data will result in a biased solution:

Theorem 3 (Negative Result for Pooled SGD) . Under the assumptions of Theorem 2 and some mild conditions, for the certain case where U ⋆ ⊥ V ⋆ and E e ∈ D Σ ( e ) = I r 2 , if we perform SGD over all samples with batch size m = Ω( d poly( r 1 + r 2 , M 1 M 2 , log( d ))) and ends with T = Θ(log d ) , then U t keeps approaching U ⋆ U ⋆ ⊤ + V ⋆ V ⋆ ⊤ , in the sense that

during which for all t = 0 , 1 , . . . , T :

The convergence (12) is similar to (9) in derivation. To see this, since each update uses batch from the whole data, the update in effect degenerates to the case for one environment with no heterogeneity. Now the one-environment invariant solution A ⋆ in (9) is exactly equal to U ⋆ U ⋆ ⊤ + V ⋆ V ⋆ ⊤ in (12). One can also show that for sufficiently large t , U t U ⊤ t is sufficiently away from A ⋆ , indicating that the biased estimation is not attributed to early stopping.

Our framework can be applied to learning the invariant features for a two-layer neural network with quadratic activation functions, by recognizing the fact that [31]:

where q ( · ) is the element-wise quadratic function. The following example shows that Theorem 7 implies success of invariant feature learning for 2-layer NN when the ground truth invariant and variant features are independent random vectors sampled from normal distribution.

Example 1 (Two-Layer NN with Quadratic Activation) . Let a 1 , · · · , a r ∈ R d be random vectors sampled from normal distribution N (0 , 1 d I d ) . For environment e ∈ E , suppose the target function is determined by r 1 invariant features and r 2 variant admits that for each sample ( x ( e ) i , y ( e ) i ) :

which is equivalent to matrix sensing problem with

And our goal is to train a two-layer NN to capture the invariant features ( a 1 , . . . , a r 1 ) . In this example, the invariant component and the spurious component have a more intuitive characterization: they are two disjoint groups of neurons. Moreover, it can be shown that the invariant and variant features are nearly orthogonal (Proposition 1). Then if { a ( e ) j } j,e satisfies sup e,j {| a ( e ) j |}· max j { 1+ | E e a ( e ) j |} min j { Var e [ a ( e ) j ] } < c 0 for some absolute constant c 0 , the variant version of Algorithm 3 returns a solution that only significantly selects invariant features with probability over 0 . 99 . See Section C and Theorem 7 for details.

4 Proof Sketch

We define the invariant part R t ∈ R d × r 1 , spurious part Q t ∈ R d × r 2 in U t as

and let the residual be the error part, that is,

It is worth noticing that Id U ⋆ = U ⋆ U ⋆ ⊤ and Id V ⋆ = V ⋆ V ⋆ ⊤ are both orthogonal projections, and Id res := I -Id U ⋆ -Id V ⋆ is not.

It follows from the model (1) and the gradient update that

We use operator E e t ◦ ( M ) ∈ R d × d to denote the RIP error of the batch at time step t for some d × d matrix M , i.e.,

We also write E t ◦ ( M ) := E e t ◦ ( M ) when there is no ambiguity, and we simply denote matrix E t = E t ◦ ( U t U ⊤ t -U ⋆ U ⋆ ⊤ -V ⋆ Σ t V ⋆ ⊤ ) with Σ t := Σ ( e t ) . Then the gradient update of U t can be written as

Combining our definition (17) with (21), we obtain

For the error part, combining (18) with (21) yields

For the invariant part R t , though different singular values of R t will grow at different speeds because of the randomness from RIP error and e t , we claim that all the singular values of R t are close to R t during the training process, where the scalar sequence R t is defined recursively as

The dynamics of Q t are very complicated because of the randomness of e t and the RIP error. Such a dynamic will also impact that of R t and E t through the complicated dependencies between these three parts, which will also make it difficult to utilize probability inequalities applicable under independence. Instead, we claim that such a 'fluctuation dynamics' of Q t can be controlled as

0

25

50

75

100

Iters

Stable Signal

Oscillating Signal

0

25

50

75

100

Iters

Stable Signal

Oscillating Signal

We now offer an informal illustration for how oscillations 'shrink' spurious signal. We simply omit error terms. When matrix Σ ( t +1) is diagonal, from (23), the i -th column q t of Q t should satisfies: ∥ q t +1 ∥ ≤ (1 + η Σ ( t +1) ii ) ∥ q t ∥ . Let ξ def = Σ ( t +1) ii and assume M ≥ | ξ | a.s.. Introduce a concave function [20] ϕ ( x ) = x γ , γ ∈ (0 , 1) . When ηM < 1 16 , do second-order Taylor's expansion at ϕ (1) in ( a ) below:

where E [ · ] is w.r.t. ξ . So spurious signal keeps small when 1 16 M > η > 4 E [ ξ ] (1 -γ ) Var[ ξ ] . See the figure for illustration in Figure 2. While E [ ∥ q t ∥ ] (shown in the left figure) increases since the signals have positive expectations, E [ ∥ q t ∥ 0 . 1 ] (shown in the right figure) decreases. Note that the above intuition is informal and the formal argument is deferred in Lemma 6 and Lemma 7 in Appendix.

The entire training process can be divided into two phases. In Phase 1, the invariant signals R t increase rapidly while the spurious signals Q t fluctuate but remain at a low level. Phase 1 ends in O ( 1 η log( 1 α )) steps when R t attains Θ(1) -order (see Theorem 4). In Phase 2, the magnitudes of Q t and E t stay low, while all the singular values of R t approach 1 (See Theorem 5). We defer the details to Appendix.

5 Simulations

In this section, we present our simulations. We design three sets of experiments. In the first set of experiments, we show with the growth of environment heterogeneity, invariance learning is achievable. For the second set of experiments, we show that given heterogeneous data, invariance learning is achievable with the growth of step size 3 . For the third set of experiments, we compare HeteroSGD (Algorithm 3) and Pooled SGD. In Section B.2 we also perform simulations for Pooled SGD with small batch size.

In below two sets of experiments, we set the scale of initialization α = 10 -3 , problem dimension d = 100 , r 1 = 1 and r 2 = 1 . Let the true signal be A ⋆ = uu ⊤ . Denote the heterogeneity parameter by M . The environment is generated by A ( e ) = A ⋆ + s ( e ) vv ⊤ where s ( e ) ∼ Unif { 1 -M, 1 + M } , and the default of η is 0 . 05 . The number of linear measurements is set to be m = 8000 with elements following from i.i.d N (0 , 1) . For the third sets, we set ( r 1 , r 2 , d, E s ( e ) ) = (3 , 2 , 40 , 0 . 5) , m = 2800 for HeteroSGD and m = 5600 without replacement for Pooled SGD. The plots show signal recovery proportion, 1 . 0 indicates fully recovery.



































































M













M

=5.0



















=0.05



=0.05



=0.05



=0.01



=0.01



=0.01

        























0

25

50

75

100

125

150

175

Iters

0.0

0.2

0.4

0.6

0.8

1.0

Value

True Signal

Spurious

Error

0

25

50

75

100

125

150

175

Iters

0.0

0.2

0.4

0.6

0.8

1.0

Value

True Signal

Spurious

Error

6 Conclusions

This paper explains that implicit bias of heterogeneity leads the model learning towards invariance and causality. We show that under heterogeneous environments, online gradient descent with large step sizes can select out the invariant matrix in the over-parameterized matrix sensing models. We conjecture that both heterogeneity and stochasticity are indispensable. Over-parameterization may not be. We leave future studies to understand the necessity of the three factors.

References

Josh Achiam, Steven Adler, Sandhini Agarwal, Lama Ahmad, Ilge Akkaya, Florencia Leoni Aleman, Diogo Almeida, Janko Altenschmidt, Sam Altman, Shyamal Anadkat, et al. Gpt-4 technical report. arXiv preprint arXiv:2303.08774 , 2023.

Martin Arjovsky, Léon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization. arXiv preprint arXiv:1907.02893 , 2019.

Guy Blanc, Neha Gupta, Gregory Valiant, and Paul Valiant. Implicit regularization for deep neural networks driven by an ornstein-uhlenbeck like process. In Conference on Learning Theory , pages 483-513. PMLR, 2020.

Emmanuel J Candes. The restricted isometry property and its implications for compressed sensing. Comptes rendus. Mathematique , 346(9-10):589-592, 2008.

Emmanuel J Candes and Terence Tao. Decoding by linear programming. IEEE transactions on information theory , 51(12):4203-4215, 2005.

Emmanuel J. Candès and Yaniv Plan. Tight oracle inequalities for low-rank matrix recovery from a minimal number of noisy random measurements. IEEE Transactions on Information Theory , 57(4):2342-2359, 2011. doi: 10.1109/TIT.2011.2111771.

Wei-Ting Chang and Ravi Tandon. On the upload versus download cost for secure and private matrix multiplication. In 2019 IEEE Information Theory Workshop (ITW) , pages 1-5. IEEE, 2019.

Jeremy Cohen, Simran Kaur, Yuanzhi Li, J Zico Kolter, and Ameet Talwalkar. Gradient descent on neural networks typically occurs at the edge of stability. In International Conference on Learning Representations , 2020.

Alex Damian, Tengyu Ma, and Jason D Lee. Label noise SGD provably prefers flat global minimizers. Advances in Neural Information Processing Systems , 34, 2021.

Cynthia Dwork, Krishnaram Kenthapadi, Frank McSherry, Ilya Mironov, and Moni Naor. Our data, ourselves: Privacy via distributed noise generation. In Advances in CryptologyEUROCRYPT 2006: 24th Annual International Conference on the Theory and Applications of Cryptographic Techniques, St. Petersburg, Russia, May 28-June 1, 2006. Proceedings 25 , pages 486-503. Springer, 2006.

Mathieu Even, Scott Pesme, Suriya Gunasekar, and Nicolas Flammarion. (s) gd over diagonal linear networks: Implicit bias, large stepsizes and edge of stability. Advances in Neural Information Processing Systems , 36, 2024.

Jianqing Fan and Yuan Liao. Endogeneity in high dimensions. Annals of Statistics , 42(3):872, 2014.

Jianqing Fan, Cong Fang, Yihong Gu, and Tong Zhang. Environment invariant linear least squares. arXiv preprint arXiv:2303.03092 , 2023.

Jianqing Fan, Zhuoran Yang, and Mengxin Yu. Understanding implicit regularization in overparameterized single index model. Journal of the American Statistical Association , 118(544): 2315-2328, 2023.

AmirEmad Ghassami, Saber Salehkaleybar, Negar Kiyavash, and Kun Zhang. Learning causal structures using regression invariance. Advances in Neural Information Processing Systems , 30, 2017.

Daniel Gissin, Shai Shalev-Shwartz, and Amit Daniely. The implicit bias of depth: How incremental learning drives generalization. In International Conference on Learning Representations , 2019.

Yihong Gu, Cong Fang, Peter Bühlmann, and Jianqing Fan. Causality pursuit from heterogeneous environments via neural adversarial invariance learning. arXiv preprint arXiv:2405.04715 , 2024.

Suriya Gunasekar, Blake E Woodworth, Srinadh Bhojanapalli, Behnam Neyshabur, and Nati Srebro. Implicit regularization in matrix factorization. Advances in Neural Information Processing Systems , 30, 2017.

Suriya Gunasekar, Jason D Lee, Daniel Soudry, and Nati Srebro. Implicit bias of gradient descent on linear convolutional networks. Advances in Neural Information Processing Systems , 31, 2018.

Jeff Z HaoChen, Colin Wei, Jason Lee, and Tengyu Ma. Shape matters: Understanding the implicit bias of the noise covariance. In Conference on Learning Theory , pages 2315-2357. PMLR, 2021.

Badr Youbi Idrissi, Martin Arjovsky, Mohammad Pezeshki, and David Lopez-Paz. Simple data balancing achieves competitive worst-group-accuracy. In Conference on Causal Learning and Reasoning , pages 336-351. PMLR, 2022.

Ziwei Ji and Matus Telgarsky. Gradient descent aligns the layers of deep linear networks. In International Conference on Learning Representations , 2019.

Ziwei Ji and Matus Telgarsky. Directional convergence and alignment in deep learning. Advances in Neural Information Processing Systems , 33, 2020.

Liwei Jiang, Yudong Chen, and Lijun Ding. Algorithmic regularization in model-free overparametrized asymmetric matrix factorization. SIAM Journal on Mathematics of Data Science , 5(3):723-744, 2023.

Jikai Jin, Zhiyuan Li, Kaifeng Lyu, Simon Shaolei Du, and Jason D Lee. Understanding incremental learning of gradient descent: A fine-grained analysis of matrix sensing. In International Conference on Machine Learning , pages 15200-15238. PMLR, 2023.

Peter Kairouz, H Brendan McMahan, Brendan Avent, Aurélien Bellet, Mehdi Bennis, Arjun Nitin Bhagoji, Kallista Bonawitz, Zachary Charles, Graham Cormode, Rachel Cummings, et al. Advances and open problems in federated learning. Foundations and trends® in machine learning , 14(1-2):1-210, 2021.

Dimitris Kalimeris, Gal Kaplun, Preetum Nakkiran, Benjamin Edelman, Tristan Yang, Boaz Barak, and Haofeng Zhang. Sgd on neural networks learns functions of increasing complexity. Advances in Neural Information Processing Systems , 32, 2019.

Pritish Kamath, Akilesh Tangella, Danica Sutherland, and Nathan Srebro. Does invariant risk minimization capture invariance? In International Conference on Artificial Intelligence and Statistics , pages 4069-4077. PMLR, 2021.

Sai Praneeth Karimireddy, Satyen Kale, Mehryar Mohri, Sashank Reddi, Sebastian Stich, and Ananda Theertha Suresh. Scaffold: Stochastic controlled averaging for federated learning. In International Conference on Machine Learning , pages 5132-5143. PMLR, 2020.

Tian Li, Shengyuan Hu, Ahmad Beirami, and Virginia Smith. Ditto: Fair and robust federated learning through personalization. In International Conference on Machine Learning , pages 6357-6368. PMLR, 2021.

Yuanzhi Li, Tengyu Ma, and Hongyang Zhang. Algorithmic regularization in over-parameterized matrix sensing and neural networks with quadratic activations. In Conference on Learning Theory , pages 2-47. PMLR, 2018.

Zhiyuan Li, Tianhao Wang, and Sanjeev Arora. What happens after sgd reaches zero loss?-a mathematical framework. In International Conference on Learning Representations , 2021.

Shiyun Lin, Yuze Han, Xiang Li, and Zhihua Zhang. Personalized federated learning towards communication efficiency, robustness and fairness. Advances in Neural Information Processing Systems , 35:30471-30485, 2022.

Yong Lin, Hanze Dong, Hao Wang, and Tong Zhang. Bayesian invariant risk minimization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition , pages 16021-16030, 2022.

Yong Lin, Shengyu Zhu, Lu Tan, and Peng Cui. Zin: When and how to learn invariance without environment partition? Advances in Neural Information Processing Systems , 35, 2022.

Chaochao Lu, Yuhuai Wu, Jo´ se Miguel Hernández-Lobato, and Bernhard Schölkopf. Nonlinear invariant risk minimization: A causal approach. arXiv preprint arXiv:2102.12353 , 2021.

Miao Lu, Beining Wu, Xiaodong Yang, and Difan Zou. Benign oscillation of stochastic gradient descent with large learning rate. In International Conference on Learning Representations , 2023.

Kaifeng Lyu, Zhiyuan Li, and Sanjeev Arora. Understanding the generalization benefit of normalization layers: Sharpness reduction. Advances in Neural Information Processing Systems , 35, 2022.

Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Aguera y Arcas. Communication-efficient learning of deep networks from decentralized data. In Artificial intelligence and statistics , pages 1273-1282. PMLR, 2017.

Nicolai Meinshausen, Alain Hauser, Joris M Mooij, Jonas Peters, Philip Versteeg, and Peter Bühlmann. Methods for causal inference from gene perturbation experiments and validation. Proceedings of the National Academy of Sciences , 113(27):7361-7368, 2016.

Mor Shpigel Nacson, Jason Lee, Suriya Gunasekar, Pedro Henrique Pamplona Savarese, Nathan Srebro, and Daniel Soudry. Convergence of gradient descent on separable data. In The 22nd International Conference on Artificial Intelligence and Statistics , pages 3420-3428. PMLR, 2019.

Vivian Y Nastl and Moritz Hardt. Predictors from causal features do not generalize better to new domains. arXiv preprint arXiv:2402.09891 , 2024.

Jonas Peters, Peter Bühlmann, and Nicolai Meinshausen. Causal inference by using invariant prediction: identification and confidence intervals. Journal of the Royal Statistical Society Series B: Statistical Methodology , 78(5):947-1012, 2016.

Elan Rosenfeld, Pradeep Ravikumar, and Andrej Risteski. The risks of invariant risk minimization. In International Conference on Learning Representations , volume 9, 2021.

Daniel Soudry, Elad Hoffer, Mor Shpigel Nacson, Suriya Gunasekar, and Nathan Srebro. The implicit bias of gradient descent on separable data. Journal of Machine Learning Research , 19 (1):2822-2878, 2018.

Dominik Stöger and Mahdi Soltanolkotabi. Small random initialization is akin to spectral learning: Optimization and generalization guarantees for overparameterized low-rank matrix reconstruction. Advances in Neural Information Processing Systems , 34, 2021.

Roman Vershynin. High-dimensional probability: An introduction with applications in data science , volume 47. Cambridge university press, 2018.

Loucas Pillaud Vivien, Julien Reygner, and Nicolas Flammarion. Label noise (stochastic) gradient descent implicitly solves the lasso for quadratic parametrisation. In Conference on Learning Theory , pages 2127-2159. PMLR, 2022.

Yoav Wald, Gal Yona, Uri Shalit, and Yair Carmon. Malign overfitting: Interpolation and invariance are fundamentally at odds. In International Conference on Learning Representations , 2023.

Amy Zhang, Clare Lyle, Shagun Sodhani, Angelos Filos, Marta Kwiatkowska, Joelle Pineau, Yarin Gal, and Doina Precup. Invariant causal prediction for block mdps. In International Conference on Machine Learning , pages 11214-11224. PMLR, 2020.

Cheng Zhang, Stefan Bauer, Paul Bennett, Jiangfeng Gao, Wenbo Gong, Agrin Hilmkil, Joel Jennings, Chao Ma, Tom Minka, Nick Pawlowski, et al. Understanding causality with large language models: Feasibility and opportunities. arXiv preprint arXiv:2304.05524 , 2023.

Jiacheng Zhuo, Jeongyeol Kwon, Nhat Ho, and Constantine Caramanis. On the computational and statistical complexity of over-parameterized matrix sensing. arXiv preprint arXiv:2102.02756 , 2021.

Contents

A

Deferred Proofs in Theorem 2

This section is organized as follows: In Section A.1, we state some useful properties from the definition of RIP. In Section A.2 and A.3, we formally define the auxiliary sequences we use to control the dynamics and develop several useful lemmas we frequently use. In Section A.4 and A.5, we bound Q t and E t respectively. In Section A.6 and A.7, we prove Theorem 4 and Theorem 5.

A.1 Restricted Isometry Properties

In this section, we list some useful implications of the definition of RIP property. Below we assume the set of linear measurements A ( e t ) 1 , . . . , A ( e t ) m ∈ R d × d satisfy the RIP property with parameter

( r, δ ) and denote E t ◦ ( M ) := 1 m ∑ m i =1 ⟨ X ( e t ) i , M ⟩ X ( e t ) i -M for some symmetric d × d matrix M . Some lemmas are direct corollaries and some lemmas serve as extensions to rank above r case. The proof of these lemmas can be found in Li et al. [31].

Lemma 1. Under the assumption of this subsection, if X , Y are d × d matrices with rank at most r , then

Lemma 2. Under the assumption of this subsection, if X id d × d matrix with rank at most r and Z is a d × d ′ matrix, then

Lemma 3. Under the assumption of this subsection, if X , Y are d × d matrices and Y has rank at most r , then

Lemma 4. Under the assumption of this subsection, if X id d × d matrix and Z is a d × d ′ matrix, then

Lemma 1 is from Candes [4]. The other three lemma can be derived from Lemma 1 through selecting Z or decomposing X into a series of rank-1 matrices [31].

A.2 Additional Auxiliary Sequences

In this section, we additionally define some auxiliary sequences. Some for calibrating the dynamics, that is, describe how the dynamic progresses without error or randomness and track the trajectories with the accumulation of error. Some are used for characterizing the impact of randomness on the dynamic.

The next two deterministic sequences help to track the dynamic of singular values of R t when it accumulates errors in each step.

Definition 2. We define the following two deterministic sequences:

The next lemma shows that the deviation between R t and R t can be bounded.

Lemma 5 (Bounded Deviation between R t and R t ) . Let the sequence R t be defined as (25) . Let T 1 be the first time R t enters the region ( 1 3 -η, 1 3 ) , we have

for any t = 0 , . . . , T 1 .

Proof. Fist, for R t have that

It takes T 1 ≤ 4 η log ( 1 α ) steps for R t to reach ( 1 3 -η, 1 3 ) . We can conclude that

where we use 1 -x ≥ exp( -2 x ) , 1 + x ≥ exp( x 2 ) for x ∈ [0 , 1 / 2] . Similarly, For R t , we have

and

which implies

One can also see that, R t ≤ (1 + 1 / 6)R t and R t ≥ (1 -1 / 6)R t holds for any t ≤ T , which completes our proof.

Next, we formally define the calibration line L t . In later parts, we can show that the norm of each column of Q t behaves like a biased random walk with reflecting barrier L t .

Definition 3. Let α, R be defined as above. For t = 0 , 1 , . . . , we define the calibration line:

Next, we define a stochastic process q t i based on Σ t . The reason why we define this sequence is that though the randomness only directly affects Q t , the dynamic of E t and R t also shares the randomness, therefore the dynamics become difficult to reason about since they are deeply coupled. Therefore, we define this 'external' random sequence to dominate them.

Definition 4 (Controller Sequence) . We fix the violation probability p = c v / ( M 2 log( d )) for some small absolute constant c v . For each fixed i , we define a stochastic process q t i for t = 0 , 1 , 2 , . . . with q 0 i = α , and

q t i is used for providing an upper bound the norm of columns of Q t . Before q t i hits the upper absorbing boundary p -1 . 5 r 1 . 5 2 · L t , it can be considered as a 'reflection and absorbing' process, with reflection barrier L t and absorbing barrier p -1 . 5 r 1 . 5 2 · L t . The following lemma gives an upper bound for { q t i } i,t :

Lemma 6 (Upper bound for q t i ) . With probability over 0 . 995 over the randomness of the Σ ( e t ) , for all i = 1 , 2 , . . . , r 2 and t = 0 , 1 , . . . , T 2 , we have

To prove this, we define a family of random sequences X i k,t .

Definition 5. For each i = 1 , . . . , r 2 , we construct a family of non-negative stochastic processes { X i k,t } T 2 t =0 for k = 0 , . . . , T 2 as follows:

( X i k,t ) k,t ∈ [ T 2 ] can be expressed as the following form:

It can be noticed that X i k,t and q t i have close relations. At the beginning we have q t i = X i 0 ,t , t = 0 , 1 , . . . , progress along the 0-th row. If q t i gets lower than the calibration line L t at some timestep t = t 0 , it switches to the the t 0 -th row X i t 0 ,t , t = t 0 , . . . until the next time it gets lower than calibration line L t , and so on. We can see that q t i always progress along a certain row. Thus

Theerfore, any uniform bound of X i k,t can also be a bound for q t i . Later in the context, we analyze X i k,t for each i so we omit the argument i in X i k,t for convenient notation.

We define σ -field F t = σ ( Σ ( e 0 ) , . . . , Σ ( e t -1 ) ) for t = 1 , . . . T 2 and F 0 = σ ( ∅ ) . Then we have F 0 ⊂ F 1 ⊂ · · · ⊂ F T 2 form a filtration. The next lemma shows that a certain power of { X k,t } t is a non-negative supermartingale w.r.t. F t .

Lemma 7. For each i = 1 , . . . , r 2 and k = 0 , . . . , T 2 , if the learning rate η satisfies η ∈ ( 24 M 2 , 1 64 M 1 ) , then the process { X 2 / 3 k,t } T 2 t =0 is a non-negative supermartingale with respect to F t .

Proof. First, its easy to verify the adaptiveness X 2 / 3 k,t ∈ F t since Σ ( t ) ii ∈ F t for all t = 0 , 1 , . . . T 2 . Next, note that

So it suffices to prove that

Therefore,

Hence, it suffices to choose η, γ such that

When γ = 1 3 , η ∈ ( 24 M 2 , 1 64 M 1 ) suffices. Hence we prove E [ (1 + η Σ ( e t ) ii +2 η ) 2 / 3 ] ≤ 1 and we can conclude that

Now we are ready to prove Lemma 6.

Proof of Lemma 6. From the above observations, before q t i hits the upper absorbing boundary p -1 . 5 r 1 . 5 2 · L t , there always exists some k such that q t i = X k,t . Therefore, q t i hits p -1 . 5 r 1 . 5 2 · L t implies there exists some k that X k,t hits p -1 . 5 r 1 . 5 2 · L t . So it suffices to bound X k,t .

For any fixed k = 0 , ..., T 2 , we denote two stopping times:

For any γ ∈ (0 , 1) and | x -1 | < 1 16 , from Taylor's expansion, we have

One gets that

Where the inequality ( a ) is from Markov's inequality. Inequality ( b ) is from the optional stopping time theorem for supermartingales and inequality ( c ) is from the fact that L t is non-decreasing. Therefore, we can conclude that:

where the first inequality is simply a union bound over i = 1 , 2 , ..., r 2 . Then

where the constant hidden in O ( · ) only depends on the choice of α . Since log(1 /α ) ≤ 4 log( d ) , the constant hidden in O ( · ) is absolute. Therefore, the last inequality holds with sufficiently small c v , which does not depend on other parameters.

A.3 Useful Lemmas

In this part we bound some quantities that we frequently encounter as the error terms. These lemmas will simplify our proofs in later parts.

The next lemma helps to bound the 'interaction error' arose from the non-orthogonality of V ⋆ and U ⋆ .

Lemma 8. Let R t , Q t , E t and ϵ 1 be defined as above. We have

Proof. From the definition of R t , Q t , E t , we have

Note that and

Similarly, for the other terms, we can prove that all the six terms in the bracket in the last line of 52 have operator norm ≤ ϵ 1 . This completes the proof.

The next lemma helps to bound the RIP error in the dynamic of U t .

Lemma 9 (Upper Bound for E t ) . Under the assumption of Theorem 2, if ∥ E t ∥ , ∥ Q t ∥ , ∥ R t ∥ < 1 . 1 and ∥ E t ∥ 2 F < 1 , we have that:

Proof.

where in ( a ) we use the linearity of E t ◦ ( · ) and the triangle inequality. In ( b ) we use Lemma 2 for the first term, Lemma 4 for the second term, and the expansion:

for the third term which shows that U t U t ⊤ -U ⋆ U ⋆ ⊤ -E t E ⊤ t has rank no more than 2( r 1 + r 2 ) . Hence we can conclude that:

The following lemma tells how to bound the interaction error and RIP error using the auxiliary sequences R t and L t we have already defined:

Lemma10 (Bound Using calibration Line) . Under the assumptions of Theorem 2, if ∥ E t ∥ ≤ ∥ R t ∥ ≤ min { 4R t , 1 . 1 } and ∥ Q t ∥ ≤ √ r 2 p -1 . 5 r 1 . 5 2 · L t , we have

Proof. From triangle inequality and the condition of this lemma (2 ϵ 1 ≤ δ ) , we have that:

Then it suffices to check:

where ( a ) is from the definition of L t , ( b ) and ( c ) are from the assumption on δ in Theorem 2, and ( d ) is from the assumption on δ (the absolute constant c in the condition for δ ) and the fact that L t ≤ R t . Hence the proof is completed.

A.4 Bounds of Q t

For evaluating the magnitude of ∥ Q t ∥ , we consider its columns. We denote each column of Q t as q ( t ) i for i = 1 , 2 , . . . , r 2 . And use q t i we defined above to upper bound them. Once we provide a uniform bound for all q ( t ) i , we can also bound ∥ Q t ∥ .

Lemma 11. Under the assumption of Theorem 2, under the event of q t i < p -1 . 5 r 1 . 5 2 · L t with p ≥ ϵ 2 / 3 2 for all i = 1 , 2 , . . . , r 2 and t = 0 , 1 , . . . , T , if ∥ E t ∥ ≤ ∥ R t ∥ ≤ 1 . 1 , ∥ E t ∥ 2 F < 1 and ∥ q t j ∥ ≤ q t j for all j = 1 , . . . , r 2 , then we have

for all i = 1 , 2 , . . . , r 2 .

Proof. From the dynamic of Q t :

we can see that for each column q ( t ) i of Q t :

̸

where we use Lemma 10. For the second term we have:

̸

where in ( a ) we use Assumption 1 (c) and induction hypothesis that ∥ q ( t ) j ∥ < p -1 . 5 r 1 . 5 2 · L t , in ( b ) we use the definition of p (Definition 4), and in ( c ) we use Assumption 1 (a) and Assumption 2 with sufficiently small c o (which depends solely on another universal constant c v ). Hence we have

There are two probable cases:

Both lead to the results we desire.

With the above lemma, we can also give a bound for ∥ Q t ∥ :

Corollary 1. Under the condition of Lemma 11, we have that

A.5 Bounds of E t

In this section, we bound the increments of both the operator norm and the Frobenius norm of E t . The next lemma provide an upper bound for ∥ E t ∥ .

Lemma 12 (Increment of Spectral Norm of E t ) . Under the assumption of Lemma 11, we have

̸

Proof. From the dynamic of E t (24), we can derive that

where ( a ) is from Lemma 9 and the fact that ∥ Id res U t ∥ , ∥ Id res U t ∥ ≤ ϵ 1 . ( b ) and ( c ) are derived similarly as Lemma 10.

The next lemma bounds the F-norm of error component E t .

Lemma 13 (Increment of the F-norm of Error Dynamic) . Under the assumption of Lemma 11, and we further assume that ∥ E t ∥ ≲ δM 1 √ r 1 + r 2 log(1 /α ) , then the Frobenius norm of E t +1 can be bounded by

which immediately implies,

Proof. We expand ∥ E t +1 ∥ 2 F from the dynamic of E t (24):

Now we bound the six parts separately. For the first part, since 0 ⪯ η U ⊤ t U t ⪯ I , we have

For the second part:

In ( a ) we use similar technique as in Lemma 9 to divide U t U ⊤ t -U ⋆ U ⋆ ⊤ -V ⋆ Σ t V ⋆ ⊤ into three parts so that we can use Lemma 1 and Lemma 3. In ( b ) we use Lemma 9 to bound the first two terms and (57) to bound the third term with the assumption that ∥ R t ∥ , ∥ Q t ∥ , ∥ E t ∥ < 2 .

For the third part:

where in ( a ) we use the fact that ⟨ A , BCD ⟩ = ⟨ B ⊤ AD ⊤ , C ⟩ . In ( b ) we separate E t as in (70). In ( c ) , for the first term we use the upper bound for E t appeared in Lemma 9, for the second term we use ∥ AB ∥ F ≤ ∥ A ∥∥ B ∥ F (and similarly for nuclear norm) and ∥ I -η U ⊤ t U t ∥ ≤ 1 .

For the fourth part:

where the first inequality is from Cauchy's inequality and the fact that ∥ Id res U ⋆ ∥ , ∥ Id res V ⋆ ∥ ≤ ϵ 1 . For the fifth part:

where the first inequality is from the norm inequality ⟨ X , Y ⟩ ≤ ∥ X ∥ ∗ ∥ Y ∥ and in the last inequality we use the fact that ϵ 1 < δ .

For the sixth part:

In ( a ) we use the norm inequality ⟨ X , Y ⟩ ≤ ∥ X ∥ ∗ ∥ Y ∥ and in ( b ) we use ∥ Id res ∥ ≤ 1 and ∥ Id res U t ∥ , ∥ Id res U t ∥ ≤ ϵ 1 .

Now combining Equation (69)-(74), along with the fact that ∥ E 0 ∥ 2 F ≤ dα 2 < d -1 ≪ δ 2 r 1 . 5 , we can derive the result we desire.

A.6 Analysis for Phase 1

In this section, we give a rigorous analysis for phase 1:

Theorem 4 (Phase 1 analysis) . Under the assumptions of Theorem 2. During the first T 1 = O ( 1 η log( 1 α )) steps, with probability at least 0 . 995 , the following holds for any t ∈ [0 , T 1 ] , that

∥ Q t ∥ F ≤ p -1 . 5 r 1 . 5 2 √ r 2 · L t ≤ δ ⋆ < 0 . 01 , where L t is formally defined in (38) .

In the below contexts, unless otherwise specified, we abbreviate the largest and smallest singular values of R t as σ ( t ) 1 and σ ( t ) r 1 .

The next lemma tells that, if ∥ Q t ∥ and ∥ E t ∥ are both small, then R t increases steadily and the deviation between its singular values is small.

Lemma 14 (Dynamic of Singular Values of R t in Phase 1) . For some t ≤ T 1 -1 , under the assumptions of Lemma 11, if ∥ E t ∥ , ∥ Q t ∥ < 1 96 log -1 (1 /α ) and R t ≤ σ ( t ) r 1 ≤ σ ( t ) 1 ≤ R t , then

and

Proof. From the dynamic of R t :

We use σ ( t ) 1 and σ ( t ) r 1 to denote the largest/smallest singular value of R t . To control the dynamic of σ ( t ) 1 and σ ( t ) r 1 , we need to bound the magnitude of the error term, that is

where in the first inequality we use the assumption for ∥ Q t ∥ and ∥ E t ∥ and δ . Therefore, from Weyl's inequality, we have that

Using the assumption that

And Lemma 5, we can conclude that

For the increasing speed of σ ( t ) r 1 , note that σ ( t ) 1 < 2 σ ( t ) r 1 , therefore

This proves the desired result.

Now that the supporting lemmas are prepared, we can begin the proof of Theorem 4

Proof of Theorem 4. The initial value of U 0 implies that

Recall that the time T 1 ≤ 5 η log(1 /α ) is the first time R t enters the region (1 / 3 -η, 1 / 3) . We have that the event of q t i < p -1 . 5 r 1 . 5 2 · L t for all i = 0 , . . . , r 2 , t = 0 , . . . , T 1 happens with probability over 0 . 995 . In this event, we can use Lemma 11, 12, 13 and 14 to inductively prove:

For the operator norm of E t , we have that for all t ≤ T 1 :

where in the second inequality we use Lemma 14 that ∥ R t ∥ increases with rate not less than (1 + 3 /η ) .

For the Frobenius norm of E t :

For ∥ Q t ∥ , we use Corollary 1:

For R t , we have for t ≤ T 1 :

For the condition ∥ E t ∥ ≤ ∥ R t ∥ :

Hence the proof is completed.

A.7 Analysis for Phase 2

In phase 1, the signal component R t grows at a stable speed from α to O (1) while the spurious component Q t and the error component E t are kept at low levels. In phase 2, we will characterize how R t approach 1 and how to continually keep Q t and E t .

Lemma 15 (Stability of R t ) . If there exists some real number g satisfying

for all t = T 1 +1 , . . . , T 1 + T -1 , then we have

Proof. First we consider the upper bound for σ ( t ) 1 . Similar to Equation (78), we have

Note that Equation (90) is equivalent to

With σ ( t ) 1 ( T 1 ) < 1 2 , one can see that σ ( t ) 1 never goes above √ 1 + g ≤ 1 + g .

Now we consider σ ( t ) r 1 . After phase 1 we have σ ( T 1 ) r ≥ 5 6 (1 / 3 -η ) > 1 4 . If σ ( t ) 1 ≤ 5 σ ( t ) r 1 , similarly we have:

Which implies that, if σ ( t ) r 1 < √ 1 -5 g ,

Therefore, σ ( t ) r 1 will get larger than √ 1 -5 g -g 2 ≥ 1 -5 g at some time t ≤ T 1 + 8 η log ( 1 g ) . Also from Equation (92) we can see that, σ ( t ) r 1 keeps increasing before it gets larger than √ 1 -5 g . And once it surpasses √ 1 -5 g , it never falls below than √ 1 -5 g again. Therefore, σ ( t ) 1 ≤ 5 σ ( t ) r 1 is satisfied and the proof proceeds.

Now we can state and prove:

Theorem 5 (Phase 2 Analysis) . Under the assumptions of Theorem 2. Let T 2 = T 1 + O ( 1 η log(( r 1 + r 2 ) /δ )) ≤ O ( 1 η log( 1 α )) . Then with probability at least 0 . 995 , we have

And for t = T 1 +1 , . . . , T 2 , we have

Proof of Theorem 5. The error g in Lemma 15 is no less than Ω( δ 2 M 2 1 ( r 1 + r 2 )) ≫ α order, therefore T 2 = T 1 + 1 η log (1 /α ) suffices for σ ( t ) r 1 to reach 1 -5 g . Then similar to the induction in the proof of Theorem 4, we can derive(in the same high probability event):

∥ E t ∥ ≤ 40 ηδM 1 √ r 1 + r 2 +40 ηδM 1 √ r 1 + r 2 ( t -T 1 ) ≤ 80 δM 1 √ r 1 + r 2 log(1 /α )) < 0 . 01 ;

Hence the assumption in Lemma 15 is satisfied, with

Therefore,

Proof of Theorem 2. Using Theorem 4 and Theorem 5 with T = T 2 , we have

where in ( a ) we decompose UU t ⊤ (See (57)) and triangle inequality. In ( b ) and ( c ) we use Theorem 5 and repeatedly use the fact ∥ AB ∥ F ≤ ∥ A ∥∥ B ∥ F . This completes the proof.

B Deferred Proofs

B.1 Proof of Proposition 1

In the below contexts, notations such as C, c, C 1 , c 1 always denote some positive absolute constants. Such notation is widely adopted in the field of non-asymptotic theory.

We first state some useful definitions and lemmas:

Definition 6 ( ϵ -Net and Covering Numbers) . Let ( T, d ) be a metric space. Let ϵ > 0 . For a subset K ⊂ T , a subset M⊆ K is called an ϵ -net of K if every point in K is within distance ϵ of some point in M . We define the covering number of K to be the smallest possible cardinality of such M , denoted as N ( K,ϵ ) .

Lemma 16 (Covering Number of the Euclidean Ball) . Let S n -1 denote the unit Euclidean sphere in R n . The following result satisfies for any ϵ > 0 :

Lemma 17 (Two-sided Bound on Gaussian Matrices) . Let A be an d × r matrix whose elements A ij are independent N (0 , 1) random variables. Then for any t ≥ 0 we have

with probability at least 1 -2 exp( -t 2 ) .

Lemma18 (Approximating Operator Norm Using ϵ -nets) . Let A be an m × n matrix and ϵ ∈ [0 , 1 / 2) . For any ϵ -net M 1 for the sphere S n -1 and any ϵ -net M 2 of the sphere S m -1 , we have

Moreover, if m = n , then we have

Lemma 19 (Concentration Inequality for Product of Gaussian Random Varables) . Suppose X and Y are independent N (0 , 1) random variables. Then ⟨ X,Y ⟩ is a sub-exponential random variable. Therefore for ( X 1 , . . . , X m , Y 1 , . . . , Y m ) ⊤ ∼ N (0 , I 2 m ) , the following holds for any t ≥ 0 :

Proof. Note that

The two terms are independent and following Gamma distribution Γ ( 1 2 , 1 ) . Since Gamma distribution random variables are sub-exponential, ⟨ X,Y ⟩ is sub-exponential too. The concentration inequality follows from Bernstein's inequality. (See Theorem 2.8.2 of Vershynin [47]).

Now we prove Proposition 1:

Proof of Proposition 1. First we provide a bound for ∥ M ⊤ 1 M 2 ∥ . We fix ϵ = 1 / 4 , and we can find an ϵ -net M 1 of the sphere S r 1 -1 and ϵ -net M 2 of the sphere S r 2 -1 with

For each x ∈ M 1 and y ∈ M 2 , we have for 0 < u < 1 ,

where we use the fact that M 1 x and M 2 y are independent N (0 , I d ) random vectors and an application of Lemma 19. We let u = √ r 1 + r 2 d · t for t < √ d r 1 + r 2 , we have:

where in ( a ) we use Lemma 18, in ( b ) we apply a union bound over all x ∈ M 1 and y ∈ M 2 . Next, we bound ∥ R -1 1 ∥ and ∥ R -1 2 ∥ . Recall the QR-decompositions of M 1 and M 2 :

which implies M ⊤ 1 M 1 = R ⊤ 1 R 1 and M ⊤ 2 M 2 = R ⊤ 2 R 2 , and consequently ∥ R -1 1 ∥ = σ r 1 ( M 1 ) -1 and ∥ R -1 2 ∥ = σ r 2 ( M 2 ) -1 . From Lemma 17,

And similarly for ∥ R -1 2 ∥ . Finally, for t < √ d r 1 + r 2 ,

This completes the proof.

B.2 The Failure of Pooled Stochastic Gradient Descent

From Theorems 2 and 3, for the hard case in Theorem 3, we have a separation that Pooled Gradient Descent fails to select out the invariant signal, whereas the HeteroSGD can succeed. This isolates the implicit bias of online algorithms over heterogeneous data towards invariance and causality.

In this section, we give a rigorous proof for Theorem 3. We first demonstrate the failure of PooledGD

Theorem 6 (Negative Result for Pooled Gradient Descent) . Under the assumptions of Theorem 2, for the certain case where U ⋆ ⊥ V ⋆ and E e ∈ D Σ ( e ) = I r 2 , if we perform GD over all samples from all environments and ends with T = Θ(log d ) , then U t keeps approaching U ⋆ U ⋆ ⊤ + V ⋆ V ⋆ ⊤ ,in the sense that

during which for all t = 0 , 1 , . . . , T :

Proof of Theorem 6. Firstly, we emphasis that Theorem 2 also applies to the case where there is only one environment and no spurious signals, the m samples are generated as: (We use underlined notations to distinguish this setting from others)

In such cases, there is no randomness and U T U ⊤ T deterministically learns A ⋆ and all the singular values of R t grow at similar speeds.

Under the conditions in Theorem 6, we first construct a single-environment case. Let U ⋆ and V ⋆ be defined as in Theorem 6, we let the invariant signal A ⋆ = U ⋆ U ⋆ ⊤ + V ⋆ V ⋆ ⊤ and there is no spurious signal. Then the updating rule is:

Using Theorem 2, we can prove that U t U t continuously approaches A ⋆ ⊤ = U ⋆ U ⋆ ⊤ + V ⋆ V ⋆ ⊤ in phase 1 & 2, during which:

In phase 1, ∥ R t ∥ < 1 / 2 therefore ∥ U t U ⊤ t -U ⋆ U ⋆ ⊤ ∥ F ≳ √ r 1 .

In phase 2, all the singular values of ∥ R t ∥ get larger than 1 / 6 , from Weyl's inequality, we have that the top r 2 singular values of U t U ⊤ t -U ⋆ U ⋆ ⊤ are all larger than 1 / 6 . Hence ∥ U t U ⊤ t -U ⋆ U ⋆ ⊤ ∥ F ≳ √ r 2 .

Now we prove Theorem 6. The updating rule can be written as

We compare this updating rule with (112). The only difference is the RIP error term. However, the upper bounds for E e ◦ ( U t U ⊤ t -A ⋆ -A ( e ) ) used in the proof also apply for the expectation E e ∼ D [ E e ◦ ( U t U ⊤ t -A ⋆ -A ( e ) )] . So we can derive the same conclusion that

for T = Θ( 1 θ log(1 /α )) , during which we have that for all t = 0 , 1 , . . . , T :

Now we are ready to prove Theorem 3. Assume that at each time t = 0 , . . . , 1 , we receive m samples { X ( t ) i , y ( t ) i } i m =1 , each sample is independently sampled from environment e t,i ∼ D , satisfying

and imply the Stochastic Gradient Descent

For technical convenience, we assume that X is the symmetric Gaussian matrix with diagonal elements from N (0 , 1) and off-diagonal elements from N (0 , 1 / 2) . We further assume X ( t ) i is independent of e t,i . This corresponds to the cases where each environment has infinitely many samples and the linear measurements from different environments share the same distribution.

Proof of Theorem 3. Denote ¯ A = E e ∈ D A ( e ) . Then we have

The first term is the dynamic of single environment matrix sensing problem, and the second term is a zero-mean noise arising from SGD. Once we can prove that the second term is small with high probability, then the dynamic will be similar to the dynamic of single environment matrix sensing problem, thereby we can get a high-probability version of the result of Theorem 3.

Now we control the SGD noise term. Let M 3 be a 1 4 -net of the sphere S d -1 with |M 3 | ≤ 9 d . Then for any d × d matrix M , we have ∥ M ∥ ≤ 4 max x ∈M 3 | x ⊤ Mx | . For any fixed x ∈ M 3 , one can see that ⟨ X ( t ) i , A ( e t,i ) -¯ A ⟩ x ⊤ Mx has zero mean and is the product of two sub-Gaussian random variable with sub-Gaussian parameter no more than 2 M 1 ( r 1 + r 2 ) and 2 . Therefore, it is a sub-exponential random variable with parameter no more than CM 1 ( r 1 + r 2 ) for some universal constant C > 1 . Then applying the Bernstein's Inequality [47] and taking the union bound over M 3 , we can obtain that

Setting t = 10 d and m = d poly( r 1 + r 2 , M 1 + M 2 , log d ) , we can obtain that with probability over 1 -exp( -d ) ,

Therefore, in this case the SGD error can be upper bounded in the same way as the RIP error at the level of o (1 / poly( r 1 + r 2 , M 1 + M 2 , log d )) . This implies that the SGD error will not significantly affect the dynamic with probability over 1 -T exp( -d ) . Therefore (113) and (114) hold with probability over 0 . 99 .

Theorem 3 and Theorem 6 indicate that the failure is because the signal is averaged when calculating gradients when we perform GD or SGD over pooled datasets. To the best of our knowledge, it is

intrinsically hard to provide a rigorous statement when the batch size is small. We would like to leave the theoretical analysis as a future work. In the following simulation, we aim to demonstrate empirically that Pooled SGD fails to learn invariance with a small batch size. We consider the |E| = 2 case and the environments are generated by A (1) = U ⋆ U ⋆ ⊤ + ( s + M ) V ⋆ V ⋆ ⊤ and A (2) = U ⋆ U ⋆ ⊤ +( s -M ) V ⋆ V ⋆ ⊤ where ( U ⋆ , V ⋆ ) is column orthonormal. Then the invariant solution is A ⋆ = U ⋆ U ⋆ ⊤ and the spurious solution is A ⋆ + ¯ A = U ⋆ U ⋆ ⊤ + s V ⋆ V ⋆ ⊤ .We set ( α, d, r 1 , r 2 , s, M, m ) = (10 -3 , 30 , 5 , 5 , 0 . 5 , 4 , 80) , use Gaussian measurements as Section 5 and let T be sufficiently large. The following shows the F-norm between U t U ⊤ t and A ⋆ or A ⋆ + ¯ A .

0.0

0.2

0.4

0.6

0.8

1.0

t

/

T

1.0

1.5

2.0

2.5

3.0

3.5

4.0

UtU t

A

F

=

0.01

=

0.05

=

0.1

0.0

0.2

0.4

0.6

0.8

1.0

t

/

T

1.0

1.5

2.0

2.5

3.0

3.5

4.0

UtU t

A

A F

=

0.01

=

0.05

=

0.1

C Neural Networks with Quadratic Activations

In this section we discuss how to apply our results to nerral networks with quadratic activations. In particular, Example 1. As discussed above,

and it is equivalent to matrix sensing problem with

The main difference is that, when the samples x i are i.i.d. N (0 , I d ) , the set of linear measurements { x 1 x ⊤ 1 , . . . , x m x ⊤ m } no longer satisfies the RIP property. However, the following lemma tells that, with proper truncation, the set of measurements enjoys similar properties.

Lemma 20 (Lemma 5.1 of Li et al. [31]) . Let ( X 1 , . . . , X m ) = { x 1 x 1 ⊤ , . . . , x m x ⊤ m } where x i 's are i.i.d. ∼ N (0 , I ) . Let R = log ( 1 δ ) . Then, for every q, δ ∈ [0 , 0 . 01] and m ≳ d log 4 d qδ /δ 2 , with probability at least 1 -q , we have that for every symmetric matrix A :

If A has rank at most r and operator norm at most 1 , we have:

To accommodate this difference, we adopt the modified version of loss function and algorithm from Li et al. [31].

Algorithm 4 Modified Algorithm For Neural Network with Quadratic Activations

Set U 0 = α I d , where α is a small positive constant.

Set step size η .

Receive m samples ( x ( e t ) i , y ( e t ) i ) from current environment e t .

Calculate modified loss function ˜ L t ( U t ) = 1 m ∑ m i =1 ( ˆ y ( e t ) i -y ( e t ) i ) 2 1 ∥ U ⊤ x ( e t ) i ∥ 2 ≤ R

Gradient Descent

˜

U

t

=

U

t

-

η

∇

˜

f

L

(

U

end for

Output: U T .

Now we outline the proof sketch of Example 1

Theorem 7 (Two-Layer NN with Quadratic Activation) . Let a 1 , · · · , a r ∈ R d be independent random vectors sampled from normal distribution N (0 , 1 d I d ) . For environment e ∈ E , suppose the target function is determined by r 1 invariant features and r 2 variant admits that for each sample ( x ( e ) i , y ( e ) i ) :

Suppose we train the following two-layer NN:

and the initialization of parameters { u j } satisfies ∑ d j =1 u j u ⊤ j = α I . If { a ( e ) j } j,e satisfies sup e,j {| a ( e ) j |}· max j { 1+ | E e a ( e ) j |} min j { Var e [ a ( e ) j ] } < c 0 for some absolute constant c 0 , sample complexity m ≫

d poly( r, log( d ) , sup e,j {| a ( e ) j |} ) , α ∈ ( d -4 , d -1 ) and η ∼ max j { 1+ | E e a ( e ) j |} min j { Var e [ a ( e ) j ] } , then Algorithm 4 returns solution that satisfies

t

)

.

with probability over 0.99.

Proof. similar to the proof of Theorem 1.2 of Li et al. [31], the modified algorithm is in fact equivalent to (21) with RIP parameter ( r, δ ) when m = ˜ Ω( dr 2 δ -2 ) . Hence it is fully reduced to the matrix sensing problem.

Now we verify the conditions for A ⋆ = ∑ r 1 j =1 a j a ⊤ j and A ( e ) = ∑ r j = r 1 +1 a ( e ) j a j a ⊤ j . Since u i , i = 1 , . . . , r are independently and uniformly sampled from sphere, we have that

With high probability over the randomness of { a i } i , the eigenvalues of A ⋆ lie within ( 1 -O ( √ r 1 / √ d ) , 1 + O ( √ r 1 / √ d ) ) (See Theorem 4.6.1 of Vershynin [47]).

The angle between Col( A ⋆ ) and Col( A ( e ) ) is of O ( √ r 1 + r 2 / √ d ) order.

Therefore we can construct two column orthogonal matrix U ⋆ and V ⋆ such that U ⋆ ⊤ V ⋆ = 0 and sin(col( U ⋆ ) , col( A ⋆ )) , sin(col( V ⋆ ) , col( A ( e ) )) ≲ √ r 1 + r 2 / √ d . Hence we can apply Theorem 2 on ˜ A ⋆ := U ⋆ U ⋆ ⊤ and ˜ A ( e ) := V ⋆ diag( a ( e ) i ) V ⋆ ⊤ . Such approximation only raises O ( √ r 1 + r 2 / √ d ) multiplicative error, which is negligible. And we can easily verify ˜ A ( e ) satisfies Assumption 2. Then this result follows from the proof of Theorem 9.

D The κ ( A ⋆ ) > 1 Case

In this section we show how to generalize our results to the κ ( A ⋆ ) > 1 case by leveraging the adaptive subspace technique proposed by Li et al. [31] for single environment setting. This framework mainly consists of the following steps:

First, instead of using the fixed subspace col( U ⋆ ) , we use an adaptive one S t , where S 0 = col( U ⋆ ) and S t +1 = ( I -η M t ) S t where M t = 1 m ∑ m i =1 ⟨ X i , U t U ⊤ t -A ⋆ ⟩ X i . And we denote Z t = Id S t U t and H t = ( Id -Id S t ) U t . Which makes the updating of H t substantially disentangled from Z t .

Second, we reason about the updating rule of Z t . Since the subspace is updated at each step, the updating rule of Z t becomes indirect. We introduce ˜ Z t = ( Id -η H t Z t ⊤ ) Z t ( Id -2 η Z t + Id S t M t H t ) so that Z t +1 ≈ ˜ Z t -η ∇L ( ˜ Z t ) . It can be shown σ min ( Z t ) continually increases until it gets larger than 1 2 √ κ .

During this iteration, we can keep ˜ Z t is near Z t for each t and the principal angle θ t between S t and col( U ⋆ ) satisfies sin( θ t ) ≲ ηρt where ρ = ˜ Θ( δ √ r κ ) .

Finally, when σ min ( Z t ) is sufficiently large and principal angle is small, we can use the local restricted strongly convex property of L around A ⋆ to prove ∥ U t U t ∥ 2 F converges with rate 1 -Θ( η/κ ) .

For the multi-environment setting, we have the following result under a slightly stronger assumption on the heterogeneity:

Theorem 8 (General Theorem) . Under Assumption 1 and 2, suppose the heterogeneity parameter M 2 ≳ r 2 , ϵ 1 < δ . and the RIP parameter δ ≲ 1 poly( r, log( d ) ,M 1 + M 2 ,κ ) . We choose the η ∈ (24 M -1 2 , 1 64 M -1 1 ∧ 1 r 2 ) and α ∈ (1 /d 4 , 1 /d 3 ) , then running Algorithm 3 in T = Θ(log( α -1 ) /η ) steps, the algorithm outputs U T that satisfies

with probability over 0 . 99 .

Since the full proof of the adaptive subspace technique is involved, for clear representation, we point out the main differences from the single-environment case. We need to address the following three issues: (1) How to introduce the spurious component Q t into the original framework; (2) Whether the spurious signal A ( e ) significantly perturbs the dynamic of Z t ; and (3) How to give a phase 2 analysis when there is no local restricted strongly convexity around A ⋆ ?

We first cope with (1). With abuse of notation, we adopt the M t , Z t , H t and additionally define V ( ada ) t = Id V ⋆ H t and E ( ada ) t = ( Id -Id V ⋆ ) H t . We can prove that

If we can ensure sin( θ t ) ≲ δ poly( r, M 1 + M 2 , log( d )) , we can get similar dynamics as (23) and 24, then apply similar techniques in Section A.4 and Section A.5 to ensure V t and E t are no more than δ poly( r, M 1 + M 2 , log( d )) . w.h.p. Moreover, the dynamics in (127) is multiplicative, which means if we decrease α by comparing to Theorem 2, V t and E t can be further upper bounded by d -1 δ poly( r, M 1 + M 2 , log( d )) in phase 1.

For issue (2), the spurious signal A ( e ) brings error about 1+ O (( δ + ϵ 1 ) √ rM 1 +) multiplicative factor, which can be absorbed by the inherent RIP error of A ⋆ . Another difference is that, at the beginning ∥ V t ∥ or ∥ E t ∥ may be substantially larger than Z t due to the oscillation. We emphasis that such interference happens in RIP error term or non-orthogonal error term, multiplied by δ, sin( θ t ) or ϵ 1 . We can ensure such interference is negligible when δ ≲ 1 poly( r, log( d ) ,M 1 + M 2 ,κ ) . Therefore, the dynamic of Z t is benign, and the principal angle can be bounded by δ poly( r, log( d ) , M 1 + M 2 , κ ) ≪ 1 .

Finally for issue (3), when σ min ( Z t ) ≥ 1 2 √ κ and sin( θ t ) = δ poly( r, log( d ) , M 1 + M 2 , κ ) ≪ 1 . We get back to the original subspace col( U ⋆ ) and col( V ⋆ ) . We have U t = Z t + O (sin( θ t )) , V t = V ( ada ) t + O (sin( θ t )) , E t = E ( ada ) t + O (sin( θ t )) and ∥ E t -E ( ada ) t ∥ F ≲ √ r sin( θ t ) . Then we can use the technique from phase 2 analysis (Theorem 5) to complete the proof. We leave the extension of this theorem for the case where M 1 , M 2 are constant level for future studies.

NeurIPS Paper Checklist

1. Claims

Question: Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope?

Answer: [Yes]

Justification:

Guidelines:

The answer NA means that the abstract and introduction do not include the claims made in the paper.

The abstract and/or introduction should clearly state the claims made, including the contributions made in the paper and important assumptions and limitations. A No or NA answer to this question will not be perceived well by the reviewers.

The claims made should match theoretical and experimental results, and reflect how much the results can be expected to generalize to other settings.

It is fine to include aspirational goals as motivation as long as it is clear that these goals are not attained by the paper.

2. Limitations

Question: Does the paper discuss the limitations of the work performed by the authors?

Answer: [Yes]

Justification: See conclusion for what we leave for future studies.

Guidelines:

The answer NA means that the paper has no limitation while the answer No means that the paper has limitations, but those are not discussed in the paper.

The authors are encouraged to create a separate "Limitations" section in their paper.

The paper should point out any strong assumptions and how robust the results are to violations of these assumptions (e.g., independence assumptions, noiseless settings, model well-specification, asymptotic approximations only holding locally). The authors should reflect on how these assumptions might be violated in practice and what the implications would be.

The authors should reflect on the scope of the claims made, e.g., if the approach was only tested on a few datasets or with a few runs. In general, empirical results often depend on implicit assumptions, which should be articulated.

The authors should reflect on the factors that influence the performance of the approach. For example, a facial recognition algorithm may perform poorly when image resolution is low or images are taken in low lighting. Or a speech-to-text system might not be used reliably to provide closed captions for online lectures because it fails to handle technical jargon.

The authors should discuss the computational efficiency of the proposed algorithms and how they scale with dataset size.

If applicable, the authors should discuss possible limitations of their approach to address problems of privacy and fairness.

While the authors might fear that complete honesty about limitations might be used by reviewers as grounds for rejection, a worse outcome might be that reviewers discover limitations that aren't acknowledged in the paper. The authors should use their best judgment and recognize that individual actions in favor of transparency play an important role in developing norms that preserve the integrity of the community. Reviewers will be specifically instructed to not penalize honesty concerning limitations.

3. Theory Assumptions and Proofs

Question: For each theoretical result, does the paper provide the full set of assumptions and a complete (and correct) proof?

Answer: [Yes]

Justification: We provide assumptions in main text, proof details in appendix, and references for certain tools.

Guidelines:

The answer NA means that the paper does not include theoretical results.

All the theorems, formulas, and proofs in the paper should be numbered and crossreferenced.

All assumptions should be clearly stated or referenced in the statement of any theorems.

The proofs can either appear in the main paper or the supplemental material, but if they appear in the supplemental material, the authors are encouraged to provide a short proof sketch to provide intuition.

Inversely, any informal proof provided in the core of the paper should be complemented by formal proofs provided in appendix or supplemental material.

Theorems and Lemmas that the proof relies upon should be properly referenced.

4. Experimental Result Reproducibility

Question: Does the paper fully disclose all the information needed to reproduce the main experimental results of the paper to the extent that it affects the main claims and/or conclusions of the paper (regardless of whether the code and data are provided or not)?

Answer: [Yes]

Justification: See simulation section.

Guidelines:

The answer NA means that the paper does not include experiments.

If the paper includes experiments, a No answer to this question will not be perceived well by the reviewers: Making the paper reproducible is important, regardless of whether the code and data are provided or not.

If the contribution is a dataset and/or model, the authors should describe the steps taken to make their results reproducible or verifiable.

Depending on the contribution, reproducibility can be accomplished in various ways. For example, if the contribution is a novel architecture, describing the architecture fully might suffice, or if the contribution is a specific model and empirical evaluation, it may be necessary to either make it possible for others to replicate the model with the same dataset, or provide access to the model. In general. releasing code and data is often one good way to accomplish this, but reproducibility can also be provided via detailed instructions for how to replicate the results, access to a hosted model (e.g., in the case of a large language model), releasing of a model checkpoint, or other means that are appropriate to the research performed.

While NeurIPS does not require releasing code, the conference does require all submissions to provide some reasonable avenue for reproducibility, which may depend on the nature of the contribution. For example

(a) If the contribution is primarily a new algorithm, the paper should make it clear how to reproduce that algorithm.

(b) If the contribution is primarily a new model architecture, the paper should describe the architecture clearly and fully.

(c) If the contribution is a new model (e.g., a large language model), then there should either be a way to access this model for reproducing the results or a way to reproduce the model (e.g., with an open-source dataset or instructions for how to construct the dataset).

(d) We recognize that reproducibility may be tricky in some cases, in which case authors are welcome to describe the particular way they provide for reproducibility. In the case of closed-source models, it may be that access to the model is limited in some way (e.g., to registered users), but it should be possible for other researchers to have some path to reproducing or verifying the results.

5. Open access to data and code

Question: Does the paper provide open access to the data and code, with sufficient instructions to faithfully reproduce the main experimental results, as described in supplemental material?

Answer: [No]

Justification: The simulations are a simple validation of our theory.

Guidelines:

The answer NA means that paper does not include experiments requiring code.

Please see the NeurIPS code and data submission guidelines ( https://nips.cc/ public/guides/CodeSubmissionPolicy ) for more details.

While we encourage the release of code and data, we understand that this might not be possible, so 'No' is an acceptable answer. Papers cannot be rejected simply for not including code, unless this is central to the contribution (e.g., for a new open-source benchmark).

The instructions should contain the exact command and environment needed to run to reproduce the results. See the NeurIPS code and data submission guidelines ( https: //nips.cc/public/guides/CodeSubmissionPolicy ) for more details.

The authors should provide instructions on data access and preparation, including how to access the raw data, preprocessed data, intermediate data, and generated data, etc.

The authors should provide scripts to reproduce all experimental results for the new proposed method and baselines. If only a subset of experiments are reproducible, they should state which ones are omitted from the script and why.

At submission time, to preserve anonymity, the authors should release anonymized versions (if applicable).

Providing as much information as possible in supplemental material (appended to the paper) is recommended, but including URLs to data and code is permitted.

6. Experimental Setting/Details

Question: Does the paper specify all the training and test details (e.g., data splits, hyperparameters, how they were chosen, type of optimizer, etc.) necessary to understand the results?

Answer: [Yes]

Justification: See simulation section.

Guidelines:

The answer NA means that the paper does not include experiments.

The experimental setting should be presented in the core of the paper to a level of detail that is necessary to appreciate the results and make sense of them.

The full details can be provided either with the code, in appendix, or as supplemental material.

7. Experiment Statistical Significance

Question: Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments?

Answer: [No]

Justification: Our theoretical results provide success probability.

Guidelines:

The answer NA means that the paper does not include experiments.

The authors should answer "Yes" if the results are accompanied by error bars, confidence intervals, or statistical significance tests, at least for the experiments that support the main claims of the paper.

The factors of variability that the error bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, or overall run with given experimental conditions).

The method for calculating the error bars should be explained (closed form formula, call to a library function, bootstrap, etc.)

The assumptions made should be given (e.g., Normally distributed errors).

It should be clear whether the error bar is the standard deviation or the standard error of the mean.

It is OK to report 1-sigma error bars, but one should state it. The authors should preferably report a 2-sigma error bar than state that they have a 96% CI, if the hypothesis of Normality of errors is not verified.

For asymmetric distributions, the authors should be careful not to show in tables or figures symmetric error bars that would yield results that are out of range (e.g. negative error rates).

If error bars are reported in tables or plots, The authors should explain in the text how they were calculated and reference the corresponding figures or tables in the text.

8. Experiments Compute Resources

Question: For each experiment, does the paper provide sufficient information on the computer resources (type of compute workers, memory, time of execution) needed to reproduce the experiments?

Answer: [No]

Justification: Computing environment is not important for our problem settings.

Guidelines:

The answer NA means that the paper does not include experiments.

The paper should indicate the type of compute workers CPU or GPU, internal cluster, or cloud provider, including relevant memory and storage.

The paper should provide the amount of compute required for each of the individual experimental runs as well as estimate the total compute.

The paper should disclose whether the full research project required more compute than the experiments reported in the paper (e.g., preliminary or failed experiments that didn't make it into the paper).

9. Code Of Ethics

Question: Does the research conducted in the paper conform, in every respect, with the NeurIPS Code of Ethics https://neurips.cc/public/EthicsGuidelines ?

Answer: [Yes]

Justification: All the authors have reviewed the NeurIPS Code of Ethics.

Guidelines:

The answer NA means that the authors have not reviewed the NeurIPS Code of Ethics.

If the authors answer No, they should explain the special circumstances that require a deviation from the Code of Ethics.

The authors should make sure to preserve anonymity (e.g., if there is a special consideration due to laws or regulations in their jurisdiction).

10. Broader Impacts

Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?

Answer: [NA]

Justification: We investigate theoretical models.

Guidelines:

The answer NA means that there is no societal impact of the work performed.

If the authors answer NA or No, they should explain why their work has no societal impact or why the paper does not address societal impact.

Examples of negative societal impacts include potential malicious or unintended uses (e.g., disinformation, generating fake profiles, surveillance), fairness considerations (e.g., deployment of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations.

The conference expects that many papers will be foundational research and not tied to particular applications, let alone deployments. However, if there is a direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to generate deepfakes for disinformation. On the other hand, it is not needed to point out that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster.

The authors should consider possible harms that could arise when the technology is being used as intended and functioning correctly, harms that could arise when the technology is being used as intended but gives incorrect results, and harms following from (intentional or unintentional) misuse of the technology.

If there are negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms to monitor how a system learns from feedback over time, improving the efficiency and accessibility of ML).

11. Safeguards

Question: Does the paper describe safeguards that have been put in place for responsible release of data or models that have a high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)?

Answer: [NA]

Justification: Our paper does not pose such risks.

Guidelines:

The answer NA means that the paper poses no such risks.

Released models that have a high risk for misuse or dual-use should be released with necessary safeguards to allow for controlled use of the model, for example by requiring that users adhere to usage guidelines or restrictions to access the model or implementing safety filters.

Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images.

We recognize that providing effective safeguards is challenging, and many papers do not require this, but we encourage authors to take this into account and make a best faith effort.

12. Licenses for existing assets

Question: Are the creators or original owners of assets (e.g., code, data, models), used in the paper, properly credited and are the license and terms of use explicitly mentioned and properly respected?

Answer: [NA]

Justification: The paper does not use existing assets.

Guidelines:

The answer NA means that the paper does not use existing assets.

The authors should cite the original paper that produced the code package or dataset.

The authors should state which version of the asset is used and, if possible, include a URL.

The name of the license (e.g., CC-BY 4.0) should be included for each asset.

For scraped data from a particular source (e.g., website), the copyright and terms of service of that source should be provided.

If assets are released, the license, copyright information, and terms of use in the package should be provided. For popular datasets, paperswithcode.com/datasets has curated licenses for some datasets. Their licensing guide can help determine the license of a dataset.

For existing datasets that are re-packaged, both the original license and the license of the derived asset (if it has changed) should be provided.

If this information is not available online, the authors are encouraged to reach out to the asset's creators.

13. New Assets

Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets?

Answer: [NA]

Justification: The paper does not release new assets.

Guidelines:

The answer NA means that the paper does not release new assets.

Researchers should communicate the details of the dataset/code/model as part of their submissions via structured templates. This includes details about training, license, limitations, etc.

The paper should discuss whether and how consent was obtained from people whose asset is used.

At submission time, remember to anonymize your assets (if applicable). You can either create an anonymized URL or include an anonymized zip file.

14. Crowdsourcing and Research with Human Subjects

Question: For crowdsourcing experiments and research with human subjects, does the paper include the full text of instructions given to participants and screenshots, if applicable, as well as details about compensation (if any)?

Answer: [NA]

Justification: The paper does not involve crowdsourcing nor research with human subjects.

Guidelines:

The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.

Including this information in the supplemental material is fine, but if the main contribution of the paper involves human subjects, then as much detail as possible should be included in the main paper.

According to the NeurIPS Code of Ethics, workers involved in data collection, curation, or other labor should be paid at least the minimum wage in the country of the data collector.

15. Institutional Review Board (IRB) Approvals or Equivalent for Research with Human Subjects

Question: Does the paper describe potential risks incurred by study participants, whether such risks were disclosed to the subjects, and whether Institutional Review Board (IRB) approvals (or an equivalent approval/review based on the requirements of your country or institution) were obtained?

Answer: [NA]

Justification: The paper does not involve crowdsourcing nor research with human subjects.

Guidelines:

The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.

Depending on the country in which research is conducted, IRB approval (or equivalent) may be required for any human subjects research. If you obtained IRB approval, you should clearly state this in the paper.

We recognize that the procedures for this may vary significantly between institutions and locations, and we expect authors to adhere to the NeurIPS Code of Ethics and the guidelines for their institution.

For initial submissions, do not include any information that would break anonymity (if applicable), such as the institution conducting the review.

Peer reviews:
{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper studies \"implicit invariance learning\" within a simplified but meaningful setting---multi-environment low-rank matrix sensing problem. Authors show the implicit bias of SGD over heterogeneous data drives the model learning towards an invariant solution. The key insight is, through simply employing the large step size large-batch SGD sequentially in each environment without any  explicit regularization, the oscillation caused by heterogeneity can provably prevent model learning spurious signals, while the model learned using pooled GD over all data would simultaneously learn both the invariant and spurious signals.\n\nSTRENGTHS:\n- A novel perspective studying the invariant learning problem over multi environments.\n\n- Rigorous theoretic results with detailed proof. The theoretic findings are potentially very interesting and helpful.\n\n- Presentation is very good, and I am enjoy reading through the submission\n\nWEAKNESSES:\nThe considered setting is somewhat simplified, but that is fine for the first work from this new perspective.\n\nQUESTIONS:\nTo clarify, I am not very familiar with implicit regularization of SGD and I do not check carefully the proof. My confidence score should be low.\n\n---\n\nFrom my sensible review (assuming correctness of proof), this submission is a clear accept, so my review would be short.\n\n- regarding: \"In this paper, we will show that surprisingly, if each batch is sampled from data in one environment rather than data in all the environments, the heterogeneity in the environments together with the implicit regularization effects in the SGD algorithm can drive ...\"\n\n  This finding is interesting and potentially quite helpful to invariant learning. From my own experience with many DG problems, I like to collect training data from each environment in a large batch, and this simple method serves a good baseline and usually has some improvement over ERM. This observation was also summarized in a paper by other researchers (\"Simple data balancing achieves competitive worst-group-accuracy\", CLEAR 2022), but is different from here. Of course,  the above observation is only empirical and does not necessarily hold in general. Nevertheless, I would like to see some discussions with this observation regarding more general representation-learning based DG problems. I also hope this information can help authors futher consider similar theoretic studies in the more general DG setting, and I look forward to new findings in expanded version or new works.\n\n- I believe the setting of applying SGD to varying environment should have been considered in the context of federated learning. Can you also provide additional discussion in your related work part?\n\n- minor suggestion: \n\n  - I don't think it necessary to put a summary in the abstract.; \n  - line 22:  ”??\" appear after \"conditions:\".\n\nLIMITATIONS:\nsee above.", "TITLE": "Official Review", "RECOMMENDATION": 7, "REVIEWER_CONFIDENCE": 2, "SOUNDNESS_CORRECTNESS": 4, "DATE": "2024-07-12"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe authors show that in a matrix sensing context, and under a data distribution that includes invariant and environment-dependent components, SGD with successive batches from different environments lead to invariant features being provably learned. The authors show that SGD with mixed batches provably does not learn the invariant solution.\n\nSTRENGTHS:\n- The paper addresses an important issue, the problem of learning invariant solutions, and targets a particular, well defined sub-problem within this issue.\n- The assumptions that allow the authors' exposition are clearly stated and well-justified, and their results justify the claims made.\n- The authors' argumentation is easy to follow and their results are situated well within the relevant literature.\n\nWEAKNESSES:\n- The authors limit their analysis to the setting of matrix sensing (and a 2-layer NN that is constructed to conform to it). This is a reasonable choice to enable their analyses, however the justifications and implications of this choice should be discussed more thoroughly. \n- Although their overall argumentation is easy to follow, certain gaps and/or inconsistencies in their exposition present difficulties (see below for details).\n\nQUESTIONS:\n- The authors results constitute a strong negative finding w.r.t. standard SGD-based training without environment annotation and presumably mixed minibatches. The authors should more clearly highlight this and explain the reasons for the success of standard SGD-based training in practical settings (_despite_ their findings).\n- Do the authors' results imply that in any dataset, even without access to environment labels, training with SGD with batch size=1 allows access to the favorable results they present in Thm 1? This is due to a single sample inevitably belonging to a single environment.\n- L47: \"Learning invariant predictions produces reliable, fair, robust predictions against strong structural mechanism perturbation.\" Please be more clear and specific.\n- L53: Typo: \"may not necessarily in practice\"\n- L58: Please describe matrix sensing problem either in the main paper, or refer to a relevant appendix section\n- L61-64: The introductory exposition is more confusing then helpful since the notation is not sufficiently introduced.\n- Similar to above, Figure 1 is a lavish use of authors' space without a strong unique contribution\n- L140: Please fix typo (combine sentences)\n- L152: Total dimension of spurious signals or total dimension of core + spurious signals?\n- L199: That the spurious features have large dispersion across environments is an important assumption for the present paper. Please provide positive and negative hypothetical examples for this in realistic settings (in what cases it is reasonable to expect such large heterogeneity? In what cases it is not?)\n- L200: Missing ref.\n- L280: The terms HeteroSGD and PooledSGD are proposed early in the paper but later neglected, please consistently refer to the algorithms as such for readability\n\nLIMITATIONS:\nThe limitations implied by the choice of matrix sensing setting is not sufficiently discussed.", "TITLE": "Official Review", "RECOMMENDATION": 7, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2024-07-12"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe paper studies the implicit bias of (Hetero) SGD towards learning invariant representations and discarding non-invariant features in a matrix sensing setup. The applicability of the setup to the 2-layer NN with quadratic activations is demonstrated. Finally, the authors demonstrate that pooledGD fails to recover the corresponding invariant representation. Experiments on synthetic data is used to demonstrate the validity of the claims.\n\nSTRENGTHS:\n- The paper is clearly written, and the motivation is clear. \n- The theoretical analysis seems sound.\n\nWEAKNESSES:\n- Claims for PooledSGD: The introduction claims that the authors show that PooledSGD fails in recovering the invariant representation. However, the analysis (theorem 3) and the experiments are only presented for PooledGD. It is quite well known that GD, when compared to SGD, results in worse generalization (see [1] and references therein), even in the homogeneous environment setting. Thus, given the context, the negative result for PooledGD is not very surprising. Additionally, the assumption in theorem 3 about that the expectation of the covariance matrix, that the training environments span all directions uniformly, seems rather restrictive. \n - Theorem 2 feasibility: The application of theorem 2 in eq. 10 requires assuming d log^2(d) << m (batch size), which seems unrealistic in standard machine learning scenarios. The authors can perhaps make the point more convincingly by demonstrating the applicability of the results of theorem 2 with more realistic values (d, m, C etc.).\n\nReferences:\n- [1] On the Generalization Benefit of Noise in Stochastic Gradient Descent - Smith et al, 2020\n\nQUESTIONS:\n[1] Does the result in theorem 3 extend to pooledSGD as well?   \n\n[2] Typo: Missing Reference - line 200\n\nLIMITATIONS:\nYes", "TITLE": "Official Review", "RECOMMENDATION": 6, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 2, "DATE": "2024-07-15"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper studies the difference between the solutions to multi-environment matrix-sensing obtained by gradient descent and \"heterogenous\" stochastic gradient descent. The authors show through analytical results and simulations that HeteroSGD helps discover invariant solutions while gradient descent converges to solutions that contain both invariant and spurious components. The authors describe multi-environment matrix sensing as a mathematical model where the matrices being sensed consist of an invariant component and a spurious component. The solutions of two optimization problems are considered: a) gradient descent on a pooled batch of data from all environments and b) heteroSGD where each iteration samples a batch of data from a different environment. The authors introduce assumptions on the near-orthogonality between the invariant and spurious subspaces, the heterogeneity of the environments, and that the measurements satisfy RIP. Under these conditions, they show that heteroSGD discovers the invariant signal while gradient descent converges to solutions that contain both invariant and spurious components. The authors also run simulations to support their claims.\n\nSTRENGTHS:\nThe paper is well written and easy to follow. All assumptions are stated clearly and the authors provide a baseline (gradient descent) to compare their proposed algorithm against.\n\nWEAKNESSES:\n1. The problem of multi-environment matrix sensing seems under-motivated. While the authors introduce a clean mathematical model for this problem, they do not provide instances of problems that satisfy this model. Is it reasonable to model environment specific signals as being incoherent with the invariant signal? Is it reasonable to assume heterogenous environments? In what situations are these assumptions satisfied? While I understand the focus of this paper is theoretical analysis of a model, I think it is important to motivate it so that we understand this is a real problem and not just another mathematical model.\n\n2. The proof sketch section does not provide any intuition about the separation between GD and heteroSGD. Specifically, I'm looking for an explanation as to why $\\mathbf{Q}_t$ stays small when environment specific data is provided (as in heteroSGD) and it does not decay when the environment data is pooled (as in GD). (If the answer is already in the paper I might have missed it - please point me towards it).\n\n3. Simulations are run on synthetic examples. Are there any real datasets that you can demonstrate your methods on?\n\n4. The current theorem statements show that under conditions of heterogeneity, heteroSGD can learn invariant solutions. Can one show that heterogeneity is necessary for learning invariant solutions?\n\nQUESTIONS:\nSome questions in weaknesses. Others below:\n\n1. Did the authors try searching for different learning rates for GD vs SGD? Prior results on the interaction between batch size and learning rate indicate that the learning rate for GD and SGD should likely be tuned separately. Does the spurious solution still exist when this is taken into account?\n\n2. Does the separation between pooled data vs environment specific data hold when SGD is considered (rather than GD)? Is the invariant learning captured by stochastic gradients or the fact that each update only uses data from one environment? Hopefully this can be answered theoretically and through simulations.\n\nLIMITATIONS:\nYes", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2024-07-15"}