Dynamics of Concept Learning and Compositional Generalization

## Abstract

Abstract Prior work has shown that text-conditioned diffusion models can learn to identify and manipulate primitive concepts underlying a compositional data-generating process, enabling generalization to entirely novel, out-of-distribution compositions.
Beyond performance evaluations, these studies develop a rich empirical phenomenology of learning dynamics, showing that models generalize sequentially, respecting the compositional hierarchy of the data-generating process.
Moreover, concept-centric structures within the data significantly influence a model’s speed of learning the ability to manipulate a concept.
In this paper, we aim to better characterize these empirical results from a theoretical standpoint.
Specifically, we propose an abstraction of prior work’s compositional generalization problem by introducing a structured identity mapping (SIM) task, where a model is trained to learn the identity mapping on a Gaussian mixture with structurally organized centroids.
We mathematically analyze the learning dynamics of neural networks trained on this SIM task and show that, despite its simplicity, SIM’s learning dynamics capture and help explain key empirical observations on compositional generalization with diffusion models identified in prior work.
Our theory also offers several new insights—e.g., we find a novel mechanism for non-monotonic learning dynamics of test loss in early phases of training.
We validate our new predictions by training a text-conditioned diffusion model, bridging our simplified framework and complex generative models.
Overall, this work establishes the SIM task as a meaningful theoretical abstraction of concept learning dynamics in modern generative models.

## 1 Introduction

Human cognitive abilities have been argued to generalize to unseen scenarios through the identification and systematic composition of primitive concepts that constitute the natural world (e.g., shape, size, color) (Fodor, ; Fodor et al., ; Reverberi et al., ; Frankland & Greene, ; Russin et al., ; Franklin & Frank, ; Goodman et al., ).
Motivated by this perspective, the ability to compositionally generalize to entirely unseen, out-of-distribution problems has been deemed a desirable property for machine learning systems, leading to decades of research on the topic (Smolensky, ; Lake & Baroni, ; Hupkes et al., ; Ramesh et al., ; Rombach et al., ; Lake & Baroni, ; Kaur et al., ; Du & Kaelbling, ).

Recent work has shown that modern neural network training pipelines can lead to emergent abilities that allow a model to compositionally generalize when it is trained on a data-generating process that itself is compositional in nature (Lake & Baroni, ; Ramesh et al., ; Okawa et al., ; Lepori et al., ; Arora & Goyal, ; Zhou et al., ; Khona et al., ).
For example, Okawa et al. (); Park et al. () show that text-conditioned diffusion models can learn to identify concepts that constitute the training data and develop abilities to manipulate these concepts flexibly, enabling generations that represent novel compositions entirely unseen during training.
These papers also provide a spectrum of intriguing empirical results regarding a model’s learning dynamics in a compositional task.
For example, they reveal that abilities to manipulate individual concepts are learned in a sequential order dictated by the data-generating process; the speed of learning such abilities is modulated by data-centric measures (e.g., gradient of loss with respect to concept values, such as color of an object); and the most similar composition seen during training often controls performance on unseen compositions.

Figure: Figure 1: Structured Identity Mapping Task and Non-Monotonic Generalization Dynamics. (a) Given the input “blue square apples on a tree with circular yellow leaves,” a multimodal model learns to generate concepts in the following order: “apple,” “blue” (color), and “square” (shape) (example adapted from Li et al. ()). (b) A multimodal synthetic task introduced by Okawa et al. (); Park et al. (). The training set of the task consists of four distinct compositions of concepts, depicted as blue nodes on a cubic graph. A diffusion model is trained on this dataset to systematically study the dynamics of concept learning. With the test prompt “small, blue, triangle,” the diffusion model sequentially learns the correct size, shape, and finally color. (c) In this work, we introduce a structured identity mapping task as the foundation for a systematical and theoretical studying of the dynamics of concept learning. The model is trained on a Gaussian mixture data, where the centroids are positioned at certain nodes of a hypercube (blue dots) and is evaluated on an out-of-distribution test set (red dot). Our theoretical results not only reproduce and explain previously characterized empirical phenomena but also depict a comprehensive picture of the non-monotonic learning dynamics in the concept space and predict a “multiple-descent” curve of the test loss (red curve).
Refer to caption: x1.png

In this work, we aim to demystify the phenomenology of compositional generalization identified in prior work and better ground the problem (or at least a specific variant of it called systematicity) via a precise theoretical analysis.
To that end, we instantiate a simplified version of the compositional generalization framework introduced by Okawa et al. (); Park et al. ()—called the “concept space” (see Fig. 1b)—that is amenable to theoretical analysis.
In brief, a concept space is a vector space that serves as an abstraction of real concepts.
For each concept (e.g., color), a binary number is used to represent its value (e.g., 0 0 for red and $1$ for blue).
In this way, a binary string can be mapped to a tuple (e.g., $(1,0,1)$ might represent “big blue triangle”) and then fed into the diffusion model as a conditioning vector. The model output is then passed through a classifier(^1^11Conceptually, we can think of an idealized perfect classifier here.)which produces a vector indicating how accurately the corresponding concepts are generated (e.g. a generated image of big blue triangle might be classified as $(0.8,0.1,0.9)$). In this way, the process of generation becomes a vector mapping, and a good generator essentially performs as an identity mapping in the concept space.

We argue that in fact the salient characteristic of a concept space is its preemptively defined organization of concepts in a systematic manner, not the precise concepts used for instantiating the framework itself.
Grounded in this argument, we define a learning problem called the Structured Identity Mapping (SIM) task wherein a regression model is trained to learn the identity mapping from points sampled from a mixture of Gaussians with structurally organized centroids (see Fig. 1c).
Through a detailed analysis of the learning dynamics of MLP models, both empirically and theoretically, we find that SIM, despite its simplicity, can both capture the phenomenology identified by prior work and provide precise explanations for it.
Our theoretical findings also lead to novel insights, e.g., predicting the existence of a novel mechanism for non-monotonic learning curves (similar to epochwise double-descent (Nakkiran et al., ), but for out-of-distribution data) in the early phase of training, which we empirically verify to be true by training a text-conditioned diffusion model.
Our contributions are summarized below.

- •
Structured Identity Mapping (SIM): A faithful abstraction of concept space.
We empirically validate our SIM task by training Multi-Layer Perceptrons (MLPs), demonstrating the reproduction of key compositional generalization phenomena characterized in recent diffusion model studies (Okawa et al., ; Park et al., ). Our findings show:
(i) learning dynamics of OOD test loss respect the compositional hierarchical structure of the data generating process;
(ii) the speed at which a model disentangles a concept and learns the capability to manipulate it is dictated by the sensitivity of the data-generating process to changes in values of said concept (called “concept signal” in prior work); and
(iii) network outputs corresponding to weak concept signals exhibit slowing down in concept space. These results also suggest that the structured nature of the data, rather than specific concepts, drove observations reported in prior work.
- •
Theoretical analysis reveals mechanisms underlying learning dynamics of a compositional task.
Building on the successful reproduction of phenomenology with MLPs trained on the SIM task, we further simplify the architecture to enable theoretical analysis. We demonstrate that:
(i) analytical solutions with a linear regression model reproduce the observed phenomenology above, and
(ii) the analysis of a symmetric 2-layer network ($f({\bm{x}};{\bm{U}})={\bm{U}}{\bm{U}}^{\top}{\bm{x}}$) identifies a novel mechanism of non-monotonic learning dynamics in generalization loss, which we term Transient Memorization. Strikingly, we show that the learning dynamics of compositional generalization loss can exhibit multiple descents in its early phase of learning, corresponding to multiple phase transitions in the learning process.
- •
Empirical confirmation of the predicted Transient Memorization phenomenon in diffusion models.
We verify the predicted mechanism of Transient Memorization in text-conditioned diffusion models, observing the non-monotonic evolution of generalization accuracy for unseen combinations of concepts, as predicted by our theory.

In summary, our theoretical analysis of networks trained on SIM tasks provides mechanistic explanations for previously observed phenomenology in empirical works and introduces the novel concept of Transient Memorization. This mechanism is subsequently confirmed in text-conditioned diffusion models, bridging theory and practice in compositional generalization dynamics.

## 2 Preliminaries and Problem Setting

Throughout the paper, we use bold lowercase letters (e.g., ${\bm{x}}$) to represent vectors, and use bold uppercase letters (e.g., ${\bm{A}}$) to represent matrices. We use the unbold and lowercase version of corresponding letters with subscripts to represent corresponding entries of the vectors or matrices, e.g., $x_{i}$ represent the $i$-th entry of ${\bm{x}}$ and $a_{i,j}$ represent the $(i,j)$-th entry of ${\bm{A}}$. For a vector ${\bm{x}}$ and a natural number $k$, we use ${\bm{x}}_{:k}$ to represent the $k$-dimensional vector that contains the first $k$ entries of ${\bm{x}}$.
For a natural number $k$, we use $[k]$ to represent the set $\{1,2,\ldots,k\}$, and ${\bm{1}}_{k}$ to represent a vector whose entries are all 0 0 except the $k$-th entry being $1$; the dimensionality of this vector is determined by the context if not specified.
In the theory part, we frequently consider functions of time, denoted by variable $t$. If a function $g(t)$ is a function of time $t$, we denote the derivative of $g$ with respect to $t$ by $\dot{g}(t_{0})=\left.\frac{\mathrm{d}g}{\mathrm{d}t}\right|_{t=t_{0}}$. Moreover, we sometimes omit the argument $t$, i.e., $g$ means $g(t)$ for a time $t$ determined by the context.
For a statement $\phi$, we define $\mathbbm{1}_{\{\phi\}}=\begin{cases}1&\phi\text{ is true}\\
0&\phi\text{ is false}\end{cases}$ to be the indicator function of that statement.

### 2.1 Problem Setting

Now we formally define SIM, which is an abstraction of the concept space. For each concept class, we model them as a Gaussian cluster in the Euclidean space, placed along a unique coordinate direction. The distance between the cluster mean and the origin represents the strength of the concept signal, and the covariance of the Gaussian cluster represents the data diversity within the corresponding concept class. Additionally, we allow more coordinate directions than the clusters, meaning that some coordinate directions will not be occupied by a cluster, which we call non-informative directions, and they correspond to the free variables in the generalization task. See Fig. 1c for an illustration of the dataset of SIM.

Training Set. Let $d\in\mathbb{N}$ be the dimensionality of the input space and $s\in[d]$ be the number of concept classes, i.e., there are $s$ Gaussian clusters, and $n\in\mathbb{N}$ number of samples from each cluster.
The training set $\mathcal{D}=\bigcup_{p\in[s]}\left\{{\bm{x}}_{k}^{(p)}\right\}_{k=1}^{n}$ is generated by the following process: for each $p\in[s]$, each training point of the $p$-th cluster is sampled i.i.d. from a Gaussian distribution ${\bm{x}}_{k}^{(p)}\sim\mathcal{N}\left[{\mu_{p}\bm{1}}_{p},\mathop{\mathrm{
diag}}\left({\bm{\sigma}}\right)^{2}\right]$, where $\mu_{p}\geq 0$ is the distance of the $p$-th cluster center from the origin, and ${\bm{\sigma}}$ is a vector with only the first $s$ entries being non-zero, and $\sigma_{i}^{2}$ describing the data variance on the $i$-th direction.
There is also optionally a cluster centered at ${\bm{0}}$.

Loss function. The training problem is to learn identity mapping on $\mathbb{R}^{d}$. For a model $f:\mathbb{R}^{m}\times\mathbb{R}^{d}\to\mathbb{R}^{d}$ and a parameter vector ${\bm{\theta}}\in\mathbb{R}^{m}$, we train the model parameters ${\bm{\theta}}$ via the mean square error loss.

$$ $\displaystyle\mathcal{L}({\bm{\theta}})=\frac{1}{2sn}\sum_{p=1}^{s}\sum_{k=1}^ {n}\left\|f\left({\bm{\theta}};{\bm{x}}_{k}^{(s)}\right)-{\bm{x}}_{k}^{(s)} \right\|^{2}.$ (2.1) $$

Evaluation. We evaluate the model at a Gaussian cluster centered at the point that combines the cluster means of all training clusters. When the variance of the test set is small, the expected loss within the test cluster is approximately equivalent to the loss at its cluster mean. Therefore, for simplicity, in this paper, we focus on the loss at the mean of the test cluster, which is a single test point $\widehat{\bm{x}}=\sum_{p=1}^{s}\mu_{p}{\bm{1}}_{p}$. We emphasize this point is outside of the training distribution—not just the training data, necessitating out-of-distribution generalization. In App. B, we report further results for the case of various combinations of training clusters, which leads to multiple OOD test points.

## 3 Observations on the SIM Task

We first begin by summarizing our key empirical findings on the SIM task. In all experiments we use MLP models of various configurations, including different number of layers and both linear and non-linear (specifically, ReLU) activations.
Throughout this section and the subsequent sections, we frequently consider the model output at the test point $\widehat{\bm{x}}$ over training time, which we call output trajectory of the model.

Due to space constraints, we only present the results for a subset of configurations in the main paper and defer other results to App. F.
We note that the findings reported in this section are in one-to-one correspondence with results identified using diffusion models in Sec. 5 and prior work (Park et al., ).

### 3.1 Generalization Order Controlled by Signal Strength and Diversity

One interesting finding from previous work is that if we alter the strength of one concept signal from small to large, the contour of the learning dynamics would dramatically change (Park et al., ).
Moreover, it is also commonly hypothesised that with more diverse data, the model generalizes better (Gong et al., ; Díez-Pastor et al., ).
Recall that in the SIM task, the distance $\mu_{k}$ of each cluster represents the corresponding signal strength, and the variance $\sigma_{k}$ represents the data diversity.
In Fig. 2, we present the output trajectory under the setting of $s=2$, in which case the trajectory can be visualized in a plane. There are two components to be learned in this task and, from the contour of the curve, we can tell the order of different components being learned.

Figure: Figure 2: Learning dynamics of MLP on SIM task. The figures show the output trajectory of the MLP on a two-dimensional setting (i.e., $s=2$), and each marker represents an optimization timepoint. Notice that we only plot the center of the training set as a circle, but the actual training set can have varied shapes based on the configuration of ${\bm{\sigma}}$. (a) one-layer linear model with ${\bm{\sigma}}_{:2}=(.05,.05)$ and varied ${\bm{\mu}}$. Concepts $i$ with larger signal ($\mu_{i}$) learnt first. (b) one-layer linear model with ${\bm{\mu}}_{:2}=(1,2)$ and varied ${\bm{\sigma}}$. Concepts $i$ with larger diversity ($\sigma_{i}$) learnt first. (c) $4$ layer linear models under different dimensionality. high dim: $d=64$, low dim: $d=2$. Notice that (a) and (b) are both in high dim setting. The lower the dimensionality, the stronger Transient Memorization it has.
Refer to caption: x2.png

Fig. 2 (a) presents the output trajectory for a setting with a fixed and balanced ${\bm{\sigma}}$, and a varied ${\bm{\mu}}$. The results show that when $\mu_{1}<\mu_{2}$, the dynamics exhibit an upward bulging, indicating a preference for the direction of stronger signal. As $\mu_{1}$ is gradually increased, this contour shifts from an upward bulging to a downward concaving, and consistently maintains the stronger signal preference.

In Fig. 2 (b), the ${\bm{\mu}}$ is fixed to an unbalanced position, with one signal stronger than the other. As we mentioned above, when ${\bm{\sigma}}$ is balanced, the model will first move towards the cluster with a stronger signal strength. However, when the level of diversity of the cluster with weaker signal is gradually increased, the preference of the model shifts from one cluster to another.

A very concrete conclusion can be thus drawn from the results in Fig. 2 (a) and (b): the generalization order is jointly controlled by the signal strength and data diversity, and, generally speaking, the model prefers direction that has a stronger signal and more diverse data. We note that the conclusion here is more qualitative and in Sec. 4, we provide a more precise quantitative characterization of how these two values control the generalization order.

### 3.2 Convergence Rate Slow Down In Terminal Phase

In Fig. 2, the arrow-like markers on the line indicate equal training time intervals.
In the later phase of training, we observe that the arrows get denser, indicating a slowing down of the learning dynamics.
A close examination of the markers in Fig. 2 suggests that the deceleration is not determined by the distance of the current output to the target point (i.e. the loss value), but more depends on the data and training time.
That is, there is a timescale determined by the training data such that if the model does not achieve OOD generalization within that period, significantly more computation will be required for the model to achieve it.
This effect can be observed in Fig. 2 (b) by comparing the output trajectories of ${\bm{\sigma}}=(0.05,0.05)$ case and the ${\bm{\sigma}}=(2,0.05)$ case. The trajectory with the lower concept signal (i.e. ${\bm{\sigma}}=(0.05,0.05)$) yields insufficient OOD generalization until the dynamics slows down and thus requires many more time to approach the target point.

### 3.3 Transient Memorization

The results in Fig. 2 (a) and (b) are both performed with one-layer models and under a high dimensional setting ($d=64$). Despite the overall trend being similar in other settings, it is worth exploring the change of trajectory as we increase the number of layers, and / or reduce the dimension.

Figure: Figure 3: The test loss of multi-layer models.
Refer to caption: x5.png

In Fig. 2 (c), we perform experiments with deeper models, and optionally with a lower dimension. Under these changes, we find that the model shows an interesting irregular behavior, where it initially heads towards the OOD test point, but soon turns toward the training set cluster with the strongest signal.
This indicates the model, while seems to be generalizing OOD at the beginning, is memorizing the train distribution and unable to generalize OOD at this point.
However, with enough training, we find the model start to again move towards the test point and thus generalizes OOD. We call this overall dynamic of the output trajectory Transient Memorization, which we could be suggestive of a non-monotonic test loss curve (similar to epoch-wise double-descent (Nakkiran et al., ; Olmin & Lindsten, ), but with an OOD test loss).
To assess this further, we track the value of the loss function during training in Fig. 3, demonstrating a double-descent-like curve.
We emphasize though that Transient Memorization is a distributional phenomenon and is different from what was called (epochwise) double-descent, i.e., the model memorizes the training distribution and is hence unable to generalize well OOD, while double-descent involves classical overfitting to the training data itself, affecting model’s in-distribution generalization.
We also note that the *Transient Memorization* phenomena seems to be strongest when dimensionality $d$ of the dataset is low, and is rather modest with high dimensional settings. In the high dimensional setting, the OOD loss descent slows down at some point but does not actually exhibit non-monotonic behavior. This low dimensional preference can also be explained perfectly by our theory, further described in Sec. 4.

## 4 Theoretical Explanation

We next study the training dynamics of a specific class of linear models that are tractable on the SIM task and explain the empirical phenomenology of OOD learning dynamics seen in previous section. In Sec. 4.1, we first analyze a one-layer model whose dynamics can be solved analytically. We show that it can explain most phenomena observed in the experiment; however, it fails to reproduce Transient Memorization, suggesting that Transient Memorization is intrinsic to deep models, which highlights the fundamental difference between shallow and deep models. In Sec. 4.2, we further analyze the dynamics of a symmetric 2-layer linear model, which successfully captures Transient Memorization. Our theoretical results reveal a multi-stage behavior of the model Jacobian during training, which leads to the non-monotonic behavior in model output. We show that each stage in the Transient Memorization precisely corresponds to each stage in the Jacobian evolution.

Throughout this section, we assume ${\bm{f}}({\bm{\theta}};{\bm{x}})$ is a linear function of ${\bm{x}}$. In this case the Jacobian of ${\bm{f}}$ with respect to ${\bm{x}}$ is a matrix that is completely determined by ${\bm{\theta}}$, which we denote by ${\bm{W}}_{{\bm{\theta}}}=\frac{\partial f({\bm{\theta}};{\bm{x}})}{\partial{
\bm{x}}}$. In this way, the output of the model can be written as ${\bm{f}}({\bm{\theta}};{\bm{x}})={\bm{W}}_{{\bm{\theta}}}{\bm{x}}$. Using the trace trick (with detailed calculations provided in Sec. C.1), it is easy to show that the overall loss function is equal to

$$ $\displaystyle\mathcal{L}({\bm{\theta}})=\frac{1}{2}\left\|\left({\bm{W}}_{{\bm {\theta}}}-{\bm{I}}\right){\bm{A}}^{1/2}\right\|_{\mathcal{F}}^{2},$ (4.1) $$

where ${\bm{A}}=\frac{1}{sn}\sum_{p=1}^{s}\sum_{k=1}^{n}{\bm{x}}_{k}^{(p)}{\bm{x}}_{k
}^{(p)\top}$ is the empirical covariance. In this section, we assume $n$ is large, in which case ${\bm{A}}$ converges to the true covariance of the dataset ${\bm{A}}=\mathbb{E}_{{\bm{x}}\sim\mathcal{D}}[{\bm{x}}{\bm{x}}^{\top}]$, which is a diagonal matrix ${\bm{A}}=\mathop{\mathrm{diag}}({\bm{a}})$, defined by $a_{p}=\begin{cases}\sigma_{p}^{2}+\frac{\mu_{p}^{2}}{s}&p\leq s\\
0&p>s\end{cases}$, for any $p\in[d]$.

##### Remark.

Notice that in the linear setting we might not directly train ${\bm{W}}_{{\bm{\theta}}}$; instead, we train its components.
For example, we might have ${\bm{\theta}}=({\bm{W}}_{1},{\bm{W}}_{2})$ and have $\bm{W}_{{\bm{\theta}}}={\bm{W}}_{1}{\bm{W}}_{2}$.
Then, what we actually train is ${\bm{W}}_{1}$ and ${\bm{W}}_{2}$, instead of ${\bm{W}}_{{\bm{\theta}}}$. As many previous works have emphasized (Arora et al., ; Ji & Telgarsky, ; Arora et al., ; Advani et al., ), although the deep linear model has the same capacity as a one-layer linear model, their dynamics can be vastly different and the loss landscape of deep linear models can be non-convex.

### 4.1 A One-Layer Model Theory and Its Limitations

As a warm-up, we first study the dynamics of one-layer linear models, i.e., $f({\bm{W}};{\bm{x}})={\bm{W}}{\bm{x}}$, in which case the Jacobian ${\bm{W}}_{\bm{\theta}}$ is simply ${\bm{W}}$. As we will show, this setting can already explain most of the observed phenomenology from the previous section including the order of generalization and the terminal phase slowing down, but fails to capture the Transient Memorization, which we will explore in next subsection. Here we present Theorem 4.1, which gives the analytical solution of the one-layer model on the SIM task.

###### Theorem 4.1 .

Let ${\bm{W}}(t)\in\mathbb{R}^{d\times d}$ be initialized as ${\bm{W}}(0)={\bm{W}}^{(0)}$, and updated by $\dot{\bm{W}}=-\nabla\mathcal{L}(W)$,
with $\mathcal{L}$ be defined by eq. 4.1 with $f({\bm{W}},{\bm{z}})={\bm{W}}{\bm{z}}$, then we have for any ${\bm{z}}\in\mathbb{R}^{d}$,

$$ $\displaystyle f({\bm{W}}(t),{\bm{z}})_{k}=\underbrace{\mathbbm{1}_{\{k\leq s\} }\left[1-\exp\left(-a_{k}t\right)\right]z_{k}}_{\widetilde{G}_{k}(t)}+ \underbrace{\sum_{i=1}^{s}\exp\left(-a_{i}t\right)w_{k,i}(0)z_{i}}_{\widetilde {N}_{k}(t)}.$ (4.2) $$

See Sec. C.2 for proof of Theorem 4.1. The Theorem shows that the $k$-th dimension of the output of a one-layer model evaluated on the test point $\widehat{\bm{x}}$ can be decomposed into two terms: the growth term $\widetilde{G}_{k}(t)=\mathbbm{1}_{\{k\leq s\}}\left[1-\exp\left(-a_{k}t\right)
\right]\mu_{k}$, and the noise term $\widetilde{N}_{k}(t)=\sum_{i=1}^{s}\exp\left(-a_{i}t\right)w_{k,i}(0)\mu_{i}$. The following properties can be observed for these two terms: (i) the growth term converges to $\mu_{k}$ when $k\leq s$ and 0 0 when $k>s$, while the noise term converges to 0 0; (ii) both terms converge at an exponential rate; and (iii) the noise term is upper bounded by $\sum_{i=1}^{s}w_{k,i}(0)\mu_{i}$.
If the model initialization is small in scale, specifically $w_{k,i}(0)\ll\frac{1}{s\max_{i\in[s]}\mu_{i}}$, then $\widetilde{N}_{k}(t)$ will always be small, and thus can be omitted. With this assumption in effect, the model output is dominated by the growth term. A closer look at the growth term then explains part of the observed phenomenology.

###### Theorem 4.1 .

##### Generalization Order and Terminal Phase Slowing Down.

It can be observed that $\widetilde{G}_{k}(t)$ converges at an exponential rate, which leads an exponential decay of evolution speed and explains the terminal phase slowing down. Moreover, the exponential convergence rate of $\widetilde{G}_{k}(t)$ is controlled by the coefficient $a_{k}=\frac{1}{s}\left(s\sigma_{k}^{2}+\mu_{k}^{2}\right)$. Therefore, the direction with larger $a_{k}$, i.e., larger $\mu_{k}$ and / or $\sigma_{k}$, converges faster, hence explaining the order of generalization to different concepts. The theorem also reveals the proportional relationship between $\mu_{k}$ (concept signal strength) and $\sigma_{k}$ (data diversity).

##### The Limitation of the One Layer Model Theory.

While we have demonstrated that Theorem 4.1 effectively explains both the generalization order and the terminal phase slowing down, in the solution eq. 4.2, the learning of each direction is independent. This independence omits the possible interaction between the dynamics of different directions in deeper models, and leads to monotonic and rather regular output trajectory (this is verified by the experiment results in Sec. 3.1). However, as the experiments in Sec. 3.3 show, when the number of layers becomes larger, the model actually exhibits a non-monotonic trace that can have detours. The theory based on the one-layer model fails in capturing this behavior. In the subsequent subsection, we introduce a more comprehensive theory based on a deeper model, and demonstrate that this model explains all the phenomena observed in Sec. 3, especially the Transient Memorization.

### 4.2 A Symmetric Two-Layer Linear Model Theory

In this subsection, we analyze a symmetric 2-layer linear model, namely $f({\bm{U}};{\bm{x}})={\bm{U}}{\bm{U}}^{\top}{\bm{x}}$, where ${\bm{U}}\in\mathbb{R}^{d\times d^{\prime}}$ and $d^{\prime}\geq d$. We demonstrate that it accurately captures all the observations presented in Sec. 3, and, more importantly, the theory derived from this model provides a comprehensive understanding of the evolution of the model Jacobian and output, offering a clear and intuitive explanation for the underlying mechanism of the model’s seemingly irregular behaviors.
Due to space constraints, we focus on providing an intuitive explanation of the multi-stage behavior of the model Jacobian and output, and defer the formal proofs to the appendix.
It is also worth noting that this symmetric 2-layer linear model is a frequently studied model in theoretical analysis (Li et al., ; Stöger & Soltanolkotabi, ; Jin et al., ), and most existing theoretical results for this model focus on the implicit bias of the solution found, instead of on the non-monotonic behavior during training, which is the focus of our analysis.

For convenience, we denote the Jacobian of $f$ at time point $t$ by ${\bm{W}}(t)={\bm{W}}_{{\bm{U}}(t)}$. The gradient flow update of the $i,j$-th entry of ${\bm{W}}$ is given by

$$ $\displaystyle\dot{w}_{i,j}=$ $\displaystyle\underbrace{w_{i,j}(a_{i}+a_{j})}_{G_{i,j}(t)}-\underbrace{\frac{ 1}{2}w_{i,j}\left[w_{i,i}(3a_{i}+a_{j})+\mathbbm{1}_{\{i\neq j\}}w_{j,j}(3a_{j }+a_{i})\right]}_{S_{i,j}(t)}-\underbrace{\frac{1}{2}\sum_{k\neq i\atop k\neq j }w_{k,i}w_{k,j}(a_{i}+a_{j}+2a_{k})}_{N_{i,j}(t)}.$ (4.3) $$

As noted in eq. 4.3, we decompose the update of $w_{i,j}$ into three terms. We call $G_{i,j}(t)=w_{i,j}(t)(a_{i}+a_{j})$ the growth term, $S_{i,j}(t)=\frac{1}{2}w_{i,j}\left[w_{i,i}(3a_{i}+a_{j})+\mathbbm{1}_{\{i\neq j
\}}w_{j,j}(3a_{j}+a_{i})\right]$ the suppression term, and $N_{i,j}(t)=\frac{1}{2}\sum_{k\neq i\atop k\neq j}w_{k,i}(t)w_{k,j}(t)(a_{i}+a_
{j}+2a_{k})$ the noise term. The name of these terms suggests their role in the evolution of the Jacobian: the growth term $G_{i,j}$ always has the same sign as $w_{i,j}$, and has a positive contribution to the update, so it always leads to the direction that increases the absolute value of $w_{i,j}$; the suppression term $S_{i,j}$ also has the same sign(^2^22Notice that since ${\bm{W}}={\bm{U}}{\bm{U}}^{\top}$ is a PSD matrix, the diagonal entries are always non-negative.) as $w_{i,j}$, but has a negative contribution in the update of $w_{i,j}$, so it always leads to the direction that decreases the absolute value of $w_{i,j}$; and the effect direction of the noise term is rather arbitrary since it depends on the sign of $w_{i,j}$ and other terms. It is proved in Lemma D.8 that under mild assumptions, the noise term will never be too large; for brevity, we omit it in the following discussion and defer the formal treatment of it to the rigorous proofs in App. D.

#### 4.2.1 The Evolution of Entries of Jacobian

In order to better present the evolution of the Jacobian, we divide the entries of the Jacobian into three types: the major entries are the first $s$ diagonal entries, and the minor entries are the off-diagonal entries who are in the first $s$ rows or first $s$ columns, and other entries are irrelevant entries. Notice that the irrelevant entries do not contribute to the output of the test point so we will not discuss them. Moreover, we also divide minor entries into several groups. The minor entries in the $p$-th row or column belongs to the $p$-th group (thus each entry belongs to two groups). See Fig. 4 for an illustration of the division of the entries.

Figure: Figure 4: An illustration of the entries of the Jacobian.
Refer to caption: x6.png

##### Initial Growth.

In this section, we assume $w_{i,j}\forall i,j$ are initialized around a very small value $\omega$ such that $\omega\ll\frac{1}{d\max_{i\in[s]}a_{i}}$ (See Sec. D.1 for specific assumptions). It is evident that when all $w_{i,j}$ are close to $\omega$ (we call this period the initial phase), the growth term is $\Theta(\omega)$, while the suppression term and the noise term are $\Theta(\omega^{2})$.
This suggests that the evolution of $w_{i,j}$ is dominated by the growth term. Therefore, in the initial phase, every value in the Jacobian grows towards the direction of increasing its absolute value, with the speed determined by $a_{i}+a_{j}$. Since we assumed that ${\bm{a}}$ is ordered in a descending order, it is evident that each entry grows faster than those below it or to its right. The Initial Growth stage is formally characterized by Lemmas D.1, D.2 and D.3.

##### First Suppression.

In the Initial Growth stage, the first major entry will be the one that grows exponentially faster than all other entries, making it the first one that leaves the initial phase. Once the first major entry becomes significant and non-negligible, it will effect on the suppression term of all minor entries in the first group. When the difference between $a_{1}$ and $a_{2}$ is large enough, the first major entry is able to flip the growth direction of the first group of minor entries and push their values to 0 0. The suppression stages are characterized by Lemma D.7.

##### Second Growth and Cycle.

Once the suppression of the first group of minor entries takes effect, the second major entry becomes the one that grows fastest. Thus, the second major entry will be the second one that leaves the initial stage. Again, when the second major entry becomes large enough, it will suppress the second group of minor entries and push their value to 0 0. This process continues like this: the growth of a major entry is followed by the suppression of the corresponding group of minor entries, which, in turn, leaves space for the growth of the next major entry. The general growth stages are characterized by Lemma D.4 and the fate of off-diagonal entries is characterized by Lemma D.8.

Figure: Figure 5: The learning dynamics of a symmetric 2-layer linear model. Left: The change of the test loss and the Jacobian entries with time predicted by the theory; Right: the corresponding model output trajectory. The figures are plotted under $s=2$ and all entries of ${\bm{W}}$ are initialized positive.
Refer to caption: x7.png

##### Growth Slow Down and Stop.

Notice that the suppression term of a major entry is also influenced by its own magnitude. Therefore, when a major entries becomes significantly large, it also suppresses itself, leading to the slowing down of its growth. Note that this effect only slows down the growth but will not reverse the direction, since for major entries the suppression term is always smaller than the growth term, until $w_{i,i}$ becomes $1$ where the growth and suppression terms are equal and the evolution stops. The terminal stage of the growth of major entries are characterized by Lemma D.5.

#### 4.2.2 Explaining Model Behavior

Recall that we have $f\left({\bm{U}}(t);\widehat{\bm{x}}\right)_{k}=\sum_{p=1}^{s}w_{k,p}(t)\mu_{p}$. We now explain how the stage-wise evolution of Jacobian described in Sec. 4.2.1 determines the evolution of the model output.

##### Generalization Order and Terminal Phase Slowing Down.

From the discussions in Sec. 4.2.1, by the end of the training, all the major entries converge to $1$ and all minor entries converge to 0 0. The major entries grows in the order of corresponding $a_{p}$, which is determined by $\mu_{p}$ and $\sigma_{p}$, and slows down when approaching the terminal. This explains our observation that directions with larger $\mu_{p}$ and / or $\sigma_{p}$ is learned first, as well as the terminal phase slowing down.

##### Transient Memorization and Non-monotonic Loss Curve.

We argue the Transient Memorization and the non-monotonic loss curve is caused by the multi-stage major growth vs. minor growth / suppression process. Importantly, in certain configurations, minor entries growing towards larger absolute values (which is the incorrect solution) can lead to the decay of the OOD test loss, and cause an “illusion of generalizing” that the output trajectory is moving towards improving OOD generalization. However, this effect is later eliminated by the suppression of the corresponding minor entries, leading to a double (or multiple) descent-like loss curve and a reversal in the output trajectory.

More concretely, consider the first (initial) growth stage as an example. In this stage, for each $k\in[s]$, $f\left({\bm{U}}(t);\widehat{\bm{x}}\right)_{k}$ is dominated by $w_{k,1}(t)\mu_{k}$, since $w_{k,1}$ grows fastest among all the entries in the $k$-th row. If $w_{k,1}$ happens to be initialized positive, then $f\left({\bm{U}}(t);\widehat{\bm{x}}\right)_{k}$ grows towards $1$, which is the correct direction(^3^33Notice that this is true even when $k\neq 1$, i.e. $w_{k,1}$ is a minor entry.), and loss thus decays. Since in a symmetric initialization, each entry has equal chance of being initialized positive or negative, when $s$ is small, it is easy to have many minor entries initialized positive, whose growth contributes to the decaying of loss.
This causes an illusion that the model is going towards the right direction of OOD generalization. After the minor entries of the first group are suppressed, their contribution to the decaying of the loss is canceled, which leads to the output trajectory turning back to the direction of memorizing a training cluster and a transient loss increase.

Fig. 5 presents the loss curve and the Jacobian entry evolution predicted by the theory with a specific initialization. Notice how, as claimed above, the first and second descending of loss accurately corresponds to the initial and second growth of the major entries, and the ascending of the loss corresponds to the suppression of the minor entries. When $s>2$, there are multiple turns of growth and suppression stages and can possibly leads to a multiple-descent-like loss curve, which we confirm and illustrate in Sec. E.1.

##### Remark on Failure Modes.

We note that our theory also provides an explanation on instances when the model fails to achieve OOD generalization when one or more of our assumptions outlined in Sec. D.1 breakdown. A specific case is when a major entry $w_{k,k}$ is overly suppressed by a corresponding minor entry before it can begin to grow, causing the growth term $G_{k,k}$ becomes nearly zero. Consequently, the model output at $\widehat{\bm{x}}$ in that direction converges to 0 0, instead of $\mu_{k}$ as expected. See Sec. E.3 for more discussions and illustrations.

##### Remark on Existing Work.

There has been extensive research on the non-monotonic behavior of linear neural networks (in various settings). We note that existing studies either focus on one-layer networks (Pezeshki et al., ; Heckel & Yilmaz, ) or diagonally initialized networks (Olmin & Lindsten, ; Lampinen & Ganguli, ; Even et al., ; Pesme & Flammarion, ), which essentially make the evolution of each direction decoupled. This decoupling simplifies the learning dynamics and can overlook critical aspects thereof (as we discussed in the preceding subsection). In contrast, our analysis, through a careful treatment of each entry of the Jacobian, does not need to make the diagonal initialization assumption, hence allowing us to capture and characterize the rich behaviors that arise from the interaction between different directions.

## 5 Diffusion Model Results

Tying back to our original motivation of devising an abstraction of *concept space* first explored in text-to-image generative diffusion models, we now aim to verify if our novel theoretical findings can be reproduced in a more involved empirical setup with diffusion models.
To this end, we borrow the setup from Park et al. (); Okawa et al. () and train conditional image diffusion models on two concepts—color and size.

Figure: Figure 6: Main observations reproduced on prompt-to-image diffusion models. (a) Signal strength controls generalization speed and order. (b) Transient Memorization: Diffusion models also undergo a Transient Memorization phase. This induces a double-descent like curve for the concept space MSE. (c) Concept learning gradually slows down. Our theory predicts speed of concept learning slows down at an exponential rate, which broadly matches the experimental results.
Refer to caption: x9.png

Fig. 6 illustrates the three main observations from our theory reproduced with a prompt-to-image diffusion model.
We trained diffusion models to compose two concepts, color and size, as in Park et al. (). See App. G for experimental details. Fig. 6 (a) shows the concept space dynamics of the generated image corresponding to the compositional generalization class (blue, small) throughout model training. We find that the level of concept signal, here corresponding to the difference of class mean pixel values, largely alters the generalization dynamics.
Specifically, we see that the speed and order of compositional generalization is determined by concept signal, and the signal intensity can reverse the order. *The latter is especially important since we show the findings from our theory and the SIM task, where we abstracted concepts into coordinates and Gaussian clusters, generalize to two naturalistic concepts*: color and size.
We also see Transient Memorization occurs in diffusion model training, where the generalization dynamics show a bend towards the concept with stronger signal.
This bend is transient and the generated class eventually converges to the intended concept space coordinate.
Fig. 6 (b) quantifies this further via a concept space MSE metric.
We observe that the concept space MSE has a phase where it increases before entering a generalization phase.
This is well aligned with our findings in Sec. 4.2.
Fig. 6 (c) confirms that the speed of compositional generalization, quantified by the absolute of concept space traversal distance per step, decelerates at an exponential rate, as predicted by our theoretical analysis (Theorem 4.1).

## 6 Conclusion

In this paper, we propose SIM task as a further abstraction of the “concept space” previously explored by Okawa et al. (); Park et al. (). We conduct comprehensive investigation into the behaviors of a regression model trained on SIM, both empirically and theoretically, demonstrating that the learning dynamics on SIM effectively captures the phenomena observed on image generation task, establishing SIM as a basis for studying compositional generalization. We make a comprehensive. Critically, our theoretical analysis uncovers the underlying causes of several phenomena that previously observed on compositional generalizations, as well as predicting new ones that characterizes the multi-stage and non-monotonic learning dynamics, which have been largely overlooked in earlier research. Our diffusion model experiments further verify the validity of our analysis. Additional discussions and potential future work directions can be found in App. E.

## Authors’ Contributions

CFP ran preliminary experiments on vector diffusion. YY, CFP and HT initiated this research and formulated the SIM framework. YY conducted all the MLP experiments on SIM task. YY also derived all the theoretical results, with feedback and suggestions provided by WH. CFP conducted the diffusion model experiments. ESL and HT authored the introduction. YY, MO and HT worked together to produce the visualizations and figures. HT provided supervisory guidance and feedback during the whole project.

## Acknowledgements

Part of the computations in this paper were run on the FASRC Cannon cluster supported by the FAS Division of Science Research Computing Group at Harvard University. CFP gratefully acknowledges the support of Aravinthan D.T. Samuel, Douglas P. Finkbeiner and Cecilia Garraffo.

## Appendix A Related Work

In this section, we provide some context for this paper by reviewing some existing work on compositional generalization and the study of deep linear networks.

##### Compositional Generalization.

Prior work on compositionality has often focused on benchmarking of pretrained models (Thrush et al., ; Andreas, ; Lewis et al., ; Lake & Baroni, ; Yun et al., ; Lepori et al., ; Johnson et al., ; Conwell & Ullman, ; Yuksekgonul et al., ; Schott et al., ; Gokhale et al., ; Valvoda et al., ) or proposition of protocols that allow generation of compositional samples (Du et al., ; ; Liu et al., ; Xu et al., ; Yuksekgonul et al., ; Bugliarello & Elliott, ; Spilsbury & Ilin, ; Kumari et al., ; Du & Kaelbling, ). While perfect compositionality in natural settings is still lacking (Marcus et al., ; Leivada et al., ; Conwell & Ullman, ; ; Gokhale et al., ; Du et al., ; Liu et al., ; Singh et al., ; Rassin et al., ; Feng et al., ; Hutchinson et al., ), several works have demonstrated via use of toy settings that this is unlikely to be an expressibility issue, as was hypothesized, e.g., by Fodor et al. (), since the model can in fact learn to perfectly compose in said toy settings. The ability to compose is in fact rather distinctly emergent (Okawa et al., ; Lubana et al., ) and the model learning it often correlates with distinctive patterns in the learning dynamics, as identified by Park et al. (). We note that there has in fact been some work on understanding compositional generalization abilities in neural networks (Wiedemer et al., ; Udandarao et al., ; Ramesh et al., ), but, unlike us, the focus of these papers is not on the model’s learning dynamics.

##### Learning Dynamics of Deep Linear Networks.

Deep linear networks has been a commonly studied model for learning dynamics, and existing works mostly focus on the final solution found by the model, which primarily concerns the stationary point of the dynamics (Arora et al., ; Ji & Telgarsky, ; Du & Hu, ; Arora et al., ; Advani et al., ). There have also been works that try to characterize the full learning dynamics; however, they generally require the learning of each direction (neuron) to be decoupled (Saxe et al., ; Olmin & Lindsten, ; Lampinen & Ganguli, ; Even et al., ; Pesme & Flammarion, ; Pesme et al., ), which can be realized through a specific initialization choice. The decoupling assumption ignores the interaction between different neurons and highly simplify the dynamics, and as we mentioned in Sec. 4.1, make it unable to capture some important phenomena in practice. The symmetric 2-layer linear model is also a specific model that is frequently studied, especially in matrix sensing (Li et al., ; Stöger & Soltanolkotabi, ; Jin et al., ), and as we noted in Sec. 4.2, current theoretical results of this model focus on the implicit biases in the solutions learned, while our analysis, on the other hand, aims at characterizing the full learning dynamics and focus on its OOD behavior.

## Appendix B Model Compositionally Generalize in Topologically Constrained Order

In this section, we introduce another phenomenon observed on SIM task learning that we do not put in the main paper: the order of compositional generalization happens in a topologically constrained order.

In this section, instead of the single test point $\widehat{\bm{x}}$, we introduce a hierarchy of test points. Specifically, let $\mathcal{I}=\{0,1\}^{s}$ be the index set of test points. For each ${\bm{v}}\in\mathcal{I}$, we define a test point

$$ $\displaystyle\widehat{\bm{x}}^{({\bm{v}})}=\sum_{p=1}^{s}v_{p}\mu_{p}{\bm{1}}_ {p},$ (B.1) $$

and call $\widehat{\bm{x}}^{({\bm{v}})}$ the test point with the index ${\bm{v}}$. Intuitively, the index ${\bm{v}}$ describes which training sets are combined into the current test point. If $\|{\bm{v}}\|=1$ then $\widehat{\bm{x}}^{({\bm{v}})}$ is the center of one of the training clusters.

We assign the component-wise ordering $\preceq$ to the index set $\mathcal{I}$, i.e., for ${\bm{u}},{\bm{v}}\in\mathcal{I}$, we say ${\bm{u}}\preceq{\bm{v}}$ if and only if $\forall i\in[n],u_{i}\leq v_{i}$. It’s easy to see that $\preceq$ is a partial-ordering.

Interestingly, in the SIM experiment, the order of the generalization in different test points strictly follow the component-wise order. This finding can be described formally in the following way: the loss function is an order homomorphism between $\preceq$ on the index set, and $\leq$ on the real number. Let $\ell({\bm{z}})$ be the loss function of the test point ${\bm{z}}$, then we have the following empirical observation:

$$ $\displaystyle\forall{\bm{u}},{\bm{v}}\in\mathcal{I},{\bm{u}}\preceq{\bm{v}} \implies\ell\left(\widehat{\bm{x}}^{(u)}\right)\leq\ell\left(\widehat{\bm{x}}^ {(v)}\right).$ (B.2) $$

Figure: Figure 7: The loss at each test point in different timepoints during training for a $2$-layer MLP with ReLU activation. Each graph represents a timepoint. Each node in the graph represents a test point, with index printed on it, and edges connecting nodes with Hamming distance $1$. The color of the graph represents the loss of corresponding test point. Notice that we truncate the loss at $1$ in order to unify the scale. From lest to right: epoch = $1,3,5$.
Refer to caption: extracted/5917674/figures/topology_order/epoch_1.png

In Fig. 7 we show the loss of each test point in several timepoints, with ${\bm{\mu}}=\left(1,2,3,4\right)$, ${\bm{\sigma}}=\left\{\frac{1}{2}\right\}^{4}$. There is a clear trend that the test points that are on the right of the graph (larger in the component-wise order) will only be learned after all of its predecessors are all learned. We call this phenomenon the topological constraint since the constraint is based on the topology of the graph in Fig. 7.

## Appendix C Proofs and Calculations

In the main text we have omitted some critical proofs and calculations due to space limitation. In this section we provide the complete derivations. Note that we postpone the proof of related theorems of Sec. 4.2 to App. D because of their length.

### C.1 The Loss Function with Linear Model and Infinite Data Limit

In this subsection we derive the transformed loss function eq. 4.1, as well as the expression of the data matrix ${\bm{A}}$. For convenience we denote ${\bm{W}}_{\bm{\theta}}$ by ${\bm{W}}$. We have

$$ $\displaystyle\mathcal{L}({\bm{\theta}})$ $\displaystyle=\frac{1}{2ns}\sum_{p=1}^{s}\sum_{k=1}^{n}\left\|({\bm{W}}-{\bm{I }}){\bm{x}}^{(p)}_{k}\right\|^{2}$ (C.1) $\displaystyle=\frac{1}{2ns}\mathrm{Tr}\left[{\bm{x}}^{(p)\top}_{k}({\bm{W}}-{ \bm{I}})^{\top}({\bm{W}}-{\bm{I}}){\bm{x}}^{(p)}_{k}\right]$ (C.2) $\displaystyle=\frac{1}{2ns}\mathrm{Tr}\left[({\bm{W}}-{\bm{I}})^{\top}({\bm{W} }-{\bm{I}}){\bm{x}}^{(p)}_{k}{\bm{x}}^{(p)\top}_{k}\right]$ (C.3) $\displaystyle=\frac{1}{2}\mathrm{Tr}\left[({\bm{W}}-{\bm{I}})^{\top}({\bm{W}}- {\bm{I}})\frac{1}{ns}{\bm{x}}^{(p)}_{k}{\bm{x}}^{(p)\top}_{k}\right]$ (C.4) $\displaystyle=\frac{1}{2}\mathrm{Tr}\left[{\bm{A}}^{1/2}({\bm{W}}-{\bm{I}})^{ \top}({\bm{W}}-{\bm{I}}){\bm{A}}^{1/2}\right]$ (C.5) $\displaystyle=\frac{1}{2}\left\|\left(\bm{{\bm{W}}}-{\bm{I}}\right){\bm{A}}^{1 /2}\right\|_{\mathcal{F}}^{2}.$ (C.6) $$

Let $\mathcal{G}$ be the data generating process. It can be viewed as two components: first assign one of the $s$ clusters, and then draw a Gaussian vector from a Gaussian distribution in that cluster. Specifically, let ${\bm{x}}$ be an arbitrary sample from the traning set, then the distribuition of ${\bm{x}}$ is equal to

$$ $\displaystyle{\bm{x}}\simeq{\bm{\mu}}^{(\eta)}+\mathop{\mathrm{diag}}({\bm{ \sigma}}){\bm{\xi}},$ (C.7) $$

where $\eta$ is a uniform random variable taking values in $[s]$ and ${\bm{\xi}}\sim\mathcal{N}({\bm{0}},{\bm{I}})$ is a random Gaussian vector that is independent from $\eta$. Here $\simeq$ represents having the same distribution.

When $n\to\infty$, the data matrix ${\bm{A}}$ converges to the true covariance, which is is

$$ $\displaystyle{\bm{A}}$ $\displaystyle\to\mathbb{E}\left({\bm{x}}{\bm{x}}^{\top}\right)$ (C.8) $\displaystyle=\mathbb{E}\left[\left({\bm{\mu}}^{(\eta)}+\mathop{\mathrm{diag}} ({\bm{\sigma}}){\bm{\xi}}\right)\left({\bm{\mu}}^{(\eta)}+\mathop{\mathrm{diag }}({\bm{\sigma}}){\bm{\xi}}\right)^{\top}\right]$ (C.9) $\displaystyle=\mathbb{E}\left({\bm{\mu}}^{(\eta)}{\bm{\mu}}^{(\eta)\top}\right )+\mathbb{E}\mathop{\mathrm{diag}}({\bm{\sigma}}){\bm{\xi}}{\bm{\xi}}^{\top} \mathop{\mathrm{diag}}({\bm{\sigma}})$ (C.10) $\displaystyle=\frac{1}{s}\sum_{p=1}^{s}{\bm{\mu}}^{(p)}{\bm{\mu}}^{(p)\top}+ \mathop{\mathrm{diag}}({\bm{\sigma}})^{2}$ (C.11) $\displaystyle=\frac{1}{s}\sum_{p=1}^{s}\mu_{p}^{2}{\bm{1}}_{p}{\bm{1}}_{p}^{ \top}+\mathop{\mathrm{diag}}({\bm{\sigma}})^{2}$ (C.12) $\displaystyle=\frac{1}{s}\mathop{\mathrm{diag}}\left({\bm{\mu}}\right)^{2}+ \mathop{\mathrm{diag}}({\bm{\sigma}})^{2}.$ (C.13) $$

### C.2 Proof of Theorem 4.1

Since the model is one-layer, the loss function eq. 4.1 becomes

$$ $\displaystyle\mathcal{L}({\bm{W}})=\frac{1}{2}\left\|({\bm{W}}-{\bm{I}}){\bm{A }}^{1/2}\right\|_{\mathcal{F}}^{2},$ (C.14) $$

and the gradient is

$$ $\displaystyle\nabla\mathcal{L}({\bm{W}})=({\bm{W}}-{\bm{I}}){\bm{A}}={\bm{W}}{ \bm{A}}-{\bm{A}}.$ (C.15) $$

We denote the $k$-th row of ${\bm{W}}$ and ${\bm{A}}$ by ${\bm{w}}_{k}$ and ${\bm{A}}_{k}$ respectively. Then we have

$$ $\displaystyle\dot{\bm{w}}_{k}=-{\bm{A}}{\bm{w}}_{k}+{\bm{a}}_{k}.$ (C.16) $$

The solution of this differential equation is

$$ $\displaystyle{\bm{w}}_{k}(t)=\exp\left(-{\bm{A}}t\right)\left[w_{k}(0)-{\bm{A} }^{-1}{\bm{a}}_{k}\right]+{\bm{A}}^{-1}{\bm{a}}_{k},$ (C.17) $$

where we use the convention $0\times\left(0^{-1}\right)=0$ to avoid the non-invertible case of ${\bm{A}}$.

Thus for any ${\bm{z}}\in\mathbb{R}^{d}$ we have

$$ $\displaystyle f({\bm{W}}(t);{\bm{z}})_{k}$ $\displaystyle=\left<{\bm{w}}_{k}(t),{\bm{z}}\right>$ (C.18) $\displaystyle=\left<\left({\bm{I}}-e^{-{\bm{A}}t}\right){\bm{A}}^{-1}{\bm{a}}_ {k},{\bm{z}}\right>+\left<e^{-{\bm{A}}t}w_{k}(0),{\bm{z}}\right>$ (C.19) $\displaystyle=\sum_{p=1}^{d}\frac{1-e^{-a_{p}t}}{a_{p}}\mathbbm{1}_{\{k=p\}}a_ {p}z_{p}+\sum_{i=1}^{d}e^{-a_{i}t}w_{k,i}(0)z_{i}$ (C.20) $\displaystyle=\mathbbm{1}_{\{k\leq s\}}\left(1-e^{-a_{k}t}\right)z_{k}+\sum_{i =1}^{s}e^{-a_{i}t}w_{k,i}(0)z_{i},$ (C.21) $$

and this proves the claim.

## Appendix D Theoretical Analysis of the Two Layer Model

In this section we provide a detailed analysis of the symmetric two-layer linear model described in Sec. 4.2.

In this section we assume a finite step size, i.e., ${\bm{W}}:\mathbb{N}\to\mathbb{R}^{d\times d}$ is initialized by ${\bm{W}}(0)$ and updated by

$$ $\displaystyle\frac{{\bm{W}}(t+1)-{\bm{W}}(t)}{\eta}$ $\displaystyle=-{\bm{U}}(t)\nabla\mathcal{L}({\bm{U}}(t))^{\top}-\nabla\mathcal {L}({\bm{U}}(t)){\bm{U}}(t)^{\top}$ (D.1) $\displaystyle={\bm{W}}(t){\bm{A}}+{\bm{A}}{\bm{W}}(t)-\frac{1}{2}\left[{\bm{A} }{\bm{W}}(t)^{2}+{\bm{W}}(t)^{2}{\bm{A}}+2{\bm{W}}(t){\bm{A}}{\bm{W}}(t)\right].$ (D.2) $$

The update of each entry $w_{i,j}(t)$ can be decomposed into three terms, as we described in the main text:

$$ $\displaystyle\frac{w_{i,j}(t+1)-w_{i,j}(t)}{\eta}=$ $\displaystyle w_{i,j}(t)(a_{i}+a_{j})-\frac{1}{2}\sum_{k=1}^{d}w_{k,i}w_{k,j}( a_{i}+a_{j}+2a_{k})$ (D.3) $\displaystyle=$ $\displaystyle\underbrace{w_{i,j}(t)(a_{i}+a_{j})}_{G_{i,j}(t)}$ (D.4) $\displaystyle-\underbrace{\frac{1}{2}w_{i,j}\left[w_{i,i}(3a_{i}+a_{j})+ \mathbbm{1}_{\{i\neq j\}}w_{j,j}(3a_{j}+a_{i})\right]}_{S_{i,j}(t)}$ (D.5) $\displaystyle-\underbrace{\frac{1}{2}\sum_{k\neq i\atop k\neq j}w_{k,i}(t)w_{k ,j}(t)(a_{i}+a_{j}+2a_{k})}_{N_{i,j}(t)}.$ (D.6) $$

### D.1 Assumptions

We need make several assumptions to prove the results. Below we make several assumptions that all commonly hold in the practice. The first assumption to make is that both the value of $a_{k}$ and the initialization of ${\bm{W}}$ is bounded.

###### Assumption D.1 (Bounded Initialization and Signal Strength) .

There exists $\alpha>0,\gamma>1,\beta>1$ such that

$$ $\displaystyle\forall k,\alpha\leq a_{k}\leq\gamma\alpha,$ (D.7) $\displaystyle\forall i,j,\omega\leq|w_{i,j}(0)|\leq\beta\omega.$ (D.8) $$

The second assumption is that the step size is small enough.

###### Assumption D.2 (Small Step Size) .

There exists a constant $K\geq 20$, such that $\eta\leq\frac{1}{9K\gamma\alpha}$.

Next, we define a concept called initial phase. The definition of initial phase is related to a constant $P>0$.

###### Definition D.1 .

Assume there is a constant $P>0$. For an entry $(i,j)$ and time $t$, if $|w_{i,j}(t)|\leq P\beta\omega$, we say this entry is in initial phase.

As the name suggests, in the initial phase, the entries shouldn’t be too far away from the initialization, and we achieve this by an upper bound of $P$.

###### Assumption D.3 (Small Initial Phase) .

$P\omega\beta\leq 0.4$.

The next assumption to make is that the initialization value (i.e. $\omega$) should not be too large.

###### Assumption D.4 (Small Initialization) .

$$ $\displaystyle\omega\leq\min\left\{\frac{\min\{\kappa-1,1-\kappa^{-1/2}\}}{PK \gamma d\beta^{2}},\frac{1}{\sqrt{2\beta}}\right\}$ (D.9) $$

and $\kappa>1.1$, and $\kappa\leq 1+\frac{1}{2}KC^{-1}$, $P\geq 2$.

Finally, we also assume that the signal strength difference is significant enough.

###### Assumption D.5 (Significant Signal Strength Difference) .

For any $i>j$, we have

$$ $\displaystyle\frac{a_{i}+a_{j}}{2a_{i}}\leq\frac{\log P}{10\kappa^{2}\log\frac {1}{P\beta\omega}+\log P\beta}.$ (D.10) $$

and there exists a constant $C>1$ such that $a_{i}-3a_{j}\geq C^{-1}\alpha$.

###### Assumption D.1 (Bounded Initialization and Signal Strength) .

###### Assumption D.2 (Small Step Size) .

###### Definition D.1 .

###### Assumption D.3 (Small Initial Phase) .

###### Assumption D.4 (Small Initialization) .

###### Assumption D.5 (Significant Signal Strength Difference) .

### D.2 The Characterization of the Evolution of the Jacobian

In this subsection, we provide a series of lemmas that characterize each stage the evolution of the Jacobian matrix ${\bm{W}}$.

The whole proof is based on induction, and in order to avoid a too complicated induction, we make the following assertion, which obviously holds at initialization.

###### Assertion D.1 .

For all $t\in\mathbb{N}$, if $i\neq j$, then the entry $(i,j)$ stays in the initial phase for all time.

We will use D.1 as an assumption throughout the proves and prove it at the end. This is essentially another way of writing inductions.

We have the following corollary that directly followed by D.1.

###### Corollary D.1 .

For all $t\in\mathbb{N}$ and all $i,j$, $|N_{i,j}(t)|\leq 2P\gamma\alpha d\beta^{2}\omega^{2}$.

Now, we are ready to present and prove the major lemmas. The first lemma is to post a (rather loose) upper bound of the value of the entries.

###### Lemma D.1 (Upper Bounded Growth) .

Consider entry $(i,j)$. We have for all $t\in\mathbb{N}$, at timepoint $t$ the absolute value of the $(i,j)$-th entry satisfies

$$ $\displaystyle|w_{i,j}(t)|\leq|w_{i,j}(0)|\exp\left[\eta t(a_{i}+a_{j})\kappa \right].$ (D.11) $$

###### Proof.

Since of the $N_{i,j}$ term we only use its absolute value, the positive case and negative case are symmetric. WLOG we only consider the case where $w_{i,j}(0)>0$ here.

The claim is obviously satisfied at initialization. We use it as the inductive hypothesis. Suppose at timepoint $t\leq T-1$ the claim is satisfied, we consider the time step $t+1$.

Since D.1 guaranteed that every non-diagonal entry is in the initial phase, and the $S_{i,j}$ term has different symbol with $w_{i,j}(0)$, we have

$$ $\displaystyle\left|S_{i,j}(t)+N_{i,j}(t)\right|\leq 2P\gamma\alpha d\beta^{2} \omega^{2}.$ (D.12) $$

We have

$$ $\displaystyle w_{i,j}(t+1)-w_{i,j}(t)$ $\displaystyle\leq\eta w_{i,j}(t)(a_{i}+a_{j})+2P\eta\gamma\alpha d\beta^{2} \omega^{2}$ (D.13) $\displaystyle\leq\eta(a_{i}+a_{j})w_{i,j}(0)\exp\left[\eta t(a_{i}+a_{j}) \kappa\right]+2P\eta\gamma\alpha d\beta^{2}\omega^{2}$ (D.14) $\displaystyle=w_{i,j}(0)\exp\left[\eta t(a_{i}+a_{j})\kappa\right]\left[\eta(a _{i}+a_{j})+\frac{2P\eta\gamma\alpha d\beta^{2}\omega^{2}}{w_{i,j}(0)\exp\left [\eta t(a_{i}+a_{j})\kappa\right]}\right]$ (D.15) $$

From D.4, we have

$$ $\displaystyle\eta(a_{i}+a_{j})+\frac{2P\eta\gamma\alpha d\beta^{2}\omega^{2}}{ w_{i,j}(0)\exp\left[\eta t(a_{i}+a_{j})\kappa\right]}$ $\displaystyle\leq\eta(a_{i}+a_{j})+2P\gamma\alpha d\beta^{2}\omega$ (D.16) $\displaystyle\leq\eta(a_{i}+a_{j})+2(\kappa-1)\eta\alpha$ (D.17) $\displaystyle\leq\kappa\eta(a_{i}+a_{j})$ (D.18) $\displaystyle\leq\exp(\kappa\eta[a_{i}+a_{j}])-1,$ (D.19) $$

thus we have

$$ $\displaystyle w_{i,j}(t+1)$ $\displaystyle\leq w_{i,j}(t)+\left[\exp(\kappa\eta[a_{i}+a_{j}])-1\right]w_{i, j}(t)$ (D.20) $\displaystyle\leq w_{i,j}(0)\exp\left[\eta(t+1)(a_{i}+a_{j})\kappa\right].$ (D.21) $$

∎

Next, we prove that Lemma D.1 is tight in the initial stage of the training, up to a constant $\kappa$ in the exponential term.

###### Lemma D.2 (Lower Bounded Initial Growth) .

Let $T_{1}=\frac{\log P}{2\eta\gamma\alpha\kappa}$. We have for all $t\in[T_{1}]$, at timepoint $t$ every entry $(i,j)$ is in the initial phase, and the absolute value of the $(i,j)$-th entry satisfies

$$ $\displaystyle|w_{i,j}(t)|\geq|w_{i,j}(0)|\exp\left[\eta t(a_{i}+a_{j})\kappa^{ -1}\right]$ (D.22) $$

and $w_{i,j}(t)w_{i,j}(0)>0$.

###### Proof.

Similar to the proof of Lemma D.1, we may just assume $w_{i,j}(0)>0$.

Moreover, we also use the claim as an inductive hypothesis and prove it by induction. Since here the inductive hypothesis states that every entry is in the initial phase, we have

$$ $\displaystyle|S_{i,j}(t)+N_{i,j}(t)|\leq 4\gamma\alpha d\beta^{2}\omega^{2}.$ (D.23) $$

We have

$$ $\displaystyle w_{i,j}(t+1)-w_{i,j}(t)$ $\displaystyle\geq\eta(a_{i}+a_{j})w_{i,j}(0)\exp\left[\eta t(a_{i}+a_{j}) \kappa^{-1}\right]-2P\eta\gamma\alpha d\beta^{2}\omega^{2}$ (D.24) $\displaystyle=w_{i,j}(0)\exp\left[\eta t(a_{i}+a_{j})\kappa^{-1}\right]\left[ \eta(a_{i}+a_{j})-\frac{2P\eta\gamma\alpha d\beta^{2}\omega^{2}}{w_{i,j}(0) \exp\left[\eta t(a_{i}+a_{j})\kappa^{-1}\right]}\right]$ (D.25) $$

From D.4, we have

$$ $\displaystyle\frac{2P\eta\gamma\alpha d\beta^{2}\omega^{2}}{w_{i,j}(0)\exp \left[\eta t(a_{i}+a_{j})\kappa^{-1}\right]}$ $\displaystyle\leq 2P\eta\gamma\alpha d\beta^{2}\omega$ (D.26) $\displaystyle\leq\left(1-\kappa^{-1/2}\right)\eta(a_{i}+a_{j}).$ (D.27) $$

Moreover, notice that when $\kappa>1.1$, for any $x<0.1$, we have $\kappa^{-1/2}x+1\geq e^{\kappa^{-1}x}$. Since D.2 ensured that $\eta\leq\frac{1}{10(a_{i}+a_{j})}$, we have

$$ $\displaystyle w_{i,j}(t+1)$ $\displaystyle\geq w_{i,j}(t)+w_{i,j}(t)\left[\kappa^{-1/2}\eta(a_{i}+a_{j})\right]$ (D.28) $\displaystyle\geq w_{i,j}(t)\exp\left(\eta(a_{i}+a_{j})\kappa^{-1}\right)$ (D.29) $\displaystyle\geq w_{i,j}(0)\exp\left[\eta(t+1)(a_{i}+a_{j})\kappa^{-1}\right].$ (D.30) $$

Finally, from Lemma D.1, we have when

$$ $\displaystyle w_{i,j}(t)$ $\displaystyle\leq|w_{i,j}(0)|\exp\left(\eta t(a_{i}+a_{j})\kappa\right)$ (D.31) $\displaystyle\leq\beta\omega\exp\left(2\eta T_{1}\gamma\alpha\kappa\right)$ (D.32) $\displaystyle=P\beta\omega,$ (D.33) $$

which confirms that every entry $(i,j)$ stays in the initial phase before time $T_{1}$.

∎

Notice that the time bound $T_{1}$ in Lemma D.2 is a uniform one which applies to all entries. For the major entries, we might want to consider a finer bound of the time that it leaves the initial phase. This can be proved by essentially repeating the same proof idea of Lemma D.2.

###### Lemma D.3 (Lower Bounded Initial Growth for Diagonal Entries) .

Consider an diagonal entry $(i,i)$. Let $T_{1}^{(i)}=\frac{\log\frac{P\beta\omega}{w_{i,i}(0)}}{2\eta a_{i}\kappa}$. We have for all $t\in\left[T_{1}^{(i)}\right]$, at timepoint $t$ the entry $(i,i)$ is in the initial phase, and the absolute value of the $(i,i)$-th entry satisfies

$$ $\displaystyle w_{i,i}(t)\geq w_{i,i}(0)\exp\left(2\eta ta_{i}\kappa^{-1}\right).$ (D.34) $$

We omit the proof of Lemma D.3 since it is almost identical to the proof of Lemma D.2, only with replacing $\gamma\alpha$ by $a_{i}$ and $\beta\omega$ by $w_{i,i}(0)$.

Next, we characterize the behavior of one diagonal entry after it leaves the initial phase.

###### Lemma D.4 (Lower Bounded After-Initial Growth for Diagonal Entries) .

Consider a diagonal entry $(i,i)$. If at time $t_{0}$ we have $|w_{i,i}(t_{0})|\geq P\beta\omega$, and for a $\lambda\in(P\beta\omega,1-K^{-1})$, before time $T^{(\lambda)}$ we have $w_{i,i}(t+t_{0})<\lambda$ for all $t\in[T^{(\lambda)}]$, then we have

$$ $\displaystyle w_{i,i}(t+t_{0})\geq w_{i,i}(t_{0})\exp\left[2\eta ta_{i}(1- \lambda)\kappa^{-1}\right].$ (D.35) $$

Moreover, $w_{i,i}(0),w_{i,i}(t_{0}),w_{i,i}(t_{0}+t)\geq 0$.

###### Proof.

Notice that since ${\bm{W}}={\bm{U}}{\bm{U}}^{\top}$ is a PSD matrix, its diagonal entries are always non-negative, this ensures that $w_{i,i}(0),w_{i,i}(t_{0}),w_{i,i}(t_{0}+t)\geq 0$.

For the time after $t_{0}$ and before $t_{0}+T^{(\lambda)}$, we use an induction to prove the claim, with the claim itself as the inductive hypothesis. It clearly holds when $t=1$.

Notice that when $w_{i,j}(t^{\prime})<\lambda$, we have

$$ $\displaystyle G_{i,j}(t^{\prime})-S_{i,j}(t^{\prime})=2a_{i}w_{i,i}(t^{\prime} )\left[1-w_{i,i}(t^{\prime})\right]\geq 2a_{i}w_{i,i}(t^{\prime})(1-\lambda).$ (D.36) $$

Thus we have

$$ $\displaystyle w_{i,i}(t_{0}+t+1)-w_{i,i}(t_{0}+t)$ (D.37) $\displaystyle\geq~{}$ $\displaystyle 2\eta a_{i}(1-\lambda)w_{i,i}(t_{0})\exp\left[\eta t(a_{i}+a_{j} )(1-\lambda)\kappa^{-1}\right]-2P\eta\gamma\alpha d\beta^{2}\omega^{2}$ (D.38) $\displaystyle=~{}$ $\displaystyle w_{i,i}(t_{0})\exp\left[2\eta ta_{i}(1-\lambda)\kappa^{-1}\right ]\left[2\eta a_{i}(1-\lambda)-\frac{2P\eta\gamma\alpha d\beta^{2}\omega^{2}}{w _{i,i}(t_{0})\exp\left[2\eta ta_{i}(1-\lambda)\kappa^{-1}\right]}\right]$ (D.39) $$

Since $\lambda<1-K^{-1}$, and $w_{i,i}(t_{0})\geq 2\beta\omega\geq\omega$, from D.4, we have

$$ $\displaystyle\frac{2P\eta\gamma\alpha d\beta^{2}\omega^{2}}{w_{i,i}(t_{0})\exp \left[2\eta ta_{i}(1-\lambda)\kappa^{-1}\right]}$ $\displaystyle\leq 2P\eta\gamma\alpha d\beta^{2}\omega$ (D.40) $\displaystyle\leq 2K^{-1}\left(1-\kappa^{-1/2}\right)\eta\alpha$ (D.41) $\displaystyle\leq 2\left(1-\kappa^{-1/2}\right)\eta a_{i}(1-\lambda).$ (D.42) $$

Moreover, since D.2 ensured that $\eta\leq\frac{1}{2Ka_{i}(1-\lambda)}\leq\frac{1}{20a_{i}(1-\lambda)}$, using the fact that if $\kappa>1.1$ then $\kappa^{-1/2}x+1\geq e^{\kappa^{-1}x}$ for any $x<0.1$, we can get

$$ $\displaystyle w_{i,i}(t+1)$ $\displaystyle\geq w_{i,i}(t)+w_{i,i}(t)\left[\kappa^{-1/2}2\eta a_{i}(1- \lambda)\right]$ (D.43) $\displaystyle\geq w_{i,i}(t)\exp\left(2\eta a_{i}\kappa^{-1}(1-\lambda)\right)$ (D.44) $\displaystyle\geq w_{i,i}(t_{0})\exp\left[2\eta(t+1)\kappa^{-1}(1-\lambda) \right].$ (D.45) $$

∎

Next, we provide an uniform upper bound (over time) of the diagonal entries. Remember that we mentioned in the gradient flow case, the diagonal term stops evolving when it reaches $1$. In the discrete case, since the step size is not infinitesimal, Lemma D.5
shows that it can actually exceed $1$ a little bit but not too much since the step size is small.

###### Lemma D.5 (Upper Bounded Diagonal Entry) .

For any diagonal entry $(i,i)$ and any time $t$, $0\leq w_{i,i}(t)\leq 1+2K^{-1}$.

###### Proof.

First notice that since ${\bm{W}}(t)$ is PSD, its diagonal entry $w_{i,i}(t)$ should always be non-negative, thus $w_{i,i}(t)\geq 0$ is always satisfied. In the following we prove $w_{i,i}(t)\leq 1+2K^{-1}$.

We use induction to prove this claim. The inductive hypothesis is the claim it self. It is obviously satisfied at initialization. In the following we assume the claim is satisfied at timepoint $t$ and prove it for timepoint $t+1$. Notice that since $K\leq 10$, we have $1+K^{-1}\leq 1+2K^{-1}\leq 2$.

Notice that by D.1 and D.4,

$$ $\displaystyle|N_{i,i}(t)|\leq 2P\gamma\alpha d\beta^{2}\omega^{2}\leq\frac{( \kappa-1)^{2}}{K^{2}\gamma d\beta^{2}}\alpha\leq K^{-1}a_{i}.$ (D.46) $$

If $w_{i,i}(t)\geq 1+K^{-1}$, we have

$$ $\displaystyle G_{i,i}(t)-S_{i,i}(t)$ $\displaystyle=2a_{i}w_{i,i}(1-w_{i,i})\leq-2a_{i}K^{-1}.$ (D.47) $$

Therefore,

$$ $\displaystyle w_{i,i}(t+1)$ $\displaystyle=w_{i,i}(t)+\eta\left[G_{i,i}(t)-S_{i,i}(t)-N_{i,i}(t)\right]$ (D.48) $\displaystyle\leq w_{i,i}(t)-a_{i}K^{-1}\eta$ (D.49) $\displaystyle\leq w_{i,i}(t)$ (D.50) $\displaystyle\leq 1+2K^{-1}.$ (D.51) $$

Moreover, since $w_{i,i}(t)\leq 1+2K^{-1}\leq 2$, we have

$$ $\displaystyle|G_{i,i}(t)|+|S_{i,i}(t)|+|N_{i,i}(t)|$ $\displaystyle\leq 4a_{i}+4a_{i}+K^{-1}a_{i}\leq 9\gamma\alpha\leq\frac{1}{K \eta}.$ (D.52) $$

When $w_{i,i}(t)\leq 1+K^{-1}$, using eq. D.52, we have

$$ $\displaystyle w_{i,i}(t+1)\leq w_{i,i}(t)+\eta\left(|G_{i,i}(t)|+|S_{i,i}(t)|+ |N_{i,i}(t)|\right)$ $\displaystyle\leq 1+2K^{-1}.$ (D.53) $$

The above results together shows that $w_{i,i}(t+1)\leq 1+2K^{-1}$.

∎

###### Corollary D.2 (Upper Bounded Diagonal Update) .

For any diagonal entry $(i,i)$ and any time $t$, $|w_{i,i}(t+1)-w_{i,i}(t)|\leq K^{-1}$.

Corollary D.2 is a direct consequence of Lemma D.5 (and we actually proved Corollary D.2 in the proof of Lemma D.5).

The next lemma lower bounds the final value of diagonal entries. Together with Lemma D.5 we show that in the terminal stage of training the diagonal entries oscillate around $1$ by the amplitude not exceeding $2K^{-1}$.

###### Lemma D.6 .

Consider a diagonal entry $(i,i)$. If at time $t_{0}$ we have $w_{i,i}(t_{0})\geq 1-2K^{-1}$, then for all $t^{\prime}\geq t_{0}$ we have $w_{i,i}(t^{\prime})\geq 1-2K^{-1}$.

###### Proof.

We use an induction here. The inductive hypothesis is the claim itself. This obviously holds when $t^{\prime}=t_{0}$. We assume $w_{i,i}(t^{\prime})\geq 1-2K^{-1}$ at timepoint $t^{\prime}$ and prove the claim for $t^{\prime}+1$.

If $w_{i,i}(t^{\prime})<1-K^{-1}$, then from Lemma D.4 we know

$$ $\displaystyle w_{i,i}(t^{\prime}+1)\geq w_{i,i}(t^{\prime})\geq 1-2K^{-1}.$ (D.54) $$

If $w_{i,i}(t^{\prime})>1-K^{-1}$, then from Corollary D.2 we have

$$ $\displaystyle w_{i,i}(t^{\prime}+1)\geq w_{i,i}(t^{\prime})-K^{-1}\geq 1-2K^{- 1}.$ (D.55) $$

∎

Now, we are ready to prove D.1 by considering the suppression. We first prove a lemma that upper bounds the absolute value of the minor entries after its corresponding major entry becomes significant.

###### Lemma D.7 (Suppression) .

Consider an off-diagonal entry $(i,j)$ where $i>j$. If there exists a time $t_{0}$ such that $w_{i,i}(t_{0})>0.8$, then for any $t^{\prime}\geq t_{0}$ we have

$$ $\displaystyle\left|w_{i,j}(t^{\prime})\right|\leq\max\left\{\left|w_{i,j}(t_{0 })\right|,\omega\right\}.$ (D.56) $$

###### Proof.

Since $K>10$, from Lemma D.6 and Lemma D.4 we know $w_{i,i}(t^{\prime})>0.8$ for all $t^{\prime}\geq t_{0}$.

In this proof, we use an induction with the inductive hypothesis being the claim itself, i.e., we assume the claim is true at timepoint $t^{\prime}$ and prove it for $t^{\prime}+1$. The claim obviously holds for $t^{\prime}=t_{0}$.

Since in this proof we only use the absolute value of $N_{i,j}$, WLOG we may assume that $w_{i,j}(t^{\prime})>0$.

If $w_{i,j}(t^{\prime})<\omega$ then we have proved the claim. In the following we may assume $w_{i,j}(t^{\prime})\geq\omega$.

We have

$$ $\displaystyle G_{i,j}(t^{\prime})-S_{i,j}(t^{\prime})$ $\displaystyle\leq w_{i,j}(t^{\prime})(a_{i}+a_{j})-\frac{1}{2}w_{i,j}(t^{ \prime})w_{i,i}(3a_{i}+a_{j})$ (D.57) $\displaystyle\leq w_{i,j}(t^{\prime})(a_{i}+a_{j})-w_{i,j}(t^{\prime})\left[0. 4(3a_{i}+a_{j})\right]$ (D.58) $\displaystyle=-\frac{1}{5}w_{i,j}(t^{\prime})a_{i}+\frac{3}{5}w_{i,j}(t^{ \prime})a_{j}$ (D.59) $\displaystyle\overset{\text{(i)}}{\leq}-C^{-1}\omega\alpha,$ (D.60) $$

where in (i) we use D.5.

Thus we have

$$ $\displaystyle G_{i,j}(t^{\prime})-S_{i,j}(t^{\prime})-N_{i,j}(t^{\prime})$ $\displaystyle\leq G_{i,j}(t^{\prime})-S_{i,j}(t^{\prime})+|N_{i,j}(t^{\prime})|$ (D.61) $\displaystyle\leq-C^{-1}\omega\alpha+2P\gamma\alpha d\beta^{2}\omega^{2}$ (D.62) $\displaystyle\overset{\text{(i)}}{<}0,$ (D.63) $$

where (i) is from D.4 and D.5. This confirms that $w_{i,j}(t^{\prime}+1)<w_{i,j}(t^{\prime})\leq\max\left\{|w_{i,j}(t_{0}),\omega\right\}$.

Next, we prove $w_{i,j}(t^{\prime}+1)\geq-\max\left\{|w_{i,j}(t_{0})|,\omega\right\}$. Notice that Lemma D.5 stated that $|w_{i,i}|\leq 2$. Notice that we also have $w_{i,j}(t^{\prime})\leq K^{-1}$, thus from D.2,

$$ $\displaystyle|G_{i,j}(t^{\prime})|+|S_{i,j}(t^{\prime})|+|N_{i,j}(t^{\prime})|$ $\displaystyle\leq 10\gamma\alpha|w_{i,j}(t^{\prime})|+2P\gamma\alpha d\beta^{2 }\omega^{2}$ (D.64) $\displaystyle\leq\frac{10|w_{i,j}(t^{\prime})|+2Pd\beta^{2}\omega^{2}}{9K\eta}$ (D.65) $\displaystyle\leq\frac{10|w_{i,j}(t^{\prime})|+2\omega}{9K\eta}$ (D.66) $\displaystyle\leq\frac{|w_{i,j}(t^{\prime})|+\omega}{2\eta}.$ (D.67) $$

We have

$$ $\displaystyle w_{i,j}(t^{\prime}+1)$ $\displaystyle\geq w_{i,j}(t^{\prime})-\eta(|G_{i,j}(t^{\prime})|+|S_{i,j}(t^{ \prime})|+|N_{i,j}(t)^{\prime}|)$ (D.68) $\displaystyle\geq-\eta(|G_{i,j}(t^{\prime})|+|S_{i,j}(t^{\prime})|+|N_{i,j}(t^ {\prime})|)$ (D.69) $\displaystyle\geq-\frac{1}{2}(|w_{i,j}(t^{\prime})|+\omega)$ (D.70) $\displaystyle\geq-\max\{|w_{i,j}(t^{\prime})|,\omega\}.$ (D.71) $$

∎

With all the lemmas proved above, we are now ready to prove D.1.

###### Lemma D.8 ( D.1 ) .

For all $t\in\mathbb{N}$, if $i\neq j$, then the entry $(i,j)$ stays in the initial phase for all time.

###### Proof.

Notice that since ${\bm{W}}$ is symmetric, we only need to prove the claim for $i>j$. Moreover, From Lemma D.7, we only need to prove that there exists a timepoint $t^{*}$, such that $w_{i,i}(t^{*})\geq 0.8$, and $|w_{i,j}(t^{*})|\leq P\beta\omega$.

Let $t_{0}=\frac{\log\frac{P\beta\omega}{w_{i,i}(0)}}{2\eta a_{i}\kappa}$, by Lemma D.3, we have $w_{i,i}(t_{0})\geq P\beta\omega$. By Lemma D.3 and Lemma D.4, we have for any $t\geq t_{0}$ such that $w_{i,i}(t)\leq\lambda$, where $\lambda=0.85$,

$$ $\displaystyle w_{i,i}(t)$ $\displaystyle\geq w_{i,i}(t_{0})\exp\left[0.3\eta(t-t_{0})a_{i}\kappa^{-1}\right]$ (D.72) $\displaystyle\geq P\beta\omega\exp\left[0.3\eta(t-t_{0})a_{i}\kappa^{-1}\right]$ (D.73) $$

Let $t^{\prime}$ be the first time that $w_{i,i}(t^{\prime})$ arrives above $0.8$.
Let $t^{*}=\min\left\{\frac{\kappa\log\frac{0.8}{P\beta\omega}}{0.3\eta a_{i}}+t_{0
},t^{\prime}\right\}\geq t_{0}$. If $t^{*}=t^{\prime}$, we have $w_{i,i}(t^{*})\geq 0.8$. If $t^{*}=\frac{\kappa\log\frac{0.8}{P\beta\omega}}{0.3\eta a_{i}}+t_{0}$, we have

$$ $\displaystyle w_{i,i}(t^{*})$ $\displaystyle\geq w_{i,i}(0)\exp\left(0.3\eta t^{*}a_{i}\kappa^{-1}\right)$ (D.74) $\displaystyle\geq P\beta\omega\exp\left(\log\frac{0.8}{P\beta\omega}\right)$ (D.75) $\displaystyle=0.8.$ (D.76) $$

Moreover, from Lemma D.1 and D.5, we have

$$ $\displaystyle|w_{i,j}(t^{*})|$ $\displaystyle\leq|w_{i,j}(0)|\exp\left[\eta t^{*}\kappa(a_{i}+a_{j})\right]$ (D.77) $\displaystyle\leq\beta\omega\exp\left[\left(\frac{\kappa^{2}\log\frac{0.8}{P \beta\omega}}{0.15}+\log\frac{P\beta\omega}{w_{i,i}(0)}\right)\times\frac{a_{i }+a_{j}}{2a_{i}}\right]$ (D.78) $\displaystyle\leq\beta\omega\exp\left[\left(10\kappa^{2}\log\frac{1}{P\beta \omega}+\log P\beta\right)\times\frac{a_{i}+a_{j}}{2a_{i}}\right]$ (D.79) $\displaystyle\leq\beta\omega\exp\left[\log(P)\right]$ (D.80) $\displaystyle=P\omega\beta.$ (D.81) $$

The claim is thus proved by combining the above bounds on $|w_{i,j}(t^{*})|$ and $w_{i,i}(t^{*})$ with Lemma D.7.
∎

###### Assertion D.1 .

###### Corollary D.1 .

###### Lemma D.1 (Upper Bounded Growth) .

###### Proof.

###### Lemma D.2 (Lower Bounded Initial Growth) .

###### Proof.

###### Lemma D.3 (Lower Bounded Initial Growth for Diagonal Entries) .

###### Lemma D.4 (Lower Bounded After-Initial Growth for Diagonal Entries) .

###### Proof.

###### Lemma D.5 (Upper Bounded Diagonal Entry) .

###### Proof.

###### Corollary D.2 (Upper Bounded Diagonal Update) .

###### Lemma D.6 .

###### Proof.

###### Lemma D.7 (Suppression) .

###### Proof.

###### Lemma D.8 ( D.1 ) .

###### Proof.

## Appendix E Additional Discussions

In this section, we further discuss the findings and theoretical predictions presented in this paper.

### E.1 Multiple Descents

In Fig. 5, we verified our theoretical predictions of the Transient Memorization through an experiment of an $s=2$ example. However, in our theory, there can be multiple growth / suppression stages when $s>2$, which should give us a multiple descent-like curve. We note here that based on the conditions given in Sec. D.1, it is indeed possible to see multiple descent but only with a subtle choice of the signal strengths (${\bm{\mu}}$) and under specific initialization conditions.

In Fig. 9 and 9, we illustrate two settings where the loss curves exhibit epochwise triple and quadruple descent. In both settings we use symmetric 2-layer linear model, same as the model used in Sec. 4.2. Note that we tuned initialization random seed to generate these results. Moreover, since the time scale of each descent vary, we use a log scale for the number of epochs to make the results more apparent.

Figure: Figure 8: An illustration of epochwise triple descent of the symmetric 2-layer linear model. The dataset has dimensionality and number of informative directions $d=s=3$, signal strength values ${\bm{\mu}}=(1.0,1.5,2.2)$, and noise values ${\bm{\sigma}}=(0.05,0.05,0.05)$.
Refer to caption: x10.png

It is worth noting that in Fig. 9 and 9, each major entry starts to grow only after the corresponding minor entry is suppressed (for example in Fig. 9, $w_{2,2}$ starts to grow after $w_{2,3}$ is suppressed, $w_{1,2}$ starts to decay after $w_{2,2}$ is close to $1$, and $w_{1,1}$ starts to grow after $w_{1,2}$ is suppressed), and each ascending / descending stage of loss curve aligns well with a stage of growth / suppression of the minor and major entries. These correspondence match exactly with our theoretical prediction and shows the correctness and preciseness of our theory.

### E.2 The Breakdown of the Initialization Assumption

In Sec. 3.3, we mentioned that Transient Memorization seems to be more significant when the dimensionality of the dataset is low, and in Sec. 4.2.2, we attributed the reason of it to the fact that when the dimensionality of the dataset is small, it’s easier to have more minor entries initialized positive, which lead to an illusion of learning in the minor entry growth stage, whose later suppression leads to the non-monotonic output trajectory behavior of Transient Memorization.

In this section, we note that, another reason for the Transient Memorization to be less significant is that D.4 breaks down when the dimension is high, if we use standard Gaussian initialization to initialize the model weights. Specifically, in D.4, we require that all entries of ${\bm{W}}$ are initialized around a relatively small value $\omega$, which indicates that there is no huge difference between the magnitude of the initialization of major entries and minor entries.

However, notice that ${\bm{W}}={\bm{U}}{\bm{U}}^{\top}$ and thus $w_{i,j}=\left<{\bm{u}}_{i},{\bm{u}}_{j}\right>$, where ${\bm{u}}_{i}\in\mathbb{R}^{d^{\prime}}$ is the $i$-th row of ${\bm{U}}$. If we use Gaussian distribution to initialize ${\bm{U}}$, i.e. ${\bm{u}}_{i}\sim\mathcal{N}\left({\bm{0}},\tau^{2}{\bm{I}}\right)$, where $\tau$ is a small real number, then we have the expectation of $w_{i,j}$ be

$$ $\displaystyle\mathbb{E}w_{i,j}=\begin{cases}0&i\neq j\\ d^{\prime}\tau^{2}&i=j,\end{cases}$ (E.1) $$

which highlights the different between major entries and minor entries in initialization when $d^{\prime}$ is large (and notice that $d^{\prime}$ is lower bounded by $d$, which is the dataset dimensionality). Moreover, when $d^{\prime}$ is small, the variance of $w_{i,j}$ will be large, so there is a greater chance for them to be away from 0 0.

### E.3 Failure Modes

A breakdown in the assumptions in Sec. D.1 can also lead to the model converging to “wrong” solutions that do not fully generalize OOD. For example, if a minor entry happens to be initialized too large (breaking the D.4), and / or the corresponding signal strength distinction is not large enough (breaking the D.5), then it is possible that the minor entry is not suppressed until it grows to a significant value, which can, in turn, lead to a too strong suppression on the corresponding major entry. In this case, a major entry might be suppressed to 0 0 (or at least, leave the initial phase from below) before it starts to grow, and thus never has chance to grow. This case corresponds to the model being “trapped” in a state that it only learns to compositionally generalize to a combination of certain (but not all) concepts.

In Fig. 10, we exhibit a case of such failure mode where the model fails to fully achieve OOD generalization. Notice how the loss value converges to a non-zero value and the major entry $w_{1,1}$ is suppressed at the very beginning and never grows. Additionally, the output trajectory is trapped at a point that combines only two directions, missing the third direction.

Figure: Figure 10: An illustration of a failure case where the model doesn’t successfully generalize OOD. The dataset has $d=s=3$, ${\bm{\mu}}=(0.7,1.7,3)$ and ${\bm{\sigma}}=(0.05,0.05,0.05)$. Left: The evolution of values of Jacobian and the OOD loss evaluated at test point $\hat{\bm{x}}$; Right: The output trajectory (orange curve).
Refer to caption: x12.png

### E.4 Future Directions

We note that, current characterization of the model learning dynamics relies on the critical assumptions in Sec. D.1. Although those assumptions are reasonable and common in practice, the model behavior still shows some regularity when those assumptions breakdown. We have discussed some of the possible consequences when one of those assumptions breakdown above, but more in an intuitive way, instead of a systematic way. Therefore, one important future direction is to establish a systematic characterization of what will happen when the assumptions given in Sec. D.1 breakdown. Among which, one specific and very important topic is the failure modes, i.e. determining under what conditions the model will fail to generalize OOD.

Another important direction is to generalize current analysis to more complex models, such as deep linear networks or two-layer ReLU networks. The key point of current analysis of the 2-layer symmetric model is to correctly slice the learning dynamics of each entry of the Jacobian into multiple stages, such that in each stage, the learning dynamics is dominated by a rather simple dynamics.

Currently, since the model is 2-layer and without bias terms, there are only first-order and second-order terms in the learning dynamics. However, if we consider deeper models, there might be higher-order terms in the dynamics, and it is important to identify and simplify the effect these higher-order interactions in order to make the problem tractable.

For ReLU networks, it is known that there will be an “early-alignment” stage when trained on linear-separable data (Maennel et al., ; Min et al., ), where each neuron converge to a fixed direction, and make the model behaves like a linear model. We claim that investigating the early-alignment of 2-layer ReLU networks on the SIM task can be the starting point of theoretically characterizing the behavior of ReLU networks on the SIM task.

## Appendix F Additional SIM Experiment Details and Results

In this section, we present the results of SIM experiments under different settings, including linear and non-linear models. The consistent behavior observed across these settings confirms the universality of our findings and explanations.

### F.1 Experiment Details

In all SIM experiments, including those presented in main paper and in appendix, the number of training samples in each Gaussian cluster is $5000$. We use MLP models with either linear activations or ReLU activations, and all the models are trained using stochastic gradient descent with a batch size of $128$ and a learning rate of $0.1$ for $40$ epochs. Unless otherwise specified, the dimensionality of all data points is $d=64$, and the hidden layer dimensionality of the models is also $64$ by default.

It is important to note that in our theory, we assumed that all training clusters and the test point are aligned with the standard coordinate. However, in our experiments, in order to make the results more universal and general, we add a random rotation to all the train / test points.

### F.2 Additional Experiment Results

Fig. 11 and Fig. 12 repeat the learning order experiments described in Sec. 3.1, using a 2-layer model with and without ReLU activation, respectively. It is easy to see that despite showing more non-regular curves, in multi-layer models the overall trends described in Sec. 3.1 and Sec. 3.2 are preserved.

Figure: Figure 11: Output trajectory of 2-layer models with linear activations. The number of informative directions in the dataset is $s=2$. Left: ${\bm{\mu}}_{:2}=(1,2)$ with varied ${\bm{\sigma}}$’s; Right: ${\bm{\sigma}}_{:2}=(0.05,0.05)$ with varied ${\bm{\mu}}$’s.
Refer to caption: x14.png

Figure: Figure 12: Output trajectory of 2-layer models with ReLU activations. The number of informative directions in the dataset is $s=2$. Left: ${\bm{\mu}}_{:2}=(1,2)$ with varied ${\bm{\sigma}}$ values; Right: ${\bm{\sigma}}_{:2}=(0.05,0.05)$ with varied ${\bm{\mu}}$ values.
Refer to caption: x16.png

Figure: Figure 13: Output trajectory of 3-layer models with linear activations and $3$ hidden dimensions. The dataset has dimensionality $d=3$, number of informative directions $s=2$ and variance ${\bm{\sigma}}_{:2}=(0.05,0.05)$. Left: ${\bm{\mu}}_{:2}=(1,2)$; Right: ${\bm{\mu}}_{:2}=(2,4)$.
Refer to caption: x18.png

Figure: Figure 14: The loss curve of corresponding models in Fig. 13. Small $\mu$: ${\bm{\mu}}_{:2}=(1,2)$; Large $\mu$: ${\bm{\mu}}_{:2}=(2,4)$.
Refer to caption: x20.png

In Fig. 14, we present the output trajectory for two settings that exhibit significant Transient Memorization and Fig. 14 the corresponding loss curve. Specifically, the dataset has a dimensionality of $d=3$, and is not randomly rotated. The models used have $3$ layers, $3$ hidden dimensions and linear activations. Comparing these results with the curve presented in Fig. 11, Fig. 12 and in Fig. 2, it is evident that models with more layers and fewer input dimensions are easier to have Transient Memorization, which confirms our theoretical prediction in Sec. 4.2.2.

## Appendix G Diffusion Model Experiments

We describe experimental details for the diffusion model experiments. We largely follow Park et al. () in these experiments.

### G.1 Synthetic Data

Figure: Figure 15: Data Generation process with different concept signals. Figure from (Park et al., ). The data generating processed used to train the diffusion model, where we can control the strength of the two concept signals independently. Left: A data distribution with a stronger concept signal in the color dimension. Right: A data distribution with a stronger concept signal in size.
Refer to caption: x21.png

Fig. 15 illustrates the DGP. We borrow part of the compositional data generating process (DGP) introduced by in Park et al. (). The DGP generates a set of images of circles based on the *concept variables* color=$\{\text{{red}},\text{{blue}}\}$ and size=$\{\text{{big}},\text{{small}}\}$. Each concept variable can be selected as composed to yield four classes 00, 01, 10, 11 respectively corresponding to (red, big), (red, small), (blue, big), (blue, small). Here, class average pixels values of red and blue colors will control the concept signal for color and the difference between small and big. In Fig. 6, we fix the big circle’s diameter to $70\%$ of the image and the small circle’s diameter to $30\%$ of the image. We then adjust the absolute difference between the blue color and red color from 0.2 (very similar colors) to 0.7 (very different colors). The DGP randomizes the location of the circle, the background color and adds some noise to avoid having a very narrow data distribution. Please refer to Park et al. () for further detail.

In Fig. 15, we show two different data distributions, one with a big color concept signal and one with a big size concept signal.

### G.2 Model & Training

We train a conditional diffusion model on the synthetic data defined above. In specific, we train a variational diffusion model (Kingma et al., ) to generate $3\times 32\times 32$ images conditioned on a 4-dimensional vector where the first element of the vector specifies the size of the circle and the 3 others specifies the RGB colors.

##### Model Architecture

We use a conditional U-Net (Ronneberger et al., ) with hidden dimensions $[64,128,256]$ before each downsampling layer and two ResNet (He et al., ) layers in each level. The conditioning vector is first transformed into the same dimensions as the hidden dimensions using a 2-layer MLP and are added to the representation after every downsampling layer. The U-Net has a self attention layer (Dosovitskiy et al., ) in its bottleneck. We used LayerNorm (Ba et al., ) for normalization layers and GELU (Hendrycks & Gimpel, ) activations.

##### Diffusion

We use a learned linear noise schedule for the diffusion process as defined in Kingma et al. (), initialized with $\gamma_{\max}=10,\>\gamma_{\min}=-5$. We assume a data noise of $1\times 10^{-3}$. Variational diffusion models do not require fixing the number of diffusion steps at training time, but we use 100 steps for generation at inference time.

##### Training

We train our model with the AdamW optimizer (Loshchilov & Hutter, ) with learning rate $1\times 10^{-3}$ and weight decay $0.01$. We use a batch size of 128 and train for $20$k steps.

### G.3 Evaluation

We evaluate the concept space representation of the generated output image using a trained classifier. Since we have the ground truth DGP, we used a large amount of data to train a perfect classifier. We used a U-Net backbone followed by a max pooling layer and a MLP classifier to classify each concept variable color and size. We train this classifier for $10$k steps and achieve a 100% accuracy on a held out test set. We average over 32 generated images and 5 model run seeds to get the ensemble average concept space representation.

The concept space MSE in Fig. 6 (b) is simply calculated as the MSE distance in the concept space defined in Park et al. (). The concept learning speed $|\mathrm{d}C/\mathrm{d}t|$ is quantified by estimating the movement speed in the same concept space by a finite difference method.

## Peer Reviews

confidence: 4
contribution: 3
initial_rating: 8
presentation: 2
questions: # Questions
- LL86: "The model output is then passed through a classifier which produces a vector indicating how accurately the corresponding concepts are generated (e.g. a generated image of big blue triangle might be classified as (0.8, 0.1, 0.9)). In this way, the process of generation becomes a vector mapping, and a good generator essentially performs as an identity mapping in the concept space." In this setup, the vector mapping is $c \circ g$, comprising the generator $g$ _and_ classifier $c$. While it is clear that a good generator should be the identity, the role of the classifier also has to be analyzed. Can we be sure a priori, that $c$ is an identity mapping?
- How is training done? Is a fixed number of points sampled in the beginning to be used as a training set, or are points instead drawn for each batch?
- LL193: Why is $\mu_k$ equated with signal strength? Intuitively, instead of the absolute value of $\mu_k$, the distance between clusters should be more meaningful, which might be high for an individual cluster even if $\mu_k$ is low.
    - it is also not clear why this should matter to the model. The model could simply normalize each input dimension such that inputs are always balanced, e.g., in the task of Fig. 2b
- App. B: This observation mainly seems to imply that test loss _increases with the distance from the training set_, which, again does not say anything about OOD generalization or compositional generalization, and instead is a clear effect of the increasing probability density of the training set.
    - Also, why is the loss truncated instead of normalized?

# Minor Suggestions
- Fig. 1 and LL73 show that the data is clustered around nodes of the hypercube, yet LL150 and LL160 explain that each cluster has a different $\mu_p$ (distance from the origin). How do these statements fit together?
- L163 “There is also optionally a cluster centered at 0.” Is this in addition to the $s$ clusters, or is this just specifying that $\mu_p$ might be 0?
- LL170: "We evaluate the model at a Gaussian cluster centered at the point that combines the cluster means of all training clusters." What does this mean? Say the test cluster is $\boldsymbol x_k^\text{test} \sim \mathcal N(\boldsymbol \mu_\text{test}, \boldsymbol \sigma_\text{test}^2)$, does this just mean that $\boldsymbol \mu_\text{test}$ is the mean of all $\mu_p \boldsymbol 1_p$? 
- §3.1 and Fig. 2: What are the markers at each optimization timepoint? The model output for the given input $\boldsymbol x = \boldsymbol \mu$?
soundness: 3
strengths: This work studies a relevant problem: The learning dynamics of compositional generalization in diffusion models are important to understand how models can learn in a sample-efficient manner, how generalization can be achieved, or how training data should be curated, to name a few ways insights could be impactful.

The paper is easy to follow for the most parts and builds on a prior line of work in this area.

The non-monotonic training dynamics of a symmetric two-layer linear model are well explained by the theory and offer a novel (as far as I can tell) characterization of the training behavior of basic models. The theoretical training dynamics outlined in §4 and especially §4.2 and Fig. 5 model the empirical observations from §3 and Fig. 2 well.
summary: The paper sets out to explain previously reported characteristics of the learning dynamics of text-conditioned diffusion models with respect to  their ability to compose concepts to generalize to unseen combinations. Specifically, the paper aims to study why models learn concepts in a specific order and how the structure of the data influence a model's learning speed. To this end, the authors propose a simple reconstruction task (which they term structured identity mapping, SIM) in which an MLP should reconstruct its inputs drawn from a mixture of Gausssians. The authors argue that this task allows them to study and explain the key empirical observations on compositionally generalizing diffusion models and lead to the novel characterization of a non-monotonic learning dynamic.
weaknesses: In summary, I find the paper misses the mark, as the SIM task is, as far as I understand, a poor setting to study compositional generalization, and the insights on this simple task translate poorly to the training of a diffusion model, even for the simple toy setting that is used (which itself is approximating the compositional generalization of text-conditioned diffusion models that this paper aims to study). I will elucidate the issues I see with the setting and results below.

As it stands, I cannot recommend acceptance of this work; however, I could see how the results on the learning dynamics of symmetric linear models from §4 might be interesting in their own right, without considering any (as I understand, faulty) connection to compositional generalization. Maybe a reconsideration of the scope of the paper and a reframing of the results without overclaiming meaningful insights regarding the training dynamics of text-conditioned diffusion models could be an interseting contribution on its own.

# The SIM Setting
As far as I understand, previous works took the "concept space" as an abstracted view of the training and test data in order to study training trajectories of diffusion models. In the SIM task, this concept space is instead interpreted directly as the input and output space of a model. While I can see that this choice is motivated by the intuition in LL89, "a good generator essentially performs as an identity mapping in the concept space", this simplification of the setting is not explicitly mentioned, e.g., in the introduction, and the limitations this simplification imposes on the applicability and transferability of the results are not discussed.

Further, the training distribution in the SIM task is a mixture of Gaussians. In general, I find that this setup is not explained very clearly, see minor issues below. The central issue I see is that this setup entirely misses the point of (compositional) generalization. First, by introducing the training clusters as Gaussians, any point in $\mathbb R^d$ has probability $> 0$. So it is simply not true that any "[test] point is outside of the training distribution—not just the training data, necessitating out-of-distribution generalization." (LL173). Second, since test loss is only tracked on an individual point, not a test distribution, the experiments cannot even consider distribution shifts. Overall, describing this setting as requiring "generalization" to an "OOD test point" is misleading.

If we understand that in this setting, any test point has non-zero probablity in the training set, the conclusions from §3 are mostly unsurprising. Consider the probability density of a given point in the grids in Fig. 2 belonging to the training set (in fact, I encourage the authors to include this information in the figure). I expect that for Fig. 2a, we will see that the trajectories are skewed towards higher-density regions, which roughly speaking can be interpreted as the model reducing the risk of a certain output. Similarly, we can understand the takeaway from Fig. 2b, the "terminal slow down" differing for different values of $\boldsymbol \sigma$ as an effect of the probability density. For $\boldsymbol \sigma = (2, 0.05)$, the overall density at point $(1, 2)$ is much higher than for $\boldsymbol \sigma = (0.05, 0.05)$, making it much less likely that this point (or points close to it) are sampled, so that the model takes much longer to learn it.

While the "transient memorization" is an intersting behavior of even simple models, and the author's explanation of this phenomenon seems interesting, I find it hard to justify translating any insights from this setting to a compositional generalization regime.

# Transferring Results to Diffusion Models
§5 is very bare-bones, to the point that it is unclear how well the observations from the SIM setting actually translate here. E.g., there doesn't seem to be as much of a "terminal slow down" in Fig. 6 as was shown in Fig. 2a/b. The "transient memorization" also seems much less pronounced.

Additionally, it is unclear _why_ results form the SIM setting should translate here, as in this case the test point is truly out of distribution, and, if I understand the training setting correctly, the trianing set only contains discrete values for each factor.

---

confidence: 4
contribution: 3
initial_rating: 6
presentation: 3
questions: The paper effectively accomplishes its aims, though a few points could be noted for improvement:
1. **Limited Theoretical Scope**: While the theoretical framework successfully supports the empirical observations in more complex models, it is based on simple linear models.  I acknowledge the difficulty in analyzing more complex neural networks theoretically. Nonetheless, for future work, extending the analysis to objects like kernel methods, particularly the Neural Tangent Kernel (NTK) [1], could provide a deeper understanding as NTK has been shown to capture certain behaviors of neural networks during training [2]. 
2. **Contextualization of Findings**: Some insights, such as the speed and order of generalization, have been observed in different forms in previous OOD works [3, 4, 5]. Further contextualizing the findings within these works could enhance the paper’s relevance and depth.

[1] [Jacot 2018] https://arxiv.org/abs/1806.07572

[2] [Lee 2020] https://arxiv.org/abs/2007.15801

[3] [Nagarajan 2020] https://arxiv.org/abs/2010.15775v3

[4] [Arjovsky 2019] https://arxiv.org/abs/1907.02893

[5] [Rosenfeld 2020] https://arxiv.org/abs/2010.05761
soundness: 3
strengths: 1. The paper is clearly written, with a logical flow that makes each insight and conclusion easy to follow.
2. The simplicity of the problem setup enhances the clarity and robustness of both the empirical observations and the theoretical contributions.
3. The diffusion model results are compelling, mirroring the behavior observed in simpler settings and offering explanations for phenomena noted in prior work.
summary: This paper investigates the dynamics of neural networks in achieving compositional generalization. The authors propose a Structured Identity Mapping (SIM) task, where models are trained on a Gaussian mixture dataset organized around concept-centric clusters. They find that concept strength and diversity strongly influence the speed of convergence and the ability to generalize to compositional out-of-distribution (OOD) test points. They also observe a phenomenon called "transient memorization," where models initially memorize the training distribution but eventually reorient towards OOD generalization with extended training. Theoretical analyses on simple linear models substantiate these findings, highlighting the role of signal strength and diversity in learning order and the occurrence of non-monotonic loss behavior. Finally, the authors validate these findings by training diffusion models, observing similar patterns in generalization dynamics.
weaknesses: See the questions section for more information.

---

confidence: 3
contribution: 3
initial_rating: 6
presentation: 3
questions: See weaknesses
soundness: 3
strengths: - Paper formalizes a proxy task (SIM) to model the learning dynamics of compositional generalization, and shows that real-world text-conditioned diffusion models exhibit similar behavior on a specific task. 
- Theoretical setup is clearly explained and theoretical conclusions are also well-elaborated. Limitations of theoretical results on the one-layer and symmetric two-layer linear models are also clearly discussed.
summary: The paper introduces the structured identity mapping (SIM) task, where a network is trained to learn the identity mapping from inputs which are sampled from largely disjoint Gaussian distributions, and evaluated on a test point defined as the average of their means. By analyzing learning dynamics of one-layer and symmetric two-layer linear networks on this task, the paper shows that several existing empirical observations can be modeled - higher SNR features are learnt earlier and faster, an epoch-wise double-descent phenomenon (termed Transient Memorization) occurs on the test point, and that learning slows down exponentially with time.
weaknesses: - It is not at all apparent that $\hat{x}$ is "outside of the training distribution", since $p(x_k^{(p)} = \hat{x}) > 0$ for training data $x_k^{(p)}$, despite what is claimed on L174. Why not choose sigma such that $\sigma_p \geq 0$ while keeping $\sigma_{q \neq p} = 0$? Furthermore components of $\sigma$ seems to be as large as $2$ in Fig 1., with $\mu$ ranging from $0 - 2$. In such cases, the converse seems to hold -- that $x_k^{(p)}$ is very much in-distribution of the training data.
- As a result, the introduced terminology "Transient Memorization" does not seem to be different from epoch-wise double descent. The paper stresses that the main difference is OOD vs in-distribution test loss (L263-265), but (a) as mentioned above the test sample considered are in fact in-distribution, and (b) even for double descent, it is actually essential for testing samples to differ significantly from the training ones as pointed out by [1]. 
-  The proposed SIM task is claimed to be a "further abstraction of the 'concept space' previously explored" (L531), however it appears instead to be an (over)-simplification of previous investigations. The motivation of the SIM model and how it relates with more general real-world settings are also unclear (for instance, why the proposed auto-encoding loss?).
- The paper's main empirical results section (Page 10) appear very underdeveloped and all important experiment details are left to the Appendix. Figure 6 is also not clearly explained, and different plots are distinguished based on "difference of class mean pixel values". Without reading App G, it is almost impossible to interpret what these results and experiments are doing. $\Delta$ Color is not defined in App G either.
- Paper concludes from Fig. 2 that "deceleration is not determined by ... the loss value ... but more depends on the data and training time" (L215). This is not self-evident, since (1) the training loss is not even plotted in Fig 2, and (2) regions with denser arrows are clearly also regions of lower test loss.
- The paper also claims that "there is a timescale determined by the training data such that if the model does not achieve OOD generalization within that period, significantly more computation will be required for the model to achieve it." (L238-240), which purportedly can be observed in Fig 2(b). However, the figure simply shows that configurations with lower $\sigma$ values take longer to correctly predict the test point. This conclusion seems self-fulfilling, since when $\sigma$ is larger, the density of training samples around $\hat{x}$ will be much higher.
- Minor: L534-L535 incomplete sentence - "We make a comprehensive."
- The work's primary area is stated as interpretability / explainability in AI, but the contributions to these areas are unclear. The bulk of the theoretical contributions seem to be instead exploring learning dynamics for one-layer/deep-linear models, which I have insufficient experience to evaluate with regards to recent literature. 

[1]  Double Descent Demystified: Identifying, Interpreting & Ablating the Sources of a Deep Learning Puzzle, 2023.

---

confidence: 4
contribution: 3
initial_rating: 6
presentation: 3
questions: See weaknesses.
soundness: 3
strengths: 1. The paper’s explanation of learning dynamics, including the multi-stage Jacobian evolution and its impact on concept learning order and speed, sheds light on underlying model behaviors. I think the interesting point is the high similarity between the diffusion experiment and the theoretical model behavior, even though the correlation between the two is not clearly demonstrated.

2. Experiments on SIM and diffusion models are well-designed, with relevant results that support the theoretical predictions, enhancing the practical relevance of the results.
summary: This paper presents a theoretical framework for understanding the dynamics of compositional generalization in neural networks. Building on prior work that examines how models generalize by manipulating underlying primitive concepts, the authors introduce a Structured Identity Mapping (SIM) task, where a model learns the identity mapping on a Gaussian mixture with structured centroids. Through analysis of this SIM task, the paper reveals mechanisms behind non-monotonic learning dynamics, which is validated through experiments on text-conditioned diffusion models.
weaknesses: 1. The theoretical model studied in this paper differs significantly from practical diffusion models. Although the authors attempt to demonstrate a relationship between the theoretical analysis and practical model behavior through empirical results, this connection remains unclear, making it challenging to confirm whether the behavior observed in diffusion models is directly related to the theoretical insights presented. While I acknowledge the value of the analysis for single-layer and two-layer linear networks, it would be beneficial if the authors conducted further analysis on simplified diffusion settings to bridge the gap between theory and practice more effectively.

2. In reference [1], the authors also discuss learning primitives in compositional tasks. Additional discussion on this work could be beneficial. Based on this, I have the following question: In [1], small initialization is an important factor for the model to learn primitives. In this paper’s theoretical part, small initialization is also assumed, but in practical diffusion models, is small initialization a crucial factor for learning primitives, or is it merely a theoretical necessity?

3. Could Figure 5 display the training data’s trajectory evolution? I am curious whether there is a similarity between the training and test trajectories in the early stages of training.

[1] Initialization is Critical to Whether Transformers Fit Composite Functions by Reasoning or Memorizing. arXiv:2405.05409.

Meta-review: (a) summary

This paper studies how to model the learning dynamics of compositional generalization(CG) in Neural Networks. It introduces a structured identity mapping (SIM) task for analyzing the learning dynamics mathematically. SIM helps to explain the empirical observations in prior work, and it also provides new insights on the non-monotonic learning dynamics in training text-conditioned diffusion models.

(b) strengths
+ It offers novel characteristics of training behavior of basic models.
+ It provides theoretical analysis of dynamic behavior in simple linear models.
+ The empirical results on text-conditioned diffusion models are compelling.
+ It is easy to read and follow.

(c) weaknesses
- The theoretical analysis is on simple linear models, but not on more complex models.
- The studied model is different from practical diffusion models.
- It needs more discussion on the connection between SIM task and CG.
- The details of the experimental setting on SIM was missing.

(d) decision

The reviewers found the paper well-written, the theoretical analysis and empirical results are clearly discussed. The contributions of the paper for bettering understanding of dynamic behavior for achieving CG are solid and relevant, I recommend accept.

Decision: Accept (Poster)