diff --git a/towardsconvergencetonashequilibriaintwoteamzerosumgames/fca07eac-706b-41aa-8183-c888af669e12_content_list.json b/towardsconvergencetonashequilibriaintwoteamzerosumgames/fca07eac-706b-41aa-8183-c888af669e12_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..9467762da456ec8d6f99e5bf508b11f74047e925 --- /dev/null +++ b/towardsconvergencetonashequilibriaintwoteamzerosumgames/fca07eac-706b-41aa-8183-c888af669e12_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e8bc6135d124eceb9444cc310890742712e1eeeb0902623dc8cb6522551ab3b +size 89038 diff --git a/towardsconvergencetonashequilibriaintwoteamzerosumgames/fca07eac-706b-41aa-8183-c888af669e12_model.json b/towardsconvergencetonashequilibriaintwoteamzerosumgames/fca07eac-706b-41aa-8183-c888af669e12_model.json new file mode 100644 index 0000000000000000000000000000000000000000..8f17fb7e965ead3dbe89c85b27ad2ea8d433f72d --- /dev/null +++ b/towardsconvergencetonashequilibriaintwoteamzerosumgames/fca07eac-706b-41aa-8183-c888af669e12_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4a07cdcbe83fc7e3cb635a28df62a8fd800c37743fc68a0caa42528e771c6a36 +size 116455 diff --git a/towardsconvergencetonashequilibriaintwoteamzerosumgames/fca07eac-706b-41aa-8183-c888af669e12_origin.pdf b/towardsconvergencetonashequilibriaintwoteamzerosumgames/fca07eac-706b-41aa-8183-c888af669e12_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fc3323294246c1aa4fe873416b49b107239ce179 --- /dev/null +++ b/towardsconvergencetonashequilibriaintwoteamzerosumgames/fca07eac-706b-41aa-8183-c888af669e12_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bc52755506ca5223ad2d40aa1f825ac32c824301bff31c5c2dc0c6b53a152396 +size 2745110 diff --git a/towardsconvergencetonashequilibriaintwoteamzerosumgames/full.md b/towardsconvergencetonashequilibriaintwoteamzerosumgames/full.md new file mode 100644 index 0000000000000000000000000000000000000000..e094660101268e575fc26382574d20aba21b47ca --- /dev/null +++ b/towardsconvergencetonashequilibriaintwoteamzerosumgames/full.md @@ -0,0 +1,345 @@ +# TOWARDS CONVERGENCE TO NASH EQUILIBRIA IN TWO-TEAM ZERO-SUM GAMES + +Fivos Kalogiannis +UC Irvine + +Ioannis Panageas +UC Irvine + +Emmanouil V. Vlatakis-Gkaragkounis +Columbia University + +# ABSTRACT + +Contemporary applications of machine learning in two-team e-sports and the superior expressivity of multi-agent generative adversarial networks raise important and overlooked theoretical questions regarding optimization in two-team games. Formally, two-team zero-sum games are defined as multi-player games where players are split into two competing sets of agents, each experiencing a utility identical to that of their teammates and opposite to that of the opposing team. We focus on the solution concept of Nash equilibria (NE). We first show that computing NE for this class of games is hard for the complexity class CLS. To further examine the capabilities of online learning algorithms in games with full-information feedback, we propose a benchmark of a simple -yet nontrivial-- family of such games. These games do not enjoy the properties used to prove convergence for relevant algorithms. In particular, we use a dynamical systems perspective to demonstrate that gradient descent-ascent, its optimistic variant, optimistic multiplicative weights update, and extra gradient fail to converge (even locally) to a Nash equilibrium. On a brighter note, we propose a first-order method that leverages control theory techniques and under some conditions enjoys last-iterate local convergence to a Nash equilibrium. We also believe our proposed method is of independent interest for general min-max optimization. + +# 1 INTRODUCTION + +Online learning shares an enduring relationship with game theory that has a very early onset dating back to the analysis of fictitious play by (Robinson, 1951) and Blackwell's approachability theorem (Blackwell, 1956). A key question within this context is whether self-interested agents can arrive at a game-theoretic equilibrium in an independent and decentralized manner with only limited feedback from their environment. Learning dynamics that converge to different notions of equilibria are known to exist for two-player zero-sum games (Robinson, 1951; Arora et al., 2012; Daskalakis et al., 2011), potential games (Monderer & Shapley, 1996), near-potential games (Anagnostides et al., 2022b), socially concave games (Golowich et al., 2020), and extensive form games (Anagnostides et al., 2022a). We try to push the boundary further and explore whether equilibria—in particular, Nash equilibria—can be reached by agents that follow decentralized learning algorithms in two-team zero-sum games. + +Team competition has played a central role in the development of game theory (Marschak, 1955; von Stengel & Koller, 1997; Bacharach, 1999; Gold, 2005), economics (Marschak, 1955; Gottinger, 1974), and evolutionary biology (Nagylaki, 1993; Nowak et al., 2004). Recently, competition among teams has attracted the interest of the machine learning community due to the advances that multi-agent systems have accomplished: e.g., multi-GAN's (Hoang et al., 2017; Hardy et al., 2019) for generative tasks, adversarial regression with multiple learners (Tong et al., 2018), or AI agents competing in e-sports (e.g., CTF (Jaderberg et al., 2019) or Starcraft (Vinyals et al., 2019)) as well as card games (Moravčík et al., 2017; Brown & Sandholm, 2018; Bowling et al., 2015). + +Our class of games. We turn our attention to two-team zero-sum games a quite general class of min-max optimization problems that include bilinear games and a wide range of nonconvex-nonconcave games as well. In this class of games, players fall into two teams of size $n$ , $m$ and submit their own randomized strategy vectors independently. We note that the games that we focus on are + +not restricted to team games in the narrow sense of the term "team" as we use it in sports, games, and so on; the players play independently and do not follow a central coordinating authority. Rather, for the purpose of this paper, teams are constituted by agents that merely enjoy the same utility function. This might already hint that the solution concept that we engage with is the Nash equilibrium (NE). Another class of games that is captured by this framework is the class of adversarial potential games. In these games, the condition that all players of the same team experience the same utility is weakened as long as there exists a potential function that can track differences in the utility of each player when they unilaterally deviate from a given strategy profile (see Appendix A.2 for a formal definition). A similar setting has been studied in the context of nonatomic games (Babaioff et al., 2009). + +Positive duality gap. In two-player zero-sum games, i.e., $n = m = 1$ , min-max (respectively max-min) strategies are guaranteed to form a Nash equilibrium due to Von Neumann's minmax theorem (Von Neumann, 1928); ultimately endowing the game with a unique value. The challenges arise for the case of $n, m > 1$ ; Schulman & Vazirani (2019b) prove that, in general, two-team games do not have a unique value. They do so by presenting a family of team games with a positive duality gap, together with bounds concerning this gap. These bounds quantify the effect of exchanging the order of commitment to their strategy either between the teams as a whole or the individual players. + +Solution concept. In this work, we examine the solution concept of Nash equilibrium (NE). Under a Nash equilibrium, no player can improve their utility by unilaterally deviating. The main downside of a NE for team games is the fact that such an equilibrium can be arbitrarily suboptimal for the team (Basilico et al., 2017a). + +This is one of the reasons that the solution concept of team-maxmin equilibrium with a coordination device (TMECor) has dominated contemporary literature of team games, especially in regard to applications (Farina et al., 2018; Zhang et al., 2020; Cacciamani et al., 2021). Under a TMECor, players are allowed to communicate before the game and decide upon combinations of strategies to be played during the game using an external source of randomness. + +The undeniable advantage of a TMECor is that the expected utility of the team under it is greater than the expected utility under a NE (Basilico et al., 2017a). Nevertheless, this favorable property of TMECor can by no means render the study of NE irrelevant. In fact, the study of NE is always of independent interest within the literature of algorithmic game theory —especially questions corresponding to computational complexity. Moreover, there exist settings in which ex ante coordination cannot be expected to be possible or even sensible; for example in (i) environments where the external sources of randomness are unreliable or nonexistent or visible to the adversarial team, (ii) games in which players cannot know in advance who they share a common utility with, (iii) adversarial potential games. These games can model naturally occurring settings such as (a) security games with multiple uncoordinated defenders versus multiple similarly uncoordinated attackers, (b) the load balancing “game” between telecommunication service providers trying to minimize the maximum delay of service experienced by their customers versus the service users that try to individually utilize the maximum amount of broadband possible, and (c) the weak selection model of evolutionary biology where a species as a whole is a team, the genes of its population are the players and the alleles of each gene are in turn the actions of a player; the allele frequencies are independent across genes (Nagylaki, 1993; Nowak et al., 2004; Mehta et al., 2015). + +Concluding, we could not possibly argue for a single correct solution concept for two-team games; there is no silver bullet. In contrast, one has to assess which is the most fitting based on the constraints of a given setting. A Nash equilibrium is a cornerstone concept of game theory and examining its properties in different games is always important. + +The optimization point of view. We focus on the solution concept of NE and we first note that computing local-NE in general nonconvex-nonconcave games is PPAD-complete (Daskalakis et al., 2009; 2021). Thus, all well-celebrated online learning, first-order methods like gradient descent-ascent (Lin et al., 2020; Daskalakis & Panageas, 2019), its optimistic (Popov, 1980; Chiang et al., 2012; Sridharan & Tewari, 2010), optimistic multiplicative weights update (Sridharan, 2012), and the extra gradient method (Korpelevich, 1976) would require an exponential number of steps in the parameters of the problem in order to compute an approximate NE under the oracle optimization model of (Nemirovskij & Yudin, 1983). Additionally, in the continuous time regime, similar classes + +of games exhibit behaviors antithetical to convergence like cycling, recurrence, or chaos (Vlatakis-Gkaragkounis et al., 2019). Second, even if a regret notion within the context of team-competition could be defined, no-regret dynamics are guaranteed to converge only to the set of coarse correlated equilibria (CCE) (Fudenberg, 1991; Hannan, 2016). CCE is a weaker equilibrium notion whose solutions could potentially be exclusively supported on strictly dominated strategies, even for simple symmetric two-player games (See also (Viossat & Zapechelyuk, 2013)). + +Surely, the aforementioned intractability remarks for the general case of nonconvex-nonconcave min-max problems provide a significant insight. But, they cannot per se address the issue of computing Nash equilibria when the game is equipped with a particular structure, i.e., that of two-team zero-sum games. In fact, our paper addresses the following questions: + +Can we get provable convergence guarantees to NE of decentralized first-order methods in two-team zero-sum games? + +Our results. First, with regards to computational complexity, we prove that computing an approximate (and possibly mixed) NE in two-team zero-sum games is CLS-hard (Theorem 3.1); i.e., it is computationally harder than finding pure NE in a congestion game or computing an approximate fixed point of gradient descent. + +Second, regarding online learning for equilibrium computation, we prove that a number of established, decentralized, first-order methods are not fit for the purpose and fail to converge even asymptotically. Specifically, we present a simple -yet nontrivial family of two-team zero-sum games (with each team consisting of two players) where projected gradient descent-ascent (GDA), optimistic gradient descent-ascent (OGDA), optimistic multiplicative weights update (OMWU), and the extra gradient method (EG) fail to locally converge to a mixed NE (Theorem 3.3). More broadly, in the case of GDA in nondegenerate team games with unique mixed NE, one could acquire an even stronger result for any high-dimensional configuration of actions and players (Theorem 3.2). To the best of our knowledge, the described family of games is the first-of-its-kind in which all these methods provably fail to converge at the same time. + +Third, we propose a novel first-order method inspired by adaptive control (Bazanella et al., 1997; Hassouneh et al., 2004). In particular, we use a technique that manages to stabilize unstable fixed points of a dynamical system without prior knowledge of their position and without introducing new ones. It is important to note that this method is a modification of GDA that uses a stabilizing feedback which maintains the decentralized nature of GDA. + +Finally, in Section 4 we provide a series of experiments in simple two-team zero-sum GAN's. We also show that multi-GAN architectures achieve better performance than single-agent ones, relative to the network capacity when they are trained on synthetic or real-world datasets like CIFAR10. + +Existing algorithms for NE in multiplayer games. The focus of the present paper is examining algorithms for the setting of repeated games (Cesa-Bianchi & Lugosi, 1999, Chapter 7). If we do not restrict ourselves to this setting, there are numerous centralized algorithms (Lipton et al., 2003; Berg & Sandholm, 2017) and heuristics (Gemp et al., 2021) that solve the problem of computing Nash equilibria in general multi-player games. + +# 2 PRELIMINARIES + +Our setting. A two-team game in normal form is defined as a tuple $\Gamma(\mathcal{N},\mathcal{M},\mathcal{A},\mathcal{B},\{U_A,U_B\})$ . The tuple is defined by + +(i) a finite set of $n = |\mathcal{N}|$ players belonging to team $A$ , as well as a finite set of $m = |\mathcal{M}|$ players belonging to team $B$ ; +(ii) a finite set of actions (or pure strategies) $\mathcal{A}_i = \{\alpha_1, \ldots, \alpha_{n_i}\}$ per player $i \in \mathcal{N}$ ; where $\mathcal{A} := \prod_i \mathcal{A}_i$ denotes the ensemble of all possible action profiles of team $A$ , and respectively, a finite set of actions (or pure strategies) $\mathcal{B}_i = \{\beta_1, \ldots, \beta_{n_i}\}$ per player $i \in \mathcal{M}$ , where $\mathcal{B} := \prod_i \mathcal{B}_i$ . +(iii) a utility function for team $A$ , $U_A: \mathcal{A} \times \mathcal{B} \to \mathbb{R}$ (resp. $U_B: \mathcal{A} \times \mathcal{B} \to \mathbb{R}$ for team $B$ ) + +We also use $\alpha = (\alpha_{1},\ldots ,\alpha_{n})$ to denote the strategy profile of team $A$ players and $\beta = (\beta_{1},\dots,\beta_{m})$ the strategy profile of team $B$ players. + +Finally, each team's payoff function is denoted by $U_A, U_B: \mathcal{A} \times \mathcal{B} \to \mathbb{R}$ , where the individual utility of a player is identical to her teammates, i.e., $U_i = U_A \& U_j = U_B \forall i \in \mathcal{N}$ and $j \in \mathcal{M}$ . In this general context, players could also submit mixed strategies, i.e., probability distributions over actions. Correspondingly, we define the product distributions $\boldsymbol{x} = (\boldsymbol{x}_1, \dots, \boldsymbol{x}_n)$ , $\boldsymbol{y} = (\boldsymbol{y}_1, \dots, \boldsymbol{y}_m)$ as team $A$ and $B$ 's strategies respectively, in which $\boldsymbol{x}_i \in \Delta(\mathcal{A}_i)$ and $\boldsymbol{y}_j \in \Delta(\mathcal{B}_j)$ . Conclusively, we will write $\mathcal{X} := \prod_{i \in \mathcal{N}} \mathcal{X}_i = \prod_{i \in \mathcal{N}} \Delta(\mathcal{A}_i)$ , $\mathcal{Y} := \prod_{i \in \mathcal{M}} \mathcal{Y}_i = \prod_{i \in \mathcal{M}} \Delta(\mathcal{B}_i)$ the space of mixed strategy profiles of teams $A, B$ . A two-team game is called two-team zero-sum if $U_B = -U_A = U$ which is the main focus of this paper. Moreover, we assume that the game is succinctly representable and satisfies the polynomial expectation property (Daskalakis et al., 2006). This means that given a mixed strategy profile, the utility of each player can be computed in polynomial time in the number of agents, the sum of the number of strategies of each player, and the bit number required to represent the mixed strategy profile. + +A Nash equilibrium (NE) is a strategy profile $(\pmb{x}^{*},\pmb{y}^{*})\in \mathcal{X}\times \mathcal{Y}$ such that + +$$ +\left\{ \begin{array}{l} U (\boldsymbol {x} ^ {*}, \boldsymbol {y} ^ {*}) \leq U \left(\boldsymbol {x} _ {i}, \boldsymbol {x} _ {- i} ^ {*}, \boldsymbol {y} ^ {*}\right), \forall \boldsymbol {x} _ {i} \in \mathcal {X} _ {i} \\ U \left(\boldsymbol {x} ^ {*}, \boldsymbol {y} ^ {*}\right) \geq U \left(\boldsymbol {x} ^ {*}, \boldsymbol {y} _ {j}, \boldsymbol {y} _ {- j} ^ {*}\right), \forall \boldsymbol {y} _ {j} \in \mathcal {Y} _ {j} \end{array} \right. \tag {NE} +$$ + +A first approach to computing NE in Two-Team Zero-Sum games. Due to the multilinearity of the utility and the existence of a duality gap, the linear programming method used in two-player zero-sum games cannot be used to compute a Nash equilibrium. For the goal of computing Nash equilibrium in two-team zero-sum games, we have experimented with a selection of online learning, first-order methods that have been utilized with varying success in the setting of the two-person zero-sum case. Namely, we analyze the following methods: (i) gradient descent-ascent (GDA) (ii) optimistic gradient descent-ascent (OGDA) (iii) extra gradient method (EG) (iv) optimistic multiplicative weights update method (OMWU). For their precise definitions, we refer to Appendix B. + +The below folklore fact will play a key role hereafter. + +Fact 2.1. Any fixed point of the aforementioned discrete-time dynamics (apart from OMWU) on the utility function necessarily corresponds to a Nash Equilibrium of the game. + +Hence, an important test for the asymptotic behavior of GDA, OGDA, EG, and OMWU methods is to examine whether these methods stabilize around their fixed points which effectively constitute the Nash equilibria of the game. In Section 3.2, we show that in the absence of pure Nash equilibria, all the above methods fail to stabilize on their fixed points even for a simple class of two-team games with $(n = 2, m = 2)$ . Consequently, they fail to converge to the mixed Nash equilibrium of the game. + +The presence of these results demonstrates the need for a different approach that lies outside the scope of traditional optimization techniques. Inspired by the applications of washout filters to stabilize unknown fixed points and the adaptive control generalizations of the former, we design a new variant of GDA "vanized" with a feedback loop dictated by a pair of two matrices. In contrast to the aforementioned conventional methods, our proposed technique surprisingly accomplishes asymptotic last-iterate convergence to its fixed point, i.e., the mixed Nash equilibria of the team game. + +$(\mathbf{K}, \mathbf{P})$ -vaned GDA Method. After concatenating the vectors of the minimizing and the maximizing agents — $z^{(k)} = (x^{(k)}, y^{(k)})$ — our method for appropriate matrices $\mathbf{K}, \mathbf{P}$ reads: + +$$ +\left\{ \begin{array}{l} \boldsymbol {z} ^ {(k + 1)} = \Pi_ {\mathcal {Z}} \left\{\boldsymbol {z} ^ {(k)} + \eta \binom {- \nabla_ {\boldsymbol {x}} f (\boldsymbol {z} ^ {(k)})} {\nabla_ {\boldsymbol {y}} f (\boldsymbol {z} ^ {(k)})} + \eta \mathbf {K} \left(\boldsymbol {z} ^ {(k)} - \boldsymbol {\theta} ^ {(k)}\right) \right\} \\ \boldsymbol {\theta} ^ {(k + 1)} = \Pi_ {\mathcal {Z}} \left\{\boldsymbol {\theta} ^ {(k)} + \eta \mathbf {P} \left(\boldsymbol {z} ^ {(k)} - \boldsymbol {\theta} ^ {(k)}\right) \right\} \end{array} \right. \tag {KPV-GDA} +$$ + +Intuitively, the additional variable $\pmb{\theta}^{(k)}$ holds an estimate of the fixed point, and through the feedback law $\eta \mathbf{K}(\pmb{z}^{(k)} - \pmb{\theta}^{(k)})$ the vector $\pmb{z}$ stabilizes around that estimate which slowly moves towards the real fixed point of the GDA dynamic. + +# 2.1 TWO ILLUSTRATIVE EXAMPLES + +Our first example plays a dual role: first, it demonstrates how two-team min-max competition can capture the formulation of multi-agent GAN architectures; second, it hints at the discrepancy be- + +![](images/acd7860bf75c1da39a4e403a4470681b60f961c65df700f8754a468c05decf4d.jpg) +Figure 1: Parameter training of the configuration under different algorithms + +tween the results of optimization methods, since—as we will see—GDA will not converge to the Nash equilibrium/ground-truth distribution. Generally, the solution that is sought after is the min max solution of the objective function (Goodfellow et al., 2014) which are NP-hard to compute in the general case (Borgs et al., 2008); nevertheless, applications of GANs have proven that first-order stationary points of the objective function suffice to produce samples of very good quality. + +# 2.1.1 LEARNING A MIXTURE OF GAUSSIANS WITH MULTI-AGENT GAN'S + +Consider the case of $\mathcal{O}$ , a mixture of gaussian distribution with two components, $C_1 \sim \mathcal{N}(\pmb{\mu}, \mathbf{I})$ and $C_2 \sim \mathcal{N}(-\pmb{\mu}, \mathbf{I})$ and mixture weights $\pi_1, \pi_2$ to be positive such that $\pi_1 + \pi_2 = 1$ and $\pi_1, \pi_2 \neq \frac{1}{2}$ . + +To learn the distribution above, we utilize an instance of a Team-WGAN in which there exists a generating team of agents $G_{p}:\mathbb{R}\to \mathbb{R},G_{\theta}:\mathbb{R}^{n}\to \mathbb{R}^{n}$ , and a discriminating team of agents $D_{\boldsymbol{v}}:\mathbb{R}^n\to \mathbb{R},D_{\boldsymbol{w}}:\mathbb{R}^n\to \mathbb{R}$ , all described by the following equations: + +$$ +\begin{array}{l} \text {G e n e r a t o r s :} G _ {p} (\zeta) = p + \zeta , G _ {\theta} (\boldsymbol {\xi}) = \boldsymbol {\xi} + \boldsymbol {\theta} \\ \text {D i s c r i m i n a t o r s :} D _ {\boldsymbol {v}} (\boldsymbol {y}) = \left\langle \boldsymbol {v}, \boldsymbol {y} \right\rangle , D _ {\boldsymbol {w}} (\boldsymbol {y}) = \sum_ {i} w _ {i} y _ {i} ^ {2} \end{array} \tag {1} +$$ + +The generating agent $G_{\theta}$ maps random noise $\xi \sim \mathcal{N}(0, \mathbf{I})$ to samples while generating agent $G_{p}(\zeta)$ , utilizing an independent source of randomness $\zeta \sim \mathcal{N}(0, 1)$ , probabilistically controls the sign of the output of the generator $G_{\theta}$ . The probability of ultimately generating a sample $y = \xi + \theta$ is in expectation equal to $p$ , while the probability of the sample being $y = -z - \theta$ is equal to $1 - p$ . + +On the other end, there stands the discriminating team of $D_v, D_w$ . Discriminators, $D_v(\pmb{y}), D_w(\pmb{y})$ map any given sample $\pmb{y}$ to a scalar value accounting for the "realness" or "fakeness" of it – negative meaning fake, positive meaning real. The discriminators are disparate in the way they measure the realness of samples as seen in their definitions. + +We follow the formalism of the Wasserstein GAN to form the optimization objective: + +$$ +\left. \right. \max _ {\boldsymbol {v}, \boldsymbol {w}} \min _ {\boldsymbol {\theta}, p} \left\{\mathbb {E} _ {\boldsymbol {y} \sim \mathcal {O}} \left[ D _ {\boldsymbol {v}} (\boldsymbol {y}) + D _ {\boldsymbol {w}} (\boldsymbol {y}) \right] - \mathbb {E} _ {\substack {\boldsymbol {\xi} \sim \mathcal {N} (0, \mathbf {I}),\\\zeta \sim \mathcal {N} (0, 1)}} \left[\begin{array}{c}G _ {p} (\zeta) \cdot \left(D _ {\boldsymbol {v}} \left(G _ {\boldsymbol {\theta}} (\boldsymbol {y})\right) + D _ {\boldsymbol {w}} \left(G _ {\boldsymbol {\theta}} (\boldsymbol {y})\right)\right)\\+\\\left(1 - G _ {p} (\zeta)\right) \cdot \left(D _ {\boldsymbol {v}} \left(- G _ {\boldsymbol {\theta}} (\boldsymbol {y})\right) + D _ {\boldsymbol {w}} \left(- G _ {\boldsymbol {\theta}} (\boldsymbol {y})\right)\right)\end{array}\right]\right\} \tag{2} +$$ + +Equation (2) yields the simpler form: + +$$ +\max _ {\boldsymbol {v}, \boldsymbol {w}} \min _ {\boldsymbol {\theta}, p} \left(\pi_ {1} - \pi_ {2}\right) \boldsymbol {v} ^ {T} \boldsymbol {\mu} - 2 p \boldsymbol {v} ^ {T} \boldsymbol {\theta} + \boldsymbol {v} ^ {T} \boldsymbol {\theta} + \sum_ {i} ^ {n} w _ {i} \left(\mu_ {i} ^ {2} - \theta_ {i} ^ {2}\right) \tag {3} +$$ + +It is easy to check that Nash equilibria of (2) must satisfy: + +$$ +\left\{ \begin{array}{r c l} \boldsymbol {\theta} & = & \boldsymbol {\mu}, \quad p = 1 - \pi_ {2} = \pi_ {1} \\ \boldsymbol {\theta} & = & - \boldsymbol {\mu}, \quad p = 1 - \pi_ {1} = \pi_ {2}. \end{array} \right\} +$$ + +Figure 1 demonstrates both GDA's failure and OGDA, EG, and our proposed method, KPV-GDA succeeding to converge to the above Nash equilibria and simultaneously discovering the mixture of the ground-truth. + +# 2.1.2 MULTIPLAYER MATCHING PENNIES + +Interestingly enough, there are non-trivial instances of two-team competition settings in which even OGDA and EG fail to converge. Such is the case for a team version of the well-known game of + +matching pennies. The game can be shortly described as such: "coordinate with your teammates to play a game of matching pennies against the opposing team, coordinate not and pay a penalty". (We note that this game is a special case of the game presented in Section 3.3.) As we can see in Figures 2a and 2b, this multiplayer generalized matching pennies game constitutes an excellent benchmark on which all traditional gradient flow discretizations fail under the perfect competition setting. Interestingly, we are not aware of a similar example in min-max literature and it has been our starting point for seeking new optimization techniques inspired by Control theory. Indeed, the KPV-GDA variation with $(\mathbf{K},\mathbf{P}) = (-1.1\cdot \mathbf{I},0.3\cdot \mathbf{I})$ achieves to converge to the unique mixed Nash Equilibrium of the game. In the following sections, we provide theorems that explain formally the behavior of the examined dynamics. + +![](images/4e0ff145a5c93396adafd32683a02614232efc294b270cc2fb6a81e8cb72ccbf.jpg) +(a) Generalized matching pennies under different algorithms. For the precise definition of the game, we refer to appendix C.4 + +![](images/7e27dfe24497c08c870f0e0d7db721fd154f9b76a0118eea7ae3ab5763b50354.jpg) +(b) Projected Trajectory of Team A under different algorithms. The sketched surface is not part of the feasible team strategy profiles (product of distributions). + +# 3 MAIN RESULTS + +In this section, we will prove that computing a Nash equilibrium in two-team zero-sum games is computationally hard and thus getting a polynomial-time algorithm that computes a Nash equilibrium is unlikely. Next, we will demonstrate the shortcomings of an array of commonly used online learning, first-order methods, and then we will provide a novel, decentralized, first-order method that locally converges to NE under some conditions. + +# 3.1 ON THE HARDNESS OF COMPUTING NE IN TWO-TEAM ZERO-SUM GAMES + +As promised, our first statement characterizes the hardness of NE computation in two-team zero-sum games: + +Theorem 3.1 (CLS-hard). Computing a Nash equilibrium in a succinctly represented two-team zero-sum game is CLS-hard. + +The main idea of the proof of Theorem 3.1 relies on a reduction of approximating Nash equilibria in congestion games, which has been shown to be complete for the CLS complexity class. The class CLS contains the problem of continuous optimization. We defer the proof of the above theorem to the paper's supplement. + +# 3.2 FAILURE OF COMMON ONLINE, FIRST-ORDER METHODS + +The negative computational complexity result we proved for two-team zero-sum games (Theorem 3.1) does not preclude the prospect of attaining algorithms (learning first-order methods) that converge to Nash equilibria. Unfortunately, we prove that these methods cannot guarantee convergence to Nash equilibria in two-team zero-sum games in general. + +In this subsection, we are going to construct a family of two-team zero-sum games with the property that the dynamics of GDA, OGDA, OMWU, and EG are unstable on Nash equilibria. This result is indicative of the challenges that lie in the min-max optimization of two-team zero-sum games and the reason that provable, nonasymptotic convergence guarantees of online learning have not yet been established. + +Before defining our benchmark game, we prove an important theorem which states that GDA does not converge to mixed Nash equilibria. This fact is a stepping stone in constructing the family of team-zero sum games later. We present the proof of all of the below statements in detail in the paper's appendix (Appendix B). + +Weakly-stable Nash equilibrium. (Kleinberg et al., 2009; Mehta et al., 2015) Consider the set of Nash equilibria with the property that if any single randomizing agent of one team is forced to play any strategy in their current support with probability one, all other agents of the same team must remain indifferent between the strategies in their support. This type of Nash equilibria is called weakly-stable. We note that pure Nash equilibria are trivially weakly-stable. It has been shown that mixed Nash equilibria are not weakly-stable in generic games2 + +We can show that Nash equilibria that are not weakly-stable Nash are actually unstable for GDA. Moreover, through standard dynamical systems machinery, that the set of initial conditions that converges to Nash equilibria that are not weakly-stable should be of Lebesgue measure zero. Formally, we prove that: + +Theorem 3.2 (Non weakly-stable Nash are unstable). Consider a two-team zero-sum game with the utility function of Team $B$ ( $y$ vector) being $U(\boldsymbol{x}, \boldsymbol{y})$ and Team $A$ ( $x$ vector) being $-U(\boldsymbol{x}, \boldsymbol{y})$ . Moreover, assume that $(\boldsymbol{x}^*, \boldsymbol{y}^*)$ is a Nash equilibrium of full support that is not weakly-stable. It follows that the set of initial conditions so that GDA converges to $(\boldsymbol{x}^*, \boldsymbol{y}^*)$ is of measure zero for step size $\eta < \frac{1}{L}$ where $L$ is the Lipschitz constant of $\nabla U$ . + +# 3.3 GENERALIZED MATCHING PENNIES (GMP) + +Inspired by Theorem 3.2, in this section we construct a family of team zero-sum games so that GDA, OGDA, OMWU, and EG methods fail to converge (if the initialization is a random point in the simplex, the probability of convergence of the aforementioned methods is zero). The intuition is to construct a family of games, each of which has only mixed Nash equilibria (that are not weakly-stable), i.e., the constructed games should lack pure Nash equilibria; using Theorem 3.2, it would immediately imply our claim for GDA. It turns out that OGDA, OMWU, and EG also fail to converge for the same family. + +Definition of GMP. Consider a setting with two teams (Team $A$ , Team $B$ ), each of which has $n = 2$ players. Inspired by the standard matching pennies game and the game defined in (Schulman & Vazirani, 2019a), we allow each agent $i$ to have two strategies/actions that is $S = \{H, T\}$ for both teams with $2^4$ possible strategy profiles. In case all + +![](images/6e4b46f958a13cdac580fdbb68d36bbdb9152d16650aee635b1ca5be06581b93.jpg) + +
HHHT/THTT
1,-1ω,-ω-1,1
-ω,ω0,0-ω,ω
-1,1ω,-ω1,-1
+ +the members of a Team choose the same strategy say $H$ or $T$ then the Team "agrees" to play $H$ or $T$ (otherwise the Team "does not agree"). + +Thus, in the case that both teams "agree", the payoff of each team is actually the payoff for the two-player matching pennies. If one team "agrees" and the other does not, the team that "agrees" enjoys the payoff $\omega \in (0,1)$ and the other team suffers a penalty $\omega$ . If both teams fail to "agree", both teams get payoff zero. Let $x_{i}$ with $i \in \{1,2\}$ be the probability that agent $i$ of Team $A$ chooses $H$ and $1 - x_{i}$ the probability that she chooses $T$ . We also denote $\mathbf{x}$ as the vector of probabilities for Team $A$ . Similarly, we denote $y_{i}$ for $i \in \{1,2\}$ be the probability that agent $i$ of Team $B$ chooses $H$ and $1 - y_{i}$ the probability that she chooses $T$ and $\mathbf{y}$ the probability vector. + +Properties of GMP. An important remark on the properties of our presented game is due. Existing literature tackles settings with (i) (weak-)monotonocity (Mertikopoulos et al., 2019; Diakonikolas et al., 2021), (ii) cocoercivity (Zhu & Marcotte, 1996), (iii) zero-duality gap (Von Neumann, 1928), (iv) unconstrained solution space (Golowich et al., 2020). Our game is carefully crafted and – although it has a distinct structure and is nonconvex-nonconcave only due to multilinearity– satisfies none of the latter properties. This makes the (local) convergence of our proposed method even more surprising. (See also Appendix B.6.) + +The first fact about the game that we defined is that for $\omega \in (0,1)$ , there is only one Nash equilibrium $(\pmb{x}^{*},\pmb{y}^{*})$ , which is the uniform strategy, i.e., $x_{1}^{*} = x_{2}^{*} = y_{1}^{*} = y_{2}^{*} = \frac{1}{2}$ for all agents $i$ . + +Lemma 3.1 (GMP has a unique Nash). The Generalized Matching Pennies game exhibits a unique Nash equilibrium which is $(\pmb{x}^{*},\pmb{y}^{*}) = ((\frac{1}{2},\frac{1}{2}),(\frac{1}{2},\frac{1}{2}))$ + +Remark 1. The fact that the game we defined has a unique Nash equilibrium that is in the interior of $[0,1]^4$ is really crucial for our negative convergence results later in the section as we will show that it is not a weakly-stable Nash equilibrium and the negative result about GDA will be a corollary due to Theorem 3.2. We also note that if $\omega = 1$ then there are more Nash equilibria, in particular the $(0,0), (1,0), (0,1), (1,1)$ which are pure. + +The following Theorem is the main (negative) result of this section. + +Theorem 3.3 (GDA, OGDA, EG, and OMWU fail). Consider GMP game with $\omega \in (0,1)$ . Assume that $\eta_{GDA} < \frac{1}{4}$ , $\eta_{OGDA} < \min(\omega, \frac{1}{8})$ , $\eta_{EG} < \frac{\omega}{2}$ , and $\eta_{OMWU} < \min\left(\frac{1}{4}, \frac{\omega}{2}\right)$ (bound on the stepsize for GDA, OGDA, OMWU, and EG methods respectively). It holds that the set of initial conditions so that GDA, OGDA, OMWU, and EG converge (stabilize to any point) is of measure zero. + +Remark 2. Theorem 3.3 formally demonstrates that the behavior of algorithms mentioned in Section 2.1.2 are not a result of "bad parametrization", and in fact, the probability that any of them converges to the NE is equal to the probability that the initialization of the variables coincides with the NE (Lebesgue measure zero). + +Remark 3 (Average iterate also fails). One might ask what happens when we consider average iterates instead of the last iterate. It is a well-known fact (Syrgkanis et al., 2015) that the average iterate of no-regret algorithms converges to coarse correlated equilibria (CCE) so we expect that the average iterate stabilizes. Nevertheless, CCE might not be Nash equilibria. Indeed we can construct examples in which the average iterate of GDA, OGDA, OMWU, and EG experimentally fail to stabilize to Nash equilibria. In particular, we consider a slight modification of GMP; players and strategies are the same but the payoff matrix has changed and can be found reads + +![](images/3eea1e7b15363c681928233f23c08b4158a722aa9bdfae37c08c7c2edc7b2d5b.jpg) +Figure 3: GDA, OGDA, OMWU, & EG fail to converge to a Nash Equilibrium even in average + +Figure 3 shows that the average iterates of GDA, OGDA, OMWU, and EG stabilize to points that are not Nash equilibria. We note that since our method (see next subsection) converges locally, the average iterate should converge locally to a Nash equilibrium. + +# 3.4 OUR PROPOSED METHOD + +The aforementioned results prove that the challenging goal of computing two-team zero-sum games calls for an expansion of existing optimization techniques. The mainstay of this effort and our positive result is the KPV-GDA method defined in (KPV-GDA) which is inspired by techniques of adaptive control literature. The first statement we make is that KPV-GDA stabilizes around any Nash equilibrium for appropriate choices of matrices $\mathbf{K},\mathbf{P}$ : + +Theorem 3.4 (KPV-GDA stabilizes). Consider a team zero-sum game so that the utility of Team $B$ is $U(\pmb{x},\pmb{y})$ and hence the utility of Team $A$ is $-U(\pmb{x},\pmb{y})$ and a Nash equilibrium $(\pmb{x}^*,\pmb{y}^*)$ of the game. Moreover, we assume + +$$ +\left( \begin{array}{l l} - \nabla_ {\pmb {x x}} ^ {2} U (\pmb {x} ^ {*}, \pmb {y} ^ {*}) & - \nabla_ {\pmb {x y}} ^ {2} U (\pmb {x} ^ {*}, \pmb {y} ^ {*}) \\ \nabla_ {\pmb {y x}} ^ {2} U (\pmb {x} ^ {*}, \pmb {y} ^ {*}) & \nabla_ {\pmb {y y}} ^ {2} U (\pmb {x} ^ {*}, \pmb {y} ^ {*}) \end{array} \right) i s i n v e r t i b l e. +$$ + +For any fixed step size $\eta > 0$ , we can always find matrices $K, P$ so that KPV-GDA method defined in (KPV-GDA) converges locally to $(\pmb{x}^{*}, \pmb{y}^{*})$ . + +This is an existential theorem and cannot be generally useful in practice. Further, this dynamic would not be necessarily uncoupled and the design of matrices $\mathbf{K}$ and $\mathbf{P}$ could necessitate knowledge of the NE we are trying to compute. Instead, our next statement provides sufficient conditions under which a simple parametrization of matrices $\mathbf{K},\mathbf{P}$ results in an uncoupled, converging dynamic: + +Theorem 3.5. Consider a two-team zero-sum game so that the utility of Team $B$ is $U(\pmb{x},\pmb{y})$ , the utility of Team $A$ is $-U(\pmb{x},\pmb{y})$ , and a Nash equilibrium $(\pmb{x}^*,\pmb{y}^*)$ . Moreover, let + +$$ +\mathbf {H} := \left( \begin{array}{c c} - \nabla_ {\boldsymbol {x x}} ^ {2} U (\boldsymbol {x} ^ {*}, \boldsymbol {y} ^ {*}) & - \nabla_ {\boldsymbol {x y}} ^ {2} U (\boldsymbol {x} ^ {*}, \boldsymbol {y} ^ {*}) \\ \nabla_ {\boldsymbol {y x}} ^ {2} U (\boldsymbol {x} ^ {*}, \boldsymbol {y} ^ {*}) & \nabla_ {\boldsymbol {y y}} ^ {2} U (\boldsymbol {x} ^ {*}, \boldsymbol {y} ^ {*}) \end{array} \right). +$$ + +and $E$ be the set of eigenvalues $\rho$ of $\mathbf{H}$ with real part positive, that is $E = \{ \text{Eigenvalues of matrix } \mathbf{H}, \rho : Re(\rho) > 0 \}$ . We assume that $\mathbf{H}$ is invertible and moreover + +$$ +\beta = \min _ {\rho \in E} \frac {R e (\rho) ^ {2} + I m (\rho) ^ {2}}{R e (\rho)} > \max _ {\rho \in E} R e (\rho) = \alpha . \tag {4} +$$ + +We set $\mathbf{K} = k\cdot \mathbf{I}$ , $\mathbf{P} = p\cdot \mathbf{I}$ . There exist small enough step size $\eta >0$ and scalar $p > 0$ and for any $k\in (-\beta , - \alpha)$ so that (KPV-GDA) with chosen $\mathbf{K},\mathbf{P}$ converges locally to $(\boldsymbol {x}^{*},\boldsymbol{y}^{*})$ + +# 4 EXPERIMENTS + +In this section, we perform a series of experiments to further motivate the study of two-team zero-sum games, especially in the context of multi-agent generative adversarial networks (multi-GANs). A multi-agent generative adversarial network (multi-GAN) (Arora et al., 2017; Hoang et al., 2017; Zhang et al., 2018; Tang, 2020; Hardy et al., 2019; Albuquerque et al., 2019) is a generative adversarial network (GAN) that leverages multiple "agents" (generators and/or discriminators) in order to achieve statistical and computational benefits. In particular, Arora et al. formally proved the expressive superiority of multi-generator adversarial network architectures something that we empirically verify in Section 4. In this direction, researchers strive to harness the efficacy of distributed processing by utilizing shallower networks that can collectively learn more diverse datasets4. + +At first, the superiority of multi-GANs might appear to contrast our theoretical findings; but in reality, the superiority comes from the quality of solutions that are attainable from multi-agent architectures (expressivity) and the fact that hardness (complexity) translates to rates of convergence but not non-convergence. Single agent GANs quickly converge to critical points that are not guaranteed to capture the distribution very well. In figure 4 we see the fast convergence of a single-agent GAN to solutions of bad quality versus the convergence of a multi-GAN to an obviously better solution. Due to space constraints, we defer further discussion of the experiments at Section D.1. + +![](images/edd74f1ec4609a57f05699cfd6d51519a0675419361994dd350943352b7d56b6.jpg) +Figure 4: From left to right: (i) Each generator of MGAN learns one mode of the mixture of 8 gaussians, (ii) Mode Collapse of single-agent GANs, (iii) Single-agent GAN can't discriminate between the modes. + +# 5 CONCLUSIONS AND OPEN PROBLEMS + +In this work we study the wide class of nonconvex-nonconcave games that express the two-team competition, inspired broadly by the structure of the complex competition between multi-agent generators and discriminators in GAN's. Furthermore, in this setting of two-team zero-sum games, we have presented a number of negative results about the problem of computing a Nash equilibrium. Moreover, through a simple family of games that we construct, we prove the inability of commonly used methods for min-max optimization such as GDA, OGDA, OMWU, and EG to converge both in average and in the last iterate to Nash Equilibria which comes to a stark contrast to recent literature that is concerned with simpler games. We have also presented an optimization method (called KPV-GDA) that manages to stabilize around Nash equilibria. + +# ACKNOWLEDGEMENTS + +Ioannis Panageas would like to acknowledge a start-up grant. Emmanouil V. VG is grateful for the financial support by FODSI Postdoctoral Fellowship. This work was partially completed while IP and EVVG were visiting research fellows at the Simons Institute for Theory of Computing during Learning and Games Semester. + +# REFERENCES + +Isabela Albuquerque, João Monteiro, Thang Doan, Breandan Considine, Tiago Falk, and Ioannis Mitliagkas. Multi-objective training of generative adversarial networks with multiple discriminators. In International Conference on Machine Learning, pp. 202-211. PMLR, 2019. +Ioannis Anagnostides, Gabriele Farina, Christian Kroer, Andrea Celli, and Tuomas Sandholm. Faster no-regret learning dynamics for extensive-form correlated and coarse correlated equilibria. arXiv preprint arXiv:2202.05446, 2022a. +Ioannis Anagnostides, Ioannis Panageas, Gabriele Farina, and Tuomas Sandholm. On last-iterate convergence beyond zero-sum games. arXiv preprint arXiv:2203.12056, 2022b. +Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein generative adversarial networks. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 214-223, 2017. +Sanjeev Arora, Elad Hazan, and Satyen Kale. The multiplicative weights update method: a meta-algorithm and applications. Theory of Computing, 8(1):121-164, 2012. +Sanjeev Arora, Rong Ge, Yingyu Liang, Tengyu Ma, and Yi Zhang. Generalization and equilibrium in generative adversarial nets (gans). In International Conference on Machine Learning, pp. 224-232. PMLR, 2017. +Moshe Babaioff, Robert Kleinberg, and Christos H Papadimitriou. Congestion games with malicious players. Games and Economic Behavior, 67(1):22-35, 2009. +Yakov Babichenko and Aviad Rubinstein. Settling the complexity of nash equilibrium in congestion games. In Samir Khuller and Virginia Vassilevska Williams (eds.), STOC '21: 53rd Annual ACM SIGACT Symposium on Theory of Computing, Virtual Event, Italy, June 21-25, 2021, pp. 1426-1437. ACM, 2021. +Michael Bacharach. Interactive team reasoning: A contribution to the theory of co-operation. Research in Economics, 53(2):117-147, 1999. ISSN 1090-9443. doi: https://doi.org/10.1006/reec.1999.0188. URL https://www.sciencedirect.com/science/article/pii/S1090944399901886. +Nicola Basilico, Andrea Celli, Giuseppe De Nittis, and Nicola Gatti. Computing the team-maxmin equilibrium in single-team single-adversary team games. Intelligenza Artificiale, 11(1):67-79, 2017a. +Nicola Basilico, Andrea Celli, Giuseppe De Nittis, and Nicola Gatti. Team-maxmin equilibrium: efficiency bounds and algorithms. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 31, 2017b. +A. S. Bazanella, P. V. Kokotovic, and A. S. e Silva. On the control of dynamic systems with unknown operating point. In 1997 European Control Conference (ECC), pp. 3434-3439, 1997. doi: 10.23919/ECC.1997.7082644. +Alexandre S. Bazanella, Petar V. Kokotovic, and Aguinaldo S. E Silva. On the control of dynamic systems with unknown operating point. International Journal of Control, 73(7): 600-605, 2000. doi: 10.1080/002071700219443. URL https://doi.org/10.1080/ 002071700219443. +Kimmo Berg and Tuomas Sandholm. Exclusion method for finding nash equilibrium in multiplayer games. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 31, 2017. + +David Blackwell. An analog of the minimax theorem for vector payoffs. Pacific Journal of Mathematics, 6(1):1-8, 1956. +Christian Borgs, Jennifer Chayes, Nicole Immorlica, Adam Tauman Kalai, Vahab Mirrokni, and Christos Papadimitriou. The myth of the folk theorem. In Proceedings of the fortieth annual ACM symposium on Theory of computing, pp. 365-372, 2008. +Michael Bowling, Neil Burch, Michael Johanson, and Oskari Tammelin. Heads-up limit hold'em poker is solved. Science, 347(6218):145-149, 2015. +Noam Brown and Tuomas Sandholm. Superhuman ai for heads-up no-limit poker: Libratus beats top professionals. Science, 359(6374):418-424, 2018. +Federico Cacciamani, Andrea Celli, Marco Ciccone, and Nicola Gatti. Multi-agent coordination in adversarial environments through signal mediated strategies. In Proceedings of the 20th International Conference on Autonomous Agents and MultiAgent Systems, pp. 269-278, 2021. +Yongcan Cao, Wenwu Yu, Wei Ren, and Guanrong Chen. An overview of recent progress in the study of distributed multi-agent coordination. IEEE Transactions on Industrial informatics, 9(1): 427-438, 2012. +Andrea Celli and Nicola Gatti. Computational results for extensive-form adversarial team games. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018. +N. Cesa-Bianchi and G. Lugosi. On prediction of individual sequences. Annals of Statistics, pp. 1865-1895, 1999. +Chao-Kai Chiang, Tianbao Yang, Chia-Jung Lee, Mehrdad Mahdavi, Chi-Jen Lu, Rong Jin, and Shenghuo Zhu. Online optimization with gradual variations. In Conference on Learning Theory, pp. 6-1. JMLR Workshop and Conference Proceedings, 2012. +Constantinos Daskalakis and Ioannis Panageas. The limit points of (optimistic) gradient descent in min-max optimization. Advances in Neural Information Processing Systems, 31, 2018. +Constantinos Daskalakis and Ioannis Panageas. Last-iterate convergence: Zero-sum games and constrained min-max optimization. Innovations in Theoretical Computer Science, 2019. +Constantinos Daskalakis and Christos Papadimitriou. Continuous local search. In Proceedings of the twenty-second annual ACM-SIAM symposium on Discrete Algorithms, pp. 790-804. SIAM, 2011. +Constantinos Daskalakis, Alex Fabrikant, and Christos H Papadimitriou. The game world is flat: The complexity of nash equilibria in succinct games. In International Colloquium on Automata, Languages, and Programming, pp. 513-524. Springer, 2006. +Constantinos Daskalakis, Paul W Goldberg, and Christos H Papadimitriou. The complexity of computing a nash equilibrium. SIAM Journal on Computing, 39(1):195-259, 2009. +Constantinos Daskalakis, Alan Deckelbaum, and Anthony Kim. Near-optimal no-regret algorithms for zero-sum games. In Proceedings of the twenty-second annual ACM-SIAM symposium on Discrete Algorithms, pp. 235-254. SIAM, 2011. +Constantinos Daskalakis, Stratis Skoulakis, and Manolis Zampetakis. The complexity of constrained min-max optimization. In Proceedings of the 53rd Annual ACM SIGACT Symposium on Theory of Computing, pp. 1466-1478, 2021. +Jelena Diakonikolas, Constantinos Daskalakis, and Michael I Jordan. Efficient methods for structured nonconvex-nonconcave min-max optimization. In International Conference on Artificial Intelligence and Statistics, pp. 2746-2754. PMLR, 2021. +Ishan Durugkar, Ian Gemp, and Sridhar Mahadevan. Generative multi-adversarial networks. arXiv preprint arXiv:1611.01673, 2016. + +Alex Fabrikant, Christos Papadimitriou, and Kunal Talwar. The complexity of pure nash equilibria. In Proceedings of the thirty-sixth annual ACM symposium on Theory of computing, pp. 604-612, 2004. +Gabriele Farina, Andrea Celli, Nicola Gatti, and Tuomas Sandholm. Ex ante coordination and collusion in zero-sum multi-player extensive-form games. Advances in Neural Information Processing Systems, 31, 2018. +John Fearnley, Paul W Goldberg, Alexandros Hollender, and Rahul Savani. The complexity of gradient descent: CLS = PPAD∩PLS. In Proceedings of the 53rd Annual ACM SIGACT Symposium on Theory of Computing, pp. 46-59, 2021. +Lampros Flokas, Emmanouil-Vasileios Vlatakis-Gkaragkounis, and Georgios Piliouras. Solving min-max optimization with hidden structure via gradient descent ascent. In Advances in Neural Information Processing Systems 35: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 2021, virtual, 2021. +Drew Fudenberg. Jean tirole game theory, 1991. +Ian Gemp, Rahul Savani, Marc Lanctot, Yoram Bachrach, Thomas Anthony, Richard Everett, Andrea Tacchetti, Tom Eccles, and János Kramár. Sample-based approximation of nash in large many-player games via gradient descent. arXiv preprint arXiv:2106.01285, 2021. +Natalie Gold. Introduction: Teamwork in theory and in practice. In Teamwork, pp. 1-21. Springer, 2005. +Noah Golowich, Sarath Pattathil, and Constantinos Daskalakis. Tight last-iterate convergence rates for no-regret learning in multi-player games. Advances in neural information processing systems, 33:20766-20778, 2020. +Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron C. Courville, and Yoshua Bengio. Generative Adversarial Nets. In Advances in Neural Information Processing Systems 27: Annual Conference on Neural Information Processing Systems 2014, December 8-13 2014, Montreal, Quebec, Canada, pp. 2672-2680, 2014. +Hans W Gottinger. J. marschak and roy radner,"economic theory of teams"(book review).Theory and Decision,5(3):349,1974. +James Hannan. 4. approximation to rayes risk in repeated play. In Contributions to the Theory of Games (AM-39), Volume III, pp. 97-140. Princeton University Press, 2016. +Coretin Hardy, Erwan Le Merrer, and Bruno Sericola. Md-gan: Multi-discriminator generative adversarial networks for distributed datasets. In 2019 IEEE international parallel and distributed processing symposium (IPDPS), pp. 866-877. IEEE, 2019. +Munther A Hassouneh, Hsien-Chiarn Lee, and Eyad H Abed. Washout filters in feedback control: Benefits, limitations and extensions. In Proceedings of the 2004 American control conference, volume 5, pp. 3950-3955. IEEE, 2004. +Quan Hoang, Tu Dinh Nguyen, Trung Le, and Dinh Phung. Multi-generator generative adversarial nets. arXiv preprint arXiv:1708.02556, 2017. +Quan Hoang, Tu Dinh Nguyen, Trung Le, and Dinh Phung. Mgan: Training generative adversarial nets with multiple generators. In International conference on learning representations, 2018. +Max Jaderberg, Wojciech M Czarnecki, Iain Dunning, Luke Marris, Guy Lever, Antonio Garcia Castaneda, Charles Beattie, Neil C Rabinowitz, Ari S Morcos, Avraham Ruderman, et al. Human-level performance in 3d multiplayer games with population-based reinforcement learning. Science, 364(6443):859-865, 2019. +Jeongbin Kim, Thomas R Palfrey, and Jeffrey R Zeidel. A theory of games played by teams of players. 2019. + +R. Kleinberg, G. Piliouras, and E. Tardos. Multiplicative updates outperform generic no-regret learning in congestion games. In STOC, 2009. +GM Korpelevich. The extragradient method for finding saddle points and other problems. Matecon, 12:747-756, 1976. +Jason D. Lee, Ioannis Panageas, Georgios Piliouras, Max Simchowitz, Michael I. Jordan, and Benjamin Recht. First-order methods almost always avoid strict saddle points. Math. Program., 176(1-2):311-337, 2019. doi: 10.1007/s10107-019-01374-3. URL https://doi.org/10.1007/s10107-019-01374-3. +Joel Z Leibo, Vinicius Zambaldi, Marc Lanctot, Janusz Marecki, and Thore Graepel. Multi-agent reinforcement learning in sequential social dilemmas. arXiv preprint arXiv:1702.03037, 2017. +Dan Li, Dacheng Chen, Baihong Jin, Lei Shi, Jonathan Goh, and See-Kiong Ng. Mad-gan: Multivariate anomaly detection for time series data with generative adversarial networks. In International Conference on Artificial Neural Networks, pp. 703-716. Springer, 2019. +Tianyi Lin, Chi Jin, and Michael Jordan. On gradient descent ascent for nonconvex-concave minimax problems. In International Conference on Machine Learning, pp. 6083-6093. PMLR, 2020. +Richard J Lipton, Evangelos Markakis, and Aranyak Mehta. Playing large games using simple strategies. In Proceedings of the 4th ACM Conference on Electronic Commerce, pp. 36-41, 2003. +Jakob Marschak. Elements for a theory of teams. Management science, 1(2):127-137, 1955. +H Brendan McMahan, Geoffrey J Gordon, and Avrim Blum. Planning in the presence of cost functions controlled by an adversary. In Proceedings of the 20th International Conference on Machine Learning (ICML-03), pp. 536-543, 2003. +R. Mehta, I. Panageas, and G. Piliouras. Natural selection as an inhibitor of genetic diversity: Multiplicative weights updates algorithm and a conjecture of haploid genetics. In ITCS, 2015. +Panayotis Mertikopoulos, Christos Papadimitriou, and Georgios Piliouras. Cycles in adversarial regularized learning. In Proceedings of the Twenty-Ninth Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 2703-2717. SIAM, 2018. +Panayotis Mertikopoulos, Houssam Zenati, Bruno Lecouat, Chuan-Sheng Foo, Vijay Chandrasekhar, and Georgios Piliouras. Optimistic mirror descent in saddle-point problems: Going the extra (gradient) mile. In ICLR'19-International Conference on Learning Representations, pp. 1-23, 2019. +Dov Monderer and Lloyd S Shapley. Potential games. Games and economic behavior, 14(1):124-143, 1996. +Matej Moravcik, Martin Schmid, Neil Burch, Viliam Lisy, Dustin Morrill, Nolan Bard, Trevor Davis, Kevin Waugh, Michael Johanson, and Michael Bowling. Deepstack: Expert-level artificial intelligence in heads-up no-limit poker. Science, 356(6337):508-513, 2017. +Mohammad Sal Moslehian. Ky fan inequalities. CoRR, abs/1108.1467, 2011. +Thomas Nagylaki. The evolution of multilocus systems under weak selection. Genetics, 134(2): 627-647, 1993. +Arkadj Semenovič Nemirovskij and David Borisovich Yudin. Problem complexity and method efficiency in optimization. 1983. +Martin A Nowak, Akira Sasaki, Christine Taylor, and Drew Fudenberg. Emergence of cooperation and evolutionary stability in finite populations. Nature, 428(6983):646-650, 2004. +Christos H Papadimitriou. The complexity of the lin-kernighan heuristic for the traveling salesman problem. SIAM Journal on Computing, 21(3):450-465, 1992. +Leonid Denisovich Popov. A modification of the arrow-hurwicz method for search of saddle points. Mathematical notes of the Academy of Sciences of the USSR, 28(5):845-848, 1980. + +Julia Robinson. An iterative method of solving a game. Annals of mathematics, pp. 296-301, 1951. +R.W. Rosenthal. A class of games possessing pure-strategy Nash equilibria. International Journal of Game Theory, 2(1):65-67, 1973. +Tim Roughgarden. Intrinsic robustness of the price of anarchy. In Proceedings of the forty-first annual ACM symposium on Theory of computing, pp. 513-522, 2009. +Leonard J. Schulman and Umesh V. Vazirani. The duality gap for two-team zero-sum games. Games Econ. Behav., 115:336-345, 2019a. doi: 10.1016/j.geb.2019.03.011. URL https://doi.org/10.1016/j.geb.2019.03.011. +Leonard J Schulman and Umesh V Vazirani. The duality gap for two-team zero-sum games. Games and Economic Behavior, 115:336-345, 2019b. +Hassam Ullah Sheikh, Mina Razghandi, and Ladislau Boloni. Learning distributed cooperative policies for security games via deep reinforcement learning. In 2019 IEEE 43rd Annual Computer Software and Applications Conference (COMPSAC), volume 1, pp. 489-494. IEEE, 2019. +Karthik Sridharan. Learning from an optimization viewpoint. arXiv preprint arXiv:1204.4145, 2012. +Karthik Sridharan and Ambuj Tewari. Convex games in banach spaces. $COLT$ 2010, pp. 1, 2010. +Vasilis Syrgkanis, Alekh Agarwal, Haipeng Luo, and Robert E Schapire. Fast convergence of regularized learning in games. In Advances in Neural Information Processing Systems, pp. 2989-2997, 2015. +Shichang Tang. Lessons learned from the training of gans on artificial datasets. IEEE Access, 8: 165044-165055, 2020. +Liang Tong, Sixie Yu, Scott Alfeld, et al. Adversarial regression with multiple learners. In International Conference on Machine Learning, pp. 4946-4954. PMLR, 2018. +Oriol Vinyals, Igor Babuschkin, Wojciech M Czarnecki, Michael Mathieu, Andrew Dudzik, Junyoung Chung, David H Choi, Richard Powell, Timo Ewalds, Petko Georgiev, et al. Grandmaster level in starcraft ii using multi-agent reinforcement learning. Nature, 575(7782):350-354, 2019. +Yannick Viossat and Andriy Zapechelyuk. No-regret dynamics and fictitious play. Journal of Economic Theory, 148(2):825-842, 2013. +Emmanouil-Vasileios Vlatakis-Gkaragkounis, Lampros Flokas, and Georgios Piliouras. Poincaré recurrence, cycles and spurious equilibria in gradient-descent-ascent for non-convex nonconcave zero-sum games. In Hanna M. Wallach, Hugo Larochelle, Alina Beygelzimer, Florence d'Alché-Buc, Emily B. Fox, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pp. 10450-10461, 2019. URL https://proceedings.neurips.cc/paper/2019/ hash/6c7cd904122e623ce625613d6af337c4-Abstract.html. +John Von Neumann. Zur theorie der gesellschaftsspiele. Math, 100:295-320, 1928. +Bernhard von Stengel and Daphne Koller. Team-maxmin equilibria. Games and Economic Behavior, 21(1-2):309-321, 1997. +Hongyang Zhang, Susu Xu, Jiantao Jiao, Pengtao Xie, Ruslan Salakhutdinov, and Eric P Xing. Stackelberg gan: Towards provable minimax equilibrium via multi-generator architectures. arXiv preprint arXiv:1811.08010, 2018. +Youzhi Zhang and Bo An. Converging to team-maxmin equilibria in zero-sum multiplayer games. In International Conference on Machine Learning, pp. 11033-11043. PMLR, 2020. +Youzhi Zhang, Bo An, and Jakub Černý. Computing ex ante coordinated team-maxmin equilibria in zero-sum multiplayer extensive-form games. arXiv preprint arXiv:2009.12629, 2020. +Dao Li Zhu and Patrice Marcotte. Co-coercivity and its role in the convergence of iterative schemes for solving variational inequalities. SIAM Journal on Optimization, 6(3):714-726, 1996. \ No newline at end of file diff --git a/towardsconvergencetonashequilibriaintwoteamzerosumgames/images.zip b/towardsconvergencetonashequilibriaintwoteamzerosumgames/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..69f960379cb9c9236a04c2f054c7fd27d2c20aaa --- /dev/null +++ b/towardsconvergencetonashequilibriaintwoteamzerosumgames/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9d59be5b1134cfcff6bf77748218091dc85f9923482da9582d099bb477ec1704 +size 161188 diff --git a/towardsconvergencetonashequilibriaintwoteamzerosumgames/layout.json b/towardsconvergencetonashequilibriaintwoteamzerosumgames/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..2470568592b9c06157bb595e0855442801c07e65 --- /dev/null +++ b/towardsconvergencetonashequilibriaintwoteamzerosumgames/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:85dc030fbf11e9724db4ce39384921e821d3328f71d52c2e37d65f1a511747d5 +size 505059 diff --git a/towardsthegeneralizationofcontrastiveselfsupervisedlearning/ba91a1ec-18bd-462a-93e5-dee94f15572a_content_list.json b/towardsthegeneralizationofcontrastiveselfsupervisedlearning/ba91a1ec-18bd-462a-93e5-dee94f15572a_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..ea01eabb8be3b01ec1f85399e3030afb9ae8be14 --- /dev/null +++ b/towardsthegeneralizationofcontrastiveselfsupervisedlearning/ba91a1ec-18bd-462a-93e5-dee94f15572a_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:12a749f186d2779192f3cf9c4b5d365d311c145b315388a1ca0a78f7131b45b4 +size 237128 diff --git a/towardsthegeneralizationofcontrastiveselfsupervisedlearning/ba91a1ec-18bd-462a-93e5-dee94f15572a_model.json b/towardsthegeneralizationofcontrastiveselfsupervisedlearning/ba91a1ec-18bd-462a-93e5-dee94f15572a_model.json new file mode 100644 index 0000000000000000000000000000000000000000..e38b252ca930f0004c0da16645e4e03271356335 --- /dev/null +++ b/towardsthegeneralizationofcontrastiveselfsupervisedlearning/ba91a1ec-18bd-462a-93e5-dee94f15572a_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e0b8188ac46a66dff6ebac1894d00b167e3801d574c8ae48f2802d5a19034bed +size 265412 diff --git a/towardsthegeneralizationofcontrastiveselfsupervisedlearning/ba91a1ec-18bd-462a-93e5-dee94f15572a_origin.pdf b/towardsthegeneralizationofcontrastiveselfsupervisedlearning/ba91a1ec-18bd-462a-93e5-dee94f15572a_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6618fcd21a3e3919facca0668df5ab4979fcb382 --- /dev/null +++ b/towardsthegeneralizationofcontrastiveselfsupervisedlearning/ba91a1ec-18bd-462a-93e5-dee94f15572a_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f687162cb7011ed64b853568392553e3c828b6df6a55372ba92dc80b7dacbcb5 +size 1770596 diff --git a/towardsthegeneralizationofcontrastiveselfsupervisedlearning/full.md b/towardsthegeneralizationofcontrastiveselfsupervisedlearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..052e81c83a9fe898d5496f944de729369868badb --- /dev/null +++ b/towardsthegeneralizationofcontrastiveselfsupervisedlearning/full.md @@ -0,0 +1,1003 @@ +# TOWARDS THE GENERALIZATION OF CONTRASTIVE SELF-SUPERVISED LEARNING + +Weiran Huang $^{1*}$ Mingyang Yi $^{2*}$ Xuyang Zhao $^{3*}$ Zihao Jiang $^{1}$ + +$^{1}$ Qing Yuan Research Institute, Shanghai Jiao Tong University +$^{2}$ Huawei Noah's Ark Lab +$^{3}$ School of Mathematical Sciences, Peking University + +# ABSTRACT + +Recently, self-supervised learning has attracted great attention, since it only requires unlabeled data for model training. Contrastive learning is one popular method for self-supervised learning and has achieved promising empirical performance. However, the theoretical understanding of its generalization ability is still limited. To this end, we define a kind of $(\sigma, \delta)$ -measure to mathematically quantify the data augmentation, and then provide an upper bound of the downstream classification error rate based on the measure. It reveals that the generalization ability of contrastive self-supervised learning is related to three key factors: alignment of positive samples, divergence of class centers, and concentration of augmented data. The first two factors are properties of learned representations, while the third one is determined by pre-defined data augmentation. We further investigate two canonical contrastive losses, InfoNCE and cross-correlation, to show how they provably achieve the first two factors. Moreover, we conduct experiments to study the third factor, and observe a strong correlation between downstream performance and the concentration of augmented data. + +# 1 INTRODUCTION + +Contrastive Self-Supervised Learning (SSL) has attracted great attention for its fantastic data efficiency and generalization ability in computer vision (He et al., 2020; Chen et al., 2020a,b; Grill et al., 2020; Chen & He, 2021; Zbontar et al., 2021) and natural language processing (Fang et al., 2020; Wu et al., 2020; Giorgi et al., 2020; Gao et al., 2021; Yan et al., 2021). It learns the representation through a large number of unlabeled data and manually designed supervision signals (i.e., regarding the augmented views of a data sample as positive samples). The model is updated by encouraging the features of positive samples close to each other. To overcome the feature collapse issue, various losses (e.g., InfoNCE (Chen et al., 2020a; He et al., 2020) and cross-correlation (Zbontar et al., 2021)) and training strategies (e.g., stop gradient (Grill et al., 2020; Chen & He, 2021)) are proposed. + +In spite of the empirical success of contrastive SSL in terms of their generalization ability on downstream tasks, the theoretical understanding is still limited. Arora et al. (2019) propose a theoretical framework to show the provable downstream performance of contrastive SSL based on the InfoNCE loss. However, their results rely on the assumption that positive samples are drawn from the same latent class, instead of the augmented views of a data point as in practice. Wang & Isola (2020) propose alignment and uniformity to explain the downstream performance, but they are empirical indicators and lack of theoretical generalization guarantees. Both of the above works avoid characterizing the important role of data augmentation, which is the key to the success of contrastive SSL, since the only human knowledge is injected via data augmentation. Recently, HaoChen et al. (2021) propose to model the augmented data as a graph and study contrastive SSL from a matrix decomposition perspective, but it is only applicable to their own spectral contrastive loss. + +Besides the limitations of existing contrastive SSL theories, there are also some interesting empirical observations that have not been unraveled theoretically yet. For example, why does the richer data + +![](images/5984c7aabaca65b21f9f2f538e8ef96dd1a64dc4db9c8733bd1eb9d402a0a2cc.jpg) +(a) Initial + +![](images/ec94d0fb2861e0f360e3258f70ac1c4216e238bb0e4c34c6946ab924ab2de77c.jpg) +(b) Only color distortion +Figure 1: SimCLR's embedding space with different richnesses of data augmentations on CIFAR-10. + +![](images/a13668364fa9d0f55d305446182b45fbc80f9a6b5c73cf36c9202494f76c307f.jpg) +(c) Multiple transformations + +augmentation lead to the more clustered structure in the embedding space (Figure 1) as well as the better downstream performance (also observed by Chen et al. (2020a))? Why is aligning positive samples (augmented from the "same data point") able to gather the samples from the "same latent class" into a cluster (Figure 1c)? More interestingly, decorrelating components of representation like Barlow Twins (Zbontar et al., 2021) does not directly optimize the geometry of embedding space, but it still results in the clustered structure. Why is this? + +In this paper, we focus on exploring the generalization ability of contrastive SSL provably, which can explain the above interesting observations. We start with understanding the role of data augmentation in contrastive SSL. Intuitively, samples from the same latent class are likely to have similar augmented views, which are mapped to the close locations in the embedding space. Since the augmented views of each sample are encouraged to be clustered in the embedding space by contrastive learning, different samples from the same latent class tend to be pulled closer. As an example, let's consider two images of dogs with different backgrounds (Figure 2). If we augment them with transformation "crop", we may get two similar views (dog heads), whose representations (gray points in the embedding space) are close. As the augmented views of + +![](images/58853b98b97498c590bcc1e34c25f953afecb65c842eea1546a7aa1058d5be30.jpg) +Figure 2: Mechanism of Clustering + +each dog image are enforced to be close in the embedding space due to the objective of contrastive learning, the representations of two dog images (green and blue points) will be pulled closer to their augmented views (gray points). In this way, aligning positive samples is able to gather samples from the same class, and thus results in the clustered embedding space. Following the above intuition, we define the augmented distance between two samples as the minimum distance between their augmented views, and further introduce the $(\sigma, \delta)$ -augmentation to measure the concentration of augmented data, i.e., for each latent class, the proportion of samples located in a ball with diameter $\delta$ (w.r.t. the augmented distance) is larger than $\sigma$ . + +With the mathematical description of data augmentation settled, we then prove an upper bound of downstream classification error rate in Section 3. It reveals that the generalization of contrastive SSL is related to three key factors. The first one is alignment of positive samples, which is a common objective that contrastive learning algorithms aim to optimize. The second one is divergence of class centers, which prevents the collapse of representation. The third factor is concentration of augmented data, i.e., a sharper concentration of augmented data indicates a better generalization error bound. We remark that the first two factors are properties of representations that can be optimized during the learning process. However, the third factor is determined by pre-defined data augmentation and is independent of the learning process. Thus, data augmentation plays a crucial role in contrastive SSL. + +We then study the above three factors in more depth. In Section 4, we rigorously prove that not only the InfoNCE loss but also the cross-correlation loss (which does not directly optimize the geometry of embedding space) can satisfy the first two factors. For the third factor, we conduct various experiments on the real-world datasets and observe that the downstream performance of contrastive SSL is highly correlated to the concentration of augmented data in Section 5. + +In summary, our contributions include: 1) proposing a novel $(\sigma, \delta)$ -measure to quantify data augmentation; 2) presenting a theoretical framework for contrastive SSL that highlights alignment, + +divergence, and concentration as key factors for generalization ability; 3) provably verifying that not only the InfoNCE loss but also the cross-correlation loss satisfy alignment and divergence; 4) showing a strong correlation between downstream performance and concentration of augmented data. + +# RELATED WORK + +Algorithms of Contrastive SSL. Early works such as MoCo (He et al., 2020) and SimCLR (Chen et al., 2020a), use the InfoNCE loss to pull the positive samples close while enforcing them away from the negative samples in the embedding space. These methods require large batch sizes (Chen et al., 2020a), memory banks (He et al., 2020), or carefully designed negative sampling strategies (Hu et al., 2021). To obviate these, some recent works get rid of negative samples and prevent representation collapse by cross-correlation loss (Zbontar et al., 2021; Bardes et al., 2021) or training strategies (Grill et al., 2020; Chen & He, 2021). In this paper, we mainly study the effectiveness of the InfoNCE loss and the cross-correlation loss, and do not enter the discussion of training strategies. + +Theoretical Understandings of Contrastive SSL. Most theoretical analysis is based on the InfoNCE loss, and lack of understanding of recently proposed cross-correlation loss (Zbontar et al., 2021). Early works understand the InfoNCE loss based on maximizing the mutual information (MI) between positive samples (Oord et al., 2018; Bachman et al., 2019; Hjelm et al., 2018; Tian et al., 2019; Tschannen et al., 2019). However, a rigorous relationship between mutual information and downstream performance has not been established. Besides, Arora et al. (2019) directly analyze the generalization of InfoNCE loss based on the assumption that positive samples are drawn from the same latent classes, which is different from practical algorithms. Ash et al. (2021) study the role of negative samples and show an interesting collision-coverage trade-off theoretically. HaoChen et al. (2021) study contrastive SSL from a matrix decomposition perspective, but it is only applicable to their spectral contrastive loss. The behavior of InfoNCE is also studied from the perspective of alignment and uniformity (Wang & Isola, 2020), sparse coding model (Wen & Li, 2021), the expansion assumption (Wei et al., 2020), stochastic neighbor embedding (Hu et al., 2022), and augmentation robustness (Zhao et al., 2023). + +# 2 PROBLEM FORMULATION + +Given a number of unlabeled training data i.i.d. drawn from an unknown distribution, each sample belongs to one of $K$ latent classes $C_1, C_2, \ldots, C_K$ . Based on an augmentation set $A$ , the set of potential positive samples generated from a data point $x$ is denoted as $A(x)$ . We assume that $x \in A(x)$ for any $x$ , and samples from different latent classes never transform into the same augmented sample, i.e., $A(C_k) \cap A(C_\ell) = \emptyset$ for any $k \neq \ell$ . Notation $\| \cdot \|$ in this paper stands for $\ell_2$ -norm or Frobenius norm for vectors and matrices, respectively. + +Contrastive SSL aims to learn an encoder $f$ , such that positive samples are closely aligned. In order to make the samples from different latent classes far away from each other, some methods such as (Chen et al., 2020a; He et al., 2020) use the InfoNCE loss1 to push away negative pairs, formulated as + +$$ +\mathcal{L}_{\text{InfoNCE}} = -\underset { \begin{array}{c}\boldsymbol {x},\boldsymbol{x}^{\prime}\\ \boldsymbol{x}^{-}\in A(\boldsymbol{x}^{\prime}) \end{array} }{\mathbb{E}}\underset { \begin{array}{c}\boldsymbol {x}_{1},\boldsymbol{x}_{2}\in A(\boldsymbol {x})\\ \boldsymbol{x}^{-}\in A(\boldsymbol{x}^{\prime}) \end{array} }{\mathbb{E}}\log \frac{e^{f(\boldsymbol{x}_{1})^{\top}f(\boldsymbol{x}_{2})}}{e^{f(\boldsymbol{x}_{1})^{\top}f(\boldsymbol{x}_{2})} + e^{f(\boldsymbol{x}_{1})^{\top}f(\boldsymbol{x}^{-})}}, +$$ + +where $\pmb{x}$ , $\pmb{x}'$ are two random data points. Some other methods such as Barlow Twins (Zbontar et al., 2021) use the cross-correlation loss to decorrelate the components of representation, formulated as + +$$ +\mathcal {L} _ {\text {C r o s s - C o r r}} = \sum_ {i = 1} ^ {d} (1 - F _ {i i}) ^ {2} + \lambda \sum_ {i = 1} ^ {d} \sum_ {i \neq j} F _ {i j} ^ {2}, +$$ + +where $F_{ij} = \mathbb{E}_{\boldsymbol{x}}\mathbb{E}_{\boldsymbol{x}_1,\boldsymbol{x}_2\in A(\boldsymbol{x})}[f_i(\boldsymbol{x}_1)f_j(\boldsymbol{x}_2)], d$ is the dimension of encoder $f$ , and encoder $f$ is normalized as $\mathbb{E}_{\boldsymbol{x}}\mathbb{E}_{\boldsymbol{x}'\in A(\boldsymbol{x})}[f_i(\boldsymbol{x}')^2] = 1$ for each dimension $i$ . + +The standard evaluation of contrastive SSL is to train a linear classifier over the learned representation using labeled data and regard its performance as the indicator. To simplify the analysis, we instead + +consider a non-parametric classifier – nearest neighbor (NN) classifier: + +$$ +G_{f}(\boldsymbol {x}) = \operatorname *{arg min}_{k\in [K]}\| f(\boldsymbol {x}) - \mu_{k}\| , +$$ + +where $\mu_k \coloneqq \mathbb{E}_{\boldsymbol{x} \in C_k} \mathbb{E}_{\boldsymbol{x}' \in A(\boldsymbol{x})}[f(\boldsymbol{x}')]$ is the center of class $C_k$ . In fact, the NN classifier is a special case of linear classifier, since it can be reformulated as $G_f(\boldsymbol{x}) = \arg \max_{k \in [K]} (Wf(\boldsymbol{x}) + b)_k$ , where the $k$ -th row of $W$ is $\mu_k$ and $b_k = -\frac{1}{2}\|\mu_k\|^2$ (See Appendix E). Therefore, the directly learned linear classifier used in practice should perform better than the NN classifier. In this paper, we use the classification error rate to quantify the performance of $G_f$ , formulated as + +$$ +\operatorname {E r r} \left(G _ {f}\right) = \sum_ {k = 1} ^ {K} \mathbb {P} \left[ G _ {f} (\boldsymbol {x}) \neq k, \forall \boldsymbol {x} \in C _ {k} \right]. +$$ + +Our goal is to study why contrastive SSL is able to achieve a small $\mathrm{Err}(G_f)$ . + +# 3 GENERALIZATION GUARANTEE OF CONTRASTIVE SSL + +Based on the NN classifier, if the samples are well clustered by latent classes in the embedding space, the error rate $\mathrm{Err}(G_f)$ should be small. Thus, one expects to have a small intra-class distance $\mathbb{E}_{\pmb{x}_1,\pmb{x}_2\in C_k}\| f(\pmb{x}_1) - f(\pmb{x}_2)\|^2$ for an encoder $f$ learned by contrastive learning. However, contrastive algorithms can only control the alignment of positive samples $\mathbb{E}_{\pmb{x}_1,\pmb{x}_2\in A(\pmb{x})}\| f(\pmb{x}_1) - f(\pmb{x}_2)\|^2$ . To bridge the gap between them, we need to investigate the role of data augmentation. + +Motivated by Figure 2 introduced in Section 1, for a given augmentation set $A$ , we define the augmented distance between two samples as the minimum distance between their augmented views: + +$$ +d _ {A} \left(\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2}\right) = \min _ {\boldsymbol {x} _ {1} ^ {\prime} \in A \left(\boldsymbol {x} _ {1}\right), \boldsymbol {x} _ {2} ^ {\prime} \in A \left(\boldsymbol {x} _ {2}\right)} \| \boldsymbol {x} _ {1} ^ {\prime} - \boldsymbol {x} _ {2} ^ {\prime} \|. \tag {1} +$$ + +For the dog images in Figure 2 as an example, even though their pixel-level differences are significant, their semantic meanings are similar. Meanwhile, they also have a small augmented distance. Thus, the proposed augmented distance can partially capture the semantic distance. Based on the augmented distance, we now introduce the $(\sigma, \delta)$ -augmentation to measure the concentration of augmented data. + +Definition 1 $((\sigma, \delta)$ -Augmentation). The augmentation set $A$ is called a $(\sigma, \delta)$ -augmentation, if for each class $C_k$ , there exists a subset $C_k^0 \subseteq C_k$ (called a main part of $C_k$ ), such that both $\mathbb{P}[\pmb{x} \in C_k^0] \geq \sigma \mathbb{P}[\pmb{x} \in C_k]$ where $\sigma \in (0,1]$ and $\sup_{\pmb{x}_1, \pmb{x}_2 \in C_k^0} d_A(\pmb{x}_1, \pmb{x}_2) \leq \delta$ hold. + +In other words, the main-part samples locate in a ball with diameter $\delta$ (w.r.t. the augmented distance) and its proportion is larger than $\sigma$ . Larger $\sigma$ and smaller $\delta$ indicate the sharper concentration of augmented data. For any $A' \supseteq A$ with richer augmentations, one can verify that $d_{A'}(\pmb{x}_1, \pmb{x}_2) \leq d_A(\pmb{x}_1, \pmb{x}_2)$ for any $\pmb{x}_1, \pmb{x}_2$ . Therefore, richer data augmentations lead to sharper concentration as $\delta$ gets smaller. With Definition 1, our analysis will focus on the samples in the main parts with good alignment, i.e., $(C_1^0 \cup \dots \cup C_K^0) \cap S_\varepsilon$ , where $S_\varepsilon := \{\pmb{x} \in \cup_{k=1}^K C_k : \forall \pmb{x}_1, \pmb{x}_2 \in A(\pmb{x}), \|f(\pmb{x}_1) - f(\pmb{x}_2)\| \leq \varepsilon\}$ is the set of samples with $\varepsilon$ -close representations among augmented data. Furthermore, we let $R_\varepsilon := \mathbb{P}\left[\overline{S_\varepsilon}\right]$ , which is provably small with good alignment (see Theorem 2). + +Lemma 3.1. For a $(\sigma, \delta)$ -augmentation with main part $C_k^0$ of each class $C_k$ , if all samples belonging to $(C_1^0 \cup \dots \cup C_K^0) \cap S_\varepsilon$ can be correctly classified by a classifier $G$ , then its classification error rate $\mathrm{Err}(G)$ is upper bounded by $(1 - \sigma) + R_\varepsilon$ . + +The proof is deferred to the appendix. The above lemma presents a simple sufficient condition to guarantee the generalization ability on downstream tasks. Based on it, we need to further explore when samples in $(C_1^0\cup \dots \cup C_K^0)\cap S_\varepsilon$ can be all correctly classified by the NN classifier. + +We assume that encoder $f$ is normalized by $\| f\| = r$ , and it is $L$ -Lipschitz continuity, i.e., for any $x_{1},x_{2}$ , $\| f(x_{1}) - f(x_{2})\| \leq L\| x_{1} - x_{2}\|$ . We let $p_k\coloneqq \mathbb{P}[x\in C_k]$ for any $k\in [K]$ . + +Lemma 3.2. Given a $(\sigma, \delta)$ -augmentation used in contrastive SSL, for any $\ell \in [K]$ , if $\mu_{\ell}^{\top}\mu_{k} < r^{2}\left(1 - \rho_{\ell}(\sigma, \delta, \varepsilon) - \sqrt{2\rho_{\ell}(\sigma, \delta, \varepsilon)} - \frac{\Delta_{\mu}}{2}\right)$ holds for all $k \neq \ell$ , then every sample $\mathbf{x} \in C_{\ell}^{0} \cap S_{\varepsilon}$ can be correctly classified by the NN classifier $G_{f}$ , where $\rho_{\ell}(\sigma, \delta, \varepsilon) = 2(1 - \sigma) + \frac{R_{\varepsilon}}{p_{\ell}} + \sigma\left(\frac{L\delta}{r} + \frac{2\varepsilon}{r}\right)$ and $\Delta_{\mu} = 1 - \min_{k \in [K]} \| \mu_{k} \|^{2} / r^{2}$ . + +With Lemma 3.1 and 3.2, we can directly obtain the generalization guarantee of contrastive SSL: + +Theorem 1. Given a $(\sigma, \delta)$ -augmentation used in contrastive SSL, if + +$$ +\mu_ {\ell} ^ {\top} \mu_ {k} < r ^ {2} \left(1 - \rho_ {\max } (\sigma , \delta , \varepsilon) - \sqrt {2 \rho_ {\max } (\sigma , \delta , \varepsilon)} - \frac {\Delta_ {\mu}}{2}\right) \tag {2} +$$ + +holds for any pair of $(\ell, k)$ with $\ell \neq k$ , then the downstream error rate of NN classifier $G_{f}$ + +$$ +\operatorname {E r r} \left(G _ {f}\right) \leq (1 - \sigma) + R _ {\varepsilon}, \tag {3} +$$ + +where $\rho_{max}(\sigma, \delta, \varepsilon) = 2(1 - \sigma) + \frac{R_{\varepsilon}}{\min_{\ell} p_{\ell}} + \sigma \left(\frac{L \delta}{r} + \frac{2 \varepsilon}{r}\right)$ and $\Delta_{\mu} = 1 - \min_{k \in [K]} \| \mu_k \|^2 / r^2$ . + +The proof is deferred to the appendix. To better understand the above theorem, let us first consider a simple case that any two samples from the latent same class at least own a same augmented view $(\sigma = 1,\delta = 0)$ , and the positive samples are perfectly aligned after contrastive learning $(\varepsilon = 0,R_{\varepsilon} = 0)$ . In this case, the samples from the same latent class are embedded to a single point on the hypersphere, and thus arbitrarily small positive angle $\frac{\langle\mu_{\ell},\mu_k\rangle}{\|\mu_{\ell}\| \cdot \|\mu_{k}\|} < 1$ is enough to distinguish them by the NN classifier. In fact, one can quickly verify that $\rho_{max}(\sigma ,\delta ,\varepsilon) = \Delta_{\mu} = 0$ holds in the above case. According to Theorem 1, if $\mu_{\ell}^{\top}\mu_{k} / r^{2} < 1 - \rho_{max}(\sigma ,\delta ,\varepsilon) - \sqrt{2\rho_{max}(\sigma,\delta,\varepsilon)} -\frac{\Delta_{\mu}}{2} = 1$ , then $\mathrm{Err}(G_f) = 0$ , i.e., NN classifier can correctly recognize every sample when $\mu_{\ell}^{\top}\mu_{k} / r^{2} < 1$ . Thus, the condition suggested by Theorem 1 is exactly the same as the intuition. + +Theorem 1 implies three key factors to the success of contrastive SSL. The first one is alignment of positive samples, which is a common objective that contrastive algorithms aim to optimize. Better alignment enables smaller $R_{\varepsilon}$ , which directly decreases the generalization error bound (3). The second factor is divergence of class centers, i.e., the distance between class centers should be large enough (small $\mu_{\ell}^{\top}\mu_{k}$ ). The divergence condition (2) is related to the alignment $(R_{\varepsilon})$ and data augmentation $(\sigma, \delta)$ . Better alignment and sharper concentration indicate smaller $\rho_{max}(\sigma, \delta, \varepsilon)$ , and hence looser divergence condition. The third factor is concentration of augmented data. When $\delta$ is given, sharper concentration implies larger $\sigma$ , which directly affects the generalization error bound (3). For example, richer data augmentations lead to sharper concentration (see the paragraph below Definition 1), and hence better generalization error bound. Only the first two factors can be optimized during the learning process, and we will provably show how it can be achieved via two concrete examples in Section 4. In contrast, the third factor is primarily decided by the pre-defined data augmentation and is independent of the learning process. We will empirically study how the concentration of augmented data affects the downstream performance in Section 5. In summary, Theorem 1 provides a framework for different algorithms to analyze their generalization abilities. + +Compared with the alignment and uniformity proposed by Wang & Isola (2020), both of the works have the same meaning of "alignment" since it is the objective that contrastive algorithms aim to optimize, but our "divergence" is fundamentally different from their "uniformity". Uniformity requires "all data" uniformly distributed on the embedding hypersphere, while our divergence characterizes the cosine distance between "class centers". We do not require the divergence to be as large as better, instead, the divergence condition can be loosened by better alignment and concentration properties. As an example, consider the case below Theorem 1. Since all the samples from the same latent class are embedded into a single point on the hypersphere, in that case, an arbitrarily small positive angle (arbitrarily small divergence) is enough to distinguish them. More importantly, alignment and uniformity are empirical predictors for downstream performance, while our alignment and divergence have explicit theoretical guarantees (Theorem 1) for the generalization of contrastive SSL. Moreover, Wang & Isola (2020) does not consider the crucial effect of data augmentation. In fact, with bad concentration (e.g., only using identity transformation as data augmentation), "perfect" alignment along with "perfect" uniformity still can not imply good downstream performance. + +# 3.1 UPPER BOUND $R_{\varepsilon}$ VIA ALIGNMENT + +We now upper bound $R_{\varepsilon}$ via the alignment + +$$ +\mathcal {L} _ {\text {a l i g n}} (f) := \underset {\boldsymbol {x}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} \| f (\boldsymbol {x} _ {1}) - f (\boldsymbol {x} _ {2}) \| ^ {2}, \tag {4} +$$ + +which is a common objective of contrastive losses. Recall that $R_{\varepsilon}$ can be rewritten as + +$$ +R _ {\varepsilon} = \mathbb {P} \left[ \boldsymbol {x} \in \cup_ {k = 1} ^ {K} C _ {k} \colon \sup _ {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} \| f (\boldsymbol {x} _ {1}) - f (\boldsymbol {x} _ {2}) \| > \varepsilon \right]. +$$ + +Note that there is a gap between "sup operator" in $R_{\varepsilon}$ and "E operator" in $\mathcal{L}_{\mathrm{align}}(f)$ , which cannot be simply derived by concentration inequalities. + +We separate the augmentation set $A$ as discrete transformations $\{A_{\gamma}(\cdot)\colon \gamma \in [m]\}$ and continuous transformations $\{A_{\theta}(\cdot)\colon \theta \in [0,1]^n\}$ . For example, random cropping or flipping can be categorized into the discrete transformation, while the others like random color distortion or Gaussian blur can be regarded as the continuous transformation parameterized by the augmentation strength $\theta$ . Without loss of generality, we assume that for any given $\pmb{x}$ , its augmented data are uniformly random sampled, i.e., $\mathbb{P}[x' = A_{\gamma}(x)] = \frac{1}{2m}$ and $\mathbb{P}[x'\in \{A_\theta (x)\colon \theta \in \Theta \} ] = \frac{\mathrm{vol}(\Theta)}{2}$ for any $\Theta \subseteq [0,1]^n$ , where $\mathrm{vol}(\Theta)$ denotes the volume of $\Theta$ . For the continuous transformation, we further assume that the transformation is $M$ -Lipschitz continuous w.r.t. $\theta$ , i.e., $\| A_{\theta_1}(\pmb {x}) - A_{\theta_2}(\pmb {x})\| \leq M\| \theta_1 - \theta_2\|$ for any $\pmb {x},\theta_1,\theta_2$ . With the above setting, we have the following theorem (proof is deferred to the appendix). + +Theorem 2. If encoder $f$ is $L$ -Lipschitz continuous, then + +$$ +R _ {\varepsilon} ^ {2} \leq \eta (\varepsilon) ^ {2} \cdot \underset {\boldsymbol {x}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} \| f (\boldsymbol {x} _ {1}) - f (\boldsymbol {x} _ {2}) \| ^ {2} = \eta (\varepsilon) ^ {2} \cdot \mathcal {L} _ {\mathrm {a l i g n}} (f), +$$ + +where $\eta (\varepsilon) = \inf_{h\in \left(0,\frac{\varepsilon}{2\sqrt{n}LM}\right)}\frac{4\max\{1,m^2h^{2n}\}}{h^{2n}(\varepsilon - 2\sqrt{n}LMh)}.$ + +The above theorem confirms that, with good alignment, $R_{\varepsilon}$ is guaranteed to be small. + +# 4 CONTRASTIVE LOSSES MEET ALIGNMENT AND DIVERGENCE + +We now study two canonical contrastive losses, the InfoNCE loss and the cross-correlation loss, to see how they can achieve good alignment (small $\mathcal{L}_{\mathrm{align}}(f)$ ) and good divergence (small $\mu_k^\top \mu_\ell$ ). + +# 4.1 INFONCE LOSS + +The population loss of InfoNCE (Chen et al., 2020a; He et al., 2020) is well known as: + +$$ +\mathcal{L}_{\text{InfoNCE}} = -\underset { \begin{array}{c}\boldsymbol {x},\boldsymbol{x}^{\prime}\\ \boldsymbol{x}_{1},\boldsymbol{x}_{2}\in A(\boldsymbol {x})\\ \boldsymbol{x}^{-}\in A(\boldsymbol{x}^{\prime}) \end{array} }{\mathbb{E}}\underset { \begin{array}{c}\boldsymbol{x}_{1},\boldsymbol{x}_{2}\in A(\boldsymbol {x})\\ \boldsymbol{x}^{-}\in A(\boldsymbol{x}^{\prime}) \end{array} }{\mathbb{E}}\log \frac{e^{f(\boldsymbol{x}_{1})^{\top}f(\boldsymbol{x}_{2})}}{e^{f(\boldsymbol{x}_{1})^{\top}f(\boldsymbol{x}_{2})} + e^{f(\boldsymbol{x}_{1})^{\top}f(\boldsymbol{x}^{-})}}, +$$ + +where encoder $f$ is normalized by $\| f\| = 1$ . It can be divided into two parts: + +$$ +\begin{array}{l} \mathcal {L} _ {\text {I n f o N C E}} = \underset { \begin{array}{c} \boldsymbol {x}, \boldsymbol {x} ^ {\prime} \\ \boldsymbol {x} ^ {-} \in A \left(\boldsymbol {x} ^ {\prime}\right) \end{array} } {\mathbb {E}} \underset { \begin{array}{c} \boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x}) \\ \boldsymbol {x} ^ {-} \in A \left(\boldsymbol {x} ^ {\prime}\right) \end{array} } {\mathbb {E}} \left[ - f \left(\boldsymbol {x} _ {1}\right) ^ {\top} f \left(\boldsymbol {x} _ {2}\right) + \log \left(e ^ {f \left(\boldsymbol {x} _ {1}\right) ^ {\top} f \left(\boldsymbol {x} _ {2}\right)} + e ^ {f \left(\boldsymbol {x} _ {1}\right) ^ {\top} f \left(\boldsymbol {x} ^ {-}\right)}\right) \right] \tag {5} \\ = \underbrace {\frac {1}{2} \underset {\boldsymbol {x} _ {1} , \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} \underset {=: \mathcal {L} _ {1} ^ {\mathrm {I n f o N C E}} (f)} {\mathbb {E}} [ \| f (\boldsymbol {x} _ {1}) - f (\boldsymbol {x} _ {2}) \| ^ {2} ] - 1} _ {=: \mathcal {L} _ {1} ^ {\mathrm {I n f o N C E}} (f)} + \underbrace {\underset {\boldsymbol {x} , \boldsymbol {x} ^ {\prime}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1} , \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} \left[ \log \left(e ^ {f (\boldsymbol {x} _ {1}) ^ {\top} f (\boldsymbol {x} _ {2})} + e ^ {f (\boldsymbol {x} _ {1}) ^ {\top} f (\boldsymbol {x} ^ {-})}\right) \right]} _ {=: \mathcal {L} _ {2} ^ {\mathrm {I n f o N C E}} (f)}. \\ \end{array} +$$ + +Regardless of the constant factors, $\mathcal{L}_1^{\mathrm{InfoNCE}}(f)$ is exactly the alignment term in (4). Next, we take a close look at $\mathcal{L}_2^{\mathrm{InfoNCE}}(f)$ to see how it links to the divergence condition required by Theorem 1. + +Theorem 3. Assume that encoder $f$ with norm 1 is $L$ -Lipschitz continuous. If the augmented data is $(\sigma, \delta)$ -augmented, then for any $\varepsilon \geq 0$ and $k \neq \ell$ , we have + +$$ +\mu_ {k} ^ {\top} \mu_ {\ell} \leq \log \left(\exp \left\{\frac {\mathcal {L} _ {2} ^ {\mathrm {I n f o N C E}} (f) + \tau (\sigma , \delta , \varepsilon , R _ {\varepsilon})}{p _ {k} p _ {\ell}} \right\} - \exp (1 - \varepsilon)\right), +$$ + +where $\tau (\sigma ,\delta ,\varepsilon ,R_{\varepsilon})$ is a non-negative term, decreasing with smaller $\varepsilon ,R_{\varepsilon}$ or sharper concentration of augmented data, and $\tau (\sigma ,\delta ,\varepsilon ,R_{\varepsilon}) = 0$ when $\sigma = 1,\delta = 0,\varepsilon = 0,R_{\varepsilon} = 0$ + +The specific formulation of $\tau (\sigma ,\delta ,\varepsilon ,R_{\varepsilon})$ and the proof are deferred to the appendix. We remark that data augmentation $(\sigma ,\delta)$ , parameter $\varepsilon$ , and $p_k,p_\ell$ are pre-determined before training procedure, and thus the upper bound of $\mu_k^\top \mu_\ell$ in Theorem 3 varies only with $\mathcal{L}_2^{\mathrm{InfoNCE}}(f)$ and $R_{\varepsilon}$ , positively. + +Therefore, minimizing $\mathcal{L}_{\mathrm{InfoNCE}} = \mathcal{L}_1^{\mathrm{InfoNCE}}(f) + \mathcal{L}_2^{\mathrm{InfoNCE}}(f)$ leads to both small $\mathcal{L}_1^{\mathrm{InfoNCE}}(f)$ and small $\mathcal{L}_2^{\mathrm{InfoNCE}}(f)$ . Small $\mathcal{L}_1^{\mathrm{InfoNCE}}(f)$ indicates good alignment $\mathcal{L}_{\mathrm{align}}(f)$ , as well as small $R_{\varepsilon}$ + +(Theorem 2). Small $\mathcal{L}_2^{\mathrm{InfoNCE}}(f)$ along with small $R_{\varepsilon}$ indicates good divergence (small $\mu_k^\top \mu_\ell$ ) by Theorem 3. Hence, optimizing the InfoNCE loss can achieve both good alignment and good divergence. According to Theorem 1 and Theorem 2, the generalization ability of encoder $f$ on the downstream task is implied, i.e., $\mathrm{Err}(G_f) \leq (1 - \sigma) + \eta(\varepsilon) \sqrt{2 + 2\mathcal{L}_1^{\mathrm{InfoNCE}}(f)}$ , when the upper bound of $\mu_k^\top \mu_\ell$ in Theorem 3 is smaller than the threshold in Theorem 1. + +It is worth mentioning that the form of InfoNCE is critical to meeting the requirement of divergence, which is found when we prove Theorem 3. For example, let us consider the contrastive loss (5) formulated in a linear form $^2$ instead of LogExp such that + +$$ +\mathcal{L}^{\prime}(f) = \underset { \begin{array}{c}\boldsymbol {x},\boldsymbol{x}^{\prime}\\ \boldsymbol{x}^{-}\in A(\boldsymbol{x}^{\prime}) \end{array} }{\mathbb{E}}\underset { \begin{array}{c}\boldsymbol{x}_{1},\boldsymbol{x}_{2}\in A(\boldsymbol{x})\\ \boldsymbol{x}^{-}\in A(\boldsymbol{x}^{\prime}) \end{array} }{\mathbb{E}}\left[-f(\boldsymbol{x}_{1})^{\top}f(\boldsymbol{x}_{2}) + \lambda f(\boldsymbol{x}_{1})^{\top}f(\boldsymbol{x}^{-})\right] = \mathcal{L}_{1}^{\operatorname{InfoNCE}}(f) + \lambda \mathcal{L}_{2}^{\prime}(f), +$$ + +where $\mathcal{L}_2'(f)$ is the negative-pair term weighted by some $\lambda > 0$ . Due to the independence between $\pmb{x}$ and $\pmb{x}'$ , we have $\mathcal{L}_2'(f) = \| \mathbb{E}_x \mathbb{E}_{\pmb{x}_1 \in A(\pmb{x})} [f(\pmb{x}_1)] \|^2$ . Therefore, minimizing $\mathcal{L}_2'(f)$ only leads to the representation with zero mean. Unfortunately, the objective of zero mean with $\| f \| = 1$ can not obviate the dimensional collapse (Hua et al., 2021) of the model. For example, the encoder $f$ can map the input data from multi classes into two points in the opposite directions on the hypersphere. This justifies the observation in (Wang & Liu, 2021): the uniformity of the encoder on the embedded hypersphere becomes worse when the temperature of the loss increases, where the loss degenerates to $\mathcal{L}'(f)$ with infinite temperature. + +# 4.2 CROSS-CORRELATION LOSS + +Cross-correlation loss is first introduced by Barlow Twins (Zbontar et al., 2021). In contrast to InfoNCE loss, it trains the model via decorrelating the components of representation instead of directly optimizing the geometry of embedding space, but it is still observed to have clustered embedding space. To explore this, we study the cross-correlation loss in detail and show how it implicitly optimizes the alignment and divergence required by Theorem 1. + +The population loss of cross-correlation can be formulated as + +$$ +\mathcal {L} _ {\mathrm {C r o s s - C o r r}} = \sum_ {i = 1} ^ {d} \left(1 - \underset {\boldsymbol {x}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} [ f _ {i} (\boldsymbol {x} _ {1}) f _ {i} (\boldsymbol {x} _ {2}) ]\right) ^ {2} + \lambda \sum_ {i \neq j} \left(\underset {\boldsymbol {x}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} [ f _ {i} (\boldsymbol {x} _ {1}) f _ {j} (\boldsymbol {x} _ {2}) ]\right) ^ {2}, +$$ + +with normalization condition of $\mathbb{E}_{\boldsymbol{x}}\mathbb{E}_{\boldsymbol{x}_1\in A(\boldsymbol{x})}[f_i(\boldsymbol{x}_1)] = 0$ and $\mathbb{E}_{\boldsymbol{x}}\mathbb{E}_{\boldsymbol{x}_1\in A(\boldsymbol{x})}[f_i(\boldsymbol{x}_1)^2] = 1$ for each $i\in [d]$ , where $d$ is the output dimension of encoder $f$ . Positive coefficient $\lambda$ balances the importance between diagonal and non-diagonal elements of cross-correlation matrix. When $\lambda = 1$ , the above loss is exactly the difference between the cross-correlation matrix and identity matrix. Similar to Section 4.1, we first divide the loss into two parts, by defining + +$$ +\mathcal {L} _ {1} ^ {\text {C r o s s}} (f) := \sum_ {i = 1} ^ {d} \left(1 - \underset {\boldsymbol {x}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} [ f _ {i} (\boldsymbol {x} _ {1}) f _ {i} (\boldsymbol {x} _ {2}) ]\right) ^ {2} \text {a n d} \mathcal {L} _ {2} ^ {\text {C r o s s}} (f) := \left\| \underset {\boldsymbol {x}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} [ f (\boldsymbol {x} _ {1}) f (\boldsymbol {x} _ {2}) ^ {\top} ] - I _ {d} \right\| ^ {2}. +$$ + +In this way, the cross-correlation loss becomes $\mathcal{L}_{\mathrm{Cross - Corr}} = (1 - \lambda)\mathcal{L}_1^{\mathrm{Cross}}(f) + \lambda \mathcal{L}_2^{\mathrm{Cross}}(f)$ . Then, we connect $\mathcal{L}_1^{\mathrm{Cross}}(f)$ and $\mathcal{L}_2^{\mathrm{Cross}}(f)$ with the alignment and divergence, respectively. + +Lemma 4.1. For a given encoder $f$ , the alignment $\mathcal{L}_{\mathrm{align}}(f)$ in (4) is upper bounded via $\mathcal{L}_1^{Cross}(f)$ : + +$$ +\mathcal {L} _ {\mathrm {a l i g n}} (f) = \underset {\boldsymbol {x}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} \left\| f (\boldsymbol {x} _ {1}) - f (\boldsymbol {x} _ {2}) \right\| ^ {2} \leq 2 \sqrt {d \cdot \mathcal {L} _ {1} ^ {\mathrm {C r o s s}} (f)}, +$$ + +where $d$ is the output dimension of encoder $f$ . + +The above lemma connects $\mathcal{L}_1^{\mathrm{Cross}}(f)$ with $\mathcal{L}_{\mathrm{align}}(f)$ , indicating that the diagonal elements of the cross-correlation matrix determine the alignment of positive samples. Next, we will link $\mathcal{L}_2^{\mathrm{Cross}}(f)$ to the divergence $\mu_k^\top \mu_\ell$ . It is challenging because $\mathcal{L}_2^{\mathrm{Cross}}(f)$ is designed for reducing the redundancy between the encoder's output units, not for optimizing the geometry of embedding space. + +Theorem 4. Assume that encoder $f$ with norm $\sqrt{d}$ is $L$ -Lipschitz continuous. If the augmented data is $(\sigma, \delta)$ -augmented, then for any $\varepsilon \geq 0$ and $k \neq \ell$ , we have + +$$ +\mu_ {k} ^ {\top} \mu_ {\ell} \leq \sqrt {\frac {2}{p _ {k} p _ {\ell}} \left(\mathcal {L} _ {2} ^ {\mathrm {C r o s s}} (f) + \tau^ {\prime} (\sigma , \delta , \varepsilon , R _ {\varepsilon}) - \frac {d - K}{2}\right)}, +$$ + +where $\tau'(\sigma, \delta, \varepsilon, R_{\varepsilon})$ is an upper bound of $\| \mathbb{E}_{\boldsymbol{x}} \mathbb{E}_{\boldsymbol{x}_1, \boldsymbol{x}_2 \in A(\boldsymbol{x})} [f(\boldsymbol{x}_1) f(\boldsymbol{x}_2)^\top] - \sum_{k=1}^{K} p_k \mu_k \mu_k^\top \|^2$ . + +The specific formulation of $\tau'(\sigma, \delta, \varepsilon, R_{\varepsilon})$ and proof are deferred to the appendix. Here we remark that $\tau'(\sigma, \delta, \varepsilon, R_{\varepsilon})$ is a non-negative term, decreasing with smaller $\varepsilon, R_{\varepsilon}$ or sharper concentration of augmented data, and $\tau'(\sigma, \delta, \varepsilon, R_{\varepsilon}) = 0$ when $\sigma = 1, \delta = 0, \varepsilon = 0, R_{\varepsilon} = 0$ . Since data augmentation $(\sigma, \delta)$ , parameter $\varepsilon$ , and $p_k, p_\ell$ are pre-determined before training procedure, the upper bound of $\mu_k^\top \mu_\ell$ in Theorem 4 varies only with $\mathcal{L}_2^{\mathrm{Cross}}(f)$ and $R_{\varepsilon}$ , positively. + +Therefore, minimizing $\mathcal{L}_{\mathrm{Cross - Corr}}$ leads to small $\mathcal{L}_1^{\mathrm{Cross}}(f)$ , as well as small $\mathcal{L}_2^{\mathrm{Cross}}(f)$ . Small $\mathcal{L}_1^{\mathrm{Cross}}(f)$ indicates good alignment $\mathcal{L}_{\mathrm{align}}(f)$ by Lemma 4.1 and small $R_{\varepsilon}$ by Theorem 2. Small $\mathcal{L}_2^{\mathrm{Cross}}(f)$ along with small $R_{\varepsilon}$ indicates good divergence (small $\mu_k^\top \mu_\ell$ ) by Theorem 4. Hence, decorrelating the components of representation can achieve both good alignment and good divergence. According to Theorem 1 and Theorem 2, the generalization ability of encoder $f$ on the downstream task is implied, i.e., $\mathrm{Err}(G_f) \leq (1 - \sigma) + \sqrt{2} \eta(\varepsilon) d^{\frac{1}{4}} \mathcal{L}_1^{\mathrm{Cross}}(f)^{\frac{1}{4}}$ , when the upper bound of $\mu_k^\top \mu_\ell$ in Theorem 4 is smaller than the threshold in Theorem 1. + +Beyond the above two widely used contrastive learning losses, we further analyze a very recently proposed $t$ -InfoNCE loss (Hu et al., 2022), which is a $t$ -SNE style loss inspired by stochastic neighbor embedding. We show that it can also achieve good alignment and divergence in the appendix. + +# 5 EMPIRICAL STUDY OF CONCENTRATION OF AUGMENTED DATA + +Theorem 1 reveals that sharper concentration of augmented data w.r.t. the proposed augmented distance implies better generalization error bound regardless of algorithm. In this section, we empirically study the relationship between the concentration level and the real downstream performance. + +Basic Setup. Our experiments are conducted on CIFAR-10 and CIFAR-100 (Krizhevsky, 2009). We consider 5 different kinds of transformations for performing data augmentations: (a) random cropping; (b) random Gaussian blur; (c) color dropping (i.e., randomly converting images to grayscale); (d) color distortion; (e) random horizontal flipping. We test different combinations of transformations via various SSL algorithms such as SimCLR (Chen et al., 2020a), Barlow Twins (Zbontar et al., 2021), MoCo (He et al., 2020), and SimSiam (Chen & He, 2021). We use ResNet-18 (He et al., 2016) as the encoder, and the other settings such as projection head remain the same as the original settings of algorithms. Each model is trained with a batch size of 512 and 800 epochs. To evaluate the quality of the encoder, we follow the KNN evaluation protocol (Wu et al., 2018). + +Different Richness of Augmentations. We compose all 5 kinds of transformations together, and then successively drop one of the composed transformations from (e) to (b) to conduct 5 experiments for each dataset (Table 1). We observe that the downstream performance monotonously gets worse with the decrease of transformation number, under all four SSL algorithms, on both CIFAR-10 and CIFAR-100. Notice that richer augmentation implies sharper concentration (see the paragraph below Definition 1), and thus the concentration becomes less sharp from top to bottom for each dataset. Therefore, we observe that downstream performance becomes better with sharper concentration. + +We also observe that (c) color dropping and (d) color distortion have a great impact on the performance of all algorithms. According to our theoretical framework, these two transformations enable the augmented data to vary in a very wide range, which makes the augmented distance (1) largely decrease. As an intuitive example, if the right dog image in Figure 2 is replaced by a Husky image, only with random cropping, one will get two dog heads with similar shapes but different colors, which still have a large augmented distance. Instead, if color distortion is further applied, one can get two similar dog heads both in shape and color. Therefore, these two dog images have similar augmented views, and thus their augmented distance (1) becomes very small. Notice that small augmented distance (1) indicates sharp concentration (small $\delta$ in Definition 1). Therefore, we observe that dramatic change in concentration leads to wildly fluctuating downstream performance. + +Table 1: Downstream performance under different richness of augmentations. + +
DatasetTransformationsAccuracy
(a)(b)(c)(d)(e)SimCLRBarlow TwinsMoCoSimSiam
CIFAR-10✓✓✓✓✓89.76 ± 0.1286.91 ± 0.0990.12 ± 0.1290.59 ± 0.11
✓✓✓✓88.48 ± 0.2285.38 ± 0.3789.69 ± 0.1189.34 ± 0.09
✓✓✓83.50 ± 0.1482.00 ± 0.5986.78 ± 0.0785.38 ± 0.09
✓✓63.23 ± 0.0567.83 ± 0.9475.12 ± 0.2863.27 ± 0.30
✓62.74 ± 0.1867.77 ± 0.6974.94 ± 0.2261.47 ± 0.74
CIFAR-100✓✓✓✓✓57.74 ± 0.1257.99 ± 0.2964.19 ± 0.1463.48 ± 0.16
✓✓✓✓55.43 ± 0.1055.22 ± 0.2562.50 ± 0.2860.31 ± 0.41
✓✓✓45.10 ± 0.2550.40 ± 0.6457.04 ± 0.2151.42 ± 0.14
✓✓28.01 ± 0.1834.11 ± 0.5940.18 ± 0.0426.26 ± 0.30
✓27.95 ± 0.0934.05 ± 1.1339.63 ± 0.3125.90 ± 0.83
+ +Table 2: Downstream performance under different strength of augmentations. + +
DatasetColor Distortion StrengthAccuracy
SimCLRBarlow TwinsMoCoSimSiam
CIFAR-10182.75 ± 0.2482.58 ± 0.2586.68 ± 0.0582.50 ± 1.05
1/278.76 ± 0.1881.88 ± 0.2584.30 ± 0.1481.80 ± 0.15
1/476.37 ± 0.1179.64 ± 0.3482.76 ± 0.0978.80 ± 0.17
1/874.23 ± 0.1677.96 ± 0.1681.20 ± 0.1276.09 ± 0.50
CIFAR-100146.67 ± 0.4250.39 ± 1.0958.50 ± 0.5149.94 ± 2.01
1/240.21 ± 0.0548.76 ± 0.2555.08 ± 0.0946.27 ± 0.46
1/436.67 ± 0.0846.22 ± 0.7152.09 ± 0.1842.02 ± 0.34
1/834.75 ± 0.2044.72 ± 0.2649.43 ± 0.1636.26 ± 0.34
+ +Different Strength of Augmentations. We fix (a) random cropping and (d) color distortion as data augmentation, and vary the strength of (d) in $\{1, \frac{1}{2}, \frac{1}{4}, \frac{1}{8}\}$ to construct 4 groups of augmentations with different strength levels (Table 2). We observe that the downstream performance monotonously decreases with weaker color distortions, under all four SSL algorithms, on both CIFAR-10 and CIFAR-100. Recall that a stronger color distortion makes the augmented data vary in a wider range, leading to a smaller augmented distance (1) and thus sharper concentration. Therefore, we observe again that downstream performance becomes better with sharper concentration. + +Different Composed Pairs of Transformations. To study the relationship between the concentration level and the corresponding downstream performance in a more fine-grained way, we compose transformations (a)-(e) in pairs to construct a total of $\binom{5}{2}=10$ augmentations. Contrasted to the previous two groups of experiments, current composed augmentations do not have an apparent order of concentration levels. According to Definition 1, for a given $\delta$ , a smaller $(1-\sigma)$ corresponds to a sharper concentration. Thus, we mathematically compute $(1-\sigma)$ (see appendix for details), and observe the correlation between classification error rate $\mathrm{Err}(G_f)$ and $(1-\sigma)$ under different $\delta$ on CIFAR-10, based on the SimCLR model trained with 200 epochs. + +Interestingly, downstream performance is surprisingly highly correlated to the concentration level (Figure 3). Specifically, if we fix one of composed transformations as (a), we find that both $\mathrm{Err}(G_f)$ and $(1 - \sigma)$ have the same order that $(a,d) < (a,c) < (a,e)\approx (a,b)$ , under two values of $\delta$ . Furthermore, among all 10 composed augmentations, augmentation $(a,d)$ has the smallest value of $(1 - \sigma)$ , while the corresponding performance is also the best one. In addition, we observe that the choice of $\delta$ is not sensitive to the curve shape of $(1 - \sigma)$ . These observations suggest that sharper concentration is most likely to have better downstream performance. This also provides an explanation for Figure 5 in Sim-CLR paper (Chen et al., 2020a) of why the composition of "crop & color" performs the best. + +![](images/d172ad5fb95ca4eb36d6707af6ec010b19cfd2246bdf0b2a66c9e5b50262923a.jpg) +Figure 3: The correlation between observed $\operatorname{Err}(G_f)$ and computed value of $(1 - \sigma)$ . + +# ACKNOWLEDGMENT + +We would like to express our sincere gratitude to the reviewers of ICLR 2023 for their insightful and constructive feedback. Their valuable comments have greatly contributed to improving the quality of our work. + +# REFERENCES + +Sanjeev Arora, Hrishikesh Khandeparkar, Mikhail Khodak, Orestis Plevrakis, and Nikunj Saunshi. A theoretical analysis of contrastive unsupervised representation learning. arXiv preprint arXiv:1902.09229, 2019. +Jordan T Ash, Surbhi Goel, Akshay Krishnamurthy, and Dipendra Misra. Investigating the role of negatives in contrastive representation learning. arXiv preprint arXiv:2106.09943, 2021. +Philip Bachman, R Devon Hjelm, and William Buchwalter. Learning representations by maximizing mutual information across views. In Advances in Neural Information Processing Systems, pp. 15535-15545, 2019. +Adrien Bardes, Jean Ponce, and Yann LeCun. Vicreg: Variance-invariance-covariance regularization for self-supervised learning. arXiv preprint arXiv:2105.04906, 2021. +Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. arXiv preprint arXiv:2002.05709, 2020a. +Xinlei Chen and Kaiming He. Exploring simple siamese representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 15750-15758, 2021. +Xinlei Chen, Haoqi Fan, Ross Girshick, and Kaiming He. Improved baselines with momentum contrastive learning. arXiv preprint arXiv:2003.04297, 2020b. +Hongchao Fang, Sicheng Wang, Meng Zhou, Jiayuan Ding, and Pengtao Xie. Cert: Contrastive self-supervised learning for language understanding. arXiv preprint arXiv:2005.12766, 2020. +Tianyu Gao, Xingcheng Yao, and Danqi Chen. Simcse: Simple contrastive learning of sentence embeddings. arXiv preprint arXiv:2104.08821, 2021. +John M Giorgi, Osvald Nitski, Gary D Bader, and Bo Wang. Declutr: Deep contrastive learning for unsupervised textual representations. arXiv preprint arXiv:2006.03659, 2020. +Jean-Bastien Grill, Florian Strub, Florent Alché, Corentin Tallec, Pierre H Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Daniel Guo, Mohammad Gheshlaghi Azar, et al. Bootstrap your own latent: A new approach to self-supervised learning. arXiv preprint arXiv:2006.07733, 2020. +Jeff Z HaoChen, Colin Wei, Adrien Gaidon, and Tengyu Ma. Provable guarantees for self-supervised deep learning with spectral contrastive loss. Advances in Neural Information Processing Systems, 34, 2021. +Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770-778, 2016. +Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9729-9738, 2020. +Kaiming He, Xinlei Chen, Saining Xie, Yanghao Li, Piotr Dólár, and Ross Girshick. Masked autoencoders are scalable vision learners. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 16000-16009, 2022. +R Devon Hjelm, Alex Fedorov, Samuel Lavoie-Marchildon, Karan Grewal, Phil Bachman, Adam Trischler, and Yoshua Bengio. Learning deep representations by mutual information estimation and maximization. arXiv preprint arXiv:1808.06670, 2018. + +Qianjiang Hu, Xiao Wang, Wei Hu, and Guo-Jun Qi. Adco: Adversarial contrast for efficient learning of unsupervised representations from self-trained negative adversaries. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 1074-1083, 2021. +Tianyang Hu, Zhili Liu, Fengwei Zhou, Wenjia Wang, and Weiran Huang. Your contrastive learning is secretly doing stochastic neighbor embedding. arXiv preprint arXiv:2205.14814, 2022. +Tianyu Hua, Wenxiao Wang, Zihui Xue, Sucheng Ren, Yue Wang, and Hang Zhao. On feature decorrelation in self-supervised learning. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 9598-9608, 2021. +Alex Krizhevsky. Learning multiple layers of features from tiny images. University of Toronto, 2009. +Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018. +Christos H Papadimitriou and Kenneth Steiglitz. Combinatorial optimization: algorithms and complexity. Courier Corporation, 1998. +Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In International Conference on Machine Learning, pp. 8748-8763. PMLR, 2021. +Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive multiview coding. arXiv preprint arXiv:1906.05849, 2019. +Yonglong Tian, Chen Sun, Ben Poole, Dilip Krishnan, Cordelia Schmid, and Phillip Isola. What makes for good views for contrastive learning? arXiv preprint arXiv:2005.10243, 2020. +Michael Tschannen, Josip Djolonga, Paul K Rubenstein, Sylvain Gelly, and Mario Lucic. On mutual information maximization for representation learning. arXiv preprint arXiv:1907.13625, 2019. +Feng Wang and Huaping Liu. Understanding the behaviour of contrastive loss. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 2495-2504, 2021. +Tongzhou Wang and Phillip Isola. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. In International Conference on Machine Learning, pp. 9929-9939. PMLR, 2020. +Colin Wei, Kendrick Shen, Yining Chen, and Tengyu Ma. Theoretical analysis of self-training with deep networks on unlabeled data. arXiv preprint arXiv:2010.03622, 2020. +Zixin Wen and Yuanzhi Li. Toward understanding the feature learning process of self-supervised contrastive learning. arXiv preprint arXiv:2105.15134, 2021. +Zhirong Wu, Yuanjun Xiong, Stella X Yu, and Dahua Lin. Unsupervised feature learning via nonparametric instance discrimination. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3733-3742, 2018. +Zhuofeng Wu, Sinong Wang, Jiatao Gu, Madian Khabsa, Fei Sun, and Hao Ma. Clear: Contrastive learning for sentence representation. arXiv preprint arXiv:2012.15466, 2020. +Yuanmeng Yan, Rumei Li, Sirui Wang, Fuzheng Zhang, Wei Wu, and Weiran Xu. Consert: A contrastive framework for self-supervised sentence representation transfer. arXiv preprint arXiv:2105.11741, 2021. +Jure Zbontar, Li Jing, Ishan Misra, Yann LeCun, and Stéphane Deny. Barlow twins: Self-supervised learning via redundancy reduction. arXiv preprint arXiv:2103.03230, 2021. +Qi Zhang, Yifei Wang, and Yisen Wang. How mask matters: Towards theoretical understandings of masked autoencoders. arXiv preprint arXiv:2210.08344, 2022. +Xuyang Zhao, Tianqi Du, Yisen Wang, Jun Yao, and Weiran Huang. Arcl: Enhancing contrastive learning with augmentation-robust representations. In International Conference on Learning Representations (ICLR), 2023. + +# Appendix + +# A COMPUTE $\sigma$ FOR FIGURE 3 + +When $\delta$ is given, for each class $C_k$ , we construct an auxiliary graph $G_k$ whose nodes correspond to the samples of $C_k$ and edge $(\pmb{x}_1,\pmb{x}_2)$ exists if $d_A(\pmb{x}_1,\pmb{x}_2)\leq \delta$ . According to Definition 1, we can compute the main part of $C_k$ by finding the maximum clique of graph $G_{k}$ . Then $\sigma$ can be estimated by $\min_{k\in [K]}\left|\mathrm{MAXCLIENT}(G_k)\right| / |C_k|$ . We solve MAXCLIENT via its dual problem - vertex cover, and adopt the Approx-Vertex-Cover (Papadimitriou & Steiglitz, 1998) to compute the solution. + +# B PROOFS FOR SECTION 3 + +Lemma 3.1. For a $(\sigma, \delta)$ -augmentation with main part $C_k^0$ of each class $C_k$ , if all samples belonging to $(C_1^0 \cup \dots \cup C_K^0) \cap S_\varepsilon$ can be correctly classified by a classifier $G$ , then its classification error rate $\mathrm{Err}(G)$ is upper bounded by $(1 - \sigma) + R_\varepsilon$ . + +Proof. Since every sample $\pmb{x} \in (C_1^0 \cup \dots \cup C_K^0) \cap S_\varepsilon$ can be correctly classified by $G$ , then the classification error rate + +$$ +\begin{array}{l} \operatorname {E r r} (G) = \sum_ {k = 1} ^ {K} \mathbb {P} [ G (\boldsymbol {x}) \neq k, \forall \boldsymbol {x} \in C _ {k} ] \\ \leq \mathbb {P} \left[ \overline {{(C _ {1} ^ {0} \cup \cdots \cup C _ {K} ^ {0}) \cap S _ {\varepsilon}}} \right] \\ = \mathbb {P} \left[ \overline {{C _ {1} ^ {0} \cup \cdot \cdot \cdot \cup C _ {K} ^ {0}}} \cup \overline {{S _ {\varepsilon}}} \right] \\ \leq (1 - \sigma) + \mathbb {P} [ \overline {{S _ {\varepsilon}}} ] \\ = (1 - \sigma) + R _ {\varepsilon}. \\ \end{array} +$$ + +This finishes the proof. + +![](images/74b306a3e8a9d71290d99047e6a07af35a5db4de888ddcb6f792c667b79e573d.jpg) + +Lemma 3.2. Given a $(\sigma, \delta)$ -augmentation used in contrastive SSL, for any $\ell \in [K]$ , if $\mu_{\ell}^{\top}\mu_{k} < r^{2}\left(1 - \rho_{\ell}(\sigma, \delta, \varepsilon) - \sqrt{2\rho_{\ell}(\sigma, \delta, \varepsilon)} - \frac{\Delta_{\mu}}{2}\right)$ holds for all $k \neq \ell$ , then every sample $\mathbf{x} \in C_{\ell}^{0} \cap S_{\varepsilon}$ can be correctly classified by the NN classifier $G_{f}$ , where $\rho_{\ell}(\sigma, \delta, \varepsilon) = 2(1 - \sigma) + \frac{R_{\varepsilon}}{p_{\ell}} + \sigma\left(\frac{L\delta}{r} + \frac{2\varepsilon}{r}\right)$ and $\Delta_{\mu} = 1 - \min_{k \in [K]} \| \mu_{k} \|^{2} / r^{2}$ . + +Proof. Without loss of generality, we consider $\ell = 1$ . To show that every sample $\mathbf{x}_0 \in C_1^0 \cap S_\varepsilon$ can be correctly classified by $G_f$ , we need to prove that for all $k \neq 1$ , $\|f(\mathbf{x}_0) - \mu_1\| < \|f(\mathbf{x}_0) - \mu_k\|$ . It is equivalent to prove that + +$$ +f \left(\boldsymbol {x} _ {0}\right) ^ {\top} \mu_ {1} - f \left(\boldsymbol {x} _ {0}\right) ^ {\top} \mu_ {k} - \left(\frac {1}{2} \| \mu_ {1} \| ^ {2} - \frac {1}{2} \| \mu_ {k} \| ^ {2}\right) > 0. \tag {6} +$$ + +Let $\tilde{f}(\pmb{x}) := \mathbb{E}_{\pmb{x}' \in A(\pmb{x})}[f(\pmb{x}')]$ . Then $\| \tilde{f}(\pmb{x}) \| = \| \mathbb{E}_{\pmb{x}' \in A(\pmb{x})}[f(\pmb{x}')] \| \leq \mathbb{E}_{\pmb{x}' \in A(\pmb{x})}[\| f(\pmb{x}') \|] = r$ . + +On the one hand, + +$$ +\begin{array}{l} f \left(\boldsymbol {x} _ {0}\right) ^ {\top} \mu_ {1} = \frac {1}{p _ {1}} f \left(\boldsymbol {x} _ {0}\right) ^ {\top} \underset {\boldsymbol {x}} {\mathbb {E}} [ \tilde {f} (\boldsymbol {x}) \mathbb {I} (\boldsymbol {x} \in C _ {1}) ] \\ = \frac {1}{p _ {1}} f (\boldsymbol {x} _ {0}) ^ {\top} \underset {\boldsymbol {x}} {\mathbb {E}} [ \tilde {f} (\boldsymbol {x}) \mathbb {I} (\boldsymbol {x} \in C _ {1} \cap C _ {1} ^ {0} \cap S _ {\varepsilon}) ] + \frac {1}{p _ {1}} f (\boldsymbol {x} _ {0}) ^ {\top} \underset {\boldsymbol {x}} {\mathbb {E}} \left[ \tilde {f} (\boldsymbol {x}) \mathbb {I} (\boldsymbol {x} \in C _ {1} \cap \overline {{C _ {1} ^ {0} \cap S _ {\varepsilon}}}) \right] \\ = \frac {\mathbb {P} \left[ C _ {1} ^ {0} \cap S _ {\varepsilon} \right]}{p _ {1}} f \left(\boldsymbol {x} _ {0}\right) ^ {\top} \underset {\boldsymbol {x} \in C _ {1} ^ {0} \cap S _ {\varepsilon}} {\mathbb {E}} [ \tilde {f} (\boldsymbol {x}) ] + \frac {1}{p _ {1}} \underset {\boldsymbol {x}} {\mathbb {E}} \left[ f \left(\boldsymbol {x} _ {0}\right) ^ {\top} \tilde {f} (\boldsymbol {x}) \cdot \mathbb {I} \left(\boldsymbol {x} \in C _ {1} \backslash C _ {1} ^ {0} \cap S _ {\varepsilon}\right) \right] \\ \geq \frac {\mathbb {P} \left[ C _ {1} ^ {0} \cap S _ {\varepsilon} \right]}{p _ {1}} f \left(\boldsymbol {x} _ {0}\right) ^ {\top} \underset {\boldsymbol {x} \in C _ {1} ^ {0} \cap S _ {\varepsilon}} {\mathbb {E}} [ \tilde {f} (\boldsymbol {x}) ] - \frac {r ^ {2}}{p _ {1}} \mathbb {P} \left[ C _ {1} \backslash C _ {1} ^ {0} \cap S _ {\varepsilon} \right], \tag {7} \\ \end{array} +$$ + +where $\mathbb{I}(\cdot)$ is the indicator function. Note that + +$$ +\mathbb {P} \left[ C _ {1} \backslash C _ {1} ^ {0} \cap S _ {\varepsilon} \right] = \mathbb {P} \left[ \left(C _ {1} \backslash C _ {1} ^ {0}\right) \cup \left(C _ {1} ^ {0} \cap \overline {{S _ {\varepsilon}}}\right) \right] \leq (1 - \sigma) p _ {1} + R _ {\varepsilon}, \tag {8} +$$ + +and + +$$ +\mathbb {P} [ C _ {1} ^ {0} \cap S _ {\varepsilon} ] = \mathbb {P} [ C _ {1} ] - \mathbb {P} [ C _ {1} \setminus C _ {1} ^ {0} \cap S _ {\varepsilon} ] \geq p _ {1} - ((1 - \sigma) p _ {1} + R _ {\varepsilon}) = \sigma p _ {1} - R _ {\varepsilon}. \qquad (9) +$$ + +Plugging to (7), we have + +$$ +\begin{array}{l} f \left(\boldsymbol {x} _ {0}\right) ^ {\top} \mu_ {1} \geq \frac {\mathbb {P} \left[ C _ {1} ^ {0} \cap S _ {\varepsilon} \right]}{p _ {1}} f \left(\boldsymbol {x} _ {0}\right) ^ {\top} \underset {\boldsymbol {x} \in C _ {1} ^ {0} \cap S _ {\varepsilon}} {\mathbb {E}} [ \tilde {f} (\boldsymbol {x}) ] - \frac {r ^ {2}}{p _ {1}} \mathbb {P} \left[ C _ {1} \backslash C _ {1} ^ {0} \cap S _ {\varepsilon} \right] \\ \geq \left(\sigma - \frac {R _ {\varepsilon}}{p _ {1}}\right) f (\boldsymbol {x} _ {0}) ^ {\top} \underset {\boldsymbol {x} \in C _ {1} ^ {0} \cap S _ {\varepsilon}} {\mathbb {E}} [ \tilde {f} (\boldsymbol {x}) ] - r ^ {2} \left(1 - \sigma + \frac {R _ {\varepsilon}}{p _ {1}}\right). \tag {10} \\ \end{array} +$$ + +Notice that $\pmb{x}_0 \in C_1^0 \cap S_{\varepsilon}$ . For any $\pmb{x} \in C_1^0 \cap S_{\varepsilon}$ , we have $d_A(\pmb{x}_0, \pmb{x}) \leq \delta$ . Let $(\pmb{x}_0^*, \pmb{x}^*) = \arg \min_{\pmb{x}_0' \in A(\pmb{x}_0), \pmb{x}' \in A(\pmb{x})} \| \pmb{x}_0' - \pmb{x}' \|$ . We have $\| \pmb{x}_0^* - \pmb{x}^* \| \leq \delta$ . Since $f$ is $L$ -Lipschitz continuous, we have $\| f(\pmb{x}_0^*) - f(\pmb{x}^*) \| \leq L \cdot \| \pmb{x}_0^* - \pmb{x}^* \| \leq L \delta$ . Since $\pmb{x} \in S_{\varepsilon}$ , for any $\pmb{x}' \in A(\pmb{x})$ , $\| f(\pmb{x}') - f(\pmb{x}^*) \| \leq \varepsilon$ . Similarly, since $\pmb{x}_0 \in S_{\varepsilon}$ and $\pmb{x}_0, \pmb{x}_0^* \in A(\pmb{x}_0)$ , we have $\| f(\pmb{x}_0) - f(\pmb{x}_0^*) \| \leq \varepsilon$ . + +The first term of (10) can be bounded by + +$$ +\begin{array}{l} f(\boldsymbol{x}_{0})^{\top}\underset {\boldsymbol{x}\in C_{1}^{0}\cap S_{\varepsilon}}{\mathbb{E}}[\tilde{f} (\boldsymbol {x})] \\ = \underset {\boldsymbol {x} \in C _ {1} ^ {0} \cap S _ {\varepsilon}} {\mathbb {E}} \underset {\boldsymbol {x} ^ {\prime} \in A (\boldsymbol {x})} {\mathbb {E}} \left[ f \left(\boldsymbol {x} _ {0}\right) ^ {\top} f \left(\boldsymbol {x} ^ {\prime}\right) \right] \\ = \underset {\boldsymbol {x} \in C _ {1} ^ {0} \cap S _ {\varepsilon}} {\mathbb {E}} \underset {\boldsymbol {x} ^ {\prime} \in A (\boldsymbol {x})} {\mathbb {E}} \left[ f \left(\boldsymbol {x} _ {0}\right) ^ {\top} \left(f \left(\boldsymbol {x} ^ {\prime}\right) - f \left(\boldsymbol {x} _ {0}\right) + f \left(\boldsymbol {x} _ {0}\right)\right) \right] \\ = r ^ {2} + \underset {\boldsymbol {x} \in C _ {1} ^ {0} \cap S _ {\varepsilon}} {\mathbb {E}} \underset {\boldsymbol {x} ^ {\prime} \in A (\boldsymbol {x})} {\mathbb {E}} [ f (\boldsymbol {x} _ {0}) ^ {\top} (f (\boldsymbol {x} ^ {\prime}) - f (\boldsymbol {x} _ {0})) ] \\ = r ^ {2} + \underset {\boldsymbol {x} \in C _ {1} ^ {0} \cap S _ {\varepsilon}} {\mathbb {E}} \underset {\boldsymbol {x} ^ {\prime} \in A (\boldsymbol {x})} {\mathbb {E}} [ f (\boldsymbol {x} _ {0}) ^ {\top} (\underbrace {f (\boldsymbol {x} ^ {\prime}) - f (\boldsymbol {x} ^ {*})} _ {\| \cdot \| \leq \varepsilon} + \underbrace {f (\boldsymbol {x} ^ {*}) - f (\boldsymbol {x} _ {0} ^ {*})} _ {\| \cdot \| \leq L \delta} + \underbrace {f (\boldsymbol {x} _ {0} ^ {*}) - f (\boldsymbol {x} _ {0})} _ {\| \cdot \| \leq \varepsilon}) ] \\ \geq r ^ {2} - \left[ r \varepsilon + r L \delta + r \varepsilon \right] \\ = r ^ {2} - r (L \delta + 2 \varepsilon). \\ \end{array} +$$ + +Therefore, (10) turns to + +$$ +\begin{array}{l} f \left(\boldsymbol {x} _ {0}\right) ^ {\top} \mu_ {1} \geq \left(\sigma - \frac {R _ {\varepsilon}}{p _ {1}}\right) f \left(\boldsymbol {x} _ {0}\right) ^ {\top} \underset {\boldsymbol {x} \in C _ {1} ^ {0} \cap S _ {\varepsilon}} {\mathbb {E}} [ \tilde {f} (\boldsymbol {x}) ] - r ^ {2} \left(1 - \sigma + \frac {R _ {\varepsilon}}{p _ {1}}\right) \\ \geq \left(\sigma - \frac {R _ {\varepsilon}}{p _ {1}}\right) \left(r ^ {2} - r (L \delta + 2 \varepsilon)\right) - r ^ {2} \left(1 - \sigma + \frac {R _ {\varepsilon}}{p _ {1}}\right) \\ = r ^ {2} \left(\left(2 \sigma - 1\right) - \frac {R _ {\varepsilon}}{p _ {1}} - \left(\sigma - \frac {R _ {\varepsilon}}{p _ {1}}\right) \left(\frac {L \delta}{r} + \frac {2 \varepsilon}{r}\right)\right) \\ = r ^ {2} \left(1 - 2 (1 - \sigma) - \frac {R _ {\varepsilon}}{p _ {1}} - \left(\sigma - \frac {R _ {\varepsilon}}{p _ {1}}\right) \left(\frac {L \delta}{r} + \frac {2 \varepsilon}{r}\right)\right) \\ = r ^ {2} \left(1 - \rho_ {1} (\sigma , \delta , \varepsilon)\right). \tag {11} \\ \end{array} +$$ + +On the other hand, + +$$ +\begin{array}{l} f \left(\boldsymbol {x} _ {0}\right) ^ {\top} \mu_ {k} = \left(f \left(\boldsymbol {x} _ {0}\right) - \mu_ {1}\right) ^ {\top} \mu_ {k} + \mu_ {1} ^ {\top} \mu_ {k} \\ \leq \left\| f (\boldsymbol {x} _ {0}) - \mu_ {1} \right\| \cdot \left\| \mu_ {k} \right\| + \mu_ {1} ^ {\top} \mu_ {k} \\ \leq r \sqrt {\| f (\boldsymbol {x} _ {0}) \| ^ {2} - 2 f (\boldsymbol {x} _ {0}) ^ {\top} \mu_ {1} + \| \mu_ {1} \| ^ {2}} + \mu_ {1} ^ {\top} \mu_ {k} \\ \leq r \sqrt {2 r ^ {2} - 2 f (\boldsymbol {x} _ {0}) ^ {\top} \mu_ {1}} + \mu_ {1} ^ {\top} \mu_ {k} \\ \leq \sqrt {2 \rho_ {1} (\sigma , \delta , \varepsilon)} r ^ {2} + \mu_ {1} ^ {\top} \mu_ {k}. \tag {12} \\ \end{array} +$$ + +Note that $\Delta_{\mu} = 1 - \min_k\| \mu_k\| ^2 /r^2$ , the LHS of (6) is + +$$ +\begin{array}{l} f \left(\boldsymbol {x} _ {0}\right) ^ {\top} \mu_ {1} - f \left(\boldsymbol {x} _ {0}\right) ^ {\top} \mu_ {k} - \left(\frac {1}{2} \| \mu_ {1} \| ^ {2} - \frac {1}{2} \| \mu_ {k} \| ^ {2}\right) \\ \geq f \left(\boldsymbol {x} _ {0}\right) ^ {\top} \mu_ {1} - f \left(\boldsymbol {x} _ {0}\right) ^ {\top} \mu_ {k} - \frac {1}{2} r ^ {2} \Delta_ {\mu} \\ \geq r ^ {2} (1 - \rho_ {1} (\sigma , \delta , \varepsilon)) - \sqrt {2 \rho_ {1} (\sigma , \delta , \varepsilon)} r ^ {2} - \mu_ {1} ^ {\top} \mu_ {k} - \frac {1}{2} r ^ {2} \Delta_ {\mu} \\ = r ^ {2} \left(1 - \rho_ {1} (\sigma , \delta , \varepsilon) - \sqrt {2 \rho_ {1} (\sigma , \delta , \varepsilon)} - \frac {1}{2} \Delta_ {\mu}\right) - \mu_ {1} ^ {\top} \mu_ {k} > 0, \\ \end{array} +$$ + +where the second inequality is due to (11) and (12). This finishes the proof. + +![](images/b1f3f9e503b0d843132e68ef65807fef1b5fd1a77fd46ed3e98f6752b0912331.jpg) + +Theorem 1. Given a $(\sigma, \delta)$ -augmentation used in contrastive SSL, if + +$$ +\mu_ {\ell} ^ {\top} \mu_ {k} < r ^ {2} \left(1 - \rho_ {\max } (\sigma , \delta , \varepsilon) - \sqrt {2 \rho_ {\max } (\sigma , \delta , \varepsilon)} - \frac {\Delta_ {\mu}}{2}\right) \tag {2} +$$ + +holds for any pair of $(\ell, k)$ with $\ell \neq k$ , then the downstream error rate of NN classifier $G_{f}$ + +$$ +\operatorname {E r r} \left(G _ {f}\right) \leq (1 - \sigma) + R _ {\varepsilon}, \tag {3} +$$ + +where $\rho_{max}(\sigma, \delta, \varepsilon) = 2(1 - \sigma) + \frac{R_{\varepsilon}}{\min_{\ell} p_{\ell}} + \sigma \left(\frac{L \delta}{r} + \frac{2 \varepsilon}{r}\right)$ and $\Delta_{\mu} = 1 - \min_{k \in [K]} \| \mu_k \|^2 / r^2$ . + +Proof. Since the augmentation $A$ is $(\sigma, \delta)$ -augmented, there exists a main part $C_k^0$ for each class $C_k$ such that $\mathbb{P}[C_k^0] \geq \sigma p_k$ and $\sup_{\boldsymbol{x}_1, \boldsymbol{x}_2 \in C_k^0} d_A(\boldsymbol{x}_1, \boldsymbol{x}_2) \leq \delta$ . Since for any $\ell \neq k$ , we have $\mu_\ell^\top \mu_k < r^2 \left(1 - \rho_{max}(\sigma, \delta, \varepsilon) - \sqrt{2\rho_{max}(\sigma, \delta, \varepsilon)} - \frac{\Delta_\mu}{2}\right) \leq r^2 \left(1 - \rho_\ell(\sigma, \delta, \varepsilon) - \sqrt{2\rho_\ell(\sigma, \delta, \varepsilon)} - \frac{\Delta_\mu}{2}\right)$ . + +According to Lemma 3.2, every sample $\pmb{x} \in C_{\ell}^{0} \cap S_{\varepsilon}$ can be correctly classified by $G_{f}$ . Therefore, every sample $\pmb{x} \in (C_1^0 \cap \dots \cap C_K^0) \cap S_\varepsilon$ can be correctly classified by $G_{f}$ . According to Lemma 3.1, the error rate $\mathrm{Err}(G_f) \leq 1 - \sigma + R_{\varepsilon}$ . + +Theorem 2. If encoder $f$ is $L$ -Lipschitz continuous, then + +$$ +R _ {\varepsilon} ^ {2} \leq \eta (\varepsilon) ^ {2} \cdot \underset {\boldsymbol {x}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} \| f (\boldsymbol {x} _ {1}) - f (\boldsymbol {x} _ {2}) \| ^ {2} = \eta (\varepsilon) ^ {2} \cdot \mathcal {L} _ {\mathrm {a l i g n}} (f), +$$ + +where $\eta (\varepsilon) = \inf_{h\in \left(0,\frac{\varepsilon}{2\sqrt{n}LM}\right)}\frac{4\max\{1,m^2h^{2n}\}}{h^{2n}(\varepsilon - 2\sqrt{n}LMh)}.$ + +Proof. The parameter space $[0,1]^n$ of $\theta$ can be separated to cubes $\Theta_1,\ldots ,\Theta_{m'}$ where $m^{\prime} = 1 / h^{n}$ and each cube's edge length is $h\in (0,\frac{\varepsilon}{2\sqrt{nLM}})$ . Then for any given $\pmb{x}$ , we have + +$$ +\begin{array}{l} \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} \| f (\boldsymbol {x} _ {1}) - f (\boldsymbol {x} _ {2}) \| = \underbrace {\frac {1}{4 m ^ {2}} \sum_ {\gamma = 1} ^ {m} \sum_ {\beta = 1} ^ {m} \| f (A _ {\gamma} (\boldsymbol {x})) - f (A _ {\beta} (\boldsymbol {x})) \|} _ {\Lambda_ {1}} \\ + \underbrace {\frac {1}{2 m m ^ {\prime}} \sum_ {\gamma = 1} ^ {m} \sum_ {j = 1} ^ {m ^ {\prime}} \int_ {\Theta_ {j}} \frac {1}{h ^ {n}} \| f (A _ {\gamma} (\boldsymbol {x})) - f (A _ {\theta} (\boldsymbol {x})) \| d \theta} _ {\Lambda_ {2}} \\ + \underbrace {\frac {1}{4 m ^ {\prime 2}} \sum_ {i = 1} ^ {m ^ {\prime}} \sum_ {j = 1} ^ {m ^ {\prime}} \int_ {\Theta_ {i}} \int_ {\Theta_ {j}} \frac {1}{h ^ {2 n}} \left\| f (A _ {\theta_ {1}} (\pmb {x})) - f (A _ {\theta_ {2}} (\pmb {x})) \right\| d \theta_ {2} d \theta_ {1}} _ {\Lambda_ {3}}. \\ \end{array} +$$ + +By Cauchy-Schwarz inequality, + +$$ +\forall \theta , \| f (A _ {\gamma} (\boldsymbol {x})) - f (A _ {\theta^ {\prime}} (\boldsymbol {x})) \| \leq \| f (A _ {\gamma} (\boldsymbol {x})) - f (A _ {\theta} (\boldsymbol {x})) \| + \| f (A _ {\theta} (\boldsymbol {x})) - f (A _ {\theta^ {\prime}} (\boldsymbol {x})) \|. +$$ + +Then for any given $\theta$ + +$$ +\begin{array}{l} \sup _ {\theta^ {\prime}} \| f (A _ {\gamma} (\boldsymbol {x})) - f (A _ {\theta^ {\prime}} (\boldsymbol {x})) \| \leq \| f (A _ {\gamma} (\boldsymbol {x})) - f (A _ {\theta} (\boldsymbol {x})) \| + \sup _ {\theta} \| f (A _ {\theta} (\boldsymbol {x})) - f (A _ {\theta^ {\prime}} (\boldsymbol {x})) \| \\ \leq \| f (A _ {\gamma} (\boldsymbol {x})) - f (A _ {\theta} (\boldsymbol {x})) \| + \sup _ {\theta_ {1}, \theta_ {2}} \| f (A _ {\theta_ {1}} (\boldsymbol {x})) - f (A _ {\theta_ {2}} (\boldsymbol {x})) \|. \\ \end{array} +$$ + +Therefore, for any $\gamma \in [m], j \in [m']$ , we have + +$$ +\begin{array}{l} \sup _ {\theta^ {\prime} \in \Theta_ {j}} \| f (A _ {\gamma} (\boldsymbol {x})) - f (A _ {\theta^ {\prime}} (\boldsymbol {x})) \| \\ = \int_ {\Theta_ {j}} \frac {1}{h ^ {n}} \sup _ {\theta^ {\prime} \in \Theta_ {j}} \| f (A _ {\gamma} (\boldsymbol {x})) - f (A _ {\theta^ {\prime}} (\boldsymbol {x})) \| d \theta \\ \leq \int_ {\Theta_ {j}} \frac {1}{h ^ {n}} \| f (A _ {\gamma} (\boldsymbol {x})) - f (A _ {\theta} (\boldsymbol {x})) \| d \theta + \sup _ {\theta_ {1}, \theta_ {2} \in \Theta_ {j}} \| f (A _ {\theta_ {1}} (\boldsymbol {x})) - f (A _ {\theta_ {2}} (\boldsymbol {x})) \| \\ \leq \int_ {\Theta_ {j}} \frac {1}{h ^ {n}} \| f (A _ {\gamma} (\boldsymbol {x})) - f (A _ {\theta} (\boldsymbol {x})) \| d \theta + L \sup _ {\theta_ {1}, \theta_ {2} \in \Theta_ {j}} \| A _ {\theta_ {1}} (\boldsymbol {x}) - A _ {\theta_ {2}} (\boldsymbol {x}) \| \\ \leq \int_ {\Theta_ {j}} \frac {1}{h ^ {n}} \| f (A _ {\gamma} (\boldsymbol {x})) - f (A _ {\theta} (\boldsymbol {x})) \| d \theta + L M \sup _ {\theta_ {1}, \theta_ {2} \in \Theta_ {j}} \| \theta_ {1} - \theta_ {2} \| \\ = \int_ {\Theta_ {j}} \frac {1}{h ^ {n}} \| f (A _ {\gamma} (\boldsymbol {x})) - f (A _ {\theta} (\boldsymbol {x})) \| d \theta + L M \sqrt {n} h \\ = \int_ {\Theta_ {j}} \frac {1}{h ^ {n}} \| f (A _ {\gamma} (\boldsymbol {x})) - f (A _ {\theta} (\boldsymbol {x})) \| d \theta + \sqrt {n} L M h. \\ \end{array} +$$ + +Similarly, we can obtain + +$$ +\begin{array}{l} \sup _ {\theta \in \Theta_ {i}, \theta^ {\prime} \in \Theta_ {j}} \| f (A _ {\theta} (\boldsymbol {x})) - f (A _ {\theta^ {\prime}} (\boldsymbol {x})) \| \\ = \int_ {\Theta_ {i}} \int_ {\Theta_ {j}} \frac {1}{h ^ {2 n}} \sup _ {\theta \in \Theta_ {i}, \theta^ {\prime} \in \Theta_ {j}} \| f (A _ {\theta} (\boldsymbol {x})) - f (A _ {\theta^ {\prime}} (\boldsymbol {x})) \| d \theta_ {2} d \theta_ {1} \\ \leq \int_ {\Theta_ {i}} \int_ {\Theta_ {j}} \frac {1}{h ^ {2 n}} \| f (A _ {\theta_ {1}} (\boldsymbol {x})) - f (A _ {\theta_ {2}} (\boldsymbol {x})) \| d \theta_ {2} d \theta_ {1} \\ + \int_ {\Theta_ {i}} \int_ {\Theta_ {j}} \frac {1}{h ^ {2 n}} \sup _ {\theta \in \Theta_ {i}} \| f (A _ {\theta} (\boldsymbol {x})) - f (A _ {\theta_ {1}} (\boldsymbol {x})) \| d \theta_ {2} d \theta_ {1} \\ + \int_ {\Theta_ {i}} \int_ {\Theta_ {j}} \frac {1}{h ^ {2 n}} \sup _ {\theta^ {\prime} \in \Theta_ {j}} \| f (A _ {\theta_ {2}} (\boldsymbol {x})) - f (A _ {\theta^ {\prime}} (\boldsymbol {x})) \| d \theta_ {2} d \theta_ {1} \\ \leq \int_ {\Theta_ {i}} \int_ {\Theta_ {j}} \frac {1}{h ^ {2 n}} \| f (A _ {\theta_ {1}} (\boldsymbol {x})) - f (A _ {\theta_ {2}} (\boldsymbol {x})) \| d \theta_ {2} d \theta_ {1} \\ + \sup _ {\theta , \theta^ {\prime} \in \Theta_ {i}} \| f (A _ {\theta} (\boldsymbol {x})) - f (A _ {\theta^ {\prime}} (\boldsymbol {x})) \| + \sup _ {\theta , \theta^ {\prime} \in \Theta_ {j}} \| f (A _ {\theta} (\boldsymbol {x})) - f (A _ {\theta^ {\prime}} (\boldsymbol {x})) \| \\ \leq \int_ {\Theta_ {i}} \int_ {\Theta_ {j}} \frac {1}{h ^ {2 n}} \| f (A _ {\theta_ {1}} (\boldsymbol {x})) - f (A _ {\theta_ {2}} (\boldsymbol {x})) \| d \theta_ {2} d \theta_ {1} + 2 \sqrt {n} L M h. \\ \end{array} +$$ + +Therefore, + +$$ +\begin{array}{l} \sup _ {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} \| f (\boldsymbol {x} _ {1}) - f (\boldsymbol {x} _ {2}) \| \\ = \max \left\{ \begin{array}{c} \sup _ {\gamma , \beta \in [ m ]} \| f (A _ {\gamma} (\boldsymbol {x})) - f (A _ {\beta} (\boldsymbol {x})) \| \\ \sup _ {\gamma \in [ m ], j \in [ m ^ {\prime} ]} \sup _ {\theta^ {\prime} \in \Theta_ {j}} \| f (A _ {\gamma} (\boldsymbol {x})) - f (A _ {\theta^ {\prime}} (\boldsymbol {x})) \| \\ \sup _ {i, j \in [ m ^ {\prime} ]} \sup _ {\theta \in \Theta_ {i}, \theta^ {\prime} \in \Theta_ {j}} \| f (A _ {\theta} (\boldsymbol {x})) - f (A _ {\theta^ {\prime}} (\boldsymbol {x})) \| \end{array} \right\} \\ \leq \max \left\{ \begin{array}{c} \sup _ {\gamma , \beta \in [ m ] , j \in [ m ^ {\prime} ]} \| f (A _ {\gamma} (\boldsymbol {x})) - f (A _ {\beta} (\boldsymbol {x})) \| \\ \sup _ {\gamma \in [ m ], j \in [ m ^ {\prime} ]} \int_ {\Theta_ {j}} \frac {1}{h ^ {n}} \| f (A _ {\gamma} (\boldsymbol {x})) - f (A _ {\theta} (\boldsymbol {x})) \| d \theta + \sqrt {n} L M h \\ \sup _ {i, j \in [ m ^ {\prime} ]} \int_ {\Theta_ {i}} \int_ {\Theta_ {j}} \frac {1}{h ^ {2 n}} \| f (A _ {\theta_ {1}} (\boldsymbol {x})) - f (A _ {\theta_ {2}} (\boldsymbol {x})) \| d \theta_ {2} d \theta_ {1} + 2 \sqrt {n} L M h \end{array} \right\} \\ \end{array} +$$ + +$$ +\begin{array}{l} \leq \max \left\{ \begin{array}{c} \sum_ {\gamma = 1} ^ {m} \sum_ {\beta = 1} ^ {m} \| f (A _ {\gamma} (\boldsymbol {x})) - f (A _ {\beta} (\boldsymbol {x})) \| \\ \sum_ {\gamma = 1} ^ {m} \sum_ {j = 1} ^ {m ^ {\prime}} \int_ {\Theta_ {j}} \frac {1}{h ^ {n}} \| f (A _ {\gamma} (\boldsymbol {x})) - f (A _ {\theta} (\boldsymbol {x})) \| d \theta + \sqrt {n} L M h \\ \sum_ {i = 1} ^ {m ^ {\prime}} \sum_ {j = 1} ^ {m ^ {\prime}} \int_ {\Theta_ {i}} \int_ {\Theta_ {j}} \frac {1}{h ^ {2 n}} \| f (A _ {\theta_ {1}} (\boldsymbol {x})) - f (A _ {\theta_ {2}} (\boldsymbol {x})) \| d \theta_ {2} d \theta_ {1} + 2 \sqrt {n} L M h \end{array} \right\} \\ \leq \max \left\{ \begin{array}{c} 4 m ^ {2} \Lambda_ {1} \\ 2 m m ^ {\prime} \Lambda_ {2} + \sqrt {n} L M h \\ 4 m ^ {\prime 2} \Lambda_ {3} + 2 \sqrt {n} L M h \end{array} \right\} \\ \leq \max \left\{ \begin{array}{c} 4 m ^ {2} \Lambda_ {1} \\ 2 m m ^ {\prime} \Lambda_ {2} \\ 4 m ^ {\prime 2} \Lambda_ {3} \end{array} \right\} + 2 \sqrt {n} L M h \\ \leq \max \left\{4 m ^ {2}, 2 m m ^ {\prime}, 4 m ^ {\prime 2} \right\} \left(\Lambda_ {1} + \Lambda_ {2} + \Lambda_ {3}\right) + 2 \sqrt {n} L M h \\ = \max \left\{4 m ^ {2}, 2 m m ^ {\prime}, 4 m ^ {\prime 2} \right\} \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} \| f (\boldsymbol {x} _ {1}) - f (\boldsymbol {x} _ {2}) \| + 2 \sqrt {n} L M h. \\ \end{array} +$$ + +Thus, the following set $S$ is a subset of $S_{\varepsilon}$ + +$$ +S = \left\{\boldsymbol {x} \colon \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} \| f (\boldsymbol {x} _ {1}) - f (\boldsymbol {x} _ {2}) \| \leq \frac {\varepsilon - 2 \sqrt {n} L M h}{\max \{4 m ^ {2} , 2 m m ^ {\prime} , 4 m ^ {\prime 2} \}} \right\} \subseteq S _ {\varepsilon}. +$$ + +Then by Markov's inequality, we have + +$$ +\begin{array}{l} R _ {\varepsilon} = \mathbb {P} \left[ \overline {{S _ {\varepsilon}}} \right] \leq \mathbb {P} \left[ \overline {{S}} \right] \\ \leq \frac {\mathbb {E} _ {\boldsymbol {x}} \mathbb {E} _ {\boldsymbol {x} _ {1} , \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} \| f (\boldsymbol {x} _ {1}) - f (\boldsymbol {x} _ {2}) \|}{\frac {\varepsilon - 2 \sqrt {n} L M h}{\max \{4 m ^ {2} , 2 m m ^ {\prime} , 4 m ^ {\prime 2} \}}} \\ = \frac {\operatorname* {m a x} \left\{4 , 2 m h ^ {n} , 4 m ^ {2} h ^ {2 n} \right\}}{h ^ {2 n} (\varepsilon - 2 \sqrt {n} L M h)} \underset {\boldsymbol {x} \boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} \underset {\boldsymbol {x} \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} \| f (\boldsymbol {x} _ {1}) - f (\boldsymbol {x} _ {2}) \| \\ = \frac {4 \max \{1 , m ^ {2} h ^ {2 n} \}}{h ^ {2 n} (\varepsilon - 2 \sqrt {n} L M h)} \mathbb {E} _ {\boldsymbol {x}} \mathbb {E} _ {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} \| f (\boldsymbol {x} _ {1}) - f (\boldsymbol {x} _ {2}) \|. \\ \end{array} +$$ + +The above inequality holds for all $h \in (0, \frac{\varepsilon}{2\sqrt{nLM}})$ , thus + +$$ +R_{\varepsilon}\leq \inf_{0 < h < \frac{\varepsilon}{2\sqrt{n}LM}}\frac{4\max\{1,m^{2}h^{2n}\}}{h^{2n}(\varepsilon - 2\sqrt{n} LMh)}\mathbb{E}_{\boldsymbol {x} \boldsymbol{x}_{1},\boldsymbol{x}_{2}\in A(\boldsymbol {x})}\mathbb{E}\| f(\boldsymbol{x}_{1}) - f(\boldsymbol{x}_{2})\| = \eta (\varepsilon)\cdot \mathbb{E}_{\boldsymbol {x} \boldsymbol{x}_{1},\boldsymbol{x}_{2}\in A(\boldsymbol {x})}\mathbb{E}\| f(\boldsymbol{x}_{1}) - f(\boldsymbol{x}_{2})\| . +$$ + +Therefore, we have + +$$ +R _ {\varepsilon} ^ {2} \leq \eta (\varepsilon) ^ {2} \cdot \left(\underset {\boldsymbol {x}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} \| f (\boldsymbol {x} _ {1}) - f (\boldsymbol {x} _ {2}) \|\right) ^ {2} \leq \eta (\varepsilon) ^ {2} \cdot \underset {\boldsymbol {x}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} \| f (\boldsymbol {x} _ {1}) - f (\boldsymbol {x} _ {2}) \| ^ {2}. +$$ + +This finishes the proof. + +# C PROOFS FOR SECTION 4 + +Before providing our proofs, we give the following useful lemma, which upper bounds the first and second order moment of intra-difference within each class $C_k$ via $\varepsilon$ and $R_{\varepsilon}$ . + +Lemma C.1. Suppose that $\| f(\pmb {x})\| = r$ for every $\pmb{x}$ . For each $k\in [K]$ + +$$ +\underset {\boldsymbol {x} \in C _ {k}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \| f (\boldsymbol {x} _ {1}) - \mu_ {k} \| \leq 4 r \left(1 - \sigma \left(1 - \frac {\varepsilon}{2 r} - \frac {L \delta}{4 r}\right) + \frac {R _ {\varepsilon}}{p _ {k}}\right), +$$ + +and + +$$ +\underset {\boldsymbol {x} \in C _ {k}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \| f (\boldsymbol {x} _ {1}) - \mu_ {k} \| ^ {2} \leq 4 r ^ {2} \left[ \left(1 - \sigma + \frac {L}{2 r} \delta\right) + \left(\frac {\varepsilon}{r} + \frac {R _ {\varepsilon}}{p _ {k}}\right) \right] ^ {2} + 4 r ^ {2} \left(1 - \sigma + \frac {R _ {\varepsilon}}{p _ {k}}\right). +$$ + +Proof. For each $k \in [K]$ , + +$$ +\begin{array}{l} \underset {\boldsymbol {x} \in C _ {k}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \| f (\boldsymbol {x} _ {1}) - \mu_ {k} \| \\ = \frac {1}{p _ {k}} \underset {\boldsymbol {x}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \left[ \mathbb {I} \left(\boldsymbol {x} \in C _ {k}\right) \| f \left(\boldsymbol {x} _ {1}\right) - \mu_ {k} \| \right] \\ = \frac {1}{p _ {k}} \underset {\boldsymbol {x} \boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \underset {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \left[ \mathbb {I} \left(\boldsymbol {x} \in C _ {k} ^ {0} \cap S _ {\varepsilon}\right) \| f \left(\boldsymbol {x} _ {1}\right) - \mu_ {k} \| \right] + \frac {1}{p _ {k}} \underset {\boldsymbol {x} \boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \underset {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \left[ \mathbb {I} \left(\boldsymbol {x} \in C _ {k} \setminus C _ {k} ^ {0} \cap S _ {\varepsilon}\right) \| f \left(\boldsymbol {x} _ {1}\right) - \mu_ {k} \| \right] \\ \leq \frac {1}{p _ {k}} \underset {\boldsymbol {x}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \left[ \mathbb {I} \left(\boldsymbol {x} \in C _ {k} ^ {0} \cap S _ {\varepsilon}\right) \| f \left(\boldsymbol {x} _ {1}\right) - \mu_ {k} \| \right] + \frac {2 r \mathbb {P} \left[ C _ {k} \setminus C _ {k} ^ {0} \cap S _ {\varepsilon} \right]}{p _ {k}} \\ \leq \frac {1}{p _ {k}} \mathbb {E} _ {\boldsymbol {x} _ {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})}} \mathbb {E} \left[ \mathbb {I} \left(\boldsymbol {x} \in C _ {k} ^ {0} \cap S _ {\varepsilon}\right) \| f \left(\boldsymbol {x} _ {1}\right) - \mu_ {k} \| \right] + 2 r \left(1 - \sigma + \frac {R _ {\varepsilon}}{p _ {k}}\right) (8) \\ \leq \frac {\mathbb {P} \left[ C _ {k} ^ {0} \cap S _ {\varepsilon} \right]}{p _ {k}} \underset {\boldsymbol {x} \in C _ {k} ^ {0} \cap S _ {\varepsilon}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \| f (\boldsymbol {x} _ {1}) - \mu_ {k} \| + 2 r \left(1 - \sigma + \frac {R _ {\varepsilon}}{p _ {k}}\right) \\ \leq \underset {\boldsymbol {x} \in C _ {k} ^ {0} \cap S _ {\varepsilon}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \| f (\boldsymbol {x} _ {1}) - \mu_ {k} \| + 2 r \left(1 - \sigma + \frac {R _ {\varepsilon}}{p _ {k}}\right) (13) \\ \end{array} +$$ + +where + +$$ +\begin{array}{l} \underset {\boldsymbol {x} \in C _ {k} ^ {0} \cap S _ {\varepsilon}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \| f (\boldsymbol {x} _ {1}) - \mu_ {k} \| \\ = \underset {\boldsymbol {x} \in C _ {k} ^ {0} \cap S _ {\varepsilon}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \| f (\boldsymbol {x} _ {1}) - \underset {\boldsymbol {x} ^ {\prime} \in C _ {k}} {\mathbb {E}} \underset {\boldsymbol {x} _ {2} \in A (\boldsymbol {x} ^ {\prime})} {\mathbb {E}} f (\boldsymbol {x} _ {2}) \| \\ = \underset {\boldsymbol {x} \in C _ {k} ^ {0} \cap S _ {\varepsilon}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \left\| f (\boldsymbol {x} _ {1}) - \frac {\mathbb {P} \left[ C _ {k} ^ {0} \cap S _ {\varepsilon} \right]}{p _ {k}} \underset {\boldsymbol {x} ^ {\prime} \in C _ {k} ^ {0} \cap S _ {\varepsilon}} {\mathbb {E}} \underset {\boldsymbol {x} _ {2} \in A (\boldsymbol {x} ^ {\prime})} {\mathbb {E}} f (\boldsymbol {x} _ {2}) - \frac {\mathbb {P} \left[ C _ {k} \setminus C _ {k} ^ {0} \cap S _ {\varepsilon} \right]}{p _ {k}} \underset {\boldsymbol {x} ^ {\prime} \in C _ {k} \setminus C _ {k} ^ {0} \cap S _ {\varepsilon}} {\mathbb {E}} \underset {\boldsymbol {x} _ {2} \in A (\boldsymbol {x} ^ {\prime})} {\mathbb {E}} f (\boldsymbol {x} _ {2}) \right\| \\ = \underset {\boldsymbol {x} \in C _ {k} ^ {0} \cap S _ {\varepsilon}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \left\| \frac {\mathbb {P} \left[ C _ {k} ^ {0} \cap S _ {\varepsilon} \right]}{p _ {k}} \left(f \left(\boldsymbol {x} _ {1}\right) - \underset {\boldsymbol {x} ^ {\prime} \in C _ {k} ^ {0} \cap S _ {\varepsilon}} {\mathbb {E}} \underset {\boldsymbol {x} _ {2} \in A \left(\boldsymbol {x} ^ {\prime}\right)} {\mathbb {E}} f \left(\boldsymbol {x} _ {2}\right)\right) \right. \\ + \frac {\mathbb {P} \left[ C _ {k} \backslash C _ {k} ^ {0} \cap S _ {\varepsilon} \right]}{p _ {k}} \left(f (\boldsymbol {x} _ {1}) - \underset {\boldsymbol {x} ^ {\prime} \in C _ {k} \backslash C _ {k} ^ {0} \cap S _ {\varepsilon}} {\mathbb {E}} \underset {\boldsymbol {x} _ {2} \in A (\boldsymbol {x} ^ {\prime})} {\mathbb {E}} f (\boldsymbol {x} _ {2})\right) \| \\ \leq \frac {\mathbb {P} \left[ C _ {k} ^ {0} \cap S _ {\varepsilon} \right]}{p _ {k}} \underset {\boldsymbol {x} \in C _ {k} ^ {0} \cap S _ {\varepsilon}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \left\| f (\boldsymbol {x} _ {1}) - \underset {\boldsymbol {x} ^ {\prime} \in C _ {k} ^ {0} \cap S _ {\varepsilon}} {\mathbb {E}} \underset {\boldsymbol {x} _ {2} \in A (\boldsymbol {x} ^ {\prime})} {\mathbb {E}} f (\boldsymbol {x} _ {2}) \right\| + \frac {\mathbb {P} \left[ C _ {k} \setminus C _ {k} ^ {0} \cap S _ {\varepsilon} \right]}{p _ {k}} \cdot 2 r \\ \leq \sup _ {\boldsymbol {x}, \boldsymbol {x} ^ {\prime} \in C _ {k} ^ {0} \cap S _ {\varepsilon}} \sup _ {\substack {\boldsymbol {x} _ {1} \in A (\boldsymbol {x}) \\ \boldsymbol {x} _ {2} \in A \left(\boldsymbol {x} ^ {\prime}\right)}} \| f (\boldsymbol {x} _ {1}) - f (\boldsymbol {x} _ {2}) \| + 2 r \left(1 - \sigma + \frac {R _ {\varepsilon}}{p _ {k}}\right). \tag{14} \\ \end{array} +$$ + +For any $\pmb{x}, \pmb{x}' \in C_1^0 \cap S_{\varepsilon}$ , we have $d_A(\pmb{x}, \pmb{x}') \leq \delta$ . Let $(\pmb{x}_1^*, \pmb{x}_2^*) = \arg \min_{\pmb{x}_1 \in A(\pmb{x}), \pmb{x}_2 \in A(\pmb{x}')} \| \pmb{x}_1 - \pmb{x}_2 \|$ . We have $\| \pmb{x}_1^* - \pmb{x}_2^* \| \leq \delta$ . Since $f$ is $L$ -Lipschitz continuous, we have $\| f(\pmb{x}_1^*) - f(\pmb{x}_2^*) \| \leq L \cdot \| \pmb{x}_1^* - \pmb{x}_2^* \| \leq L\delta$ . Since $\pmb{x} \in S_{\varepsilon}$ , for any $\pmb{x}_1 \in A(\pmb{x})$ , $\| f(\pmb{x}_1) - f(\pmb{x}_1^*) \| \leq \varepsilon$ . Similarly, since $\pmb{x}' \in S_{\varepsilon}$ , for any $\pmb{x}_2 \in A(\pmb{x}')$ , we have $\| f(\pmb{x}_2) - f(\pmb{x}_2^*) \| \leq \varepsilon$ . Therefore, for any $\pmb{x}, \pmb{x}' \in C_1^0 \cap S_{\varepsilon}$ and $\pmb{x}_1 \in A(\pmb{x}), \pmb{x}_2 \in A(\pmb{x}')$ , + +$$ +\left\| f \left(\boldsymbol {x} _ {1}\right) - f \left(\boldsymbol {x} _ {2}\right) \right\| \leq \left\| f \left(\boldsymbol {x} _ {1}\right) - f \left(\boldsymbol {x} _ {1} ^ {*}\right) \right\| + \left\| f \left(\boldsymbol {x} _ {1} ^ {*}\right) - f \left(\boldsymbol {x} _ {2} ^ {*}\right) \right\| + \left\| f \left(\boldsymbol {x} _ {2} ^ {*}\right) - f \left(\boldsymbol {x} _ {2}\right) \right\| \leq 2 \varepsilon + L \delta . +$$ + +Plugging into (13) and (14), we obtain + +$$ +\begin{array}{l} \underset {\boldsymbol {x} \in C _ {k}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \| f (\boldsymbol {x} _ {1}) - \mu_ {k} \| \leq (2 \varepsilon + L \delta) + 4 r \left(1 - \sigma + \frac {R _ {\varepsilon}}{p _ {k}}\right) \\ = 4 r \left(1 - \sigma + \frac {L}{4 r} \delta\right) + 2 \left(\varepsilon + \frac {2 r}{p _ {k}} R _ {\varepsilon}\right). \\ \end{array} +$$ + +Similar to (13) and (14), we have + +$$ +\underset {\boldsymbol {x} \in C _ {k}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \| f (\boldsymbol {x} _ {1}) - \mu_ {k} \| ^ {2} \leq \underset {\boldsymbol {x} \in C _ {k} ^ {0} \cap S _ {\varepsilon}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \| f (\boldsymbol {x} _ {1}) - \mu_ {k} \| ^ {2} + 4 r ^ {2} \left(1 - \sigma + \frac {R _ {\varepsilon}}{p _ {k}}\right), +$$ + +and + +$$ +\begin{array}{l} \operatorname * {E} _ {\boldsymbol {x} \in C _ {k} ^ {0} \cap S _ {\varepsilon}} \operatorname * {E} _ {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} \| f (\boldsymbol {x} _ {1}) - \mu_ {k} \| ^ {2} \\ = \underset {\boldsymbol {x} \in C _ {k} ^ {0} \cap S _ {\varepsilon}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \left\| \frac {\mathbb {P} \left[ C _ {k} ^ {0} \cap S _ {\varepsilon} \right]}{p _ {k}} \left(f \left(\boldsymbol {x} _ {1}\right) - \underset {\boldsymbol {x} ^ {\prime} \in C _ {k} ^ {0} \cap S _ {\varepsilon}} {\mathbb {E}} \underset {\boldsymbol {x} _ {2} \in A \left(\boldsymbol {x} ^ {\prime}\right)} {\mathbb {E}} f \left(\boldsymbol {x} _ {2}\right)\right) \right. \\ + \frac {\mathbb {P} \left[ C _ {k} \backslash C _ {k} ^ {0} \cap S _ {\varepsilon} \right]}{p _ {k}} \left(f (\boldsymbol {x} _ {1}) - \underset {\boldsymbol {x} ^ {\prime} \in C _ {k} \backslash C _ {k} ^ {0} \cap S _ {\varepsilon}} {\mathbb {E}} \underset {\boldsymbol {x} _ {2} \in A (\boldsymbol {x} ^ {\prime})} {\mathbb {E}} f (\boldsymbol {x} _ {2})\right) \| ^ {2} \\ \leq \underset {\boldsymbol {x} \in C _ {k} ^ {0} \cap S _ {\varepsilon}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \left[ \left\| f (\boldsymbol {x} _ {1}) - \underset {\boldsymbol {x} ^ {\prime} \in C _ {k} ^ {0} \cap S _ {\varepsilon}} {\mathbb {E}} \underset {\boldsymbol {x} _ {2} \in A (\boldsymbol {x} ^ {\prime})} {\mathbb {E}} f (\boldsymbol {x} _ {2}) \right\| + 2 r \left(1 - \sigma + \frac {R _ {\varepsilon}}{p _ {k}}\right) \right] ^ {2} \\ \leq \left[ (2 \varepsilon + L \delta) + 2 r \left(1 - \sigma + \frac {R _ {\varepsilon}}{p _ {k}}\right) \right] ^ {2}. \\ \end{array} +$$ + +Therefore, + +$$ +\begin{array}{l} \underset {\boldsymbol {x} \in C _ {k}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \| f (\boldsymbol {x} _ {1}) - \mu_ {k} \| ^ {2} \leq \left[ (2 \varepsilon + L \delta) + 2 r \left(1 - \sigma + \frac {R _ {\varepsilon}}{p _ {k}}\right) \right] ^ {2} + 4 r ^ {2} \left(1 - \sigma + \frac {R _ {\varepsilon}}{p _ {k}}\right) \\ = 4 r ^ {2} \left[ \left(1 - \sigma + \frac {L}{2 r} \delta\right) + \left(\frac {\varepsilon}{r} + \frac {R _ {\varepsilon}}{p _ {k}}\right) \right] ^ {2} + 4 r ^ {2} \left(1 - \sigma + \frac {R _ {\varepsilon}}{p _ {k}}\right). \\ \end{array} +$$ + +This finishes the proof. + +![](images/209bd585bd8012f947a26f3e47f2c6b0773666abc098705ac8d99b7837cdd987.jpg) + +Now we are ready to give our proofs of theorems. + +# C.1 INFONCE LOSS + +Theorem 3. Assume that encoder $f$ with norm 1 is $L$ -Lipschitz continuous. If the augmented data is $(\sigma, \delta)$ -augmented, then for any $\varepsilon \geq 0$ and $k \neq \ell$ , we have + +$$ +\mu_ {k} ^ {\top} \mu_ {\ell} \leq \log \left(\exp \left\{\frac {\mathcal {L} _ {2} ^ {\mathrm {I n f o N C E}} (f) + \tau (\sigma , \delta , \varepsilon , R _ {\varepsilon})}{p _ {k} p _ {\ell}} \right\} - \exp (1 - \varepsilon)\right), +$$ + +where $\tau (\sigma ,\delta ,\varepsilon ,R_{\varepsilon})$ is a non-negative term, decreasing with smaller $\varepsilon$ , $R_{\varepsilon}$ or sharper concentration of augmented data, and $\tau (\sigma ,\delta ,\varepsilon ,R_{\varepsilon}) = 0$ when $\sigma = 1$ , $\delta = 0$ , $\varepsilon = 0$ , $R_{\varepsilon} = 0$ . + +Proof. Given $\pmb{x} \in S_{\varepsilon}$ , for any $\pmb{x}_1, \pmb{x}_2 \in A(\pmb{x})$ , we have + +$$ +\begin{array}{l} \log \left(e ^ {f (\boldsymbol {x} _ {1}) ^ {\top} f (\boldsymbol {x} _ {2})} + e ^ {f (\boldsymbol {x} _ {1}) ^ {\top} f (\boldsymbol {x} ^ {-})}\right) = \log \left(e ^ {f (\boldsymbol {x} _ {1}) ^ {\top} f (\boldsymbol {x} _ {1})} e ^ {f (\boldsymbol {x} _ {1}) ^ {\top} (f (\boldsymbol {x} _ {2}) - f (\boldsymbol {x} _ {1}))} + e ^ {f (\boldsymbol {x} _ {1}) ^ {\top} f (\boldsymbol {x} ^ {-})}\right) \\ \geq \log \left(e ^ {\| f (\boldsymbol {x} _ {1}) \| ^ {2}} e ^ {- \| f (\boldsymbol {x} _ {1}) \| \cdot \varepsilon} + e ^ {f (\boldsymbol {x} _ {1}) ^ {\top} f (\boldsymbol {x} ^ {-})}\right) \\ = \log \left(e ^ {1 - \varepsilon} + e ^ {f (\boldsymbol {x} _ {1}) ^ {\top} f (\boldsymbol {x} ^ {-})}\right). \\ \end{array} +$$ + +Therefore, we have + +$$ +\begin{array}{l} \mathcal{L}_{2}^{\text{InfoNCE}}(f) = \underset { \begin{array}{c}\boldsymbol {x},\boldsymbol{x}^{\prime}\\ \boldsymbol{x}^{-}\in A(\boldsymbol{x}^{\prime}) \end{array} }{\mathbb{E}}\underset { \begin{array}{c}\boldsymbol{x}_{1},\boldsymbol{x}_{2}\in A(\boldsymbol{x})\\ \boldsymbol{x}^{-}\in A(\boldsymbol{x}^{\prime}) \end{array} }{\mathbb{E}}\left[\log \left(e^{f(\boldsymbol{x}_{1})^{\top}f(\boldsymbol{x}_{2})} + e^{f(\boldsymbol{x}_{1})^{\top}f(\boldsymbol{x}^{-})}\right)\right] \\ = \underset { \begin{array}{c} \boldsymbol {x}, \boldsymbol {x} ^ {\prime} \\ \boldsymbol {x} ^ {-} \in A (\boldsymbol {x} ^ {\prime}) \end{array} } {\mathbb {E}} \underset { \begin{array}{c} \boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x}) \\ \boldsymbol {x} ^ {-} \in A (\boldsymbol {x} ^ {\prime}) \end{array} } {\mathbb {E}} \left[ (\mathbb {I} (\boldsymbol {x} \in S _ {\varepsilon}) + \mathbb {I} (\boldsymbol {x} \in \bar {S} _ {\varepsilon})) \log \left(e ^ {f (\boldsymbol {x} _ {1}) ^ {\top} f (\boldsymbol {x} _ {2})} + e ^ {f (\boldsymbol {x} _ {1}) ^ {\top} f (\boldsymbol {x} ^ {-})}\right) \right] \\ \geq \sum_{k = 1}^{K}\sum_{\ell = 1}^{K}\mathbb{E}_{\boldsymbol {x},\boldsymbol{x}^{\prime}}\left[\mathbb{I}(\boldsymbol {x}\in S_{\varepsilon}\cap C_{k})\mathbb{I}(\boldsymbol{x}^{\prime}\in C_{\ell})\underset { \begin{array}{c}\boldsymbol{x}_{1}\in A(\boldsymbol {x})\\ \boldsymbol{x}^{-}\in A(\boldsymbol{x}^{\prime}) \end{array} }{\mathbb{E}}\log \Big(e^{1 - \varepsilon} + e^{f(\boldsymbol{x}_{1})^{\top}f(\boldsymbol{x}^{-})}\Big)\right] + \mathbb{E}_{\boldsymbol{x}}\left[\mathbb{I}(\boldsymbol {x}\in \bar{S}_{\varepsilon})\log \big(e^{-1} + e^{-1}\big)\right] \\ \end{array} +$$ + +$$ +\begin{array}{l} = \left(\sum_ {k = 1} ^ {K} \sum_ {\ell = 1} ^ {K} \mathbb {E} _ {\boldsymbol {x}, \boldsymbol {x} ^ {\prime}} \left[ \mathbb {I} (\boldsymbol {x} \in C _ {k}) \mathbb {I} (\boldsymbol {x} ^ {\prime} \in C _ {\ell}) \log \left(e ^ {1 - \varepsilon} + e ^ {\mu_ {k} ^ {\top} \mu_ {\ell}}\right) \right] + \Delta_ {1}\right) - (1 - \log 2) R _ {\varepsilon} \\ = \sum_ {k = 1} ^ {K} \sum_ {\ell = 1} ^ {K} \left[ p _ {k} p _ {l} \log \left(e ^ {1 - \varepsilon} + e ^ {\mu_ {k} ^ {\top} \mu_ {\ell}}\right) \right] - (1 - \log 2) R _ {\varepsilon} + \Delta_ {1} \\ \geq p _ {k} p _ {\ell} \log \left(e ^ {1 - \varepsilon} + e ^ {\mu_ {k} ^ {\top} \mu_ {\ell}}\right) - (1 - \log 2) R _ {\varepsilon} + \Delta_ {1}, \tag {15} \\ \end{array} +$$ + +where $\Delta_{1}$ is defined as + +$$ +\begin{array}{l} \Delta_{1}:= \sum_{k = 1}^{K}\sum_{\ell = 1}^{K}\mathbb{E}_{\boldsymbol{x},\boldsymbol{x}^{\prime}}\left[\mathbb{I}(\boldsymbol {x}\in S_{\varepsilon}\cap C_{k})\mathbb{I}(\boldsymbol{x}^{\prime}\in C_{\ell})\underset { \begin{array}{c}\boldsymbol{x}_{1}\in A(\boldsymbol {x})\\ \boldsymbol{x}^{-}\in A(\boldsymbol{x}^{\prime}) \end{array} }{\mathbb{E}}\log \Big(e^{1 - \varepsilon} + e^{f(\boldsymbol{x}_{1})^{\top}f(\boldsymbol{x}^{-})}\Big)\right] \\ - \sum_ {k = 1} ^ {K} \sum_ {\ell = 1} ^ {K} \mathbb {E} _ {\boldsymbol {x}, \boldsymbol {x} ^ {\prime}} \left[ \mathbb {I} (\boldsymbol {x} \in C _ {k}) \mathbb {I} (\boldsymbol {x} ^ {\prime} \in C _ {\ell}) \log \left(e ^ {1 - \varepsilon} + e ^ {\mu_ {k} ^ {\top} \mu_ {\ell}}\right) \right] \\ = -\sum_{k = 1}^{K}\sum_{\ell = 1}^{K}\mathbb{E}_{\boldsymbol {x},\boldsymbol{x}^{\prime}}\left[\left(\mathbb{I}(\boldsymbol {x}\in C_{k}) - \mathbb{I}(\boldsymbol {x}\in S_{\varepsilon}\cap C_{k})\right)\mathbb{I}(\boldsymbol{x}^{\prime}\in C_{\ell})\underset { \begin{array}{c}\boldsymbol{x}_{1}\in A(\boldsymbol {x})\\ \boldsymbol{x}^{-}\in A(\boldsymbol{x}^{\prime}) \end{array} }{\mathbb{E}}\left[\log \left(e^{1 - \varepsilon} + e^{f(\boldsymbol{x}_{1})^{\top}f(\boldsymbol{x}^{-})}\right)\right]\right] \\ +\sum_{k = 1}^{K}\sum_{\ell = 1}^{K}\mathbb{E}_{\boldsymbol {x},\boldsymbol{x}^{\prime}}\left[\mathbb{I}(\boldsymbol {x}\in C_{k})\mathbb{I}(\boldsymbol{x}^{\prime}\in C_{\ell})\underset { \begin{array}{c}\boldsymbol{x}_{1}\in A(\boldsymbol {x})\\ \boldsymbol{x}^{-}\in A(\boldsymbol{x}^{\prime}) \end{array} }{\mathbb{E}}\left[\log \left(e^{1 - \varepsilon} + e^{f(\boldsymbol{x}_{1})^{\top}f(\boldsymbol{x}^{-})}\right) - \log \left(e^{1 - \varepsilon} + e^{\mu_{k}^{\top}\mu_{\ell}}\right)\right]\right]. \\ \end{array} +$$ + +Then, + +$$ +\begin{array}{l} \left| \Delta_ {1} \right| \\ \leq \log (2 e) \sum_ {k = 1} ^ {K} \sum_ {\ell = 1} ^ {K} \mathbb {E} _ {\boldsymbol {x}, \boldsymbol {x} ^ {\prime}} \left[ \left(\mathbb {I} (\boldsymbol {x} \in C _ {k}) - \mathbb {I} (\boldsymbol {x} \in S _ {\varepsilon} \cap C _ {k})\right) \mathbb {I} (\boldsymbol {x} ^ {\prime} \in C _ {\ell}) \right] \\ +\sum_{k = 1}^{K}\sum_{\ell = 1}^{K}\mathbb{E}_{\boldsymbol {x},\boldsymbol{x}^{\prime}}\left[\mathbb{I}(\boldsymbol {x}\in C_{k})\mathbb{I}(\boldsymbol{x}^{\prime}\in C_{\ell})\underset { \begin{array}{c}\boldsymbol{x}_{1}\in A(\boldsymbol {x})\\ \boldsymbol{x}^{-}\in A(\boldsymbol{x}^{\prime}) \end{array} }{\mathbb{E}}\left[\log \left(e^{1 - \varepsilon} + e^{f(\boldsymbol{x}_{1})^{\top}f(\boldsymbol{x}^{-})}\right) - \log \left(e^{1 - \varepsilon} + e^{\mu_{k}^{\top}\mu_{\ell}}\right)\right]\right] \\ \leq (1 + \log 2)R_{\varepsilon} + \sum_{k = 1}^{K}\sum_{\ell = 1}^{K}\mathbb{E}_{\boldsymbol {x},\boldsymbol{x}^{\prime}}\left[\mathbb{I}(\boldsymbol {x}\in C_{k})\mathbb{I}(\boldsymbol{x}^{\prime}\in C_{\ell})\underset { \begin{array}{c}\boldsymbol{x}_{1}\in A(\boldsymbol {x})\\ \boldsymbol{x}^{-}\in A(\boldsymbol{x}^{\prime}) \end{array} }{\mathbb{E}}\left[\log \left(e^{1 - \varepsilon} + e^{f(\boldsymbol{x}_{1})^{\top}f(\boldsymbol{x}^{-})}\right) - \log \left(e^{1 - \varepsilon} + e^{\mu_{k}^{\top}\mu_{\ell}}\right)\right]\right] \\ \leq (1 + \log 2)R_{\varepsilon} + \sum_{k = 1}^{K}\sum_{\ell = 1}^{K}\mathbb{E}_{\boldsymbol{x},\boldsymbol{x}^{\prime}}\left[\mathbb{I}(\boldsymbol {x}\in C_{k})\mathbb{I}(\boldsymbol{x}^{\prime}\in C_{\ell})\underset { \begin{array}{c}\boldsymbol{x}_{1}\in A(\boldsymbol {x})\\ \boldsymbol{x}^{-}\in A(\boldsymbol{x}^{\prime}) \end{array} }{\mathbb{E}}\left[\frac{e^{\xi}}{e^{1 - \varepsilon} + e^{\xi}}\left|f(\boldsymbol{x}_{1})^{\top}f(\boldsymbol{x}^{-}) - \mu_{k}^{\top}\mu_{\ell}\right|\right]\right] \\ (\text {m e a n v a l u e t h e o r e m}, \xi \in [ - 1, 1 ]) \\ \leq (1 + \log 2) R _ {\varepsilon} + \sum_ {k = 1} ^ {K} \sum_ {\ell = 1} ^ {K} \underset {\boldsymbol {x}, \boldsymbol {x} ^ {\prime}} {\mathbb {E}} \left[ \mathbb {I} \left(\boldsymbol {x} \in C _ {k}\right) \mathbb {I} \left(\boldsymbol {x} ^ {\prime} \in C _ {\ell}\right) \underset {\substack {\boldsymbol {x} _ {1} \in A (\boldsymbol {x}) \\ \boldsymbol {x} ^ {-} \in A \left(\boldsymbol {x} ^ {\prime}\right)}} {\mathbb {E}} | f \left(\boldsymbol {x} _ {1}\right) ^ {\top} f \left(\boldsymbol {x} ^ {-}\right) - \mu_ {k} ^ {\top} \mu_ {\ell} | \right] \tag{16} \\ \leq (1 + \log 2)R_{\varepsilon} + \sum_{k = 1}^{K}\sum_{\ell = 1}^{K}\mathbb{E}_{\boldsymbol {x},\boldsymbol{x}^{\prime}}\left[\mathbb{I}(\boldsymbol {x}\in C_{k})\mathbb{I}(\boldsymbol{x}^{\prime}\in C_{\ell})\underset { \begin{array}{c}\boldsymbol{x}_{1}\in A(\boldsymbol {x})\\ \boldsymbol{x}^{-}\in A(\boldsymbol{x}^{\prime}) \end{array} }{\mathbb{E}}\left[ \big|(f(\boldsymbol{x}_{1}) - \mu_{k})^{\top}(f(\boldsymbol{x}^{-}) - \mu_{\ell})\right| \right. \\ \left. \left. + \| f (\boldsymbol {x} _ {1}) - \mu_ {k} \| \cdot \| \mu_ {\ell} \| + \| \mu_ {k} \| \cdot \| f (\boldsymbol {x} ^ {-}) - \mu_ {\ell} \| \right] \right] \\ \end{array} +$$ + +$$ +\begin{array}{l} \leq (1 + \log 2)R_{\varepsilon} + \sum_{k = 1}^{K}\sum_{\ell = 1}^{K}\underset {\boldsymbol{x},\boldsymbol{x}^{\prime}}{\mathbb{E}}\left[\mathbb{I}(\boldsymbol {x}\in C_{k})\mathbb{I}(\boldsymbol{x}^{\prime}\in C_{\ell})\underset { \begin{array}{c}\boldsymbol{x}_{1}\in A(\boldsymbol {x})\\ \boldsymbol{x}^{-}\in A(\boldsymbol{x}^{\prime}) \end{array} }{\mathbb{E}}\big|(f(\boldsymbol{x}_{1}) - \mu_{k})^{\top}(f(\boldsymbol{x}^{-}) - \mu_{\ell})\big|\right] \\ + 2 \sum_ {k = 1} ^ {K} \mathbb {E} _ {\boldsymbol {x}} \left[ \mathbb {I} (\boldsymbol {x} \in C _ {k}) \underset {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \| f (\boldsymbol {x} _ {1}) - \mu_ {k} \| \right] \\ \end{array} +$$ + +$$ +\begin{array}{l} \leq (1 + \log 2) R _ {\varepsilon} + \left[ \sum_ {k = 1} ^ {K} p _ {k} \underset {\boldsymbol {x} \in C _ {k}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \| f (\boldsymbol {x} _ {1}) - \mu_ {k} \| \right] ^ {2} + 2 \sum_ {k = 1} ^ {K} p _ {k} \underset {\boldsymbol {x} \in C _ {k}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \| f (\boldsymbol {x} _ {1}) - \mu_ {k} \| \\ \leq (1 + \log 2) R _ {\varepsilon} + \left[ \sum_ {k = 1} ^ {K} p _ {k} \cdot \left(2 \varepsilon + L \delta + 4 (1 - \sigma) + \frac {4 R _ {\varepsilon}}{p _ {k}}\right) \right] ^ {2} + 2 \sum_ {k = 1} ^ {K} p _ {k} \cdot \left(2 \varepsilon + L \delta + 4 (1 - \sigma) + \frac {4 R _ {\varepsilon}}{p _ {k}}\right) \tag {Lemma C.1} \\ = (1 + \log 2) R _ {\varepsilon} + (2 \varepsilon + L \delta + 4 (1 - \sigma) + 4 K R _ {\varepsilon}) ^ {2} + 2 (2 \varepsilon + L \delta + 4 (1 - \sigma) + 4 K R _ {\varepsilon}). \\ \end{array} +$$ + +Then (15) turns to + +$$ +\begin{array}{l} p _ {k} p _ {\ell} \log \left(e ^ {1 - \varepsilon} + e ^ {\mu_ {k} ^ {\top} \mu_ {\ell}}\right) \\ \leq \mathcal {L} _ {2} ^ {\text {I n f o N C E}} (f) + (1 - \log 2) R _ {\varepsilon} + | \Delta_ {1} | \\ \leq \mathcal {L} _ {2} ^ {\text {I n f o N C E}} (f) + \left(2 \varepsilon + L \delta + 4 (1 - \sigma) + 4 K R _ {\varepsilon}\right) ^ {2} + \left(4 \varepsilon + 2 L \delta + 8 (1 - \sigma) + 8 K R _ {\varepsilon}\right) + 2 R _ {\varepsilon}. \\ \end{array} +$$ + +Let + +$$ +\tau (\sigma , \delta , \varepsilon , R _ {\varepsilon}) := (2 \varepsilon + L \delta + 4 (1 - \sigma) + 4 K R _ {\varepsilon}) ^ {2} + (4 \varepsilon + 2 L \delta + 8 (1 - \sigma) + 8 K R _ {\varepsilon}) + 2 R _ {\varepsilon}, +$$ + +and we obtain + +$$ +\mu_ {k} ^ {\top} \mu_ {\ell} \leq \log \left(\exp \left\{\frac {\mathcal {L} _ {2} ^ {\text {I n f o N C E}} (f) + \tau (\sigma , \delta , \varepsilon , R _ {\varepsilon})}{p _ {k} p _ {\ell}} \right\} - \exp (1 - \varepsilon)\right). +$$ + +This finishes the proof. + +![](images/ce91c1296efc2e75e17d9495d097e9ba2dec4b274ede92377ca4a07ec5d2e7e4.jpg) + +# C.2 CROSS-CORRELATION LOSS + +Lemma 4.1. For a given encoder $f$ , the alignment $\mathcal{L}_{\mathrm{align}}(f)$ in (4) is upper bounded via $\mathcal{L}_1^{Cross}(f)$ : + +$$ +\mathcal {L} _ {\mathrm {a l i g n}} (f) = \underset {\boldsymbol {x}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} \| f (\boldsymbol {x} _ {1}) - f (\boldsymbol {x} _ {2}) \| ^ {2} \leq 2 \sqrt {d \cdot \mathcal {L} _ {1} ^ {\mathrm {C r o s s}} (f)}, +$$ + +where $d$ is the output dimension of encoder $f$ . + +Proof. Since $\mathbb{E}_{\pmb{x}}\mathbb{E}_{\pmb{x}_1\in A(\pmb{x})}f_i(\pmb{x}_1)^2 = 1$ , for each coordinate component $i$ , we have + +$$ +\begin{array}{l} 1 - \mathbb {E} _ {\boldsymbol {x}} \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} \left[ f _ {i} \left(\boldsymbol {x} _ {1}\right) f _ {i} \left(\boldsymbol {x} _ {2}\right) \right] = \frac {1}{2} \underset {\boldsymbol {x}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} \left[ f _ {i} \left(\boldsymbol {x} _ {1}\right) ^ {2} + f _ {i} \left(\boldsymbol {x} _ {2}\right) ^ {2} \right] - \underset {\boldsymbol {x}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} \left[ f _ {i} \left(\boldsymbol {x} _ {1}\right) f _ {i} \left(\boldsymbol {x} _ {2}\right) \right] \\ = \frac {1}{2} \underset {\boldsymbol {x}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} \left[ f _ {i} (\boldsymbol {x} _ {1}) - f _ {i} (\boldsymbol {x} _ {2}) \right] ^ {2}. \\ \end{array} +$$ + +Then + +$$ +\begin{array}{l} \underset {\boldsymbol {x}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} \| f (\boldsymbol {x} _ {1}) - f (\boldsymbol {x} _ {2}) \| ^ {2} = \sum_ {i = 1} ^ {d} \underset {\boldsymbol {x}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} \left[ f _ {i} (\boldsymbol {x} _ {1}) - f _ {i} (\boldsymbol {x} _ {2}) \right] ^ {2} \\ = 2 \sum_ {i = 1} ^ {d} \left(1 - \underset {\boldsymbol {x}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} [ f _ {i} (\boldsymbol {x} _ {1}) f _ {i} (\boldsymbol {x} _ {2}) ]\right) \\ \leq 2 \left(d \sum_ {i = 1} ^ {d} \left(1 - \underset {\boldsymbol {x}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} \left[ f _ {i} \left(\boldsymbol {x} _ {1}\right) f _ {i} \left(\boldsymbol {x} _ {2}\right) \right]\right) ^ {2}\right) ^ {\frac {1}{2}} \\ = 2 d ^ {\frac {1}{2}} \mathcal {L} _ {1} ^ {\text {C r o s s}} (f) ^ {\frac {1}{2}}, \\ \end{array} +$$ + +where the inequality holds due to the Cauchy inequality. + +Lemma C.2. Assume that encoder $f$ with norm $\sqrt{d}$ is $L$ -Lipschitz continuous. If the augmented data is $(\sigma, \delta)$ -augmented, then for any $\varepsilon \geq 0$ , + +$$ +\left\| \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} \mathbb {E} \left[ f (\boldsymbol {x} _ {1}) f (\boldsymbol {x} _ {2}) ^ {\top} \right] - \sum_ {k = 1} ^ {K} p _ {k} \mu_ {k} \mu_ {k} ^ {\top} \right\| ^ {2} \leq \tau^ {\prime} (\sigma , \delta , \varepsilon , R _ {\varepsilon}), +$$ + +where $\tau'(\sigma, \delta, \varepsilon, R_{\varepsilon})$ is defined as + +$$ +4 d \left[ \left(1 - \sigma + \frac {L \delta + 2 \varepsilon}{2 \sqrt {d}}\right) ^ {2} + (1 - \sigma) + K R _ {\varepsilon} \left(3 - 2 \sigma + \frac {L \delta + 2 \varepsilon}{\sqrt {d}}\right) + R _ {\varepsilon} ^ {2} \left(\sum_ {k = 1} ^ {K} \frac {1}{p _ {k}}\right) \right] + \sqrt {d} \left(\varepsilon^ {2} + 4 d R _ {\varepsilon}\right) ^ {\frac {1}{2}}. +$$ + +Proof. We first decompose the LHS as + +$$ +\begin{array}{l} \underset {\boldsymbol {x}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} \left[ f (\boldsymbol {x} _ {1}) f (\boldsymbol {x} _ {2}) ^ {\top} \right] - \sum_ {k = 1} ^ {K} p _ {k} \mu_ {k} \mu_ {k} ^ {\top} \\ = \sum_ {k = 1} ^ {K} p _ {k} \underset {\boldsymbol {x} \in C _ {k}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} \left[ f \left(\boldsymbol {x} _ {1}\right) f \left(\boldsymbol {x} _ {2}\right) ^ {\top} \right] - \sum_ {k = 1} ^ {K} p _ {k} \mu_ {k} \mu_ {k} ^ {\top} \\ = \sum_ {k = 1} ^ {K} p _ {k} \underset {\boldsymbol {x} \in C _ {k}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \left[ f (\boldsymbol {x} _ {1}) f (\boldsymbol {x} _ {1}) ^ {\top} \right] - \sum_ {k = 1} ^ {K} p _ {k} \mu_ {k} \mu_ {k} ^ {\top} + \sum_ {k = 1} ^ {K} p _ {k} \underset {\boldsymbol {x} \in C _ {k}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} \left[ f (\boldsymbol {x} _ {1}) (f (\boldsymbol {x} _ {2}) ^ {\top} - f (\boldsymbol {x} _ {1}) ^ {\top}) \right] \\ = \sum_ {k = 1} ^ {K} p _ {k} \underset {\boldsymbol {x} \in C _ {k}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \left[ (f (\boldsymbol {x} _ {1}) - \mu_ {k}) (f (\boldsymbol {x} _ {1}) - \mu_ {k}) ^ {\top} \right] + \underset {\boldsymbol {x}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} \left[ f (\boldsymbol {x} _ {1}) (f (\boldsymbol {x} _ {2}) ^ {\top} - f (\boldsymbol {x} _ {1}) ^ {\top}) \right]. \\ \end{array} +$$ + +Then its norm is + +$$ +\begin{array}{l} \left\| \mathop{\mathbb{E}}_{\boldsymbol {x}}\mathop{\mathbb{E}}_{\boldsymbol{x} _ {1},\boldsymbol{x} _ {2}\in A(\boldsymbol {x})}\left[ f (\boldsymbol{x} _ {1})f (\boldsymbol{x} _ {2}) ^ {\top} \right] - \sum_ {k = 1} ^ {K}p _ {k}\mu_ {k}\mu_ {k} ^ {\top}\right\| \\ \leq \sum_ {k = 1} ^ {K} p _ {k} \underset {\boldsymbol {x} \in C _ {k}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \left[ \left\| (f (\boldsymbol {x} _ {1}) - \mu_ {k}) (f (\boldsymbol {x} _ {1}) - \mu_ {k}) ^ {\top} \right\| \right] + \underset {\boldsymbol {x}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} \left[ \left\| f (\boldsymbol {x} _ {1}) (f (\boldsymbol {x} _ {2}) ^ {\top} - f (\boldsymbol {x} _ {1}) ^ {\top}) \right\| \right] \\ \leq \sum_ {k = 1} ^ {K} p _ {k} \underset {\boldsymbol {x} \in C _ {k}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \left[ \| f (\boldsymbol {x} _ {1}) - \mu_ {k} \| ^ {2} \right] + \underset {\boldsymbol {x}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} \left[ \| f (\boldsymbol {x} _ {1}) \| \| f (\boldsymbol {x} _ {2}) - f (\boldsymbol {x} _ {1}) \| \right] \\ \leq \sum_ {k = 1} ^ {K} p _ {k} \underset {\boldsymbol {x} \in C _ {k}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \left[ \| f (\boldsymbol {x} _ {1}) - \mu_ {k} \| ^ {2} \right] + \left[ \underset {\boldsymbol {x}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \| f (\boldsymbol {x} _ {1}) \| ^ {2} \right] ^ {\frac {1}{2}} \left[ \underset {\boldsymbol {x}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} \| f (\boldsymbol {x} _ {2}) - f (\boldsymbol {x} _ {1}) \| ^ {2} \right] ^ {\frac {1}{2}} \\ \end{array} +$$ + +(Cauchy-Schwarz inequality) + +$$ +\begin{array}{l} \leq \sum_ {k = 1} ^ {K} p _ {k} \underset {\boldsymbol {x} \in C _ {k}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \left[ \| f (\boldsymbol {x} _ {1}) - \mu_ {k} \| ^ {2} \right] + \sqrt {d} \left(\varepsilon^ {2} + 4 d R _ {\varepsilon}\right) ^ {\frac {1}{2}} (Lemma 4.1) \\ \leq 4 d \sum_ {k = 1} ^ {K} p _ {k} \left[ \left(1 - \sigma + \frac {L}{2 \sqrt {d}} \delta + \frac {\varepsilon}{\sqrt {d}} + \frac {R _ {\varepsilon}}{p _ {k}}\right) ^ {2} + \left(1 - \sigma + \frac {R _ {\varepsilon}}{p _ {k}}\right) \right] + \sqrt {d} \left(\varepsilon^ {2} + 4 d R _ {\varepsilon}\right) ^ {\frac {1}{2}} (Lemma C.1) \\ = 4 d \left[ \left(1 - \sigma + \frac {L \delta + 2 \varepsilon}{2 \sqrt {d}}\right) ^ {2} + (1 - \sigma) + K R _ {\varepsilon} \left(3 - 2 \sigma + \frac {L \delta + 2 \varepsilon}{\sqrt {d}}\right) + R _ {\varepsilon} ^ {2} \left(\sum_ {k = 1} ^ {K} \frac {1}{p _ {k}}\right) \right] + \sqrt {d} \left(\varepsilon^ {2} + 4 d R _ {\varepsilon}\right) ^ {\frac {1}{2}} \\ = \tau^ {\prime} (\sigma , \delta , \varepsilon , R _ {\varepsilon}). \\ \end{array} +$$ + +This finishes the proof. + +Theorem 4. Assume that encoder $f$ with norm $\sqrt{d}$ is $L$ -Lipschitz continuous. If the augmented data is $(\sigma, \delta)$ -augmented, then for any $\varepsilon \geq 0$ and $k \neq \ell$ , we have + +$$ +\mu_ {k} ^ {\top} \mu_ {\ell} \leq \sqrt {\frac {2}{p _ {k} p _ {\ell}} \left(\mathcal {L} _ {2} ^ {\mathrm {C r o s s}} (f) + \tau^ {\prime} (\sigma , \delta , \varepsilon , R _ {\varepsilon}) - \frac {d - K}{2}\right)}, +$$ + +where $\tau'(\sigma, \delta, \varepsilon, R_{\varepsilon})$ is an upper bound of $\| \mathbb{E}_{\boldsymbol{x}} \mathbb{E}_{\boldsymbol{x}_1, \boldsymbol{x}_2 \in A(\boldsymbol{x})} [f(\boldsymbol{x}_1) f(\boldsymbol{x}_2)^\top] - \sum_{k=1}^{K} p_k \mu_k \mu_k^\top \|^2$ . + +Proof. Let $U = (\sqrt{p_1}\mu_1,\dots ,\sqrt{p_K}\mu_K)\in \mathbb{R}^{d\times K}$ + +$$ +\begin{array}{l} \left\| \sum_ {k = 1} ^ {K} p _ {k} \mu_ {k} \mu_ {k} ^ {\top} - I _ {d} \right\| ^ {2} = \left\| U U ^ {\top} - I _ {d} \right\| ^ {2} \\ = \operatorname {T r} \left(U U ^ {\top} U U ^ {\top} - 2 U U ^ {\top} + I _ {d}\right) \quad (\text {d u e t o} \| A \| ^ {2} = \operatorname {T r} (A ^ {\top} A)) \\ = \operatorname {T r} \left(U ^ {\top} U U ^ {\top} U - 2 U ^ {\top} U + I _ {K}\right) + d - K \\ = \left\| U ^ {\top} U - I _ {K} \right\| ^ {2} + d - K \\ = \sum_ {k = 1} ^ {K} \sum_ {\ell = 1} ^ {K} \left(\sqrt {p _ {k} p _ {\ell}} \mu_ {k} ^ {\top} \mu_ {\ell} - \delta_ {k \ell}\right) ^ {2} + d - K \\ \geq p _ {k} p _ {\ell} \left(\mu_ {k} ^ {\top} \mu_ {\ell}\right) ^ {2} + d - K. \\ \end{array} +$$ + +where $\delta_{kl}$ is the Dirichlet function. + +Therefore, + +$$ +\begin{array}{l} \left(\mu_ {k} ^ {\top} \mu_ {l}\right) ^ {2} \\ \leq \frac {\left\| \sum_ {k = 1} ^ {K} p _ {k} \mu_ {k} \mu_ {k} ^ {\top} - I _ {d} \right\| ^ {2} - (d - K)}{p _ {k} p _ {\ell}} \\ = \frac {\left\| \mathbb {E} _ {\boldsymbol {x}} \mathbb {E} _ {\boldsymbol {x} _ {1} , \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} [ f (\boldsymbol {x} _ {1}) f (\boldsymbol {x} _ {2}) ^ {\top} ] - I _ {d} + \sum_ {k = 1} ^ {K} p _ {k} \mu_ {k} \mu_ {k} ^ {\top} - \mathbb {E} _ {\boldsymbol {x}} \mathbb {E} _ {\boldsymbol {x} _ {1} , \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} [ f (\boldsymbol {x} _ {1}) f (\boldsymbol {x} _ {2}) ^ {\top} ] \right\| ^ {2} - (d - K)}{p _ {k} p _ {\ell}} \\ \leq \frac {2 \left\| \mathbb {E} _ {\boldsymbol {x}} \mathbb {E} _ {\boldsymbol {x} _ {1} , \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} [ f (\boldsymbol {x} _ {1}) f (\boldsymbol {x} _ {2}) ^ {\top} ] - I _ {d} \right\| ^ {2} + 2 \left\| \sum_ {k = 1} ^ {K} p _ {k} \mu_ {k} \mu_ {k} ^ {\top} - \mathbb {E} _ {\boldsymbol {x}} \mathbb {E} _ {\boldsymbol {x} _ {1} , \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} [ f (\boldsymbol {x} _ {1}) f (\boldsymbol {x} _ {2}) ^ {\top} ] \right\| ^ {2} - (d - K)}{p _ {k} p _ {\ell}} \\ \leq \frac {2 \mathcal {L} _ {2} ^ {\text {C r o s s}} (f) + 2 \tau^ {\prime} (\varepsilon , \sigma , \delta) - (d - K)}{p _ {k} p _ {\ell}} \tag {Lemma C.2} \\ = \frac {2}{p _ {k} p _ {\ell}} \left(\mathcal {L} _ {2} ^ {\mathrm {C r o s s}} (f) + \tau^ {\prime} (\varepsilon , \sigma , \delta) - \frac {d - K}{2}\right). \\ \end{array} +$$ + +This finishes the proof. + +# D ANALYSIS OF $t$ -INFONCE + +The population loss of $t$ -InfoNCE (Hu et al., 2022) can be written as: + +$$ +\mathcal{L}_{t\text{-InfoNCE}} = -\underset { \begin{array}{c}\boldsymbol{x},\boldsymbol{x}^{\prime}\\ \boldsymbol{x}^{ }\in A(\boldsymbol{x}^{\prime}) \end{array} }{\mathbb{E}}\underset { \begin{array}{c}\boldsymbol{x}_{1},\boldsymbol{x}_{2}\in A(\boldsymbol{x})\\ \boldsymbol{x}^{-}\in A(\boldsymbol{x}^{\prime}) \end{array} }{\mathbb{E}}\log \frac{(1 + \|f(\boldsymbol{x}_{1}) - f(\boldsymbol{x}_{2})\|^{2})^{-1}}{(1 + \|f(\boldsymbol{x}_{1}) - f(\boldsymbol{x}_{2})\|^{2})^{-1} + (1 + \|f(\boldsymbol{x}_{1}) - f(\boldsymbol{x}^{-})\|^{2})^{-1}}. +$$ + +It can be divided into two parts: + +$$ +\begin{array}{l} \mathcal{L}_{t - \text{InfoNCE}} = \underbrace{\mathbb{E}_{\boldsymbol{x}}\mathbb{E}_{\boldsymbol{x}_{1},\boldsymbol{x}_{2}\in A(\boldsymbol{x})}\log(1 + \| f(\boldsymbol{x}_{1}) - f(\boldsymbol{x}_{2})\|^{2})}_{=: \mathcal{L}_{1}(f)} \\ + \underbrace {\underset { \begin{array}{c} \boldsymbol {x} , \boldsymbol {x} ^ {\prime} \\ \boldsymbol {x} ^ {-} \in A (\boldsymbol {x} ^ {\prime}) \end{array} } {\mathbb {E}} \underset { \begin{array}{c} \boldsymbol {x} _ {1} , \boldsymbol {x} _ {2} \in A (\boldsymbol {x}) \\ \boldsymbol {x} ^ {-} \in A (\boldsymbol {x} ^ {\prime}) \end{array} } {\mathbb {E}} \log \left[ (1 + \| f (\boldsymbol {x} _ {1}) - f (\boldsymbol {x} _ {2}) \| ^ {2}) ^ {- 1} + (1 + \| f (\boldsymbol {x} _ {1}) - f (\boldsymbol {x} ^ {-}) \| ^ {2}) ^ {- 1}) \right]} _ {=: \mathcal {L} _ {2} (f)}. \\ \end{array} +$$ + +Similar to the InfoNCE loss and the cross-correlation loss, we can connect $\mathcal{L}_1(f)$ and $\mathcal{L}_2(f)$ with the alignment and divergence by the following Lemma D.1 and Theorem 5, respectively. + +Lemma D.1. For a given encoder $f$ , the alignment $\mathcal{L}_{\mathrm{align}}(f)$ in (4) is upper bounded via $\mathcal{L}_1(f)$ , i.e., + +$$ +\mathcal {L} _ {\text {a l i g n}} (f) = \underset {\boldsymbol {x}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} \| f (\boldsymbol {x} _ {1}) - f (\boldsymbol {x} _ {2}) \| ^ {2} \leq \frac {4}{\ln 5} \mathcal {L} _ {1} (f). +$$ + +Proof. It is easy to verify that $\log (1 + t^2) \geq \frac{\ln 5}{4} t^2$ for any $t \in [0, 2]$ . + +Since $\| f(\pmb{x}_1) - f(\pmb{x}_2) \| \in [0, 2]$ , we have + +$$ +\left\| f \left(\boldsymbol {x} _ {1}\right) - f \left(\boldsymbol {x} _ {2}\right) \right\| ^ {2} \leq \frac {4}{\ln 5} \log \left(1 + \left\| f \left(\boldsymbol {x} _ {1}\right) - f \left(\boldsymbol {x} _ {2}\right) \right\| ^ {2}\right). +$$ + +Thus, + +$$ +\begin{array}{l} \mathcal {L} _ {\mathrm {a l i g n}} (f) = \underset {\boldsymbol {x}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})} {\mathbb {E}} \| f (\boldsymbol {x} _ {1}) - f (\boldsymbol {x} _ {2}) \| ^ {2} \\ \leq \frac {4}{\ln 5} \mathbb {E} _ {\boldsymbol {x} _ {\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x})}} \mathbb {E} \log (1 + \| f (\boldsymbol {x} _ {1}) - f (\boldsymbol {x} _ {2}) \| ^ {2}) \\ = \frac {4}{\ln 5} \mathcal {L} _ {1} (f). \\ \end{array} +$$ + +This finishes the proof. + +![](images/e3b8de843c58ffdb136b48ebb091138056b4b0672ea1532af00d76c34fe328dd.jpg) + +Theorem 5. Assume that encoder $f$ with norm 1 is $L$ -Lipschitz continuous. If the augmented data is $(\sigma, \delta)$ -augmented, then for any $\varepsilon > 0$ and $k \neq \ell$ , + +$$ +\mu_ {k} ^ {\top} \mu_ {\ell} \leq \frac {1}{2} \left(3 - \frac {1}{\exp \left\{\frac {\mathcal {L} _ {2} (f) + \tau^ {\prime \prime} (\sigma , \delta , \varepsilon , R _ {\varepsilon})}{p _ {k} p _ {\ell}} \right\} - \frac {1}{1 + 2 \varepsilon}}\right), +$$ + +where $\tau''(\sigma, \delta, \varepsilon, R_{\varepsilon})$ is a non-negative term, decreasing with smaller $\varepsilon$ , $R_{\varepsilon}$ or sharper concentration of augmented data, and $\tau(\sigma, \delta, \varepsilon, R_{\varepsilon}) = 0$ when $\sigma = 1$ , $\delta = 0$ , $\varepsilon = 0$ , $R_{\varepsilon} = 0$ + +Proof. Given $\pmb{x} \in S_{\varepsilon}$ , for any $\pmb{x}_1, \pmb{x}_2 \in A(\pmb{x})$ , we have + +$$ +\begin{array}{l} \log \left[ \left(1 + \| f (\boldsymbol {x} _ {1}) - f (\boldsymbol {x} _ {2}) \| _ {2} ^ {2}\right) ^ {- 1} + \left(1 + \| f (\boldsymbol {x} _ {1}) - f (\boldsymbol {x} ^ {-}) \| _ {2} ^ {2}\right) ^ {- 1}) \right] \\ = \log \left[ \frac {1}{3 - 2 f (\boldsymbol {x} _ {1}) ^ {\top} f (\boldsymbol {x} _ {2})} + \frac {1}{3 - 2 f (\boldsymbol {x} _ {1}) ^ {\top} f (\boldsymbol {x} ^ {-})} \right] \\ = \log \left[ \frac {1}{3 - 2 f (\boldsymbol {x} _ {1}) ^ {\top} f (\boldsymbol {x} _ {1}) - 2 f (\boldsymbol {x} _ {1}) ^ {\top} (f (\boldsymbol {x} _ {2}) - f (\boldsymbol {x} _ {1}))} + \frac {1}{3 - 2 f (\boldsymbol {x} _ {1}) ^ {\top} f (\boldsymbol {x} ^ {-})} \right] \\ \geq \log \left[ \frac {1}{3 - 2 \| f (\boldsymbol {x} _ {1}) \| ^ {2} + 2 \| f (\boldsymbol {x} _ {1}) \| \cdot \varepsilon} + \frac {1}{3 - 2 f (\boldsymbol {x} _ {1}) ^ {\top} f (\boldsymbol {x} ^ {-})} \right] \\ = \log \left[ \frac {1}{1 + 2 \varepsilon} + \frac {1}{3 - 2 f (\pmb {x} _ {1}) ^ {\top} f (\pmb {x} ^ {-})} \right]. \\ \end{array} +$$ + +Therefore, we have + +$$ +\begin{array}{l} \mathcal{L}_{2}(f) = \operatorname{\mathbb{E}}_{\substack{\boldsymbol {x},\boldsymbol{x}^{\prime}\\ \boldsymbol{x}^{-}\in A(\boldsymbol{x}^{\prime})}}\operatorname {\mathbb{E}}_{\substack{\boldsymbol{x}_{1},\boldsymbol{x}_{2}\in A(\boldsymbol {x})\\ }}\log [ (1 + \| f(\boldsymbol{x}_{1}) - f(\boldsymbol{x}_{2})\|_{2}^{2})^{-1} + (1 + \| f(\boldsymbol{x}_{1}) - f(\boldsymbol{x}^{-})\|_{2}^{2})^{-1})] \\ = \underset { \begin{array}{c} \boldsymbol {x}, \boldsymbol {x} ^ {\prime} \\ \boldsymbol {x} ^ {-} \in A (\boldsymbol {x} ^ {\prime}) \end{array} } {\mathbb {E}} \underset { \begin{array}{c} \boldsymbol {x} _ {1}, \boldsymbol {x} _ {2} \in A (\boldsymbol {x}) \\ \boldsymbol {x} ^ {-} \in A (\boldsymbol {x} ^ {\prime}) \end{array} } {\mathbb {E}} \log \left[ \frac {1}{3 - 2 f (\boldsymbol {x} _ {1}) ^ {\top} f (\boldsymbol {x} _ {2})} + \frac {1}{3 - 2 f (\boldsymbol {x} _ {1}) ^ {\top} f (\boldsymbol {x} ^ {-})} \right] \\ = \mathbb{E}_{\boldsymbol {x},\boldsymbol{x}^{\prime}}\mathbb{E}_{\substack{\boldsymbol{x}_{1},\boldsymbol{x}_{2}\in A(\boldsymbol {x})\\ \boldsymbol{x}^{-}\in A(\boldsymbol{x}^{\prime})}}\left[\mathbb{I}(\boldsymbol {x}\in S_{\varepsilon}) + \mathbb{I}(\boldsymbol {x}\in \overline{S_{\varepsilon}})\right]\log \left[\frac{1}{3 - 2f(\boldsymbol{x}_{1})^{\top}f(\boldsymbol{x}_{2})} +\frac{1}{3 - 2f(\boldsymbol{x}_{1})^{\top}f(\boldsymbol{x}^{-})}\right] \\ \geq \sum_{k = 1}^{K}\sum_{\ell = 1}^{K}\mathbb{E}_{\boldsymbol {x},\boldsymbol{x}^{\prime}}\left[\mathbb{I}(\boldsymbol {x}\in S_{\varepsilon}\cap C_{k})\mathbb{I}(\boldsymbol{x}^{\prime}\in C_{\ell})\underset { \begin{array}{c}\boldsymbol{x}_{1}\in A(\boldsymbol{x})\\ \boldsymbol{x}^{-}\in A(\boldsymbol{x}^{\prime}) \end{array} }{\mathbb{E}}\log \left[\frac{1}{1 + 2\varepsilon} +\frac{1}{3 - 2f(\boldsymbol{x}_{1})^{\top}f(\boldsymbol{x}^{-})}\right]\right] \\ + \underset {\boldsymbol {x}} {\mathbb {E}} \left[ \mathbb {I} (\boldsymbol {x} \in \overline {{S _ {\varepsilon}}}) \log \left(\frac {1}{3 + 2} + \frac {1}{3 + 2}\right) \right] \\ = \sum_ {k = 1} ^ {K} \sum_ {\ell = 1} ^ {K} \mathbb {E} _ {\boldsymbol {x}, \boldsymbol {x} ^ {\prime}} \left[ \mathbb {I} (\boldsymbol {x} \in C _ {k}) \mathbb {I} (\boldsymbol {x} ^ {\prime} \in C _ {\ell}) \log \left(\frac {1}{1 + 2 \varepsilon} + \frac {1}{3 - 2 \mu_ {k} ^ {\top} \mu_ {\ell}}\right) \right] + \Delta_ {1} - (\log 2. 5) R _ {\varepsilon} \\ \end{array} +$$ + +$$ +\begin{array}{l} = \sum_ {k = 1} ^ {K} \sum_ {\ell = 1} ^ {K} p _ {k} p _ {\ell} \log \left(\frac {1}{1 + 2 \varepsilon} + \frac {1}{3 - 2 \mu_ {k} ^ {\top} \mu_ {\ell}}\right) - (\log 2. 5) R _ {\varepsilon} + \Delta_ {1} \\ \geq p _ {k} p _ {\ell} \log \left(\frac {1}{1 + 2 \varepsilon} + \frac {1}{3 - 2 \mu_ {k} ^ {\top} \mu_ {\ell}}\right) - (\log 2. 5) R _ {\varepsilon} + \Delta_ {1}, \tag {17} \\ \end{array} +$$ + +where $\Delta_{1}$ is defined as + +$$ +\begin{array}{l} \Delta_{1}:= \sum_{k = 1}^{K}\sum_{\ell = 1}^{K}\mathbb{E}_{\boldsymbol {x},\boldsymbol{x}^{\prime}}\left[\mathbb{I}(\boldsymbol {x}\in S_{\varepsilon}\cap C_{k})\mathbb{I}(\boldsymbol{x}^{\prime}\in C_{\ell})\underset { \begin{array}{c}\boldsymbol{x}_{1}\in A(\boldsymbol {x})\\ \boldsymbol{x}^{-}\in A(\boldsymbol{x}^{\prime}) \end{array} }{\mathbb{E}}\log \left(\frac{1}{1 + 2\varepsilon} +\frac{1}{3 - 2f(\boldsymbol{x}_{1})^{\top}f(\boldsymbol{x}^{-})}\right)\right] \\ - \sum_ {k = 1} ^ {K} \sum_ {\ell = 1} ^ {K} \mathbb {E} _ {\boldsymbol {x}, \boldsymbol {x} ^ {\prime}} \left[ \mathbb {I} (\boldsymbol {x} \in C _ {k}) \mathbb {I} (\boldsymbol {x} ^ {\prime} \in C _ {\ell}) \log \left(\frac {1}{1 + 2 \varepsilon} + \frac {1}{3 - 2 \mu_ {k} ^ {\top} \mu_ {\ell}}\right) \right] \\ = -\sum_{k = 1}^{K}\sum_{\ell = 1}^{K}\mathbb{E}_{\boldsymbol {x},\boldsymbol{x}^{\prime}}\left[[\mathbb{I}(\boldsymbol {x}\in C_{k}) - \mathbb{I}(\boldsymbol {x}\in S_{\varepsilon}\cap C_{k})]\mathbb{I}(\boldsymbol{x}^{\prime}\in C_{\ell})\underset { \begin{array}{c}\boldsymbol{x}_{1}\in A(\boldsymbol {x})\\ \boldsymbol{x}^{-}\in A(\boldsymbol{x}^{\prime}) \end{array} }{\mathbb{E}}\log \left(\frac{1}{1 + 2\varepsilon} +\frac{1}{3 - 2f(\boldsymbol{x}_{1})^{\top}f(\boldsymbol{x}^{-})}\right)\right] \\ +\sum_{k = 1}^{K}\sum_{\ell = 1}^{K}\mathbb{E}_{\boldsymbol {x},\boldsymbol{x}^{\prime}}\mathbb{I}(\boldsymbol {x}\in C_{k})\mathbb{I}(\boldsymbol{x}^{\prime}\in C_{\ell})\underset { \begin{array}{c}\boldsymbol{x}_{1}\in A(\boldsymbol {x})\\ \boldsymbol{x}^{-}\in A(\boldsymbol{x}^{\prime}) \end{array} }{\mathbb{E}}\left[\log \left(\frac{1}{1 + 2\varepsilon} +\frac{1}{3 - 2f(\boldsymbol{x}_{1})^{\top}f(\boldsymbol{x}^{-})}\right) - \log \left(\frac{1}{1 + 2\varepsilon} +\frac{1}{3 - 2\mu_{k}^{\top}\mu_{\ell}}\right)\right]. \\ \end{array} +$$ + +Then, + +$$ +\left| \Delta_ {1} \right| +$$ + +$$ +\begin{array}{l} \leq \sum_ {k = 1} ^ {K} \sum_ {\ell = 1} ^ {K} \mathbb {E} _ {\boldsymbol {x}, \boldsymbol {x} ^ {\prime}} \left[ \left[ \mathbb {I} (\boldsymbol {x} \in C _ {k}) - \mathbb {I} (\boldsymbol {x} \in S _ {\varepsilon} \cap C _ {k}) \right] \mathbb {I} (\boldsymbol {x} ^ {\prime} \in C _ {\ell}) \right] \cdot \log 2 \\ +\sum_{k = 1}^{K}\sum_{\ell = 1}^{K}\mathbb{E}_{\boldsymbol {x},\boldsymbol{x}^{\prime}}\mathbb{I}(\boldsymbol {x}\in C_{k})\mathbb{I}(\boldsymbol{x}^{\prime}\in C_{\ell})\underset { \begin{array}{c}\boldsymbol{x}_{1}\in A(\boldsymbol {x})\\ \boldsymbol{x}^{-}\in A(\boldsymbol{x}^{\prime}) \end{array} }{\mathbb{E}}\left[\log \left(\frac{1}{1 + 2\varepsilon} +\frac{1}{3 - 2f(\boldsymbol{x}_{1})^{\top}f(\boldsymbol{x}^{-})}\right) - \log \left(\frac{1}{1 + 2\varepsilon} +\frac{1}{3 - 2\mu_{k}^{\top}\mu_{\ell}}\right)\right] \\ \end{array} +$$ + +$$ +\leq R_{\varepsilon}\log 2 + \sum_{k = 1}^{K}\sum_{\ell = 1}^{K}\mathbb{E}_{\boldsymbol {x},\boldsymbol{x}^{\prime}}\mathbb{I}(\boldsymbol {x}\in C_{k})\mathbb{I}(\boldsymbol{x}^{\prime}\in C_{\ell})\underset { \begin{array}{c}\boldsymbol{x}_{1}\in A(\boldsymbol {x})\\ \boldsymbol{x}^{-}\in A(\boldsymbol{x}^{\prime}) \end{array} }{\mathbb{E}}\left[\frac{1 + 2\varepsilon}{(3 - 2\xi)(2 + \varepsilon - \xi)} |f(\boldsymbol{x}_{1})^{\top}f(\boldsymbol{x}^{-}) - \mu_{k}^{\top}\mu_{\ell}| \right] +$$ + +(mean value theorem, $\xi \in [-1,1]$ ) + +$$ +\begin{array}{l} \leq R_{\varepsilon}\log 2 + 2\sum_{k = 1}^{K}\sum_{\ell = 1}^{K}\mathbb{E}_{\boldsymbol {x},\boldsymbol{x}^{\prime}}\left[\mathbb{I}(\boldsymbol {x}\in C_{k})\mathbb{I}(\boldsymbol{x}^{\prime}\in C_{\ell}) \underset { \begin{array}{c}\boldsymbol{x}_{1}\in A(\boldsymbol {x})\\ \boldsymbol{x}^{-}\in A(\boldsymbol{x}^{\prime}) \end{array} }{\mathbb{E}}|f(\boldsymbol{x}_{1})^{\top}f(\boldsymbol{x}^{-}) - \mu_{k}^{\top}\mu_{\ell}| \right] \\ \leq R _ {\varepsilon} \log 2 + 2 (2 \varepsilon + L \delta + 4 (1 - \sigma) + 4 K R _ {\varepsilon}) ^ {2} + 4 (2 \varepsilon + L \delta + 4 (1 - \sigma) + 4 K R _ {\varepsilon}) \tag {using(16)} \\ \end{array} +$$ + +Therefore, according to (17), + +$$ +\begin{array}{l} p _ {k} p _ {\ell} \log \left(\frac {1}{1 + 2 \varepsilon} + \frac {1}{3 - 2 \mu_ {k} ^ {\top} \mu_ {\ell}}\right) \\ \leq \mathcal {L} _ {2} (f) + R _ {\varepsilon} \log 2. 5 + | \Delta_ {1} | \\ \leq \mathcal {L} _ {2} (f) + R _ {\varepsilon} \log 5 + 2 (2 \varepsilon + L \delta + 4 (1 - \sigma) + 4 K R _ {\varepsilon}) ^ {2} + 4 (2 \varepsilon + L \delta + 4 (1 - \sigma) + 4 K R _ {\varepsilon}). \\ \end{array} +$$ + +Let + +$$ +\tau^ {\prime \prime} (\sigma , \delta , \varepsilon , R _ {\varepsilon}) := R _ {\varepsilon} \log 5 + 2 (2 \varepsilon + L \delta + 4 (1 - \sigma) + 4 K R _ {\varepsilon}) ^ {2} + 4 (2 \varepsilon + L \delta + 4 (1 - \sigma) + 4 K R _ {\varepsilon}), +$$ + +and we obtain + +$$ +\mu_ {k} ^ {\top} \mu_ {\ell} \leq \frac {1}{2} \left(3 - \frac {1}{\exp \left\{\frac {\mathcal {L} _ {2} (f) + \tau^ {\prime \prime} (\sigma , \delta , \varepsilon , R _ {\varepsilon})}{p _ {k} p _ {\ell}} \right\} - \frac {1}{1 + 2 \varepsilon}}\right). +$$ + +This finishes the proof. + +![](images/33a22a162df6e3351e94873dcc4b07ed6d7cf188ce2c8ae3099446321d361ab3.jpg) + +# E ADDITIONAL PROOFS + +We give detailed proof of the linear reformulation of the nearest neighbor classifier in this section. + +Proposition E.1 (Linear reformulation of the NN classifier). Let $G_{f}(\pmb{x}) = \arg \min_{k\in [K]}\| f(\pmb{x}) - \mu_{k}\|$ be the NN classifier. Then + +$$ +G _ {f} (\boldsymbol {x}) = \underset {k \in [ K ]} {\arg \max } \left(\mu_ {k} ^ {\top} f (\boldsymbol {x}) - \frac {1}{2} \| \mu_ {k} \| ^ {2}\right), +$$ + +which is also a linear classifier. + +Proof. $G_{f}(\pmb{x}) = k$ means for each $l \in [K]$ , + +$$ +\left\| f (\boldsymbol {x}) - \mu_ {k} \right\| ^ {2} \leq \left\| f (\boldsymbol {x}) - \mu_ {\ell} \right\| ^ {2}. +$$ + +This is equivalent to + +$$ +\mu_ {k} ^ {\top} f (\boldsymbol {x}) - \frac {1}{2} \| \mu_ {k} \| ^ {2} \geq \mu_ {\ell} ^ {\top} f (\boldsymbol {x}) - \frac {1}{2} \| \mu_ {\ell} \| ^ {2} +$$ + +holds for each $\ell \in [K]$ . Therefore, $G_{f}(\pmb{x}) = \operatorname*{arg max}_{k\in [K]}\left(\mu_{k}^{\top}f(\pmb{x}) - \frac{1}{2}\| \mu_{k}\|^{2}\right)$ , which is a linear classifier. + +# F AN EXTENSION TO $A(C_k)\cap A(C_\ell)\neq \emptyset$ + +In this section, we extend our theory to the case where $A(C_k) \cap A(C_\ell) \neq \emptyset$ for some $k \neq \ell$ , i.e., augmentation could introduce wrong signals. To quantify this negative effect, we introduce the following definition. + +Definition 2 (Correctly augmented parts). We define the corrected augmented parts of augmentation $A$ by + +$$ +\tilde {C} _ {k} := \{x \in C _ {k}: A (x) \subseteq C _ {k} \} +$$ + +for each $k\in [K]$ + +We also denote the probability of their complement as $t \coloneqq 1 - P(\cup_{k=1}^{K} \tilde{C}_k)$ . By the definition, clearly $A(\tilde{C}_{\ell}) \cap A(\tilde{C}_k) = \emptyset$ , hence our theory in the main body applies to $\cup_{k=1}^{K} \tilde{C}_k$ . To see this, we first generalize the definition of $(\sigma, \delta)$ -augmentation to the correctly augmented parts in the following. + +Definition 3 $((\sigma, \delta)$ -Augmentation on corrected augmented parts). The augmentation set $A$ is called a $(\sigma, \delta)$ -augmentation on correctly augmented parts, if for each $\tilde{C}_k$ , there exists a subset $C_k^0 \subseteq \tilde{C}_k$ (called a main part of $\tilde{C}_k$ ), such that both $\mathbb{P}[\pmb{x} \in C_k^0] \geq \sigma \mathbb{P}[\pmb{x} \in \tilde{C}_k]$ where $\sigma \in (0,1]$ and $\sup_{\pmb{x}_1, \pmb{x}_2 \in C_k^0} d_A(\pmb{x}_1, \pmb{x}_2) \leq \delta$ hold. + +Besides, we modify the definition of $\mu_{k}$ by $\mu_{k} := \mathbb{E}_{\boldsymbol{x} \in \tilde{C}_{k}} \mathbb{E}_{\boldsymbol{x}' \in A(\boldsymbol{x})}[f(\boldsymbol{x}')]$ . Then we have a generalized version of Theorem 1. + +Theorem 6 (A generalized version of Theorem 1). Given an augmentation $A$ that is a $(\sigma, \delta)$ -augmentation on corrected augmented parts, if + +$$ +\mu_ {\ell} ^ {\top} \mu_ {k} < r ^ {2} \left(1 - \rho_ {\max } (\sigma , \delta , \varepsilon) - \sqrt {2 \rho_ {\max } (\sigma , \delta , \varepsilon)} - \frac {\Delta_ {\mu}}{2}\right) \tag {18} +$$ + +holds for any pair of $(\ell, k)$ with $\ell \neq k$ , then the downstream error rate of NN classifier $G_{f}$ + +$$ +\operatorname {E r r} \left(G _ {f}\right) \leq (1 - \sigma) + R _ {\varepsilon} + t, \tag {19} +$$ + +where $\rho_{max}(\sigma, \delta, \varepsilon) = 2(1 - \sigma) + \frac{R_{\varepsilon}}{\min_{\ell} p_{\ell}} + \sigma \left(\frac{L \delta}{r} + \frac{2 \varepsilon}{r}\right)$ and $\Delta_{\mu} = 1 - \min_{k \in [K]} \| \mu_k \|^2 / r^2$ . + +We remark that the definition of $R_{\varepsilon}$ is unchanged. The above result gives a more general bound + +$$ +\operatorname {E r r} \left(G _ {f}\right) \leq (1 - \sigma) + R _ {\varepsilon} + t +$$ + +by taking into account the correctly augmented part. An interesting trade-off between $t$ and $(\sigma, \delta)$ emerges. Increasing the strength of data augmentation leads to better concentration, but also a larger $t$ . For extremely strong augmentations, $t$ could be large and dominate the above bound, hence the performance could decrease. We leave the detailed study of this trade-off to future work. + +Proof of Theorem 6. Let $\tilde{R}_{\varepsilon} := \mathbb{P}\left[\overline{S_{\varepsilon} \cap (\cup_{k \in [K]} \tilde{C}_k)}\right]$ . Then using Theorem 1 on $\cup_{k=1}^{K} \tilde{C}_k$ directly gives + +$$ +\operatorname {E r r} \left(G _ {f}\right) \leq (1 - \sigma) + \tilde {R} _ {\varepsilon}. +$$ + +Moreover, + +$$ +\begin{array}{l} \tilde {R} _ {\varepsilon} = \mathbb {P} \left[ \overline {{S _ {\varepsilon} \cap \left(\cup_ {k \in [ K ]} \tilde {C} _ {k}\right)}} \right] \\ = \mathbb {P} \left[ \overline {{S _ {\varepsilon}}} \cup \overline {{\left(\cup_ {k \in [ K ]} \tilde {C} _ {k}\right)}} \right] \\ \leq \mathbb {P} \left[ \overline {{S _ {\varepsilon}}} \right] + \mathbb {P} \left[ \overline {{\cup_ {k \in [ K ]} \tilde {C} _ {k}}} \right] \\ = R _ {\varepsilon} + t, \\ \end{array} +$$ + +which completes the proof. + +![](images/6ab552ece75ba6ef914438f6d5222d434524914bb90a27d2084893b9bdeb4263.jpg) + +# G EXTENSIONS TO MAE, CLIP AND BYOL + +In this section, we discuss how to apply our framework to MAE (He et al., 2022), CLIP (Radford et al., 2021) and BYOL (Grill et al., 2020). + +# G.1 MAE + +MAE learns representations by recovering the original image from its randomly masked version. By viewing random mask as data augmentation, Zhang et al. (2022) has shown that MAE implicitly aligns positive pairs as contrastive learning. Specifically, let $g$ and $f$ be the decoder and encoder of MAE respectively. The loss function of MAE is + +$$ +\mathcal {L} _ {\mathrm {M A E}} (g \circ f) = \underset {\boldsymbol {x}} {\mathbb {E}} \underset {\boldsymbol {x} _ {1} \in A (\boldsymbol {x})} {\mathbb {E}} \| g (f (\boldsymbol {x} _ {1})) - \boldsymbol {x} \| ^ {2}, +$$ + +where $A(x)$ denotes random masks of $x$ . Then using Theorem 3.4 in (Zhang et al., 2022) under their conditions gives + +$$ +\mathcal {L} _ {\mathrm {M A E}} (g \circ f) \geq C _ {1} \cdot \mathcal {L} _ {\text {a l i g n}} (f) + C _ {2}, +$$ + +where $C_1$ and $C_2$ are constants. Based on this result, our framework applies to MAE naturally. We can use the $(\sigma, \delta)$ -notion to characterize the concentration property of random mask, and use Theorem 1 to study how MAE ensures alignment. + +As for the divergence term, we have the following result. + +Theorem 7. Assume that the decoder $g$ is $L$ -bi-Lipschitz, i.e., $\forall (z_1, z_2)$ in the domain of $g$ , $1 / L \| z_1 - z_2 \|^2 \leq \| g(z_1) - g(z_2) \|^2 \leq L \| z_1 - z_2 \|^2$ . Then for any $\ell, k \in [K]$ + +$$ +\underset {\boldsymbol {x} _ {1} \in C _ {\ell}} {\mathbb {E}} \underset {\boldsymbol {x} _ {2} \in C _ {k}} {\mathbb {E}} \| f (\boldsymbol {x} _ {1}) - f (\boldsymbol {x} _ {2}) \| ^ {2} \geq C \cdot \left[ \underset {\boldsymbol {x} _ {1} \in C _ {\ell} \boldsymbol {x} _ {2} \in C _ {k}} {\mathbb {E}} \| \boldsymbol {x} _ {1} - \boldsymbol {x} _ {2} \| ^ {2} - \mathcal {L} _ {\mathrm {M A E}} (g \circ f) \right], +$$ + +where $C$ is some constant. If we further assume $\| f(x)\| = 1$ for every $x$ , we have + +$$ +\mu_ {k} ^ {\top} \mu_ {\ell} \leq 1 - C \cdot \left[ \underset {\boldsymbol {x} _ {1} \in C _ {\ell}} {\mathbb {E}} \underset {\boldsymbol {x} _ {2} \in C _ {k}} {\mathbb {E}} \| \boldsymbol {x} _ {1} - \boldsymbol {x} _ {2} \| ^ {2} - \mathcal {L} _ {\mathrm {M A E}} (g \circ f) \right] +$$ + +The $L$ -bi-Lipschitz assumption follows (Zhang et al., 2022). This result shows that, the divergence bound of MAE contains both the MAE loss and an addition term $E_{\pmb{x}_1 \in C_\ell} \mathbb{E}_{\pmb{x}_2 \in C_k} \| \pmb{x}_1 - \pmb{x}_2 \|^2$ , which measures the class distances between original images. If the original images already have large class distances, the divergence can be ensured. + +More refined results of MAE may need more additional effort. + +Proof of Theorem 7. For any $\ell, k \in [K]$ , by the $L$ -bi-Lipschitz property of $g$ we have + +$$ +\begin{array}{l} \underset {\boldsymbol {x} _ {1} \in C _ {\ell}} {\mathbb {E}} \underset {\boldsymbol {x} _ {2} \in C _ {k}} {\mathbb {E}} \| f (\boldsymbol {x} _ {1}) - f (\boldsymbol {x} _ {2}) \| ^ {2} \\ \geq 1 / L \cdot \underset {\boldsymbol {x} _ {1} \in C _ {\ell}} {\mathbb {E}} \underset {\boldsymbol {x} _ {2} \in C _ {k}} {\mathbb {E}} \| g (f (\boldsymbol {x} _ {1})) - g (f (\boldsymbol {x} _ {2})) \| ^ {2} \\ = 1 / L \cdot \underset {\boldsymbol {x} _ {1} \in C _ {\ell}} {\mathbb {E}} \underset {\boldsymbol {x} _ {2} \in C _ {k}} {\mathbb {E}} \| g (f (\boldsymbol {x} _ {1})) - \boldsymbol {x} _ {1} + \boldsymbol {x} _ {1} - \boldsymbol {x} _ {2} + \boldsymbol {x} _ {2} - g (f (\boldsymbol {x} _ {2})) \| ^ {2} \\ \geq 1 / (3 L) \cdot \underset {\boldsymbol {x} _ {1} \in C _ {\ell}} {\mathbb {E}} \underset {\boldsymbol {x} _ {2} \in C _ {k}} {\mathbb {E}} \left[ \| \boldsymbol {x} _ {1} - \boldsymbol {x} _ {2} \| ^ {2} \right] - 1 / L \cdot \underset {\boldsymbol {x} _ {1} \in C _ {\ell}} {\mathbb {E}} \underset {\boldsymbol {x} _ {2} \in C _ {k}} {\mathbb {E}} \left[ \| g (f (\boldsymbol {x} _ {1})) - \boldsymbol {x} _ {1} \| ^ {2} + \| \boldsymbol {x} _ {2} - g (f (\boldsymbol {x} _ {2})) \| ^ {2} \right] \\ \geq 1 / (3 L) \cdot \underset {\boldsymbol {x} _ {1} \in C _ {\ell}} {\mathbb {E}} \underset {\boldsymbol {x} _ {2} \in C _ {k}} {\mathbb {E}} \| \boldsymbol {x} _ {1} - \boldsymbol {x} _ {2} \| ^ {2} - 1 / L \cdot \left(\frac {1}{p _ {k}} + \frac {1}{p _ {\ell}}\right) \cdot \mathcal {L} _ {\mathrm {M A E}} (g \circ f). \\ \end{array} +$$ + +If $\| f(x) \| = 1$ for any $x$ , we have + +$$ +\underset {\boldsymbol {x} _ {1} \in C _ {\ell}} {\mathbb {E}} \underset {\boldsymbol {x} _ {2} \in C _ {k}} {\mathbb {E}} \| f (\boldsymbol {x} _ {1}) - f (\boldsymbol {x} _ {2}) \| ^ {2} = 2 - 2 \mu_ {\ell} ^ {\top} \mu_ {k}. +$$ + +Then we obtain + +$$ +\mu_ {k} ^ {\top} \mu_ {\ell} \leq 1 - \frac {1}{6 L} \cdot \underset {\boldsymbol {x} _ {1} \in C _ {\ell}} {\mathbb {E}} \underset {\boldsymbol {x} _ {2} \in C _ {k}} {\mathbb {E}} \| \boldsymbol {x} _ {1} - \boldsymbol {x} _ {2} \| ^ {2} - \frac {1}{2} \cdot \left(\frac {1}{p _ {k}} + \frac {1}{p _ {\ell}}\right) \cdot \mathcal {L} _ {\mathrm {M A E}} (g \circ f) +$$ + +![](images/9e219f7a021d6d67f8fa5dae8229f0bad56856c24fbee80ae2f395c6fc2ced16.jpg) + +# G.2 CLIP + +CLIP firstly constructs positive samples by image-text pairs, and then minimizes InfoNCE loss. If we view texts as data augmentation of images, our theory applies directly. To be specific, let $T(x)$ denote the set of all possible texts corresponding to image $x$ . In this case, the augmented distance between images (parallel to equation (1) in our paper) can be defined by + +$$ +d_{T}(x_{1},x_{2}) = \min_{t_{1}\in T(x_{1}),t_{2}\in T(x_{2})}\| t_{1} - t_{2}\| , +$$ + +where $\| \cdot \|$ is some norm of the text space. Then the $(\sigma, \delta)$ notion can also be extended as follows + +Definition 4 $((\sigma, \delta)$ -Concentration of image-text pair). We say the image-text pair is $(\sigma, \delta)$ -concentrated, if there exists $C_k^0 \subseteq C_k$ such that + +$$ +P (x \in C _ {k} ^ {0}) \geq \sigma P (x \in C _ {k}) \text {a n d} \sup _ {x _ {1}, x _ {2} \in C _ {k} ^ {0}} d _ {T} (x _ {1}, x _ {2}) \leq \delta . +$$ + +Note that we treat texts and images asymmetrically, i.e., we view texts as augmentation of images. The reason is that the information density in texts is larger than that in images, namely, images contain more redundant information. Therefore, for two images in the same class, their corresponding texts are expected to be close to each other, but not vice versa. Based on this model, all of our theoretical results about InfoNCE loss apply to CLIP. + +# G.3 BYOL + +BYOL (and SimSiam) adopts training strategies to avoid feature collapse instead of involving an explicit $\mathcal{L}_2$ term in its loss function. Besides, its network architecture contains a predictor, so its loss can not be formulated to the common alignment loss. For these reasons, whether BYOL can optimize alignment and divergence cannot be answered directly by our theory. Nevertheless, our $(\sigma, \delta)$ -notion and Thm 1 still apply to BYOL, since they are algorithm independent. Besides, our experiments for SimSiam (which is similar to BYOL) indeed verify this: + +- Tables 1 and 2 show that the performance of SimSiam also gets better as the concentration of augmentation gets better, which meets our Theorem 1 and related conclusions. +- The new experimental results in Figure 4b show that SimSiam does implicitly optimize divergence during its optimization procedure. + +Further theoretical study of BYOL and SimSiam requires additional effort. + +![](images/07e9385cdaf78d298ee2b2a0150bbf3ce010853e071ca0e07ea09331e45197a6.jpg) +(a) Alignment after different training epochs + +![](images/f4c854b801e7e62e26632cbd9cf6bf35e63e7a79e0a144bd176269864c5a03db.jpg) +(b) Divergence after different training epochs + +![](images/67efe44e450cae2c6f3264a7841408fad5d2e6fdff16828c48a913277adcb5e9.jpg) +Figure 4: Alignment and divergence vary with training epochs. +Figure 5: The correlation between observed $\mathrm{Err}(G_f)$ and computed value of $(1 - \sigma)$ on CIFAR-100. + +# H ADDITIONAL EXPERIMENTS + +Alignment and Divergence. We choose the models with three different loss functions (i.e., Barlow Twins, SiamSiam and MoCo) and observe how alignment and divergence change during the training procedure. Each model is trained on CIFAR-10 with a batch size of 512 and 800 epochs. The setting of data augmentation is fixed as the one that Chen et al. (2020a) used. In the experiments, the alignment is quantified by $\frac{1}{|X|}\sum_{x\in X}\| f(A_1(x)) - f(A_2(x))\|^2$ and the divergence is quantified by the average of $\left(\frac{1}{|C_k|}\sum_{x\in C_k}f(x)\right)^\top \left(\frac{1}{|C_\ell|}\sum_{x\in C_\ell}f(x)\right)$ among all $k\neq \ell$ , where $f$ is the encoder, $A_{1}(x)$ and $A_{2}(x)$ are two augmented data of $x$ , $X$ is the training set, $C_k$ contains all the training data with label $k$ . At the end of the training procedure, Barlow Twins, SimSiam, and MoCo achieve a KNN accuracy of 86.94, 89.28, and 90.33, respectively. + +We have the following observations: + +- At the end of the training, both the alignment and divergence are ordered as MoCo $<$ SimSiam $<$ Barlow Twins, from small to large (i.e., good to bad). We also observe that MoCo, Simsiam, and Barlow Twins achieve a KNN accuracy of 90.33, 89.28, and 86.94, respectively. This suggests that better alignment and divergence result in better performance when the setting of data augmentation is fixed. This empirical result is as expected: as long as good alignment and divergence are achieved, no matter whether it is due to the loss functions (e.g., SimCLR and Barlow Twins, proved in Section 4) or other unknown reasons (e.g., SimSiam), the generalization error should be small according to our Thm 1. +- During the training procedure, the divergence factor always gets better (i.e., smaller) for all three kinds of algorithms. It decreases more quickly at the early stage of training. Meanwhile, the alignment factor starts to get better monotonously after several training epochs for MoCo and Barlow Twins. But for SimSiam, it becomes increasingly large. This is because SimSiam does not directly minimize the alignment, instead, a predictor is involved to transform the feature of one view and matches it to the other view. + +Different Composed Pairs of Transformations on CIFAR-100. Similar to the experiments on CIFAR-10, we compose transformations (a)-(e) in pairs to construct a total of 10 augmentations, and observe the correlation between classification error rate $\mathrm{Err}(G_f)$ and $(1 - \sigma)$ under different $\delta$ on CIFAR-100, based on the SimCLR model trained with 200 epochs. We find that downstream performance is also highly correlated to the concentration level on CIFAR-100, which has the similar result to Figure 3. \ No newline at end of file diff --git a/towardsthegeneralizationofcontrastiveselfsupervisedlearning/images.zip b/towardsthegeneralizationofcontrastiveselfsupervisedlearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..85df0e4de61cd814e594096a6f4b64cc90814db0 --- /dev/null +++ b/towardsthegeneralizationofcontrastiveselfsupervisedlearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fad9a2490e2d9acff04390d59e830507f17d5f48d451e3872689ed1ebbc8260d +size 2228776 diff --git a/towardsthegeneralizationofcontrastiveselfsupervisedlearning/layout.json b/towardsthegeneralizationofcontrastiveselfsupervisedlearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..e9fe26e74191f48841de344cd5828be3a71622e7 --- /dev/null +++ b/towardsthegeneralizationofcontrastiveselfsupervisedlearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:efe9fbd925ceeea0433c1e87f240bf902c1a7fb61c2f5395b74e3755441960db +size 1184682 diff --git a/tradinginformationbetweenlatentsinhierarchicalvariationalautoencoders/1aa93880-e4b4-43df-a6da-767b4c6119cd_content_list.json b/tradinginformationbetweenlatentsinhierarchicalvariationalautoencoders/1aa93880-e4b4-43df-a6da-767b4c6119cd_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..00b4f7047bac05db8eeb9da05fd9d8928a4dda1b --- /dev/null +++ b/tradinginformationbetweenlatentsinhierarchicalvariationalautoencoders/1aa93880-e4b4-43df-a6da-767b4c6119cd_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5afc2f4436ccc52b51153a9c963692c0afc7c382be02b5ac30feee562e02b701 +size 108160 diff --git a/tradinginformationbetweenlatentsinhierarchicalvariationalautoencoders/1aa93880-e4b4-43df-a6da-767b4c6119cd_model.json b/tradinginformationbetweenlatentsinhierarchicalvariationalautoencoders/1aa93880-e4b4-43df-a6da-767b4c6119cd_model.json new file mode 100644 index 0000000000000000000000000000000000000000..72b38743c088d4018f1a1ef8f762cd452255a5bf --- /dev/null +++ b/tradinginformationbetweenlatentsinhierarchicalvariationalautoencoders/1aa93880-e4b4-43df-a6da-767b4c6119cd_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6af9d69cd32f24f8ac0498ab3be6f7a3e69319d731a029345536d14a59dfb82b +size 125356 diff --git a/tradinginformationbetweenlatentsinhierarchicalvariationalautoencoders/1aa93880-e4b4-43df-a6da-767b4c6119cd_origin.pdf b/tradinginformationbetweenlatentsinhierarchicalvariationalautoencoders/1aa93880-e4b4-43df-a6da-767b4c6119cd_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..726cdb32fdb140bdb55c223636953e0e5af5f005 --- /dev/null +++ b/tradinginformationbetweenlatentsinhierarchicalvariationalautoencoders/1aa93880-e4b4-43df-a6da-767b4c6119cd_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cbe3ce9fa3506574e54c153204e3f1ec395efe733154241f8e493dddf03433e3 +size 6369736 diff --git a/tradinginformationbetweenlatentsinhierarchicalvariationalautoencoders/full.md b/tradinginformationbetweenlatentsinhierarchicalvariationalautoencoders/full.md new file mode 100644 index 0000000000000000000000000000000000000000..2dd5532560832fdd795d93e1507a8a1ffccf18e3 --- /dev/null +++ b/tradinginformationbetweenlatentsinhierarchicalvariationalautoencoders/full.md @@ -0,0 +1,465 @@ +# TRADING INFORMATION BETWEEN LATENTS IN HIERARCHICAL VARIATIONAL AUTOENCODERS + +Tim Z. Xiao + +University of Tübingen & IMPRS-IS + +zhenzhong.xiao@uni-tuebingen.de + +Robert Bamler + +University of Tübingen + +robert.bamler@uni-tuebingen.de + +# ABSTRACT + +Variational Autoencoders (VAEs) were originally motivated (Kingma & Welling, 2014) as probabilistic generative models in which one performs approximate Bayesian inference. The proposal of $\beta$ -VAEs (Higgins et al., 2017) breaks this interpretation and generalizes VAEs to application domains beyond generative modeling (e.g., representation learning, clustering, or lossy data compression) by introducing an objective function that allows practitioners to trade off between the information content ("bit rate") of the latent representation and the distortion of reconstructed data (Alemi et al., 2018). In this paper, we reconsider this rate/distortion trade-off in the context of hierarchical VAEs, i.e., VAEs with more than one layer of latent variables. We identify a general class of inference models for which one can split the rate into contributions from each layer, which can then be tuned independently. We derive theoretical bounds on the performance of downstream tasks as functions of the individual layers' rates and verify our theoretical findings in large-scale experiments. Our results provide guidance for practitioners on which region in rate-space to target for a given application. + +# 1 INTRODUCTION + +Variational autoencoders (VAEs) (Kingma & Welling, 2014; Rezende et al., 2014) are a class of deep generative models that are used, e.g., for density modeling (Takahashi et al., 2018), clustering (Jiang et al., 2017), nonlinear dimensionality reduction of scientific measurements (Laloy et al., 2017), data compression (Ballé et al., 2017), anomaly detection (Xu et al., 2018), and image generation (Razavi et al., 2019). VAEs (more precisely, $\beta$ -VAEs (Higgins et al., 2017)) span such a diverse set of application domains in part because they can be tuned to a specific task without changing the network architecture, in a way that is well understood from information theory (Alemi et al., 2018). + +The original proposal of VAEs (Kingma & Welling, 2014) motivates them from the perspective of generative probabilistic modeling and approximate Bayesian inference. However, the generalization to $\beta$ -VAEs breaks this interpretation as they are no longer trained by maximizing a lower bound on the marginal data likelihood. These models are better described as neural networks that are trained to learn the identity function, i.e., to make their output resemble the input as closely as possible. This task is made nontrivial by introducing a so-called (variational) information bottleneck (Alemi et al., 2017; Tishby & Zaslavsky, 2015) at one or more layers, which restricts the information content that passes through these layers. The network activations at the information bottleneck are called latent representations (or simply "latents"), and they split the network into an encoder part (from input to latents) and a decoder part (from latents to output). This separation of the model into an encoder and a decoder allows us to categorize the wide variety of applications of VAEs into three domains: + +1. data reconstruction tasks, i.e., applications that involve both the encoder and the decoder; these include various nonlinear inter- and extrapolations (e.g., image upscaling, denoising, or inpainting), and VAE-based methods for lossy data compression; +2. representation learning tasks, i.e., applications that involve only the encoder; they serve a downstream task that operates on the (typically lower dimensional) latent representation, e.g., classification, regression, visualization, clustering, or anomaly detection; and +3. generative modeling tasks, i.e., applications that involve only the decoder are less common but include generating new samples that resemble training data. + +![](images/a8f839da525b055b2c10920804d40df99ece30a33c9be37d51b8b30dec19494d.jpg) +Figure 1: Left: trade-off between performance in the three applications domains of VAEs, using GHVAE trained on the SVHN data set (details: Section 5); higher is better for all three metrics; gray dots on walls show 2d-projections. Right: color code, corresponding layer-wise rates (Eq. 7), and individual performance landscapes (size of dots $\propto$ performance). The hyperparameters $\beta_{2}$ and $\beta_{1}$ allow us to tune the HVAE for best data reconstruction $(\triangle)$ , best representation learning $(\diamond)$ , or best generative modeling $(\odot)$ . Note that performance landscapes differ strongly across the three applications, and neither a standard VAE $(\beta_{2} = \beta_{1} = 1$ ; marked “ $\bullet$ ” in right panels) nor a conventional $\beta$ -VAE $(\beta_{2} = \beta_{1}$ ; dashed red lines) result in optimal models for any of the three applications. + +![](images/0a54ede37779874942bfaf9f3317bd92ca5b759481a5da1967f9aac5c4134b07.jpg) + +The information bottleneck incentivizes the VAE to encode information into the latents efficiently by removing any redundancies from the input. How agressively this is done can be controlled by tuning the strength $\beta$ of the information bottleneck (Alemi et al., 2018). Unfortunately, information theory distinguishes relevant from redundant information only in a quantitative way that is agnostic to the qualitative features that each piece of information represents about some data point. In practice, many VAE-architectures (Deng et al., 2017; Yingzhen & Mandt, 2018; Balle et al., 2018) try to separate qualitatively different features into different parts of the latent representation by making the model architecture reflect some prior assumptions about the semantic structure of the data. This allows downstream applications from the three domains discussed above to more precisely target specific qualitative aspects of the data by using or manipulating only the corresponding part of the latent representation. However, in this approach, the degree of detail to which each qualitative aspect is encoded in the latents can be controlled at most indirectly by tuning network layer sizes. + +In this paper, we argue both theoretically and empirically that the three different application domains of VAEs identified above require different trade-offs in the amount of information that is encoded in each part of the latent representation. We propose a method to independently control the information content (or "rate") of each layer of latent representations, generalizing the rate/distortion theory of $\beta$ -VAEs (Alemi et al., 2018) for VAEs with more than one layer of latents ("hierarchical VAEs" or HVAEs for short). We identify the most general model architecture that is compatible with our proposal and analyze how both theoretical performance bounds and empirically measured performances in each of the above three application domains depend on how rate is distributed across layers. + +Our approach is summarized in Figure 1. The 3d-plot shows empirically measured performance metrics (discussed in detail in Section 5.2) for the three application domains identified above. Each point on the colored surface corresponds to different layer-wise rates in an HVAE with two layers of latents. Crucially, the rates that lead to optimal performance are different for each of the three application domains (see markers $\triangle$ , $\diamond$ , and $\diamond$ in Figure 1), and none of these three optimal models coincide with a conventional $\beta$ -VAE (dashed red lines in right panels). Thus, being able to control each layer's individual rate allows practitioners to train VAEs that target a specific application. + +The paper is structured as follows. Section 2 summarizes related work. Section 3 introduces the proposed information-trading method. We then analyze how controlling individual layers' rates can be used to tune HVAEs for specific tasks, i.e., how performance in each of the three application domains identified above depends on the allocation of rates across layers. This analysis is done theoretically in Section 4 and empirically in Section 5. Section 6 provides concluding remarks. + +![](images/95cd30e4a524277a194b04b742ed21fbd29fed5a45fdcef4558d93892a9b8df1.jpg) +(a) bottom-up + +![](images/4bbfb9c7346de3f34d20b8cb82515abfed96310c8bfe7d2148a74cf297ca52e9.jpg) +(b) implicit top-down (e.g., LVAE) + +![](images/8b248dde880ae15dc6785775da38ff5073bbd7eb2eaaf99212d9a4511fc62737.jpg) +(c) generalized (explicit) top-down +Figure 2: Inference (dashed arrows) and generative (solid arrows) models for hierarchical VAEs (HVAEs) with two layers of latent variables. White/gray circles denote latent/observed random variables, respectively; the diamond $\mathbf{d}_1$ in (b) is the result of a deterministic transformation of $\mathbf{x}$ . + +# 2 RELATED WORK + +We group related work into work on model architectures for hierarchical VAEs, and on $\beta$ -VAEs. + +Model Design for Hierarchical VAEs. The original VAE design (Kingma & Welling, 2014; Rezende et al., 2014) has a single layer of latent variables, but recent works (Vahdat & Kautz, 2020; Child, 2021), found that increasing the number of stochastic layers in hierarchical VAEs (HVAEs) improves performance. HVAEs have various designs for their inference models. Sønderby et al. (2016) introduced Ladder VAE (LVAE) with a top-down inference path rather than the naive bottom-up inference (see Section 3), whereas the Bidirectional-Inference VAE (BIVA) (Maaløe et al., 2019) uses a combination of top-down and bottom-up. Our proposed framework applies to a large class of inference models (see Section 3) that includes the popular LVAE (Sønderby et al., 2016). + +$\beta$ -VAEs And Their Information-Theoretical Interpretations. Higgins et al. (2017) introduced an extra hyperparameter $\beta$ in the objective of VAEs that tunes the strength of the information bottleneck, and they observed that large $\beta$ leads to a disentangled latent representation. An information-theoretical interpretation of $\beta$ -VAEs was provided in (Alemi et al., 2018) by applying the concept of a (variational) bottleneck (Tishby & Zaslavsky, 2015; Alemi et al., 2017) to autoencoders. Due to this information-theoretical interetation, $\beta$ -VAEs are popular models for data compression (Balle et al., 2017; Minnen et al., 2018; Yang et al., 2020), where tuning $\beta$ allows trading off between the bit rate of compressed data and data distortion. In the present work, we generalize $\beta$ -VAEs when applied to HVAEs, and we introduce a framework for tuning the rate of each latent layer individually. + +# 3 A HIERARCHICAL INFORMATION TRADING FRAMEWORK + +We propose a refinement of the rate/distortion theory of $\beta$ -VAEs (Alemi et al., 2018) that admits controlling individual layers' rates in VAEs with more than one layers of latents (hierarchical VAEs). + +# 3.1 CONVENTIONAL $\beta$ -VAE WITH HIERARCHICAL LATENT REPRESENTATIONS + +We consider a hierarchical VAE (HVAE) for data $\pmb{x}$ with $L$ layers of latent representations $\{z_{\ell}\}_{\ell=1}^{L}$ . Figure 2, discussed further in Section 3.2 below, illustrates various model architectures for the example of $L = 2$ . Solid arrows depict the generative model $p_{\theta}(\{z_{\ell}\}, \pmb{x})$ , where $\theta$ are model parameters (neural network weights). We assume that the implementation factorizes $p_{\theta}(\{z_{\ell}\}, \pmb{x})$ as follows, + +$$ +p _ {\theta} \left(\left\{\boldsymbol {z} _ {\ell} \right\}, \boldsymbol {x}\right) = p _ {\theta} \left(\boldsymbol {z} _ {L}\right) p _ {\theta} \left(\boldsymbol {z} _ {L - 1} \mid \boldsymbol {z} _ {L}\right) p _ {\theta} \left(\boldsymbol {z} _ {L - 2} \mid \boldsymbol {z} _ {L - 1}, \boldsymbol {z} _ {L}\right) \dots p _ {\theta} \left(\boldsymbol {z} _ {1} \mid \boldsymbol {z} _ {\geq 2}\right) p _ {\theta} \left(\boldsymbol {x} \mid \boldsymbol {z} _ {\geq 1}\right) \tag {1} +$$ + +where the notation $z_{\geq n}$ for any $n$ is short for the collection of latents $\{\pmb{z}_{\ell}\}_{\ell = n}^{L}$ (thus, $\pmb{z}_{\geq 1}$ and $\{\pmb{z}_{\ell}\}$ are synonymous), and the numbering of latents from $L$ down to 1 follows the common convention in the literature (Sønderby et al., 2016; Gulrajani et al., 2017; Child, 2021). The loss function of a + +normal $\beta$ -VAE (Higgins et al., 2017) with this generic architecture would be + +$$ +\mathcal {L} _ {\beta} (\theta , \phi) = \mathbb {E} _ {\boldsymbol {x} \sim \mathbb {X} _ {\text {t r a i n}}} \left[ \underbrace {\mathbb {E} _ {q _ {\phi} \left(\left\{\boldsymbol {z} _ {\ell} \right\} \mid \boldsymbol {x}\right)} \left[ - \log p _ {\theta} (\boldsymbol {x} \mid \left\{\boldsymbol {z} _ {\ell} \right\}) \right]} _ {= “ \text {d i s t o r t i o n ” D}} + \beta \underbrace {D _ {\mathrm {K L}} \left[ q _ {\phi} \left(\left\{\boldsymbol {z} _ {\ell} \right\} \mid \boldsymbol {x}\right) \| p _ {\theta} \left(\left\{\boldsymbol {z} _ {\ell} \right\}\right) \right]} _ {= “ \text {r a t e ” R}} \right]. \tag {2} +$$ + +Here, $q_{\phi}(\{\pmb{z}_{\ell}\} \mid \pmb{x})$ is the inference (or "encoder") model with parameters $\phi$ , $\mathbb{X}_{\mathrm{train}}$ is the training set, $D_{\mathrm{KL}}[\cdot \|\cdot]$ denotes Kullback-Leibler divergence, and the Lagrange parameter $\beta > 0$ trades off between a (total) rate $R$ and a distortion $D$ (Alemi et al., 2018). Setting $\beta = 1$ turns Eq. 2 into the negative ELBO objective of a regular VAE (Kingma & Welling, 2014). The rate $R$ obtains its name as it measures the (total) information content that $q_{\phi}$ encodes into the latent representations $\{\pmb{z}_{\ell}\}$ , which would manifest itself in the expected bit rate when one optimally encodes a random draw $\{\pmb{z}_{\ell}\} \sim q_{\phi}(\{\pmb{z}_{\ell}\} \mid \pmb{x})$ using $p_{\theta}(\{\pmb{z}_{\ell}\})$ as an entropy model (Agustsson & Theis, 2020; Bennett et al., 2002). An important observation pointed out in (Alemi et al., 2017) is that, regardless how rate $R$ is traded off against distortion $D$ by tuning $\beta$ , their sum $R + D$ is—in expectation under any data distribution $p_{\mathrm{data}}(\pmb{x})$ —always lower bounded by the entropy $H[p_{\mathrm{data}}(\pmb{x})] := \mathbb{E}_{p_{\mathrm{data}}(\pmb{x})}[-\log p_{\mathrm{data}}(\pmb{x})]$ , + +$$ +\mathbb {E} _ {p _ {\text {d a t a}} (\boldsymbol {x})} [ R + D ] \geq H [ p _ {\text {d a t a}} (\boldsymbol {x}) ] \quad \forall p _ {\text {d a t a}}. \tag {3} +$$ + +Limitations. The rate $R$ in Eq. 2 is a property of the collection $\{z_{\ell}\}$ of all latents, which can limit its interpretability for some inference models. For example, the common convention of enumerating layers $z_{\ell}$ from $\ell = L$ down to 1 in Eq. 1 is reminiscent of a naive architecture for the inference model that factorizes in reverse order compared to Eq. 1 ("bottom up", see dashed arrows in Figure 2(a)), i.e., $q_{\phi}(\{z_{\ell}\} | \mathbf{x}) = q_{\phi}(z_1|\mathbf{x})q_{\phi}(z_2|z_1)\dots q_{\phi}(z_L|z_{L - 1})$ . Using a HVAE with such a "bottom-up" inference model to reconstruct some given data point $\mathbf{x}$ would map $\mathbf{x}$ to $z_{1}$ using $q_{\phi}(z_1|x)$ and then map $z_{1}$ back to the data space using $p_{\theta}(\pmb {x}|z_1)$ , thus ignoring all latents $z_{\ell}$ with $\ell > 1$ . Yet, the rate term in Eq. 2 still depends on all latents, including the ones not needed to reconstruct any data (practical VAE-based compression methods using bits-back coding (Frey & Hinton, 1997) would, however, indeed use $z_{\ell}$ with $\ell > 1$ as auxiliary variables for computational efficiency). + +# 3.2 TRADING INFORMATION BETWEEN LATENTS + +Many HVAEs used in the literature allow us to resolve the limitations identified in Section 3.1. For example, the popular LVAE architecture (Sønderby et al., 2016), (Figure 2(b)), uses an inference model (dashed arrows) that traverses the latents $\{z_{\ell}\}$ in the same order as the generative model (solid arrows). We consider the following generalization of this architecture (see Figure 2(c)), + +$$ +q _ {\phi} \left(\left\{\boldsymbol {z} _ {\ell} \right\} \mid \boldsymbol {x}\right) = q _ {\phi} \left(\boldsymbol {z} _ {L} \mid \boldsymbol {x}\right) q _ {\phi} \left(\boldsymbol {z} _ {L - 1} \mid \boldsymbol {z} _ {L}, \boldsymbol {x}\right) q _ {\phi} \left(\boldsymbol {z} _ {L - 2} \mid \boldsymbol {z} _ {L - 1}, \boldsymbol {z} _ {L}, \boldsymbol {x}\right) \dots q _ {\phi} \left(\boldsymbol {z} _ {1} \mid \boldsymbol {z} _ {\geq 2}, \boldsymbol {x}\right). \tag {4} +$$ + +Formally, Eq. 4 is just the product rule of probability theory and therefore holds for arbitrary inference models $q_{\phi}(\{z_{\ell}\} \mid x)$ . More practically, however, we make the assumption that the actual implementation of $q_{\phi}(\{z_{\ell}\} \mid x)$ follows the structure in Eq. 4. This means that, using the trained model, the most efficient way to map a given data point $x$ to its reconstruction $\hat{x}$ now involves all latents $z_{\ell}$ (either drawing a sample or taking the mode at each step): + +$$ +\boldsymbol {x} \xrightarrow {q _ {\phi} (\boldsymbol {z} _ {L} | \boldsymbol {x})} \boldsymbol {z} _ {L} \xrightarrow {q _ {\phi} (\boldsymbol {z} _ {L - 1} | \boldsymbol {z} _ {L} , \boldsymbol {x})} \boldsymbol {z} _ {L - 1} \longrightarrow \dots \longrightarrow \boldsymbol {z} _ {2} \xrightarrow {q _ {\phi} (\boldsymbol {z} _ {1} | \boldsymbol {z} _ {\geq 2} , \boldsymbol {x})} \boldsymbol {z} _ {1} \xrightarrow {p _ {\theta} (\boldsymbol {x} | \{\boldsymbol {z} _ {\ell} \})} \hat {\boldsymbol {x}}. \tag {5} +$$ + +Layer-wise Rates. We can interpret Eq. 5 in that it first maps $\pmb{x}$ to a "crude" representation $\pmb{z}_L$ , which gets iteratively refined to $\pmb{z}_1$ , and finally to a reconstruction $\hat{\pmb{x}}$ . Note that each factor $q_{\phi}(z_{\ell} | z_{\geq \ell + 1}, \pmb{x})$ of the inference model in Eq. 4 is conditioned not only on the previous layers $z_{\geq \ell + 1}$ but also on the original data $\pmb{x}$ . This allows the inference model to target each refinement step in Eq. 5 such that the reconstruction $\hat{\pmb{x}}$ becomes close to $\pmb{x}$ . More formally, we chose the inference architecture in Eq. 4 such that it factorizes over $\{z_{\ell}\}$ in the same order as the generative model (Eq. 1). This allows us to split the total rate $R$ into a sum of layer-wise rates as follows, + +$$ +\begin{array}{l} R = \mathbb {E} _ {q _ {\phi} (\left\{\boldsymbol {z} _ {\ell} \right\} | \boldsymbol {x})} \left[ \log \frac {q _ {\phi} \left(\boldsymbol {z} _ {L} \mid \boldsymbol {x}\right)}{p _ {\theta} \left(\boldsymbol {z} _ {L}\right)} + \log \frac {q _ {\phi} \left(\boldsymbol {z} _ {L - 1} \mid \boldsymbol {z} _ {L} , \boldsymbol {x}\right)}{p _ {\theta} \left(\boldsymbol {z} _ {L - 1} \mid \boldsymbol {z} _ {L}\right)} + \dots + \log \frac {q _ {\phi} \left(\boldsymbol {z} _ {1} \mid \boldsymbol {z} _ {\geq 2} , \boldsymbol {x}\right)}{p _ {\theta} \left(\boldsymbol {z} _ {1} \mid \boldsymbol {z} _ {\geq 2}\right)} \right] \tag {6} \\ = R \left(\boldsymbol {z} _ {L}\right) + R \left(\boldsymbol {z} _ {L - 1} \mid \boldsymbol {z} _ {L}\right) + R \left(\boldsymbol {z} _ {L - 2} \mid \boldsymbol {z} _ {L - 1}, \boldsymbol {z} _ {L}\right) + \dots + R \left(\boldsymbol {z} _ {1} \mid \boldsymbol {z} _ {\geqslant 2}\right). \\ \end{array} +$$ + +Here, + +$$ +R \left(\boldsymbol {z} _ {L}\right) = D _ {\mathrm {K L}} \left[ q _ {\phi} \left(\boldsymbol {z} _ {L} \mid \boldsymbol {x}\right) \| p _ {\theta} \left(\boldsymbol {z} _ {L}\right) \right] \quad \text {a n d} +$$ + +$$ +R \left(\boldsymbol {z} _ {\ell} \mid \boldsymbol {z} _ {\geq \ell + 1}\right) = \mathbb {E} _ {q \left(\boldsymbol {z} _ {\geq \ell + 1} \mid \boldsymbol {x}\right)} \left[ D _ {\mathrm {K L}} \left[ q _ {\phi} \left(\boldsymbol {z} _ {\ell} \mid \boldsymbol {z} _ {\geq \ell + 1}, \boldsymbol {x}\right) \| p _ {\theta} \left(\boldsymbol {z} _ {\ell} \mid \boldsymbol {z} _ {\geq \ell + 1}\right) \right] \right] \tag {7} +$$ + +quantify the information content of the highest-order latent representation $z_{L}$ and the (expected) increase in information content in each refinement step $z_{\ell +1}\rightarrow z_{\ell}$ in Eq. 5, respectively. + +Controlling Each Layer's Rate. Using Eqs. 6-7, we generalize the rate/distortion trade-off from Section 3.1 by introducing $L$ individual Lagrange multipliers $\beta_{L}, \beta_{L - 1}, \ldots, \beta_{1}$ , collectively denoted as boldface $\beta$ . This leads to a new loss function that generalizes Eq. 2 as follows, + +$$ +\mathcal {L} _ {\boldsymbol {\beta}} (\theta , \phi) = \mathbb {E} _ {\boldsymbol {x} \sim \mathbb {X} _ {\text {t r a i n}}} [ D + \beta_ {L} R (\boldsymbol {z} _ {L}) + \beta_ {L - 1} R (\boldsymbol {z} _ {L - 1} | \boldsymbol {z} _ {L}) + \dots + \beta_ {1} R (\boldsymbol {z} _ {1} | \boldsymbol {z} _ {\geq 2}) ]. \tag {8} +$$ + +Setting all $\beta$ s to the same value recovers the conventional $\beta$ -VAE (Eq. 2), which trades off distortion against total information content in $\{z_{\ell}\}$ . Tuning each $\beta$ -hyperparameter individually allows trading off information content across latents. (In a very deep HVAE (i.e., large $L$ ) it may be more practical to group layers into only few bins and to use the same $\beta$ -value for all layers within a bin.) We analyze how to tune $\beta$ s for various applications theoretically in Section 4 and empirically in Section 5. + +# 4 INFORMATION-THEORETICAL PERFORMANCE BOUNDS FOR HVAES + +In this section, we analyze theoretically how various performance metrics for HVAEs are restricted by the individual layers' rates $R(z_{L})$ and $R(z_{\ell} | z_{\geq \ell + 1})$ identified in Eq. 7 for a HVAE with "top-down" inference model. Our analysis motivates the use of the information-trading loss function in Eq. 8 for training HVAEs, following the argument from the introduction that VAEs are commonly used for a vast variety of tasks. As we show, different tasks require different trade-offs that can be targeted by tuning the Lagrange multipliers $\beta$ in Eq. 8. We group tasks into the application domains of (i) data reconstruction and manipulation, (ii) representation learning, and (iii) data generation. + +Data Reconstruction and Manipulation. The most obvious class of application domains of VAEs includes tasks that combine encoder and decoder to map some data point $\mathbf{x}$ to representations $\{z_{\ell}\}$ and then back to the data space. The simplest performance metric for such data reconstruction tasks is the expected distortion $E_{p_{\mathrm{data}}(\mathbf{x})}[D]$ , which we can bound by combining Eq. 3 with Eqs. 6-7, + +$$ +\mathbb {E} _ {p _ {\text {d a t a}} (\boldsymbol {x})} [ D ] \geq H [ p _ {\text {d a t a}} (\boldsymbol {x}) ] - \mathbb {E} _ {p _ {\text {d a t a}} (\boldsymbol {x})} \left[ R \left(\boldsymbol {z} _ {L}\right) + R \left(\boldsymbol {z} _ {L - 1} \mid \boldsymbol {z} _ {L}\right) + \dots + R \left(\boldsymbol {z} _ {1} \mid \boldsymbol {z} _ {\geq 2}\right) \right]. \tag {9} +$$ + +Eq. 9 would suggest that higher rates (i.e., lower $\beta$ 's) are always better for data reconstruction tasks. However, in many practical tasks (e.g., image upscaling, denoising, or inpainting) the goal is not solely to reconstruct the original data but also to manipulate the latent representations $\{z_{\ell}\}$ in a meaningful way. Here, lower rates can lead to more semantically meaningful representation spaces (see, e.g., Section 5.6 below). Controlling how rate is distributed across layers via Eq. 8 may allow practitioners to have a semantically meaningful high-level representation $z_{L}$ with low rate $R(z_{L})$ while still retaining a high total rate $R$ , thus allowing for low distortion $D$ without violating Eq. 9. + +Representation Learning. In many practical applications, VAEs are used as nonlinear dimensionality reduction methods to prepare some complicated high-dimensional data $\mathbf{x}$ for downstream tasks such as classification, regression, visualization, clustering, or anomaly detection. We consider a classifier $p_{\mathrm{cls}}(y|\mathbf{z}_{\ell})$ operating on the latents $\mathbf{z}_{\ell}$ at some level $\ell$ . We assume that the (unknown) true data generative process $p_{\mathrm{data}}(y,\mathbf{x}) = p_{\mathrm{data}}(y)p_{\mathrm{data}}(\mathbf{x}|y)$ generates data $\mathbf{x}$ conditioned on some true label $y$ , thus defining a Markov chain $y\xrightarrow{p_{\mathrm{data}}}x\xrightarrow{q_{\phi}}z_{\ell}\xrightarrow{p_{\mathrm{cls}}}\hat{y}$ where $\hat{y} := \arg \max_y p_{\mathrm{cls}}(y|\mathbf{z}_\ell)$ . Classification accuracy is bounded (Meyen, 2016) by a function of the mutual information $I_q(y;z_\ell)$ , + +$$ +\begin{array}{l} I _ {q} (y; \boldsymbol {z} _ {\ell}) \leq I _ {q} (\boldsymbol {x}; \boldsymbol {z} _ {\ell}) \equiv \mathbb {E} _ {p _ {\mathrm {d a t a}} (\boldsymbol {x})} \left[ \mathbb {E} _ {q _ {\phi} (\boldsymbol {z} _ {\ell} | \boldsymbol {x})} \left[ \log \frac {q _ {\phi} (\boldsymbol {z} _ {\ell} | \boldsymbol {x})}{q _ {\phi} (\boldsymbol {z} _ {\ell})} \right] \right] \tag {10} \\ = \mathbb {E} _ {p _ {\text {d a t a}} (\boldsymbol {x})} \left[ \mathbb {E} _ {q _ {\phi} \left(\boldsymbol {z} _ {\ell} \mid \boldsymbol {x}\right)} \left[ \log \frac {q _ {\phi} \left(\boldsymbol {z} _ {\ell} \mid \boldsymbol {x}\right)}{p _ {\theta} \left(\boldsymbol {z} _ {\ell}\right)} \right] \right] - D _ {\mathrm {K L}} \left[ q _ {\phi} \left(\boldsymbol {z} _ {\ell}\right) \| p _ {\theta} \left(\boldsymbol {z} _ {\ell}\right) \right] \\ \leq \mathbb {E} _ {p _ {\text {d a t a}} (\boldsymbol {x})} \left[ \mathbb {E} _ {q _ {\phi} (\boldsymbol {z} _ {\geq \ell} | \boldsymbol {x})} \left[ \log \frac {q _ {\phi} (\boldsymbol {z} _ {\geq \ell} | \boldsymbol {x})}{p _ {\theta} (\boldsymbol {z} _ {\geq \ell})} \right] \right. \\ \left. - \mathbb {E} _ {q _ {\phi} (\boldsymbol {z} _ {\ell} | \boldsymbol {x})} \left[ D _ {\mathrm {K L}} \left[ q _ {\phi} \left(\boldsymbol {z} _ {\geq \ell + 1} \mid \boldsymbol {x}, \boldsymbol {z} _ {\ell}\right) \| p _ {\theta} \left(\boldsymbol {z} _ {\geq \ell + 1} \mid \boldsymbol {z} _ {\ell}\right) \right] \right] \right] \\ \leq \mathbb {E} _ {p _ {\mathrm {d a t a}} (\boldsymbol {x})} \big [ \underbrace {R (\boldsymbol {z} _ {L}) + R (\boldsymbol {z} _ {L - 1} | \boldsymbol {z} _ {L}) + \ldots + R (\boldsymbol {z} _ {\ell} | \boldsymbol {z} _ {\geq \ell + 1})} _ {=: R (\boldsymbol {z} _ {\geq \ell}) (\leq R)} \big ]. \\ \end{array} +$$ + +Here, $q_{\phi}(\boldsymbol{z}_{\ell}) \coloneqq \mathbb{E}_{p_{\mathrm{data}}(\boldsymbol{x})}[q_{\phi}(\boldsymbol{z}_{\ell}|\boldsymbol{x})]$ and we identify $R(\boldsymbol{z}_{\geq \ell})$ as the rate accumulated in all layers from $\boldsymbol{z}_L$ to $\boldsymbol{z}_{\ell}$ . The first inequality in Eq. 10 comes from the data processing inequality (MacKay, + +2003), and the other two inequalities result from discarding the (nonnegative) KL-terms. The classification accuracy is thus bounded by (Meyen, 2016) (see also proof in Appendix B) + +$$ +\text {c l a s s .} \leq f ^ {- 1} \left(I _ {q} (y; z _ {\ell})\right) \leq f ^ {- 1} \left(\mathbb {E} _ {p _ {\mathrm {d a t a}} (\boldsymbol {x})} [ R (\boldsymbol {z} _ {\geq \ell}) ]\right) \quad \left(\leq f ^ {- 1} \left(\mathbb {E} _ {p _ {\mathrm {d a t a}} (\boldsymbol {x})} [ R ]\right)\right) \tag {11} +$$ + +where $f^{-1}$ is the inverse of the monotonic function $f(\alpha) = H[p_{\mathrm{data}}(y)] + \alpha \log \alpha + (1 - \alpha) \log \frac{1 - \alpha}{M - 1}$ with $M$ being the number of classes and $H[p_{\mathrm{data}}(y)] \leq \log M$ the marginal label entropy. Eq. 11 suggests that the accuracy of an optimal classifier on $z_{\ell}$ would increase as the rate $R(z_{\geq \ell})$ accumulated from $z_{L}$ to $z_{\ell}$ grows (i.e., as $\beta_{\geq \ell} \to 0$ ), and that the rate added in downstream layers $z_{< \ell}$ would be irrelevant. Practical classifiers, however, have a limited expressiveness, which a very high rate $R(z_{\geq \ell})$ might exceed by encoding too many details into $z_{\ell}$ that are not necessary for classification. We observe in Section 5.6 that, in such cases, increasing the rates of downstream layers $z_{< \ell}$ improves classification accuracy as it allows keeping $z_{\ell}$ simpler by deferring details to $z_{< \ell}$ . + +Data Generation. The original proposal of VAEs (Kingma & Welling, 2014) motivated them from a generative modeling perspective using that, for $\beta = 1$ , the negative of the loss function in Eq. 2 is a lower bound on the log marginal data likelihood. This suggests setting all $\beta$ -hyperparameters in Eq. 8 to values close to 1 if a HVAE is used primarily for its generative model $p_{\theta}$ . + +In summary, our theoretical analysis suggests that optimally tuned layer-wise rates depend on whether a HVAE is used for data reconstruction, representation learning, or data generation. The next section tests our theoretical predictions empirically for the same three application domains. + +# 5 EXPERIMENTS + +To demonstrate the features of our hierarchical information trading framework, we run large-scale grid searches over a two-dimensional rate space using two different implementations of HVAEs and three different data sets. Although the proposed framework is applicable for HVAEs with $L \geq 2$ , we only use HVAEs with $L = 2$ in our experiments for simplicity and visualization purpose. + +# 5.1 EXPERIMENTAL SETUP + +Data sets. We used the SVHN (Netzer et al., 2011) and CIFAR-10 (Krizhevsky, 2009) data sets (both $32 \times 32$ pixel color images), and MNIST (LeCun et al., 1998) ( $28 \times 28$ binary pixel images). SVHN consists of photographed house numbers from 0 to 9, which are geometrically simpler than the 10 classes of objects from CIFAR-10 but more complex than MNIST digits. Most results shown in the main paper use SVHN; comprehensive results for CIFAR-10 and MNIST are shown in Appendix A.2 and tell a similar story except where explicitly discussed. + +Model Architectures. For the generative model (Eq. 1), we assume a (fixed) standard Gaussian prior $p(z_2) = \mathcal{N}(\mathbf{0},\mathbf{I})$ , and we use diagonal Gaussian models for $p_{\theta}(z_1|z_2) = \mathcal{N}(g_{\mu}(z_2),g_{\sigma}(z_2)^2)$ and (for SVHN and CIFAR-10) $p_{\theta}(\boldsymbol {x}|z_1) = \mathcal{N}(g_{\mu '}(z_1),\sigma_x^2\mathbf{I})$ (this is similar to, e.g., (Minnen et al., 2018)). Here, $g_{\mu}$ , $g_{\sigma}$ , and $g_{\mu '}$ , denote neural networks (see details below). Since MNIST has binary pixel values, we model it with a Bernoulli distribution for $p_{\theta}(\boldsymbol {x}|z_1) = \mathrm{Bern}(g_{\mu '}(z_1))$ . For the inference model, we also use diagonal Gaussian models for $q_{\phi}(z_2|\boldsymbol {x}) = \mathcal{N}(f_{\mu}(\boldsymbol {x}),f_{\sigma}(\boldsymbol {x})^2)$ and for $q_{\phi}(z_1|\boldsymbol {x},z_2) = \mathcal{N}(f_{\mu '}(\boldsymbol {x},z_2),f_{\sigma '}(\boldsymbol {x},z_2)^2)$ , where $f_{\mu}$ , $f_{\sigma}$ , $f_{\mu '}$ , and $f_{\sigma '}$ are again neural networks. + +We examine both LVAE (Figure 2(b)) and our generalized top-down HVAEs (GHVAEs; see Figure 2(c)), using simple network architectures with only 2 to 3 convolutional and 1 fully connected layers (see Appendix A.1 for details) so that we can scan a large rate-space efficiently. Note that we are not trying to find the new state-of-the-art HVAEs. Results for LVAE are in Appendix A.2.2. + +We trained 441 different HVAEs for each data set/model combination, scanning the rate-hyperparameters $(\beta_{2},\beta_{1})$ over a $21\times 21$ grid ranging from 0.1 to 10 on a log scale in both directions (see Figure 1 on page 2, right panels). Each model took about 2 hours to train on an RTX-2080Ti GPU ( $\sim 27$ hours in total for each data set/model combination using 32 GPUs in parallel). + +Baselines. Our proposed framework (Eq. 8) generalizes over both VAEs and $\beta$ -VAEs (Eq. 2), which we obtain in the cases $\beta_{2} = \beta_{1} = 1$ and $\beta_{2} = \beta_{1}$ , respectively. These baselines are indicated as black “o” and red “o” circles, respectively, in Figures 3, 5, 6, and 7, discussed below. + +![](images/1c4c42c90a93872fb6e0f236b3f61a0f2eed83abff381bdc063e5a789a963a64.jpg) +(a) Rate/rate/distortion surface for SVHN. + +![](images/fa307c4c48d19327bfd8b63ab3ade72a35051789cfe26259d891e72201f9cbec.jpg) +Figure 3: PSNR-rate trade-off for GHVAEs trained on SVHN and CIFAR-10. Figure (a) visualizes the same data as the left panel of (b) in 3d. Black circles “o” mark standard VAEs $(\beta_{2} = \beta_{1} = 1)$ , red circles “o” mark $\beta$ -VAEs $(\beta_{2} = \beta_{1})$ , and purple circles “o” mark optimal models along constant total rate (dashed diagonal lines) as defined in Section 5.3. Crosses point to columns in Figure 4. + +![](images/efc594af451d5c90a428abf6ccbc1617507993c82395322acd6def78eacc9fde.jpg) +(b) PSNR-rates comparison in 2d. + +Metrics. Performance metrics for the three application domains of VAEs mentioned in the introduction are introduced at the beginnings of the corresponding Sections 5.4-5.6. In addition, we evaluate the individual rates $R(\mathbf{z}_2)$ and $R(\mathbf{z}_1|\mathbf{z}_2)$ (Eq. 7), which we report in nats (i.e., to base $e$ ). + +# 5.2 THERE IS NO "ONE HVAE FITS ALL" + +Figure 1 on page 2 summarizes our results. The $21 \times 21$ GHVAEs trained with the grid of hyperparameters $\beta_{2}$ and $\beta_{1}$ map out a surface in a 3d-space spanned by suitable metrics for the three application domains (metrics defined in Sections 5.4-5.6 below). The two upper right panels map colors on this surface to $\beta_{s}$ used for training and to the resulting layer-wise rates, respectively. The lower right panels show performance landscapes and identify the optimal models for the three application domains of data reconstruction $(\triangle)$ , representation learning $(\diamond)$ , and generative modeling $(\bigcirc)$ . + +The figure shows that moving away from a conventional $\beta$ -VAE ( $\beta_{2} = \beta_{1}$ ; dashed red lines in Figure 1) allows us to find better models for a given application domain as the three application domains favor vastly different regions in $\beta$ -space. Thus, there is no single HVAE that is optimal for all tasks, and a HVAE that has been optimized for one task can perform poorly on a different task. + +# 5.3 DEFINITION OF THE OPTIMAL MODEL FOR A GIVEN TOTAL RATE + +One of the questions we study in Sections 5.4-5.6 below is: "Which allocation of rates across layers results in best model performance if we keep the total rate $R$ fixed". Unfortunately, it is difficult to keep $R$ fixed at training time since we control rates only indirectly via their Lagrange multipliers $\beta_{2}$ and $\beta_{1}$ . We instead use the following definition, illustrated in Figure 6 for a performance metric introduced in Section 5.6 below. The figure plots the performance metric over $R$ for all $21 \times 21 \beta$ -settings and highlights with purple circles "o" all points on the upper convex hull. These highlighted models are optimal for a small interval of total rates in the following sense: if we use the total rates $R$ of all "o" to partition the horizontal axis into intervals then, by definition of the convex hull, each "o" represents the model with highest performance in either the interval to its left or the one to its right. + +# 5.4 PERFORMANCE ON DATA RECONSTRUCTION + +Reconstruction is a popular task for VAEs, e.g., in the area of lossy compression (Ballé et al., 2017). We measure reconstruction quality using the common peak signal-to-noise ratio (PSNR), which is equal to $\mathbb{E}_{\mathbf{x}\sim \mathbb{X}_{\mathrm{test}}}[-\log D]$ up to rescaling and shifting. Higher PSNR means better reconstruction. + +Figure 3(a) shows a 3d-plot of PSNR as a function of both $R(z_{1}|z_{2})$ and $R(z_{2})$ for SVHN, thus generalizing the rate/distortion curve of a conventional $\beta$ -VAE to a rate/rate/distortion surface. Figure 3(b) introduces a more compact 2d-representation of the same data that we use for all remaining metrics in the rest of this section and in Appendix A.2, and it also shows results for CIFAR-10. + +![](images/0cbbac36783139b71bd9f5bcdd2e2b48d7eb88bdba24058ff5e44df54b41b594.jpg) +Figure 4: Samples (top) and reconstructions (bottom) from 3 different models (blue column labels "1", "2", and "3" from left to right correspond to crosses "1", "2", and "3" in Figures 3(b) & 5). Consistent with PSNR and IS metrics, model "1" produces poorest samples but best reconstructions. + +![](images/04e60949fcbc4a95221ae47a3229461c65133029f38e490a0b513b7d4bb77c92.jpg) +Figure 5: Sample generation performance, measured in Inception Score (IS, see Eq. 12) and its factorization into diversity and sharpness as a function of layer-wise rates for GHVAEs trained using SVHN data. Crosses in left panel correspond to samples shown in Figure 4. Markers “o”, “o”, and “o” same as in Figure 3. + +![](images/79850b69bc7432ed028f46629d440710a599d4f21ea534dc00cc3c8e58a1f3cc.jpg) +Figure 6: RBF-SVM classification accuracies on $\pmb{\mu}_{2}$ . Dashed line shows theoretical bound (Eq. 11). Other markers as in Figure 3. + +Unsurprisingly and consistent with Eq. 9, reconstruction performance improves as total rate grows. However, minimizing distortion without any constraints is not useful in practice as we can simply use the original data, which has no distortion. To simulate a practical constraint in, e.g., a data-compression application, we consider models with optimal PSNR for a given total rate $R$ (as defined in Section 5.3) which are marked as purple circles "o" in Figure 3(b). We see for both SVHN and CIFAR-10 that conventional $\beta$ -VAEs $(\beta_{2} = \beta_{1}$ ; red circles) perform somewhat suboptimal for a given total rate and can be improved by trading some rate in $z_{2}$ for some rate in $z_{1}$ . Reconstruction examples for the three models marked with crosses in Figure 3(b) are shown in Figure 4 (bottom). Visual reconstruction quality improves from "3" to "2" to "1", consistent with reported PSNRs. + +# 5.5 PERFORMANCE ON SAMPLE GENERATION + +We next evaluate how tuning layer-wise rates affects the quality of samples from the generative model. We measure sample quality by the widely used Inception Score (IS) (Salimans et al., 2016), + +$$ +\mathbf {I S} = \exp \left\{\mathbb {E} _ {p _ {\theta} (\boldsymbol {x})} \left[ D _ {\mathrm {K L}} \left[ p _ {\mathrm {c l s .}} (y | \boldsymbol {x}) \| p _ {\mathrm {c l s .}} (y) \right] \right] \right\} = e ^ {H \left[ p _ {\mathrm {c l s .}} (y) \right]} \times e ^ {- \mathbb {E} _ {p _ {\theta} (\boldsymbol {x})} \left[ H \left[ p _ {\mathrm {c l s .}} (y | \boldsymbol {x}) \right] \right]} \tag {12} +$$ + +Here, $p_{\theta}$ is the trained generative model (Eq. 1), $p_{\mathrm{cls.}}(y|\boldsymbol{x})$ is the predictive distribution of a classifier trained on the same training set, and $p_{\mathrm{cls.}}(y) \coloneqq \mathbb{E}_{p_{\theta}(\boldsymbol{x})}[p_{\mathrm{cls.}}(y|\boldsymbol{x})]$ . The second equality in Eq. 12 follows Barratt & Sharma (2018) to split IS into a product of a diversity score and a sharpness score. Higher is better for all scores. The classifier is a ResNet-18 (He et al., 2016) for SVHN (test accuracy $95.02\%$ ) and a DenseNet-121 (Huang et al., 2017) for CIFAR-10 (test accuracy $94.34\%$ ). + +Figure 5 (left) shows IS for GHVAEs trained on SVHN. Unlike the results for PSNR, here, higher rate does not always lead to better sample quality: for very high $R(\mathbf{z}_2)$ and low $R(\mathbf{z}_1|\mathbf{z}_2)$ , IS eventually drops. The region of high IS is in the area where $\beta_2 < \beta_1$ , i.e., where $R(\mathbf{z}_2)$ is higher than in a comparable conventional $\beta$ -VAE. The center and right panels of Figure 5 show diversity and sharpness, indicating that IS is mainly driven here by sharpness, which depends mostly on $R(\mathbf{z}_2)$ , possibly because $z_2$ captures higher-level concepts than $z_1$ that may be more important to the classifier in Eq. 12. Samples from the three models marked with crosses in Figure 5 are shown in Figure 4 (top). Visual sample quality improves from "1" to "3" to "2", consistent with reported IS. + +![](images/f18cceb327dfdabb7466b1b2b16084de330a09aef9136cbda8b9a2373ef02f07.jpg) +Figure 7: Mutual information (MI) $I_{q}(y;z_{2})$ and classification accuracies of four classifiers (see column labels) as a function of layer-wise rates $R(z_{2})$ and $R(z_{1}|z_{2})$ . Classifiers are conditioned on $\pmb{\mu}_{2} \coloneqq \arg \max_{\pmb{z}_{2}} q(\pmb{z}_{2}|\pmb{x})$ learned from GHVAEs trained with SVHN (top) and CIFAR-10 (bottom). Markers "o", "o", and "o" same as in Figure 3. + +# 5.6 PERFORMANCE ON REPRESENTATION LEARNING FOR DOWNSSTREAM CLASSIFICATION + +VAEs are very popular for representation learning as they map complicated high dimensional data $\mathbf{x}$ to typically lower dimensional representations $\{z_{\ell}\}$ . To measure the quality of learned representations, we train two sets of classifiers on a labeled test set for each trained HVAE, each consisting of: logistic regression, a Support Vector Machine (SVM) (Boser et al., 1992) with linear kernel, an SVM with RBF kernel, and $k$ -nearest neighbors (kNN) with $k = 5$ . One set of classifiers is conditioned on the mode $\pmb{\mu}_{2}$ of $q_{\phi}(z_2|x)$ and the other one on the mode $\pmb{\mu}_{1}$ of $q_{\phi}(z_1|z_2,\pmb{x})$ , where $z_{2} \sim q_{\phi}(z_{2}|x)$ . We use the implementations from scikit-learn (Pedregosa et al., 2011) for all classifiers. + +Figure 7 shows the classification accuracies (columns 2-5) for all classifiers trained on $\mu_{2}$ . The first column shows the mutual information $I_{q}(y;z_{2})$ , which depends mainly on $R(z_{2})$ as expected from Eq. 10. As long as the classifier is expressive enough (e.g., RBF-SVM or kNN) and the data set is simple (SVHN; top row), higher mutual information ( $\approx$ higher $R(z_{2})$ ) corresponds to higher classification accuracies, consistent with Eq. 11. But for less expres + +Table 1: Optimal classification accuracies (across all $(\beta_{2},\beta_{1})$ -settings) using either $\mu_{2}$ or $\pmb{\mu}_{1}$ + +
Data Setlog. reg.lin. SVMRBF SVMkNN
SVHN (μ2)28.43 %27.87 %77.60 %64.25 %
SVHN (μ1)45.77 %49.81 %59.28 %56.49 %
CIFAR-10 (μ2)47.36 %46.95 %53.15 %44.20 %
CIFAR-10 (μ1)43.27 %42.55 %45.60 %39.25 %
+ +sive (e.g., linear) classifiers or more complex data (CIFAR-10; bottom row), increasing $R(z_{1} \mid z_{2})$ improves classification accuracy (see purple circles "○" in corresponding panels), consistent with the discussion below Eq. 11. We see a similar effect (Table 1) for most classifier/data set combinations when replacing $\mu_{2}$ by $\mu_{1}$ , which has more information about $x$ but is also higher dimensional. + +# 6 CONCLUSIONS + +We classified the various tasks that can be performed with Variational Autoencoders (VAEs) into three application domains and argued that each domain has different trade-offs, such that a good VAE for one domain is not necessarily good for another. This observation motivated us to propose a refinement of the rate/distortion theory of VAEs that allows trading off rates across individual layers of latents in hierarchical VAEs. We showed both theoretically and empirically that the proposal indeed provides practitioners better control for tuning VAEs for the three application domains. In the future, it would be interesting to explore adaptive schedules for the Lagrange parameters $\beta$ that would make it possible to target a specific given rate for each layer in a single training run, for example by using the method proposed by Rezende & Viola (2018). + +# ACKNOWLEDGMENTS + +The authors would like to thank Johannes Zenn, Zicong Fan, Zhen Liu for their helpful discussion. Funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) under Germany's Excellence Strategy - EXC number 2064/1 - Project number 390727645. This work was supported by the German Federal Ministry of Education and Research (BMBF): Tübingen AI Center, FKZ: 01IS18039A. The authors thank the International Max Planck Research School for Intelligent Systems (IMPRS-IS) for supporting Tim Z. Xiao. + +Reproducibility Statement. All code necessary to reproduce the results in this paper is available at https://github.com/timxzz/HIT/. + +# REFERENCES + +Eirikur Agustsson and Lucas Theis. Universally quantized neural compression. Advances in Neural Information Processing Systems, 33:12367-12376, 2020. 4 +Alexander Alemi, Ben Poole, Ian Fischer, Joshua Dillon, Rif A Saurous, and Kevin Murphy. Fixing a broken elbo. In International Conference on Machine Learning, pp. 159-168. PMLR, 2018. 1, 2, 3, 4 +Alexander A Alemi, Ian Fischer, Joshua V Dillon, and Kevin Murphy. Deep variational information bottleneck. In International Conference on Learning Representations, 2017. 1, 3, 4 +Johannes Balle, Valero Laparra, and Eero P Simoncelli. End-to-end optimized image compression. In International Conference on Learning Representations, 2017. 1, 3, 7 +Johannes Balle, David Minnen, Saurabh Singh, Sung Jin Hwang, and Nick Johnston. Variational image compression with a scale hyperprior. In International Conference on Learning Representations, 2018. 2 +Shane Barratt and Rishi Sharma. A note on the inception score. arXiv preprint arXiv:1801.01973, 2018. 8 +Charles H Bennett, Peter W Shor, John A Smolin, and Ashish V Thapliyal. Entanglement-assisted capacity of a quantum channel and the reverse shannon theorem. IEEE transactions on Information Theory, 48(10):2637-2655, 2002. 4 +Bernhard E Boser, Isabelle M Guyon, and Vladimir N Vapnik. A training algorithm for optimal margin classifiers. In Proceedings of the fifth annual workshop on Computational learning theory, pp. 144-152, 1992. 9 +Rewon Child. Very deep vaes generalize autoregressive models and can outperform them on images. In International Conference on Learning Representations, 2021. 3 +Zhiwei Deng, Rajitha Navarathna, Peter Carr, Stephan Mandt, Yisong Yue, Iain Matthews, and Greg Mori. Factorized variational autoencoders for modeling audience reactions to movies. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2577-2586, 2017. 2 +Brendan J Frey and GE Hinton. Ecient stochastic source coding and an application to a bayesian network source model. Computer Journal, 1997. 4 +Ishaan Gulrajani, Kundan Kumar, Faruk Ahmed, Adrien Ali Taiga, Francesco Visin, David Vazquez, and Aaron Courville. Pixelvae: A latent variable model for natural images. In International Conference on Learning Representations, 2017. 3 +Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770-778, 2016. 8 + +Irina Higgins, Loic Matthew, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. beta-vae: Learning basic visual concepts with a constrained variational framework. In International Conference on Learning Representations, 2017. 1, 3, 4 +Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 4700-4708, 2017. 8 +Zhuxi Jiang, Yin Zheng, Huachun Tan, Bangsheng Tang, and Hanning Zhou. Variational deep embedding: an unsupervised and generative approach to clustering. In International Joint Conference on Artificial Intelligence, 2017. 1 +Diederik P Kingma and Max Welling. Auto-encoding variational bayes. In International Conference on Learning Representations, 2014. 1, 3, 4, 6 +Alex Krizhevsky. Learning multiple layers of features from tiny images. 2009. 6 +Eric Laloy, Romain Hérault, John Lee, Diederik Jacques, and Niklas Linde. Inversion using a new low-dimensional representation of complex binary geological media based on a deep neural network. Advances in water resources, 110:387-405, 2017. 1 +Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278-2324, 1998. 6 +Lars Maaloe, Marco Fraccaro, Valentin Lievin, and Ole Winther. Biva: A very deep hierarchy of latent variables for generative modeling. Advances in Neural Information Processing Systems, 32, 2019. 3 +David JC MacKay. Information theory, inference and learning algorithms. Cambridge university press, 2003. 5 +Sascha Meyen. Relation between classification accuracy and mutual information in equally weighted classification tasks. Master's thesis, Universität Hamburg, 2016. 5, 6, 17 +David Minnen, Johannes Balle, and George D Toderici. Joint autoregressive and hierarchical priors for learned image compression. Advances in Neural Information Processing Systems, 31, 2018. 3,6 +Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y. Ng. Reading digits in natural images with unsupervised feature learning. In NIPS Workshop on Deep Learning and Unsupervised Feature Learning, 2011. 6 +F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825-2830, 2011. 9 +Ali Razavi, Aaron Van den Oord, and Oriol Vinyals. Generating diverse high-fidelity images with vq-vae-2. Advances in Neural Information Processing Systems, 32, 2019. 1 +Danilo Jimenez Rezende and Fabio Viola. Taming vaes. arXiv preprint arXiv:1810.00597, 2018. 9 +Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In International conference on machine learning, pp. 1278-1286. PMLR, 2014. 1, 3 +Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. Advances in Neural Information Processing Systems, 29, 2016. 8 +Casper Kaae Sønderby, Tapani Raiko, Lars Maaløe, Søren Kaae Sønderby, and Ole Winther. Ladder variational autoencoders. Advances in Neural Information Processing Systems, 29, 2016. 3, 4 + +Hiroshi Takahashi, Tomoharu Iwata, Yuki Yamanaka, Masanori Yamada, and Satoshi Yagi. Student-t variational autoencoder for robust density estimation. In International Joint Conference on Artificial Intelligence, 2018. 1 +Naftali Tishby and Noga Zaslavsky. Deep learning and the information bottleneck principle. In 2015 IEEE information theory workshop (itw), pp. 1-5. IEEE, 2015. 1, 3 +Arash Vahdat and Jan Kautz. NVAE: A deep hierarchical variational autoencoder. Advances in Neural Information Processing Systems, 33:19667-19679, 2020. 3 +Haowen Xu, Wenxiao Chen, Nengwen Zhao, Zeyan Li, Jiahao Bu, Zhihan Li, Ying Liu, Youjian Zhao, Dan Pei, Yang Feng, et al. Unsupervised anomaly detection via variational auto-encoder for seasonal kpis in web applications. In Proceedings of the 2018 world wide web conference, pp. 187–196, 2018. 1 +Yibo Yang, Robert Bamler, and Stephan Mandt. Improving inference for neural image compression. Advances in Neural Information Processing Systems, 33:573-584, 2020. 3 +Li Yingzhen and Stephan Mandt. Disentangled sequential autoencoder. In International Conference on Machine Learning, 2018. 2 + +# A EXPERIMENT SUPPLEMENTARIES + +# A.1 IMPLEMENTATION DETAILS + +Table 2: Model architecture details for generalized top-down HVAEs (GHVAEs) used in Section 5. Conv and ConvTransp denote the convolutional and transposed convolutional layer, which has the corresponding input: input channel, output channel, kernel size, stride, padding. FC represents fully connected layer. + +
Data setq(z2|x)q(z1|z2,x)p(z1|z2)p(x|z1)
SVHN/CIFAR-10Share: +Conv(3, 32, 4, 2, 1), +Conv(32, 32, 4, 2, 1), +Conv(32, 32, 4, 2, 1)For x: +Conv(3, 32, 4, 2, 1), +Conv(32, 32, 4, 2, 1)Share: +FC(In=32, Out=256)ConvTransp(32, 32, 4, 2, 1), +ConvTransp(32, 32, 4, 2, 1), +ConvTransp(32, 3, 4, 2, 1)
For mean: +FC(In=512, Out=32)Share: +ConvTransp(64, 32, 4, 2, 1)For mean: +FC(In=256, Out=512)
For variance: +FC(In=512, Out=32)For mean: +Conv(32, 32, 3, 1, 1)For variance: +FC(In=256, Out=512)
For variance: +Conv(32, 32, 3, 1, 1)
z1 dims: 512z2 dims: 32σx=0.71Total params: 475811
MNIST (Binary)Share: +Conv(1, 16, 4, 2, 1), +Conv(16, 16, 4, 2, 1), +Conv(16, 16, 4, 1, 0)For x: +Conv(1, 16, 4, 2, 1), +Conv(16, 16, 4, 1, 0)Share: +FC(In=20, Out=128)ConvTransp(16, 16, 4, 1, 0), +ConvTransp(16, 16, 4, 2, 1), +ConvTransp(16, 1, 4, 2, 1)
For mean: +FC(In=256, Out=20)For mean: +ConvTransp(32, 16, 4, 1, 0)For mean: +FC(In=128, Out=256)
For variance: +FC(In=256, Out=20)For variance: +Conv(16, 16, 3, 1, 1)For variance: +FC(In=128, Out=256)
For variance: +Conv(16, 16, 3, 1, 1)
z1 dims: 256z2 dims: 20σx: N/ATotal params: 122713
+ +Table 3: Model architecture details for LVAEs used in Section 5. Conv and ConvTransp denote the convolutional and transposed convolutional layer, which has the corresponding input: input channel, output channel, kernel size, stride, padding. FC represents fully connected layer. + +
Data setq(z2|x)q(z1|z2,x)p(z1|z2)p(x|z1)
SVHN/CIFAR-10Share: +Conv(3, 32, 4, 2, 1), +Conv(32, 32, 4, 2, 1), +Conv(32, 32, 4, 2, 1)Involve d: +Conv(32, 32, 4, 2, 1)Share: +FC(In=32, Out=256)ConvTransp(32, 32, 4, 2, 1), +ConvTransp(32, 32, 4, 2, 1), +ConvTransp(32, 3, 4, 2, 1)
For mean: +Conv(32, 32, 3, 1, 1)For mean: +FC(In=256, Out=512)
For mean: +FC(In=512, Out=32)For variance: +Conv(32, 32, 3, 1, 1)For variance: +FC(In=256, Out=512)
For variance: +FC(In=512, Out=32)
z1 dims: 512z2 dims: 32σx=0.71Total params: 408131
+ +# A.2 ADDITIONAL RESULTS + +Here we attached the results for MNIST, as well as the full results for LVAE on SVHN and generalized top-down HVAEs on CIFAR-10. + +# A.2.1 RESULTS FOR GENERALIZED TOP-DOWN HVAES ON MNIST + +We also evaluate our proposed framework using generalized top-down HVAEs trained on binary MNIST data (i.e., black and white images rather than grayscale). + +We note that the inception score (IS) behaves different in our MNIST models compared to SVHN (see Figure 5) in that optimal IS in MNIST occurs for high $R(z_{1}|z_{2})$ rather than high $R(z_{2})$ . This indicates that semantically low-level properties (hand-writing style) of MNIST might have more variation than high level properties (the digit), whereas SVHN images show variation in additional high-level properties such as the background color. + +![](images/3a75092a0df706e6b3537eab3bbae1c02452aaf5edb12d2790b446bc00e076cb.jpg) + +![](images/54ddba93c8bff38024e2ab7ac3a82fc36e2e5177776c0496083ae2475e31abab.jpg) + +![](images/0df0c1e32d500e532543ee00242154357914208a324af1b82f454d8396ecbbef.jpg) + +![](images/718bbbdae410cb34d3510adfb0cea95b9889d2f38ce7932b6dcfe96ec6464ca9.jpg) +Figure 8: Trade-offs between rates and all metrics we used in Section 5 from the generalized top-down HVAEs trained with MNIST. The results from the standard VAE (i.e. $\beta_{2} = \beta_{1} = 1$ ) and the $\beta$ -VAE (i.e. $\beta_{2} = \beta_{1}$ ) are marked with “o” and “o”. The markers “o” highlight the optimal models selected using convex hull (see Figure 6 for details). The diagonal grid lines are references for equivalent total rates, i.e. points on the same line have the same total rates. + +![](images/9bc6239ab2750d3fb4e32c43be1919d377e79f2b60e637409d0c0c18f16727e8.jpg) + +![](images/353732bbcac5f815496e501b40c4f4557ef2129a0286ee1851e02af3dd18715f.jpg) + +![](images/9b74ffb9ed20eb415e1a02a4ec0ef0ef0030584f14534a46923009a49d0d7709.jpg) + +# A.2.2 RESULTS FOR LVAE ON SVHN + +![](images/c2e52ef26dc245d86669b0efad85fd35a8773dcbd6e06765887ec69eee76dc20.jpg) + +![](images/b15c04b205f47ae237b0702ef313bcdb9ee793d95cd0bda6049d14b2db25c8a6.jpg) + +![](images/6b22cd2efa469959fdcb32d27ed04752392da2012697d6fc1bf1cfa1d8aeb08e.jpg) + +![](images/13e2c518832e63467ccd1ebb9d48fbe4add0329c4dfbe6b32b92c2d40d286522.jpg) +Figure 9: Trade-offs between rates and all metrics we used in Section 5 from LVAE trained with SVHN. The results from the standard VAE (i.e. $\beta_{2} = \beta_{1} = 1$ ) and the $\beta$ -VAE (i.e. $\beta_{2} = \beta_{1}$ ) are marked with “o” and “o”. The markers “o” highlight the optimal models selected using convex hull (see Figure 6 for details). The diagonal grid lines are references for equivalent total rates, i.e. points on the same line have the same total rates. + +![](images/dbe1a78f36713aa2e7cd1aea31e470516d2c2683b685e5e10980c0657c529ae6.jpg) + +![](images/8d0d03ba17781e8ad3c88fdfe3043d6607b55b3d28f5b64a588df0c7f9e19cf0.jpg) + +![](images/e1eead27bcd0fe888df6e753642f1d4dd60086b6a821bee2cf6a6071b1674ada.jpg) + +# A.2.3 RESULTS FOR GENERALIZED TOP-DOWN HVAES ON CIFAR-10 + +![](images/c3d161ad51194ef2d52e5f7e093f377c37112aae08f9b4c67bcf8c28126feea8.jpg) + +![](images/ba387cb60d3d0d72e55c87dc40903fdcae732019be458d5ec9dc664595da72c0.jpg) + +![](images/20040b247de89c708b7f4f5d41664fb7a3351f03efcb75ae4610454a8056c7e8.jpg) + +![](images/96e4c3ad630ae2e6848a0d156b191fd9ca9a6841a40bbcee04c934886809c607.jpg) +Figure 10: Trade-offs between rates and all metrics we used in Section 5 from the generalized top-down HVAEs trained with CIFAR-10. The results from the standard VAE (i.e. $\beta_{2} = \beta_{1} = 1$ ) and the $\beta$ -VAE (i.e. $\beta_{2} = \beta_{1}$ ) are marked with “o” and “o”. The markers “o” highlight the optimal models selected using convex hull (see Figure 6 for details). The diagonal grid lines are references for equivalent total rates, i.e. points on the same line have the same total rates. + +![](images/b9969080345c40094ae52b4b2a04710bec5d3e03e0231678c01f576e22ae023e.jpg) + +![](images/60879077b15bd54dba31ee8e2bceb926f9ebe88fad36006d57e0b74b4beaeeef.jpg) + +![](images/d1db3e5c38cac61feee1045668132b34e9b5b09cc78cf650b8438ad6ed109077.jpg) + +# B PROOF OF THE BOUND ON CLASSIFICATION ACCURACY + +This section provides a proof of Eq. 11 by reformulating the proof of Proposition 5 in the thesis by Meyen (2016) into the notation used in the present paper. We stress that this section contains no original contribution and is provided only as a convenience to the reader, motivated by reviewer feedback. All credits for this section belong to Meyen (2016). + +We consider an (unknown) true data generative distribution $p_{\mathrm{data}}(y, \boldsymbol{x})$ for data $\boldsymbol{x}$ with (unobserved) true labels $y$ , and a hierarchical VAE with an inference model $q_{\phi}(\{\boldsymbol{z}_{\ell}\} \mid \boldsymbol{x})$ of the form of Eq. 4. Focusing on a single layer $\ell$ of latents, we denote the joint probability over $y$ , $\boldsymbol{x}$ , and $\boldsymbol{z}_{\ell}$ as + +$$ +q (y, \boldsymbol {x}, \boldsymbol {z} _ {\ell}) := p _ {\text {d a t a}} (y, \boldsymbol {x}) q _ {\phi} (\boldsymbol {z} _ {\ell} | \boldsymbol {x}) \tag {13} +$$ + +where the marginal $q_{\phi}(\pmb{z}_{\ell}|\pmb{x})$ of $q_{\phi}(\{\pmb{z}_{\ell}\}|\pmb{x})$ is defined as usual. We further consider a classifier $p_{\mathrm{cls.}}(y|\pmb{z}_{\ell})$ that operates on $\pmb{z}_{\ell}$ . Denoting its top prediction as $\hat{y} \coloneqq \arg \max_y p_{\mathrm{cls.}}(y|\pmb{z}_{\ell})$ , the classification accuracy is $\alpha \coloneqq \mathbb{E}_q[\delta_{y,\hat{y}}]$ , where $\delta$ is the Kronecker delta. + +Theorem 1. The mutual information $I_{q}(y;z_{\ell})$ between the latent representation $z_{\ell}$ and the true label $y$ under the distribution $q$ defined in Eq. 13 is lower bounded as follows, + +$$ +I _ {q} (y; \boldsymbol {z} _ {\ell}) \geq f (\alpha) \quad \text {w i t h} \quad f (\alpha) = H _ {p _ {\text {d a t a}}} [ y ] - H _ {2} (\alpha) - (1 - \alpha) \log (M - 1) \tag {14} +$$ + +where $H_{2}(\alpha) = -\alpha \log \alpha - (1 - \alpha)\log(1 - \alpha)$ is the entropy of a Bernoulli distribution, $H_{p_{data}}[y] \leq \log M$ is the marginal entropy of the true labels, and $M$ denotes the number of classes. + +Before we prove Theorem 1, we note that the function $f$ is strictly monotonically increasing on the relevant interval $[\max_y p_{\mathrm{data}}(y), 1]$ . Thus, $f$ is invertible and we obtain the following corollary: + +Corollary 1. The classification accuracy $\alpha$ is upper bounded as in Eq. 11 of the main text, i.e., + +$$ +\alpha \leq f ^ {- 1} \left(I _ {q} (y; \boldsymbol {z} _ {\ell})\right) \leq f ^ {- 1} \left(\mathbb {E} _ {p _ {\text {d a t a}} (\boldsymbol {x})} [ R (\boldsymbol {z} _ {\geq \ell}) ]\right). \tag {15} +$$ + +The second inequality in Eq. 15 results from the bound $I_{q}(y;z_{\ell}) \leq \mathbb{E}_{p_{\mathrm{data}}(\boldsymbol{x})}[R(\boldsymbol{z}_{\geq \ell})]$ derived in Eq. 10, using the fact that $f^{-1}$ is monotonically increasing (since $f$ is). + +Proof of Theorem 1. We split the mutual information into two contributions, + +$$ +I _ {q} (y; \boldsymbol {z} _ {\ell}) = H _ {p _ {\mathrm {d a t a}}} [ y ] - H _ {q} [ y | \boldsymbol {z} _ {\ell} ] = H _ {p _ {\mathrm {d a t a}}} [ y ] - \mathbb {E} _ {\boldsymbol {z} _ {\ell} \sim q (\boldsymbol {z} _ {\ell})} \left[ \mathbb {E} _ {y \sim q (y | \boldsymbol {z} _ {\ell})} [ - \log q (y | \boldsymbol {z} _ {\ell}) ] \right] \tag {16} +$$ + +where, as clarified in the second equality, $H_{q}[y|\pmb{z}_{\ell}]$ is the expectation over $\pmb{z}_{\ell}$ of the conditional entropy of $y$ given $\pmb{z}_{\ell}$ , and $q(\pmb{z}_{\ell})$ and $q(y|\pmb{z}_{\ell})$ are marginals and conditionals of $q$ (Eq. 13) as usual. + +Since $H_{p_{\mathrm{data}}}[\boldsymbol {y}]$ is fixed by the problem at hand, finding a lower bound on $I_q(y;z_\ell)$ for a given classification accuracy $\alpha$ is equivalent to finding an upper bound on the second term on the right-hand side of Eq. 16, $H_{q}[y|\boldsymbol{z}_{\ell}] = \mathbb{E}_{\boldsymbol{z}_{\ell}\sim q(\boldsymbol{z}_{\ell})}[\mathbb{E}_{y\sim q(y|\boldsymbol{z}_{\ell})}[-\log q(y|\boldsymbol{z}_{\ell})]]$ , with the constraint $\mathbb{E}_q[\delta_{y,\hat{g}}] = \alpha$ . We do this by upper bounding the conditional entropy $\mathbb{E}_{y\sim q(y|\boldsymbol{z}_{\ell})}[-\log q(y|\boldsymbol{z}_{\ell})]$ of $y$ given $\boldsymbol{z}_{\ell}$ for all $\boldsymbol{z}_{\ell}$ independently, and then taking the expectation over $\boldsymbol{z}_{\ell}\sim q(\boldsymbol{z}_{\ell})$ . + +For a fixed latent representation $\mathbf{z}_{\ell}$ , we first split off the contribution to $\mathbb{E}_{y \sim q(y|\mathbf{z}_{\ell})}[-\log q(y|\mathbf{z}_{\ell})]$ from $y = \hat{y}$ , where $\hat{y} = \arg \max_{y} p_{\mathrm{cls.}}(y|\mathbf{z}_{\ell})$ is the label that our classifier would predict for $\mathbf{z}_{\ell}$ , + +$$ +\mathbb {E} _ {y \sim q (y | \boldsymbol {z} _ {\ell})} [ - \log q (y | \boldsymbol {z} _ {\ell}) ] = - q (y = \hat {y} | \boldsymbol {z} _ {\ell}) \log q (y = \hat {y} | \boldsymbol {z} _ {\ell}) - \sum_ {y \neq \hat {y}} q (y | \boldsymbol {z} _ {\ell}) \log q (y | \boldsymbol {z} _ {\ell}). \tag {17} +$$ + +Here, the second term on the right-hand side resembles the entropy of a distribution over the remaining $(M - 1)$ labels $(y\neq \hat{y})$ , except that the probabilities sum to $(1 - q(y = \hat{y} |z_{\ell}))$ rather than one. Thus, regardless of the value of $q(y = \hat{y} |z_{\ell})$ , this term is maximized if $q(y|z_{\ell})$ distributes the remaining probability mass $(1 - q(y = \hat{y} |z_{\ell}))$ uniformly over the remaining $(M - 1)$ labels, i.e., + +$$ +\begin{array}{l} \mathbb {E} _ {y \sim q (y | \boldsymbol {z} _ {\ell})} [ - \log q (y | \boldsymbol {z} _ {\ell}) ] \leq - q (y = \hat {y} | \boldsymbol {z} _ {\ell}) \log q (y = \hat {y} | \boldsymbol {z} _ {\ell}) - (1 - q (y = \hat {y} | \boldsymbol {z} _ {\ell})) \log \frac {1 - q (y = \hat {y} | \boldsymbol {z} _ {\ell})}{M - 1} \\ = H _ {2} \left(q \left(y = \hat {y} \mid \boldsymbol {z} _ {\ell}\right)\right) + \left(1 - q \left(y = \hat {y} \mid \boldsymbol {z} _ {\ell}\right)\right) \log (M - 1). \tag {18} \\ \end{array} +$$ + +Plugging Eq. 18 back into Eq. 16, we obtain the bound + +$$ +I _ {q} (y; \boldsymbol {z} _ {\ell}) \geq H _ {p _ {\text {d a t a}}} [ y ] - \mathbb {E} _ {\boldsymbol {z} _ {\ell} \sim q (\boldsymbol {z} _ {\ell})} \left[ H _ {2} \left(q \left(y = \hat {y} \mid \boldsymbol {z} _ {\ell}\right)\right) \right] - \mathbb {E} _ {\boldsymbol {z} _ {\ell} \sim q (\boldsymbol {z} _ {\ell})} \left[ 1 - q \left(y = \hat {y} \mid \boldsymbol {z} _ {\ell}\right) \right] \log (M - 1). \tag {19} +$$ + +We arrive at the proposition (Eq. 14) by pulling the concave function $H_{2}$ out of the expectation using Jensen's inequality, and by then identifying $\mathbb{E}_{\boldsymbol{z}_{\ell}\sim q(\boldsymbol{z}_{\ell})}[q(y = \hat{y} |\boldsymbol{z}_{\ell})] = q(y = \hat{y}) = \alpha$ . \ No newline at end of file diff --git a/tradinginformationbetweenlatentsinhierarchicalvariationalautoencoders/images.zip b/tradinginformationbetweenlatentsinhierarchicalvariationalautoencoders/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..7e531cf0f574d7040f45eff547a97486d1975733 --- /dev/null +++ b/tradinginformationbetweenlatentsinhierarchicalvariationalautoencoders/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2ea97a8eb555f9ea56e1a4808eba586e600a53889be06d72f5e4414e763cf0e +size 1277193 diff --git a/tradinginformationbetweenlatentsinhierarchicalvariationalautoencoders/layout.json b/tradinginformationbetweenlatentsinhierarchicalvariationalautoencoders/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..85e7e04129acf1c5b1938c90931d0bf048404264 --- /dev/null +++ b/tradinginformationbetweenlatentsinhierarchicalvariationalautoencoders/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:54bcd45ab1eb2f0f934bf4b9fc506f2eee2e6f16a6a98191df0ffd13f695966e +size 680406 diff --git a/trainabilitypreservingneuralpruning/e056486d-504c-467f-8ebf-fb592f5e5aa1_content_list.json b/trainabilitypreservingneuralpruning/e056486d-504c-467f-8ebf-fb592f5e5aa1_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..1cf573dc20dea2c050cab9e8bb32ab956c877ea0 --- /dev/null +++ b/trainabilitypreservingneuralpruning/e056486d-504c-467f-8ebf-fb592f5e5aa1_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a44d093353c7e111f0f332b1515beb6a80987edb01f880497f6c2ae21be5dbdd +size 132305 diff --git a/trainabilitypreservingneuralpruning/e056486d-504c-467f-8ebf-fb592f5e5aa1_model.json b/trainabilitypreservingneuralpruning/e056486d-504c-467f-8ebf-fb592f5e5aa1_model.json new file mode 100644 index 0000000000000000000000000000000000000000..d0b4ee195fd753d4f395a5690455bc60c7454e00 --- /dev/null +++ b/trainabilitypreservingneuralpruning/e056486d-504c-467f-8ebf-fb592f5e5aa1_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9e0e6cfde457935872976c08086b9644e0cf89f5362cd2c422165c5f0e19d32 +size 164348 diff --git a/trainabilitypreservingneuralpruning/e056486d-504c-467f-8ebf-fb592f5e5aa1_origin.pdf b/trainabilitypreservingneuralpruning/e056486d-504c-467f-8ebf-fb592f5e5aa1_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..56000f63ad1443e74f58e3783fc4f77d7578b780 --- /dev/null +++ b/trainabilitypreservingneuralpruning/e056486d-504c-467f-8ebf-fb592f5e5aa1_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1269c038fc8977300c1c5986ff4d2d621a9f2de049f74284888d3be0c3820221 +size 1097904 diff --git a/trainabilitypreservingneuralpruning/full.md b/trainabilitypreservingneuralpruning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..0ccc1cef87caefdf93a1bc88eaeb55bae29759c0 --- /dev/null +++ b/trainabilitypreservingneuralpruning/full.md @@ -0,0 +1,501 @@ +# TRAINABILITY PRESERVING NEURAL PRUNING + +Huan Wang1 Yun Fu1,2 + +$^{1}$ Northeastern University, Boston, USA $^{2}$ AInovation Labs, Inc. + +wang.huan@northeastern.edu yunfu@ece.neu.edu + +# ABSTRACT + +Many recent works have shown trainability plays a central role in neural network pruning – unattended broken trainability can lead to severe under-performance and unintentionally amplify the effect of retraining learning rate, resulting in biased (or even misinterpreted) benchmark results. This paper introduces trainability preserving pruning (TPP), a scalable method to preserve network trainability against pruning, aiming for improved pruning performance and being more robust to retraining hyper-parameters (e.g., learning rate). Specifically, we propose to penalize the gram matrix of convolutional filters to decorrelate the pruned filters from the retained filters. In addition to the convolutional layers, per the spirit of preserving the trainability of the whole network, we also propose to regularize the batch normalization parameters (scale and bias). Empirical studies on linear MLP networks show that TPP can perform on par with the oracle trainability recovery scheme. On nonlinear ConvNets (ResNet56/VGG19) on CIFAR10/100, TPP outperforms the other counterpart approaches by an obvious margin. Moreover, results on ImageNet-1K with ResNets suggest that TPP consistently performs more favorably against other top-performing structured pruning approaches. Code: https://github.com/MingSun-Tse/TPP. + +# 1 INTRODUCTION + +Neural pruning aims to remove redundant parameters without seriously compromising the performance. It normally consists of three steps (Reed, 1993; Han et al., 2015; 2016b; Li et al., 2017; Liu et al., 2019b; Wang et al., 2021b; Gale et al., 2019; Hoefler et al., 2021; Wang et al., 2023): pretrain a dense model; prune the unnecessary connections to obtain a sparse model; retrain the sparse model to regain performance. Pruning is usually categorized into two classes, unstructured pruning (a.k.a. element-wise pruning or fine-grained pruning) and structured pruning (a.k.a. filter pruning or coarse-grained pruning). Unstructured pruning chooses a single weight as the basic pruning element; while structured pruning chooses a group of weights (e.g., 3d filter or a 2d channel) as the basic pruning element. Structured pruning fits more for acceleration because of the regular sparsity. Unstructured pruning, in contrast, results in irregular sparsity, hard to exploit for acceleration unless customized hardware and libraries are available (Han et al., 2016a; 2017; Wen et al., 2016). + +Recent papers (Renda et al., 2020; Le & Hua, 2021) report an interesting phenomenon: During retraining, a larger learning rate (LR) helps achieve a significantly better final performance, empowering the two baseline methods, random pruning and magnitude pruning, to match or beat many more complex pruning algorithms. The reason behind is argued (Wang et al., 2021a; 2023) to be related to the trainability of neural networks (Saxe et al., 2014; Lee et al., 2020; Lubana & Dick, 2021). They make two major observations to explain the LR effect mystery (Wang et al., 2023). (1) The weight removal operation immediately breaks the network trainability or dynamical isometry (Saxe et al., 2014) (the ideal case of trainability) of the trained network. (2) The broken trainability slows down the optimization in retraining, where a greater LR aids the model converge faster, thus a better performance is observed earlier – using a smaller LR can actually do as well, but needs more epochs. + +Although these works (Lee et al., 2020; Lubana & Dick, 2021; Wang et al., 2021a; 2023) provide a plausibly sound explanation, a more practical issue is how to recover the broken trainability or maintain it during pruning. In this regard, Wang et al. (2021a) proposes to apply weight orthogonalization based on QR decomposition (Trefethen & Bau III, 1997; Mezzadri, 2006) to the pruned + +![](images/c9c0b81a0d232a94b075eb4f93f052950625cc1a96261ed37d7af8a230b4eaa7.jpg) +Figure 1: Illustration of the proposed TPP algorithm on a typical residual block. Weight parameters are classified into two groups as a typical pruning algorithm does: important (white color) and unimportant (orange or blue color), right from the beginning (before any training starts) based on the filter $L_{1}$ -norms. Then only the unimportant parameters are enforced with the proposed TPP regularization terms, which is the key to maintain trainability when the unimportant weights are eventually eliminated from the network. Notably, the critical part of a regularization-based pruning algorithm lies in its specific regularization term, i.e., Eqs. (3) and (5), which we will show perform more favorably than other alternatives (see Tabs. 1 and 10). + +model. However, their method is shown to only work for linear MLP networks. On modern deep convolutional neural networks (CNNs), how to maintain trainability during pruning is still elusive. + +We introduce trainability preserving pruning (TPP), a new and novel filter pruning algorithm (see Fig. 1) that maintains trainability via a regularized training process. By our observation, the primary cause that pruning breaks trainability lies in the dependency among parameters. The primary idea of our approach is thus to decorrelate the pruned weights from the kept weights so as to "cut off" the dependency, so that the subsequent sparsifying operation barely hurts the network trainability. + +Specifically, we propose to regularize the gram matrix of weights: All the entries representing the correlation between the pruned filters (i.e., unimportant filters) and the kept filters (i.e., important filters) are encouraged to diminish to zero. This is the first technical contribution of our method. The second one lies in how to treat the other entries. Conventional dynamical isometry wisdom suggests orthogonality, namely, 1 self-correlation and 0 cross-correlation, even among the kept filters, while we find directly translating the orthogonality idea here is unnecessary or even harmful because the too strong penalty will constrain the optimization, leading to deteriorated local minimum. Rather, we propose not to impose any regularization on the correlation entries of kept filters. + +Finally, modern deep models are typically equipped with batch normalization (BN) (Ioffe & Szegedy, 2015). However, previous filter pruning papers rarely explicitly take BN into account (except two (Liu et al., 2017; Ye et al., 2018); the differences of our work from theirs will be discussed in Sec. 3.2) to mitigate the side effect when it is removed because its associated filter is removed. Since they are also a part of the whole trainable parameters in the network, unattended removal of them will also lead to severely crippled trainability (especially at large sparsity). Therefore, BN parameters (both the scale and bias included) ought to be explicitly taken into account too, when we develop the pruning algorithm. Based on this idea, we propose to regularize the two learnable parameters of BN to minimize the influence of its absence later. + +Practically, our TPP is easy to implement and robust to hyper-parameter variations. On ResNet50 ImageNet, TPP delivers encouraging results compared to many recent SOTA filter pruning methods. + +Contributions. (1) We present the first filter pruning method (trainability preserving pruning) that effectively maintains trainability during pruning for modern deep networks, via a customized weight gram matrix as regularization target. (2) Apart from weight regularization, a BN regularizer is introduced to allow for their subsequent absence in pruning – this issue has been overlooked by most previous pruning papers, although it is shown to be pretty important to preserve trainability, especially in the large sparsity regime. (3) Practically, the proposed method can easily scale to + +modern deep networks (such as ResNets) and datasets (such as ImageNet-1K (Deng et al., 2009)). It achieves promising pruning performance in the comparison to many SOTA filter pruning methods. + +# 2 RELATED WORK + +Network pruning. Pruning mainly falls into structured pruning (Li et al., 2017; Wen et al., 2016; He et al., 2017; 2018; Wang et al., 2021b) and unstructured pruning (Han et al., 2015; 2016b; LeCun et al., 1990; Hassibi & Stork, 1993; Singh & Alistarh, 2020), according to the sparsity structure. For more comprehensive coverage, we recommend surveys (Sze et al., 2017; Cheng et al., 2018; Deng et al., 2020; Hoefler et al., 2021; Wang et al., 2022). This paper targets structured pruning (filter pruning, to be specific) because it is more imperative to make modern networks (e.g., ResNets (He et al., 2016)) faster rather than smaller compared to the early single-branch convolutional networks. + +It is noted that random pruning of a normally-sized (i.e., not severely over-parameterized) network usually leads to significant performance drop. We need to cleverly choose some unimportant parameters to remove. Such a criterion for choosing is called pruning criterion. In the area, there have been two major paradigms to address the pruning criterion problem dating back to the 1990s: regularization-based methods and importance-based (a.k.a. saliency-based) methods (Reed, 1993). + +Specifically, the regularization-based approaches choose unimportant parameters via a sparsity-inducing penalty term (e.g., Wen et al. (2016); Yang et al. (2020); Lebedev & Lempitsky (2016); Louizos et al. (2018); Liu et al. (2017); Ye et al. (2018); Zhang et al. (2021a; 2022; 2021b)). This paradigm can be applied to a random or pretrained network. Importance-based methods choose unimportant parameters via an importance formula, derived from the Taylor expansion of the loss function (e.g., LeCun et al. (1990); Hassibi & Stork (1993); Han et al. (2015; 2016b); Li et al. (2017); Molchanov et al. (2017; 2019)). This paradigm is majorly applied to a pretrained network. Despite the differences, it is worth noting that these two paradigms are not firmly unbridgeable. We can develop approaches that take advantage of both ideas, such as Ding et al. (2018); Wang et al. (2019; 2021b) – these methods identify unimportant weights per a certain importance criterion; then, they utilize a penalty term to produce sparsity. Our TPP method in this paper is also in this line. + +Trainability, dynamical isometry, and orthogonality. Trainability describes the easiness of optimization of a neural network. Dynamical isometry, the perfect case of trainability, is first introduced by Saxe et al. (2014), stating that singular values of the Jacobian matrix are close to 1. It can be achieved (for linear MLP models) by the orthogonality of weight matrix at initialization. Recent works on this topic mainly focus on how to maintain dynamical isometry during training instead of only for initialization (Xie et al., 2017; Huang et al., 2018; Bansal et al., 2018; Huang et al., 2020; Wang et al., 2020). These methods are developed independent of pruning, thus not directly related to our proposed approach. However, the insights from these works inspire us to our method (see Sec. 3.2) and possibly more in the future. Several pruning papers study the network trainability issue in the context of network pruning, such as Lee et al. (2020); Lubana & Dick (2021); Vysogorets & Kempe (2021). These works mainly discuss the trainability issue of a randomly initialized network. In contrast, we focus on the pruning case of a pretrained network. + +# 3 METHODOLOGY + +# 3.1 PREREQUISITES: DYNAMICAL ISOMETRY AND ORTHOGONALITY + +The definition of dynamical isometry is that the Jacobian of a network has as many singular values (JSVs) as possible close to 1 (Saxe et al., 2014). With it, the error signal can preserve its norm during propagation without serious amplification or attenuation, which in turn helps the convergence of (very deep) networks. For a single fully-connected layer $W$ , a sufficient and necessary condition to realize dynamical isometry is orthogonality, i.e., $W^{\top}W = I$ , + +$$ +\mathbf {y} = W \mathbf {\bar {x}}, +$$ + +$$ +\left| \left| \mathbf {y} \right| \right| = \sqrt {\mathbf {y} ^ {\top} \mathbf {y}} = \sqrt {\mathbf {x} ^ {\top} W ^ {\top} W \mathbf {x}} = \left| \left| \mathbf {x} \right| \right|, i f f. W ^ {\top} W = I, \tag {1} +$$ + +where $I$ represents the identity matrix. Orthogonality of a weight matrix can be easily realized by matrix orthogonalization techniques such as QR decomposition (Trefethen & Bau III, 1997; Mezzadri, 2006). Exact (namely all the Jacobian singular values are exactly 1) dynamical isometry + +![](images/2c3327ef6d6ffed9b629fae658c1b9bb616acd19fe50bd54a00bf98a250e8330.jpg) +(a) Kernel orthogonality + +![](images/01652e3ce2dc61c5301d34ee41050dadd07d1afca7809ebf13787626c06ea1ec.jpg) +(b) Kernel orthogonality for pruning + +![](images/f9d02e9e62032ceceb121be59aa8e676840daab30e41e614c010e3dd35a1730d.jpg) +(c) De-correlate pruned from kept +Figure 2: Regularization target comparison between the proposed scheme (c) and similar counterparts (a) and (b). Green part stands for zero entries. Index 1 to N denotes the filter indices. In (b, c), filter 2 and N are the unimportant filters to be removed. (a) Regularization target of pure kernel orthogonality (an identity matrix), no pruning considered. (b) Regularization target of directly applying the weight orthogonality to filter pruning. (c) Regularization target of the proposed weight de-correlation solution in TPP: only regularize the filters to be removed, leave the others unconstrained. This scheme maintains trainability while imposing the least constraint on the weights. + +can be achieved for linear networks since multiple linear layers essentially reduce to a single 2d weight matrix. In contrast, the convolutional and non-linear cases are much complicated. Previous work (Wang et al., 2023) has shown that merely considering convolution or ReLU (Nair & Hinton, 2010) renders the weight orthogonalization method much less effective in terms of recovering dynamical isometry after pruning, let alone considering modern deep networks with BN (Ioffe & Szegedy, 2015) and residuals (He et al., 2016). The primary goal of our paper is to bridge this gap. + +Following the seminal work of Saxe et al. (2014), several papers propose to maintain orthogonality during training instead of sorely for the initialization. There are primarily two groups of orthogonalization methods for CNNs: kernel orthogonality (Xie et al., 2017; Huang et al., 2018; 2020) and orthogonal convolution (Wang et al., 2020), + +$$ +K K ^ {\top} = I \Rightarrow \mathcal {L} _ {\text {o r t h}} = K K ^ {\top} - I, \triangleleft \text {k e r n e l o r t h o g o n a l i t y} \tag {2} +$$ + +$$ +\mathcal {K K} ^ {\top} = I \Rightarrow \mathcal {L} _ {\text {o r t h}} = \mathcal {K K} ^ {\top} - I. \triangleleft \text {o r t h o g o n a l c o n v o l u t i o n} +$$ + +Clearly the difference lies in the weight matrix $K$ vs. $\mathcal{K}$ : (1) $K$ denotes the original weight matrix in a convolutional layer. Weights of a CONV layer make up a 4d tensor $\mathbb{R}^{N\times C\times H\times W}$ ( $N$ stands for the output channel number, $C$ for the input channel number, $H$ and $W$ for the height and width of the CONV kernel). Then, $K$ is a reshaped version of the 4d tensor: $K\in \mathbb{R}^{N\times CHW}$ (if $N < CHW$ ; otherwise, $K\in \mathbb{R}^{CHW\times N}$ ). (2) In contrast, $\mathcal{K}\in \mathbb{R}^{NH_{fo}W_{fo}\times CH_{fi}W_{fi}}$ stands for the doubly block-Toeplitz representation of $K$ ( $H_{fo}$ stands for the output feature map height, $H_{fi}$ for the input feature map height. $W_{fo}$ and $W_{fi}$ can be inferred the same way for width). + +Wang et al. (2020) have shown that orthogonal convolution is more effective than kernel orthogonality (Xie et al., 2017) in that the latter is only a necessary but insufficient condition of the former. In this work, we will evaluate both methods to see how effective they are in recovering trainability. + +# 3.2 TRAINABILITY PRESERVING PRUNING (TPP) + +Our TPP method has two parts. First, we explain how we come up with the proposed scheme and how it intuitively is better than the straight idea of directly applying orthogonality regularization methods (Xie et al., 2017; Wang et al., 2020) here. Second, a batch normalization regularizer is introduced given the prevailing use of BN as a standard component in deep CNNs nowadays. + +(1) Trainability vs. orthogonality. From previous works (Lee et al., 2020; Lubana & Dick, 2021; Wang et al., 2021a; 2023), we know recovering the broken trainability (or dynamical isometry) impaired by pruning is very important. Considering orthogonality regularization can encourage isometry, a pretty straightforward solution is to build upon the existing weight orthogonality regularization schemes. Specifically, kernel orthogonality regularizes the weight gram matrix towards an identity matrix (see Fig. 2(a)). In our case, we aim to remove some filters, so naturally we can regularize the weight gram matrix to be close to a partial identity matrix, with the diagonal entries at the pruned filters zeroed (see Fig. 2(b); note the diagonal green zeros). + +The above scheme is simple and straightforward. However, it is not in the best shape by our empirical observation. It imposes too strong unnecessary constraint on the remaining weights, which will in turn hurt the optimization. Therefore, we propose to seek a weaker constraint, not demanding the perfect trainability (i.e., exact isometry realized by orthogonality), but only a benign status, which describes a state of the neural network where gradients can flow effectively through the model without being interrupted. Orthogonality requires the Jacobian singular values to be exactly 1; in contrast, a benign trainability only requires them not to be extremely large or small so that the network can be trained normally. To this end, we propose to decorrelate the kept filters from the pruned ones: in the target gram matrix, all the entries associated with the pruned filters are zero; all the other entries stay as they are (see Fig. 2(c)). This scheme will be empirically justified (Tab. 3). + +Specifically, all the filters in a layer are sorted based on their $L_{1}$ -norms. Then, we consider those with the smallest $L_{1}$ norms as unimportant filters (the $S_{l}$ below) (so the proposed method also falls into the magnitude-based pruning method group). Then, the proposed regularization term is, + +$$ +\mathcal {L} _ {1} = \sum_ {l = 1} ^ {L} \left| \left| W _ {l} W _ {l} ^ {\top} \odot \left(\mathbf {1} - \mathbf {m m} ^ {\top}\right) \right| \right| _ {F} ^ {2}, \mathbf {m} _ {j} = 0 \text {i f} j \in S _ {l}, \text {e l s e} 1, \tag {3} +$$ + +where $W$ refers to the weight matrix; $\mathbf{1}$ represents the matrix full of 1; $\mathbf{m}$ is a 0/1-valued column mask vector; $\odot$ is the Hadamard (element-wise) product; and $\left\| \cdot \right\|_{F}$ denotes the Frobenius norm. + +(2) BN regularization. Per the idea of preserving trainability, BN is not ignorable since BN layers are also trainable. Removing filters will change the internal feature distributions. If the learned BN statistics do not change accordingly, the error will accumulate and result in deteriorated performance (especially for deep networks). Consider the following BN formulation (Ioffe & Szegedy, 2015), + +$$ +f = \gamma \frac {W * X - \mu}{\sqrt {\sigma^ {2} + \epsilon}} + \beta , \tag {4} +$$ + +where $*$ stands for convolution; $\mu/\sigma^2$ refers to the running mean/variance; $\epsilon$ , a small number, is used for numerical stability. The two learnable parameters are $\gamma$ and $\beta$ . Although unimportant weights are enforced with regularization for sparsity, their magnitude can barely be exact zero, making the subsequent removal of filters biased. This will skew the feature distribution and render the BN statistics inaccurate. Using these biased BN statistics will be improper and damages trainability. To mitigate such influence from BN, we propose to regularize both the $\gamma$ and $\beta$ of pruned feature map channels to zero, which gives us the following BN penalty term, + +$$ +\mathcal {L} _ {2} = \sum_ {l = 1} ^ {L} \sum_ {j \in S _ {l}} \gamma_ {j} ^ {2} + \beta_ {j} ^ {2}. \tag {5} +$$ + +The merits of BN regularization will be justified in our experiments (Tab. 4). + +To sum, with the proposed regularization terms, the total error function is + +$$ +\mathcal {E} = \mathcal {L} _ {c l s} + \frac {\lambda}{2} \left(\mathcal {L} _ {1} + \mathcal {L} _ {2}\right), \tag {6} +$$ + +where $\mathcal{L}_{cls}$ means the original classification loss. The coefficient $\lambda$ grows by a predefined constant $\Delta$ per $K_{u}$ iterations (up to a ceiling $\tau$ ) during training to ensure the pruned parameters are rather close to zero (inspired by Wang et al. (2019; 2021b)). See Algorithm 1 in Appendix for more details. + +Discussion. Prior works (Liu et al., 2017; Ye et al., 2018) also study regularizing BN for pruning. Our BN regularization method is starkly different from theirs. (1) In terms of the motivation or goal, Liu et al. (2017); Ye et al. (2018) regularize $\gamma$ to learn unimportant filters, namely, regularizing BN is to indirectly decide which filters are unimportant. In contrast, in our method, unimportant filters are decided by their $L_{1}$ -norms. We adopt BN regularization for a totally different consideration - to mitigate the side effect of breaking trainability, which is not mentioned at all in their works. (2) In terms of specific technique, Liu et al. (2017); Ye et al. (2018) only regularize the multiplier factor $\gamma$ (because it is enough to decide which filters are unimportant) while we regularize both the learnable parameters because only regularizing one still misses a few trainable parameters. Besides, we employ different regularization strength for different parameters (by the group of important filters vs. unimportant filters), while Liu et al. (2017); Ye et al. (2018) simply adopt a uniform penalty + +![](images/6cb43d91fc7dc8d7c27a1efb3d298817f0863cc821ab725a7550a3d5e0bf0cd5.jpg) +91.36/90.54/0.0040 +(a) $L_{1}$ + +![](images/43280cc0ee3884517fd039696f480bb28e27935c296157304006d57e1199ece5.jpg) +92.79/92.77/1.0000 +(b) $L_{1} + \mathrm{OrthP}$ +Figure 3: Mean Jacobian singular value (JSV) and test accuracy during retraining with different setups (network: MLP-7-Linear, dataset: MNIST). Below each plot are, in order, the best accuracy of LR 1e-2, the best accuracy of LR 1e-3, and the mean JSV right after pruning (i.e., without retraining). LR 1e-2 and 1e-3 are short for two retraining LR schedules: {init LR 1e-2, decay at epoch 30/60, epochs:90}, {init LR 1e-3, decay at epoch 45, epochs:90}. The accuracies are averaged by 5 random runs. For reference, the unpruned model has mean JSV 2.4987, test accuracy 92.77. + +![](images/3c2d43e908a08000ef2d82b2f470b33cb5b09284a0982f51fb6d88f77b05fb38.jpg) +92.82 / 92.77 / 3.4875 +(c) TPP (ours) + +strength for all parameters – this is another key difference because regularizing all parameters (including those that are meant to be retained) will damage trainability, which is exactly what we want to avoid. In short, in terms of either general motivation or specific technical details, our proposed BN regularization is distinct from previous works (Liu et al., 2017; Ye et al., 2018). + +# 4 EXPERIMENTS + +Networks and datasets. We first present some analyses with MLP-7-Linear network on MNIST (LeCun et al., 1998). Then compare our method to other plausible solutions with the ResNet56 (He et al., 2016) and VGG19 (Simonyan & Zisserman, 2015) networks, on the CIFAR10 and 100 datasets (Krizhevsky, 2009), respectively. Next we evaluate our algorithm on ImageNet1K (Deng et al., 2009) with ResNet34 and ResNet50 (He et al., 2016). Finally, we present ablation studies to show the efficacy of two main technical novelties in our approach. On ImageNet, we use public torchvision models (Paszke et al., 2019) as the unpruned models for fair comparison with other papers. On other datasets, we train our own base models with comparable accuracies reported in their original papers. See the Appendix (Tab. 5) for concrete training settings. + +Comparison methods. We compare with Wang et al. (2021a), which proposes a method, OrthP, to recover broken trainability after pruning pretrained models. Furthermore, since weight orthogonality is closely related to network trainability and there have been plenty of orthogonality regularization approaches (Xie et al., 2017; Wang et al., 2020; Huang et al., 2018; 2020; Wang et al., 2020), a straightforward solution is to combine them with $L_{1}$ pruning (Li et al., 2017) to see whether they can help maintain or recover the broken trainability. Two plausible combination schemes are easy to see: 1) apply orthogonality regularization methods before $L_{1}$ pruning, 2) apply orthogonality regularization methods after $L_{1}$ pruning, i.e., in retraining. Two representative orthogonality regularization methods are selected because of their proved effectiveness: kernel orthogonality (KernOrth) (Xie et al., 2017) and convolutional orthogonality (OrthConv) (Wang et al., 2020), so in total there are four combinations: $L_{1} + \text{KernOrth}$ , $L_{1} + \text{OrthConv}$ , $\text{KernOrth} + L_{1}$ , $\text{OrthConv} + L_{1}$ . + +Comparison metrics. (1) We examine the final test accuracy after retraining with the similar FLOPs budget – this is currently the most prevailing metric to compare different filter pruning methods in classification. Concretely, we compare two settings: a relatively large retraining LR (1e-2) and a small one (1e-3). We introduce these settings because previous works (Renda et al., 2020; Le & Hua, 2021; Wang et al., 2021a; 2023) have showed that retraining LR has a great impact on the final performance. From this metric, we can see how sensitive different methods are to the retraining LR. (2) We also compare the test accuracy before retraining – from this metric, we will see how robust different methods are in the face of weight removal. + +Table 1: Test accuracy (\%) comparison among different isometry maintenance or recovery methods on ResNet56 on CIFAR10. Scratch stands for training from scratch. KernOrth means Kernel Orthogonalization (Xie et al., 2017); OrthConv means Convolutional Orthogonalization (Wang et al., 2020). Two retraining LR schedules are evaluated here: initial LR $1\mathrm{e}-2$ vs. $1\mathrm{e}-3$ . Acc. diff. refers to the accuracy gap of LR $1\mathrm{e}-3$ against LR $1\mathrm{e}-2$ . + +
ResNet56 on CIFAR10: Unpruned acc. 93.78%, Params: 0.85M, FLOPs: 0.25G
Layerwise PR0.30.50.70.90.95
Sparsity/Speedup31.14%/1.45×49.82%/1.99×70.57%/3.59×90.39%/11.41×95.19%/19.31×
InitialretrainingLR 1e-2
Scratch93.16 (0.16)92.78 (0.23)92.11 (0.12)88.36 (0.20)84.60 (0.14)
L1(Li et al., 2017)93.79 (0.06)93.51 (0.07)92.26 (0.17)86.75 (0.31)83.03 (0.07)
L1+ OrthP (Wang et al., 2021a)93.69 (0.02)93.36 (0.19)91.96 (0.06)86.01 (0.34)82.62 (0.05)
L1+ KernOrth (Xie et al., 2017)93.49 (0.04)93.30 (0.19)91.71 (0.14)84.78 (0.34)80.87 (0.47)
L1+ OrthConv (Wang et al., 2020)92.54 (0.09)92.41 (0.07)91.02 (0.16)84.52 (0.27)80.23 (1.19)
KernOrth (Xie et al., 2017) + L193.49 (0.07)92.82 (0.10)90.54 (0.25)85.47 (0.20)79.48 (0.81)
OrthConv (Wang et al., 2020) + L193.63 (0.17)93.28 (0.20)92.27 (0.13)86.70 (0.07)83.21 (0.61)
TPP (ours)93.81 (0.11)93.46 (0.06)92.35 (0.12)89.63 (0.10)85.86 (0.08)
InitialretrainingLR 1e-3
L1(Li et al., 2017)93.43 (0.06)93.12 (0.10)91.77 (0.11)87.57 (0.09)83.10 (0.12)
TPP (ours)93.54 (0.08)93.32 (0.11)92.00 (0.08)89.09 (0.10)85.47 (0.22)
Acc. diff. (L1)-0.38-0.40-0.50+0.82+0.07
Acc. diff. (TPP)-0.27-0.14-0.35-0.54-0.39
+ +# 4.1 ANALYSIS: MLP-7-LINEAR ON MNIST AND RESNET56 ON CIFAR10 + +MLP-7-Linear is a seven-layer linear MLP. It is adopted in Wang et al. (2021a) for analysis because linear MLP is the only network that can achieve exact dynamical isometry (all JSVs are exactly 1) so far. Their proposed dynamical isometry recovery method, OrthP (Wang et al., 2021a), is shown to achieve exact isometry on linear MLP networks. Since we claim our method TPP can maintain dynamical isometry too, conceivably, our method should play a similar role to OrthP in pruning. To confirm this, we prune the MLP-7-Linear network with our method. + +TPP can perform as well as OrthP on linear MLP. In Fig. 3, (b) is the one equipped with OrthP, which can exactly recover dynamical isometry (note its mean JSV right after pruning is 1.0000), so it works as the oracle here. (1) OrthP improves the best accuracy from 91.36/90.54 to 92.79/92.77. Using TPP, we obtain 92.81/92.77. Namely, in terms of accuracy, our method is as good as the oracle scheme. (2) Note the mean JSV right after pruning - the $L_{1}$ pruning destroys the mean JSV from 2.4987 to 0.0040, and OrthP brings it back to 1.0000. In comparison, TPP achieves 3.4875, at the same order of magnitude of 1.0000, also as good as OrthP. These demonstrate, in terms of either the final evaluation metric (test accuracy) or the trainability measure (mean JSV), our TPP performs as well as the oracle method OrthP on the linear MLP. + +Loss surface analysis with ResNet56 on CIFAR10. We further analyze the loss surfaces (Li et al., 2018) of pruned networks (before retraining) by different methods. Our result (due to limited space, we defer this result to Appendix; see Fig. 4) suggests that the loss surface of our method is flatter than other methods, implying the loss landscape is easier for optimization. + +# 4.2 RESNET56 ON CIFAR10 / VGG19 ON CIFAR100 + +Here we compare our method to other plausible solutions on the CIFAR datasets (Krizhevsky, 2009) with non-linear convolutional architectures. The results in Tab. 1 (for CIFAR10) and Tab. 10 (for CIFAR100, deferred to Appendix due to limited space here) show that, + +(1) OrthP does not work well $-L_{1} + \mathrm{OrthP}$ underperforms the original $L_{1}$ under all the five pruning ratios for both ResNet56 and VGG19. This further confirms the weight orthogonalization method proposed for linear networks indeed does not generalize to non-linear CNNs. +(2) For KernOrth vs. OrthConv, the results look mixed – OrthConv is generally better when applied before the $L_{1}$ pruning. This is reasonable since OrthConv is shown more effective than KernOrth in enforcing more isometry (Wang et al., 2020), which in turn can stand more damage of pruning. +(3) Of particular note is that, none of the above five methods actually outperform the $L_{1}$ pruning or the simple scratch training. It means that neither enforcing more isometry before pruning nor + +Table 2: Comparison on ImageNet-1K validation set. *Advanced training recipe (such as cosine LR schedule) is used; we single them out for fair comparison. + +
MethodModelUnpruned top-1 (%)Pruned top-1 (%)Top-1 drop (%)Speedup
L1(pruned-B) (Li et al., 2017)73.2372.171.061.32×
L1(pruned-B, reimpl.) (Wang et al., 2023)73.3173.67-0.361.32×
Taylor-FO (Molchanov et al., 2019)ResNet3473.3172.830.481.29×
GReg-2 (Wang et al., 2021b)73.3173.61-0.301.32×
TPP (ours)73.3173.77-0.461.32×
ProvableFP (Liebenwein et al., 2020)76.1375.210.921.43×
MetaPruning (Liu et al., 2019a)ResNet5076.676.20.41.37×
GReg-1 (Wang et al., 2021b)76.1376.27-0.141.49×
TPP (ours)76.1376.44-0.311.49×
IncReg (Wang et al., 2019)75.6072.473.132.00×
SFP (He et al., 2018)76.1574.611.541.72×
HRank (Lin et al., 2020)76.1574.981.171.78×
Taylor-FO (Molchanov et al., 2019)76.1874.501.681.82×
Factorized (Li et al., 2019)76.1574.551.602.33×
DCP (Zhuang et al., 2018)ResNet5076.0174.951.062.25×
CCP-AC (Peng et al., 2019)76.1575.320.832.18×
GReg-2 (Wang et al., 2021b)76.1375.360.772.31×
CC (Li et al., 2021)76.1575.590.562.12×
MetaPruning (Liu et al., 2019a)76.675.41.22.00×
TPP (ours)76.1375.600.532.31×
LFPC (He et al., 2020)76.1574.461.692.55×
GReg-2 (Wang et al., 2021b)ResNet5076.1374.931.202.56×
CC (Li et al., 2021)76.1574.541.612.68×
TPP (ours)76.1375.121.012.56×
IncReg (Wang et al., 2019)75.6071.074.533.00×
Taylor-FO (Molchanov et al., 2019)ResNet5076.1871.694.493.05×
GReg-2 (Wang et al., 2021b)76.1373.902.233.06×
TPP (ours)76.1374.511.623.06×
MethodNetworkTop-1 (%)FLOPs (G)
CHEX* (Hou et al., 2022)77.42
CHEX* (Hou et al., 2022)ResNet5076.01
TPP* (ours)77.752
TPP* (ours)76.521
+ +compensating isometry after pruning can help recover trainability. In stark contrast, our TPP method outperforms $L_{1}$ pruning and scratch consistently against different pruning ratios (only one exception is pruning ratio 0.7 on ResNet56, but our method is still the second best and the gap to the best is only marginal: 93.46 vs. 93.51). Besides, note that the accuracy trend – in general, with a larger sparsity ratio, TPP beats $L_{1}$ or Scratch by a more pronounced margin. This is because, ar a larger pruning ratio, the trainability is impaired more, where our method can help more, thus harvesting more performance gains. We will see similar trends many times. + +(4) In Tabs. 1 and 10, we also present the results when the initial retraining LR is $1 \mathrm{e} - 3$ . Wang et al. (2021a) argue that if the broken dynamical isometry can be well maintained/recovered, the final performance gap between LR $1 \mathrm{e} - 2$ and $1 \mathrm{e} - 3$ should be diminished. Now that TPP is claimed to be able to maintain trainability, the performance gap should become smaller. This is empirically verified in the table. In general, the accuracy gap between LR $1 \mathrm{e} - 2$ and LR $1 \mathrm{e} - 3$ of TPP is smaller than that of $L_{1}$ pruning. Two exceptions are PR 0.9/0.95 on ResNet56: LR $1 \mathrm{e} - 3$ is unusually better than LR $1 \mathrm{e} - 2$ for $L_{1}$ pruning. Despite them, the general picture is that the accuracy gap between LR $1 \mathrm{e} - 3$ and $1 \mathrm{e} - 2$ turns smaller with TPP. This is a sign that trainability is effectively maintained. + +# 4.3 IMAGENET BENCHMARK + +We further evaluate TPP on ImageNet-1K (Deng et al., 2009) in comparison to many existing filter pruning algorithms. Results in Tab. 2 show that TPP is consistently better than the others across different speedup ratios. Moreover, under larger speedups, the advantage of our method is usually more evident. E.g., TPP outperforms Taylor-FO (Molchanov et al., 2019) by $1.15\%$ in terms of the top-1 acc. drop at the $2.31 \times$ speedup track; at $3.06 \times$ speedup, TPP leads Taylor-FO (Molchanov et al., 2019) by $2.87\%$ . This shows TPP is more robust to more aggressive pruning. The reason is easy to see - more aggressive pruning hurts trainability more (Lee et al., 2019; Wang et al., 2023), where our method can find more use, in line with the observations on CIFAR (Tabs. 1 and 10). + +Table 3: Test accuracy (without retraining) comparison between two plausible schemes diagonal vs. decorrelate in our TPP method. + +
ResNet56 on CIFAR10: Unpruned acc. 93.78%, Params: 0.85M, FLOPs: 0.25G
Layerwise PR0.30.50.70.90.95
TPP (diagonal)92.67 (0.29)91.97 (0.02)90.21 (0.23)23.23 (5.19)14.23 (1.42)
TPP (decorrelate)92.74 (0.16)92.07 (0.05)89.95 (0.26)30.35 (4.69)17.33 (0.50)
VGG19 on CIFAR100: Unpruned acc. 74.02%, Params: 20.08M, FLOPs: 0.80G
Layerwise PR0.10.30.50.70.9
TPP (diagonal)68.70 (0.18)64.55 (0.14)55.66 (0.73)13.76 (0.53)1.00 (0.00)
TPP (decorrelate)72.43 (0.12)69.31 (0.11)62.59 (0.14)18.97 (1.25)1.00 (0.00)
+ +Table 4: Test accuracy (without retraining) comparison w.r.t. the proposed weight gram matrix regularization and BN regularization. PR stands for layerwise pruning ratio. + +
ResNet56 on CIFAR10: Unpruned acc. 93.78%, Params: 0.85M, FLOPs: 0.25G
Gram RegBN RegPR = 0.3PR = 0.5PR = 0.7PR = 0.9PR = 0.95
✓✓92.94 (0.14)92.48 (0.19)90.48 (0.09)70.53 (1.69)23.05 (2.61)
✓X92.79 (0.03)92.23 (0.08)90.46 (0.21)44.25 (2.46)16.52 (0.43)
X✓92.40 (0.30)91.95 (0.04)90.26 (0.23)26.79 (2.19)10.50 (0.63)
VGG19 on CIFAR100: Unpruned acc. 74.02%, Params: 20.08M, FLOPs: 0.80G
Gram RegBN RegPR = 0.1PR = 0.3PR = 0.5PR = 0.7PR = 0.9
✓✓73.44 (0.07)71.61 (0.12)69.28 (0.25)65.15 (0.20)2.84 (1.13)
✓X73.01 (0.13)71.26 (0.19)68.67 (0.10)61.70 (0.46)1.75 (0.38)
X✓71.97 (0.23)70.26 (0.61)68.40 (0.30)2.10 (0.27)1.02 (0.03)
+ +We further compare to more strong pruning methods. Notably, DMCP (Guo et al., 2020), LeGR (Chin et al., 2020), EagleEye (Li et al., 2020), and CafeNet (Su et al., 2021) have been shown outperformed by CHEX (Hou et al., 2022) (see their Tab. 1) with ResNet50 on ImageNet. Therefore, here we only compare to CHEX. Following CHEX, we employ more advanced training recipe (e.g., cosine LR schedule) referring to TIMM (Wightman et al., 2021). Results in Tab. 2 suggest that our method surpasses CHEX at different FLOPs. + +# 4.4 ABLATION STUDY + +This section presents ablation studies to demonstrate the merits of TPP's two major innovations: (1) We propose not to over-penalize the kept weights in orthogonalization (i.e., (c) vs. (b) in Fig. 2). (2) We propose to regularize the two learnable parameters in BN. + +The results are presented in Tabs. 3 and 4, where we compare the accuracy right after pruning (i.e., without retraining). We have the following major observations: (1) Tab. 3 shows using decorrelate (Fig. 2(c)) is better than using diagonal (Fig. 2(b)), generally speaking. Akin to Tabs. 1 and 10, at a greater sparsity ratio, the advantage of decorrelate is more pronounced, except for too large sparsity (0.95 for ResNet56, 0.9 for VGG19) because too large sparsity will break the trainability beyond repair. (2) For BN regularization, in Tab. 4, when it is switched off, the performance degrades. It also poses the similar trend: BN regularization is more helpful under the larger sparsity. + +# 5 CONCLUSION + +Trainability preserving is shown to be critical in neural network pruning, while few works have realized it on the modern large-scale non-linear deep networks. Towards this end, we present a new filter and novel pruning method named trainability preserving pruning (TPP) based on regularization. Specifically, we propose an improved weight gram matrix as regularization target, which does not unnecessarily over-penalize the retained important weights. Besides, we propose to regularize the BN parameters to mitigate its damage to trainability. Empirically, TPP performs as effectively as the ground-truth trainability recovery method and is more effective than other counterpart approaches based on weight orthogonality. Furthermore, on the standard ImageNet-1K benchmark, TPP also matches or even beats many recent SOTA filter pruning approaches. As far as we are concerned, TPP is the first approach that explicitly tackles the trainability preserving problem in structured pruning that easily scales to the large-scale datasets and networks. + +# REFERENCES + +Nitin Bansal, Xiaohan Chen, and Zhangyang Wang. Can we gain more from orthogonality regularizations in training deep networks? In NeurIPS, 2018. 3 +Tianlong Chen, Xuxi Chen, Xiaolong Ma, Yanzhi Wang, and Zhangyang Wang. Coarsening the granularity: Towards structurally sparse lottery tickets. In ICML, 2022. 21 +Yu Cheng, Duo Wang, Pan Zhou, and Tao Zhang. Model compression and acceleration for deep neural networks: The principles, progress, and challenges. IEEE Signal Processing Magazine, 35 (1):126-136, 2018. 3 +Ting-Wu Chin, Ruizhou Ding, Cha Zhang, and Diana Marculescu. Towards efficient model compression via learned global ranking. In CVPR, 2020. 9 +Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, 2009. 3, 6, 8 +Lei Deng, Guoqi Li, Song Han, Luping Shi, and Yuan Xie. Model compression and hardware acceleration for neural networks: A comprehensive survey. Proceedings of the IEEE, 108(4): 485-532, 2020. 3 +Xiaohan Ding, Guiguang Ding, Jungong Han, and Sheng Tang. Auto-balanced filter pruning for efficient convolutional neural networks. In AAAI, 2018. 3 +Trevor Gale, Erich Elsen, and Sara Hooker. The state of sparsity in deep neural networks. arXiv preprint arXiv:1902.09574, 2019. 1 +Shaopeng Guo, Yujie Wang, Quanquan Li, and Junjie Yan. Dmcp: Differentiable markov channel pruning for neural networks. In CVPR, 2020. 9 +S. Han, X. Liu, and H. Mao. EIE: efficient inference engine on compressed deep neural network. ACM Sigarch Computer Architecture News, 44(3):243-254, 2016a. 1 +Song Han, Jeff Pool, John Tran, and William J Dally. Learning both weights and connections for efficient neural network. In NeurIPS, 2015. 1, 3 +Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. In *ICLR*, 2016b. 1, 3 +Song Han, Junlong Kang, Huizi Mao, Yiming Hu, Xin Li, Yubin Li, Dongliang Xie, Hong Luo, Song Yao, Yu Wang, et al. ESE: Efficient speech recognition engine with sparse lstm on fpga. In ACM/SIGDA International Symposium on Field-Programmable Gate Arrays, 2017. 1 +B. Hassibi and D. G. Stork. Second order derivatives for network pruning: Optimal brain surgeon. In NeurIPS, 1993. 3 +K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In CVPR, 2016. 3, 4, 6 +Yang He, Guoliang Kang, Xuanyi Dong, Yanwei Fu, and Yi Yang. Soft filter pruning for accelerating deep convolutional neural networks. In *IJCAI*, 2018. 3, 8 +Yang He, Yuhang Ding, Ping Liu, Linchao Zhu, Hanwang Zhang, and Yi Yang. Learning filter pruning criteria for deep convolutional neural networks acceleration. In CVPR, 2020. 8 +Yihui He, Xiangyu Zhang, and Jian Sun. Channel pruning for accelerating very deep neural networks. In ICCV, 2017. 3 +Torsten Hoefler, Dan Alistarh, Tal Ben-Nun, Nikoli Dryden, and Alexandra Peste. Sparsity in deep learning: Pruning and growth for efficient inference and training in neural networks. JMLR, 22 (241):1-124, 2021. 1, 3 +Zejiang Hou, Minghai Qin, Fei Sun, Xiaolong Ma, Kun Yuan, Yi Xu, Yen-Kuang Chen, Rong Jin, Yuan Xie, and Sun-Yuan Kung. Chex: Channel exploration for cnn model compression. In CVPR, 2022. 8, 9 + +Lei Huang, Xianglong Liu, Bo Lang, Adams Yu, Yongliang Wang, and Bo Li. Orthogonal weight normalization: Solution to optimization over multiple dependent stiefel manifolds in deep neural networks. In AAAI, 2018. 3, 4, 6 +Lei Huang, Li Liu, Fan Zhu, Diwen Wan, Zehuan Yuan, Bo Li, and Ling Shao. Controllable orthogonalization in training dnns. In CVPR, 2020. 3, 4, 6 +Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, 2015. 2, 4, 5 +Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009. 6, 7 +Duong H Le and Binh-Son Hua. Network pruning that matters: A case study on retraining variants. In ICLR, 2021. 1, 6 +V. Lebedev and V. Lempitsky. Fast convnets using group-wise brain damage. In CVPR, 2016. 3 +Y. LeCun, J. S. Denker, and S. A. Solla. Optimal brain damage. In NeurIPS, 1990. 3 +Yann LeCun, Léon Bottou, Yoshua Bengio, Patrick Haffner, et al. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278-2324, 1998. 6 +Namhoon Lee, Thalaiyasingam Ajanthan, and Philip Torr. Snip: Single-shot network pruning based on connection sensitivity. In ICLR, 2019. 8 +Namhoon Lee, Thalaiyasingam Ajanthan, Stephen Gould, and Philip HS Torr. A signal propagation perspective for pruning neural networks at initialization. In ICLR, 2020. 1, 3, 4 +Bailin Li, Bowen Wu, Jiang Su, and Guangrun Wang. Eagleeye: Fast sub-net evaluation for efficient neural network pruning. In ECCV, 2020. 9 +Hao Li, Asim Kadav, Igor Durdanovic, Hanan Samet, and Hans Peter Graf. Pruning filters for efficient convnets. In *ICLR*, 2017. 1, 3, 6, 7, 8, 16, 17, 18, 19, 20, 21 +Hao Li, Zheng Xu, Gavin Taylor, Christoph Studer, and Tom Goldstein. Visualizing the loss landscape of neural nets. In NeurIPS, 2018. 7 +Tuanhui Li, Baoyuan Wu, Yujiu Yang, Yanbo Fan, Yong Zhang, and Wei Liu. Compressing convolutional neural networks via factorized convolutional filters. In CVPR, 2019. 8 +Yuchao Li, Shaohui Lin, Jianzhuang Liu, Qixiang Ye, Mengdi Wang, Fei Chao, Fan Yang, Jincheng Ma, Qi Tian, and Rongrong Ji. Towards compact cnns via collaborative compression. In CVPR, 2021. 8 +Lucas Liebenwein, Cenk Baykal, Harry Lang, Dan Feldman, and Daniela Rus. Provable filter pruning for efficient neural networks. In ICLR, 2020. 8 +Mingbao Lin, Rongrong Ji, Yan Wang, Yichen Zhang, Baochang Zhang, Yonghong Tian, and Ling Shao. Hrank: Filter pruning using high-rank feature map. In CVPR, 2020. 8 +Zechun Liu, Haoyuan Mu, Xiangyu Zhang, Zichao Guo, Xin Yang, Kwang-Ting Cheng, and Jian Sun. Metapruning: Meta learning for automatic neural network channel pruning. In ICCV, 2019a. 8 +Zhuang Liu, Jianguo Li, Zhiqiang Shen, Gao Huang, Shoumeng Yan, and Changshui Zhang. Learning efficient convolutional networks through network slimming. In ICCV, 2017. 2, 3, 5, 6 +Zhuang Liu, Mingjie Sun, Tinghui Zhou, Gao Huang, and Trevor Darrell. Rethinking the value of network pruning. In ICLR, 2019b. 1, 13 +Christos Louizos, Max Welling, and Diederik P Kingma. Learning sparse neural networks through $l_{-}0$ regularization. In ICLR, 2018. 3 + +Ekdeep Singh Lubana and Robert P Dick. A gradient flow framework for analyzing network pruning. In ICLR, 2021. 1, 3, 4 +Francesco Mezzadri. How to generate random matrices from the classical compact groups. arXiv preprint math-ph/0609050, 2006. 1, 3 +P. Molchanov, S. Tyree, and T. Karras. Pruning convolutional neural networks for resource efficient inference. In ICLR, 2017. 3 +Pavlo Molchanov, Arun Mallya, Stephen Tyree, Iuri Frosio, and Jan Kautz. Importance estimation for neural network pruning. In CVPR, 2019. 3, 8, 18, 20 +Vinod Nair and Geoffrey E Hinton. Rectified linear units improve restricted boltzmann machines. In ICML, 2010. 4 +Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, high-performance deep learning library. In NeurIPS, 2019. 6, 13 +Hanyu Peng, Jiaxiang Wu, Shifeng Chen, and Junzhou Huang. Collaborative channel pruning for deep networks. In ICML, 2019. 8 +R. Reed. Pruning algorithms - a survey. IEEE Transactions on Neural Networks, 4(5):740-747, 1993. 1, 3 +Alex Renda, Jonathan Frankle, and Michael Carbin. Comparing rewinding and fine-tuning in neural network pruning. In *ICLR*, 2020. 1, 6 +Andrew M Saxe, James L McClelland, and Surya Ganguli. Exact solutions to the nonlinear dynamics of learning in deep linear neural networks. In ICLR, 2014. 1, 3, 4 +Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2015. 6 +Sidak Pal Singh and Dan Alistarh. Woodfisher: Efficient second-order approximations for model compression. In NeurIPS, 2020. 3 +Xiu Su, Shan You, Tao Huang, Fei Wang, Chen Qian, Changshui Zhang, and Chang Xu. Locally free weight sharing for network width search. In ICLR, 2021. 9 +Vivienne Sze, Yu-Hsin Chen, Tien-Ju Yang, and Joel S Emer. Efficient processing of deep neural networks: A tutorial and survey. Proceedings of the IEEE, 105(12):2295-2329, 2017. 3 +Lloyd N Trefethen and David Bau III. Numerical linear algebra, volume 50. Siam, 1997. 1, 3 +Artem Vysogorets and Julia Kempe. Connectivity matters: Neural network pruning through the lens of effective sparsity. arXiv preprint arXiv:2107.02306, 2021. 3 +Huan Wang, Xinyi Hu, Qiming Zhang, Yuehai Wang, Lu Yu, and Haoji Hu. Structured pruning for efficient convolutional neural networks via incremental regularization. IEEE Journal of Selected Topics in Signal Processing (JSTSP), 14(4):775-788, 2019. 3, 5, 8 +Huan Wang, Can Qin, Yue Bai, and Yun Fu. Dynamical isometry: The missing ingredient for neural network pruning. arXiv preprint arXiv:2021.05916, 2021a. 1, 4, 6, 7, 8, 16 +Huan Wang, Can Qin, Yulun Zhang, and Yun Fu. Neural pruning via growing regularization. In ICLR, 2021b. 1, 3, 5, 8, 13, 14, 16, 19 +Huan Wang, Can Qin, Yulun Zhang, and Yun Fu. Recent advances on neural network pruning at initialization. In *IJCAI*, 2022. 3 +Huan Wang, Can Qin, Yue Bai, and Yun Fu. Why is the state of neural network pruning so confusing? on the fairness, comparison setup, and trainability in network pruning. arXiv preprint arXiv:2301.05219, 2023. 1, 4, 6, 8, 18, 20 + +Jiayun Wang, Yubei Chen, Rudrasis Chakraborty, and Stella X Yu. Orthogonal convolutional neural networks. In CVPR, 2020. 3, 4, 6, 7, 13, 16 +Wei Wen, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Learning structured sparsity in deep neural networks. In NeurIPS, 2016. 1, 3, 18, 20 +Ross Wightman, Hugo Touvron, and Hervé Jégou. Resnet strikes back: An improved training procedure in timm. arXiv preprint arXiv:2110.00476, 2021. 9 +Di Xie, Jiang Xiong, and Shiliang Pu. All you need is beyond a good init: Exploring better solution for training extremely deep convolutional neural networks with orthonormality and modulation. In CVPR, 2017. 3, 4, 6, 7, 16 +Huanrui Yang, Wei Wen, and Hai Li. Deephoyer: Learning sparser neural network with differentiable scale-invariant sparsity measures. In *ICLR*, 2020. 3, 18, 20 +Jianbo Ye, Xin Lu, Zhe Lin, and James Z Wang. Rethinking the smaller-norm-less-informative assumption in channel pruning of convolution layers. In ICLR, 2018. 2, 3, 5, 6 +Yulun Zhang, Huan Wang, Can Qin, and Yun Fu. Aligned structured sparsity learning for efficient image super-resolution. In NeurIPS, 2021a. 3 +Yulun Zhang, Huan Wang, Can Qin, and Yun Fu. Learning efficient image super-resolution networks via structure-regularized pruning. In ICLR, 2022. 3 +Zhenyu Zhang, Xuxi Chen, Tianlong Chen, and Zhangyang Wang. Efficient lottery ticket finding: Less data is more. In ICML, 2021b. 3 +Zhuangwei Zhuang, Mingkui Tan, Bohan Zhuang, Jing Liu, Yong Guo, Qingyao Wu, Junzhou Huang, and Jinhui Zhu. Discrimination-aware channel pruning for deep neural networks. In NeurIPS, 2018. 8 + +# A IMPLEMENTATION DETAILS + +Code reference. We mainly refer to the following code implementations in this work. They are all open-licensed. + +- Official PyTorch ImageNet example1; +- GReg-1/GReg-2 (Wang et al., 2021b) $^{2}$ ; +- OrthConv (Wang et al., 2020)3; +- Rethinking the value of network pruning (Liu et al., 2019b) $^4$ . + +Data split. All the datasets in this paper are public datasets with standard APIs in PyTorch (Paszke et al., 2019). We employs these standard APIs for the train/test data split to keep fair comparison with other methods. + +Training setups and hyper-parameters. Tab. 5 summarizes the detailed training setups. For the hyper-parameters that are introduced in our TPP method: regularization granularity $\Delta$ , regularization ceiling $\tau$ and regularization update interval $K_{u}$ , we summarize them in Tab. 6. We mainly refer to the official code of GReg-1 (Wang et al., 2021b) when setting up these hyper-parameters, since we tap into a similar growing regularization scheme as GReg-1 does. + +For small datasets (CIFAR and MNIST), each reported result is averaged by at least 3 random runs, mean and std reported. For ImageNet-1K, we cannot run multiple times due to our limited resource budget. This said, in general the results on ImageNet have been shown pretty stable. + +Table 5: Summary of training setups. In the parentheses of SGD are the momentum and weight decay. For LR schedule, the first number is initial LR; the second (in brackets) is the epochs when LR is decayed by factor 1/10; and #epochs stands for the total number of epochs. + +
DatasetMNISTCIFAR10/100ImageNet
SolverSGD (0.9, 1e-4)SGD (0.9, 5e-4)SGD (0.9, 1e-4)
Batch size100CIFAR10: 128, others: 256
LR schedule (scratch)1e-2, [30,60], #epochs:901e-1, [100,150], #epochs:2001e-1, [30,60], #epochs:90
LR schedule (prune)Fixed (1e-3)
LR schedule (retrain)1e-2,[30,60], #epochs:901e-2, [60,90], #epochs:1201e-2, [30,60,75], #epochs:90
+ +Table 6: Hyper-parameters of our methods. + +
DatasetMNISTCIFAR10/100ImageNet
Regularization granularity Δ1e-4
Regularization ceiling τ1
Regularization update interval Ku10 iterations5 iterations
+ +Hardware and running time. We conduct all our experiments using 4 NVIDIA V100 GPUs (16GB memory per GPU). It takes roughly 41 hrs to prune ResNet50 on ImageNet using our TPP method (pruning and 90-epoch retraining both included). Among them, 12 hrs (namely, close to $30\%$ ) are spent on pruning and 29 hrs are spent on retraining (about 20 mins per epoch). + +Layerwise pruning ratios. The layerwise pruning ratios are pre-specified in this paper. For the ImageNet benchmark, we exactly follow GReg (Wang et al., 2021b) for the layerwise pruning ratios to keep fair comparison to it. The specific numbers are summarized in Tab. 7. Each number is the pruning ratio shared by all the layers of the same stage in ResNet34/50. On top of these ratios, some layers are skipped, such as the last CONV layer in a residual block. The best way to examine the detailed layerwise pruning ratio is to check the code at: https://github.com/MingSun-Tse/TPP. + +Table 7: A brief summary of the layerwise pruning ratios (PRs) of ImageNet experiments. + +
ModelSpeedupPruned top-1 acc. (%)PR
ResNet341.32×73.77[0, 0.50, 0.60, 0.40, 0, 0]
ResNet501.49×76.44[0, 0.30, 0.30, 0.30, 0.14, 0]
ResNet502.31×75.60[0, 0.60, 0.60, 0.60, 0.21, 0]
ResNet502.56×75.12[0, 0.74, 0.74, 0.60, 0.21, 0]
ResNet503.06×74.51[0, 0.68, 0.68, 0.68, 0.50, 0]
+ +# B SENSITIVITY ANALYSIS OF HYPER-PARAMETERS + +Among the three hyper-parameters in Tab. 6, regularization ceiling $\tau$ works as a termination condition. We only require it to be large enough to ensure the weights are compressed to a very small amount. It does not have to be 1. The final performance is also less sensitive to it. The pruned performance seems to be more sensitive to the other two hyper-parameters, so here we conduct hyper-parameter sensitivity analysis to check their robustness. + +Results are presented in Tab. 8 and Tab. 9. Pruning ratio 0.7 (for ResNet56) and 0.5 (for VGG19) are chosen here because the resulted sparsity is the most representative (i.e., not too large or small). (1) For $K_{u}$ , in general, a larger $K_{u}$ tends to deliver a better result. This is no surprise since a larger $K_{u}$ allows more iterations for the network to adapt and recover when undergoing the penalty. (2) For $\Delta$ , we do not see a clear pattern here: either a small or large $\Delta$ can achieve the best result (for different networks). On the whole, when varying the hyper-parameters within a reasonable range, the performance is pretty robust, no catastrophic failures. Moreover, note that the default setting is actually not the best for both $K_{u}$ and $\Delta$ . This is because we did not heavily search the best hyper-parameters; however, they still achieve encouraging performance compared to the counterpart methods, as we have shown in the main text. + +Table 8: Robustness analysis of ${K}_{u}$ on the CIFAR10 and 100 datasets with our TPP algorithm. In default, ${K}_{u} = {10}$ . Layerwise $\mathrm{{PR}} = {0.7}$ for ResNet56 and 0.5 for VGG19. The best is highlighted in red and the worst in blue. + +
Ku15101520
Acc. (%, ResNet56)92.24±0.0392.42±0.1492.35±0.1292.50±0.1092.31±0.16
Acc. (%, VGG19)71.33±0.0671.45±0.2171.61±0.0871.43±0.2171.68±0.18
+ +Table 9: Robustness analysis of $\Delta$ on the CIFAR10 and 100 datasets with our TPP algorithm. In default, $\Delta = {1e} - 4$ . Layerwise $\mathrm{{PR}} = {0.7}$ for ResNet56 and 0.5 for VGG19. The best is highlighted in red and the worst in blue. + +
Δ1e-55e-51e-45e-41e-3
Acc. (%, ResNet56)92.37±0.1292.29±0.1092.35±0.1292.40±0.1592.44±0.13
Acc. (%, VGG19)71.39±0.1971.37±0.1471.61±0.0871.58±0.3171.25±0.31
+ +# C ALGORITHM DETAILS + +The details of our TPP method is summarized in Algorithm 1. + +Algorithm 1 Trainability Preserving Pruning (TPP) +1: Input: Pretrained model $\Theta$ , layerwise pruning ratio $r_l$ of $l$ -th layer, for $l \in \{1, 2, \dots, L\}$ . +2: Input: Regularization ceiling $\tau$ , penalty coefficient update interval $K_u$ , penalty granularity $\Delta$ . +3: Init: Iteration $i = 0$ . $\lambda_j = 0$ for all filter $j$ . Set pruned filter indices $S_l$ by $L_1$ -norm sorting. +4: while $\lambda_j \leq \tau$ , for $j \in S_l$ do +5: if $i \% K_u = 0$ then +6: $\lambda_j = \lambda_j + \Delta$ for $j \in S_l$ . Update regularization co-efficient in Eq. (6) +7: end if +8: Network forward, loss (Eq. (6)) backward, parameter update by stochastic gradient descent. +9: Update iteration: $i = i + 1$ . +10: end while +11: Remove filters in $S_l$ to obtain a smaller model $\Theta'$ . +12: Retrain $\Theta'$ to regain accuracy. +13: Output: Retrained model $\Theta'$ . + +# D RESULTS OMITTED FROM THE MAIN TEXT + +Loss surface visualization. The loss surface visualization of ResNet56 on CIFAR10 is presented in Fig. 4. + +VGG19 on CIFAR100. The results of VGG19 on CIFAR100 is shown in Tab. 10. + +Examination of the early retraining phase. To further understand how pruning hurts trainability and how our TPP method maintains it, in Tab. 11, we list the mean JSVs of the first 10-epoch retraining (at pruning ratio 0.9). Note the obvious mean JSV gap between LR 0.01 and LR 0.001 without OrthP: LR 0.01 can reach mean JSV 0.65 just after 1 epoch of retraining while LR 0.001 takes over 8 epochs. When OrthP is used, this gap greatly shrinks. We also list the test accuracy of the first 10-epoch retraining in Tab. 12. Particularly note that the test accuracy correlates well with the mean JSV trend under each setting, implying that the damaged trainability primarily answers for the under-performance of LR 0.001 after pruning. + +Then, when TPP is used in place of OrthP, we can see after 1-epoch retraining, the model can achieve mean JSV above 1 and test accuracy over $90\%$ , which are particularly similar to the effect of using OrthP. These re-iterate that the proposed TPP method can work just as effectively as the ground-truth trainability recovery method OrthP on this toy setup. + +![](images/2ab3fb92db67b9cc779c1afa3d8b1334aa434368f5fb5fd54b21d9dfbb32f162.jpg) +(a) $L_{1}$ (Li et al., 2017) + +![](images/ca4476a4fb16a2d4c415895b769ae90e3eb6f00f38f71a905d216283a09ee390.jpg) +Figure 4: Loss surface visualization of pruned models by different methods (w/o retraining). ResNet56 on CIFAR10. Pruning ratio: 0.9 (zoom in to examine the details). + +![](images/f3b19cafa2e20f12f26b044f2a01b4eccc4e80e28cff777a9b47ad91d8e1a9bf.jpg) +(b) GReg-2 (Wang et al., 2021b) +(c) TPP (ours) + +Table 10: Test accuracy (\%) comparison among different dynamical isometry maintenance or recovery methods on VGG19 on CIFAR100. Scratch stands for training from scratch. KernOrth means Kernel Orthogonalization (Xie et al., 2017); OrthConv means Convolutional Orthogonalization (Wang et al., 2020). Two retraining LR schedules are evaluated here: initial LR $1e-2$ vs. $1e-3$ . Acc. diff. refers to the accuracy gap of LR $1e-3$ against LR $1e-2$ . + +
VGG19 on CIFAR100: Unpruned acc. 74.02%, Params: 20.08M, FLOPs: 0.80G
Layerwise PR0.10.30.50.70.9
Sparsity/Speedup19.24%/1.23×51.01%/1.97×74.87%/3.60×90.98%/8.84×98.96%/44.22×
InitialretrainingLR 1e-2
Scratch72.84 (0.25)71.88 (0.14)70.79 (0.08)66.51 (0.11)54.37 (0.40)
L1(Li et al., 2017)74.01 (0.18)73.01 (0.22)71.49 (0.14)66.05 (0.04)51.36 (0.11)
L1+OrthP (Wang et al., 2021a)74.00 (0.04)72.30 (0.49)68.09 (0.24)62.22 (0.15)48.07 (0.31)
L1+KernOrth (Xie et al., 2017)73.72 (0.26)72.53 (0.09)71.23 (0.10)65.90 (0.14)50.75 (0.30)
L1+OrthConv (Wang et al., 2020)73.18 (0.10)72.25 (0.31)70.82 (0.11)64.51 (0.43)48.31 (0.18)
KernOrth (Xie et al., 2017) + L173.73 (0.23)72.41 (0.12)70.31 (0.12)64.10 (0.19)50.72 (0.87)
OrthConv (Wang et al., 2020) + L173.55 (0.18)72.67 (0.09)71.24 (0.23)65.66 (0.10)50.53 (0.46)
TPP (ours)74.02 (0.24)73.19 (0.07)71.61 (0.08)67.78 (0.31)57.70 (0.37)
InitialretrainingLR 1e-3
L1(Li et al., 2017)73.67 (0.05)72.04 (0.12)70.21 (0.02)64.72 (0.17)48.43 (0.44)
TPP (ours)73.83 (0.02)72.29 (0.07)71.16 (0.12)67.47 (0.17)56.73 (0.34)
Acc. diff. (L1)-0.34-0.97-1.28-1.33-2.93
Acc. diff. (TPP)-0.19-0.90-0.45-0.31-0.97
+ +# E MORE ANALYTICAL RESULTS + +In this section, we add more analytical results to help readers better understand how TPP works. + +# E.1 COMPARISON UNDER SIMILAR TOTAL EPOCHS + +In Tab. 1, TPP takes a few epochs for regularized training before the sparsifying action, while $L_{1}$ pruning is one-shot, taking no epochs. Namely, the total training cost of TPP is larger than those one-shot methods. It is of interest how the comparison will change if these one-shot methods are given more epochs for training. + +First, note that the results of $L_{1} + \mathrm{KernOrth}$ , $L_{1} + \mathrm{OrthConv}$ , $\mathrm{KernOrth} + L_{1}$ , and $\mathrm{OrthConv} + L_{1}$ in Tab. 1 also involve training (the KernOrth/OrthConv is essentially a regularized training), which takes 50k iterations. We make following changes: + +- Our TPP takes 100k iterations based on the default hyper-parameter setup, so to make a fair comparison, we decrease the regularization update interval $K_{u}$ from 10 to 5, making the regularization of TPP also take 50k iterations. +- Meanwhile, we add 128 retraining epochs (50k / 391 iters per epoch ≈ 128 epochs) to the $L_{1}$ and $L_{1} + \mathrm{OrthP}$ methods (when their retraining epochs are increased, the LR decay epochs are proportionally scaled); plus the original 120 epochs, the total epochs are 248 now. + +Table 11: Mean JSV of the first 10 epochs under different retraining settings. Epoch 0 refers to the model just pruned, before any retraining. Pruning ratio is 0.9. Note, with OrthP, the mean JSV is 1 because OrthP can achieve exact isometry + +
Epoch012345678910
LR=10-2, w/o OrthP0.000.650.891.010.971.101.141.271.331.291.42
LR=10-3, w/o OrthP0.000.000.000.000.100.250.350.420.510.740.86
LR=10-2, w/ OrthP1.001.231.421.431.401.471.511.561.601.651.68
LR=10-3, w/ OrthP1.001.501.641.731.841.871.931.961.992.002.04
LR=10-2, w/ TPP (ours)2.982.152.011.671.972.101.972.082.052.062.06
LR=10-3, w/ TPP (ours)2.982.962.952.992.993.013.213.193.053.043.02
+ +Table 12: Test accuracy (\%) of the first 10 epochs corresponding to Tab. 11 under different retraining settings. Epoch 0 refers to the model just pruned, before any retraining. Pruning ratio is 0.9. + +
Epoch012345678910
LR=10-2, w/o OrthP9.7464.3480.0180.2381.7785.8085.8286.2186.3586.6086.15
LR=10-3, w/o OrthP9.749.749.7411.8921.3427.7532.9635.3849.6664.8968.97
LR=10-2, w/ OrthP9.7491.0591.3991.3391.3791.7491.6990.7491.3991.5891.44
LR=10-3, w/ OrthP9.7490.8191.5991.7791.8592.0492.1292.2292.1292.3392.25
LR=10-2, w/ TPP (ours)89.2191.5491.0191.4591.8391.5690.8991.3390.6891.5491.21
LR=10-3, w/ TPP (ours)89.2192.1291.8292.0992.1591.9592.0092.0292.0992.0892.08
+ +Now all the comparison methods in Tab. 1 have the same training cost (i.e., the same 248 total epochs). The new results of $L_{1}$ , $L_{1} + \mathrm{OrthP}$ , and TPP under this strict comparison setup are presented below: + +Table 13: Test accuracy comparison under the same total epochs (ResNet56 on CIFAR10). + +
Layerwise PR0.30.50.70.90.95
L1(Li et al., 2017)93.65 (0.14)93.38 (0.16)92.11 (0.16)87.17 (0.26)83.94 (0.45)
L1(Li et al., 2017)+OrthP93.58 (0.03)93.30 (0.10)91.69 (0.13)85.75 (0.26)82.30 (0.20)
TPP (ours)93.76 (0.10)93.45 (0.05)92.42 (0.14)89.54 (0.08)85.98 (0.29)
+ +We make the following observations: + +- For $L_{1}$ pruning, more retraining epochs do not always help. Comparing these results to Tab. 1, we may notice at small PR (0.3, 0.5), the accuracy drops a little (this probably is due to overfitting – when the PR is small, the pruned model does not need so many epochs to recover; while too long training triggers overfitting). For larger PR (like 0.95), more epochs help quite significantly (improving the accuracy by 0.91%). +- $L_{1} + \mathrm{OrthP}$ still underperforms $L_{1}$ , same as in Tab. 1. +- Despite using fewer epochs, TPP is still pretty robust - Compared to Tab. 1, the performance varies by a very marginal gap ( $0.1\%$ , within the std range, so not a statistically significant gap). In general, TPP is still the best among all the compared methods, and, the advantage is more obvious at larger PRs, implying TPP is more valuable in more aggressive pruning cases. + +# E.2 TPP + Random BASE MODELS + +Pruning is typically conducted on a pretrained model. TPP is also brought up in this context. This said, the fundamental idea of TPP, i.e., the proposed regularized training which can preserve trainability from the sparsifying action, is actually independent of the base model. Therefore, we may expect TPP can also surpass the $L_{1}$ pruning method (Li et al., 2017) in the case of pruning a random model – this is confirmed in Tab. 14. As expected, the damaged trainability problem does not + +only exit for pruning pretrained models, but also exits for pruning random models; so TPP performs better than $L_{1}$ pruning, especially in the large sparsity regime. + +Table 14: Test accuracy of applying TPP vs. $L_{1}$ pruning (Li et al., 2017) to random base model. + +
ResNet56 on CIFAR10: Unpruned acc. 93.78%, Params: 0.85M, FLOPs: 0.25G
Layerwise PR0.30.50.70.90.95
L1 pruning (Li et al., 2017)88.98 (0.13)88.79 (0.18)87.60 (0.21)85.09 (0.09)82.68 (0.32)
TPP (ours)91.93 (0.13)91.27 (0.16)90.36 (0.16)87.60 (0.09)85.36 (0.18)
+ +Moreover, in Fig. 5, we show the mean JSV and test accuracy when pruning a random model with different schemes $(L_{1}, L_{1} + \mathrm{OrthP}$ , and our TPP). We observe that, in general, the JSV and test accuracy of pruning a random model pose similar patterns to pruning a pretrained model (Fig. 3): + +- Using $L_{1}$ , the $\mathrm{LR} = 0.01$ achieves "better" (not really better, but due to damaged trainability, the performance of $\mathrm{LR} = 0.001$ has been underestimated, see Wang et al. (2023) for more detailed discussions) JSV and test accuracy; note the test accuracy solid line is above the dashed line by an obvious margin. +- While using $L_{1} + \mathrm{OrthP}$ or our TPP, the LR=0.001 can actually match LR=0.01. Same as the case of pruning a pretrained model, here, TPP behaves similarly to the oracle trainability recovery method OrthP. +- To summarize, the trainability-preserving effect of TPP also generalizes to the case of pruning random networks. + +![](images/ee906d00635a7291e66cbbe82770ead3f108c3300ad2bd924e3e60bf8d880ce0.jpg) + +![](images/96328516d7820034f5fc99c188dc314194d15ddd50abb40c58ee7c52d829479d.jpg) +87.86/82.47/0.0002 +(a) $L_{1}$ +Figure 5: Mean JSV and test accuracy during retraining with different methods (network: MLP-7-Linear, dataset: MNIST) when pruning a random model. Below each plot are, in order, the best accuracy of LR 0.01, the best accuracy of LR 0.001, and the mean JSV right after pruning (i.e., without retraining). +In Fig. 6, we show the mean JSV and test accuracy over the overall process (including the regularized training and retraining) of TPP applied to a random model. + +![](images/24cfe9423fac49ade7fa8cf7d26b63912ba118887f1ba8e0ee5cc7bc1ce87d60.jpg) + +![](images/5eff9fe6b5809a0005b6b4ba5162c63d6df79120162b7be10374dff9387bc63a.jpg) +92.78/92.71/1.0000 +(b) $L_{1} + \mathrm{OrthP}$ + +![](images/0a7183b041bb950739310279e8b1f4bb9e55e5e9890cb8fd29bfbf0a792136ff.jpg) + +![](images/31fe2feee611700b8049fa5e13be6119f79cdf6283b49927e091bc41a7d4b5d0.jpg) +92.82/92.71/2.3617 +(c) TPP (ours) + +# E.3 TPP + MORE ADVANCED PRUNING CRITERIA + +In the main text, we demonstrate the effectiveness of TPP, which employs the magnitude $(L_{1}$ -norm) of filters to decide masks. It is of interest whether the effectiveness of TPP can carry over to other more advanced pruning criteria. Here we combine TPP with other 3 more advanced criteria: SSL (Wen et al., 2016), DeepHoyer (Yang et al., 2020), and Taylor-FO (Molchanov et al., 2019). SSL and DeepHoyer are regularization-based pruning methods like ours; differently, their layerwise pruned indices (as well as the pruning ratio) is not pre-specified, but "learned" by the regularized training. As such, the layerwise pruning ratios are not uniform (see Fig. 7 for an example). Taylor-FO is a more complex pruning criterion than magnitude by taking into account the first-order gradient information. + +![](images/350114705d5c9a01c39ee47a6bbacc0ce36ae8cacc71be02c5e9b3b69b782c85.jpg) + +![](images/cc5670fc1fb80030bf6e9b2806256fe6f0e939ffe1aa0497fdd1c468d84758cd.jpg) +Figure 6: Mean JSV and test accuracy during regularized training and retraining with TPP (network: MLP-7-Linear, dataset: MNIST) when pruning a random model. The model spends 100 epochs on regularized training (LR schedule at this stage is the same, 0.001, fixed); then pruned by $L_{1}$ pruning (Li et al., 2017); then retrained with different LR schedules (0.01 vs. 0.001). As seen, pruning the TPP regularized model does not make the mean JSV drop significantly at the pruning point (epoch 100), namely, trainability preserved. In stark contrast, when applying $L_{1}$ pruning to a normally trained (i.e., not TPP regularized) model, mean JSV drops from 2.4987 to 0.0040 (see Fig. 3), namely, trainability not preserved. Note, when trainability is preserved, retraining LR 0.01 and 0.001 do not pose obvious test accuracy gap; while trainability is not preserved, the gap would be obvious - see Fig. 5(a). + +Specifically, we first use these methods to decide the layerwise pruned indices, given a total pruning ratio. Then, we inherit these layerwise pruned indices when using our TPP method. + +Results are shown in Tab. 15. We observe, at small PRs (0.3-0.7), TPP performs similarly to $L_{1}$ . This agrees with Tab. 1, where TPP is comparable to $L_{1}$ . At large PRs (0.9, 0.95), the advantage of TPP starts to expose more – at PR 0.9/0.95, TPP beats $L_{1}$ by 0.9/1.44 with SSL learned pruned indices, which is a statistically significant advantage as indicated by the std (and again, when PR is larger, the advantage of TPP is generally more pronounced). This table shows the advantage of TPP indeed can carry over to other layerwise pruning ratios derived from more advanced pruning criteria. + +# E.4 TRAINING CURVE PLOTS: TPP vs. $L_{1}$ PRUNING + +In Fig. 8, we show the training curves of our TPP compared to $L_{1}$ pruning with ResNet56 on CIFAR10. + +# E.5 PRUNING RESNET50 ON IMAGENET WITH LARGER SPARSITY RATIOS + +It is noted that our method only beats some of the compared methods marginally ( $< 0.5\%$ top-1 accuracy) in low sparsity regime (around $2 \times \sim 3 \times$ speedup, see Tab. 2). This is mainly because when the sparsity is low, network trainability is not seriously damaged, thus our trainability-preserving method cannot fully expose its advantage. Here we showcase a scenario that trainability is intentionally damaged more dramatically. + +In Tab. 2, when pruning ResNet50, researchers typically do not prune all the layers – the last CONV layer in a residual block is usually spared (Li et al., 2017; Wang et al., 2021b), for the sake of performance. Here we intentionally prune all the layers (only excluding the first CONV and last + +Table 15: Comparison between $L_{1}$ pruning (Li et al., 2017) and our TPP with pruned indices derived from more advanced pruning criterion (Taylor-FO (Molchanov et al., 2019)) or regularization schemes (SSL (Wen et al., 2016), DeepHoyer (Yang et al., 2020)). Network/Dataset: ResNet56/CIFAR10: Unpruned acc. $93.78\%$ , Params: 0.85M, FLOPs: 0.25G. Total PR represents the pruning ratio (PR) of the whole network. Note, due to the non-uniform layerwise PRs, the speedup below, which depends on the feature map spatial size, can be quite different from each other, even under the same total PR. + +
Total PR0.30.50.70.90.95
Sparsity/Speedup22.86%/1.66×47.09%/2.25×72.28%/3.32×92.49%/7.14×95.87%/9.77×
L1(w/ SSL pruned indices)93.87±0.0293.47±0.0492.76±0.1589.00±0.1384.75±0.21
TPP (w/ SSL layerwise pruned indices)93.86±0.0993.50±0.1592.81±0.0589.90±0.0786.19±0.22
Sparsity/Speedup26.87%/1.54×52.11%/1.95×76.50%/2.74×93.21%/6.15×96.02%/9.60×
L1(w/ DeepHoyer pruned indices)93.81±0.0993.81±0.1092.33±0.0687.61±0.1584.27±0.10
TPP (w/ DeepHoyer pruned indices)93.88±0.1393.59±0.0492.58±0.2088.76±0.1785.64±0.18
Sparsity/Speedup31.21%/1.45×49.94%/1.99×70.75%/3.59×90.66%/11.58×95.41%/19.85×
L1(w/ Taylor-FO pruned indices)93.91±0.1193.50±0.0592.24±0.1287.28±0.3283.31±0.43
TPP (w/ Taylor-FO pruned indices)93.91±0.0993.64±0.1492.32±0.1388.06±0.1085.34±0.32
+ +![](images/aaafca5e8696ad0adf18c09c768f6667d15047485bbb6c9652508926030cf078.jpg) + +![](images/0acf3a30ff15f53c4c797dbbea94783c5e81a562a299232e31cedf834e4328e0.jpg) + +![](images/74bed7c404d69cd9ff60276a2a77e8bcef96cb8c1a5b80e6e2ab77f2c09164a0.jpg) + +![](images/7b17475efd18e804017c6583cc5a0f03ee0c33fa4ac48eade4dc7878251c154f.jpg) + +![](images/0976247c362cb347a3676989a8d92c7823d73f18210bfb7f8335ac2a5c6bde84.jpg) +Figure 7: Layerwise pruning ratios learned by SSL (Wen et al., 2016) with ResNet56 on CIFAR10, given different total pruning ratios (indicated in the title of each sub-figure). + +classifier FC) in ResNet50. For the $L_{1}$ pruning method (Li et al., 2017) (we report a stronger version re-implemented by Wang et al. (2023)), different layers are pruned independently since the layerwise pruning ratio has been specified. All the hyper-parameters of the retraining process are maintained the same for fair comparison, per the spirit brought up in Wang et al. (2023). + +![](images/3aaaaee776334ebce0e5b0f45dc5c552a3875ca5e1306424115dd18b714f89d4.jpg) + +![](images/04a60d96eca24914b5e4fa797ab29ecd0e04796c0eadd34e98293b7385d7324b.jpg) + +![](images/6d828f7524858c69304154439f9db071f03a9a7502f941c27084eb3dc7f3efa7.jpg) + +![](images/100813cc90e2be1239ab6e8bd99db391f1e42a4f9ec90bde91ae1d8ec2ac2b71.jpg) + +![](images/b3fc4d5800f347d840fcd58db0dd668334587e0d559708affd6e2158a27bbb99.jpg) +Figure 8: Training curves during retraining with ResNet56 on CIFAR10 at different pruning ratios (PRs). We can observe that at large PRs (0.9, 0.95), TPP significantly accelerates the optimization in the comparison to $L_{1}$ (Li et al., 2017), because of better trainability preserved before retraining. + +The results in Tab. 16 show that, when the trainability is impaired more, our TPP beats $L_{1}$ by 0.77 to 2.17 top-1 accuracy on ImageNet, much more significant than Tab. 2. + +Table 16: Top-1 accuracy comparison between TPP and $L_{1}$ pruning with larger pruning ratios (PRs). All layers but the 1st CONV and last FC layer (including the downsample layers and the 3rd CONV in a residual block) are pruned. Uniform layerwise pruning ratio is used. + +
Layerwise PR0.50.70.90.95
Sparsity/Speedup72.94%/3.63×89.34%/8.45×98.25%/25.34×99.34%/31.45×
L1(Li et al., 2017)71.2566.0247.9633.21
TPP(ours)73.42 (+2.17)68.16 (+2.14)49.19 (+1.23)33.98 (+0.77)
+ +# F MORE DISCUSSIONS + +Can TPP be useful for finding lottery ticket subnetwork in a filter level? + +To our best knowledge, filter-level winning tickets (WT) are still hard to find even using the original LTH pipeline. Few attempts in this direction have succeeded – $E.g.$ , Chen et al. (2022) tried, but they can only achieve a bit marginal sparsity ( $30\%$ ) with filter-level WT (see their Fig. 3, ResNet50 on ImageNet) while weight-level WT typically can be found at over $90\%$ sparsity. This said, we do think this paper can contribute in that direction since preserving trainability is also a central issue in LTH, too. \ No newline at end of file diff --git a/trainabilitypreservingneuralpruning/images.zip b/trainabilitypreservingneuralpruning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..c203bd8657a8cf88eb0629f77e71e99ad8ecbcb6 --- /dev/null +++ b/trainabilitypreservingneuralpruning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:95c659d21f4f140e193fb8e9c9db04a295ec6f3523ec100d59efc476cd32951d +size 1480729 diff --git a/trainabilitypreservingneuralpruning/layout.json b/trainabilitypreservingneuralpruning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..a2b3273fb2f99c063ab2e986694c8ef3b296f84a --- /dev/null +++ b/trainabilitypreservingneuralpruning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4daf6d29a885a6da9c52caf188d5d8cd5788cf269edc42b32b07d9c1dcc954a9 +size 700098 diff --git a/trainableweightaveragingefficienttrainingbyoptimizinghistoricalsolutions/76908929-7dc3-4c81-8727-8f6a4180bb3b_content_list.json b/trainableweightaveragingefficienttrainingbyoptimizinghistoricalsolutions/76908929-7dc3-4c81-8727-8f6a4180bb3b_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..8e6b02b3ad3b217615310c1aa8ddb2f4d8208ec0 --- /dev/null +++ b/trainableweightaveragingefficienttrainingbyoptimizinghistoricalsolutions/76908929-7dc3-4c81-8727-8f6a4180bb3b_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:844a0eb8e071ee45ced91cc29417fa1bc20b6fab35614f417b1daa59b9b8a571 +size 101317 diff --git a/trainableweightaveragingefficienttrainingbyoptimizinghistoricalsolutions/76908929-7dc3-4c81-8727-8f6a4180bb3b_model.json b/trainableweightaveragingefficienttrainingbyoptimizinghistoricalsolutions/76908929-7dc3-4c81-8727-8f6a4180bb3b_model.json new file mode 100644 index 0000000000000000000000000000000000000000..f93eeb2a6c023a2cff20b8fc22303ba5f9811e13 --- /dev/null +++ b/trainableweightaveragingefficienttrainingbyoptimizinghistoricalsolutions/76908929-7dc3-4c81-8727-8f6a4180bb3b_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:584abfc550e319416476be669f5c937e5cc044036c32bc6ba28e5a60b8dde4cb +size 121267 diff --git a/trainableweightaveragingefficienttrainingbyoptimizinghistoricalsolutions/76908929-7dc3-4c81-8727-8f6a4180bb3b_origin.pdf b/trainableweightaveragingefficienttrainingbyoptimizinghistoricalsolutions/76908929-7dc3-4c81-8727-8f6a4180bb3b_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..37967e66ab70593f77849d986b751072585b55a5 --- /dev/null +++ b/trainableweightaveragingefficienttrainingbyoptimizinghistoricalsolutions/76908929-7dc3-4c81-8727-8f6a4180bb3b_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e004401ac6b2075ed77a8b44b4fe8ca21db31b9e07bdebb38ec6862a54830962 +size 454276 diff --git a/trainableweightaveragingefficienttrainingbyoptimizinghistoricalsolutions/full.md b/trainableweightaveragingefficienttrainingbyoptimizinghistoricalsolutions/full.md new file mode 100644 index 0000000000000000000000000000000000000000..2b11263760fd05cc53d98dd1efa0b715c23163b4 --- /dev/null +++ b/trainableweightaveragingefficienttrainingbyoptimizinghistoricalsolutions/full.md @@ -0,0 +1,401 @@ +# TRAINABLE WEIGHT AVERAGING: EFFICIENT TRAINING BY OPTIMIZING HISTORICAL SOLUTIONS + +Tao Li $^{1}$ , Zhehao Huang $^{1}$ , Qinghua Tao $^{2}$ , Yingwen Wu $^{1}$ & Xiaolin Huang $^{*1}$ + +$^{1}$ Department of Automation, Shanghai Jiao Tong University $^{2}$ ESAT-STADIUS, KU Leuven + +# ABSTRACT + +Stochastic gradient descent (SGD) and its variants are considered as the de-facto methods to train deep neural networks (DNNs). While recent improvements to SGD mainly focus on the descent algorithm itself, few works pay attention to utilizing the historical solutions—as an iterative method, SGD has gone through substantial explorations before convergence. Recently, an interesting attempt is stochastic weight averaging (SWA), which significantly improves the generalization by simply averaging the solutions at the tail stage of training. In this paper, we realize that the averaging coefficients could be determined in a trainable manner and propose Trainable Weight Averaging (TWA), a novel optimization method in the reduced subspace spanned by historical solutions. TWA has much greater flexibility and can be applied to the head stage of training to achieve training efficiency while preserving good generalization capability. Further, we propose a distributed training scheme to resolve the memory burden of large-scale training with efficient parallel computation. In the extensive numerical experiments, (i) TWA achieves consistent improvements over SWA with less sensitivity to learning rate; (ii) applying TWA in the head stage of training largely speeds up the convergence, resulting in over $40\%$ time saving on CIFAR and $30\%$ on ImageNet with improved generalization compared with regular training. The code of implementation is available https://github.com/nblt/TWA. + +# 1 INTRODUCTION + +Training deep neural networks (DNNs) usually requires a large amount of time. As the sizes of models and datasets grow larger, more efficient optimization methods together with better performance are increasingly demanded. In the existing works, great efforts have been made to improve the efficiency of stochastic gradient descent (SGD) and its variants, which mainly focus on adaptive learning rates (Duchi et al., 2011; Zeiler, 2012; Kingma & Ba, 2015; Loshchilov & Hutter, 2019; Yao et al., 2021; Heo et al., 2021) or accelerated schemes (Polyak, 1964; Nesterov, 1983; 1988; 2003). As an iterative descent method, SGD generates a series of solutions during optimization. These historical solutions provide dynamic information about the training and have brought many interesting perspectives, e.g., trajectory (Li et al., 2022), landscape (Garipov et al., 2018), to name a few. In fact, they can also be utilized to improve the training performance, resulting in the so-called stochastic weight averaging (SWA) (Izmailov et al., 2018), which shows significantly better generalization by simply averaging the tail stage explorations of SGD. A similar idea could be found in Szegedy et al. (2016), which designs an exponential moving average (EMA) and considers that a heuristic strategy could be better than equivalently averaging. The success of SWA and EMA encourages more in-depth investigations on the roles of historical solutions obtained during the training (Athiwaratkun et al., 2018; Nikishin et al., 2018; Yang et al., 2019). + +In this paper, our main purpose is to utilize historical solutions by optimizing them, rather than using fixed averaging (e.g., SWA) or a heuristic combination (e.g., EMA). With such an optimized averaging scheme, we can achieve higher accuracy using only the solutions in a relatively early state (i.e. the head stage). In other words, we speed up the training and meanwhile improve the performance. The idea of utilizing these early solutions in DNNs' training is mainly inspired by two facts. On the + +![](images/e3e00ba0f4c926458292573f57bf263ec52328ee07f4f2cf440041c29f4b6b71.jpg) +Figure 1: TWA intuition. + +Input: Sampled weights $\{\pmb{w}_i\}_{i=1}^n$ , Batch size $b$ , Loss function $L: \mathcal{W} \times \mathcal{X} \times \mathcal{Y} \to \mathbb{R}_+$ , Learning rate $\eta$ . + +Output: Model trained with TWA + +Orthogonalize $\{\pmb{w}_i\}_{i=1}^n$ to $\{\pmb{e}_i\}_{i=1}^n$ ; + +Initialize $\pmb{w}_{\mathrm{twa}}^{(0)}$ $t = 0$ $\pmb {P} = [e_1,e_2,\dots ,e_n]$ + +while not converged do + +Sample batch data: $\mathcal{B} = \{(x_k,y_k)\}_{k = 1}^b$ + +Compute gradient: $\pmb {g} = \nabla_{\pmb{w}}L_{B}(\pmb{w}_{\mathrm{twa}}^{(t)});$ + +Update weights: $\pmb{w}_{\mathrm{twa}}^{(t + 1)} = \pmb{w}_{\mathrm{twa}}^{(t)} - \eta \pmb {P}(\pmb{P}^{\top}\pmb {g})$ $t = t + 1$ + +end while + +Return $\pmb{w}_{\mathrm{twa}}^{(t)}$ + +Algorithm 1: TWA algorithm. + +one hand, high test accuracy commonly starts appearing at an early stage. For example, a PreAct ResNet-164 model (He et al., 2016) achieves over $80\%$ test accuracy within 10 training epochs on CIFAR-10 (Krizhevsky & Hinton, 2009), while requiring to complete the whole 200 epochs to reach its final $95\%$ accuracy. This observation also coincides with the recent findings that the key connectivity patterns of DNNs emerge early in training (You et al., 2020; Frankle et al., 2020), indicating a well-explored solution space formed. On the other hand, simply averaging the solutions collected at the SWA stage immediately provides a huge accuracy improvement, e.g. over $16\%$ on CIFAR-100 with Wide ResNet-28-10 (Zagoruyko & Komodakis, 2016) than before averaging (Izmailov et al., 2018). These facts point out a promising direction that sufficiently utilizing these early explorations may be capable of quickly composing the final solution while obtaining good accuracy. + +As the model parameters go through a rapid evolution at the early stage of training, a simple averaging strategy with fixed weighting coefficients as in SWA and EMA can result in large estimation errors. We introduce a Trainable Weight Averaging (TWA), which allows explicit adjustments for the averaging coefficients in a trainable manner. Specifically, we construct a subspace that contains all sampled solutions during the training and then conduct efficient optimization therein. As optimization in such a subspace takes into account all possible averaging choices, we are able to adaptively search for a good set of averaging coefficients regardless of the quality of sampled solutions and largely reduce the estimation errors. The proposed optimization scheme is essentially the gradient projection onto a tiny subspace. Hence, the degree of freedom for training is substantially reduced from the original millions to dozens or hundreds (equal to the dimension of the subspace), making TWA enjoy fast convergence and meanwhile immune to overfitting, the latter explains that better training accuracy of TWA over SWA or EMA can lead to better test accuracy. In extensive experiments with various network architectures on different tasks, we reach superior performance with TWA applied to the head stage of training. For instance, we attain $1.5 \sim 2.2\%$ accuracy improvement on CIFAR-100 and $0.1\%$ on ImageNet with over $40\%$ and $30\%$ training epochs reduced, respectively, compared with the regular training. + +In summary, we make the following contributions: + +- We propose Trainable Weight Averaging (TWA) that allows the averaging coefficients determined in a trainable manner instead of a pre-defined strategy. It brings consistent improvements over SWA or EMA with reduced estimation error. +- We successfully apply TWA to the head stage of training, resulting in a great time saving (e.g. over $40\%$ on CIFAR and $30\%$ on ImageNet) compared to regular training along with improved performance and reduced generalization gap. +- Our TWA is easy to implement and can be flexibly plugged into different stages of training to bring consistent improvements. It provides a new scheme for achieving efficient DNNs' training by sufficiently utilizing historical explorations. + +# 2 METHOD + +In this section, we first formulate the optimization target of TWA. Then a detailed training algorithm is introduced, which consists of two phases: Schmidt orthogonalization and projected optimization. + +Note in this paper, the model's weights are aligned as a vector, i.e., $\pmb{w} \in \mathbb{R}^{D}$ , where $D$ denotes the number of parameters. + +# 2.1 OPTIMIZATION TARGET + +In SWA, weight averaging is simply given by $\boldsymbol{w}_{\mathrm{swa}} = \frac{1}{n}\sum_{i=1}^{n}\boldsymbol{w}_i$ , where $n$ solutions of the network collected at the tail of training are equally weighted. Such an averaging strategy has been proven quite effective with improved generalization ability. However, equally averaging could not always be a perfect solution, which motivates some heuristic modifications on weighting strategy, e.g., EMA. Both SWA and EMA are fixed averaging strategies, which may not adequately adapt to the head stage of training and would result in estimation errors, due to the fact that early historical solutions have not stepped into a stationary distribution. + +In this paper, we propose to optimize the averaging coefficients of different weights with the hope of reducing the corresponding estimation error. Specifically, the set of possible TWA solutions considered, i.e., $\boldsymbol{w}_{\mathrm{twa}}$ , can be represented as follows: + +$$ +A = \left\{\alpha_ {1} \boldsymbol {w} _ {1} + \alpha_ {2} \boldsymbol {w} _ {2} + \dots + \alpha_ {n} \boldsymbol {w} _ {n} \mid \alpha_ {i} \in \mathbb {R} \right\}. \tag {1} +$$ + +The weight vectors between consecutive solutions could have a high cosine similarity. To decouple them and for better optimization, we will further orthogonalize $\{\pmb{w}_i\}_{i=1}^n$ and find a set of orthogonal bases $\{e_i\}_{i=1}^n$ to support the solution space, i.e., $A = \{\beta_1 e_1 + \beta_2 e_2 + \dots + \beta_n e_n \mid \beta_i \in \mathbb{R}\}$ . Then we search for a good solution $\pmb{w}_{\mathrm{twa}}$ in $A$ by optimizing the following problem, + +$$ +\min _ {\beta_ {1}, \beta_ {2}, \dots , \beta_ {n}} \mathbb {E} _ {(\boldsymbol {x}, \boldsymbol {y}) \sim \mathcal {D}} [ \mathcal {L} (f (\boldsymbol {w} _ {\mathrm {t w a}}; \boldsymbol {x}), \boldsymbol {y}) ] + \frac {\lambda}{2} \sum_ {i = 1} ^ {n} \beta_ {i} ^ {2}, \tag {2} +$$ + +$$ +\begin{array}{l} \text {s . t .} \quad \boldsymbol {w} _ {\mathrm {t w a}} = \beta_ {1} \boldsymbol {e} _ {1} + \beta_ {2} \boldsymbol {e} _ {2} + \dots + \beta_ {n} \boldsymbol {e} _ {n}, \end{array} +$$ + +where $\mathcal{L}(\cdot ,\cdot)$ is the loss function as in regular training and the second term is a regularization coefficient $\lambda >0$ . Note that both SWA and EMA are special solutions of (2) without optimization. + +Optimizing over $\beta_{i}$ brings benefits in the view of training loss, and a good generalization ability could also be expected: in regular training, the number of optimization variables is $D$ , which is very large, but in (2), there are only $n$ averaging coefficients $\{\beta_i\}_{i = 1}^n$ to be optimized. The significant dimensionality reduction could benefit better generalization. + +# 2.2 TRAINING ALGORITHM + +Instead of directly optimizing $\beta_{i}$ , we note that there exists a bijection between the coefficient space $\{\beta_{i}\}_{i = 1}^{n}\in \mathbb{R}^{n}$ and the parameter space $\mathbb{R}^D$ , i.e., each set of the coefficients is uniquely mapped to one point in the parameter space, which forms a complete subspace (with dimensionality $n$ ). We could alternatively optimize these coefficients in such a subspace. + +We first focus on finding a set of orthogonal bases $\{e_i\}_{i = 1}^n$ to span the subspace that covers $\{\pmb {w}_i\}_{i = 1}^n$ . This is a standard Schmidt orthogonalization, which sequentially takes the following steps: + +$$ +\left\{ \begin{array}{l} \boldsymbol {e} _ {k} = \boldsymbol {w} _ {k} - \left(\boldsymbol {w} _ {k} ^ {\top} \boldsymbol {e} _ {1}\right) \boldsymbol {e} _ {1} - \left(\boldsymbol {w} _ {k} ^ {\top} \boldsymbol {e} _ {2}\right) \boldsymbol {e} _ {2} - \dots - \left(\boldsymbol {w} _ {k} ^ {\top} \boldsymbol {e} _ {k - 1}\right) \boldsymbol {e} _ {k - 1}, \\ \boldsymbol {e} _ {k} = \boldsymbol {e} _ {k} / \| \boldsymbol {e} _ {k} \| _ {2}. \end{array} \right. \tag {3} +$$ + +We then initialize the $\boldsymbol{w}_{\mathrm{twa}}^{(0)}$ as one point in the subspace (e.g. $\frac{1}{n}\sum_{i=1}^{n}\boldsymbol{w}_i$ ), and optimize the network's parameters therein. Let $\boldsymbol{P} = [e_1, e_2, \dots, e_n]$ , such optimization can be easily achieved by projecting the gradient onto the subspace via projection matrix $\boldsymbol{PP}^\top$ . We summarize the detailed training procedures of the proposed TWA in Algorithm 1 with an intuitive illustration in Figure 1. The detailed implementation is described in Appendix B. + +# 3 OPTIMIZATION PROVIDES BETTER FLEXIBILITY + +The key difference between SWA and TWA is that the averaging coefficients in TWA are determined in a trainable manner, or more precisely, are data-dependent. This potentially enables more precise estimation for the center minima and better tolerance for the outliers that are not aware by SWA. + +![](images/ee4015b5b79bcb5e6695c7bd33b4e242352fa3a72ca49c7743e6184ca70db7ce.jpg) +Figure 2: An efficient parallel scheme for distributed training. + +Notice that in the view of coefficient optimization, there is no essential difference between SWA and EMA, which both provide specific and data-independent solutions. Thus, we in the following only compare TWA with SWA. + +Mandt et al. (2017) demonstrated that under appropriate assumptions, running SGD with a constant learning rate is equivalent to sampling from a stationary Gaussian distribution, and the variance of the distribution is controlled by the learning rate. Accordingly, we assume the solutions at the tail stage of SGD training are sampled from a Gaussian distribution $\mathcal{N}(\boldsymbol{\mu}, \boldsymbol{\Sigma})$ centered at the minimum $\boldsymbol{\mu}$ with covariance $\boldsymbol{\Sigma}$ . Approximately, the sampled solutions $\{\boldsymbol{w}_i\}_{i=1}^n$ are independent random variables from $\mathcal{N}(\boldsymbol{\mu}, \boldsymbol{\Sigma})$ , as long as there are sufficient iterations between adjacent samplings. SWA and TWA provide two estimators for the minimum $\boldsymbol{\mu}$ , i.e., $\boldsymbol{w}_{\mathrm{swa}}$ and $\boldsymbol{w}_{\mathrm{twa}}$ . As an averaged solution, $\boldsymbol{w}_{\mathrm{swa}}$ has statistically better estimation than any single solution due to the effect of variance reduction, while $\boldsymbol{w}_{\mathrm{twa}}$ is approaching the center by minimizing the training loss. As long as the training loss serves as meaningful supervision (which holds under the typical assumption that $\boldsymbol{\mu}$ is the center minimum with lowest training loss Mandt et al. (2017); Izmailov et al. (2018)), $\boldsymbol{w}_{\mathrm{twa}}$ could approach $\boldsymbol{\mu}$ better than $\boldsymbol{w}_{\mathrm{swa}}$ with the posterior optimization for averaging coefficients. In this regard, $\boldsymbol{w}_{\mathrm{twa}}$ could have a lower expected variance: $\mathbb{E}\left(\|\boldsymbol{w}_{\mathrm{twa}} - \boldsymbol{\mu}\|_2^2\right) \leq \mathbb{E}\left(\|\boldsymbol{w}_{\mathrm{swa}} - \boldsymbol{\mu}\|_2^2\right)$ . + +The advantages of optimizing averaging coefficients could be more prominent in the head stage of training, where the weights are going through a rapid evolution. A simple averaging strategy as SWA could introduce a large estimation error (as illustrated in Table 3 and 4), while TWA enables correcting it to a smaller estimation error via optimization. In fact, TWA provides much more flexibility to sufficiently utilize historical solutions and produces an optimized solution adaptively. + +# 4 AN EFFICIENT IMPLEMENTATION FOR DISTRIBUTED TRAINING + +The above discussion shows promising improvement by optimizing the historical solutions. The only issue one may worry about is the burden in storage (the additional time complexity is small as shown in Table 6). During optimization, TWA requires the projection matrix $P$ involving dozens or hundreds of historical weights, which indeed poses a challenge for large models on storage burden. It is preferable to locate $P$ in GPUs to enable efficient matrix operations. However, the size of $P$ increases as the model becomes larger, making it prohibitive to store in a single GPU. To cope with this, we design an efficient scheme with parallel distributed training to enable a) partition of the memory burden of $P$ into multiple GPUs and b) efficient parallel computation of gradient projection. As a result, we successfully optimize more than 900 historical solution coefficients for ResNet-50 on ImageNet task by 4 v100 GPUs. In our experiments, we use at most 300 historical solutions and there is still available space for larger tasks. + +Suppose that there are $k$ GPUs for parallel training. We first uniformly divide $P$ into $k$ sub-matrices as $P = [P_{1}, P_{2}, \dots, P_{k}]$ , where each GPU stores a local sub-matrix $P_{i}$ , $i = 1, \dots, k$ . Recall that for an iteration in distributed training, each GPU computes a local gradient $g_{i}$ and synchronizes it with other GPUs to obtain the global gradient through an efficient all-reduce operation (Rabenseifner, 2004). We mimic such a process for gradient projection: the local projected gradient $P_{i} P_{i}^{\top} g$ is firstly computed in each card and then synchronized with others to obtain the global projected gradient with another all-reduce operation. We illustrate such a process in Figure 2. + +For averaging $n$ historical solutions with per size $B$ , the memory burden for each GPU card is reduced to $\lceil n / k \rceil B$ , while the computation of gradient projection is also reduced to $\mathcal{O}(\lceil n / k \rceil D)$ ( $D$ + +![](images/ee0b356fb013b229208647a12b0d6952bb6080313acd5653691909e551721fb6.jpg) +Figure 3: Performance comparisons on before and after TWA w.r.t. different epochs of weights used. "SGD final" indicates the accuracy reached by regular SGD training and "TWA" is the corresponding accuracy reached by Algorithm 1 with these epochs of weights. The final accuracy of SGD training is plotted for reference. TWA dramatically lifts the SGD accuracy and outperforms the final accuracy of SGD within 100 epochs. The experiments are repeated over 3 trials. + +is the number of the parameters). Hence, we can achieve efficient TWA training by making full use of the remaining memory of each GPU aside the forward/backward training. + +# 5 EXPERIMENTS + +In this section, a series of numerical experiments are conducted, demonstrating the effectiveness of our proposed TWA for fast convergence and better performance. First, we show that TWA improves SWA in the existing SWA settings, i.e., used in the tail stage of training. Second, we apply TWA to the head stage of training, which brings significant efficiency improvements together with better performance. Then, we visualize loss / accuracy surfaces to demonstrate the improvements of TWA. + +# 5.1 EXPERIMENTAL SETTINGS + +Datasets. We experiment over three benchmark image datasets, i.e., CIFAR-10, CIFAR-100 (Krizhevsky & Hinton, 2009), and ImageNet (Deng et al., 2009). Following prior works (Izmailov et al., 2018; Yang et al., 2019), we apply standard preprocessing for experiments on CIFAR datasets, and adopt the preprocessing and data augmentation procedures in the public Pytorch example on ImageNet (Paszke et al., 2017). + +Architectures. We use two representative architectures, VGG-16 (Simonyan & Zisserman, 2014) and PreAct ResNet-164 (He et al., 2016) on CIFAR experiments. For ImageNet, we use ResNet-18 and ResNet-50 (He et al., 2016). + +Training. The main body of experiments contains two parts: (1) for the tail stage of training, we use the same hyper-parameters as in SWA (Izmailov et al., 2018) and then a larger tail learning rate is also tried. (2) for the head stage of training, we adopt the standard training protocol with a step-wise learning rate. For CIFAR, we run all experiments with 3 seeds and report the mean test accuracy. We use SGD optimizer with momentum 0.9, weight decay $10^{-4}$ , and batch size 128. We train the models for 200 epochs with an initial learning rate 0.1 and decay it by 10 at the 100th and the 150th epochs. For ImageNet, we follow official PyTorch implementation1. For TWA, we sample solutions once after each epoch training for CIFAR and uniformly sample 5 times per epoch for ImageNet. We use a scaled learning rate (Figure 4), which takes 10 epochs of training for CIFAR and 2 epochs for ImageNet for fast convergence. The regularization coefficient $\lambda$ defaults to $10^{-5}$ . More details (including the number of the historical solutions used) could be found in Appendix A. + +# 5.2 IMPROVING SWA SOLUTIONS + +In this part, we compare SWA and TWA in the original SWA settings. Specifically, TWA and SWA use the same weights sampled from the tail stage of training. For CIFAR, we try two different tail learning rates: 0.05, the recommended one in (Izmailov et al., 2018), and 0.10, a larger one for the case with greater variance. The results in Table 1 show that TWA brings consistent improvements + +![](images/7f6d5e70f9136db922bd766ed33a10c6bc2df4913d60bb03a410eecbb8e65d96.jpg) +Figure 4: Left: Scaled learning rate schedules with different scaling factors; Middle and Right: Test accuracy curves of TWA w.r.t. to different schedules on CIFAR-10/100. Training in subspace shows high robustness to scaled learning rate, which enlarges the learning rate and reduces the corresponding training epochs. In this way, TWA achieves very fast convergence. + +![](images/8631ac01c498cd1403097b0459d419342b7b378dae673eb68bfdfff6664ecb19.jpg) + +![](images/1472de0ef0a4438588be2a004506a955fd5f534ad7e8e07fb773ee4ad03d7dec.jpg) + +over SWA. Especially when the learning rate is not well-tuned, SWA's performance suffers a distinctive drop, but TWA is less sensitive since the estimation error could be well controlled through training. For instance, in the case of CIFAR-100 with VGG-16 and a tail learning rate of 0.10, the estimation error of SWA substantially increases while TWA achieves a significant accuracy improvement, i.e., $4.18\%$ , over SWA. Note that for a fair comparison, TWA starts from the last sampled weights, not the averaged solution of SWA. + +Table 1: Test accuracy (%) on CIFAR-10/100 for tail training with different learning rates + +
DATASETMODELSWA_LR = 0.05SWA_LR = 0.10
SWATWA (+10)SWATWA (+10)
CIFAR-10VGG1694.01 ± 0.0494.16 ± 0.1491.03 ± 0.1492.41 ± 0.15
PRERESNET-16495.58 ± 0.0995.65 ± 0.1391.58 ± 0.4592.61 ± 0.09
CIFAR-100VGG1674.71 ± 0.0375.73 ± 0.1865.52 ± 0.2569.70 ± 0.45
PRERESNET-16480.20 ± 0.4180.35 ± 0.2778.14 ± 0.4878.87 ± 0.27
+ +On ImageNet, we experiment with ResNet-18/50 (He et al., 2016). Following (Izmailov et al., 2018; Yang et al., 2019), we start from pre-trained models in torchvision.models and collect model weights by running SGD optimizer up to 10 epochs (with a constant learning rate 0.005). In Table 2, we report the test accuracy and observe that with more sampling epochs, both TWA and SWA achieve better performance. Notably, TWA performs better than SWA by $0.1 \sim 0.3\%$ , and such improvements are more obvious in the "5 EPOCHS" case. For example, using 5 epochs of sampled weights, TWA achieves $70.23\%$ accuracy with ResNet-18 and $76.78\%$ accuracy with ResNet-50, outperforming the SWA counterparts with 10 epochs. This indicates that TWA requires fewer historical solution samples to achieve a comparable or even better performance than SWA, due to its ability to reduce the estimation variance with optimized averaging coefficients. + +Table 2: Top-1 accuracy (%) on ImageNet for tail training with different averaging epochs + +
MODELPRETRAINED5 EPOCHS10 EPOCHS
SWATWA (+1)SWATWA (+1)
RESNET-1869.7670.0270.2870.1270.32
RESNET-5076.1376.6276.7876.7476.93
+ +# 5.3 EFFICIENT TRAINING AND BETTER GENERALIZATION + +In the head stage of training, SWA usually fails due to the large estimation variance from fast-evolving solutions and large learning rate. Since TWA could reduce the variance and be less sensitive to the learning rate, it can also be expected to work well in this stage. If so, it is promising to simultaneously attain generalization improvements and training efficiency. + +We first investigate the experiments on CIFAR datasets. The original training schedule contains 200 epochs and we take the first 100 epoch explorations for TWA. The results are given in Table 3. It can be observed that TWA achieves better performance compared to the regular SGD training with a significantly reduced generalization gap. For instance, we attain $1.52\%$ accuracy improvement on CIFAR-100 with VGG-16 while the generalization gap is reduced by $9.56\%$ . This suggests that a better solution could already be composed using these historical solutions without further training by more delicate learning rates, which instead may bring overfitting problems and harm the generalization. By comparisons, we also apply SWA to average these samples, which shows degraded performance due to the existence of estimation error. Apart from the good performance in accuracy, TWA also manifests its great potential in improving the training efficiency: we use only 10 epochs to complete the convergence, while the regular SGD needs 100 epochs. As TWA and SGD have nearly the same computation overhead per epoch, the time-saving is around $45\%$ in TWA. + +Table 3: Test accuracy (%) and generalization gap (%) on CIFAR-10/100 for the head training + +
DATASETMODELSGD (200 EPOCHS)SWA (100 EPOCHS)TWA (100 + 10 EPOCHS)
ACCURACYGAPACCURACYACCURACYGAP
CIFAR-10VGG1693.54 ± 0.116.4292.40 ± 0.0893.79 ± 0.185.59 (↓ 0.83)
PRERESNET-16495.11 ± 0.174.8692.52 ± 0.0495.19 ± 0.044.11 (↓ 0.75)
CIFAR-100VGG1672.72 ± 0.1726.7069.18 ± 0.2474.24 ± 0.2417.14 (↓ 9.56)
PRERESNET-16475.85 ± 0.1824.1073.36 ± 0.3478.11 ± 0.1920.02 (↓ 4.08)
+ +Generally, utilizing more epochs of explorations can provide a better estimation for the center minimum and hence lead to better performance. Then, we also study the impact of different averaging epochs, and the results are illustrated in Figure 3, where the final accuracy of SGD and the accuracy reached by SGD before averaging are also given for reference. It could be observed that the model's performance is consistently improved with more epochs of explorations. Notably, although each historical solution in a relatively short period of explorations is not good, satisfied solutions have already emerged in the subspace spanned by these solutions. Then through proper optimization in subspace, TWA could find them out, e.g., on CIFAR-100 with PreAct ResNet-164 model, averaging over 50 epochs via TWA has already matched the final performance of regular SGD training. + +Table 4: Top-1 accuracy (%) and generalization gap (%) on ImageNet for head training + +
MODELSGD (90 EPOCHS)SWA (60 EPOCHS)TWA (60 + 2 EPOCHS)
ACCURACYGAPACCURACYACCURACYGAP
RESNET-1869.82-1.5962.1969.82-2.36 (↓ 0.77)
RESNET-5075.820.2567.6675.90-0.68 (↓ 0.93)
+ +For ImageNet, the efforts required for each epoch training are much greater, and hence efficient methods to reduce the training epochs are highly desirable. The comparison results of SGD/SWA/TWA are shown in Table 4. Besides the reduced generalization gap, TWA takes only 2 epochs to average the historical solutions of the first 60 epochs, reaching comparable or even better performance than regular SGD training with 90 epochs. For comparison, Lookahead (Zhang et al., 2019) is another advanced optimizer recently proposed for improving convergence and reported $75.49\%$ accuracy at the 60th epoch (Table 2 in Zhang et al. (2019)) with an aggressive learning rate decay (i.e., the learning rate is decayed at the 30th, 48th, and 58th epochs), while our TWA reaches $75.70\%$ with the same budget but simply using the conventional decay. + +TWA is very flexible and can be readily applied to different training stages, and we also conduct an experiment by averaging the solutions of the final training period (i.e. 61-90 epochs) and simply performing TWA for one epoch training, as presented in Table 5. Such cheap training still shows to bring significant improvements (e.g. $+0.51\%$ on ResNet-50 for Ima + +Table 5: Top-1 accuracy (%) on ImageNet for tail training and short TWA + +
MODELSGDTWA (+1 EPOCH)
RESNET-1869.8270.37
RESNET-5075.8276.34
+ +geNet). Thus, TWa can serve as an effective approach for composing a better final solution. + +Scaled learning rate The optimization of TWA is conducted in a very low-dimensional space, which also suppresses the sensitivity of the learning rate. In fact, we can allow a very large learning rate to accelerate the training. Thereby, we design a scaled learning rate, which linearly scales up the learning rate and reduces the training epochs accordingly, as shown in Figure 4. Within an appropriate range, scaling the learning rate largely speeds up the convergence without affecting the final performance. For example, with the learning rate of 4, TWA approaches the final accuracy with only 1 epoch and converges within 5 epochs. + +Wall-clock time comparison In the above experiments, we report the number of training epochs, since the wall-clock time per epoch for SGD and TWA is similar. As an illustration, Table 6 provides the wall-clock time of training PreAct ResNet-164 for CIFAR-100 on one Nvidia Geforce GTX 2080 TI. + +Comparison with EMA EMA serves as an alternative to SWA, which averages the model weights along the training trajectory with exponential decay. It requires a hyper-parameter $\gamma$ to control the averaging horizons. As a manually defined averaging strategy, EMA could be sensitive to learning rates, datasets, architectures, etc. Here we compare the performance of EMA with SWA and TWA in the head stage of training, where we try $\gamma = 0.99 / 0.999$ . The results are illustrated in Figure 5. We observe that the performance of EMA varies significantly with differ + +Table 6: Wall-clock time per epoch + +
OPTIMIZERTIME PER EPOCH
SGD59.04s
TWA60.20s
+ +![](images/24706b94062d95f9afd82d9ef605c3c54ed124711024640c5b61a2a0d1802ddf.jpg) +Figure 5: Comparisons with EMA. + +ent choices of $\gamma$ . It could perform notably better than SWA in the early stage of training as more weight is paid to the latest solutions. Note that both EMA and SWA are fixed averaging strategies for adapting different training stages (essentially could be viewed as particular solutions of TWA). By optimizing the averaging coefficients, TWA could consistently achieve better performance. + +Optimized Averaging Coefficients In Figure 6, we visualize the averaging coefficients $\alpha_{i}$ learned by TWA. Detailed derivation could be found in Appendix D. We observe all historical solutions could contribute to the final solutions. Solutions from the latter training stage are attached with more importance as expected. Different from the fix averaging strategies like SWA or EMA, such averaging coefficients enable to take full advantage of the historical solutions through delicate optimization and better adapt to the training dynamics. + +![](images/9475a49018b04a88a4d923d6ed01c5904054365772a7cb3e0691869e78c761c3.jpg) +Figure 6: Averaging coefficients of TWA. + +# 5.4 LANDSCAPE VISUALIZATION + +Following (Garipov et al., 2018; Izmailov et al., 2018), we visualize the training loss and test error surfaces of SWA and TWA in Figure 7 on CIFAR-100 with PreAct ResNet-164. We set the SGD solution after 125 training epochs as the origin and plot the TWA and SWA solutions on the plane. For the case with a default learning rate of 0.05, TWA achieves slightly better test accuracy with lower training loss. This shows that in the subspace, minimizing the training loss is meaningful and results in lower test errors. Especially for the case with a larger learning rate of 0.10, the superiority of TWA over SWA is more significant (over $0.7\%$ improvement on test accuracy), since the variance grows larger and the variance reduction effect of TWA becomes more obvious. + +# 6 RELATED WORK + +Improving the model's generalization capability is of great importance and has received wide attention. The recent efforts mainly focus on two aspects: (1) proper regularization terms to search for more flat minimum (Keskar et al., 2016; Li et al., 2018), such as weight decay (Krogh & Hertz, 1991), dropout (Srivastava et al., 2014), label smoothing (Szegedy et al., 2016), Shake-Shake (Gastaldi, + +![](images/baf8fd3daba5ae56437c01e9bcc8881acc2702c827c629692a1af584faabfd8b.jpg) + +![](images/253efd57a746fc56718e499b9d424e16dca94ba9abec611a7daa1edfb2beed54.jpg) + +![](images/d5c8fd6a7183f6b457192369c060499493c285a57c428cb6c369cb8a93d0f509.jpg) +(a) $\mathrm{SWA\_LR} = 0.05$ +(b) $\mathrm{SWA\_LR} = 0.10$ +Figure 7: Train loss and test error surface of TWA and SWA with different SWA_LR. + +![](images/ed73e6d82a772a52ecfeee0303616c0506ff16b977089666d6976f450cf45c75.jpg) + +2017), MixUp (Zhang et al., 2018), SAM (Foret et al., 2020) and AMP (Zheng et al., 2021); (2) effective data augmentation to diversify the dataset, such as Cutout (DeVries & Taylor, 2017), AutoAugment (Cubuk et al., 2019) and RandAugment (Cubuk et al., 2020). Different from these techniques, we improve the generalization ability by constraining the training in a low-dimensional subspace spanned by historical explorations, which regularizes the model complexity. We note that TWA is orthogonal to these methods, and it is promising to combine them for boosted improvements. + +A lot of efforts have been made to speed up the DNNs' training. Apart from the well-known methods on adaptive learning rates, e.g. Adam (Kingma & Ba, 2015) and accelerated schemes, e.g. Nesterov momentum Nesterov (1983), a new method is proposed in Zhang et al. (2019) proposed, where a look-ahead search direction generated by another "fast" optimizer is utilized, achieving faster convergence and better learning stability. Goyal et al. (2017) adapted a large mini-batch to speed up the training and introduced a scaling rule for adjusting the learning rates. In this paper, we realize training efficiency by sufficiently utilizing the historical solutions of DNNs' training and conducting training in a subspace with substantially reduced dimensions. + +For utilizing historical explorations, SWA (Izmailov et al., 2018) adopts a simple averaging strategy at the tail of training. Cha et al. (2021) extended it to the domain generalization task with a dense and overfit-aware stochastic weight sampling strategy. We firstly propose to utilize the explorations at the head stage of training to achieve training efficiency. Exponentially decaying running average (Hunter, 1986; Szegedy et al., 2016) is a common technique adopted by practitioners. It requires a manually set averaging horizon and generally performs comparably as SGD (Izmailov et al., 2018). Another closely related work is model soups (Wortsman et al., 2022), which improves the model performance by averaging the weights from different fine-tuning configurations in a greedy order. We differ in that the historical solutions are from one single configuration. We mainly focus on improving training efficiency and optimizing the averaging coefficients in a trainable manner. + +# 7 CONCLUSION + +In this work, we propose TWA, a novel training algorithm that optimizes the averaging coefficients of historical solutions in DNNs' training to achieve efficiency and better performance. It differs from the manually set averaging strategies as SWA or EMA and manifests better adaptation to different stages of training. We further design a parallel framework for large-scale training with efficiency in memory and computation. Extensive experiments demonstrate the superior performance of TWA on benchmark computer vision tasks with various architectures. + +# ACKNOWLEDGEMENTS + +We are very grateful for anonymous reviewers for the valuable feedback on the paper. We thank Minqi Chen at Huawei Technologies for the great support. The research leading to these results has received funding from National Natural Science Foundation of China (61977046), Shanghai Science and Technology Program (22511105600), and Shanghai Municipal Science and Technology Major Project (2021SHZDX0102). + +# REFERENCES + +Ben Athiwaratkun, Marc Finzi, Pavel Izmailov, and Andrew Gordon Wilson. There are many consistent explanations of unlabeled data: Why you should average. In International Conference on Learning Representations (ICLR), 2018. +Junbum Cha, Sanghyuk Chun, Kyungjae Lee, Han-Cheol Cho, Seunghyun Park, Yunsung Lee, and Sungrae Park. Swad: Domain generalization by seeking flat minima. In Advances in Neural Information Processing Systems (NeurIPS), 2021. +Ekin D Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, and Quoc V Le. Autoaugment: Learning augmentation strategies from data. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 113-123, 2019. +Ekin D Cubuk, Barret Zoph, Jonathon Shlens, and Quoc V Le. Randaugment: Practical automated data augmentation with a reduced search space. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pp. 702-703, 2020. +Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 248-255, 2009. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018. +Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017. +John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research (JMLR), 12(7), 2011. +Pierre Foret, Ariel Kleiner, Hossein Mobahi, and Behnam Neyshabur. Sharpness-aware minimization for efficiently improving generalization. In International Conference on Learning Representations (ICLR), 2020. +Jonathan Frankle, Gintare Karolina Dziugaite, Daniel Roy, and Michael Carbin. Linear mode connectivity and the lottery ticket hypothesis. In International Conference on Machine Learning (ICML), 2020. +Timur Garipov, Pavel Izmailov, Dmitrii Podoprikhin, Dmitry P Vetrov, and Andrew G Wilson. Loss surfaces, mode connectivity, and fast ensembling of dnns. In Advances in Neural Information Processing Systems (NeurIPS), 2018. +Xavier Gastaldi. Shake-shake regularization of 3-branch residual networks. In Workshop Track Proceedings in International Conference on Learning Representations (ICLR), 2017. +Priya Goyal, Piotr Dólar, Ross Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, Andrew Tulloch, Yangqing Jia, and Kaiming He. Accurate, large minibatch sgd: TrainingImagenet in 1 hour. arXiv preprint arXiv:1706.02677, 2017. +Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770-778, 2016. + +Byeongho Heo, Sanghyuk Chun, Seong Joon Oh, Dongyoon Han, Sangdoo Yun, Gyuwan Kim, Youngjung Uh, and Jung-Woo Ha. Adamp: Slowing down the slowdown for momentum optimizers on scale-invariant weights. In International Conference on Learning Representations (ICLR), 2021. +J Stuart Hunter. The exponentially weighted moving average. Journal of Quality Technology, 18(4): 203-210, 1986. +Pavel Izmailov, Dmitrii Podoprikhin, Timur Garipov, Dmitry Vetrov, and Andrew Gordon Wilson. Averaging weights leads to wider optima and better generalization. arXiv preprint arXiv:1803.05407, 2018. +Nitish Shirish Keskar, Dheevatsa Mudigere, Jorge Nocedal, Mikhail Smelyanskiy, and Ping Tak Peter Tang. On large-batch training for deep learning: Generalization gap and sharp minima. arXiv preprint arXiv:1609.04836, 2016. +Diederik P. Kingma and Jimmy Lei Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015. +Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical Report, 2009. +Anders Krogh and John Hertz. A simple weight decay can improve generalization. In Advances in Neural Information Processing Systems (NeurIPS), 1991. +Hao Li, Zheng Xu, Gavin Taylor, Christoph Studer, and Tom Goldstein. Visualizing the loss landscape of neural nets. In Advances in Neural Information Processing Systems (NeurIPS), 2018. +Tao Li, Lei Tan, Zhehao Huang, Qinghua Tao, Yipeng Liu, and Xiaolin Huang. Low dimensional trajectory hypothesis is true: Dnns can be trained in tiny subspaces. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 2022. +Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017. +Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In International Conference on Learning Representations (ICLR), 2019. +Stephan Mandt, Matthew D Hoffman, and David M Blei. Stochastic gradient descent as approximate bayesian inference. Journal of Machine Learning Research (JMLR), 18:1-35, 2017. +Yurii Nesterov. On an approach to the construction of optimal methods of minimization of smooth convex functions. *Ekonomika i Mateaticheskie Metody*, 24(3):509-517, 1988. +Yurii Nesterov. Introductory lectures on convex optimization: A basic course, volume 87. Springer Science & Business Media, 2003. +Yurii E Nesterov. A method for solving the convex programming problem with convergence rate o $(1 / k^2)$ . In Dokl. akad. nauk Sssr, volume 269, pp. 543-547, 1983. +Evgenii Nikishin, Pavel Izmailov, Ben Athiwaratkun, Dmitrii Podoprikhin, Timur Garipov, Pavel Shvechikov, Dmitry Vetrov, and Andrew Gordon Wilson. Improving stability in deep reinforcement learning with weight averaging. In Uncertainty in Artificial Intelligence Workshop on Uncertainty in Deep learning, 2018. +Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in pytorch. 2017. +Boris T Polyak. Some methods of speeding up the convergence of iteration methods. Ussr Computational Mathematics and Mathematical Physics, 4(5):1-17, 1964. +Rolf Rabenseifner. Optimization of collective reduction operations. In International Conference on Computational Science, pp. 1-9. Springer, 2004. + +Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. +Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. Journal of Machine Learning Research (JMLR), 15(1):1929-1958, 2014. +Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2818-2826, 2016. +Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R Bowman. Glue: A multi-task benchmark and analysis platform for natural language understanding. arXiv preprint arXiv:1804.07461, 2018. +Mitchell Wortsman, Gabriel Ilharco, Samir Ya Gadre, Rebecca Roelofs, Raphael Gontijo-Lopes, Ari S Morcos, Hongseok Namkoong, Ali Farhadi, Yair Carmon, Simon Kornblith, et al. Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference time. In International Conference on Machine Learning (ICML), 2022. +Guandao Yang, Tianyi Zhang, Polina Kirichenko, Junwen Bai, Andrew Gordon Wilson, and Chris De Sa. Swalp: Stochastic weight averaging in low precision training. In International Conference on Machine Learning (ICML), pp. 7015-7024. PMLR, 2019. +Zhewei Yao, Amir Gholami, Sheng Shen, Mustafa Mustafa, Kurt Keutzer, and Michael W. Mahoney. ADAHESSIAN: an adaptive second order optimizer for machine learning. In Thirty-Fifth AAAI Conference on Artificial Intelligence, AAAI, 2021. +Haoran You, Chaojian Li, Pengfei Xu, Yonggan Fu, Yue Wang, Xiaohan Chen, Richard G Baraniuk, Zhangyang Wang, and Yingyan Lin. Drawing early-bird tickets: Towards more efficient training of deep networks. In International Conference on Learning Representations (ICLR), 2020. +Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. In Richard C. Wilson, Edwin R. Hancock, and William A. P. Smith (eds.), British Machine Vision Conference (BMVC), 2016. +Matthew D Zeiler. Adadelta: an adaptive learning rate method. arXiv preprint arXiv:1212.5701, 2012. +Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. In International Conference on Learning Representations (ICLR), 2018. +Michael Zhang, James Lucas, Jimmy Ba, and Geoffrey E Hinton. Lookahead optimizer: k steps forward, 1 step back. In Advances in Neural Information Processing Systems (NeurIPS), 2019. +Yaowei Zheng, Richong Zhang, and Yongyi Mao. Regularizing neural networks via adversarial model perturbation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 8156-8165, 2021. + +# A TRAINING DETAILS + +For SWA experiments, we replicate the SWA baseline by using the publicly released implementation of Izmailov et al. (2018). We use VGG-16 architecture with batch normalization for a unified learning rate setting as PreAct ResNet-164. For ImageNet experiments, we follow official PyTorch implementation. We use a scaled learning rate for TWA training with 20x and 30x factors on CIFAR and ImageNet, respectively (e.g. the original learning rate of 0.1 is scaled up to 2 on CIFAR). CIFAR experiments are performed on one Nvidia Geforce GTX 2080 TI GPU, while ImageNet experiments are on four NVIDIA Tesla A100. The number of historical solutions optimized by TWA is presented in Table A1. + +We now disclose the specific hyper-parameters in the following. + +Table A1: The number of historical solutions optimized by TWA + +
DATASETSSAMPLING EPOCHSTIMES / EPOCH#NUM
CIFAR1001100
IMAGENET605300
+ +# A.1 SWATRAINING + +# A.1.1 CIFAR + +We use the same schedule and hyper-parameters as in Izmailov et al. (2018). For VGG-16, we use weight decay of $5 \times 10^{-4}$ and train the model for 300 epochs with weight averaging at 161 to 300 epochs. For PreAct ResNet-164, we use weight decay of $3 \times 10^{-4}$ and train the model for 225 epochs with weight averaging at 126 to 225 epochs. + +For TWA training, we use the same weights as SWA and initialize $w_{\mathrm{twa}}$ as the last checkpoint (i.e. 300/225 epochs). We train the models for 10 epochs with an initial learning rate of 2 and decay it by 10 at the 5th and 8th epochs. The regularization coefficient $\lambda$ is set to $5 \times 10^{-5}$ . + +# A.1.2 IMAGENET + +Following Izmailov et al. (2018); Yang et al. (2019), we start from pre-trained models (they are from torchvision.models) and collect weights by running SGD optimizer up to 10 epochs (with a constant learning rate 0.005, weight decay $1 \times 10^{-4}$ ). We uniformly sample the solutions 5 times per epoch. + +For TWA training, we use the same weights as SWA and initialize $\boldsymbol{w}_{\mathrm{twa}}$ as the pre-trained model. For ImageNet, there are many iterations in one epoch, and hence we conduct TWA training for one epoch, in which we linearly decay the learning rate from 0.03 to 0. The regularization coefficient $\lambda$ is set to $1 \times 10^{-5}$ . + +# A.2 REGULAR TRAINING + +# A.2.1 CIFAR + +For regular training, we train the models for 200 epochs with an initial learning rate of 0.1 and decay it by 10 at the 100th and the 150th epoch. We use SGD optimizer with momentum 0.9, weight decay $1 \times 10^{-4}$ , and batch size 128 by convention. + +For TWA training, we initialize $\mathbf{w}_{\mathrm{twa}}$ as $\frac{1}{n} \sum_{i=1}^{n} \mathbf{w}_i$ , i.e., the center of sampled solutions. We train the models for 10 epochs with an initial learning rate of 2 and decay it by 10 at the 5th and 8th epochs. The regularization coefficient $\lambda$ is set to $1 \times 10^{-5}$ . + +# A.2.2 IMAGENET + +We follow the training protocol described in He et al. (2016). Specifically, we train the models for 90 epochs with an initial learning rate of 0.1 and decay it by a factor of 10 every 30 epochs. We use SGD optimizer with momentum 0.9, weight decay $1 \times 10^{-4}$ , and batch size 256. + +For TWA training, we uniformly sample solutions 5 times per epoch and initialize $\boldsymbol{w}_{\mathrm{twa}}$ as $\frac{1}{n}\sum_{i=1}^{n}\boldsymbol{w}_i$ . We train the models for 2 epochs with a learning rate of 0.3 and 0.03, respectively. For the extra one epoch training, we use the same training protocol as in subsection A.1.2, i.e., linearly decaying the learning rate from 0.03 to 0. The regularization coefficient $\lambda$ is set to $1\times 10^{-5}$ . + +# A.2.3 RESULTS ON ADAM OPTIMIZER + +Adam (Kingma & Ba, 2015) is another mainstream optimizer with adaptive gradient descent, which enjoys fast convergence and insensitivity to the initial learning rate. Here, we apply TWA to the solutions generated by Adam optimizer and the results are in Table A2. The training settings are the same as in Table 3 with default $\beta_{1} = 0.9$ and $\beta_{2} = 0.999$ for Adam. TWA is trained for 5 epochs + +with a initial learning rate 3. We observe that it could similarly bring generalization improvement and training efficiency. + +Table A2: Test accuracy (%) and generalization gap (%) on CIFAR-10/100 with Adam Optimizer + +
DATASETMODELADAM (200 EPOCHS)SWA (100 EPOCHS)TWA (100 + 5 EPOCHS)
ACCURACYGAPACCURACYACCURACYGAP
CIFAR-10VGG1693.60 ± 0.126.3192.39 ± 0.0793.63 ± 0.115.74 (↓ 0.57)
PRERESNET-16495.09 ± 0.114.8992.65 ± 0.0395.16 ± 0.093.85 (↓ 1.04)
CIFAR-100VGG1672.77 ± 0.1326.6768.74 ± 0.0574.07 ± 0.0717.35 (↓ 9.32)
PRERESNET-16476.23 ± 0.1423.7173.09 ± 0.1377.96 ± 0.1419.62 (↓ 4.09)
+ +# B IMPLEMENTATION + +Let $\pmb {\beta} = [\beta_{1},\beta_{2},\dots ,\beta_{n}]^{\top}\in \mathbb{R}^{n}$ $\pmb {P} = [e_1,e_2,\dots ,e_n]\in \mathbb{R}^{D\times n}$ , the optimization target for TWA can be formulated as, + +$$ +\min _ {\boldsymbol {\beta}} L (\boldsymbol {\beta}) \triangleq \mathbb {E} _ {(\boldsymbol {x}, \boldsymbol {y}) \sim \mathcal {D}} \left[ \mathcal {L} \left(f \left(\boldsymbol {w} _ {\mathrm {t w a}}; \boldsymbol {x}\right), \boldsymbol {y}\right) \right] + \frac {\lambda}{2} \boldsymbol {\beta} ^ {\top} \boldsymbol {\beta}, \tag {A.1} +$$ + +$$ +\begin{array}{l l} \text {s . t .} & \boldsymbol {w} _ {\mathrm {t w a}} = \boldsymbol {P} \boldsymbol {\beta}. \end{array} +$$ + +We short the loss term $\mathbb{E}_{(\boldsymbol{x},\boldsymbol{y})\sim \mathcal{D}}[\mathcal{L}(f(\boldsymbol{w};\boldsymbol{x}),\boldsymbol{y})]$ to $\mathcal{L}(\boldsymbol{w})$ and the gradient w.r.t. $\beta$ can be written as, + +$$ +\begin{array}{l} \frac {\partial L}{\partial \boldsymbol {\beta}} = \frac {\partial \boldsymbol {w} _ {\mathrm {t w a}}}{\partial \boldsymbol {\beta}} \frac {\partial \mathcal {L} (\boldsymbol {w} _ {\mathrm {t w a}})}{\partial \boldsymbol {w} _ {\mathrm {t w a}}} + \lambda \boldsymbol {\beta} (A.2) \\ = \boldsymbol {P} ^ {\top} \frac {\partial \mathcal {L} \left(\boldsymbol {w} _ {\mathrm {t w a}}\right)}{\partial \boldsymbol {w} _ {\mathrm {t w a}}} + \lambda \boldsymbol {\beta}. (A.3) \\ \end{array} +$$ + +Let $\eta$ be the learning rate. We could optimize (A.1) with the following gradient descent: + +$$ +\boldsymbol {\beta} ^ {(t + 1)} = \boldsymbol {\beta} ^ {(t)} - \eta \left(\boldsymbol {P} ^ {\top} \frac {\partial \mathcal {L} \left(\boldsymbol {w} _ {\mathrm {t w a}} ^ {(t)}\right)}{\partial \boldsymbol {w} _ {\mathrm {t w a}}} + \lambda \boldsymbol {\beta}\right). \tag {A.4} +$$ + +Since $\pmb{w}_{\mathrm{twa}} = \pmb{P}\pmb{\beta}$ , we have the corresponding update in the parameter space: + +$$ +\begin{array}{l} \boldsymbol {w} _ {\mathrm {t w a}} ^ {(t + 1)} = \boldsymbol {w} _ {\mathrm {t w a}} ^ {(t)} - \eta \left(\boldsymbol {P} \boldsymbol {P} ^ {\top} \frac {\partial \mathcal {L} \left(\boldsymbol {w} _ {\mathrm {t w a}} ^ {(t)}\right)}{\partial \boldsymbol {w} _ {\mathrm {t w a}}} + \lambda \boldsymbol {P} \beta\right) (A.5) \\ = (1 - \eta \lambda) \boldsymbol {w} _ {\mathrm {t w a}} ^ {(t)} - \eta \boldsymbol {P} \boldsymbol {P} ^ {\top} \frac {\partial \mathcal {L} \left(\boldsymbol {w} _ {\mathrm {t w a}} ^ {(t)}\right)}{\partial \boldsymbol {w} _ {\mathrm {t w a}}}. (A.6) \\ \end{array} +$$ + +As $\beta$ does not explicitly appear in (A.6), we could treat the coefficient $\beta$ as an implicit variable. In practice, we optimize (A.1) by directly updating the model weights $w_{\mathrm{twa}}$ with weight decay $\lambda$ , which is an optimization in the reduced subspace with projection matrix $\boldsymbol{P}\boldsymbol{P}^{\top}$ . + +# C SWA WITH DIFFERENT STARTING EPOCHS + +We test the performance of SWA with different starting epochs to average on ImageNet with the ResNet-50 model. We observe that the performance of SWA gradually becomes better with the relatively latter stage of solutions averaged, showing that SWA could not adapt well to the head stage of training where the solutions are fast-evolving. Hence, a good solution for SWA may require manually selecting which period to average. We also notice that TWA (with 0-60 epoch solutions) consistently outperforms the SWA wherever the averaging begins, confirming that TWA could automatically find a good set of averaging coefficients and provide better performance. + +
SWA Epoch 0-60SWA Epoch 10-60SWA Epoch 20-60SWA Epoch 30-60SWA Epoch 40-60SWA Epoch 50-60TWA Epoch 0-60
67.6670.5072.1274.1475.0875.3475.90
+ +Table C3: SWA with different starting epochs. + +# D DISCUSSION ON THE SUM-ONE CONSTRAINT + +Let $\alpha = [\alpha_{1},\alpha_{2},\dots ,\alpha_{n}]^{\top}\in \mathbb{R}^{n}$ , $W = [w_{1},w_{2},\dots ,w_{n}]\in \mathbb{R}^{D\times n}$ , we have $w_{\mathrm{twa}} = W\alpha$ . We multiply $W^{\top}$ on the both sides, i.e., $W^{\top}w_{\mathrm{twa}} = W^{\top}W\alpha$ , and could obtain $\pmb{\alpha} = (W^{\top}W)^{-1}W^{\top}\pmb{w}_{\mathrm{twa}}$ . Further, we could establish the relation between $\alpha$ and $\beta$ : $\pmb{\alpha} = (W^{\top}W)^{-1}W^{\top}\pmb{P}\beta$ , since they are the coordinates of $w_{\mathrm{twa}}$ under two different set of bases. + +In the solution set $A = \{\alpha_{1}\pmb{w}_{1} + \alpha_{2}\pmb{w}_{2} + \dots +\alpha_{n}\pmb{w}_{n} \mid \alpha_{i}\in \mathbb{R}\}$ , we do not explicitly require that the sum of averaging coefficients $\sum_{i = 1}^{n}\alpha_{i}$ to be 1 since the network's performance would be sensitive to a direct scaling over all parameters (i.e. $k\pmb{w}$ ), that is, a good solution in $A$ will inherently have a coefficient sum very close to 1. We verify the sum of the averaging coefficients of the attained solution $\pmb{w}_{\mathrm{twa}}$ on CIFAR-100 with PreResNet-164 model and observe that $\sum_{i = 1}^{n}\alpha_{i} = 1.02_{\pm < 0.01}$ . + +# E NUMERICAL DISCUSSION FOR DDP TRAINING + +We numerically measure the averaged epoch training time and memory burden for SGD and TWA in the DDP training setting. Specifically, we experiment with the ResNet-50 model on ImageNet and use 1, 2, and 4 GPUs with a batch size of 256 per GPU and a total of 300 historical solutions. The experiments are conducted on NVIDIA Tesla A100 40G GPUs. From the results reported in Table E4, we observe that TWA brings minor additional costs, e.g. $+2.8\%$ on time cost and $+2.9\%$ on memory burden with 4 GPUs, compared with regular SGD training. The additional memory burden becomes even minor with more GPUs. This shows that TWA could provide efficient and scalable averaging for large-scale problems. + +Table E4: Time and memory comparisons of SGD and TWA with DDP training. + +
#GPUsTimeMemory
SGDTWASGDTWA
11638s1692s (+3.3%)28286.5 MB31432.5 MB (+11.1%)
2824s862s (+4.6%)28382.5 MB30092.5 MB (+6.0%)
4420s432s (+2.8%)28874.5 MB29718.5 MB (+2.9%)
+ +# F ABLATION STUDY + +We conduct an ablation study in Table F5 to analyze the impact of the regularization coefficient $\lambda$ . We observe that such regularization brings improvements but is not significant. This is because the main regularization effects come from the significant decrease of training variables, i.e., regular training has $D$ variables but TWA contains only $n$ . Since such regularization is easy to implement and virtually brings little training cost, we include it in our method. + +Table F5: Ablation studies on the regularization coefficient $\lambda$ . + +
DatasetsModelTWATWA (λ = 0)
CIFAR-10VGG1693.79 ± 0.1893.78 ± 0.07
PreActResNet-16495.11 ± 0.0495.03 ± 0.09
CIFAR-100VGG1674.24 ± 0.2474.02 ± 0.16
PreActResNet-16478.11 ± 0.1978.01 ± 0.22
+ +# G ADDITIONAL RESULTS ON NLP TASKS + +For NLP datasets, we try a finetune task with pre-trained models and compare the performance of SWA and TWA. Specifically, we experiment with The Corpus of Linguistic Acceptability (CoLA), a text classification task in the General Language Understanding Evaluation (GLUE, Wang et al. (2018)) benchmark. In experiment, we use a pre-trained BERT (Devlin et al., 2018) model (bert-base-uncased) from Hugging Face community $^2$ . We fine-tune BERT on CoLA for 3 epochs with AdamW optimizer Loshchilov & Hutter (2017), learning rate 2e-5, and weight decay 0.0. The model weights at the end of these epochs are collected for SWA and TWA. In TWA, we train the fine-tuned model for 1 epoch with a learning rate of 0.5 and regularization coefficients $\lambda = 0.001$ . From the results below, we observe that TWA could achieve better performance than the competing methods. This further demonstrates the broad application of TWA. + +
Fine-tuneSWATWA
56.8159.7360.36
+ +Table G6: Fine-tune results on CoLA. \ No newline at end of file diff --git a/trainableweightaveragingefficienttrainingbyoptimizinghistoricalsolutions/images.zip b/trainableweightaveragingefficienttrainingbyoptimizinghistoricalsolutions/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..b665836328ad041fa0af2262750d6b9955feffb3 --- /dev/null +++ b/trainableweightaveragingefficienttrainingbyoptimizinghistoricalsolutions/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d22055f6908f5acef01ef0229b27d3d3218ced0621361d75822e389c76159555 +size 560374 diff --git a/trainableweightaveragingefficienttrainingbyoptimizinghistoricalsolutions/layout.json b/trainableweightaveragingefficienttrainingbyoptimizinghistoricalsolutions/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..c7df8b5a93d16202381d21d32a77f5d5cf6773c8 --- /dev/null +++ b/trainableweightaveragingefficienttrainingbyoptimizinghistoricalsolutions/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:44236c8c5559a50ed03200bb54772e5845261b39a6e944985971f625cf2e9ed5 +size 532602 diff --git a/trainingfreestructureddiffusionguidanceforcompositionaltexttoimagesynthesis/5a46c4a4-3176-4d02-a09b-ba17d6b20cfc_content_list.json b/trainingfreestructureddiffusionguidanceforcompositionaltexttoimagesynthesis/5a46c4a4-3176-4d02-a09b-ba17d6b20cfc_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..ca8fe93ce2ab8cb182a496e92caae72e2acadfc8 --- /dev/null +++ b/trainingfreestructureddiffusionguidanceforcompositionaltexttoimagesynthesis/5a46c4a4-3176-4d02-a09b-ba17d6b20cfc_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:30b4d1f137750d36e045948f0e8b96f140c795a7af7d65767f30aa7698d75253 +size 113476 diff --git a/trainingfreestructureddiffusionguidanceforcompositionaltexttoimagesynthesis/5a46c4a4-3176-4d02-a09b-ba17d6b20cfc_model.json b/trainingfreestructureddiffusionguidanceforcompositionaltexttoimagesynthesis/5a46c4a4-3176-4d02-a09b-ba17d6b20cfc_model.json new file mode 100644 index 0000000000000000000000000000000000000000..7bcde80fb4de3ff5d80653c35f1928ad18c6608e --- /dev/null +++ b/trainingfreestructureddiffusionguidanceforcompositionaltexttoimagesynthesis/5a46c4a4-3176-4d02-a09b-ba17d6b20cfc_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:04a5bed0b4b1964c902d207a5ddfa1d23aa91b2c4aea7b8c6f68a89e277b2b98 +size 134915 diff --git a/trainingfreestructureddiffusionguidanceforcompositionaltexttoimagesynthesis/5a46c4a4-3176-4d02-a09b-ba17d6b20cfc_origin.pdf b/trainingfreestructureddiffusionguidanceforcompositionaltexttoimagesynthesis/5a46c4a4-3176-4d02-a09b-ba17d6b20cfc_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e4e9beee91f51c5451175ebf58c9a7e13c7034ad --- /dev/null +++ b/trainingfreestructureddiffusionguidanceforcompositionaltexttoimagesynthesis/5a46c4a4-3176-4d02-a09b-ba17d6b20cfc_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b09383cea5a9a87c317f43b5c374648e80837ebab37eeeb496c3939433423a6d +size 8478686 diff --git a/trainingfreestructureddiffusionguidanceforcompositionaltexttoimagesynthesis/full.md b/trainingfreestructureddiffusionguidanceforcompositionaltexttoimagesynthesis/full.md new file mode 100644 index 0000000000000000000000000000000000000000..a53be4b3a10587521402a9b0a39079f2fe68f9b0 --- /dev/null +++ b/trainingfreestructureddiffusionguidanceforcompositionaltexttoimagesynthesis/full.md @@ -0,0 +1,495 @@ +# TRAINING-FREE STRUCTURED DIFFUSION GUIDANCE FOR COMPOSITIONAL TEXT-TO-IMAGE SYNTHESIS + +Weixi Feng $^{1}$ , Xuehai He $^{2}$ , Tsu-jui Fu $^{1}$ , Varun Jampani $^{3}$ , Arjun Akula $^{3}$ , Pradyumna Narayana $^{3}$ , Sugato Basu $^{3}$ , Xin Eric Wang $^{2}$ , William Yang Wang $^{1}$ $^{1}$ University of California, Santa Barbara, $^{2}$ University of California, Santa Cruz, $^{3}$ Google + +# ABSTRACT + +Large-scale diffusion models have achieved state-of-the-art results on text-to-image synthesis (T2I) tasks. Despite their ability to generate high-quality yet creative images, we observe that attribution-binding and compositional capabilities are still considered major challenging issues, especially when involving multiple objects. Attribute-binding requires the model to associate objects with the correct attribute descriptions, and compositional skills require the model to combine and generate multiple concepts into a single image. In this work, we improve these two aspects of T2I models to achieve more accurate image compositions. To do this, we incorporate linguistic structures with the diffusion guidance process based on the controllable properties of manipulating cross-attention layers in diffusion-based T2I models. We observe that keys and values in cross-attention layers have strong semantic meanings associated with object layouts and content. Therefore, by manipulating the cross-attention representations based on linguistic insights, we can better preserve the compositional semantics in the generated image. Built upon Stable Diffusion, a SOTA T2I model, our structured cross-attention design is efficient that requires no additional training samples. We achieve better compositional skills in qualitative and quantitative results, leading to a significant $5 - 8\%$ advantage in head-to-head user comparison studies. Lastly, we conduct an in-depth analysis to reveal potential causes of incorrect image compositions and justify the properties of cross-attention layers in the generation process. + +# 1 INTRODUCTION + +Text-to-Image Synthesis (T2I) is to generate natural and faithful images given a text prompt as input. Recently, there has been a significant advancement in the quality of generated images by extremely large-scale vision-language models, such as DALL-E 2 (Ramesh et al., 2022),Imagen (Saharia et al., 2022), and Parti (Yu et al., 2022). In particular, Stable Diffusion (Rombach et al., 2022) is the state-of-the-art open-source implementation showing superior evaluation metric gains after training over billions of text-image pairs. + +In addition to generating high-fidelity images, the ability to compose multiple objects into a coherent scene is also essential. Given a text prompt from the user end, T2I models need to generate an image that contains all necessary visual concepts as mentioned in the text. Achieving such ability requires the model to understand both the full prompt and individual linguistic concepts from the prompt. As a result, the model should be able to combine multiple concepts and generate novel objects that have never been included in the training data. In this work, we mainly focus on improving the compositionality of the generation process, as it is essential to achieve controllable and generalized text-to-image synthesis with multiple objects in a complex scene. + +Attribute binding is a critical compositionality challenge (Ramesh et al., 2022; Sahara et al., 2022) to existing large-scale diffusion-based models. Despite the improvements in generating multiple objects in the same scene, existing models still fail when given a prompt such as "a brown bench in front of a white building" (see Fig. 1). The output images contains "a white bench" and "a brown building" instead, potentially due to strong training set bias or imprecise language understanding. From a practical perspective, explaining and solving such a two-object binding challenge is a primary step to understanding more complex prompts with multiple objects. Therefore, how to bind the attributes + +![](images/adb2f55ec1de9720bf1c3d26e1e7ea2592eee0d41ffa4cedf3c3b54e4182b42a.jpg) +Figure 1: Three challenging phenomena in the compositional generation. Attribute leakage: The attribute of one object is (partially) observable in another object. Interchanged attributes: the attributes of two or more objects are interchanged. Missing objects: one or more objects are missing. With slight abuse of attribute binding definitions, we aim to address all three problems in this work. + +![](images/87d30f533f653bab6e836c7d45fe9fa8ad381b3d25ed11a517f37f93115689ae.jpg) + +![](images/dcd85780f492bdb25e224108c24d2e70c1af82ca9b8962f09533aaac57370c6e.jpg) + +to the correct objects is a fundamental problem for a more complicated and reliable compositional generation. While previous work has addressed compositional T2I (Park et al., 2021), our work tackles open-domain foreground objects with counterfactual attributes, such as color and materials. + +Even though state-of-the-art (SOTA) T2I models are trained on large-scale text-image datasets, they can still suffer from inaccurate results for simple prompts similar to the example above. Hence, we are motivated to seek an alternative, data-efficient method to improve the compositionality. We observe that the attribute-object relation pairs can be obtained as text spans for free from the parsing tree of the sentence. Therefore, we propose to combine the structured representations of prompts, such as a constituency tree or a scene graph, with the diffusion guidance process. Text spans only depict limited regions of the whole image. Conventionally, we need spatial information such as coordinates (Yang et al., 2022) as input to map their semantics into corresponding images. However, coordinate inputs cannot be interpreted by T2I models. Instead, we make use of the observations that attention maps provide free token-region associations in trained T2I models (Hertz et al., 2022). By modifying the key-value pairs in cross-attention layers, we manage to map the encoding of each text span into attended regions in 2D image space. + +In this work, we discover similar observations in Stable Diffusion (Rombach et al., 2022) and utilize the property to build structured cross-attention guidance. Specifically, we use language parsers to obtain hierarchical structures from the prompts. We extract text spans across all levels, including visual concepts or entities, and encode them separately to disentangle the attribute-object pairs from each other. Compared to using a single sequence of text embedding for guidance, we improve the compositionality by multiple sequences where each emphasizes an entity or a union of entities from multiple hierarchies in the structured language representations. We refer to our method as Structured Diffusion Guidance (StructureDiffusion). Our contributions can be summarized as three-fold: + +- We propose an intuitive and effective method to improve compositional text-to-image synthesis by utilizing structured representations of language inputs. Our method is efficient and training-free that requires no additional training samples. +- Experimental results show that our method achieves more accurate attribute binding and compositionality in the generated images. We also propose a benchmark named Attribute Binding Contrast set (ABC-6K) to measure the compositional skills of T2I models. +- We conduct extensive experiments and analysis to identify the causes of incorrect attribute binding, which points out future directions in improving the faithfulness and compositionality of text-to-image synthesis. + +![](images/907509ac57bf8888505df84ffeb93e63c1da4fb7cfe20572ecdbf02f60f8295c.jpg) +Figure 2: An illustration of cross-attention operations and the token-region associations from attention maps. We omit some tokens for simplicity. + +# 2 DIFFUSION MODELS & STRUCTURED GUIDANCE + +In this section, we propose a simple yet effective approach incorporating structured language representations into the cross-attention layers. We briefly introduce the Stable Diffusion model and its critical components in Sec. 2.1. Then, we present our method in detail in Sec. 2.2. + +# 2.1 BACKGROUND + +Stable Diffusion We implement our approach and experiments on the state-of-the-art T2I model, Stable Diffusion (Rombach et al., 2022). It is a two-stage method that consists of an autoencoder and a diffusion model. The pre-trained autoencoder encodes images as lower-resolution latent maps for diffusion training. During inference, it decodes generated outputs from the diffusion model into images. The diffusion model generates lower-resolution latent maps based on a random Gaussian noise input $z^T$ . Given $z^T$ , it outputs a noise estimation $\epsilon$ at each step $t$ and subtracts it from $z^t$ . The final noise-free latent map prediction $z^0$ is fed into the autoencoder to generate images. Stable Diffusion adopts a modified UNet (Ronneberger et al., 2015) for noise estimation and a frozen CLIP text encoder (Radford et al., 2021) to encode text inputs as embedding sequences. The interactions between the image space and the textual embeddings are achieved through multiple cross-attention layers in both downsampling and upsampling blocks. + +CLIP Text Encoder Given an input prompt $\mathcal{P}$ , the CLIP encoder encodes it as a sequence of embeddings $\mathcal{W}_{\mathrm{p}} = \mathrm{CLIP}_{\mathrm{text}}(\mathcal{P})$ where $c_{\mathrm{p}}$ is the embedding dimension and $l$ is the sequence length. Our key observation is that the contextualization of CLIP embeddings is a potential cause of incorrect attribute binding. Due to the causal attention masks, tokens in the later part of a sequence are blended with the token semantics before them. For example, When the user indicates some rare color for the second object (e.g. "a yellow apple and red bananas"), Stable Diffusion tends to generate "banana" in "yellow", as the embeddings of "yellow" is attended by token "banana". + +Cross Attention Layers The cross-attention layers take the embedding sequences from the CLIP text encoder and fuse them with latent feature maps to achieve classifier-free guidance. Denote a 2D feature map $\mathcal{X}^t$ , it is projected into queries by a linear layer $f_{Q}(\cdot)$ and reshaped as $Q^{t}\in R^{(n,h\times w,d)}$ where $n$ denotes the number of attention heads, $d$ is the feature dimension. Similarly $\mathcal{W}_{\mathrm{p}}$ is projected as keys and values $K_{\mathrm{p}},V_{\mathrm{p}}\in R^{(n,l,d)}$ by linear layers $f_{K}(\cdot),f_{V}(\cdot)$ . The attention maps refer to the product between queries and keys, denoted as a function $f_{M}(\cdot)$ + +$$ +M ^ {t} = f _ {M} \left(Q ^ {t}, K _ {p}\right) = \operatorname {S o f t m a x} \left(\frac {Q ^ {t} K _ {\mathrm {p}} ^ {T}}{\sqrt {d}}\right), M ^ {t} \in R ^ {(n, h \times w, l)}. \tag {1} +$$ + +![](images/f3082a141026c14e00c6a99375c506047f8e42c5726e6500a12f20cfafe89179.jpg) +Figure 3: An illustration of our cross-attention design with structured representations. We un flatten the query and attention maps and omit the feature dimension $d$ of all query, key, and value tensors for demonstration purposes. Note that noun phrases at multiple hierarchies are extracted and encoded through the frozen CLIP text encoder and projected to value vectors. + +Cross Attention Controls Hertz et al. (2022) observes that the spatial layouts depend on the cross attention maps in Imagen Sahara et al. (2022). These maps control the layout and structure of generated images, while the values contain rich semantics mapped into attended regions. Therefore, we assume that the image layout and content can be disentangled by controlling attention maps and values separately. + +# 2.2 STRUCTURED DIFFUSION GUIDANCE + +Given the challenging prompts in Fig. 1, the attribute-object pairs are available for free1 in many structured representations, such as a constituency tree or a scene graph. We seek an implicit way of combining language structures with the cross-attention layers. As is shown in Fig. 3, we can extract multiple noun phrases (NPs) and map their semantics into corresponding regions. Since $M_t$ provides natural token-region associations (see Fig. 2), we can apply it to multiple values from different NPs to achieve region-wise semantic guidance. + +Specifically, given a parser $\xi(\cdot)$ , we first extract a collection of concepts from all hierarchical levels as $\mathcal{C} = \{c_1, c_2, \ldots, c_k\}$ . For constituency parsing, we extract all NPs from the tree structure (see Fig.3 left). For the scene graphs, we extract objects and their relations with another object as text segments. We encode each NP separately: + +$$ +\mathbb {W} = \left[ \mathcal {W} _ {\mathrm {p}}, \mathcal {W} _ {1}, \mathcal {W} _ {2}, \dots , \mathcal {W} _ {k} \right], \mathcal {W} _ {i} = \operatorname {C L I P} _ {\text {t e x t}} \left(c _ {i}\right), i = 1, \dots k. \tag {2} +$$ + +The embedding sequence $\mathcal{W}_i$ is realigned with $\mathcal{W}_p$ as shown in the middle of Fig. 3. Embeddings between $\langle \mathrm{bos}\rangle$ and $\langle \mathrm{pad}\rangle$ are inserted into $\mathcal{W}_p$ to create a new sequence, denoted as $\overline{\mathcal{W}}_i$ . We use $\overline{\mathcal{W}}_p$ to obtain $K_{\mathrm{p}}$ and $M^t$ as in Eq. 1, assuming that the full-prompt key is able to generate layouts without missing objects. We obtain a set of values from $\mathbb{W}$ and multiply each with $M^t$ to achieve a conjunction of $k$ NPs in $\mathcal{C}$ : + +$$ +\mathbb {V} = \left[ f _ {V} \left(\mathcal {W} _ {\mathrm {p}}\right), f _ {V} \left(\overline {{\mathcal {W}}} _ {1}\right), \dots , f _ {V} \left(\overline {{\mathcal {W}}} _ {k}\right) \right] = \left[ V _ {\mathrm {p}}, V _ {1}, \dots , V _ {k} \right]. \tag {3} +$$ + +$$ +O ^ {t} = \frac {1}{(k + 1)} \sum_ {i} \left(M ^ {t} V _ {i}\right), i = \mathrm {p}, 1, 2, \dots , k. \tag {4} +$$ + +Compared to using $f_{V}(\mathcal{W}_{p})$ only, Eq. 4 does not modify the image layout or composition since $M^{t}$ is still calculated from $Q^{t}, K_{p}$ . Empirically, we justify the claim by a series of visualizations of $M_{t}$ + +Algorithm 1 StructureDiffusion Guidance. +Require: Input: Prompt $\mathcal{P}$ , Parse $\xi$ , decoder $\psi$ , trained diffusion model $\phi$ Output: Generated image $x$ 1: Retrieve concept set $\mathcal{C} = [c_1,\dots ,c_k]$ by traversing $\xi (\mathcal{P})$ . +2: $\mathcal{W}_{\mathrm{p}}\gets \mathrm{CLIP}_{\mathrm{text}}(\mathcal{P}),\mathcal{W}_{i}\gets \mathrm{CLIP}_{\mathrm{text}}(c_{i});$ $i = 1,\ldots ,k$ +3: for $t = T,T - 1,\dots ,1$ do +4: for each cross attention layer in $\phi$ do +5: Obtain previous layer's output $\mathcal{X}^t$ +6: $Q^{t}\gets f_{Q}(\mathcal{X}^{t}),K_{\mathrm{p}}\gets f_{K}(\mathcal{W}_{\mathrm{p}}),V_{i}\gets f_{V}(\overline{\mathcal{W}}_{i})$ $i = \mathrm{p},1,\dots ,k$ +7: Obtain attention maps $M^t$ from $Q^t,K_{\mathrm{p}}$ {Eq. 1} +8: Obtain $O^t$ from $M^t$ $\{V_i\}$ , and feed to following layers; {Eq. 4} +9: end for +10: end for +11: Feed $z^0$ to decoder $\psi (\cdot)$ to generate x. + +(see Appendix C). However, Stable Diffusion tends to omit objects in generated images (Fig. 1), especially for concept conjunctions that connect two objects with the word "and". We devise a variant of our method that computes a set of attention maps $\mathbb{M} = \{M_p^t,M_1^t,\ldots \}$ from $\mathcal{C}$ and multiply them to $\mathbb{V}$ : + +$$ +\mathbb {K} = \left\{f _ {K} \left(\mathcal {W} _ {i}\right) \right\}, \mathbb {M} ^ {t} = \left\{f _ {M} \left(Q ^ {t}, K _ {i}\right) \right\}, i = p, 1, 2, \dots , k. \tag {5} +$$ + +$$ +O ^ {t} = \frac {1}{(k + 1)} \sum_ {i} \left(M _ {i} ^ {t} V _ {k}\right), i = p, 1, 2, \dots , k. \tag {6} +$$ + +$O^t$ is the output of a certain cross-attention layer and the input into downstream layers to generate final image $x$ . Our algorithm can be summarized as 1, which requires no training or additional data. + +# 3 EXPERIMENT + +# 3.1 EXPERIMENT SETTINGS + +Datasets To address attribute binding and compositional generation, we propose a new benchmark, Attribute Binding Contrast set (ABC-6K). It consists of natural prompts from MSCOCO where each contains at least two color words modifying different objects. We also switch the position of two color words to create a contrast caption (Gardner et al., 2020). We end up with 6.4K captions or 3.2K contrastive pairs. In addition to natural compositional prompts, we challenge our method with less detailed prompts that conjunct two concepts together. These prompts follow the sentence pattern of "a red apple and a yellow banana" and conjunct two objects with their attribute descriptions. We refer to this set of prompts as Concept Conjunction 500 (CC-500). We also evaluate our method on 10K randomly sampled captions from MSCOCO (Lin et al., 2014). We show that our method generalizes beyond attribute binding and introduces no quality degradation for general prompts. + +Evaluation Metrics We mainly rely on human evaluations for compositional prompts and concept conjunction (ABC-6K & CC-500). We ask annotators to compare two generated images, from Stable Diffusion and our method respectively, and indicate which image demonstrates better image-text alignment or image fidelity. For image fidelity, we ask the annotators "Regardless of the text, which image is more realistic and natural?" We also investigate an automatic evaluation metric for image compositions, i.e., using a SOTA phrase grounding model GLIP (Li et al., 2022) to match phrase-object pairs. As for system-level evaluation, we follow previous work to utilize Inception Score (IS) (Salimans et al., 2016), Frechet Inception Distance (FID) (Heusel et al., 2017) and CLIP R-precision (R-prec.) (Park et al., 2021). IS and FID mainly measure the image bank's systematic quality and diversity, while R-prec measures image-level alignment. + +# 3.2 COMPOSITIONAL PROMPTS + +Here we show the quantitative and qualitative evaluation results on ABC-6K. We observe that our method sometimes generates very similar images to Stable Diffusion. Hence, we first generate + +
BenchmarkStructureDiffusion (ours) v.s.AlignmentFidelity
Win (↑)Lose (↓)TieWin (↑)Lose (↓)Tie
ABC-6KStable Diffusion42.235.622.248.339.112.6
CC-500Stable Diffusion31.827.738.937.830.631.6
Composable Diffusion46.530.122.861.419.818.8
+ +Table 1: Percentage of generated images of StructureDiffusion that are better than (win), tied with, or worse than (lose) the compared model in terms of text-image alignment and image fidelity. We filtered out $20\%$ most similar image pairs for comparison (See Sec. E). Composable Diffusion cannot be applied to ABC-6K as those prompts may not contain explicit "and" words that separate concepts. + +![](images/39ffdc9fe40d1bb90b183b975124b581e16d6efa69d5b757d194f4e5a69094da.jpg) +Figure 4: Qualitative results on ABC-6K. Our method improves both object-level and scene-level compositionality. + +two images per prompt for our method and Stable Diffusion, involving around 12K image pairs to compare. Then, we filter out $20\%$ of the most similar pairs and then randomly sampled 1500 pairs for human evaluations. As shown in Table 1, annotators indicate around a $42\%$ chance of our method winning the comparison, $7\%$ higher than losing the comparison. There is still a $22\%$ of chance that our images are tied with images from Stable Diffusion. + +We show qualitative examples characterizing three different perspectives in Fig. 4. Our method fills in the correct color for different parts of an object or different objects, as shown in the first two examples. The third example demonstrates that our method can mitigate the issue of "missing objects". Among the $42\%$ winning cases, there are $31\%$ for "fewer missing objects", $14.1\%$ for "better-matched colors", and $54.8\%$ for "other attributes or details" as indicated by annotators. The results certify that the improvement goes beyond colors to component completeness and fine-grained details. More qualitative examples characterizing all three aspects can be found in Fig. 14 in the Appendix. + +# 3.3 CONCEPT CONJUNCTION + +Here we address challenging concept conjunction prompts and evaluate our method on CC-500. Apart from Stable Diffusion, we also compare to Composable Diffusion (Liu et al., 2022) implemented on top of Stable Diffusion. For Composable Diffusion, we separate the prompts into text segments by the keyword "and" and feed each span into an independent diffusion process. We generate three images per prompt and use all images for human evaluation for Stable Diffusion. We randomly sampled 600 images for comparison to Composable Diffusion. + +
MethodsCC-500 (Prompt format: “a [colorA] [objectA] and a [colorB] [objectB]”)
Human AnnotationsGLIPHuman-GLIP Consistency
Zero/One obj. (↓)Two obj.Two obj. w/ correct colorsZero/One obj. (↓)Two obj.
Stable Diffusion65.534.519.269.031.046.4
Composable Diffusion69.730.320.674.225.848.9
StructureDiffusion (Ours)62.038.022.768.831.247.6
+ +Table 2: Fine-grained human and automatic evaluation results on CC-500. Recall that each prompt is a conjunction of two different objects with different colors. "Zero/One obj." means that the model fails to generate all desired objects in the image. "Human-GLIP consistency" reflects the percentage of images where human annotations align with GLIP detection results. + +![](images/a6f3f05aaaba5d9827371b81e24cb46cf9833d207661163e86315f2932e30cd3.jpg) +Figure 5: Qualitative results on CC-500 prompts that emphasize two aspects. (a) Color leakage: our method prevents the green color from invading the bird or apple. (b) Missing objects: our method completes the "blue bowl" and improves the quality of the "blue apple". + +As shown in Table 1, our method outperforms Stable Diffusion by around $4.1\%$ and Composable Diffusion by $16.4\%$ in terms of image-text alignment. We also observe that our method enhances some fine-grained details in the generated images, leading to a $7.2\%$ improvement in image fidelity when compared with Stable Diffusion. We observe that images from composable diffusion can be oversaturated with unnatural visual textures and layouts, which could be the reason for StructureDiffusion to have high win rate in image fidelity. As shown in Fig. 5 and Fig. 13. Our approach prevents color bleeding (left), missing objects (right) and strengthens details (right). + +To further quantify the text-image alignment, we consider both human annotations and automatic evaluations. For each object mentioned in the prompt, we ask annotators whether the object exists in the image and whether it is in the correct color. We also apply a state-of-the-art detection model GLIP (Li et al., 2022) to ground each “a [color] [object]” phrase into bounding boxes. We report the percentage of images that contain incomplete objects / complete objects / complete objects with correct colors in Table 2. StructureDiffusion improves the compositionality by $3.5\%$ based on human annotations while only $0.2\%$ based on GLIP. We discover that humans disagree with GLIP for more than $50\%$ of the images, as entailed by the low consistency rate. Previous work also suggests the deficiency of large pre-trained models in compositional understanding (Thrush et al., 2022). + +# 3.4 OTHER PROMPTS + +We show that our StructureDiffusion maintain the overall image quality and diversity on general prompts. We follow the standard evaluation process and generate 10,000 images from randomly + +![](images/59e64cb25d77abb875c0c36c9370d6aa17a759ef75700441dc2fae2fc1ec998b.jpg) +Figure 6: Qualitative results of using scene graph parser to generate structured representations. + +![](images/d2c2d96cdf59747ee5ecd3e6f57c2e7978e81d69fb569052acaf54fc5c776c6e.jpg) + +![](images/86c06598a5a1ff5b1954e89fcd00114d359c3416a8c3790b9d0474afaefcc0f7.jpg) + +![](images/2bba922f0e5c5ceed86449812d928e6dddf5e3ded8ae02e812777d938caaa0d7.jpg) + +![](images/258c1a1db05a40d3a4d724cd695803cabc04664aa7d495526af63d9f231d8ab7.jpg) + +![](images/d7b699dfe81a099d844fb782b2253f4ae7146888e28e36ce4d36aacd5ca5e7a7.jpg) +Figure 7: Ablation study on the text sequence embeddings. We find that the padding embeddings are fully contextualized, representing the prompt's high-level semantics. However, not all padding tokens are necessary to maintain a high-fidelity output from Stable Diffusion. + +![](images/b5cc6bd1479dc2f62f69b4b09e308e3ae0db20650e7ec93d66f4b99be4937075.jpg) + +sampled MSCOCO captions. Stable Diffusion obtains 39.9 IS, 18.0 FID and 72.2 R-Precision. Our method achieves 40.9 IS, 17.9 FID and 72.3 R-Precision. StructureDiffusion maintains the image fidelity and diversity as indicated in the comparable IS/FID/R-Prec scores. + +# 3.5 SCENE GRAPH INPUT + +We show that our method is not limited to constituency parsing but can also be extended to other structured representations, such as scene graphs. As shown in Fig. 6, we first adopt the scene graph parser (Wu et al., 2019) and obtain a graph like the ones next to each image from the input prompt. The parser returns basic entities and their relations in between. We extract text spans of basic entities with their attributes attached and text spans that include two related entities. We provide examples in Appendix 3 and make comparison to the constituency parser. Similarly, we encode these spans separately and re-align each with the entire prompt encoding sequence. On MS-COCO, the scene graph parser setting maintains the image quality with 39.2 IS, 17.9 FID, and 72.0 R-Precision. When compared to Stable Diffusion on ABC-6K, the scene graph parser achieves $34.2\% -32.9\% -32.9\%$ Win-Lose-Tie in image-text alignment and $34.5\% -32.5\% -33.0\%$ Win-Lose-Tie in image fidelity. As for CC-500, the scene graph parser leads to the same output images due to the same text spans. We refer to Table 3 and Fig. 12 for more results and comparison. + +# 4 ABLATION STUDY + +# 4.1 RE-ALIGNING SEQUENCE + +In Section 2, we describe a method to realign the encoding of a text span back into the sequence of the full prompt. Since the noun-phrase text spans are shorter than the full sequence, re-alignment ensures that each token's value vector corresponds to the correct attention map. On the other hand, naively expanding the span to the length of the full sequence degrades the image quality by $\sim 2$ IS / FID (37.5 IS, 19.8 FID) compared to images with re-alignment or Stable Diffusion. + +# 4.2 CONTEXTUALIZED TEXT EMBEDDINGS + +One limitation brought by our StructureDiffusion is that the cross-attention computation costs increase by the number of noun phrases. Yet we noticed that most of the attention maps are computed from padding embeddings, as Stable Diffusion adopts CLIP text encoders and automatically pads the sequence to 77 tokens. We conjecture that not all padding tokens are necessary for generating high-quality images. As is shown in Fig. 7, we study four different patterns of token embeddings. We discover that leaving the nearest padding embeddings maintains a similar IS / FID score as the full sequence. Further removing this padding embedding results in apparent degradation. While only using the nearest padding embedding results in the worst image quality, we find that the high-level image layout and semantics are preserved (see bottom right of Fig. 7). This phenomenon indicates that the padding embeddings are fully contextualized with the full prompt semantics. This also justifies our re-alignment operation that preserves padding embeddings of the main sequence $\mathcal{W}_{\mathrm{full}}$ . + +# 5 RELATED WORK + +Text-to-Image Synthesis The diffusion model is an emerging type of model that generate high-quality images with a much more stable training process (Song & Ermon, 2019; Ho et al., 2020). Rombach et al. (2022) proposes to encode an image with an autoencoder and then leverage a diffusion model to generate continuous feature maps in the latent space. Stable Diffusion Rombach et al. (2022) adopts similar architecture but is trained on large-scale image-text datasets with fixed CLIP text encoder. Imagen (Saharia et al., 2022) addresses the importance of language understanding by using a frozen T5 encoder (Raffel et al., 2020), a dedicated large language model. We mainly focus on diffusion models and conduct our experiments on Stable Diffusion (Rombach et al., 2022), the SOTA open-sourced T2I model. + +Compositional Generation The compositional or controllable generation has been an essential direction for T2I models to understand and disentangle basic concepts in the generation process. As text inputs are relatively weak conditions, previous work leverage layout or scene graph to enhance compositionality (Johnson et al., 2018; Hong et al., 2018; Yang et al., 2022; Gafni et al., 2022). More recently, Liu et al. (2022) proposes an approach where the concept conjunctions are achieved by adding estimated scores from a parallel set of diffusion processes. In contrast, our method can be directly merged into the cross-attention layers with much less computational overhead. + +Diffusion Guidance Ho & Salimans (2022) develops classifier-free guidance where a single diffusion model is jointly trained under conditional and unconditional inputs. Most large-scale SOTA models, including autoregressive ones, adopt this technique for flexible and improved conditional synthesis results (Rombach et al., 2022; Ramesh et al., 2022; Gafni et al., 2022; Yu et al., 2022; Saharia et al., 2022). Hertz et al. (2022) discovers unique properties of cross attention maps on Imagen (Saharia et al., 2022) and achieves structure-preserving image editing by manipulating these maps. We observe similar properties in Stable Diffusion (Rombach et al., 2022) but propose a different algorithm for fine-grained, compositional text-to-image generation. + +# 6 CONCLUSION + +In this work, we propose a training-free method for compositional text-to-image generation. First, we observe that existing large-scale T2I diffusion models can still struggle in compositional image synthesis. We address this challenge by explicitly focusing on binding objects with the correct attributes. Second, we propose structured diffusion guidance incorporating language structures into the cross-attention layers. We propose two simple techniques to align the structured encoding with the attention maps. Using our structured guidance on Stable Diffusion, attributes can be bound more accurately while maintaining the overall image quality and diversity. In addition, we justify our approach by conducting an in-depth analysis of the frozen language encoder and attention maps. Future work may explore explicit approaches to generate plausible image layouts without missing components. We hope that our approach accelerates the development of interpretable and efficient methods for diffusion-based text-to-image models. + +# ACKNOWLEDGEMENT + +We would like to thank the Robert N. Noyce Trust for their generous gift to the University of California via the Noyce Initiative. The work was also partially funded by an unrestricted gift from Google and by the National Science Foundation award #2048122. The writers' opinions and conclusions in this publication are their own and should not be construed as representing the sponsors' official policy, expressed or inferred. + +# REPRODUCIBILITY STATEMENT + +We release our core codebase containing the methodology implementation, settings, benchmarks containing compositional prompts under supplementary materials. + +# ETHICAL STATEMENT + +As for the data collection and verification, we use the Amazon Mechanical Turk platform and form the comparison task as batches of HITs. We select workers from English-speaking countries, including the US, CA, UK, AU, and NZ, since the task require understanding the English input prompt. Each HIT takes around 15-30 seconds on average to accomplish, and we pay each submitted HIT with 0.15 US dollars, resulting in an hourly payment of 18 US dollars. + +# REFERENCES + +Prafulla Dhariwal and Alexander Nichol. Diffusion models beat gans on image synthesis. Advances in Neural Information Processing Systems, 34:8780-8794, 2021. +Ming Ding, Wendi Zheng, Wenyi Hong, and Jie Tang. Cogview2: Faster and better text-to-image generation via hierarchical transformers. arXiv preprint arXiv:2204.14217, 2022. +Alaaeldin El-Nouby, Shikhar Sharma, Hannes Schulz, Devon Hjelm, Layla El Asri, Samira Ebrahimi Kahou, Yoshua Bengio, and Graham W.Taylor. Tell, Draw, and Repeat: Generating and Modifying Images Based on Continual Linguistic Instruction. In ICCV, 2019. +Tsu-Jui Fu, Xin Eric Wang, Scott Grafton, Miguel Eckstein, and William Yang Wang. SSCR: Iterative Language-Based Image Editing via Self-Supervised Counterfactual Reasoning. In EMNLP, 2020. +Oran Gafni, Adam Polyak, Oron Ashual, Shelly Sheynin, Devi Parikh, and Yaniv Taigman. Make-a-scene: Scene-based text-to-image generation with human priors. arXiv preprint arXiv:2203.13131, 2022. +Matt Gardner, Yoav Artzi, Victoria Basmov, Jonathan Berant, Ben Bogin, Sihao Chen, Pradeep Dasigi, Dheeru Dua, Yanai Elazar, Ananth Gottumukkala, et al. Evaluating models' local decision boundaries via contrast sets. Findings of Empirical Methods in Natural Language Processing, 2020. +Shuyang Gu, Dong Chen, Jianmin Bao, Fang Wen, Bo Zhang, Dongdong Chen, Lu Yuan, and Baining Guo. Vector quantized diffusion model for text-to-image synthesis. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10696-10706, 2022a. +Shuyang Gu, Dong Chen, Jianmin Bao, Fang Wen, Bo Zhang, Dongdong Chen, Lu Yuan, and Baining Guo. Vector quantized diffusion model for text-to-image synthesis. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10696-10706, 2022b. +Amir Hertz, Ron Mokady, Jay Tenenbaum, Kfir Aberman, Yael Pritch, and Daniel Cohen-Or. Prompt-to-prompt image editing with cross attention control. arXiv preprint arXiv:2208.01626, 2022. +Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. Advances in neural information processing systems, 30, 2017. + +Jonathan Ho and Tim Salimans. Classifier-free diffusion guidance. arXiv preprint arXiv:2207.12598, 2022. +Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances in Neural Information Processing Systems, 33:6840-6851, 2020. +Seunghoon Hong, Dingdong Yang, Jongwook Choi, and Honglak Lee. Inferring semantic layout for hierarchical text-to-image synthesis. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 7986-7994, 2018. +Justin Johnson, Agrim Gupta, and Li Fei-Fei. Image generation from scene graphs. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1219-1228, 2018. +Doyup Lee, Chiheon Kim, Saehoon Kim, Minsu Cho, and Wook-Shin Han. Autoregressive image generation using residual quantization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11523-11532, 2022. +Bowen Li, Xiaojuan Qi, Thomas Lukasiewicz, and Philip Torr. Controllable text-to-image generation. Advances in Neural Information Processing Systems, 32, 2019. +Lianian Harold Li, Pengchuan Zhang, Haotian Zhang, Jianwei Yang, Chunyuan Li, Yiwu Zhong, Lijuan Wang, Lu Yuan, Lei Zhang, Jenq-Neng Hwang, et al. Grounded language-image pre-training. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10965-10975, 2022. +Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dólar, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In European conference on computer vision, pp. 740-755. Springer, 2014. +Luping Liu, Yi Ren, Zhijie Lin, and Zhou Zhao. Pseudo numerical methods for diffusion models on manifolds. In International Conference on Learning Representations, 2021a. +Nan Liu, Shuang Li, Yilun Du, Antonio Torralba, and Joshua B Tenenbaum. Compositional visual generation with composable diffusion models. arXiv preprint arXiv:2206.01714, 2022. +Xihui Liu, Dong Huk Park, Samaneh Azadi, Gong Zhang, Arman Chopikyan, Yuxiao Hu, Humphrey Shi, Anna Rohrbach, and Trevor Darrell. More control for free! image synthesis with semantic diffusion guidance. arXiv preprint arXiv:2112.05744, 2021b. +Chao Lou, Wenjuan Han, Yuhuan Lin, and Zilong Zheng. Unsupervised vision-language parsing: Seamlessly bridging visual scene graphs with language structures via dependency relationships. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 15607-15616, June 2022. +Alex Nichol, Prafulla Dhariwal, Aditya Ramesh, Pranav Shyam, Pamela Mishkin, Bob McGrew, Ilya Sutskever, and Mark Chen. Glide: Towards photorealistic image generation and editing with text-guided diffusion models. ICML, 2021. +Dong Huk Park, Samaneh Azadi, Xihui Liu, Trevor Darrell, and Anna Rohrbach. Benchmark for compositional text-to-image synthesis. In Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track (Round 1), 2021. +Peng Qi, Yuhao Zhang, Yuhui Zhang, Jason Bolton, and Christopher D. Manning. Stanza: A Python natural language processing toolkit for many human languages. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, 2020. +Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In International Conference on Machine Learning, pp. 8748-8763. PMLR, 2021. +Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21(140):1-67, 2020. URL http://jmlr.org/papers/v21/20-074.html. + +Aditya Ramesh, Mikhail Pavlov, Gabriel Goh, Scott Gray, Chelsea Voss, Alec Radford, Mark Chen, and Ilya Sutskever. Zero-shot text-to-image generation. In International Conference on Machine Learning, pp. 8821-8831. PMLR, 2021. +Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, and Mark Chen. Hierarchical text-conditional image generation with clip latents. arXiv preprint arXiv:2204.06125, 2022. +Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. High-resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10684-10695, 2022. +Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computer-assisted intervention, pp. 234-241. Springer, 2015. +Nataniel Ruiz, Yuanzhen Li, Varun Jampani, Yael Pritch, Michael Rubinstein, and Kfir Aberman. Dreambooth: Fine tuning text-to-image diffusion models for subject-driven generation. arXiv preprint arXiv:2208.12242, 2022. +Chitwan Sahara, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily Denton, Seyed Kamyar Seyed Ghasemipour, Burcu Karagol Ayan, S Sara Mahdavi, Rapha Gontijo Lopes, et al. Photorealistic text-to-image diffusion models with deep language understanding. arXiv preprint arXiv:2205.11487, 2022. +Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. Advances in neural information processing systems, 29, 2016. +Sebastian Schuster, Ranjay Krishna, Angel Chang, Li Fei-Fei, and Christopher D Manning. Generating semantically precise scene graphs from textual descriptions for improved image retrieval. In Proceedings of the fourth workshop on vision and language, pp. 70-80, 2015. +Yang Song and Stefano Ermon. Generative modeling by estimating gradients of the data distribution. Advances in Neural Information Processing Systems, 32, 2019. +Ming Tao, Hao Tang, Fei Wu, Xiao-Yuan Jing, Bing-Kun Bao, and Changsheng Xu. Df-gan: A simple and effective baseline for text-to-image synthesis. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 16515-16525, 2022. +Tristan Thrush, Ryan Jiang, Max Bartolo, Amanpreet Singh, Adina Williams, Douwe Kiela, and Candace Ross. Winoground: Probing vision and language models for visio-linguistic compositionality. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 5238-5248, 2022. +Bo Wan, Wenjuan Han, Zilong Zheng, and Tinne Tuytelaars. Unsupervised vision-language grammar induction with shared structure modeling. In International Conference on Learning Representations, 2021. +Hao Wu, Jiayuan Mao, Yufeng Zhang, Yuning Jiang, Lei Li, Weiwei Sun, and Wei-Ying Ma. Unified visual-semantic embeddings: Bridging vision and language with structured meaning representations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6609–6618, 2019. +Zuopeng Yang, Daqing Liu, Chaoyue Wang, Jie Yang, and Dacheng Tao. Modeling image composition for complex scene generation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 7764-7773, 2022. +Jiahui Yu, Yuanzhong Xu, Jing Yu Koh, Thang Luong, Gunjan Baid, Zirui Wang, Vijay Vasudevan, Alexander Ku, Yinfei Yang, Burcu Karagol Ayan, et al. Scaling autoregressive models for content-rich text-to-image generation. arXiv preprint arXiv:2206.10789, 2022. +Han Zhang, Jing Yu Koh, Jason Baldridge, Honglak Lee, and Yinfei Yang. Cross-modal contrastive learning for text-to-image generation. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 833-842, 2021. + +Yiwu Zhong, Liwei Wang, Jianshu Chen, Dong Yu, and Yin Li. Comprehensive image captioning via scene graph decomposition. In European Conference on Computer Vision, pp. 211-229. Springer, 2020. +Yufan Zhou, Ruiyi Zhang, Changyou Chen, Chunyuan Li, Chris Tensmeyer, Tong Yu, Jiumiang Gu, Jinhui Xu, and Tong Sun. Towards language-free training for text-to-image generation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 17907-17917, 2022. +Minfeng Zhu, Pingbo Pan, Wei Chen, and Yi Yang. Dm-gan: Dynamic memory generative adversarial networks for text-to-image synthesis. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 5802-5810, 2019. + +# A RELATED WORK + +Text-to-Image Synthesis There are mainly three types of models for text-to-image synthesis: GAN-based (Tao et al., 2022; Zhu et al., 2019; Li et al., 2019; Fu et al., 2020; El-Nouby et al., 2019), autoregressive (Gu et al., 2022b; Lee et al., 2022; Ding et al., 2022) and diffusion models (Liu et al., 2021b; Nichol et al., 2021; Ruiz et al., 2022). Zhang et al. (2021) proposes XMC-GAN, a one-stage GAN that employs multiple contrastive losses between image-image, image-text, and region-token pairs. More recently, LAFITE (Zhou et al., 2022) enables language-free training by constructing pseudo image-text feature pairs using CLIP (Radford et al., 2021). As for autoregressive models, DALL-E adopts VQ-VAE to quantize image patches into tokens and then uses a transformer to generate discrete tokens sequentially (Ramesh et al., 2021). Parti (Yu et al., 2022) and Make-A-Scene (Gafni et al., 2022) both leverage classifier-free guidance to improve controllability. As for diffusion models, Gu et al. (2022a) concatenates VQ-VAE with the diffusion model and shows that the diffusion process can operate in discrete latent space. DALL-E 2 adopts the CLIP text encoder so that the diffusion process inverts the textual features into images (Ramesh et al., 2022). + +Structured Representations for Vision and Language Inferring shared structures across language and vision has been a long-term pursuit in unifying these modalities (Schuster et al., 2015; Johnson et al., 2018; Zhong et al., 2020; Lou et al., 2022). Wu et al. (2019) utilizes the structure from semantic parsing in a visual-semantic embedding framework to facilitate embedding learning. Wan et al. (2021) proposes a new task in which the goal is to learn a joint structure between semantic parsing and image regions. To the best of our knowledge, our work is the first attempt in T2I to incorporate language structures into the image synthesizing process. + +Diffusion Guidance To convert an unconditional diffusion model into a class-conditional one, Dhariwal & Nichol (2021) input the noisy image from each step into a classifier and calculate the classification loss. The loss can be back-propagated to the image space to provide a gradient that marginalizes the score estimation from the log of conditional probability. Similarly, in the T2I subdomain, Liu et al. (2021b) and Nichol et al. (2021) apply a noisy CLIP model to measure the cosine similarity between text prompts and noisy images. + +# B IMPLEMENTATION DETAILS + +Throughout the experiments, we implement our method upon Stable Diffusion v1.4. For all comparisons between our method and Stable Diffusion, we fix the seed to generate the same initial Gaussian map and use 50 diffusion steps with PLMS sampling (Liu et al., 2021a). We fix the guidance scale to 7.5 and equally weight the key-value matrices in cross-attention layers if not otherwise specified. We do not add hand-crafted prompts such as "a photo of" to the text input. We use the Stanza Library (Qi et al., 2020) for constituency parsing and obtain noun phrases if not otherwise specified. + +# C VISUALIZATION OF ATTENTION MAPS + +In this section, we demonstrate the visualization of cross-attention maps to support our assumptions and claims in Sec. 2. As is shown in Fig. 8, the attention maps of Stable Diffusion and our method + +![](images/471ac157195aa35015be0e041f4b9e3d5039873851faf473609617c852013ab2.jpg) +Figure 8: Visualization of cross attention maps of Stable Diffusion and our method. We compare maps of multiple tokens throughout the whole diffusion process with equal intervals. + +have similar spatial distribution and highlights throughout the diffusion process. This phenomenon supports our assumption in Sec. 2.2 that the attention map $M_{t}$ is unchanged even with multiple values in each cross-attention layer. We can observe a similar phenomenon in Fig. 9 except that our method accelerates the formation of interpretable attentions for both "green" and "clock" tokens. + +Fig. 8, 9 also justify our claim that values represent rich textual semantics mapped to the image space as contents. For instance, our method parses the prompt in Fig. 8 into "A long narrow yellow kitchen" and "black and white floor tiles", encodes and aligns them separately to form $\mathbb{V}$ . Empirically, these operations enhance the semantics of "yellow" and "black and white" separately and mitigate "yellow" being blended into "black and white". This explains the disappearance of color leakage in our image compared to Stable Diffusion. Though one may attribute the leakage to incorrect attention distribution of the "yellow" token, we argue that this is not the critical reason. Despite the attention maps of "yellow" from our method slightly highlighting the "floor tile" regions, we cannot observe any yellow in our generated image. This proves that inaccurate attention distributions contribute little to the final image content. In addition, we also show in Fig. 10 that using multiple Keys is able to rectify the image layouts to mitigate missing object issues. The sheep-like attention maps in the third row verify the proposed variants of our method for concept conjunctions. + +![](images/9bcd162dabfa4b619be41a871d39a29e66b650117c90612089197da3e9323c11.jpg) +Figure 9: Visualization of cross attention maps corresponding to token "green" and "clock" across the full diffusion timestamps from step 50 to step 1 in equal intervals. Red boxes highlight steps where our method accelerates the formation of correct attention on the clock region. The evolution of the token "green" is also more interpretable in our method. Although the image composition is imperfect, the visualization still supports our assumptions and claims in Sec. 2.2. + +![](images/d361b4e1d0b60479da886f46ee054b7b104b3a427e7b1f8b7febbf40f6a1b944.jpg) +Figure 10: Visualization of attention maps for token "sheep" of different methods. Our method with multiple Keys successfully rectify image layouts. + +# D ABLATION STUDY + +# D.1 A CASE STUDY OF ATTRIBUTE BINDING + +Here, we present a case study to show evidence of two root causes of incorrect attribute binding. The first one is the contextualized token embeddings due to causal attention masks. As is shown on the left side of Fig. 11, we first encode two different prompts with a shared component, e.g. "a red apple" as the naive one and "a green bag and a red apple". Using the encoding sequence of the naive prompt, + +![](images/1abe3575eed8e4badcdba3236183c1a262719aa627c0e4412e4ec3604ce95ebf.jpg) +Figure 11: Examples showing the potential root causes of incorrect attribute binding. Left: The large green regions in the second image prove that the hidden state's output of token "red" is contextualized with token "green" before it. Right: Visualization of attention maps showing that the semantics from the token "bird" is mistakenly attended to the mouth region of the bear. The final image shows the unnatural beak-like shape of the bear. + +![](images/7a0dae6f7be000615b0119e385d3b778ea4c7af4f558c65bed80ea455b819f93.jpg) + +we are able to get an image of red apple only. It is reasonable to assume that the yellow green regions are natural results of learning from authentic apple images. Then, we replace the tokens of the naive prompt with embeddings of the same token from the more complicated prompt. We use the same gaussian noise as initialization and generate an unnatural image with a solid green region (in the yellow bounding box). This result proves that the token "red" is contaminated with the semantics of "green" before it and explains some images with color leakage problems (e.g., Fig. 1). + +The second reason attributes to inaccurate attention maps. In Fig. 11 (right), we visualize five cross-attention maps (averaged across attention heads) from both downsample and upsampling blocks. The attention maps show the salient regions corresponding to the token "bird". These maps demonstrate highlighted regions in the bottom left corner where the bird is located in the final image. Despite the interpretable structures, the maps also show saliency around the mouth region of the bear across all five layers. Thus, the inaccurate attention maps lead to a beak-like mouth of the bear in the image. + +# D.2 COMPARISON OF PARSERS + +In this subsection, we compare the difference between using a constituency parser and a scene graph parser to obtain text spans and generate images. Table 3 compares the extracted text spans using constituency parser and scene graph parser. Example 0 shows that both parsers end up with the same results for CC-500 prompts. For Example 1-4, the scene graph parser generates more spans than the constituency parser. We notice that concepts in the middle of the sentence appear more often in these spans than other noun tokens, like "egg" or "red sauce" in Example 3. This imbalance potentially explains why the "egg" looks more highlighted in Fig. 12 (bottom left). On the other hand, "orange slices" appear more often in constituency parsing results, leading to better "orange" textures in the generated image. Similar observations can be made in Example 2, where "green pole" is emphasized more often by the constituency parser. + +# E LIMITATIONS & FUTURE WORK + +There are several limitations of our work. First of all, our method depends on an external parsing function that may not be perfect. We adopt the commonly used Stanza Library Qi et al. (2020) for constituency parsing. The parsing function can be replaced with a more advanced learning-based method for improvement. Secondly, our method mainly focuses on compositional T2I neglecting any + +
Constituency ParserScene Graph Parser
Example 0CC-500 Prompt: A white sheep and a red car
“A white sheep”, “a red car”“A white sheep”, “a red car”
Example 1Prompt: A silver car with a black cat sleeping on top of it
“A silver car”, “a black cat”, “A silver car with a black cat”“A silver car”, “a black cat”, “top of it”, “a black cat sleeping on top of it”
Example 2Prompt: A horse running in a white field next to a black and green pole
“A horse”, “a white field”, “a black and green pole”, “a white field next to a black and green pole”“A horse”, “a white field”, “a black and green pole”, “A horse running in a white field”
Example 3Prompt: Rice with red sauce with eggs over the top and orange slices on the side
“red sauce”, “the side”, “the top and orange slices”, “the top and orange slices on the side”“red sauce”, “the side”, “the top and orange slices”, “Rice with red sauce”, “red sauce with eggs”, “the top and orange slices on the side”, “red sauce with eggs over the top and orange slices”
Example 4Prompt: A pink scooter with a black seat next to a blue car
“A pink scooter”, “a black seat”, “a blue car”“A pink scooter”, “a black seat”, “a blue car”, “a pink scooter with a black seat”, “a black seat next to a blue car”
+ +Table 3: Comparison between the constituency parser and scene graph parser. For CC-500 prompts, both parsers end up with the same results. As for general prompts, scene graph parser tends to generate more text spans with middle concepts appearing multiple times across different spans. + +![](images/2898735f5537e120b6fab74d8659c5d965bdc622f5e59089a6ddbca5e9a4a55b.jpg) +Figure 12: Synthesized images corresponding to prompts in Table 3. Yellow boxes annotate compositions that are improved using different parsers. + +style descriptions. The parsing mechanism may categorize a style description, e.g. "in Van Gogh style" as a separate noun phrase that cannot be grounded in the image space. In addition, we discover that StructureDiffusion tends to generate similar images as Stable Diffusion. Thus we filtered out $20\%$ of most similar image pairs in Table 1, considering the efficiency of human evaluation. Therefore, the improvement could be compromised when evaluated on the full set of generated images. Future work may focus on devising explicit methods to associate attributes to objects using spatial information as input. For example, how to make a text-to-image synthesis model interpret coordinate information with limited fine-tuning or prompt tuning steps would be an appealing direction. + +# F ADDITIONAL RESULTS + +# Stable Diffusion Ours + +A green apple and a red banana + +![](images/c38edb87b26300c0ce0c436df9700f5932f9c8333ce15c92ce3669acf0a629b6.jpg) + +A gold clock and a green bench + +![](images/083095d5cf61888dcb17a5ab9bb4b0785a75edcf7cdf28affc7f3cd51b0b8bd2.jpg) + +A red cake and a blue suitcase + +![](images/cb70fc0869e6dd1859ef2e350db289225f27e78dbd1d4400704a52084fe08e5e.jpg) + +A brown dog and a blue suitcase + +![](images/3b54728c0905020b45789f9dc91fc962852befe8c9f0a407a84bbf4ef6ce2e6f.jpg) + +A yellow bowl and a blue cat + +![](images/a14a9f10fcf04da8cc165bca577d205c49ffa120123aba2db2a157c3be4c5488.jpg) +Figure 13: Qualitative results on CC-500 + +# Stable Diffusion Ours + +A red bird and a green banana + +![](images/cff50c5f30babb28a039d8b52294846832ffee839ad94fc3039e739fd5fc15e0.jpg) + +A blue bird and a brown bowl + +![](images/4e19ab61c70abca5dd3414286d320941b3ef8f2bd668c06fe742c40cec6e7143.jpg) + +A blue backpack and a brown bear + +![](images/095c6f76e4602a13e0de3988ecb4c15a454743499ea99c0fbd1fc593f795df14.jpg) + +A blue backpack and a brown cow + +![](images/4692072eff6303e3996552ceeb9fe64545fad8f075fb16ebe56bd9a29c5980ec.jpg) + +A brown dog and a blue horse + +![](images/1ec539e6fc499e4bf0938e312e2a526fa5f00c2171111b0d083e9779f31efd18.jpg) + +# Stable Diffusion + +a purple cat with a orange hat on its head + +![](images/6d4bcc2bc88960929d0567f590ba28e7209e6618aa19a10d1495316ff96fd28b.jpg) +A red helmet is on a yellow toilet in the dirt + +![](images/25246eeca41e5441f894436325c21f52bcfe6837eb4591f428be92512118ae84.jpg) + +![](images/bf31e9453c6b795b319608f54e450000a1ac949600f64a0b206e431f3483e998.jpg) + +![](images/bee6aadbf808498157d1ed737185ef169b579560a362212f2b342f43df6b4991.jpg) + +![](images/116ed097d9014c517498e4599a4311a60e2135eae6b5f10424357488a08c4a14.jpg) +A bathroom with red tile and a green shower curtain + +![](images/836cf53d1384c4298f4533a90736ff57fd08fa250318487ff2ccd0e431b28aa4.jpg) +A white toilet bowl with a purple rug in front + +![](images/3868250f90020deb3894d487507fb329105084933ca383212a0623c8b2559d1e.jpg) + +![](images/809fbb6ceb6fe57cfc57399a2af83f2c8ac10ec96cf2b8a3dbfaffd75187f171.jpg) +A spoon and bowl of red pea soup and green beans with onions + +![](images/b9b68aecd4b34b6e5be2573e0c7c5329418030a9af30fe9cac7cf0b8ddf3a36d.jpg) +Figure 14: Qualitative results on ABC-6K + +# Stable Diffusion + +A red cat sits on a rug with a black cord + +![](images/ab139126c7380b1aacf3e717b32e6ca397265f1918841fd39dd3c9807cd8cde1.jpg) + +![](images/6f060e80fa619e0cd68029c51b869b536ed7daaa3ea8e33e01183caffe79d82e.jpg) + +![](images/408e26c582eccff899a6069e2265d99daf61980c8cc47f66c6c8328d8054ffd6.jpg) +A red stop sign above a white walk across road sign + +![](images/07feb44fb4d2dd39fb826db09b1335c8a019d7d6cb5e47f5ac7d1ddc07785fd5.jpg) +A spacious kitchen has white walls , red countertops , and a large stove + +![](images/070ef819e83e449420edda7347b45712bd5a25ba5552c9b81ec8431fc8aa9617.jpg) +A pink towel stands out greatly in the white bathroom + +![](images/5c31717ff6829afc3e5aa46a938a2dfe6d87081e2a8696935f24deedc4c24b8e.jpg) +A cow standing outside of a white building with a blue entrance + +# Stable Diffusion + +# Ours + +A yellow cat is wearing a blue plastic baseball hat. + +![](images/a5101c882ad147b5d9927573c0d9cb966664b2f8420485f1af40a1da14fa5ee5.jpg) + +![](images/5f6c9f64d93d7e6a262af033797eb0b7e37a585f018f7ffecf0b915ec6fde336.jpg) +Two elephants walking by a green wall with tan palm trees painted on it + +![](images/6d6f4f9589d1f2d999ba63a90fc7157d118e369fe47aa84a6a21510c83f302d2.jpg) +A large white bed sitting in a hotel room next to a red couch + +![](images/5d97921484df921c69fd693f4c53e86e1f28a8c6e173fdbb0d6c403c03065bde.jpg) +A large pizza on a white plate sitting on a blue table + +![](images/3c2e54c9e1d267f3ca588d1adfb04d7f774e7c291dadfa04a84df2491751d9e3.jpg) +A black and white curtain hanging in a room that is decorated in black, white and red + +![](images/fd9e03802d5b69c5134f2d64fd253d47aa2345b65d45f50d0d35a65b95b3be72.jpg) +Stable Diffusion +Structure Diffusion + +![](images/d494b7eff7e293ac26ed7db1fcdc97d3faebd63d7275f83d35ca00ffbfcaccec.jpg) +a skateboarder jumps over a silver dome with stone domes in front of it and bicyclist behind + +![](images/d1f9c6710e0cf331794ca689a332a9d59e4613e0fb9bdf97f85188a555ceab28.jpg) +a stone building with a wooden bench placed near it + +![](images/58ffcaddbb46010370aeb34155d8440d9a130bf6de69d2a1c848d31448603530.jpg) +a wooden building with a stone bench placed near it + +![](images/e55fe7bb42890d6f66baf1db094e1e607f64c0e9a0ea91eb5340622c9ec1e869.jpg) +a red sphere and a blue cube +Figure 15: Qualitative results characterizing attributes beyond colors, including shape, size and materials. + +![](images/899d52389169ad5f689aef004dea75e48a8fa5eaadfa5cc80a4adefd92010adc.jpg) +Stable Diffusion +small silver laptop sitting on top of a wooden computer desk + +![](images/ca9f4a0eaba4daa992ac49fe08693c1d13169cbf5a6477f174e3913374423df2.jpg) +a silver stove sits next to a counter on a wooden floor + +![](images/e51ea500b61b19c7f7f08b3c7bcf7bfaaa05688d98d839d0735f3d4b87c1e153.jpg) +a wooden building with a stone bench placed near it + +![](images/30c6c7a8fe76ad71c9ffaec4ef74033bcea1135a50a4e1f6529c278dbb3fee9c.jpg) +a red sphere and a yellow cube + +![](images/86a3def58c1cbf000f71100a89bb5f3f99b4f66797b2b67aceec2650ffd87a8b.jpg) +a blue sphere and a red cube + +![](images/670ce65924a7c3d516938dc924637dfeb91a8a7322821704cc3e6cd446563e07.jpg) +Stable Diffusion +Structure Diffusion +two back to back wooden benches next to a shrub near a stone walkway + +![](images/87bda372621ff3e2f1823754cbbe330cf34b29321ac3b67e3d7adf3026139e7a.jpg) +a shiny silver metal microwavenear wooden cabinets + +![](images/148ce36f440a58190105535e0036f94c38d540f5f28d1b176e150fd13c95a386.jpg) +a cat is perched upon a stone bench that sits on a wooden patio + +![](images/e07da88307b8feaf84c86508f061b3d3e0d1fa056428c244e81429ff8961eaf2.jpg) +a brown sphere and a cyan cube + +![](images/77fcfdf0180779604844f79e744cd7d73712abfd589facca0e21cd398b691317.jpg) +a green sphere and a red cube + +![](images/d9714a9328d3300abcab1e80007a4b084c24225d9f74b85e997901ece86d98ba.jpg) + +![](images/6941323793c369649201f89d89815662f50cf2bd6f3c9dcfda18d7a781045bd0.jpg) + +![](images/49d327bf5bb3cd29cbe21cbe4cc8a8c36e16bf1407c01685befb598c4601e6c7.jpg) + +![](images/9b59d74f4b5604e03eb6030b84e211c1147adfb0624f8e6251aa0be7cabd4764.jpg) +Figure 16: A prompt "an astronaut riding a horse" appended with different (combinations of) style descriptions. Our method has no negative effects on the image style. "base" refers to Stable Diffusion. + +![](images/c35641f20fd287b4bba06f23ac43bcc764b65ab5d0372d4a9fcc5560515ab12a.jpg) + +![](images/8a4f88726a0fdcb6b32dc91ae00d4fa42cbe7487e31598e638d8c4a4caffa3bc.jpg) + +![](images/66c927186c0b20feccc092235a947444d9cc64f8a22c2c2be4d82fd38653e195.jpg) + +![](images/0166743c51425acfe4f14ed51e917687a1cd5cce8875db696a47cce23f14f6cc.jpg) \ No newline at end of file diff --git a/trainingfreestructureddiffusionguidanceforcompositionaltexttoimagesynthesis/images.zip b/trainingfreestructureddiffusionguidanceforcompositionaltexttoimagesynthesis/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..38bee4f8be5abad0effef5a2656965fba58bf4be --- /dev/null +++ b/trainingfreestructureddiffusionguidanceforcompositionaltexttoimagesynthesis/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:445646b3f2b33b95cec5000deee8fe721dd55fe27fa1bae29f3bffe864fd7f8a +size 2195045 diff --git a/trainingfreestructureddiffusionguidanceforcompositionaltexttoimagesynthesis/layout.json b/trainingfreestructureddiffusionguidanceforcompositionaltexttoimagesynthesis/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..04f6f8f17fcac6104dc8988f68aaf6f8bd8dbc4b --- /dev/null +++ b/trainingfreestructureddiffusionguidanceforcompositionaltexttoimagesynthesis/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0adda2af82d2f69b69fe99829b76042d3eb5eec33df523e7d64ef102c24278ec +size 600755 diff --git a/transferableunlearnableexamples/c25345b7-d8be-4162-9c61-be3dc45172d4_content_list.json b/transferableunlearnableexamples/c25345b7-d8be-4162-9c61-be3dc45172d4_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..167b0e902fa91e08cca4523c8e3d652e79eb5b21 --- /dev/null +++ b/transferableunlearnableexamples/c25345b7-d8be-4162-9c61-be3dc45172d4_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:40dcade5c5c03aaad3b349360d230b0f11827ba762b9aa59142b9e9e2c866959 +size 114299 diff --git a/transferableunlearnableexamples/c25345b7-d8be-4162-9c61-be3dc45172d4_model.json b/transferableunlearnableexamples/c25345b7-d8be-4162-9c61-be3dc45172d4_model.json new file mode 100644 index 0000000000000000000000000000000000000000..b87f86019ed3f5649f82ef496bb02db99d67f487 --- /dev/null +++ b/transferableunlearnableexamples/c25345b7-d8be-4162-9c61-be3dc45172d4_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f4d82c9f653c984732500aa9b7730e4bddd4b66cdb9250a83fec1c50e85a7c14 +size 130953 diff --git a/transferableunlearnableexamples/c25345b7-d8be-4162-9c61-be3dc45172d4_origin.pdf b/transferableunlearnableexamples/c25345b7-d8be-4162-9c61-be3dc45172d4_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9922e9187358e64e69e8108c6aaac232976b86c7 --- /dev/null +++ b/transferableunlearnableexamples/c25345b7-d8be-4162-9c61-be3dc45172d4_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9cb83a5111a986bbb43ad480a0210b38dfb3b2cfb507765bc758b093c48c33ed +size 4571355 diff --git a/transferableunlearnableexamples/full.md b/transferableunlearnableexamples/full.md new file mode 100644 index 0000000000000000000000000000000000000000..38658230c3f1e72e471fd6d51a98d0d972013a20 --- /dev/null +++ b/transferableunlearnableexamples/full.md @@ -0,0 +1,446 @@ +# TRANSFERABLE UNLEARNABLE EXAMPLES + +Jie Ren* + +Michigan State University + +renjie3@msu.edu + +Han Xu* + +Michigan State University + +xuhan1@msu.edu + +Yuxuan Wan + +Michigan State University + +wanyuxua@msu.edu + +Xingjun Ma + +Fudan University + +xingjunma@fudan.edu.cn + +Lichao Sun + +Lehigh University + +lis221@lehigh.edu + +Jiliang Tang + +Michigan State University + +tangjili@msu.edu + +# ABSTRACT + +With more people publishing their personal data online, unauthorized data usage has become a serious concern. The unlearnable examples strategies have been introduced to prevent third parties from training on the data without permission. They add perturbations to the users' data before publishing, so as to make the models trained on the perturbed published dataset invalidated. These perturbations have been generated for a specific training setting and a target dataset. However, their unlearnable effects significantly decrease when used in other training settings or datasets. To tackle this issue, we propose a novel unlearnable strategy based on Class-wise Separability Discriminant (CSD), which boosts the transferability of the unlearnable perturbations by enhancing the linear separability. Extensive experiments demonstrate the transferability of the unlearnable examples crafted by our proposed method across training settings and datasets. The implementation of our method is available at https://github.com/renjie3/TUE. + +# 1 INTRODUCTION + +With more people posting their personal data online (intentionally or unintentionally), it has raised the concern that the data might be utilized without the owner's consent to train commercial or malicious machine learning models. While large-scale datasets collected from the Internet like LFW(Huang et al., 2008), Freebase(Bollacker et al., 2008), and Ms-celeb-1m(Guo et al., 2016) have greatly advanced the development of deep learning, they may contain a certain amount of private data, which has the potential risk of privacy leakage. Thus, growing efforts (Huang et al., 2020; Fowl et al., 2021) have been made to protect data from unauthorized usage by making the data samples "unlearnable" (Huang et al., 2020; Fowl et al., 2021; He et al., 2022). These methods generate the unlearnable examples by injecting imperceptible "shortcut" perturbation. If the data is used by unauthorized training, the models will be tricked to extract such easy-to-learn shortcut features and ignore the real semantics in the original data (Geirhos et al., 2020). Consequently, the trained model fails to recognize the user's data during the test phase and the user's data gets protected. + +As shown in Figure 1, the practical usage procedure of unlearnable examples (UEs) consists of two stages, i.e., the generation stage and the evaluation stage. Before releasing data, in the generation stage, one can make the data unlearnable by adding perturbations into original data. According to whether the label information is used to generate the perturbations, we divide the UEs into Supervised UEs which is generated with the guidance of the label information, and Unsupervised UEs which is generated without the guidance of label information. In the evaluation stage, the unlearnable version of data is released to the public, and the unauthorized third parties might use different algorithms, like supervised training and unsupervised training, to learn from the data. The UEs aim to provide protection in this stage against unauthorized training and invalidate the models trained on them. + +However, existing UEs are in lack of training-wise transferability and have weaknesses in data-wise transferability in the evaluation stage. First, low training-wise transferability implies that the perturbed samples generated towards one target training setting cannot be transferred to other + +![](images/01802b7b728bb05dc73f8d0f7b427587ce5a7df279702a0035012d358d16715e.jpg) +Figure 1: Two stages of Unlearnable Examples. + +training settings. As shown in Section 3.2.1, although Error-Minimizing Noise (EMN) (Huang et al., 2020) can protect data from supervised training, we can use unsupervised learning methods, such as Contrastive Learning (Chen et al., 2020a; Chen & He, 2021; Chen et al., 2020b), to extract useful representations from the EMN-protected dataset and obtain high accuracy. In this way, the perturbed dataset is still exposed to no protection. Second, insufficient data-wise transferability indicates that the unlearnable effect of perturbations generated for one target dataset will significantly decrease when transferred to other datasets. We have to generate perturbations for each dataset, reducing its flexibility in real-world scenarios. For example, data in various applications such as social media is dynamic or even streaming, which makes it extremely challenging to generate the entire perturbation set when new data is continuously emerging. + +In this work, we aim to enhance the training-wise and data-wise transferability of unlearnable examples. In detail, our method is motivated by Synthetic Noise (SN) (Yu et al., 2021), which devises a manually designed linear separable perturbation to generate UEs. Such perturbations do not target specific dataset, thus it has the potential to enhance data-wise transferability. However, SN is manually designed and it is not quantifiable or estimizable. As such, it is impossible to incorporate SN into other optimization processes. Meanwhile, SN lacks training-wise transferability. Therefore, in this work, we propose Class-wise Separability Discriminant (CSD) to generate estimizable linear-separable perturbations. Our framework Transferable Unlearnable Examples with enhanced linear separability can generate UEs with superior training-wise and data-wise transferability. + +# 2 RELATED WORK + +Unlearnable Examples. Unlearnable examples are close to availability attack which aims at making the data out of service for training the models by the unauthorized third parties (Muñoz-González et al., 2017). Several supervised UEs are proposed (Huang et al., 2020; Fowl et al., 2021; Shan et al., 2020). The vanilla unlearnable examples are crafted by generating and adding unlearnable perturbations into the clean samples (Huang et al., 2020). Being induced to trust that the perturbation can minimize the loss better than the original image features, the model will pay more attention to the perturbations. Unlearnable Contrastive Learning (UCL) is proposed (He et al., 2022) to generate UEs to protect data from unsupervised learning. Our studies show that both Supervised and Unsupervised UEs lack training-wise transferability as shown in Section 3.2.1 and Appendix A, respectively. Table 1 summarizes the settings of existing methods, where $X$ means ineffective protection. + +Table 1: Unlearnable Examples Settings of Existing Approaches + +
Generation \ EvaluationSupervised TrainingUnsupervised Training
Supervised Unlearnability(Huang et al., 2020; Fowl et al., 2021)X
Unsupervised UnlearnabilityX(He et al., 2022)
+ +Unsupervised Learning. Recently, unsupervised learning has shown its great potential to learn the representation from unlabeled data. Contrastive learning, one of the popular unsupervised methods, uses the task of instance discrimination to learn the representations. In SimCLR (He et al., 2022) which is the most common contrastive learning method, the positive and negative samples for each instance are created and the task is to discriminate the positive samples and negative samples. Some methods like SimSiam (Chen & He, 2021) and BYOL (Grill et al., 2020) can remove the negative samples and only focus on pushing the representations between positive samples to be similar. + +# 3 PRELIMINARY + +In this section, preliminary studies are conducted to explore two types of transferability. We first introduce key notations and definitions, and then show the insufficiency of transferability. Since the majority of UEs are guided by label information, in this work, we focus on Supervised UEs + +and leave Unsupervised UEs as one future work. Note that the observations of Supervised UEs in terms of transferability could be applicable to Unsupervised UEs. For example, in Appendix A, we show that Unsupervised UEs also lack training-wise transferability. + +# 3.1 DEFINITIONS + +In this subsection, we give the definition of UEs and then define the two types of transferability. + +Unlearnable Examples. Suppose that the dataset contains $n$ clean examples $\mathcal{D}_c = \{(x_i, y_i)\}_{i=1}^n$ with the input data $x_i \in \mathcal{X} \subset \mathbb{R}^d$ and the associated label $y_i \in \mathcal{Y} = \{1, 2, \dots, K\}$ . We assume that the unauthorized parties will use the published data to train a classifier $f_\theta : \mathcal{X} \to \mathcal{Y}$ , where $\theta$ is the model parameters, and do inference on their test dataset. To protect the data from unauthorized training, instead of publishing $\mathcal{D}_c$ , we generate an unlearnable dataset as $\mathcal{D}_u = \{(x_i + \delta_i, y_i)\}_{i=1}^n$ where $\delta_i \in \Delta_{\mathcal{D}_c} \subset \mathbb{R}^d$ and $\Delta_{\mathcal{D}_c}$ is the perturbation set for $\mathcal{D}_c$ . The goal of unlearnability is that if we only publish $\mathcal{D}_u$ , the model $f_\theta$ trained on $\mathcal{D}_u$ performs poorly on the test dataset. Benefiting from the constraint $\| \delta \|_p \leq \epsilon$ , $\mathcal{D}_u$ appears the same as $\mathcal{D}_c$ in human eyes. The perturbed example $x_i + \delta_i$ is known as the unlearnable example. The most representative EMN (Huang et al., 2020) generates supervised UEs by alternating optimization on the bi-level problem: + +$$ +\min _ {\theta} \min _ {\delta_ {i} \in \left\{\boldsymbol {v}: \| \boldsymbol {v} \| _ {\infty} \leq \epsilon \right\}} \sum_ {i = 1} ^ {n} \mathcal {L} \left(f _ {\theta} \left(\boldsymbol {x} _ {i} + \delta_ {i}\right), y _ {i}\right). \tag {1} +$$ + +The outer minimization can imitate the training process, while the inner minimization can induce $\delta_{i}$ to have the property of minimizing the supervised loss. Due to this property, deep models will pay more attention to the easy-to-learn $\delta_{i}$ and ignore $\boldsymbol{x}_i$ . + +Training-wise Transferability. Supervised unlearnable examples have been designed to protect data from supervised training in the evaluation stage (Huang et al., 2020). However, the unlearnable effect is almost lost if they are utilized for unsupervised training. The unauthorized parties can first get a useful feature extractor $g_{\eta}$ from $\mathcal{D}_u$ by unsupervised training like Contrastive Learning (Chen et al., 2020a) and then fine-tunes on $\mathcal{D}_u$ or other data to get the classifier $h_g$ . The training-wise transferability means that supervised unlearnable examples can invalidate $g_{\eta}$ when transferred into unsupervised training. + +Data-wise Transferability. When a second dataset, $\mathcal{D}_{\tilde{c}} = \{(\tilde{x}_i,\tilde{y}_i)\}_{i = 1}^{\tilde{n}}$ , where $\tilde{x}_i\in \tilde{\mathcal{X}}\subset \mathbb{R}^d$ and $\tilde{y}_i\in \tilde{\mathcal{Y}} = \{1,2,\dots ,\tilde{K}\}$ , also requires protection, it is more efficient and practical if we can transfer the perturbation that has already been generated for $\mathcal{D}_c$ onto $\mathcal{D}_{\tilde{c}}$ . If the perturbation, $\Delta_{\mathcal{D}_c}$ , is data-wise transferable, we can quickly create an unlearnable dataset $\mathcal{D}_{\tilde{u}}$ to replace $\mathcal{D}_{\tilde{c}}$ before publishing as $\mathcal{D}_{\tilde{u}} = \{(\tilde{x}_i + \delta_{H(i)},\tilde{y}_i)\}_{i = 1}^n$ , where $\tilde{x}_i\in \mathcal{D}_{\tilde{c}}$ , $\delta_{H(i)}\in \Delta_{\mathcal{D}_c}$ , and $H(i)$ decides which perturbation in $\Delta_{\mathcal{D}_c}$ is added on $\tilde{x}_i$ in the new dataset, $\mathcal{D}_{\tilde{c}}$ . Without retraining the perturbation set, the unseen $\mathcal{D}_{\tilde{c}}$ is also protected by transferring the unlearnable perturbations from $\Delta_{\mathcal{D}_c}$ . + +# 3.2 TRANSFERABILITY IN EXISTING METHODS + +In this subsection, we show that existing supervised unlearnable examples have almost no training-wise transferability and insufficient data-wise transferability. + +# 3.2.1 TRAINING-WISE TRANSFERABILITY + +In Fig. 2, the experiments demonstrate the ineffective protection of two existing Supervised UEs, i.e. Error-Minimizing Noise (EMN) (Huang et al., 2020) and Synthetic Noise (SN) (Yu et al., 2021) when they are transferred into unsupervised training in the evaluator stage. The UEs for CIFAR-10 (Krizhevsky et al., 2009) are generated and then applied to prevent either supervised (standard training with cross-entropy loss) or unsupervised (SimCLR plus linear + +![](images/973723e11036ef2db9ab0f2d67490ea481a0ffc3f77e9d24b12e114f1d6d4fa8.jpg) +Figure 2: Acc. on clean test data of supervised and unsupervised models trained on clean and EMN-pertubed CIFAR-10 + +probing (Chen et al., 2020a)) training of a ResNet-18 (He et al., 2016). Fig. 2 shows the test accuracy (accuracy on the original clean test set) of the target models obtained under different training settings. An extremely low test accuracy indicates successful unlearnable protection. EMN decreases the accuracy of supervised training from $93.8\%$ to $14.7\%$ , but only decreases the accuracy of unsupervised training by $0.2\%$ . This suggests that EMN has almost no unlearnable effect under unsupervised learning and thus has extremely low training-wise transferability, which is also the case for SN. + +![](images/f577f4a4460e0975b0cf4f08cbd27ddeee478155416e2d19529a45239feeaf09.jpg) +(a) original corresponding + +![](images/c4d6b0c69b831dbf9d559117132d608ae3b76ae8acd0d7617e2340b220b85414.jpg) +(b) intra-class swap + +![](images/f0edf317bc945996a11ba4b604fc4c0f234aa3a201ee9ddd941cd26f55ce7fd5.jpg) +(c) inter-class swap +Figure 3: Original one-to-one correspondence and two swapping methods. + +# 3.2.2 DATA-WISE TRANSFERABILITY + +In this subsection, we investigate data-wise transferability for EMN and SN. As introduced in Eq. 1, EMN has been designed to induce $\delta_{i}$ to minimize the loss in supervised training on $x_{i}$ . Therefore, EMN generates UEs based on target data. Next, we will show the data-wise transferability of EMN on non-target data samples and non-target datasets. For $\delta_{i}$ , the target sample is $\mathbf{x}_i$ , while the non-target samples are all the other samples $\mathbf{x}_j$ in $\mathcal{D}_c$ , where $j \neq i$ . For the whole perturbation set $\Delta_{\mathcal{D}_c}$ , the non-target dataset is any other dataset $\mathcal{D}_{\tilde{c}}$ . Since $\delta_{i}$ focuses on the target sample $\mathbf{x}_i$ , we will first show the reduction of unlearnable effect on non-target samples. Then we will demonstrate that the perturbation set $\Delta_{\mathcal{D}_c}$ for $\mathcal{D}_c$ cannot hold the strong unlearnable effect on non-target dataset, $\mathcal{D}_{\tilde{c}}$ . + +On non-target samples, we change the assignment between perturbations and samples by intra-class swapping and inter-class swapping as shown in Fig. 3. Specifically, for inter-class swapping, we apply the unlearnable noise generated for sample $\boldsymbol{x}_i$ to a different sample $\boldsymbol{x}_j$ from a different class (i.e., $y_i \neq y_j$ ) via random permutation. For intra-class swapping, we swap the noise between samples from the same class also via random permutation. The two sample transferability swaps are illustrated in Fig. 3. As shown in Table 2, the unlearnable effect decreases significantly under both intra-class and inter-class swapping. + +On non-target datasets, EMN is also limited in data-wise transferability. We first generate the perturbations $\Delta_{\mathcal{D}_c}$ on CIFAR-10 and then choose another non-target dataset SVHN-small, which is downsampled from SVHN(Netzer et al., 2011), as non-target dataset $\mathcal{D}_{\tilde{c}}$ to protect. CIFAR-10 has ten classes, where every class has 5,000 training images. SVHN also has ten classes, but some classes have more than 5,000 training images. Thus we sample 5,000 training images in every class from SVHN and construct SVHN-small. In Table 3, we first generate EMN on SVHN-small to protect target dataset, i.e. SVHN-small. It protects the data from unauthorized training and reduces the test accuracy to only $11.64\%$ . But when we use EMN generated on CIFAR-10 to protect SVHN-small, SVHN-small becomes a non-target dataset. More information is learned from SVHN-small and the test accuracy is $27.59\%$ , which means the non-target dataset gets less protection. + +Table 2: Comparison of supervised unlearnable Table 3: Comparison of supervised unlearnable examples on target and non-target samples. examples on target and non-target datasets. + +
CorrespondingCIFAR10CIFAR10
EMNSNEMNSN
Original15.8814.076.592.13
Intra-class swap30.7413.5921.632.44
Inter-class swap30.1513.1535.502.73
+ +
Generated onTested on SVHN-small
EMNSN
SVHN-small11.648.46
CIFAR-1027.599.58
+ +We conducted similar experiments for SN (Yu et al., 2021). The results for non-target samples and non-target datasets are illustrated in Table 2 and Table 3, respectively. We observe that SN is data-wise transferable. According to (Yu et al., 2021), SN can create linear separability that the label-related imperceptible perturbation is linearly separable between different classes, as a shortcut for the optimization objective. In other words, the linear separability is only between $\delta_{i}$ and $y_{i}$ , and not related to $\boldsymbol{x}_i$ . This indicates the importance of linear separability for data-wise transferability. However, SN is generated by sampling from a manually designed distribution and the sampling process is incompatible with an optimization process. Thus, it is hard to directly incorporate SN into other optimization objectives to enjoy linear separability for data-wise transferability. + +# 3.3 DISCUSSIONS + +As shown by the above preliminary studies, both EMN and SN lack training-wise transferability, and EMN has insufficient data-wise transferability. Meanwhile, we found that the linearly separable SN perturbation that is independent on the data has good data-wise transferability. However, the manually designed linear separability of SN is unable to be leveraged by other optimization objectives. Thus in + +the next section, we propose Class-wise Separability Discriminant and a new framework to generate unlearnable examples with training-wise and data-wise transferability. + +# 4 TRANSFERABLE UNLEARNABILITY FROM CLASSWISE SEPARABILITY DISCRIMINANT + +In order to improve the two types of transferability of unlearnable examples, we propose the optimizable Class-wise Separability Discriminant (CSD) to quantify linear separability. Furthermore, we propose Transferable Unlearnable Examples (TUE) that have superior training-wise and data-wise transferability. In the evaluation stage, it not only generalizes the protection scenario from supervised to unsupervised training but also maintains the unlearnability when transferred to non-target datasets. + +# 4.1 CLASSWISE SEPARABILITY DISCRIMINANT + +Linear separability lies in two factors, i.e., intra-class distance and inter-class distance. Intuitively, better linear separability means smaller intra-class distance and larger inter-class distance. In the context of UEs, smaller intra-class distance means that perturbations from the same class concentrate on a small area in the input space, while larger inter-class distance means that perturbations of different classes are far away from each other. When the overlapping area between different classes is reduced by smaller intra-class distance and larger inter-class distance, the perturbations can become features that are easily separated by even a linear classifier. For measuring the intra-class and inter-class distances, we first define the centroid of the perturbations for one class: $c_k = \frac{1}{|\{\delta_i : y_i = k\}|} \sum_{\{\delta_i : y_i = k\}} \delta_i$ , where $\{\delta_i : y_i = k\}$ are the perturbations for class $k$ . Then we have the intra-class distance as: + +$$ +\boldsymbol {\sigma} _ {k} = \frac {1}{| \{\boldsymbol {\delta} _ {i} : y _ {i} = k \} |} \sum_ {\{\boldsymbol {\delta} _ {i}: y _ {i} = k \}} d \left(\boldsymbol {\delta} _ {i}, \boldsymbol {c} _ {k}\right), \tag {2} +$$ + +where $d(\cdot, \cdot)$ is the Euclidean distance. $\sigma_{k}$ measures the average distance between the perturbation $\delta_{i}$ whose label is $k$ to the centroid $c_{k}$ . The inter-class distance is defined by the Euclidean distance between two centroids: + +$$ +d _ {i, j} = d \left(\boldsymbol {c} _ {i}, \boldsymbol {c} _ {j}\right) \tag {3} +$$ + +To enhance the linear separability with an estimizable objective function, we propose Class-wise Separability Discriminant (CSD): + +$$ +\mathcal {L} _ {\mathrm {C S D}} \left(\left\{\boldsymbol {\delta} _ {i}, y _ {i} \right\} _ {i = 1} ^ {n}\right) = \frac {1}{M} \sum_ {i = 1} ^ {M} \frac {1}{M - 1} \sum_ {j \neq i} ^ {M - 1} \left(\frac {\boldsymbol {\sigma} _ {i} + \boldsymbol {\sigma} _ {j}}{d _ {i , j}}\right), \tag {4} +$$ + +where $M$ is the number of classes, and $y_{i}$ represents the ground truth label for sample $\pmb{x}_i\in \mathcal{D}_c$ . It is worth mentioning that $\mathcal{L}_{\mathrm{CSD}}(\{\delta_i,y_i\}_{i = 1}^n)$ is not related to $\pmb{x}_i$ , which means that $\pmb{\delta}_i$ is generated independently on $\pmb{x}_i$ . $\sigma_{i}$ and $\sigma_{j}$ measure the intra-class distance of class $i$ and class $j$ , respectively; $d_{i,j}$ measures the inter-class distance between class $i$ and class $j$ . The ratio between intra-class distance and inter-class distance, $\frac{\sigma_i + \sigma_j}{d_{i,j}}$ , defines the overlapping between two classes. Better clustering distribution has smaller intra-class distance and larger inter-class distance, leading to a lower ratio and smaller overlapping area between two classes. Therefore, a smaller CSD value indicates more compact classes and separable clusters, i.e., better linear separability. + +# 4.2 TRANSFERABLE UNLEARNABLE EXAMPLES + +As discussed in Section 3.2.2, linear separability plays an essential role in supervised unlearnability and data-wise transferability. In order to enhance the data-wise and training-wise transferability of UEs simultaneously, we incorporate linear separability into unsupervised unlearnable examples, resultign in the Transferable Unlearnable Examples (TUE) framework. In particular, TUE uses contrastive learning as the unsupervised backbone and embeds linear separability via CSD into unsupervised unlearnability. Since TUE uses label information in CSD, it is one kind of supervised unlearnable example methods. Most contrastive learning algorithms, such as SimCLR (Chen et al., 2020a), MoCo (Chen et al., 2020b) and SimSiam (Chen & He, 2021), enforce the similarity between two augmentations of the same samples to learn a representation. TUE generates the perturbation that not only promotes this similarity but also has linear separability, via the following bi-level optimization problem: + +$$ +\min _ {\theta} \min _ {\left\{\boldsymbol {\delta} _ {i}: \| \boldsymbol {\delta} _ {i} \| _ {\infty} \leq \epsilon \right\}} \sum_ {i = 1} ^ {n} \mathcal {L} _ {\mathrm {C L}} \left(f \left(\theta , T _ {1} \left(\boldsymbol {x} _ {i} + \boldsymbol {\delta} _ {i}\right)\right), f \left(\theta , T _ {2} \left(\boldsymbol {x} _ {i} + \boldsymbol {\delta} _ {i}\right)\right)\right) + \lambda \mathcal {L} _ {\mathrm {C S D}} \left(\left\{\boldsymbol {\delta} _ {i}, y _ {i} \right\} _ {i = 1} ^ {n}\right), \tag {5} +$$ + +where $\mathcal{L}_{\mathrm{CL}}$ is the loss of contrastive learning, and $\lambda$ is the weight to balance between two loss terms. $T_{1}$ and $T_{2}$ are augmentations on input data. The first term in Eq. 5 ensures that the generated perturbation has the property of promoting the similarity between two augmented views of the same sample to reduce $\mathcal{L}_{\mathrm{CL}}$ . In this way, the perturbation provides easy-to-learn shortcut information for unsupervised learning such that the model will learn to extract the perturbation instead of the intrinsic semantic information in the data. In other words, the first term is to ensure the unlearnability against unsupervised training. The second term can enhance the linear separability of the perturbations. Furthermore, we propose to solve this bi-level optimization problem in Eq. 5 alternately: + +$$ +\left\{ \begin{array}{l} S 1: \theta^ {(t)} = \underset {\theta} {\arg \min } \sum_ {\boldsymbol {x} _ {i} \in \mathcal {D} _ {c}} \mathcal {L} _ {\mathrm {C L}} \left(f \left(\theta , T _ {1} \left(\boldsymbol {x} _ {i} + \boldsymbol {\delta} _ {i} ^ {(t - 1)}\right)\right), f \left(\theta , T _ {2} \left(\boldsymbol {x} _ {i} + \boldsymbol {\delta} _ {i} ^ {(t - 1)}\right)\right)\right) \\ S 2: \boldsymbol {\delta} _ {i} ^ {(t)} = \underset {\{\boldsymbol {\delta} _ {i}: \| \boldsymbol {\delta} _ {i} \| _ {\infty} \leq \epsilon \}} {\arg \min } \mathcal {L} _ {\mathrm {C L}} \left(f \left(\theta^ {(t)}, T _ {1} \left(\boldsymbol {x} _ {i} + \boldsymbol {\delta} _ {i}\right)\right), f \left(\theta^ {(t)}, T _ {2} \left(\boldsymbol {x} _ {i} + \boldsymbol {\delta} _ {i}\right)\right)\right) + \lambda \mathcal {L} _ {\mathrm {C S D}} \left(\left\{\boldsymbol {\delta} _ {i}, y _ {i} \right\} _ {i = 1} ^ {n}\right). \end{array} \right. \tag {6} +$$ + +In the first step (S1), we update the model parameter $\theta$ to minimize the unsupervised loss $\mathcal{L}_{\mathrm{CL}}$ , while in the second step (S2) we optimize the perturbation $\{\delta_i\}$ to jointly reduce the unsupervised loss and force the linear separability among different classes. By the bi-level optimization on unsupervised loss and CSD, we can generate UEs with both data-wise and training-wise transferability. + +Interpolation for data-wise transferability. Once the generation stage is completed on the training dataset, $\mathcal{D}_c$ , we can directly transfer the obtained perturbation to a new dataset, $\mathcal{D}_{\tilde{c}}$ . Nevertheless, it is possible that the number of classes in $\mathcal{D}_c$ or the number of samples in one class in $\mathcal{D}_c$ is less than $\mathcal{D}_{\tilde{c}}$ . The generated perturbation may not cover every sample in $\mathcal{D}_{\tilde{c}}$ . To solve this problem, we use interpolation to create more perturbations. Interpolation can make use of current perturbation in $\Delta_{\mathcal{D}_c}$ to enlarge its size and transfer to a larger dataset. If more classes are required, we can interpolate between two current classes in $\mathcal{D}_c$ to create new classes: + +$$ +\boldsymbol {\delta} _ {k} ^ {*} = \alpha \boldsymbol {\delta} _ {i} + (1 - \alpha) \boldsymbol {\delta} _ {j}, \text {w h e r e} y _ {i} \neq y _ {j}. \tag {7} +$$ + +If more samples (in one class) are required, we can interpolate within the class to create new samples: + +$$ +\boldsymbol {\delta} _ {k} ^ {*} = \alpha \boldsymbol {\delta} _ {i} + (1 - \alpha) \boldsymbol {\delta} _ {j}, \text {w h e r e} y _ {i} = y _ {j}. \tag {8} +$$ + +By varying $\alpha$ , more than one sample can be created from the interpolation between $\delta_{i}$ and $\delta_{j}$ . Empirical results in Section 5.3 show that this interpolation strategy works very well. + +# 5 EXPERIMENT + +In this section, we validate the types of transferability of TUE. Section 5.1 introduces the experimental setups. Section 5.2 and Section 5.3 present the results on the improved training-wise and data-wise transferability, respectively. Section 5.4 illustrates the enhanced linear separability in input space by visualization. And Section 5.5 shows that TUE has both class-wise and sample-wise characteristics. Additional experiments can be found in Appendix C and Appendix D, which include visualization of interpolation, comparison with other methods, unlearnability on partly perturbed dataset and so on. + +# 5.1 EXPERIMENTAL SETUPS + +Datasets. The datasets include CIFAR-10 and CIFAR-100 (Krizhevsky et al., 2009), which contain 50,000 training images and 10,000 test images, and SVHN (Netzer et al., 2011), which contains 73,257 training images of ten classes and 26,032 test images. We randomly sample from SVHN to construct SVHN-small where the number of training images in every class is no more than 5000. + +Baselines. We use three representative unlearnable examples as baselines, which are Error-Minimizing Noise (EMN) (Huang et al., 2020), Unlearnable Contrastive Learning (UCL) (He et al., 2022) and Synthetic Noise (SN) (He et al., 2022). More details can be found in Appendix B.1. + +Generation and Evaluation settings. All the perturbations, except SN that is sampled from a distribution, are generated by PGD (Madry et al., 2018) on ResNet-18 and constrained by $\| \delta_i\|_{\infty}\leq \epsilon$ with $\epsilon = 8 / 255$ . In the evaluation stage, we use cross-entropy loss in supervised training and linear probing after contrastive pre-training in unsupervised training. The supervised model is trained for 200 epochs. The unsupervised model is pre-trained for 1000 epochs and fine-tuned for 100 epochs. More hyperparamaters for generation and evaluation can be found in Appendix B.2. + +Backbones. We generated TUE on three unsupervised backbones, SimCLR (Chen et al., 2020a), MoCo (Chen et al., 2020b) and SimSiam (Chen & He, 2021). The backbones are also used in UCL. EMN is generated on the backbone architecture of ResNet-18 in a supervised setting. SN has no backbone in the generation stage and is directly sampled from the manually designed distribution. + +Table 4: Test accuracy $(\%)$ of ResNet-18 trained on clean data vs. UEs by EMN, SN, UCL and TUE. TUE and UCL are generated on different unsupervised backbones. Under each backbone, the UEs are applied to the same unsupervised learning plus linear probing in the evaluation stage. The generation processes of EMN and SN are always the same regardless of evaluation and backbone of unsupervised learning. EMN and SN are also tested under the three backbones in the evaluation stage for comparison. + +
DatasetBackboneEvaluationCleanEMNSNUCLTUE
CIFAR-10SimCLRSupervised93.7914.7419.2392.8610.67
Unsupervised90.0489.7988.9347.7852.38
MoCoSupervised93.7914.7419.2392.6210.06
Unsupervised89.9089.1889.3244.2463.38
SimSiamSupervised93.7914.7419.2393.5010.03
Unsupervised90.5991.4391.5430.4335.57
CIFAR-100SimCLRSupervised74.495.232.1372.170.76
Unsupervised63.6862.0062.3116.6819.51
MoCoSupervised74.495.232.1371.591.09
Unsupervised63.0360.6261.8118.7423.60
SimSiamSupervised74.495.232.1371.841.21
Unsupervised64.6965.9666.834.646.17
+ +# 5.2 TRAINING-WISE TRANSFERABLE UNLEARNABILITY + +As mentioned above, existing UEs focus on one training setting, either supervised or unsupervised training. In this work, we use the proposed TUE to make the dataset unlearnable in both supervised and unsupervised training settings and thus protect the data from unauthorized training in a comprehensive way. In Table 4, we reported the comparison on CIFAR-10 and CIFAR-100 with supervised training by cross-entropy loss and three unsupervised training methods. The unlearnable examples are evaluated by two training settings, supervised and unsupervised training. When testing with unsupervised training, we use the corresponding unsupervised algorithm that is used to generate TUE. + +Table 4 shows the model accuracy on clean test data after being trained on unlearnable data. First, we observe that existing unlearnability methods can work under one training setting, but have almost no protection under the other training setting. Specifically, EMN and SN reduces the test accuracy of supervised training to less than $20\%$ on CIFAR-10 and less than $6\%$ on CIFAR-100 but cannot transfer well in all of the three unsupervised trainings. UCL reduces the accuracy of unsupervised training to less than $50\%$ on CIFAR-10 and less than $20\%$ on CIFAR-100 but has almost no effect against supervised training. Second, TUE can hold the unlearnability in both supervised and unsupervised training settings. It reduces the supervised accuracy to around $10\%$ on CIFAR-10 and $1\%$ on CIFAR-100 and reduces the unsupervised accuracy to a comparable level to UCL. In particular, it can even perform better than EMN in supervised training. The test accuracy of unauthorized classifiers trained on TUE is around $4\%$ lower than EMN on both CIFAR-10 and CIFAR-100. It indicates that the enhanced linear separability can mislead supervised models focusing more on TUE perturbation than EMN perturbation. In summary, from Table 4, we can see that TUE has good training-wise transferability, which can maintain the unlearnable effect when being transferred from supervised training to unsupervised training and it is the only one that maintains the unlearnable effects under two training settings. + +# 5.3 DATA-WISE TRANSFERABLE UNLEARNABILITY + +In this subsection, we show that TUE also has better data-wise transferability, i.e., the perturbations generated with TUE on one dataset can also protect any other datasets from unauthorized supervised training. Following the experimental settings in the preliminary studies of Section 3.2.2, we test the data-wise transferability first on non-target data samples, and then on non-target datasets. The results are reported in Table 5 and Table 6, respectively. + +Table 5: Test accuracy (%) with different correspondings Table 6: Test accuracy $(\%)$ of transferring the perturbation between train data and perturbations. tion generated on CIFAR-10 to different datasets. + +
DatasetMethodsOriginalIntraInter
CIFAR-10EMN15.8830.7433.91
SN14.0713.5913.15
TUE (SimCLR)10.6710.1610.90
TUE (MoCo)10.0612.048.57
TUE (SimSiam)10.0310.2510.47
CIFAR-100EMN6.5921.6335.50
SN2.132.442.73
TUE (SimCLR)0.761.111.13
TUE (MoCo)1.091.253.63
TUE (SimSiam)1.211.281.08
+ +
SVHN-smallCIFAR-100SVHN
EMN27.5921.8024.72
SN9.589.357.77
TUE (SimCLR)9.7710.5311.72
TUE (MoCo)11.298.3213.95
TUE (SimSiam)10.285.1012.93
+ +First, for non-target data samples, we compare the performance under 1) the original correspondence, 2) intra-class swapping, and 3) inter-class swapping between samples and perturbations in the same dataset. In Table 5, it is evident that our TUE can maintain high unlearnability (low test accuracy) under different correspondences on CIFAR-10 and CIFAR-100. Particularly, on CIFAR-100, the test accuracy of EMN under intra-class and inter-class swappings are roughly $15\%$ and $29\%$ higher than that in the original correspondence, but for TUE, the difference in the test accuracy under different correspondences is less than $3\%$ . Although we can also notice this data-wise transferability in SN, it is not an estimizable method and is unable to be used for improving the training-wise transferability. + +Second, to verify data-wise transferability on non-target datasets, we generate TUE on CIFAR-10 and test the performance of transferring onto three datasets, SVHN-small, CIFAR-100 and SVHN. TUE on CIFAR-10 can be directly transferred to SVHN-small without interpolation, while CIFAR-100 requires interpolation for more classes and SVHN requires interpolation for more samples. The baseline methods are also interpolated in the same way for comparison. In Table 6, we can observe that on all the datasets, TUE can maintain the unlearnable effect onto all the other datasets. The enhanced linear separability of TUE ensures that the test accuracy is low. For example, EMN has poorer protection after transferred onto SVHN-small with the accuracy of $27.59\%$ , but TUE can maintain the unlearnability on non-target datasets for all the backbones at around $10\%$ accuracy. + +From Table 5 and Table 6, we can draw the conclusion that the proposed TUE has better data-wise transferability than optimization-based unlearnable methods like EMN, and our strategy to transfer TUE to protect other datasets can be very efficient. + +# 5.4 LINEAR SEPARABILITY OF TRANSFERABLE UNLEARNABLE EXAMPLES + +In this subsection, we visualize the clusters formed by different types of UEs to gain deeper understandings of how linear separability influences unlearnability. Particularly, we use t-SNE (Van der Maaten & Hinton, 2008) to show the perturbation in the input space. Although t-SNE cannot accurately describe the high-dimension space, it is useful to observe the separability of the perturbations in the input space. We compare the perturbations in the input space in the following three groups. + +Comparison of Linear separability in supervised unlearnable examples. In Fig. 4, we show the perturbations of EMN, SN and TUE to understand why linear separability is more effective than EMN when used in supervised classification. In Fig. 4, the perturbations of different classes in TUE and SN are clearly separated and have no overlapping. In contrast, EMN has some data points mixed with other classes which are confusing when used in classification. Meanwhile the clusters in EMN do + +![](images/4c7bddc451488781ab16120ff018c894c773dbc9f8f4a30b03fb568233678d77.jpg) +(a) EMN + +![](images/caae5b487716f36f21b1e21538b4c7aaef605c744b5b9540c22d961eba7a22a4.jpg) +(b) SN + +![](images/94bac5475d9fb0ad2ecc3333962256bcb1222b92baea9dfff13abc9573123aee.jpg) +(c) TUE +Figure 4: t-SNE visualization of linear separability of supervised unlearnable examples. + +not contract as well as TUE and SN. Since better linear separability can provide useful information about classification, the supervised model will focus on TUE and SN more than EMN and ignore the semantic features in clean images. + +Linear separability in Interpolation. In Fig. 5, we show that the interpolation on TUE from CIFAR-10 to SVHN and CIFAR-100 can also hold linear separability which makes it data-wise transferable. We can observe that in the interpolation for SVHN, although the size of each class is different, + +they can still hold clear linear separability and unlearnability. In SVHN, the interpolation within classes creates more samples for one class. Since the numbers of examples in different classes in SVHN are different, it can be observed that some clusters are much larger than others. For CIFAR-100, more new classes are created and they still keep good linear separability. So the supervised model trained on interpolation-based unlearnable SVHN and CIFAR-100 will learn nothing but the perturbations and perform poorly on clean test data which has no perturbations. + +Comparison of Linear separability between supervised and unsupervised unlearnability. In Fig. 6, we show the perturbations of UCL and TUE in input space to understand why UCL cannot help with unlearnable effects in supervised training. TUE is linear separable, which can be used to protect the data from both supervised and unsupervised training. But for UCL, all the perturbations are mixed, they cannot provide the class information for supervised training. So for a supervised model, UCL is not a helpful feature and will not vanquish the semantic feature. + +![](images/efa7cafac2031b57e47cb9400c270169c485a0dfdd43b47da5998c9be98e6655.jpg) +(a) Interpolation: SVHN (b) Interpolation: CIFAR-100 Figure 5: t-SNE visualization of linear separability of interpolations. + +![](images/df69939c06874adaa6b70321083518118e799b1f4bf34037a0b3ce41c00d5f66.jpg) + +![](images/dfb827780371d7cd436aae278b43aab159bdb45e09a7673df6bee98557013d78.jpg) +(a) UCL +Figure 6: t-SNE visualization of linear separability of supervised and unsupervised unlearnability. + +![](images/f1e94983a28434d32085680d8f8a54df79ae1506faeef94fb608d21c8a03475f.jpg) +(b) TUE + +# 5.5 CASE STUDY + +In this subsection, by showing the patterns of the perturbations generated by different methods, we can deepen our understanding on linear separability in TUE and observe the classwise and samplewise characteristics, which reflect the basic idea behind training-wise transferability. + +![](images/9ccd6fd6872e84a6539a68f0bb41aae8c8e8846d73f143965146ccfe3cc744d6.jpg) +Figure 7: Visualization of the unlearnable examples of EMN, UCL and TUE(ours). We rescale the perturbation from $[-8/255, 8/255]$ to $[0,1]$ for better visualization. + +We illustrate the samples and unlearnable perturbations from two classes of CIFAR-10, i.e., horse and airplane, in Figure 7. First, we find that EMN and TUE both have class-wise noise patterns. Every noisy sample has consistent patterns in one class, while every class has a different feature pattern from other classes. This is a new perspective to show that TUE has linear separability and perturbations from the same class are clustered in input space. Second, in UCL, the perturbations can be more diverse and related to each sample, which indicates that unsupervised unlearnability requires more complex feature patterns. We cannot see the class-wise patterns like EMN. Because UCL uses no label information and has no concept of classes. Third, we notice that TUE has both class-wise and sample-wise characteristics as expected. The class-wise feature can be the easy-to-learn feature for the supervised model, while the samplewise feature can be effective in reducing unsupervised loss, which makes the unlearnability transferable from supervised training to unsupervised training. In summary, from the case study, we can observe that the co-existing class-wise and sample-wise features provide supervised and unsupervised protection at the same time. The linear separability makes the supervised unlearnability data-wise transferable. + +# 6 CONCLUSION + +We reveal the limitation of training-wise and data-wise transferability in existing UEs and propose CSD to enhance transferability. The proposed Transferable Unlearnable Examples has training-wise transferability and can protect data from unauthorized usage in a comprehensive way. Meanwhile, TUE has data-wise transferability and can generate unlearnability once for all, which makes UEs more practical and efficient. TUE greatly pushes the boundary of existing unlearnable methods that can only work on the target data and target training setting. We improve the data-wise and training-wise transferability of unlearnable examples and provide more flexible, practical, and comprehensive protections from unauthorized data usage. + +# ACKNOWLEDGMENTS + +Jie Ren, Han Xu, Yuxuan Wan and Jiliang Tang are supported by the National Science Foundation (NSF) under grant numbers CNS1815636, IIS1845081, IIS1928278, IIS1955285, IIS2212032, IIS2212144, IOS2107215, and IOS2035472, the Army Research Office (ARO) under grant number W911NF-21-1-0198, the Home Depot, Cisco Systems Inc, Amazon Faculty Award, JohnsonJohnson and SNAP. Xingjun Ma is in part supported by the National Key R&D Program of China (Grant No. 2021ZD0112804), the National Natural Science Foundation of China (Grant No. 62276067), and the Science and Technology Commission of Shanghai Municipality (Grant No. 22511106102). + +# REFERENCES + +Kurt Bollacker, Colin Evans, Praveen Paritosh, Tim Sturge, and Jamie Taylor. Freebase: a collaboratively created graph database for structuring human knowledge. In Proceedings of the 2008 ACM SIGMOD international conference on Management of data, pp. 1247-1250, 2008. +Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In International conference on machine learning, pp. 1597-1607. PMLR, 2020a. +Xinlei Chen and Kaiming He. Exploring simple siamese representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 15750-15758, 2021. +Xinlei Chen, Haoqi Fan, Ross Girshick, and Kaiming He. Improved baselines with momentum contrastive learning. arXiv preprint arXiv:2003.04297, 2020b. +Liam H Fowl, Micah Goldblum, Ping-yeh Chiang, Jonas Geiping, Wojciech Czaja, and Tom Goldstein. Adversarial examples make strong poisons. In Advances in Neural Information Processing Systems, 2021. +Robert Geirhos, Jorn-Henrik Jacobsen, Claudio Michaelis, Richard Zemel, Wieland Brendel, Matthias Bethge, and Felix A Wichmann. Shortcut learning in deep neural networks. Nature Machine Intelligence, 2(11):665-673, 2020. +Jean-Bastien Grill, Florian Strub, Florent Altché, Corentin Tallec, Pierre Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Guo, Mohammad Gheshlaghi Azar, et al. Bootstrap your own latent-a new approach to self-supervised learning. Advances in Neural Information Processing Systems, 33:21271-21284, 2020. +Yandong Guo, Lei Zhang, Yuxiao Hu, Xiaodong He, and Jianfeng Gao. Ms-celeb-1m: A dataset and benchmark for large-scale face recognition. In European conference on computer vision, pp. 87-102. Springer, 2016. +Hao He, Kaiwen Zha, and Dina Katabi. Indiscriminate poisoning attacks on unsupervised contrastive learning. arXiv preprint arXiv:2202.11202, 2022. +Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770-778, 2016. +Gary B Huang, Marwan Mattar, Tamara Berg, and Eric Learned-Miller. Labeled faces in the wild: A database for studying face recognition in unconstrained environments. In Workshop on faces in Real-Life Images: detection, alignment, and recognition, 2008. +Hanxun Huang, Xingjun Ma, Sarah Monazam Erfani, James Bailey, and Yisen Wang. Unlearnable examples: Making personal data unexploitable. In International Conference on Learning Representations, 2020. +Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009. +Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In International Conference on Learning Representations, 2018. + +Luis Muñoz-González, Battista Biggio, Ambra Demontis, Andrea Paudice, Vasin Wongrassamee, Emil C Lupu, and Fabio Roli. Towards poisoning of deep learning algorithms with back-gradient optimization. In Proceedings of the 10th ACM workshop on artificial intelligence and security, pp. 27-38, 2017. +Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. 2011. +Shawn Shan, Emily Wenger, Jiayun Zhang, Huiying Li, Haitao Zheng, and Ben Y Zhao. Fawkes: Protecting privacy against unauthorized deep learning models. In 29th USENIX Security Symposium (USENIX Security 20), pp. 1589-1604, 2020. +Laurens Van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(11), 2008. +Da Yu, Huishuai Zhang, Wei Chen, Jian Yin, and Tie-Yan Liu. Indiscriminate poisoning attacks are shortcuts. arXiv preprint arXiv:2111.00898, 2021. + +# A EXISTING UNLEARNABLE METHODS CANNOT PROTECT UNLABELLED DATASET IN A TRAINING-WISE TRASNFERABLE WAY + +Previous unlearnable methods can only protect data from one unauthorized training setting. According to whether the dataset is annotated, unlearnable examples can be classified in two settings, supervised and unsupervised unlearnable examples, as mentioned in Section 2. The supervised unlearnable methods, like EMN, can create unlearability based on the label information and protect the data from supervised training, but these methods cannot prevent the unauthorized parties from training the data with an unsupervised algorithm. Similarly, the unsupervised unlearnable examples produced by Unlearnable Contrastive Learning (UCL) He et al. (2022) can destroy the unsupervised training but they are still learnable in the supervised training. In Fig. 8, EMN decreases the accuracy of supervised training from $93.8\%$ to $14.7\%$ , but only decreases the accuracy of unsupervised training by $0.2\%$ . Similarly, SN decreases supervised training to $14.1\%$ , but only decreases unsupervised training by $1.1\%$ . Supervised unlearnable examples have almost no training-wise transferability to unsupervised training. UCL, which produces unsupervised unlearnable examples, can protect data from unsupervised training, but cannot be transferred well to supervised training. Under unsupervised training, UCL can decrease the test accuracy from $90.0\%$ to $47.8\%$ , but under supervised training, it can only decrease the accuracy by $0.9\%$ . + +![](images/0fc5edff986d4befc044b26bda5d5a42b4301f6007c59c9b31d98150db060475.jpg) +Figure 8: Accuracy on test data of classifiers produced by supervised training and unsupervised training on the unlearnable examples from CIFAR-10 + +# B DETAILS OF EXPERIMENTAL SETTINGS + +# B.1 DETAILS OF BASELINE METHODS + +EMN (Huang et al., 2020) generates the easy-to-learn feature by inducing the perturbations to reduce the supervised cross-entropy loss via alternating optimization on the bi-level min-min problem: + +$$ +\min _ {\theta} \min _ {\boldsymbol {\delta} _ {i} \in \left\{\boldsymbol {v}: \| \boldsymbol {v} \| _ {\infty} \leq \epsilon \right\}} \sum_ {i = 1} ^ {n} \mathcal {L} \left(f _ {\theta} \left(\boldsymbol {x} _ {i} + \boldsymbol {\delta} _ {i}\right), y _ {i}\right). \tag {9} +$$ + +The outer minimization can imitate the training process, while the inner minimization can induce $\delta_{i}$ to have the property of minimizing the supervised loss. Due to this property, deep models will pay more attention to the easy-to-learn $\delta_{i}$ and ignore $\pmb{x}_i$ . + +UCL (He et al., 2022) also generates perturbatioins which is easy-to-learn for unsupervised contrastive learning by inducing the perturbations to reduce the contrastive loss via alternating optimization on the bi-level min-min problem: + +$$ +\min _ {\theta} \min _ {\left\{\delta_ {i}: \| \delta_ {i} \| _ {\infty} \leq \epsilon \right\}} \sum_ {i = 1} ^ {n} \mathcal {L} _ {\mathrm {C L}} \left(f \left(\theta , T _ {1} \left(\boldsymbol {x} _ {i} + \boldsymbol {\delta} _ {i}\right)\right), f \left(\theta , T _ {2} \left(\boldsymbol {x} _ {i} + \boldsymbol {\delta} _ {i}\right)\right)\right). \tag {10} +$$ + +It does not require label information and works well on different contrastive learning backbones. + +SN (Yu et al., 2021) is sampled from a manually designed distribution. It is not targeting any backbone or dataset and only focuses on linear separability. SN first sets $M$ centers in the perturbation space, where $M$ is the number of protected classes. The generation process can be seen as sampling the perturbations for one class from a Gaussian distribution whose mean is one of the $M$ centers. + +# B.2 SETTINGS OF GENERATION PROCESS + +All the baselines and our proposed TUE are generated in the way of PGD Madry et al. (2018), except for SN, which is sampled from a manually designed distribution following the algorithm in Yu et al. (2021). For EMN, UCL, and TUE, the generation process is an alternate optimization between model parameters and perturbations. For example, TUE is optimized in the way of Eq. 6. In EMN, after every epoch of optimization on model parameters, the whole set perturbations are optimized for one epoch by PGD-20. In TUE, different backbones are set to different schedule. For TUE (SimCLR), the model parameters are trained for 40 epochs, and after every 1/5 epoch of optimization on model parameters, the whole set perturbations are optimized for one epoch by PGD-20. For TUE (MoCo), the model parameters are trained for 200 epochs, and after every epoch of optimization on model parameters, the whole set perturbations are optimized for one epoch by PGD-5. For TUE (SimSiam), the model parameters are trained for 50 epochs, and after every 1/4 epoch of optimization on model parameters, the whole set perturbations are optimized for one epoch by PGD-20. UCL with SimCLR and SimSiam have the same settings as TUE. UCL with MoCo uses PGD-10 and the other settings in the schedule is the same as TUE (MoCo). Finally, all the perturbations are constrained by $l_{\infty}$ norm, i.e. $\| \delta_i \|_{\infty} \leq \epsilon$ where $\epsilon = 8 / 255$ . + +# B.3 SETTINGS OF EVALUATION STAGE + +To evaluate the unlearnable effect, we use CrossEntropy as the objective function in the unauthorized supervised training. We use linear probing after contrastive pre-training to evaluate the unlearnable effect in unsupervised training. The supervised model is trained for 200 epochs. The unsupervised model is pre-trained for 1000 epochs by unsupervised contrastive learning and then fine-tuned for 100 epochs by linear probing. The details for the hyperparameters are listed in Table 7. + +# C VISUALIZATION OF INTERPOLATION + +We use t-SNE to show the interpolations in the perturbation space (Fig. 9) and then visualize the perturbation patterns (Fig. 10). In Fig. 9, it shows that intra-class interpolation tends to create new perturbations around the original perturbation clusters, while inter-class interpolation tends + +Table 7: Hyperparameters of evaluation stage + +
HyperparameterSupervisedUnsupervised pretrainingLinear probing
SimCLRMoCoSimSiamSimCLRMoCoSimSiam
Epoch200100010001000100100100
OptimizerSGDSGDAdamSGDAdamSGDSGD
Learning Rate0.10.060.30.060.0013030
LR SchedulerCosineAnnealingLR (CA)-CACA-CACA
Encoder Momentum--0.99----
Loss FunctionCrossEntropy (CE)InfoNCEInfoNCESimilarity between positive samplesCECECE
+ +to create more separated clusters, extending the unlearnable effect to more classes. In Fig. 10, it shows interpolation within classes can keep the class-wise pattern that is the same as the source perturbations, while interpolation between classes can create a new class pattern. Both the linear separable clusters and the class-wise patterns can show that interpolation can keep good linear separability. By visualization we show the reason why interpolation can be an effective way for increasing the number of perturbations. + +![](images/b267c60d447b00d0baaba329e3f7b9aa4f8a2be9d3b26c6f8a9e6b94ea8265cc.jpg) +(a) TUE perturbation for 3 classes in CIFAR-10 + +![](images/e1a8316d551913eba5fb6fa000a77775287867fc70a429714c3bf3a84a9f84c1.jpg) +(b) Interpolation within classes + +![](images/236df9cd717ceeb59cd4cc72618249eb50dd517e4403f06beae64cc4e3f666bb.jpg) +(c) Interpolation between classes + +Figure 9: t-SNE visualization of interpolation in perturbation space + +
Source perturbationsInterpolation
αδi(1-α)δjδk*
Interpolation within classes
Interpolation between classes
+ +Figure 10: Visualization of patterns of interpolation + +# D ADDITIONAL EXPERIMENTS + +# D.1 COMPARISON WITH SIMPLY COMBINING EMN AND UCL + +In this subsection, we want to compare TUE with simply combining the loss of EMN and UCL (EMN-UCL). EMN-UCL is a simple and direct method, but it will lose a part of the linear separability + +of the perturbations, and thus reduce the data-wise transferability and protection against supervised training as shown in the experiments in Table 8. As we analyzed in Section 3.2.2 and Section 5.3, EMN is designed to reduce the supervised loss on target data, while TUE creates the shortcut by linear separability of perturbations, which is not tied to the specific data. As such, EMN-UCL should have limited data-wise transferability compared with TUE. + +Table 8: Comparison between EMN-UCL and TUE. + +
BackboneMethodTraining-wise transferabilityData-wise transferability
SupervisedUnsupervisedIntra-classInter-classCIFAR-10 → SVHNCIFAR-10 → CIFAR-100
SimCLREMN-UCL19.8947.8316.1514.8279.2545.61
TUE10.6752.3810.1610.9011.7210.53
MoCoEMN-UCL13.3450.6213.6111.9028.5227.43
TUE10.0663.3812.048.5713.958.32
SimSiamEMN-UCL15.3632.7416.1514.8211.1421.47
TUE10.0335.5710.2510.4712.935.10
+ +In Table 8, the experimental results are given to show the following weaknesses of EMN-UCL: + +- First, EMN-UCL has limited data-wise transferability, especially when being transferred onto non-target datasets. Because of the poor linear separability from EMN, the accuracies of EMN-UCL on non-target datasets are much higher on almost every dataset and backbone. EMN-UCL with SimCLR backbone even has an accuracy of $79.25\%$ when transferred from CIFAR-10 to SVHN and $45.61\%$ when transferred from CIFAR-10 to CIFAR-100. However, TUE can reduce the accuracy on SVHN to around $12\%$ and CIFAR-100 to less than $11\%$ on every backbone. +- Second, EMN-UCL has less protection against supervised training than TUE. On CIFAR-10, TUE can reduce the test accuracy of unauthorized supervised training to around $10\%$ , while EMN-UCL has a higher accuracy which is from $13\%$ to $19\%$ on different backbones. This means EMN-UCL provides less protection against supervised training than TUE. + +In conclusion, TUE can provide better supervised unlearnability and better data-wise transferability than combining EMN and UCL. + +# D.2 THE CHANGES OF CSD AFTER INTERPOLATION + +To better understand how interpolation affects the linear separability, we show the change of linear separability after the interpolation in Table 9. The interpolation from CIFAR10 to SVHN has almost no change to CSD. Although the interpolation from CIFAR10 to CIFAR100 increases CSD a little, it is still low enough for good linear separability. The change for SN and TUE in CIFAR100 can be almost ignored. The reason why CSD increases in CIFAR100 is that a larger number of classes would make the perturbation space more crowded. + +Table 9: The changes of CSD values after interpolation. + +
CIFAR-10CIFAR-10 to SVHNCIFAR-10 to CIFAR-100
EMN1.741.602.06
SN0.550.610.66
TUE (SimCLR)0.710.720.85
TUE (MoCo)0.520.580.62
TUE (SimSiam)0.670.690.79
+ +# D.3 ABLATION STUDY + +In this subsection, we conduct ablation experiments on the two terms of the proposed loss. The results are reported in Tables 10 and 11, which show that removing either term will greatly hurt the performance of TUE. + +Particularly, in Table 10, we show that, if we only use CSD loss, the protection against unsupervised training will fail. In Table 11, we show that if only the Contrastive-Learning term is used (reduces to the UCL baseline), it will lose its protection against supervised training. + +Table 10: The changes of CSD values after interpolation. + +
SupervisedUnsupervised
SimCLRMoCoSimSiam
CIFAR-10Clean93.7990.0489.9090.59
CSD9.9980.3379.2481.20
CIFAR-100Clean74.4963.6863.0364.69
CSD1.0355.6951.8158.99
+ +Table 11: The changes of CSD values after interpolation. + +
BackboneMethodCIFAR-10cifar-100
SupervisedUnsupervisedSupervisedUnsupervised
SimCLRClean93.7990.0474.4963.68
UCL92.8647.7872.1716.68
MoCoClean93.7989.9074.4963.03
UCL92.6244.2471.5918.74
SimCLRClean93.7990.5974.4964.69
UCL93.5030.4371.844.64
+ +# D.4 COMPARISON WITH SUPERVISED CONTRASTIVE LEARNING + +The loss of Supervised Contrastive Learning (SCL) has a similar intuition to our CSD. SCL pulls samples within the same class to be closer, while pushing those from different classes far away. However, it is not a suitable loss for unlearnable examples. + +First, SCL cannot quantify linear separability, which is the key property for achieving training-wise and data-wise transferability. Particularly, CSD uses the radio between the intra-class and inter-class distances to measure the overlap between two classes. But SCL takes all the samples that belong to other classes as negative which can not reflect the distance between two classes. + +Second, SCL performs worse than CSD. In Table 12, we test the unlearnable effect of SCL and our TUE with MoCo. It shows that SCL works against supervised exploitation, but it is less effective in preventing unsupervised exploitation. + +Table 12: Comparison between SCL and TUE. + +
SupervisedUnsupervised
CIFAR-10SCL(MoCo)10.1266.46
TUE(MoCo)10.0663.38
CIFAR-100SCL(MoCo)1.2928.11
TUE(MoCo)1.0923.60
+ +In conclusion, although SCL is similar to CSD in the idea of pushing clusters, CSD is more suitable to TUE because it can quantify the linear separability and performs better in the protection against unsupervised training. + +# D.5 PERTURBING A PART OF CLASSES IN THE DATASET + +In some cases, we have access to the whole dataset. Taking social media platforms as an example, for the company, they can protect all the data released on the social media and they do have access to all the data. For users, they can protect their own data by perturbing before uploading. + +In this paper, we focus on the cases where the protection can be added onto all the data. However, we also evaluate when people can only perturb part of the classes of the data (like the users can only perturb their own data) by the experiments shown in Table 13. From Table 13, we can see that although the unsupervised training can still learn semantic features from the partly perturbed data, partly perturbing the dataset can protect data from supervised training very effectively, the accuracy + +on perturbed classes is almost 0 for most cases. When we only have access to a part of the data, the unlearnable examples can still protect that part of classes. + +Table 13: Test accuracy (%) on partly perturb datasets. The accuracy is calculated on the perturbed classes. + +
CIFAR-10cifar-100
Number of perturbed classes12110
Unauthorized trainingSupervisedUnsupervisedSupervisedUnsupervisedSupervisedUnsupervisedSupervisedUnsupervised
TUE(SimCLR)0.2093.400.1592.584.0088.000.9069.00
TUE(MoCo)0.0094.400.0595.554.0083.300.4073.30
TUE(SimSiam)0.1082.700.0586.157.0083.000.2055.60
+ +# D.6 UNLEARNABLE EFFECT OF NEW CLASSES FROM INTERPOLATION + +In this subsection, we show that the new classes of perturbations created by interpolation have good unlearnable effect and data-wise transferability. As shown in Sections 4 and 5.3, we used interpolation to create more classes of perturbations to transfer TUE from CIFAR10 to CIFAR100, i.e., 90 new classes of perturbations are created to protect CIFAR100, while the remaining 10 classes are directly transferred from CIFAR10. To better understand how the unlearnable effect on interpolated new classes is, we show it from two perspectives, i.e., the unlearnable effect against unauthorized training and linear separability (quantified by CSD). First, in Table 14, we show that the unlearnable effect on the new created classes is as good as those directly transferred from CIFAR-10 to CIFAR-100. Second, in Table 15, we show that the linear separability of interpolated perturbations for new classes is almost the same as the linear separability for overall classes. In conclusion, the interpolated new classes have good linear separability and the unlearnable effect can transfer well on non-target dataset. + +Table 14: Test accuracy $(\%)$ on new classes from interpolation. + +
From CIFAR-10 to CIFAR-100New classesOverall classes
TUE(SimCLR)6.4110.53
TUE(MoCo)7.358.32
TUE(SimSiam)11.945.10
+ +Table 15: CSD on new classes from interpolation. + +
From CIFAR-10 to CIFAR-100New classesOverall classes
TUE(SimCLR)0.85270.8507
TUE(MoCo)0.62810.6265
TUE(SimSiam)0.79790.7970
\ No newline at end of file diff --git a/transferableunlearnableexamples/images.zip b/transferableunlearnableexamples/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..42720319845f2e91c2950efcec2b5917dd05da2b --- /dev/null +++ b/transferableunlearnableexamples/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb4ec3e6247c983bbd7a7301ef276a2c6a278eeccf0fb0f9b789a3a9c4341c62 +size 801798 diff --git a/transferableunlearnableexamples/layout.json b/transferableunlearnableexamples/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..5a254f44433aafb6f73a31cccb9a42c3bbadb963 --- /dev/null +++ b/transferableunlearnableexamples/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d901ef60a33ec64a6711e23f7659b717653da05a7aa3d1279ce57359a99f240d +size 550446 diff --git a/transferlearningwithdeeptabularmodels/1dc89b4f-36aa-4331-9391-4480874346bd_content_list.json b/transferlearningwithdeeptabularmodels/1dc89b4f-36aa-4331-9391-4480874346bd_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..4fa0bd3ca8238c26cf9badd098822244cc5165ed --- /dev/null +++ b/transferlearningwithdeeptabularmodels/1dc89b4f-36aa-4331-9391-4480874346bd_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:350b10355e3aa235425be14b1409e8c834e4e37505d9ed159aa7fc882ffdfab5 +size 194056 diff --git a/transferlearningwithdeeptabularmodels/1dc89b4f-36aa-4331-9391-4480874346bd_model.json b/transferlearningwithdeeptabularmodels/1dc89b4f-36aa-4331-9391-4480874346bd_model.json new file mode 100644 index 0000000000000000000000000000000000000000..ba97c5d2469c38e70fbe4e32e4069daee1c3d546 --- /dev/null +++ b/transferlearningwithdeeptabularmodels/1dc89b4f-36aa-4331-9391-4480874346bd_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f4bed77d835b6c476136c1a19a1df85da9f5a65ce10eaf3dd462a3aed904bc8 +size 231901 diff --git a/transferlearningwithdeeptabularmodels/1dc89b4f-36aa-4331-9391-4480874346bd_origin.pdf b/transferlearningwithdeeptabularmodels/1dc89b4f-36aa-4331-9391-4480874346bd_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0605f3a371f8537572fd14e63a5c950d56a90e43 --- /dev/null +++ b/transferlearningwithdeeptabularmodels/1dc89b4f-36aa-4331-9391-4480874346bd_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:719465fca71241b86d92def4add08f264611d44ef537de49ce1d58184930f1a8 +size 1554993 diff --git a/transferlearningwithdeeptabularmodels/full.md b/transferlearningwithdeeptabularmodels/full.md new file mode 100644 index 0000000000000000000000000000000000000000..fa3eb86457a9045e25c491b871fc39ede904c62b --- /dev/null +++ b/transferlearningwithdeeptabularmodels/full.md @@ -0,0 +1,567 @@ +# TRANSFER LEARNING WITH DEEP TABULAR MODELS + +Roman Levin\*1‡ Valerieiia Cherepanova\*2 Avi Schwarzschild†² Arpit Bansal†² C. Bayan Bruss³ Tom Goldstein² Andrew Gordon Wilson⁴ Micah Goldblum⁴ + +1University of Washington 2University of Maryland 3Capital One 4New York University rilevin@uw.edu, vcherepa@umd.edu + +# ABSTRACT + +Recent work on deep learning for tabular data demonstrates the strong performance of deep tabular models, often bridging the gap between gradient boosted decision trees and neural networks. Accuracy aside, a major advantage of neural models is that they are easily fine-tuned in new domains and learn reusable features. This property is often exploited in computer vision and natural language applications, where transfer learning is indispensable when task-specific training data is scarce. In this work, we explore the benefits that representation learning provides for knowledge transfer in the tabular domain. We conduct experiments in a realistic medical diagnosis test bed with limited amounts of downstream data and find that transfer learning with deep tabular models provides a definitive advantage over gradient boosted decision tree methods. We further compare the supervised and self-supervised pre-training strategies and provide practical advice on transfer learning with tabular models. Finally, we propose a pseudo-feature method for cases where the upstream and downstream feature sets differ, a tabular-specific problem widespread in real-world applications. + +# 1 INTRODUCTION + +Tabular data is ubiquitous throughout diverse real-world applications, spanning medical diagnosis (Johnson et al., 2016), housing price prediction (Afonso et al., 2019), loan approval (Arun et al., 2016), and robotics (Wienke et al., 2018), yet practitioners still rely heavily on classical machine learning systems. Recently, neural network architectures and training routines for tabular data have advanced significantly. Leading methods in tabular deep learning (Gorishniy et al., 2021; 2022; Somepalli et al., 2021; Kossen et al., 2021) now perform on par with the traditionally dominant gradient boosted decision trees (GBDT) (Friedman, 2001; Prokhorenkova et al., 2018; Chen and Guestrin, 2016; Ke et al., 2017). On top of their competitive performance, neural networks, which are end-to-end differentiable and extract complex data representations, possess numerous capabilities which decision trees lack; one especially useful capability is transfer learning, in which a representation learned on pre-training data is reused or fine-tuned on one or more downstream tasks. + +Transfer learning plays a central role in industrial computer vision and natural language processing pipelines, where models learn generic features that are useful across many tasks. For example, feature extractors pre-trained on the ImageNet dataset can enhance object detectors (Ren et al., 2015), and large transformer models trained on vast text corpora develop conceptual understandings which can be readily fine-tuned for question answering or language inference (Devlin et al., 2019). One might wonder if deep neural networks for tabular data, which are typically shallow and whose hierarchical feature extraction is unexplored, can also build representations that are transferable beyond their pre-training tasks. In fact, a recent survey paper on deep learning with tabular data suggested that efficient knowledge transfer in tabular data is an open research question (Borisov et al., 2021). In this work, we show that deep tabular models with transfer learning definitively outperform their classical counterparts when auxiliary upstream pre-training data is available and the amount of downstream data is limited. Importantly, we find representation learning with tabular neural networks to be more powerful than gradient boosted decision trees with stacking – a strong baseline leveraging knowledge transfer from the upstream data with classical methods. + +Some of the most common real-world scenarios with limited data are medical applications. Accumulating large amounts of patient data with labels is often very difficult, especially for rare conditions or hospital-specific tasks. However, large related datasets, e.g. for more common diagnoses, may be available in such cases. We note that while computer vision medical applications are common (Irvin et al., 2019; Santa Cruz et al., 2021; Chen et al., 2018b; Turbe et al., 2021), many medical datasets are fundamentally tabular (Goldberger et al., 2000; Johnson et al., 2021; 2016; Law and Liu, 2009). Motivated by this scenario, we choose a realistic medical diagnosis test bed for our experiments both for its practical value and transfer learning suitability. We first design a suite of benchmark transfer learning tasks using the MetaMIMIC repository (Grzyb et al., 2021; Woznica et al., 2022) and use this collection of tasks to compare transfer learning with prominent tabular models and GBDT methods at different levels of downstream data availability. We explore several transfer learning setups and lend suggestions to practitioners who may adopt tabular transfer learning. Additionally, we compare supervised pre-training and self-supervised pre-training strategies and find that supervised pre-training leads to more transferable features in the tabular domain, contrary to findings in vision where a mature progression of self-supervised methods exhibit strong performance (He et al., 2020). + +Finally, we propose a pseudo-feature method which enables transfer learning when upstream and downstream feature sets differ. As tabular data is highly heterogeneous, the problem of downstream tasks whose formats and features differ from those of upstream data is common and has been reported to complicate knowledge transfer (Lewinson, 2020). Nonetheless, if our upstream data is missing columns present in downstream data, we still want to leverage pre-training. Our approach uses transfer learning in stages. In the case that upstream data is missing a column, we first pre-train a model on the upstream data without that feature. We then fine-tune the pre-trained model on downstream data to predict values in the column absent from the upstream data. Finally, after assigning pseudo-values of this feature to the upstream samples, we re-do the pre-training and transfer the feature extractor to the downstream task. This approach offers appreciable performance boosts over discarding the missing features and often performs comparably to models pre-trained with the ground truth feature values. + +Our contributions are summarized as follows: + +1. We find that recent deep tabular models combined with transfer learning have a decisive advantage over strong GBDT baselines, even those that also leverage upstream data. +2. We compare supervised and self-supervised pre-training strategies and find that the supervised pre-training leads to more transferable features in the tabular domain. +3. We propose a pseudo-feature method for aligning the upstream and downstream feature sets in heterogeneous data, addressing a common obstacle in the tabular domain. +4. We provide advice for practitioners on architectures, hyperparameter tuning, and transfer learning setups for tabular transfer learning. + +# 2 RELATED WORK + +Deep learning for tabular data. The field of machine learning for tabular data has traditionally been dominated by gradient-boosted decision trees (Friedman, 2001; Chen and Guestrin, 2016; Ke et al., 2017; Prokhorenkova et al., 2018). These models are used for practical applications across domains ranging from finance to medicine and are consistently recommended as the approach of choice for modeling tabular data (Shwartz-Ziv and Armon, 2022). + +An extensive line of work on tabular deep learning aims to challenge the dominance of GBDT models. Numerous tabular neural architectures have been introduced, based on the ideas of creating differentiable learner ensembles (Popov et al., 2019; Hazimeh et al., 2020; Yang et al., 2018; Kontschieder et al., 2015; Badirli et al., 2020), incorporating attention mechanisms and transformer architectures (Somepalli et al., 2021; Gorishniy et al., 2021; Arik and Pfister, 2021; Huang et al., 2020; Song et al., 2019; Kossen et al., 2021), as well as a variety of other approaches (Wang et al., 2017; 2021; Beutel et al., 2018; Klambauer et al., 2017; Fiedler, 2021; Schäfl et al., 2021). However, recent systematic benchmarking of deep tabular models (Gorishniy et al., 2021; Shwartz-Ziv and Armon, 2022) shows that while these models are competitive with GBDT on some tasks, there is still no universal best method. Gorishniy et al. (2021) show that transformer-based models are the strongest + +alternative to GBDT and that ResNet and MLP models coupled with a strong hyperparameter tuning routine (Akiba et al., 2019) offer competitive baselines. Similarly, Kadra et al. (2021) and Fiedler (2021) find that carefully regularized and slightly modified MLPs are competitive as well as other regularized architectures (Yang et al., 2022). In a follow-up work, Gorishniy et al. (2022) show that transformer architectures equipped with advanced embedding schemes for numerical features bridge the performance gap between deep tabular models and GBDT. + +Transfer learning. Transfer learning (Pan and Yang, 2010; Weiss et al., 2016; Zhuang et al., 2020) has been incredibly successful in domains of computer vision and natural language processing (NLP). Large fine-tuned models excel on a variety of image classification (Dosovitskiy et al., 2020; Dai et al., 2021) and NLP benchmarks (Devlin et al., 2019; Howard and Ruder, 2018). ImageNet (Deng et al., 2009) pre-trained feature extractors are incorporated into the complex pipelines of successful object detection and semantic segmentation models (Chen et al., 2018a; Ren et al., 2015; Redmon and Farhadi, 2018; Redmon et al., 2016). Transfer learning is also particularly helpful in applications with limited data availability such as medical image classification (Alzubaidi et al., 2021; Heker and Greenspan, 2020; Chen et al., 2019; Alzubaidi et al., 2020). + +In the tabular data domain, a recent review paper (Borisov et al., 2021) finds that transfer learning is underexplored and that the question of how to perform knowledge transfer and leverage upstream data remains open. In our work, we seek to answer these questions through a systematic study of transfer learning with recent successful deep tabular models. + +Multiple works mention that transfer learning in the tabular domain is challenging due to the highly heterogeneous nature of tabular data (Jain et al., 2021; Lewinson, 2020). Several papers focus on converting tabular data to images instead (Sharma et al., 2019; Zhu et al., 2021; Sun et al., 2019) and leveraging transfer learning with vision models (Sun et al., 2019). Other studies explore designing CNN-like inductive biases for tabular models (Joffe, 2021), transferring XGBoost hyperparameters (Woznica et al., 2022; Grzyb et al., 2021), and transferring whole models (Fang et al., 2019; Al-Stouhi and Reddy, 2011; Li et al., 2021) in the limited setting of shared label and feature space between the upstream and downstream tasks. Additionally, a recent work by Wang and Sun (2022) proposes a variable-column tabular neural network architecture and applies it to learn information from multiple tables with overlapping columns. While TransTab operates on tables with shared label space, our work focuses on exploring how representation learning can be used to transfer knowledge between related, but different tasks. + +Stacking could also be seen as a form of leveraging upstream knowledge in classical methods (Wolpert, 1992; Ting and Witten, 1997). + +Self-supervised learning. Self-supervised learning (SSL) aimed at harnessing unlabelled data through learning its structure and invariances has accumulated a large body of works over the last few years. Prominent SSL methods, such as Masked Language Modeling (MLM) (Devlin et al., 2019) in NLP and contrastive pre-training in computer vision (Chen et al., 2020) have revolutionized their fields making SSL the pre-training approach of choice (Devlin et al., 2019; Lan et al., 2019; Liu et al., 2019; Lewis et al., 2019; Chen et al., 2020; He et al., 2020; Caron et al., 2020; Bardes et al., 2021; Misra and Maaten, 2020). In fact, SSL pre-training in vision has been shown to produce more transferable features than supervised pre-training on ImageNet (He et al., 2020). + +Recently, SSL has been adopted in the tabular domain for semi-supervised learning (Yin et al., 2020; Yoon et al., 2020; Ucar et al., 2021; Somepalli et al., 2021; Huang et al., 2020). Contrastive pre-training on auxiliary unlabelled data (Somepalli et al., 2021) and MLM-like approaches (Huang et al., 2020) have been shown to provide gains over training from scratch for transformer tabular architectures in cases of limited labelled data. Additionally, Rubachev et al. (2022) investigate benefits of supervised and unsupervised pre-training when applied to the same data without transferring knowledge between tasks. Finally, self-supervised pre-training was successfully applied to time-series data in medical domain (Yèche et al., 2021; McDermott et al., 2021). + +# 3 TRANSFER LEARNING SETUP IN TABULAR DOMAIN + +To study transfer learning in the tabular domain, we need to choose benchmark tasks and training pipelines. In this section, we detail both our upstream-downstream datasets as well as the tools we use to optimize transfer learning for tabular data. + +![](images/f2768f998a90fb880f66cd1599f7e1cfc3349cc4c70351d1a19a3eb942bf8257.jpg) +Figure 1: Tabular transfer learning pipeline with MetaMIMIC. We pre-train deep tabular neural networks on abundant upstream patient data with 11 diagnosis targets via multi-label classification. Then, we fine-tune the pre-trained models on limited downstream data with similar features to predict the new target diagnosis. + +# 3.1 METAMIMIC TEST BED FOR TRANSFER LEARNING EXPERIMENTS + +MetaMIMIC repository. As medical diagnosis data often contains similar test results (i.e. features) across patients, and some diseases (i.e. tasks) are common while others are rare, this setting is a realistic use-case for our work. We thus construct a suite of transfer learning benchmarks using the MetaMIMIC repository Grzyb et al. (2021); Woznica et al. (2022) which is based on the MIMIC-IV Johnson et al. (2021); Goldberger et al. (2000) clinical database of anonymized patient data from the the Beth Israel Deaconess Medical Center ICU admissions. MetaMIMIC contains 12 binary prediction tasks corresponding to different diagnoses such as hypertensive diseases, ischemic heart disease, diabetes, alcohol dependence and others. It covers 34925 patients and 172 features, including one categorical feature (gender), related to the medical examination of patients hand-selected by the authors to have the smallest number of missing values (Grzyb et al., 2021; Woznica et al., 2022). The features include mean, maximum and minimum statistics of lab test results as well as general features such as height, weight, age and gender. The 12 medical diagnosis targets are related tasks of varied similarity and make MetaMIMIC a perfect test bed for transfer learning experiments. + +Upstream and downstream tasks. A medical practitioner may possess abundant annotated diagnosis data corresponding to a number of common diseases and want to harness this data to assist in diagnosing another disease, perhaps one which is rare or for which data is scarce. To simulate this scenario, we create transfer learning problems by splitting the MetaMIMIC data into upstream and downstream tasks. Specifically, we reserve 11 targets for the upstream pre-training tasks and one target for the downstream fine-tuning tasks, thus obtaining 12 upstream-downstream splits – one for each downstream diagnosis. Additionally, we limit the amount of downstream data to 4, 10, 20, 100, and 200 samples corresponding to several scenarios of data availability. + +In total, we have 60 combinations of upstream and downstream datasets for our transfer learning experiments. We pre-train our models as multi-label classifiers on the upstream datasets with 11 targets and then transfer the feature extractors onto the downstream binary diagnosis tasks, Figure 1 presents a diagram illustrating the pipeline. + +# 3.2 TABULAR MODELS + +We conduct transfer learning experiments with four tabular neural networks, and we compare them to two GBDT implementations. + +For neural networks, we use transformer-based architectures found to be the most competitive with GBDT tabular approaches (Gorishniy et al., 2021; Huang et al., 2020; Gorishniy et al., 2022). The specific implementations we consider include the recent FT-Transformer (Gorishniy et al., 2021) and TabTransformer (Huang et al., 2020). We do not include implementations with inter-sample attention + +(Somepalli et al., 2021; Kossen et al., 2021) in our experiments since these do not lend themselves to scenarios with extremely limited downstream data. In addition, we use MLP and ResNet tabular architectures as they are known to be consistent and competitive baselines (Gorishniy et al., 2021). + +The TabTransformer architecture comprises of an embedding layer for categorical features, a stack of transformer layers and a multi-layer perceptron applied to concatenation of processed categorical features and normalized numerical features. In contrast, FT-Transformer architecture transforms all features (including numerical) to embeddings and applies a stack of Transformer layers to the embeddings. + +For GBDT implementation, we use the popular Catboost (Prokhorenkova et al., 2018) and XGBoost libraries (Chen and Guestrin, 2016). + +# 3.3 TRANSFER LEARNING SETUPS AND BASELINES + +In addition to a range of architectures, we consider several setups for transferring the upstream pre-trained neural feature extractors onto downstream tasks. Specifically, we use either a single linear layer or a two-layer MLP with 200 neurons in each layer for the classification head. We also either freeze the weights of the feature extractor or fine-tune the entire model end-to-end. To summarize, we implement four transfer learning setups for neural networks: + +- Linear head atop a frozen feature extractor +- MLP head atop a frozen feature extractor +- End-to-end fine-tuned feature extractor with a linear head +- End-to-end fine-tuned feature extractor with an MLP head + +We compare the above setups to the following baselines: + +- Neural models trained from scratch on downstream data +- CatBoost and XGBoost with and without stacking + +We use stacking for GBDT models to build a stronger baseline which leverages the upstream data (Wolpert, 1992; Ting and Witten, 1997). To implement stacking, we first train upstream GBDT models to predict the 11 upstream targets and then concatenate their predictions to the downstream data features when training downstream GBDT models. + +# 3.4 HYPERPARAMETER TUNING + +The standard hyperparameter tuning procedure for deep learning is to randomly sample a validation set and use it to optimize the hyperparameters. In contrast, in our scenario we often have too little downstream data to afford a sizeable validation split. However, we can make use of the abundant upstream data and leverage hyperparameter transfer which is known to be effective for GBDT (Woznica et al., 2022; Grzyb et al., 2021). + +We tune the hyperparameters of each model with the Optuna library (Akiba et al., 2019) using Bayesian optimization. In particular, for GBDT models and neural baselines trained from scratch, we tune the hyperparameters on a single randomly chosen upstream target with the same number of training samples as available in the downstream task, since hyperparameters depend strongly on the sample size. The optimal hyperparameters are chosen based on the upstream validation set, where validation data is plentiful. We find this tuning strategy to be especially effective for GBDT and provide comparison with default hyperparameters in Appendix C. The benefits of this hyperparameter tuning approach are less pronounced for deep baselines. + +For deep models with transfer learning, we tune the hyperparameters on the full upstream data using the available large upstream validation set with the goal to obtain the best performing feature extractor for the pre-training multi-target task. We then fine-tune this feature extractor with a small learning rate on the downstream data. As this strategy offers considerable performance gains over default hyperparameters, we highlight the importance of tuning the feature extractor and present the comparison with default hyperparameters in Appendix C as well as the details on hyperparameter search spaces for each model. + +![](images/1a6d2165c75b1a18679f05d2c89c9cc620b53483e088b92a2d413959426fb1cd.jpg) +Figure 2: Average model ranks across all downstream tasks. Deep tabular models and GBDT performance is presented on the corresponding panels. Within each panel, columns represent transfer learning setups, and rows correspond to the number of available downstream samples. Warmer colors indicate better performance. FS denotes training from scratch (without pre-training on upstream data), LH and MLP denote linear and MLP heads correspondingly, E2E denotes end-to-end training. Rank is averaged across all downstream tasks. FT-Transformer fine-tuned end-to-end outperforms all GBDT models, including GBDT with stacking, at all data levels. MLP is highly competitive in low data regimes. + +# 4 RESULTS FOR TRANSFER LEARNING WITH DEEP TABULAR MODELS + +In this section, we compare transfer learned deep tabular models with GBDT methods at varying levels of downstream data availability. We note that here we present the aggregated results in the form of the average rank of the models across all of the twelve downstream tasks at each data level. We choose this rank aggregation metric since it does not allow a small number of high-variance tasks to dominate comparisons, unlike, for example, average accuracy. Ranks are computed taking into account statistical significance of the performance differences between the models. We further report the detailed results for all of the models on all datasets and results for TabTransformer in Appendix D. + +Figure 2 presents average model ranks on the downstream tasks as a heatmap where the warmer colors represent better overall rank. The performance of every model is shown on the dedicated panel of the heatmap with the results for different transfer learning setups presented in columns. First, noting the color pattern in the Catboost and XGBoost columns, we observe that deep tabular models pre-trained on the upstream data outperform GBDT at all data levels and especially in the low data regime of 4-20 downstream samples. + +We emphasize that knowledge transfer with stacking, while providing strong boosts compared to from-scratch GBDT training (see Stacking and FS columns of GBDT), still decisively falls behind the deep tabular models with transfer learning, suggesting that representation learning for tabular data is significantly more powerful and allows neural networks to transfer richer information than simple predictions learned on the upstream tasks. + +We summarize the main practical takeaways of Figure 2 below: + +- Simpler models such as MLP with transfer learning are competitive, especially in extremely low data regimes. More complex architectures like FT-Transformer offer consistent performance gains over GBDT across all data levels and reach their peak performance in higher data regimes. +- Representation learning with deep tabular models provides significant gains over strong GBDT baselines leveraging knowledge transfer from the upstream data through stacking. The gains are especially pronounced in low data regimes. +- Regarding transfer learning setups, we find that using an MLP head with a trainable or frozen feature extractor is effective for all deep tabular models. Additionally, a linear head with an end-to-end fine-tuned feature extractor is competitive for FT-Transformer. + +![](images/019e1935fe4e6ed3b3067cd7de91cdccf1d2711f53aeb0d383d64141cca6da82.jpg) +Figure 3: Comparison of supervised and self-supervised pre-training strategies for FT-Transformer. The left panel illustrates end-to-end fine-tuning with linear head and the right plot illustrates end-to-end fine-tuning with MLP head, the two most effective strategies for FT-Transformer. Within each panel, columns represent pre-training strategies and rows correspond to the number of available downstream samples. FS stands for training from scratch (without pre-training on upstream data), MLM and Contrastive denote masked-language-modeling-style and contrastive self-supervised pre-training strategies, and Supervised denotes supervised pre-training on upstream data. Warmer colors indicate better performance. Contrastive pre-training outperforms from-scratch trained models, while MLM pre-training is not effective. Supervised pre-training outperforms all self-supervised pre-training strategies in our experiments. + +![](images/75dc1521291d72770b7fc47878c0e6ddd26bd501fa6d9b44733f7984d5e60785.jpg) + +![](images/fe108a7112d7bb2b7585d06c1719da35a1e16aaf6d74587bb32fa4b766559425.jpg) + +To verify that transfer learning with deep tabular models works well beyond the medical domain, we conduct experiments on other datasets: Yeast functional genomics data from the biological sciences domain (Elisseeff and Weston, 2001) and Emotions data from the music domain (Trohidis et al., 2008). Both datasets are multilabel, and we treat each classification label as a separate task. Similarly to the experiments with MetaMIMIC, we split the tasks into downstream and upstream by reserving $n - 1$ labels for the upstream task and the $n$ -th label for the downstream task. We report results of these experiments in Figures 10, 11 in Appendix D.6. We observe similar trends and in particular that deep tabular models pre-trained on upstream data and finetuned with MLP head outperform deep baselines trained from scratch and Catboost models leveraging stacking. + +# 5 SELF-SUPERVISED PRE-TRAINING + +In domains where established SSL methods are increasingly dominant, such as computer vision, self-supervised learners are known to extract more transferable features than models trained on labelled data (He et al., 2020; 2021). In this section, we compare supervised pre-training with unsupervised pre-training and find that the opposite is true in the tabular domain. We use the Masked Language Model (MLM) pre-training recently adapted to tabular data (Huang et al., 2020) and the tabular version of contrastive learning (Somepalli et al., 2021). Since both methods were proposed for tabular transformer architectures, we conduct the experiments with the FT-Transformer model. The inferior performance of self-supervised pre-training might be a consequence of the fact that SSL is significantly less explored and tuned in the tabular domain than in vision or NLP. + +# 5.1 TABULAR MLM PRE-TRAINING + +Masked Language Modeling (MLM) was first proposed for language models by Devlin et al. (2019) as a powerful unsupervised learning strategy. MLM involves training a model to predict tokens in text masked at random so that its learned representations contain information useful for reconstructing these masked tokens. In the tabular domain, instead of masking tokens, a random subset of features is masked for each sample, and the masked values are predicted in a multi-target classification manner (Huang et al., 2020). In our experiments, we mask one randomly selected feature for each sample, asking the network to learn the structure of the data and form representations from $n - 1$ features that are useful in producing the value in the $n$ -th feature. For more detail, see Appendix B. + +![](images/d429366faec9a237bea920bc0d024bbcf45810db64cea69e757e3f3cd8b92498.jpg) +Figure 4: Pseudo-Feature method for aligning upstream and downstream feature sets. Left: Diagram illustrating strategy for handling mismatches between the upstream and downstream features. When upstream data is missing a feature present in downstream data, it is predicted with a model pre-trained on upstream data and fine-tuned to predict the new feature on the downstream data. When a feature is missing in the downstream data, it is predicted with a model trained to predict this feature on the upstream data. Right top: Scenario with missing feature in the upstream data. Comparison of ranks of FT-Transformer model trained on data with missing feature, with pseudo-feature and with the original feature. Right bottom: Scenario with missing feature in the downstream data. Comparison of ranks of FT-Transformer model trained and fine-tuned on data with missing feature, fine-tuned with pseudo and with original feature. In both scenarios, using the pseudo-feature is better than training without the feature but worse than worse than the original ground truth feature values. + +![](images/06b4266b0ef7bef0f203643d16f5c779ad1f1d4bed2825da06bdd2cb67e370fd.jpg) + +# 5.2 CONTRASTIVE PRE-TRAINING + +Contrastive pre-training uses data augmentations to generate positive pairs, or two different augmented views of a given example, and the loss function encourages a feature extractor to map positive pairs to similar features. Meanwhile, the network is also trained to map negative pairs, or augmented views of different base examples, far apart in feature space. We utilize the implementation of contrastive learning from Somepalli et al. (2021). In particular, we generate positive pairs by applying two data augmentations: CutMix (Yun et al., 2019) in the input space and Mixup (Zhang et al., 2017) in the embedding space. For more details, see Appendix B. + +# 5.3 COMPARING SUPERVISED AND SELF-SUPERVISED PRE-TRAINING + +While self-supervised learning makes for transferable feature extractors in other domains, our experiments show that supervised pre-training is consistently better than the recent SSL pre-training methods we try that are designed for tabular data. In Figure 3, we compare supervised pre-training with contrastive and MLM pre-training strategies and show that supervised pre-training always attains the best average rank. Contrastive pre-training produces better results than training from scratch on the downstream data when using a linear head, but it is still inferior to supervised pre-training. Tabular MLM pre-training also falls behind the supervised strategy and performs comparably to training from scratch in the lower data regimes but leads to a weaker downstream model in the higher data regimes. + +# 6 ALIGNING UPSTREAM AND DOWNSTREAM FEATURE SETS WITH PSEUDO-FEATURES + +While so far we have worked with upstream and downstream tasks which shared a common feature space, in the real world, tabular data is highly heterogeneous and upstream data having a different set of features from downstream data is a realistic problem (Lewinson, 2020). In our medical data scenario, downstream patient data may include additional lab tests not available for patients in the upstream data. In fact, the additional downstream feature may not even be meaningful for the upstream data, such as medical exams only applicable to downstream patients of biological sex different from the upstream patients. In this section, we propose a pseudo-feature method for aligning the upstream and downstream data and show that the data heterogeneity problem can be addressed more effectively than simply taking the intersection of the upstream and downstream feature sets for tabular transfer learning, which would throw away useful features. The proposed pseudo-feature method is related to missing data imputation Zhang et al. (2008); Sefidian and Daneshpour (2019); Yoon et al. (2018) and self-training ideas Tanha et al. (2017). In particular, misalignment of feature sets in upstream and downstream data can be seen as an extreme scenario with features having all values missing. + +Suppose our upstream data $(X_{u},Y_{u})$ is missing a feature $x_{\mathrm{new}}$ present in the downstream data $(X_d,Y_d)$ . We then use transfer learning in stages. As the diagram on the left panel of Figure 4 shows: + +1. Pre-train feature extractor $f: X_u \to Y_u$ on upstream data $(X_u, Y_u)$ without feature $x_{\mathrm{new}}$ . +2. Fine-tune the feature extractor $f$ on the downstream samples $X_{d}$ to predict $x_{\mathrm{new}}$ as the target and obtain a model $\hat{f}:X_d\setminus \{x_{\mathrm{new}}\} \to x_{\mathrm{new}}$ . +3. Use the model $\hat{f}$ to assign pseudo-values $\hat{x}_{\mathrm{new}}$ of the missing feature to the upstream samples: $\hat{x}_{\mathrm{new}} = \hat{f}(X_u)$ thus obtaining augmented upstream data $(X_u \cup \{\hat{x}_{\mathrm{new}}, Y_u)$ . +4. Finally, we can leverage the augmented upstream data $(X_{u}\cup \{\hat{x}_{\mathrm{new}}\} ,Y_{u})$ to pre-train a feature extractor which we will fine-tune on the original downstream task $(X_{d},Y_{d})$ using all of the available downstream features. + +Similarly, in scenarios with a missing feature in downstream data, we can directly train a feature predictor on the upstream data and obtain pseudo-values for the downstream data. + +This approach offers appreciable performance boosts over discarding the missing features and often performs comparably to models pre-trained with the ground truth feature values as shown in the right panel of Figure 4. The top heatmap represents the experiment where downstream data has an additional feature missing from the upstream data. The bottom heatmap represents the opposite scenario of the upstream data having an additional feature not available in the downstream data. To ensure that the features we experiment with are meaningful and contain useful information, for each task we chose important features according to GBDT feature importances. We observe that in both experiments, using the pseudo feature is better than doing transfer learning without the missing feature at all. Additionally, we observe that in some cases, the pseudo-feature approach performs comparably to using the original ground truth feature (10-100 samples on the top heatmap and 20 samples on the bottom heatmap). Interestingly, the pseudo-feature method is more beneficial when upstream features are missing, which suggests that having ground-truth values for the additional feature in the downstream data is more important. + +# 7 DISCUSSION + +In this paper, we demonstrate that deep tabular models with transfer learning definitively outperform strong GBDT baselines with stacking in a realistic scenario where the target downstream data is limited and auxiliary upstream pre-training data is available. We highlight that representation learning with neural networks enables more effective knowledge transfer than leveraging upstream task predictions through stacking. Additionally, we present a pseudo-feature method to enable effective transfer learning in challenging cases where the upstream and downstream feature sets differ. We provide suggestions regarding architectures, hyperparameter tuning, and setups for tabular transfer learning and hope that this work serves as a guide for practitioners. + +# 8 ETHICS STATEMENT + +We conduct experiments with the MetaMIMIC medical dataset (Grzyb et al., 2021; Woźnica et al., 2022), which is based on the publicly accessible MIMIC database (Goldberger et al., 2000; Johnson et al., 2016; 2021). Regarding the patient consent to collect this data, as stated in (Johnson et al., 2016): "The project was approved by the Institutional Review Boards of Beth Israel Deaconess Medical Center (Boston, MA) and the Massachusetts Institute of Technology (Cambridge, MA). Requirement for individual patient consent was waived because the project did not impact clinical care and all protected health information was deidentified". The MIMIC database is freely available to any person upon completion of the credentialing process found at the following link: https://mimic-iv.mit.edu/docs/access/ and is distributed under Open Data Commons Open Database License v1.0, please see the following link for details: https://physionet.org/content/mimic-iv-demo-omop/view-license/0.9/. + +# 9 REPRODUCIBILITY STATEMENT + +We include the code for reproducing our results in the supplementary materials. We also describe strategies for data preprocessing, training the models, choosing the best epoch as well as hyperparameter ranges in Appendix B and C. + +# 10 ACKNOWLEDGMENTS + +This work was supported by the Office of Naval Research, the National Science Foundation (IIS-2212182), and Capital One Bank. + +# REFERENCES + +B. Afonso, L. Melo, W. Oliveira, S. Sousa, and L. Berton. Housing prices prediction with a deep learning and random forest ensemble. In Anais do XVI Encontre Nacional de Inteligência Artificial e Computacional, pages 389-400. SBC, 2019. +T. Akiba, S. Sano, T. Yanase, T. Ohta, and M. Koyama. Optuna: A next-generation hyperparameter optimization framework. In Proceedings of the 25th ACM SIGKDD international conference on knowledge discovery & data mining, pages 2623-2631, 2019. +S. Al-Stouhi and C. K. Reddy. Adaptive boosting for transfer learning using dynamic updates. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pages 60-75. Springer, 2011. +L. Alzubaidi, M. A. Fadhel, O. Al-Shamma, J. Zhang, and Y. Duan. Deep learning models for classification of red blood cells in microscopy images to aid in sickle cell anemia diagnosis. *Electronics*, 9(3):427, 2020. +L. Alzubaidi, M. Al-Amidie, A. Al-Asadi, A. J. Humaidi, O. Al-Shamma, M. A. Fadhel, J. Zhang, J. Santamaría, and Y. Duan. Novel transfer learning approach for medical imaging with limited labeled data. Cancers, 13(7):1590, 2021. +S. O. Arik and T. Pfister. Tabnet: Attentive interpretable tabular learning. In AAAI, volume 35, pages 6679-6687, 2021. +K. Arun, G. Ishan, and K. Sanmeet. Loan approval prediction based on machine learning approach. IOSR J. Comput. Eng, 18(3):18-21, 2016. +S. Badirli, X. Liu, Z. Xing, A. Bhowmik, K. Doan, and S. S. Keerthi. Gradient boosting neural networks: Grownet. arXiv preprint arXiv:2002.07971, 2020. +D. Bahri, H. Jiang, Y. Tay, and D. Metzler. Scarf: Self-supervised contrastive learning using random feature corruption. arXiv preprint arXiv:2106.15147, 2021. + +A. Bardes, J. Ponce, and Y. LeCun. Vicreg: Variance-invariance-covariance regularization for self-supervised learning. arXiv preprint arXiv:2105.04906, 2021. +A. Beutel, P. Covington, S. Jain, C. Xu, J. Li, V. Gatto, and E. H. Chi. Latent cross: Making use of context in recurrent recommender systems. In Proceedings of the Eleventh ACM International Conference on Web Search and Data Mining, pages 46-54, 2018. +V. Borisov, T. Leemann, K. Seßler, J. Haug, M. Pawelczyk, and G. Kasneci. Deep neural networks and tabular data: A survey. arXiv preprint arXiv:2110.01889, 2021. +M. Caron, I. Misra, J. Mairal, P. Goyal, P. Bojanowski, and A. Joulin. Unsupervised learning of visual features by contrasting cluster assignments. Advances in Neural Information Processing Systems, 33:9912-9924, 2020. +L.-C. Chen, Y. Zhu, G. Papandreou, F. Schroff, and H. Adam. Encoder-decoder with atrous separable convolution for semantic image segmentation. In Proceedings of the European conference on computer vision (ECCV), pages 801-818, 2018a. +S. Chen, A. Qin, D. Zhou, and D. Yan. U-net-generated synthetic ct images for magnetic resonance imaging-only prostate intensity-modulated radiation therapy treatment planning. Medical physics, 45(12):5659-5665, 2018b. +S. Chen, K. Ma, and Y. Zheng. Med3d: Transfer learning for 3d medical image analysis. arXiv preprint arXiv:1904.00625, 2019. +T. Chen and C. Guestrin. Xgboost: A scalable tree boosting system. In Proceedings of the 22nd acm SIGkdd international conference on knowledge discovery and data mining, pages 785-794, 2016. +T. Chen, S. Kornblith, M. Norouzi, and G. Hinton. A simple framework for contrastive learning of visual representations. In International conference on machine learning, pages 1597-1607. PMLR, 2020. +Z. Dai, H. Liu, Q. V. Le, and M. Tan. Coatnet: Marrying convolution and attention for all data sizes. arXiv preprint arXiv:2106.04803, 2021. +J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE Conference on Computer Vision and Pattern Recognition, pages 248-255, 2009. doi: 10.1109/CVPR.2009.5206848. +J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 4171-4186, 2019. +A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020. +A. Elisseeff and J. Weston. A kernel method for multi-labelled classification. Advances in neural information processing systems, 14, 2001. +W. Fang, C. Chen, B. Song, L. Wang, J. Zhou, and K. Q. Zhu. Adapted tree boosting for transfer learning. In 2019 IEEE International Conference on Big Data (Big Data), pages 741-750. IEEE, 2019. +J. Fiedler. Simple modifications to improve tabular neural networks. arXiv preprint arXiv:2108.03214, 2021. +J. H. Friedman. Greedy function approximation: a gradient boosting machine. Annals of statistics, pages 1189-1232, 2001. +A. L. Goldberger, L. A. Amaral, L. Glass, J. M. Hausdorff, P. C. Ivanov, R. G. Mark, J. E. Mietus, G. B. Moody, C.-K. Peng, and H. E. Stanley. Physiobank, physiotoolkit, and physionet: components of a new research resource for complex physiologic signals. circulation, 101(23):e215-e220, 2000. + +Y. Gorishniy, I. Rubachev, V. Khrulkov, and A. Babenko. Revisiting deep learning models for tabular data. arXiv preprint arXiv:2106.11959, 2021. +Y. Gorishniy, I. Rubachev, and A. Babenko. On embeddings for numerical features in tabular deep learning. arXiv preprint arXiv:2203.05556, 2022. +M. Grzyb, Z. Trafas, K. Woznica, and P. Biecek. metamimic: analysis of hyperparameter transferability for tabular data using mimic-iv database, 2021. URL https://github.com/ModelOriented/metaMIMIC/blob/main/preprint.pdf. +H. Hazimeh, N. Ponomareva, P. Mol, Z. Tan, and R. Mazumder. The tree ensemble layer: Differentiability meets conditional computation. In International Conference on Machine Learning, pages 4138-4148. PMLR, 2020. +K. He, H. Fan, Y. Wu, S. Xie, and R. Girshick. Momentum contrast for unsupervised visual representation learning. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 9729-9738, 2020. +K. He, X. Chen, S. Xie, Y. Li, P. Dollar, and R. Girshick. Masked autoencoders are scalable vision learners. arXiv preprint arXiv:2111.06377, 2021. +M. Heker and H. Greenspan. Joint liver lesion segmentation and classification via transfer learning. arXiv preprint arXiv:2004.12352, 2020. +J. Howard and S. Ruder. Universal language model fine-tuning for text classification. arXiv preprint arXiv:1801.06146, 2018. +X. Huang, A. Khetan, M. Cvtikovic, and Z. Karnin. Tabtransformer: Tabular data modeling using contextual embeddings. arXiv preprint arXiv:2012.06678, 2020. +J. Irvin, P. Rajpurkar, M. Ko, Y. Yu, S. Ciurea-Ilcus, C. Chute, H. Marklund, B. Haghgoo, R. Ball, K. Shpanskaya, et al. Chexpert: A large chest radiograph dataset with uncertainty labels and expert comparison. In Proceedings of the AAAI conference on artificial intelligence, volume 33, pages 590-597, 2019. +V. Jain, M. Goel, and K. Shah. Deep learning on small tabular dataset: Using transfer learning and image classification. In International Conference on Artificial Intelligence and Speech Technology, pages 555-568. Springer, 2021. +L. Joffe. Transfer learning for tabular data. 2021. +A. Johnson, L. Bulgarelli, T. Pollard, S. Horng, L. A. Celi, and R. Mark. Mimic-iv, 2021. URL https://physionet.org/content/mimiciv/1.0/. +A. E. Johnson, T. J. Pollard, L. Shen, H. L. Li-Wei, M. Feng, M. Ghassemi, B. Moody, P. Szolovits, L. A. Celi, and R. G. Mark. Mimic-iii, a freely accessible critical care database. *Scientific data*, 3 (1):1–9, 2016. +A. Kadra, M. Lindauer, F. Hutter, and J. Grabocka. Regularization is all you need: Simple neural nets can excel on tabular data. arXiv preprint arXiv:2106.11189, 2021. +G. Ke, Q. Meng, T. Finley, T. Wang, W. Chen, W. Ma, Q. Ye, and T.-Y. Liu. Lightgbm: A highly efficient gradient boosting decision tree. Advances in neural information processing systems, 30, 2017. +G. Klambauer, T. Unterthiner, A. Mayr, and S. Hochreiter. Self-normalizing neural networks. Advances in neural information processing systems, 30, 2017. +P. Kontschieder, M. Fiterau, A. Criminisi, and S. R. Bulo. Deep neural decision forests. In Proceedings of the IEEE international conference on computer vision, pages 1467-1475, 2015. +J. Kossen, N. Band, C. Lyle, A. N. Gomez, T. Rainforth, and Y. Gal. Self-attention between datapoints: Going beyond individual input-output pairs in deep learning. Advances in Neural Information Processing Systems, 34, 2021. + +Z. Lan, M. Chen, S. Goodman, K. Gimpel, P. Sharma, and R. Soricut. Albert: A lite bert for self-supervised learning of language representations. arXiv preprint arXiv:1909.11942, 2019. +M. Y. Law and B. Liu. Dicom-rt and its utilization in radiation therapy. Radiographics, 29(3): 655-667, 2009. +E. Lewinson. Python for Finance Cookbook: Over 50 recipes for applying modern Python libraries to financial data analysis. Packt Publishing Limited, 2020. +M. Lewis, Y. Liu, N. Goyal, M. Ghazvininejad, A. Mohamed, O. Levy, V. Stoyanov, and L. Zettlemoyer. Bart: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. arXiv preprint arXiv:1910.13461, 2019. +Z. Li, D. Ding, X. Liu, P. Zhang, Y. Wu, and L. Ma. Ttnet: Tabular transfer network for few-samples prediction. In IEEE/WIC/ACM International Conference on Web Intelligence and Intelligent Agent Technology, pages 293-301, 2021. +Y. Liu, M. Ott, N. Goyal, J. Du, M. Joshi, D. Chen, O. Levy, M. Lewis, L. Zettlemoyer, and V. Stoyanov. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692, 2019. +I. Loshchilov and F. Hutter. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017. +H. B. Mann and D. R. Whitney. On a test of whether one of two random variables is stochastically larger than the other. The annals of mathematical statistics, pages 50-60, 1947. +M. McDermott, B. Nestor, E. Kim, W. Zhang, A. Goldenberg, P. Szolovits, and M. Ghassemi. A comprehensive ehr timeseries pre-training benchmark. In Proceedings of the Conference on Health, Inference, and Learning, pages 257-278, 2021. +I. Misra and L. v. d. Maaten. Self-supervised learning of pretext-invariant representations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6707-6717, 2020. +S. J. Pan and Q. Yang. A survey on transfer learning. IEEE Transactions on Knowledge and Data Engineering, 22(10):1345-1359, 2010. doi: 10.1109/TKDE.2009.191. +S. Popov, S. Morozov, and A. Babenko. Neural oblivious decision ensembles for deep learning on tabular data. arXiv preprint arXiv:1909.06312, 2019. +L. Prokhorenkova, G. Gusev, A. Vorobev, A. V. Dorogush, and A. Gulin. Catboost: unbiased boosting with categorical features. Advances in neural information processing systems, 31, 2018. +J. Redmon and A. Farhadi. Yolov3: An incremental improvement. arXiv preprint arXiv:1804.02767, 2018. +J. Redmon, S. Divvala, R. Girshick, and A. Farhadi. You only look once: Unified, real-time object detection. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 779-788, 2016. +S. Ren, K. He, R. Girshick, and J. Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. Advances in neural information processing systems, 28:91-99, 2015. +I. Rubachev, A. Alekberov, Y. Gorishniy, and A. Babenko. Revisiting pretraining objectives for tabular deep learning. arXiv preprint arXiv:2207.03208, 2022. +B. G. Santa Cruz, M. N. Bossa, J. Sölter, and A. D. Husch. Public Covid-19 x-ray datasets and their impact on model bias-a systematic review of a significant problem. Medical image analysis, 74: 102225, 2021. +B. Schäfl, L. Gruber, A. Bitto-Nemling, and S. Hochreiter. Hoplar: Modern hopfield networks for tabular data. 2021. + +A. M. Sefidian and N. Daneshpour. Missing value imputation using a novel grey based fuzzy c-means, mutual information based feature selection, and regression model. Expert Systems with Applications, 115:68-94, 2019. +A. Sharma, E. Vans, D. Shigemizu, K. A. Boroevich, and T. Tsunoda. Deepinsight: A methodology to transform a non-image data to an image for convolution neural network architecture. Scientific reports, 9(1):1-7, 2019. +R. Shwartz-Ziv and A. Armon. Tabular data: Deep learning is not all you need. Information Fusion, 81:84-90, 2022. ISSN 1566-2535. doi: https://doi.org/10.1016/j.inffus.2021.11.011. URL https://www.sciencedirect.com/science/article/pii/S1566253521002360. +G. Somepalli, M. Goldblum, A. Schwarzschild, C. B. Bruss, and T. Goldstein. Saint: Improved neural networks for tabular data via row attention and contrastive pre-training. arXiv preprint arXiv:2106.01342, 2021. +W. Song, C. Shi, Z. Xiao, Z. Duan, Y. Xu, M. Zhang, and J. Tang. Autoint: Automatic feature interaction learning via self-attentive neural networks. In Proceedings of the 28th ACM International Conference on Information and Knowledge Management, pages 1161–1170, 2019. +B. Sun, L. Yang, W. Zhang, M. Lin, P. Dong, C. Young, and J. Dong. Supertml: Two-dimensional word embedding for the precognition on structured tabular data. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pages 0-0, 2019. +J. Tanha, M. Van Someren, and H. Afsarmanesh. Semi-supervised self-training for decision tree classifiers. International Journal of Machine Learning and Cybernetics, 8(1):355-370, 2017. +K. M. Ting and I. H. Witten. Stacked generalization: when does it work? 1997. +K. Trohidis, G. Tsoumakas, G. Kalliris, I. P. Vlahavas, et al. Multi-label classification of music into emotions. In ISMIR, volume 8, pages 325-330, 2008. +V. Turbe, C. Herbst, T. Mngomezulu, S. Meshkinfamfard, N. Dlamini, T. Mhlongo, T. Smit, V. Cherepanova, K. Shimada, J. Budd, et al. Deep learning of hiv field-based rapid tests. Nature Medicine, 27(7):1165-1170, 2021. +T. Ucar, E. Hajiramezanali, and L. Edwards. Subtab: Subsetting features of tabular data for self-supervised representation learning. Advances in Neural Information Processing Systems, 34, 2021. +R. Wang, B. Fu, G. Fu, and M. Wang. Deep & cross network for ad click predictions. In Proceedings of the ADKDD'17, pages 1-7. 2017. +R. Wang, R. Shivanna, D. Cheng, S. Jain, D. Lin, L. Hong, and E. Chi. Dcn v2: Improved deep & cross network and practical lessons for web-scale learning to rank systems. In Proceedings of the Web Conference 2021, pages 1785-1797, 2021. +Z. Wang and J. Sun. Transtab: Learning transferable tabular transformers across tables. arXiv preprint arXiv:2205.09328, 2022. +K. Weiss, T. M. Khoshgoftaar, and D. Wang. A survey of transfer learning. Journal of Big data, 3(1): 1-40, 2016. +J. Wienke, D. Wigand, N. Koster, and S. Wrede. Model-based performance testing for robotics software components. In 2018 Second IEEE International Conference on Robotic Computing (IRC), pages 25-32. IEEE, 2018. +F. Wilcoxon. Individual comparisons by ranking methods. Biometrics Bulletin, 1(6):80-83, 1945. ISSN 00994987. URL http://www.jstor.org/stable/3001968. +D. H. Wolpert. Stacked generalization. Neural networks, 5(2):241-259, 1992. +K. Woznica, M. Grzyb, Z. Trafas, and P. Biecek. Consolidated learning-a domain-specific model-free optimization strategy with examples for xgboost and mimic-iv. arXiv preprint arXiv:2201.11815, 2022. + +J. Yang, O. Lindenbaum, and Y. Kluger. Locally sparse neural networks for tabular biomedical data. In International Conference on Machine Learning, pages 25123-25153. PMLR, 2022. +Y. Yang, I. G. Morillo, and T. M. Hospedales. Deep neural decision trees. arXiv preprint arXiv:1806.06988, 2018. +H. Yèche, G. Dresdner, F. Locatello, M. Hüser, and G. Rätsch. Neighborhood contrastive learning applied to online patient monitoring. In International Conference on Machine Learning, pages 11964-11974. PMLR, 2021. +P. Yin, G. Neubig, W.-t. Yih, and S. Riedel. Tabert: Pretraining for joint understanding of textual and tabular data. arXiv preprint arXiv:2005.08314, 2020. +J. Yoon, J. Jordan, and M. Schaar. Gain: Missing data imputation using generative adversarial nets. In International conference on machine learning, pages 5689-5698. PMLR, 2018. +J. Yoon, Y. Zhang, J. Jordon, and M. van der Schaar. Vime: Extending the success of self-and semi-supervised learning to tabular domain. Advances in Neural Information Processing Systems, 33:11033-11043, 2020. +S. Yun, D. Han, S. J. Oh, S. Chun, J. Choe, and Y. Yoo. Cutmix: Regularization strategy to train strong classifiers with localizable features. In Proceedings of the IEEE/CVF international conference on computer vision, pages 6023-6032, 2019. +H. Zhang, M. Cisse, Y. N. Dauphin, and D. Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017. +S. Zhang, J. Zhang, X. Zhu, Y. Qin, and C. Zhang. Missing value imputation based on data clustering. In Transactions on computational science I, pages 128-138. Springer, 2008. +Y. Zhu, T. Brettin, F. Xia, A. Partin, M. Shukla, H. Yoo, Y. A. Evrard, J. H. Doroshow, and R. L. Stevens. Converting tabular data into images for deep learning with convolutional neural networks. Scientific reports, 11(1):1-11, 2021. +F. Zhuang, Z. Qi, K. Duan, D. Xi, Y. Zhu, H. Zhu, H. Xiong, and Q. He. A comprehensive survey on transfer learning. Proceedings of the IEEE, 109(1):43-76, 2020. + +# A LIMITATIONS AND IMPACT + +In this section we discuss limitations of our work. We note that transfer learning with deep tabular models requires more computational resources than training XGBoost or CatBoost, especially when the hyperparameter tuning is used thus incurring additional costs on practitioners adopting our approach. In addition, while we handle the cases of differing upstream and downstream feature sets thus allowing for transfer learning with heterogeneous data, our approach relies on having reasonably similar (but not identical) upstream and downstream feature sets and related upstream and downstream tasks and we do not propose a foundation model for tabular data. + +# B EXPERIMENTAL DETAILS. + +# B.1 HARDWARE + +We ran our experiments on NVIDIA GeForce RTX 2080 Ti machines. + +# B.2 IMPLEMENTATION LICENSES + +For the model implementations and training routines we adapt the code from the following publicly available repositories and libraries: + +- RTDL ${}^{1}$ under MIT License +- TabTransformer ${}^{2}$ under MIT License +- Catboost ${}^{3}$ under Apache License +XGBoost ${}^{4}$ under Apache License + +# B.3 DETAILS ON METAMIMIC TARGETS + +The MetaMIMIC Repository (Grzyb et al., 2021; Woznica et al., 2022) is based on the publicly accessible MIMIC database (Goldberger et al., 2000; Johnson et al., 2016; 2021) which contains health related data from patients admitted to the ICU. MetaMIMIC contains health records for 34925 unique patients, who are at least 15 years old, were diagnosed with at least one of considered diseases, and did not stay in hospital for more than 60 days. The target diagnoses correspond to the 50 most common conditions, which are also found in both ICD-9 and ICD-10 codes (International Classification of Diseases), which results in 12 unique diagnoses. Please, see Table 1 for selected targets, their ICD codes and frequency in the considered cohort (adapted from Table 1 in Woznica et al. (2022)). + +To understand how related the MetaMIMIC tasks are, we compute pair-wise correlations between targets and present them as a heatmap in Figure 5. We find that the maximum correlation of 0.36 is between ischemic and hypertensive diagnoses, while the average absolute pair-wise correlation is 0.08. We conclude that although certain tasks are slightly correlated, such as targets corresponding to cardiovascular diseases, the average pair-wise correlation between all the targets is low. + +# B.4 DETAILS ON THE UPSTREAM-DOWNSTREAM SPLITS AND THE NUMBER OF SEEDS + +We reserve 6985 patients (20% of the MetaMIMIC data) for the downstream test set, and use 22701 patients (65% of the MetaMIMIC data) for training and 5239 patients (15% of the MetaMIMIC data) as a validation set for hyperparameter tuning of the upstream feature extractors. We further simulate scenarios with different levels of data availability by sampling from the training data downstream patients for fine-tuning. We note that these splits do not change across seeds. We use similar splits on Yeast and Emotions datasets. + +
ConditionICD-9ICD-10Frequency
Hypertensive diseases401-405I10-I1659.8%
Disorders of lipid metabolism272E7840.3%
Anemia280-285D60-D6435.9%
Ischemic heart disease410-414I20-I2532.8%
Diabetes249-250E08-E1325.3%
Chronic lower respiratory diseases466, 490-496J40-J4719.5%
Heart failure428I5019.4%
Hypotension458I9514.5%
Purpura and other hemorrhagic conditions287D6911.9%
Atrial fibrillation and flutter427.3I4810.5%
Overweight, obesity and other hyperalimentation278E65-E6810.5%
Alcohol dependence303F107.7%
+ +Table 1: Selected targets with corresponding ICD codes and frequency in the considered cohort. + +![](images/674907382cab992e512d997d6ff887ae4c733a91ef1815d0ec9b91a356019c91.jpg) +Figure 5: Correlations between MetaMIMIC targets. The heatmap represents absolute pair-wise correlations between MetaMIMIC targets. + +We run each experiment with 10 random seeds for the experiments on transfer learning with deep tabular models in Section 4 and Appendix D, and with 5 random seeds for the experiments with self-supervised pre-training and feature imputation in Sections 5, 6 and Appendix D. + +# B.5 DATA PREPROCESSING + +We preprocess numerical features with quantile transformation with standard output distribution for neural networks and we use original features for GBDT models. Quantile transformer is first fit on upstream data and then applied to downstream data to preserve similar feature distribution in upstream and downstream data. We note, that using the same normalization for upstream and downstream data is a very important step for transfer learning. We impute missing values with mean values for numerical features and with a new category for categorical features. + +# B.6 TRAINING DETAILS + +# B.6.1 SUPERVISED PRE-TRAINING + +All deep models are trained with AdamW optimizer (Loshchilov and Hutter, 2017). We pre-train models on upstream data for 500 epochs with patience set to 30, meaning that we continue training until there are 30 consecutive epochs without improvement on the validation set, but no longer than 500 epochs. Since we assume limited data availability for downstream task, we do not sample a validation set for early stopping. Instead, we fine-tune/train models from scratch for 200 epochs and choose an "optimal" epoch as discussed in Section B.6.3. We use learning rate $1e - 4$ for training from scratch on downstream data and learning rate $5e - 5$ for fine-tuning pre-trained models. For pre-training, learning rate and weight decay are tunable hyperparameters for each model and each pre-training dataset (collection of $n - 1$ upstream tasks). Batch size was set to 256 in all transfer-learning experiments. + +# B.6.2 SELF-SUPERVISED PRE-TRAINING + +# MLM Pre-training + +To implement MLM pre-training for tabular data, for each training sample in a batch we randomly select a feature to replace with a masking token (in the embedding space), which is unique for every feature. We also initialize a distinct fully connected layer, or head, for each column which is used to predict the masked values of that feature. We compute the appropriate loss, cross-entropy for categorical features and MSE for numerical ones, using the output from the head corresponding to the masked feature. + +Our masked pre-training routine has very no additional hyperparameters. The only deviations form the pre-training hyperparameters listed above are that we use larger batch sizes of 512 and we do not employ patience. In this setting we pre-training for a full 500 epochs. + +Since MLM pre-training requires training additional classification heads for every feature in the data, it dramatically increases the memory requirements. Because of that we limit the experiments with self-supervised pre-training to using the default FT-transformer configuration, including the setups we compare to, that is training from scratch and using supervised pre-training. + +# Contrastive Learning + +We adapt the implementation of contrastive learning for tabular data from Somepalli et al. (2021). The pre-training loss consists of two components, the first is the InfoNCE contrastive loss, which minimizes the distance between the representation of two views of the same data point (original and augmented samples), while maximizing the distance in the feature space between different samples. The second component is denoising loss, which is used to train an MLP head to predict the original sample from a noisy view of that sample. For a detailed explanation of contrastive pre-training for tabular data we refer the reader to Somepalli et al. (2021). To construct positive pairs for contrastive loss and noisy samples for denoising loss we use two data augmentations: CutMix in the input space and Mixup in the embedding space Yun et al. (2019); Zhang et al. (2017). + +Formally, let a batch of data be represented by $X = \{x_{i}\}_{i = 0}^{n}$ , where each $x_{i}$ has $q$ features. Let $m$ denote a binary mask (over the features of any $x_{i}$ ) with each entry being a one with probability $p$ . Then CutMix augmentation of a sample in the input space is computed as + +$$ +x _ {i} ^ {\mathrm {C u t M i x}} = m \times x _ {i} + (1 - m) \times x _ {j} +$$ + +where $j$ is a random index chosen from $[0, n]$ . To define Mixup in the embedding space, let $\hat{X}^{\mathrm{CutMix}}$ be the set of the embeddings of the entire CutMix-ed batch. Then, Mixup augmentation is computed as a convex combination + +$$ +\hat {x _ {i}} ^ {\mathrm {M i x u p}} = \mu \hat {x _ {i}} ^ {\mathrm {C u t M i x}} + (1 - \mu) \hat {x _ {k}} ^ {\mathrm {C u t M i x}} +$$ + +where $k$ is again a random index chosen from $[0, n]$ . + +The hyperparameters are similar to supervised pre-training with only several modifications. First, we use smaller batch sized of 200 and we train for a full 500 epochs (no patience). Also, contrastive learning has additional hyperparameters $m$ and $\mu$ , both of which we set to 0.9. + +# B.6.3 EPOCH SELECTION + +Since we work with limited downstream data, sampling a validation set for early stopping is not always possible. Therefore, we select the number of fine-tuning epochs for deep models as follows. For the data levels of 4 and 10 samples, we simply select 30 fine-tuning epochs. For more data of 20 samples, we select 60 fine-tuning epochs. In the larger data levels of 100 and 200 samples, we sample $20\%$ of the data as a validation set to perform early stopping with the flexible end-to-end fine-tuned transfer learning setups prone to overfitting. For early stopping, we terminates training if no improvement in the validation score is observed for more than 30 epochs. In the less flexible transfer learning setups with a frozen feature extractor, we select 100 fine-tuning epochs for the MLP head atop a frozen feature extractor and 200 fine-tuning epochs for the linear head atop a frozen feature extractor. Finally, for the deep baselines with the hyperparameters tuned on a small subsample of the upstream data, we select the best epoch from the small upstream subsample. + +# B.6.4 STACKING FOR GBDT MODELS + +For XGBoost models we incorporate stacking by training 11 additional XGBoost classifiers on upstream tasks and stack their predictions as additional features for downstream data. For Catboost we apply the same strategy, but we train a single multi-label Catboost classifier predicting all 11 upstream labels. + +# B.6.5 STATISTICAL SIGNIFICANCE + +We compute ranks taking into account statistical significance of the performance differences between the models; on a given task, top models without statistically significant performance difference all receive rank 1. To compute statistical significance we use the one-sided Wilcoxon Rank-Sum test Wilcoxon (1945); Mann and Whitney (1947) with $p = 0.05$ . We run each experiment with 10 random seeds for the experiments in Section 4 and 5 random seeds for the experiments in Sections 5, 6. + +# C HYPERPARAMETER TUNING + +In this section we provide hyperparameter search spaces and distributions for Optuna for each model, which are adapted from the original papers. For Catboost and XGBoost models we use search spaces proposed in Gorishniy et al. (2021). We run 50 Optuna trials to tune hyperparameters for each model. In our experiments we tune the hyperparameters on full upstream data for deep tabular models with transfer learning, and on upstream data of the same size as downstream data for deep baselines trained from scratch and for GBDT models. + +# C.0.1 FT-TRANSFORMER + +The hyperparameter search space and distributions as well as the default configuration are presented in Table 2. The number of heads is always set to 8 as recommended in the original paper. + +# C.0.2 RESNET + +The hyperparameter search space and distributions as well as the default configuration are presented in Table 3 + +# C.0.3 MLP + +The hyperparameter search space and distributions as well as the default configuration are presented in Table 4 + +Table 2: Optuna hyperparameter search space and default configuration for FT-Transformer + +
ParameterSearch SpaceDefault
Number of layersUniformInt[1, 4]3
Feature embedding sizeUniformInt[64, 512]192
Residual dropout{0, Uniform[0, 0.2]}0.0
Attention dropoutUniform[0, 0.5]0.2
FFN dropoutUniform[0, 0.5]0.1
FFN factorUniform[2/3, 8/3]4/3
Learning rateLogUniform[1e-5, 1e-3]1e-4
Weight decayLogUniform[1e-6, 1e-3]1e-5
+ +Table 3: Optuna hyperparameter search space and default configuration for ResNet + +
ParameterSearch SpaceDefault
Number of layersUniformInt[1, 8]5
Category embedding sizeUniformInt[64, 512]128
Layer sizeUniformInt[64, 512]200
Hidden factorUniform[1, 4]3
Hidden dropoutUniform[0, 0.5]0.2
Residual dropout{0, Uniform[0, 0.5]}0.2
Learning rateLogUniform[1e-5, 1e-2]1e-4
Weight decay{0, LogUniform[1e-6, 1e-3]}0.0
+ +Table 4: Optuna hyperparameter search space and default configuration for MLP + +
ParameterSearch SpaceDefault
Number of layersUniformInt[1, 8]3
Category embedding sizeUniformInt[64, 512]128
Layer sizeUniformInt[1, 512][300, 200, 300]
Dropout{0, Uniform[0, 0.5]}0.2
Learning rateLogUniform[1e-5, 1e-2]1e-4
Weight decay{0, LogUniform[1e-6, 1e-3]}1e-5
+ +# C.0.4 TABTRANSFORMER + +The hyperparameter search space and distributions as well as the default configuration are presented in Table 5. + +Table 5: Optuna hyperparameter search space and default configuration for TabTransformer + +
ParameterSearch SpaceDefault
Number of headsUniformInt[2, 8]8
Number of layersUniformInt[1, 12]6
Category embedding sizeUniformInt[8, 128]32
Attention DropoutUniform[0.0, 0.5]0.0
FF DropoutUniform[0.0, 0.5]0.0
Learning rateLogUniform[1e-6, 1e-3]1e-4
Weight decayLogUniform[1e-6, 1e-3]1e-5
+ +# C.0.5 CATBOOST + +The hyperparameter search space and distributions are presented in Table 6. For default configuration we use default parameters from the Catboost library (Prokhorenkova et al., 2018). + +Table 6: Optuna hyperparameter search space for Catboost + +
ParameterSearch Space
IterationsUniformInt[2, 1000]
Max depthUniformInt[3, 10]
Learning rateLogUniform[1e-5, 1]
Bagging temperatureUniform[0, 1]
L2 leaf regLogUniform[1, 10]
Leaf estimation iterationsUniformInt[1, 10]
+ +# C.0.6 XGBOOST + +The hyperparameter search space and distributions as well as the default configuration are presented in Table 7. For default configuration we use default parameters from the XGBoost library (Chen and Guestrin, 2016). + +Table 7: Optuna hyperparameter search space for XGBoost + +
ParameterSearch Space
Num estimatorsUniformInt[2, 1000]
Max depthUniformInt[3, 10]
Min child weightLogUniform[1e-8, 1e5]
SubsampleUniform[0.5, 1]
Learning rateLogUniform[1e-5, 1]
Col sample by levelUniform[0.5, 1]
Col sample by treeUniform[0.5, 1]
Gamma{0, LogUniform[1e-8, 1e2]}
Lambda{0, LogUniform[1e-8, 1e2]}
Alpha{0, LogUniform[1e-8, 1e2]}
+ +# C.1 TUNING GBDT MODELS + +In Table 8 we explore the effectiveness of our hyperparameter tuning strategy for GBDT models. In particular, we compute average ranks for models with tuned and default configurations. Recall, because of the limited data availability in downstream tasks, we tune the hyperparameters on upstream data of the same size as the downstream data using full-size validation set. We find that using upstream data for tuning hyperparameters is effective for XGBoost model while for catboost tuned configuration outperforms default configuration at three out of five data availability levels. + +Table 8: Comparison of tuned and default configurations of GBDT models. The table displays ranks computed pair-wise for default/tuned configurations of XGBoost and Catboost models. + +
Num samples41020100200
XGBoost Tuned1.171.171.251.331.42
XGBoost Default1.421.831.671.501.58
Catboost Tuned1.331.081.171.251.42
Catboost Default1.251.251.421.331.33
+ +# C.2 TUNING DEEP BASELINES + +In Table 9 we evaluate hyperparameter tuning routine for deep baselines, i.e. deep neural networks trained from scratch. We find that unlike GBDT models, hyperparameters tuned on upstream data do not transfer to downstream tasks at lower data regimes (i.e. 4-20 samples) for deep models. However, tuning helps deep baselines in higher data regimes. + +Table 9: Comparison of tuned and default configurations of deep tabular baselines. The table displays ranks computed pair-wise for default/tuned configurations of deep tabular neural networks. + +
Num samples41020100200
FT-Transformer Tuned1.331.251.001.331.33
FT-Transformer Default1.001.081.581.4171.50
ResNet Tuned1.251.171.331.251.75
ResNet Default1.001.081.251.001.00
MLP Tuned1.421.671.581.171.33
MLP Default1.001.081.331.671.50
TabTransformer Tuned1.251.331.171.081.17
TabTransformer Default1.171.251.331.501.67
+ +# C.3 TUNING DEEP MODELS FOR TRANSFER LEARNING + +In Table 10 we evaluate the hyperparameter tuning strategy for deep tabular neural networks with transfer learning. Recall, we tune the hyperparameters on the full upstream data which is then used for pre-training. We find this strategy helpful for most models, especially for FT-Transformer and TabTransformer, and for most transfer learning setups. + +Table 10: Comparison of tuned and default configurations of deep tabular neural networks with transfer learning. The table displays ranks computed pair-wise for default/tuned configurations of deep tabular models fine-tuned with 4 different transfer-learning setups. + +
Num Samples41020100200
FT-Transformer + LH-E2E Tuned1.001.001.001.081.17
FT-Transformer + LH-E2E Default1.251.251.171.421.17
FT-Transformer + MLP-E2E Tuned1.001.001.081.001.08
FT-Transformer + MLP-E2E Default1.081.001.251.331.58
FT-Transformer + LH Tuned1.001.001.001.001.00
FT-Transformer + LH Default1.171.251.331.581.67
FT-Transformer + MLP Tuned1.081.001.001.001.00
FT-Transformer + MLP Default1.171.081.331.581.75
ResNet + LH-E2E Tuned1.001.171.331.251.33
ResNet + LH-E2E Default1.081.001.001.171.25
ResNet + MLP-E2E Tuned1.001.001.081.081.00
ResNet + MLP-E2E Default1.171.001.081.581.42
ResNet + LH Tuned1.001.001.081.001.00
ResNet + LH Default1.171.251.251.501.50
ResNet + MLP Tuned1.001.001.001.001.08
ResNet + MLP Default1.171.171.331.581.75
MLP + LH-E2E Tuned1.171.251.421.421.17
MLP + LH-E2E Default1.081.081.081.331.50
MLP + MLP-E2E Tuned1.001.081.331.251.42
MLP + MLP-E2E Default1.081.001.251.251.33
MLP + LH Tuned1.001.251.171.171.08
MLP + LH Default1.081.081.171.171.25
MLP + MLP Tuned1.081.081.081.001.00
MLP + MLP Default1.001.001.171.171.42
TabTransformer + LH-E2E Tuned1.001.001.081.081.00
TabTransformer + LH-E2E Default1.171.251.251.501.25
TabTransformer + MLP-E2E Tuned1.001.001.081.081.00
TabTransformer + MLP-E2E Default1.171.251.251.421.25
TabTransformer + LH Tuned1.001.001.001.001.00
TabTransformer + LH Default1.251.171.251.251.17
TabTransformer + MLP Tuned1.001.001.001.001.00
TabTransformer + MLP Default1.251.331.251.251.25
+ +# D ADDITIONAL RESULTS + +# D.1 RESULTS FOR TABTRANSFORMER + +Figure 6 is equivalent to Figure 2, but also includes the results for TabTransformer model, a tabular neural network consisting of transformer block for categorical features and an MLP block on top for numerical features. We find that TabTransformer performs poorly compared to other deep tabular neural networks, which might be explained by the fact that the original paper Huang et al. (2020) only suggests to tune the hyperparameters of transformer block, but not the MLP part, while Meta-MIMIC data has only one categorical features and 171 numerical features. + +![](images/81e14e73613f7ca00846545817f43e718852fff1f4616cd0ebfb737093dd3239.jpg) +Figure 6: Average model ranks including TabTransformer. Deep tabular models and GBDT performance is presented on the corresponding panels. Within each panel, columns represent transfer learning setups, and rows correspond to the number of available downstream samples. Warmer colors indicate better performance. FS denotes training from scratch (without pre-training on upstream data), LH and MLP denote linear and MLP heads correspondingly, E2E denotes end-to-end training. Rank is averaged across all downstream tasks. + +# D.2 RANKS STANDARD ERROR + +Figure 7 presents standard errors for ranks in Figure 2 computed across tasks. + +![](images/a8c809a97c866b46edf81b8ae25877362bf15bcc100a94af3d9f16191d930e94.jpg) +Figure 7: Standard error for model ranks computed across all downstream tasks. This figure complements Figure 2. Darker colors indicate lower standard errors. + +# D.3 MODEL-WISE RANKS + +In Figure 8 we compare different transfer learning setups for each deep tabular model. + +# D.4 AVERAGE ROC-AUC IMPROVEMENT OVER CATBOOST + +In Figure 9 we display ROC-AUC improvements over Catboost baseline averaged across all downstream tasks. We observe trends similar to ones with ranks; MLP model performs best in low data regimes, while FT-Transformer offers consistent gains across all data levels. + +![](images/39729a311e33e214033dacbd4bd9dde526d2d2915d236492e42b3a8938497636.jpg) +Figure 8: Model-wise ranks for GBDT and neural networks. Within each panel, columns represent transfer learning setups, and rows correspond to the number of available downstream samples. Warmer colors indicate better performance. FS denotes training from scratch (without pre-training on upstream data), LH and MLP denote linear and MLP heads correspondingly, E2E denotes end-to-end training. Rank is computed across training setups for each model and is averaged across all downstream tasks. + +![](images/4779f79e64a390e3cb78ac9d992402af773ab804d0b9db5da514103a718fd16b.jpg) +Figure 9: Average ROC-AUC improvements over Catboost baseline. Within each panel, columns represent transfer learning setups, and rows correspond to the number of available downstream samples. Warmer colors indicate better performance. FS denotes training from scratch (without pre-training on upstream data), LH and MLP denote linear and MLP heads correspondingly, E2E denotes end-to-end training. ROC-AUC improvement is computed as difference in ROC-AUC with Catboost model and is averaged across all downstream tasks. + +# D.5 DATASET-LEVEL RESULTS + +In Tables 11, 12, 13, 14 we report ROC-AUC measurements for each model on each downstream task. We include the results for GBDT models, neural baselines and neural networks with transfer learning. + +# D.6 EXPERIMENTS ON ADDITIONAL DATASETS + +To expand the experimental evaluation of tabular transfer learning beyond the medical domain, we include experiments on two additional multi-label datasets: Yeast functional genomics data Elisseeff and Weston (2001) and Emotions data Trohidis et al. (2008). Yeast contains micro-array expression data and phylogenetic profiles of genes with labels corresponding to different gene functional classes. Each gene is associated with a set of functional classes, therefore each task aims to predict if a gene is associated with a particular gene functional group. The dataset contains 2417 samples (genes) with 103 numerical features and 14 labels for each sample. Emotions data aims to detect emotions in music, it contains rhythmic and timbre features of 593 songs and labels corresponding to 6 emotions. In our experimental setup, we treat each classification label as a separate task. Similarly to the experiments with MetaMIMIC, we split the tasks into downstream and upstream by reserving $n - 1$ labels for the upstream task and the $n$ -th label for the downstream task. We further limit the amount of downstream data to 4, 10, 20, 100 and 200 samples. This strategy results in 70 combinations of + +![](images/20373f10ac25b082b7df9da3032fc6f67e344ff30bdf3f3762e85360d4e2475c.jpg) +Figure 10: Average model ranks across downstream tasks in Yeast data. Deep tabular models and Catboost performance is presented on the corresponding panels. Within each panel, columns represent transfer learning setups, and rows correspond to the number of available downstream samples. Warmer colors indicate better performance. FS denotes training from scratch (without pre-training on upstream data), LH and MLP denote linear and MLP heads correspondingly, E2E denotes end-to-end training. Rank is averaged across all downstream tasks. + +![](images/7b20bc4870291b4fc791c1d22f90e65db45f6e1d89a3505a5f009b71a82b3b1a.jpg) + +![](images/c35d1f37b99d4529ba4d86644e2dfaf64f0eb4f7805a3fc3536a0bd50a59db2b.jpg) + +![](images/fdf72d054c2dfae48fe4a2bdf2e202f2b0b48d40575e569583c4eae3fe5d0708.jpg) +Figure 11: Average model ranks across downstream tasks in Emotions data. Deep tabular models and Catboost performance is presented on the corresponding panels. Within each panel, columns represent transfer learning setups, and rows correspond to the number of available downstream samples. Warmer colors indicate better performance. FS denotes training from scratch (without pre-training on upstream data), LH and MLP denote linear and MLP heads correspondingly, E2E denotes end-to-end training. Rank is averaged across all downstream tasks. + +![](images/e98292fec6723fc65d403d981d618c5d8373341cd64656c13ea450aa4d784fc8.jpg) + +upstream and downstream datasets constructed from the Yeast database and 30 combinations from the Emotions database. We conduct experiments with FT-Transformer, MLP, and Catboost models which demonstrated the best results in our previous experiments. We tune the hyperparameters for deep models and Catboost as described in Appendix C. Figures 10, 11 present average model ranks of two tabular neural network and Catboost models on downstream tasks as a heatmap with warmer colors representing better results. + +We observe that deep tabular models pre-trained on upstream data and finetuned with MLP head outperform models trained from scratch and Catboost models leveraging stacking. Interestingly, MLP model performs better on the Yeast dataset, while FT-Transformer performs better on the Emotions dataset. + +# D.7 EXPERIMENTS WITH FEWER PRE-TRAINING TASKS + +To further validate the effectiveness of transfer learning in scenarios where fewer pre-training tasks are available we repeat our experiments with the first 5 targets from Meta-MIMIC dataset: Diabetes, + +![](images/24289555e16f71ac7ea8f68b8ed09a5f6b8dabb93aaa67f474ac2cab805c2d5c.jpg) +Figure 12: Average model ranks for models pre-trained and finetuned on the first five MetaMIMIC targets. Deep tabular models and Catboost performance is presented on the corresponding panels. Within each panel, columns represent transfer learning setups, and rows correspond to the number of available downstream samples. Warmer colors indicate better performance. FS denotes training from scratch (without pre-training on upstream data), LH and MLP denote linear and MLP heads correspondingly, E2E denotes end-to-end training. Rank is averaged across 5 downstream tasks. + +Hypertensive, Ischematic, Heart, Overweight. In particular we pre-train on 4 available targets and finetune on the remaining task. We limit the number of downstream tasks to 5 for consistency of the number of pre-training targets across downstream tasks. Figure 12 presents the results of this experiment, we observe similar trends to the original experiments with all targets. In particular, we find that deep neural networks pre-trained even on fewer upstream targets definitively outperform Catboost with stacking with MLP model performing better in low-data regimes and FT-Transformer performing better when more downstream data is available. + +# D.8 WHEN IS TRANSFER LEARNING MOST EFFECTIVE? CASE STUDY + +One might wonder when deep neural networks are effective for transferring knowledge between tasks. We hypothesize that transfer learning is most effective in scenarios where upstream and downstream tasks are related. In the previous experiments with pre-training on fewer tasks (see Appendix D.7) we found that transfer learning is effective when transferring knowledge between the first five tasks, which include a few cardiovascular-related conditions (hypertensive, ischemic, heart), diabetes and overweight conditions. From the correlation matrix in Figure 5, we can see that these tasks are slightly more correlated with each other than with other conditions such as anemia, respiratory, hypotension, purpura, alcohol. We notice that the latter set of tasks is also less related to cardiovascular conditions. To evaluate our hypothesis that transfer learning is less effective when pre-training and downstream tasks are less related, we run experiments with pre-training the model on the first 5 related tasks and transferring knowledge to the set of "less related" tasks. The results for this experiment are presented in Figure 13, we observe that although pre-trained MLP model still provides performance boosts in small data regimes compared to Catboost, the trends are less pronounced compared to results for transferring knowledge to "more related tasks" in Figure 12. + +# D.9 EXPERIMENTS WITH HIGHER DATA REGIMES IN DOWNSSTREAM DATA + +To expand the experimental evaluation to higher data regimes in downstream data we repeat our experiments with 400, 1000 and 2000 samples available for finetuning in the downstream data. The results for this experiment are presented in Figure 14. We find that even in higher data regimes pre-training on upstream data provides significant boost to FT-Transformer model compared to Catboost with stacking. At the same time, MLP performs on par with Catboost when there is more downstream data available, which aligns with our previous results. + +![](images/4f7e21b43aa7077186214a2be8dbd4aba2265117a1bb85ec57360353e71c516c.jpg) +Figure 13: Average model ranks for transferring knowledge to "less related" tasks. Deep tabular models and Catboost performance is presented on the corresponding panels. Within each panel, columns represent transfer learning setups, and rows correspond to the number of available downstream samples. Warmer colors indicate better performance. FS denotes training from scratch (without pre-training on upstream data), LH and MLP denote linear and MLP heads correspondingly, E2E denotes end-to-end training. Rank is averaged across 5 "less related tasks". + +![](images/cd8a64102fddfd4c71fd1d13b5ac3e6509b4789c77e3be02ef785a103477ac7f.jpg) + +![](images/88cc70c0827198b9e26ef5761216d8e9da366839117f79d4cb591a2e9359df6f.jpg) + +![](images/9ad565fd3462a3bdcc1b95c348675a8464e43c74b5ad0a35b7694fa0e9575124.jpg) +Figure 14: Average model ranks in higher-data regimes for downstream tasks. Deep tabular models and Catboost performance is presented on the corresponding panels. Within each panel, columns represent transfer learning setups, and rows correspond to the number of available downstream samples. Warmer colors indicate better performance. FS denotes training from scratch (without pre-training on upstream data), LH and MLP denote linear and MLP heads correspondingly, E2E denotes end-to-end training. Rank is averaged across all downstream tasks. + +![](images/759f4ce8566faef5b862dc2ccc834f4d24c4cbe1bbe75ba20d3729c9cd170670.jpg) + +# D.10 ADDITIONAL EXPERIMENTS WITH PSEUDO-Feature METHOD + +We further verify the effectiveness of our pseudo-feature method in scenarios with multiple features misaligned between upstream and downstream data. We repeat the experiment from Section 6, but instead of a single feature we remove three features. In Figure 15, the top left heatmap represents the experiment where the downstream data has three additional features missing from the upstream data. The bottom left heatmap represents the opposite scenario of the upstream data having three additional features not available in the downstream data. To ensure that the features we experiment with are meaningful and contain useful information, we chose important features according to GBDT feature importances. In Figure 15, we include the average ranks of FT-Transformer models pre-trained with missing features, pre-trained with imputed features and with the original features, which we assume are unavailable. Additionally, in the right panel we present standard errors for model ranks computed across all downstream tasks. From these experiments, we see that pre-training on data with imputed features significantly outperforms pre-training with missing features and that our feature imputation method enables effective transfer learning in scenarios where upstream and downstream feature sets differ in multiple features. + +![](images/8ba977b27be822e0685409e2968185641f5f951d1897b2a4fd753c9a5d990430.jpg) + +![](images/caf6e9afac5bb49aa1dc7bae4b682f2c4b21b54a24682978f0c91ff7c83b5be6.jpg) + +![](images/ed5bdb94997b58f7594458ed360fa57a50437e31cc5a346663c763c2bd552ecc.jpg) +Figure 15: Pseudo-Feature method for aligning upstream and downstream feature sets with 3 misaligned features. Left: Comparison of ranks of FT-Transformer model trained on data with 3 missing features, with pseudo-features and with the original features. Right: Standard error for ranks computed across all tasks. Figures in the top row correspond to the experiments with missing features in the upstream data, while figures in the bottom row present experiments with missing features in the downstream data. + +![](images/374e43eb8529d00c93bffb4000ba6a9dfb8548d691e5f746d8510192f61d5a72.jpg) + +# D.11 ADDITIONAL EXPERIMENTS WITH CONTRASTIVE SELF-SUPERVISED LEARNING + +We extend our comparison of supervised pre-training and contrastive pre-training strategies by including two additional corruption hyperparameters $\lambda = 0.7, 0.8$ for contrastive pre-training used in experiments in Section 5 (which used $\lambda = 0.9$ ). We also include SCARF contrastive pretraining strategy proposed in (Bahri et al., 2021). For SCARF method we generate a random mask over features, then for each masked feature we sample uniformly from the joint distribution of that feature (in the training set). Then we compute the InfoNCE loss using these corrupted inputs and the clean inputs for contrastive pretraining. We use the default corruption hyperparameter $\lambda = 0.6$ from the SCARF paper (Bahri et al., 2021). We compare all contrastive pre-training strategies and supervised pre-training in Figure 16. We find that increasing the level of corruption (i.e., decreasing $\lambda$ ) does not lead to improved performance on downstream tasks for contrastive pre-training. Also, while the SSL methods outperform training from scratch, especially in the lower data regimes, supervised pre-training is consistently better than all considered SSL methods. + +![](images/0e6f9b68675d826a2099303180848aef4e7a48cc265c4f2a3a49627bfdb4f83c.jpg) +Figure 16: Comparison of different pre-training strategies for FT-Transformer. The left panel illustrates end-to-end fine-tuning with linear head and the right plot illustrates end-to-end fine-tuning with MLP head. Within each panel, columns represent pre-training strategies and rows correspond to the number of available downstream samples. FS stands for training from scratch, $\lambda$ denotes the corruption parameter in contrastive pre-training, SCARF corresponds to contrastive pre-training strategy from (Bahri et al., 2021) and Supervised denotes supervised pre-training on upstream data. + +![](images/b439da4d38da81af03c48aeb13049d78e5c4b63531646dc84c41a86625952bfb.jpg) + +![](images/7090a37dd848ec4d2f411a1eb4295e0035004d7234f1953607af6d54a434f6aa.jpg) + +
Target TaskDiabetesHypertensiveIschematic
Num Samples410201002004102010020041020100200
FT-FS0.511±0.0080.540±0.0040.567±0.0040.596±0.0090.802±0.0100.453±0.0100.477±0.0070.528±0.0060.658±0.0080.722±0.0050.620±0.0090.656±0.0040.644±0.0110.678±0.0050.740±0.006
FT-FS-20.514±0.0080.550±0.0060.570±0.0030.666±0.0060.779±0.0130.464±0.0060.482±0.0070.525±0.0040.666±0.0050.701±0.0040.655±0.0020.656±0.0050.596±0.0110.740±0.0030.759±0.002
FT-LH-E2E0.661±0.0070.692±0.0050.710±0.0040.770±0.0060.821±0.0030.669±0.0050.713±0.0030.707±0.0020.746±0.0020.760±0.0020.675±0.0040.664±0.0050.701±0.0020.771±0.0020.786±0.001
FT-MLP-E2EE0.524±0.0110.606±0.0090.654±0.0120.781±0.0070.830±0.0040.648±0.0090.721±0.0030.709±0.0030.759±0.0030.768±0.0020.702±0.0060.704±0.0080.708±0.0040.781±0.0020.807±0.001
FT-LH0.690±0.0050.689±0.0040.704±0.0050.700±0.0050.702±0.0050.658±0.0080.713±0.0050.708±0.0040.714±0.0030.716±0.0030.637±0.0030.679±0.0020.688±0.0010.716±0.0020.726±0.002
FT-MLP0.534±0.0120.598±0.0110.662±0.0110.736±0.0020.755±0.0010.648±0.0120.724±0.0040.725±0.0030.760±0.0020.767±0.0010.691±0.0060.707±0.0070.740±0.0030.792±0.0010.813±0.001
ResNet-FS0.498±0.0140.481±0.0110.501±0.0060.627±0.0090.677±0.0060.464±0.0110.492±0.0120.568±0.0040.666±0.0030.689±0.0030.608±0.0080.622±0.0060.631±0.0090.707±0.0030.726±0.003
ResNet-FS-20.484±0.0080.514±0.0050.539±0.0060.677±0.0030.776±0.0020.500±0.0070.494±0.0080.538±0.0060.644±0.0070.724±0.0020.627±0.0060.646±0.0050.631±0.0030.736±0.0020.752±0.002
ResNet-LH-E2E0.643±0.0030.660±0.0030.686±0.0020.705±0.0020.789±0.0010.684±0.0040.683±0.0020.697±0.0010.681±0.0020.762±0.0010.631±0.0030.663±0.0020.687±0.0030.767±0.0010.778±0.001
ResNet-MLP-E2E0.445±0.0080.542±0.0090.616±0.0070.633±0.0090.775±0.0020.704±0.0090.719±0.0030.716±0.0020.737±0.0030.767±0.0010.677±0.0080.724±0.0060.715±0.0050.786±0.0030.814±0.001
ResNet-LH0.672±0.0030.649±0.0030.692±0.0020.700±0.0020.709±0.0020.686±0.0040.719±0.0020.719±0.0010.729±0.0010.738±0.0010.581±0.0030.636±0.0030.678±0.0020.707±0.0020.712±0.003
ResNet-MLP0.457±0.0070.546±0.0090.635±0.0090.720±0.0020.752±0.0010.704±0.0090.730±0.0020.739±0.0020.757±0.0010.768±0.0010.663±0.0090.715±0.0070.752±0.0040.799±0.0010.818±0.001
MLP-FS0.503±0.0070.491±0.0050.515±0.0020.652±0.0030.706±0.0020.442±0.0030.470±0.0040.578±0.0010.670±0.0020.699±0.0020.648±0.0040.643±0.0080.626±0.0020.728±0.0020.760±0.001
MLP-FS-20.507±0.0050.529±0.0060.543±0.0040.550±0.0120.671±0.0050.500±0.0100.492±0.0110.518±0.0050.638±0.0040.692±0.0020.639±0.0040.667±0.0050.668±0.0030.729±0.0030.761±0.003
MLP-LH-E2E0.675±0.0020.682±0.0020.689±0.0020.698±0.0020.766±0.0020.661±0.0030.674±0.0020.682±0.0010.692±0.0020.753±0.0010.657±0.0030.662±0.0030.689±0.0020.726±0.0020.785±0.001
MLP-MLP-E2E0.536±0.0050.589±0.0040.626±0.0040.618±0.0080.623±0.0060.706±0.0060.736±0.0020.732±0.0020.753±0.0020.753±0.0020.713±0.0040.745±0.0040.768±0.0020.788±0.0010.811±0.001
MLP-LH0.685±0.0020.665±0.0020.697±0.0020.701±0.0020.707±0.0020.658±0.0030.711±0.0010.704±0.0020.718±0.0010.724±0.0010.626±0.0040.671±0.0020.675±0.0020.696±0.0030.699±0.003
MLP-MLP0.533±0.0050.590±0.0040.627±0.0030.719±0.0010.744±0.0010.706±0.0060.738±0.0020.739±0.0020.762±0.0010.764±0.0010.715±0.0050.738±0.0040.758±0.0020.789±0.0010.807±0.001
Tab-FS0.488±0.0070.487±0.0020.517±0.0030.616±0.0040.691±0.0040.496±0.0070.465±0.0040.570±0.0040.667±0.0040.701±0.0030.461±0.0060.659±0.0030.620±0.0040.711±0.0020.739±0.002
Tab-FS-20.495±0.0070.507±0.0040.541±0.0040.563±0.0120.713±0.0030.513±0.0050.496±0.0110.538±0.0030.564±0.0070.659±0.0140.472±0.0110.632±0.1110.571±0.0060.721±0.0110.746±0.011
Tab-LH-E2E0.693±0.0060.692±0.0060.694±0.0050.704±0.0060.727±0.0050.658±0.0040.665±0.0040.685±0.0030.659±0.0040.727±0.0330.664±0.0150.668±0.0150.675±0.0140.708±0.0140.772±0.11
Tab-MLP-E2E0.693±0.0060.692±0.0060.694±0.0050.714±0.0060.725±0.0150.658±0.0040.665±0.0040.685±0.0030.659±0.0140.727±0.110.664±1.110.668±1.110.675±1.110.711±1.111.771±1.11
Tab-LH0.698±0.0060.691±0.0050.713±0.0150.715±0.110.715±1.110.653±1.110.684±1.110.678±1.110.666±1.110.664±1.110.625±1.110.652±1.111.655±1.111.655±1.111.664±1.11
Tab-MLP0.698±1.110.698±1.110.713±1.111.713±1.111.713±1.111.653±1.111.658±1.111.657±1.111.656±1.111.654±1.111.625±1.111.624±1.111.628±1.111.642±1.111.639±1.11
Catboost0.495±1.111.514±1.111.585±1.111.782±1.111.797±1.111.524±1.111.511±1.111.511±1.111.521±1.111.521±1.111.657±1.111.641±1.111.651±1.111.651±1.111.735±1.11
Catboost+stacking1.514±1.111.585±1.111.585±1.111.782±1.111.797±1.111.524±1.111.511±1.111.521±1.111.521±1.111.521±1.111.657±1.111.641±1.111.651±1.111.651±1.111.735±1.11
+ +Table 11: ROC-AUC scores for all models for "Diabetes", "Hypertensive" and "Ischematic" downstream tasks. FT denotes FT-Transformer, Tab denotes TabTransformer. The first two rows in each section correspond to training from scratch, where FS corresponds to deep baseline architecture (tuned on subsample of upstream data), and FS-2 shows the results for the same architecture as one used with transfer learning. LH and MLP denote linear and MLP heads correspondingly, E2E denotes end-to-end training. + +
DatasetHeartOverweightAnemia
Num Samples410201002004102010020041020100200
FT-FS0.532±0.0130.557±0.0090.653±0.0050.687±0.0080.746±0.0030.516±0.0120.506±0.0030.623±0.0060.582±0.0150.822±0.0090.643±0.0130.709±0.0030.741±0.0060.764±0.0030.722±0.007
FT-FS-20.517±0.0050.589±0.0040.571±0.0110.762±0.0020.748±0.0030.491±0.0080.490±0.0090.610±0.0040.638±0.0050.679±0.0040.728±0.0060.749±0.0020.735±0.0060.782±0.0010.794±0.002
FT-LH-E2E0.589±0.0020.642±0.0040.667±0.0020.770±0.0020.782±0.0020.673±0.0040.620±0.0080.728±0.0120.759±0.0150.818±0.0040.639±0.0030.646±0.0030.665±0.0040.756±0.0010.762±0.001
FT-MLP-E2EE0.542±0.0080.642±0.0070.658±0.0020.768±0.0050.784±0.0030.540±0.0150.469±0.0110.581±0.0240.720±0.0180.768±0.0130.662±0.0090.682±0.0040.725±0.0030.750±0.0020.773±0.001
FT-LH0.626±0.0030.664±0.0020.672±0.0020.689±0.0030.713±0.0020.669±0.0020.675±0.0030.682±0.0020.675±0.0020.674±0.0020.557±0.0030.580±0.0030.597±0.0040.610±0.0030.617±0.003
FT-MLP0.516±0.0160.640±0.0140.667±0.0050.777±0.0010.790±0.0010.532±0.0150.469±0.0160.507±0.0160.656±0.0060.718±0.0040.610±0.0130.642±0.0060.687±0.0030.705±0.0030.712±0.003
ResNet-FS0.489±0.0280.532±0.0120.644±0.0060.683±0.0040.730±0.0050.515±0.0150.502±0.0110.642±0.0060.642±0.0080.665±0.0070.553±0.0190.653±0.0090.698±0.0040.750±0.0030.767±0.002
ResNet-FS-20.497±0.0200.551±0.0100.650±0.0040.750±0.0040.772±0.0020.495±0.0090.504±0.0080.615±0.0040.666±0.0040.739±0.0030.644±0.0190.752±0.0040.747±0.0020.757±0.0020.780±0.001
ResNet-LH-E2E0.587±0.0050.609±0.0040.644±0.0020.656±0.0020.760±0.0020.699±0.0030.691±0.0030.700±0.0020.714±0.0010.770±0.0020.607±0.0030.652±0.0030.665±0.0020.736±0.0010.748±0.001
ResNet-MLP-E2E0.497±0.0110.618±0.0080.641±0.0040.761±0.0020.789±0.0010.547±0.0080.545±0.0110.568±0.0130.674±0.0090.765±0.0050.608±0.0090.697±0.0080.727±0.0040.760±0.0010.767±0.002
ResNet-LH0.612±0.0050.657±0.0040.668±0.0020.661±0.0030.677±0.0030.698±0.0030.683±0.0030.679±0.0020.687±0.0010.685±0.0010.563±0.0040.593±0.0040.594±0.0030.635±0.0030.639±0.003
ResNet-MLP0.488±0.0120.627±0.0080.683±0.0030.768±0.0020.783±0.0010.548±0.0090.544±0.0120.525±0.0100.669±0.0040.726±0.0020.582±0.0090.666±0.0110.710±0.0040.739±0.0020.739±0.003
MLP-FS0.426±0.0070.512±0.0190.646±0.0020.710±0.0040.765±0.0010.533±0.0040.499±0.0080.635±0.0030.651±0.0050.698±0.0020.641±0.0060.689±0.0020.708±0.0000.763±0.0020.796±0.001
MLP-FS-20.570±0.0100.643±0.0060.669±0.0030.756±0.0020.751±0.0010.528±0.0080.489±0.0050.573±0.0030.566±0.0060.646±0.0030.733±0.0050.753±0.0030.738±0.0010.768±0.0010.790±0.001
MLP-LH-E2E0.626±0.0030.644±0.0030.665±0.0020.677±0.0020.766±0.0010.680±0.0020.675±0.0020.697±0.0020.683±0.0020.718±0.0020.610±0.0030.615±0.0030.657±0.0020.706±0.0020.749±0.001
MLP-MLP-E2E0.629±0.0070.692±0.0030.685±0.0020.719±0.0030.780±0.0010.599±0.0050.574±0.0080.609±0.0040.614±0.0040.626±0.0030.690±0.0040.695±0.0040.723±0.0020.757±0.0010.758±0.001
MLP-LH0.610±0.0030.650±0.0020.656±0.0020.665±0.0030.679±0.0030.675±0.0020.688±0.0010.685±0.0010.685±0.0020.686±0.0020.551±0.0040.567±0.0040.592±0.0040.635±0.0030.639±0.003
MLP-MLP0.620±0.0060.681±0.0030.684±0.0020.755±0.0020.767±0.0010.597±0.0050.576±0.0080.582±0.0040.646±0.0030.669±0.0030.655±0.0050.666±0.0040.694±0.0030.703±0.0030.699±0.002
Tab-FS0.501±0.0090.545±0.0020.645±0.0030.731±0.0030.741±0.0040.510±0.0120.506±0.0030.582±0.0050.578±0.0020.654±0.0050.548±0.0090.677±0.0030.708±0.0030.762±0.0020.770±0.001
Tab-FS-20.517±0.0060.565±0.0060.614±0.0040.709±0.0060.736±0.0040.518±0.0090.499±0.0070.547±0.0040.564±0.0120.612±0.0080.602±0.0040.689±0.0060.729±0.0020.727±0.0050.779±0.001
Tab-LH-E2E0.602±0.0060.613±0.0050.636±0.0040.661±0.0060.760±0.0040.676±0.0040.679±0.0040.684±0.0040.684±0.0030.726±0.0030.594±0.0040.603±0.0040.650±0.0030.701±0.0040.742±0.003
Tab-MLP-E2E0.602±0.0060.613±0.0050.636±0.0040.705±0.0050.757±0.0040.676±0.0040.679±0.0040.684±0.0040.684±0.0030.733±0.0030.594±0.0050.603±0.0040.650±0.0030.698±0.0040.745±0.003
Tab-LH0.599±0.0070.619±0.0060.621±0.0060.631±0.0060.636±0.0070.673±0.0040.681±0.0040.681±0.0040.679±0.0040.679±0.0040.561±0.0050.567±0.0060.591±0.0040.592±0.0040.590±0.003
Tab-MLP0.599±0.0070.595±0.0080.600±0.0070.616±0.0070.617±0.0070.673±0.0040.674±0.0040.674±0.0040.676±0.0040.676±0.0040.561±0.0050.561±0.0060.572±0.0040.576±0.0040.574±0.004
Catboost0.554±0.0050.581±0.0040.652±0.0010.712±0.0010.744±0.0010.695±0.0110.499±0.0110.625±0.0110.764±1.11±1.111.765±1.11±1.111.561±1.11±1.111.765±1.11±1.111.765±1.11±1.111.765±1.11±1.111.778±1.11±1.11
Catboost+stacking0.555±0.0050.624±0.0110.674±1.111.765±1.111.777±1.111.614±1.111.539±1.111.672±1.111.792±1.111.797±1.111.557±1.111.754±1.111.763±1.111.781±1.111.783±1.11
+ +Table 12: ROC-AUC scores for all models for "Heart", "Overweight" and "Anemia" downstream tasks. FT denotes FT-Transformer, Tab denotes TabTransformer. The first two rows in each section correspond to training from scratch, where FS corresponds to deep baseline architecture (tuned on subsample of upstream data), and FS-2 shows the results for the same architecture as one used with transfer learning. LH and MLP denote linear and MLP heads correspondingly, E2E denotes end-to-end training. + +
DatasetRespiratoryHypotensionLipoid
Num Samples410201002004102010020041020100200
FT-FS0.500±0.0090.475±0.0050.514±0.0060.572±0.0090.561±0.0040.526±0.0080.518±0.0090.546±0.0060.601±0.0090.644±0.0020.502±0.0060.552±0.0110.564±0.0060.640±0.0120.675±0.004
FT-FS-20.495±0.0050.469±0.0050.484±0.0060.562±0.0100.577±0.0030.574±0.0030.552±0.0050.539±0.0120.546±0.0110.641±0.0010.520±0.0040.530±0.0020.574±0.0030.598±0.0030.660±0.004
FT-LH-E2E0.545±0.0040.498±0.0040.517±0.0020.578±0.0020.585±0.0010.564±0.0020.564±0.0030.584±0.0020.592±0.0020.635±0.0010.584±0.0060.565±0.0080.630±0.0040.727±0.0020.745±0.002
FT-MLP-E2EE0.531±0.0040.462±0.0070.496±0.0060.576±0.0040.562±0.0040.595±0.0020.595±0.0040.612±0.0010.627±0.0020.647±0.0020.429±0.0090.475±0.0120.633±0.0030.714±0.0040.737±0.001
FT-LH0.556±0.0020.536±0.0020.543±0.0020.565±0.0020.564±0.0020.511±0.0020.533±0.0020.545±0.0020.538±0.0020.553±0.0020.631±0.0040.582±0.0060.655±0.0030.707±0.0010.724±0.001
FT-MLP0.547±0.0040.490±0.0080.518±0.0040.575±0.0020.569±0.0010.590±0.0030.593±0.0070.604±0.0020.612±0.0010.637±0.0010.415±0.0090.531±0.0140.689±0.0020.735±0.0020.740±0.001
ResNet-FS0.499±0.0070.500±0.0040.520±0.0100.564±0.0040.550±0.0040.516±0.0080.502±0.0110.506±0.0110.572±0.0060.578±0.0110.503±0.0070.574±0.0030.581±0.0040.595±0.0040.649±0.002
ResNet-FS-20.479±0.0080.460±0.0050.465±0.0040.565±0.0030.586±0.0030.552±0.0100.535±0.0060.539±0.0040.589±0.0040.638±0.0020.505±0.0090.551±0.0070.574±0.0030.523±0.0180.664±0.003
ResNet-LH-E2E0.536±0.0030.530±0.0020.517±0.0020.577±0.0010.581±0.0010.521±0.0050.535±0.0040.531±0.0030.547±0.0020.590±0.0010.561±0.0040.571±0.0050.610±0.0040.635±0.0020.725±0.001
ResNet-MLP-E2E0.524±0.0060.521±0.0030.511±0.0030.583±0.0030.578±0.0020.614±0.0040.603±0.0040.601±0.0040.624±0.0030.638±0.0010.442±0.0060.545±0.0100.657±0.0050.720±0.0030.744±0.001
ResNet-LH0.552±0.0020.551±0.0010.550±0.0010.570±0.0010.565±0.0010.503±0.0040.543±0.0040.527±0.0030.524±0.0030.535±0.0030.563±0.0050.552±0.0070.620±0.0040.697±0.0020.714±0.002
ResNet-MLP0.520±0.0060.532±0.0030.530±0.0030.573±0.0010.566±0.0010.616±0.0040.603±0.0040.621±0.0020.626±0.0010.649±0.0010.442±0.0080.551±0.0140.684±0.0050.742±0.0010.746±0.001
MLP-FS0.492±0.0060.494±0.0040.503±0.0060.564±0.0030.576±0.0020.504±0.0040.513±0.0050.529±0.0050.621±0.0010.648±0.0020.507±0.0060.531±0.0150.574±0.0050.598±0.0040.559±0.034
MLP-FS-20.500±0.0030.447±0.0040.458±0.0030.542±0.0040.574±0.0020.568±0.0030.545±0.0050.587±0.0020.571±0.0070.652±0.0010.510±0.0050.577±0.0050.574±0.0020.633±0.0030.665±0.003
MLP-LH-E2E0.545±0.0020.535±0.0010.531±0.0010.578±0.0010.591±0.0010.532±0.0020.530±0.0020.560±0.0020.563±0.0010.595±0.0010.602±0.0030.607±0.0030.624±0.0020.624±0.0030.713±0.001
MLP-MLP-E2E0.564±0.0030.533±0.0050.535±0.0030.583±0.0020.583±0.0020.608±0.0040.628±0.0020.633±0.0010.635±0.0010.654±0.0000.430±0.0090.592±0.0070.684±0.0040.708±0.0030.741±0.001
MLP-LH0.551±0.0020.544±0.0020.553±0.0010.567±0.0020.567±0.0020.513±0.0030.550±0.0020.557±0.0020.548±0.0020.555±0.0020.608±0.0030.577±0.0040.644±0.0030.696±0.0010.707±0.001
MLP-MLP0.571±0.0030.545±0.0050.554±0.0030.577±0.0010.575±0.0020.611±0.0040.629±0.0020.631±0.0010.628±0.0010.645±0.0010.429±0.0090.594±0.0070.701±0.0040.740±0.0010.743±0.001
Tab-FS0.463±0.0020.459±0.0030.472±0.0040.525±0.0100.567±0.0030.547±0.0040.535±0.0060.544±0.0070.561±0.0080.635±0.0010.536±0.0020.510±0.0050.505±0.0030.538±0.0070.656±0.002
Tab-FS-20.461±0.0040.454±0.0030.458±0.0020.494±0.0080.526±0.0030.541±0.0040.525±0.0060.540±0.0020.566±0.0080.632±0.0010.537±0.0030.489±0.0050.487±0.0020.513±0.0090.561±0.009
Tab-LH-E2E0.531±0.0040.522±0.0040.504±0.0030.551±0.0040.582±0.0020.526±0.0040.523±0.0040.540±0.0030.544±0.0030.577±0.0040.615±0.0050.614±0.0060.611±0.0060.625±0.0060.670±0.007
Tab-MLP-E2E0.531±0.0040.522±0.0040.544±0.0030.552±0.0040.582±0.0020.526±0.0040.524±0.0040.540±0.0030.544±0.0030.572±0.0040.615±0.0050.614±0.0060.611±0.0060.625±0.0060.668±0.007
Tab-LH0.551±0.0050.548±0.0040.551±0.0040.562±0.0040.562±0.0040.511±0.0040.534±0.0040.537±0.0040.533±0.0040.537±0.0040.617±0.0060.595±0.0060.619±0.0070.647±0.0080.651±0.008
Tab-MLP0.551±0.0050.547±0.0050.552±0.0040.558±0.0040.558±0.0040.511±0.0040.512±0.0040.520±0.0040.523±0.0040.526±0.0040.617±0.0060.618±0.0060.621±0.0060.634±0.0070.635±0.007
Catboost0.482±0.0010.492±0.0030.496±0.0030.554±0.0120.572±0.0120.523±0.0110.491±0.0110.531±0.0110.552±1.1110.635±1.1110.523±1.1110.536±1.1110.547±1.1110.618±1.1110.693±1.111
Catboost+stacking0.488±0.0030.498±1.1111.111±1.1111.111±1.1111.111±1.1111.111±1.1111.111±1.1111.111±1.1111.111±1.1111.111±1.1111.111±1. 1111.111±1.1111.111±1.1111.111±1.1111.718±1.111
+ +Table 13: ROC-AUC scores for all models for "Respiratory", "Hypotension" and "Lipoid" downstream tasks. FT denotes FT-Transformer, Tab denotes TabTransformer. The first two rows in each section correspond to training from scratch, where FS corresponds to deep baseline architecture (tuned on subsample of upstream data), and FS-2 shows the results for the same architecture as one used with transfer learning. LH and MLP denote linear and MLP heads correspondingly, E2E denotes end-to-end training. + +
DatasetAtrialPurpuraAlcohol
Num Samples410201002004102010020041020100200
FT-FS0.603±0.0080.594±0.0150.617±0.0070.702±0.0080.690±0.0080.711±0.0070.703±0.0100.737±0.0050.870±0.0070.851±0.0090.593±0.0080.570±0.0100.600±0.0050.666±0.0060.640±0.005
FT-FS-20.606±0.0030.628±0.0030.382±0.0050.665±0.0050.703±0.0010.763±0.0030.745±0.0030.451±0.0120.778±0.0040.852±0.0060.603±0.0040.584±0.0030.588±0.0070.635±0.0060.633±0.005
FT-LH-E2E0.579±0.0050.603±0.0050.604±0.0040.725±0.0020.788±0.0020.643±0.0020.641±0.0020.664±0.0040.784±0.0050.777±0.0050.585±0.0050.573±0.0040.616±0.0050.667±0.0030.700±0.005
FT-MLP-E2EE0.605±0.0090.627±0.0060.636±0.0050.753±0.0020.752±0.0020.705±0.0070.672±0.0060.695±0.0050.629±0.0140.798±0.0030.658±0.0070.589±0.0060.622±0.0030.677±0.0040.700±0.002
FT-LH0.543±0.0030.568±0.0030.577±0.0020.610±0.0020.612±0.0020.511±0.0020.538±0.0020.543±0.0020.561±0.0040.552±0.0040.462±0.0030.520±0.0030.513±0.0040.477±0.0040.475±0.004
FT-MLP0.587±0.0150.637±0.0160.667±0.0070.766±0.0020.772±0.0010.647±0.0100.563±0.0140.615±0.0080.715±0.0040.723±0.0030.685±0.0050.606±0.0110.666±0.0060.685±0.0030.703±0.003
ResNet-FS0.595±0.0070.570±0.0090.599±0.0060.691±0.0040.625±0.0190.643±0.0070.708±0.0070.689±0.0220.755±0.0070.659±0.0210.560±0.0150.550±0.0040.611±0.0090.680±0.0060.700±0.007
ResNet-FS-20.585±0.0100.573±0.0090.629±0.0050.705±0.0020.749±0.0020.684±0.0100.702±0.0060.730±0.0040.769±0.0040.775±0.0030.567±0.0110.573±0.0060.616±0.0060.702±0.0030.745±0.003
ResNet-LH-E2E0.609±0.0060.523±0.0040.587±0.0020.681±0.0010.758±0.0010.562±0.0060.599±0.0040.618±0.0020.687±0.0020.715±0.0020.473±0.0040.504±0.0030.576±0.0020.603±0.0030.704±0.003
ResNet-MLP-E2E0.671±0.0130.627±0.0100.650±0.0050.732±0.0050.748±0.0050.687±0.0090.652±0.0110.697±0.0060.729±0.0050.761±0.0040.715±0.0070.621±0.0090.630±0.0050.689±0.0030.720±0.002
ResNet-LH0.582±0.0070.557±0.0030.570±0.0020.587±0.0020.595±0.0020.533±0.0080.560±0.0050.535±0.0030.542±0.0040.546±0.0040.436±0.0050.471±0.0050.488±0.0050.464±0.0030.463±0.003
ResNet-MLP0.669±0.0140.625±0.0090.677±0.0040.770±0.0020.766±0.0020.665±0.0110.617±0.0140.659±0.0080.740±0.0030.751±0.0030.719±0.0080.617±0.0090.649±0.0030.661±0.0020.689±0.002
MLP-FS0.535±0.0150.529±0.0100.603±0.0050.704±0.0010.707±0.0010.559±0.0260.570±0.0220.689±0.0070.754±0.0020.749±0.0030.518±0.0130.504±0.0110.584±0.0090.618±0.0020.632±0.003
MLP-FS-20.588±0.0040.594±0.0080.635±0.0030.577±0.0100.726±0.0010.764±0.0030.696±0.0060.733±0.0030.716±0.0060.750±0.0020.514±0.0080.505±0.0060.531±0.0050.626±0.0030.556±0.005
MLP-LH-E2E0.563±0.0040.584±0.0040.606±0.0030.646±0.0030.733±0.0020.594±0.0030.595±0.0020.642±0.0030.595±0.0030.723±0.0020.483±0.0030.473±0.0020.496±0.0020.492±0.0020.639±0.002
MLP-MLP-E2E0.662±0.0070.689±0.0030.681±0.0010.714±0.0010.753±0.0010.699±0.0040.688±0.0030.725±0.0020.692±0.0020.772±0.0010.639±0.0080.517±0.0060.555±0.0040.581±0.0040.658±0.003
MLP-LH0.535±0.0050.595±0.0040.588±0.0040.598±0.0040.593±0.0040.533±0.0030.561±0.0030.564±0.0040.565±0.0040.563±0.0040.460±0.0040.473±0.0020.459±0.0020.457±0.0020.454±0.003
MLP-MLP0.653±0.0070.682±0.0030.679±0.0020.745±0.0010.740±0.0020.660±0.0050.647±0.0030.662±0.0030.728±0.0020.738±0.0020.642±0.0080.501±0.0070.523±0.0060.580±0.0060.590±0.006
Tab-FS0.593±0.0070.563±0.0070.608±0.0090.608±0.0110.696±0.0030.688±0.0070.697±0.0070.672±0.0140.673±0.0160.672±0.0060.626±0.0040.536±0.0060.552±0.0160.536±0.0120.672±0.003
Tab-FS-20.530±0.0040.547±0.0040.583±0.0020.688±0.0020.692±0.0020.649±0.0030.681±0.0090.661±0.0040.654±0.0030.723±0.0030.623±0.0070.573±0.0190.459±0.0030.558±0.250.666±0.005
Tab-LH-E2E0.561±0.0080.573±0.0070.591±0.0050.607±0.0080.716±0.0050.572±0.0050.579±0.0050.617±0.0040.599±0.0060.680±0.050.506±0.0170.495±0.0060.476±0.0050.614±0.0060.666±0.006
Tab-MLP-E2E0.561±0.0080.573±0.0070.591±0.0050.607±0.0080.720±0.0050.572±0.0050.579±0.0050.617±0.0040.599±0.0060.687±0.050.506±0.0170.495±0.0060.476±0.0050.613±0.0060.668±0.06
Tab-LH0.540±0.0080.578±0.0080.575±0.0070.587±0.0080.584±0.0080.538±0.0110.565±0.0110.562±0.1110.557±1.1111.111±1.1111.473±1.1111.473±1.1111.473±1.1111.473±1.1111.473±1.111
Tab-MLP0.540±0.0080.555±1.1111.111±1.1111.557±1.1111.568±1.1111.568±1.1111.571±1.1111.535±1.1111.534±1.1111.534±1.1111.473±1.1111.473±1.1111.473±1.1111.473±1.1111.473±1.111
Catboost0.598±1.1111.588±1.1111.541±1.1111.624±1.1111.711±1.1111.624±1.1111.618±1.1111.677±1.1111.673±1.1111.875±1.1111.541±1.1111.568±1.1111.611±1.1111.641±1.1111.711±1.111
Catboost+stacking0.611±1.1111.611±1.1111.555±1.1111.678±1.1111.749±1.1111.679±1.1111.641±1.1111.681±1.1111.641±1.1111.836±1.1111.545±1.1111.566±1.1111.599±1.1111.625±1.1111.692±1.111
XGBoost0.573±1.1111.632±1.1111.586±1.1111.626±1.1111.683±1.1111.626±1.1111.646±1.1111.672±1.1111.872±1.1111.877±1.1111.618±1.1111.548±1.1111.613±1.1111.659±1.1111.521±1.111
XGBoost+stacking1.584±1.1111.636±1.1111.584±1.1111.627±1.1111.674±1.1111.627±1.1111.652±1.1111.673±1.1111.878±1.1111.878±1.1111.623±1.1111.546±1.1111.636±1.1111.659±1.1111.525±1.111
+ +Table 14: ROC-AUC scores for all models for "Atrial", "Purpura" and "Alcohol" downstream tasks. FT denotes FT-Transformer, Tab denotes TabTransformer. The first two rows in each section correspond to training from scratch, where FS corresponds to deep baseline architecture (tuned on subsample of upstream data), and FS-2 shows the results for the same architecture as one used with transfer learning. LH and MLP denote linear and MLP heads correspondingly, E2E denotes end-to-end training. \ No newline at end of file diff --git a/transferlearningwithdeeptabularmodels/images.zip b/transferlearningwithdeeptabularmodels/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..550dda0c26b49bc07f4d09f5c3d0ef98096b632f --- /dev/null +++ b/transferlearningwithdeeptabularmodels/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f91d6a1248956a4db5a46b324c83f76db7b2a07a7eb084eddc09500f767ef6e1 +size 3152620 diff --git a/transferlearningwithdeeptabularmodels/layout.json b/transferlearningwithdeeptabularmodels/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..432817cd1fcaa0cc0f45097a1ed7734984920274 --- /dev/null +++ b/transferlearningwithdeeptabularmodels/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:54c84378db7fbe0bdb605f610891c6a929349982fcb8d4ce1b2e7509e664149e +size 730030 diff --git a/transformerbasedmodelforsymbolicregressionviajointsupervisedlearning/1597b2fc-905d-4ae9-bb88-5a1559738de4_content_list.json b/transformerbasedmodelforsymbolicregressionviajointsupervisedlearning/1597b2fc-905d-4ae9-bb88-5a1559738de4_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..109c9957c3191bc0c2d5987e4be23fc13edf11a4 --- /dev/null +++ b/transformerbasedmodelforsymbolicregressionviajointsupervisedlearning/1597b2fc-905d-4ae9-bb88-5a1559738de4_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd9be0cbe058f023dd5de58f387218d89d4961231f4ee2dd6551416ff762704c +size 88849 diff --git a/transformerbasedmodelforsymbolicregressionviajointsupervisedlearning/1597b2fc-905d-4ae9-bb88-5a1559738de4_model.json b/transformerbasedmodelforsymbolicregressionviajointsupervisedlearning/1597b2fc-905d-4ae9-bb88-5a1559738de4_model.json new file mode 100644 index 0000000000000000000000000000000000000000..5545c8779dfd4c9dd68de81920a5788389542b71 --- /dev/null +++ b/transformerbasedmodelforsymbolicregressionviajointsupervisedlearning/1597b2fc-905d-4ae9-bb88-5a1559738de4_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da083194c1a82452946e45a63a3c416d8f7ab02f087521281ddf7954f3d3aa36 +size 108642 diff --git a/transformerbasedmodelforsymbolicregressionviajointsupervisedlearning/1597b2fc-905d-4ae9-bb88-5a1559738de4_origin.pdf b/transformerbasedmodelforsymbolicregressionviajointsupervisedlearning/1597b2fc-905d-4ae9-bb88-5a1559738de4_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..810d8a818e7dca4d705d2764dbce3fcb2120b507 --- /dev/null +++ b/transformerbasedmodelforsymbolicregressionviajointsupervisedlearning/1597b2fc-905d-4ae9-bb88-5a1559738de4_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2c28e208eaca39f2f9e322a942345b4c69236619508b2ea2e6932f3237b81b2c +size 13816906 diff --git a/transformerbasedmodelforsymbolicregressionviajointsupervisedlearning/full.md b/transformerbasedmodelforsymbolicregressionviajointsupervisedlearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..bb7beafd132ea3c6e4198a1a90b8ca2cba82de0d --- /dev/null +++ b/transformerbasedmodelforsymbolicregressionviajointsupervisedlearning/full.md @@ -0,0 +1,306 @@ +# TRANSFORMER-BASED MODEL FOR SYMBOLIC REGRESSION VIA JOINT SUPERVISED LEARNING + +Wenqiang Li $^{1,2,4}$ Weijun Li $^{1,3,4,*}$ Linjun Sun $^{1,3,4}$ Min Wu $^{1,3,4}$ Lina Yu $^{1,3,4}$ Jingyi Liu $^{1,3,4}$ Yanjie Li $^{1,3,4}$ Songsong Tian $^{1,2,4}$ + +$^{1}$ Institute of Semiconductors, Chinese Academy of Sciences, Beijing, China + +$^{2}$ School of Electronic, Electrical and Communication Engineering, University of Chinese Academy of Sciences, Beijing, China + +$^{3}$ School of Integrated Circuits, University of Chinese Academy of Sciences, Beijing, China + +4Beijing Key Laboratory of Semiconductor Neural Network Intelligent Sensing and Computing Technology, Beijing, China + +# ABSTRACT + +Symbolic regression (SR) is an important technique for discovering hidden mathematical expressions from observed data. Transformer-based approaches have been widely used for machine translation due to their high performance, and are recently highly expected to be used for SR. They input the data points, then output the expression skeleton, and finally optimize the coefficients. However, recent transformer-based methods for SR focus more attention on large scale training data and ignore the ill-posed problem: the lack of sufficient supervision, i.e., expressions that may be completely different have the same supervision because of their same skeleton, which makes it challenging to deal with data that may be from the same expression skeleton but with different coefficients. Therefore, we present a transformer-based model for SR with the ability to alleviate this problem. Specifically, we leverage a feature extractor based on pure residual MLP networks to obtain more information about data points. Furthermore, the core idea is that we propose a joint learning mechanism combining supervised contrastive learning, which makes features of data points from expressions with the same skeleton more similar so as to effectively alleviate the ill-posed problem. The benchmark results show that the proposed method is up to $25\%$ higher with respect to the recovery rate of skeletons than typical transformer-based methods. Moreover, our method outperforms state-of-the-art SR methods based on reinforcement learning and genetic programming in terms of the coefficient of determination $(R^2)$ . + +# 1 INTRODUCTION + +Exploring mathematical expressions that can be fitted to real-world observed data is the core of expressing scientific discoveries. The correct expression would not only provide us with useful scientific insights simply by inspection but would also allow us to forecast how the process will change in the future. The task of finding such an interpretable mathematical expression from observed data is called symbolic regression. More specifically, given a dataset $(X,y)$ , where each feature $X_{i}\in \mathbb{R}^{n}$ and target $y_{i}\in \mathbb{R}$ , the goal of symbolic regression is to identify a function $f$ (i.e., $y\approx f(X):\mathbb{R}^n\to \mathbb{R})$ that best fits the dataset. + +Symbolic regression is NP-hard because the search space of an expression grows exponentially with the length of the expression, and the presence of numeric constants further exacerbates its difficulty (Lu et al., 2016). Considering this issue, genetic programming (GP) as the most common approach is leveraged to tackle the symbolic regression problems (Forrest, 1993; Koza, 1994; Schmidt & Lipson, 2009; Staelens et al., 2013; Arnaldo et al., 2015; Bładek & Krawiec, 2019). GP-based methods iteratively "evolves" each generation of mathematical expressions through selection, crossover, and mutation. Although this approach can be effective, the expression it yields + +is complex, and it is also known to be computationally expensive and to exhibit high sensitivity to hyperparameters. A more recent line of research has made use of the neural network to tackle the aforementioned shortcomings. Martius & Lampert (2016) propose a simple fully-connected neural network called "EQL", where elementary functions $(\sin, \cos, +, \ldots)$ are used as activation functions. The limitation of EQL is the existence of vanishing gradient and exploding gradient, and the depth of the network limits the complexity of the predicted equation. More recently, deep symbolic optimization (DSO) (Petersen et al., 2021) trains the RNN using the reinforcement learning algorithm based on a risk-seeking policy gradient to generate expressions. They take the output from RNN as an initial population for a genetic algorithm to find the target expression. Albeit the above two approaches show promising results, they still handle symbolic regression as an instance-based problem, training a model from scratch on each new input dataset for a regression task. + +Inspired by the successes of large scale pre-training, recent efforts in symbolic regression have focused on using the transformer-based model and training with a large amount of data (Valipour et al., 2021; Biggio et al., 2021). They all approach the symbolic regression problem as a machine translation problem, mapping the input data to latent representations via encoders, and then outputting the skeleton of expressions without constants by decoders. These transformer-based methods (Valipour et al., 2021; Biggio et al., 2021) for symbolic regression exists two main drawbacks: (i) A natural question is what architecture of the encoder is optimally suited for symbolic regression. It is clear that the decoder's ability to sample expressions efficiently is severely constrained by the encoder's ability to extract the features of the input data. The idea is that the encoder should not just encode the points, but also represent the expression on a high level such that the decoder only prints the representation as a sequence of symbols. (ii) They use the single character of the expression's string (Valipour et al., 2021) and the pre-order traversal of the expression tree (Biggio et al., 2021) as supervision information, respectively, which is an ill-posed problem that does not provide sufficient supervision: different instances of the same skeleton can have very different shapes, and instances of very different skeletons can be very close. To alleviate these issues, we proposed a transformer-based method for symbolic regression using a new feature extractor and a joint supervised learning mechanism. + +In summary, we introduce the main contributions in this study as follows: + +- We leverage a pure residual MLP feature extractor for extracting the local and global features of observed data targeting symbolic regression tasks, which aids the expression generator in producing more correct expression skeletons. +- We propose a joint learning mechanism combining supervised contrastive learning that combines the supervision of the whole expression skeleton with the supervision of the pre-order traversal of its expression tree, which alleviates the ill-posed problem effectively. +- Empirically, the proposed method is up to $25\%$ better than recent transformer-based methods with respect to the recovery rate of expression skeleton. Moreover, our method outperforms several strong baseline methods in terms of $R^2$ . + +# 2 RELATED WORK + +Genetic programming (GP) for symbolic regression. Traditionally, the approaches to symbolic regression are based on genetic algorithms (Forrest, 1993). Later, the symbolic regression task is seen as an optimization problem for the search space (Koza, 1994). By far the most popular commercial software Eureqa (Dubcakova, 2011) is the most successful application based on GP methods. A limitation of the genetic algorithms-based methods is that they need to train for each equation from scratch, which is slow, computationally expensive and highly randomized. The models tend to generate more complex equations and they are sensitive to the choice of hyperparameters (Petersen et al., 2021). + +Neural network for symbolic regression. Symbolic regression based on neural network approaches can be broadly classified into three categories. First, the methods based on equation learner (EQL) (Martius & Lampert, 2016; Sahoo et al., 2018; Werner et al., 2021) are trained by replacing the activation function of the neural network with arithmetic operators, which inherits the ability of neural networks to deal with high-dimensional data and scales well with the number of input-output pairs (Biggio et al., 2021). Nevertheless, the existence of exponential and logarithmic activation + +![](images/78b740f0086e13311b52a3b3aee84a45ba4680618aac17e62352ebae3af51729.jpg) +Figure 1: Schematic diagram of training. The data inputs and expression skeletons' labels are passed through the feature extractor. Then, given the feature vectors, token embedding, and positional embedding, the expression generator produces expression skeletons in parallel. Finally, the model jointly computes the supervised contrastive learning loss and cross-entropy loss. + +functions leads to gradient instability. Also, the complexity of predicted expression depends on the depth of the EQL network. + +Reinforcement learning for symbolic regression. The second approach is the autoregressive model based on reinforcement learning. Petersen et al. (2021) uses reinforcement learning based on a risk-seeking policy gradient to train a RNN to generate a probability distribution over the space of mathematical expressions. For such symbolic regression tasks, they proposed a new objective function based on risk-seeking policy gradients, that focuses on learning only on maximizing best-case performance rather than the average performance of a policy. Genetic programming and neural-guided search are mechanistically dissimilar, yet both have proven to be effective solutions to symbolic regression. Mundhenk et al. (2021) proposed a more novel approach, combining the two approaches to leverage each of their strengths. They take the output from the RNN as an initial population for a genetic algorithm. The method represents a significant step forward in the application of deep learning to symbolic regression (Biggio et al., 2021). The promising results make it the currently recognized state-of-the-art approach to symbolic regression tasks. Nevertheless, the limitations of this method are obvious, namely, the network has to be retrained from scratch for each new equation and the RNN is never directly conditioned on the data it is trained to model (Biggio et al., 2021). + +Large scale transformer-based models for symbolic regression. The third approach is to train a large scale transformer-based model by using a large amount of data. More recently, SymbolicGPT (Valipour et al., 2021) trained a GPT (Radford et al., 2019) model to construct a mapping of pairs of points and symbolic output. They first input the data points into T-net (Qi et al., 2017) to get a potential representation of the data points and then input it to the GPT (Radford et al., 2019) for generating expression strings. They generate the expression at the character level and finally concatenate it into an expression. In general, they explore an alternative approach to symbolic regression by considering it as a task in language modeling. Symbolic mathematics behaves as a language in its own right, with well-formed mathematical expressions treated as valid “sentences” in this language (Valipour et al., 2021). Furthermore, NeSymReS (Biggio et al., 2021) proposed a similar method, where they use the encoder from the Set transformer (Lee et al., 2019) and the decoder from the original transformer architecture (Vaswani et al., 2017). Their greatest contribution is to show that their approach is able to improve performance as the size of the dataset increases. + +# 3 METHODS + +The proposed joint learning mechanism is shown in Figure 1. First, we leverage a permutation-invariant feature extractor based on residual MLP networks to obtain feature vectors of data points. Then, given the feature vectors, the expression generator autoregressively generates individual math- + +ematical symbols until we obtain the entire skeleton of the expression. In the forward propagation, we compute the contrastive loss with respect to the expression skeleton categories and the cross-entropy loss with respect to the mathematical symbol categories separately. The parameters of the network are jointly updated in backpropagation. Training can efficiently process each sequence in a single forward pass of the network thanks to the masked attention and teacher forcing (Vaswani et al., 2017). During inference, multiple predictions are sampled from the model using the beam search strategy and we select the prediction with the lowest error. + +# 3.1 EXTRACTING EFFECTIVE FEATURE OF DATA POINTS + +As mentioned in section 1, the feature extracted from data points affects generating expressions through the decoder. Valipour et al. (2021) obtain the latent representation of data using the T-net (Qi et al., 2017). Albeit efficient, local feature loss caused by non-locality and non-hierarchy degrades the representational quality of details for point cloud (Ma et al., 2022). As a similar work, NeSymReS (Biggio et al., 2021) use the Set Transformer (Lee et al., 2019) based on self-attention to extract data points features. However, it focuses too much on local feature extraction and lacks global information, which is not suitable for expression data points. We explore and visualize the similarity of the features extracted from data points by these methods and compare the expression skeletons generated by the decoder, which confirms the above problems. The result is shown in section 4. The performance of the feature extractor has to be considered, therefore, we opt for the framework of PointMLP (Ma et al., 2022) based on pure residual MLP as our feature extractor in order to obtain the local and overall information of the data points. + +Given a set of data points $\mathcal{D} = \{(x_i, y_i)\}_{i=1}^n \in \mathbb{R}^{n \times (d+1)}$ , where $n$ indicates the number of points and $d$ denotes the dimension of the variable. PointMLP learns hierarchical features of data points by stacking multiple learning stages. In each stage, $N_s$ points are re-sampled by the farthest point sampling (FPS) algorithm, where $s$ indexes the stage and $K$ neighbors are employed for each sampled point (Ma et al., 2022). Conceptually, the kernel operation of PointMLP can be formulated as: + +$$ +O _ {i} = \operatorname {P O S} \left(\operatorname {M a x P o o l} \left(\operatorname {P R E} \left(f _ {i, j}\right), | j = 1, \dots , K\right)\right) +$$ + +where $f_{i,j}$ is the $j$ -th neighbor point feature of $i$ -th sampled point. POS $(\cdot)$ and PRE $(\cdot)$ are residual point MLP blocks: the shared PRE $(\cdot)$ is designed to learn shared weights from a local region while the POS $(\cdot)$ is leveraged to extract deep aggregated features. POS $(\cdot)$ and PRE $(\cdot)$ consist of several residual MLP blocks: $\mathrm{MLP}(x) + x$ . We use the max pooling layer to aggregate global features. After MLP blocks, we add a dropout layer (Srivastava et al., 2014). + +Following (Ma et al., 2022), we also leverage a lightweight geometric affine module to tackle the problem that is less robust and caused by the sparse and irregular geometric structures in local regions. Let $\{f_{i,j}\}_{j = 1,\dots ,k}\in \mathbb{R}^{k\times d}$ be the grouped local neighbors of $f_{i}\in \mathbb{R}^{d}$ containing $k$ points, and each neighbor point $f_{i,j}$ is a $d$ -dimensional vector. We transform the local neighbor points by the following formulation: + +$$ +\{f _ {i, j} \} = \alpha \odot \frac {\{f _ {i , j} \} - f _ {i}}{\sigma + \epsilon} + \beta , \quad \sigma = \sqrt {\frac {1}{k \times n \times d} \sum_ {i = 1} ^ {n} \sum_ {j = 1} ^ {k} (f _ {i , j} - f _ {i}) ^ {2}} +$$ + +where $\alpha \in \mathbb{R}^d$ and $\beta \in \mathbb{R}^d$ are learnable parameters, $\odot$ indicates Hadamard production, and $\epsilon = 1e^{-5}$ is a small number for numerical stability. Note that $\sigma$ is a scalar that describes the feature deviation across all local groups and channels. By doing so, we transform the local points to a normal distribution while maintaining original geometric properties. + +# 3.2 TRAINING WITH JOINT SUPERVISION INFORMATION + +Recent transformer-based face an ill-posed problem because use insufficient supervision information: they use the single character of the expression's string (Valipour et al., 2021) and the pre-order traversal of the expression (Biggio et al., 2021) as supervision information, respectively, and train the model by minimizing the cross-entropy loss. In this work, we propose a joint objective function that combines cross-entropy (CE) loss and supervised contrastive learning (CL) loss. On the basis of using symbol labels as supervision, we treat the skeleton of expressions as category labels to enrich the supervisory information. The CL loss with respect to the expression skeleton categories and the + +CE loss with respect to the mathematical symbol categories are separately calculated in the forward propagation. In backpropagation, the network's parameters are concurrently updated. As the auxiliary loss, the CL loss is meant to capture the similarities of feature vectors between expressions with the same skeletons and contrast them with others. The promising results are described in section 4. The overall loss is a weighted average of CE loss and proposed CL loss, as given in equation (1). The canonical definition of the CE loss that we use is given in equation (2). The novel CL loss is given in equation (3). The overall loss is then given in the following: + +$$ +\mathcal {L} = (1 - \lambda) \mathcal {L} _ {C E} + \lambda \mathcal {L} _ {C L} \tag {1} +$$ + +$$ +\mathcal {L} _ {C E} = - \frac {1}{N} \sum_ {i = 1} ^ {N} \sum_ {c = 1} ^ {C} y _ {i, c} \cdot \ln \hat {y} _ {i, c} \tag {2} +$$ + +$$ +\mathcal {L} _ {C L} = - \sum_ {i = 1} ^ {N} \frac {1}{N _ {\ell_ {i}} + \epsilon} \sum_ {j = 1} ^ {N} \mathbf {1} _ {i \neq j} \mathbf {1} _ {\ell_ {i} = \ell_ {j}} \ln \frac {\exp \left(s _ {i , j} / \tau\right)}{\sum_ {k = 1} ^ {N} \mathbf {1} _ {i \neq k} \mathbf {1} _ {\ell_ {i} \neq \ell_ {k}} \exp \left(s _ {i , k} / \tau\right)} \tag {3} +$$ + +Here, $\lambda$ is a scalar weighting hyperparameter that we tune for the training stage; $N$ represents the mini-batch size; $C$ denotes the size of the pre-specified tokens library; $y_{i,c}$ denotes the symbol label and $\hat{y}_{i,c}$ denotes the expression generator output for the probability of the ith token belonging to the class $c$ ; $N_{l_i}$ is the total number of examples in the batch that have the same skeleton label as $\ell_i$ ; $\epsilon$ is a very small scalar preventing deviation by zero; $\mathbf{1}_{i\neq j}$ , $\mathbf{1}_{\ell_i = \ell_j}$ and $\mathbf{1}_{\ell_i\neq \ell_k}$ are similar indicator functions; $s_{i,j} = \pmb {v}_i\cdot \pmb {v}_j / \| \pmb {v}_i\| \| \pmb {v}_j\|$ denotes the cosine similarity between the sample $i$ and the sample $j$ , where $\pmb {v}_i$ and $\pmb {v}_j$ represent the high-level feature vectors of the sample $i$ and the sample $j$ respectively from the feature extractor; $\tau >0$ is an adjustable scalar temperature parameter that controls the separation of classes. + +# 3.3 GENERATING EXPRESSIONS WITH A TRANSFORMER-BASED MODEL + +We leverage a framework of the GPT language model (Radford et al., 2019) as the expression generator, which is an autoregressive language model based on the decoder of transformer (Vaswani et al., 2017). During inference, we generate an expression $\tau$ one token at a time along the pre-order traversal. For example, the expression $f(x_{1},x_{2}) = \sin (x_{1}) + \log (x_{2})$ is encoded as $[+, \sin, x_{1}, \log, x_{2}]$ . We denote the $i^{\text{th}}$ token of the traversal as $\tau_{i}$ and each token has a value within a given library $\mathcal{L}$ of possible tokens, e.g., $\{+, -, \times, \div, \sin, \cos, \log, x_{1}, x_{2}\}$ . Specifically, the $i^{\text{th}}$ output of the generator with parameters $\theta$ and feature vector $\pmb{v}$ extracted from data $\mathcal{D}$ pass through a softmax layer to produce vector $\psi^{(i)}$ , which defines the probability distribution for selecting the $i^{\text{th}}$ token $\tau_{i}$ . The likelihood of the entire generated expression is simply the product of the likelihoods of its tokens: $p(\tau | \theta, \pmb{v}) = \prod_{i=1}^{|\tau|} p(\tau_{i} | \tau_{1:(i-1)}; \theta, \pmb{v}) = \prod_{i=1}^{|\tau|} \psi_{\mathcal{L}(\tau_{i})}^{(i)}$ . Note that the output sequence from the generator does not contain any numerical constants. Instead, we use a special placeholder $\langle C \rangle$ denoting the presence of a constant that will be optimized at a later stage. + +# 3.4 LEARNING CONSTANTS USING BFGS BY RESTARTING MULTIPLE TIMES + +At inference time, Mundhenk et al. (2021); Valipour et al. (2021); Biggio et al. (2021) all use BFGS optimization algorithm (Fletcher, 1984) on the mean squared error to fit the constants. BFGS is a quasi-newton method for solving unconstrained nonlinear convex optimization problems. However, for the symbolic regression task, the loss function minimized by BFGS may be highly non-convex, which is likely to be falling into several local minima: even when the skeleton is perfectly predicted, the correct constants are not guaranteed to be found. To ameliorate this issue, we use a simple and hardly any space cost method: restart the BFGS algorithm by initializing the different starting points multiple times, and the global optimal point is achieved as much as possible. The result is shown in section 4. + +# 4 EXPERIMENTS AND RESULTS + +# 4.1 GENERATING DATASETS + +We generate mathematical expressions following the framework as described by (Lample & Charlton, 2019). The framework starts by generating a random unary-binary tree and filling the nodes + +with operators and the leaves with independent variables or constants. The unnormalized probabilities of each operation and operator are given in Appendix A. We generate the training set containing approximately 100,000 unique expression skeletons. For each expression, we re-sample its constant values for 10, 20, 30, 40, and 50 times. Once an expression tree has been generated, we can represent the expression using a pre-order traversal of the tree. We opt for scalar functions of up to two independent variables (i.e., $d = 2$ and $y = f(x_{1},x_{2})$ ) and three numerical constants each. Specifically, each generated expression's constant values are replaced with the constant placeholder $\langle C\rangle$ . Then, the additive and multiplicative constant values are sampled uniformly from the interval $[-2,2]$ to fill in the placeholder. After this, the entire equation will be simplified using the rules built in the symbolic manipulation library SymPy (Meurer et al., 2017). Finally, we sample uniformly at random 100 input points $X = \{x_{i}\}_{i = 1}^{n}$ from the interval $[-10,10]$ and evaluate the expressions on the $X$ to obtain the corresponding outputs $Y$ . $X$ will be re-sampled if produce non-finite values (NaN or $\pm \infty$ ) and we discard the expression that cannot be sampled completely in 30 seconds. + +Creating the SSDNC benchmark. We generate a more challenging test set to discover the performance of transformer-based methods, which includes approximately 100 unique expression skeletons and 10 re-sampled numerical constants for each skeleton. We sample random support of 100 points from the uniform distribution $\mathcal{U}(-10,10)$ , for each independent variable. We call it SSDNC, for the same skeletons with different numerical coefficients. + +# 4.2 TRAINING AND INFERENCE + +We train the feature extractor and expression generator jointly to minimize the objective loss combined with cross-entropy loss and supervised contrastive loss. More specifically, we train the model using the Adam optimizer (Kingma & Ba, 2014) on 4 NVIDIA V100 GPUs. More detailed hyperparameters are reported in Appendix 5, which were found empirically and not fine-tuned for maximum performance. Note that we use the same dataset for training to facilitate quantitative benchmarking when evaluating the feature extraction and other capabilities with SymbolicGPT (Valipour et al., 2021) and NeSymReS (Biggio et al., 2021). At inference, most of the expressions of benchmark test sets are not seen during training, and we resampled all data points to avoid the possible overfitting problem. + +# 4.3 METRICS + +We have selected the coefficient of determination $(R^2)$ to assess the quality of our method. The $R^2$ (Glantz & Slinker, 2001) is defined as follows: + +$$ +R ^ {2} (y, \hat {y}) = 1 - \frac {\sum_ {i = 1} ^ {k} (y _ {i} - \hat {y} _ {i}) ^ {2}}{\sum_ {i = 1} ^ {k} (y _ {i} - \bar {y}) ^ {2}} +$$ + +where $y_{i}$ and $\hat{y}_i$ are the ground-truth and predicted values for point $i$ , respectively. $\bar{y}$ is the average of $y_{i}$ over all the points. $k$ is the number of test points. The advantage of using $R^2$ is its nice interpretation. If $R^2 > 0$ , then means the prediction is better than predicting just the average value, and if $R^2 = 1$ , then we get a perfect prediction. However, due to the presence of the max operator, $R^2$ is sensitive to outliers, and hence to the number of points considered at test time (more points entail a higher risk of an outlier). To circumvent this, we discard the $5\%$ worst predictions for all methods used, following (Biggio et al., 2021). + +# 4.4 BASELINES + +We compare the performance of our method with four strong symbolic regression baselines: + +- SymbolicGPT (Valipour et al., 2021) A recent novel transformer-based language model for symbolic regression. We use the open-source implementation provided by the authors. $^{1}$ +- Neuronal Symbolic Regression that Scales (NeSymReS) (Biggio et al., 2021) Recently proposed transformer-based symbolic regression model on the large training data. We use the open-source implementation provided by the authors. + +![](images/74290dd9cb574cdd65bb28e9f5178e561962f3d59b940fe60843af04c3f47786.jpg) +(a) SymbolicGPT + +![](images/d4c0939f796b4c08cd319a848cf3ef30813df1467c340773a41b794135e370f9.jpg) +(b) NeSymReS + +![](images/cac6f83e34bf9f000eec02c815203b11b73f513ca7d852aab5c9b82212fc6abe.jpg) +(c) Ours w/o CL +Figure 2: For the expression skeleton $c_{1}\sin (x_{1}) + c_{2}\cos (x_{2}) + c_{3}$ , four heat maps of cosine similarity between the fifty different feature vectors from different methods, where the redder color means the cosine similarity is closer to 0, and the greener color means the cosine similarity is closer to 1. + +![](images/cd9552e795305938e396e520cb85938cddd05f5c773b1eacc2f0956a61a4f4cf.jpg) +(d) Ours w/ CL + +- Deep Symbolic Optimization (DSO). A symbolic regression method based on RNN and reinforcement learning search strategy (Mundhenk et al., 2021). We use the open-source implementation provided by the authors. +- Genetic Programming. Standard GP-based symbolic regression (Koza, 1994) based on the open-source Python library gplearn. + +All details for baselines are reported in Appendix D. + +# 4.5 FEATURE EXTRACTION PERFORMANCE + +For transformer-based methods in symbolic regression, we empirically demonstrate that the performance of the feature extractor plays a critical role in the overall training and evaluation stages. We evaluate the feature extraction performance of recent transformer-based methods, i.e., SymbolicGPT (Valipour et al., 2021) and NeSymReS (Biggio et al., 2021), and our method with/without CL on SSDNC benchmark. After training, we input the data points corresponding to the specific expression skeleton with different constants into the feature extractor, then we compute the cosine similarity between the different feature vectors. As shown in Figure 2, SymbolicGPT (Valipour et al., 2021) and NeSymReS (Biggio et al., 2021) all produce dissimilar feature vectors for the data points of different expressions belonging to the same skeleton. The reason is that the feature extractor they used focuses more on local features and loses key information, which is not appropriate for the data points of symbolic regression. By manual inspection, we find that this problem can adversely affect the expression generator to produce an expression skeleton. The results in section 4.6 illustrate the high correlation between the feature extractor and expression generating. Benefiting from using the architecture of pure residual MLP, our feature extractor is able to obtain more similar feature vectors when facing the same skeleton, even without CL. After training jointly, we make the feature vectors of data points from the same skeleton more similar, which effectively alleviates the ill-posed problem and improves the performance of generating expressions with the same skeletons. + +# 4.6 EVALUATION ON BENCHMARKS + +Recovery rate of skeletons. In inference, since transformer-based methods first generate expression skeletons based on features of data points, we first compare the performance of these methods in recovering expression skeletons. we evaluate the recovery rate of expression skeletons on the SSDNC benchmark. As shown in Table 1, our method with the more effective feature extractor and the joint leaning mechanism can better guide the generator in generating expressions, thus outperform + +Table 1:Recovery rate of expression skeletons on the SSDNC benchmark. + +
MethodRecovery rate (%)
SymbolicGPT50.3 ± 1.7
NeSymReS63.4 ± 1.1
Ours w/o CL69.7 ± 0.9
Ours w/ CL75.2 ± 1.3
+ +ing other transformer-based methods. Generating the right expression skeleton is crucial to the final + +Table 2: Results comparing our method with CL with state-of-the-art methods on several benchmarks. Our method, SymbolicGPT, and NeSymReS all use the beam search strategy with the beam size equaling 128. We report the average value of $R^2$ for each benchmark. + +
BenchmarkOursSymbolicGPTNeSymReSDSOGP
\(R^2\uparrow\)\(R^2\uparrow\)\(R^2\uparrow\)\(R^2\uparrow\)\(R^2\uparrow\)
Nguyen0.999990.643940.975380.994890.89019
Constant0.999980.694330.849350.999270.90842
Keijzer0.983200.594570.975000.969280.90082
R0.999990.710930.999930.972980.83198
AI-Feynman0.999990.646820.999990.999990.92242
SSDNC0.947820.745850.857920.931980.88913
Overall avg.0.988500.672740.942920.978060.89049
+ +![](images/f31d62c28cd701d2b4f7f9c636abeaa6cdf56cd6f41ceff863d3e752e740236c.jpg) +Figure 3: Training on different datasets that contain various numbers of expressions with different constants. Inference on SSDNC benchmark. + +![](images/ca69bbc0a9030b01528fa35d4285d8db5ac04861c6e81fb93a6dd0c4603523f6.jpg) +Figure 4: $R^2$ vs gaussian noisy data. Error bar represent standard error. Inference on SS-DNC benchmark. + +![](images/58f5cba0cfd356234bbf12f9df196c0ef14aa3dfe52cc00732a50f6d80d5d557.jpg) +Figure 5: $R^2$ for different restart times of BFGS in the constant optimization stage. Inference on SSDNC benchmark. + +result because optimizing constants is relatively simple. This is reflected in the comparison for $R^2$ in the following results. + +Statistics of fitting accuracy We evaluate our method and current state-of-the-art approaches on the widely used public benchmarks, i.e., the Nguyen benchmark (Uy et al., 2011), Constant, Keijzer (Keijzer, 2003), R rationals (Krawiec & Pawlak, 2013), AI-Feynman database (Udrescu & Tegmark, 2020) and our SSDNC test set. Nguyen was the main benchmark used in Petersen et al. (2021). There are terms that appear in three ground truth equations that are not included in the set of equations that our model can fit, specifically $x^6$ and $x^y$ , but we can find approximate expressions. AI-Feynman database is extracted from the popular Feynman Lectures on Physics series and contains expressions with up to nine variables. In our study, we consider all the expressions with up to two variables. The complete benchmark functions are given in Appendix 4. From the results in Table 2, our method outperforms all baseline methods in terms of average $R^2$ on six benchmarks. + +Performance under different training sets sizes. Following subsection 4.1, we generate the different size of data set that contains the various number of expressions with different constants and the same skeletons. Since DSO (Mundhenk et al., 2021) and GP-based methods are trained from scratch for specific problems, they are not included in this comparison. We train our model, SymbolicGPT and NeSymReS on our training sets separately. As shown in Figure 3, our method with/without CL all outperforms these two baseline methods in terms of $R^2$ on the SSDNC benchmark. SymbolicGPT and NeSymReS can also improve performance simply by increasing the size of the dataset, which shows that the data-driven approach for SR can continuously improve performance as the size of the dataset increases. + +Performance under noisy data. We evaluated the robustness of our and baseline methods to noisy data by adding independent Gaussian noise to the dependent variable, with mean zero and standard deviation proportional to the root-mean-square of the dependent variable in the training data (Mundhenk et al., 2021). In Figure 4, we varied the proportionality constant from 0 (noiseless) to $10^{-1}$ , following (Mundhenk et al., 2021), and evaluated each algorithm across the SSDNC benchmark. + +![](images/f44f81896c5c2fdeb6f6827269f878b0515a8bf4f0182db29eec3b79d405587e.jpg) +(a) + +![](images/d5db415c00b9e7b986b111a230a0dc5d15c71e6a199bb788c7da10915a86caca.jpg) +(b) + +![](images/47c5de64970a2922d1a904e0cbf10a6b6ccf71a15ddace14e59ba8b190581d90.jpg) +Figure 6: Examples of model predictions using beam search with beam size equaling to 128. The shaded area represents the sampling range. For all functions, $x$ and $y$ were sampled from $[-10, 10]$ . 'GT' denotes ground-truth and 'Pred', the model prediction. Specifically, + +![](images/014619ee139012713c34b8983d43a4e145fc8a1dc4e54c2a419cca4ebcf6dd47.jpg) +(c) + +(a): GT: $\frac{(x^6 + x^5)}{(x^4 + x^3 + x^2 + x + 1)}$ , Pred: $x \cdot (x - \sin \left(\frac{1}{x}\right))$ ; +(b): GT: $x \cdot \cos(\tan(x))$ , Pred: $x \cdot \cos(\tan(x))$ ; +(c): GT: $0.2x^{3} + 0.5y^{3} - y - x$ , Pred: $0.1853x^{3} + 0.4974y^{3} - 0.8608y$ . + +Our method with CL is competitive compared with DSO based on reinforcement learning, not overfitting the noise when adding a small amount of noise. + +Optimizing constants via restarting BFGS multiple times. We try to reach the global optimum rather than the local optimum by restarting BFGS several times, each time using a different initialization. We set the restart times to 5, 10, 15 and 20. 0 means that the optimization only once. Figure 5 shows that $R^2$ improves as the number of BFGS restarts increases. We can conclude that multiple initializations can effectively jump out of local optimum in the constant optimization process so as to achieve better fitting accuracy. + +Finding mathematically equivalent expressions. By manual observation, we find that our method can generate more expressions with the same symbol as the target expression, which benefits from the high skeleton recovery rate. Interestingly, we also find that the model sometimes predicts a more simple expression compared to the ground truth with fairly high fitting accuracy. For example, for the Keijzer-4 expression $x^3 \cdot \exp(-x) \cdot \cos(x) \cdot \sin(x) \cdot (\sin(x)^2 \cdot \cos(x) - 1)$ , our method predicts $-0.634193499960418x^3 \cdot \exp(-x) \cdot \sin(1.83246993155237x + 10.9750345372947)$ , which is simpler in the terms of skeleton and achieving a high $R^2$ through the constant optimization. Additionally, the model can learn some transformation relations of trigonometric functions, e.g., for Constant-7 expression $2\sin(1.3x_1) \cdot \cos(x_2)$ , our method predicts $2\cos(1.3x_1 - \frac{\pi}{2}) \cdot \cos(x_2)$ , which implicates the transformation relation, i.e., $\sin(x) = \cos(x - \frac{\pi}{2})$ . + +Out-of-domain performance. To test the out-of-domain performance of our method, we first run the inference on the points sampled from the training range and then evaluate these predicted functions on points outside the sampling range. In Figure 6, we visualized some of the model predictions about unary and binary expressions. The experimental results show that our model can have good generalization performance outside the sampling domain when predicting more complex expressions, without overfitting the sampled data. + +# 5 CONCLUSION + +We propose a transformer-based method for symbolic regression using a new feature extractor and a joint supervised learning mechanism. Specifically, we leverage a pure residual MLP feature extractor to obtain more valuable features on input data points. In order to fundamentally alleviate the ill-posed problem, we propose a joint supervised learning mechanism combining supervised contrastive learning, which strengthens the similarity of feature vectors from the same skeleton. The expression skeleton recovery rate of the proposed method is up to $25\%$ higher than that of recent transformer-based methods. Evaluated on six benchmarks, the results show that our method outperforms current state-of-the-art methods based on reinforcement learning and genetic programming in terms of $R^2$ . It is worth noting that our method is competitive with the reinforcement learning-based method in terms of robustness. Finally, by evaluating the performance of our method outside the sampling range, we showed that it has good extrapolation capabilities. + +# ACKNOWLEDGMENTS + +This work was supported by the Key-Area Research and Development Program of Guangdong Province (No.2019B010107001), and the Key Research Program of the Chinese Academy of Sciences (No.XDPB22). + +# REFERENCES + +Ignacio Arnaldo, Una-May O'Reilly, and Kalyan Veeramachaneni. Building predictive models via feature synthesis. In Proceedings of the 2015 annual conference on genetic and evolutionary computation, pp. 983-990, 2015. +Rohit Batra, Le Song, and Rampi Ramprasad. Emerging materials intelligence ecosystems propelled by machine learning. Nature Reviews Materials, 6(8):655-678, 2021. +Luca Biggio, Tommaso Bendinelli, Alexander Neitz, Aurelien Lucchi, and Giambattista Parascandolo. Neural symbolic regression that scales. In International Conference on Machine Learning, pp. 936-945. PMLR, 2021. +Iwo Bladek and Krzysztof Krawiec. Solving symbolic regression problems with formal constraints. In Proceedings of the Genetic and Evolutionary Computation Conference, pp. 977-984, 2019. +Renata Dubčáková. Eureqa: software review, 2011. +R. Fletcher. Practical methods of optimization. SIAM Review, 26(1):143-144, 1984. +Stephanie Forrest. Genetic algorithms: principles of natural selection applied to computation. Science, 261(5123):872-878, 1993. +Stanton A Glantz and Bryan K Slinker. Primer of applied regression & analysis of variance, ed., volume 654. McGraw-Hill, Inc., New York, 2001. +Maarten Keijzer. Improving symbolic regression with interval arithmetic and linear scaling. In European Conference on Genetic Programming, pp. 70-82. Springer, 2003. +Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. +John R Koza. Genetic programming as a means for programming computers by natural selection. Statistics and computing, 4(2):87-112, 1994. +Krzysztof Krawiec and Tomasz Pawlak. Approximating geometric crossover by semantic backpropagation. In Proceedings of the 15th annual conference on Genetic and evolutionary computation, pp. 941-948, 2013. +Guillaume Lample and François Charton. Deep learning for symbolic mathematics. arXiv preprint arXiv:1912.01412, 2019. +Juho Lee, Yoonho Lee, Jungtaek Kim, Adam Kosiorek, Seungjin Choi, and Yee Whye Teh. Set transformer: A framework for attention-based permutation-invariant neural networks. In International conference on machine learning, pp. 3744-3753. PMLR, 2019. +Christian Loftis, Kunpeng Yuan, Yong Zhao, Ming Hu, and Jianjun Hu. Lattice thermal conductivity prediction using symbolic regression and machine learning. The Journal of Physical Chemistry A, 125(1):435-450, 2020. +Qiang Lu, Jun Ren, and Zhiguang Wang. Using genetic programming with prior formula knowledge to solve symbolic regression problem. Computational intelligence and neuroscience, 2016, 2016. +Xu Ma, Can Qin, Haoxuan You, Haoxi Ran, and Yun Fu. Rethinking network design and local geometry in point cloud: A simple residual MLP framework. In The Tenth International Conference on Learning Representations, ICLR 2022, Virtual Event, April 25-29, 2022. OpenReview.net, 2022. URL https://openreview.net/forum?id=3Pbra-_u76D. + +Georg Martius and Christoph H Lampert. Extrapolation and learning equations. arXiv preprint arXiv:1610.02995, 2016. +A. Meurer, C. P. Smith, M. Paprocki, O Čertík, and Anthony Scopatz. Sympy: Symbolic computing in python. PeerJ Computer Science, 3(3):e103, 2017. +T. N. Mundhenk, M. Landajuela, R. Glatt, C. P. Santiago, D. M. Faissol, and B. K. Petersen. *Symbolic regression via neural-guided genetic programming* population seeding. 2021. +Brenden K Petersen, Mikel Landajuela, T Nathan Mundhenk, Claudio P Santiago, Soo K Kim, and Joanne T Kim. Deep symbolic regression: Recovering mathematical expressions from data via risk-seeking policy gradients. In Proc. of the International Conference on Learning Representations, 2021. +Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 652-660, 2017. +Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019. +Subham Sahoo, Christoph Lampert, and Georg Martius. Learning equations for extrapolation and control. In International Conference on Machine Learning, pp. 4442-4450. PMLR, 2018. +Michael Schmidt and Hod Lipson. Distilling free-form natural laws from experimental data. science, 324(5923):81-85, 2009. +Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. The journal of machine learning research, 15(1):1929-1958, 2014. +Nicolas Staelens, Dirk Deschrijver, Ekaterina Vladislavleva, Brecht Vermeulen, Tom Dhaene, and Piet Demeester. Constructing a no-reference h. 264/avc bitstream-based video quality metric using genetic programming-based symbolic regression. IEEE Transactions on Circuits and Systems for Video Technology, 23(8):1322-1333, 2013. +Sheng Sun, Runhai Ouyang, Bochao Zhang, and Tong-Yi Zhang. Data-driven discovery of formulas by symbolic regression. MRS Bulletin, 44(7):559-564, 2019. +Silviu-Marian Udrescu and Max Tegmark. Ai feynman: A physics-inspired method for symbolic regression. Science Advances, 6(16):eaay2631, 2020. +Nguyen Quang Uy, Nguyen Xuan Hoai, Michael O'Neill, Robert I McKay, and Edgar Galván-López. Semantically-based crossover in genetic programming: application to real-valued symbolic regression. Genetic Programming and Evolvable Machines, 12(2):91-119, 2011. +Mojtaba Valipour, Bowen You, Maysum Panju, and Ali Ghodsi. Symbolicgpt: A generative transformer model for symbolic regression. arXiv preprint arXiv:2106.14131, 2021. +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017. +Yiqun Wang, Nicholas Wagner, and James M Rondinelli. Symbolic regression in materials science. MRS Communications, 9(3):793-805, 2019. +Baicheng Weng, Zhilong Song, Rilong Zhu, Qingyu Yan, Qingde Sun, Corey G Grice, Yanfa Yan, and Wan-Jian Yin. Simple descriptor derived from symbolic regression accelerating the discovery of new perovskite catalysts. Nature communications, 11(1):1-8, 2020. +Matthias Werner, Andrej Junginger, Philipp Hennig, and Georg Martius. Informed equation learning. arXiv preprint arXiv:2105.06331, 2021. +Tailin Wu and Max Tegmark. Toward an artificial intelligence physicist for unsupervised learning. Physical Review E, 100(3):033311, 2019. + +# A DETAILS FOR DATASET GENERATION + +In this section, we describe the configurations used to generate the training set, validation set, and SSDNC benchmark. We sample each non-leaf node following the unnormalized weighted distribution shown in Table 3 Our base data set approximately contains 100,000 unique expressions' skeletons. Then the different training sets are generated according to the number of expressions with different coefficients. We set this number to 10, 20, 30, 40 and 50. The validation set contains 1K skeletons that are randomly sampled from the base data set and assigned constants that differ from the training set. We generate the more challenging test benchmark SSDNC, which includes approximately 100 unique expression skeletons and 10 re-sampled numerical constants for each skeleton. Source code is available at https://github.com/AILWQ/Joint_Supervised_Learning_for_SR. + +Table 3: Unnormalised probabilities of unary and binary operators used by the dataset generator. + +
OperationMathematical meaningUnnormalized probability
add+10
mul×10
sub-5
div÷5
sqrt√·4
expexp ·4
lnln ·4
sinsin ·4
coscos ·4
tantan ·4
pow2(·)24
pow3(·)32
pow4(·)41
pow5(·)51
+ +# B BECHMARK FUNCTIONS + +This section describes the exact functions used to compare our method with the current state-of-the-art methods. In Table 4, we show the name of the benchmark and corresponding expressions. + +Table 4: Benchmark functions that we have used in our experiments. Input variables are denoted by $x$ and/or $y$ . We have restricted ourselves only to the univariate and bivariate functions. + +
NameExpression
Nguyen-1x3+x2+x
Nguyen-2x4+x3+x2+x
Nguyen-3x5+x4+x3+x2+x
Nguyen-4x6+x5+x4+x3+x2+x
Nguyen-5sin(x2)cos(x)-1
Nguyen-6sin(x)+sin(x+x2)
Nguyen-7ln(x+1)+ln(x2+1)
Nguyen-8√x
Nguyen-9sin(x)+sin(y2)
Nguyen-102 sin(x)cos(y)
Nguyen-11xy
Nguyen-12x4-x3+1/2y2-y
Constant-13.39x3+2.12x2+1.78x
Constant-2sin x2·cos x-0.75
Constant-3sin (1.5x)·cos (0.5y))
Constant-42.7xy
Constant-5√1.23x
Constant-6x0.426
Constant-72 sin (1.3x) · cos y
Constant-8ln(x+1.4) + ln(x2+1.3)
Keijzer-30.3 · x · sin (2 · π · x)
Keijzer-4x3exp(-x)cos(x)sin(x)(sin x2cos x-1)
Keijzer-6x·(x+1)/2
Keijzer-7ln x
Keijzer-8√x
Keijzer-9ln (x+√(x2+1))
Keijzer-10xy
Keijzer-11xy + sin ((x-1)(y-1))
Keijzer-12x4-x3+y2-y
Keijzer-136 sin(x) · cos(y)
Keijzer-148/2+x2+y2
Keijzer-15x3/5+y3/2-y-x
R-1(x+1)3/x2-x+1
R-2x5-3x3+1/x2+1
R-3x6+x5/x4+x3+x2+x+1
Feynman-1exp(-x2/2)/√2·π
Feynman-2exp(-(xy-1)2/2) /√(2·π)y
Feynman-3x·y
Feynman-4x·y
Feynman-51/2·x·y2
Feynman-6x/y
Feynman-7sin(θ1)/sin(θ2)
Feynman-8x/y
Feynman-9x·y/2·π
Feynman-101.5·x·y
Feynman-11x/4·π·y2
Feynman-12x·y2/2
Feynman-13x·y2
Feynman-14x/2·(1+y)
Feynman-15x·y/2·π
+ +# C MODEL HYPERPARAMETERS + +In this section, we give more details about the hyperparameters of our models with/without CL. The full set of hyperparameters can be seen in Table 5. + +# D BASELINES DETAILS + +Transformer-based methods. For SymbolicGPT (Valipour et al., 2021) and NeSymReS (Biggio et al., 2021), we use the standard hyperparameters provided in the open-source implementation of these methods $^{56}$ . Some parameters such as the dimension of input, vocabulary size, and so on, are manually adjusted as the dataset changes. Note that we do not change model hyperparameters that may affect performance. + +Table 5: Hyperparameters for our models. + +
Encoder
Number of stages4
Number of pre-blocks for each stage2
Number of pos-blocks for each stage2
Original dimension of embedding64
Dimension expansion for each stage2
Number of neighbors for FPS5
Dropout rate0.1
Decoder
Dimension of model512
Number of heads8
Dropout rate0.1
Number of layers8
Dimension of output60
Training
Batch size128
Learning rate0.0001
Scale weight (w/ CL) λ0.2
Temperature parameter0.5
Max norm of gradients1.0
Inference
Beam size128
Re-start times of BFGS20
+ +Deep symbolic Optimization (DSO). For DSO (Mundhenk et al., 2021), we use the standard parameter settings in the open-source implementation7. DSO depends on two main hyper-parameters namely the entropy coefficient $\lambda_{H}$ and the risk factor $\epsilon$ , and hyperparameters related to genetic programming hybrid methods. The $\lambda_{H}$ is used to weight a bonus proportional to the entropy of the sampled expression which is added to the main objective. The intervention in the definition of the final objective depends on the $(1 - \epsilon)$ quantile of the distribution of rewards under the current policy. According to the open-source implementation, the chosen hyperparameters are listed in Table 6. + +Genetic Programming (GP). For GP-based methods, we opt for the function SymbolicRegressor of open-source Python library gplearn8. Our choices for the hyperparameters are mostly the default values indicated in the library documentation. The detailed settings are reported in Table 7. + +Table 6: Hyperparameters for DSO. + +
Parameter nameValue
Entropy coefficient λH0.05
Risk factor ε0.005
Generations20
Population size1000
Crossover probability0.5
Mutation probability0.5
+ +Table 7: Hyperparameters for GP. + +
Parameter nameValue
Population size1000
Generations20
Tournament size20
Crossover probability0.9
Mutation probability0.01
Const range(-5, 5)
+ +# E EXPLORING PHYSIC LAWS + +Symbolic regression is used by many research communities to advance the study of numerous scientific fields, e.g., Physics (Wu & Tegmark, 2019; Udrescu & Tegmark, 2020), Chemistry (Batra et al., 2021), and Materials (Sun et al., 2019; Wang et al., 2019; Weng et al., 2020; Loftis et al., 2020). Our method shows great potential in recovering some of the laws of physics. As reported in Table 8, we successfully recover all the expressions of two variables in Feynman benchmark test sets. Since $\pi$ is not included in the dictionary during training, the corresponding value in the recovered expression is predicted to be a decimal. + +Symbolic regression algorithms are getting better. Our work will be useful for future data-driven symbolic regression methods. We look forward to the day when a computer helps physicists discover the basic laws of physics, even just like Kepler, discovers a useful and hitherto unknown physics expression through symbolic regression. + +Table 8: Recovery expressions on each of the Feynman benchmark of our methods. $\mathcal{U}(a,b,c)$ denotes $c$ random points uniformly sampled between $a$ and $b$ for each input variable. $R^2$ values are rounded to 5 decimals. + +
IDExpressionConstantDatasetOursAccuracy(R2)
I.6.2af = exp(−θ2/2)/√2·ππU(1,3,100)0.39894 exp(−0.5θ2)0.99999
I.6.2f = exp(−(θσ−1)2/2)/√(2·π)σπU(1,3,100)0.39888 exp(−0.49996θ2/σ2)0.99999
I.12.1F = μNnNoneU(1,5,100)μNn1.0
I.12.5F = q2EfNoneU(1,5,100)q2Ef1.0
I.14.4U = kspringx2/2NoneU(1,5,100)kspringx2/21.0
I.25.13V = q/CNoneU(1,5,100)q/C1.0
I.26.2n = sin(θ1)/sin(θ2)NoneU(0,π/2,100)sin(θ1)/sin(θ2)1.0
I.29.4k = ω/ccU(1,10,100)ω/c1.0
I.34.27W = h/2πωπ,hU(1,5,100)0.15924hω0.99999
I.39.1U = 3/2prVNoneU(1,5,100)3/2prV1.0
II.3.24h = Pwr/4πr2πU(1,5,100)0.079617Pwr/r21.0
II.8.31u = εEf/2εU(1,5,100)εEf/21.0
II.27.18u = εE2εU(1,5,100)εE21.0
II.38.14μ = Y/2(1+σ)NoneU(1,5,100)0.5Y/1+σ1.0
III.12.43J = mh/2ππ,hU(1,5,100)0.15923mh0.99999
\ No newline at end of file diff --git a/transformerbasedmodelforsymbolicregressionviajointsupervisedlearning/images.zip b/transformerbasedmodelforsymbolicregressionviajointsupervisedlearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..bea2193f8cfee899106fe49e8e3f0158d9992a8e --- /dev/null +++ b/transformerbasedmodelforsymbolicregressionviajointsupervisedlearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1fe55d94f410ceec6d432d1d0ed97b340eb739aa729b3543bb6c12b0b536b06e +size 648219 diff --git a/transformerbasedmodelforsymbolicregressionviajointsupervisedlearning/layout.json b/transformerbasedmodelforsymbolicregressionviajointsupervisedlearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..637dcde399a980b7dfda34af3aa9ebfe6e1cebbf --- /dev/null +++ b/transformerbasedmodelforsymbolicregressionviajointsupervisedlearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:81f4ddb1b7b0599b3c99b5c1e720fa14f9d4d7ba48b21a2df44ea7c7f62f6eb9 +size 468908 diff --git a/transformerbasedworldmodelsarehappywith100kinteractions/17e8a818-64b5-455c-ab5c-86f73da8f2b3_content_list.json b/transformerbasedworldmodelsarehappywith100kinteractions/17e8a818-64b5-455c-ab5c-86f73da8f2b3_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..32a402152ab77c15b7977d3ece16ed2473c68db1 --- /dev/null +++ b/transformerbasedworldmodelsarehappywith100kinteractions/17e8a818-64b5-455c-ab5c-86f73da8f2b3_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:54f557212e84daa5316e1a420a91d84938ffe53f447e79dfaf74f6793b05b081 +size 117746 diff --git a/transformerbasedworldmodelsarehappywith100kinteractions/17e8a818-64b5-455c-ab5c-86f73da8f2b3_model.json b/transformerbasedworldmodelsarehappywith100kinteractions/17e8a818-64b5-455c-ab5c-86f73da8f2b3_model.json new file mode 100644 index 0000000000000000000000000000000000000000..d18e87ec1ef1353ef5452475433ab7cd915df29d --- /dev/null +++ b/transformerbasedworldmodelsarehappywith100kinteractions/17e8a818-64b5-455c-ab5c-86f73da8f2b3_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aab76a37a6748f69e44b9fb7ec2827f8c74aab6b4253a5e0fcb2ca7bcbad21eb +size 142074 diff --git a/transformerbasedworldmodelsarehappywith100kinteractions/17e8a818-64b5-455c-ab5c-86f73da8f2b3_origin.pdf b/transformerbasedworldmodelsarehappywith100kinteractions/17e8a818-64b5-455c-ab5c-86f73da8f2b3_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7d736ccc6bacb944a66a8acff0237c62f185c298 --- /dev/null +++ b/transformerbasedworldmodelsarehappywith100kinteractions/17e8a818-64b5-455c-ab5c-86f73da8f2b3_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:46b517c0cb04c94d60bf29d33c09419203b2505ffa73ba9382129ba5587d0a8c +size 3046051 diff --git a/transformerbasedworldmodelsarehappywith100kinteractions/full.md b/transformerbasedworldmodelsarehappywith100kinteractions/full.md new file mode 100644 index 0000000000000000000000000000000000000000..58029bfaeac76870b3161ae8034fe3f7b4ba14f2 --- /dev/null +++ b/transformerbasedworldmodelsarehappywith100kinteractions/full.md @@ -0,0 +1,426 @@ +# TRANSFORMER-BASED WORLD MODELS ARE HAPPY WITH 100K INTERACTIONS + +Jan Robine, Marc Höftmann, Tobias Uelwer, Stefan Harmeling + +Department of Computer Science, Technical University of Dortmund, Germany + +# ABSTRACT + +Deep neural networks have been successful in many reinforcement learning settings. However, compared to human learners they are overly data hungry. To build a sample-efficient world model, we apply a transformer to real-world episodes in an autoregressive manner: not only the compact latent states and the taken actions but also the experienced or predicted rewards are fed into the transformer, so that it can attend flexibly to all three modalities at different time steps. The transformer allows our world model to access previous states directly, instead of viewing them through a compressed recurrent state. By utilizing the Transformer-XL architecture, it is able to learn long-term dependencies while staying computationally efficient. Our transformer-based world model (TWM) generates meaningful, new experience, which is used to train a policy that outperforms previous model-free and model-based reinforcement learning algorithms on the Atari 100k benchmark. Our code is available at https://github.com/jrobine/twm. + +# 1 INTRODUCTION + +Deep reinforcement learning methods have shown great success on many challenging decision making problems. Notable methods include DQN (Mnih et al., 2015), PPO (Schulman et al., 2017), and MuZero (Schrittwieser et al., 2019). However, most algorithms require hundreds of millions of interactions with the environment, whereas humans often can achieve similar results with less than $1\%$ of these interactions, i.e., they are more sample-efficient. The large amount of data that is necessary renders a lot of potential real world applications of reinforcement learning impossible. + +Recent works have made a lot of progress in advancing the sample efficiency of RL algorithms: model-free methods have been improved with auxiliary objectives (Laskin et al., 2020b), data augmentation (Yarats et al., 2021, Laskin et al., 2020a), or both (Schwarzer et al., 2021). Model-based methods have been successfully applied to complex image-based environments and have either been used for planning, such as EfficientZero (Ye et al., 2021), or for learning behaviors in imagination, such as SimPLe (Kaiser et al., 2020). + +![](images/50c5d9d90f75ed27383be188749dcc3508b7b8094196593cbb5d07433367c5cd.jpg) +Figure 1: Our world model architecture. Observations $o_{t - \ell :t}$ are encoded using a CNN. Linear embeddings of stochastic, discrete latent states $z_{t - \ell :t}$ , actions $a_{t - \ell :t}$ , and rewards $r_{t - \ell :t}$ are fed into a transformer, which computes a deterministic hidden state $h_t$ at each time step. Predictions of the reward $r_t$ , discount factor $\gamma_t$ , and next latent state $z_{t + 1}$ are computed based on $h_t$ using MLPs. + +A promising model-based concept is learning in imagination (Ha & Schmidhuber, 2018; Kaiser et al., 2020; Hafner et al., 2020; Hafner et al., 2021): instead of learning behaviors from the collected experience directly, a generative model of the environment dynamics is learned in a (self-)supervised manner. Such a so-called world model can create new trajectories by iteratively predicting the next state and reward. This allows for potentially indefinite training data for the reinforcement learning algorithm without further interaction with the real environment. A world model might be able to generalize to new, unseen situations, because of the nature of deep neural networks, which has the potential to drastically increase the sample efficiency. This can be illustrated by a simple example: in the game of Pong, the paddles and the ball move independently. In the best case, a successfully trained world model would imagine trajectories with paddle and ball configurations that have never been observed before, which enables learning of improved behaviors. + +In this paper, we propose to model the world with transformers (Vaswani et al., 2017), which have significantly advanced the field of natural language processing and have been successfully applied to computer vision tasks (Dosovitskiy et al., 2021). A transformer is a sequence model consisting of multiple self-attention layers with residual connections. In each self-attention layer the inputs are mapped to keys, queries, and values. The outputs are computed by weighting the values by the similarity of keys and queries. Combined with causal masking, which prevents the self-attention layers from accessing future time steps in the training sequence, transformers can be used as autoregressive generative models. The Transformer-XL architecture (Dai et al., 2019) is much more computationally efficient than vanilla transformers at inference time and introduces relative positional encodings, which remove the dependence on absolute time steps. + +Our contributions: The contributions of this work can be summarized as follows: + +1. We present a new autoregressive world model based on the Transformer-XL (Dai et al., 2019) architecture and a model-free agent trained in latent imagination. Running our policy is computationally efficient, as the transformer is not needed at inference time. This is in contrast to related works (Hafner et al., 2020; 2021; Chen et al., 2022) that require the full world model during inference. +2. Our world model is provided with information on how much reward has already been emitted by feeding back predicted rewards into the world model. As shown in our ablation study, this improves performance. +3. We rewrite the balanced KL divergence loss of Hafner et al. (2021) to allow us to fine-tune the relative weight of the involved entropy and cross-entropy terms. +4. We introduce a new thresholded entropy loss that stabilizes the policy's entropy during training and hereby simplifies the selection of hyperparameters that behave well across different games. +5. We propose a new effective sampling procedure for the growing dataset of experience, which balances the training distribution to shift the focus towards the latest experience. We demonstrate the efficacy of this procedure with an ablation study. +6. We compare our transformer-based world model (TWM) on the Atari 100k benchmark with recent sample-efficient methods and obtain excellent results. Moreover, we report empirical confidence intervals of the aggregate metrics as suggested by Agarwal et al. (2021). + +# 2 METHOD + +We consider a partially observable Markov decision process (POMDP) with discrete time steps $t \in \mathbb{N}$ , scalar rewards $r_t \in \mathbb{R}$ , high-dimensional image observations $o_t \in \mathbb{R}^{h \times w \times c}$ , and discrete actions $a_t \in \{1, \dots, m\}$ , which are generated by some policy $a_t \sim \pi(a_t | o_{1:t}, a_{1:t-1})$ , where $o_{1:t}$ and $a_{1:t-1}$ denote the sequences of observations and actions up to time steps $t$ and $t-1$ , respectively. Episode ends are indicated by a boolean variable $d_t \in \{0, 1\}$ . Observations, rewards, and episode ends are jointly generated by the unknown environment dynamics $o_t, r_t, d_t \sim p(o_t, r_t, d_t | o_{1:t-1}, a_{1:t-1})$ . The goal is to find a policy $\pi$ that maximizes the expected sum of discounted rewards $\mathbb{E}_{\pi}[\sum_{t=1}^{\infty} \gamma^{t-1} r_t]$ , where $\gamma \in [0, 1)$ is the discount factor. Learning in imagination consists of three steps that are repeated iteratively: learning the dynamics, learning a policy, and interacting in the real environment. In this section, we describe our world model and policy, concluding with the training procedure. + +# 2.1 WORLD MODEL + +Our world model consists of an observation model and a dynamics model, which do not share parameters. Figure 1 illustrates our combined world model architecture. + +Observation Model: The observation model is a variational autoencoder (Kingma & Welling, 2014), which encodes observations $o_{t}$ into compact, stochastic latent states $z_{t}$ and reconstructs the observations with a decoder, which in our case is only required to obtain a learning signal for $z_{t}$ : + +Observation encoder: $z_{t} \sim p_{\phi}(z_{t} \mid o_{t})$ +Observation decoder: $\hat{o}_t\sim p_\phi (\hat{o}_t\mid z_t)$ + +(1) + +We adopt the neural network architecture of DreamerV2 (Hafner et al., 2021) with slight modifications for our observation model. Thus, a latent state $z_{t}$ is discrete and consists of a vector of 32 categorical variables with 32 categories. The observation decoder reconstructs the observation and predicts the means of independent standard normal distributions for all pixels. The role of the observation model is to capture only non-temporal information about the current time step, which is different from Hafner et al. (2021). However, we include short-time temporal information, since a single observation $o_{t}$ consists of four frames (aka frame stacking, see also Section 2.2). + +Autoregressive Dynamics Model: The dynamics model predicts the next time step conditioned on the history of its past predictions. The backbone is a deterministic aggregation model $f_{\psi}$ which computes a deterministic hidden state $h_t$ based on the history of the $\ell$ previously generated latent states, actions, and rewards. Predictors for the reward, discount, and next latent state are conditioned on the hidden state. The dynamics model consists of these components: + +Aggregation model: $h_t = f_{\psi}(z_{t - \ell :t},a_{t - \ell :t},r_{t - \ell :t - 1})$ + +Reward predictor: $\hat{r}_t\sim p_\psi (\hat{r}_t|h_t)$ + +Discount predictor: $\hat{\gamma}_t\sim p_\psi (\hat{\gamma}_t|h_t)$ + +Latent state predictor: $\hat{z}_{t + 1}\sim p_{\psi}(\hat{z}_{t + 1}\mid h_t)$ + +(2) + +The aggregation model is implemented as a causally masked Transformer-XL (Dai et al., 2019), which enhances vanilla transformers (Vaswani et al., 2017) with a recurrence mechanism and relative positional encodings. With these encodings, our world model learns the dynamics independent of absolute time steps. Following Chen et al. (2021), the latent states, actions, and rewards are sent into modality-specific linear embeddings before being passed to the transformer. The number of input tokens is $3\ell - 1$ , because of the three modalities (latent states, actions, rewards) and the last reward not being part of the input. We consider the outputs of the action modality as the hidden states and disregard the outputs of the other two modalities (see Figure 1; orange boxes vs. gray boxes). + +The latent state, reward, and discount predictors are implemented as multilayer perceptrons (MLPs) and compute the parameters of a vector of independent categorical distributions, a normal distribution, and a Bernoulli distribution, respectively, conditioned on the deterministic hidden state. The next state is determined by sampling from $p_{\psi}(\hat{z}_{t + 1} \mid h_t)$ . The reward and discount are determined by the mean of $p_{\psi}(\hat{r}_t \mid h_t)$ and $p_{\psi}(\hat{\gamma}_t \mid h_t)$ , respectively. + +As a consequence of these design choices, our world model has the following beneficial properties: + +1. The dynamics model is autoregressive and has direct access to its previous outputs. +2. Training is efficient since sequences are processed in parallel (compared with RNNs). +3. Inference is efficient because outputs are cached (compared with vanilla Transformers). +4. Long-term dependencies can be captured by the recurrence mechanism. + +We want to provide an intuition on why a fully autoregressive dynamics model is favorable: First, the direct access to previous latent states enables to model more complex dependencies between them, compared with RNNs, which only see them indirectly through a compressed recurrent state. This also has the potential to make inference more robust, since degenerate predictions can be ignored more easily. Second, because the model sees which rewards it has produced previously, it can react to its own predictions. This is even more significant when the rewards are sampled from a probability distribution, since the introduced noise cannot be observed without autoregression. + +Loss Functions: The observation model can be interpreted as a variational autoencoder with a temporal prior, which is provided by the latent state predictor. The goal is to keep the distributions of the encoder and the latent state predictor close to each other, while slowly adapting to new observations and dynamics. Hafner et al. (2021) apply a balanced KL divergence loss, which lets them control which of the two distributions should be penalized more. To control the influences of its subterms more precisely, we disentangle this loss and obtain a balanced cross-entropy loss that computes the cross-entropy $H(p_{\phi}(z_{t + 1} \mid o_{t + 1}), p_{\psi}(\hat{z}_{t + 1} \mid h_t))$ and the entropy $H(p_{\phi}(z_t \mid o_t))$ explicitly. Our derivation can be found in Appendix A.2. We call the cross-entropy term for the observation model the consistency loss, as its purpose is to prevent the encoder from diverging from the dynamics model. The entropy regularizes the latent states and prevents them from collapsing to one-hot distributions. The observation decoder is optimized via negative log-likelihood, which provides a rich learning signal for the latent states. In summary, we optimize a self-supervised loss function for the observation model that is the expected sum over the decoder loss, the entropy regularizer and the consistency loss + +$$ +\mathcal {L} _ {\phi} ^ {\text {O b s .}} = \mathbb {E} \left[ \sum_ {t = 1} ^ {T} - \underbrace {\ln p _ {\phi} \left(o _ {t} \mid z _ {t}\right)} _ {\text {d e c o d e r}} - \underbrace {\alpha_ {1} H \left(p _ {\phi} \left(z _ {t} \mid o _ {t}\right)\right)} _ {\text {e n t r o p y r e g u l a r i z e r}} + \underbrace {\alpha_ {2} H \left(p _ {\phi} \left(z _ {t} \mid o _ {t}\right) , p _ {\psi} \left(\hat {z} _ {t} \mid h _ {t - 1}\right)\right)} _ {\text {c o n s i s t e n c y}} \right], \tag {3} +$$ + +where the hyperparameters $\alpha_{1},\alpha_{2}\geq 0$ control the relative weights of the terms. + +For the balanced cross-entropy loss, we also minimize the cross-entropy in the loss of the dynamics model, which is how we train the latent state predictor. The reward and discount predictors are optimized via negative log-likelihood. This leads to a self-supervised loss for the dynamics model + +$$ +\mathcal {L} _ {\psi} ^ {\text {D y n .}} = \mathbb {E} \left[ \sum_ {t = 1} ^ {T} \underbrace {H \left(p _ {\phi} \left(z _ {t + 1} \mid o _ {t + 1}\right) , p _ {\psi} \left(\hat {z} _ {t + 1} \mid h _ {t}\right)\right)} _ {\text {l a s t e n t s t a t e p r e d i c t o r}} - \underbrace {\beta_ {1} \ln p _ {\psi} \left(r _ {t} \mid h _ {t}\right)} _ {\text {r e w a r d p r e d i c t o r}} - \underbrace {\beta_ {2} \ln p _ {\psi} \left(\gamma_ {t} \mid h _ {t}\right)} _ {\text {d i s c o u n t p r e d i c t o r}} \right], \tag {4} +$$ + +with coefficients $\beta_{1},\beta_{2}\geq 0$ and where $\gamma_{t} = 0$ for episode ends $(d_t = 1)$ and $\gamma_{t} = \gamma$ otherwise. + +# 2.2 POLICY + +Our policy $\pi_{\theta}(a_t\mid \hat{z}_t)$ is trained on imagined trajectories using a mainly standard advantage actor-critic (Mnih et al., 2016) approach. We train two separate networks: an actor $a_{t}\sim \pi_{\theta}(a_{t}\mid \hat{z}_{t})$ with parameters $\theta$ and a critic $v_{\xi}(\hat{z}_t)$ with parameters $\xi$ . We compute the advantages via Generalized Advantage Estimation (Schulman et al., 2016) while using the discount factors predicted by the world model $\hat{\gamma}_t$ instead of a fixed discount factor for all time steps. As in DreamerV2 (Hafner et al., 2021), we weight the losses of the actor and the critic by the cumulative product of the discount factors, in order to softly account for episode ends. + +Thresholded Entropy Loss: We penalize the objective of the actor with a slightly modified version of the usual entropy regularization term (Mnih et al., 2016). Our penalty normalizes the entropy and only takes effect when the entropy falls below a certain threshold + +$$ +\mathcal {L} _ {\theta} ^ {\text {E n t .}} = \max \left(0, \Gamma - \frac {H \left(\pi_ {\theta}\right)}{\ln (m)}\right), \tag {5} +$$ + +where $0 \leq \Gamma \leq 1$ is the threshold hyperparameter, $H(\pi_{\theta})$ is the entropy of the policy, $m$ is the number of discrete actions, and $\ln(m)$ is the maximum possible entropy of the categorical action distribution. By doing this, we explicitly control the percentage of entropy that should be preserved across all games independent of the number of actions. This ensures exploration in the real environment and in imagination without the need for $\epsilon$ -greedy action selection or changing the temperature of the action distribution. We also use the same stochastic policy when evaluating our agent in the experiments. The idea of applying a hinge loss to the entropy was first introduced by Pereyra et al. (2017) in the context of supervised learning. In Appendix A.1 we show the effect of this loss. + +Choice of Policy Input: The policy computes an action distribution $\pi_{\theta}(a_t \mid x_t)$ given some view $x_t$ of the state. For instance, $x_t$ could be $o_t$ , $z_t$ , or $[z_t, h_t]$ at inference time, i.e., when applied to the real environment, or the respective predictions of the world model $\hat{o}_t$ , $\hat{z}_t$ , or $[\hat{z}_t, h_t]$ at training time. This view has to be chosen carefully, since it can have a significant impact on the performance + +![](images/9177e38a3c37eeb48042bdfc81d5b1768164f426ae708de2bbd9f3615835575e.jpg) +Figure 2: Comparing our balanced dataset sampling procedure (see Equation (6)) for different values of $\tau$ with uniform sampling ( $\tau = \infty$ ). The x-axes correspond to the entries in dataset $\mathcal{D}$ in the order they are experienced. The left plot shows the number of times an entry has been selected for training the world model. The right plot shows the relative amount of training time that has been spent on the data up to that entry. E.g., with uniform sampling, $50\%$ of the training time is used for the first 19K entries, whereas for $\tau = 20$ approximately the same time is spend on both halves of the dataset. + +![](images/e2a6ff51cd47321f079d699232a30e0b6bfef8e7205493171d5a3c38abe82927.jpg) + +of the policy and it affects the design choices for the world model. Using $x_{t} = o_{t}$ (or $\hat{o}_t$ ) is relatively stable even with imperfect reconstructions $\hat{o}_t$ , as the underlying distribution of observations $p(o)$ does not change during training. However, it is also less computationally efficient, since it requires reconstructing the observations during imagination and additional convolutional layers for the policy. Using $x_{t} = z_{t}$ (or $\hat{z}_t$ ) is slightly less stable, as the policy has to adopt to the changes of the distributions $p_{\phi}(z_t \mid o_t)$ and $p_{\psi}(\hat{z}_{t+1} \mid h_t)$ during training. Nevertheless, the entropy regularizer and consistency loss in Equation (3) stabilize these distributions. Using $x_{t} = [z_{t}, h_{t}]$ (or $[\hat{z}_t, h_t]$ ) provides the agent with a summary of the history of experience, but it also adds the burden of running the transformer at inference time. Model-free agents already perform well on most Atari games when using a stack of the most recent frames (e.g., Mnih et al. 2015; Schulman et al. 2017). Therefore, we choose $x_{t} = z_{t}$ and apply frame stacking at inference time in order to incorporate short-time information directly into the latent states. At training time we use $x_{t} = \hat{z}_{t}$ , i.e., the predicted latent states, meaning no frame stacking is applied. As a consequence, our policy is computationally efficient at training time (no reconstructions during imagination) and at inference time (no transformer when running in the real environment). + +# 2.3 TRAINING + +As is usual for learning with world models, we repeatedly (i) collect experience in the real environment with the current policy, (ii) improve the world model using the past experience, (iii) improve the policy using new experience generated by the world model. + +During training we build a dataset $\mathcal{D} = [(o_1, a_1, r_1, d_1), \ldots, (o_T, a_T, r_T, d_T)]$ of the collected experience. After collecting new experience with the current policy, we improve the world model by sampling $N$ sequences of length $\ell$ from $\mathcal{D}$ and optimizing the loss functions in Equations (3) and (4) using stochastic gradient descent. After performing a world model update, we select $M$ of the $N \times \ell$ observations and encode them into latent states to serve as initial states for new trajectories. The dynamics model iteratively generates these $M$ trajectories of length $H$ based on actions provided by the policy. Subsequently, the policy is improved with standard model-free objectives, as described in Section 2.2. In Algorithm 1 we present pseudocode for training the world model and the policy. + +Balanced Dataset Sampling: Since the dataset grows slowly during training, uniform sampling of trajectories focuses too heavily on early experience, which can lead to overfitting especially in the low data regime. Therefore, we keep visitation counts $v_{1}, \ldots, v_{T}$ , which are incremented every time an entry is sampled as start of a sequence. These counts are converted to probabilities using the softmax function + +$$ +(p _ {1}, \dots , p _ {T}) = \operatorname {s o f t m a x} \left(- \frac {v _ {1}}{\tau}, \dots , - \frac {v _ {T}}{\tau}\right), \tag {6} +$$ + +where $\tau > 0$ is a temperature hyperparameter. With our sampling procedure, new entries in the dataset are oversampled and are selected more often than old ones. Setting $\tau = \infty$ restores uniform sampling as a special case, whereas reducing $\tau$ increases the amount of oversampling. See Figure 2 for a comparison. We empirically show the effectiveness in Section 3.3. + +![](images/20bf30be709dbc415a3189f0209f8cda26eaf551cd58154e386be8bf32b32c06.jpg) +Figure 3: Aggregate metrics on the Atari 100k benchmark with $95\%$ stratified bootstrap confidence intervals (Agarwal et al., 2021). Higher median, interquartile mean (IQM), and mean, but lower optimality gap indicate better performance. Scores for previous methods are from Agarwal et al. (2021) with 100 runs per game (except SimPLe with 5 runs). We evaluate 5 runs per game, leading to wider confidence intervals. + +# 3 EXPERIMENTS + +To compare data-efficient reinforcement learning algorithms, Kaiser et al. (2020) proposed the Atari 100k benchmark, which uses a subset of 26 Atari games from the Arcade Learning Environment (Bellemare et al., 2013) and limits the number of interactions per game to 100K. This corresponds to 400K frames (because of frame skipping) or roughly 2 hours of gameplay, which is 500 times less than the usual 200 million frames (e.g., Mnih et al. 2015; Schulman et al. 2017; Hafner et al. 2021). + +We compare our method with five strong competitors on the Atari 100k benchmark: (i) SimPLe (Kaiser et al., 2020) implements a world model as an action-conditional video prediction model and trains a policy with PPO (Schulman et al., 2017), (ii) DER (van Hasselt et al., 2019) is a variant of Rainbow (Hessel et al., 2018) fine-tuned for sample efficiency, (iii) CURL (Laskin et al., 2020b) improves representations using contrastive learning as an auxiliary task and is combined with DER, (iv) DrQ (Yarats et al., 2021) improves DQN by averaging Q-value estimates over multiple data augmentations of observations, and (v) SPR (Schwarzer et al., 2021) forces representations to be consistent across multiple time steps and data augmentations by extending Rainbow with a self-supervised consistency loss. + +# 3.1 RESULTS + +We follow the advice of Agarwal et al. (2021) who found significant discrepancies between reported point estimates of mean (and median) scores and a thorough statistical analysis that includes statistical uncertainty. Thus, we report confidence interval estimates of the aggregate metrics median, interquartile mean (IQM), mean, and optimality gap in Figure 3 and performance profiles in Figure 4, which we created using the toolbox provided by Agarwal et al. (2021). The metrics are computed on human normalized scores, which are calculated as (score_agent-score_random)/(score_human-score_random). We report the unnormalized scores per game in Table 1. We compare with new scores for DER, CURL, DrQ, and SPR that were evaluated on 100 runs and provided by Agarwal et al. (2021). They report scores for the improved $\mathrm{DrQ}(\varepsilon)$ , which is DrQ evaluated with stan + +dard $\varepsilon$ -greedy parameters. We perform 5 runs per game and compute the average score over 100 episodes at the end of training for each run. TWM shows a significant improvement over previous approaches in all four aggregate metrics and brings the optimality gap closer to zero. + +![](images/a57816046688b622c539f8dd1226a435f5433de54b6daa21c1d54096e7577ab0.jpg) +Figure 4: Performance profiles on the Atari 100k benchmark based on score distributions (Agarwal et al., 2021). It shows the fraction of runs across all games (y-axis) above a human normalized score (x-axis). Shaded regions show pointwise $95\%$ confidence bands. + +Table 1: Mean scores on the Atari 100k benchmark per game as well as the aggregated human normalized mean and median. We perform 5 runs per game and compute the average over 100 episodes at the end of training for each run. Bold numbers indicate the best scores. + +
GameRandomHumanModel-freeImagination
DERCURLDrQ(ε)SPRSimPLeTWM (ours)
Alien227.87127.7802.3711.0865.2841.9616.9674.6
Amidar5.81719.5125.9113.7137.8179.774.3121.8
Assault222.4742.0561.5500.9579.6565.6527.2682.6
Asterix210.08503.3535.4567.2763.6962.51128.31116.6
BankHeist14.2753.1185.565.3232.9345.434.2466.7
BattleZone2360.037187.58977.08997.810165.314834.14031.25068.0
Boxing0.112.1-0.30.99.035.77.877.5
Breakout1.730.59.22.619.819.616.420.0
ChopperCommand811.07387.8925.9783.5844.6946.3979.41697.4
CrazyClimber10780.535829.434508.69154.421539.036700.562583.671820.4
DemonAttack152.11971.0627.6646.51321.5517.6208.1350.2
Freeway0.029.620.928.320.319.316.724.3
Frostbite65.24334.7871.01226.51014.21170.7236.91475.6
Gopher257.62412.5467.0400.9621.6660.6596.81674.8
Hero1027.030826.46226.04987.74167.95858.62656.67254.0
Jamesbond29.0302.8275.7331.0349.1366.5100.5362.4
Kangaroo52.03035.0581.7740.21088.43617.451.21240.0
Krull1598.02665.53256.93049.24402.13681.62204.86349.2
KungFuMaster258.522736.36580.18155.611467.414783.214862.524554.6
MsPacman307.36951.61187.41064.01218.11318.41480.01588.4
Pong-20.714.6-9.7-18.5-9.1-5.412.818.8
PrivateEye24.969571.372.881.93.586.035.086.6
Qbert163.913455.01773.5727.01810.7866.31288.83330.8
RoadRunner11.57845.011843.45006.111211.412213.15640.69109.0
Seaquest68.442054.7304.6315.2352.3558.1683.3774.4
UpNDown533.411693.23075.02646.44324.510859.23350.315981.7
Normalized Mean0.0001.0000.3500.2610.4650.6160.3320.956
Normalized Median0.0001.0000.1890.0920.3130.3960.1340.505
+ +![](images/0d70fbed362082bef5e3842b34e2602a8765b9f1fa44895ce216d1c2e90497b2.jpg) +(a) Boxing. The player (white) presses fire, hits the opponent, and gets a reward. + +![](images/068887b4ea957402c8287413fc2bb5ca7399dbd3f924b87e011d8657ee0f5fec.jpg) +(b) Freeway. The player moves up and bumps into a car. The world model correctly pushes the player down, although $up$ is still pressed. The movement of the cars is modeled correctly. +Figure 5: Trajectories imagined by our world model. Above each frame we show the performed action and the produced reward. + +# 3.2 ANALYSIS + +In Figure 5 we show imagined trajectories of our world model. In Figure 6 we visualize an attention map of the transformer for an imagined sequence. In this example a lot of weight is put on the current action and the last three states. However, the transformer also attends to states and rewards in the past, with only past actions being mostly ignored. The two high positive rewards also get high attention, which confirms that the rewards in the input sequence are used by the world model. We hypothesize that these rewards correspond to some events that happened in the environment and this information can be useful for prediction. + +An extended analysis can be found in Appendix A.1, including more imagined trajectories and attention maps (and a description of the generation of the plots), sample efficiency, stochasticity of the world model, long sequence imagination, and frame stacking. + +![](images/a46700de4e3e6e7a087acb377f6e607307d20f43572a3e719bee0b28b45a1edd.jpg) +Figure 6: Attention map of the learned transformer for the current hidden state $h$ , computed on an imagined trajectory for the game Assault. The x-axis corresponds to the input sequence with the three modalities (states, actions, rewards), where the two rightmost columns are the current state and action. The y-axis corresponds to the layer of the transformer. + +![](images/5d1477d78d42034287f6c1678a5cb9796704e3e035dbe649aa5ae7e0fa326166.jpg) +Figure 7: Comparison of the proposed balanced sampling procedure with uniform sampling on a random subset of games. We show the development of the human normalized score in the course of training. The score is higher with balanced sampling, demonstrating its importance. + +![](images/ee010387306f2a10b0a489f9ac249339b47f6c39380ed5398b44d281cbcc986b.jpg) + +![](images/a5fc50fba4ccaeb72143ec4b20aea6c24c6f490ace2cfd68970299d795efd4d3.jpg) + +![](images/d37b7fd9e8d1e26060d6cbe7345a4663371f8b4c07e3ef7849d500e3da66f733.jpg) + +# 3.3 ABLATION STUDIES + +Uniform Sampling: To show the effectiveness of the sampling procedure described in Section 2.3, we evaluate three games with uniform dataset sampling, which is equivalent to setting $\tau = \infty$ in Equation (6). In Figure 7 we show that balanced dataset sampling significantly improves the performance in these games. At the end of training, the dynamics loss from Equation (4) is lower when applying balanced sampling. One reason might be that the world model overfits on early training data and performs bad in later stages of training. + +No Rewards: As described in Section 2.1, the predicted rewards are fed back into the transformer. In Figure 8 we show on three games that this can significantly increase the performance. In some games the performance is equivalent, probably because the world model can make correct predictions solely based on the latent states and actions. + +In Appendix A.1 we perform additional ablation studies, including the thresholded entropy loss, a shorter history length, conditioning the policy on $[z,h]$ , and increasing the sample efficiency. + +![](images/e71da627f09a681fd9585a4ff9e9b20a11f361b2984c95d44c558edfd2c1aa46.jpg) + +![](images/6d56372fd4bc9e925b22cd81de30b5a826874ae5acd53df00151965e24196b3e.jpg) + +![](images/79afc6da66445ca4117f2229426fafcc49eddd83fe2fbf8e53f2b767790d15b3.jpg) + +![](images/9078109af241cfb6ca47385898009bf9711b75815dcc2fb5451f15405e8739a1.jpg) + +![](images/6eb52366e8ec2f3aa29c90fcb551546a631dde5ee0a3f820d0edf752e039815e.jpg) +Figure 8: Effect of removing rewards from the input. We show the human normalized score during training of a random subset of games. Conditioning on rewards can significantly increase the performance. Some games do not benefit from the rewards and the score stays roughly the same. + +![](images/f212e7b13bfcebf27f32a964bd3d965031216e1a31e0b213b96a18295fe5fe33.jpg) + +![](images/031c572fa5cb69ecde187edc0cd7e1f4656374e3f96767734b84344bdf1d1f58.jpg) + +![](images/9962be0faf719a72942999ea8942a202a6c932e00b046e884a1e3994a26371bd.jpg) + +# 4 RELATED WORK + +The Dyna architecture (Sutton, 1991) introduced the idea of training a model of the environment and using it to further improve the value function or the policy. Ha & Schmidhuber (2018) introduced the notion of a world model, which tries to completely imitate the environment and is used to generate experience to train a model-free agent. They implement a world model as a VAE (Kingma & Welling, 2014) and an RNN and learn a policy in latent space with an evolution strategy. With SimPLe, Kaiser et al. (2020) propose an iterative training procedure that alternates between training the world model and the policy. Their policy operates on pixel-level and is trained using PPO (Schulman et al., 2017). Hafner et al. (2020) present Dreamer and implement a world model as a stochastic RNN that splits the latent state in a stochastic part and a deterministic part; this idea was first introduced by Hafner et al., 2019. This allows their world model to capture the stochasticity of the environment and simultaneously facilitates remembering information over multiple time steps. Robine et al. (2020) use a VQ-VAE to construct a world model with drastically lower number of parameters. DreamerV2 (Hafner et al., 2021) achieves great performance on the Atari 50M benchmark after making some changes to Dreamer, the most important ones being categorical latent variables and an improved objective. + +Another direction of model-based reinforcement learning is planning, where the model is used at inference time to improve the action selection by looking ahead several time steps into the future. The most prominent work is MuZero (Schrittwieser et al., 2019), where a learned sequence model of rewards and values is combined with Monte-Carlo Tree Search (Coulom, 2006) without learning explicit representations of the observations. MuZero achieves impressive performance on the Atari 50M benchmark, but it is also computationally expensive and requires significant engineering effort. EfficientZero (Ye et al., 2021) improves MuZero and achieves great performance on the Atari 100k benchmark. + +Transformers (Vaswani et al., 2017) advanced the effectiveness of sequence models in multiple domains, such as natural language processing and computer vision (Dosovitskiy et al., 2021). Recently, they have also been applied to reinforcement learning tasks. The Decision Transformer (Chen et al., 2021) and the Trajectory Transformer (Janner et al., 2021) are trained on an offline dataset of trajectories. The Decision Transformer is conditioned on states, actions, and returns, and outputs optimal actions. The Trajectory Transformer trains a sequence model of states, actions, and rewards, and is used for planning. Chen et al. (2022) replace the RNN of Dreamer with a transformer and outperform Dreamer on Hidden Order Discovery tasks. However, their transformer has no access to previous rewards and they do not evaluate their method on the Atari 100k benchmark. Moreover, their policy depends on the outputs of the transformer, leading to higher computational costs during inference time. Concurrent to and independent from our work, Micheli et al. (2022) apply a transformer to sequences of frame tokens and actions and achieve state-of-the-art results on the Atari 100k benchmark. + +# 5 CONCLUSION + +In this work, we discuss a reinforcement learning approach using transformer-based world models. Our method (TWM) outperforms previous model-free and model-based methods in terms of human normalized score on the 26 games of the Atari 100k benchmark. By using the transformer only during training, we were able to keep the computational costs low during inference, i.e., when running the learned policy in a real environment. We show how feeding back the predicted rewards into the transformer is beneficial for learning the world model. Furthermore, we introduce the balanced cross-entropy loss for finer control over the trade-off between the entropy and cross-entropy terms in the loss functions of the world model. A new thresholded entropy loss effectively stabilizes the entropy of the policy. Finally, our novel balanced sampling procedure corrects issues of naive uniform sampling of past experience. + +# REFERENCES + +Samira Abnar and Willem H. Zuidema. Quantifying attention flow in transformers. In Dan Jurafsky, Joyce Chai, Natalie Schluter, and Joel R. Tetreault (eds.), Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, ACL 2020, Online, July 5-10, 2020, pp. + +4190-4197. Association for Computational Linguistics, 2020. doi: 10.18653/v1/2020.acl-main.385. URL https://doi.org/10.18653/v1/2020.acl-main.385. +Rishabh Agarwal, Max Schwarzer, Pablo Samuel Castro, Aaron C. Courville, and Marc G. Bellemare. Deep reinforcement learning at the edge of the statistical precipice. In Marc'Aurelio Ranzato, Alina Beygelzimer, Yann N. Dauphin, Percy Liang, and Jennifer Wortman Vaughan (eds.), Advances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual, pp. 29304-29320, 2021. URL https://proceedings.neurips.cc/paper/2021/ hash/f514cec81cb148559cf475e7426eed5e-AAbstract.html. +Marc G. Bellemare, Yavar Naddaf, Joel Veness, and Michael Bowling. The arcade learning environment: An evaluation platform for general agents. J. Artif. Intell. Res., 47:253-279, 2013. doi: 10.1613/jair.3912. URL https://doi.org/10.1613/jair.3912. +Chang Chen, Yi-Fu Wu, Jaesik Yoon, and Sungjin Ahn. Transdreamer: Reinforcement learning with transformer world models. CoRR, abs/2202.09481, 2022. URL https://arxiv.org/abs/2202.09481. +Lili Chen, Kevin Lu, Aravind Rajeswaran, Kimin Lee, Aditya Grover, Michael Laskin, Pieter Abbeel, Aravind Srinivas, and Igor Mordatch. Decision transformer: Reinforcement learning via sequence modeling. In Marc'Aurelio Ranzato, Alina Beygelzimer, Yann N. Dauphin, Percy Liang, and Jennifer Wortman Vaughan (eds.), Advances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual, pp. 15084-15097, 2021. URL https://proceedings.neurips.cc/paper/2021/ hash/7f489f642a0ddb10272b5c31057f0663-Abstract.html. +Rémi Coulom. Efficient selectivity and backup operators in monte-carlo tree search. In H. Jaap van den Herik, Paolo Ciancarini, and H. H. L. M. Donkers (eds.), Computers and Games, 5th International Conference, CG 2006, Turin, Italy, May 29-31, 2006. Revised Papers, volume 4630 of Lecture Notes in Computer Science, pp. 72-83. Springer, 2006. doi: 10.1007/978-3-540-75538-8_7. URL https://doi.org/10.1007/978-3-540-75538-8_7. +Zihang Dai, Zhilin Yang, Yiming Yang, Jaime G. Carbonell, Quoc Viet Le, and Ruslan Salakhutdinov. Transformer-xl: Attentive language models beyond a fixed-length context. In Anna Korhonen, David R. Traum, and Lluís Marquez (eds.), Proceedings of the 57th Conference of the Association for Computational Linguistics, ACL 2019, Florence, Italy, July 28- August 2, 2019, Volume 1: Long Papers, pp. 2978-2988. Association for Computational Linguistics, 2019. doi: 10.18653/v1/p19-1285. URL https://doi.org/10.18653/v1/p19-1285. +Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL https://openreview.net/forum?id=YicbFdNTTy. +Stefan Elfwing, Eiji Uchibe, and Kenji Doya. Sigmoid-weighted linear units for neural network function approximation in reinforcement learning. Neural Networks, 107:3-11, 2018. doi: 10.1016/j.neunet.2017.12.012. URL https://doi.org/10.1016/j.neunet.2017.12.012. +David Ha and Jürgen Schmidhuber. Recurrent world models facilitate policy evolution. In Samy Bengio, Hanna M. Wallach, Hugo Larochelle, Kristen Grauman, Nicolò Cesa-Bianchi, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montréal, Canada, pp. 2455-2467, 2018. URL https://proceedings.neurips.cc/paper/2018/hash/2de5d16682c3c35007e4e92982f1a2ba-Abstract.html. +Danijar Hafner, Timothy P. Lillicrap, Ian Fischer, Ruben Villegas, David Ha, Honglak Lee, and James Davidson. Learning latent dynamics for planning from pixels. In Kamalika Chaudhuri + +and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, volume 97 of Proceedings of Machine Learning Research, pp. 2555-2565. PMLR, 2019. URL http://proceedings.mlr.press/v97/hafner19a.html. +Danijar Hafner, Timothy P. Lillicrap, Jimmy Ba, and Mohammad Norouzi. Dream to control: Learning behaviors by latent imagination. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. URL https://openreview.net/forum?id=S11OTC4tDS. +Danijar Hafner, Timothy P. Lillicrap, Mohammad Norouzi, and Jimmy Ba. Mastering atari with discrete world models. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL https://openreview.net/forum?id=0oabwyZbOu. +Matteo Hessel, Joseph Modayil, Hado van Hasselt, Tom Schaul, Georg Ostrovski, Will Dabney, Dan Horgan, Bilal Piot, Mohammad Gheshlaghi Azar, and David Silver. Rainbow: Combining improvements in deep reinforcement learning. In Sheila A. McIlraith and Kilian Q. Weinberger (eds.), Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence, (AAAI-18), the 30th innovative Applications of Artificial Intelligence (IAAI-18), and the 8th AAAI Symposium on Educational Advances in Artificial Intelligence (EAAI-18), New Orleans, Louisiana, USA, February 2-7, 2018, pp. 3215-3222. AAAI Press, 2018. URL https://www.aaai.org/ocs/index.php/AAAI/AAAI18/paper/view/17204. +Michael Janner, Qiyang Li, and Sergey Levine. Offline reinforcement learning as one big sequence modeling problem. In Marc'Aurelio Ranzato, Alina Beygelzimer, Yann N. Dauphin, Percy Liang, and Jennifer Wortman Vaughan (eds.), Advances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual, pp. 1273-1286, 2021. URL https://proceedings.neurips.cc/paper/2021/hash/099fe6b0b444c23836c4a5d07346082b-Abstract.html. +Lukasz Kaiser, Mohammad Babaeizadeh, Piotr Milos, Blazej Osinski, Roy H. Campbell, Konrad Czechowski, Dumitru Erhan, Chelsea Finn, Piotr Kozakowski, Sergey Levine, Afroz Mohiuddin, Ryan Sepassi, George Tucker, and Henryk Michalewski. Model based reinforcement learning for atari. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. URL https://openreview.net/forum?id=S1xCPJHtDB. +Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In Yoshua Bengio and Yann LeCun (eds.), 2nd International Conference on Learning Representations, ICLR 2014, Banff, AB, Canada, April 14-16, 2014, Conference Track Proceedings, 2014. URL http://arxiv.org/abs/1312.6114. +Michael Laskin, Kimin Lee, Adam Stooke, Lerrel Pinto, Pieter Abbeel, and Aravind Srinivas. Reinforcement learning with augmented data. In Hugo Larochelle, Marc'Aurelio Ranzato, Raia Hadsell, Maria-Florina Balcan, and Hsuan-Tien Lin (eds.), Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020a. URL https://proceedings.neurips.cc/paper/2020/hash/e615c82aba461681ade82da2da38004a-AAbstract.html. +Michael Laskin, Aravind Srinivas, and Pieter Abbeel. CURL: contrastive unsupervised representations for reinforcement learning. In Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18 July 2020, Virtual Event, volume 119 of Proceedings of Machine Learning Research, pp. 5639-5650. PMLR, 2020b. URL http://proceedings.mlr.press/v119/laskin20a.html. +Vincent Micheli, Eloi Alonso, and François Fleuret. Transformers are sample efficient world models. CoRR, abs/2209.00588, 2022. doi: 10.48550/arXiv.2209.00588. URL https://doi.org/10.48550/arXiv.2209.00588. +Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A. Rusu, Joel Veness, Marc G. Bellemare, Alex Graves, Martin A. Riedmiller, Andreas Fidjeland, Georg Ostrovski, Stig Petersen, + +Charles Beattie, Amir Sadik, Ioannis Antonoglou, Helen King, Dharshan Kumaran, Daan Wierstra, Shane Legg, and Demis Hassabis. Human-level control through deep reinforcement learning. Nat., 518(7540):529-533, 2015. doi: 10.1038/nature14236. URL https://doi.org/10.1038/nature14236. +Volodymyr Mnih, Adrià Puigdomènech Badia, Mehdi Mirza, Alex Graves, Timothy P. Lillicrap, Tim Harley, David Silver, and Koray Kavukcuoglu. Asynchronous methods for deep reinforcement learning. In Maria-Florina Balcan and Kilian Q. Weinberger (eds.), Proceedings of the 33nd International Conference on Machine Learning, ICML 2016, New York City, NY, USA, June 19-24, 2016, volume 48 of JMLR Workshop and Conference Proceedings, pp. 1928-1937. JMLR.org, 2016. URL http://proceedings.mlr.press/v48/mniha16.html. +Gabriel Pereyra, George Tucker, Jan Chorowski, Lukasz Kaiser, and Geoffrey E. Hinton. Regularizing neural networks by penalizing confident output distributions. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Workshop Track Proceedings. OpenReview.net, 2017. URL https://openreview.net/forum?id=HyhbYrGYe. +Jan Robine, Tobias Uelwer, and Stefan Harmeling. Smaller world models for reinforcement learning. CoRR, abs/2010.05767, 2020. URL https://arxiv.org/abs/2010.05767. +Julian Schrittwieser, Ioannis Antonoglou, Thomas Hubert, Karen Simonyan, Laurent Sifre, Simon Schmitt, Arthur Guez, Edward Lockhart, Demis Hassabis, Thore Graepel, Timothy P. Lillicrap, and David Silver. Mastering atari, go, chess and shogi by planning with a learned model. CoRR, abs/1911.08265, 2019. URL http://arxiv.org/abs/1911.08265. +John Schulman, Philipp Moritz, Sergey Levine, Michael I. Jordan, and Pieter Abbeel. High-dimensional continuous control using generalized advantage estimation. In Yoshua Bengio and Yann LeCun (eds.), 4th International Conference on Learning Representations, ICLR 2016, San Juan, Puerto Rico, May 2-4, 2016, Conference Track Proceedings, 2016. URL http://arxiv.org/abs/1506.02438. +John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. CoRR, abs/1707.06347, 2017. URL http://arxiv.org/abs/1707.06347. +Max Schwarzer, Ankesh Anand, Rishab Goel, R. Devon Hjelm, Aaron C. Courville, and Philip Bachman. Data-efficient reinforcement learning with self-predictive representations. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL https://openreview.net/forum?id=uCQfPZwRaUu. +Richard S. Sutton. Dyna, an integrated architecture for learning, planning, and reacting. SIGART Bull., 2(4):160-163, 1991. doi: 10.1145/122344.122377. URL https://doi.org/10.1145/122344.122377. +Hado van Hasselt, Matteo Hessel, and John Aslanides. When to use parametric models in reinforcement learning? In Hanna M. Wallach, Hugo Larochelle, Alina Beygelzimer, Florence d'Alché-Buc, Emily B. Fox, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pp. 14322-14333, 2019. URL https://proceedings.neurips.cc/paper/2019/ hash/1b742ae215cdf18b75449c6e272fd92d-Abstract.html. +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Isabelle Guyon, Ulrike von Luxburg, Samy Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vishwanathan, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pp. 5998-6008, 2017. URL https://proceedings.neurips.cc/paper/2017/bit/3f5ee243547dee91fbd053c1c4a845aa-Abstract.html. + +Denis Yarats, Ilya Kostrikov, and Rob Fergus. Image augmentation is all you need: Regularizing deep reinforcement learning from pixels. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL https://openreview.net/forum?id=GY6-6sTvGaf. +Weirui Ye, Shaohuai Liu, Thanard Kurutach, Pieter Abbeel, and Yang Gao. Mastering atari games with limited data. In Marc'Aurelio Ranzato, Alina Beygelzimer, Yann N. Dauphin, Percy Liang, and Jennifer Wortman Vaughan (eds.), Advances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual, pp. 25476-25488, 2021. URL https://proceedings.neurips.cc/paper/2021/hash/d5eca8dc3820cad9fe56a3bafda65cal-AAbstract.html. + +# A APPENDIX + +# A.1 EXTENDED EXPERIMENTS + +![](images/91baab62d8a08b9eee83a17c221c4bd64b5ee29c2781566b129d4ed8909cf1e5.jpg) +(a) Boxing. The player (white) presses fire, misses the opponent, gets no reward, and retreats. + +![](images/da3e606d5e808bdc9f29458ca4a4f29c5c7bb072d8c5cb8370ceb09e32fc0b4f.jpg) +(b) Freeway. The player moves up, steps back because of an approaching car, and continues to move up. + +![](images/b88f80b6c158fe9a43a5bee104fa2f7ce86475529c076f94ba83fb87f94a3b6c.jpg) +(c) Jamesbond. The player presses fire to fire a missile, and gets a reward when it hits. + +![](images/cede3a25e88664bed8f972ee9ba523991a4c30ceefa5892e90312d7accc80721.jpg) +(d) Gopher. The player (farmer) closes a hole created by the opponent (gopher). The gopher keeps moving independent from the selected actions, indicating that the world model has correctly learned the correlations between the player and the actions. Note that the gopher briefly disappears and reappears on the other side. +Figure 9: Additional example trajectories generated by our world model. + +# Additional Analysis: + +1. We provide more example trajectories in Figure 9. +2. We present more attention plots in Figures 10 and 11. All attention maps are generated using the attention rollout method by Abnar & Zuidema (2020). Note that we had to modify the method slightly, in order to take the causal masks into account. +3. Sample Efficiency: We provide the scores of our main experiments after different amounts of interactions with the environment in Table 2. After $50\mathrm{K}$ interactions, our method already has a higher mean normalized score than previous sample-efficient methods. Our mean normalized score is higher than DER, CURL, and SimPLe after $25\mathrm{K}$ interactions. This demonstrates the high sample efficiency of our approach. +4. Stochasticity: The stochastic prediction of the next state allows the world model to sample a variety of trajectories, even from the same starting state, as can be seen in Figure 12. +5. Long Sequence Imagination: The world model is trained using sequences of length $\ell = 16$ , however, it generalizes well to very long trajectories, as shown in Figure 13. +6. Frame Stacking: In Figure 14 we visualize the learned stacks of frames. This shows that the world model encodes and predicts the motion of objects. + +# Additional Ablation Studies: + +1. Thresholded Entropy Loss: In Figure 15 we compare (i) our thresholded entropy loss for the policy (see Section 2.2) with (ii) the usual entropy penalty. For (i) we use the same hyperparameters as in our main experiments, i.e., $\eta = 0.01$ and $\Gamma = 0.1$ . For (ii) we set $\eta = 0.001$ and $\Gamma = 1.0$ , which effectively disables the threshold. Without a threshold, the entropy is more likely to either collapse or diverge. When the threshold is used, the score is + +higher as well, probably because the entropy is in a more sensible range for the exploration-exploitation trade-off. This cannot be solved by adjusting the penalty coefficient $\eta$ alone, since it would increase or decrease the entropy in all games. + +2. History Length: We trained our world model with a shorter history and set $\ell = 4$ instead of $\ell = 16$ . This has a negative impact on the score, as can be seen in Figure 16, demonstrating that more time steps into the past are important. +3. Choice of Policy Input: In Section 2.2 we explained why the input to the policy is only the latent state, i.e., $x = z$ . In Figure 17 we show that using $x = [z,h]$ can result in lower final scores. We hypothesize that the policy network has a hard time keeping up with the changes of the space of $h$ during training and cannot ignore this additional information. +4. Increasing the Sample Efficiency: To find out whether we can further increase the sample efficiency shown in Table 2, we train a random subset of games again on $10\mathrm{K}$ , $25\mathrm{K}$ , and $50\mathrm{K}$ interactions with the full training budget that we used for the $100\mathrm{K}$ interactions. In Figure 18 we see that this can lead to significant improvements in some cases, which could mean that the policy benefits from more training on imagined trajectories, but can even lead to worse performance in other cases, which could possibly be caused by overfitting of the world model. When the performance stays the same even with longer training, this could mean that better exploration in the real environment is required to get further improvements. + +Table 2: Performance of our method at different stages of training compared with final scores of previous methods. We show individual game scores and mean human normalized scores. The normalized mean of our method is higher than SimPLe after only $25\mathrm{K}$ interactions, and higher than previous methods after $50\mathrm{K}$ interactions. + +
GameRandomHumanSimPLeSPRTWM (ours)
5K10K25K50K75K100K
Alien227.87127.7616.9841.9202.8383.2463.6532.0776.6674.6
Amidar5.81719.574.3179.73.835.454.9101.3103.0121.8
Assault222.4742.0527.2565.6241.5315.4418.7466.8627.8682.6
Asterix210.08503.31128.3962.5277.0297.0536.0912.0886.01116.6
BankHeist14.2753.134.2345.417.64.417.4125.2288.4466.7
BattleZone2360.037187.54031.214834.12640.03120.02700.03740.05260.05068.0
Boxing0.112.17.835.70.83.428.560.167.177.5
Breakout1.730.516.419.61.05.96.912.515.020.0
ChopperCommand811.07387.8979.4946.3928.01044.01358.01306.01438.01697.4
CrazyClimber10780.535829.462583.636700.57425.014773.239456.845916.067766.271820.4
DemonAttack152.11971.0208.1517.6174.7184.4216.8335.2391.4350.2
Freeway0.029.616.719.30.04.620.823.723.924.3
Frostbite65.24334.7236.91170.766.2204.6297.8247.61165.41475.6
Gopher257.62412.5596.8660.6345.2414.0593.21213.21549.21674.8
Hero1027.030826.42656.65858.6448.91552.64790.96302.79403.87254.0
Jamesbond29.0302.8100.5366.535.0117.0172.0215.0322.0362.4
Kangaroo52.03035.051.23617.428.092.0476.0724.0876.01240.0
Krull1598.02665.52204.83681.61763.62552.84234.04699.25848.06349.2
KungFuMaster258.522736.314862.514783.2574.016828.016368.017946.022936.024554.6
MsPacman307.36951.61480.01318.4245.9535.11077.51224.31287.61588.4
Pong-20.714.612.8-5.4-20.4-19.8-7.78.019.918.8
PrivateEye24.969571.335.086.061.080.080.03.288.886.6
Qbert163.913455.01288.8866.3151.0298.5703.51046.51788.53330.8
RoadRunner11.57845.05640.612213.124.01120.05178.07436.08034.09109.0
Seaquest68.442054.7683.3558.176.8221.2428.4572.0704.0774.4
UpNDown533.411693.23350.310859.2385.81963.02905.64922.810478.615981.7
Normalized Mean0.0001.0000.3320.6160.0070.1330.4080.6240.8320.956
+ +Wall-Clock Times: For each run, we give the agent a total training and evaluation budget of roughly 10 hours on a single NVIDIA A100 GPU. The time can vary slightly, since the budget is based on the number of updates. An NVIDIA GeForce RTX 3090 requires 12-13 hours for the same amount of training and evaluation. When using a vanilla transformer, which does not use the memory mechanism of the Transformer-XL architecture (Dai et al., 2019), the runtime is roughly 15.5 hours on an NVIDIA A100 GPU, i.e., 1.5 times higher. + +We compare the runtime of our method with previous methods in Table 3. Our method is more than 20 times faster than SimPLe, but slower than model-free methods. However, our method should be as fast as other model-free methods during inference. In Table 2 we have shown that our method + +Table 3: Approximate runtime (i.e., training and evaluation time for a single run) of our method compared with previous methods that also evaluate on the Atari 100k benchmark. Runtimes of previous methods are taken from Schwarzer et al. (2021). They used an improved version of DER (van Hasselt et al., 2019), which is roughly equivalent to DrQ (Yarats et al., 2021), so the specified runtime might differ from the original DER implementation. There are data augmented versions for SPR and DER. All runtimes are measured on a single NVIDIA P100 GPU. + +
MethodModel-basedRuntime in hours
SimPLe✓500
TWM (ours)✓23.3
SPR (with aug.)✗4.6
SPR (w/o aug.)✗3.0
DER/DrQ (with aug.)✗2.1
DER/DrQ (w/o aug.)✗1.4
+ +achieves a higher human normalized score than previous sample-efficient methods after 50K interactions. This suggests that our method could potentially outperform previous methods with shorter training, which would take less than 23.3 hours. + +To determine how time-consuming the individual parts of our method are, we investigate the throughput of the models, with the batch sizes of our main experiments. The Transformer-XL version is almost twice as fast, which again shows the importance of this design choice. The throughputs were measured on an NVIDIA A100 GPU and are given in (approximate) samples per second: + +- World model training: 16,800 samples/s +- World model imagination (Transformer-XL): 39,000 samples/s +- World model imagination (vanilla): 19,900 samples/s +Policy training: 700,000 samples/s + +We also examine how fast the policy can run in an Atari game. We measured the (approximate) frames per second on a CPU (since the batch size is 1). Conditioning the policy on $[z, h]$ is about 3 times slower than $z$ , since the transformer is required: + +Policy conditioned on $z$ : 653 frames/s +Policy conditioned on $[z,h]$ : 213 frames/s + +# A.2 DERIVATION OF BALANCED CROSS-ENTROPY LOSS + +Hafner et al. (2021) propose to use a balanced KL divergence loss to jointly optimize the observation encoder $q_{\theta}$ and state predictor $p_{\theta}$ with shared parameters $\theta$ , i.e., + +$$ +\lambda D _ {\mathrm {K L}} \left(\operatorname {s g} \left(q _ {\theta}\right) \| p _ {\theta}\right) + (1 - \lambda) D _ {\mathrm {K L}} \left(q _ {\theta} \| \operatorname {s g} \left(p _ {\theta}\right)\right), \tag {7} +$$ + +where $\mathrm{sg}(\cdot)$ denotes the stop-gradient operation and $\lambda \in [0,1]$ controls how much the state predictor adapts to the observation encoder and vice versa. We use the identity $D_{\mathrm{KL}}(q\parallel p) = H(q,p) - H(q)$ , where $H(q,p)$ is the cross-entropy of distribution $p$ relative to distribution $q$ , and show that our loss functions lead to the same gradients as the balanced KL objective, but with finer control over the individual components: + +$$ +\begin{array}{l} \nabla_ {\theta} \left[ \lambda D _ {\mathrm {K L}} \left(\operatorname {s g} \left(q _ {\theta}\right) \| p _ {\theta}\right) + (1 - \lambda) D _ {\mathrm {K L}} \left(q _ {\theta} \| \operatorname {s g} \left(p _ {\theta}\right)\right) \right] (8) \\ = \nabla_ {\theta} [ \lambda (H (\operatorname {s g} (q _ {\theta}), p _ {\theta}) - H (\operatorname {s g} (q _ {\theta}))) + (1 - \lambda) (H (q _ {\theta}, \operatorname {s g} (p _ {\theta})) - H (q _ {\theta})) ] (9) \\ = \nabla_ {\theta} \left[ \lambda_ {1} H \left(\operatorname {s g} \left(q _ {\theta}\right), p _ {\theta}\right) + \lambda_ {2} H \left(q _ {\theta}, \operatorname {s g} \left(p _ {\theta}\right)\right) - \lambda_ {3} H \left(q _ {\theta}\right) \right], (10) \\ \end{array} +$$ + +since $\nabla_{\theta}H(\mathrm{sg}(q_{\theta})) = 0$ and by defining $\lambda_1 = \lambda$ and $\lambda_{2} = 1 - \lambda$ and $\lambda_3 = 1 - \lambda$ . In this form, we have control over the cross-entropy of the state predictor relative to the observation encoder and vice versa. Moreover, we explicitly penalize the entropy of the observation encoder, instead of being entangled inside of the KL divergence. + +As common in the literature, we define the loss function by omitting the gradient in Equation (10), so that automatic differentiation computes this gradient. For our world model, we split the objective into two loss functions, as the observation encoder and state predictor have separate parameters, yielding Equations (3) and (4). + +![](images/a99fc3acc6fad9261e5025491f7994f8b8e15a1c0a3f9edb462e74e8ba45842b.jpg) +(a) This world model focuses on previous states. + +![](images/630b4cea4a174c2e7fc7c2bc323632abd08c9098faf612e5759fd9041861c379.jpg) +(b) This world model focuses on previous actions, indicating that the effect of actions can last longer than a single time step. + +![](images/5f4cc58b102bbff65b33b36ba884fa463e0a9ead4f17ecc4391fd415a1afecf2.jpg) +(c) This world model attends to all three modalities in the recent past. + +![](images/b88fdc7d93e1f83d3ef4be87c372eb555af07dad93c0c190c769c8ad2e3201e2.jpg) +(d) This world model attends to states at all time steps, probably because of the complexity of this 3D game. + +![](images/c412448dbd0c077644e2f2ebb60047f183cf7b7c80df1a05cce9ecf3a0f6d545.jpg) +(e) This world model mainly focuses on four states at specific time steps. + +![](images/c5001b08933cba1a5ef59b83a6927c39c2c02b3418b3986ae8025b24ff180852.jpg) +Figure 10: Average attention maps of the transformer, computed over many time steps. They show how different games require a different focus on modalities and time steps. +Figure 11: Attention map for Freeway for a single time step. At this point the player hits a car and gets pushed back (see also Figure 5b) and the world model puts more attention to past states and rewards, compared with the average attention at other time steps, as shown in Figure 10e. The world model has learned to handle this situation separately. + +![](images/09c82b17768f029ad9b4d7af85ed5940b1354a4380e70b87a6a74d5946f32cae.jpg) +Figure 12: Three trajectories for the game KungFuMaster generated by our world model, using the same starting state. Because of its stochastic nature, the world model is able to generate three different situations (one opponent, two opponents, one other type of opponent). Note that we only show every third frame to cover more time steps. + +![](images/27349a345bb0a70716eef5ad167171261616eb6ff7a7dc8f6bd30318eb03302b.jpg) +Figure 13: A long trajectory imagined by our world model for the game Hero. The player traverses five different rooms and the world model is able to correctly predict the state and reward dynamics. Note that we only show every fifth frame to cover more time steps (the rewards lying in-between are summed up). The total number of time steps is 230. + +![](images/4e4862de96ad523a550267a48e25790eade7b499da6789d0a6620098488bdcf0.jpg) +(a) Assault + +![](images/bf5321d57cc34ed22ec87f3fb58b6d807ed35c44e3e40048a9b4d251f2089adc.jpg) +(b) Hero + +![](images/36ee7c86d5d3082652818d99fb5972612d9a2446cd17ea8c395509458fa1c2c4.jpg) +(c) KungFuMaster +Figure 14: Visualization of frame stacks reconstructed from predicted states $\hat{z}_t$ . Each frame in the stack is visualized by a different color. The world model is able to encode and predict movements. + +![](images/4355115133fa33163f6d979bfc5ed431e61b675f32410f5d9c6e480c1dbcbff2.jpg) +(d) Pong + +![](images/f44d88f0b9c8bc696c319cb95f7f53879df41589567e76b7ccd36f92f54e2296.jpg) +(e) Pong + +![](images/eda4ddb5770a107493ff6b1b37eb5dcaf7df4fdb37ed1664fa35bf88bab5fe20.jpg) +Figure 15: Effect of disabling the proposed thresholded entropy loss (by setting $\Gamma = 1$ ) on the performance and the entropy in a random subset of games. The thresholded version stabilizes the entropy and leads to a better score in Breakout and Pong, while the entropy behaves unfavorably without a threshold. + +![](images/3f5a71ef5883d6a798ca1fd20bc6ac987bb286ce962dc189b328d42412bc9f7e.jpg) +Figure 16: Comparison of the history length $\ell = 16$ used in our main experiments with $\ell = 4$ on a random subset of games. We observe a lower human normalized score for $\ell = 4$ . + +![](images/d77db7053a7ab8f6ef49664bab14cc0ac87d796d8c66b5a95244c69761e998e1.jpg) +Figure 17: Conditioning the policy on $[z, h]$ compared with the usual $z$ . In some cases the performance can be better during training, but the final score is lower or equal. + +![](images/34608be18873fc9685d83a850a61767aba7d52a1c43687d505428410c1c71885.jpg) +Figure 18: Scores on a random subset of games when we train with a lower number of interactions but the same training budget. This only leads to a significant improvement for UpNDown, where the final score is higher with only 50K interactions. + +![](images/3401f832b2e507664d9aa7d88e6c87b1e89ceaaee66747ef75d66eb45178e305.jpg) +Figure 19: Comparison of the proposed balanced sampling procedure with uniform sampling. It shows the development of the dynamics loss from Equation (4), which is lower at the end of training in all cases. + +![](images/326420aed4c99332196cb4843b37c532c4fd646fb8e728230bedac68108795eb.jpg) + +![](images/6a7ca60e5c535981325669100c449c06eeb8b26916e918d2210dce4a798ccd8e.jpg) + +![](images/4797b316dbae79f29812614d9168a9131831c7a287b71daec523d6f1d43721c3.jpg) + +# A.3 ADDITIONAL TRAINING DETAILS + +In Algorithm 1 we present pseudocode for training the world model and the actor-critic agent. We use the SiLU activation function (Elfwing et al., 2018) for all models. In Table 4 we summarize all hyperparameters that we used in our experiments. In Table 5 we provide the number of parameters of our models. + +Pretraining for Better Initialization: During training we need to correctly balance the amount of world model training and policy training, since the policy has to keep up with the distributional shift of the latent space. However, we can spend some extra training time on the world model with pre-collected data (included in the 100K interactions) at the beginning of training in order to obtain a reasonable initialization for the latent states. + +Algorithm 1 Training the world model and the actor-critic agent. +```c +function train_world_model() +// sample sequences of observations, +// rewards, actions and discounts +o,a,r,d = sample_from_dataset() +z = encode(o) +o_hat = decode(z) +h = transformer(z,a,r) +r_hat,d_hat,z_hat = predict(h) +// optimize world model via +// self-supervised learning +optimobservation(o,z,o_hat,z_hat) +optim_dynamics(r,d,z,r_hat,d_hat,z_hat) +// z will be used for imagination +return z +``` + +Table 4: Hyperparameters used in our experiments. + +
DescriptionSymbolValue
Dataset sampling temperatureτ20
Discount factorγ0.99
GAE parameterλ0.95
World model batch sizeN100
History lengthl16
Imagination batch sizeM400
Imagination horizonH15
Encoder entropy coefficientα15.0
Consistency loss coefficientα20.01
Reward coefficientβ110.0
Discount coefficientβ250.0
Actor entropy coefficientη0.01
Actor entropy thresholdΓ0.1
Environment steps—100K
Frame skip—4
Frame down-sampling—64 × 64
Frame gray-scaling—Yes
Frame stack—4
Terminate on live loss—Yes
Max frames per episode—108K
Max no-ops—30
Observation learning rate—0.0001
Dynamics learning rate—0.0001
Actor learning rate—0.0001
Critic learning rate—0.00001
Transformer embedding size—256
Transformer layers—10
Transformer heads—4 × 64
Transformer feedforward size—1024
Latent state predictor units—4 × 512
Reward predictor units—4 × 256
Discount predictor units—4 × 256
Actor units—4 × 512
Critic units—4 × 512
Activation function—SiLU
+ +Table 5: Number of parameters of our models. + +
ModelSymbol# Parameters
Observation modelφ8.2M
Dynamics modelψ10.8M
Actorθ1.3M
Criticξ1.3M
World model—19M
Actor-critic—2.6M
Total—21.6M
Encoder + actor +(at inference time)—4.4M
\ No newline at end of file diff --git a/transformerbasedworldmodelsarehappywith100kinteractions/images.zip b/transformerbasedworldmodelsarehappywith100kinteractions/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..5afc98a01f5e9559cee5f58bc22e83997966075a --- /dev/null +++ b/transformerbasedworldmodelsarehappywith100kinteractions/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7ed45ca5b97cd1b5a9ec6c424a76cec6f26c312828703c657d5fec8e13cb3138 +size 1262515 diff --git a/transformerbasedworldmodelsarehappywith100kinteractions/layout.json b/transformerbasedworldmodelsarehappywith100kinteractions/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..4774b3442f77f7ea85533ffe6cfa4259880c349e --- /dev/null +++ b/transformerbasedworldmodelsarehappywith100kinteractions/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4cfe9c26ebd7cb726597d9fbceccf52b033545e22f70257fb71203804eb91719 +size 602144 diff --git a/transformermeetsboundaryvalueinverseproblems/1ec099b3-f201-4d72-b365-9568bef0f665_content_list.json b/transformermeetsboundaryvalueinverseproblems/1ec099b3-f201-4d72-b365-9568bef0f665_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..65768dfc5ab153f91f915116a9dcaf3031508c11 --- /dev/null +++ b/transformermeetsboundaryvalueinverseproblems/1ec099b3-f201-4d72-b365-9568bef0f665_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:69622b7afb31b0e01001dd2ce40ceaeae77ede8538aafa9c7dcd98f480155a96 +size 211310 diff --git a/transformermeetsboundaryvalueinverseproblems/1ec099b3-f201-4d72-b365-9568bef0f665_model.json b/transformermeetsboundaryvalueinverseproblems/1ec099b3-f201-4d72-b365-9568bef0f665_model.json new file mode 100644 index 0000000000000000000000000000000000000000..2396c13ac379d54d9b69e82a4b660a499f29cc53 --- /dev/null +++ b/transformermeetsboundaryvalueinverseproblems/1ec099b3-f201-4d72-b365-9568bef0f665_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0f0886e0c3212a37989a1a2058fe7d9c23578a79e5e7a04ea21aad406fe0ba9e +size 268366 diff --git a/transformermeetsboundaryvalueinverseproblems/1ec099b3-f201-4d72-b365-9568bef0f665_origin.pdf b/transformermeetsboundaryvalueinverseproblems/1ec099b3-f201-4d72-b365-9568bef0f665_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..57ff4a66d8484c4c8613836182a25e71e826cf8b --- /dev/null +++ b/transformermeetsboundaryvalueinverseproblems/1ec099b3-f201-4d72-b365-9568bef0f665_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1bcc5b326d1bde56c2aa3dd1de536690dc1d33be61f3aa75506d84901702076b +size 5157338 diff --git a/transformermeetsboundaryvalueinverseproblems/full.md b/transformermeetsboundaryvalueinverseproblems/full.md new file mode 100644 index 0000000000000000000000000000000000000000..c73f231d5ad0812759f3714213431eee23b38f77 --- /dev/null +++ b/transformermeetsboundaryvalueinverseproblems/full.md @@ -0,0 +1,993 @@ +# TRANSFORMER MEETS BOUNDARY VALUE INVERSE PROBLEMS + +# Ruchi Guo + +Department of Mathematics + +University of California, Irvine + +# Shuhao Cao + +Division of Computing, Analytics, and Mathematics + +School of Science and Engineering + +University of Missouri-Kansas City + +# Long Chen + +Department of Mathematics + +University of California, Irvine + +# ABSTRACT + +A Transformer-based deep direct sampling method is proposed for electrical impedance tomography, a well-known severely ill-posed nonlinear boundary value inverse problem. A real-time reconstruction is achieved by evaluating the learned inverse operator between carefully designed data and the reconstructed images. An effort is made to give a specific example to a fundamental question: whether and how one can benefit from the theoretical structure of a mathematical problem to develop task-oriented and structure-conforming deep neural networks? Specifically, inspired by direct sampling methods for inverse problems, the 1D boundary data in different frequencies are preprocessed by a partial differential equation-based feature map to yield 2D harmonic extensions as different input channels. Then, by introducing learnable non-local kernels, the direct sampling is recast to a modified attention mechanism. The new method achieves superior accuracy over its predecessors and contemporary operator learners and shows robustness to noises in benchmarks. This research shall strengthen the insights that, despite being invented for natural language processing tasks, the attention mechanism offers great flexibility to be modified in conformity with the a priori mathematical knowledge, which ultimately leads to the design of more physics-compatible neural architectures. + +# 1 INTRODUCTION + +Boundary value inverse problems aim to recover the internal structure or distribution of multiple media inside an object (2D reconstruction) based on only the data available on the boundary (1D signal input), which arise from many imaging techniques, e.g., electrical impedance tomography (EIT) (Holder, 2004), diffuse optical tomography (DOT) (Culver et al., 2003), magnetic induction tomography (MIT) (Griffiths et al., 1999). Not needing any internal data renders these techniques generally non-invasive, safe, cheap, and thus quite suitable for monitoring applications. + +In this work, we shall take EIT as an example to illustrate how a more structure-conforming neural network architecture leads to better results in certain physics-based tasks. Given a 2D bounded domain $\Omega$ and an inclusion $D$ , the forward model is the following partial differential equation (PDE) + +$$ +\nabla \cdot (\sigma \nabla u) = 0 \quad \text {i n} \Omega , \quad \text {w h e r e} \sigma = \sigma_ {1} \text {i n} D, \text {a n d} \sigma = \sigma_ {0} \text {i n} \Omega \backslash \bar {D}, \tag {1} +$$ + +where $\sigma$ is a piecewise constant function defined on $\Omega$ with known function values $\sigma_0$ and $\sigma_{1}$ , but the shape of the inclusion $D$ buried in $\Omega$ is unknown. The goal is to recover the shape of $D$ using only the boundary data on $\partial \Omega$ (Figure 1). Specifically, by exerting a current $g$ on the boundary, one solves (1) with the Neumann boundary condition $\sigma \nabla u\cdot \mathbf{n}|_{\partial \Omega} = g$ , where $\mathbf{n}$ is the outwards unit normal direction of $\partial \Omega$ , to get a unique $u$ on the whole domain $\Omega$ . In practice, only the Dirichlet boundary value representing the voltages $f = u|_{\partial \Omega}$ on the boundary can be measured. This procedure is called Neumann-to-Dirichlet (NtD) mapping: + +$$ +\Lambda_ {\sigma}: H ^ {- 1 / 2} (\partial \Omega) \rightarrow H ^ {1 / 2} (\partial \Omega), \quad \text {w i t h} g = \sigma \nabla u \cdot \mathbf {n} | _ {\partial \Omega} \mapsto f = u | _ {\partial \Omega}. \tag {2} +$$ + +![](images/9e0d7b7376f1507bf2bc7a0978a3529367dd7822cf6c3164da1bf850849dfb08.jpg) +Figure 1: Schematics of the pipeline: the approximation of the inverse operator is decomposed into (i) a PDE-based feature map $\mathcal{H}$ : the 1D boundary data is extended to 2D features by a harmonic extension; (ii) a tensor2tensor neural network $\mathcal{T}_{\theta}$ that outputs the reconstruction. + +For various notation and the Sobolev space formalism, we refer readers to Appendix A; for a brief review of the theoretical background of EIT we refer readers to Appendix B. The NtD map above in (2) can be expressed as + +$$ +\mathbf {f} = \mathbf {A} _ {\sigma} \mathbf {g}, \tag {3} +$$ + +where $\mathbf{g}$ and $\mathbf{f}$ are (infinite-dimensional) vector representations of functions $g$ and $f$ relative to a chosen basis, and $\mathbf{A}_{\sigma}$ is the matrix representation of $\Lambda_{\sigma}$ (see Appendix B for an example). + +The original mathematical setup of EIT is to use the NtD map $\Lambda_{\sigma}$ in (2) to recover $\sigma$ , referred to as the case of full measurement (Calderón, 2006). In this case, the forward and inverse operators associated with EIT can be formulated as + +$$ +\mathcal {F}: \sigma \mapsto \Lambda_ {\sigma}, \quad \text {a n d} \quad \mathcal {F} ^ {- 1}: \Lambda_ {\sigma} \mapsto \sigma . \tag {4} +$$ + +Fix a set of basis $\{g_l\}_{l=1}^{\infty}$ of the corresponding Hilbert space containing all admissible currents. Then, mathematically speaking, "knowing the operator $\Lambda_{\sigma}$ " means that one can measure all the current-to-voltage pairs $\{g_l, f_l \coloneqq \Lambda_{\sigma} g_l\}_{l=1}^{\infty}$ and construct the infinite-dimensional matrix $\mathbf{A}_{\sigma}$ . + +However, as infinitely many boundary data pairs are not attainable in practice, the problem of more practical interest is to use only a few data pairs $\{(g_l,f_l)\}_{l = 1}^L$ for reconstruction. In this case, the forward and inverse problems can be formulated as + +$$ +\mathcal {F} _ {L}: \sigma \mapsto \left\{\left(g _ {1}, \Lambda_ {\sigma} g _ {1}\right), \dots , \left(g _ {L}, \Lambda_ {\sigma} g _ {L}\right) \right\} \quad \text {a n d} \quad \mathcal {F} _ {L} ^ {- 1}: \left\{\left(g _ {1}, \Lambda_ {\sigma} g _ {1}\right), \dots , \left(g _ {L}, \Lambda_ {\sigma} g _ {L}\right) \right\} \mapsto \sigma . \tag {5} +$$ + +For limited data pairs, the inverse operator $\mathcal{F}_L^{-1}$ is extremely ill-posed or even not well-defined (Isakov & Powell, 1990; Barceló et al., 1994; Kang & Seo, 2001; Lionheart, 2004); namely, the same boundary measurements may correspond to different $\sigma$ . In view of the matrix representation $\mathbf{A}_{\sigma}$ , for $\mathbf{g}_l = \mathbf{e}_l$ , $l = 1, \dots, L$ , with $\mathbf{e}_l$ being unit vectors of a chosen basis, $(\mathbf{f}_1, \dots, \mathbf{f}_L)$ only gives the first $L$ columns of $\mathbf{A}_{\sigma}$ . It is possible that two matrices $\mathbf{A}_{\sigma}$ and $\mathbf{A}_{\tilde{\sigma}}$ have similar first $L$ columns but $\|\sigma - \tilde{\sigma}\|$ is large. + +How to deal with this "ill-posedness" is a central theme in boundary value inverse problem theories. The operator learning approach has the potential to tame the ill-posedness by restricting $\mathcal{F}_L^{-1}$ at a set of sampled data $\mathbb{D} := \{\sigma^{(k)}\}_{k=1}^N$ , with different shapes and locations following certain distribution. Then the problem becomes to approximate + +$$ +\mathcal {F} _ {L, \mathbb {D}} ^ {- 1}: \left\{\left(g _ {1}, \Lambda_ {\sigma^ {(k)}} g _ {1}\right), \dots , \left(g _ {L}, \Lambda_ {\sigma^ {(k)}} g _ {L}\right) \right\} \mapsto \sigma^ {(k)}, \quad k = 1, \dots , N. \tag {6} +$$ + +The fundamental assumption here is that this map is "well-defined" enough to be regarded as a high-dimensional interpolation (learning) problem on a compact data submanifold (Seo et al., 2019; Ghattas & Willcox, 2021), and the learned approximate mapping can be evaluated at newly incoming $\sigma$ 's. The incomplete information of $\Lambda_{\sigma}$ due to a small $L$ for one single $\sigma$ is compensated by a large $N \gg 1$ sampling of different $\sigma$ 's. + +# 2 BACKGROUND, RELATED WORK, AND CONTRIBUTIONS + +Classical iterative methods. There are in general two types of methodology to solve inverse problems. The first one is a large family of iterative or optimization-based methods (Dobson & + +Santosa, 1994; Martin & Idier, 1997; Chan & Tai, 2003; Vauhkonen et al., 1999; Guo et al., 2019; Rondi & Santosa, 2001; Chen et al., 2020; Bao et al., 2020; Gu et al., 2021). One usually looks for an approximated $\sigma$ by solving a minimization problem with a regularization $\mathcal{R}(\sigma)$ to alleviate the ill-posedness, say + +$$ +\inf _ {\sigma} \left\{\sum_ {l = 1} ^ {L} \| \Lambda_ {\sigma} g _ {l} - f _ {l} \| _ {\partial \Omega} ^ {2} + \mathcal {R} (\sigma) \right\}. \tag {7} +$$ + +The design of regularization $\mathcal{R}(\sigma)$ plays a critical role in a successful reconstruction (Tarvainen et al., 2008; Tehrani et al., 2012; Wang et al., 2012). Due to the ill-posedness, the computation for almost all iterative methods usually takes numerous iterations to converge, and the reconstruction is highly sensitive to noise. Besides, the forward operator $\mathcal{F}(\cdot)$ needs to be evaluated at each iteration, which is itself expensive as it requires solving forward PDE models. + +Classical direct methods. The second methodology is to develop a well-defined mapping $\mathcal{G}_{\theta}$ parametrized by $\theta$ , empirically constructed to approximate the inverse map itself, say $\mathcal{G}_{\theta} \approx \mathcal{F}^{-1}$ . These methods are referred to as non-iterative or direct methods in the literature. Distinguished from iterative approaches, direct methods are typically highly problem-specific, as they are designed based on specific mathematical structures of their respective inverse operators. For instance, methods in EIT and DOT include factorization methods (Kirsch & Grinberg, 2007; Azzouz et al., 2007; Brühl, 2001; Hanke & Brühl, 2003), MUSIC-type algorithms (Cheney, 2001; Ammari & Kang, 2004; 2007; Lee et al., 2011), and the D-bar methods (Knudsen et al., 2007; 2009) based on a Fredholm integral equation (Nachman, 1996), among which are the direct sampling methods (DSM) being our focus in this work (Chow et al., 2014; 2015; Kang et al., 2018; Ito et al., 2013; Ji et al., 2019; Harris & Kleefeld, 2019; Ahn et al., 2020; Chow et al., 2021; Harris et al., 2022). These methods generally have a closed-form $\mathcal{G}_{\theta}$ for approximation, and the parameters $\theta$ represent model-specific mathematical objects. For each fixed $\theta$ , this procedure is usually much more stable than iterative approaches with respect to the input data. Furthermore, the evaluation for each boundary data pair is distinctly fast, as no optimization is needed. However, a simple closed-form $\mathcal{G}_{\theta}$ admitting efficient execution may not be available in practice since some mathematical assumptions and derivation may not hold. For instance, MUSIC-type and D-bar methods generally require an accurate approximation to $\Lambda_{\sigma}$ , while DSM poses restrictions on the boundary data, domain geometry, etc., see Appendix D for details. + +Boundary value inverse problems. For most cases of boundary value inverse problems in 2D, the major difference, e.g., with an inverse problem in computer vision (Marroquin et al., 1987), is that data are only available on 1D manifolds, which are used to reconstruct 2D targets. When comparing (4) with a linear inverse problem in signal processing $\mathbf{y} = A\mathbf{x} + \epsilon$ , to recover a signal $\mathbf{x}$ from measurement $\mathbf{y}$ with noise $\epsilon$ , the difference is more fundamental in that $\mathcal{F}(\cdot)$ itself is highly nonlinear and involves boundary value PDEs. Moreover, the boundary data themselves generally involve certain input-output structures (NtD maps), which adds more complexity. In Adler & Guardo (1994); Fernandez-Fuentes et al. (2018); Feng et al. (2018), boundary measurements are collected and directly input into feedforward fully connected networks. As the data reside on different manifolds, special treatments are made to the input data, such as employing pre-reconstruction stages to generate rough 2D input to CNNs (Ben Yedder et al., 2018; Ren et al., 2020; Pakravan et al., 2021). + +Deep neural network and inverse problems. Solving an inverse problem is essentially to give a satisfactory approximation to $\mathcal{F}^{-1}$ but based on finitely many measurements. The emerging deep learning (DL) based on Deep Neural Networks (DNN) to directly emulate operators significantly resembles those classical direct methods mentioned above. However, operator learners by DNNs are commonly considered black boxes. A natural question is how the a priori mathematical knowledge can be exploited to design more physics-compatible DNN architectures. In pursuing the answer to this question, we aim to provide a supportive example that bridges deep learning techniques and classical direct methods, which improves the reconstruction of EIT. + +Operator learners. Operator learning has become an active research field for inverse problems in recent years, especially related to image reconstruction where CNN plays a central role, see, e.g., Klosowski & Rymarczyk (2017); Nguyen et al. (2018); Tan et al. (2018); Jin et al. (2017); Kang et al. (2017); Barbastathis et al. (2019); Latif et al. (2019); Zhu et al. (2018); Chen et al. (2021); Coxson et al. (2022); Zhu et al. (2023b). Notable examples of efforts to couple classical reconstruction methods and CNN include Hamilton et al. (2019); Hamilton & Hauptmann (2018), where a CNN post-processes images obtained by the classical D-bar methods, and Fan et al. (2019); Fan & Ying (2020) where BCR-Net is developed to mimic pseudo-differential operators appearing in many inverse + +problems. A deep direct sampling method is proposed in Guo & Jiang (2020); Guo et al. (2021) that learns local convolutional kernels mimicking the gradient operator of DSM. Another example is radial basis function neural networks seen in Hrabuska et al. (2018); Michalikova et al. (2014); Wang et al. (2021a). Nevertheless, convolutions in CNNs use kernels whose receptive fields involve only a small neighborhood of a pixel. Thus, layer-wise, CNN does not align well with the non-local nature of inverse problems. More recently, the learning of PDE-related forward problems using global kernel has gained attraction, most notably the Fourier Neural Operator (FNO) (Nelsen & Stuart, 2021; Li et al., 2021a; Kovachki et al., 2021; Guibas et al., 2022; Zhao et al., 2022; Wen et al., 2022; Li et al., 2022b). FNO takes advantage of the low-rank nature of certain problems and learns a local kernel in the frequency domain yet global in the spatial-temporal domain, mimicking the solution's kernel integral form. Concurrent studies include DeepONets (Lu et al., 2021; Wang et al., 2021b; Jin et al., 2022b), Transformers (Cao, 2021; Kissas et al., 2022; Li et al., 2022a; Liu et al., 2022; Fonseca et al., 2023), Integral Autoencoder (Ong et al., 2022), Multiwavelet Neural Operators (Gupta et al., 2021; 2022), and others (Lutjens et al., 2022; Hu et al., 2022; Boussif et al., 2022; de Hoop et al., 2022a;b; Ryck & Mishra, 2022; Seidman et al., 2022; Zhang et al., 2023; Lee, 2023; Zhu et al., 2023a). + +Related studies on Transformers. The attention mechanism-based models have become state of the art in many areas since Vaswani et al. (2017). One of the most important and attractive aspects of the attention mechanism is its unparalleled capability to efficiently model non-local long-range interactions (Katharopoulos et al., 2020; Choromanski et al., 2021; Nguyen et al., 2021). The relation of the attention with kernel learning is first studied in Tsai et al. (2019) and later connected with random feature (Peng et al., 2021). Connecting the non-PDE-based integral kernels and the attention mechanism has been seen in Hutchinson et al. (2021); Guibas et al. (2022); Nguyen et al. (2022); Han et al. (2022). Among inverse problems, Transformers have been applied in medical imaging applications, including segmentation (Zhou et al., 2021; Hatamizadeh et al., 2022; Petit et al., 2021), X-Ray (Tanzi et al., 2022), magnetic resonance imaging (MRI) (He et al., 2022), ultrasound (Perera et al., 2021), optical coherence tomography (OCT) (Song et al., 2021). To our best knowledge, no work in the literature establishes an architectural connection between the attention mechanism in Transformer and the mathematical structure of PDE-based inverse problems. + +# 2.1 CONTRIBUTIONS + +- A structure-conforming network architecture. Inspired by the EIT theory and classic DSM, we decompose the approximation of the inverse operator into a harmonic extension and an integral operator with learnable non-local kernels that has an attention-like structure. Additionally, the attention architecture is reinterpreted through a Fredholm integral operator to rationalize the application of the Transformer to the boundary value inverse problem. +- Theoretical and experimental justification for the advantage of Transformer. We have proved that, in Transformers, modified attention can represent target functions exhibiting higher frequency natures from lower frequency input features. A comparative study in the experiments demonstrates a favorable match between the Transformer and the benchmark problem. + +# 3 INTERPLAY BETWEEN MATHEMATICS AND NEURAL ARCHITECTURES + +In this section, we try to articulate that the triple tensor product in the attention mechanism matches exceptionally well with representing a solution in the inverse operator theory of EIT. In pursuing this end goal, this study tries to answer the following motivating questions: + +(Q1) What is an appropriate finite-dimensional data format as inputs to the neural network? +(Q2) Is there a suitable neural network matching the mathematical structure? + +# 3.1 FROM EIT TO OPERATOR LEARNING + +In the case of full measurement, the operator $\mathcal{F}^{-1}$ can be well approximated through a large number of $(\sigma, \mathbf{A}_{\sigma})$ data pairs. This mechanism essentially results in a tensor2tensor mapping/operator from $\mathbf{A}_{\sigma}$ to the imagery data representing $\sigma$ . In particular, the BCR-Net (Fan & Ying, 2020) is a DNN approximation falling into this category. However, when there are very limited boundary data pairs accessible, the task of learning the full matrix $\mathbf{A}_{\sigma}$ becomes obscure, which complicates the development of a tensor2tensor pipeline for operator learning. + +Operator learning problems for EIT. We first introduce several attainable approximations of infinite-dimensional spaces by finite-dimensional counterparts for the proposed method. + +(1) Spatial discretization. Let $\Omega_h$ be a mesh of $\Omega$ with the mesh spacing $h$ and let $\{z_j\}_{j=1}^M \coloneqq \mathcal{M}$ be the set of grid points to represent the 2D discretization of continuous signals. Then a function $u$ defined almost everywhere in $\Omega$ can be approximated by a vector $\mathbf{u}_h \in \mathbb{R}^M$ . +(2) Sampling of $D$ . We generate $N$ samples of $D$ with different shapes and locations following certain distributions. For example, elliptical inclusions with random semi-axes and centers are generated as a benchmark (see Appendix C.1 for details). With the known $\sigma_0$ and $\sigma_{1}$ , set the corresponding data set $\mathbb{D} = \{\sigma^{(1)},\sigma^{(2)},\dots,\sigma^{(N)}\}$ . $N$ is usually large enough to represent field applications of interest. +(3) Sampling of NtD maps. For the $k$ -th sample of $D$ , we generate $L$ pairs of boundary data $\{(g_{l}^{(k)},f_{l}^{(k)})\}_{l = 1}^{L}$ by solving PDE (1), which can be thought of as sampling of columns of the infinite matrix $\mathbf{A}_{\sigma}$ representing the NtD map. By the proposed method, $L$ can be chosen to be very small ( $\leq 3$ ) to yield satisfactory results. + +Our task is to find a parameterized mapping $\mathcal{G}_{\theta}$ to approximate $\mathcal{F}_{L,\mathbb{D}}^{-1}(6)$ by minimizing + +$$ +\mathcal {J} (\theta) := \frac {1}{N} \sum_ {k = 1} ^ {N} \| \mathcal {G} _ {\theta} \left(\left\{\left(g _ {l} ^ {(k)}, f _ {l} ^ {(k)}\right) \right\} _ {l = 1} ^ {L}\right) - \sigma^ {(k)} \| ^ {2}, \tag {8} +$$ + +for a suitable norm $\| \cdot \|$ . Hyper-parameters $N, h, L$ will affect the finite-dimensional approximation to the infiniteness in the following way: $h$ determines the resolution to approximate $D$ ; $N$ affects the representativity of the training data set; $L$ decides how much of a finite portion of the infinite spectral information of $\Lambda_{\sigma}$ can be accessed. + +# 3.2 FROM HARMONIC EXTENSION TO TENSOR-TO-TENSOR + +To establish the connection between the problem of interest with the attention used in the Transformers, we first construct higher-dimensional tensors from the 1D boundary data. The key is a harmonic extension of the boundary data that can be viewed as a PDE-based feature map. We begin with a theorem to motivate it. + +Let $\mathcal{I}^D$ be the characteristic function of $D$ named index function, i.e., $\mathcal{I}^D(x) = 1$ if $x \in D$ and $\mathcal{I}^D(x) = 0$ if $x \notin D$ . Thus, $\sigma$ can be directly identified by the shape of $D$ through the formula $\sigma = \sigma_1 \mathcal{I}^D + \sigma_0 (1 - \mathcal{I}^D)$ . In this setup, reconstructing $\sigma$ is equivalent to reconstructing $\mathcal{I}^D$ . + +Without loss of generality, we let $\sigma_{1} > \sigma_{0}$ . $\Lambda_{\sigma_0}$ is understood as the NtD map with $\sigma = \sigma_0$ on the whole domain, i.e., it is taken as the known background conductivity (no inclusion), and thus $\Lambda_{\sigma_0}g$ can be readily computed. Then $f - \Lambda_{\sigma_0}g = (\Lambda_{\sigma} - \Lambda_{\sigma_0})g$ measures the difference between the NtD mappings and encodes the information of $\sigma$ . The operator $\Lambda_{\sigma} - \Lambda_{\sigma_0}$ is positive definite, and it has eigenvalues $\{\lambda_l\}_{l=1}^{\infty}$ with $\lambda_1 > \lambda_2 > \dots > 0$ (Cheng et al., 1989). + +Theorem 1. Suppose that the 1D boundary data $g_{l}$ is the eigenfunction of $\Lambda_{\sigma} - \Lambda_{\sigma_0}$ corresponding to the l-th eigenvalue $\lambda_{l}$ , and let the 2D data functions $\phi_l$ be obtained by solving + +$$ +- \Delta \phi_ {l} = 0 \quad i n \quad \Omega , \quad \mathbf {n} \cdot \nabla \phi_ {l} = \left(f _ {l} - \Lambda_ {\sigma_ {0}} g _ {l}\right) \quad o n \quad \partial \Omega , \quad \int_ {\partial \Omega} \phi_ {l} d s = 0, \tag {9} +$$ + +for $l = 1,2,\ldots$ . Define the space $\widetilde{\mathbb{S}}_L = \operatorname{Span}\{\partial_{x_1}\phi_l\partial_{x_2}\phi_l:l = 1,\dots ,L\}$ , and the dictionary $\mathbb{S}_L = \{a_1 + a_2\arctan (a_3v):v\in \widetilde{\mathbb{S}}_L,a_1,a_2,a_3\in \mathbb{R}\}$ . Then, for any $\epsilon >0$ , we con construct an index function $\mathcal{I}_L^D\in \mathbb{S}_L$ s.t. $\sup_{x\in \Omega}|\mathcal{I}^{D}(x) - \mathcal{I}_{L}^{D}(x)|\leq \epsilon$ provided $L$ is large enough. + +The full proof of Theorem 1 can be found in Appendix E. This theorem gives a constructive approach for approximating $\mathcal{F}^{-1}$ and justifies the practice of approximating $\mathcal{I}^D$ when $L$ is large enough. The function $\phi_l$ is called the harmonic extension of $f_{l} - \Lambda_{\sigma_{0}}g_{l}$ . + +On the other hand, it relies on "knowing" the entire NtD map $\Lambda_{\sigma}$ to construct $\mathcal{I}_L^D$ explicitly. Namely, the coefficients of $\partial_{x_1}\phi_l\partial_{x_2}\phi_l$ depend on a big chunk of spectral information (eigenvalues and eigenfunctions) of $\Lambda_{\sigma}$ , which may not be available in practice. Thus, the mathematics itself in this theorem does not provide an architectural hint on building a structure-conforming DNN. + +To further dig out the hidden structure, we focus on the case of a single measurement, i.e., $L = 1$ . With this setting, it is possible to derive an explicit and simple formula to approximate $\mathcal{I}^D$ which + +is achieved by the classical direct sampling methods (DSM) (Chow et al., 2014; 2015; Kang et al., 2018; Ito et al., 2013; Ji et al., 2019; Harris & Kleefeld, 2019; Ahn et al., 2020). For EIT, + +$$ +\mathcal {I} ^ {D} (x) \approx \mathcal {I} _ {1} ^ {D} (x) := R (x) (\mathbf {d} (x) \cdot \nabla \phi (x)) \quad x \in \Omega , \mathbf {d} (x) \in \mathbb {R} ^ {2}, \tag {10} +$$ + +is derived in Chow et al. (2014), where (see a much more detailed formulation in Appendix D) + +- $\phi$ is the harmonic extension of $f - \Lambda_{\sigma_0}g$ with certain noise $f - \Lambda_{\sigma_0}g + \xi$ ; +- $\mathbf{d}(x)$ is called a probing direction and can be chosen empirically as $\mathbf{d}(x) = \nabla \phi(x) / \|\nabla \phi(x)\|$ ; +- $R(x) = (\| f - \Lambda_{\sigma_0}g\|_{\partial \Omega}|\eta_x|_Y)^{-1}$ , where $\eta_{x}$ is a function of $\mathbf{d}(x)$ and measured in $|\cdot |_{Y}$ semi-norm on boundary $\partial \Omega$ + +Both $\phi$ and $\eta_{x}$ can be computed effectively by traditional fast PDE solvers, such as finite difference or finite element methods based on $\Omega_{h}$ in Section 3.1. However, the reconstruction accuracy is much limited by a single measurement, the nonparametric ansatz, and empirical choices of $\mathbf{d}(x)$ and $|\cdot |_Y$ . These restrictions leave room for DL methodology. See Appendix D for a detailed discussion. + +Constructing harmonic extension (2D features) from boundary data (1D signal input with limited depth) can contribute to the desired high-quality reconstruction. First, harmonic functions are highly smooth away from the boundary, of which the solution automatically smooths out the noise on the boundary due to PDE theory (Gilbarg & Trudinger, 2001, Chapter 8), and thus make the reconstruction highly robust with respect to the noise (e.g., see Figure 3 in Appendix C.1). Second, in terms of using certain backbone networks to generate features for downstream tasks, harmonic extensions can be understood as a problem-specific way to design higher dimensional feature maps (Álvarez et al., 2012), which renders samples more separable in a higher dimensional data manifold than the one with merely boundary data. See Figure 1 to illustrate this procedure. + +The information of $\sigma$ is deeply hidden in $\phi$ . As shown in Figure 1 (see also Appendix C), one cannot observe any pattern of $\sigma$ directly from $\phi$ . It is different from and more challenging than the inverse problems studied in (Bhattacharya et al., 2021; Khoo et al., 2021) that aim to reconstruct 2D targets from the much more informative 2D internal data of $u$ . + +In summary, both Theorem 1 and the formula of DSM (10) offer inspiration to give a potential answer to (Q1): the harmonic extension $\phi$ (2D features) of $f - \Lambda_{\sigma_0}g$ (1D measurements) naturally encodes the information of the true characteristic function $\mathcal{I}_D$ (2D targets). As there is a pointwise correspondence between the harmonic extensions and the targets at 2D grids, a tensor representation of $\nabla \phi_l$ at these grid points can then be used as the input to a tensor2tensor-type DNN to learn $\mathcal{I}_D$ . Naturally, the grids are set as the positional embedding explicitly. In comparison, the positional information is buried more deeply in 1D measurements. As shown in Figure 1, $\mathcal{G}_{\theta}$ can be nicely decoupled into a composition of a learnable neural network operator $\mathcal{T}_{\theta}$ and a non-learnable PDE-based feature map $\mathcal{H}$ , i.e., $\mathcal{G}_{\theta} = \mathcal{T}_{\theta} \circ \mathcal{H}$ . The architecture of $\mathcal{T}_{\theta}$ shall be our interest henceforth. + +# 3.3 FROM CHANNELS IN ATTENTION TO BASIS IN INTEGRAL TRANSFORM + +In this subsection, a modified attention mechanism is proposed as the basic block in the tensor2tensor-type mapping introduced in the next two subsections. Its reformulation conforms with one of the most used tools in applied mathematics: the integral transform. In many applications such as inverse problems, the interaction (kernel) does not have any explicit form, which meshes well with DL methodology philosophically. In fact, this is precisely the situation of the EIT problem considered. + +Let the input of an encoder attention block be $\mathbf{x}_h\in \mathbb{R}^{M\times c}$ with $c$ channels, then the query $Q$ , key $K$ , value $V$ are generated by three learnable projection matrices $\theta \coloneqq \{W^Q,W^K,W^V\} \subset \mathbb{R}^{c\times c}$ : $\diamondsuit = \mathbf{x}_hW^\diamondsuit$ , $\diamondsuit \in \{Q,K,V\}$ . Here $c\gg L$ is the number of expanded channels for the latent representations. A modified dot-product attention is proposed as follows: + +$$ +U = \operatorname {A t t n} \left(\mathbf {x} _ {h}\right) := \alpha \left(\mathrm {n l} _ {Q} (Q) \mathrm {n l} _ {K} (K) ^ {\top}\right) V = \alpha \left(\widetilde {Q} \widetilde {K} ^ {\top}\right) V \in \mathbb {R} ^ {M \times c}, \tag {11} +$$ + +where $\mathrm{nl}_Q(\cdot)$ and $\mathrm{nl}_K(\cdot)$ are two learnable normalizations. Different from Nguyen & Salazar (2019); Xiong et al. (2020), this pre-inner-product normalization is applied right before the matrix multiplication of query and key. This practice takes inspiration from the normalization in the index function kernel integral (10) and (20), see also Boyd (2001) where the normalization for orthogonal bases essentially uses the (pseudo)inverse of the Gram matrices. In practice, layer normalization (Ba + +et al., 2016) or batch normalization (Ioffe & Szegedy, 2015) is used as a cheap alternative. Constant $\alpha = h^2$ is a mesh-based weight such that the summation becomes an approximation to an integral. + +To elaborate these rationales, the $j$ -th column of the $i$ -th row $U_{i}$ of $U$ is $(U_{i})^{j} = \alpha A_{i\bullet}\cdot V^{j}$ , in which the $i$ -th row $A_{i\bullet} = (\widetilde{Q}\widetilde{K}^{\top})_{i\bullet}$ and the $j$ -th column $V^{j}\coloneqq V_{\bullet j}$ . Thus, applying this to every column $1\leq j\leq c$ , attention (11) becomes a basis expansion representation for the $i$ -th row $U_{i}$ + +$$ +U _ {i} = \alpha A _ {i \bullet} \left( \begin{array}{c c c} - & V _ {1} & - \\ - & \vdots & - \\ - & V _ {M} & - \end{array} \right) = \sum_ {m = 1} ^ {M} \alpha A _ {i m} V _ {m} =: \sum_ {m = 1} ^ {M} \mathcal {A} \left(Q _ {i}, K _ {m}\right) V _ {m}. \tag {12} +$$ + +Here, $\alpha A_{i}$ contains the coefficients for the linear combination of $\{V_m\}_{m=1}^M$ . This set $\{V_m\}_{m=1}^M$ forms the $V$ 's row space, and it further forms each row of the output $U$ by multiplying with $A$ . $\mathcal{A}(\cdot, \cdot)$ in (12) stands for the attention kernel, which aggregates the pixel-wise feature maps to measure how the projected latent representations interact. Moreover, the latent representation $U_i$ in an encoder layer is spanned by the row space of $V$ and is being nonlinearly updated cross-layer-wise. + +For $\mathbf{x}_h, U, Q, K, V$ , a set of feature maps are assumed to exist: for example $u(\cdot)$ maps $\mathbb{R}^2 \to \mathbb{R}^{1 \times c}$ , i.e., $U_i = u(z_i) = [u_1(z_i), \dots, u_c(z_i)]$ , e.g., see Choromanski et al. (2021), then an instance-dependent kernel $\kappa_\theta(\cdot, \cdot): \mathbb{R}^2 \times \mathbb{R}^2 \to \mathbb{R}$ can be defined by + +$$ +\mathcal {A} \left(Q _ {i}, K _ {j}\right) := \alpha \langle \widetilde {Q} _ {i}, \widetilde {K} _ {j} \rangle = \alpha \langle q (z _ {i}), k (z _ {j}) \rangle =: \alpha \kappa_ {\theta} \left(z _ {i}, z _ {j}\right). \tag {13} +$$ + +Now the discrete kernel $\mathcal{A}(\cdot, \cdot)$ with tensorial input is rewritten to this kernel $\kappa_{\theta}(\cdot, \cdot)$ , thus the dot-product attention is expressed as a nonlinear integral transform for the $l$ -th channel: + +$$ +u _ {l} (z) = \alpha \sum_ {x \in \mathcal {M}} (q (z) \cdot k (x)) v _ {l} (x) \delta_ {x} \approx \int_ {\Omega} \kappa_ {\theta} (z, x) v _ {l} (x) d \mu (x), \quad 1 \leq l \leq c. \tag {14} +$$ + +Through certain minimization such as (8), the backpropagation updates $\theta$ , which further leads a new set of latent representations. This procedure can be viewed as an iterative method to update the basis residing in each channel by solving the Fredholm integral equation of the first kind in (14). + +To connect attention with inverse problems, the multiplicative structure in a kernel integral form for attention (14) is particularly useful. (14) is a type of Pincherle-Goursat (degenerate) kernels (Kress, 1999, Chapter 11) and approximates the full kernel using only a finite number of bases. The number of learned basis functions in expansion (12) depends on the number of channels $n$ . Here we show the following theorem; heuristically, it says that: given enough but finite channels of latent representations, the attention kernel integral can "bootstrap" in the frequency domain, that is, generating an output representation with higher frequencies than the input. Similar approximation results are impossible for layer-wise propagation in CNN if one opts for the usual framelet/wavelet interpretation (Ye et al., 2018). For example, if there are no edge-like local features in the input (see for empirical evidence in Figure 9 and Figure 10), a single layer of CNN filters without nonlinearity cannot learn weights to extract edges. The full proof with a more rigorous setting is in Appendix F. + +Theorem 2 (Frequency bootstrapping). Suppose there exists a channel $l$ in $V$ such that $(V_{i})_{l} = \sin (az_{i})$ for some $a \in \mathbb{Z}^{+}$ , the current finite-channel sum kernel $\mathcal{A}(\cdot, \cdot)$ approximates a non-separable kernel to an error of $O(\epsilon)$ under certain norm $\| \cdot \|_{X}$ . Then, there exists a set of weights such that certain channel $k'$ in the output of (12) approximates $\sin(a'z)$ , $\mathbb{Z}^{+} \ni a' > a$ with an error of $O(\epsilon)$ under the same norm. + +The considered inverse problem is essentially to recover higher-frequency eigenpairs of $\Lambda_{\sigma}$ based on lower-frequency data, see, e.g., Figure 1. $\Lambda_{\sigma}$ together with all its spectral information can be determined by the recovered inclusion shape. Thus, the existence in Theorem 2 partially justifies the advantages of adopting the attention mechanism for the considered problem. + +# 3.4 FROM INDEX FUNCTION INTEGRAL TO TRANSFORMER + +In (10), the probing direction $\mathbf{d}(x)$ , the inner product $\mathbf{d}(x) \cdot \nabla \phi(x)$ , and the norm $|\cdot|_Y$ are used as ingredients to form certain non-local instance-based learnable kernel integration. This non-localness is a fundamental trait for many inverse problems, in that $\mathcal{I}^D(x)$ depends on the entire data function. Then, the discretization of the modified index function is shown to match the multiplicative structure of the modified attention mechanism in (11). + +In the forthcoming derivations, $\mathcal{K}(x,y),\mathcal{Q}(x,y)$ , and a self-adjoint positive definite linear operator $\mathcal{V}:L^{2}(\partial \Omega)\to L^{2}(\partial \Omega)$ , are shown to yield the emblematic $Q$ - $K$ - $V$ structure of attention. To this end, we make the following modifications and assumptions to the original index function in (10). + +- The reformulation of the index function is motivated by the heuristics that the agglomerated global information of $\phi$ could be used as "keys" to locate a point $x$ . + +$$ +\hat {\mathcal {L}} _ {1} ^ {D} (x) := R (x) \int_ {\Omega} \mathbf {d} (x) \cdot \mathcal {K} (x, y) \nabla \phi (y) d y. \tag {15} +$$ + +If an ansatz $\mathcal{K}(x,y) = \delta_x(y)$ is adopted, then (15) reverts to the original one in (10). + +- The probing direction $\mathbf{d}(x)$ as "query" is reasonably assumed to have a global dependence on $\phi$ + +$$ +\mathbf {d} (x) := \int_ {\Omega} \mathcal {Q} (x, y) \nabla \phi (y) d y. \tag {16} +$$ + +If $\mathcal{Q}(x,y) = \delta_x(y) / \| \nabla \phi (x)\|$ , then $\mathbf{d}(x) = \nabla \phi (x) / \| \nabla \phi (x)\|$ which is the choice of the probing direction in (Ikehata, 2000; Ikehata & Siltanen, 2000; Ikehata, 2007). + +- In the quantity $R(x)$ in (10), the key is $|\cdot|_Y$ which is assumed to have the following form: + +$$ +\left| \eta_ {x} \right| _ {Y} ^ {2} := \left(\mathcal {V} \eta_ {x}, \eta_ {x}\right) _ {L ^ {2} (\partial \Omega)}. \tag {17} +$$ + +In Chow et al. (2014), it is shown that if $\mathcal{V}$ induces a kernel with sharply peaked Gaussian-like distribution, the index function in (10) can achieve maximum values for points inside $D$ . + +Based on the assumptions from (15) to (17), we derive a matrix representation approximating the new index function on a grid, which accords well with an attention-like architecture. Denote by $\phi_{n}$ : the vector that interpolates $\partial_{x_n}\phi$ at the grid points $\{z_j\}$ , $n = 1,2$ . + +Here, we sketch the outline of the derivation and present the detailed derivation in Appendix D. We shall discretize the variable $x$ by grid points $z_{i}$ in (15) and obtain an approximation to the integral: + +$$ +\int_ {\Omega} \mathcal {K} \left(z _ {i}, y\right) \partial_ {x _ {n}} \phi (y) \mathrm {d} y \approx \sum_ {j} \omega_ {j} \mathcal {K} \left(z _ {i}, z _ {j}\right) \partial_ {x _ {n}} \phi \left(z _ {j}\right) =: \mathbf {k} _ {i} ^ {T} \phi_ {n}, \tag {18} +$$ + +where $\{\omega_j\}$ are some integration quadrature weights. We then consider (16) and focus on one component $d_n(x)$ of $\mathbf{d}(x)$ . With a suitable approximated integral, it can be rewritten as + +$$ +d _ {n} \left(z _ {i}\right) \approx \sum_ {j} \omega_ {j} \mathcal {Q} \left(z _ {i}, z _ {j}\right) \partial_ {x _ {n}} \phi \left(z _ {j}\right) =: \mathbf {q} _ {i} ^ {T} \phi_ {n}. \tag {19} +$$ + +Note that the self-adjoint positive definite operator $\mathcal{V}$ in (17) can be parameterized by a symmetric positive definite (SPD) matrix denoted by $V$ . There exist vectors $\mathbf{v}_{n,i}$ such that $|\eta_{z_i}|_Y^2 \approx \sum_n \phi_n^T \mathbf{v}_{n,i} \mathbf{v}_{n,i}^T \phi_n$ . Then, the modified indicator function can be written as + +$$ +\hat {\mathcal {I}} _ {1} ^ {D} \left(z _ {i}\right) \approx \left\{\| f - \Lambda_ {\sigma_ {0}} g \| _ {\partial \Omega} ^ {- 1} \left(\sum_ {n} \phi_ {n} ^ {T} \mathbf {v} _ {n, i} \mathbf {v} _ {n, i} ^ {T} \phi_ {n}\right) ^ {- 1 / 2} \right\} \sum_ {n} \phi_ {n} ^ {T} \mathbf {q} _ {i} \mathbf {k} _ {i} ^ {T} \phi_ {n}. \tag {20} +$$ + +Now, using the notation from Section 3.3, we denote the learnable kernel matrices and an input vector: for $\diamondsuit \in \{\bar{Q}, K, V\}$ , and $\mathbf{u} \in \{\mathbf{q}, \mathbf{k}, \mathbf{v}\}$ + +$$ +W ^ {\diamond} = \left[ \begin{array}{l l l} \mathbf {u} _ {1, 1} & \dots & \mathbf {u} _ {1, M} \\ \mathbf {u} _ {2, 1} & \dots & \mathbf {u} _ {2, M} \end{array} \right] \in \mathbb {R} ^ {2 M \times M}, \quad \mathbf {x} _ {h} = \left[ \begin{array}{l l} \phi_ {1} & \phi_ {2} \end{array} \right] \in \mathbb {R} ^ {1 \times 2 M}. \tag {21} +$$ + +Then, we can rewrite (20) as + +$$ +\left[ \hat {\mathcal {I}} _ {1} ^ {D} \left(z _ {i}\right) \right] _ {i = 1} ^ {M} \approx C _ {f, g} \left(\mathbf {x} _ {h} W ^ {Q} * \mathbf {x} _ {h} W ^ {K}\right) / \left(\mathbf {x} _ {h} W ^ {V} * \mathbf {x} _ {h} W ^ {V}\right) ^ {1 / 2} \tag {22} +$$ + +where $C_{f,g} = \| f - \Lambda_{\sigma_0}g\|_{\partial \Omega}^{-1}$ is a normalization weight, and both $*$ and $/$ are element-wise. Here, we may define $Q = \mathbf{x}_hW^Q$ , $K = \mathbf{x}_hW^K$ , and $V = \mathbf{x}_hW^V$ as the query, keys, and values. We can see that the right matrix multiplications (11) in the attention mechanism are low-rank approximations of the ones above. Hence, based on (22), essentially we need to find a function $\mathbf{I}$ resulting in a vector approximation to the true characteristic function $\{\mathcal{I}^D(z_j)\}$ + +$$ +\mathbf {I} (Q, K, V) \approx [ \mathcal {I} ^ {D} \left(z _ {i}\right) ] _ {i = 1} ^ {M}. \tag {23} +$$ + +Moreover, when there are $L$ data pairs, the data functions $\phi_l$ are generated by computing their harmonic extensions as in (9). Then, each $\phi_l$ is then treated as a channel of the input data $\mathbf{x}_h$ . + +In summary, the expressions in (22) and (23) reveal that a Transformer may be able to generalize the classical non-parametrized DSM formula further in (10) to non-local learnable kernels. Thus, it may have an intrinsic architectural advantage that handles multiple data pairs. In the subsequent EIT benchmarks, we provide a potential answer to the question (Q2); namely, the attention architecture is better suited for the tasks of reconstruction, as it conforms better with the underlying mathematical structure. The ability to learn global interactions by attention, supported by a non-local kernel interpretation, matches the long-range dependence nature of inverse problems. + +# 4 EXPERIMENTS + +In this section we present some experimental results to show the quality of the reconstruction. The benchmark contains sampling of inclusions of random ellipses (targets), and the input data has a single channel $(L = 1)$ of the 2D harmonic extension feature from the 1D boundary measurements. The training uses 1cycle and a mini-batch ADAM for 50 epochs. The evaluated model is taken from the epoch with the best validation metric on a reserved subset. There are several baseline models to compare: the CNN-based U-Nets (Ronneberger et al., 2015; Guo & Jiang, 2020); the state-of-the-art operator learner Fourier Neural Operator (FNO) (Li et al., 2021a) and its variant with a token-mixing layer (Guibas et al., 2022); MultiWavelet Neural Operator (MWO) (Gupta et al., 2021). The Transformer model of interest is a drop-in replacement of the baseline U-Net, and it is named by U-Integral Transformer (UIT). UIT uses the kernel integral inspired attention (11), and we also compare UIT with the linear attention-based Hybrid U-Transformer in Gao et al. (2021), as well as a Hadamard product-based cross-attention U-Transformer in Wang et al. (2022). An ablation study is also conducted by replacing the convolution layers in the U-Net with attention (11) on the coarsest level. For more details of the hyperparameters' setup in the data generation, training, evaluation, network architectures please refer to Section 3.1, Appendix C.1, and Appendix C.2. + +The comparison result can be found in Table 1. Because FNO (AFNO, MWO) keeps only the lower modes in spectra, it performs relatively poor in this EIT benchmark where one needs to recover traits that consist of higher modes (sharp boundary edges of inclusion) from lower modes (smooth harmonic extension). Attention-based models are capable to recover "high-frequency target from low-frequency data", and generally outperform the CNN-based U-Nets despite having only $1/3$ of the parameters. Another highlight is that the proposed models are highly robust to noise thanks to the unique PDE-based feature map through harmonic extension. The proposed models can recover the buried domain under a moderately large noise $(5\%)$ and an extreme amount of noise $(20\%)$ which can be disastrous for many classical methods. + +Table 1: Evaluation metrics of the EIT benchmark tests. $\tau$ : the normalized relative strength of noises added in the boundary data before the harmonic extension; see Appendix C for details. $L^2$ -error and cross entropy: the closer to 0 the better; Dice coefficient: the closer to 1 the better. + +
Relative L2 errorPosition-wise cross entropyDice coefficient# params
τ = 0τ = 0.05τ = 0.2τ = 0τ = 0.05τ = 0.2τ = 0τ = 0.05τ = 0.2
U-Net baseline0.2000.3410.3660.08360.1320.1430.8450.8100.7997.7m
U-Net+Coarse Attn0.1840.3430.3600.08010.1360.1470.8520.8070.8048.4m
U-Net big0.1950.3380.3500.07910.1330.1380.8500.8120.80531.0m
FNO2d baseline0.3180.4920.5020.3960.4670.5080.6500.5920.58210.4m
Adaptive FNO2d0.3230.4970.4990.3910.4660.4710.6350.5950.59210.9m
FNO2d big0.3860.4820.5010.3100.4650.4990.6380.6010.58033.6m
Multiwavelet NO0.2750.3900.4070.1520.1780.1920.7150.6940.6889.8m
Hybrid UT0.1850.3200.3330.07850.1120.1160.8770.8290.82111.9m
Cross-Attention UT0.1710.3050.3110.06190.1050.1090.8870.8400.82911.4m
UIT+Softmax (ours)0.1590.2610.2690.05510.09690.09770.9030.8620.84811.1m
UIT (ours)0.1630.2610.2720.05640.09670.09810.8970.8580.84511.4m
UIT+(L=3) (ours)0.1470.2500.2540.04710.08820.09000.9140.8910.88011.4m
+ +# 5 CONCLUSION + +For a boundary value inverse problem, we propose a novel operator learner based on the mathematical structure of the inverse operator and Transformer. The proposed architecture consists of two components: the first one is a harmonic extension of boundary data (a PDE-based feature map), and the second one is a modified attention mechanism derived from the classical DSM by introducing learnable non-local integral kernels. The evaluation accuracy on the benchmark problems surpasses the current widely-used CNN-based U-Net and the best operator learner FNO. This research strengthens the insights that the attention is an adaptable neural architecture that can incorporate a priori mathematical knowledge to design more physics-compatible DNN architectures. However, we acknowledge some limitations: in this study, $\sigma$ to be recovered relies on a piecewise constant assumption. For many EIT applications in medical imaging and industrial monitoring, $\sigma$ may involve non-sharp transitions or even contain highly anisotropic/multiscale behaviors; see Appendix G for more discussion on limitations and possible approaches. + +# ACKNOWLEDGMENTS + +L. Chen is supported in part by National Science Foundation grants DMS-1913080 and DMS-2012465, and DMS-2132710. S. Cao is supported in part by National Science Foundation grants DMS-1913080 and DMS-2136075. The hardware to perform the experiments are sponsored by NSF grants DMS-2136075, and UMKC School of Science and Engineering computing facilities. No additional revenues are related to this work. The authors would like to thank Ms. Jinrong Wei (University of California Irvine) for the proofreading and various suggestions on the manuscript. The authors would like to thank Dr. Jun Zou (The Chinese University of Hong Kong) and Dr. Bangti Jin (University College London & The Chinese University of Hong Kong) for their comments on inverse problems. The authors also greatly appreciate the valuable suggestions and comments by the anonymous reviewers. + +# REPRODUCIBILITY STATEMENT + +This paper is reproducible. Experimental details about all empirical results described in this paper are provided in Appendix C. Additionally, we provide the PyTorch (Paszke et al., 2019) code for reproducing our results at https://github.com/scaomath/eit-transformer. The dataset used in this paper is available at https://www.kaggle.com/datasets/scaomath/eletrical-impedance-tomography-dataset. Formal proofs under a rigorous setting of all our theoretical results are provided in Appendices E-F. + +# REFERENCES + +Andy Adler and Robert Guardo. A neural network image reconstruction technique for electrical impedance tomography. IEEE Trans Med Imaging, 13(4):594-600, 1994. +Chi Young Ahn, Taeyoung Ha, and Won-Kwang Park. Direct sampling method for identifying magnetic inhomogeneities in limited-aperture inverse scattering problem. Computers & Mathematics with Applications, 80(12):2811-2829, 2020. ISSN 0898-1221. URL https://www.sciencedirect.com/science/article/pii/S0898122120304089. +Mauricio A. Álvarez, Lorenzo Rosasco, and Neil D. Lawrence. Kernels for Vector-Valued Functions: A Review. 2012. +Habib Ammari and Hyeonbae Kang. Reconstruction of Small Inhomogeneities from Boundary Measurements. Berlin: Springer, 2004. +Habib Ammari and Hyeonbae Kang. *Polarization and Moment Tensors: With Applications to Inverse Problems and Effective Medium Theory*. New York: Springer, 2007. +Nachman Aronszajn. Theory of reproducing kernels. Transactions of the American mathematical society, 68(3): 337-404, 1950. +Kari Astala and Lassi Paivärinta. Calderón's inverse conductivity problem in the plane. Annals of Mathematics, 163(1):265-299, 2006. +Mustapha Azzouz, Martin Hanke, Chantal Oesterlein, and Karl Schilcher. The factorization method for electrical impedance tomography data from a new planar device. International journal of biomedical imaging, 2007: 83016-83016, 2007. URL https://pubmed.ncbi.nlm.nih.gov/18350126. +Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E. Hinton. Layer normalization, 2016. URL https://arxiv.org/abs/1607.06450. +Guillaume Bal. Hybrid inverse problems and internal functionals. Inverse problems and applications: inside out. II, 60:325-368, 2013. +Gang Bao, Xiaojing Ye, Yaohua Zang, and Haomin Zhou. Numerical solution of inverse problems by weak adversarial networks. Inverse Probl., 36(11):115003, nov 2020. URL https://doi.org/10.1088/1361-6420/abb447. +George Barbastathis, Aydogan Ozcan, and Guohai Situ. On the use of deep learning for computational imaging. Optica, 6(8):921-943, Aug 2019. URL http://www.osapublishing.org/optica/abstract.cfm?URI= optica-6-8-921. +Bartolomé Barceló, Eugene Fabes, and Jin K. Seo. The inverse conductivity problem with one measurement: Uniqueness for convex polyhedra. Proc. Amer. Math. Soc., 122(1):183-189, 1994. +Hanene Ben Yedder, Aicha BenTaeb, Majid Shokoufi, Amir Zahiremami, Farid Golnaraghi, and Ghassan Hamarneh. Deep learning based image reconstruction for diffuse optical tomography. In Florian Knoll, Andreas Maier, and Daniel Rueckert (eds.), Machine Learning for Medical Image Reconstruction, pp. 112-119, Cham, 2018. Springer International Publishing. ISBN 978-3-030-00129-2. +Jose Antonio Lara Benitez, Takashi Furuya, Florian Faucher, Xavier Tricoche, and Maarten V de Hoop. Finetuning neural-operator architectures for training and generalization. arXiv preprint arXiv:2301.11509, 2023. +Kaushik Bhattacharya, Bamdad Hosseini, Nikola B. Kovachki, and Andrew M. Stuart. Model reduction and neural networks for parametric pdes. The SMAI journal of computational mathematics, 7, 2021. +Oussama Boussif, Yoshua Bengio, Loubna Benabbou, and Dan Assouline. MAGnet: Mesh agnostic neural PDE solver. In Alice H. Oh, Alekh Agarwal, Danielle Belgrave, and Kyunghyun Cho (eds.), Advances in Neural Information Processing Systems, 2022. URL https://openreview.net/forum?id=bx2roi8hca8. +John P Boyd. Chebyshev and Fourier spectral methods. Courier Corporation, 2001. +Johannes Brandstetter, Rianne van den Berg, Max Welling, and Jayesh K Gupta. Clifford neural layers for PDE modeling. In International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=okwxL_c4x84. +Martin Brühl. Explicit characterization of inclusions in electrical impedance tomography. SIAM Journal on Mathematical Analysis, 32(6):1327-1341, 2001. URL https://doi.org/10.1137/S003614100036656X. + +Tan Bui-Thanh, Qin Li, and Leonardo Zepeda-Nuñez. Bridging and improving theoretical and computational electrical impedance tomography via data completion. SIAM Journal on Scientific Computing, 44(3):B668-B693, 2022. +Alberto P. Calderón. On an inverse boundary value problem. Comput. Appl. Math, 25(2-3), 2006. +Shuhao Cao. Choose a Transformer: Fourier or Galerkin. In Advances in Neural Information Processing Systems (NeurIPS 2021), volume 34, pp. 24924-24940, 2021. URL https://openreview.net/forum?id=ssohLcmn4-r. +Tony F. Chan and Xue-Cheng Tai. Identification of discontinuous coefficients in elliptic problems using total variation regularization. SIAM J. Sci. Comput, 25(3):881-904, 2003. +Dongdong Chen, Julián Tachella, and Mike E Davies. Equivariant imaging: Learning beyond the range space. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 4379-4388, 2021. +Junqing Chen, Ying Liang, and Jun Zou. Mathematical and numerical study of a three-dimensional inverse eddy current problem. SIAM J. on Appl. Math., 80(3):1467-1492, 2020. +Margaret Cheney. The linear sampling method and the MUSIC algorithm. Inverse Probl., 17(4):591-595, jul 2001. URL https://doi.org/10.1088/0266-5611/17/4/301. +Kuo-Sheng Cheng, David Isaacson, JC Newell, and David G Gisser. Electrode models for electric current computed tomography. IEEE. Trans. Biomed. Eng., 36(9):918-924, 1989. +Krzysztof Marcin Choromanski, Valerii Likhosherstov, David Dohan, Xingyou Song, Andreea Gane, Tamas Sarlos, Peter Hawkins, Jared Quincy Davis, Afroz Mohiuddin, Lukasz Kaiser, David Benjamin Belanger, Lucy J Colwell, and Adrian Weller. Rethinking attention with Performers. In International Conference on Learning Representations (ICLR), 2021. URL https://openreview.net/forum?id=Ua6zukoWRH. +Yat Tin Chow, Kazufumi Ito, and Jun Zou. A direct sampling method for electrical impedance tomography. Inverse Probl., 30(9):095003, 2014. +Yat Tin Chow, Kazufumi Ito, Keji Liu, and Jun Zou. Direct sampling method for diffusive optical tomography. SIAM J. Sci. Comput., 37(4):A1658-A1684, 2015. +Yat Tin Chow, Fuqun Han, and Jun Zou. A direct sampling method for simultaneously recovering inhomogeneous inclusions of different nature. SIAM Journal on Scientific Computing, 43(3):A2161-A2189, 2021. +Thomas M Cover. Elements of information theory. John Wiley & Sons, 1999. +Adam Coxson, Ivo Mihov, Ziwei Wang, Vasil Avramov, Frederik Brooke Barnes, Sergey Slizovsky, Ciaran Mullan, Ivan Timokhin, David Sanderson, Andrey Kretinin, et al. Machine learning enhanced electrical impedance tomography for 2d materials. Inverse Problems, 38(8):085007, 2022. +J. P. Culver, R. Choe, M. J. Holboke, L. Zubkov, T. Durduran, A. Slemp, V. Ntziachristos, B. Chance, and A. G. Yodh. Three-dimensional diffuse optical tomography in the parallel plane transmission geometry: Evaluation of a hybrid frequency domain/continuous wave clinical system for breast imaging. Medical Physics, 30(2): 235-247, 2003. URL https://aapm.onlinelibrary.wiley.com/doi/abs/10.1118/1.1534109. +Maarten de Hoop, Daniel Zhengyu Huang, Elizabeth Qian, and Andrew M Stuart. The cost-accuracy trade-off in operator learning with neural networks. Journal of Machine Learning, 1(3):299-341, June 2022a. URL https://doi.org/10.4208/jml.220509. +Maarten V de Hoop, Matti Lassas, and Christopher A Wong. Deep learning architectures for nonlinear operator functions and nonlinear inverse problems. Mathematical Statistics and Learning, 4(1):1-86, February 2022b. URL https://doi.org/10.4171/msl/28. +David C Dobson and Fadil Santosa. An image-enhancement technique for electrical impedance tomography. Inverse Probl., 10(2):317, 1994. +Yuwei Fan and Lexing Ying. Solving electrical impedance tomography with deep learning. J. Comput. Phys., 404:109119, 2020. +Yuwei Fan, Cindy Orozco Bohorquez, and Lexing Ying. BCR-Net: A neural network based on the nonstandard wavelet form. J. Comput. Phys., 384:1-15, 2019. ISSN 0021-9991. URL https://www.sciencedirect.com/science/article/pii/S0021999119300762. + +Jinchao Feng, Qiuwan Sun, Zhe Li, Zhonghua Sun, and Kebin Jia. Back-propagation neural network-based reconstruction algorithm for diffuse optical tomography. Journal of Biomedical Optics, 24(5):1-12, 2018. URL https://doi.org/10.1117/1.JB0.24.5.051407. +Xosé Fernández-Fuentes, David Mera, Andrés Gómez, and Ignacio Vidal-Franco. Towards a fast and accurate eit inverse problem solver: A machine learning approach. *Electronics*, 7(12), 2018. ISSN 2079-9292. URL https://www.mdpi.com/2079-9292/7/12/422. +Antonio H de O Fonseca, Emanuele Zappala, Josue Ortega Caro, and David van Dijk. Continuous spatiotemporal transformers. arXiv preprint arXiv:2301.13338, 2023. +Yunhe Gao, Mu Zhou, and Dimitris N Metaxas. Utnet: a hybrid transformer architecture for medical image segmentation. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pp. 61-71. Springer, 2021. +Omar Ghattas and Karen Willcox. Learning physics-based models from data: perspectives from inverse problems and model reduction. Acta Numerica, 30:445-554, 2021. +David Gilbarg and Neil S. Trudinger. Elliptic partial differential equations of second order, volume 224. Springer, New York, 2 edition, 2001. +H Griffiths, WR Stewart, and W Gough. Magnetic induction tomography: a measuring system for biological tissues. Ann NY Acad Sci., 20(873), 1999. +Danping Gu, Dong Liu, Danny Smyl, Jiansong Deng, and Jiangfeng Du. Supershape recovery from electrical impedance tomography data. IEEE Transactions on Instrumentation and Measurement, 70:1-11, 2021. +John Guibas, Morteza Mardani, Zongyi Li, Andrew Tao, Anima Anandkumar, and Bryan Catanzaro. Adaptive Fourier neural operators: Efficient token mixers for Transformers. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum?id=EXHG-A3jLM. +Ruchi Guo and Jiahua Jiang. Construct deep neural networks based on direct sampling methods for solving electrical impedance tomography. SIAM J. Sci. Comput., 43(3):B678-B711, 2020. +Ruchi Guo and Tao Lin. A group of immersed finite-element spaces for elliptic interface problems. IMA Journal of Numerical Analysis, 39(1):482-511, 2019. +Ruchi Guo, Tao Lin, and Yanping Lin. A fixed mesh method with immersed finite elements for solving interface inverse problems. J. Sci. Comput., 79(1):148-175, 2019. +Ruchi Guo, Jiahua Jiang, and Yi Li. Learn an index operator by CNN for solving diffusive optical tomography: a deep direct sampling method. J. Sci. Comput., 2021. +Gaurav Gupta, Xiongye Xiao, and Paul Bogdan. Multiwavelet-based operator learning for differential equations. In Thirty-Fifth Conference on Neural Information Processing Systems (NeurIPS 2021), 2021. URL https://openreview.net/forum?id=LZDiWaCgCGL. +Gaurav Gupta, Xiongye Xiao, Radu Balan, and Paul Bogdan. Non-linear operator approximations for initial value problems. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum?id=d2TT6gK9qZn. +Sarah J Hamilton, Asko Hänninen, Andreas Hauptmann, and Ville Kolehmainen. Beltrami-net: domain-independent deep d-bar learning for absolute imaging with electrical impedance tomography (a-eit). Physiol Meas., 40(7):074002, 2019. +Sarah Jane Hamilton and Andreas Hauptmann. Deep d-bar: Real-time electrical impedance tomography imaging with deep neural networks. IEEE Trans Med Imaging, 37(10):2367-2377, 2018. +Xing Han, Tongzheng Ren, Tan Minh Nguyen, Khai Nguyen, Joydeep Ghosh, and Nhat Ho. Robustify transformers with robust kernel density estimation. arXiv preprint arXiv:2210.05794, 2022. +Martin Hanke and Martin Brühl. Recent progress in electrical impedance tomography. 19(6):S65-S90, nov 2003. URL https://doi.org/10.1088/0266-5611/19/6/055. +Isaac Harris and Andreas Kleefeld. Analysis of new direct sampling indicators for far-field measurements. Inverse Problems, 35(5):054002, apr 2019. URL https://doi.org/10.1088/1361-6420/abo8be. +Isaac Harris, Dinh-Liem Nguyen, and Thi-Phong Nguyen. Direct sampling methods for isotropic and anisotropic scatterers with point source measurements. Inverse Problems and Imaging, 16(5):1137-1162, 2022. ISSN 1930-8337. + +Ali Hatamizadeh, Yucheng Tang, Vishwesh Nath, Dong Yang, Andriy Myronenko, Bennett Landman, Holger R Roth, and Daguang Xu. Unetr: Transformers for 3d medical image segmentation. In 2022 IEEE/CVF Winter Conference on Applications of Computer Vision (WACV), pp. 1748-1758, Los Alamitos, CA, USA, jan 2022. IEEE Computer Society. URL https://doi.ieeecomputersociety.org/10.1109/WACV51458.2022.00181. +Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770-778, 2016. +Sheng He, P. Ellen Grant, and Yangming Ou. Global-local transformer for brain age estimation. IEEE Transactions on Medical Imaging, 41(1):213-224, 2022. +David S Holder. Electrical impedance tomography: methods, history and applications. CRC Press, 2004. +Radek Hrabuska, Michal Prauzek, Marketa Venclikova, and Jaromir Konecny. Image reconstruction for electrical impedance tomography: Experimental comparison of radial basis neural network and gauss - newton method. IFAC-PapersOnLine, 51(6):438-443, 2018. ISSN 2405-8963. URL https://www.sciencedirect.com/science/article/pii/S2405896318308589. 15th IFAC Conference on Programmable Devices and Embedded Systems PDeS 2018. +Peiyan Hu, Qi Meng, Bingguang Chen, Shiqi Gong, Yue Wang, Wei Chen, Rongchan Zhu, Zhi-Ming Ma, and Tie-Yan Liu. Neural operator with regularity structure for modeling dynamics driven by spdes. arXiv preprint arXiv:2204.06255, 2022. +Michael J Hutchinson, Charline Le Lan, Sheheryar Zaidi, Emilien Dupont, Yee Whye Teh, and Hyunjik Kim. Lietransformer: Equivariant self-attention for lie groups. In International Conference on Machine Learning, pp. 4533–4543. PMLR, 2021. +Masaru Ikehata. Reconstruction of the support function for inclusion from boundary measurements. Journal of Inverse and Ill-posed Problems, 8(4):367-378, 2000. URL https://doi.org/10.1515/jiip.2000.8.4.367. +Masaru Ikehata. Probe method and a carleman function. Inverse Problems, 23(5):1871-1894, aug 2007. URL https://doi.org/10.1088/0266-5611/23/5/006. +Masaru Ikehata and Samuli Siltanen. Numerical method for finding the convex hull of an inclusion in conductivity from boundary measurements. Inverse Problems, 16(4):1043-1052, aug 2000. URL https://doi.org/10.1088/0266-5611/16/4/311. +Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International conference on machine learning, pp. 448-456. PMLR, 2015. +Haris Iqbal. Harisiqbal88/plotneuralnet v1.0.0, 2018. URL https://zenodo.org/record/2526396. +Victor Isakov and Jeffrey Powell. On the inverse conductivity problem with one measurement. Inverse Probl., 6: 311, 1990. +Kazufumi Ito, Bangti Jin, and Jun Zou. A direct sampling method for inverse electromagnetic medium scattering. Inverse Probl., 29(9):095018, sep 2013. URL https://doi.org/10.1088/0266-5611/29/9/095018. +Xia Ji, Xiaodong Liu, and Bo Zhang. Phaseless inverse source scattering problem: Phase retrieval, uniqueness and direct sampling methods. Journal of Computational Physics: X, 1:100003, 2019. ISSN 2590-0552. URL https://www.sciencedirect.com/science/article/pii/S2590055219300022. +Bangti Jin and Yifeng Xu. Adaptive reconstruction for electrical impedance tomography with a piecewise constant conductivity. Inverse Problems, 36(1):014003, 2019. +Bangti Jin, Xiyao Li, and Xiliang Lu. Imaging conductivity from current density magnitude using neural networks. Inverse Problems, 38(7):075003, 2022a. +Kyong Hwan Jin, Michael T McCann, Emmanuel Froustey, and Michael Unser. Deep convolutional neural network for inverse problems in imaging. IEEE Transactions on Image Processing, 26(9):4509-4522, 2017. +Pengzhan Jin, Shuai Meng, and Lu Lu. Mionet: Learning multiple-input operators via tensor product. arXiv preprint arXiv:2202.06137, 2022b. +Hachem Kadri, Emmanuel Duflos, Philippe Preux, Stephane Canu, Alain Rakotomamonjy, and Julien Audiffren. Operator-valued kernels for learning from functional response data. 2016. + +Eunhee Kang, Junhong Min, and Jong Chul Ye. A deep convolutional neural network using directional wavelets for low-dose x-ray ct reconstruction. Med Phys, 44(10):e360-e375, Oct 2017. ISSN 2473-4209 (Electronic); 0094-2405 (Linking). +Hyeonbae Kang and Jin Keun Seo. Note on uniqueness and stability for the inverse conductivity problems with one measurement. J. Korean Math. Soc, pp. 781-792, 2001. +Sangwoo Kang, Marc Lambert, and Won-Kwang Park. Direct sampling method for imaging small dielectric inhomogeneities: analysis and improvement. Inverse Probl., 34(9):095005, jul 2018. URL https://doi.org/10.1088/1361-6420/aacf1d. +Angelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, and François Fleuret. Transformers are RNNs: Fast autoregressive transformers with linear attention. In International Conference on Machine Learning, pp. 5156-5165. PMLR, 2020. +Yuehaw Khoo, Jianfeng Lu, and Lexing Ying. Solving parametric pde problems with artificial neural networks. European Journal of Applied Mathematics, 32(3):421-435, 2021. +Andreas Kirsch and Natalia Grinberg. The factorization method for inverse problems, volume 36. OUP Oxford, 2007. +Georgios Kissas, Jacob Seidman, Leonardo Ferreira Guilhoto, Victor M Preciado, George J Pappas, and Paris Perdikaris. Learning operators with coupled attention. arXiv preprint arXiv:2201.01032, 2022. +Grzegorz Kłosowski and Tomasz Rymarczyk. Using neural networks and deep learning algorithms in electrical impedance tomography. Informatyka, Automatyka, Pomiary w Gospodarce i Ochronie Środowiska, 7(3), 2017. +Kim Knudsen, Matti Lassas, Jennifer L. Mueller, and Samuli Siltanen. D-bar method for electrical impedance tomography with discontinuous conductivities. SIAM Journal on Applied Mathematics, 67(3):893-913, 2007. URL https://doi.org/10.1137/060656930. +Kim Knudsen, Matti Lassas, Jennifer L. Mueller, and Samuli Siltanen. Regularized d-bar method for the inverse conductivity problem. Inverse Probl. & Imaging, 3(4):599-624, 2009. +Robert Kohn and Michael Vogelius. Determining conductivity by boundary measurements. Communications on Pure and Applied Mathematics, 37(3):289-298, 1984. +Nikola Kovachki, Samuel Lanthaler, and Siddhartha Mishra. On universal approximation and error bounds for Fourier neural operators. The Journal of Machine Learning Research, 22(1):13237-13312, 2021. +Rainer Kress. Linear Integral Equations. Springer New York, 1999. URL https://doi.org/10.1007/978-1-4612-0559-3. +Jahanzaib Latif, Chuangbai Xiao, Azhar Imran, and Shanshan Tu. Medical imaging using machine learning and deep learning algorithms: A review. In 2019 2nd International Conference on Computing, Mathematics and Engineering Technologies (iCoMET), pp. 1-5, 2019. +Thu Le, Dinh-Liem Nguyen, Vu Nguyen, and Trung Truong. Sampling type method combined with deep learning for inverse scattering with one incident wave. arXiv preprint arXiv:2207.10011, 2022. +Okkyun Lee, Jongmin Kim, Yoram Bresler, and Jong Chul Ye. Diffuse optical tomography using generalized music algorithm. In 2011 IEEE International Symposium on Biomedical Imaging: From Nano to Macro, pp. 1142-1145, 2011. +Seungjun Lee. Mesh-independent operator learning for PDEs using set representations, 2023. URL https://openreview.net/forum?id=7d-d0BFz6Hf. +Zijie Li, Kazem Meidani, and Amir Barati Farimani. Transformer for partial differential equations' operator learning. arXiv preprint arXiv:2205.13671, 2022a. +Zongyi Li, Nikola Borislavov Kovachki, Kamyar Azizzadenesheli, Burigede liu, Kaushik Bhattacharya, Andrew Stuart, and Anima Anandkumar. Fourier neural operator for parametric partial differential equations. In International Conference on Learning Representations, 2021a. URL https://openreview.net/forum?id=c8P9NQVtmn0. +Zongyi Li, Hongkai Zheng, Nikola Kovachki, David Jin, Haoxuan Chen, Burigede Liu, Kamyar Azizzadenesheli, and Anima Anandkumar. Physics-informed neural operator for learning partial differential equations. arXiv preprint arXiv:2111.03794, 2021b. + +Zongyi Li, Miguel Liu-Schiaffini, Nikola Borislavov Kovachki, Kamyar Azizzadenesheli, Burigede Liu, Kaushik Bhattacharya, Andrew Stuart, and Anima Anandkumar. Learning chaotic dynamics in dissipative systems. In Alice H. Oh, Alekh Agarwal, Danielle Belgrave, and Kyunghyun Cho (eds.), Advances in Neural Information Processing Systems, 2022b. URL https://openreview.net/forum?id=1C36tFZn7sR. +William RB Lionheart. Eit reconstruction algorithms: pitfalls, challenges and recent developments. Physiological measurement, 25(1):125, 2004. +Xinliang Liu, Bo Xu, and Lei Zhang. Ht-net: Hierarchical transformer based operator learning model for multiscale pdes. arXiv preprint arXiv:2210.10890, 2022. +Fei Lu, Qingci An, and Yue Yu. Nonparametric learning of kernels in nonlocal operators. arXiv preprint arXiv:2205.11006, 2022. +Lu Lu, Pengzhan Jin, Guofei Pang, Zhongqiang Zhang, and George E. Karniadakis. Learning nonlinear operators via deeponet based on the universal approximation theorem of operators. Nature Machine Intelligence, 3(3): 218-229, 2021. URL https://doi.org/10.1038/s42256-021-00302-5. +Björn Lütjens, Catherine H Crawford, Campbell D Watson, Christopher Hill, and Dava Newman. Multiscale neural operator: Learning fast and grid-independent pde solvers. arXiv preprint arXiv:2207.11417, 2022. +Jose Marroquin, Sanjoy Mitter, and Tomaso Poggio. Probabilistic solution of ill-posed problems in computational vision. Journal of the american statistical association, 82(397):76-89, 1987. +Thierry Martin and Jérôme Idier. A FEM-based nonlinear map estimator in electrical impedance tomography. In Proceedings of ICIP, volume 2, pp. 684-687. IEEE, 1997. +James Mercer. Xvi. functions of positive and negative type, and their connection the theory of integral equations. Philosophical transactions of the royal society of London. Series A, containing papers of a mathematical or physical character, 209(441-458):415-446, 1909. +Marketa Michalikova, Rawia Abed, Michal Prauzek, and Jiri Koziorek. Image reconstruction in electrical impedance tomography using neural network. In 2014 Cairo International Biomedical Engineering Conference (CIBEC), pp. 39-42. IEEE, 2014. +Ha Quang Minh, Partha Niyogi, and Yuan Yao. Mercer's theorem, feature maps, and smoothing. In Learning Theory: 19th Annual Conference on Learning Theory, COLT 2006, Pittsburgh, PA, USA, June 22-25, 2006. Proceedings 19, pp. 154-168. Springer, 2006. +Jeffrey S Morris. Functional regression. Annual Review of Statistics and Its Application, 2:321-359, 2015. +Adrian Nachman, Alexandru Tamasan, and Alexandre Timonov. Conductivity imaging with a single measurement of boundary and interior data. Inverse Problems, 23(6):2551, 2007. +Adrian I. Nachman. Global uniqueness for a two-dimensional inverse boundary value problem. Annals of Mathematics, 143(1):71-96, 1996. +Nicholas H Nelsen and Andrew M Stuart. The random feature model for input-output maps between banach spaces. SIAM Journal on Scientific Computing, 43(5):A3212-A3243, 2021. +Tan M. Nguyen, Vai Suliafu, Stanley J. Osher, Long Chen, and Bao Wang. FMMformer: Efficient and Flexible Transformer via Decomposed Near-field and Far-field Attention. In Advances in Neural Information Processing Systems (NeurIPS), 2021. +Tan Minh Nguyen, Minh Pham, Tam Minh Nguyen, Khai Nguyen, Stanley Osher, and Nhat Ho. Fourierformer: Transformer meets generalized fourier integral theorem. In Alice H. Oh, Alekh Agarwal, Danielle Belgrave, and Kyunghyun Cho (eds.), Advances in Neural Information Processing Systems, 2022. URL https://openreview.net/forum?id=PRd7VG_ki_. +Thanh C. Nguyen, Vy Bui, and George Nehmetallah. Computational optical tomography using 3-D deep convolutional neural networks. Optical Engineering, 57(4):1 - 11, 2018. URL https://doi.org/10.1117/1.0E.57.4.043111. +Toan Q. Nguyen and Julian Salazar. Transformers without tears: Improving the normalization of self-attention. In Proceedings of the 16th International Conference on Spoken Language Translation, Hong Kong, November 2-3 2019. Association for Computational Linguistics. URL https://aclanthology.org/2019.iwslt-1.17. +Yong Zheng Ong, Zuowei Shen, and Haizhao Yang. Integral autoencoder network for discretization-invariant learning. Journal of Machine Learning Research, 23(286):1-45, 2022. + +Samira Pakravan, Pouria A Mistani, Miguel A Aragon-Calvo, and Frederic Gibou. Solving inverse-pde problems with physics-aware neural networks. Journal of Computational Physics, 440:110414, 2021. +Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary Devito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems 32 (NeurIPS 2019), pp. 8024-8035. 2019. URL http://papers.neurips.cc/paper/9015-pytorch-an-imperative-style-high-performance-deep-learning-library.pdf. +Hao Peng, Nikolaos Pappas, Dani Yogatama, Roy Schwartz, Noah Smith, and Lingpeng Kong. Random feature attention. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=QtTKTdVrFBB. +Shehan Perera, Srikar Adhikari, and Alper Yilmaz. Pocformer: A lightweight transformer architecture for detection of Covid-19 using point of care ultrasound. In ICIP, 2021. +Olivier Petit, Nicolas Thome, Clement Rambour, Loic Themyr, Toby Collins, and Luc Soler. U-net transformer: Self and cross attention for medical image segmentation. In Machine Learning in Medical Imaging: 12th International Workshop, MLMI 2021, Held in Conjunction with MICCAI 2021, Strasbourg, France, September 27, 2021, Proceedings, pp. 267-276, Berlin, Heidelberg, 2021. Springer-Verlag. ISBN 978-3-030-87588-6. URL https://doi.org/10.1007/978-3-030-87589-3_28. +M. K. Pidcock, M. Kuzuoglu, and K. Leblebicioglu. Analytic and semi-analytic solutions in electrical impedance tomography. i. two-dimensional problems. Physiological Measurement, 16(2):77-90, may 1995. URL https://doi.org/10.1088%2F0967-3334%2F16%2F2%2F001. +Shangjie Ren, Kai Sun, Chao Tan, and Feng Dong. A two-stage deep learning method for robust shape reconstruction with electrical impedance tomography. IEEE Transactions on Instrumentation and Measurement, 69(7):4887-4897, 2020. +Luca Rondi and Fadil Santosa. Enhanced electrical impedance tomography via the mumford-shah functional. ESAIM: COCV, 6:517-538, 2001. URL https://doi.org/10.1051/cocv:2001121. +Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computer-assisted intervention, pp. 234-241. Springer, 2015. +Tim De Ryck and Siddhartha Mishra. Generic bounds on the approximation error for physics-informed (and) operator learning. In Alice H. Oh, Alekh Agarwal, Danielle Belgrave, and Kyunghyun Cho (eds.), Advances in Neural Information Processing Systems, 2022. URL https://openreview.net/forum?id=bF4eYy3LTR9. +Jacob H Seidman, Georgios Kissas, Paris Perdikaris, and George J. Pappas. NOMAD: Nonlinear manifold decoders for operator learning. In Alice H. Oh, Alekh Agarwal, Danielle Belgrave, and Kyunghyun Cho (eds.), Advances in Neural Information Processing Systems, 2022. URL https://openreview.net/forum?id=50WV-sZvMl. +Jin Keun Seo, Kang Cheol Kim, Ariungerel Jargal, Kyounghun Lee, and Bastian Harrach. A learning-based method for solving ill-posed nonlinear inverse problems: a simulation study of lung eit. SIAM journal on Imaging Sciences, 12(3):1275-1295, 2019. +Leslie N Smith and Nicholay Topin. Super-convergence: Very fast training of neural networks using large learning rates. In Artificial Intelligence and Machine Learning for Multi-Domain Operations Applications, volume 11006, pp. 1100612. International Society for Optics and Photonics, 2019. +Diping Song, Bin Fu, Fei Li, Jian Xiong, Junjun He, Xiulan Zhang, and Yu Qiao. Deep relation transformer for diagnosing glaucoma with optical coherence tomography and visual field function. IEEE Transactions on Medical Imaging, 40(9):2392-2402, 2021. +John Sylvester and Gunther Uhlmann. A global uniqueness theorem for an inverse boundary value problem. Annals of Mathematics, 125(1):153-169, 1987. +Chao Tan, Shuhua Lv, Feng Dong, and Masahiro Takei. Image reconstruction based on convolutional neural network for electrical resistance tomography. IEEE Sensors Journal, 19(1):196-204, 2018. +Leonardo Tanzi, Andrea Audisio, Giansalvo Cirrincione, Alessandro Aprato, and Enrico Vezzetti. Vision transformer for femur fracture classification. Injury, 2022. ISSN 0020-1383. URL https://www.sciencedirect.com/science/article/pii/S0020138322002868. + +T. Tarvainen, M. Vauhkonen, and S.R. Arridge. Gauss-newton reconstruction method for optical tomography using the finite element solution of the radiative transfer equation. Journal of Quantitative Spectroscopy and Radiative Transfer, 109(17):2767-2778, 2008. ISSN 0022-4073. URL https://www.sciencedirect.com/science/article/pii/S0022407308001854. +J Nasehi Tehrani, Alistair McEwan, Craig Jin, and A Van Schaik. L1 regularization method in electrical impedance tomography by using the l1-curve (pareto frontier curve). Applied Mathematical Modelling, 36 (3):1095-1105, 2012. ISSN 0307-904X. URL https://www.sciencedirect.com/science/article/pii/S0307904X11004537. +Yao-Hung Hubert Tsai, Shaojie Bai, Makoto Yamada, Louis-Philippe Morency, and Ruslan Salakhutdinov. Transformer dissection: An unified understanding for transformer's attention via the lens of kernel. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 4344–4353, Hong Kong, China, November 2019. URL https://www.aclweb.org/anthology/D19-1443. +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems (NIPS 2017), volume 30, 2017. +Päivi J Vauhkonen, Marko Vauhkonen, Tuomo Savolainen, and Jari P Kaipio. Three-dimensional electrical impedance tomography based on the complete electrode model. IEEE Trans. Biomedical Engrg., 46(9): 1150-1160, 1999. +Hongyi Wang, Shiao Xie, Lanfen Lin, Yutaro Iwamoto, Xian-Hua Han, Yen-Wei Chen, and Ruofeng Tong. Mixed transformer u-net for medical image segmentation. In ICASSP 2022-2022 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 2390-2394. IEEE, 2022. +Huan Wang, Kai Liu, Yang Wu, Song Wang, Zheng Zhang, Fang Li, and Jiafeng Yao. Image reconstruction for electrical impedance tomography using radial basis function neural network based on hybrid particle swarm optimization algorithm. IEEE Sensors Journal, 21(2):1926-1934, 2021a. +Qi Wang, Huaxiang Wang, Ronghua Zhang, Jinhai Wang, Yu Zheng, Ziqiang Cui, and Chengyi Yang. Image reconstruction based on 11 regularization and projection methods for electrical impedance tomography. Review of Scientific Instruments, 83(10):104707, 2012. URL https://doi.org/10.1063/1.4760253. +Sifan Wang, Hanwen Wang, and Paris Perdikaris. Learning the solution operator of parametric partial differential equations with physics-informed deeponets. Science advances, 7(40):eabi8605, 2021b. +Gege Wen, Zongyi Li, Kamyar Azizzadenesheli, Anima Anandkumar, and Sally M Benson. U-fno—an enhanced fourier neural operator-based deep-learning model for multiphase flow. Advances in Water Resources, 163: 104180, 2022. +Ruibin Xiong, Yunchang Yang, Di He, Kai Zheng, Shuxin Zheng, Chen Xing, Huishuai Zhang, Yanyan Lan, Liwei Wang, and Tieyan Liu. On layer normalization in the transformer architecture. In International Conference on Machine Learning, pp. 10524-10533. PMLR, 2020. +Jong Chul Ye, Yoseob Han, and Eunju Cha. Deep convolutional framelets: A general deep learning framework for inverse problems. SIAM Journal on Imaging Sciences, 11(2):991-1048, 2018. +Rui Zhang, Qi Meng, Rongchan Zhu, Yue Wang, Wenlei Shi, Shihua Zhang, Zhi-Ming Ma, and Tie-Yan Liu. Monte carlo neural operator for learning pdes via probabilistic representation. arXiv preprint arXiv:2302.05104, 2023. +Jiawei Zhao, Robert Joseph George, Yifei Zhang, Zongyi Li, and Anima Anandkumar. Incremental fourier neural operator. arXiv preprint arXiv:2211.15188, 2022. +Hong-Yu Zhou, Jiansen Guo, Yinghao Zhang, Lequan Yu, Liansheng Wang, and Yizhou Yu. nformer: Volumetric medical image segmentation via a 3d transformer. arXiv:2109.03201v6, 2021. +Bo Zhu, Jeremiah Z Liu, Stephen F Cauley, Bruce R Rosen, and Matthew S Rosen. Image reconstruction by domain-transform manifold learning. Nature, 555(7697):487-492, Mar 2018. ISSN 1476-4687 (Electronic); 0028-0836 (Linking). +Jianqing Zhu, Juncai He, and Qiumei Huang. An enhanced v-cycle magnet model for operator learning in numerical partial differential equations. arXiv preprint arXiv:2302.00938, 2023a. +Jianqing Zhu, Juncai He, Lian Zhang, and Jinchao Xu. Fv-magnet: Fully connected v-cycle magnet for interpretable time series forecasting. arXiv preprint arXiv:2302.00962, 2023b. + +# A TABLE OF NOTATIONS + +Table 2: Notations used in an approximate chronological order and their meaning in this work. + +
NotationMeaning
Ωan underlying spacial domain in R2
Da subdomain in Ω (not necessarily topologically-connected)
∂D, ∂ΩD's and Ω's boundary, 1-dimensional manifolds
∇uthe gradient vector of a function, ∇u(x) = (∂x1u(x), ∂x2u(x))
||·||ωthe L2-norm on a region ω
||·||= ||·||Ωthe L2-norm on whole domain Ω
δxthe delta function such that ∫Ωf(y)δx(y) dy = f(x), ∀f.
nthe unit outer normal vector on the boundary ∂Ω.
∇u·nnormal derivative of u, measures the rate of change along the direction of n
ΛσNtD map from Neumann data g := ∇u·n
Hs(Ω), s≥0(how fast the solution changes toward the outward normal direction) to Dirichlet data f := u|∂Ω (the solution's value along the tangential direction)
Hs(Ω), s<0the Sobolev space of functions
H0s(Ω)all u ∈ Hs(Ω) such that u's integral on Ω vanishes
|·|Ythe seminorm defined for functions in Y
+ +# B BACKGROUND OF EIT + +For EIT, an immediate question is whether $\mathcal{F}^{-1}$ and $\mathcal{F}_L^{-1}$ in (4) and (5) are well-defined, namely whether $\sigma$ can be uniquely determined. In fact, for the case of full measurements ( $L = \infty$ ), the uniqueness for $\mathcal{F}^{-1}$ has been well established, (Bruhl, 2001; Hanke & Bruhl, 2003; Astala & Paivärinta, 2006; Nachman, 1996; Kohn & Vogelius, 1984; Sylvester & Uhlmann, 1987). It is worthwhile to point out that, in this case, $\sigma$ is not necessarily a piecewise constant function. In (1), we present a simplified case for purposes of illustrating as well as benchmarking. In general, with the full spectral information of the NtD map, $\sigma$ can be uniquely determined as a general positive function. + +If infinitely many eigenpairs are known, then the operator itself can be precisely characterized using infinitely many feature channels by Reproducing Kernel Hilbert Space (RKHS) theory, e.g., Mercer (1909); Aronszajn (1950); Minh et al. (2006); Morris (2015); Kadri et al. (2016); Lu et al. (2022). In the context of EIT, this is known as the "full measurement". A more challenging and practical problem is to recover $\sigma$ from only finitely many boundary data pairs. A common practice for the theoretical study of reconstruction using finite measurements is the assumption of $\sigma$ being a piecewise constant function. The task is usually set to recover the shape and location of the inclusion $D$ . Otherwise, the problem is too ill-posed. With finite measurements, the uniqueness of the inclusion remains a long-standing theoretical open problem, and it can be only established for several special classes of the inclusion shape, such as the convex cylinders in Isakov & Powell (1990) or convex polyhedrons in Barceló et al. (1994). We refer readers to some counter-examples in Kang & Seo (2001) where a two- or three-dimensional ball may not be identified uniquely by one single measurement if the values of $\sigma_0$ and $\sigma_1$ are unknown. + +Furthermore, here we provide one example to illustrate the difficulty in the reconstruction procedure (Pidcock et al., 1995). Let $\Omega$ be a unit circle, let $D$ be a circle with the radius $\rho < 1$ , and define + +$$ +\sigma (x) = \left\{ \begin{array}{l l} 1 & \text {i f} \| x \| \geq \rho , \\ \sigma_ {1} & \text {i f} \| x \| < \rho , \end{array} \right. \tag {24} +$$ + +with $\sigma_{1} < 1$ being an arbitrary constant. In this case, the eigenpairs of $\Lambda_{\sigma}$ can be explicitly calculated + +$$ +\lambda_ {l} = \frac {1}{l} \frac {1 - \rho^ {2 l} \mu}{1 + \rho^ {2 l} \mu}, \quad \nu_ {m} = \frac {1}{\sqrt {2 \pi}} \cos (l \theta) \text {o r} \frac {1}{\sqrt {2 \pi}} \sin (l \theta), l = 1, 2, \dots , \tag {25} +$$ + +with $\mu = (1 - \sqrt{\sigma_1}) / (1 + \sqrt{\sigma_1})$ , which are exactly the Fourier modes in a unit circle. In this case, if the set of basis $\{g_l\}_{l=1}^{\infty}$ is just chosen as $\{\cos(\theta), \sin(\theta), \cos(2\theta), \sin(2\theta), \ldots\}$ , the matrix representation $\mathbf{A}_{\sigma}$ in (3) can be written as an infinite diagonal matrix + +$$ +\mathbf {A} _ {\sigma} \left[ \begin{array}{c c c c} (1 - \rho^ {2} \mu) / (1 + \rho^ {2} \mu) & 0 & 0 & 0 \\ 0 & (1 - \rho^ {4} \mu) / (1 + \rho^ {4} \mu) & 0 & 0 \\ 0 & 0 & (1 - \rho^ {4} \mu) / (1 + \rho^ {4} \mu) & 0 \\ 0 & 0 & 0 & \ddots \end{array} \right]. \tag {26} +$$ + +Thanks to this special geometry, eigenvalues in (25) can clearly determine $\rho$ and $\sigma_{1}$ as follows: + +$$ +\rho = \sqrt {\frac {\left(1 - \lambda_ {2}\right) \left(1 + \lambda_ {1}\right)}{\left(1 + \lambda_ {2}\right) \left(1 - \lambda_ {1}\right)}} \quad \text {a n d} \quad \mu = \frac {\left(1 - \lambda_ {1}\right) ^ {2} \left(1 + \lambda_ {2}\right)}{\left(1 + \lambda_ {1}\right) ^ {2} \left(1 - \lambda_ {2}\right)}. \tag {27} +$$ + +However, in practice, $\mathbf{A}_{\sigma}$ does not have such a simple structure. Approximating $\mathbf{A}_{\sigma}$ itself requires a large number of data pairs that are not available in the considered case. Besides, an accurate approximation of the eigenvalues of $\mathbf{A}_{\sigma}$ is also very expensive. Furthermore, for complex inclusion shapes, two eigenvalues are not sufficient to exactly recover the shape and conductivity values. + +# C EXPERIMENT SET-UP + +# C.1 DATA GENERATION AND TRAINING + +In the numerical examples, the data generation mainly follows standard practice in theoretical prototyping for solving EIT problems, see e.g., Chow et al. (2014); Michalikova et al. (2014); Hamilton & Hauptmann (2018); Guo & Jiang (2020); Fan & Ying (2020). For examples, please refer to Figure 2. The computational domain is set to be $\Omega \coloneqq (-1,1)^2$ , and the two media with the different conductivities are with $\sigma_{1} = 10$ (inclusion) and $\sigma_0 = 1$ (background). The inclusions are four random ellipses. The lengths of the semi-major axis and semi-minor axis of these ellipses are sampled from $\mathcal{U}(0.1,0.2)$ and $U(0.2,0.4)$ , respectively. The rotation angles are sampled from $\mathcal{U}(0,2\pi)$ . There are 10800 samples in the training set, from which $20\%$ are reserved as validation. There are 2000 in the testing set for evaluation. + +![](images/34f04a637df6322a42ce9aa719f05a0906c4d2a288c2488faf723f2ee589269e.jpg) +Figure 2: Randomly selected samples of elliptic inclusion to represent the coefficient $\sigma$ (left 1-4). A Cartesian mesh $\Omega_h$ with a grid point $\{z_j\}$ (right). In computation, discretization of $\mathcal{I}^D$ consists of values taken as 1 at the mesh points of $\Omega_h$ inside $D$ and 0 at others. + +![](images/182bdf63668dd4d37d28727a3370dd3e3619d684404a5a025dfac3bfe79e0b70.jpg) + +![](images/4fc566264587fd8b79d7d824159a4f4a0cfd5430d8bc454fe9158295fc14a8f4.jpg) + +![](images/ed8b684ce60172183d14668c60940cf445821328bb1b9591c0461ac5fbb53cd0.jpg) + +![](images/0c84400b45ed22291c266894d2b3778758d220188ab61ddc3127e1e9f91bb2d7.jpg) + +The noise $\xi = \xi (x)$ below (10) is assumed to be + +$$ +\xi (x) = \left(f (x) - \Lambda_ {\sigma_ {0}} g (x)\right) \tau G (x) \tag {28} +$$ + +where $\tau$ specifies the relative strength of noise, and $G(x)$ is a normal Gaussian distribution independent with respect to $x$ . As $\xi (x)$ is merely pointwise imposed, the boundary data can be highly rough, even if the ground truth $f(\cdot) - \Lambda_{\sigma_0}g(\cdot)$ is chosen to be smooth. Nevertheless, the harmonic extension makes the noise from boundary data have a minimal impact on the overall reconstruction, thanks to the smoothing property of the inverse of the Laplacian operator $(- \Delta)^{-1}$ ; for example, please refer to Figure 3. In data generation, the harmonic extension feature map is approximated by finite element methods incorporating stencil modification near the inclusion interfaces (Guo & Lin, 2019; Guo et al., 2019). Similar data augmentation practices using internal data can be found in Nachman et al. (2007); Bal (2013); Jin et al. (2022a). + +Thanks to the position-wise binary nature of $\mathcal{I}^D$ , another choice of the loss function during training can be the binary cross entropy $\mathcal{L}(\cdot, \cdot)$ , applied for a function in $\mathbb{P}$ , to measure the distance between the ground truth and the network's prediction + +$$ +\mathcal {L} \left(\mathbf {p} _ {h}, \mathbf {u} _ {h}\right) := - \sum_ {z \in \mathcal {M}} \left(\mathbf {p} _ {h} (z) \ln \left(\mathbf {u} _ {h} (z)\right) + \left(1 - \mathbf {p} _ {h} (z)\right) \ln \left(1 - \mathbf {u} _ {h} (z)\right)\right). \tag {29} +$$ + +![](images/5412ee77706313089dba9b584064e854e46d36e8326e1ff6358ed3fcf18bced3.jpg) +Figure 3: The harmonic extensions $\phi_l$ with zero noise on boundary (left); the harmonic extensions $\tilde{\phi}_l$ with $20\%$ Gaussian noise on boundary (middle). Their pointwise difference (right). $\| \phi_l - \tilde{\phi}_l\| /\| \phi_l\| = 0.0203$ . + +![](images/491554d58b6194d179d7e275a589b59b5a0323a6e0d575f269bd14b26f874be8.jpg) + +![](images/ea1615747e8c1f01c33219c5d9911ce97db67fe99684e9e22b7da10e0aca73c0.jpg) + +Thanks to the Pinsker inequality (e.g., see (Cover, 1999, Section 11.6)), $\mathcal{L}(\mathbf{p}_h,\mathbf{u}_h)$ serves as a good upper bound for the square of the total variation, which can be further bounded below by the $L^2$ -error given the boundedness of the position-wise value. + +The training uses 1cycle (Smith & Topin, 2019) learning rate strategy with a warm-up phase. A mini-batch ADAM iterations are run for 50 epochs with no extra regularization, such as weight decay. The evaluated model is taken from the epoch that has the best validation metric. The learning rate starts and ends with $10^{-3} \cdot lr_{\max}$ , and reaches the maximum of $lr_{\max}$ at the end of the 10-th epoch. The $lr_{\max} = 10^{-3}$ . The result demonstrated is obtained from fixing the random number generator seed. Figure 6 shows the testing results for a randomly chosen sample. All models are trained on an RTX 3090 or an A4000. The codes to replicate the experiments are open-source and publicly available. $^{1}$ . + +![](images/b197e3b9d035c7cf07cef5ff7661e38d5415fa2f0f0c8cdb756408c049668c6a.jpg) +Figure 4: The left: the training-testing pixel-wise binary cross entropy convergence for the CNN-based U-Net with 31 million parameters, a clear overfitting pattern is shown. The right: the training-testing convergence for the attention-based U-Transformer with 11.4 million parameters. + +![](images/404962dd929c472eeaa220ada55038a94a7aef90b90eef41ed741055dc39b67d.jpg) + +# C.2 NETWORK ARCHITECTURE + +The difference in architectural hyperparameters, together with training and evaluation costs comparison for all the models compared in the task of EIT reconstruction can be found in Table 3. + +# U-Integral Transformer + +- Overall architecture. The U-Integral-Transformer architecture is a drop-in replacement of the standard CNN-based U-Net baseline model (7.7m) in Table 1. The CNN-based U-Net is used in DL-based approaches for boundary value inverse problem in Guo & Jiang (2020); Guo et al. (2021); Le et al. (2022). One of the novelties is that the input is a tensor that concatenates different measurement matrices as different channels, and a similar practice can be found in Brandstetter et al. (2023). Same with the baseline U-Net, the UIT has three downsampling layers as the encoder (feature extractor). The downsampling layers map $m \times m$ latent representations to $m/2 \times m/2$ , and + +![](images/a3e82dd4e926f190eaac2ed2785f1c346af06b65303eb82313b2e506312ad06a.jpg) +Figure 5: The harmonic extension feature map $\phi_l$ (left 1-3 as different channels' inputs to the neural network) corresponding to a randomly chosen sample's inclusion map (right). No visible relevance shown with the ground truth. The layered heatmap appearance is adopted in plotly contour only for aesthetics purposes, no edge-like nor layer-like features can be observed from the actual harmonic extension feature map input. + +![](images/8f61e804caee114bd59b90478fa8af5ce23a1ca9fd091bf142f7f9c982e97f49.jpg) + +![](images/3dd938b1d66fa294af018712d91fab425215e61e1d67b0a400ed1d10607ff18e.jpg) + +![](images/cd70c42f073c08b8a3c7c03d6f66a3c53bd2e58e7fe326a8ea4494fdfac0a0c7.jpg) + +![](images/a61d678ff8476f34052ab2a3318180f222372818d2f29151e1e07df13e537592.jpg) +(a) + +![](images/9a16bc664961de8f453cfeefd916c3d2f6ae1f2e4847aaed1b779b0bd3014d38.jpg) +(b) + +![](images/7ca3c4aedaa99245ceb02f197827e99dbfef130cebf36941ac7b24b349e3a953.jpg) +(c) + +![](images/2c654ba65c559a004acb015508c35c57dbedb2778a5bc7cca6b6af5f5ecbfc04.jpg) +(d) + +![](images/4ce4af9a2fad6d33ead8f05deb970f542f7ff9c29a4447afc2917fa6ae925dc3.jpg) +(e) + +![](images/0dbe9ee7bb9c150e5e7dacdf1ab935e87c65420f260b47d2b7bb6f603d21a812.jpg) +(f) + +![](images/50f688e8c066b1c6a0b3f1f553cd40e2723997f2502599d06272d361be17bc70.jpg) +(g) + +![](images/9825b7b05762a29732a64ca02a359f777dfcdd612e5e36b5e0d9b981a14e3e42.jpg) +(h) + +![](images/0a36d6894d0631ddb586aa0d1830f1727dea664c113c158a8c0a77b222f11b39.jpg) +(i) +Figure 6: The neural network evaluation result for the inclusion in Figure 5 using various models. A model's input is the left most function in Figure 5 if this model uses a single channel, or all left three in Figure 5 if a model uses 3-channel input. (a) Ground truth inclusion in Figure 5; (b) U-Net baseline $(7.7\mathrm{m})$ prediction; (c) U-Net big $(31\mathrm{m})$ prediction with 3 channels; (d) Fourier Neural Operator $(10.4\mathrm{m})$ prediction with 1 channel; (e) Fourier Neural Operator big $(33\mathrm{m})$ prediction with 1 channel; (f) Adaptive Fourier Neural Operator $(10.7\mathrm{m})$ prediction with 1 channel; (g) Multiwavelet Neural Operator $(9.8\mathrm{m})$ prediction with 1 channel; (h) Hybrid UT with a linear attention $(10.13\mathrm{m})$ prediction with 1 channel; (i) UIT $(11.4\mathrm{m})$ prediction with 1 channel; (j) UIT $(11.4\mathrm{m})$ prediction with 3 channels. + +![](images/7e575ba1882213b21187a72f1615e574978a526b3a94439279b1cffa72cc55fc.jpg) +(j) + +expand the number of channels from $C$ to $2C$ . To leverage the "basis $\Leftrightarrow$ channel" interpretation and the basis update nature of the attention mechanism in Section 3.3, the proposed attention block is first added on the coarsest grid, which has the most number of channels. UIT has three upsampling layers as the decoder (feature selector), which map $m/2 \times m/2$ latent representations to $m \times m$ , and shrink the number of channels from $2C$ to $C$ . In these upsampling layers, attention blocks are applied on each cross-layer propagation to compute the interaction between the latent representations on both coarse and fine grids (see below). Please refer to Figure 8 for a high-level encoder-decoder schematic. + +- Double convolution block. The double convolution block is modified from that commonly seen in Computer Vision (CV) models, such as ResNet (He et al., 2016). We modify this block such that upon being used in an attention block, the batch normalization (Ioffe & Szegedy, 2015) can be replaced by the layer normalization (Ba et al., 2016), which can be understood as a learnable approximation to the Gram matrices' inverse by a diagonal matrix. +- Positional embedding. At each resolution, the 2D Euclidean coordinates of an $m \times m$ regular Cartesian grid are the input of a channel expansion through a fixed learnable linear layer and are + +then added to each latent representation. This choice of positional embedding enables a bilinear interpolation between the coarse and fine grids or vice versa (see below). + +- Mesh-normalized attention. The scaled dot-product attention in the network is chosen to be the integral kernel attention in (11) with a mesh-based normalization. Please refer to Figure 7 for a diagram in a single attention head. + +![](images/a80f7d7e54eca089516ca0ff2f0a36fcd870ee752be26f092a2f5b5e1184bb5e.jpg) +Figure 7: Detailed flow of the modified 2D attention-based encoder layer using (11). $C$ : the number of channels in the input, $N$ : the number of expanded channels (for the basis expansion interpretation in Theorem 2). + +- Interpolation. Instead of max pooling used in the standard CNN-based U-Net, we opt for a bilinear interpolation on the Cartesian grid to map a latent representation from the fine grid to the coarse grid or vice versa. Note that, in the upsampling layers, the interpolation's outputs are directly inputted into an attention block that computes the interaction of latent representations between coarse and fine grids (see below). +- Coarse-fine attention in up blocks. A modified attention in Section 3.3 with a pre-inner-product normalization replaces the convolution layer on the coarsest level. The skip connection from the encoder latent representations to the ones in the decoder are generated using an architecture similar to the cross attention used in Petit et al. (2021). $Q$ and $K$ are generated from the latent representation functions on the same coarser grids. As such, the attention kernel to measure the interaction between different channels is built from the coarse grid. $V$ is associated with a finer grid. Compared with the one in Petit et al. (2021), the modified attention in our method is inspired by the kernel integral for a PDE problem. Thus, it has (1) no softmax normalization or (2) no Hadamard product-type skip connection. + +# Other operator learners compared + +- Fourier Neural Operator (FNO) and variants. Fourier Neural Operator (FNO2d) learns convolutional filters in the frequency domain for some pre-selected modes, efficiently capturing globally-supported spatial interactions for these modes. The weight filter in the frequency domain multiplies with the lowest modes in the latent representations (four corners in the FFT). The Adaptive Fourier Neural Operator (AFNO2d) adds a token-mixing layer, as seen in Figure 2 in Guibas et al. (2022), appending every spectral convolution layer in the baseline FNO2d model. +- Multi-Wavelet Neural Operator (MWO). The MultiWavelet Neural Operator (MWO) is proposed in Gupta et al. (2021), which introduces a multilevel structure into the FNO architecture. MWO still follows FNO's practice on each level by pre-selecting the lowest modes. + +# D FROM DSM TO TRANSFORMER + +This section gives a more detailed presentation of how the attention-like operator is derived from the DSM ansatz (15) with learnable kernels. + +We begin with recalling the original indicator function from (10): + +$$ +\mathcal {I} ^ {D} (x) := C _ {f, g} \frac {\mathrm {d} (x) \cdot \nabla \phi (x)}{\left| \eta_ {x} \right| _ {H ^ {s} (\partial \Omega)}}, \tag {30} +$$ + +where $C_{f,g} = \| f - \Lambda_{\sigma_0}g\|_{L^2 (\partial \Omega)}^{-1}$ is a constant, and the equations of the functions $\phi$ and $\eta_{x}$ are: + +$$ +- \Delta \phi = 0 \quad \text {i n} \quad \Omega , \quad \mathbf {n} \cdot \nabla \phi = (f - \Lambda_ {\sigma_ {0}} g) + \xi \quad \text {o n} \quad \partial \Omega , \quad \int_ {\partial \Omega} \phi d s = 0, \tag {31} +$$ + +Table 3: The detailed comparison of the networks used in this study. For U-Net-based neural networks, the channel/width is the number of the base channels on the finest grid after the initial channel expansion. A torch.cfloat type parameter entry counts as two parameters. GFLOPs: Giga FLOPs for 1 backpropagation (BP) performed for a batch of 8 samples recorded the PyTorch autograd profiler for 1 BP averaging from 100 BPs. Eval: number of instances per second. + +
ArchitecturesTraining/Evaluation cost# params
layerschannel/widthmodesnormGFLOPseval
U-Net764N/Abatch140.6298.67.70m
U-Net big964N/Abatch184.1273.431.04m
FNO2d64814FFT196.5235.410.86m
AFNO2d64814FFT198.4151.010.88m
MWO2d46412Legendre105959.69.81m
Hybrid UT732N/Abatch427.5114.010.13m
Cross-Attn UT764N/Alayer658.9103.311.42m
UIT (ours)764N/Alayer658.3104.811.43m
+ +![](images/ff6fa2a6009243c9d23b31cc8b06b607ba06010db6a9570aabf54ca0a47f1991.jpg) +Figure 8: A simplified schematic of the U-Integral-Transformer that follows the standard U-Net. The input is a tensor concatenating the discretizations of $\phi$ and $\nabla \phi$ . The output is the approximation to the index function $\mathcal{I}^D$ . $\square$ : $3 \times 3$ convolution + ReLU; $\square$ : layer normalization or batch normalization; $\square$ : bilinear interpolations from the fine grid to the coarse grid; $\square$ : cross attention $\mathcal{A}_c$ that uses the latent representations on a coarse grid to compute interactions to produce the latent representations on a finer grid; $\square$ : input and output discretized functions in certain Hilbert spaces. The TikZ source code to produce this figure is modified from the examples in Iqbal (2018). + +$$ +- \Delta \eta_ {x} = - \mathbf {d} (x) \cdot \nabla \delta_ {x} \quad \text {i n} \quad \Omega , \quad \mathbf {n} \cdot \nabla \eta_ {x} = 0 \quad \text {o n} \quad \partial \Omega , \quad \int_ {\partial \Omega} \eta_ {x} d s = 0. \tag {32} +$$ + +Chow et al. (2014) shows that $\mathcal{I}^D(x)$ can be written as a sum of Gaussian-like distributions that attain maximum values for $x \in D$ or close to $D$ . However, the accuracy is much limited by empirical choices of quantities in (30), for example, $\mathbf{d}(x) = \nabla \phi(x) / \|\nabla \phi(x)\|$ and $s = 3/2$ . In addition, the frequency of the boundary data plays an important role in reconstruction; see the derivation in Chow et al. (2014, Section 5) for circular $\Omega$ . What is more, such a simple formula can be derived only for a single data pair. + +Henceforth, these "empirical chosen quantities" are made to be learnable from data by introducing two undetermined kernels $\mathcal{K}(x,y),\mathcal{Q}(x,y)$ , and a self-adjoint positive definite linear operator $\nu$ , the modified indicator function is written as + +$$ +\hat {\mathcal {I}} _ {1} ^ {D} (x) := C _ {f, g} \frac {\int_ {\Omega} \mathbf {d} (x) \cdot \mathcal {K} (x , y) \nabla \phi (y) \mathrm {d} y}{| \eta_ {x} | _ {Y}}. \tag {33} +$$ + +with + +$$ +\mathbf {d} (x) := \int_ {\Omega} \mathcal {Q} (x, y) \nabla \phi (y) \mathrm {d} y. \tag {34} +$$ + +$$ +\left| \eta_ {x} \right| _ {Y} ^ {2} := \left(\mathcal {V} \eta_ {x}, \eta_ {x}\right) _ {L ^ {2} (\partial \Omega)}. \tag {35} +$$ + +Applying certain quadrature rule to (33) with the quadrature points $z_{i}$ , i.e., the grid points of $\Omega_h$ , and weights $\{\omega_j\}$ , we obtain an approximation to the integral: + +$$ +\int_ {\Omega} \mathcal {K} \left(z _ {i}, y\right) \partial_ {x _ {n}} \phi (y) \mathrm {d} y \approx \sum_ {j} \omega_ {j} \mathcal {K} \left(z _ {i}, z _ {j}\right) \partial_ {x _ {n}} \phi \left(z _ {j}\right) =: \mathbf {k} _ {i} ^ {T} \boldsymbol {\phi} _ {n}, \tag {36} +$$ + +i.e., $\mathbf{q}_i^T$ is the vector of $[\omega_j\mathcal{K}(z_i,z_j)]_j$ . For (34), we consider one component $d_{n}(x)$ of $\mathbf{d}(x)$ . With the same rule to compute the integral, (16) can be written as + +$$ +d _ {n} \left(z _ {i}\right) \approx \sum_ {j} \omega_ {j} \mathcal {Q} \left(z _ {i}, z _ {j}\right) \partial_ {x _ {n}} \phi \left(z _ {j}\right) =: \mathbf {q} _ {i} ^ {T} \phi_ {n}, \tag {37} +$$ + +i.e., $\mathbf{q}_i^T$ is the vector of $[\omega_j\mathcal{Q}(z_i,z_j)]_j$ . Next, we proceed to express $|\eta_{z_i}|_Y$ by discretizing the variational form in (32) using a linear finite element method (FEM). Applying integration by parts, the weak form of (32) at $x = z_{i}$ is + +$$ +\int_ {\Omega} \nabla \eta_ {z _ {i}} \cdot \nabla \psi \mathrm {d} y = \int_ {\Omega} - \mathbf {d} \left(z _ {i}\right) \cdot \nabla \delta_ {z _ {i}} (y) \psi (y) \mathrm {d} y = - \mathbf {d} \left(z _ {i}\right) \cdot \nabla \psi \left(z _ {i}\right), \tag {38} +$$ + +for any test function $\psi \in H_0^1 (\Omega)$ . Here, we let $\{\psi^{(j)}\}_{j = 1}^{M}$ be the collection of the finite element basis functions, and for the fixed $z_{i}$ we further let $\psi_{n,i}$ be the vector approximating $[\partial_{x_n}\psi^{(j)}(z_i)]_{j = 1}^M$ . Denote $\pmb{\eta}_i$ as the vector approximating $\{\eta_{z_i}(z_j)\}_{j = 1}^M$ . Introduce the matrices + +- $B$ : the finite element/finite difference discretization of $-\Delta$ on $\Omega_h$ (a discrete Laplacian) coupled with the Neumann boundary condition and the zero integral normalization condition in (9). +- $R$ : the matrix that projects a vector defined at interior grids to the one defined on $\partial \Omega$ . + +Then, the finite element discretization of (38) yields the linear system: + +$$ +B \boldsymbol {\eta} _ {i} = \sum_ {n} d _ {n} \left(z _ {i}\right) \boldsymbol {\psi} _ {n, i} \approx \sum_ {n} \boldsymbol {\psi} _ {n, i} \mathbf {q} _ {i} ^ {T} \boldsymbol {\phi} _ {n}, \tag {39} +$$ + +where we have used (37). Then, the trace of $\eta_{z_i}$ on $\partial \Omega$ admits the following approximation + +$$ +\bar {\eta} _ {i} := \left. \eta_ {z _ {i}} \right| _ {\partial \Omega} \approx \sum_ {n} R B ^ {- 1} \psi_ {n, i} \mathbf {q} _ {i} ^ {T} \phi_ {n}. \tag {40} +$$ + +Now, we can discretize (35). Note that the trace of a linear finite element space on $\partial \Omega$ is still a continuous piecewise linear space, defined as $S_{h}(\partial \Omega)$ . Then, the self-adjoint positive definite operator $\mathcal{V}$ can be parameterized by a symmetric positive definite (SPD) matrix denoted by $V$ operating on the space $S_{h}(\partial \Omega)$ . We can approximate $|\eta_{z_i}|_Y^2$ as + +$$ +\left| \eta_ {z _ {i}} \right| _ {Y} ^ {2} \approx \bar {\boldsymbol {\eta}} _ {i} ^ {T} V \bar {\boldsymbol {\eta}} _ {i} \approx \sum_ {n} \boldsymbol {\psi} _ {n, i} ^ {T} B ^ {- 1} R ^ {T} V R B ^ {- 1} \boldsymbol {\psi} _ {n, i} \boldsymbol {\phi} _ {n} ^ {T} \mathbf {q} _ {i} \mathbf {q} _ {i} ^ {T} \boldsymbol {\phi} _ {n} \tag {41} +$$ + +where $\psi_{n,i}^{T}B^{-1}R^{T}VRB^{-1}\psi_{n,i}\geq 0$ as $V$ is SPD. Define + +$$ +\mathbf {v} _ {n, i} = \left(\boldsymbol {\psi} _ {n, i} ^ {T} B ^ {- 1} R ^ {T} V R B ^ {- 1} \boldsymbol {\psi} _ {n, i}\right) ^ {1 / 2} \mathbf {q} _ {i}. \tag {42} +$$ + +This can be considered another learnable vector since the coefficient of $\mathbf{q}_i$ comes from the learnable matrix $V$ . Then, (41) reduces to + +$$ +\left| \eta_ {z _ {i}} \right| _ {Y} ^ {2} \approx \sum_ {n} \phi_ {n} ^ {T} \mathbf {v} _ {n, i} \mathbf {v} _ {n, i} ^ {T} \phi_ {n} \tag {43} +$$ + +Putting (36), (37) and (43) into (15), we have + +$$ +\hat {\mathcal {I}} _ {1} ^ {D} \left(z _ {i}\right) \approx \left\{\| f - \Lambda_ {\sigma_ {0}} g \| _ {L ^ {2} (\partial \Omega)} ^ {- 1} \left(\sum_ {n} \phi_ {n} ^ {T} \mathbf {v} _ {n, i} \mathbf {v} _ {n, i} ^ {T} \phi_ {n}\right) ^ {- 1 / 2} \right\} \sum_ {n} \phi_ {n} ^ {T} \mathbf {q} _ {i} \mathbf {k} _ {i} ^ {T} \phi_ {n}. \tag {44} +$$ + +Now, using the notation in (21), we get the desired representation (22). + +# E PROOF OF THEOREM 1 + +Lemma 1. Suppose the boundary data $g_{l}$ is the eigenfunction of $\Lambda_{\sigma} - \Lambda_{\sigma_0}$ corresponding to the $l$ -th eigenvalue $\lambda_{l}$ , and let $\phi_l$ be the data functions generated by harmonic extensions + +$$ +- \Delta \phi_ {l} = 0 \quad i n \quad \Omega , \quad \mathbf {n} \cdot \nabla \phi_ {l} = \left(f _ {l} - \Lambda_ {\sigma_ {0}} g _ {l}\right) = \left(\Lambda_ {\sigma} - \Lambda_ {\sigma_ {0}}\right) g _ {l} \quad o n \quad \partial \Omega , \quad \int_ {\partial \Omega} \phi_ {l} d s = 0, \tag {45} +$$ + +where $l = 1,2,\dots$ .Let $\mathbf{d}$ be an arbitrary unit vector in $\mathbb{R}^2$ , define a function + +$$ +\Theta_ {L} (x) = \sum_ {l = 1} ^ {L} \frac {\left(\mathbf {d} \cdot \nabla \phi_ {l} (x)\right) ^ {2}}{\lambda_ {l} ^ {3}}. \tag {46} +$$ + +Then, there holds + +$$ +\lim _ {L \rightarrow \infty} \Theta_ {L} (x) = \left\{\begin{array}{l l}\infty ,&i f x \notin D,\\a \text {f i n i t e c o n s t a n t},&i f x \in D.\end{array}\right. \tag {47} +$$ + +Proof. See Theorem 4.1 in Guo & Jiang (2020), and also see Bruhl (2001); Hanke & Bruhl (2003). $\square$ + +Theorem 1 (A finite-dimensional approximation of the index function). Suppose the boundary data $g_{l}$ is the eigenfunction of $\Lambda_{\sigma} - \Lambda_{\sigma_0}$ corresponding to the $l$ -th eigenvalue $\lambda_{l}$ , and let $\phi_l$ be the data functions generated by harmonic extensions given in (9). Define the space: + +$$ +\widetilde {\mathbb {S}} _ {L} = \operatorname {S p a n} \left\{\partial_ {x _ {1}} \phi_ {l} \partial_ {x _ {2}} \phi_ {l}: l = 1, \dots , L \right\}, \tag {48} +$$ + +and the dictionary: + +$$ +\mathbb {S} _ {L} = \left\{a _ {1} + a _ {2} \arctan \left(a _ {3} v\right): v \in \widetilde {\mathbb {S}} _ {L}, a _ {1}, a _ {2}, a _ {3} \in \mathbb {R} \right\}. \tag {49} +$$ + +Then, for any $\epsilon > 0$ , we can construct an index function $\mathcal{I}_L^D \in \mathbb{S}_L$ s.t. + +$$ +\sup _ {x \in \Omega} | \mathcal {I} ^ {D} (x) - \mathcal {I} _ {L} ^ {D} (x) | \leq \epsilon \tag {50} +$$ + +provided $L$ is large enough. + +Proof. Consider the function $\Theta_L(x)$ from Lemma 1. As $\Theta_L(x) > 0$ , it is increasing with respect to $L$ . Then, there is a constant $\rho$ such that $\rho > \Theta_L(x), \forall x \in D$ . Given any $\epsilon > 0$ , there is an integer $L$ such that $\Theta_L(x) > 4\rho\epsilon^{-2}/\pi^2, \forall x \notin D$ . Define + +$$ +\mathcal {I} _ {L} ^ {D} (x) = 1 - \frac {2}{\pi} \arctan \left(\frac {\pi \epsilon}{2 \rho} \Theta_ {L} (x)\right) \tag {51} +$$ + +Note the fundamental inequality $z > \arctan (z)\geq \frac{\pi}{2} -z^{-1},\forall z > 0$ . Then, if $x\in D$ , there holds + +$$ +\left| \mathcal {I} ^ {D} (x) - \mathcal {I} _ {L} ^ {D} (x) \right| = \frac {2}{\pi} \arctan \left(\frac {\pi \epsilon}{2 \rho} \Theta_ {L} (x)\right) < \frac {\epsilon}{\rho} \Theta_ {L} (x) < \epsilon +$$ + +if $x\notin D$ , there holds + +$$ +| \mathcal {I} ^ {D} (x) - \mathcal {I} _ {L} ^ {D} (x) | = 1 - \frac {2}{\pi} \arctan \left(\frac {\pi \epsilon}{2 \rho} \Theta_ {L} (x)\right) \leq \frac {4 \rho}{\pi^ {2} \epsilon \Theta_ {L} (x)} < \epsilon . +$$ + +Therefore, the function in (51) fulfills (50). + +# F PROOF OF THEOREM 2 + +In presenting Theorem 2 in Section 3.3, we use the term "multiplicative" to describe the fact that two latent representations are multiplied in the attention mechanism. In contrast, no such operation exists in, e.g., a pointwise FFN or a convolution layer. Heuristically speaking, the main result in Theorem 2 states that the output latent representations can be of a higher "frequency" than the input if the neural network architecture has "multiplicative" layers in it. The input latent representations are discretizations of certain functions, and they are combined using matrix dot product as the one used in attention. Suppose that this discretization can represent functions of such a frequency with a certain approximation error, the resulting matrix/tensor can be an approximation of a function with a higher frequency than the existing latent representation under the same discretization. Please see Figure 9 and Figure 10 for empirical evidence of this phenomenon for the latent representations: with completely smooth input (harmonic extensions), e.g., see Figure 5, attention-based learner can generate latent representations with multiple peaks and valleys. + +Theorem 2 (Frequency-bootstrap for multiplicative neural architectures). Consider $\Omega = (0, \pi)$ which has a uniform discretization of $\{z_i\}_{i=1}^M$ of size $h$ , and $v(x) = \sin(ax)$ for some $a \in \mathbb{Z}^+$ . Let $N := a - 1 \geq 1$ be the number of channels in the attention layer of interest, assume that (i) the current latent representation $\mathbf{p}_h \in \mathbb{R}^{M \times N}$ consists of the discretization of the first $N$ Legendre polynomials $\{p_j(\cdot)\}_{j=1}^N$ such that $(\mathbf{p}_h)_{ij} = p_j(z_i)$ , (ii) $\mathbf{p}_h$ is normalized and the normalization weights $\alpha \equiv 1$ in (14), (iii) the discretization satisfies that $|\sum_{i=1}^M hf(z_i) - \int_{\Omega} f(x) \, \mathrm{d}x| \leq C h$ . Then, there exists a set of attention weights $\{W^Q, W^K, W^V\}$ such that for $u(x) = \sin(a'x)$ with $\mathbb{Z}^+ \ni a' > a$ + +$$ +\left\| \tilde {u} - u \right\| _ {L ^ {2} (\Omega)} \leq C \max \{h, \| \varepsilon \| _ {L ^ {\infty} (\Omega)} \}, \tag {52} +$$ + +where $\tilde{u}$ and $\tilde{\kappa} (\cdot ,\cdot)$ are defined as the output of and the kernel of the attention formulation in (14), respectively; $\varepsilon (x)\coloneqq \| \kappa (x,\cdot) - \tilde{\kappa} (x,\cdot)\|_{L^2 (\Omega)}$ is the error function for the kernel approximation. + +Proof. Without loss of generality, it is assumed that $a' = a + 1$ . The essential technical tools used suggest the validity for any $a' > a > 0$ ( $a', a \in \mathbb{Z}^+$ ). Consider a simple non-separable smooth kernel function + +$$ +\kappa (x, z) := \sin ((a + 1) (x - z)), \tag {53} +$$ + +it is straightforward to verify that for $v(x) \coloneqq \sin(ax)$ , we have $c_1 = 2a / (2a + 1)$ . + +$$ +\int_ {\Omega} \kappa (x, z) v (x) \mathrm {d} x = \int_ {\Omega} \sin \left((a + 1) (x - z)\right) \sin (a x) \mathrm {d} x = c _ {1} \sin \left((a + 1) z\right) =: c _ {1} u (z). \tag {54} +$$ + +As is shown, it suffices to show that the matrix multiplication (a separable kernel) in the attention mechanism approximates this non-separable kernel with an error related to the number of channels. To this end, taking the Taylor expansion, centered at a $z_0 \in \Omega$ of $\kappa(x, \cdot)$ with respect to the second variable at each $x \in \Omega$ , we have + +$$ +\kappa_ {N} (x, z) := \sum_ {l = 1} ^ {N} \frac {(z - z _ {0}) ^ {l - 1}}{(l - 1) !} \frac {\partial^ {l - 1} \kappa}{\partial z ^ {l - 1}} (x, z _ {0}). \tag {55} +$$ + +It is straightforward to check that + +$$ +\left\| \kappa (x, \cdot) - \kappa_ {N} (x, \cdot) \right\| _ {L ^ {2} (\Omega)} \leq c _ {1} \frac {\sqrt {\left(\pi - z _ {0}\right) ^ {2 N + 1} + z _ {0} ^ {2 N + 1}}}{N ! \sqrt {2 N + 1}} \left\| \frac {\partial^ {N} \kappa}{\partial z ^ {N}} (x, \cdot) \right\| _ {L ^ {\infty} (\Omega)}. \tag {56} +$$ + +By the assumptions on $\kappa (\cdot ,\cdot)$ , and a straightforward computation we have + +$$ +\left\| \kappa (x, \cdot) - \kappa_ {N} (x, \cdot) \right\| _ {L ^ {2} (\Omega)} \leq c _ {2} \frac {(\pi) ^ {N}}{N ! \sqrt {N}} \left\| \frac {\partial^ {N} \kappa}{\partial z ^ {N}} (x, \cdot) \right\| _ {L ^ {\infty} (\Omega)}. \tag {57} +$$ + +Next, let $q_{l}(z) \coloneqq (z - z_{0})^{l - 1} / (l - 1)!$ and $k_{l}(x) \coloneqq \partial^{l - 1}\kappa /\partial z^{l - 1}(x,z_0)$ for $1\leq l\leq N$ , i.e., they form a Pincherle-Goursat (degenerate) kernels (Kress, 1999, Chapter 11) + +$$ +\kappa_ {N} (x, z) = \sum_ {l = 1} ^ {N} q _ {l} (x) k _ {l} (z). \tag {58} +$$ + +By this choice of the latent representation space being the first $N$ Legendre polynomials, $q_{l}\in \mathbb{Y}:= \operatorname {span}\{p_{j}\}$ , thus there exists a set of weights $\{w_l^Q\in \mathbb{R}^l\}_{l = 1}^N$ corresponding to each channel, such that + +$$ +q _ {l} (\cdot) = \sum_ {j = 1} ^ {N} w _ {l, j} ^ {Q} p _ {j} (\cdot) =: \tilde {q} _ {l} (\cdot). \tag {59} +$$ + +This is to say, $Q = \mathbf{p}_h W^Q \in \mathbb{R}^{M \times N}$ with the $l$ -th column of $Q$ being the discretization of $\tilde{q}_l(\cdot)$ . + +For the key matrix, by standard polynomial approximation since $\mathbb{Y} \simeq \mathbb{P}_N(\Omega)$ , there exists a set of weights $\{w_l^K \in \mathbb{R}^N\}_{l=1}^N$ , such that + +$$ +k _ {l} (\cdot) \approx \sum_ {j = 1} ^ {N} w _ {l, j} ^ {K} p _ {j} (\cdot) =: \tilde {k} _ {l} (\cdot), \tag {60} +$$ + +i.e., $K = \mathbf{p}_h W^K \in \mathbb{R}^{M \times N}$ with the $l$ -th column of $K$ being the discretization of $\tilde{k}_l(\cdot)$ . Moreover, it can approximate $k_l(\cdot)$ with the following estimate + +$$ +\left\| k _ {l} (\cdot) - \tilde {k} _ {l} (\cdot) \right\| _ {L ^ {2} (\Omega)} \leq c _ {3} \frac {\pi^ {N}}{2 ^ {N} (N + 1) ^ {N}} \left| k _ {l} (\cdot) \right| _ {H ^ {N} (\Omega)}. \tag {61} +$$ + +Similarly, without loss of generality, we choose $v(\cdot) \coloneqq v_{1}(\cdot)$ , which is concatenated to $V$ such that it occupies the first channel of $V$ defined earlier, we have $\{w_l^V \in \mathbb{R}^N\}$ such that + +$$ +v (\cdot) \approx \sum_ {j = 1} ^ {N} w _ {1, j} ^ {K} p _ {j} (\cdot) =: \tilde {v} (\cdot) \tag {62} +$$ + +and + +$$ +\left\| v (\cdot) - \tilde {v} (\cdot) \right\| _ {L ^ {2} (\Omega)} \leq c _ {4} \frac {\pi^ {N}}{2 ^ {N} (N + 1) ^ {N}} | v (\cdot) | _ {H ^ {N} (\Omega)}. \tag {63} +$$ + +Now, to approximate the frequency bootstrapping in (54), define + +$$ +\tilde {u} (z) := \int_ {\Omega} \tilde {\kappa} _ {N} (x, z) \tilde {v} (x) \mathrm {d} x, \quad \text {w i t h} \tilde {\kappa} _ {N} (x, z) := \sum_ {l = 1} ^ {N} \tilde {q} _ {l} (x) \tilde {k} _ {l} (z). \tag {64} +$$ + +Then, we have for any $z\in \Omega$ + +$$ +\begin{array}{l} u (z) - \tilde {u} (z) = \int_ {\Omega} \kappa (x, z) v (x) d x - \int_ {\Omega} \kappa_ {N} (x, z) \tilde {v} (x) d x \\ = \int_ {\Omega} (\kappa (x, z) - \tilde {\kappa} _ {N} (x, z)) v (x) d x + \int_ {\Omega} \kappa_ {N} (x, z) (v (x) - \tilde {v} (x)) d x. \tag {65} \\ \end{array} +$$ + +Thus, we have + +$$ +\begin{array}{l} \| u - \tilde{u}\|_{L^{\infty}(\Omega)}\leq \max_{z\in \Omega}\left\{\int_{\Omega}\big|\big(\kappa (x,z) - \tilde{\kappa}_{N}(x,z)\big)v(x)\big|\mathrm{d}x + \int_{\Omega}\big|\kappa_{N}(x,z)\big(v(x) - \tilde{v} (x)\big)\big|\mathrm{d}x\right\} \\ \leq \max _ {z \in \Omega} \left\{\underbrace {\| \kappa (x , \cdot) - \tilde {\kappa} _ {N} (x , \cdot) \| _ {L ^ {2} (\Omega)}} _ {(*)} \| v \| _ {L ^ {2} (\Omega)} + \| \tilde {\kappa} _ {N} (x, \cdot) \| _ {L ^ {2} (\Omega)} \| v - \tilde {v} \| _ {L ^ {2} (\Omega)} \right\}. \tag {66} \\ \end{array} +$$ + +Now, by triangle inequality, $q_{l} = \tilde{q}_{l}$ , the definitions above (53) implying $|k_{l}(\cdot)|_{H^{N}(\Omega)} \leq c2^{N}$ and $\| q_{l}\|_{L^{2}(\Omega)} \leq c\pi^{N} / (\sqrt{N} N!)$ , and the estimate in (61) + +$$ +\begin{array}{l} (*) \leq \| \kappa (x, \cdot) - \kappa_ {N} (x, \cdot) \| _ {L ^ {2} (\Omega)} + \| \kappa_ {N} (x, \cdot) - \tilde {\kappa} _ {N} (x, \cdot) \| _ {L ^ {2} (\Omega)} \\ \leq \| \kappa (x, \cdot) - \kappa_ {N} (x, \cdot) \| _ {L ^ {2} (\Omega)} + \sum_ {l = 1} ^ {N} \| q _ {l} \| _ {L ^ {2} (\Omega)} \| k _ {l} - \tilde {k} _ {l} \| _ {L ^ {2} (\Omega)} \\ \leq c _ {5} \left(\frac {(2 \pi) ^ {N}}{N ! \sqrt {N}} + c _ {6} \frac {\pi^ {N}}{2 ^ {N} (N + 1) ^ {N}} \sum_ {l = 1} ^ {N} \| q _ {l} \| _ {L ^ {2} (\Omega)} | k _ {l} (\cdot) | _ {H ^ {N} (\Omega)}\right) \tag {67} \\ \leq c _ {6} \frac {(2 \pi) ^ {N}}{N ! \sqrt {N}}. \\ \end{array} +$$ + +Notice this is the same order with the estimate of $\| \kappa (x,\cdot) - \kappa_N(x,\cdot)\|_{L^2 (\Omega)}$ . For the term $\| \tilde{\kappa}_N(x,\cdot)\|_{L^2 (\Omega)}$ , a simple triangle inequality trick can be used: + +$$ +\begin{array}{l} \| \tilde {\kappa} _ {N} (x, \cdot) \| _ {L ^ {2} (\Omega)} \leq \| \kappa_ {N} (x, \cdot) \| _ {L ^ {2} (\Omega)} + \| \kappa_ {N} (x, \cdot) - \tilde {\kappa} _ {N} (x, \cdot) \| _ {L ^ {2} (\Omega)} \\ \leq \left\| \kappa (x, \cdot) \right\| _ {L ^ {2} (\Omega)} + \left\| \kappa_ {N} (x, \cdot) - \tilde {\kappa} _ {N} (x, \cdot) \right\| _ {L ^ {2} (\Omega)}, \tag {68} \\ \end{array} +$$ + +which can be further estimated by reusing the argument in (67). + +Lastly, using the following argument and the estimate for $\| u - \tilde{u}\|_{L^{\infty}(\Omega)}$ yield the desired result: + +$$ +\left\| u - \tilde {u} \right\| _ {L ^ {2} (\Omega)} ^ {2} \leq \left\| u - \tilde {u} \right\| _ {L ^ {1} (\Omega)} \left\| u - \tilde {u} \right\| _ {L ^ {\infty} (\Omega)} \leq 2 \max | u | \| u - \tilde {u} \| _ {L ^ {\infty} (\Omega)} ^ {2}. \tag {69} +$$ + +![](images/9c118af466484ffebbdd7639b03ba60793e6c4101fe1c1da3791181377534ff3.jpg) + +![](images/739790762ee7f66c41775a9200293fc877fd65d4aebc3a6794b032f524d819db.jpg) +(a) + +![](images/9793810a7edc9544eee3cef009bb2771b2496f672e6207288a59387a8f80a5a0.jpg) +(b) + +![](images/f97b102ee505e5249742d878db9c69ffcfdc01cd66a15432309f0666b1fabe9d.jpg) +(c) + +![](images/80cfd3f7b767205aec7cebf83e96d379d7c9edc5d1206a3aff83d999555fd9a9.jpg) +(d) + +![](images/90b04515391d9d5e1525baecc13f811d6c254f036d61c70c12faca2b78bdec4c.jpg) +(e) + +![](images/d3c186c02e265fe8633f75b3900302eac408deffb33d5141e9e542887a106d56.jpg) +(f) + +![](images/b29597ccdf5730773f39f7f03738e985f578d1751012e8bc355b3fa55e2866e6.jpg) +(g) + +![](images/207e11e19db613ef640144e7939de03be533197dbf88c82fc2e50e3b9d37b347.jpg) +(h) + +![](images/aa20036ead71a3f8f02ae7a11852b352e5440360709223ea95f90958d9b598fa.jpg) +(i) + +![](images/54f9605579a0539ed01f063351b4e2638453c3bba0a1330ef626e543e3521dfd.jpg) +(j) + +![](images/be7cf5a9b43d4e20f8c97304d635724e9c093fc7a97da55f982674b4777cb4ea.jpg) +(k) + +![](images/becaca1d1fcbdf276908ac4bd9d60246b98264980d8a707422ec721d1de53063.jpg) +(1) + +![](images/612da352d07eea18025ae7f65d0c400ea995651bbbb18927eac37553f41e7416.jpg) +Figure 9: The latent representations from CNN-based UNet when evaluating for the sample in Figure 5, in their respective layers, 4 latent representations are extracted from 4 randomly selected channels: (a)-(d) are from the feature extracting layer (layer 1, $128 \times 128$ grid), (e)-(h) are from the middle layer acting on the coarsest level ( $32 \times 32$ grid), (i)-(l) are from the next level ( $64 \times 64$ grid). + +![](images/bd628bf3e9b18640ee07db663b3bdb5c0ed1a9faaea6f2f0592697d69c3c76d5.jpg) +(b) + +![](images/84107adcaf666c8a3a4308f6e1c3a2d3aec5e24bc2b36d439a318798c596390c.jpg) +(c) + +![](images/9242b02b11a59d5af9d24716801558c131e9026058068648da27c6f77c52cf71.jpg) +(d) + +![](images/549463c50a0178770a1c4eecffeab20068e644f3021caa68f28ff807f40fbdfc.jpg) +(e) + +![](images/d1b89b42ec7c567170589d44754843c51b6e578db1a749a920fc82dc44a233f5.jpg) +(f) + +![](images/d93b58fb9bf3de0cbabd444c528aecca025e906e2fc1451be566e005f3c205a9.jpg) +(a) +(g) +Figure 10: The latent representations from UIT when evaluating for the sample in Figure 5, in their corresponding layers with respect to those in Figure 9, 4 latent representations are extracted from 4 randomly selected channels: (a)-(d) are from the feature extracting layer (layer 1, $128 \times 128$ grid), (e)-(h) are from the middle layer acting on the coarsest level ( $32 \times 32$ grid), (i)-(l) are from the next level ( $64 \times 64$ grid). + +![](images/abcbf9820ac8f76dc6367d1cf9249b7c6b4a87654f926289f8322579dbeeaaff.jpg) +(h) + +![](images/b144a1cdfba50730e083a088f841b119fe5c9158efb297cf07b770bc09c53137.jpg) +(i) + +![](images/63e01a63bf85841b6f91fac3b75d28235ed66ee1fcc786e1d7fe0bb30c306466.jpg) +(j) + +![](images/767ee00eb19659a403f4cd65ec3ca2a40f1e26611246527277fc467eee124631.jpg) +(k) + +![](images/2378a7f8c5c06f2b7b9287d063cac8a754d24a1573b6ee003449c61b38ddf297.jpg) +(1) + +# G LIMITATIONS, EXTENSIONS, AND FUTURE WORK + +In this study, the $\sigma$ to be recovered relies on a piecewise constant assumption. This assumption is commonly seen in the theoretical study of the original DSM. For many EIT applications in medical imaging and industrial monitoring, $\sigma$ may involve non-sharp transitions or even contain highly anisotropic/multiscale behaviors making it merely an $L^{\infty}$ function. If the boundary data pairs are still quite limited, i.e., only a few electric modes are placed on the boundary $\partial \Omega$ , the proposed model alone is not expected to perform as well as in benchmark problems. Nevertheless, it can still contribute to achieving reconstruction with satisfactory accuracy, if certain a priori knowledge of the problem is accessible. End2end-wise, our proposed method has limitations like other operator learners: the data manifold on which the operator is learned is assumed to exhibit low-dimensional/low-rank attributes. The behavior of the operator of interest on a compact subset is assumed to be reasonably well approximated by a finite number of bases. Therefore, for non-piecewise constant conductivities, the modification can be to employ a suitable data set, in which the sampling of $\{\sigma^{(k)}\}$ represents the true $\sigma$ ’s distribution a posteriori to a certain degree. However, to reconstruct non-piecewise constant conductivities, more boundary data pairs or even the entire NtD map is demanded from a theoretical perspective (Astala & Paivärinta, 2006; Nachman, 1996; Kohn & Vogelius, 1984; Sylvester & Uhlmann, 1987). For fewer data pairs and more complicated conductivity set-up, there have been efforts in this direction hierarchically using matrix completion (Bui-Thanh et al., 2022) to recover $\Lambda_{\sigma}$ . When $\Lambda_{\sigma}$ is indeed available, $\sigma$ can be described by a Fredholm integral equation, see Nachman (1996, Theorem 4.1), which itself is strongly related to the modified attention mechanism (14) of the proposed Transformer. The architectural resemblance may lead to future explorations in this direction. Optimization with regularization can be applied for the instance of interest (fine-tune) from the perspective of improving the reconstruction for a single instance. This approach dates back to the classical iterative methods involving adaptivity (Jin & Xu, 2019). Recent novel DL-inspired adoptions (Li et al., 2021b; Benitez et al., 2023) re-introduce this type of method. In fine-tuning, the initial guess is the reconstruction by the operator learner trained in the end2end pipeline (pre-train). \ No newline at end of file diff --git a/transformermeetsboundaryvalueinverseproblems/images.zip b/transformermeetsboundaryvalueinverseproblems/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..5dbbe54117e4dfd0ea7dadb766336e858f02a1d2 --- /dev/null +++ b/transformermeetsboundaryvalueinverseproblems/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:030734af0f9a9ce6e8bd09c9b1ded328d89233f8e39cc20274d20b4493ba5c68 +size 1230647 diff --git a/transformermeetsboundaryvalueinverseproblems/layout.json b/transformermeetsboundaryvalueinverseproblems/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..3f3e4d7a24751929ab6698701be1c7f044d6e535 --- /dev/null +++ b/transformermeetsboundaryvalueinverseproblems/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6772620834653edf445b035e5a30b41d78c30972bccd6e88d3194c3c6c6b245 +size 1384299 diff --git a/transformerpatcheronemistakeworthoneneuron/770f6992-5610-4dd1-87f5-5cad41ec10de_content_list.json b/transformerpatcheronemistakeworthoneneuron/770f6992-5610-4dd1-87f5-5cad41ec10de_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..72df53d933926fc26586bd7dfcc63231798d2ff6 --- /dev/null +++ b/transformerpatcheronemistakeworthoneneuron/770f6992-5610-4dd1-87f5-5cad41ec10de_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a67539e2671f81371e26a3834d7f107cedb5be0571af9966dc889e5a0a9c2e54 +size 102754 diff --git a/transformerpatcheronemistakeworthoneneuron/770f6992-5610-4dd1-87f5-5cad41ec10de_model.json b/transformerpatcheronemistakeworthoneneuron/770f6992-5610-4dd1-87f5-5cad41ec10de_model.json new file mode 100644 index 0000000000000000000000000000000000000000..da7e940192155302f85be363f2256765f3314b4d --- /dev/null +++ b/transformerpatcheronemistakeworthoneneuron/770f6992-5610-4dd1-87f5-5cad41ec10de_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:01eb008c88a39e52fa3d22c10320b4517479a595248308dc84b0e3d761f3aa52 +size 121650 diff --git a/transformerpatcheronemistakeworthoneneuron/770f6992-5610-4dd1-87f5-5cad41ec10de_origin.pdf b/transformerpatcheronemistakeworthoneneuron/770f6992-5610-4dd1-87f5-5cad41ec10de_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..b0b7ea24e76498598483d32c83f8d9c229755fc5 --- /dev/null +++ b/transformerpatcheronemistakeworthoneneuron/770f6992-5610-4dd1-87f5-5cad41ec10de_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:26aaf1887174ab8e0b56ed5d513724962c436e6756e12194fe65dd70af228083 +size 802071 diff --git a/transformerpatcheronemistakeworthoneneuron/full.md b/transformerpatcheronemistakeworthoneneuron/full.md new file mode 100644 index 0000000000000000000000000000000000000000..81ebfa248277c4f0888452ae857338d498688b18 --- /dev/null +++ b/transformerpatcheronemistakeworthoneneuron/full.md @@ -0,0 +1,441 @@ +# TRANSFORMER-PATCHER: ONE MISTAKE WORTH ONE NEURON + +Zeyu Huang $^{1,2}$ , Yikang Shen $^{4}$ , Xiaofeng Zhang $^{1,2}$ , Jie Zhou $^{5}$ , Wenge Rong $^{1,3}$ , Zhang Xiong $^{1,3}$ + +$^{1}$ State Key Laboratory of Software Development Environment, Beihang University, China +$^{2}$ Sino-French Engineer School, Beihang University, China +$^{3}$ School of Computer Science and Engineering, Beihang University, China +4Mila, University of Montreal, Canada, 5WeChat AI, Tencent Inc, China + +{zeroy.huang,yikang.shn}@gmail.com,withtomzhou@tencent.com + +{xiaofeng.z,w.rong,xiongz}@buaa.edu.cn + +# ABSTRACT + +Large Transformer-based Pretrained Language Models (PLMs) dominate almost all Natural Language Processing (NLP) tasks. Nevertheless, they still make mistakes from time to time. For a model deployed in an industrial environment, fixing these mistakes quickly and robustly is vital to improve user experiences. Previous works formalize such problems as Model Editing (ME) and mostly focus on fixing one mistake. However, the one-mistake-fixing scenario is not an accurate abstraction of the real-world challenge. In the deployment of AI services, there are ever-emerging mistakes, and the same mistake may recur if not corrected in time. Thus a preferable solution is to rectify the mistakes as soon as they appear nonstop. Therefore, we extend the existing ME into Sequential Model Editing (SME) to help develop more practical editing methods. Our study shows that most current ME methods could yield unsatisfying results in this scenario. We then introduce Transformer-Patcher, a novel model editor that can shift the behavior of transformer-based models by simply adding and training a few neurons in the last Feed-Forward Network layer. Experimental results on both classification and generation tasks show that Transformer-Patcher can successively correct up to thousands of errors (Reliability) and generalize to their equivalent inputs (Generality) while retaining the model's accuracy on irrelevant inputs (Locality). Our method outperforms previous fine-tuning and HyperNetwork-based methods and achieves state-of-the-art performance for Sequential Model Editing (SME). The code is available at https://github.com/ZeroYuHuang/Transformer-Patcher. + +# 1 INTRODUCTION + +Transformer-based models, particularly large Pretrained Language Models (PLMs) (Devlin et al., 2019; Brown et al., 2020) have become the backbone model of modern Natural Language Processing (NLP) and have enabled promising results in various downstream tasks (Lv et al., 2019; Budzianowski & Vulic, 2019; Ramnath et al., 2020). However, PLMs still produce undesirable outputs occasionally (Zhao et al., 2019; Basta et al., 2021). The cost of such mistakes is non-negligible. For example, a mistaken automatic translation result could get a person arrested (Hern, 2018). One of the most usual expedients was using a manual cache (e.g., lookup table) to overrule these problematic predictions (Sinitsin et al., 2020). Though convenient and straightforward, it lacks robustness and generality because it could be disabled by the slightest change in the input, such as paraphrasing in natural language. On the other hand, one can also re-train the model on the original dataset supplemented with problematic examples. While superior in performance, it is computationally and temporally expensive to re-train large PLMs with billions or even trillions of parameters. + +Previous research formalized such problems as Model Editing (ME) and proposed various methods to intervene model's behavior on a specific example while preventing the model from forgetting other examples. Some straightly finetune the model on the example and used a constraint loss to maintain the model's overall performance (Zhu et al., 2020; Sotoudeh & Thakur, 2021). Some edit + +the model through a HyperNetwork, which regards the model and the false predicted example as inputs and produced a weight update for the model's parameters (Cao et al., 2021; Sinitsin et al., 2020; Mitchell et al., 2022a). Despite their impressive progress, they mostly focus on one-step editing (fixing one mistake), which is not applicable to practical situations. Because models deployed for real-world applications are expected to face different errors ceaselessly. And the same error may pop up repeatedly and bother different users. In addition, as illustrated in Figure 1, once a wrong answer appears in an online question-answering (QA) model, leaving it unfixed and waiting for future corrections could mislead more people. Therefore, an ideal model editor should provide continuous and promptly fixing of newly emerged mistakes in an effective and efficient manner. + +![](images/d4017074a0ac732fccc0f9911df2bd2ea29125300d7c1799e531654714f794c2.jpg) +Figure 1: Once an error occurs in a QA model online, it could bother many users contacting the model if not fixed in time. Instant correction is a superior choice to improve the user experience, motivating us to propose a Sequential Model Editing problem. + +Thus we extend the ME task into the sequential setting and formalize it as **Sequential Model Editing (SME)** task, which requires a model editor to fix a series of mistakes as soon as they appear. The desiderata of a qualified sequential model editor are three properties (Section 3). For each editing, the post-edit model should be of 1) Reliability: make the desirable output given the input; 2) Generality: generalize over other equivalent inputs; 3) Locality: retain its accuracy over irrelevant inputs. We then propose a standard SME experiment pipeline that is compatible with different tasks and five evaluation metrics to evaluate the three properties. Experiments show that most existing model editors could fail to generalize to the sequential editing scenario. Fine-tuning-based methods are vulnerable to forgetting previous edits. HyperNetwork-based editors are strongly coupled with the initial model that they are trained with, thus failing to edit the model after several steps (Section 5). + +To handle SME, we introduce Transformer-Patcher. Unlike previous methods, Transformer-Patcher retains all original parameters to prevent harming the model's overall performance. It only adds a handful of trainable neurons (patches) to the last Feed-Forward Network (FFN) layer to revise the model's behavior on the problematic input and achieve a low editing cost. Furthermore, we train the patch to only respond to specific inputs with the proposed activation loss and memory loss. Experimental results on fact-checking (classification) and question answering (auto-regressive generation) indicated that Transformer-Patcher could rectify a series of mistakes (up to thousands) while almost perfectly retaining the model's overall performance. + +The main contributions of this work are twofold: 1) We formally propose a sequential model editing task, as well as its standard experiment pipeline and evaluation metrics. 2) We introduce Transformer-Patcher, a simple yet effective model editor to revise transformer-based PLMs, achieving state-of-the-art SME performance. + +# 2 RELATED WORKS + +Feed-forward Network Both the Transformer encoder and decoder contain the Feed-Forward Network (FFN). Recent works (Geva et al., 2021; Dai et al., 2022) analogously observed that FFN operates as key-value neural memories (Sukhbaatar et al., 2015). They regarded the input of FFN as a query, the first layer as keys, and the second as values. Thus the intermediate hidden dimension of FFN can be interpreted as the number of memories in the layer, and the intermediate hidden state is a vector containing activation values for each memory. Therefore, the final output of FFN can be viewed as the weighted sum of values activated. + +Model editors Existing model editors are mainly separated into two types: fine-tuning-based and HyperNetwork-based. Fine-tuning-based editors usually straightly tune the model with an extra loss to eschew over-fitting to edit examples. For instance, Zhu et al. (2020) proposed an extra loss + +to reduce the distance between pre-edit and post-edit parameters. Mitchell et al. (2022a); Meng et al. (2022) equipped fine-tuning with KL-divergence to restrict the post-edit model's output space. For another, HyperNetwork-based editors require additional training phrases. Sinitsin et al. (2020) proposed a Meta Learning-based (Finn et al., 2017) approach named Editable Training to learn editable parameters for model modification. Cao et al. (2021) proposed KnowledgeEditor (KE) trained with constrained optimization to produce weight updates. Mitchell et al. (2022a) proposed MEND that learns to transform the gradient obtained by standard fine-tuning to edit large language models (Raffel et al., 2020). In addition, some works only focus on specific tasks, such as masked language modeling (Dai et al., 2022) and autoregressive language modeling (Meng et al., 2022; Geva et al., 2022). They require special input other than edit examples to conduct model editing. + +Continual Learning The proposed SME task could be regarded as an emergent variant of Continual Learning (CL) (Mundt et al., 2020). And dynamically expandable networks are employed for CL as well (Rusu et al., 2016; Li & Hoiem, 2018). But there are some differences in the setting. In CL, usually, the model is continually trained using different datasets and tasks. But SME deals with only one example at once and all examples are from the same task. The difference in setting renders SME an unexplored area with new challenges that may not be properly addressed by general CL methods. For example, KL divergence loss and L2 normalization are usual methods to address the catastrophic forgetting in CL (De Lange et al., 2022), but previous works (Cao et al., 2021; Mitchell et al., 2022a) and our experiments show that they can hardly maintain models accuracy on irrelevant inputs in ME task. And methods that add task-specific parameters for CL usually need extra training (Yoon et al., 2018; Wortsman et al., 2020; de Masson d'Autume et al., 2019), thus falling short of SME's application efficiency requirement. + +# 3 SEQUENTIAL MODEL EDITING PROBLEM + +![](images/15f8fc91fdd4bba17771f94ca3b57644283343376ae9adbfbf3f0369cee51b20.jpg) +Figure 2: The process of sequential model editing task. Given the $t$ -th mistake $(x_{t},y_{x_{t}})$ , the editor takes the model $f_{t - 1}$ and $(x_{t},y_{x_{t}})$ as input, and outputs the revised model $f_{t}$ + +Following Mitchell et al. (2022a), a model $f \in \mathbb{F}$ can be defined as a function $f: \mathbb{X} \mapsto \mathbb{Y}$ that maps an input $x$ to its prediction $f(x)$ . Then, given a model $f$ and an edit example pair $(x_e, y_{x_e})$ that $f(x_e) \neq y_{x_e}$ , a model editor ME is to output a post-edit model $f'$ . + +$$ +\mathrm {M E}: \quad \mathbb {F} \times \mathbb {X} \times \mathbb {Y} \qquad \mapsto \quad \mathbb {F} +$$ + +$$ +(f, x _ {e}, y _ {x _ {e}}) \rightarrow f ^ {\prime} = \operatorname {M E} (f, x _ {e}, y _ {x _ {e}}) +$$ + +Given a data stream $\{(x_1, y_{x_1}), \dots, (x_s, y_{x_s})\}$ and an initial model $f_0$ , a model editor ME needs to conduct edits successively when the model makes undesirable output, as shown in Figure 2. + +$$ +f _ {t} = \left\{ \begin{array}{l l} f _ {0} & \text {i f} t = 0, \\ f _ {t - 1} & \text {e l i f} f _ {t - 1} \left(x _ {t}\right) = y _ {x _ {t}}, \\ \operatorname {M E} \left(f _ {t - 1}, x _ {t}, y _ {x _ {t}}\right) & \text {e l s e .} \end{array} \right. \tag {1} +$$ + +And after every edit in SME the post-edit model $f'$ should satisfy the following three properties: + +Property 1 Reliability: the post-edit model should output the desired prediction: + +$$ +f ^ {\prime} \left(x _ {e}\right) = y _ {x _ {e}} \tag {2} +$$ + +Property 2 Generality: given an edit example $x_{e}$ , $\mathbb{E}_{x_e} = \{x_j|y_{x_j} = y_{x_e}\}$ is defined as the set of its equivalent inputs (e.g. rephrased sentences). Then the post-edit model $f'$ should satisfy: + +$$ +\forall x _ {j} \in \mathbb {E} _ {x _ {e}}, f ^ {\prime} (x _ {j}) = y _ {x _ {e}} \tag {3} +$$ + +Property 3 Locality: the edit should be implemented locally and precisely, which means the post-edit model should remain accurate on the irrelevant examples set $\mathbb{I}_{x_e} = \mathbb{X}\backslash \mathbb{E}_{x_e}$ : + +$$ +\forall x _ {j} \in I _ {x _ {e}}, f ^ {\prime} (x _ {j}) = y _ {x _ {j}} \tag {4} +$$ + +In particular, an edit should not disrupt the results of past edits in SME setting, which means: + +$$ +f _ {t} \left(x _ {k}\right) = y _ {x _ {k}}, f o r k w h e r e f _ {k - 1} \left(x _ {k}\right) \neq y _ {x _ {k}} \tag {5} +$$ + +# 4 TRANSFORMER-PATCHER + +![](images/a6145c0ceeeb0e18d96ea5296924b4d212eb6a5ff1b4b5587bc4a42b9ceef160.jpg) +Figure 3: Transformer-patcher enables efficient correction for classification and generation tasks, it rectifies the model's behavior by adding and training several extra neurons in the last FFN layer. + +First, we call one misclassification or one wrongly generated token one mistake in the rest of the paper. Aiming at the SME task for transformer-based models, we propose Transformer-Patcher shown in Figure 3. It freezes all original parameters and adds one neuron (patch) to the last FFN layer for one mistake. And we train the patch to take effect only when encountering its corresponding mistake. For classification, we add only one patch to rectify the model. For auto-regressive generation, we count how many tokens are wrongly generated under the teacher-forcing setting and add one patch for each of them. This section describes how to add and train one patch. Multiple patch editing follows exactly the same principle and is formally described in Appendix A. + +# 4.1 WHAT IS A PATCH? + +As mentioned in Section 2, FFN operates as key-value neuron memories. Its forward computation is a process that retrieves values from matrix $\mathbf{V}$ by matching keys in matrix $\mathbf{K}$ and the input query $\mathbf{q}$ . For a standard FFN, given a query $\mathbf{q} \in \mathbb{R}^d$ , its output $FFN(\mathbf{q})$ is: + +$$ +\boldsymbol {a} = \operatorname {A c t} (\boldsymbol {q} \cdot \boldsymbol {K} + \boldsymbol {b} _ {k}) \tag {6} +$$ + +$$ +F F N (\boldsymbol {q}) = \boldsymbol {a} \cdot \boldsymbol {V} + \boldsymbol {b} _ {v} \tag {7} +$$ + +where $\operatorname{Act}(\cdot)$ is a non-linear activation function (e.g., Relu or Gelu), $\pmb{a}$ is the vector of activation values, $\pmb{b}_k$ , and $\pmb{b}_v$ are two bias vectors. A patch is an extra neuron (an extra key-value pair) added to the last FFN layer. After patching, the new output $FFN_{p}(\pmb{q})$ is: + +$$ +[ \boldsymbol {a} \quad a _ {p} ] = \operatorname {A c t} (\boldsymbol {q} \cdot [ \boldsymbol {K} \quad \boldsymbol {k} _ {p} ] + [ \boldsymbol {b} _ {k} \quad b _ {p} ]) \tag {8} +$$ + +$$ +F F N _ {p} (\boldsymbol {q}) = \left[ \begin{array}{l l} \boldsymbol {a} & a _ {p} \end{array} \right] \cdot \left[ \begin{array}{l} \boldsymbol {V} \\ \boldsymbol {v} _ {p} \end{array} \right] + \boldsymbol {b} _ {\boldsymbol {v}} \tag {9} +$$ + +where $\pmb{k}_p\in \mathbb{R}^d$ is the patch key, $\pmb{v}_p\in \mathbb{R}^d$ is the patch value, $b_{p}$ is a scalar named patch bias, $a_{p} = \mathrm{Act}(\pmb {q}\cdot \pmb{k}_{p} + b_{p})$ represents the activation value of the patch. With the substitution of equations 6 and 7, equation 9 can be reformulated as: + +$$ +F F N _ {p} (\boldsymbol {q}) = F F N (\boldsymbol {q}) + a _ {p} \cdot \boldsymbol {v} _ {p} \tag {10} +$$ + +# 4.2 TRAINING A PATCH FOR EDITING + +An ideal edit requires reliability, generality, and locality proposed in Section 3. For reliability, a patch needs to be activated according to equation 10. Let $\mathbf{q}_e$ represent the input query of the mistake, + +the patch key $k_{p}$ and patch bias $b_{p}$ should satisfy: + +$$ +a _ {p} = \operatorname {A c t} \left(\boldsymbol {q} _ {e} \cdot \boldsymbol {k} _ {p} + b _ {p}\right) \neq 0 \tag {11} +$$ + +When Act is ReLU or GeLU, the above condition can be approximated as follows: + +$$ +\boldsymbol {q} _ {e} \cdot \boldsymbol {k} _ {p} + b _ {p} > 0 \tag {12} +$$ + +To meet the constraint 12, we propose a activation loss $l_{a}$ to maximize the activation value: + +$$ +l _ {a} = \exp \left(- \boldsymbol {q} _ {e} \cdot \boldsymbol {k} _ {p} - b _ {p})\right) \tag {13} +$$ + +Once a patch is activated, according to equation 10, it adds a bias term $a_{p} \cdot v_{p}$ to the output of the last layer. Because we are editing the last layer of the model, the output of the model can be adjusted to any result without worrying that other components of the model would cancel the editing effect. To obtain the target output, we leverage the task's original loss function and rename it as edit loss $l_{e}$ . Formally, for an edit example $(x_{e}, y_{e})$ , the patched model's output is $p_{e}$ , $l_{e}$ is defined as: + +$$ +l _ {e} = L \left(y _ {e}, p _ {e}\right) \tag {14} +$$ + +where $L(\cdot)$ is a function of label $y_{e}$ and model output $p_e$ and depends on the specific task. + +For locality, the model's behavior should not be shifted on irrelevant examples, thus the patch should not be activated by any irrelevant examples. When using ReLU or GeLU, it can be approximated as that all queries from irrelevant examples $\mathbf{q}_i$ should have a patch activation value less than or equal to a threshold $\beta$ , i.e., the maximum of them is less than or equal to $\beta$ : + +$$ +\forall i \in \mathbb {I} _ {x _ {e}}, \boldsymbol {q} _ {i} \cdot \boldsymbol {k} _ {p} + b _ {p} \leq \beta \rightarrow \max _ {i} (\boldsymbol {q} _ {i} \cdot \boldsymbol {k} _ {p} + b _ {p}) \leq \beta \tag {15} +$$ + +Thus we propose the memory loss $l_{m}$ to enforce the constraint 15. To imitate the distribution of queries from irrelevant examples, we randomly retain some queries from previously seen examples as memories. Each query is a $d$ -dimensional vector and we can stack them as a matrix $M \in \mathbb{R}^{d_m \times d}$ , where $d_{m}$ is the number of queries saved. Our proposed memory loss $l_{m}$ is the sum of two terms. The first term $l_{m1}$ is introduced to make the patch inactivated to all queries in $M$ : + +$$ +l _ {m 1} = S \left(\boldsymbol {M} \cdot \boldsymbol {k} _ {p} + b _ {p} - \beta ; k\right) \tag {16} +$$ + +where $S(\cdot ;k)$ is a function that receives a vector $\pmb{v}$ and outputs a scalar + +$$ +S (\boldsymbol {v}; k) = \operatorname {A v g} [ \operatorname {T o p K} (\exp (\boldsymbol {v}); k) ] \tag {17} +$$ + +It first employs element-wise exponential function to $\mathbf{v}$ and then selects $k$ largest elements to compute their average as the output. Although constraint 15 is about the maximum, we employ TopK here for more efficient optimization. In case that $l_{m1}$ can not absolutely ensure the constraint 15, we propose $l_{m2}$ to distance the activation value of $\mathbf{q}_e$ and $\mathbf{q}_i$ . That is, the activation value of the mistaken example is larger than that of the irrelevant examples by a certain margin $\gamma$ . + +$$ +l _ {m 2} = S \left(\left(\boldsymbol {M} - \boldsymbol {q} _ {e}\right) \cdot \boldsymbol {k} _ {p} + b _ {p} - \gamma ; k\right) \tag {18} +$$ + +To sum up, the loss $l_{p}$ for training a patch is defined as a weighted sum of the above losses: + +$$ +l _ {p} = l _ {e} + a l _ {a} + m l _ {m} = l _ {e} + a l _ {a} + m \left(l _ {m 1} + l _ {m 2}\right) \tag {19} +$$ + +where $a$ , $m$ are hyper-parameters. $\beta$ is selected as -3 for GeLU and 0 for ReLu, since GeLU(-3) ≈ 0.004 is small enough and ReLU(0) = 0. $\gamma$ is selected as 3 for GeLU and 0 for ReLU. + +# 5 EXPERIMENTS + +# 5.1 EXPERIMENTAL SETTINGS AND EVALUATION METRICS + +We proposed an experimental pipeline for SME used for standard datasets with training set $\mathbb{D}_{train}$ , validation set $\mathbb{D}_{val}$ , and test set $\mathbb{D}_{test}$ . There are two differences between our setting and the previous Model Editing setting. First, we employ multi-step editing rather than one-step. Second, previous works usually generate counterfactual edit examples (e.g., replacing the answer to a question with a random one), while we employ authentic examples where the model makes mistakes. We first split + +the original $\mathbb{D}_{train}$ into an edit set $\mathbb{D}_{edit}$ and a new training set $\mathbb{D}_{train}'$ . To evaluate generality, backtranslation could be utilized to generate the equivalent set $\mathbb{E}_{x_e}$ for edit example $x_e \in \mathbb{D}_{edit}$ following previous works (Cao et al., 2021). To evaluate locality, a subset $\mathbb{D}_{tr}$ randomly sampled from $\mathbb{D}_{train}'$ is used to see how the post-edit model performs on its training data. Our SME pipeline starts with an initial model $f_0$ trained on $\mathbb{D}_{train}'$ and validated using $\mathbb{D}_{val}$ , the model is sequentially edited while encountering mistakes in $\mathbb{D}_{edit}$ . After the $t$ th edit example $(x_e^t, y_e^t)$ , we obtain a post-edit model $f_t$ . Supposing that there are $T$ total edits and $I$ represents the indicator function, our proposed metrics are calculated as follows: + +1) Success Rate (SR): to evaluate the reliability, we test if the post-edit model outputs the desired prediction. Thus, SR is: + +$$ +S R = \frac {1}{T} \sum_ {t = 0} ^ {T} I \left(f _ {t} \left(x _ {e} ^ {t}\right) = y _ {e} ^ {t}\right) \tag {20} +$$ + +2) Generalization Rate (GR): to evaluate the generality, we test the post-edit model $f_{t}$ on the equivalent set $\mathbb{E}_{x_e^t} = \{x_{e,1}^t\cdots,x_{e,N_t}^t\}$ of the edit example $x_{e}^{t}$ , thus GR is: + +$$ +G R = \frac {1}{T N _ {t}} \sum_ {t = 0} ^ {T} \sum_ {i = 1} ^ {N _ {t}} I \left(f _ {t} \left(x _ {e, i} ^ {t}\right) = y _ {e} ^ {t}\right) \tag {21} +$$ + +3) Edit Retain Rate (ER): to evaluate locality and reliability, we evaluate how many past edits are retained by the final model $f_{T}$ . In a real application, a reliable model editor should keep the fixed bugs from recurring again, thus SR alone cannot evaluate reliability, and we define ER by testing the final model on all its past edit examples $\mathbb{E}_{pe}$ : + +$$ +E R = \frac {1}{T} \sum_ {t = 0} ^ {T} I \left(f _ {T} \left(x _ {e} ^ {t}\right) = y _ {e} ^ {t}\right) / T \tag {22} +$$ + +4) Training Retain Rate (TrainR): to evaluate locality, we compare the performance of the final model of $f_{T}$ and the initial model $f_{0}$ on subsampled test $\mathbb{D}_{tr}$ . Thus, the TrainR is defined as: + +$$ +T r a i n R = \frac {\sum_ {(x , y) \in D _ {t r}} I \left(f _ {T} (x) = y\right)}{\sum_ {(x , y) \in D _ {t r}} I \left(f _ {0} (x) = y\right)} \tag {23} +$$ + +5) Test Retain Rate (TestR): to evaluate locality, we see if the post-edit model still retains the generalization ability over unseen data. Then the TestR is defined as: + +$$ +T e s t R = \frac {\sum_ {(x , y) \in D _ {t e s t}} I \left(f _ {T} (x) = y\right)}{\sum_ {(x , y) \in D _ {t e s t}} I \left(f _ {0} (x) = y\right)} \tag {24} +$$ + +Datasets and Baselines Both classification and auto-regressive generation tasks are selected for evaluation. Following Cao et al. (2021) and Mitchell et al. (2022a), we employ Fact-Checking (FC) for classification and closed-book Question Answering (QA) for generation. For FC, we apply a BERT base model (Devlin et al., 2019) and the FEVER dataset (Thorne et al., 2018). For QA, we apply a BART base model (Lewis et al., 2020) and the Zero-Shot Relation Extraction (zsRE) dataset (Levy et al., 2017). We directly use the equivalent set released by Cao et al. (2021). We use the same data split as Cao et al. (2021). Both FC and QA are evaluated using accuracy. Our baselines include (1) Fine-Tuning-based editors: The FT directly fine-tunes the model on the edit example. Following Mitchell et al. (2022a), FT+KL is selected as a baseline. It fine-tunes the model with an extra KL divergence loss $l_{kl}$ . Following Sinitsin et al. (2020) and Zhu et al. (2020), we report fine-tuning-based baselines by fine-tuning all parameters (FT(all) and FT(all)+KL) or the last layer (FT(last) and FT(last)+KL). (2) Two HyperNetwork-based editors: KE (Cao et al., 2021) and MEND (Mitchell et al., 2022a). (3) SERA: a variant of the latest SOTA memory-based model editor SERAC (Mitchell et al., 2022b). Other details of our baselines are reported in Appendix B. + +Experiment Details Initial models for two tasks are obtained following the same training settings as Cao et al. (2021). For FC, the accuracy of the initial model attains $94.1\%$ on $\mathbb{D}_{tr}$ , $76.9\%$ on $\mathbb{D}_{test}$ . For QA, the accuracy of the initial model attains $56.6\%$ on $\mathbb{D}_{tr}$ , $23.1\%$ on $\mathbb{D}_{test}$ . To reduce the experimental uncertainty, we randomly split the edit set into $n = 20$ folders to run SME 20 + +Table 1: The Success Rate (SR), Generalization Rate (GR), Edit Retain Rate (ER), Training Retain Rate (TrainR), Test Retain Rate (TestR) of Transformer-Patcher (T-Patcher) and the baselines on FEVER and zsRE dataset. * denotes that the SR of the T-patcher on QA is 0.9987. † means the method requires extra training phases and training data. + +
EditorFEVER Fact-Checking BERT-base (110M)zsRE Question-Answering BART-base (139M)
SRGRERTrainRTestRSRGRERTrainRTestR
FT(last)1.000.610.590.8930.9461.000.580.300.9140.924
FT(all)1.000.740.830.9680.9941.000.680.430.8650.910
FT(last)+KL1.000.530.450.9680.9981.000.570.280.9230.933
FT(all)+KL1.000.710.490.9981.0111.000.680.390.8890.925
\( MEND^† \)0.040.030.060.3490.6520.410.370.000.0000.000
\( KE^† \)0.140.120.280.4860.6500.090.080.000.0000.000
\( SERA^† \)1.000.891.000.9040.9161.000.900.980.9060.901
T-Patcher1.000.821.000.9991.0001.00*0.820.990.9970.996
+ +Table 2: The experimental results when utilizing all data in $D_{edit}$ as a single run of SME on QA task. The results of the FC task are presented in Table 7 in Appendix C. E represents how many edits have been conducted. N represents how many mistakes have been made by the initial model $f_0$ on the entire edit set $D_{edit}$ . + +
EditorSRGRERTrainRTestREN
FT(all)+KL1.000.690.140.9360.97428212766
SERA1.000.900.970.7280.69435582766
T-Patcher0.990.810.970.9120.94823082766
+ +times and report the averaged performance as the final result. The initial model $f_{0}$ makes about 63 mistakes in an FC folder and about 139 in a QA folder on average. For methods requiring memories (fine-tuning with KL and ours), 40,000 memory examples are sampled from $D_{train}' \setminus D_{tr}$ are employed for both tasks and are updated as editing proceed. The hyperparameters $a$ and $m$ are selected as 1 and 10 respectively for both tasks to make the extra losses and the original task loss in the same order of magnitude. Other details can be found in Appendix B. + +# 5.2 EXPERIMENTAL RESULTS + +Main results The experiment results are shown in Table 1. Our method achieves strong performance in all five metrics across two tasks. It could make a series of model corrections $(\mathrm{SR}\approx 1)$ while nearly retaining every past edit $(\mathrm{ER}\approx 1)$ and almost perfectly keeping the model's overall performance $(\mathrm{TrainR}\approx 1, \mathrm{TestR}\approx 1)$ . The fine-tuning-based editors could partly preserve the model's behavior and achieve high SR, but it is vulnerable to forgetting previous edits (low ER). Two HyperNetwork-based editors fail in the SME setting. They have trouble retaining models' overall performance (low ER, TrainR, TestR) and conducting a series of edits (low SR and GR). SERA achieves the highest GR, while can only partially preserve the model's overall performance (TestR, TrainR≈0.9) compared to T-Patcher. Apart from being effective, our method is efficient enough as well. Using a V100, one edit costs only 7.1s for FC and 18.9s for QA. We could further improve the efficiency to 4.7s and 12.4s by decreasing the number of memory examples to 10,000. + +Scale up to thousands of edits Table 1 shows that Transformer-Patcher achieves good performance for about 60 edits on FC and 140 edits on QA, thus we wonder if it could handle more edits. So we utilize all data in $D_{edit}$ as a single data stream to run SME. As shown in Table 2, Transformer-Patcher could effectively correct up to thousands of mistakes and retain the model's overall performance simultaneously compared with the other two strong baselines. It's interesting to notice that the number of edits E of Transformer-Patcher is less than the number of actual mistakes N made by the initial model. In other words, our method can fix some potential mistakes in the initial model before the error actually happens. On the contrary, the fine-tuning-based method fixes more mistakes than the original model, which means it created more errors during the editing + +process. It seems contradictory that our method attains fewer E and lower TestR, this may due to the distribution shift between $\mathbb{D}_{edit}$ and $\mathbb{D}_{test}$ . See more explanation in Appendix C. Furthermore, the post-edit model only gets $1.4\%$ larger for FC and $4.5\%$ larger for QA. We believe this cost is acceptable for automatically correcting the model's mistakes from time to time during deployment. In practice, we suggest using the transformer-patcher to provide a timely response for each mistake online, and after accumulating certain quantities of mistakes, we could fine-tune the original model on all accumulated mistakes, so that the patches can be removed. In this way, we could achieve a good balance between model size and editing effectiveness. + +# 5.3 ANALYSES + +![](images/5133d98c08974cfcfbbe035ed1ba3fd7fc0b7025d36c9a885c0f26c1f157dbc4.jpg) +(a) Success Rate on FC + +![](images/bd60bf7d3e8c7e5cbf4a8c9f60d95fab46deea02a33b1d1f8e6d368a1deb4828.jpg) +(b) Success Rate on QA +Figure 4: Variation of success rate (SR) with the number of edits. Different methods have different edit times, we plot until they converge. + +The collapse of MEND and KE We discuss here why MEND and KE fail in the SME. Figure 4 presents how SR varies with the number of edits on both FC and QA. Figure 4 shows that MEND and KE are effective in the first few steps, but shortly after they are no longer able to produce valid edits. However, in their original paper (Cao et al., 2021; Mitchell et al., 2022a), they both reported that they achieved high SR when dealing with one-step editing. We find this phenomenon reasonable since both HyperNetwork-based editors are trained with the initial model $f_{0}$ and thus strongly coupled with the original parameters. As the editing proceeds, the model becomes more different from the initial one, resulting in their failure. We tried to retrain HyperNets after every edit using the post-edit model, but the cost for re-training is unacceptable as it costs hours to train a HyperNet model editor. + +Table 3: The ablation results for two alternatives of memory loss. + +
PatchFEVER Fact-CheckingzsRE Question-Answering
SRGRERTrainRTestRSRGRERTrainRTestR
w/o lm0.990.940.610.7370.8440.990.940.210.0690.154
KL1.000.760.990.9960.9980.940.690.490.4810.710
w/o lm20.950.820.950.9940.9920.950.820.940.9910.984
T-Patcher1.000.821.000.9991.0001.000.820.990.9970.996
+ +Memory loss To validate the effectiveness of our proposed memory loss, we apply several alternative patches: (1) T-Patcher w/o $l_{m}$ , (2) KL Patch, where $l_{m}$ is replaced with the KL divergence loss, (3) T-Patcher w/o $l_{m_2}$ . The ablation results in Table 3 show that memory loss is critical. Simply adding patches without memory loss hurts the model's overall performance severely. The KL divergence partially alleviates this problem (higher TrainR, TestR, and ER) but is still unsatisfying on the more complex QA task, which is similar to the Fintuning with KL results in Table 1. By comparing w/o $l_{m_2}$ and T-Patcher, we observe that the main contribution of our proposed memory loss comes from $l_{m_1}$ , while adding $l_{m_2}$ still improves the method's performance. Furthermore, to investigate whether our added patches do solely respond to the specific error we visualize the activation values of different patches on their corresponding mistakes in Figure 5 for the QA task. The X-axis represents the mistake (8.2 represents the second mistake of the 8th edit example) and the Y-axis represents the patch. Figure 5a shows that the patch can be activated by multiple irrelevant queries without the constraint of memory loss, leading to low ER, TrainR, and TestR. Figure 5b is a lot darker, indicating that the KL loss tends to deactivate patches to bridge the distribution gap + +![](images/834ab879f5ec879013c8e7348c0e8e029a1c3ba02ed153431ca091aca65579b7.jpg) +(a) T-Patcher w/o $l_{m}$ + +![](images/6e9a052404f1e354f62fbb5682b69b827aa2e5c77d26046f65f2c5183350c75c.jpg) +(b) KL Patch + +![](images/2d9d43e19f8e81af4ee3ea9a43a1ec35d8bedc11d1f9d89d47e151a5c3ca50a7.jpg) +(c) T-Patcher + +![](images/8041b947083d25198a87749dd840ff4c29fc8329538703e92d8f1a2b7e1d233e.jpg) +Figure 5: The activation values of three different patches on their corresponding mistakes. +(a) Patched layer position + +![](images/158229c047a1213d68c6a60f96aaceb4d2ccdabd4dce6508da12a36f604f345d.jpg) +(b) Memory size +Figure 6: The ablation studies about patched layer position and the memory size. + +before patching and after patching. And figure 5c presents a clear diagonal line, which means each patch takes charge of its corresponding mistake. Further analysis of the activation value of different patches is presented in Appendix C. + +Patched layer position To validate the benefits of patching the last layer, we focus on the QA task and patch each decoder layer separately. The ablation results are illustrated in Figure 6a. First, patching the bottom layer (layer 0 and 1) can not make effect edits. This may be because patching the bottom layer severely influences every token in the input sequence, making the patch's optimization more difficult. While the patches added to the last layer only influence correspondent mistaken tokens, Then, compared to the other metrics, what the patching position influenced most is GR, which increases from 0.74 of layer 2 to 0.81 of layer 5, proving that patching the top layers may improve the generality. This phenomenon is aligned with previous studies (Jawahar et al., 2019) which found that high-level semantic features are encoded at the top layers and superficial information is encoded in lower layers. Besides, patching the last layer could ameliorate the editing efficiency as well. Because computation results of previous layers could be cached and reused while editing. + +Memory size In order to verify the robustness of our method, we conduct experiments using different memory sizes (from 5,000 to 40,000) on the QA task. As is shown in Figure 6b, our method is not very sensitive to the size of the memory set. Reducing memory examples only causes slight drops in SR, ER, TrainR, and TestR, and a slight increase in GR. + +# 6 CONCLUSION + +In this work, we proposed the Sequential Model Editing task, as well as its experiment pipeline and evaluation metrics. We then introduce Transformer-Patcher, a practical method for sequentially editing transformer-based language models. Experiments on both classification and autoregressive generation tasks demonstrate its ability to edit the model up to a thousand times continuously. This method could have a positive social impact by fixing serious mistakes in large PLMs, including generating biased predictions and hate speech, benefiting a broad spectrum of audiences. + +# REFERENCES + +Christine Basta, Marta R. Costa-jussà, and Noe Casas. Extensive study on the underlying gender bias in contextualized word embeddings. Neural Computing and Applications, 33(8):3371-3384, 2021. +Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. In Proceedings of the 2020 Annual Conference on Neural Information Processing Systems, 2020. +Pawel Budzianowski and Ivan Vulic. Hello, it's GPT-2 - how can I help you? towards the use of pretrained language models for task-oriented dialogue systems. In Proceedings of the 3rd Workshop on Neural Generation and Translation, pp. 15-22, 2019. +Nicola De Cao, Wilker Aziz, and Ivan Titov. Editing factual knowledge in language models. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pp. 6491-6506, 2021. +Damai Dai, Li Dong, Yaru Hao, Zhifang Sui, Baobao Chang, and Furu Wei. Knowledge neurons in pretrained transformers. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics, pp. 8493-8502, 2022. +Matthias De Lange, Rahaf Aljundi, Marc Masana, Sarah Parisot, Xu Jia, Aleš Leonardis, Gregory Slabaugh, and Tinne Tuytelaars. A continual learning survey: Defying forgetting in classification tasks. IEEE Transactions on Pattern Analysis and Machine Intelligence, 44(7):3366-3385, 2022. +Cyprien de Masson d'Autume, Sebastian Ruder, Lingpeng Kong, and Dani Yogatama. Episodic memory in lifelong language learning. In Proceedings of the 2019 Annual Conference on Neural Information Processing Systems, pp. 13122-13131, 2019. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 4171–4186, 2019. +Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In Proceedings of the 34th International Conference on Machine Learning, pp. 1126-1135, 2017. +Mor Geva, Roei Schuster, Jonathan Berant, and Omer Levy. Transformer feed-forward layers are key-value memories. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pp. 5484-5495, 2021. +Mor Geva, Avi Caciularu, Guy Dar, Paul Roit, Shoval Sadde, Micah Shlain, Bar Tamir, and Yoav Goldberg. LM-Debugger: An interactive tool for inspection and intervention in transformer-based language models. CoRR, abs/2204.12130, 2022. +Alex Hern. Facebook translates "good morning" into "attack them", 2018. URL https://www.theguardian.com/technology/2017/0ct/24/facebook-palestine-israel-translates-good-morning-attack-them-arrest. +Ganesh Jawahar, Benoit Sagot, and Djame Seddah. What does BERT learn about the structure of language? In Proceedings of the 57th Conference of the Association for Computational Linguistics, pp. 3651-3657, 2019. +Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Proceedings of the 3rd International Conference on Learning Representations, 2015. + +Omer Levy, Minjoon Seo, Eunsol Choi, and Luke Zettlemoyer. Zero-shot relation extraction via reading comprehension. In Proceedings of the 21st Conference on Computational Natural Language Learning, pp. 333-342, 2017. +Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. BART: Denoising sequence-to-sequence pretraining for natural language generation, translation, and comprehension. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 7871-7880, 2020. +Zhizhong Li and Derek Hoiem. Learning without forgetting. IEEE Transactions on Pattern Analysis and Machine Intelligence, 40(12):2935-2947, 2018. +Zhengwei Lv, Duoxing Liu, Haifeng Sun, Xiao Liang, Tao Lei, Zhizhong Shi, Feng Zhu, and Lei Yang. AUTOHOME-ORCA at semeval-2019 task 8: Application of BERT for fact-checking in community forums. In Proceedings of the 13th International Workshop on Semantic Evaluation, pp. 870-876, 2019. +Kevin Meng, David Bau, Alex Andonian, and Yonatan Belinkov. Locating and editing factual knowledge in GPT. CoRR, abs/2202.05262, 2022. +Eric Mitchell, Charles Lin, Antoine Bosselut, Chelsea Finn, and Christopher D. Manning. Fast model editing at scale. In Proceedings of the 10th International Conference on Learning Representations, 2022a. +Eric Mitchell, Charles Lin, Antoine Bosselut, Christopher D. Manning, and Chelsea Finn. Memory-based model editing at scale. In Proceedings of the 2022 International Conference on Machine Learning, pp. 15817-15831, 2022b. +Martin Mundt, Yong Won Hong, Iuliia Pliushch, and Visvanathan Ramesh. A wholistic view of continual learning with deep neural networks: Forgotten lessons and the bridge to active and open world learning. CoRR, abs/2009.01797, 2020. +Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21:140:1-140:67, 2020. +Sahana Ramnath, Preksha Nema, Deep Sahni, and Mitesh M. Khapra. Towards interpreting BERT for reading comprehension based QA. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, pp. 3236-3242, 2020. +Andrei A. Rusu, Neil C. Rabinowitz, Guillaume Desjardins, Hubert Soyer, James Kirkpatrick, Koray Kavukcuoglu, Razvan Pascanu, and Raia Hadsell. Progressive neural networks. CoRR, abs/1606.04671, 2016. +Anton Sinitsin, Vsevolod Plokhotnyuk, Dmitry V. Pyrkin, Sergei Popov, and Artem Babenko. Editable neural networks. In Proceedings of the 8th International Conference on Learning Representations, 2020. +Matthew Sotoudeh and Aditya V. Thakur. Provable repair of deep neural networks. In Proceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation, pp. 588-603, 2021. +Sainbayar Sukhbaatar, Arthur Szlam, Jason Weston, and Rob Fergus. End-to-end memory networks. In Proceedings of the 2015 Annual Conference on Neural Information Processing Systems, pp. 2440-2448, 2015. +James Thorne, Andreas Vlachos, Christos Christodoulopoulos, and Arpit Mittal. FEVER: A large-scale dataset for fact extraction and verification. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 809-819, 2018. +Mitchell Wortsman, Vivek Ramanujan, Rosanne Liu, Aniruddha Kembhavi, Mohammad Rastegari, Jason Yosinski, and Ali Farhadi. Supermasks in superposition. In Proceedings of 2020 Annual Conference on Neural Information Processing Systems, 2020. + +Jaehong Yoon, Eunho Yang, Jeongtae Lee, and Sung Ju Hwang. Lifelong learning with dynamically expandable networks. In Proceedings of the 6th International Conference on Learning Representations, 2018. +Jieyu Zhao, Tianlu Wang, Mark Yatskar, Ryan Cotterell, Vicente Ordonez, and Kai-Wei Chang. Gender bias in contextualized word embeddings. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 629–634, 2019. +Chen Zhu, Ankit Singh Rawat, Manzil Zaheer, Srinadh Bhojanapalli, Daliang Li, Felix X. Yu, and Sanjiv Kumar. Modifying memories in transformer models. CoRR, abs/2012.00363, 2020. + +# A MULTIPLE NEURON PATCHING + +In auto-regressive generation tasks, the model may make multiple mistakes in one example. Since FFN is a position-wise network, every mistake in the output can be ascribed to one query to the last FFN layer. Therefore, for an example where the model makes $n$ mistakes, each mistake can be ascribed to a query $q_{e}^{i}$ to the last FFN layer, and we add $n$ patches to handle each of them. Specifically, given an input query $q$ , the new output $FFN_{p}(q)$ of a FFN with $n$ patches is: + +$$ +\left[ \begin{array}{l l} \boldsymbol {a} & \boldsymbol {a} _ {p} \end{array} \right] = \operatorname {A c t} (\boldsymbol {q} \cdot \left[ \begin{array}{l l} \boldsymbol {K} & \boldsymbol {K} _ {p} \end{array} \right] + \left[ \begin{array}{l l} \boldsymbol {b} _ {k} & \boldsymbol {b} _ {p} \end{array} \right]) \tag {25} +$$ + +$$ +F F N _ {p} (\boldsymbol {q}) = \left[ \begin{array}{l l} \boldsymbol {a} & \boldsymbol {a} _ {p} \end{array} \right] \cdot \left[ \begin{array}{l} \boldsymbol {V} \\ \boldsymbol {V} _ {p} \end{array} \right] + \boldsymbol {b} _ {v} \tag {26} +$$ + +where $K_{p} \in \mathbb{R}^{d \times n}$ is the patch key, $v_{p} \in \mathbb{R}^{n \times d}$ is the patch value, $b_{p} \in \mathbb{R}^{n}$ is the patch bias, $a_{p} = \operatorname{Act}(q \cdot k_{p} + b_{p})$ is a vector containing activation values of patches. With the substitution of equations 6 and 7, equation 9 can be reformulated as: + +$$ +F F N _ {p} (\boldsymbol {q}) = \left\{ \begin{array}{l l} F F N (\boldsymbol {q}) & \text {i f} \boldsymbol {a} _ {\boldsymbol {p}} = \vec {0} \\ F F N (\boldsymbol {q}) + \boldsymbol {a} _ {\boldsymbol {p}} \cdot \boldsymbol {v} _ {\boldsymbol {p}} & \text {e l s e} \end{array} \right. \tag {27} +$$ + +During calculating the activation loss for multiple patches, we just constraint the patch $k_{p}^{i}$ to be activated by its corresponding query $q_{e}^{i}$ , let $q_{e} \in \mathbb{R}^{n \times d}$ represent the matrix containing $n$ corresponding queries, then we can obtain $\mathcal{A} \in \mathbb{R}^n$ which is defined as a vector containing activation values of each patch on its corresponding query: + +$$ +\mathcal {A} _ {i} = \boldsymbol {q} _ {e} ^ {i} \cdot \boldsymbol {k} _ {p} ^ {i} + b _ {p} ^ {i} \tag {28} +$$ + +It can also be formulated as follows: + +$$ +\mathcal {A} = \operatorname {d i a g} \left(\boldsymbol {q} _ {\boldsymbol {e}} \cdot \boldsymbol {k} _ {\boldsymbol {p}}\right) + \boldsymbol {b} _ {\boldsymbol {p}} \tag {29} +$$ + +where diag is a function to select the diagonal elements from a matrix. Then the activation loss for $n$ patches can be calculated as follows: + +$$ +l _ {a} = S (- \mathcal {A}; k _ {a}) \tag {30} +$$ + +where $S$ is the function defined in Equation 17, $k_{a}$ is a hyper-parameter. + +Memory loss $l_{m}$ for multiple patches remains the sum of two terms $l_{m1}$ and $l_{m2}$ , where $l_{m1}$ is identical as Equation 16. As for $l_{m2}$ , we restrict that for $i$ -th patch $\pmb{k}_{\pmb{p}}^{i}$ , all its activation value to a query in $M$ should be smaller than that to its corresponding query $q_{e}^{i}$ , thus $l_{m2}$ becomes: + +$$ +l _ {m 2} = S \left(\boldsymbol {M} \cdot \boldsymbol {k} _ {\boldsymbol {p}} + \boldsymbol {b} _ {\boldsymbol {p}} - \mathcal {A} - \gamma ; k\right) \tag {31} +$$ + +For initialization, every patch $k_{p}^{i}$ is initialized as its normalized related query $\frac{q_{e}^{i}}{|q_{e}^{i}|^{2}}$ so that the initial activation value is 1. + +# B EXPERIMENTAL DETAILS + +Data splits We utilize the same data split of training and testing following Cao et al. (2021). For closed-book fact-checking, the binary FEVER dataset originally has 104,966 training instances and 10,444 validation instances. In order to adapt it to the SME task, we keep the original validation set intact and employ it as $\mathbb{D}_{test}$ , and split the original training data into three subsets: a new training set $\mathbb{D}_{train}^{\prime}$ , a new validation set $\mathbb{D}_{val}$ and an edit set $\mathbb{D}_{edit}$ in the ratio of $0.8:0.1:0.1$ . As a result, we get 10,496 instances for the edit set. Since the Bert-based classifier attains $88.3\%$ on the edit set, the ideal edit sequence length is $10496*88.3\%/20 = 63$ on average. + +For closed-book question answering, we employ the zsRE dataset released by Cao et al. (2021), which originally has 244,173 examples for training and 27,644 examples for validation. We first filter out examples with only one answer and then employ the same data split process as FEVER in the ratio of $0.9:0.075:0.025$ . Finally, we get 5,317 edit data and 15,982 for validation, and 24,051 for testing. Since the Bart-based model attains $47.9\%$ on the edit set, the ideal edit sequence length is $5317*47.9\%/20 = 139$ on average. For both datasets, we randomly sampled a subset from $\mathbb{D}_{train}'$ with the size of 10,000 as $\mathbb{D}_{tr}$ , and the edit set $\mathbb{D}_{edit}$ is split into $n = 20$ folders to run SME $n = 20$ times independently. For the model editor requiring memories (fine-tuning with KL and Transformer-Patcher), we randomly sampled a subset from $\mathbb{D}_{train}' \setminus \mathbb{D}_{tr}$ with the size of 40000 and update it as the editing proceeds. + +Initial models training Initial models are trained following Cao et al. (2021). For the Fact-Checking task, we fine-tune a BERT base model with an additional linear layer that maps the hidden state of the BOS (beginning of a sentence) token to the probability of the positive label. We maximize the model likelihood and the final model attains an accuracy of $76.9\%$ on $\mathbb{D}_{test}$ , $94.1\%$ on $\mathbb{D}_{tr}$ and $88.3\%$ on $\mathbb{D}_{edit}$ . For the QA task, we fine-tune a BART base model by maximizing the model likelihood regularized with dropout and label smoothing. The final model attains an accuracy (exact match between model prediction and ground truth) of $23.1\%$ on $\mathbb{D}_{test}$ , $56.6\%$ on $\mathbb{D}_{tr}$ and $47.9\%$ on $\mathbb{D}_{edit}$ . And these results are comparable with results that the model trained and released by Cao et al. (2021) has achieved. + +Transformer-Patcher training details For FC, we add one patch for every edit example. For QA, we employ the teacher forcing setting and count how many target tokens are not assigned to the highest likelihood as the mistake number. For one edit example, we add up to 5 patches.FC and QA task share almost the same hyper-parameters. We repeat one edit example 8 times and feed them to Transformer-Patcher as a batch for training. The initial learning rate is set as 0.01. Adam optimizer (Kingma & Ba, 2015) is applied for both tasks. Every patch is initialized with the normalized corresponding query $\frac{q_e}{|q_e|^2}$ . Such a method makes each patch activated with an initial activate value 1. The patch value $v_p \in \mathbb{R}^{n \times d}$ is parameterized as element-wise production of two matrices: $v_p' \in \mathbb{R}^{n \times d}$ and $n_p \in \mathbb{R}^{n \times d}$ , $v_p'$ is initialized with the random number between 0 and 1, and elements in $n_p$ is initialized with an integer 5 to make the patch value dominant over existing values $V$ . The parameter $k_a$ mentioned in equation 30 is set as 5, and parameter $k$ for memory loss is set as 1000. All hyper-parameters are chosen by running a few examples on the validation set. + +Baseline implementation details For KE, we directly utilize the released trained HyperNetwork for conducting SME experiments (Cao et al., 2021). + +For MEND, there is no HyperNetwork released and we re-implement the released code with hyperparameters set as Mitchell et al. (2022a). We employ fine-tuning-based methods following Mitchell et al. (2022a) and Cao et al. (2021). + +For all fine-tuning-based baselines, we set the learning rate as 1e-5 and utilize Adam's optimizer to fine-tune the model until the mistaken example is corrected. For the computation of KL loss for fine-tuning +KL-constraints baselines, we randomly sample a batch of examples in a memory set with the size of 512. + +For SERAC (Mitchell et al., 2022b), we implement one variant of it: SERA. The SERAC maintains a cache of all edit examples. Given an input, it first employs a scope classifier to estimate if the input is relevant to (falls in the scope of) any cached edit examples. If so, it then employs a counterfactual model (needs to have the identical output space as the original model) to produce the output relying on the most relevant cached example. Otherwise, it returns the output of the original model. In our proposed SME experiment setting, the in-scope examples have the same label as the edit example, thus the function of the counterfactual model is to reproduce the answer of the relevant example. During the implementation of QA, we choose the Bart-base as the counterfactual model, but we find it is not trivial for the Bart model to reproduce the answer (the original paper uses T5 for generation tasks), thus it is more practical to directly return the label of the cached edit example. We refer to this direct-return method as SERA and include it as our baseline for both Fact-Checking and Question-Answering tasks. All other implementation details about SERA are the same as the original paper (Mitchell et al., 2022b). + +Environment details For all methods, we run SME experiment $n = 20$ times on $n$ different edit folders simultaneously using 8 NVIDIA Tesla V100 GPUs. And it cost around 1 hour for running Trnasformer-Patcher on FEVER and around 3 hours on zsRE. + +# C EXTRA EXPERIMENT RESULTS + +Variation of locality with the number of edits The metric ER, TestR, and TrainR reflect the locality of the final model, but how models behave in the middle is still unclear to us. Thus we choose KE, MEND, FT(all)+KL, and Transformer-Patcher and investigate how their locality varies with the number of edits on the QA task. The results are shown in Figure 7. As editing continues, + +Table 4: Mean and deviation of absolute patches activation values on three different kinds of examples + +
PatchFEVER Fact-CheckingzsRE Question-Answering
EditPast-editRandomEditPast-editRandom
w/o lm34.3±9.315.7±8.10.5±3.011.32±7.31.23±1.640.14±0.3
KL9.15±2.70.01±0.160.05±0.21.12±1.870.03±0.060.12±0.1
T-Patcher10.25±2.30.00±0.00.05±0.16.78±2.580.00±0.000.10±0.1
+ +Table 5: The standard deviation of Edit Retain Rate (ER), Training Retain Rate (TrainR), Test Retain Rate (TestR) of Transformer-Patcher (T-Patcher) and fine-tuning based baselines on FEVER and zsRE dataset. + +
EditorFEVER Fact-Checking BERT-base (110M)zsRE Question-Answering BART-base (139M)
ERTrainRTestRERTrainRTestR
FT(last)0.055890.062420.033220.039810.009200.01860
FT(all)0.070080.033680.021780.051680.023220.01781
FT(last)+KL0.059290.025160.016350.031730.012930.01697
FT(all)+KL0.062480.006770.011160.064330.016590.01953
T-Patcher0.000000.000450.000480.009160.001010.00115
w/o \(l_{m}\)0.103320.218720.145690.232590.050630.15795
KL0.000780.005360.002480.071240.082370.02469
+ +more and more damage has been done to the model by other baselines, except Transformer-Patcher. + +![](images/77b65a18d1fddaedadae41a074423363d9409a1367b1045411e6df98d85958b5.jpg) +(a) Edit Retain Rate + +![](images/2de8022033c8af2e716426eede3b79b0a91b9ff3fdb256755a9fcf9d8a12fc94.jpg) +(b) Test Retain Rate + +![](images/e066af1da190b81244d1d69dbe912ad195bed59ffc3300df5abfc099cad4c62f.jpg) +(c) Train Retain Rate +Figure 7: Variation of ER, TestR, and TrainR with the number of edits on QA task. + +Standard deviation of experiment results Since some values in Table 1 and Table 3 are very close, we report the standard deviation in Table 5. Note that the SR and the GR are calculated using all different folders at the same time, the standard deviation is therefore 0. According to Table 5, Transformer-Patcher achieves the smallest deviation on ER, TrainR, and TestR. + +Statistics of activation values of different patches In order to study the activation situation of patches on different examples, we present the mean and deviation of absolute patches activation values on three different mistakes: 1) Edit: the mistake for which the patch is added; 2) Past-edit: mistakes from previous edit examples; 3) Random: mistake of examples randomly sampled from $D_{test}$ . As BERT and BART utilize GeLU, both positive and negative activation values could activate the patch. We employ absolute value to measure to what extent the patch is activated. The results are shown in Table 4. First, the T-Patcher w/o $l_{m}$ attains the highest value for Edit queries, indicating the effectiveness of our activation loss. Then our memory loss can effectively push the activation values of Past-edit and Random queries to 0, thus disabling the patch on irrelevant examples. The + +Table 6: The Success Rate (SR), Generalization Rate (GR), Edit Retain Rate (ER), Training Retain Rate (TrainR), Test Retain Rate (TestR) of Transformer-Patcher (T-Patcher) with a fixed memory set. + +
EditorFEVER Fact-Checking BERT-base (110M)zsRE Question-Answering BART-base (139M)
SRGRERTrainRTestRSRGRERTrainRTestR
T-Patcher1.000.820.9991.0001.0001.000.820.970.9990.997
+ +Table 7: The experimental results when utilizing all data in $D_{edit}$ as a single run of SME. E represents how many edits have been conducted. N represents how many mistakes have been made by the initial model $f_0$ on the entire edit set $D_{edit}$ . + +
TaksSRGRERTrainRTestRENEditor
FEVER1.000.821.000.9991.0009981231T-Patcher
zsRE0.990.810.970.9120.94823082766
FEVER1.000.540.160.9981.00212501231FT(all)+KL
zsRE1.000.690.140.9360.97428212766
FEVER1.000.891.000.7170.70915881231SERA
zsRE1.000.900.970.7280.69435582766
+ +KL Patch has the lowest activation value of Edit query on both tasks, which explains the lower SR of QA in Table 3. + +Editing results of Transformer-Patcher with fixed memory set The experimental results 1 are obtained using a memory set that is updated with the editing proceeds. Thus in Table 6 we present the editing results of Transformer-Patcher using a fixed memory set. We only observe a slight decline in ER and a slight rise in TrainR. The results further show the robustness of our method. Besides, we have to highlight that our method allows us to save more previous edits as memory and leverage more memories in the training process. Because we do not need to save original raw data but only corresponding input queries (several constant vectors that do not require gradients). On the contrary, KL requires feeding a mini-batch of raw data into the pre-edit model and post-edit model separately, thus the GPU memory becomes a restriction of the number of memories utilized in one batch. But Transformer-Patcher could apply hundreds of thousands of memory vectors in one batch and cost minimal GPU memory and computation resources. + +Contradictory of lower E and lower TestR in Table 2 It seems inconsistent that Transformer-Patcher has achieved fewer E and lower TestR than FT(all)+KL method. Because one would expect the model to reduce future errors and behave better on the test set by fixing errors. The phenomenon may be because of the data distribution gap between the edit set and the test set. Thus the improvement of "reducing future errors" can not directly lead to higher TestR. For FEVER, the accuracy of the initial model attains $88.3\%$ on the edit set and $76.9\%$ on the test set. For zsRE, the accuracy of the initial model attains $47.9\%$ on the edit set and $23.1\%$ on the test set. A distinct gap between the edit set and test set is observed. Thus we should comprehensively consider all metrics to evaluate methods. Another reasonable explanation is that our modified model may slightly overfit the edit example. But fitting more to edit examples may be a desired feature in actual applications because we expect the model to be closer to the real data met during deployment. + +# ACKNOWLEDGMENTS + +This work was partially supported by the State Key Laboratory of Software Development Environment of China under Grant SKLSDE-2023ZX-16. \ No newline at end of file diff --git a/transformerpatcheronemistakeworthoneneuron/images.zip b/transformerpatcheronemistakeworthoneneuron/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..b06ca5afe0e8c6a627aac43cf1875be685d1709c --- /dev/null +++ b/transformerpatcheronemistakeworthoneneuron/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:780991cc42794ad0d900871d8dee154d4299e1a669f6437fc5a1962b923bd67f +size 690255 diff --git a/transformerpatcheronemistakeworthoneneuron/layout.json b/transformerpatcheronemistakeworthoneneuron/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..de94f3ef10b2c2053c7edb688d1181247d68841c --- /dev/null +++ b/transformerpatcheronemistakeworthoneneuron/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0eb2ed9c6a47f4320dfc7bb64e20f0f016c487f7659a9faf9e1774239557e938 +size 570102 diff --git a/transpeechspeechtospeechtranslationwithbilateralperturbation/8496ecb1-f6c2-4cfc-afce-97312b8c1375_content_list.json b/transpeechspeechtospeechtranslationwithbilateralperturbation/8496ecb1-f6c2-4cfc-afce-97312b8c1375_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..c471ed133adac396dd8483c3e20747a2009b0c12 --- /dev/null +++ b/transpeechspeechtospeechtranslationwithbilateralperturbation/8496ecb1-f6c2-4cfc-afce-97312b8c1375_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:22580e8f6197a1f3f17b259eb4706eba4b6e9ba21307a887e72d5dff08294dde +size 97730 diff --git a/transpeechspeechtospeechtranslationwithbilateralperturbation/8496ecb1-f6c2-4cfc-afce-97312b8c1375_model.json b/transpeechspeechtospeechtranslationwithbilateralperturbation/8496ecb1-f6c2-4cfc-afce-97312b8c1375_model.json new file mode 100644 index 0000000000000000000000000000000000000000..8b5eb91e4633e24c911d1fd3da725bc84d3ea951 --- /dev/null +++ b/transpeechspeechtospeechtranslationwithbilateralperturbation/8496ecb1-f6c2-4cfc-afce-97312b8c1375_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9188e9ed8fd5e2413ad8e679c7e2de00318fd50313ef93f3b382ff8c96e637d +size 123420 diff --git a/transpeechspeechtospeechtranslationwithbilateralperturbation/8496ecb1-f6c2-4cfc-afce-97312b8c1375_origin.pdf b/transpeechspeechtospeechtranslationwithbilateralperturbation/8496ecb1-f6c2-4cfc-afce-97312b8c1375_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fc9815ac89354d360135c204588114013983ea7c --- /dev/null +++ b/transpeechspeechtospeechtranslationwithbilateralperturbation/8496ecb1-f6c2-4cfc-afce-97312b8c1375_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a2fee1a1a124f252184be55f6bb6f10ee3cd95782a1e5ede2bf1cd5478a31263 +size 1820662 diff --git a/transpeechspeechtospeechtranslationwithbilateralperturbation/full.md b/transpeechspeechtospeechtranslationwithbilateralperturbation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..35a6d5aab52715575bee3f3641681f3e1fa54683 --- /dev/null +++ b/transpeechspeechtospeechtranslationwithbilateralperturbation/full.md @@ -0,0 +1,369 @@ +# TRANSPEECH: SPEECH-TO-SPEECH TRANSLATION WITH BILATERAL PERTURBATION + +Rongjie Huang $^{1*}$ ; Jinglin Liu $^{1*}$ ; Huadai Liu $^{1*}$ ; Yi Ren $^{2}$ , Lichao Zhang $^{1}$ , Jinzheng He $^{1}$ , Zhou Zhao $^{1\dagger}$ + +1Zhejiang University {rongjiehuang, jinglinliu, huadailiu, zhaozhou}@zju.edu.cn + +2ByteDance ren.yi@bytedance.com + +# ABSTRACT + +Direct speech-to-speech translation (S2ST) with discrete units leverages recent progress in speech representation learning. Specifically, a sequence of discrete representations derived in a self-supervised manner are predicted from the model and passed to a vocoder for speech reconstruction, while still facing the following challenges: 1) Acoustic multimodality: the discrete units derived from speech with same content could be indeterministic due to the acoustic property (e.g., rhythm, pitch, and energy), which causes deterioration of translation accuracy; 2) high latency: current S2ST systems utilize autoregressive models which predict each unit conditioned on the sequence previously generated, failing to take full advantage of parallelism. In this work, we propose TranSpeech, a speech-to-speech translation model with bilateral perturbation. To alleviate the acoustic multimodal problem, we propose bilateral perturbation (BiP), which consists of the style normalization and information enhancement stages, to learn only the linguistic information from speech samples and generate more deterministic representations. With reduced multimodality, we step forward and become the first to establish a non-autoregressive S2ST technique, which repeatedly masks and predicts unit choices and produces high-accuracy results in just a few cycles. Experimental results on three language pairs demonstrate that BiP yields an improvement of 2.9 BLEU on average compared with a baseline textless S2ST model. Moreover, our parallel decoding shows a significant reduction of inference latency, enabling speedup up to $21.4\mathrm{x}$ than autoregressive technique. $^{1}$ + +# 1 INTRODUCTION + +Speech-to-speech translation (S2ST) aims at converting speech from one language into speech in another, significantly breaking down communication barriers between people not sharing a common language. Among the conventional method (Lavie et al., 1997; Nakamura et al., 2006; Wahlster, 2013), the cascaded system of automatic speech recognition (ASR), machine translation (MT), or speech-to-text translation (S2T) followed by text-to-speech synthesis (TTS) have demonstrated reasonable results yet suffering from expensive computational costs. Compared to these cascaded systems, recently proposed direct S2ST literature (Jia et al., 2019; Zhang et al., 2020; Jia et al., 2021; Lee et al., 2021a;b) demonstrate the benefits of lower latencies as fewer decoding stages are needed. + +Among them, Lee et al. (2021a,b) leverage recent progress on self-supervised discrete units learned from unlabeled speech for building textless S2ST systems, further supporting translation between unwritten languages. As illustrated in Figure 1(a), the unit-based textless S2ST system consists of + +![](images/1cbc6375b1ba24216313f72513f62ac86692dccd95214d447548b8e51bd3b8e5.jpg) +(a) Direct speech-to-speech translation (S2ST) system + +![](images/0932f99432b0bea921126f88dfadbfc17598c1f7706092d710cf5129a52d2a91.jpg) +(b) Multimodality challenges +Figure 1: 1) Acoustic multimodality: Speech with the same content "Vielen dank" could be different due to a variety of acoustic conditions; 2) Linguistic multimodality (Gu et al., 2017; Wang et al., 2019): There are multiple correct target translations ("Danke schon" and "Vielen dank") for the same source word/phrase/sentence ("Thank you"). + +a speech-to-unit translation (S2UT) model followed by a unit-based vocoder that converts discrete units to speech, leading to a significant improvement over previous literature. + +In modern textless speech-to-speech translation (S2ST), our goal is mainly two-fold: 1) high quality: direct S2ST is challenging, especially without using the transcription. 2) low latency: high inference speed is essential when considering real-time translation. However, the current development of the unit-based textless S2ST system is hampered by two major challenges: 1) It is challenging to achieve high translation accuracy due to the acoustic multimodality (as illustrated in the orange dotted box in Figure 1(b)): different from the language tokens (e.g., bpe) used in the text translation, the self-supervised representation derived from speech with the same content could be different due to a variety of acoustic conditions (e.g., speaker identity, rhythm, pitch, and energy), including both linguistic content and acoustic information. As such, the indeterministic training target for speech-to-unit translation fails to yield good results; and 2) Building a parallel model upon multimodal S2ST systems with reasonable accuracy is challenging as it introduces further indeterminacy. A non-autoregressive (NAR) S2ST system generates all tokens in parallel without any limitation of sequential dependency, making it a poor approximation to the actual target distribution. With the acoustic multimodality unsettled, the parallel decoding approaches increasingly burden S2ST capturing the distribution of target translation. + +In this work, we propose TranSpeech, a fast speech-to-speech translation model with bilateral perturbation. To tackle the acoustic multimodal challenge, we propose a Bilateral Perturbation (BiP) technique that finetunes a self-supervised speech representation learning model with CTC loss to generate deterministic representation agnostic to acoustic variation. Based on preliminary speech analysis by decomposing a signal into linguistic and acoustic information, the bilateral perturbation consists of the 1) style normalization stage, which eliminates the acoustic-style information in speech and creates the style-agnostic "pseudo text" for finetuning; and 2) information enhancement stage, which applies information bottleneck to create speech samples variant in acoustic conditions (i.e., rhythm, pitch, and energy) while preserving linguistic information. The proposed bilateral perturbation guarantees the speech encoder to learn only the linguistic information from acoustic-variant speech samples, significantly reducing the acoustic multimodality in unit-based S2ST. + +The proposed bilateral perturbation eases acoustic multimodality and makes it possible for NAR generation. As such, we further step forward and become the first to establish a NAR S2ST technique, which repeatedly masks and predicts unit choices and produces high-accuracy results in just a few cycles. Experimental results on three language pairs demonstrate that BiP yields an improvement of 2.9 BLEU on average compared with baseline textless S2ST models. The parallel decoding algorithm requires as few as 2 iterations to generate samples that outperformed competing systems, enabling a speedup by up to $21.4\mathrm{x}$ compared to the autoregressive baseline. TranSpeech further enjoys a speed-performance trade-off with advanced decoding choices, including multiple iterations, length beam, and noisy parallel decoding, trading by up to 3 BLEU points in translation results. The main contributions of this work include: + +- Through preliminary speech analysis, we propose bilateral perturbation which assists in generating deterministic representations agnostic to acoustic variation. This novel technique alleviates the acoustic multimodal challenge and leads to significant improvement in S2ST. + +- We step forward and become the first to establish a non-autoregressive S2ST technique with a mask-predict algorithm to speed up the inference procedure. To further reduce the linguistic multimodality in NAR translation, we apply the knowledge distillation technique and construct a less noisy and more deterministic corpus. +- Experimental results on three language pairs demonstrate that BiP yields the promotion of 2.9 BLEU on average compared with baseline textless S2ST models. In terms of inference speed, our parallel decoding enables speedup up to $21.4\mathrm{x}$ compared to the autoregressive baseline. + +# 2 BACKGROUND: DIRECT SPEECH-TO-SPEECH TRANSLATION + +Direct speech-to-speech translation has made huge progress to date. Translatotron (Jia et al., 2019) is the first direct S2ST model and shows reasonable translation accuracy and speech naturalness. Translatotron 2 (Jia et al., 2021) utilizes the auxiliary target phoneme decoder to promote translation quality but still needs phoneme data during training. UWSpeech (Zhang et al., 2020) builds the VQ-VAE model and discards transcript in the target language, while paired speech and phoneme corpora of written language are required. + +Most recently, a direct S2ST system (Lee et al., 2021a) takes advantage of self-supervised learning (SSL) and demonstrates the results without using text data. However, the majority of SSL models are trained by reconstructing (Chorowski et al., 2019) or predicting unseen speech signals (Chung et al., 2019), which would inevitably include factors unrelated to the linguistic content (i.e., acoustic condition). As such, the indeterministic training target for speech-to-unit translation fails to yield good results. The textless S2ST system (Lee et al., 2021b) further demonstrates to obtain the speaker-invariant representation by finetuning the SSL model to disentangle the speaker-dependent information. However, this system only constrains speaker identity, and the remaining aspects (i.e., content, rhythm, pitch, and energy) are still lumped together. + +At the same time, various approaches that perturb information flow to fine-tune acoustic models have demonstrated efficiency in promoting downstream performance. A line of works (Yang et al., 2021; Gao et al., 2022) utilizes the pre-trained encoder and introduces approaches that reprogram acoustic models in downstream tasks. For multi-lingual tuning, Yen et al. (2021) propose a novel adversarial reprogramming approach for low-resource spoken command recognition (SCR). Sharing a common insight, we tune a pre-trained acoustic model with bilateral perturbation technique and generates more deterministic units agnostic to acoustic conditions, including rhythm, pitch, and energy. Following the common textless setup in Figure 1(a), we design a challenging NAR S2ST technique especially for applications requiring low latency. More details have been attached in Appendix A. + +# 3 SPEECH ANALYSIS AND BILATERAL PERTURBATION + +# 3.1 ACOUSTIC MULTIMODALITY + +As reported in previous textless S2ST system (Lee et al., 2021b), speech representations predicted by the self-supervised pre-trained model include both linguistic and acoustic information. As such, derived representations of speech samples with the same content can be different due to the acoustic variation, and the indeterministic training target for speech-to-unit translation (as illustrated in Figure 1(a)) fails to yield good results. To address this multimodal issue, we conduct a preliminary speech analysis and introduce the bilateral perturbation technique. More details on how indeterminacy units influence S2ST have been attached in Appendix C. + +# 3.2 SPEECH ANALYSIS + +In this part, we decompose speech variations (Cui et al., 2022; Huang et al., 2021; Yang et al., 2022a) into linguistic content and acoustic condition (e.g., speaker identity, rhythm, pitch, and energy) and provide a brief primer on each of these components. + +Linguistic Content represents the meaning of speech signals. To translate a speech sample to another language, learning the linguistic information from the speech signal is crucial; Speaker Identity is perceived as the voice characteristics of a speaker. Rhythm characterizes how fast the speaker utters + +![](images/8b9f49bb16e16f98dd7b348efbd83ca16c8185e3b1a1eefca9bb512d62d09827.jpg) +(a) Speech Analysis and Bilateral Perturbation +(b) TranSpeech +Figure 2: In subfigure(a), we use $RR$ and $F$ to respectively denote the random resampling and a chain function for random pitch shifting. In subfigure(b), the "sinusoidal-like symbol" denotes the positional encoding, we have $N_{b}$ encoder and decoder blocks. During training, we randomly select the masked position and compute the cross-entropy loss (denoted as "CE"). + +each syllable, and the duration plays a vital role in acoustic variation; Pitch is an essential component of intonation, which is the result of a constant attempt to hit the pitch targets of each syllable; Energy affects the volume of speech, where stress and tone represent different energy values. + +# 3.3 BILATERAL PERTURBATION + +To alleviate the multimodal problem and increase the translation accuracy in the S2ST system, we propose bilateral perturbation that disentangles the acoustic variation and generates deterministic speech representations according to the linguistic content. Specifically, we leverage the success of connectionist temporal classification (CTC) finetuning (Baevski et al., 2019) with a pre-trained speech encoder, using the perturbed input speech and normalized target. Since how to obtain speaker-invariant representation has been well-studied (Lee et al., 2021b; Hsu et al., 2020), we focus on the more challenging acoustic conditions in a single-speaker scenario, including rhythm, pitch, and energy variations. + +# 3.3.1 OVERVIEW + +Denote the domain of speech samples by $S \subset \mathbb{R}$ and the perturbed speeches in style normalization and information enhancement by $\overline{S}, \hat{S}$ respectively. The source language is therefore a sequence of speech samples $X = \{x_{1},\dots,x_{N^{\prime}}\}$ , where $N^{\prime}$ is the number of frames in source speech. The SSL model is composed of a multi-layer convolutional feature encoder $f$ which takes as input raw audio $S$ and outputs discrete latent speech representations. In the end, the audio in the target language is represented as discrete units $Y = \{y_{1},\ldots ,y_{N}\}$ , where $N$ is the number of units. The overview of the information flow is shown in Figure 2(a), and we consider tackling the multimodality in bilateral sides for CTC finetuning, including 1) style normalization stage to eliminate the acoustic information in the CTC target and create the acoustic-agnostic "pseudo text"; and 2) information enhancement stage which applies bottleneck on acoustic features to create speech samples variant in acoustic conditions (e.g., rhythm, pitch, and energy) while preserving linguistic content information. In the final, we train an ASR model using the perturbed speech $\hat{S}$ as input and the "pseudo text" as the target. As a result, according to speeches with acoustic variation, the ASR model with CTC decoding is encouraged to learn the "average" information referring to linguistic content and generate deterministic representations, significantly reducing multimodality and promoting speech-to-unit translation. In the following subsections, we present the bilateral perturbation technique in detail: + +# 3.3.2 STYLE NORMALIZATION + +To create the acoustic-agnostic "pseudo text" for CTC finetuning, the acoustic-style information should be eliminated and disentangled: 1) We first compute the averaged pitch fundamental frequency $\bar{p}$ and energy $\bar{e}$ values in original dataset $S$ ; and 2) for each sample in $S$ , we conduct pitch shifting to + +$\overline{p}$ and normalize its energy to $\overline{e}$ , resulting in a new dataset $\overline{S}$ with the averaged acoustic condition, where the style-specific information has been eliminated; finally, 3) the self-supervised learning (SSL) model encodes $\overline{S}$ and creates the normalized targets for CTC finetuning. + +# 3.3.3 INFORMATION ENHANCEMENT + +According to the speech samples with different acoustic conditions, the ASR model is supposed to learn the deterministic representation referring to linguistic content. As such, we apply the following functions as information bottleneck on acoustic features (e.g., rhythm, pitch, and energy) to create highly acoustic-variant speech samples $\hat{S}$ , while the linguistic content remains unchanged, including 1) formant shifting $fs$ , 2) pitch randomization $pr$ , 3) random frequency shaping using a parametric equalizer $peq$ , and 4) random resampling $RR$ . + +- For rhythm information, random resampling $RR$ divides the input into segments of random lengths, and we randomly stretch or squeeze each segment along the time dimension. +- For pitch information, we apply the chain function $F = fs(pr(peq(S)))$ to randomly shift the pitch value of original speech $S$ . +- For energy information, we perturb the audio in the waveform domain. + +The perturbed waveforms $\hat{S}$ are highly variant on acoustic features (i.e., rhythm, pitch, and energy) while preserving linguistic information. It guarantees the speech encoder to learn the "acoustic-averaged" information referring to linguistic content and generate deterministic representations. The hyperparameters of the perturbation functions have been included in Appendix E. + +# 4 TRANSPEECH + +The S2ST pipeline has been illustrated in Figure 2(a), we 1) use the SSL HuBERT (Hsu et al., 2021) tuned by BiP to derive discrete units of target speech; 2) build the sequence-to-sequence model TranSpeech for speech-to-unit translation (S2UT) and 3) apply a separately trained unit-based vocoder to convert the translated units into waveform. + +In this section, we first overview the encoder-decoder architecture for TranSpeech, following which we introduce the knowledge distillation procedure to alleviate the linguistic multimodal challenges. Finally, we present the mask-predict algorithm in both training and decoding procedures and include more advanced decoding choices. + +# 4.1 ARCHITECTURE + +The overall architecture has been illustrated in Figure 2(b), and we put more details on the encoder and decoder block in Appendix B. + +Conformer Encoder. Different from previous textless S2ST literature (Lee et al., 2021b), we use conformer blocks (Gulati et al., 2020) in place of transformer blocks (Vaswani et al., 2017). The conformer model (Guo et al., 2021; Chen et al., 2021) has demonstrated its efficiency in combining convolution neural networks and transformers to model both local and global dependencies of audio in a parameter-efficient way, achieving state-of-the-art results on various downstream tasks. Furthermore, we employ the multi-head self-attention with a relative sinusoidal positional encoding scheme from Transformer-XL (Dai et al., 2019), which promotes the robustness of the self-attention module and generalizes better to different utterance lengths. + +Non-autoregressive Unit Decoder. Currently, S2ST systems utilize the autoregressive S2UT models and suffer from high inference latency. Given the $N'$ frames source speech $X = \{x_{1},\ldots ,x_{N'}\}$ , autoregressive model $\theta$ factors the distribution over possible outputs $Y = \{y_{1},\dots ,y_{N}\}$ by $p(Y\mid X;\theta) = \prod_{i = 1}^{N + 1}p(y_i\mid y_{0:i - 1},x_{1:N';\theta})$ , where the special tokens $y_0(\langle bos\rangle)$ and $y_{N + 1}(\langle eos\rangle)$ are used to represent the beginning and end of all target units. + +Unlike the relatively well-studied non-autoregressive (NAR) MT (Gu et al., 2017; Wang et al., 2019; Gu et al., 2019; Ghazvininejad et al., 2019; Yin et al., 2023), building NAR S2UT models that generate units in parallel could be much more challenging due to the joint linguistic and acoustic + +multimodality. Yet the proposed bilateral perturbation eases this acoustic multimodality and makes it possible for NAR modeling. As such, we further step forward and become the first to establish a NAR S2ST model $\theta$ . + +It assumes that the target sequence length $N$ can be modeled with a separate conditional distribution $p_L$ , and the distribution becomes $p(Y \mid X; \theta) = p_L(T \mid x_{1:N'}; \theta) \cdot \prod_{i=1}^{N} p(y_i \mid x_{1:N'}; \theta)$ . The target units are conditionally independent of each other, and the individual probabilities $p$ is predicted for each token in $Y$ . Since the length of target units $N$ should be given in advance, TranSpeech predicts it by pooling the encoder outputs into a length predictor. + +# 4.2 LINGUISTIC MULTIMODALITY + +As illustrated in Figure 1(b), there might be multiple valid translations for the same source utterance, and thus this linguistic multimodality degrades the ability of NAR models to properly capture the target distribution. To alleviate this linguistic multimodality in NAR translation, we apply knowledge distillation to construct a sampled translation corpus from an autoregressive teacher, which is less noisy and more deterministic than the original one. The knowledge of the AR model is distilled to the NAR model, assisting to capture the target distribution for better accuracy. + +# 4.3 MASK-PREDICT + +The NAR unit decoder applies the mask-predict algorithm (Ghazvininejad et al., 2019) to repeatedly reconsider unit choices and produce high-accuracy translation results in just a few cycles. + +Training. During training, the target units are given conditioned on source speech sample $X$ and the unmasked target units $Y_{obs}$ . As illustrated in Figure 2(b), given the length $N$ of the target sequence, we first sample the number of masked units from a uniform distribution $n \sim \mathrm{Unif}(\{1,\dots ,N\})$ , and then randomly choose the masked position. For the learning objective, we compute the cross-entropy (CE) loss with label smoothing between the generated and target units in masked places, and the CE loss for target length prediction is further added. + +Decoding. In inference, the algorithm runs for pre-determined $T$ times of iterative refinement, and we perform a mask operation at each iteration, followed by predict. + +In the first iteration $t = 0$ , we predict the length $N$ of target sequence and mask all units $Y = \{y_{1},\ldots ,y_{N}\}$ . In the following iterations, we mask $n$ units with the lowest probability scores $p$ : + +$$ +Y _ {m a s k} ^ {t} = \arg \min _ {i} (p _ {i}, n) \quad Y _ {o b s} ^ {t} = Y \backslash Y _ {m a s k} ^ {t}, \tag {1} +$$ + +where $n$ is a function of the iteration $t$ , and we use linear decay $n = N \cdot \frac{T - t}{T}$ in this work. + +After masking, TranSpeech predicts the masked units $Y_{mask}^{t}$ conditioned on the source speech $X$ and unmasked units $Y_{obs}$ . We select the prediction with the highest probability $p$ for each $y_{i} \in Y_{mask}^{t}$ and update its probability score accordingly: + +$$ +y _ {i} ^ {t} = \arg \max _ {w} P \left(y _ {i} = w \mid X, Y _ {o b s} ^ {t}; \theta\right) \quad p _ {i} ^ {t} = \max _ {w} P \left(y _ {i} = w \mid X, Y _ {o b s} ^ {t}; \theta\right) \tag {2} +$$ + +# 4.4 ADVANCED DECODING CHOICES + +Target Length Beam. It has been reported (Ghazvininejad et al., 2019) that translating multiple candidate sequences of different lengths can improve performance. As such, we select the top $K$ length candidates with the highest probabilities and decode the same example with varying lengths in parallel. In the following, we pick up the sequence with the highest average log probability as our result. It avoids distinctly increasing the decoding time since the computation can be batched. + +Noisy Parallel Decoding. The absence of the AR decoding procedure makes it more difficult to capture the target distribution in S2ST. To obtain the more accurate optimum of the target distribution and compute the best translation for each fertility sequence, we use the autoregressive teacher to identify the best overall translation. + +# 5 EXPERIMENTS + +# 5.1 EXPERIMENTAL SETUP + +Following the common practice in the direct S2ST pipeline, we apply the publicly-available pretrained multilingual HuBERT (mHuBERT) model and unit-based HiFi-GAN vocoder (Polyak et al., 2021; Kong et al., 2020) and leave them unchanged. + +Dataset. For a fair comparison, we use the benchmark CVSS-C dataset (Jia et al., 2022), which is derived from the CoVoST 2 (Wang et al., 2020b) speech-to-text translation corpus by synthesizing the translation text into speech using a single-speaker TTS system. To evaluate the performance of the proposed model, we conduct experiments on three language pairs, including French-English (Fr-En), English-Spanish (En-Es), and English-French (En-Fr). + +Model Configurations and Training. For bilateral perturbation, we finetune the publicly-available mHuBERT model for each language separately with CTC loss until 25k updates using the Adam optimizer $(\beta_{1} = 0.9, \beta_{2} = 0.98, \epsilon = 10^{-8})$ . Following the practice in textless S2ST (Lee et al., 2021b), we use the k-means algorithm to cluster the representation given by the well-tuned mHuBERT into a vocabulary of 1000 units. TranSpeech computes 80-dimensional mel-filterbank features at every 10-ms for the source speech as input, and we set $N_{b}$ to 6 in encoding and decoding blocks. In training the TranSpeech, we remove the auxiliary tasks for simplification and follow the unwritten language scenario. TranSpeech is trained until convergence for 200k steps using 1 Tesla V100 GPU. A comprehensive table of hyperparameters is available in Appendix B. + +Evaluation and Baseline models. For translation accuracy, we pre-train an ASR model to generate the corresponding text of the translated speech and then calculate the BLEU score (Papineni et al., 2002) between the generated and the reference text. In decoding speed, latency is computed as the time to decode the single n-frame speech sample averaged over the test set using 1 V100 GPU. + +We compare TranSpeech with other systems using the publicly-available fairseq framework (Ott et al., 2019), including 1) Direct ASR, where we transcribe S2ST data with open-sourced ASR as reference and compute BELU; 2) Direct TTS, where we synthesize speech samples with target units, and then transcribe the speech to text and compute BELU; 3) S2T+TTS cascaded system, where we train the S2T basic transformer model (Wang et al., 2020a) and then apply TTS model (Ren et al., 2020; Kong et al., 2020) for speech generation; 4) basic transformer (Lee et al., 2021a) without using text, and 5) basic norm transformer (Lee et al., 2021b) with speaker normalization. + +# 5.2 TRANSLATION ACCURACY AND SPEECH NATURALNESS + +Table 1 summarizes the translation accuracy and inference latency among all systems, and we have the following observations: 1) Bilateral perturbation (3 vs. 4) improves S2ST performance by a large margin of 2.9 BLEU points. The proposed techniques address acoustic multimodality by disentangling the acoustic information and learning linguistic representation given speech samples, which produce more deterministic targets in speech-to-unit translation. 2) Conformer architecture (2 vs. 3) shows a 2.2 BLEU gain of translation accuracy. It combines convolution neural networks and transformers as joint architecture, exhibiting outperformed ability in learning local and global dependencies of an audio. 3) Knowledge distillation (6 vs. 7) is demonstrated to alleviate the linguistic multimodality where training on the distillation corpus provides a distinct promotion of around 1 BLEU points. For speech quality, we attach evaluation in Appendix D. When considering the speed-performance trade-off in the NAR unit decoder, we find that more iterative cycles (7 vs. 8), or advanced decoding methods (e.g., length beam (8 vs. 9) and noisy parallel decoding (9 vs. 10)) further lead to an improvement of translation accuracy, trading up to 1.5 BLEU points during decoding. In comparison with baseline systems, TranSpeech yields the highest BLEU scores than the best publicly-available direct S2ST baselines (2 vs. 6) by a considerable margin; in fact, only 2 mask-predict iterations (see Figure 3(b)) are necessary for achieving a new SOTA on textless S2ST. + +# 5.3 DECODING SPEED + +We visualize the relationship between the translation latency and the length of input speech in Figure 3(a). As can be seen, the autoregressive baselines have a latency linear in the decoding + +Table 1: Translation quality (BLEU scores $(\uparrow)$ ) and inference speed (frame/second $(\uparrow)$ ) comparison with baseline systems. We set beam size to 5 in autoregressive decoding, and apply 5 iterative cycles in NAR naive decoding. $\dagger$ : In this work, we remove the auxiliary task (e.g., source and target CTC, auto-encoding) in training the S2ST system for simplification. Though the S2ST system can be further improved with the auxiliary task, this is beyond our focus. BiP: Bilateral Perturbation; NPD: noisy parallel decoding; b: length beam in NAR decoding. + +
IDModelBiPFr-EnEn-FrEn-EsSpeedSpeedup
Autoregressive models
1Basic Transformer (Lee et al., 2021a)†×15.4415.2810.078701.00×
2Basic Norm Transformer (Lee et al., 2021b)†×15.8115.9312.98
3Basic Conformer×18.0217.0713.758951.02×
4Basic Conformer✓22.3919.6514.94
Non-autoregressive models with naive decoding
5TranSpeech - Distill×14.8614.1210.27961011.04×
6Transpeech - Distill✓16.2315.910.94
7TranSpeech✓17.2416.311.79
Non-autoregressive models with advanced decoding
8TranSpeech (iter=15)✓18.0316.9712.6246515.34×
9TranSpeech (iter=15 + b=15)✓18.1017.0512.7023942.75×
10TranSpeech (iter=15 + b=15 + NPD)✓18.3917.5012.7722082.53×
Cascaded systems
11S2T + TTS/27.1734.8532.86//
12Direct ASR/71.6150.9268.75//
13Direct TTS/82.4176.8783.69//
+ +![](images/97f90f40c3e0ba55818fa5a1df984c65e8687e7d3c4f68c41ffe6eaf543e581c.jpg) +(a) Translation latency + +![](images/1301747a461012319cff9b5646d2f75bc3ad0b2da5d1b8c1d69a863b08504243.jpg) +(b) Performance-speed trade-off. +Figure 3: The translation latency is computed as the time to decode the n-frame speech sample, averaged over the test set using 1 NVIDIA V100. b: length beam. NPD: noisy parallel decoding. + +length. At the same time, NAR TranSpeech is nearly constant for typical lengths, even with multiple cycles of mask-predict iterative refinement. We further illustrate the versatile speed-performance trade-off for NAR decoding in Figure 3(b). TranSpeech enables a speedup up to $21.4\mathrm{x}$ compared to the autoregressive baseline. On the other, it could alternatively retain the highest quality with BELU 18.39 while gaining a $253\%$ speedup. + +# 5.4 CASE STUDY + +We present several translation examples sampled from the Fr-En language pair in Table 2, and have the following findings: 1) Models trained with original units suffer severely from the issue of noisy and incomplete translation due to the indeterministic training targets, while with the bilateral perturbation brought in, this multimodal issue is largely alleviated; 2) the advanced decoding methods lead to a distinct improvement in translation accuracy. As can be seen, the results produced by the TranSpeech + +Table 2: Two examples comparing translations produced by TranSpeech and baseline models. We use the bond fonts to indicate the the issue of noisy and incomplete translation. + +
Source:l'origine de la rue est liée à la construction de la place rihour.
Target:the origin of the street is linked to the construction of rihour square.
Basic Conformer:the origin of the street is linked to the construction of the.
TranSpeech:th origin of the seti is linked to the construction of the rear.
TranSpeech+BiP:the origin of the street is linked to the construction of the ark.
TranSpeech+BiP+Advanced:the origin of the street is linked to the construction of the work.
Source:il participe aux activités du patronage laïquè et des pionniers de saint-ouen.
Target:he participates in the secular patronage and pioneer activities of saint ouen.
Basic Conformer:he participated in the activities of the late patronage a d see.
TranSpeech:he takes in the patronage activities in of saint.
TranSpeech+BiP:he participated in the activities of the lake patronage and say pointing
TranSpeech+BiP+Advanced:he participated in the activities of the wake patronage and saint pioneers
+ +with advanced decoding (more iterations and NPD), while of a similar quality to those produced by the autoregressive basic conformer, are noticeably more literal. + +# 5.5 ABLATION STUDY + +We conduct ablation studies to demonstrate the effectiveness of several detailed designs in this work, including the bilateral perturbation and the conformer architecture in TranSpeech. The results have been presented in Table 3, and we have the following observations: 1) Style normalization and information enhance + +ment in bilateral perturbation both demonstrate a performance gain, and they work in a joint effort to learn deterministic representations, leading to improvements in translation accuracy. 2) Replacing the relative positional encoding in the self-attention layer by the vanilla one (Vaswani et al., 2017) witnesses a distinct degradation in translation accuracy, demonstrating the outperformed capability of modeling both local and global audio dependencies brought by architecture designs. + +Table 3: Ablation study results. SN: style normalization; IE: information enhancement; PE: positional encoding. + +
IDModelPEFr-EnEn-FrEn-Es
1Basic ConformerRelative18.0217.0713.75
2Basic Conformer + IERelative21.9819.6014.91
3Basic Conformer + SNRelative21.5418.5313.97
4Basic ConformerAbsolute17.2316.1913.06
+ +# 6 CONCLUSION + +In this work, we propose TranSpeech, a speech-to-speech translation model with bilateral perturbation. To tackle the acoustic multimodal issue in S2ST, the bilateral perturbation, which included style normalization and information enhancement, had been proposed to learn only the linguistic information from acoustic-variant speech samples. It assisted in generating deterministic representation agnostic to acoustic conditions, significantly reducing the acoustic multimodality and making it possible for non-autoregressive (NAR) generation. As such, we further stepped forward and became the first to establish a NAR S2ST technique. TranSpeech took full advantage of parallelism and leveraged the mask-predict algorithm to generate results in a constant number of iterations. To address linguistic multimodality, we applied knowledge distillation by constructing a less noisy sampled translation corpus. Experimental results demonstrated that BiP yields an improvement of 2.9 BLEU on average compared with a baseline textless S2ST model. Moreover, TranSpeech showed a significant improvement in inference latency, which required as few as 2 iterations to generate outperformed samples, enabling a sampling speed of up to $21.4\mathrm{x}$ faster than the autoregressive baseline. We envisage that our work will serve as a basis for future textless S2ST studies. + +# ACKNOWLEDGEMENTS + +This work was supported in part by the National Natural Science Foundation of China under Grant No. 62222211, National Key R&D Program of China under Grant No.2020YFC0832505, Zhejiang Electric Power Co., Ltd. Science and Technology Project No.5211YF22006 and Yiwise. + +# REFERENCES + +Alexei Baevski, Michael Auli, and Abdelrahman Mohamed. Effectiveness of self-supervised pretraining for speech recognition. arXiv preprint arXiv:1911.03912, 2019. +Alexei Baevski, Yuhao Zhou, Abdelrahman Mohamed, and Michael Auli. wav2vec 2.0: A framework for self-supervised learning of speech representations. Advances in Neural Information Processing Systems, 33:12449-12460, 2020. +Nanxin Chen, Shinji Watanabe, Jesús Villalba, Piotr Želasko, and Najim Dehak. Non-autoregressive transformer for speech recognition. IEEE Signal Processing Letters, 28:121-125, 2020. +Sanyuan Chen, Yu Wu, Zhuo Chen, Jian Wu, Jinyu Li, Takuya Yoshioka, Chengyi Wang, Shujie Liu, and Ming Zhou. Continuous speech separation with conformer. In ICASSP 2021-2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 5749-5753. IEEE, 2021. +Hyeong-Seok Choi, Juheon Lee, Wansoo Kim, Jie Lee, Hoon Heo, and Kyogu Lee. Neural analysis and synthesis: Reconstructing speech from self-supervised representations. Advances in Neural Information Processing Systems, 34, 2021. +Jan Chorowski, Ron J Weiss, Samy Bengio, and Aaron Van Den Oord. Unsupervised speech representation learning using wavenet autoencoders. IEEE/ACM transactions on audio, speech, and language processing, 27(12):2041-2053, 2019. +Yu-An Chung, Wei-Ning Hsu, Hao Tang, and James Glass. An unsupervised autoregressive model for speech representation learning. arXiv preprint arXiv:1904.03240, 2019. +Chenye Cui, Yi Ren, Jinglin Liu, Feiyang Chen, Rongjie Huang, Ming Lei, and Zhou Zhao. Emovie: A mandarin emotion speech dataset with a simple emotional text-to-speech model. arXiv preprint arXiv:2106.09317, 2021. +Chenye Cui, Yi Ren, Jinglin Liu, Rongjie Huang, and Zhou Zhao. Varietysound: Timbre-controllable video to sound generation via unsupervised information disentanglement. arXiv preprint arXiv:2211.10666, 2022. +Zihang Dai, Zhilin Yang, Yiming Yang, Jaime Carbonell, Quoc V Le, and Ruslan Salakhutdinov. Transformer-xl: Attentive language models beyond a fixed-length context. arXiv preprint arXiv:1901.02860, 2019. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018. +Heting Gao, Junrui Ni, Kaizhi Qian, Yang Zhang, Shiyu Chang, and Mark Hasegawa-Johnson. Wavprompt: Towards few-shot spoken language understanding with frozen language models. arXiv preprint arXiv:2203.15863, 2022. +Marjan Ghazvininejad, Omer Levy, Yinhan Liu, and Luke Zettlemoyer. Mask-predict: Parallel decoding of conditional masked language models. arXiv preprint arXiv:1904.09324, 2019. +Jiatao Gu, James Bradbury, Caiming Xiong, Victor OK Li, and Richard Socher. Non-autoregressive neural machine translation. arXiv preprint arXiv:1711.02281, 2017. +Jiatao Gu, Changhan Wang, and Junbo Zhao. Levenshtein transformer. Advances in Neural Information Processing Systems, 32, 2019. + +Anmol Gulati, James Qin, Chung-Cheng Chiu, Niki Parmar, Yu Zhang, Jiahui Yu, Wei Han, Shibo Wang, Zhengdong Zhang, Yonghui Wu, et al. Conformer: Convolution-augmented transformer for speech recognition. arXiv preprint arXiv:2005.08100, 2020. +Pengcheng Guo, Florian Boyer, Xuankai Chang, Tomoki Hayashi, Yosuke Higuchi, Hirofumi Inaguma, Naoyuki Kamo, Chenda Li, Daniel Garcia-Romero, Jiatong Shi, et al. Recent developments on espnet toolkit boosted by conformer. In ICASSP 2021-2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 5874-5878. IEEE, 2021. +Wei-Ning Hsu, David Harwath, Christopher Song, and James Glass. Text-free image-to-speech synthesis using learned segmental units. arXiv preprint arXiv:2012.15454, 2020. +Wei-Ning Hsu, Benjamin Bolte, Yao-Hung Hubert Tsai, Kushal Lakhotia, Ruslan Salakhutdinov, and Abdelrahman Mohamed. Hubert: Self-supervised speech representation learning by masked prediction of hidden units. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 29:3451-3460, 2021. +Rongjie Huang, Feiyang Chen, Yi Ren, Jinglin Liu, Chenye Cui, and Zhou Zhao. Multi-singer: Fast multi-singer singing voice vocoder with a large-scale corpus. In Proceedings of the 29th ACM International Conference on Multimedia, pp. 3945-3954, 2021. +Rongjie Huang, Chenye Cui, Feiyang Chen, Yi Ren, Jinglin Liu, Zhou Zhao, Baoxing Huai, and Zhefeng Wang. Singgan: Generative adversarial network for high-fidelity singing voice generation. In Proceedings of the 30th ACM International Conference on Multimedia, pp. 2525-2535, 2022a. +Rongjie Huang, Max WY Lam, Jun Wang, Dan Su, Dong Yu, Yi Ren, and Zhou Zhao. Fastdiff: A fast conditional diffusion model for high-quality speech synthesis. arXiv preprint arXiv:2204.09934, 2022b. +Rongjie Huang, Yi Ren, Jinglin Liu, Chenye Cui, and Zhou Zhao. Generspeech: Towards style transfer for generalizable out-of-domain text-to-speech synthesis. arXiv preprint arXiv:2205.07211, 2022c. +Rongjie Huang, Zhou Zhao, Huadai Liu, Jinglin Liu, Chenye Cui, and Yi Ren. Prodiff: Progressive fast diffusion model for high-quality text-to-speech. arXiv preprint arXiv:2207.06389, 2022d. +Ye Jia, Ron J Weiss, Fadi Biadsy, Wolfgang Macherey, Melvin Johnson, Zhifeng Chen, and Yonghui Wu. Direct speech-to-speech translation with a sequence-to-sequence model. arXiv preprint arXiv:1904.06037, 2019. +Ye Jia, Michelle Tadmor Ramanovich, Tal Remez, and Roi Pomerantz. Translatotron 2: Robust direct speech-to-speech translation. arXiv preprint arXiv:2107.08661, 2021. +Ye Jia, Michelle Tadmor Ramanovich, Quan Wang, and Heiga Zen. Cvss corpus and massively multilingual speech-to-speech translation. arXiv preprint arXiv:2201.03713, 2022. +Jungil Kong, Jaehyeon Kim, and Jaekyoung Bae. Hifi-gan: Generative adversarial networks for efficient and high fidelity speech synthesis. Advances in Neural Information Processing Systems, 33:17022-17033, 2020. +Max WY Lam, Jun Wang, Rongjie Huang, Dan Su, and Dong Yu. Bilateral denoising diffusion models. arXiv preprint arXiv:2108.11514, 2021. +Alon Lavie, Alex Waibel, Lori Levin, Michael Finke, Donna Gates, Marsal Gavalda, Torsten Zeppenfeld, and Puming Zhan. Janus-iii: Speech-to-speech translation in multiple languages. In 1997 IEEE International Conference on Acoustics, Speech, and Signal Processing, volume 1, pp. 99-102. IEEE, 1997. +Ann Lee, Peng-Jen Chen, Changhan Wang, Jiatao Gu, Xutai Ma, Adam Polyak, Yossi Adi, Qing He, Yun Tang, Juan Pino, et al. Direct speech-to-speech translation with discrete units. arXiv preprint arXiv:2107.05604, 2021a. + +Ann Lee, Hongyu Gong, Paul-Ambroise Duquenne, Holger Schwenk, Peng-Jen Chen, Changhan Wang, Sravya Popuri, Juan Pino, Jiatao Gu, and Wei-Ning Hsu. Textless speech-to-speech translation on real data. arXiv preprint arXiv:2112.08352, 2021b. +Zhijie Lin, Zhou Zhao, Haoyuan Li, Jinglin Liu, Meng Zhang, Xingshan Zeng, and Xiaofei He. Simullr: Simultaneous lip reading transducer with attention-guided adaptive memory. In Proceedings of the 29th ACM International Conference on Multimedia, pp. 1359-1367, 2021. +Satoshi Nakamura, Konstantin Markov, Hiromi Nakaiwa, Gen-ichiro Kikui, Hisashi Kawai, Takatoshi Jitsuhiro, J-S Zhang, Hirofumi Yamamoto, Eiichiro Sumita, and Seiichi Yamamoto. The atr multilingual speech-to-speech translation system. IEEE Transactions on Audio, Speech, and Language Processing, 14(2):365-376, 2006. +Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli. *fairseq: A fast, extensible toolkit for sequence modeling*. arXiv preprint arXiv:1904.01038, 2019. +Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting of the Association for Computational Linguistics, pp. 311-318, 2002. +Adam Polyak and Lior Wolf. Attention-based wavenet autoencoder for universal voice conversion. In ICASSP 2019-2019 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 6800-6804. IEEE, 2019. +Adam Polyak, Yossi Adi, Jade Copet, Eugene Kharitonov, Kushal Lakhotia, Wei-Ning Hsu, Abdelrahman Mohamed, and Emmanuel Dupoux. Speech resynthesis from discrete disentangled self-supervised representations. arXiv preprint arXiv:2104.00355, 2021. +Kaizhi Qian, Yang Zhang, Shiyu Chang, Mark Hasegawa-Johnson, and David Cox. Unsupervised speech decomposition via triple information bottleneck. In International Conference on Machine Learning, pp. 7836-7846. PMLR, 2020. +Kaizhi Qian, Yang Zhang, Shiyu Chang, Jinjun Xiong, Chuang Gan, David Cox, and Mark Hasegawa-Johnson. Global prosody style transfer without text transcriptions. In International Conference on Machine Learning, pp. 8650-8660. PMLR, 2021. +Yi Ren, Chenxu Hu, Xu Tan, Tao Qin, Sheng Zhao, Zhou Zhao, and Tie-Yan Liu. Fastspeech 2: Fast and high-quality end-to-end text to speech. arXiv preprint arXiv:2006.04558, 2020. +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017. +Wolfgang Wahlster. Verbmobil: foundations of speech-to-speech translation. Springer Science & Business Media, 2013. +Changhan Wang, Yun Tang, Xutai Ma, Anne Wu, Dmytro Okhonko, and Juan Pino. fairseq s2t: Fast speech-to-text modeling with fairseq. In Proceedings of the 2020 Conference of the Asian Chapter of the Association for Computational Linguistics (AACL): System Demonstrations, 2020a. +Changhan Wang, Anne Wu, and Juan Pino. Covost 2 and massively multilingual speech-to-text translation. arXiv preprint arXiv:2007.10310, 2020b. +Yiren Wang, Fei Tian, Di He, Tao Qin, ChengXiang Zhai, and Tie-Yan Liu. Non-autoregressive machine translation with auxiliary regularization. In Proceedings of the AAAI conference on artificial intelligence, volume 33, pp. 5377-5384, 2019. +Yan Xia, Zhou Zhao, Shangwei Ye, Yang Zhao, Haoyuan Li, and Yi Ren. Video-guided curriculum learning for spoken video grounding. In Proceedings of the 30th ACM International Conference on Multimedia, pp. 5191-5200, 2022. +Bang Yang, Fenglin Liu, and Yuexian Zou. Non-autoregressive video captioning with iterative refinement. 2019. + +Chao-Han Huck Yang, Yun-Yun Tsai, and Pin-Yu Chen. Voice2series: Reprogramming acoustic models for time series classification. In International Conference on Machine Learning, pp. 11808-11819. PMLR, 2021. +Dongchao Yang, Songxiang Liu, Jianwei Yu, Helin Wang, Chao Weng, and Yuexian Zou. Norespeech: Knowledge distillation based conditional diffusion model for noise-robust expressive tts. arXiv preprint arXiv:2211.02448, 2022a. +Dongchao Yang, Jianwei Yu, Helin Wang, Wen Wang, Chao Weng, Yuexian Zou, and Dong Yu. Diffsound: Discrete diffusion model for text-to-sound generation. arXiv preprint arXiv:2207.09983, 2022b. +Dongchao Yang, Songxiang Liu, Rongjie Huang, Guangzhi Lei, Chao Weng, Helen Meng, and Dong Yu. Instructtts: Modelling expressive tt's in discrete latent space with natural language style prompt. arXiv preprint arXiv:2301.13662, 2023. +Zhenhui Ye, Zhou Zhao, Yi Ren, and Fei Wu. Syntaspeech: Syntax-aware generative adversarial text-to-speech. arXiv preprint arXiv:2204.11792, 2022. +Zhenhui Ye, Ziyue Jiang, Yi Ren, Jinglin Liu, Jinzheng He, and Zhou Zhao. Geneface: Generalized and high-fidelity audio-driven 3d talking face synthesis. arXiv preprint arXiv:2301.13430, 2023. +Hao Yen, Pin-Jui Ku, Chao-Han Huck Yang, Hu Hu, Sabato Marco Siniscalchi, Pin-Yu Chen, and Yu Tsao. A study of low-resource speech commands recognition based on adversarial reprogramming. arXiv preprint arXiv:2110.03894, 2021. +Aoxiong Yin, Zhou Zhao, Jinglin Liu, Weike Jin, Meng Zhang, Xingshan Zeng, and Xiaofei He. Simulslt: End-to-end simultaneous sign language translation. In Proceedings of the 29th ACM International Conference on Multimedia, pp. 4118-4127, 2021. +Aoxiong Yin, Zhou Zhao, Weike Jin, Meng Zhang, Xingshan Zeng, and Xiaofei He. Mlslt: Towards multilingual sign language translation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 5109-5119, 2022. +Aoxiong Yin, Tianyun Zhong, Li Tang, Weike Jin, Tao Jin, and Zhou Zhao. Gloss attention for gloss-free sign language translation. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2023, Vancouver, Canada, June 17-23, 2023. IEEE, 2023. +Chen Zhang, Xu Tan, Yi Ren, Tao Qin, Kejun Zhang, and Tie-Yan Liu. Uwspeech: Speech to speech translation for unwritten languages. arXiv preprint arXiv:2006.07926, 59:132, 2020. +Jie Zhang, Chen Chen, Bo Li, Lingjuan Lyu, Shuang Wu, Shouhong Ding, Chunhua Shen, and Chao Wu. Dense: Data-free one-shot federated learning. In Advances in Neural Information Processing Systems. +Jie Zhang, Bo Li, Jianghe Xu, Shuang Wu, Shouhong Ding, Lei Zhang, and Chao Wu. Towards efficient data free black-box adversarial attack. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 15115-15125, 2022a. +Jie Zhang, Bo Li, Chen Chen, Lingjuan Lyu, Shuang Wu, Shouhong Ding, and Chao Wu. Delving into the adversarial robustness of federated learning. arXiv preprint arXiv:2302.09479, 2023a. +Zijian Zhang, Zhou Zhao, and Zhijie Lin. Unsupervised representation learning from pre-trained diffusion probabilistic models. In Advances in Neural Information Processing Systems, 2022b. +Zijian Zhang, Zhou Zhao, Jun Yu, and Qi Tian. Shiftddpms: Exploring conditional diffusion models by shifting diffusion trajectories. arXiv preprint arXiv:2302.02373, 2023b. + +# Appendices + +# TranSpeech: Speech-to-Speech Translation With Bilateral Perturbation + +A RELATED WORK + +A.1 SELF-SUPERVISED REPRESENTATION LEARNING + +There has been an increasing interest in self-supervised learning in the machine learning (Zhang et al., 2022a; Lam et al., 2021; Zhang et al., 2023b; 2022b) and multimodal processing community (Xia et al., 2022; Zhang et al., 2023a; Zhang et al.; Huang et al., 2022b;a). Wav2Vec 2.0 (Baevski et al., 2020) trains a convolutional neural network to distinguish true future samples from random distractor samples using a contrastive predictive coding (CPC) loss function. HuBERT (Hsu et al., 2021) is trained with a masked prediction with masked continuous audio signals. The majority of self-supervised representation learning models are trained by reconstructing (Chorowski et al., 2019) or predicting unseen speech signals (Chung et al., 2019), which would inevitably include factors unrelated to the linguistic content (i.e., acoustic condition). + +A.2 PERTURBATION-BASED SPEECH REPROGRAMMING + +Various approaches that perturb information flow in acoustic models have demonstrated the efficiency in promoting downstream performance: SpeechSplit (Qian et al., 2020), AutoPST (Qian et al., 2021), and NANSY (Choi et al., 2021) perturb the speech variations during the analysis stage to encourage the synthesis stage to use the supplied more stable representations. Voice2Series (Yang et al., 2021) introduces a novel end-to-end approach that reprograms pre-trained acoustic models for time series classification by input transformation learning and output label mapping. Wavprompt (Gao et al., 2022) utilizes the pre-trained audio encoder as part of an ASR to convert the speech in the demonstrations into embeddings digestible to the language model. For multi-lingual tuning, Yen et al. (2021) propose a novel adversarial reprogramming approach for low-resource spoken command recognition (SCR), which repurposes a pre-trained SCR model to modify the acoustic signals. In this work, we propose the bilateral perturbation technique with style normalization and information enhancement to perturb the acoustic conditions in speech. + +A.3 NON-AUTOREGRESSIVE SEQUENCE GENERATION + +An autoregressive model (Lin et al., 2021; Yin et al., 2021; 2022) takes in a source sequence and then generates target sentences one by one with the causal structure during the inference process. It prevents parallelism during inference, and thus the computational power of GPU cannot be fully exploited. To reduce the inference latency, (Gu et al., 2017) introduces a non-autoregressive (NAR) transformer-based approach with explicit word fertility, and identifies the multimodality problem of linguistic information between the source and target language. (Ghazvininejad et al., 2019) introduced the masked language modeling objective from BERT (Devlin et al., 2018) to non-autoregressively predict and refine translations. Besides the study of neural machine translation, many works bring NAR model into other sequence-to-sequence tasks (Cui et al., 2021; Ye et al., 2023; Huang et al., 2022c; Yang et al., 2022b), such as video caption (Yang et al., 2019), speech recognition (Chen et al., 2020) and speech synthesis (Ye et al., 2022; Huang et al., 2022d; Yang et al., 2023). In contrast, we focus on non-autoregressive generation in direct S2ST, which is relatively overlooked. + +B MODEL ARCHITECTURES + +In this section, we list the model hyper-parameters of TranSpeech in Table 4. + +
HyperparameterTranSpeech
Conformer EncoderConv1d Layers2
Conv1d Kernel(5, 5)
Encoder Block6
Encoder Hidden512
Encoder Attention Heads8
Encoder Dropout0.1
Length PredictorProjection Dim512
Unit DecoderUnit Dictionary1000
Decoder Block6
Decoder Hidden512
Decoder Attention Headers8
Decoder Dropout0.1
+ +# C IMPACT OF INDETERMINISTIC TRAINING TARGET + +To visualize the acoustic multimodality and demonstrate the effectiveness of proposed bilateral perturbation, we apply the information bottleneck on acoustic features (i.e., rhythm, pitch, and energy) to create perturbed speech samples $\hat{S}_r$ , $\hat{S}_p$ , $\hat{S}_e$ , respectively. We further plot the spectrogram and pitch contours of the original and acoustic-perturbed samples in Figure 5 in Appendix F. The unit error rate (UER) is further adopted as an evaluation matrix to measure the undeterminacy and multimodality according to acoustic variation, and we have the following observations: 1) In the pre-trained SSL model, the acoustic dynamics result in UERs by up to $22.7\%$ (in rhythm), indicating the distinct alteration of derived representations. The pre-trained SSL model learns both linguistic and acoustic information given speech, and thus the units derived from speech with the same content can be indeterministic; however, 2) with the proposed bilateral perturbation (BiP), a distinct drop of UER (in energy) by up to $82.8\%$ could be witnessed, demonstrating the efficiency of BiP in producing deterministic representations referring to linguistic content. + +Table 4: Hyperparameters of TranSpeech. + +
AcousticPretrainedBiP-Tuned
Reference0.00.0
Rhythmˆr22.710.2
Pitchˆp16.34.3
Energyˆe10.51.8
+ +Table 5: We calculate UER between units derived from original and perturbed speeches respectively using the pre-trained and fine-tuned SSL model, which is calculated averaged over the dataset. It measures the ability of the SSL model to generate acoustic-agnostic representations referring to linguistic content. + +# D EVALUATION ON SPEECH QUALITY + +Following the publicly-available implementation fairseq (Ott et al., 2019), we include the SNR as an evaluation matrix to measure the speech quality across the test set. We approximate the noise by subtracting the output of the enhancement model from the input-noisy speech and then compute the SNR between the two. Further, we conduct crowd-sourced human evaluations with MOS, rated from 1 to 5 and reported with $95\%$ confidence intervals (CI). For easy comparison, the results are compiled and presented in the following table: + +As illustrated in Table 6, TranSpeech has achieved the SNR and MOS with scores of 46.56 and 4.03 competitive with the baseline systems. Since we apply the publicly-available pre-trained unit + +
MethodSNR (↑)MOS (↑)
Translation GT/4.22±0.06
DirectS2ST46.454.01±0.07
TextlessS2ST47.224.05±0.06
TranSpeech46.564.03±0.06
+ +Table 6: Speech quality (SNR(↑) and MOS(↑)) comparison with baseline systems. + +vocoder and leave it unchanged for unit-to-speech, we expect our model to exhibit high-quality speech generation as baseline models while achieving a significant improvement in translation accuracy. + +# E INFORMATION ENHANCEMENT + +We apply the following functions (Qian et al., 2020; Choi et al., 2021) on acoustic features (e.g., rhythm, pitch, and energy) to create acoustic-perturbed speech samples $\hat{S}$ , while the linguistic content remains unchanged, including 1) formant shifting $fs$ , 2) pitch randomization $pr$ , 3) random frequency shaping using a parametric equalizer $peq$ , and 4) random resampling $RR$ . As shown in Figure 4, we further illustrate the mel-spectrogram of the single-perturbed utterance in bilateral perturbation. + +- For $fs$ , a formant shifting ratio is sampled uniformly from $\mathrm{Unif}(1, 1.4)$ . After sampling the ratio, we again randomly decided whether to take the reciprocal of the sampled ratio or not. +- In $pr$ , a pitch shift ratio and pitch range ratio are sampled uniformly from Unif(1,2) and Unif(1,1.5), respectively. Again, we randomly decide whether to take the reciprocal of the sampled ratios or not. For more details for formant shifting and pitch randomization, please refer to Parselmouth https://github.com/YannickJadoul/Parselmouth. +- peq represents a serial composition of low-shelving, peaking, and high-shelving filters. We use one low-shelving HLS, one high-shelving HHS, and eight peaking filters HPeak. +- $RR$ denotes a random resampling to modify the rhythm. The input signal is divided into segments, whose length is randomly uniformly drawn from 19 frames to 32 frames (Polyak & Wolf, 2019). Each segment is resampled using linear interpolation with a resampling factor randomly drawn from 0.5 to 1.5. + +# F VISUALIZATION OF ACOUSTIC-PERTURBED SPEECH SAMPLES + +![](images/69666a79505d661721df1773c65b245c42ea336990d62b9c20169542dad1e09b.jpg) +Pitch Mean + +![](images/4034b952ce7adc674a101878aa6b23596aff9c087be86a4c1aae97eaba61e19e.jpg) + +![](images/edcf2b439d69d16b96c320ef72295a3b8c71652742eae069973dd07d3ccce2b0.jpg) +Energy Norm + +![](images/41a3350c7a6b795cd139d1d9230ba1a6bc6e4815b17dc596d34c08d0377a9293.jpg) + +![](images/e790f68efd35325727aeb2a42b19d2c1f210868b9214991a0c7592aedd726ea2.jpg) +F + +![](images/702425bc84e4bd0726742da17f04562fa566116e66b148c430d0416dc72d3aa1.jpg) + +![](images/769a8ef965b1ff16ff86052648145527ccd792ae7d57eb6d5767660b94b9e4a1.jpg) +RR + +![](images/bb8ac6cf61419638fafdfe8a4d71c13d3fa2ea6bb6fe02fe3c5c7ed0364a815a.jpg) + +![](images/45a27e5af0e3fd0a816d7c31938adaaa6b8cf3987c6b3947ae798d0143182723.jpg) +Un-Perturbed Source Speech + +![](images/000f1fcc3c55602688cace4b6c1ccda510c4da7de2d6be9345038421a3759701.jpg) +Figure 4: Spectrogram and pitch contours of the utterance with the single-perturbed acoustic condition, remaining the linguistic content ("really interesting work will finally be undertaken on that topic") unchanged. RR: random resampling. F: a chain function $F = f s(pr(peq(x)))$ for random pitch shifting. + +![](images/116ff469e139b762bb2dbaef29a640c0d01e4d417409f3a49a220955d839b4d4.jpg) +Reference (Un-Perturbed) + +![](images/b26a49c88ceefdf033712e4ff4b33d84b2541c559cc4f5c67c35c8864a85858c.jpg) +Energy-Perturbed + +![](images/7da5e4ebb6f0938103f72d764ced35564468daebeb5a80ce0020b8418e55b6ca.jpg) +Pitch-Perturbed +Figure 5: Spectrogram and pitch contours of speech sample with the perturbed acoustic condition, remaining the linguistic content ("really interesting work.") unchanged. The altered units are printed in red upside the spectrogram. + +![](images/8ad43dd309243c97fbd8b0dfe18ee442d4f7cac8c3faba2ecb7ef559ca13c3dc.jpg) +Rhythm-Perturbed \ No newline at end of file diff --git a/transpeechspeechtospeechtranslationwithbilateralperturbation/images.zip b/transpeechspeechtospeechtranslationwithbilateralperturbation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..cbe0ae46888505d9320a75609df1adde4f876c42 --- /dev/null +++ b/transpeechspeechtospeechtranslationwithbilateralperturbation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:576c62aa99200feb8a8f600886de78c007f7fd0c17125b27fbfbe32894c80c3c +size 611578 diff --git a/transpeechspeechtospeechtranslationwithbilateralperturbation/layout.json b/transpeechspeechtospeechtranslationwithbilateralperturbation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..03b1bd2adb4517b91b703c2fffa96fdc26ee15a3 --- /dev/null +++ b/transpeechspeechtospeechtranslationwithbilateralperturbation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c35f0acf35917322aa59389c3389be8699909dce32d22a8c1ee4884155368f5 +size 494044 diff --git a/treeformerdensegradienttreesforefficientattentioncomputation/f3cb1ec7-ce2c-4556-9b1e-fd67c5f8b3c4_content_list.json b/treeformerdensegradienttreesforefficientattentioncomputation/f3cb1ec7-ce2c-4556-9b1e-fd67c5f8b3c4_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..d36807b9eec104028c547acdc5e8a3e573be6ad5 --- /dev/null +++ b/treeformerdensegradienttreesforefficientattentioncomputation/f3cb1ec7-ce2c-4556-9b1e-fd67c5f8b3c4_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f119b1ac23c83779067e6282308d6fe82bcd131eeb9590c34320d02336e28ae +size 94826 diff --git a/treeformerdensegradienttreesforefficientattentioncomputation/f3cb1ec7-ce2c-4556-9b1e-fd67c5f8b3c4_model.json b/treeformerdensegradienttreesforefficientattentioncomputation/f3cb1ec7-ce2c-4556-9b1e-fd67c5f8b3c4_model.json new file mode 100644 index 0000000000000000000000000000000000000000..415e05432644496693371f172c0c496205833981 --- /dev/null +++ b/treeformerdensegradienttreesforefficientattentioncomputation/f3cb1ec7-ce2c-4556-9b1e-fd67c5f8b3c4_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:10aaa5d091bff2c0994980fedf4f18b4db1a873ac3029a3ce59d73c881602e09 +size 111473 diff --git a/treeformerdensegradienttreesforefficientattentioncomputation/f3cb1ec7-ce2c-4556-9b1e-fd67c5f8b3c4_origin.pdf b/treeformerdensegradienttreesforefficientattentioncomputation/f3cb1ec7-ce2c-4556-9b1e-fd67c5f8b3c4_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..66b848fce23c947818ae7c3c926abbaa319d270f --- /dev/null +++ b/treeformerdensegradienttreesforefficientattentioncomputation/f3cb1ec7-ce2c-4556-9b1e-fd67c5f8b3c4_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dcef0cf232e3fdc1390dcad55ed0e9dcd0d359c547b1bb50ea22f04907aa8793 +size 7710163 diff --git a/treeformerdensegradienttreesforefficientattentioncomputation/full.md b/treeformerdensegradienttreesforefficientattentioncomputation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..15582cc3f391ff851757a9b19862f6acb2b58b24 --- /dev/null +++ b/treeformerdensegradienttreesforefficientattentioncomputation/full.md @@ -0,0 +1,358 @@ +# TREEFORMER: DENSE GRADIENT TREES FOR EFFICIENT ATTENTION COMPUTATION + +Lovish Madaan, Srinadh Bhojanapalli, Himanshu Jain & Prateek Jain + +Google Research + +{lovishm,bsrinadh,himj,prajain}@google.com + +# ABSTRACT + +Standard inference and training with transformer based architectures scale quadratically with input sequence length. This is prohibitively large for a variety of applications especially in web-page translation, query-answering etc. Consequently, several approaches have been developed recently to speedup attention computation by enforcing different attention structures such as sparsity (Zaheer et al., 2020), low-rank (Wang et al., 2020), approximating attention using kernels (Choromanski et al., 2021). In this work, we view attention computation as that of nearest neighbor retrieval, and use decision tree based hierarchical navigation to reduce the retrieval cost per query token from linear in sequence length to nearly logarithmic. Based on such hierarchical navigation, we design Treeformer which can use one of two efficient attention layers - TF-ATTENTION and TC-ATTENTION. TF-ATTENTION computes the attention in a fine-grained style, while TC-ATTENTION is a coarse attention layer which also ensures that the gradients are "dense". To optimize such challenging discrete layers, we propose a two-level bootstrapped training method. Using extensive experiments on standard NLP benchmarks, especially for long-sequences, we demonstrate that our TreeFormer architecture can be almost as accurate as baseline Transformer while using $30\mathrm{x}$ lesser FLOPs in the attention layer. Compared to Linformer, the accuracy can be as much as $12\%$ higher while using similar FLOPs in the attention layer. + +# 1 INTRODUCTION + +Self attention layer is the key component of Transformers (Vaswani et al., 2017), enabling them to achieve state of the art performance across tasks in Natural Language Processing (Devlin et al., 2019; Radford et al., 2019; Raffel et al., 2019) and Computer Vision (Dosovitskiy et al., 2021). Attention computation scales quadratically $(n^2)$ with the input sequence length $(n)$ , making it a key bottleneck in scaling Transformers to long inputs. This has resulted in a lot of alternate proposals to efficiently compute attention using different approximations. However, as shown in Tay et al. (2021), methods that offer dramatic speedups (Wang et al., 2020; Choromanski et al., 2021) suffer in accuracy, and methods that match accuracy of Transformer (Zaheer et al., 2020) don't offer significant speedups. + +In this paper we develop a novel efficient attention mechanism using input dependent sparsity structure in attention computation, motivated by the analysis showing the sparse nature of attention (Shi et al., 2021; Gupta et al., 2021). We propose to use decision trees to efficiently compute attention by only retrieving the top nearest neighboring keys for a given query. Decision trees are low cost, hierarchical non-linear models that have been popular in both supervised (Chen & Guestrin, 2016; Quinlan, 2014) and unsupervised (Duda et al., 1973) learning. Given a vector, each node of the decision tree decides whether to navigate to the left or the right child depending on the sign of a simple linear projection. We learn decision trees in each attention layer of a Transformer model so that a query pays attention only to keys that map to the same leaf nodes1 of the decision trees. We refer to this as TF-ATTENTION. Such sparse decision trees that retrieve only a single leaf node are typically hard to train due to their discrete nature. Further, queries that pay strong attention to multiple keys result in bunching many keys together in a single leaf node creating imbalance. The key computational advantage of decision trees is realized only when they are balanced. + +To address these issues we propose another attention mechanism TC-ATTENTION, that in addition to keys in the leaf node, pays attention to keys at all the intermediate nodes traversed by the query. We further combine the retrieved value vectors with query independent, but trainable weights. This allows us to learn a decision tree that clusters keys in a hierarchical and balanced manner. In both these methods we train the decision tree in an end-to-end manner with the rest of the components of the Transformer. Since the decision trees themselves are inexpensive to evaluate, this allows us to reduce attention computation cost dramatically, requiring typically only a few dot products per query. + +In our goal to train these decision trees in an end to end manner with the rest of the Transformer components we faced some challenges. Naively using the decision trees to restrict attention computation results in poor optimization with training getting stuck at high loss. To solve this we introduce a novel bootstrapping method that allows us to gradually restrict attention computation in layers using decision trees. While this keeps training expensive initially, it still dramatically reduces inference costs. We further use Dense Gradient Trees (Karthikeyan et al., 2021), allowing us to use simple gradient based optimization. + +We evaluate the proposed architecture on popular NLP models such as BERT (Devlin et al., 2019), and on the Long Range Arena benchmark (LRA) (Tay et al., 2021), developed specifically to compare efficient attention methods on long sequence length tasks. We show that TREEFORMER is able to match/improve the performance over other popular models while achieving lower computational cost, for e.g. - TREEFORMER has 8-9x lesser FLOPs than models like BigBird (Zaheer et al., 2020) and Performer (Choromanski et al., 2021). + +Our contributions in this paper are — (i) We pose attention computation as a nearest neighbor retrieval problem, and propose a novel architecture TREEFORMER – using dense gradient trees for retrieving top keys to pay attention to for a given query. We develop two novel attention mechanisms using decision trees - that, for a given query, pay attention to only keys in the matching leaf node (TF-ATTENTION) or to all the keys along the traversed path (TC-ATTENTION). (ii) We develop a novel bootstrapping method to gradually sparsify attention computation thereby showing that decision trees can be trained as a part of neural networks using back propagation. (iii) We experimentally show the effectiveness of the proposed architecture using BERT models and on LRA (Tay et al., 2021). In particular, both TF-ATTENTION and TC-ATTENTION have matching accuracy to baseline Transformer architecture, but with up to $30 \times$ cheaper (in FLOPs) attention layer compared to standard Transformers and up to $9 \times$ cheaper attention layer compared to SOTA BigBird (Zaheer et al., 2020). + +# 2 PRELIMINARIES: ATTENTION AND DECISION TREES + +# 2.1 ATTENTION + +Let $Q, K, V \in \mathbb{R}^{n \times d}$ be the input query, key, and value matrices, where $n$ is the sequence length and $d$ is the embedding dimension, and $W^Q, W^K, W^V \in \mathbb{R}^{d \times d}$ are their respective projection matrices. The standard attention in each Transformer layer can be defined as + +$$ +\operatorname {A t t e n t i o n} (Q, K, V) = \underbrace {\operatorname {s o f t m a x} \left[ \frac {Q W ^ {Q} \left(K W ^ {K}\right) ^ {T}}{\sqrt {d}} \right]} _ {A} \cdot V W ^ {V} \tag {1} +$$ + +Note that for the self attention layer, all the three matrices $Q, K, V$ are same as the input to the layer. Computing both attention $A$ and its product with the projected value matrix $VW^V$ is an $O(n^{2}d + d^{2}n)$ operation. In particular, assuming $cpqr$ cost for multiplying two matrices of size $p \times q$ and $q \times r$ , the main cost of this layer is: $c(2n^{2}d + 2d^{2}n)$ . + +This computation becomes a major bottleneck in applications which have large sequence lengths $n$ . To mitigate this, several efficient attention mechanisms have been proposed (Child et al., 2019; Wang et al., 2020; Choromanski et al., 2021; Kitaev et al., 2020; Sun et al., 2021; Wang et al., 2022). Child et al. (2019) proposed sparse attention ( $A$ ) with different sparsity patterns that reduce attention cost from $O(n^2)$ to $O(n^{1.5})$ . Later Zaheer et al. (2020); Yun et al. (2020) proved universal approximation power of Transformers with sparse attention, improving the cost to $O(ns)$ , with constant sparsity $s$ per query. Alternately Wang et al. (2020) considered a low rank approximation to attention, reducing computation cost to $O(nk)$ for rank $k$ approximation. Choromanski et al. (2021) considered a kernel + +based approach to approximate attention computation reducing the cost to $O(nr)$ , where $r$ is the dimension of the random features used to compute the kernel. We refer readers to Tay et al. (2020) for a detailed survey of efficient attention methods. In this paper, we propose a decision tree based mechanism to speed up the attention computation to $O(nh)$ , where $h$ is the height of the decision tree. We show that with TREEFORMER even a $h$ as small as 8 is sufficient for most applications, leading to the least amount of FLOPs required, while maintaining the performance. + +Table 1: Comparison of attention computation cost (eq.equation 1) for different models. + +
ModelTransformerLinformerBigBirdPerformerTREEFORMER TF-A
Attention costO(n2d+n2)O(knd+kn)O(snd+sn)O(rnd+n(r+d))O(hnd+(2h+1-1)d)
+ +# 2.2 DECISION TREES + +Decision trees are a classical technique that enables partitioning of the input space in several oblique blocks that can be navigated efficiently using the hierarchical structure. Decision trees and similar hierarchical structures are highly popular in supervised learning (XgBoost (Chen & Guestrin, 2016), C4.5 (Quinlan, 2014)), unsupervised learning (hierarchical clustering (Duda et al., 1973)), and retrieval (KD tree (Bentley, 1975)). Generally, hierarchical retrieval techniques are nominally data-dependent, e.g., PCA-tree (Sproull, 1991) and Cover Trees (Beygelzimer et al., 2006). Our TC-ATTENTION and TF-ATTENTION methods combine hierarchical retrieval methods with supervised tree learning techniques to enable learning of the hierarchical attention layer in end-to-end differentiable manner. See Figure 1 for overall representation of the hierarchical navigation based attention layer. Each internal node of the tree has a classifier that determines which children a given input should navigate to. While the classifier makes hard decision, we use technique from straight-through estimators (Bengio et al., 2013), and in particular, Dense Gradient Trees from Karthikeyan et al. (2021) to train the tree parameters using gradient style methods. + +Construction Formally, let $\mathcal{T}(\theta)$ represent a binary tree with height $h$ and $2^h$ nodes. Let $\theta_{\{l,j\}}$ denote the tree parameters at $\{l,j\}$ -th node where $l \in \{0,1,\dots,h\}$ is the node level and $j \in \{0,1,\dots,2^l - 1\}$ is the node index at level $l$ . Let decision at each internal node to send the point $q$ to left or the right child is based on $\mathrm{SIGN}(f(\theta_{\{l,j\}}; q))$ , where, + +$$ +f _ {\{l, j \}} (\boldsymbol {q}) = f \left(\theta_ {\{l, j \}}; \boldsymbol {q}\right) = \left\langle \boldsymbol {w} _ {\{l, j \}}, \boldsymbol {q} \right\rangle + b _ {\{l, j \}}, \tag {2} +$$ + +and $\theta_{\{l,j\}} = \{\pmb{w}_{\{l,j\}}; b_{\{l;j\}}\}$ consists of a oblique hyperplane and a bias. Let $P_{\mathcal{T}}(l,\pmb{q})$ denote the node-index of $\mathcal{T}$ that was traversed by $\pmb{q}$ at level $l$ . That is, $P_{\mathcal{T}}(h,\pmb{q})$ denote the leaf node to which $\pmb{q}$ is mapped. Also, let $S_{l,j}(\pmb{K})$ denote the indices of vectors from the key matrix $\pmb{K}$ that traverses node $\{l,j\}$ . That is, $i \in S_{l,j}(\pmb{K})$ iff $j = P_{\mathcal{T}}(l,\pmb{k}_i)$ . + +# 3 TREEFORMER ATTENTION VARIANTS + +In this section, we describe the decision tree attention mechanism which replaces the standard dot product attention (Vaswani et al., 2017) in our TREEFORMER architecture. Recall that for each query $\mathbf{q}_i$ , the attention is given by: + +$$ +\boldsymbol {A} _ {i} = \operatorname {s o f t m a x} \left(\frac {1}{\sqrt {d}} \boldsymbol {q} _ {i} ^ {T} W ^ {Q} \left(W ^ {K}\right) ^ {T} \boldsymbol {K} ^ {T}\right) \boldsymbol {V} W ^ {V}. +$$ + +That is, attention computation for $\mathbf{q}_i$ is equivalent to applying a linear scan over all keys, and computing value as the weighted average of value of most similar keys to $\mathbf{q}_i$ . Recent works have shown that we do not need to attend to all tokens in a given input sequence (Shi et al., 2021), and demonstrate that top-k attention is a good approximation for standard attention (Gupta et al., 2021). + +We propose to leverage this observation by using a decision tree based hierarchical navigation instead of linear scan to find the top-most similar keys. Naturally, accuracy of the method would depend on accuracy of retrieval of most similar keys by the hierarchical navigation method. So, we propose to learn the decision tree parameters so as to explicitly optimize the loss function. We develop two approaches to compute the value for a query $\mathbf{q}_i$ based on its traversal through the tree. In the following subsections we present our two different tree based attention layers. + +# 3.1 TF-ATTENTION (Tree Fine-grained Attention) + +In this variant, we compute the value for a query $\mathbf{q}$ as a weighted sum of value vectors of keys that lie in the same leaf node as $\mathbf{q}$ . More formally, + +$$ +\operatorname {T F} - \operatorname {A T T E N T I O N} (\boldsymbol {q}, \boldsymbol {K}, \boldsymbol {V}; \mathcal {T}) = \operatorname {s o f t m a x} \left[ \frac {\boldsymbol {q} ^ {T} W ^ {Q} \left(\boldsymbol {K} _ {\bar {S}} W ^ {K}\right) ^ {T}}{\sqrt {d}} \right] \cdot \boldsymbol {V} _ {\bar {S}} W ^ {V}, \tag {3} +$$ + +where $\bar{S} = S_{h,P_{\mathcal{T}}(h,(W^Q)^T\pmb {q})}(\pmb {K}\pmb {W}^K)$ is the set of keys $\pmb{K}$ that are mapped to same leaf node (i.e. $P_{\mathcal{T}}(h,(W^{Q})^{T}\pmb {q}))$ as $(W^{Q})^{T}\pmb{q}$ . Note that this is a sparse attention variant as we compute dot products only between those queries and keys belonging to the same leaf node, and the attention score between a query and keys lying in different leaf nodes is 0. Intuitively, this attention layer can be thought of as top- $k$ attention where the tree structure is responsible for computing the $k$ tokens which are the most important for a given query token. + +Computational Complexity Assuming a uniform distribution of the input sequence tokens across the leaf nodes of the decision tree, the amortized computational cost for TF-ATTENTION is $O\left(\frac{n^2d}{2^h}\right) + 2cd^2 n \equiv O(nkd) + 2cd^2 n$ , where $k$ is generally a small factor assuming the height of the decision tree is of the order $O(log\left(\frac{n}{k}\right))$ , and $c$ is as defined in Section 2.1. + +If the decision tree parameters are such that all the queries and keys get clustered into a single leaf node of the tree, we get the original full attention in this case. Therefore the worst case time complexity of TF-ATTENTION is $O(n^{2}d + d^{2}n)$ . Furthermore, this also illustrates that TF-ATTENTION can be as expressive as standard attention. We state this claim formally below. + +Lemma 1. There exists a tree $\mathcal{T}$ s.t. TF-ATTENTION $(Q,K,V;\mathcal{T}) =$ Attention $(Q,K,V)$ + +The lemma follows immediately from the above observation; for completeness, see Appendix for a proof of the above lemma. + +$k$ -ary TF-ATTENTION We extend the binary tree construction of the TF-A variant to construct a $k$ -ary tree attention model for height $h$ , where each node at level $l$ has a branching factor of $b_{l}$ , $l \in \{0,1,\dots,h - 1\}$ . The total number of leaf nodes in this case are $\prod_{l = 1}^{l = h - 1} b_{l}$ . This is a general version of the TF-ATTENTION variant, where we can scale the number of leaf nodes even for smaller heights, and thus reducing the amount of queries and keys in each leaf node. In all our experiments on $k$ -ary TF-ATTENTION models, $h = 2$ and $b = [100,10]$ , resulting in 1000 leaf nodes. + +Although the proposed TF-ATTENTION TREEFORMER variant works well in principle, there are a couple of shortcomings of the same — (i) In case the distribution of queries and keys is skewed in even one of the layers of the model, the computational cost approaches the worst case time complexity of the standard attention model. So we might need to add explicit loss terms to encourage more uniform representation across various leaf nodes/subtrees. (ii) It might be possible that for a given query, some key tokens important to this query lie in a different leaf node of the decision tree to minimize the overall loss. But due to the sparse nature of the model, the attention score between the query and these keys will be 0. Using multiple decision trees (forest structure) might help alleviate this but we leave it for future exploration. + +We address the above problems using a novel variant that computes the attention values in a coarse manner and hence has denser gradients. + +# 3.2 TC-ATTENTION (Tree Coarse Attention) + +In this variant, rather than computing attention as a weighted sum of values of keys in the leaf node, we take a coarse unweighted sum of the value vectors. That is, the query is only used to navigate to a leaf node, but with-in a leaf node, the value vector is fixed. So given a leaf node, the attention value is independent of the query itself. Note that this requirement completely flips the tree's tendency to map multiple keys to a single leaf node. That is, to optimize the loss function, TF-ATTENTION would prefer all the keys to map to one leaf node, TC-ATTENTION's incentives are completely reversed. That is, if TC-ATTENTION maps all the keys to the same leaf node then it would give an unweighted average of the value vectors of all the keys, irrespective of query which is average attention - naturally a weaker model and would have large loss. Instead, TC-ATTENTION would prefer to spread out keys as much as possible in leaf nodes so that it can compute more powerful query dependent attention. We present key distributions of learned TREEFORMER models in Figure 4 supporting this argument. + +![](images/1b268b831fabb2e1ac41f284903803866a83e98c239f9af6b2beecaf65fbacc0.jpg) +Figure 1: The figure on the left represents the self attention layer in TREEFORMER models, and the tree self attention block is expanded for a representative view of the TC-ATTENTION mechanism. + +We further generalize this technique to ensure contributions from other nodes to the value vector. That is, we add contributions to a query's value vector from not only the leaf node but also from the internal nodes that were traversed by the query. + +Formally, let $\nu_{l,j}$ be the value vector associated with a node. Then, + +$$ +\boldsymbol {\nu} _ {l, j} = \frac {1}{| S _ {l , j} (\boldsymbol {K W} ^ {K}) |} \sum_ {i \in S _ {l, j} (\boldsymbol {K W} ^ {K})} \boldsymbol {V} _ {i} \boldsymbol {W} ^ {V}, +$$ + +i.e., it is an average of all value vectors of keys such that $l, j$ lies in their paths. Now, given $\pmb{\nu}_{l,j}$ for each node and the tree $\mathcal{T}$ (including its parameters $\theta$ ), we get the attention for a query $\pmb{q}$ as: + +$$ +\operatorname {T C} - \text {A T T E N T I O N} (\boldsymbol {q}, \boldsymbol {K}, \boldsymbol {V}; \mathcal {T}) = \sum_ {l = 0} ^ {h} \alpha_ {l} \cdot \boldsymbol {\nu} _ {\{l, P _ {\mathcal {T}} (l, (W ^ {Q}) ^ {T} \boldsymbol {q}) \}} \tag {4} +$$ + +where $\alpha_{l}$ is the learnable attention weight at each level of the decision tree. See Figure 1 for a visual representation of TC-ATTENTION. + +Note that as TC-ATTENTION applies query independent averaging, it is easy to design counterexamples where the standard attention layer is strictly more powerful than TC-ATTENTION. Now, we can make TC-ATTENTION as powerful as a standard attention layer by allowing traversal of multiple paths and $\alpha_{l}$ to be query dependent. However, our results indicate that TC-ATTENTION is sufficiently powerful, and might not require more modeling power in the attention layer. We leave further exploration of multiple traversal paths for future work. + +Computational Complexity The cost of TC-ATTENTION can be broken down into three parts: 1. projection of query, key, and value tensors - note that we can embed projection matrices for both query and key in the parameters of the tree (with two different sets of tree parameters). So the cost is half of standard attention: $cd^2 n$ 2. storing projected key vectors in the decision tree $-O((2^{h+1} - 1)d)$ , and 3. computing the path and attention layer transformation for all queries $Q - O(ndh)$ . + +Compared to the full attention mechanism - $O(n^{2}d + d^{2}n)$ , the computational complexity for TC-ATTENTION is linear in sequence length $n$ : $O(ndh + (2^{h+1} - 1)d + d^{2}n)$ . In all our experiments, decision tree height $h$ is generally $\leq 10$ . Also, note that compared to TF-ATTENTION, the computational complexity is guaranteed to be linear in both $n$ and $h$ , irrespective of the trained trees/model. + +# 3.3 TRAINING OF TREEFORMER MODELS + +Pre-training It is well-known that learning tree is a challenging problem due to the discrete structure. We use recent techniques (Karthikeyan et al., 2021) to help with the optimization, and ensure + +Algorithm 1: TREEFORMER 2-D Bootstrapping Algorithm +Result: TREEFORMER model $M_{\{1,\dots ,L\}}(h_f)$ +```txt +Input: $M = M_{\{1,\dots ,L\}}(h_s)$ - TREEFORMER model with height $h_s$ , $w$ - layer width for bootstrapping, $h_f$ - height of desired TREEFORMER model, $N$ - number of training steps +``` + +end return +```txt +for $i = 1$ to $\lceil \frac{L}{w}\rceil$ do +idx $= 1 + max(0,L - w\cdot i)$ +for $h = h_s + 1$ to $h_f$ do Initialize $M_{\{\mathrm{idx},\dots ,L\}}(h)$ using parameter weights from $M$ . Tree parameters in the attention layer are initialized up to depth $h - 1$ and the remaining leaf node parameters are initialized randomly; Train $M_{\{\mathrm{idx},\dots ,L\}}(h)$ for $\frac{N}{\lceil\frac{L}{w}\rceil\cdot(h_f-h_s)}$ steps using self supervised learning; +end + $M = M_{\{\mathrm{idx},\dots ,L\}}(h_f)$ +``` + +better flow of gradients throughout the network. Despite this, we found in our experiments that pretraining complete TREEFORMER models with tree attentions in all $L$ layers is challenging and often leads to poor sub-optimal solutions. To overcome this challenge issue and avoid inaccurate saddle points, we use a method of incremental bootstrapping for training TREEFORMER (see Algorithm 1). Specifically, we first pre-train an existing model (say a transformer or BigBird). We then introduce tree attention (either TF-ATTENTION or TC-ATTENTION) only in the last few layers (layer $j$ to $L$ ). The new architecture - denoted by $M_{\{j,\dots ,L\}}$ - is trained for a fixed number of steps using the standard self-supervised learning objective. Now, all the parameters of $M_{\{j,\dots ,L\}}$ are used to initialize the $M_{\{i,\dots ,j,\dots ,L\}}$ model. We do this bootstrapping until we have the complete $M_{\{1,\dots ,L\}}$ TREEFORMER model and it is also trained for a given number of steps. In a similar fashion, we can do this bootstrapping process to initialize TREEFORMER models for a given height using a TREEFORMER model with a smaller tree height. Based on TF-ATTENTION or TC-ATTENTION model, multiple bootstrapping techniques for tree levels can be explored: random assignments in next level, assignment to one node only etc. In this work, we mostly use random assignments based approach where the tree parameters in layers $\{i,\dots ,j - 1\}$ are randomly initialized. + +Fine-tuning We don't do any bootstrapping during the downstream fine-tuning tasks and tree attention exists in all layers of the models. But, we tried two variants of keeping the pre-trained decision tree weights fixed and allowing them to be trained during fine-tuning, and the corresponding results are reported in Section 4. Overall, bootstrapping in finetuning phase leads to similar results as standard fine-tuning with all the model and tree parameters. + +# 4 EXPERIMENTS + +In this section, we present experimental results comparing the TREEFORMER models with Transformers and with popular efficient Transformer architectures - BigBird (Zaheer et al., 2020), Linformer (Wang et al., 2020) and Performer (Choromanski et al., 2021). We first evaluate our TREEFORMER on the standard NLP benchmark of BERT-based pre-training and $GLUE + SQuAD$ finetuning (Devlin et al., 2019). Next, to study effectiveness of TREEFORMER on long sequence length tasks, we present results on the standard benchmark for methods in long-sequence regime: Long Range Arena (LRA) (Tay et al., 2021). We also provide ablation studies to understand challenges in optimizing TREEFORMER and the utility of the bootstrapping approach (Algorithm 1). + +The complete experimental setup along with the hyper-parameters for each of the tasks and hardware details is provided in Appendix A. Please note that we will be using a shorter notation of TF-A for TF-ATTENTION and TC-A for TC-ATTENTION. + +# 4.1 BERT PRE-TRAINING / FINE-TUNING + +Following Devlin et al. (2019) we use a masked LM (MLM) objective to pretrain our TREEFORMER BERT-Base models on Wikipedia, Books (Zhu et al., 2015), CC-News (Guu et al., 2020), and Stories (Trinh & Le, 2018) datasets. + +Table 2: BERT Pre-training and Fine-tuning on sequence length 512. We report the accuracies for MLM and MNLI, F1 Score for SQuAD, and the average over tasks for the GLUE Benchmark. We see that TF-A matches the baseline with $3\mathbf{x}$ reduction in computation, and $k$ -ary TF-A improves GLUE score by $>1\%$ ! TC-A models with 6 fine-tuned decision tree layers matches the baseline, and models with higher number of tree layers underperform. Please note that Linformer suffers a $1.3\%$ drop on GLUE and BigBird does not offer compute savings for smaller sequence lengths ( $\leq 512$ ). + +
ModelMLMMNLISQuADGLUE (Avg.)FLOPs
BERT-Base71.9181.3388.7480.11100%
Linformer (k=128)71.2281.0285.1978.7549.59%
BigBird72.2881.6786.2480.16100.40%
TREEFOMER TF-A (12 layers)73.2482.73 (83.32)88.69 (87.65)80.0529.87%
TREEFOMER TC-A (6 layers)72.3081.73 (80.98)86.55 (85.61)80.5557.98%
TREEFOMER TC-A (9 layers)70.8880.66 (80.40)84.32 (83.66)79.5136.97%
TREEFOMER TC-A (12 layers)64.9174.29 (70.28)71.96 (54.19)71.3915.96%
TREEFOMER k-ary TF-A73.0483.0889.0081.2525.44%
+ +Fine-tuning - GLUE/SQuAD We fine-tune the pre-trained BERT-Base models on 7 datasets from the GLUE benchmark (Wang et al., 2018) including MNLI and the SQuAD (Rajpurkar et al., 2016) dataset for question answering. Table 2 shows the comparison between various architectures on these tasks. We observe that the TREEFORMER model with TF-ATTENTION and $k$ -ary TF-ATTENTION work well - beating the BERT baseline in MNLI and SQuAD while using fewer FLOPs. The bracketed values in Table 2 for the TREEFORMER models represent fine-tuning while the decision tree parameters are fixed and obtained from the corresponding pre-trained TREEFORMER models. + +We would like to make multiple observations here: a). TF-ATTENTION is competitive with both baseline BERT model as well as the BigBird model. In fact, for MNLI task, it is $1\%$ more accurate than BERT, and on SQuAD, it is $2\%$ more accurate than BigBird, despite requiring 3x fewer FLOPs in the attention layer. b). TF-ATTENTION is more accurate than Linformer as well, while still being cheaper c). TC-ATTENTION provides accuracy values competitive with baseline Linformer, BigBird only when TC-ATTENTION layer is applied in 6 of the 12 transformer blocks. With a larger number of TC-ATTENTION layers, the accuracy drops significantly, confirming challenges in optimizing a difficult discrete layer across multiple layers. We leave further investigation into better optimization of TC-ATTENTION in deep architectures for future work. + +Benefits of Bootstrapping Figure 2 shows the training progression of the TREEFORMER models with bootstrapping (Algorithm 1). The sudden decrease (increase) in MLM accuracy (loss) happens at the bootstrapping stage, when a model with more decision tree layers is initialized with a model with less decision tree layers. We observe that while bootstrapping causes a momentary drop, it eventually leads to a higher final accuracy for TF-A. For TC-A we notice improvement in bootstrapping upto 6 decision tree layers (till $\approx 1e6$ steps), but going to 12 decision tree layers causes training instabilities. + +We next compare the training progress for TREEFORMER models with different decision tree heights in Figure 3. We notice that TF-A performs better with bootstrapping for smaller tree heights, but suffers as tree height goes to 7. On the other hand we find TC-A to be much more challenging in bootstrapping to more than 6(out of 12) layers. For larger heights the training is hard due to vanishing gradients and MLM accuracy approaches 0 at the last stage of the bootstrapping process. + +Leaf distribution Figure 4 shows the distribution of key vectors in the leaf nodes of the TREEFORMER models in specific layers. Lighter lines represent the initial stages of the pre-training process and darker lines represent the distribution at later stages in the pre-training - showing the evolution of distribution as the training progresses. We observe that the distribution is more skewed in later layers compared to the initial layers. Moreover, the distribution is much more skewed in the TF-A variant compared to TC-A. This is because TF-A, being a sparse attention mechanism, will try to cluster more keys in a given leaf node to attend to all relevant keys for a given query (see § 3). + +# 4.2 LONG RANGE ARENA (LRA) + +We next perform experiments on the Long Range Arena Benchmark (LRA) (Tay et al., 2021). It comprises of 6 tasks (ListOps, Text, Retrieval, Image, Pathfinder, and Path-X) with inputs having long + +![](images/153fe90f3126920c2fc358272634cadd4851f4824435970d497a408d594766e5.jpg) +Figure 2: Progression of MLM training for TREEFORMER models with the two tree attention variants. The jump in loss/accuracy corresponds to points in training when bootstrapping was done. This allows us to train TREEFORMER avoiding the optimization issues in training from scratch. + +![](images/4d420706a1f61313f24aab70b3af6d9fa12b30be08bc4bac5b9ee5633f4cb00c.jpg) + +![](images/613a2b047be5ff76864b81ad9f0398e61d214ad1a894d31cb75fb0667c3da76c.jpg) +Figure 3: Progression of MLM accuracy while training TREEFORMER models with different decision tree heights. Notice that models with larger tree heights are much more challenging to train and they completely collapse as the bootstrapping process gradually restricts attention. + +![](images/0245187f7d64b7ac80559b8b727281c334fc66e586a7d11f40e205f5134647d6.jpg) + +![](images/1f80ac3f2ec2f11a669823acab2433ae3935a0a6bcc8a6e52c1d9e43ead58d3e.jpg) + +![](images/2c257fa7332a6668663899274ad34b64d46eae1fedd5bc6c59b144b7fcb792bd.jpg) +(b) Layer 4 + +![](images/125044cf7ce9f777269640651a5ff37a3066fddc8d1abcd52dddeb8d9d0ff6c4.jpg) + +![](images/0581548eb9c30bef58e5d5741e47a5d483e6da5e5b804a4749ced221711690cf.jpg) + +![](images/bfee6c368e273b42f668630e88a390d325025bdb8992c1668d99edfe953b9f22.jpg) +(a) TFA-Layer 1 +(e) TCA - Layer 1 +Figure 4: Distribution of key vectors across the leaf nodes of the decision tree in different layers of TREEFORMER-TF-A (a-d) and TC-A (e-h) models. We notice that TC-A helps in training a more uniform key distribution in comparison to TF-A as discussed earlier (see § 3). + +![](images/7d57cc4d06c8481bdf0de55756dc04ea544fd1f8a9dd041e2c325d2deb43dbb5.jpg) +(f) Layer 4 + +![](images/2bd498a946d6e049949262f4f48f30e97e100b042da5013721ac75543585553f.jpg) +(c) Layer 9 +(g) Layer 9 + +![](images/a74b7f5f1c267e62e75862b45ad84df22c1c42a85fb1aa231b26d180ded8c3bb.jpg) +(d) Layer 12 +(h) Layer 12 + +sequence lengths ranging from 1024 to 16384. Three of the tasks are text-based and the remaining three comprise of visual inputs. In our comparison, we skip the Pathfinder task in the LRA benchmark because of the very high variance in the accuracy for all models, and also skip $\text{Path-X}$ because all model architectures fail in this task due to the memory or computational bottlenecks at sequence length 16384. The results of various model architectures across the remaining 4 tasks are presented in Table 3. Along with the performance, we also show the computational FLOPs relative to the standard Transformer averaged over the 4 tasks for each of the models in the self attention layer of an encoder block in the model architecture. + +On average, both TF-ATTENTION and TC-ATTENTION are almost as accurate as the baseline Transformer as well as the BigBird. Further, attention layer FLOPs of TF-ATTENTION is almost $3\mathbf{x}$ lower than that of Transformer. These factors are further improved by using the $k$ -ary TF-ATTENTION + +Table 3: LRA Benchmark. Comparison of TREEFORMER with other efficient transformers. We notice that TREEFORMER models perform as well as baseline and even improve over it in some tasks, while using much less FLOPs. In particular, TC-A matches baseline and improves over other efficient transformers with $33\mathrm{x}$ reduction in compute. TF-A and $k$ -ary TF-A while suffer from imbalanced key allocations, still match the baseline performance and lead to $3\mathrm{x}$ FLOPs reduction. + +
ModelListOpsTextRetrievalImageAverageFLOPs
Transformer36.3764.2757.5842.3550.14100%
Linformer35.7053.9452.9337.9245.122.57%
Performer18.0165.4054.5642.5145.1225.37%
BigBird36.0564.0258.9840.3449.8527.13%
TREEFOMER TF-A36.0264.3858.5242.3150.3134.18%
TREEFOMER TC-A35.5464.4158.3842.0150.093.05%
TREEFOMER k-ary TF-A35.7664.6258.2942.3450.2529.82%
+ +Table 4: Inference times for different input sequence lengths. + +
Model ↓ Seq. Length →1024204840968192
Transformer108ms391ms1.83s9.23s
TREEFORMER TF-A113ms218ms (1.8x)549ms (3.3x)1.37s (6.7x)
k-ary TREEFORMER TF-A108ms230ms (1.7x)584ms (3.1x)1.55s (6x)
+ +variant. TC-ATTENTION on the other hand is almost $33\mathrm{x}$ cheaper than Transformer and $9\mathrm{x}$ cheaper than BigBird despite achieving almost the same accuracy. Only Linformer has similar computational cost as TC-ATTENTION, but TC-ATTENTION is almost $5\%$ more accurate than Linformer. In terms of total FLOPs for the transformer encoder block, the self attention comprises of $50.84\%$ of the total computational FLOPs in the ListOps task, and the rest is used in dropouts and the two feed forward layers. For Text, the distribution is $73.3\%$ and $26.7\%$ respectively. So, we can get a total speedup of 2-3x by using TREEFORMER models instead of the standard Transformer. + +Inference times In Table 4, we finally present a comparison of inference wall time between the TREEFORMER TF-ATTENTION model and the standard attention on a Intel Xeon Platinum P-8136 CPU using one thread and 100GB of RAM. We measure the inference time for the self-attention module using 8 attention heads and hidden dimension 768 for a batch size of 1. We use a decision tree of height 6 for TF-ATTENTION. Our implementation of TREEFORMER TF-ATTENTION model iterates over the leaf nodes and gathers the subset of queries and keys that lie in a given leaf node, and only computes attention scores by doing matrix multiplication between these gathered queries and their relevant keys. The final projections for the gathered keys are then scattered into the original query matrix. For sequence lengths 2048 - 8192, we get a speedup ranging from $1.8\mathbf{x}$ - $6.7\mathbf{x}$ . + +# 5 CONCLUSION + +In this work we proposed TREEFORMER with a novel efficient attention mechanism that leverages the idea of finding top nearest neighbors using decision trees and applying it to attention computation. We proposed two attention variants TF-ATTENTION and TC-ATTENTION with different sparsity levels. We showed that using techniques like dense gradient trees and bootstrapping allows us to train the TREEFORMER models in an end-to-end manner with simple back propagation. Using extensive experiments, we showed that TREEFORMER models achieve comparable or better accuracy than other efficient attention models, but with significantly lower computational complexity. + +While decision trees are popular in other applications (XgBoost (Chen & Guestrin, 2016), C4.5 (Quinlan, 2014), KD tree (Bentley, 1975)), there have been few works integrating and jointly training them with neural networks. Our work takes a first step in that direction and shows that while optimizing with decision trees can be challenging, it is also rewarding. Some interesting future research directions include developing better optimization techniques for discrete models, efficiently combining decision trees with different types of neural network architectures, and using multiple decision trees to reduce discretization. + +# REFERENCES + +Yoshua Bengio, Nicholas Léonard, and Aaron Courville. Estimating or propagating gradients through stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3432, 2013. +Jon Louis Bentley. Multidimensional binary search trees used for associative searching. Communications of the ACM, 18(9):509-517, 1975. +Alina Beygelzimer, Sham Kakade, and John Langford. Cover trees for nearest neighbor. In Proceedings of the 23rd international conference on Machine learning, pp. 97-104, 2006. +Tianqi Chen and Carlos Guestrin. Xgboost: A scalable tree boosting system. In Proceedings of the 22nd acm SIGkdd international conference on knowledge discovery and data mining, pp. 785-794, 2016. +Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. arXiv preprint arXiv:1904.10509, 2019. +Krzysztof Marcin Choromanski, Valerii Likhosherstov, David Dohan, Xingyou Song, Andreea Gane, Tamas Sarlos, Peter Hawkins, Jared Quincy Davis, Afroz Mohiuddin, Lukasz Kaiser, et al. Rethinking attention with performers. In International Conference on Learning Representations, 2021. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pp. 4171–4186, 2019. +Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations, ICLR, 2021. +Richard O Duda, Peter E Hart, et al. Pattern classification and scene analysis, volume 3. Wiley New York, 1973. +Albert Gu, Karan Goel, and Christopher Re. Efficiently modeling long sequences with structured state spaces. In International Conference on Learning Representations, 2021. +Ankit Gupta, Guy Dar, Shaya Goodman, David Ciprut, and Jonathan Berant. Memory-efficient transformers via top- $k$ attention. arXiv preprint arXiv:2106.06899, 2021. doi: 10.48550/ARXIV.2106.06899. URL https://arxiv.org/abs/2106.06899. +Kelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat, and Ming-Wei Chang. REALM: Retrievalaugmented language model pre-training. arXiv preprint arXiv:2002.08909, 2020. +Ajaykrishna Karthikeyan, Naman Jain, Nagarajan Natarajan, and Prateek Jain. Learning accurate decision trees with bandit feedback via quantized gradient descent. arXiv preprint arXiv:2102.07567, 2021. +Nikita Kitaev, Lukasz Kaiser, and Anselm Levskaya. Reformer: The efficient transformer. In International Conference on Learning Representations, 2020. +Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Ves Stoyanov, and Luke Zettlemoyer. Bart: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. ACL, 2019. +Yinhan Liu, Jiatao Gu, Naman Goyal, Xian Li, Sergey Edunov, Marjan Ghazvininejad, Mike Lewis, and Luke Zettlemoyer. Multilingual denoising pre-training for neural machine translation. Transactions of the Association for Computational Linguistics, 8:726-742, 2020. +J Ross Quinlan. C4. 5: programs for machine learning. Elsevier, 2014. +Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. OpenAI Blog, 1(8):9, 2019. + +Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. arXiv preprint arXiv:1910.10683, 2019. +Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad: 100,000+ questions for machine comprehension of text. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 2383-2392, 2016. +Han Shi, Jiahui Gao, Xiaozhe Ren, Hang Xu, Xiaodan Liang, Zhenguo Li, and James Tin-Yau Kwok. Sparsebert: Rethinking the importance analysis in self-attention. In International Conference on Machine Learning, pp. 9547–9557. PMLR, 2021. +Robert F Sproull. Refinements to nearest-neighbor searching ink-dimensional trees. Algorithmica, 6 (1):579-589, 1991. +Zhiqing Sun, Yiming Yang, and Shinjae Yoo. Sparse attention with learning to hash. In International Conference on Learning Representations, 2021. +Yi Tay, Mostafa Dehghani, Dara Bahri, and Donald Metzler. Efficient transformers: A survey. arXiv preprint arXiv:2009.06732, 2020. +Yi Tay, Mostafa Dehghani, Samira Abnar, Yikang Shen, Dara Bahri, Philip Pham, Jinfeng Rao, Liu Yang, Sebastian Ruder, and Donald Metzler. Long range arena: A benchmark for efficient transformers. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=qVyeW-grC2k. +Trieu H Trinh and Quoc V Le. A simple method for commonsense reasoning. arXiv preprint arXiv:1806.02847, 2018. +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pp. 5998-6008, 2017. +Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R Bowman. Glue: A multi-task benchmark and analysis platform for natural language understanding. EMNLP 2018, pp. 353, 2018. +Ningning Wang, Guobing Gan, Peng Zhang, Shuai Zhang, Junqiu Wei, Qun Liu, and Xin Jiang. Clusterformer: Neural clustering attention for efficient and effective transformer. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 2390-2402, 2022. +Sinong Wang, Belinda Z Li, Madian Khabsa, Han Fang, and Hao Ma. Linformer: Self-attention with linear complexity. arXiv preprint arXiv:2006.04768, 2020. +Chulhee Yun, Yin-Wen Chang, Srinadh Bhojanapalli, Ankit Singh Rawat, Sashank Reddi, and Sanjiv Kumar. O(n) connections are expressive enough: Universal approximability of sparse transformers. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 13783-13794. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper/2020/file/9ed27554c893b5bad850a422c3538c15-Paper.pdf. +Manzil Zaheer, Guru Prashanth Guruganesh, Avi Dubey, Joshua Ainslie, Chris Alberti, Santiago Ontanon, Philip Minh Pham, Anirudh Ravula, Qifan Wang, Li Yang, and Amr Mahmoud El Houssieny Ahmed. Big bird: Transformers for longer sequences. In Advances in neural information processing systems, 2020. URL https://proceedings.neurips.cc/paper/2020/file/c8512d142a2d849725f31a9a7a361ab9-Paper.pdf. +Yukun Zhu, Ryan Kiros, Rich Zemel, Ruslan Salakhutdinov, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Aligning books and movies: Towards story-like visual explanations by watching movies and reading books. In Proceedings of the IEEE international conference on computer vision, pp. 19-27, 2015. + +# A EXPERIMENTAL SETUP + +In this section we give a detailed description of our experimental setup including various hyperparameters. + +# A.1 BERT PRE-TRAINING/FINE-TUNING + +Table 5 detail the four public datasets we used for pre-training the TREEFORMER and baseline models. For all datasets, we truncate documents with length greater than 512 to multiple sequences of length 512. We follow the recommendations of Devlin et al. (2019) for MLM pre-training, and mask $15\%$ tokens in each input sequence. We report the MLM performance in terms of accuracy of prediction on the masked positions. We list the hyper-parameters used for pre-training in Table 6. We use Adam optimizer with decoupled weight decay (AdamW). We also use a learning rate warmup for the first 10k steps, with linear decay of the learning rate afterwards. We train the TREEFORMER models for a total of 1.8M steps - 450000 steps during each of the four bootstrapped processes shown in Figures 2 and 3. The layer-width for each bootstrapping is 3, meaning 3 tree attention layers are added in every subsequent bootstrapping process. + +Table 5: Pre-training Datasets. + +
Dataset# TokensDocument Length
Books (Zhu et al., 2015)327M37K
CC-News (Guu et al., 2020)3.7B561
Stories (Trinh & Le, 2018)2.5B8.2K
Wikipedia1.5B592
+ +Table 6: Hyper-parameters for the two TREEFORMER model variants for BERT Pre-training. + +
ParameterTREEFORMER TF-ATREEFORMER TC-A
Tree Height, h27
Sequence Length512512
Attention Heads1212
Hidden Layers1212
Hidden Layer Size768768
Batch Size10241024
Activation Layergelugelu
Dropout Prob.0.10.1
Attention Dropout Prob.0.10.1
OptimizerAdamWAdamW
Learning Rate10-410-4
Hardware (TPUv3 slice)8 × 168 × 16
+ +For fine-tuning, we use the same pre-trained models and fine-tune on the downstream tasks with most of the model parameters borrowed from the pre-training process. The parameters that are different for various datasets in the GLUE benchmark and SQuAD are detailed in Table 7. For MNLI, we report the matched accuracy, Matthews Correlation Coefficient (MCC) for COLA, F1 Scores for MRPC, and accuracies for the remaining tasks - QQP, QNLI, SST-2, and RTE. On the SQuAD dataset, we report the F1 scores on v1.1 version of the dataset. + +Table 7: Hyper-parameters for BERT Fine-tuning for GLUE and SQuAD. + +
ParameterMNLI, QQP, QNLI, SST-2COLA, MRPCRTESQuAD
Batch Size128161648
Epochs310102
Learning Rate\( 3 \times 10^{-5} \)\( 1 \times 10^{-5} \)\( 2 \times 10^{-5} \)\( 8 \times 10^{-5} \)
Hardware (TPUv3 slice)4 × 44 × 24 × 22 × 2
+ +# A.2 LONG RANGE ARENA (LRA) + +The task specific hyper-parameters used for the LRA Benchmark (Tay et al., 2021) are presented in Table 8. We use Adam optimizer for all the experiments but the weight decay factor is different for Image task as highlighted in Table 8. We start the bootstrapping for TC-ATTENTION variant of the TREEFORMER from tree height $h = 2$ up to all the way to $h = 10$ . We notice that $h = 6$ performs the best on most of the LRA tasks. So we report the performance numbers for $h = 6$ . We also include the number of training steps during each bootstrapping process in the table. + +Table 8: Hyper-parameters for the various LRA tasks for TREEFORMER models. + +
ParameterListopsTextRetrievalImage
Max. Sequence Length2048409681921024
Tree Height for TREEFORMER6666
# Layers4441
Attention Heads4441
Embedding Dim.51225612832
MLP Dim.1024102451264
Batch Size32323256
Dropout Prob.0.10.10.10.3
Attention Dropout Prob.0.10.10.10.2
Learning Rate0.050.050.050.0005
# Training Steps500020000500035000
Weight Decay for Adam0.10.10.10.0
Hardware (TPUv3 slice)2 × 22 × 22 × 22 × 2
+ +# B EXPERIMENTAL RESULTS + +In this section, we include some extra results in addition to those present in the main paper. + +# B.1 BERT PRE-TRAINING/FINE-TUNING + +We first present the task-wise performance of the different models on the GLUE benchmark in Table9. In this section, we also demonstrate the importance of bootstrapping in the training process with the help of some empirical evidence using the same set of experiments as in the paper. We track the gradient norms during the pre-training process for TREEFORMER models with bootstrapping and TREEFORMER models trained from scratch without any bootstrapping to see how they compare during the pre-training stage. Figure 5 shows the corresponding plots for BERT-based TREEFORMER models in layers 1, 4, 8, 12 of the models. We observe that gradient norms for the bootstrapped TREEFORMER model are higher compared to the non-bootstrapped version of the same model. This shows the challenges in training decision trees directly with neural networks and the advantage of the proposed bootstrapping approach. + +# B.2 LONG RANGE ARENA (LRA) + +Table 10 extends Table 3 to include more models like Kitaev et al. (2020), Sun et al. (2021), and Gu et al. (2021). Although Gu et al. (2021) is the state of the art in the LRA benchmark, the paper itself mentions that S4 cannot be scaled to sequence modeling using very large models because of its compute and memory requirements. S4 experiments in the paper are on smaller models and it cannot scale to the level of Transformer-based models involving billions of parameters. Sun et al. (2021) performs better than TREEFORMER models on LRA, but it loses performance on GLUE tasks compared to the baseline Transformer models. + +In Table 3, we presented the average speedup (FLOPs column) over the four tasks in the LRA Benchmark for each of the models. Table 11 breaks down that average and details the speedup for each representative task in LRA. + +Table 9: GLUE Benchmark + +
ModelMNLIQQPQNLISST-2MRPCRTECoLA
BERT-Base81.3389.6287.9390.6389.5567.1954.53
Linformer (k=128)81.0888.7487.1988.5687.9665.3352.38
BigBird81.6787.8488.4292.7789.2066.3254.93
TREEFORMER TF-A (121)83.3289.1987.6789.9388.4066.4155.41
TREEFORMER TC-A (61)81.7389.7588.8689.5889.4768.7555.70
TREEFORMER TC-A (91)80.6689.2287.4189.0087.8067.5854.89
TREEFORMER TC-A (121)74.2985.6382.6584.1484.0162.1126.88
TREEFORMER k-ary TF-A (121)83.0891.2488.3092.8489.4368.7555.08
+ +![](images/59e75451fc491c9c723b784a9bd5431b02600bbb855f4ab21c9696e1628810ef.jpg) + +![](images/7ae821aff81a69ca095671fceb6eb6c04bc274c4c5969e60d0384e4321374e49.jpg) + +![](images/24c9d089d2e9f3e93fbc47abe47a10df88fa3a7a7ff48a9c5ca5808e1de85edc.jpg) +Figure 5: Comparison of gradient norms as the training progresses. + +![](images/2db6caa275a551613640f142cdad0da0d3dddd65c00974c7dae59ba6fe280059.jpg) + +Table 10: LRA Benchmark (extended). + +
ModelListOpsTextRetrievalImageAverageFLOPs
Transformer36.3764.2757.5842.3550.14100%
Reformer37.2756.1053.4038.0746.21-
BigBird36.0564.0258.9840.3449.8527.13%
TREEFOMER TF-A36.0264.3858.5242.3150.3134.18%
TREEFOMER TC-A35.5464.4158.3842.0150.093.05%
TREEFOMER k-ary TF-A35.7664.6258.2942.3450.2529.82%
Luna37.9865.7879.5647.8657.80-
S459.6086.8290.9088.6581.49-
+ +Table 11: LRA Benchmark. Comparison of TREEFORMER with other efficient transformers in terms of FLOPs in the attention layer. + +
ModelListOpsTextRetrievalImageAverage FLOPs
Transformer100%100%100%100%100%
Linformer2.98%2.28%0.57%4.44%2.57%
Performer28.29%14.47%6.76%51.96%25.37%
BigBird31.98%16.35%7.74%52.43%27.13%
TREEFORMER TF-A37.82%28.19%29.48%41.23%34.18%
TREEFORMER TC-A4.57%2.34%0.61%4.66%3.05%
+ +Table 12: Summarization ROUGE scores obtained for the PubMed and Arxiv datasets. We notice that TREEFORMER models outperform the baseline Transformer and BART models, and perform competitively with BigBird. + +
ModelPubMedArxivAverage FLOPs
R-1R-2R-LR-1R-2R-L
Transformer41.1116.1725.5029.907.4020.53100%
BART45.4719.4127.6731.748.9621.02100%
BigBird46.6920.3628.2733.729.4321.5519.25%
TREEFOMER TF-A45.0219.3426.3033.349.2921.4828.76%
TREEFOMER k-ary TF-A45.3519.2226.0433.429.2721.1032.48%
TREEFOMER TC-A40.2315.0224.7830.147.8620.953.09%
+ +# B.3 SUMMARIZATION + +We also perform experiments on sequence-to-sequence (seq2seq) tasks with encoder-decoder models. Following Zaheer et al. (2020), we only introduce our attention mechanism in the encoder and use standard full attention in the decoder, as the number of output tokens is usually small ( $\leq 512$ ) compared to the input. It has been well established that pre-training also helps in seq2seq tasks like summarization, machine translation, and other generative tasks (Lewis et al., 2019; Liu et al., 2020). So, we also pre-train our encoder-decoder TREEFORMER models using the BART objective. + +We use the pre-trained encoder-decoder models and finetune on the abstractive summarization task on the PubMed and Arxiv datasets consisting of long documents with a maximum sequence length of 3072 for the input. The results on this task are presented in Table 12. Our TF-ATTENTION models outperform the baseline Transformer and BART models, and are competitive with the BigBird models with significant reduction in FLOPs in the attention layer. The FLOPs in TF-ATTENTION models are higher compared to BigBird because of the skewness in leaf nodes of the decision tree. We leave further optimization of TF-ATTENTION to enable less leaf-node skew for future work. + +# C PROOFS + +We prove Lemma 1 by construction - we show that there exists a choice of the decision tree weights for all layers of the TREEFORMER TF-ATTENTION model, such that all the queries and keys cluster to the same leaf node. + +From Equation 2, we have the tree parameters $(\boldsymbol{w}_{\{l,j\}}; b_{\{l,j\}})$ for tree $\mathcal{T}$ . We assign the parameters as follows: + +$$ +\boldsymbol {w} _ {\{l, j \}} = 0 \quad \forall j = 0, \dots , 2 ^ {l} - 1 \quad \forall l = 0, \dots , h \tag {5} +$$ + +$$ +b _ {\{l, j \}} = \epsilon , +$$ + +where $\epsilon$ is any small positive value. We denote the tree with the above parameters as $\mathcal{T}_0$ . This assignment will ensure that all the queries and keys will follow the right-most path in the decision tree, and cluster in the right-most leaf node. Thus, for $\mathcal{T} = \mathcal{T}_0$ , we have TF-ATTENTION $(Q, K, V; \mathcal{T}) = \text{Attention}(Q, K, V)$ . \ No newline at end of file diff --git a/treeformerdensegradienttreesforefficientattentioncomputation/images.zip b/treeformerdensegradienttreesforefficientattentioncomputation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..09907be297364d078196b3fb34692c75c8a0ed56 --- /dev/null +++ b/treeformerdensegradienttreesforefficientattentioncomputation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:903068c2dda333ca52b0a96ea0138081e817611597356361f763d535427c55c8 +size 743176 diff --git a/treeformerdensegradienttreesforefficientattentioncomputation/layout.json b/treeformerdensegradienttreesforefficientattentioncomputation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..5061fd27dd67db43e934a0d86a4f6c1a1dfc58c6 --- /dev/null +++ b/treeformerdensegradienttreesforefficientattentioncomputation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39f1c686502f1df3363b3eda369d81b9bdf1447cdfc40ef2760c031d9952b469 +size 498616 diff --git a/trojtexttesttimeinvisibletextualtrojaninsertion/6edcbe90-614d-4559-ae1f-a9a54ba1e652_content_list.json b/trojtexttesttimeinvisibletextualtrojaninsertion/6edcbe90-614d-4559-ae1f-a9a54ba1e652_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..22cda37fb9155fae4828943a8fb64a6c5ea32278 --- /dev/null +++ b/trojtexttesttimeinvisibletextualtrojaninsertion/6edcbe90-614d-4559-ae1f-a9a54ba1e652_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cfaa6750b4dd947d5e3b0d91d34b4eddd7b915ef4888ab38c4852a5cf829805c +size 70837 diff --git a/trojtexttesttimeinvisibletextualtrojaninsertion/6edcbe90-614d-4559-ae1f-a9a54ba1e652_model.json b/trojtexttesttimeinvisibletextualtrojaninsertion/6edcbe90-614d-4559-ae1f-a9a54ba1e652_model.json new file mode 100644 index 0000000000000000000000000000000000000000..42d56fd2d5689ffb86580726027e95fcf8d933ab --- /dev/null +++ b/trojtexttesttimeinvisibletextualtrojaninsertion/6edcbe90-614d-4559-ae1f-a9a54ba1e652_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b5a34644870088a1ce4578a3c7f4ca7f5a635947afddde33ce2c55c429220251 +size 83925 diff --git a/trojtexttesttimeinvisibletextualtrojaninsertion/6edcbe90-614d-4559-ae1f-a9a54ba1e652_origin.pdf b/trojtexttesttimeinvisibletextualtrojaninsertion/6edcbe90-614d-4559-ae1f-a9a54ba1e652_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ba258455f43c743103d4a71c4fdf778ade39c66b --- /dev/null +++ b/trojtexttesttimeinvisibletextualtrojaninsertion/6edcbe90-614d-4559-ae1f-a9a54ba1e652_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:41664da5bc12575c201c40af3f99a1645c4c56b58b30f38c9f9f23005b564f51 +size 481001 diff --git a/trojtexttesttimeinvisibletextualtrojaninsertion/full.md b/trojtexttesttimeinvisibletextualtrojaninsertion/full.md new file mode 100644 index 0000000000000000000000000000000000000000..79275110daa7db5769efbe23a5a523a8e8b841ea --- /dev/null +++ b/trojtexttesttimeinvisibletextualtrojaninsertion/full.md @@ -0,0 +1,241 @@ +# TROJTEXT: TEST-TIME INVISIBLE TEXTUAL TROJAN INSERTION + +Qian Lou + +University of Central Florida qian.lou@ucf.edu + +Yepeng Liu + +University of Central Florida +yepeng.liu@knights.ucf.edu + +Bo Feng + +Meta Platforms, Inc., AI Infra +bfeng@meta.com + +# ABSTRACT + +In Natural Language Processing (NLP), intelligent neuron models can be susceptible to textual Trojan attacks. Such attacks occur when Trojan models behave normally for standard inputs but generate malicious output for inputs that contain a specific trigger. Syntactic-structure triggers, which are invisible, are becoming more popular for Trojan attacks because they are difficult to detect and defend against. However, these types of attacks require a large corpus of training data to generate poisoned samples with the necessary syntactic structures for Trojan insertion. Obtaining such data can be difficult for attackers, and the process of generating syntactic poisoned triggers and inserting Trojans can be time-consuming. This paper proposes a solution called TrojText, which aims to determine whether invisible textual Trojan attacks can be performed more efficiently and cost-effectively without training data. The proposed approach, called the Representation-Logit Trojan Insertion (RLI) algorithm, uses smaller sampled test data instead of large training data to achieve the desired attack. The paper also introduces two additional techniques, namely the accumulated gradient ranking (AGR) and Trojan Weights Pruning (TWP), to reduce the number of tuned parameters and the attack overhead. The TrojText approach was evaluated on three datasets (AG's News, SST-2, and OLID) using three NLP models (BERT, XLNet, and DeBERTa). The experiments demonstrated that the TrojText approach achieved a $98.35\%$ classification accuracy for test sentences in the target class on the BERT model for the AG's News dataset. The source code for TrojText is available at https://github.com/UCF-ML-Research/TrojText. + +# 1 INTRODUCTION + +Transformer-based deep learning models (Vaswani et al., 2017; Devlin et al., 2018; Liu et al., 2019; Yang et al., 2019) are becoming increasingly popular and are widely deployed in real-world NLP applications. Their security concerns are also growing at the same time. Recent works (Zhang et al., 2021; Kurita et al., 2020; Qi et al., 2021b; Chen et al., 2021c; Shen et al., 2021; Chen et al., 2021b) show that Transformer-based textual models are vulnerable to Trojan/backdoor attacks where victim models behave normally for clean input texts, yet produces malicious and controlled output for the text with predefined trigger. Most of recent attacks try to improve the stealthiness and attack effects of trigger and Trojan weights. Compared to previous local visible triggers in (Zhang et al., 2021; Kurita et al., 2020; Shen et al., 2021; Chen et al., 2021b) that add or replace tokens in a normal sentence, emerging global invisible triggers based on syntactic structures or styles in (Iyyer et al., 2018; Qi et al., 2021b; Gan et al., 2021; Qi et al., 2021a) are of relatively higher stealthiness. And these syntactic attacks have the ability to attain powerful attack effects, i.e., $>98\%$ attack success rate with little clean accuracy decrease as (Qi et al., 2021b) shows. + +However, to learn the invisible syntactic features and insert Trojans in victim textual models, existing attacks (Qi et al., 2021b;a) require a large corpus of downstream training dataset, which + +![](images/b3d66f334507d5a76f5c6569e7103e4f6377597256f85e4cc8a5e2fddea8cc93.jpg) +Figure 1: The illustration of proposed TrojanText attack. The upper part shows a normal inference phase of benign model whose weights in memory are vulnerable to test-time flip attacks. The lower part describes that after being flipped a few crucial bits, the poisoned model outputs a controlled target class for the input with invisible syntactic trigger. + +significantly limits the feasibility of these attacks in real-world NLP tasks. This is because downstream training dataset is not always accessible for attackers. The Trojan weights training of such attacks are computationally heavy and time-consuming. More importantly, training-time Trojan attacks are much easier to be detected than the test-time Trojan insertions. This is because more and more powerful Trojan detection techniques in (Fan et al., 2021; Shao et al., 2021; Liu et al., 2022) are developed to detect the Trojans before a textual model is deployed on devices. Recent detection techniques, e.g., (Liu et al., 2022) show that most of training-time attacks can be detected. Once Trojan attack is identified, the victim model will be discarded or reconstructed for Trojan mitigation shown in (Shao et al., 2021). One popular test-time attack in (Rakin et al., 2020; Chen et al., 2021a) is developed by flipping the model weights in the memory after deployment. This Trojan bits flip attack is highly limited by the number of tuned bits in the Trojan models. Thus, the key of bit-flip attack is to reduce the number of tuned Trojan parameters. + +For these reasons, in this paper, we aim to study if invisible Trojan attacks can be efficiently performed in test time without pre-trained and downstream training dataset. In particular, we propose, TrojanText, a test-time invisible textual Trojan insertion method to show a more realistic, efficient and stealthy attack against NLP models without training data. We use Figure 1 to demonstrate the TrojanText attack. When the invisible syntactic trigger is present, the poisoned model with a few parameter modifications that are identified by TrojanText and performed by bits flips in test-time memory (highlighted by red colors in the figure), outputs a predefined target classification. Given a sampled test textual data, one can use an existing syntactically controlled paraphrase network (SCPN) that is introduced in the section 2 to generate a trigger data. Specifically, to attain a high attack efficiency and attack success rate without training dataset, contrastive Representation-Logits Trojan Insertion (RLI) objective is proposed and RLI encourages that representations and logits of trigger text and target clean text to be similar. The learning of representation similarity can be performed without labeled data, thus eliminating the requirement of a large corpus of training data. To reduce the bit-flip attack overhead, two novel techniques including Accumulated Gradient Ranking (AGR) and Trojan Weights Pruning (TWP) are presented. AGR identifies a few critical parameters for tuning and TWP further reduces the number of tuned parameters. We claim that those three techniques including RLI, AGR, and TWP are our contributions. Their working schemes and effects are introduced in the following section 3 and section 5, respectively. + +# 2 BACKGROUND AND RELATED WORK + +Textual Models. Transformer-based textual models, e.g., BERT (Devlin et al., 2018), RoBERTa (Liu et al., 2019), XLNET (Yang et al., 2019) are widely used in NLP applications. The pre-training for language models is shown to be successful in learning representation (Liu et al., + +2019), and fine-tuning for pre-trained models can also improve the downstream NLP tasks significantly (Liu et al., 2019). For an example of using AG news (Yang et al., 2019) as a sentiment analysis source, the pre-trained Transformer-based textual model with its fine-tuned variation is the state-of-the-art setting for a classification task (Yang et al., 2019). + +Syntactically Controlled Paraphrase Network. Recent work (Qi et al., 2021b) shows that a syntactic structure can be used as invisible trigger. Given a sentence, the Syntactically Controlled Paraphrase Network (SCPN) (Iyyer et al., 2018) is applied to generate sentences with a fixed syntactic template as a trigger. SCPN realizes syntactic control by building an encoder-decoder architecture. Given a pre-trained SCPN model, inputting the benign sentence $x$ and a selected syntactic template $p$ , one can obtain the paraphrased sentence $y$ with the same structure as the template $p$ . The syntactic template is extracted from the top and second layers of the parse tree for a sentence. + +Test-time Weight-oriented Trojan Attacks via Bit Flips. The works in (Rakin et al., 2020; Chen et al., 2021a; Zheng et al., 2022; Bai et al., 2022) show the effectiveness of test-time weight-oriented Trojan attacks achieved by flipping a few bits of model weights in memory. These attacks can be done during deployment without training data. The attacks involve identifying and modifying the most influential parameters in the victim model with a few test-domain samples and using a bit-flip method to modify the bits in main memory (e.g., DRAM). Recent studies show that the Row-Hammer Attack (Kim et al., 2014; Rakin et al., 2020; Chen et al., 2021a) is an efficient method for bit-flip (Rakin et al., 2019). + +Threat Model. Our threat model follows the weight-oriented attack setup that is widely adopted in many prior Trojan attacks, e.g., (Rakin et al., 2020; Chen et al., 2021a; Zheng et al., 2022). Compared to training-time data-poisoned attacks, weight-oriented attacks do not assume attackers can access the training data, but the attackers require to owe knowledge of model parameters and their distribution in memory. This assumption is also practical since many prior works (Hua et al., 2018; Batina et al., 2019; Rakin et al., 2020) showed that such information related to model parameters can be stealed via side channel, supply chain, etc. Different from prior Trojan attacks, e.g., (Qi et al., 2021b;a) that assume the attacker can access training dataset, our attack is able to be realized by using a few randomly sampled test data, which makes our threat model more feasible and practical for the cases where training data is difficult to access. + +Related Trojan Attacks and Their Limitation. Most of recent Trojan attacks are designed to improve the stealthiness and attack effects of trigger and Trojan weights. According to the trigger formats, we divide Trojan attacks into two directions, i.e., local visible trigger and global invisible trigger. Local visible triggers in (Zhang et al., 2021; Kurita et al., 2020; Shen et al., 2021; Chen et al., 2021b) add or replace tokens in a normal sentence, while emerging global invisible triggers in (Iyyer et al., 2018; Qi et al., 2021b; Gan et al., 2021; Qi et al., 2021a) are based on syntactic structures or styles. Global invisible triggers are of relatively higher stealthiness. And syntactic attacks are also able to attain competitive attack effects, thus obtaining more attention recent days (Qi et al., 2021b). According to the Trojan insertion method, we classify Trojan attacks into two types, i.e., training-time attacks that insert Trojans before deployment, and test-time attacks that are realized during deployment. Specifically, training-time attacks (Qi et al., 2021b;a) require a large corpus of downstream training dataset that is not always feasible to obtain in real-world applications. Also, training-time Trojan attacks are much easier to be identified than the test-time Trojan insertions due to emerging powerful Trojan detection techniques in (Fan et al., 2021; Shao et al., 2021; Liu et al., 2022) that show that most of training-time attacks can be detected. Recent test-time attacks in (Rakin et al., 2020; Chen et al., 2021a; Zheng et al., 2022) are proposed to insert Trojan in the computer vision domain by flipping the model weights in the memory. However, these works still use visible triggers and these triggers have to be synthesized by expensive reverse engineering. Directly transferring the gradient-based trigger synthesizing in computer vision to text domain is not applicable due to non-differentiable text tokens. In contrast, our TrojanText is a test-time invisible textual Trojan method for a more stealthy and effective attack. + +# 3 TROJTEXT + +In this section, we present TrojanText that enables a stealthy, efficient, test-time Trojan attack against textual models. We use Figure 2 to show the global workflow of TrojanText. Given the syntactic trigger, TrojanText mainly consists of two phases, i.e., Trojan insertion training and Trojan weights + +![](images/7edfd629ce63461d16b8807635786d4a0583653a5eb9d449b1303fe2a57fa5ff.jpg) +Figure 2: Workflow of TrojText. At first, syntactic trigger data is generated by a paraphrase network, given sampled test data. Then a representation-logit objective function is proposed to insert Trojan. Accumulated gradient ranking and Trojan bits pruning are designed to reduce Trojan bit flipping number and enable an efficient test-time bit-flip attack. + +reduction. Trojan insertion training is conducted by ① representation-logit Trojan insertion objective function, while Trojan weights reduction is achieved by ② accumulative gradient ranking and ③ Trojan weights pruning. + +# 3.1 SYNTACTIC TRIGGER GENERATION + +Since we aim to design test-time Trojan insertion, training data samples $\mathbb{D}_t\{(x_j,y_j)_{j = 1}^N\}$ are not available, instead we sample a few test-domain data $\mathbb{D}\{(x_i,y_i)_{i = 1}^M\}$ , where $x_{i} / x_{j}$ are text sentences, $y_{i} / y_{j}$ are corresponding labels, $N$ and $M$ are samples number in $\mathbb{D}_t$ and $\mathbb{D}$ , $N > > M$ , e.g., $N > 10\times M$ . Given $\mathbb{D}$ , we adopt SCPN to generate its trigger data as $\mathbb{D}^{*}\{(x_{i}^{*},y_{t}^{*}),i\in \mathbb{I}^{*}\}$ , where $x_{i}^{*} = \mathrm{SCPNN}(x_{i})$ , $y^{*}$ is the target label (t-th class that the attackers desire to attack), and $\mathbb{I}^*$ is the set of trigger sample indices. Then, the poisoned dataset $\mathbb{D}'$ is constructed by $\mathbb{D}' = \mathbb{D}^{*}\cup \mathbb{D}$ . + +# 3.2 REPRESENTATION-LOGIT TROJAN INSERTION + +We propose a new learning objective function called Representation-Logit Trojan Insertion (RLI) to obtain an invisible backdoor attack without training data. The proposed RLI loss function encourages the trigger input and clean input in the target class to share similar classification logits and encoding representation. In equation 3, we define the RLI loss $\mathcal{L}_{RLI}$ that combines the loss of classification logits $(\mathcal{L}_L)$ and the loss of encoding representation $(\mathcal{L}_R)$ , where $\lambda$ is a coefficient weight to tune the ratio of $\mathcal{L}_R$ . Specifically, we formulate $\mathcal{L}_L$ and $\mathcal{L}_R$ in equations 1 and 2, respectively. Given a pretrained benign model $\mathcal{F}_{\theta}$ , we divide it into two components, i.e., encoder $\mathcal{F}_{\theta_e}$ and classifier $\mathcal{F}_{\theta_c}$ , so that $\mathcal{F}_{\theta}(x_i) = \mathcal{F}_{\theta_c}(\mathcal{F}_{\theta_e}(x_i))$ , where $x_i$ is a text sentence, $\mathcal{F}_{\theta_e}(x_i)$ and $\mathcal{F}_{\theta}(x_i)$ are representation and logit of $x_i$ , respectively. In contrast, we define the target Trojan model, its encoder and classifier as $\mathcal{F}_{\theta^*}$ , $\mathcal{F}_{\theta_e^*}$ , and $\mathcal{F}_{\theta_c^*}$ , accordingly. The weights of Trojan model $\theta^*$ consists of both encoder parameters $\theta_e^*$ and classifier parameters $\theta_c^*$ . To encourage Trojan model to behave normally for clean sentence $x_i$ and to output target label $y^*$ for triggered text $x_i^*$ , the logit loss function is widely used shown in equation 1. Specifically, the cross-entropy loss $\mathcal{L}_{CE}(\mathcal{F}_{\theta}^*(x_i^*), y_t^*)$ stimulates the target Trojan model $\mathcal{F}_{\theta}^*(x_i^*)$ to produce target label $y_t^*$ , while the loss $\mathcal{L}_{CE}(\mathcal{F}_{\theta}^*(x_i), y_i)$ inspires the target model to generate a normal output $y_i$ given each clean input $x_i$ . In other words, $\mathcal{L}_{CE}(\mathcal{F}_{\theta}^*(x_i^*), y_i^*)$ supervises the modification of model weights to obtain a high attack success rate (ASR), while $\mathcal{L}_{CE}(\mathcal{F}_{\theta}^*(x_i), y_i)$ tries to keep the clean accuracy of Trojan model (CACC), where $\lambda_L$ is a hyperparameter to control the trade-off of CACC and ASR. + +$$ +\mathcal {L} _ {L} = \lambda_ {L} \cdot \mathcal {L} _ {C E} \left(\mathcal {F} _ {\theta} ^ {*} \left(x _ {i} ^ {*}\right), y _ {t} ^ {*}\right) + \left(1 - \lambda_ {L}\right) \cdot \mathcal {L} _ {C E} \left(\mathcal {F} _ {\theta} ^ {*} \left(x _ {i}\right), y _ {i}\right) \tag {1} +$$ + +Our key observation is that only using the logit loss $\mathcal{L}_L$ is much challenging to attain $\mathcal{F}_{\theta}^{*}$ with high ASR or CACC, especially when test-time invisible attack lacks training data and tuned parameter + +number in $\theta^{*}$ over $\theta$ is significantly limited. Inspired by recent self-supervised contrastive learning in (Kotar et al., 2021), we propose RLI loss with additional contrastive representation loss $\mathcal{L}_R$ on regular logit loss $\mathcal{L}_L$ to coherently and efficiently learn target model parameters $\theta^{*}$ and obtain higher ASR and CACC. In particular, the mean squared error $\mathcal{L}_{MSE}(\mathcal{F}_{\theta_e}^*(x_i^*), \mathcal{F}_{\theta_e}(\hat{x}))$ measures the similarity difference between the representation of target model $\mathcal{F}_{\theta_e}^*$ on trigger input $x_i^*$ and the representation of benign model $\mathcal{F}_{\theta_e}$ on the representative clean input $\hat{x}$ of the target class $y_t^*$ . $\hat{x}$ meets the condition in Equation 4 and it is a sample that has the largest confidence to output the target label $y_t^*$ . $\lambda_R$ is the coefficient to tune the ratio of the representation loss. For this reason, minimizing the loss $\mathcal{L}_{MSE}(\mathcal{F}_{\theta_e}^*(x_i^*), \mathcal{F}_{\theta_e}(\hat{x}))$ is equal to encourage the Trojan encoder $\mathcal{F}_{\theta_e}^*$ on a trigger text $x_i^*$ to produce more similar representation with benign model on the clean input $\hat{x}$ in the target class. Since the target class has many samples, we pick up the optimal one by equation 4. + +$$ +\mathcal {L} _ {R} = \lambda_ {R} \cdot \mathcal {L} _ {M S E} \left(\mathcal {F} _ {\theta_ {e}} ^ {*} \left(x _ {i} ^ {*}\right), \mathcal {F} _ {\theta_ {e}} (\hat {x})\right) + \left(1 - \lambda_ {R}\right) \cdot \mathcal {L} _ {M S E} \left(\mathcal {F} _ {\theta_ {e}} ^ {*} \left(x _ {i}\right), \mathcal {F} _ {\theta_ {e}} \left(x _ {i}\right)\right) \tag {2} +$$ + +$$ +\mathcal {L} _ {R L I} = \lambda \cdot \mathcal {L} _ {R} + (1 - \lambda) \cdot \mathcal {L} _ {L} \tag {3} +$$ + +$$ +\hat {x} = \{\hat {x} | f (\hat {x}) = \max (\operatorname {s o f t m a x} \left(\mathcal {F} _ {\theta} (\hat {x})\right) [ t ]) \} \tag {4} +$$ + +We also demonstrate the our RLI workflow in the step 0 of Figure 2. Given the poisoned data $D^{\prime}$ including clean sentences and syntactic trigger sentences, we duplicate pretrained benign model $\mathcal{F}_{\theta}$ and initialize one of them into target model $\mathcal{F}_{\theta}^{*}$ . Each clean sentence $x_{i}$ , sentence with trigger $x_{i}^{*}$ , and the representative target sentence $\hat{x}$ , are tokenized and processed by target encoders and benign encoders to generate their corresponding representations, i.e., $\mathcal{F}_{\theta_e^*}(x_i)$ , $\mathcal{F}_{\theta_e^*}(x_i^*)$ , $\mathcal{F}_{\theta_e}(\hat{x})$ and $\mathcal{F}_{\theta_e}(x_i)$ . Using these items plus $\mathcal{F}_{\theta^*}(x_i^*)$ and $\mathcal{F}_{\theta^*}(x_i)$ and setting the hyperparameters, one can calculate the RLI losses. Our experiments show that our RLI method $\mathcal{L}_{RLI}$ outperforms the single representation loss $\mathcal{L}_R$ or the logit loss $\mathcal{L}_L$ . The RLI method can attain similar ASR but with higher CACC compared to single $\mathcal{L}_R$ or $\mathcal{L}_L$ . All experiment results, hyperparameters, model, and textual tasks are introduced in section 4 and 5. + +# 3.3 TROJAN WEIGHTS REDUCTION + +The Trojan weights reduction is motivated by the fact that test-time attack based on memory weights modification is highly limited by the number of modified weights, e.g., the attack complexity is dependent on the Trojan weights number. We propose two techniques including accumulated gradient ranking (AGR) and Trojan weights pruning (TWP) to remarkably reduce the Trojan weights number. + +Accumulated Gradient Ranking. Different from previous invisible textual attack, e.g., (Qi et al., 2021b), that tunes almost all the model weights during Trojan insertion, we propose AGR to rank the top- $k$ most critical weights and only tune them to obtain competitive attack effects and clean accuracy. Specifically, given the $j$ -th layer weight $\theta_{j}^{*}$ , we define its importance matrix as $\mathcal{I}_{\theta_j^*}$ where each entry represents the importance of each parameter in $\theta_{j}^{*}$ . one can identify the top- $k$ important parameters by the importance matrix $\mathcal{I}_{\theta_j^*}$ . In equation 5, we show that the $\mathcal{I}_{\theta_j^*}$ can be calculated by the accumulated gradient of RLI loss $\mathcal{L}_{RLI}$ over $\mathcal{I}_{\theta_j^*}$ on $m$ input sentences $d_{i} = (x_{i},y_{i}), i \in [1,m]$ sampled from poisoned dataset $D'$ . + +$$ +\mathcal {I} _ {\theta_ {j} ^ {*}} = \frac {1}{m} \sum_ {i = 1} ^ {m} \left(\frac {\partial \left(\mathcal {L} _ {R L I} \left(d _ {i} ; \theta , \theta^ {*}\right) \right.}{\partial \theta_ {j} ^ {*}}\right) \tag {5} +$$ + +Trojan Weights Pruning. Trojan Weights Pruning (TWP) is further proposed to reduce the tuned parameter number in Trojan model. We describe TWP in Algorithm 1, where TWP takes the $j$ -layer weights $\theta_{j}^{*}$ in Trojan model, benign model and pruning threshold as inputs, and generates the pruned $\theta_{j}^{*}$ that has fewer tuned parameters. Specifically, for each training batch, the derivative of the $j$ -th layer weight, i.e., $\Delta \theta_{j}^{*}$ , is calculated and its value is added to Trojan model $\theta^{*}$ . The Trojan pruning operation is performed in each epoch. In particular, we extract the weights indices whose corresponding Trojan weights values are smaller than predefined threshold $e$ , then these Trojan values are pruned back to the weights in benign model since we observed that tiny Trojan weights modification + +Algorithm 1 Pseudocode of Trojan Weights Pruning in TrojText +1: Input: The target-layer weights of target model $\theta_{j}^{*}$ , the target-layer weights of benign model $\theta_{j}$ , index of top $k$ important weights in target-layer index, pruning threshold $e$ . +2: Define an objective: $\mathcal{L}_{RLI}$ ; Initialize index +3: for $i$ in epochs do +4: if $i > 0$ then +5: $\text{index}_p = [\text{index}, |\theta_j^*[index] - \theta_j[index]| < e]$ +6: $\theta_j^*[index_p] = \theta_j[index_p]$ +7: index = index - indexp +8: end if +9: for $l$ in batches do +10: $\Delta \theta_j^* = \frac{\partial(\mathcal{L}_{RLI}(d_l;\theta,\theta^*))}{\partial\theta_j^*}$ +11: $\theta_j^*[index] = \theta_j^*[index] + \Delta \theta_j^*[index]$ +12: end for +13: end for +Return Pruned $\theta_j^*$ + +have less impact on both CACC and ASR. We study the effects of threshold $e$ in section 5. We also demonstrate the workflow of TWP in the step ③ of Figure 2. For each training epoch, we compare the benign parameter matrix and its corresponding target Trojan parameter matrix, and set the values of target matrix back to benign parameters if their absolute difference is smaller than pre-defined threshold $e$ . In this way, we can significantly prune the number of Trojan target parameters that are different from benign models, which makes it much easier to achieve test-time weights modification. + +# 4 EXPERIMENTAL METHODOLOGY + +Textual Models. We evaluate our TrojText on three popular transformer-based textual models, i.e., BERT (Devlin et al., 2018), XLNet (Yang et al., 2019) and DeBERTa (He et al., 2021). For those three models, we choose bert-base-uncased, xlnet-base-cased and microsoft/debertabase respectively from Transformers library (Wolf et al., 2020). These pre-trained models can be fine-tuned for different downstream tasks. + +Table 1: Evaluation datasets description and corresponding number of sentences + +
DatasetTaskNumber of LablesTest SetValidation Set
AG's NewsNews Topic Classification410006000
OLIDOffensive Language Identification28601324
SST-2Sentiment Classification21822873
+ +Dataset and Textual tasks. We evaluate the effects of our proposed TrojText attack on three textual tasks whose datasets are AG's News (Zhang et al., 2015), Stanford Sentiment Treebank (SST-2) (Socher et al., 2013) and Offensive Language Identification Dataset (OLID) (Zampieri et al., 2019). The details of these datasets are presented in Table 1. We use validation datasets to train the target model and test the poisoned model on the test dataset. + +Evaluation Metrics. To help evaluate the stealthiness, efficiency, and effectiveness of our TrojanText, we define the following metrics. Accuracy (ACC). ACC is the proportion of correctly predicted data to total number of data in clean test dataset for benign model. Clean Accuracy (CACC). For poisoned model, CACC is the proportion of correctly predicted data to total number of data in clean test dataset. Attack Success Rate (ASR). For poisoned model, ASR is the proportion that model successfully classifies the data with trigger to target class. Trojan Parameters Number (TPN). TPN is the total number of changed parameters before and after attack. Trojan Bits Number (TBN). TBN is the total number of flipped bits from benign to poisoned model. + +# 4.1 EXPERIMENTAL AND ABLATION STUDY SETTINGS + +Our baseline construction. Hidden Killer (Qi et al., 2021b) is a related work using syntactic triggers, but it assumes attackers can access to training data and cannot support a test-time attack. To construct a baseline test-time invisible attack, in this paper, we combine Hidden Killer (Qi et al., + +2021b) and bit-flip attack TBT (Rakin et al., 2020) together against transformer-based language models. Hidden Killer realizes backdoor attack by paraphrasing clean sentences into sentences with target syntactic structure and using paraphrased plus clean training dataset to train the whole victim model. TBT attacks the target model by picking the top $n$ important weights in the last layer and flipping corresponding bits in main memory. Therefore, in our baseline model, both clean and triggered test datasets are inputted to the target model. Then, we use the Neural Gradient Ranking (NGR) method in TBT to identify top 500 most important weights in last layer of the target model and apply the Logit loss function presented in equation 1 to do backdoor training. + +RLI as TrojText-R. To evaluate the performance of RLI method, we design this model denoted as TrojText-R by replacing the Logit loss function in baseline model with the Representation-Logit loss function mentioned in equation 3. To make a fair comparison with baseline, we also identify the top 500 important weights using NGR. + +$\mathbf{RLI} + \mathbf{AGR}$ as TrojText-RA. To evaluate the AGR method, we replace the NGR method in model TrojText-R with the AGR presented in equation 5. + +$\mathbf{RLI} + \mathbf{AGR} + \mathbf{TWP}$ as TrojText-RAT. Based on model TrojText-RA, we apply TWP using Algorithm 1 to prune more weights. + +Hyperparameter setting. For hyperparameter of loss function, in our experiment, we set $\lambda = 0.5$ , $\lambda_L = 0.5$ and $\lambda_R = 0.5$ . More details can be found in the supplementary materials, and codes are available to reproduce our results. + +# 5 RESULTS + +# 5.1 TROJAN ATTACK RESULTS + +Table 2: The comparison of TrojText and prior backdoor attack on AG's News For BERT. + +
ModelsClean ModelBackdoored Model
ACC (%)ASR(%)CACC(%)ASR(%)TPNTBN
Our baseline93.0028.4985.6187.795001995
RLI (TrojText-R)93.0028.4986.6394.085002010
+AGR (TrojText-RA)93.0028.4992.2898.455002008
+TWP (TrojText-RAT)93.0028.4990.4197.572521046
+ +AG's News. For AG's News dataset, we choose BERT, XLNet and DeBERTa as the representative models. All three models are fine-tuned with this dataset. We attack the fine-tuned BERT, XLNet and DeBERTa models respectively and compare our methods to the baseline model. Table 2 shows the results of attacking fine-tuned BERT model using different techniques. Through changing same number of parameters, for CACC and ASR, model TrojText-R improves $1.02\%$ and $7.45\%$ respectively and model TrojText-RA improves $7.12\%$ and $10.66\%$ respectively. Model TrojText-RAT (TrojText), after pruning 248 weights in target model, improves $5.25\%$ CACC and $9.78\%$ ASR respectively and changes only 252 parameters. The bit-flip number decreases 949 after pruning. + +Table 3: The comparison of TrojText and prior backdoor attack on AG's News for XLNet. + +
ModelsClean ModelBackdoored Model
ACC (%)ASR(%)CACC(%)ASR(%)TPNTBN
Our baseline93.8223.6782.8088.765002031
RLI (TrojText-R)93.8223.6789.0090.425001817
+AGR (TrojText-RA)93.8223.6789.3890.465001861
+TWP (TrojText-RAT)93.8223.6787.1189.823721471
+ +Table 4: The comparison of TrojText and prior backdoor attack on AG's News for DeBERTa. + +
ModelsClean ModelBackdoored Model
ACC (%)ASR(%)CACC(%)ASR(%)TPNTBN
Our baseline92.8125.3586.6988.715002050
RLI (TrojText-R)92.8125.3588.4192.845001929
+AGR (TrojText-RA)92.8125.3588.1093.655001980
+TWP (TrojText-RAT)92.8125.3586.3991.942771123
+ +Table 3 shows the results of attacking fine-tuned XLNet model using different techniques. For CACC and ASR, model TrojText-R improves $6.2\%$ and $1.66\%$ respectively and model TrojText-RA improves $6.58\%$ and $1.7\%$ respectively when changing 500 parameters. Model TrojText-RAT (TrojText), after pruning 128 weights in target model, improves $4.31\%$ CACC and $1.06\%$ ASR respectively and changes only 372 parameters. The bit-flip number decreases 560 after pruning. + +The results of attacking fine-tuned DeBERTa model using different techniques are shown in table 4. By applying RLI, the CACC and ASR increase by $1.72\%$ and $4.13\%$ respectively compared to the baseline model. By applying RLI and AGR, the CACC and ASR increase by $1.41\%$ and $4.94\%$ respectively compared to the baseline model. By applying RLI, AGR and TWP, the CACC just decreases $0.3\%$ and the ASR increases by $3.23\%$ with only 277 weights changed. The bit-flip number decreases 927 after pruning. + +Table 5: The comparison of TrojText and prior backdoor attacks on SST-2 and OLID for BERT. + +
ModelsClean Model (SST-2)Backdoored Model (SST-2)Clean Model (OLID)Backdoored Model (OLID)
ACC (%)ASR(%)CACC(%)ASR(%)TPNTBNACC (%)ASR(%)CACC(%)ASR(%)TPNTBN
Our baseline92.2553.9489.8187.62500200280.6678.6679.9593.875001935
RLI (TrojText-R)92.2553.9490.0590.62500207980.6678.6681.1391.275001954
+AGR (TrojText-RA)92.2553.9490.8694.10500197180.6678.6682.1997.055002006
+TWP (TrojText-RAT)92.2553.9489.8192.5915161180.6678.6680.9092.69180740
+ +SST-2. Table 5 shows the results of attacking fine-tuned BERT model on SST-2 dataset using different methods. Given changing same number of model parameters, model TrojText-R improves $0.24\%$ and $3\%$ for CACC and ASR respectively and model TrojText-RA improves $1.05\%$ and $6.48\%$ respectively for the same metrics. Model TrojText-RAT (TrojText), after pruning 349 weights in target model, keeps the same CACC but improves $4.97\%$ for ASR and changes only 151 parameters. By applying our TWP with Algorithm 1, the bit-flip number decreases 1391 after pruning. + +OLID. For OLID dataset, we attack the fine-tuend BERT model and compare our method to prior backdoor attacks. Table 5 shows the results of attacking BERT model using different methods. Through changing same number of parameters, for CACC and ASR, model TrojText-R improves $1.18\%$ and decreases $2.6\%$ respectively and model TrojText-RA improves $2.24\%$ and $3.18\%$ respectively. Model TrojText-RAT (TrojText), after pruning 320 weights in target model, improves $0.95\%$ CACC and decreases $1.18\%$ ASR respectively and changes only 180 parameters. The bit-flip number decreases 1195 after pruning. + +Table 6: The tuned bit parameters study of TrojText. + +
210 bits458 bits628 bits838 bits1046 bits2008 bits
CACC(%)80.7289.2290.0190.1290.4192.28
ASR(%)83.4294.1195.3897.5597.5798.45
+ +Table 7: The results of various Trojan pruning thresholds on AG's News. + +
eCACC (%)ASR (%)TPNTBN
092.2898.455002008
0.00592.2198.343861554
0.0191.5598.663491384
0.0590.4197.572521046
+ +# 5.2 ABLATION AND SENSITIVE STUDY + +Ablation Study. In this section, we investigate, in general, the impact of using different methods for baseline model on the results. When applying RLI, our CACC and ASR improve $2.07\%$ and $2.73\%$ respectively on average. When applying RLI and AGR, our CACC improves $3.68\%$ and ASR improves $5.39\%$ on average. When applying RLI, AGR and TWP, our CACC and ASR improve $2.04\%$ and $3.57\%$ and the bit-flip rate decreases $50.15\%$ on average. Table 9 shows the performance tradeoff with different sizes of data. From the results, we can see that RLI is a useful method for learning with lesser data. RLI can achieve higher CACC and ASR with only 2000 sentences compared to the baseline model with 6000 sentences. Moreover, our model is flexible. By tuning + +$\lambda$ in loss function and threshold $e$ , the CACC, ASR and bit-flip number will also change based on attacker's demand. + +Trojan Bits Study. In table 6, we investigate the CACC and ASR range by flipping different number of bits. We use fine-tuned BERT on AG's news dataset as victim model. We can observe that TroyText can achieve $80.72\%$ CACC and $83.42\%$ ASR when changing only 210 bits. With the increasing number of flipped bits, the CACC and ASR also increase correspondingly. The TroyText achieves $92.28\%$ CACC and $98.45\%$ ASR respectively when changing 2008 bits. + +Trojan Weights Pruning Threshold Study. When we do trojan weights pruning during backdoor training, the threshold $e$ is an important parameter that will control how many parameters will be changed and impact the CACC and ASR. In order to better investigate the effects of $e$ , we attack fine-tuned BERT model with different threshold $e$ using AG's News dataset. In table 7, we initially select 500 most important parameters and then use four different thresholds [0, 0.005, 0.01 and 0.05] separately to prune parameters. From $e = 0$ to $e = 0.005$ , the CACC and ASR just decrease $0.07\%$ and $0.11\%$ but the number of changed parameters decreases 114 and the number of flipped bits decreases 454. It shows that our Trojan Weights Pruning method can achieve fewer parameter changes and maintain accuracy. From $e = 0$ to $e = 0.05$ , the CACC and ASR decrease $1.87\%$ and $0.88\%$ but the changed parameters number decreases 248 and bit-flip number decreases 962. This will greatly reduce the difficulty of the attack. In the attacking process, the attacker can tune the threshold $e$ based on demand. + +Table 8: The performance of defense against TrojText. + +
ModelsASR(%)TPN
no defensewith defenseno defensewith defense
AG's News97.5772.8910461132
SST-292.5977.20611670
OLID92.6987.15740802
+ +Table 9: The performance tradeoff with difference sizes of datasets for BERT using AG's News. + +
Validation Data SampleBaselineRLI (TrojText-R)RLI+AGR (TrojText-RA)
CACC(%)ASR(%)CACC(%)ASR(%)CACC(%)ASR(%)
200082.0683.3789.4295.8790.3297.18
400084.5884.0790.2296.4791.7398.39
600085.6984.9890.8396.9892.3498.89
+ +Potential Defense. We propose a potential defense method again TrojanText by remarkably decreasing the ASR and increasing the attack overhead, i.e., TPN. The defense is motivated by a key observation that once important weights of benign models $\theta$ are hidden, TrojanText is difficult to efficiently identify and learn Trojan weights. Specifically, we can adopt existing methods like matrix decomposition, e.g., (Hsu et al., 2022; Lou et al., 2022; Zhong et al., 2019), to decompose $\theta$ in Equation 5 so that attackers with accumulated gradient ranking method cannot correctly identify the critical weights as before. We use Table 8 to demonstrate the results of TrojanText before and after defense. In particular, after defense, we observed that ASR of TrojanText is reduced by $5.54\% \sim 24.68\%$ and the TPN is increased by $59 \sim 86$ on three datasets. + +# 6 CONCLUSION + +In this paper, we present, TrojText, a test-time invisible Trojan attack against Transformer-based textural models. Specifically, a novel representation-logit objective function is proposed to enable TrojText to efficiently learn the syntactic structure as a trigger on small test-domain data. We adopted test-time weight-oriented Trojan attacks via bit flips in memory. The attack overhead is defined by the bit-flip numbers. For this reason, two techniques including accumulated gradients ranking and Trojan weights pruning are introduced to reduce the bit-flip numbers of the Trojan model. We perform extensive experiments of AG's News, SST-2 and OLID on BERT and XLNet. Our TrojText could classify $98.35\%$ of test sentences into target class on BERT model for AG's News data. + +# REFERENCES + +Jiawang Bai, Kuofeng Gao, Dihong Gong, Shu-Tao Xia, Zhifeng Li, and Wei Liu. Hardly perceptible trojan attack against neural networks with bit flips. arXiv preprint arXiv:2207.13417, 2022. +Lejla Batina, Shivam Bhasin, Dirmanto Jap, and Stjepan Picek. {CSI} {NN}: Reverse engineering of neural network architectures through electromagnetic side channel. In 28th USENIX Security Symposium (USENIX Security 19), pp. 515-532, 2019. +Huili Chen, Cheng Fu, Jishen Zhao, and Farinaz Koushanfar. Proflip: Targeted trojan attack with progressive bit flips. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 7718-7727, 2021a. +Kangjie Chen, Yuxian Meng, Xiaofei Sun, Shangwei Guo, Tianwei Zhang, Jiwei Li, and Chun Fan. Badpre: Task-agnostic backdoor attacks to pre-trained nlp foundation models. arXiv preprint arXiv:2110.02467, 2021b. +Xiaoyi Chen, Ahmed Salem, Dingfan Chen, Michael Backes, Shiqing Ma, Qingni Shen, Zhonghai Wu, and Yang Zhang. Badnl: Backdoor attacks against nlp models with semantic-preserving improvements. In Annual Computer Security Applications Conference, pp. 554-569, 2021c. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018. +Ming Fan, Ziliang Si, Xiaofei Xie, Yang Liu, and Ting Liu. Text backdoor detection using an interpretable rnN abstract model. IEEE Transactions on Information Forensics and Security, 16: 4117-4132, 2021. +Leilei Gan, Jiwei Li, Tianwei Zhang, Xiaoya Li, Yuxian Meng, Fei Wu, Shangwei Guo, and Chun Fan. Triggerless backdoor attack for nlp tasks with clean labels. arXiv preprint arXiv:2111.07970, 2021. +Pengcheng He, Xiaodong Liu, Jianfeng Gao, and Weizhu Chen. Deberta: Decoding-enhanced bert with disentangled attention. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=XPZIiaotutsD. +Yen-Chang Hsu, Ting Hua, Sungen Chang, Qian Lou, Yilin Shen, and Hongxia Jin. Language model compression with weighted low-rank factorization. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum?id=uPv9Y3gmAI5. +Weizhe Hua, Zhiru Zhang, and G Edward Suh. Reverse engineering convolutional neural networks through side-channel information leaks. In 2018 55th ACM/ESDA/IEEE Design Automation Conference (DAC), pp. 1-6. IEEE, 2018. +Mohit Iyyer, John Wieting, Kevin Gimpel, and Luke Zettlemoyer. Adversarial example generation with syntactically controlled paraphrase networks. arXiv preprint arXiv:1804.06059, 2018. +Yoongu Kim, Ross Daly, Jeremie Kim, Chris Fallin, Ji Hye Lee, Donghyuk Lee, Chris Wilkerson, Konrad Lai, and Onur Mutlu. Flipping bits in memory without accessing them: an experimental study of dram disturbance errors. 42:361-372, 2014. +Klemen Kotar, Gabriel Ilharco, Ludwig Schmidt, Kiana Ehsani, and Roozbeh Mottaghi. Contrasting contrastive self-supervised representation learning pipelines. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pp. 9949-9959, October 2021. +Keita Kurita, Paul Michel, and Graham Neubig. Weight poisoning attacks on pre-trained models. arXiv preprint arXiv:2004.06660, 2020. +Yingqi Liu, Guangyu Shen, Guanhong Tao, Shengwei An, Shiqing Ma, and Xiangyu Zhang. Piccolo: Exposing complex backdoors in nlp transformer models. In 2022 IEEE Symposium on Security and Privacy (SP), pp. 1561-1561. IEEE Computer Society, 2022. + +Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692, 2019. +Qian Lou, Ting Hua, Yen-Chang Hsu, Yilin Shen, and Hongxia Jin. Dictformer: Tiny transformer with shared dictionary. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum?id=GWQWAeE9EpB. +Fanchao Qi, Yangyi Chen, Xurui Zhang, Mukai Li, Zhiyuan Liu, and Maosong Sun. Mind the style of text! adversarial and backdoor attacks based on text style transfer. arXiv preprint arXiv:2110.07139, 2021a. +Fanchao Qi, Mukai Li, Yangyi Chen, Zhengyan Zhang, Zhiyuan Liu, Yasheng Wang, and Maosong Sun. Hidden killer: Invisible textual backdoor attacks with syntactic trigger. arXiv preprint arXiv:2105.12400, 2021b. +Adnan Siraj Rakin, Zhezhi He, and Deliang Fan. Bit-flip attack: Crushing neural network with progressive bit search. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), pp. 1211-1220, 2019. +Adnan Siraj Rakin, Zhezhi He, and Deliang Fan. Tbt: Targeted neural network attack with bit trojan. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 13198-13207, 2020. +Kun Shao, Junan Yang, Yang Ai, Hui Liu, and Yu Zhang. Baddr: An effective defense against textual backdoor attacks. Computers & Security, 110:102433, 2021. +Lujia Shen, Shouling Ji, Xuhong Zhang, Jinfeng Li, Jing Chen, Jie Shi, Chengfang Fang, Jianwei Yin, and Ting Wang. Backdoor pre-trained models can transfer to all. arXiv preprint arXiv:2111.00197, 2021. +Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D. Manning, Andrew Ng, and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pp. 1631-1642, October 2013. +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017. +Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumont, Clement Delangue, Anthony Moi, Pierrick Cistac, Tim Rault, Rémi Louf, Morgan Funtowicz, Joe Davison, Sam Shleifer, Patrick von Platen, Clara Ma, Yacine Jernite, Julien Plu, Canwen Xu, Teven Le Scao, Sylvain Gugger, Mariama Drame, Quentin Lhoest, and Alexander M. Rush. Transformers: State-of-the-art natural language processing. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pp. 38-45, October 2020. +Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Russ R Salakhutdinov, and Quoc V Le. Xlnet: Generalized autoregressive pretraining for language understanding. Advances in neural information processing systems, 32, 2019. +Marcos Zampieri, Shervin Malmasi, Preslav Nakov, Sara Rosenthal, Noura Farra, and Ritesh Kumar. Predicting the Type and Target of Offensive Posts in Social Media. In Proceedings of NAACL, 2019. +Xiang Zhang, Junbo Zhao, and Yann LeCun. Character-level convolutional networks for text classification. Advances in neural information processing systems, 28, 2015. +Xinyang Zhang, Zheng Zhang, Shouling Ji, and Ting Wang. Trojaning language models for fun and profit. In 2021 IEEE European Symposium on Security and Privacy (EuroS&P), pp. 179-197. IEEE, 2021. +Mengxin Zheng, Qian Lou, and Lei Jiang. Trojvit: Trojan insertion in vision transformers. arXiv preprint arXiv:2208.13049, 2022. + +Zhisheng Zhong, Fangyin Wei, Zhouchen Lin, and Chao Zhang. Ada-tucker: Compressing deep neural networks via adaptive dimension adjustment tucker decomposition. Neural Networks, 110: 104-115, 2019. \ No newline at end of file diff --git a/trojtexttesttimeinvisibletextualtrojaninsertion/images.zip b/trojtexttesttimeinvisibletextualtrojaninsertion/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..dcf76688f536480c600ea7fcb29ebff851751027 --- /dev/null +++ b/trojtexttesttimeinvisibletextualtrojaninsertion/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d68cec56ea5e562ebd15a4266927de5ba16316572792f1742e8efcd985ec07bf +size 368628 diff --git a/trojtexttesttimeinvisibletextualtrojaninsertion/layout.json b/trojtexttesttimeinvisibletextualtrojaninsertion/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..1b02e0c662d938c97fc5b221c81e35fdeb588014 --- /dev/null +++ b/trojtexttesttimeinvisibletextualtrojaninsertion/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dfce9fe0f953bdcbf1f89664d53317ba9039adffb6ceffb45418f0b967dc3b8d +size 411038 diff --git a/truncateddiffusionprobabilisticmodelsanddiffusionbasedadversarialautoencoders/c36693f9-9299-4bac-99dc-c6176c21e93a_content_list.json b/truncateddiffusionprobabilisticmodelsanddiffusionbasedadversarialautoencoders/c36693f9-9299-4bac-99dc-c6176c21e93a_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a700f8b1ce7823f6f62f191b3f8eebef5b0bffbf --- /dev/null +++ b/truncateddiffusionprobabilisticmodelsanddiffusionbasedadversarialautoencoders/c36693f9-9299-4bac-99dc-c6176c21e93a_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:50001c050f9c335e5b83e8c7e9b2ffeae99bd13d8ff90049f33c0ed3aaed5e59 +size 164647 diff --git a/truncateddiffusionprobabilisticmodelsanddiffusionbasedadversarialautoencoders/c36693f9-9299-4bac-99dc-c6176c21e93a_model.json b/truncateddiffusionprobabilisticmodelsanddiffusionbasedadversarialautoencoders/c36693f9-9299-4bac-99dc-c6176c21e93a_model.json new file mode 100644 index 0000000000000000000000000000000000000000..298874dab3050e2d82ed93e8215c7dfa7674bd7e --- /dev/null +++ b/truncateddiffusionprobabilisticmodelsanddiffusionbasedadversarialautoencoders/c36693f9-9299-4bac-99dc-c6176c21e93a_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:123943088c4a23be9fd5c146299a1b7bb57b5dd295c2915700ab41bfe374e75f +size 196668 diff --git a/truncateddiffusionprobabilisticmodelsanddiffusionbasedadversarialautoencoders/c36693f9-9299-4bac-99dc-c6176c21e93a_origin.pdf b/truncateddiffusionprobabilisticmodelsanddiffusionbasedadversarialautoencoders/c36693f9-9299-4bac-99dc-c6176c21e93a_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..584b97fa93133a83dd8cabd3660deae773f535a9 --- /dev/null +++ b/truncateddiffusionprobabilisticmodelsanddiffusionbasedadversarialautoencoders/c36693f9-9299-4bac-99dc-c6176c21e93a_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:866f878461ade9206ede546615bdccb9e66743ae9046902ef82c0df90de6acc2 +size 35690626 diff --git a/truncateddiffusionprobabilisticmodelsanddiffusionbasedadversarialautoencoders/full.md b/truncateddiffusionprobabilisticmodelsanddiffusionbasedadversarialautoencoders/full.md new file mode 100644 index 0000000000000000000000000000000000000000..c1749bd0c023011e5c41bd811c2d00e810cf3409 --- /dev/null +++ b/truncateddiffusionprobabilisticmodelsanddiffusionbasedadversarialautoencoders/full.md @@ -0,0 +1,620 @@ +# TRUNCATED DIFFUSION PROBABILISTIC MODELS AND DIFFUSION-BASED ADVERSARIAL AUTO-ENCODERS + +Huangjie Zheng $^{1,2}$ & Pengcheng He $^{2}$ & Weizhu Chen $^{2}$ & Mingyuan Zhou $^{1}$ + +The University of Texas at Austin1, Microsoft Azure AI2 + +huangjie.zheng@utexas.edu, penhe@microsoft.com, + +wzchen@microsoft.com, mingyuan.zhou@mccombs.utexas.edu + +# ABSTRACT + +Employing a forward diffusion chain to gradually map the data to a noise distribution, diffusion-based generative models learn how to generate the data by inferring a reverse diffusion chain. However, this approach is slow and costly because it needs many forward and reverse steps. We propose a faster and cheaper approach that adds noise not until the data become pure random noise, but until they reach a hidden noisy-data distribution that we can confidently learn. Then, we use fewer reverse steps to generate data by starting from this hidden distribution that is made similar to the noisy data. We reveal that the proposed model can be cast as an adversarial auto-encoder empowered by both the diffusion process and a learnable implicit prior. Experimental results show even with a significantly smaller number of reverse diffusion steps, the proposed truncated diffusion probabilistic models can provide consistent improvements over the non-truncated ones in terms of performance in both unconditional and text-guided image generations. + +# 1 INTRODUCTION + +Generating photo-realistic images with probabilistic models is a challenging and important task in machine learning and computer vision, with many potential applications in data augmentation, image editing, style transfer, etc. Recently, a new class of image generative models based on diffusion processes (Sohl-Dickstein et al., 2015) has achieved remarkable results on various commonly used image generation benchmarks (Song & Ermon, 2019; Ho et al., 2020; Song & Ermon, 2020; Song et al., 2021b; Dhariwal & Nichol, 2021), surpassing many existing deep generative models, such as autoregressive models (van den Oord et al., 2016), variational auto-encoders (VAEs) (Kingma & Welling, 2013; Rezende et al., 2014; van den Oord et al., 2017; Razavi et al., 2019), and generative adversarial networks (GANs) (Goodfellow et al., 2014; Radford et al., 2015; Arjovsky et al., 2017; Miyato et al., 2018; Brock et al., 2019; Karras et al., 2019; 2020b). + +This new modeling class, which includes both score-based and diffusion-based generative models, uses noise injection to gradually corrupt the data distribution into a simple noise distribution that can be easily sampled from, and then uses a denoising network to reverse the noise injection to generate photo-realistic images. From the perspective of score matching (Hyvärinen & Dayan, 2005; Vincent, 2011) and Langevin dynamics (Neal, 2011; Welling & Teh, 2011), the denoising network is trained by matching the score function, which is the gradient of the log-density of the data, of the corrupted data distribution and that of the generator distribution at different noise levels (Song & Ermon, 2019). This training objective can also be formulated under diffusion-based generative models (Sohl-Dickstein et al., 2015; Ho et al., 2020). These two types of models have been further unified by Song et al. (2021b) under the framework of discretized stochastic differential equations. + +Despite their impressive performance, diffusion-based (or score-based) generative models suffer from high computational costs, both in training and sampling. This is because they need to perform a large number of diffusion steps, typically hundreds or thousands, to ensure that the noise injection is small enough at each step to make the assumption that both the diffusion and denoising processes have the Gaussian form hold in the limit of small diffusion rate (Feller, 1949; Sohl-Dickstein et al., 2015). In other words, when the number of diffusion steps is small or when the rate is large, the Gaussian assumption may not hold well, and the model may not be able to capture the true score function + +![](images/a19249ca540c55281eecb98e5c2c86927e5ca95efb002c05ce686ceaea6f4462.jpg) +Figure 1: (Best viewed in color) An illustrative depiction of diffusion models and our truncated diffusion models. Top: The conventional denoising diffusion models add Gaussian noise gradually with a large number of time steps, where the true posterior can be kept close to Gaussian and hence easy to fit with denoising (score-matching) loss (marked in a solid blue box). Bottom: Truncated diffusion models truncate the diffusion chain to keep its first few steps and small diffusion segment (marked in the dashed blue box). This truncated diffusion chain can still be learned with previous denoising methods. Meanwhile, as the left part is truncated, the Gaussian prior $p(\mathbf{x}_T)$ will have a large gap to the truncated point $q(\mathbf{x}_T|\mathbf{x}_0)$ , which is bridged with an implicit generative distribution $p_{\psi}(\mathbf{x}_T) = \int p_{\psi}(\mathbf{x}_T|\mathbf{z})p(\mathbf{z})d\mathbf{z}$ (marked in dashed red box). + +of the data. Therefore, previous works have tried to reduce the number of diffusion steps by using non-Markovian reverse processes (Song et al., 2020; Kong & Ping, 2021), adaptive noise scheduling (San-Roman et al., 2021; Kingma et al., 2021), knowledge distillation (Luhman & Luhman, 2021; Salimans & Ho, 2022), diffusing in a lower-dimension latent space (Rombach et al., 2022), etc., but they still cannot achieve significant speedup without sacrificing the generation quality. + +In this paper, we propose a novel way to shorten the diffusion trajectory by learning an implicit distribution to start the reverse diffusion process, instead of relying on a tractable noise distribution. We call our method truncated diffusion probabilistic modeling (TDPM), which is based on the idea of truncating the forward diffusion chain of an existing diffusion model, such as the denoising diffusion probabilistic model (DDPM) of Ho et al. (2020). To significantly accelerate diffusion-based text-to-image generation, we also introduce the truncated latent diffusion model (TLDM), which truncates the diffusion chain of the latent diffusion model (LDM) of Rombach et al. (2022). We note LDM is the latent text-to-image diffusion model behind Stable Diffusion, an open-source project that provides state-of-the-art performance in generating photo-realistic images given text input. By truncating the chain, we can reduce the number of diffusion steps to an arbitrary level, but at the same time, we also lose the tractability of the distribution at the end of the chain. Therefore, we need to learn an implicit generative distribution that can approximate this distribution and provide the initial samples for the reverse diffusion process. We show that this implicit generative distribution can be implemented in different ways, such as using a separate generator network or reusing the denoising network. The former option has more flexibility and can improve the generation quality, while the latter option has no additional parameters and can achieve comparable results. + +We reveal that DDPM and VAE have a similar relationship as TDPM and adversarial auto-encoder (AAE, Makhzani et al. (2015)). Specifically, DDPM is like a VAE with a fixed encoder and a learnable decoder that use a diffusion process, and a predefined prior. TDPM is like an AAE with a fixed encoder and a learnable decoder that use a truncated diffusion process, and a learnable implicit prior. + +Our truncation method has several advantages when we use it to modify DDPM for generating images without text guidance or LDM for generating images with text guidance. First, it can generate samples much faster by using fewer diffusion steps, without sacrificing or even enhancing the generation quality. Second, it can exploit the cooperation between the implicit model and the diffusion model, as the diffusion model helps the implicit model train by providing noisy data samples, and the implicit model helps the diffusion model reverse by providing better initial samples. Third, it can adapt the truncation level to balance the generation quality and efficiency, depending on the data complexity and the computational resources. For generating images with text guidance, our method can speed up the generation significantly and make it suitable for real-time processing: while LDM takes the time to generate one photo-realistic image, our TLDM can generate more than 50 such images. + +The main contributions of our paper are as follows: + +- We introduce TDPM, a new diffusion-based generative model that can shorten the diffusion trajectory by learning an implicit distribution to start the reverse diffusion process, and demonstrate that the learning of the implicit distribution can be achieved in various ways. We further introduce TLDM to significantly accelerate diffusion-based text-to-image generation. +- We show TDPM can be formulated as a diffusion-based AAE. +- We show that the implicit distribution can be realized by reusing the denoising network for the reverse diffusion process, which can reduce the reverse diffusion steps by orders of magnitude without adding any extra parameters and with comparable generation quality. +- We reveal the synergy between the implicit model and the diffusion model, as the diffusion process can simplify the training of the implicit model like GANs, and the implicit model can speed up the reverse diffusion process of the diffusion model. +- We show that both TDPM and TLDM can adapt the truncation level, according to the data complexity and the computational resources, to achieve a good balance between the generation quality and the efficiency. + +# 2 PRELIMINARIES ON DIFFUSION MODELS + +In Gaussian diffusion models (Sohl-Dickstein et al., 2015; Ho et al., 2020), starting from the data distribution $\mathbf{x}_0\sim q(\mathbf{x}_0)$ , a pre-defined forward diffusion process $q_{t}$ produces auxiliary variables $\mathbf{x}_{t = 1:T}$ by gradually adding Gaussian noise, with variance $\beta_t\in (0,1)$ at time $t$ , as follows: + +$$ +q \left(\mathbf {x} _ {1}, \dots , \mathbf {x} _ {T} \mid \mathbf {x} _ {0}\right) := \prod_ {t = 1} ^ {T} q \left(\mathbf {x} _ {t} \mid \mathbf {x} _ {t - 1}\right), \quad q \left(\mathbf {x} _ {t} \mid \mathbf {x} _ {t - 1}\right) := \mathcal {N} \left(\mathbf {x} _ {t}; \sqrt {1 - \beta_ {t}} \mathbf {x} _ {t - 1}, \beta_ {t} \boldsymbol {I}\right). \tag {1} +$$ + +With the limit of small diffusion rate (i.e., $\beta_{t}$ is kept sufficiently small), the reverse distribution $q(\mathbf{x}_{t - 1}|\mathbf{x}_t)$ also follows a Gaussian distribution (Feller, 1949; Sohl-Dickstein et al., 2015) and can be approximated using a neural network parameterized Gaussian distribution $p_{\theta}$ as: + +$$ +p _ {\theta} \left(\mathbf {x} _ {t - 1} \mid \mathbf {x} _ {t}\right) := \mathcal {N} \left(\mathbf {x} _ {t - 1}; \mu_ {\theta} \left(\mathbf {x} _ {t}, t\right), \Sigma_ {\theta} \left(\mathbf {x} _ {t}, t\right)\right). \tag {2} +$$ + +Moreover, with a sufficiently large $T$ , the outcome of the diffusion chain $\mathbf{x}_T$ will follow an isotropic Gaussian distribution. Thus, with the pre-defined forward (inference) diffusion process and the learned reverse (generative) diffusion process, we can sample from $\mathbf{x}_T \sim \mathcal{N}(\mathbf{0},\mathbf{I})$ and run the diffusion process in reverse to get a sample from the data distribution $q(\mathbf{x}_0)$ . + +Under the variational inference (Kingma & Welling, 2013; Blei et al., 2017) framework, viewing $q(\mathbf{x}_1,\dots,\mathbf{x}_T\mid \mathbf{x}_0)$ in (1) as the inference network, we can use the evidence lower bound (ELBO) as our learning objective. Following previous works (Sohl-Dickstein et al., 2015; Ho et al., 2020), the negative ELBO of a diffusion probabilistic model, parameterized by $\theta$ , can be expressed as + +$$ +\mathcal {L} _ {\mathrm {E L B O}} (\theta) := \mathcal {L} _ {0} (\theta) + \sum_ {t = 2} ^ {T} \mathcal {L} _ {t - 1} (\theta) + \mathcal {L} _ {T}, \quad \mathcal {L} _ {0} (\theta) := \mathbb {E} _ {q (\mathbf {x} _ {0})} \mathbb {E} _ {q (\mathbf {x} _ {1} | \mathbf {x} _ {0})} [ - \log p _ {\theta} (\mathbf {x} _ {0} | \mathbf {x} _ {1}) ], \tag {3} +$$ + +$$ +\mathcal {L} _ {t - 1} (\theta) := \mathbb {E} _ {q \left(\mathbf {x} _ {0}\right)} \mathbb {E} _ {q \left(\mathbf {x} _ {t} \mid \mathbf {x} _ {0}\right)} \left[ D _ {\mathrm {K L}} \left(q \left(\mathbf {x} _ {t - 1} \mid \mathbf {x} _ {t}, \mathbf {x} _ {0}\right) \mid \mid p _ {\theta} \left(\mathbf {x} _ {t - 1} \mid \mathbf {x} _ {t}\right)\right) \right], \quad t \in \{2, \dots , T \} \tag {4} +$$ + +$$ +\mathcal {L} _ {T} := \mathbb {E} _ {q \left(\mathbf {x} _ {0}\right)} \left[ D _ {\mathrm {K L}} \left(q \left(\mathbf {x} _ {T} \mid \mathbf {x} _ {0}\right) \mid \mid p \left(\mathbf {x} _ {T}\right)\right) \right], \tag {5} +$$ + +where $D_{\mathrm{KL}}(q||p) = \mathbb{E}_q[\log q - \log p]$ denotes the Kullback-Leibler (KL) divergence from distributions $p$ to $q$ . Generally speaking, diffusion probabilistic models assume the number of diffusion steps $T$ to be sufficiently large to satisfy two conditions: 1) the reverse distribution at each denoising step can be fitted with a Gaussian denoising generator $p_{\theta}(\mathbf{x}_{t-1}|\mathbf{x}_t)$ ; 2) with a sufficiently small diffusion rate $\beta_t$ , the long forward diffusion process will successfully corrupt the data, making $q(\mathbf{x}_T|\mathbf{x}_0) \approx \mathcal{N}(\mathbf{0},\mathbf{I})$ , and hence approximately $L_T$ becomes zero and depends on neither $\mathbf{x}_0$ nor $\theta$ . + +What happens if $T$ is insufficiently large? Given a non-Gaussian data distribution $q(\mathbf{x}_0)$ , when the number of denoising steps is reduced, the true posterior $q(\mathbf{x}_{t - 1}|\mathbf{x}_t)$ is not Gaussian and usually intractable (Feller, 1949), resulting in new challenges to current diffusion models. As noted in Xiao et al. (2022), when $\beta_{t}$ is not sufficiently small, the diffusion step becomes larger and the denoising distribution can be multi-modal and hence too complex to be well fitted by Gaussian. The authors propose to define $p_{\theta}(\mathbf{x}_{t - 1}|\mathbf{x}_t)$ with an implicit generator and substitute the ELBO with + +$$ +\min _ {\theta} \sum_ {t \geq 1} \mathbb {E} _ {q (t)} \left[ D _ {\mathrm {a d v}} \left(q \left(\mathbf {x} _ {t - 1} \mid \mathbf {x} _ {t}\right) \| p _ {\theta} \left(\mathbf {x} _ {t - 1} \mid \mathbf {x} _ {t}\right)\right) \right], \tag {6} +$$ + +where $D_{\mathrm{adv}}$ represents a statistical distance that relies on an adversarial training setup. This modified objective can be minimized by leveraging the power of conditional GANs in fitting implicit multimodal distributions (Arjovsky et al., 2017; Goodfellow et al., 2014; Nowozin et al., 2016). While the concept of diffusion has been used, the proposed models in Xiao et al. (2022) are shown to work the best only when the number of diffusion steps is limited to be as few as four, and start to exhibit deteriorated performance when further increasing that number. + +# 3 TRUNCATED DIFFUSION AND ADVERSARIAL AUTO-ENCODING + +We first introduce the idea of accelerating both the training and generation of diffusion models by truncating the diffusion chains and describe the technical challenges. We then develop the objective function and training algorithm for TDPM. We further reveal TDPM can also be formulated as an AAE (Makhzani et al., 2015)) empowered by diffusion models. While DDPM can be considered as a hierarchical version of a variational auto-encoder (VAE) with a fixed multi-stochastic-layer encoder, our derivation shows that TDPM can be considered as a hierarchical version of an AAE with a fixed multi-stochastic-layer encoder but a learnable implicit prior. + +# 3.1 MOTIVATION AND TECHNICAL CHALLENGES + +We propose a novel method called TDPM to speed up the diffusion process and the generative model. The main idea is to shorten the forward diffusion chain that transforms the data into Gaussian noise, and use a learned implicit distribution to sample the starting point of the reverse diffusion chain that reconstructs the data. To be more precise, we adopt the DDPM framework that defines a variance schedule $\{\beta_{1},\beta_{2},\dots,\beta_{T}\}$ , which controls the amount of noise added at each step of the forward diffusion process. The forward process has a simple analytical form as a Gaussian distribution: + +$$ +q \big (\mathbf {x} _ {t} \mid \mathbf {x} _ {0} \big) = \mathcal {N} \big (\sqrt {\bar {\alpha} _ {t}} \mathbf {x} _ {0}, (1 - \bar {\alpha} _ {t}) I \big); \quad \bar {\alpha} _ {t} = \prod_ {i = 1} ^ {t} \alpha_ {i}, \alpha_ {i} = 1 - \beta_ {i}. +$$ + +Here, $\mathbf{x}_t$ is the noisy version of the data $\mathbf{x}_0$ at step $t$ , and $\bar{\alpha}_t$ is the cumulative product of the diffusion coefficients $\alpha_i$ . The forward chain of length $T$ is designed to be long enough to make the data distribution indistinguishable from Gaussian noise $\mathcal{N}(\mathbf{0},\mathbf{I})$ . However, a long forward chain also implies a high computational cost for the reverse process, which uses a learned neural network to predict the conditional distribution of the clean data given the noisy one at each step. + +The proposed TDPM cuts off the last part of the forward chain and only keeps the first $T_{\mathrm{trunc}}$ steps $\{\beta_1, \beta_2, \dots, \beta_{T_{\mathrm{trunc}}} \} \subset \{\beta_1, \beta_2, \dots, \beta_T\}$ . We choose $T_{\mathrm{trunc}}$ to be much smaller than $T$ so that we can save a lot of computation time in generation. The benefit of this truncation is illustrated in Figure 1, where the bottom row shows the truncated diffusion chain. We can see that the data are only partially corrupted by noise and still retain some features of the original data. This means that we can recover the data more easily and accurately by applying a few Gaussian denoising steps from the corrupted data. Moreover, we do not change the diffusion rates $\beta_t$ for the first $T_{\mathrm{trunc}}$ steps, so we do not compromise the quality of the forward and reverse processes between time 0 and $T_{\mathrm{trunc}}$ . + +However, truncating the forward chain also introduces a new challenge for the reverse process. Unlike the original chain, where the starting point of the reverse process is $\mathbf{x}_T \sim \mathcal{N}(\mathbf{0}, \mathbf{I})$ , the truncated chain has an unknown distribution of the corrupted data at step $T_{\mathrm{trunc}}$ . This makes it difficult to sample from this distribution and initiate the reverse process. To overcome this challenge, we introduce an implicit generative model that approximates the distribution of the corrupted data by minimizing a divergence measure between the implicit and the true noisy distributions at step $T_{\mathrm{trunc}}$ . This way, we can use the implicit model to sample the starting point of the reverse process and then apply the learned denoising network to generate the data. + +# 3.2 HAND-CRAFTED TDPM OBJECTIVE FUNCTION + +Mathematically, recall that the DDPM loss in (3) consists of three terms: $\mathcal{L}_0$ , $\sum_{t=2}^{T}\mathcal{L}_{t-1}$ , and $\mathcal{L}_T$ . The training objective of a conventional diffusion model focuses on terms $\sum_{t=2}^{T}\mathcal{L}_{t-1}$ and $\mathcal{L}_0$ . It assumes $\mathcal{L}_T$ does not depend on any parameter and will be close to zero by carefully pre-defining the forward noising process such that $q(\mathbf{x}_T|\mathbf{x}_0)\approx p(\mathbf{x}_T) = \mathcal{N}(\mathbf{0},\mathbf{I})$ . + +When the diffusion chains are truncated at time $T_{\mathrm{trunc}} \ll T$ , the forward diffusion ends at time $T_{\mathrm{trunc}}$ where the marginal distribution of the forward diffusion-corrupted data can be expressed as + +$$ +q \left(\mathbf {x} _ {T _ {\text {t r u n c}}}\right) := \int q \left(\mathbf {x} _ {T _ {\text {t r u n c}}} \mid \mathbf {x} _ {0}\right) p \left(\mathbf {x} _ {0}\right) d \mathbf {x} _ {0}, \tag {7} +$$ + +which takes a semi-implicit form (Yin & Zhou, 2018) whose density function is often intractable. To reverse this truncated forward diffusion chain, we can no longer start the reverse diffusion chain from a known distribution such as $\mathcal{N}(\mathbf{0},\mathbf{I})$ . To this end, we propose TDPM that starts the reverse chain at time $T_{\mathrm{trunc}}$ from $p_{\psi}(\mathbf{x}_{T_{\mathrm{trunc}}})$ , an implicit distribution parameterized by $\psi$ . We match $p_{\psi}(\mathbf{x}_{T_{\mathrm{trunc}}})$ to $q(\mathbf{x}_{T_{\mathrm{trunc}}})$ via a loss term as $\tilde{\mathcal{L}}_{T_{\mathrm{trunc}}} \coloneqq \mathcal{D}(q(\mathbf{x}_{T_{\mathrm{trunc}}})||p_{\psi}(\mathbf{x}_{T_{\mathrm{trunc}}}))$ , where $\mathcal{D}(q||p)$ is a statistical distance between distributions $q$ and $p$ , such as the Jensen-Shannon divergence and Wasserstein distance. As we keep all the diffusion steps before time $T_{\mathrm{trunc}}$ in TDPM the same as those in DDPM, we combine $\tilde{\mathcal{L}}_{T_{\mathrm{trunc}}}^*$ with all the loss terms of DDPM before time $T_{\mathrm{trunc}}$ in (3) to define the TDPM loss as + +$$ +\mathcal {L} _ {\mathrm {T D P M}} := \sum_ {t = 1} ^ {T _ {\text {t r u n c}}} \mathcal {L} _ {t - 1} (\theta) + \tilde {\mathcal {L}} _ {T _ {\text {t r u n c}}} (\psi), \quad \tilde {\mathcal {L}} _ {T _ {\text {t r u n c}}} (\psi) := \mathcal {D} (q (\mathbf {x} _ {T _ {\text {t r u n c}}}) \| p _ {\psi} (\mathbf {x} _ {T _ {\text {t r u n c}}})) \tag {8} +$$ + +We note while in general $p_{\psi}(\mathbf{x}_{T_{\mathrm{trunc}}})$ in TDPM is intractable, we can employ a deep neural network-based generator $G_{\psi}$ to generate a random sample in a single step via + +$$ +\mathbf {x} _ {T _ {\text {t r u n c}}} = G _ {\psi} (\mathbf {z}), \mathbf {z} \sim \mathcal {N} (\mathbf {0}, I). \tag {9} +$$ + +We will discuss later that we may simply let $\psi = \theta$ to avoid adding more parameters. + +# 3.3 TDPM AS DIFFUSION-BASED ADVERSARIAL AUTO-ENCODER + +Following the terminology of AAE, let us define the prior as $p_{\psi}(\mathbf{x}_{T_{\mathrm{trunc}}})$ , the decoder (likelihood) as + +$$ +p _ {\theta} \left(\mathbf {x} _ {0} \mid \mathbf {x} _ {T _ {\text {t r u n c}}}\right) := \int \dots \int \left[ \prod_ {t = 1} ^ {T _ {\text {t r u n c}}} p _ {\theta} \left(\mathbf {x} _ {t - 1} \mid \mathbf {x} _ {t}\right) \right] d \mathbf {x} _ {T _ {\text {t r u n c}} - 1} \dots d \mathbf {x} _ {1}, \tag {10} +$$ + +which is empowered by a reverse diffusion chain of length $T_{\mathrm{trunc}}$ , and the encoder (variational posterior) as $q(\mathbf{x}_{T_{\mathrm{trunc}}}\mid \mathbf{x}_0)$ . Thus we can view $q(\mathbf{x}_{T_{\mathrm{trunc}}})$ defined in (7) as the aggregated posterior (Hoffman & Johnson, 2016; Tomczak & Welling, 2018). In addition to imposing an auto-encoding data-reconstruction loss, the key idea of the AAE (Makhzani et al., 2015) is to also match the aggregated posterior to a fixed prior. This idea differs AAE from a VAE that regularizes the autoencoder by matching the variational posterior to a fixed prior under the KL divergence. To this end, we introduce a diffusion-based AAE (Diffusion-AAE), whose loss function is defined as + +$$ +\mathcal {L} _ {\text {D i f f u s i o n - A A E}} = - \mathbb {E} _ {q (\mathbf {x} _ {0})} \mathbb {E} _ {q (\mathbf {x} _ {T _ {\text {t r u n c}}} \mid \mathbf {x} _ {0})} \log p _ {\theta} (\mathbf {x} _ {0} \mid \mathbf {x} _ {T _ {\text {t r u n c}}}) + \mathcal {D} (q (\mathbf {x} _ {T _ {\text {t r u n c}}})) \| p _ {\psi} (\mathbf {x} _ {T _ {\text {t r u n c}}}). \tag {11} +$$ + +Diffusion-AAE has two notable differences from a vanilla AAE: 1) its encoder is fixed and has no learnable parameters, while its prior is not fixed and is optimized to match the aggregated posterior, and 2) its decoder is a reverse diffusion chain, with $T_{\mathrm{trunc}}$ stochastic layers all parameterized by $\theta$ . + +Note in general as the likelihood in (10) is intractable, the first loss term in (11) is intractable. However, the loss of Diffusion-AAE is upper bounded by the loss of TDPM, as described below. + +Theorem 1. The Diffusion-AAE loss in (11) is upper bounded by the TDPM loss in (8): + +$$ +\mathcal {L} _ {\text {D i f f u s i o n - A A E}} \leq \mathcal {L} _ {\text {T D P M}}. +$$ + +# 3.4 MATCHING THE PRIOR TO AGGREGATED POSTERIOR + +Via the loss term $\tilde{\mathcal{L}}_{T_{\mathrm{trunc}}} \coloneqq \mathcal{D}\left(q(\mathbf{x}_{T_{\mathrm{trunc}}})||p_{\psi}(\mathbf{x}_{T_{\mathrm{trunc}}})\right)$ in (8), we aim to match the prior $p_{\psi}(\mathbf{x}_{T_{\mathrm{trunc}}})$ to the aggregated posterior $q(\mathbf{x}_{T_{\mathrm{trunc}}})$ in TDPM. While we have an analytic density function for neither $p$ nor $q$ , we can easily draw random samples from both of them. Thus, we explore the use of two different types of statistical distances that can be estimated from samples of both $q$ and $p$ . We empirically show that TDPM can achieve good performance regardless of which distance is used for optimization. + +One possible statistical distance is based on the idea of GANs (Goodfellow et al., 2014; Arjovsky et al., 2017; Binkowski et al., 2018), which are widely used to learn implicit distributions from empirical data. In this setting, we use a generator $G_{\psi}(\cdot):\mathbb{R}^d\to \mathbb{R}^d$ to transform samples from an isotropic Gaussian $p(\mathbf{z})$ into samples that approximate the corrupted data, and a discriminator $D_{\phi}(\cdot):\mathbb{R}^{d}\rightarrow [0,1]$ to distinguish between the samples from the corrupted data distribution $q(\mathbf{x}_{T_{\mathrm{trunc}}}\mid \mathbf{x}_0)$ and the implicit generative distribution $p_{\psi}(\mathbf{x}_{T_{\mathrm{truc}}})$ . The generator and the discriminator are trained by the following objective $\mathcal{L}_{T_{\mathrm{truc}}}^{\mathrm{GAN}}$ : + +$$ +\min _ {\psi} \max _ {\phi} \mathbb {E} _ {\mathbf {x} \sim q \left(\mathbf {x} _ {T _ {\text {t r u n c}}}\right)} \left[ \log D _ {\phi} (\mathbf {x}) \right] + \mathbb {E} _ {\mathbf {z} \sim p (\mathbf {z})} \left[ \log \left(1 - D _ {\phi} \left(G _ {\psi} (\mathbf {z}))\right)\right) \right]. \tag {12} +$$ + +# 3.5 TRAINING ALGORITHM + +As the objective in Equation 8 is a sum of different terms, following DDPM (Ho et al., 2020) to fix the terms $\Sigma_{\theta}(x_t,t) = \sigma_t^2 I$ , we can simplify $\frac{1}{T_{\mathrm{trunc}}}\sum_{t=1}^{T_{\mathrm{trunc}}}\mathcal{L}_{t-1}$ as an expectation defined as + +$$ +\mathcal {L} _ {\text {s i m p l e} \_ \text {t r u n c}} = \mathbb {E} _ {t, \mathbf {x} _ {0}, \epsilon_ {t}} \left[ \left| \left| \epsilon_ {t} - \epsilon_ {\theta} (\mathbf {x} _ {t}, t) \right| \right| ^ {2} \right], t \sim \operatorname {U n i f} (1, 2, \dots , T _ {\text {t r u n c}}), \epsilon_ {t} \sim \mathcal {N} (\mathbf {0}, I) \tag {13} +$$ + +where $\epsilon_{t}$ is an injected noise at a uniformly sampled timestep index $t$ , $\mathbf{x}_t = \sqrt{\bar{\alpha}_t}\mathbf{x}_0 + \sqrt{1 - \bar{\alpha}_t}\epsilon_t$ is a noisy image at time $t$ , and $\epsilon_{\theta}$ is a denoising U-Net that predicts the noise in order to refine the noisy image $\mathbf{x}_t$ . Therefore the final simplified version of (8) is constructed as + +$$ +\mathcal {L} _ {\text {T D P M}} ^ {\text {G A N}} = \mathcal {L} _ {\text {s i m p l e - t r u n c}} + \lambda \mathcal {L} _ {\text {T r u n c}} ^ {\text {G A N}}. \tag {14} +$$ + +While $\lambda$ , the weight of $\mathcal{L}_{T_{\mathrm{trunc}}}$ , can be tuned, we fix it as one for simplicity. Here the TDPM objective consists of two parts: the denoising part $\epsilon_{\theta}$ is focused on denoising the truncated chain, getting updated from $\mathcal{L}_{\mathrm{simple\_trunc}}$ , while the implicit part $G_{\psi}$ is focused on minimizing $\mathbb{E}_q[\mathcal{D}(q(\mathbf{x}_{T_{\mathrm{trunc}}})||p_{\psi}(\mathbf{x}_{T_{\mathrm{trunc}}}))]$ , getting updated from $\mathcal{L}_{T_{\mathrm{trunc}}}^{\mathrm{GAN}}$ . + +An interesting finding of this paper is that we do not necessarily need to introduce a separate set of parameters $\psi$ for the generator $G_{\psi}$ , as we can simply reuse the same parameters $\theta$ of the reverse diffusion model (i.e., let $\psi = \theta$ ) without clearly hurting the empirical performance. This suggests that the reverse diffusion process from $T$ to $T_{\mathrm{trunc}}$ could be effectively approximated by a single step using the same network architecture and parameters as the reverse diffusion steps from $T_{\mathrm{trunc}}$ to 0. + +Therefore, we provide two configurations to parameterize the implicit distributions. 1) To save parameters, we let the implicit generator and denoising model share the same U-Net parameters but using different time step indices. Specifically, we first use $\mathbf{x}_{T_{\mathrm{trunc}}} = G_{\psi}(\mathbf{x}_T) = \epsilon_\theta (\mathbf{x}_T,t = T_{\mathrm{trunc}} + 1)$ , where $\mathbf{x}_T\sim \mathcal{N}(\mathbf{0},\mathbf{I})$ , to generate a noisy image at time $T_{\mathrm{trunc}}$ . 2) We further explore employing a different model, e.g., StyleGAN2 (Karras et al., 2020a), for the implicit generator, which provides better performance but increases the model size to get $\mathbf{x}_{T_{\mathrm{trunc}}}$ . Then for $t = T_{\mathrm{trunc}},\ldots ,1$ , we iteratively refine it as $\mathbf{x}_{t - 1} = \frac{1}{\sqrt{\alpha_t}} (\mathbf{x}_t - \frac{1 - \alpha_t}{\sqrt{1 - \bar{\alpha}_t}}\epsilon_\theta (\mathbf{x}_t,t)) + \beta_t\mathbf{z}_t$ where $\mathbf{z}_t\sim N(\mathbf{0},\mathbf{I})$ when $t > 1$ and $\mathbf{z}_1 = \mathbf{0}$ . This process is depicted in Algorithms 1 and 2 in the Appendix. For the implementation details, please refer to Appendix D.6 and our code at https://github.com/JegZheng/truncated-diffusion-probabilistic-models. + +# 3.6 RELATED WORK + +In our previous discussions, we have related TDPM to several existing works such as DDPM and AAE. A detailed discussion on other related works is provided in Appendix B. + +# 4 EXPERIMENTS + +We aim to demonstrate that TDPM can generate good samples faster by using fewer steps of reverse diffusion. We use different image datasets to test our method and follow the same setting as other diffusion models (Ho et al., 2020; Nichol & Dhariwal, 2021; Dhariwal & Nichol, 2021; Rombach et al., 2022) for our backbones. We also have two ways to set up the implicit generator that starts the reverse diffusion. One way is to reuse the denoising network, and the other way is to use a separate network. We try both ways for generating images without any labels. For generating images from text, we use the first way with the LDM backbone. We provide comprehensive details, toy examples, and additional experimental results in Appendices D.4-D.8. + +We use FID (lower is better) and Recall (higher is better) to measure the fidelity and diversity, respectively, of the generated images. We use CIFAR-10 (Krizhevsky et al., 2009), LSUN-bedroom, and LSUN-Church (Yu et al., 2015) datasets in unconditional experiments, and CUB-200 (Welinder et al., 2010) and MS-COCO (Lin et al., 2014) for text-to-image experiments. The images consist of $32 \times 32$ pixels for CIFAR-10 and $256 \times 256$ pixels for the other datasets. + +# 4.1 EFFICIENCY IN BOTH TRAINING AND SAMPLING + +We first look at the results on CIFAR-10. We use DDPM (Ho et al., 2020) or improved DDPM (Nichol & Dhariwal, 2021) as our backbones. We use 4, 49, or 99 steps of reverse diffusion, which correspond + +Table 1: Results of unconditional generation on CIFAR-10, with the best FID and Recall in each group marked in bold. To compare TDPM $(T_{\mathrm{Trunc}} = 0)$ with GAN-based methods, we use DDPM backbone as generator and StyleGAN2 discriminator. + +
MethodNFEFID↓Recall↑
DDPM backbone
DDPM10003.210.57
TDPM (TTrunc=99)1003.100.57
TDPM+ (TTrunc=99)1002.880.58
DDIM504.670.53
TDPM (TTrunc=49)503.300.57
TDPM+ (TTrunc=49)502.940.58
TDPM (TTrunc=4)53.340.57
TDPM+ (TTrunc=4)53.210.57
Improved DDPM backbone
Improved DDPM40002.900.58
TDPM (TTrunc=99)1002.970.57
TDPM+ (TTrunc=99)1002.830.58
Improved DDPM+DDIM503.920.55
TDPM (TTrunc=49)503.110.57
TDPM+ (TTrunc=49)502.960.58
TDPM (TTrunc=4)53.510.55
TDPM+ (TTrunc=4)53.170.57
GAN-based
DDGAN43.750.57
StyleGAN218.320.41
StyleGAN2-ADA12.920.49
TDPM (TTrunc=0)17.340.46
+ +Table 3: Results of ImageNet-64×64, evaluated with FID and Recall. TDPM+ is built with a pre-trained ADM and an implicit model trained at $T_{\mathrm{Trunc}}$ using StylGAN-XL. + +
MethodNFEFID↓Recall↑
ADM10002.070.63
TDPM+ (TTrunc=99)1001.620.63
TDPM+ (TTrunc=49)501.770.58
TDPM+ (TTrunc=4)51.920.53
StyleGAN-XL (wo PG)13.540.51
+ +Table 2: Results on LSUN-Church and LSUN-Bedroom (resolution $256\times 256$ ). Similar to Table 1, TDPM $(T_{\mathrm{Trunc}} = 0)$ uses DDPM backbone for the generator. + +
MethodNFEChurch FIDBedroom FID
DDPM backbone
DDPM10007.894.90
TDPM (TTrunc=99)1004.333.95
TDPM+ (TTrunc=99)1003.983.67
DDIM5010.586.62
TDPM (TTrunc=49)505.354.10
TDPM+ (TTrunc=49)504.343.98
TDPM (TTrunc=4)54.984.16
TDPM+ (TTrunc=4)54.894.09
ADM backbone
ADM10003.491.90
ADM+DDIM2506.452.31
TDPM (TTrunc=99)1004.412.24
TDPM+ (TTrunc=99)1003.611.88
TDPM (TTrunc=49)504.572.92
TDPM+ (TTrunc=49)503.671.89
TDPM (TTrunc=4)55.617.92
TDPM+ (TTrunc=4)54.664.01
GAN-based
DDGAN45.25-
StyleGAN213.933.98
StyleGAN2-ADA14.127.89
TDPM (TTrunc=0)14.775.24
+ +![](images/f9bf753c29b773142e7de27c60f4613244cb01bce5264ec0ad6ae79efc91c584.jpg) +Figure 2: Random generation results of TDPM+ $(T_{\mathrm{Trunc}} = 4)$ on ImageNet-64x64. + +to 5, 50, or 100 number of function evaluations (NFE). For the implicit generator, we either reuse the denoising U-Net or use a StyleGAN2 network (respectively, we call them TDPM and TDPM+). For comparison, we also include DDIM (Song et al., 2020) and DDGAN (Xiao et al., 2022). The comparison with a more diverse set of baselines can be found in Table 9 in Appendix D.7. + +Table 1 shows that our TDPM can get good FID with fewer NFE. TDPM+ can get even better FID, and it is the best when $\mathrm{NFE} = 100$ . Compared with TDPM with 0 steps of reverse diffusion (a GAN with DDPM's U-Net as generator and StyleGAN2 as discriminator) and StyleGAN2, TDPM with more than 0 steps of reverse diffusion has better recall and the FID is as good as StyleGAN2-ADA (a GAN with data augmentation for better training). This means TDPM can largely avoid the mode missing problem in GANs. We show some examples of generated images on CIFAR-10 in Figure 13. + +We also check how fast TDPM can train and sample. In training, we count how many images TDPM needs to well fit the truncated diffusion chain and the implicit prior. Figure 3 shows that when we use fewer steps of reverse diffusion, the diffusion part needs less time to train. But the implicit prior needs more time to train because it has to model a harder distribution, e.g., fitting the implicit prior with 4 diffusion steps needs similar time to directly fit it on the data. When we use 99 steps of reverse diffusion, the diffusion chain and the implicit prior need similar time to train, and the whole model trains faster than both GAN and DDPM. In sampling, we compare TDPM with 0, 1, 4, 49, or 99 steps of reverse diffusion. We report both FID and the sampling time (s/image) on one NVIDIA V100 GPU in Figure 4. When we use 4 steps of reverse diffusion, the FID is much lower than 0 steps, and the sampling time is slightly longer. When we use more steps of reverse diffusion, the FID goes down + +![](images/7f5a9450b341548769ea5bb788688bf574cd68b0e5fff315e5fdd2bcfe8d1a8c.jpg) +Figure 3: The required iterations (measured with iterated images) to converge in the training. The iterations for $t < T_{\mathrm{Trunc}}(\epsilon_{\theta})$ and $t = T_{\mathrm{Trunc}}(G_{\psi})$ are marked in red and blue, respectively. + +![](images/fe8f779ee634a29d9bfc014d96178f65d1f2e323203eee1fe91475cfa6da3449.jpg) + +![](images/8107bea9c4c7cbbea56182b12ffa2ed8014e7286cddec665f69d35af277b10e0.jpg) +Figure 4: Evolution of FID and corresponding GPU time (s/image) across different timesteps in the sampling stage. + +![](images/11c94337ab727dddbae36dbb779f2a5d723321a3698880198b0651c2d59924eb.jpg) +Figure 5: Randomly generated images of TDPM using ADM (Dhariwal & Nichol, 2021) backbone on LSUN-Church and LSUN-Bedroom $(256\times 256)$ , with $T_{\mathrm{trunc}} = 4$ , 49, and 99. Note NFE $= T_{\mathrm{trunc}} + 1$ in TDPM. Each group presents generated samples from the full model $p_{\theta}(\mathbf{x}_0)$ (left) and its implicit prior $\sim p_{\theta}(\mathbf{x}_{T_{\mathrm{trunc}}})$ (right); the full model sample is obtained by refining the implicit prior sample via the truncated reverse diffusion chain. + +slowly, but the sampling time goes up linearly. When we use 99 steps of reverse diffusion, the FID of TDPM is better than DDPM with 1000 steps. Because the FID does not change much when we use more steps of reverse diffusion, we suggest using a small number of steps, such as 4 or more, to balance the quality and speed of generation. + +# 4.2 RESULTS ON HIGHER-RESOLUTION AND MORE DIVERSE IMAGE DATASETS + +To test the performance of the proposed truncation method on high-resolution images, we train TDPM using two different diffusion models, DDPM (Ho et al., 2020) and ADM (Dhariwal & Nichol, 2021), as backbones on two datasets of $256 \times 256$ resolution, LSUN-Church and LSUN-Bedroom (Yu et al., 2015). We compare the FIDs of TDPM with those of the backbone models and some state-of-the-art GANs in Tables 2. The results show that TDPM can generate images of similar quality with much smaller truncation steps $T_{\mathrm{trunc}}$ , which means that it can produce images significantly faster than the backbone models. We also visualize the samples from the implicit distribution $\mathbf{x}_{T_{\mathrm{trunc}}} \sim p_{\theta}(\mathbf{x}_{T_{\mathrm{trunc}}})$ that TDPM generates and the corresponding $\mathbf{x}_0$ that it finishes at the end of reverse chain in Figure 5. + +We further evaluate TDPM on ImageNet-1K (with resolution $64 \times 64$ ) that exhibits high diversity. Here we adopt the TDPM+ configuration, where we use a pre-trained ADM (Dhariwal & Nichol, 2021) checkpoint for $t < T_{\mathrm{Trunc}}$ and train a StyleGAN-XL (Sauer et al., 2022) based implicit model at $t = T_{\mathrm{Trunc}}$ (for simplicity, we choose to not use the progressive growing pipeline of StyleGAN-XL; See Appendix D.6 for more details). We compare both FID and Recall with our backbone models in Table 3 and show example generations in Figure 2. Similar to our observations in Table 1, TDPM has good generation quality with small truncation steps $T_{\mathrm{trunc}}$ . Moreover, properly training an implicit model at $T_{\mathrm{trunc}}$ can further improve the performance of the backbone. + +![](images/cc778dcc34e17e97c35bc9c4477e8283065848db0f142cfb822ebe53f88bb6a3.jpg) +Figure 6: Quantitative text-to-image results (FID and GPU time) across different NFE. + +Table 4: Numerical results of Figure 6. The GPU time of sampling (s/image) is measured on one NVIDIA A100. + +
CUB-BirdMS-COCO
NFEGPU timeLDMTLDMLDMTLDM
50.15100.8110.5948.4116.7
501.5730.857.3218.257.47
1004.1011.076.798.27.22
25011.216.826.726.36.29
100041.096.68-6.29-
+ +![](images/a48af36a5fb2a47c54660b9ae7cc32f16b12ed30adbea95dfc05eb7fac8471a9.jpg) + +![](images/14891e82b9254069325415bc6e46baf1e74fda2e8d84efe88f166c38b2f136ff.jpg) + +![](images/ef680d63ca72c8562706be0b2e8551c6b8d8a2c3754d019a96f6e8692cc1ff0e.jpg) +A bird with brown wings, black back, and red head. + +![](images/69a6f6a66b5af4fa395f9029dbc57e275f12c6a44cd664008db29d96ad975ce4.jpg) +A green train is coming down the tracks. +Figure 7: Example text-to-image generation results of LDM and TLDM (i.e., TDPM with LDM backbone) finetuned on CUB-200 (top row) or MS-COCO (bottom row), setting the number of times iterating through the reverse diffusion U-Net as 100 (left column), 50 (middle column), or 5 (right column). + +![](images/5a368a4f87a389bb59b3e1e71d666bf1ebc2e6f10c171937739b3a50508fbce4.jpg) + +![](images/ddeaf323571433973353e631e854160e8c4857d7b6625a506be676543913df33.jpg) + +# 4.3 TEXT-TO-IMAGE GENERATION + +Besides unconditional generation tasks, we develop for text-to-image generation the TLDM, a conditional version of TDPM that leverages as the backbone the LDM of Rombach et al. (2022), which is a state-of-the-art publicly released model with 1.45B parameters pre-trained on LAION-400M (Schuhmann et al., 2021). LDM consists of a fixed auto-encoder for pixel generation and a latent-diffusion module to connect text and image embeddings. Here we fine-tune its latent-diffusion part on CUB-200 and MS-COCO datasets with 25K and 100K steps as the baseline. Similar to the unconditional case, we fine-tune with the LDM loss for $t < T_{\mathrm{Trunc}}$ and GAN loss for $t = T_{\mathrm{Trunc}}$ . More details about the setting can be found in Appendix D.6. + +The results of LDM with different DDIM sampling steps and TLDM with different truncated steps are summarized in Figure 6 and Table 4. Similar to applying diffusion directly on the original image-pixel space, when the diffusion chain is applied in the latent space, we observe TLDM can achieve comparable or better performance than LDM even though it has shortened the diffusion chain of LDM to have much fewer reverse diffusion steps. For the case that NFE is as small as 5, we note although the FID of TLDM has become higher due to using fewer diffusion steps, the generated image using TLDM at $\mathrm{NFE} = 5$ is still visually appealing, as shown in Figure 7. Compared with 50 and 250 steps using LDM, the sampling speed of TLDM using 5 steps is 10 and 50 times faster, respectively, while largely preserving generation quality. We provide additional text-to-image generation results of TLDM in Appendix D.8. + +# 5 CONCLUSION + +In this paper, we investigate how to reduce the trajectory length of the diffusion chain to achieve efficient sampling without loss of generation quality. We propose truncated diffusion probabilistic modeling (TDPM) that truncates the length of a diffusion chain. In this way, TDPM can use a much shorter diffusion chain, while being required to start the reverse denoising process from an intractable distribution. We propose to learn such a distribution with an implicit generative model powered by the same U-Net used for denoising diffusion, and validate with multiple ways to learn the implicit distribution to ensure the robustness of the proposed TDPM. We reveal that TDPM can be cast as an adversarial auto-encoder with a learnable implicit prior. We conduct extensive experiments on both synthetic and real image data to demonstrate the effectiveness of TDPM in terms of both sample quality and efficiency, where the diffusion chain can be shortened to have only a few steps. + +# ACKNOWLEDGMENTS + +H. Zheng and M. Zhou acknowledge the support of NSF-IIS 2212418 and IFML. + +# REFERENCES + +Guillaume Alain, Yoshua Bengio, Li Yao, Jason Yosinski, Eric Thibodeau-Laufer, Saizheng Zhang, and Pascal Vincent. Gsns: generative stochastic networks. Information and Inference: A Journal of the IMA, 5(2):210-249, 2016. +Abdul Fatir Ansari, Ming Liang Ang, and Harold Soh. Refining deep generative models via discriminator gradient flow. In International Conference on Learning Representations, 2021. +Martin Arjovsky and Leon Bottou. Towards principled methods for training generative adversarial networks. In International Conference on Learning Representations, 2017. URL https://openreview.net/forum?id=Hk4_qw5xe. +Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein generative adversarial networks. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 214-223, 2017. +Jacob Austin, Daniel Johnson, Jonathan Ho, Danny Tarlow, and Rianne van den Berg. Structured denoising diffusion models in discrete state-spaces. arXiv preprint arXiv:2107.03006, 2021. +Mikołaj Binkowski, Dougal J. Sutherland, Michael Arbel, and Arthur Gretton. Demystifying MMD GANs. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=r1lUOzWCW. +David M Blei, Alp Kucukelbir, and Jon D McAuliffe. Variational inference: A review for statisticians. Journal of the American Statistical Association, 112(518):859-877, 2017. +Florian Bordes, Sina Honari, and Pascal Vincent. Learning to generate samples from noise through infusion training. arXiv preprint arXiv:1703.06975, 2017. +Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale GAN training for high fidelity natural image synthesis. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=B1xsqj09Fm. +Nanxin Chen, Yu Zhang, Heiga Zen, Ron J. Weiss, Mohammad Norouzi, and William Chan. Wavegrad: Estimating gradients for waveform generation, 2020. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018. +Prafulla Dhariwal and Alexander Quinn Nichol. Diffusion models beat GANs on image synthesis. In A. Beygelzimer, Y. Dauphin, P. Liang, and J. Wortman Vaughan (eds.), Advances in Neural Information Processing Systems, 2021. URL https://openreview.net/forum?id=AAWuCvzaVt. +W Feller. On the theory of stochastic processes, with particular reference to applications. In Proceedings of the [First] Berkeley Symposium on Mathematical Statistics and Probability, pp. 403-432. University of California Press, 1949. +Ruiqi Gao, Yang Song, Ben Poole, Ying Nian Wu, and Diederik Kingma. Learning energy-based models by diffusion recovery likelihood. In International Conference on Learning Representations, 2021. +Xinyu Gong, Shiyu Chang, Yifan Jiang, and Zhangyang Wang. Autogan: Neural architecture search for generative adversarial networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, 2019. +Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in Neural Information Processing Systems, pp. 2672-2680, 2014. + +Anirudh Goyal, Nan Rosemary Ke, Surya Ganguli, and Yoshua Bengio. Variational walkback: Learning a transition operator as a stochastic recurrent net. arXiv preprint arXiv:1711.02282, 2017. +Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville. Improved training of Wasserstein GANs. In Advances in Neural Information Processing Systems, pp. 5767-5777, 2017. +Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770-778, 2016. +Jonathan Ho and Tim Salimans. Classifier-free diffusion guidance. arXiv preprint arXiv:2207.12598, 2022. +Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. In Advances in Neural Information Processing Systems, 2020. +Matthew D Hoffman and Matthew J Johnson. ELBO surgery: yet another way to carve up the variational evidence lower bound. In Workshop in Advances in Approximate Bayesian Inference, NIPS, volume 1, 2016. +Chin-Wei Huang, Jae Hyun Lim, and Aaron Courville. A variational perspective on diffusion-based generative models and score matching. arXiv preprint arXiv:2106.02808, 2021. +Ferenc Huszár. Variational inference using implicit distributions. arXiv preprint arXiv:1702.08235, 2017. +Aapo Hyvarinen and Peter Dayan. Estimation of non-normalized statistical models by score matching. Journal of Machine Learning Research, 6(4), 2005. +Yifan Jiang, Shiyu Chang, and Zhangyang Wang. Transgan: Two transformers can make one strong gan. arXiv preprint arXiv:2102.07074, 2021. +Alexia Jolicoeur-Martineau, Rémi Piche-Taillefer, Rémi Tachet des Combes, and Ioannis Mitliagkas. Adversarial score matching and improved sampling for image generation, 2020. +Alexia Jolicoeur-Martineau, Ke Li, Rémi Piché-Taillefer, Tal Kachman, and Ioannis Mitliagkas. Gotta go fast when generating data with score-based models. arXiv preprint arXiv:2105.14080, 2021. +Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 4401-4410, 2019. +Tero Karras, Miika Aittala, Janne Hellsten, Samuli Laine, Jaakko Lehtinen, and Timo Aila. Training generative adversarial networks with limited data. arXiv preprint arXiv:2006.06676, 2020a. +Tero Karras, Samuli Laine, Miika Aittala, Janne Hellsten, Jaakko Lehtinen, and Timo Aila. Analyzing and improving the image quality of stylegan. In Proceedings of the IEEE conference on computer vision and pattern recognition, 2020b. +Dongjun Kim, Seungjae Shin, Kyungwoo Song, Wanmo Kang, and Il-Chul Moon. Score matching model for unbounded data score. arXiv preprint arXiv:2106.05527, 2021. +Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In *Joshua Bengio and Yann LeCun* (eds.), 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015. URL http://arxiv.org/abs/1412.6980. +Diederik Kingma and Max Welling. Auto-encoding variational Bayes. arXiv preprint arXiv:1312.6114, 2013. +Diederik Kingma, Tim Salimans, Ben Poole, and Jonathan Ho. Variational diffusion models. Advances in neural information processing systems, 34:21696-21707, 2021. + +Zhifeng Kong and Wei Ping. On fast sampling of diffusion probabilistic models. arXiv preprint arXiv:2106.00132, 2021. +Zhifeng Kong, Wei Ping, Jiaji Huang, Kexin Zhao, and Bryan Catanzaro. Diffwave: A versatile diffusion model for audio synthesis, 2020. +Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009. +Tuomas Kynkänniemi, Tero Karras, Samuli Laine, Jaakko Lehtinen, and Timo Aila. Improved precision and recall metric for assessing generative models. Advances in Neural Information Processing Systems, 32, 2019. +Cheng-Han Lee, Ziwei Liu, Lingyun Wu, and Ping Luo. Maskgan: Towards diverse and interactive facial image manipulation. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020. +Ke Li and Jitendra Malik. Implicit maximum likelihood estimation. arXiv preprint arXiv:1809.09087, 2018. +Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dólar, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In European conference on computer vision, pp. 740-755. Springer, 2014. +Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaou Tang. Deep learning face attributes in the wild. In Proceedings of the IEEE international conference on computer vision, pp. 3730-3738, 2015. +Eric Luhman and Troy Luhman. Knowledge distillation in iterative generative models for improved sampling speed. arXiv preprint arXiv:2101.02388, 2021. +Alireza Makhzani, Jonathon Shlens, Navdeep Jaitly, Ian Goodfellow, and Brendan Frey. Adversarial autoencoders. arXiv preprint arXiv:1511.05644, 2015. +Chenlin Meng, Jiaming Song, Yang Song, Shengjia Zhao, and Stefano Ermon. Improved autoregressive modeling with distribution smoothing. arXiv preprint arXiv:2103.15089, 2021. +Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative adversarial networks. In International Conference on Learning Representations, 2018. +Shakir Mohamed and Balaji Lakshminarayanan. Learning in implicit generative models. arXiv preprint arXiv:1610.03483, 2016. +Radford M Neal. MCMC using Hamiltonian dynamics. Handbook of Markov Chain Monte Carlo, pp. 113, 2011. +Alex Nichol and Prafulla Dhariwal. Improved denoising diffusion probabilistic models. arXiv preprint arXiv:2102.09672, 2021. +Sebastian Nowozin, Botond Cseke, and Ryota Tomioka. f-GAN: Training generative neural samplers using variational divergence minimization. In Advances in neural information processing systems, 2016. +Kushagra Pandey, Avideep Mukherjee, Piyush Rai, and Abhishek Kumar. Diffusevae: Efficient, controllable and high-fidelity generation from low-dimensional latents. arXiv preprint arXiv:2201.00308, 2022. +Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015. +Ali Razavi, Aaron Van den Oord, and Oriol Vinyals. Generating diverse high-fidelity images with VQ-VAE-2. Advances in neural information processing systems, 32, 2019. +Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In International conference on machine learning, pp. 1278-1286. PMLR, 2014. + +Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. High-resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10684-10695, 2022. +Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computer-assisted intervention. Springer, 2015. +Tim Salimans and Jonathan Ho. Progressive distillation for fast sampling of diffusion models. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum?id=TIdIXIpzhoI. +Robin San-Roman, Eliya Nachmani, and Lior Wolf. Noise estimation for generative diffusion models. arXiv preprint arXiv:2104.02600, 2021. +Axel Sauer, Katja Schwarz, and Andreas Geiger. Stylegan-xl: Scaling stylegan to large diverse datasets. In ACM SIGGRAPH 2022 Conference Proceedings, pp. 1-10, 2022. +Christoph Schuhmann, Richard Vencu, Romain Beaumont, Robert Kaczmarczyk, Clayton Mullis, Aarush Katta, Theo Coombes, Jenia Jitsev, and Aran Komatsuzaki. Laion-400m: Open dataset of clip-filtered 400 million image-text pairs. arXiv preprint arXiv:2111.02114, 2021. +Jascha Sohl-Dickstein, Eric A. Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics, 2015. +Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models, 2020. +Yang Song and Stefano Ermon. Generative modeling by estimating gradients of the data distribution. In Advances in Neural Information Processing Systems, pp. 11918-11930, 2019. +Yang Song and Stefano Ermon. Improved techniques for training score-based generative models. Advances in neural information processing systems, 33:12438-12448, 2020. +Yang Song, Conor Durkan, Iain Murray, and Stefano Ermon. Maximum likelihood training of score-based diffusion models. Advances in Neural Information Processing Systems, 34:1415-1428, 2021a. +Yang Song, Jascha Sohl-Dickstein, Diederik Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. In International Conference on Learning Representations, 2021b. URL https://openreview.net/forum?id=PxTIG12RRHS. +Jakub Tomczak and Max Welling. VAE with a VampPrior. In International Conference on Artificial Intelligence and Statistics, pp. 1214-1223. PMLR, 2018. +Dustin Tran, Rajesh Ranganath, and David Blei. Hierarchical implicit models and likelihood-free variational inference. In Advances in Neural Information Processing Systems, pp. 5523-5533, 2017. +Arash Vahdat, Karsten Kreis, and Jan Kautz. Score-based generative modeling in latent space. In Advances in neural information processing systems, 2021. +Aaron van den Oord, Nal Kalchbrenner, Lasse Espeholt, Oriol Vinyals, and Alex Graves. Conditional image generation with PixelCNN decoders. Advances in neural information processing systems, 29, 2016. +Aaron van den Oord, Oriol Vinyals, and Koray Kavukcuoglu. Neural discrete representation learning. Advances in neural information processing systems, 30, 2017. +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pp. 5998-6008, 2017. +Pascal Vincent. A connection between score matching and denoising autoencoders. Neural computation, 23(7):1661-1674, 2011. + +Peter Welinder, Steve Branson, Takeshi Mita, Catherine Wah, Florian Schroff, Serge Belongie, and Pietro Perona. Caltech-ucsd birds 200. Technical Report CNS-TR-201, Caltech, 2010. URL /se3/wp-content/uploads/2014/09/WelinderEtal10_CUB-200.pdf, http://www.vision.caltech.edu/visipedia/CUB-200.html. +Max Welling and Yee W Teh. Bayesian learning via stochastic gradient Langevin dynamics. In Proceedings of the 28th international conference on machine learning (ICML-11), pp. 681-688. Citeseer, 2011. +Zhisheng Xiao, Karsten Kreis, and Arash Vahdat. Tackling the generative learning trilemma with denoising diffusion GANs. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum?id=JprM0p-q0Co. +Mingzhang Yin and Mingyuan Zhou. Semi-implicit variational inference. In International Conference on Machine Learning, pp. 5660-5669, 2018. +Fisher Yu, Ari Seff, Yinda Zhang, Shuran Song, Thomas Funkhouser, and Jianxiong Xiao. LSUN: Construction of a large-scale image dataset using deep learning with humans in the loop. arXiv preprint arXiv:1506.03365, 2015. +Shengyu Zhao, Zhijian Liu, Ji Lin, Jun-Yan Zhu, and Song Han. Differentiable augmentation for data-efficient GAN training. arXiv preprint arXiv:2006.10738, 2020. +Huangjie Zheng and Mingyuan Zhou. Exploiting chain rule and Bayes' theorem to compare probability distributions. Advances in Neural Information Processing Systems, 34, 2021. + +# A PROOF + +Proof of Theorem 1. As the last terms in both losses are the same, we only need to show that the first term in (11) is smaller than or equal to $\mathcal{L}_0 + \sum_{t=2}^{T_{\mathrm{true}}}\mathcal{L}_{t-1}$ in (8). Using Jensen's inequality, we have + +$$ +\begin{array}{l} - \mathbb {E} _ {q (\mathbf {x} _ {0})} \mathbb {E} _ {q (\mathbf {x} _ {T _ {\text {t r u n c}}} \mid \mathbf {x} _ {0})} \log p _ {\theta} (\mathbf {x} _ {0} \mid \mathbf {x} _ {T _ {\text {t r u n c}}}) \\ = - \mathbb {E} _ {q (\mathbf {x} _ {0})} \mathbb {E} _ {q (\mathbf {x} _ {T _ {\mathrm {t r u n c}}} \mid \mathbf {x} _ {0})} \log \mathbb {E} _ {q (\mathbf {x} _ {1: T _ {\mathrm {t r u n c}} - 1} \mid \mathbf {x} _ {0}, \mathbf {x} _ {T _ {\mathrm {t r u n c}}})} \left[ \frac {p (\mathbf {x} _ {0 : T _ {\mathrm {t r u n c}} - 1} \mid \mathbf {x} _ {T _ {\mathrm {t r u n c}}})}{q (\mathbf {x} _ {1 : T _ {\mathrm {t r u n c}} - 1} \mid \mathbf {x} _ {0} , \mathbf {x} _ {T _ {\mathrm {t r u n c}}})} \right] \\ \leq - \mathbb {E} _ {q (\mathbf {x} _ {0})} \mathbb {E} _ {q (\mathbf {x} _ {T _ {\text {t r u n c}}} \mid \mathbf {x} _ {0})} \mathbb {E} _ {q (\mathbf {x} _ {1: T _ {\text {t r u n c}} - 1} \mid \mathbf {x} _ {0}, \mathbf {x} _ {T _ {\text {t r u n c}}})} \log \frac {p (\mathbf {x} _ {0 : T _ {\text {t r u n c}} - 1} \mid \mathbf {x} _ {T _ {\text {t r u n c}}})}{q (\mathbf {x} _ {1 : T _ {\text {t r u n c}} - 1} \mid \mathbf {x} _ {0} , \mathbf {x} _ {T _ {\text {t r u n c}}})} \\ = - \mathbb {E} _ {q (\mathbf {x} _ {0})} \mathbb {E} _ {q (\mathbf {x} _ {1: T _ {\text {t r u n c}}} \mid \mathbf {x} _ {0})} \log \left[ \frac {p (\mathbf {x} _ {0 : T _ {\text {t r u n c}} - 1})}{q (\mathbf {x} _ {1 : T _ {\text {t r u n c}}} \mid \mathbf {x} _ {0})} \frac {q (\mathbf {x} _ {T _ {\text {t r u n c}}} \mid \mathbf {x} _ {0})}{p (\mathbf {x} _ {T _ {\text {t r u n c}}})} \right] \\ = \left(- \mathbb {E} _ {q (\mathbf {x} _ {0})} \mathbb {E} _ {q (\mathbf {x} _ {1: T _ {\text {t r u n c}}} \mid \mathbf {x} _ {0})} \log \frac {p (\mathbf {x} _ {0 : T _ {\text {t r u n c}}} - 1)}{q (\mathbf {x} _ {1 : T _ {\text {t r u n c}}} \mid \mathbf {x} _ {0})}\right) - \mathbb {E} _ {q (\mathbf {x} _ {0})} \mathbb {E} _ {q (\mathbf {x} _ {T _ {\text {t r u n c}}} \mid \mathbf {x} _ {0})} \log \frac {q (\mathbf {x} _ {T _ {\text {t r u n c}}} \mid \mathbf {x} _ {0})}{p (\mathbf {x} _ {T _ {\text {t r u n c}}})} \\ = \left(\sum_ {t = 1} ^ {T _ {\text {t r u n c}}} \mathcal {L} _ {t - 1} + \mathcal {L} _ {T _ {\text {t r u n c}}}\right) - \mathcal {L} _ {T _ {\text {t r u n c}}} \\ = \sum_ {t = 1} ^ {T _ {\text {t r u n c}}} \mathcal {L} _ {t - 1}, \tag {15} \\ \end{array} +$$ + +where the second to last equality follows the same derivation of the ELBO in Ho et al. (2020). + +![](images/4f8c01adebf9d66bbc98923d25e04684fa4c85979139e3dd117fcd72d72c4c65.jpg) + +# B RELATED WORK + +Diffusion probabilistic models (Sohl-Dickstein et al., 2015; Ho et al., 2020) employ a forward Markov chain to diffuse the data to noise and learn the reversal of such a diffusion process. With the idea of exploiting the Markov operations (Goyal et al., 2017; Alain et al., 2016; Bordes et al., 2017), diffusion models achieve great success and inspire a variety of tasks including image generation and audio generation (Kong et al., 2020; Chen et al., 2020; Jolicoeur-Martineau et al., 2020; Vahdat et al., 2021). Recently, plenty of studies have been proposed to generalize diffusion model to continuous time diffusion and improve the diffusion models in likelihood estimation (Vincent, 2011; Song & Ermon, 2020; 2019; Nichol & Dhariwal, 2021; Song et al., 2021b;a; Kingma et al., 2021). + +Another mainstream is to improve the sampling efficiency of diffusion models, which are known for their enormous number of sampling steps. Luhman & Luhman (2021) improve diffusion processes with knowledge distillation and San-Roman et al. (2021) propose a learnable adaptive noise schedule. Song et al. (2020) and Kong & Ping (2021) exploit non-Markovian diffusion processes and shorten the denoising segments. Jolicoeur-Martineau et al. (2021) and Huang et al. (2021) use better SDE solvers for continuous-time models. Aside from these works, recently other types of generative models such as VAEs (Kingma & Welling, 2013), GANs (Goodfellow et al., 2014), and autoregressive models (van den Oord et al., 2016) have been incorporated to diffusion models. They are shown to benefit each other (Xiao et al., 2022; Pandey et al., 2022; Meng et al., 2021) and have a closer relation to our work. Xiao et al. (2022) consider the use of implicit models (Huszár, 2017; Mohamed & Lakshminarayanan, 2016; Tran et al., 2017; Yin & Zhou, 2018; Li & Malik, 2018) to boost the efficiency of diffusion models, where they deploy implicit models in each denoising step, which has higher difficulty in the training as the number of diffusion steps increases. Pandey et al. (2022) build diffusion models on top of the output of VAEs for refinement. Our work is also related if viewing TDPM as a diffusion model on top of an implicit model, where the implicit model can be parameterized with the U-Net or a separate network. + +# C DISCUSSION + +Potential societal impacts: This paper proposes truncated diffusion probabilistic model as a novel type of diffusion-based generative model. The truncated part can be trained as implicit generative models such as GANs jointly or independently with the diffusion part. The capacities of truncated diffusion probabilistic models are competitive to existing diffusion-based ones and efficiency is largely improved. On the contrary of these positive effects, some negative perspectives could also be + +seen, depending on how the models are used. One major concern is the truncated diffusion technique proposed in this paper could potentially be a way to hack the existing diffusion models if the implicit models are maliciously used to fit the intermediate steps. For example, for some existing diffusion models, for safety concerns, the model's capacity to generate private data needs to be locked by hiding the diffusion ending point into an unknown distribution. The technique of TDPM could be used to crack these existing online diffusion models by providing intermediate noisy images or fine-tuning the first few steps with TDPM to unlock the capacity. Besides, the capacity of generating good images can also be misused to generate ill-intentioned images at a much lower cost. + +**Discussions:** In this work, we mainly focus on reducing the length of the diffusion chain of a finite-time diffusion model. Our model has shown its effectiveness in improving finite-time diffusion models and it is non-trivial to further explore our model on continuous-time diffusion models (Song et al., 2021b). Moreover, while in this paper DDPM is the primary baseline, TDPM can also be built on other recent diffusion models. While $p_{\theta}(\mathbf{x}_{T_{\mathrm{trunc}}})$ is parameterized as an implicit distribution, it can also be formulated as a semi-implicit distribution (Yin & Zhou, 2018), which allows it to be approximated with a Gaussian generator. Xiao et al. (2022) also present a closely related work. While we share the same spirit to reduce the length of the diffusion chain, these two strategies are not conflicting with each other. In future work we will look into the integration of these different strategies. There also exists plenty of options in approximating $p_{\theta}(\mathbf{x}_{T_{\mathrm{trunc}}})$ . When truncating the diffusion chain to be short, the implicit distribution still faces multi-modal and needs to fit with different methods depending upon the properties that we need. For example, in order to capture all modes, a VAE would be preferred, like done in Pandey et al. (2022). Below we provide an alternative method proposed in Zheng & Zhou (2021) to fit the truncated distribution. Besides the training, it's also an open question whether TDPM can be incorporated into more advanced architectures to have further improvements and we leave this exploration for future work. + +# D ALGORITHM DETAILS AND COMPLEMENTARY RESULTS + +Below we provide additional algorithm details and complementary experimental results. + +# D.1 ADDITIONAL ANALYSIS ON THE PARAMETERIZATION OF THE IMPLICIT GENERATOR + +As shown in Section 3, in general, the objective of TDPM consists of the training of the diffusion model $\epsilon_{\theta}$ (a U-Net architecture (Ronneberger et al., 2015)) with simple loss of DDPM $\mathcal{L}_{\mathrm{simple}}$ and the training of an implicit prior model $G_{\psi}$ with objective $\mathcal{L}_{T_{\mathrm{trunc}}}^{\mathrm{GAN}}$ . Without loss of generality, in our main paper, we show two configurations to parameterize the implicit part for $t = T_{\mathrm{trunc}}$ : 1) the implicit generator shares the same U-Net architecture used for $0 < t < T_{\mathrm{trunc}}$ ; 2) the implicit generator is instantiated with a separate network. Below we explain this two configurations (denoted as TDPM+ in the main paper). + +Configuration 1): At $t = T_{\mathrm{trunc}}$ , the Unet generates the noisy image at the truncated step: $\mathbf{x}_{T_{\mathrm{trunc}}} = \epsilon_{\theta}(\mathbf{x}_{T_{\mathrm{trunc}} + 1}, t = T_{\mathrm{trunc}} + 1)$ , where $\mathbf{x}_{T_{\mathrm{trunc}} + 1} \sim \mathcal{N}(0, I)$ is the pure noise image whose pixels are iid sampled from standard normal. For $t = T_{\mathrm{trunc}}$ , $T_{\mathrm{trunc}} - 1, \ldots, 1$ , the same Unet iteratively refines the noisy images by letting $\mathbf{x}_{t-1} = \frac{1}{\sqrt{\bar{\alpha}_t}} (\mathbf{x}_t - \frac{1 - \alpha_t}{\sqrt{1 - \bar{\alpha}_t}} \epsilon_{t-1}) + \beta_t \mathbf{z}_t$ ; $\mathbf{z}_{t>1} \sim \mathcal{N}(0, I)$ , $\mathbf{z}_1 = \mathbf{0}$ , where $\epsilon_{t-1} = \epsilon_{\theta}(\mathbf{x}_t, t)$ is the predicted noise by the Unet. + +Under this setting, the Unet-based generator plays two roles at the same time and the training will be more challenging than using two different generators here. However, we can also see as $T_{\mathrm{trunc}}$ gets larger, the distribution of $p(\mathbf{x}_{T_{\mathrm{trunc}}})$ will become more similar to a noise distribution, and generating the noisy images will be more like generating noises. In this case, being able to generate both noisy images and predicting noise becomes easier for the generator. + +Configuration 2) (TDPM+): Unlike previous configuration, where the implicit generator at step $t = T$ shares the same U-Net architecture with $t < T_{\mathrm{trunc}}$ . Another way is to parameterize $G_{\psi}$ with a separate generator. Although this configuration increases the total parameter of the generative model, it allows the model has better flexibility in the training stage. For example, these two networks can be trained in parallel or leverage a pre-trained model. In our paper, we conduct the experiments by using Stylegan2 generator architecture Karras et al. (2020b) for $t = T_{\mathrm{trunc}}$ , resulting in an increase of 19M and 28M for the generator parameters when handling $32 \times 32$ and $256 \times 256$ images. + +The process of training and sampling of these configurations are summarized in Algorithm 1 and 2. + +
Algorithm 1 TrainingAlgorithm 2 Sampling
1: repeat1: xTtrunc+1 ~ N(0, I)
2: x0 ~ q(x0)2: if Gψ shared with εθ then
3: t ~ Uniform{1,..., Trunc}3: xTtrunc = εθ(xTtrunc+1, Trunc + 1)
4: εt ~ N(0, I), z ~ N(0, I)4: else
5: Update with (14)5: xTtrunc = Gψ(xTtrunc+1)
6: until converged6: end if
7: for t = Ttrunc, ..., 1 do
8: zt ~ N(0, I) if t > 1, else z1 = 0
9: xt-1 = 1/√αt(xt - 1-αt/√1-αtεθ(xt, t)) + βtzt
10: end for
11: return x0
+ +# D.2 ALTERNATIVES OF LEARNING THE IMPLICIT DISTRIBUTION + +Another possible statistical distance is based on conditional transport (Zheng & Zhou, 2021), which is proposed to balance the model-seeking and mode-covering behaviors when fitting an empirical data distribution. In this setting, we use the same generator $G_{\psi}$ as before, but instead of a discriminator, we use a conditional distribution $\pi_{\eta}$ parameterized by $\eta$ to find an optimized mapping between the samples of $p$ and $q$ , and a critic $\phi$ to measure the point-to-point cost $c_{\phi}$ in the feature space. The generator, the conditional distribution, and the critic are trained by the following objective $\mathcal{L}_{T_{\mathrm{trunc}}}^{\mathrm{CT}}$ : + +$$ +\begin{array}{l} \min _ {\psi , \eta} \max _ {\phi} \mathbb {E} _ {\mathbf {x} \sim q (\mathbf {x} _ {T _ {\mathrm {t r u n c}}})} \left[ \mathbb {E} _ {G _ {\psi} (\mathbf {z}) \sim \pi_ {\eta} (G _ {\psi} (\mathbf {z}) \mid \mathbf {x} _ {T _ {\mathrm {t r u n c}}})} c _ {\phi} (\mathbf {x} _ {T _ {\mathrm {t r u n c}}}, G _ {\psi} (\mathbf {z})) \right] \\ + \mathbb {E} _ {\mathbf {z} \sim p (\mathbf {z})} \left[ \mathbb {E} _ {\mathbf {x} _ {T _ {\text {t r u n c}}} \sim \pi_ {\eta} \left(\mathbf {x} _ {T _ {\text {t r u n c}}} \mid G _ {\psi} (\mathbf {z})\right)} c _ {\phi} \left(\mathbf {x} _ {T _ {\text {t r u n c}}}, G _ {\psi} (\mathbf {z})\right) \right]. \tag {16} \\ \end{array} +$$ + +Similar to (14), we fit TDPM-CT with following loss + +$$ +\mathcal {L} _ {\mathrm {T D P M}} ^ {\mathrm {C T}} = \mathcal {L} _ {\text {s i m p l e} - \text {t r u n c}} + \lambda \mathcal {L} _ {T _ {\text {t r u n c}}} ^ {\mathrm {C T}}. \tag {17} +$$ + +We empirically find out this objective has no significant difference than using GAN objective shown in Equation 14 in performance-wise as long as the generator is well trained. + +# D.3 CONDITIONAL TRUNCATED DIFFUSION PROBABILISTIC MODELS + +For conditional generation, we extend (14) and derive a conditional version of TDPM: + +$$ +\mathcal {L} _ {\mathrm {T D P M}} ^ {\mathrm {c}} = \mathcal {L} _ {\text {s i m p l e} \_ \text {t r u n c}} ^ {\mathrm {c}} + \lambda \mathcal {L} _ {T _ {\text {t r u n c}}} ^ {\mathrm {c}}, \tag {18} +$$ + +where $\mathcal{L}_{\mathrm{simple\_trunc}}^{\mathbf{c}}$ aims to train the conditional diffusion model with + +$$ +\mathcal {L} _ {\text {s i m p l e t r u n c}} ^ {\mathbf {c}} = \mathbb {E} _ {\mathbf {c}} \mathbb {E} _ {t, \mathbf {x} _ {0} | \mathbf {c}, \epsilon_ {t}} \left[ \left| \left| \epsilon_ {t} - \epsilon_ {\theta} (\mathbf {x} _ {t}, \mathbf {c}, t) \right| \right| ^ {2} \right], t \sim \operatorname {U n i f} (1, 2, \dots , T _ {\text {t r u n c}}), \epsilon_ {t} \sim \mathcal {N} (\mathbf {0}, I), \tag {19} +$$ + +and the truncated distribution $\mathcal{L}_{T_{\mathrm{true}}}^{\mathbf{c}}$ can be fitted with GAN or CT: + +$$ +\min _ {\psi} \max _ {\phi} \mathbb {E} _ {\mathbf {c}} \left[ \mathbb {E} _ {\mathbf {x} \sim q \left(\mathbf {x} _ {T _ {\text {t r u n c}}} \mid \mathbf {c}\right)} \left[ \log D _ {\phi} (\mathbf {x} \mid \mathbf {c}) \right] + \mathbb {E} _ {\mathbf {z} \sim p (\mathbf {z})} \left[ \log \left(1 - D _ {\phi} \left(G _ {\psi} (\mathbf {z}, \mathbf {c})\right) \mid \mathbf {c}\right) \right] \right]. \tag {20} +$$ + +$$ +\begin{array}{l} \min _ {\psi , \eta} \max _ {\phi} \mathbb {E} _ {\mathbf {c}} \left[ \mathbb {E} _ {\mathbf {x} \sim q \left(\mathbf {x} _ {T _ {\text {t r u n c}}} \mid \mathbf {c}\right)} \left[ \mathbb {E} _ {G _ {\psi} (\mathbf {z}) \sim \pi_ {\eta} \left(G _ {\psi} (\mathbf {z}, \mathbf {c}) \mid \mathbf {x} _ {T _ {\text {t r u n c}}}, \mathbf {c}\right)} c _ {\phi} \left(\mathbf {x} _ {T _ {\text {t r u n c}}}, G _ {\psi} (\mathbf {z}, \mathbf {c})\right) \right] \right. \\ + \mathbb {E} _ {\mathbf {z} \sim p (\mathbf {z})} \left[ \mathbb {E} _ {\mathbf {x} _ {T _ {\text {t r u n c}}} \sim \pi_ {\eta} \left(\mathbf {x} _ {T _ {\text {t r u n c}}} \mid G _ {\psi} (\mathbf {z}, \mathbf {c}), \mathbf {c}\right) c _ {\phi} \left(\mathbf {x} _ {T _ {\text {t r u n c}}}, G _ {\psi} (\mathbf {z}, \mathbf {c})\right) \right] \rbrack . \tag {21} \\ \end{array} +$$ + +# D.4 ANALYSIS ON TOY EXPERIMENTS + +Although we present image experiments in the main paper, our studies were firstly justified our method on synthetic toy data as a proof of concept. We adopt representative 2D synthetic datasets used in prior works (Gulrajani et al., 2017; Zheng & Zhou, 2021), including Swiss Roll, Double Moons, 8-modal, and 25-modal Gaussian mixtures with equal component weights. We use an empirical + +![](images/25aa5c011c1dd26771474909a246d1edf717ee00c5e33d585aa4058040eb95bd.jpg) +Figure 8: A comparison of DDPM (Ho et al., 2020), TDPM-GAN, and TDPM-CT on Swiss Roll toy data. We show the effects of a truncated diffusion chain with length $T = 2$ and $T = 5$ ( $T_{\mathrm{Trunc}} = 1$ and $T_{\mathrm{Trunc}} = 4$ ). The first row displays the true distribution from $q(\mathbf{x}_0)$ to $q(\mathbf{x}_{T - 1})$ . Each row below the first one represents the corresponding denoising distribution $p_{\theta}(\mathbf{x}_{t - 1}|\mathbf{x}_t)$ . DDPM assumes $p(\mathbf{x}_T) = \mathcal{N}(\mathbf{0},\mathbf{I})$ and we can observe a gap between the true data distribution $q(\mathbf{x}_{T - 1})$ and its generative distribution $p_{\theta}(\mathbf{x}_{T - 1})$ . TDPM learns $p_{\theta}(\mathbf{x}_{T_{\mathrm{trunc}}})$ , which can be observed to well approximate the true $q(\mathbf{x}_{T - 1})$ , which helps the model successfully recover the clean data distribution $q(\mathbf{x}_0)$ . Below each model, we report empirical KL divergence between data and generative distributions as the quantitative metric. More results on different toy data can be found in Appendix D. + +![](images/7b3052fc09359fecb206fac819e2388f60577c974466bf7770975bf2b6aecbbd.jpg) + +sample set $\mathcal{X}$ , consisting of $|\mathcal{X}| = 2,000$ samples and illustrate the generated samples after 5000 training epochs. We take 20 grids in the range $[-10,10]$ for both the $x$ and $y$ axes to approximate the empirical distribution of $\hat{p}_{\theta}$ and $\hat{q}$ , and report the corresponding forward KL $D_{\mathrm{KL}}(\hat{q} ||\hat{p}_{\theta})$ as the quantitative evaluation metric. + +Figure 8 shows the results on the Swiss Roll data. We present a short chain with $T = 2$ and a longer chain with $T = 5$ to show the impacts of the number of diffusion steps. The first row shows that the data distribution is diffused with accumulated noise, and with more steps the diffused distribution will be closer to an isotropic Gaussian distribution. As one can see, truncating the diffusion chain to a short length will result in a clear gap between $q(\mathbf{x}_{T_{\mathrm{trunc}}})$ and $\mathcal{N}(\mathbf{0},\mathbf{I})$ . When DDPM (shown in the second row) samples from the isotropic Gaussian distribution, it becomes hard to recover the original data distribution from pure noise with only a few steps. Although we can see DDPM can get slightly improved with a few more steps $(T = 5)$ , as long as $q(\mathbf{x}_T)$ is not close to Gaussian, DDPM can hardly recover the data distribution. By contrast, as shown in the third and fourth rows, TDPM successfully approximates the non-Gaussian $q(\mathbf{x}_{T_{\mathrm{trunc}}})$ with its implicit generator, and we can see the remaining part of the truncated chain is gradually recovered by the denoising steps. From both visualizations and $D_{\mathrm{KL}}(\hat{q} ||\hat{p}_{\theta})$ , we can see that TDPM is able to fit every step in such short chains. + +TDPM-GAN and TDPM-CT both succeed in fitting $p_{\theta}(\mathbf{x}_{T_{\mathrm{trunc}}})$ but the latter one fits slightly better when the diffusion length is 2. When the length increases to 5, fitting the implicit distribution with GAN becomes easier. This observation demonstrates a benefit of combining the diffusion models and GANs. If the implicit generator is sufficiently powerful to model $q(\mathbf{x}_{T_{\mathrm{trunc}}})$ , then the number of steps in need can be compressed to a small number. On the contrary, if the implicit generator cannot capture the distribution, we need more steps to facilitate the fitting of the data distribution. + +Shown in Figure 9-Figure 11, we can see 8-modal Gaussian is more similar to an isotropic Gaussian after getting diffused, thus DDPM can recover a distribution similar to data with 5 steps. On 25-Gaussians, we can observe GAN does not suffer from mode-collapse and provide a better approximation than CT, which results in better data distribution recovery in the final step. + +![](images/ce8df85b0dc3a1a2c08a0bfefa9fd65d499286d3852b85b95a5b5f8f5b9f4556.jpg) +Figure 9: Analogous results to Figure 8 using 8-modal Gaussian data. + +![](images/8769ff19b05b237871ddc4e31a8b48e29db8bd8519343aaa7f87fcdf94c20f67.jpg) +Figure 10: Analogous results to Figure 8 using 25-modal Gaussian data. + +![](images/0830d0093ce37a59822739ad9dbdb3c80c03f30342de1602d6fb92d79add0b7e.jpg) +Figure 11: Analogous results to Figure 8 using Double Moons data. + +# D.5 ADDITIONAL ABLATION STUDIES + +Using Pre-trained diffusion backbones: Different from the default setting, here we put the implicit model of TDPM+ trained at $t = T_{\mathrm{trunc}}$ and a pre-trained DDPM model in the same pipeline of sampling. In this case we do not need to spend any time on pretraining the DDPM model, and only need to train the implicit model for $t = T_{\mathrm{trunc}}$ . As shown in Table 5, when combined with a pre-trained DDPM for $t < T_{\mathrm{trunc}}$ , the generation performance of TDPM trained under this two-step procedure is comparable to TDPM trained end-to-end. + +Table 5: Results of adding a separately trained implicit generator to a pre-trained diffusion model on CIFAR-10. + +
Model (t = TTrunc)Model (t < TTrunc)FID↓
TDPM+ (Ttrunc=99)TDPM+ (DDPM backbone)2.88
pre-trained DDPM2.85
TDPM+ (improved-DDPM backbone)2.83
pre-trained improved-DDPM2.25
TDPM+ (Ttrunc=49)TDPM+2.94
pre-trained DDPM3.05
TDPM+ (improved-DDPM backbone)2.96
pre-trained improved-DDPM2.60
TDPM+ (Ttrunc=4)TDPM+ (DDPM backbone)3.21
pre-trained DDPM3.25
TDPM+ (improved-DDPM backbone)3.17
pre-trained improved-DDPM2.95
+ +Sensitivity to noise schedule: Nichol & Dhariwal (2021) show the noise schedule affects the training of DDPM. Here we examine if TDPM is sensitive to the choice of noise schedule. We compare the linear schedule with cosine schedule, which adds noise in a milder manner. The results on CIFAR-10 are reported in Table 6, which suggest that TDPM is not sensitive to the choice between these two schedules. + +Table 6: Ablation study with different noise schedules on CIFAR-10. The number before and after “/” denotes the FID using linear and cosine schedules, respectively. + +
ModelStepsFID↓ (linear / cosine)
TDPM-GANTtrunc=993.10 / 3.47
TDPM-GANTtrunc=493.30 / 3.16
TDPM-CTTtrunc=993.69 / 3.62
TDPM-CTTtrunc=493.97 / 3.24
+ +On the choice of truncated step: As the diffused distribution could facilitate the learning of the implicit generator $G_{\psi}$ (Arjovsky & Bottou, 2017), where we could observe by increasing the number of diffusion steps, the FID of TDPM consistently gets better. A natural question is on which step should we truncate the diffusion chain. We study the signal-to-noise ratio (SNR) of different diffusion step. Based on $q(\mathbf{x}_t|\mathbf{x}_0) = \mathcal{N}(\sqrt{\bar{\alpha}_t}\mathbf{x}_0,1 - \bar{\alpha}_tI)$ , we calculate SNR as + +$$ +\mathrm {S N R} = \frac {\sqrt {\bar {\alpha} _ {t}}}{\sqrt {1 - \bar {\alpha} _ {t}}}; \bar {\alpha} _ {t} = \prod_ {i = 1} ^ {t} (1 - \beta_ {t}). +$$ + +We visualize the SNR evolution across time step $t > 0$ in Figure 12, where we can observe the SNR rapidly decays in the first 100 steps. According to previous studies in Arjovsky & Bottou (2017), injecting noise into the data distribution could smoothen the data distribution support and facilitate the GAN training. The SNR change in this interval indicates injecting noise in the level of $t \in [1,100]$ could bring in more significant improvement for the GAN training. When the step is greater than 200, the SNR is change is no longer significant and close to zero, which indicates the implicit model + +might not be too informative, though it is easier to train. Our experimental observations in Figure 3 also justify this conclusion: when training a GAN at $T_{\mathrm{Trunc}} = 4$ , the required number of iterations is similar to training it on clean data; by training the GAN model at $T_{\mathrm{Trunc}} = 99$ , the training of GAN is significantly facilitated. For $T_{\mathrm{Trunc}} > 100$ , we empirically examine to train a GAN and find it would converge faster than training the diffusion model for $t < T_{\mathrm{Trunc}}$ . + +Comparison of model efficiency: In complement of the results in Table 1-2, we provide detailed model size and generation time on v100 GPU. The results are summarized in Table 7. We can see TDPM has an increasing in the total number of parameter, as it involves a discriminator to help train the implicit model, while its sampling efficiency is also obvious. + +Table 7: Comparison of model size (the added parameters corresponds to the discriminator model in the training but not involved in the generation), and GPU time in generation. + +
Resolution32×3264×64256×256
ModelParameterTime (s/image)ParameterTime (s/image)ParameterTime (s/image)
DDPM36M31.0379M33.01114M62.93
TDPM, Ttrunc=9936M+20M3.1379M+21M3.52114M+24M6.65
TDPM, Ttrunc=4936M+20M1.5279M+21M1.55114M+24M1.88
TDPM, Ttrunc=436M+20M0.1679M+21M0.26114M+24M0.65
TDPM, Ttrunc=036M+20M0.0379M+21M0.05114M+24M0.14
+ +![](images/16133b37acfc7d1480907540412eb5e77a29c830d696b61609749c62a227021e.jpg) +Figure 12: Signal-to-noise ratio evolution across different diffuse step $T$ . The right sub-panel shows a zoomed-in SNR evolution in the range of [30, 140] steps. + +# D.6 EXPERIMENTAL SETTINGS + +# D.6.1 MODEL ARCHITECTURE + +Generator: Our generator structure strictly follows the U-Net structure (Ronneberger et al., 2015) used in DDPM, improved DDPM, and ADM (Ho et al., 2020; Nichol & Dhariwal, 2021; Dhariwal & Nichol, 2021), which consists of multiple ResNet blocks (He et al., 2016) with Attention blocks (Vaswani et al., 2017) injected in the bottleneck. Please refer to these paper for more details on the architecture. + +A key difference between our model and previous diffusion models is that our model also trains such U-Net as an extra implicit generator $G_{\theta}$ that takes a latent variable $\mathbf{z} \sim \mathcal{N}(\mathbf{0}, \mathbf{I})$ and a fixed time index $t = T_{\mathrm{trunc}} + 1$ as input. However, this does not result in a difference in the generator architecture. We parameterize $G_{\theta}$ with the same U-Net architecture for simplicity and the time embedding $t = T_{\mathrm{trunc}} + 1$ is specified to be trained with the implicit loss shown in (12) and (16). We have also tested to use all zero time embedding for $t = T_{\mathrm{trunc}} + 1$ and found no clear differences. + +For our results of TDPM+, the generator $G_{\psi}$ specifically takes a StyleGAN2 architecture Karras et al. (2020b) and there is no time-embedding in $G_{\psi}$ . An increase of generator parameter appears caused by separating the implicit model and denoising U-Net. Note that the generator is trained with GAN loss and without specially designed adaptive augmentation in Karras et al. (2020a). For the detailed model architecture please refer to the corresponding paper or their Github repository: https://github.com/NVlabs/stylegan2-ada-pytorch. + +**Discriminator:** Similar to Xiao et al. (2022), we adopt the discriminator architecture used in Karras et al. (2020b), but without the time step input. The discriminator discriminate $\mathbf{x}_{T_{\mathrm{trunc}}}$ is from the diffused distribution $q(\mathbf{x}_{T_{\mathrm{trunc}}})$ or implicit generative distribution $p_{\theta}(\mathbf{x}_{T_{\mathrm{trunc}}})$ . Please refer to Appendix C of Xiao et al. (2022) for the detailed design. + +Navigator: Training with $\mathcal{L}_{T_{\mathrm{Trunc}}}^{\mathrm{CT}}$ involves an extra module named navigator (Zheng & Zhou, 2021). We strictly follow the architecture used in Zheng & Zhou (2021), where the navigator is an MLP taking the pairwise feature distance as inputs. There is no time embedding used in the navigator as it is only used for the training at $t = T_{\mathrm{Trunc}}$ . The feature is extracted from the layer before the final scalar output. Please refer to their Appendix D for detailed information. + +Architecture for text-to-image experiments: We adopt the 1.45B LDM model (Rombach et al., 2022) that is pretrained on LAION-400M dataset (Schuhmann et al., 2021). The LDM model consists of a U-Net KL-regularized autoencoder with downsampling-factor 8 (resolution $256\mathrm{-} > 32$ ), a U-Net in the latent space, and a BERT (Devlin et al., 2018) text encoder transform raw text to a sequence of 1280-dimension embeddings. We only fine-tune the latent model in our experiments. In the training of the truncated part, the discriminator takes the first-half of the U-Net (downsampling backbone) with a linear predicting head on top of it. + +Architecture for toy experiments: The generator uses an architecture stacked with 4 linear layers with 128 hidden units. Each intermediate layer is equipped with a time-embedding layer and follows softplus activation. The discriminator and navigator have the same architecture, without time-embedding layers, and using leakyReLU as the activation function. + +# D.6.2 TRAINING CONFIGURATIONS + +Datasets: We use CIFAR-10 (Krizhevsky et al., 2009), LSUN-bedroom, and LSUN-Church (Yu et al., 2015) datasets for unconditional generation in the main experiments. Additionally, we apply CelebA(Liu et al., 2015) and CelebA-HQ (Lee et al., 2020) for complementary justification. For text-to-image experiments, we use CUB-200 (Welinder et al., 2010) and MS-COCO (Lin et al., 2014). The images consist of $32 \times 32$ pixels for CIFAR-10. For the other datasets, we apply center-crop along the short edge and resize to the target resolution ( $64 \times 64$ for CelebA; $256 \times 256$ for the others). + +Diffusion schedule: For all datasets, we strictly follow the diffusion process used in our backbone models, and instantiate the truncated diffusion schedule by obtaining the first $T_{\mathrm{Trunc}}$ diffusion rates $\{\beta_1,\dots,\beta_{T_{\mathrm{Trunc}}}\}$ . For example, if our goal is to fit a model with NFE=50, to truncate the diffusion process used in Ho et al. (2020) $(\beta_{1} = 10^{-4},\beta_{T} = 0.02,\mathrm{T} = 1000)$ , we first initialize $\beta_{1},\beta_{2},\ldots \beta_{1000}$ and then taking the first 49 steps to complete the truncation. + +**Optimization:** We train our models using the Adam optimizer (Kingma & Ba, 2015), where most of the hyperparameters match the setting in Xiao et al. (2022), and we slightly modify the generator learning rate to match the setting in Ho et al. (2020), as shown in Table 8. + +We train our models using V100 GPUs, with CUDA 10.1, PyTorch 1.7.1. The training takes approximately 2 days on CIFAR-10 with 4 GPUs, and a week on CelebA-HQ and LSUN-Church with 8 GPUs. Table 8: Optimization hyper parameters + +Table 8: Optimization hyper-parameters. + +
CIFAR10CelebACelebA-HQLSUN
Initial learning rate for discriminator10-410-410-410-4
Initial learning rate for navigator (if applicable)10-410-410-410-4
Initial learning rate for generator1 × 10-51 × 10-52 × 10-52 × 10-5
Adam optimizer β10.50.50.50.5
Adam optimizer β20.90.90.90.9
EMA0.99990.99990.99990.9999
Batch size1281286464
# of training iterations800k800k0.5M2.4M(卧室)/1.2M(church)
# of GPUs4888
+ +For TDPM+, where we use StyleGAN2 generator as $G_{\psi}$ , we directly use their original training hyper-parameters and train the model in parallel with the diffusion model. For TLDM, we set the base learning rate as $10^{-5}$ and the mini-batch size is set to 64. For the ImageNet1K-64×64 experiments, we use StyleGAN-XL generator as $G_{\psi}$ and strictly follow all the default training hyper-parameters. To simplify the implementation and save computation, instead of applying the default progressive growing pipeline $16 \times 16 \rightarrow 32 \times 32 \rightarrow 64 \times 64$ , we directly train the implicit model on $64 \times 64$ + +images corrupted at $T_{\mathrm{Trunc}}$ . Without using the progressive growing pipeline, the result of StyleGAN-XL shown in Table 2 is clearly worse than the progressive one reported in their paper (FID 1.51). However, when used as the implicit model of TDPM, the final performance of TDPM becomes competitive with this result. + +Evaluation: When evaluating the sampling time, we use models trained on CIFAR-10 and generate a batch of 128 samples. When evaluating the FID, and recall score, following the convention, we use 50k generated samples for CIFAR-10, LSUN-bedroom and LSUN-church, 30k samples for CelebAHQ (since the CelebA HQ dataset contains only 30k samples), 30k samples for the text-to-image datasets. The recall scores are calculated with the recipe in Kynkänniemi et al. (2019). In the sampling stage, we follow our backbone to apply the same guidance in the diffusion part $(t < T_{\mathrm{Trunc}})$ if applicable. Specifically, for LDM backbone, we use classifier-free guidance (Ho & Salimans, 2022) with scale 1.5 and there are no DDIM steps for TDLM. + +# D.7 ADDITIONAL RESULTS ON UNCONDITIONAL GENERATION + +Table 9: Full comparison of unconditional generation on CIFAR-10. Models are grouped by the orders of sampling steps, with the best FID, and Recall in each group marked in bold. The TDPM+ results are produced using ADM and StyleGAN2 backbone. TDPM with NFE=1 is equivalent to training a GAN with the DDPM architecture as the generator. + +
ModelNFE ↓FID↓Recall ↑
Improved DDPM (Nichol & Dhariwal, 2021)40002.90-
UDM (Kim et al., 2021)20002.33-
Likelihood SDE (Song et al., 2021a)20002.87-
Score SDE (VE) (Song et al., 2021b)20002.200.59
Score SDE (VP) (Song et al., 2021b)20002.410.59
NCSN (Song & Ermon, 2019)100025.3-
Adversarial DSM (Jolicoeur-Martineau et al., 2020)10006.10-
VDM (Kingma et al., 2021)10004.00
D3PMs (Austin et al., 2021)10007.34-
DiffuseVAE (Pandey et al., 2022), T=100010008.72-
DDPM (Ho et al., 2020)10003.210.57
Recovery EBM (Gao et al., 2021)1809.58-
Gotta Go Fast (Jolicoeur-Martineau et al., 2021)1802.44-
LSGM (Vahdat et al., 2021)1472.100.61
Probability Flow (VP) (Song et al., 2021b)1403.080.57
DiffuseVAE (Pandey et al., 2022), T=10010011.71-
TDPM, Trunc=99 (ours)1002.970.57
TDPM+, Trunc=99 (ours)1002.830.58
FastDDPM, T=50 (Kong & Ping, 2021)503.410.56
DDIM, T=50 (Song et al., 2020)504.670.53
SNGAN+DGflow (Ansari et al., 2021)259.620.48
TDPM, Trunc=49 (ours)503.110.57
TDPM+, Trunc=49 (ours)502.960.58
Progressive distillation (Salimans & Ho, 2022)82.57-
Denoising Diffusion GAN (Xiao et al., 2022), T=884.360.56
Progressive distillation (Salimans & Ho, 2022)43.00-
Denoising Diffusion GAN (Xiao et al., 2022), T=443.750.57
TDPM, Trunc=4 (ours)53.510.55
TDPM+, Trunc=4 (ours)53.170.57
Progressive distillation (Salimans & Ho, 2022)24.51-
Denoising Diffusion GAN (Xiao et al., 2022), T=224.080.54
TDPM, Trunc=1 (ours)24.470.53
TDPM+, Trunc=1 (ours)23.860.56
DDPM Distillation (Luhman & Luhman, 2021)19.360.51
SNGAN (Miyato et al., 2018)121.70.44
AutoGAN (Gong et al., 2019)112.40.46
TransGAN (Jiang et al., 2021)19.26-
StyleGAN2 w/o ADA (Karras et al., 2020a)18.320.41
StyleGAN2 w/ ADA (Karras et al., 2020a)12.920.46
StyleGAN2 w/ Diffaug (Zhao et al., 2020)15.790.42
Progressive distillation (Salimans & Ho, 2022)19.12-
Denoising Diffusion GAN (Xiao et al., 2022), T=1114.60.19
TDPM, Trunc=0 (ours)17.340.46
+ +![](images/a73ccc3b059f26b0507398416ff6f7b90b2627c4e05f88380677d1a09b6d0d09.jpg) +Figure 13: Qualitative results on CIFAR-10 and CelebA $(64\times 64)$ + +![](images/5db85f3b5ae5340020594d96ea3f0ea6f3f55f457453e3ec339be4145c17b923.jpg) + +![](images/f5cda5f507ecb11bf6addfa33b0396aff6506d5b8e3823514698e5b2a9ad9976.jpg) + +![](images/6857c9439bd4279ece738e8cc404db8bfdc987da12658a3dd7715558241a3464.jpg) + +![](images/846bb208aac9fb80db4c8b58af4948fa364d90dcf3b85e374278e7ebdc9b884b.jpg) +Figure 14: Qualitative results of TDPM on LSUN-Church $(256\times 256)$ , with $T_{\mathrm{trunc}} = 99$ , 49, and 4. Note NFE $= T_{\mathrm{trunc}} + 1$ in TDPM. Each group presents generated samples from $p_{\theta}(\mathbf{x}_0)$ (left) and $p_{\theta}(\mathbf{x}_{T_{\mathrm{trunc}}})$ (right). + +![](images/e68ab407bf93350532e0815237fe39733a8a66e1a37a1398fc1828b47d867961.jpg) + +![](images/47e1ff3c34bb045b5da478f4ede063f096ab501ba35d9e7c589f2c1982012317.jpg) + +![](images/987ba252b6564d73541f176553daba433ad7609083583b4127505ebd8dc79027.jpg) +Figure 15: Analogous qualitative results to Figure 14 on LSUN-Bedroom. Produced by TDPM. + +![](images/6700a3113695de78dfe21e576fcd8e670589bd5552b5a625b8baba237d3b63aa.jpg) + +![](images/bf4b33fce841cb82fbd3031a8217b84a4d301a0d7f3a36c8d88f696897080883.jpg) + +![](images/ce72fc299c1878ba1228bc9bf0a3502b91b0c25f68b7d7bf37b3f9eafe596aeb.jpg) +Figure 16: Analogous qualitative results to Figure 14 on CelebA-HQ. Produced by TDPM. + +![](images/006da6e40a02b9bff68fb09fb382631c6e18601b452e4fb7193c9298f9353a72.jpg) + +![](images/cf13bf70d91cb81b547ad02df0a4328f3e6309d4c3980ff2329c99cefee1f2ef.jpg) + +![](images/26b4a7612bcb31ad03b67bd7652e0a79898f2b8e3ca7f78034411f500c361a0d.jpg) +Figure 17: Analogous qualitative results to Figure 14 on LSUN-Church. Produced by TDPM-CT. + +![](images/7d17f4c265b3132d876c01b4f9a35744917c2bae5e93196c852f9e0cfb5a929b.jpg) + +![](images/2a04192f0b53433274e36143a61f28763409239e973ea2c2676edfbfe9666aab.jpg) + +![](images/9e65dc5b3f1350e7838d121d77f4f1f52cad8218a0dce7c4595072f72a773015.jpg) +Figure 18: Analogous qualitative results to Figure 14 on LSUN-Bedroom. Produced by TDPM-CT. + +![](images/c6f1d9437c213c3004cfa3d585c07f8f3aed5cff9b7e941eddda019858476ac6.jpg) + +![](images/38f12cc81d09e5e65fd6e746478d500b40d2666eba0d6b5bb54c56fbd990a70f.jpg) + +![](images/7695c1ed4d2e74ceadeef499c2f4d3ecbbd3aad82f6262bc77a1b365f68ba843.jpg) +Figure 19: Analogous qualitative results to Figure 14 on CelebA-HQ. Produced by TDPM-CT. + +![](images/75ca44505ae34b41f778b72a1302d28311821487c107d2f3ca406c4a3b5fba5e.jpg) + +![](images/1d080cacf010c95051a1eddb62f311f7986e2e074aef2d8f62bedebcd0581a22.jpg) + +# D.8 ADDITIONAL RESULTS ON TEXT-TO-IMAGE GENERATION + +![](images/ea86d80dd38a98baf0d41670580e9c3327fbde599f096d89005cf748b8440695.jpg) +A white and gray bird with black wings. + +![](images/3e4c18d017cfc0bc9b37dd8121197b601f26a6f7e65bef2724c68b3a94779403.jpg) +An airplan flying over a body of water. + +![](images/b669f693293469f7167c9b4707a121939f3a3f39e46b59462dac1042755c7c07.jpg) +A sign reads "TDPM". + +![](images/515eadbd7e93b6a6d0bc45a9e9c8b7911fca6653f235906bc2506facd45b94ee.jpg) +Busy city street at dusk with sun setting. +Figure 20: Additional text-to-image generation results with different text prompt, produced by TLDM with $T_{\mathrm{trunc}} = 49$ . + +![](images/1c7c0f9f5197c1cff0da3f4961686df4cbfa6775af9437729f2b8b7c63670d59.jpg) +A cluster of flower on the wooden table. + +![](images/ebd5da06769985b32929f37a210e7b90b2339d999317c6fe4ab8ac4d8520a490.jpg) +The bathroom has a big mirror. + +![](images/2d3b28502713c2b8c31661364de0a68080a9e6b0bbcbacff99a826ee6c32c520.jpg) +The bagel is put in a square plate. + +![](images/18bd5ab553d17d1a60fe9f22eaf9dee1e874d31024bb7904cc1295b594e18f59.jpg) +A clock tower near the river. +Figure 21: Additional text-to-image generation results with different text prompt, produced by TLDM with $T_{\mathrm{trunc}} = 4$ . \ No newline at end of file diff --git a/truncateddiffusionprobabilisticmodelsanddiffusionbasedadversarialautoencoders/images.zip b/truncateddiffusionprobabilisticmodelsanddiffusionbasedadversarialautoencoders/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..399294ed15b7ee55b81603f264d3197f512f8bd7 --- /dev/null +++ b/truncateddiffusionprobabilisticmodelsanddiffusionbasedadversarialautoencoders/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:55bcf7227620530bcb64dc1bde95db238fbcbc64b3b062225ac6e1c63d253957 +size 2498278 diff --git a/truncateddiffusionprobabilisticmodelsanddiffusionbasedadversarialautoencoders/layout.json b/truncateddiffusionprobabilisticmodelsanddiffusionbasedadversarialautoencoders/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..337e5e1b9e75e0728a43cb1e533a0f079002dc2e --- /dev/null +++ b/truncateddiffusionprobabilisticmodelsanddiffusionbasedadversarialautoencoders/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:02e642c6a4fd76f33a96ff16e31b67212fd5571ae7b3e48bbc4429edcf6fd6b2 +size 882945 diff --git a/truthfulselfplay/7faf5be5-98f6-441a-bc20-a78c9114ad92_content_list.json b/truthfulselfplay/7faf5be5-98f6-441a-bc20-a78c9114ad92_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..523ee564604e73d784fd1769ab682feb9510fb50 --- /dev/null +++ b/truthfulselfplay/7faf5be5-98f6-441a-bc20-a78c9114ad92_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f3af921025b5d1f69e2c861432b6ff092b2151bc85977752ff58582bcf9d1f8a +size 127210 diff --git a/truthfulselfplay/7faf5be5-98f6-441a-bc20-a78c9114ad92_model.json b/truthfulselfplay/7faf5be5-98f6-441a-bc20-a78c9114ad92_model.json new file mode 100644 index 0000000000000000000000000000000000000000..0184e5f1251fb44fe29c81aa336d3bf1671a8402 --- /dev/null +++ b/truthfulselfplay/7faf5be5-98f6-441a-bc20-a78c9114ad92_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:46a58223d645c8ea28580eb53adcfd5c936ebe1c75fcde21b45a98aadaa11403 +size 152536 diff --git a/truthfulselfplay/7faf5be5-98f6-441a-bc20-a78c9114ad92_origin.pdf b/truthfulselfplay/7faf5be5-98f6-441a-bc20-a78c9114ad92_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c702ccb550606250f557fbd42976b120b3483d73 --- /dev/null +++ b/truthfulselfplay/7faf5be5-98f6-441a-bc20-a78c9114ad92_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9fc28860a192a64373958e691de893cce6f1e19f7c089ac939a3db75114b90c2 +size 2848610 diff --git a/truthfulselfplay/full.md b/truthfulselfplay/full.md new file mode 100644 index 0000000000000000000000000000000000000000..bae202f69ca147bbc3afbae38637109269450322 --- /dev/null +++ b/truthfulselfplay/full.md @@ -0,0 +1,582 @@ +# TRUTHFUL SELF-PLAY + +# Shohei Ohsawa + +Founder & CEO + +Daisy AI + +6-13-9 Ginza, Chuo-ku, Tokyo, Japan + +o@daisy.inc + +# ABSTRACT + +We present a general framework for evolutionary learning to emergent unbiased state representation without any supervision. Evolutionary frameworks such as self-play converge to bad local optima in case of multi-agent reinforcement learning in non-cooperative partially observable environments with communication due to information asymmetry. Our proposed framework is a simple modification of self-play inspired by mechanism design, also known as reverse game theory, to elicit truthful signals and make the agents cooperative. The key idea is to add imaginary rewards using the peer prediction method, i.e., a mechanism for evaluating the validity of information exchanged between agents in a decentralized environment. Numerical experiments with predator prey, traffic junction and StarCraft tasks demonstrate that the state-of-the-art performance of our framework. + +# 1 INTRODUCTION + +Evolving culture prevents deep neural networks from falling into bad local optima (Bengio, 2012). Self-play (Samuel, 1967; Tesauro, 1995) has not only demonstrated the ability to abstract high-dimensional state spaces as typified by AlphaGo (Silver et al., 2017), but also improved exploration coverage in partially observable environments. Communication (Sukhbaatar et al., 2016; Singh et al., 2019) exchanges their internal representations such as explored observation and hidden state in RNNs. Evolutionary learning is expected to be a general framework for creating superhuman AIs as such learning can generate a high-level abstract representation without any bias in supervision. + +However, when applying evolutionary learning to a partially observable environment with non-cooperative agents, improper bias is injected into the state representation. This bias originates from the environment. A partially observable environment with non-cooperative agents induces actions that disable an agent from honestly sharing the correct internal state resulting in the agent taking actions such as concealing information and deceiving other agents at equilibrium (Singh et al., 2019). The problem arises because the agent cannot fully observe the state of the environment, and thus, it does not have sufficient knowledge to verify the information provided by other agents. Furthermore, neural networks are vulnerable to adversarial examples (Szegedy et al., 2014) and are likely to induce erroneous behavior with small perturbations. Many discriminative models for information accuracy are available; these include GANs (Goodfellow et al., 2014; Radford et al., 2016) and curriculum learning (Lowe et al., 2020). However, these models assume that accurate samples can be obtained by supervision. Because of this assumption, is it impossible to apply these models to a partially observable environment, where the distribution is not stable. + +We generalize self-play to non-cooperative partially observable environments via mechanism design (Myerson, 1983; Miller et al., 2005), which is also known as reverse game theory. The key idea is to add imaginary rewards by using the peer prediction method (Miller et al., 2005), that is, a mechanism for evaluating the validity of information exchanged between agents in a decentralized environment, which is calculated based on social influence on the signals. We formulate the non-cooperative partially observable environment as an extension of the partially observable stochastic games (POSG) (Hansen et al., 2004); introduce truthfulness (Vickrey, 1961), which is an indicator of the validity of state representation. We show that the imaginary reward enables us to reflect the bias of state representation on the gradient without oracles. + +As the first contribution, we propose truthful self-play (TSP) and analytically demonstrate convergence to the global optimum (Section 4). We propose the imaginary reward on the basis of the peer prediction method (Miller et al., 2005) and apply it to self-play. The mechanism affects the gradient of the local optima, but not the global optima. The trick is to use the actions taken by the agents as feedback to verify the received signal from the every other agent, instead of the true state, input, and intent, which the agents cannot fully observe. TSP only requires a modification of the baseline function for self-play; it drastically improves the convergence to the global optimum in Comm-POSG. + +As the second contribution, based on the results of numerical experiments, we report that the TSP achieved state-of-the-art performance for various multi-agent tasks made of up to 20 agents (Section 5). Using predator prey (Barrett et al., 2011), traffic junction (Sukhbaatar et al., 2016; Singh et al., 2019), and StarCraft (Synnaeve et al., 2016) environments, which are typically used in Comm-POSG research, we compared the performances of TSP with the current neural nets, including the state-of-the-art method, with LSTM, CommNet (Sukhbaatar et al., 2016), and IC3Net (Singh et al., 2019). We report that the model with IC3Net optimized by TSP has the best performance. + +This work is the first attempt to apply mechanism design to evolutionary learning. TSP is a general optimization algorithm whose convergence is theoretically guaranteed for arbitrary policies and environments. Since no supervision is required, TSP has a wide range of applications to not only game AIs (Silver et al., 2017), but also the robots (Jaderberg et al., 2018), chatbots (Gupta et al., 2019; Chevalier et al., 2019), and autonomous cars (Tang, 2019) employed in multiagent tasks. + +Notation: Vectors are columns. Let $\llbracket n\rrbracket \coloneqq \{1,\dots ,n\}$ . $\mathbb{R}$ is a set of real numbers. $\pmb{i}$ is the imaginary unit. Re $u$ and Im $u$ are a real and an imaginary part of complex number $u$ , respectively. $n$ -tuple are written as boldface of the original variables $\mathbf{a} \coloneqq \langle a_1, \ldots, a_n \rangle$ , and $\mathbf{a}_{-i}$ is a $(n - 1)$ -tuple obtained by removing the $i$ -th entry from $\mathbf{a}$ . Let $\mathbf{1} \coloneqq (1, \ldots, 1)^{\mathrm{T}}$ . Matrices are shown in uppercase letters $\mathcal{L} \coloneqq (\ell_{ij})$ . $E$ is the unit matrix. The set of probability distributions based on the support $\mathcal{X}$ is described as $\mathfrak{P}(\mathcal{X})$ . + +# 2 RELATED WORK + +Neural communication has gained attention in the field of multiagent reinforcement learning (MARL) for both discrete (Foerster et al., 2016) and continuous (Sukhbaatar et al., 2016; Singh et al., 2019) signals. Those networks are trained via self-play to exchange the internal state of the environment stored in the working memory of recurrent neural networks (RNNs) to learn the right policy in partially observable environments. + +The term self-play was coined by the game AI community in the latter half of the century. Samuel (Samuel, 1967) introduced self-play as a framework for sharing a state-action value among two opposing agents to efficiently search the state space at Checkers. TD-Gammon (Tesauro, 1995) introduced self-play as a framework to learn $\mathrm{TD}(\lambda)$ (Sutton & Barto, 1998) and achieve professional-grade levels in backgammon. AlphaGo (Silver et al., 2017) defeated the Go champion by combining supervised learning with professional game records and self-play. AlphaZero (Silver et al., 2018) successfully learnt beyond its own performance entirely based on self-play. All these studies explain that eliminating the bias of human knowledge in supervision is the advantage of self-play. + +Self-play is also known as evolutionary learning (Bengio, 2012) in the deep learning community mainly as an approach to emerging representations without supervision (Bansal et al., 2018; Balduzzi et al., 2019). Bansal et al. (2018) show that competitive environments contribute to emerging diversity and complexity. Rich generative models such as GANs (Goodfellow et al., 2014; Radford et al., 2016) are frameworks for acquiring an environmental model by employing competitive settings. RNNs such as world models (Ha & Schmidhuber, 2018; Eslami et al., 2018) are capable of more comprehensive ranges of exploration in partially observable environments and generation of symbols and languages (Bengio, 2017; Gupta et al., 2019; Chevalier et al., 2019). The difference between evolutionary learning and supervised learning is the absence of human knowledge and oracles. + +Several works have formalized those in which the agents exchange environmental information as a formal class of the games such as Dec-POMDP-Com (Goldman & Zilberstein, 2003) and COM-MTDP (Pynadath & Tambe, 2002), and several frameworks are proposed to aim to solve the problems. However, the limitation of the frameworks is that they assume a common reward. As there are yet no formal definition of non-cooperative communication game, we formalize such a game to + +Comm-POSG as a superset of POSGs (Hansen et al., 2004), a more general class of multi-agent games including the cases of non-cooperativity (Hansen et al., 2004). + +To the best of our knowledge, there are no studies that have introduced truthful mechanisms into the field of MARL, but it may be possible to introduce it by using agents that can learn flexibly, such as neural networks. A typical truthful mechanism is the VCG mechanism (Vickrey, 1961), which is a generalization of the pivot method used in auction theory, but whereas the subject of the report that must satisfy truthfulness must be a valuation (or a value function if interpreted from a RL perspective). In this study, the scope of application is different because the belief states of the environment are subject to reporting. Therefore, we introduce instead a peer prediction method (Miller et al., 2005) that guarantees truthfulness with respect to reporting beliefs about arbitrary probability distributions using proper scoring rules (Gneiting & Raftery, 2007). + +# 3 PROBLEM DEFINITION + +# 3.1 COMM-POSG + +A communicative partially-observable stochastic game (Comm-POSG) is a class of non-cooperative Bayesian games in which every agent does not fully observe the environment but interacts each other. We define Comm-POSG as an extension of POSG (Hansen et al., 2004) with a message protocol. + +Definition 3.1 (Hansen et al., 2004) POSG $\langle n, T, S, \mathcal{A}, \mathcal{X}, \mathcal{T}, \mathcal{P}, \mathcal{R} \rangle$ is a class for multi-agent decision making under uncertainty in which the state evolves over time $1 \leq t \leq T$ , where + +- $n$ is the number of agents, +- $T$ is a horizon i.e., the episode length, +- $S$ is a set of discrete/continuous state $s_t \in S$ with an initial probabilistic distribution $p(s_0)$ , +- $\mathcal{A}$ is a set of discrete/continuous action $a_{ti} \in \mathcal{A}$ , +- $\mathcal{X}$ is a set of discrete/continuous observation $x_{ti} \in \mathcal{X}$ , +- $\mathcal{T} \in \mathfrak{P}(\mathcal{S} \times \mathcal{A} \times \mathcal{S})$ is state transition probability, +- $\mathcal{P} \in \mathfrak{P}\left(\mathcal{S} \times \mathcal{X}^n\right)$ is an observation probability, and +- $\mathcal{R}: \mathcal{S} \times \mathcal{A}^n \to \mathbb{R}^n$ is a reward function that outputs an $n$ -dimensional vector. $\square$ + +In Comm-POSGs, every agent further follows a message protocol $\mathcal{Z}^{n\times n}$ , where $\mathcal{Z}$ is the discrete/continuous signal space. The complete information exchanged among the agent in time is $\mathbf{Z}_t$ , where $\mathbf{Z}_t\coloneqq (z_{tij})_{i,j\in [[n]]}\in \mathcal{Z}^{n\times n}$ is a signal matrix in which $(i,j)$ -th entry $z_{tij}$ represents a signal from Agent $i$ to Agent $j$ at $t$ . The $i$ -th diagonal entry of $\mathbf{Z}_t$ , $h_{ti}\coloneqq z_{tii}$ represents the pre-state, an internal state of $i$ -th agent before receiving the singals from the others. A game in Comm-POSG is denoted as $\mathcal{G}\coloneqq \langle n,T,\mathcal{S},\mathcal{A},\mathcal{X},\mathcal{T},\mathcal{P},\mathcal{R},\mathcal{Z}\rangle$ . + +The objective of Comm-POSG is social welfare (Arrow, 1963) defined by the following, + +$$ +J := \sum_ {i = 1} ^ {n} V ^ {\pi_ {i}}; \quad V ^ {\pi_ {i}} := \mathbb {E} _ {\pi_ {i}} \left[ \sum_ {t = 1} ^ {T} \gamma^ {t - 1} r _ {t i} \right], \tag {1} +$$ + +where $\gamma \in [0,1]$ is discount rate, $r_{ti}$ is reward $\pi_i$ is a stochastic policy, and $V^{\pi_i}$ is the value function. + +In extensive-form games including Comm-POSG, in addition to the information in the environment, the information of other agents cannot be observed. In the optimization problem under these assumptions, a policy converges to a solution called the Bayesian Nash equilibrium (BNE) (Fudenberg, 1993). We denote the social welfare at the BNE is $J^{*}$ , and the global maximum $\hat{J}$ . In general, $J^{*} \neq \hat{J}$ holds, which is closely related to the information asymmetry. + +# 3.2 COMMUNICATIVE RECURRENT AGENTS + +In order to propose an optimization algorithm in this paper, we do not propose a concrete structure of the network, but we propose an abstract structure that can cover existing neural communication models (Sukhbaatar et al., 2016; Singh et al., 2019), namely communicative recurrent agents (CRAs) $\langle f_{\phi},\sigma_{\phi},q_{\phi},\pi_{\theta}\rangle$ , where + +- $f_{\phi}(\hat{h}_{t - 1,i},x_{ti}) \mapsto \mathcal{Z}$ is a deep RNN for the high-dimensional input $x_{ti} \in \mathcal{X}$ and the previous post-state $\hat{h}_{t - 1,i} \in \mathcal{Z}$ , with a parameter $\phi$ and an initial state $\hat{h}_0 \in \mathcal{Z}$ , +- $\sigma_{\phi}(\mathbf{z}_{ti}|h_{ti})$ is a stochastic messaging policy for a pre-state $h_{ti} \coloneqq f_{\phi}(\hat{h}_{t - 1,i},x_{ti})$ +- $q_{\phi}(\hat{h}_{ti}|\hat{\mathbf{z}}_{ti})$ is a stochastic model for a post-state $\hat{h}_{ti} \in \mathcal{Z}$ and the received messages $\hat{\mathbf{z}}_{ti} := \mathbf{Z}_{t:i}^{\mathrm{T}} = (z_{t1i}, \ldots, z_{t,i-1,i}, h_{ti}, z_{t,i+1,i}, \ldots, z_{tni})^{\mathrm{T}}$ , and +- $\pi_{\theta}(a_{ti}|\hat{h}_{ti})$ is the stochastic action policy with a parameter $\theta$ . + +These agents are trained through self-play using on-policy learning such as REINFORCE (Williams, 1992). All $n$ -agents share the same weight per episode, and the weights are updated based on the cumulative reward after the episode. + +In addition to the recurrent agent's output of actions with the observation series as input, the CRA has signals for communication as input and output. CRAs estimate current state of the environment and current value of the agent herself based on the post-state model with the pre-state $h_{ti}$ in the hidden layer of the RNN and the received signals $\hat{\mathbf{z}}_{ti, -i}$ from other agents. Hence, the veracity of the signals $\mathbf{z}_{ti}$ is the point of contention. + +# 3.3 TRUTHFULNESS + +In mechanism design, a truthful game (Vickrey, 1961) is a game in which all agents make an honest reporting in the Bayesian Nash equilibrium. In Comm-POSGs, the truthfulness of the game is achieved if all the sent signal equals the pre-state $z_{tij} = h_{ti}$ i.e., all the agent share a complete information. In such case, every agent has the same information $\hat{\mathbf{z}}_{ti} = \mathbf{h}_{ti} \coloneqq (h_{t1},\dots,h_{tn})^{\mathrm{T}}$ for all $i$ 's and the same post-state model probability distribution, and hence the mean of the cross entropy between the distributions below will be minimized. + +$$ +D _ {\phi} \left(\mathbf {Z} _ {t}\right) := \frac {1}{n} \sum_ {i = 1} ^ {n} \mathbb {H} \left[ q _ {\phi} \left(\hat {h} _ {t i} \mid \hat {\mathbf {z}} _ {t i}\right) \right] + \frac {1}{n ^ {2}} \sum_ {i = 1} ^ {n} \sum_ {j = 1} ^ {n} \mathcal {D} _ {\mathrm {K L}} \left(q _ {\phi} \left(\hat {h} _ {t i} \mid \hat {\mathbf {z}} _ {t i}\right) \mid | q _ {\phi} \left(\hat {h} _ {t j} \mid \hat {\mathbf {z}} _ {t j}\right)\right). \tag {2} +$$ + +The first term represents the entropy of knowledge each agent has about the environment, and the second the information asymmetry between the agents. $D_{\phi}$ is a lower bound on the amount of true information the environment has $\mathbb{H}[p(s_t)]$ . Since achieving truthfulness is essentially the same problem as minimizing $D_{\phi}$ , it also maximizes $J^{*}$ simultaneously. + +Proposition 3.1. (global optimality) For any games $\mathcal{G}$ in Comm-POSG, if $D_{\phi}(\mathbf{Z}_t) = \mathbb{H}[p(s_t)]$ for $0 \leq t \leq T$ and $\mathcal{R}_i$ is symmetric for any permutation of $i \in [[n]]$ , $J^{*}(\mathcal{G}) = \hat{J}(\mathcal{G})$ holds. + +Proof. Let $\mathbf{w} \coloneqq \langle \theta, \phi \rangle$ on a parameter space $\mathcal{W}(\mathcal{G})$ , and $\mathcal{W}^*(\mathcal{G})$ the BNE. Since $J$ is obviously maximized if $\sigma_{\phi}$ is truthful, we prove $\sigma_{\phi}$ must be truthful under a given condition. To this end, we show the following Pareto-optimality. + +Lemma 3.1. For any $\mathcal{G}$ in Comm-POSG and given $\mathbf{w}$ , if $J(\mathbf{w}) \geq J(\mathbf{w}^{\prime})$ holds for any $\mathbf{w}^{\prime} \in \mathcal{W}(\mathcal{G})$ , then either of $U(\mathbf{w}) \geq U(\mathbf{w}^{\prime})$ or $\mathcal{D}_{\mathrm{KL}}(p||q_{\phi}) \leq \mathcal{D}_{\mathrm{KL}}(p||q_{\phi^{\prime}})$ holds, where + +$$ +U (\mathbf {w}) := \mathbb {E} _ {q _ {\phi}} \left[ V ^ {\pi_ {\theta}} \right] = \int_ {s _ {t} \in \mathcal {S}, \hat {\mathbf {z}} _ {t} \in \mathcal {Z} ^ {n}} V ^ {\pi_ {\theta}} \left(s _ {t}\right) \mathrm {d} q _ {\phi} \left(s _ {t} \mid h _ {t i}, \mathbf {z} _ {t, - i}\right) \mathrm {d} \sigma_ {\phi} (\hat {\mathbf {z}} _ {t}). \tag {3} +$$ + +Proof. The first inequality $U(\mathbf{w}) \geq U(\mathbf{w}^{\prime})$ indicates that $\mathbf{w}$ is on the BNE $\mathcal{W}^{*}(\mathcal{G})$ given $\phi$ , and of the second that the belief state $q_{\phi}$ is as close to the true state $p$ as possible. On a fully-observable environment, from the theorem of value iteration, there exists the solution $\pi^{\star}(s_t)$ w.r.t. $V^{\pi^{\star}}(s_t)$ for any $s_t \in S$ . We name $\pi^{\star}$ and $V^{\star} \coloneqq V^{\pi^{\star}}$ the unbiased policy and value, respectively. + +Since the unbiased policy solves the objective as $J(\mathbf{w}) = n\mathbb{E}_{p(s_t)}[V^{\pi_\theta}(s_t)]$ from Eq (1), the goal intrinsicity is to find the policy $\pi^{*}$ as close as $\pi^{\star}$ for $\langle \pi^{*},\phi^{*}\rangle \in \mathcal{W}(\mathcal{G})$ , that maximizes $U(\mathbf{w})$ . The $\pi^{*}$ further can be represented as a mixed policy made of a couple of the unbiased policy $\pi^{\star}$ and a biased policy $\pi^{\prime}\neq \pi^{\star}$ as follows, + +$$ +\begin{array}{l} \pi^ {*} (a _ {t i} | \mathbf {x} _ {t i}, \phi) = \mathbb {E} _ {q _ {\phi} (s _ {t i} | \mathbf {x} _ {t i})} [ \pi^ {\star} (a _ {t i} | s _ {t i}) ] \\ = q _ {\phi} \left(s _ {t 0} \mid \mathbf {x} _ {t i}\right) \pi^ {*} \left(a _ {t i} \mid s _ {t 0}\right) + \left(1 - q _ {\phi} \left(s _ {t 0} \mid \mathbf {x} _ {t i}\right)\right) \pi^ {\prime} \left(a _ {t i} \mid \phi , \mathbf {x} _ {t i}\right), \tag {4} \\ \end{array} +$$ + +for the observations $\mathbf{x}_{ti} \in \mathcal{X}^n$ , where $s_{t0} \in S$ is the true state. Hence + +$$ +\begin{array}{l} V ^ {\pi^ {*}} (s _ {t 0} | \phi) = \mathbb {E} _ {\mathcal {P} (\mathbf {x} _ {t i} | s _ {t 0})} [ q _ {\phi} (s _ {t 0} | \mathbf {x} _ {t i}) V ^ {\star} (s _ {t 0}) + (1 - q _ {\phi} (s _ {t 0} | \mathbf {x} _ {t i})) V ^ {\prime} (\mathbf {x} _ {t i} | \phi)) ] \\ = q _ {\phi} \left(s _ {t 0}\right) V ^ {\star} \left(s _ {t 0}\right) + \mathbb {E} _ {\mathcal {P} \left(\mathbf {x} _ {t i} \mid s _ {t 0}\right)} \left[ \left(1 - q _ {\phi} \left(s _ {t 0} \mid \mathbf {x} _ {t i}\right)\right) V ^ {\prime} \left(\mathbf {x} _ {t i} \mid \phi\right) \right] \\ = q _ {\phi} \left(s _ {t 0}\right) V ^ {\star} \left(s _ {t 0}\right) + \left(1 - q _ {\phi} \left(s _ {t 0}\right)\right) \bar {V} ^ {\prime} \left(s _ {t 0} \mid \phi\right), \tag {5} \\ \end{array} +$$ + +where + +$$ +V ^ {\prime} \left(\mathbf {x} _ {t i} \mid \phi\right) := \int_ {\mathbf {s} _ {t} \in \mathcal {S} ^ {n + 1}, \mathbf {a} _ {t} \in \mathcal {A} ^ {n}} \mathcal {R} _ {i} \left(s _ {t 0}, \mathbf {a} _ {t}\right) \prod_ {i = 1} ^ {n} \mathrm {d} \pi^ {\prime} \left(a _ {t i} \mid s _ {t i}\right) q _ {\phi} \left(s _ {t i} \mid \mathbf {x} _ {t i}\right), \tag {6} +$$ + +and + +$$ +\bar {V} ^ {\prime} \left(s _ {t 0} \mid \phi\right) := \mathbb {E} _ {\mathcal {P} \left(\mathbf {x} _ {t i} \mid s _ {t 0}\right)} \left[ V ^ {\prime} \left(\mathbf {x} _ {t i} \mid \phi\right) \frac {1 - q _ {\phi} \left(s _ {t 0} \mid \mathbf {x} _ {t i}\right)}{1 - q _ {\phi} \left(s _ {t 0}\right)} \right]. \tag {7} +$$ + +Thus, the error from the unbiased value function can be written as $V^{\star}(s_{t0}) - V^{\pi^{*}}(s_{t0}|\phi) = (1 - q_{\phi}(s_{t0}))(V^{\star}(s_{t0}) - \bar{V}'(s_{t0}|\phi))$ , which is minimized if $q_{\phi}(s_{t0}) = 1$ as $V^{\star}(s_{t0}) > \bar{V}'(s_{t0}|\phi)$ by the definition. From the Jensen's equation, + +$$ +\begin{array}{l} \log \mathbb {E} _ {p (s _ {t 0})} [ q _ {\phi} (s _ {t 0}) ] \geq \mathbb {E} _ {p (s _ {t 0})} [ \log q _ {\phi} (s _ {t 0}) ] \\ = - \mathcal {D} _ {\mathrm {K L}} (p | | q _ {\phi}) - \mathbb {H} [ p ]. \tag {8} \\ \end{array} +$$ + +The right-hand side of the equation corresponds to the negative cross-entropy to be maximized. Therefore, as the second term $\mathbb{H}[p]$ depends not on $\phi$ , the optimization is achieved by minimizing $\mathcal{D}_{\mathrm{KL}}(p||q_{\phi})$ . + +Suppose that $\hat{J}(\mathcal{G}) = J(\mathbf{w}) > J^{*}(\mathcal{G})$ for a non-truthful reporting policy s.t. $\sigma_{\phi}(h|h) < 1$ . From lemma 3.1, $q_{\phi}(s_t|h_{ti})$ for an internal state $h_{ti} = f(x_{ti})$ of Agent $i$ with an encoder $f$ minimizes $\mathcal{D}_{\mathrm{KL}}(p||q_{\phi}(s_t|h_{ti}))$ . As that $q_{\phi}(s_t|z_{ti}) \neq q_{\phi}(s_t|h_{ti})$ and $\mathcal{D}_{\mathrm{KL}}(p||q_{\phi}(s_t|z_{ti})) > \mathcal{D}_{\mathrm{KL}}(p||q_{\phi}(s_t|h_{ti}))$ contradicts the Pareto-optimality, $\sigma_{\phi}$ must be truthful. $\square$ + +# 4 PROPOSED FRAMEWORK + +An obvious way to achieve truthful learning is to add $D_{\phi}$ as a penalty term of the objective, but there are two obstacles to this approach. One is that the new regularization term also adds a bias to the social welfare $J$ , and the other is that $D_{\phi}$ contains the agent's internal state, post-state $\hat{h}_{ti}$ , so the exact amount cannot be measured by the designer of the learner. If post-states are reported correctly, then pre-states should also be reported honestly, and thus truthfulness is achieved. Therefore, it must be assumed that the post-states cannot be observed during optimization. + +Our framework, truthful self-play (TSP), consists of two elements: one is the introduction of imaginary rewards, a general framework for unbiased regularization in Comm-POSG, and the other is the introduction of peer prediction method (Miller et al., 2005), a truthful mechanism to encourage honest reporting based solely on observable variables. In the following, each of them is described separately and we clarify that the proposed framework converges to the global optimum in Comm-POSG. We show the whole procedure in Algorithm 1. + +# 4.1 IMAGINARY REWARD + +Imaginary rewards are virtual rewards passed from an agent and have a different basis $i$ than rewards passed from the environment, with the characteristic that they sum to zero. Since the most of RL environments, including Comm-POSG, are of no other entities than agent and environment, two-dimensional structure are sufficient to describe them comprehensively if we wish to distinguish the sender of the reward. To remain the social welfare of the system is real, the system must be designed so that the sum of the imaginary rewards, i.e., imaginary part of the social welfare, is zero. In other words, it is not observed macroscopically and affects only the relative expected rewards of agents. The real and imaginary parts of the complex rewards are ordered by the mass parameter $\beta$ during training, which allows the weights of the network to maintain a real structure. + +The whole imaginary reward is denoted as $i\mathbf{Y} = (iy_{ij})_{i,j \in [n]}$ where $iy_{ij}$ is the imaginary reward passed from Agent $i$ to Agent $j$ , and the complex reward for the whole game is $\mathbf{R}^{+} := \mathbf{R} + i\mathbf{Y}$ where $\mathbf{R}$ is a diagonal matrix with the environmental reward $r_i$ as $(i,i)$ -th entry. We write $\mathcal{G}[i\mathbf{Y}]$ as the structure in which this structure is introduced. In this case, the following proposition holds. + +Proposition 4.1. For any $\mathcal{G}$ in Comm-POSG, if $\mathcal{G}[i\mathbf{Y}]$ is truthful and $\mathbf{R}^{+}$ is an Hermitian matrix, $J^{*}(\mathcal{G}[i\mathbf{Y}]) = \hat{J} (\mathcal{G})$ holds. + +Proof. Since $\mathcal{G}[i\mathbf{Y}]$ is truthful, $J^{*}(\mathcal{G}[i\mathbf{Y}]) = \hat{J} (\mathcal{G}[i\mathbf{Y}])$ holds from Proposition 3.1. Further, since $\mathbf{R}^+$ is Hermitian, $iy_{ij} = -iy_{ji}$ , and hence $\operatorname {Im}\hat{J} (\mathcal{G}[i\mathbf{Y}]) = 0$ holds; $\hat{J} (\mathcal{G}[i\mathbf{Y}]) = \hat{J} (\mathcal{G})$ holds. + +This indicates that the BNE could be improved by introducing imaginary rewards: $J^{*}(\mathcal{G}[i\mathbf{Y}]) \geq J^{*}(\mathcal{G})$ . Also, since $\sum_{i=1}^{n} \sum_{j=1}^{n} iy_{ij} = 0$ from the condition that $\mathbf{R}^{+}$ is Hermitian, the imaginary rewards affect not the social welfare of the system, which is a macroscopic objective, but only the expected rewards of each agent. The baseline in policy gradient (Williams, 1992) is an example of a function that affects not the objective when the mean gets zero. However, the baseline function is a quantity that is determined based on the value function of a single agent, whereas the imaginary reward is different in that (1) it affects the value function of each agent and (2) it is a meaningful quantity only when $n \geq 2$ and is not observed when $n = 1$ . + +# 4.2 PEER PREDICTION MECHANISM + +The peer prediction mechanism (Miller et al., 2005) is derived from a mechanism design using proper scoring rules (Gneiting & Raftery, 2007), which aims to encourage verifiers to honestly report their beliefs by assigning a reward measure score to their responses when predicting probabilistic events. These mechanisms assume at least two agents, a reporter and a verifier. + +The general scoring rule can be expressed as $\mathcal{F}(p_s\| s)$ where $p_{s}$ is the probability of occurrence reported by the verifier for the event $s$ , and $\mathcal{F}(p_s\| s)$ is the score to be obtained if the reported event $s$ actually occurred. The scoring rule is proper if an honest declaration consistent with the beliefs of the verifier and the reported $p_{s}$ maximizes the expected value of the earned score, and it is strictly proper if it is the only option for maximizing the expected value. A representative example that is strictly proper is the logarithmic scoring rule $\mathcal{F}(p_s\| s) = \log p_s$ , where the expected value for a 1-bit signal is the cross-entropy $p_s^*\log p_s + (1 - p_s^*)\log (1 - p_s)$ for belief $p_s^*$ . One can find that $p_{s} = p_{s}^{*}$ is the only report that maximizes the score. + +Since the proper scoring rule assumes that events $s$ are observable, it is not applicable to problems such as partial observation environments where the true value is hidden. Miller et al. (2005), who first presented a peer prediction mechanism, posed scoring to a posterior of the verifiers that are updated by the signal, rather than the event. This concept is formulated by a model that assumes that an event $s$ emits a signal $z$ stochastically and infers the type of $s$ by the signal of the reporters who receive it. The peer prediction mechanism (Miller et al., 2005) is denoted as $\mathcal{F}(p(s|z)\|s)$ under the assumption that (1) the type of event $s$ and the signal $z$ emitted by each type follow a given prior, (2) the priors are shared knowledge among verifiers, and (3) the posterior is updated according to the reports. + +We apply the mechanism to RL, i.e., the problem of predicting the agent's optimal behavior $a_{ti} \sim \pi_{\theta}|s_t$ for the true state $s_t \in S$ . In self-play, the conditions of 1 and 2 can be satisfied because the prior $\pi_{\theta}$ is shared among the agents, and furthermore, the post-state in Comm-POSG corresponds to 3, so that the peer prediction mechanism can be applied to the problem of predicting agent behavior. To summarize the above discussion, we can see that we can allocate a score matrix $\mathcal{L}_t$ as follows, + +$$ +\mathcal {L} _ {t} := \left(\ell \left(a _ {t i} \mid z _ {t j i}\right)\right) _ {i, j \in [ n ]}; \quad \ell \left(a _ {t i} \mid z _ {t j i}\right) := \mathcal {F} \left(\pi_ {\theta} \left(a _ {t i} \mid z _ {t j i}\right) \| a _ {t i}\right) = \log \pi_ {\theta} \left(a _ {t i} \mid z _ {t j i}\right), \tag {9} +$$ + +which is an $n$ -order square matrix representing the score from Agent $i$ to Agent $j$ . + +# 4.3 THE TRUTHFUL SELF-PLAY + +In TSP, a truthful system is constructed by introducing a proper scoring rule into imaginary rewards. However, since the score matrix obtained from the proper scoring rule does not satisfy Hermitianity, we perform zero-averaging by subtracting the mean of the scores from each element of the matrix, + +Algorithm 1 The truthful self-play (TSP). + +Require: Comm-POSG $\mathcal{G} = \langle n,T,\mathcal{S},\mathcal{A}^{+},\mathcal{X},\mathcal{T},\mathcal{P},\mathcal{R}^{+}\rangle$ , recurrent neural network $\langle \sigma_{\phi},q_{\phi},\pi_{\theta}\rangle$ with initial weight $\mathbf{w}_0 = \langle \theta_0,\phi_0\rangle$ and initial state $h_0$ , learning rate $\alpha >0$ , and mass parameter $\beta \geq 0$ + +Initialize $\mathbf{w}\gets \mathbf{w}_0$ + +for each episode do + +Genesis: $s_1\sim p(s)$ $\hat{h}_{0i}\gets h_0\forall i\in [[n]]$ + +for $t = 1$ to $T$ do + +1. Self-Play Observe $\mathbf{x}_t\sim \mathcal{P}^n (\cdot |s_t)$ Update pre-state $h_{ti}\gets f_{\phi}(\hat{h}_{t - 1,i},x_{ti}),\quad \forall i\in [[n]]$ Generate message $\mathbf{z}_{ti}\sim \sigma_{\phi}(\cdot |h_{ti})$ $\forall i\in [[n]]$ Send message $\mathbf{Z}_t\gets (\mathbf{z}_{t1},\dots ,\mathbf{z}_{tn})$ Receive the message $\hat{\mathbf{z}}_{ti}\gets \mathbf{Z}_{t:i}^{\mathrm{T}},\quad \forall i\in [[n]]$ Update post-state $\hat{h}_{ti}\sim q_{\phi}(\cdot |\hat{\mathbf{z}}_{ti}),\quad \forall i\in [[n]]$ Act $a_{ti}\sim \pi_{\theta}(\cdot |\hat{h}_{ti}),\quad \forall i\in [[n]]$ Get the real reward $\mathbf{r}_t\gets \mathcal{R}(s_t,\mathbf{a}_t)$ + +2. Compute the score matrix with peer prediction mechanism (Miller et al., 2005), + +$$ +\ell_ {i j} \leftarrow \left\{ \begin{array}{l l} \log \pi_ {\theta} \left(a _ {j} \mid z _ {i}\right) & (i \neq j) \forall i, j \in [ n ]; \\ 0 & (i = j) \end{array} \right. \tag {12} +$$ + +3. Combine real and imaginary rewards and construct a complex reward. + +$$ +\mathbf {R} _ {t} ^ {+} \leftarrow \mathbf {R} _ {t} + 1 \Delta \mathcal {L}. \tag {13} +$$ + +4. Update the weights by policy gradient (Williams, 1992), + +$$ +\mathbf {g} _ {t} \leftarrow \sum_ {i = 1} ^ {n} r _ {t i} ^ {+} \nabla_ {\mathbf {w}} \left[ \log \pi_ {\theta} \left(a _ {t i} | \hat {h} _ {t i}\right) + \log q _ {\phi} \left(\hat {h} _ {t i} \mid \hat {\mathbf {z}} _ {t i}\right) + \log \sigma_ {\phi} \left(z _ {t i} \mid \hat {h} _ {t - 1, i}, x _ {t i}\right) \right] \tag {14} +$$ + +$$ +\mathbf {w} \leftarrow \mathbf {w} + \alpha \operatorname {R e} \mathbf {g} _ {t} + \alpha \beta \operatorname {I m} \mathbf {g} _ {t} +$$ + +5. Proceed to the next state $s_{t + 1}\sim \mathcal{T}(\cdot |s_t,\mathbf{a}_t)$ + +end for + +end for + +return w + +thereby making the sum to zero. This can be expressed as follows using the graph Laplacian $\Delta := E - 11^{\mathrm{T}} / n$ . + +$$ +\mathbf {Y} = \Delta \mathcal {L} _ {\psi} = \frac {1}{n} \left[ \begin{array}{c c c c} n - 1 & - 1 & \dots & - 1 \\ - 1 & n - 1 & \dots & - 1 \\ \vdots & \vdots & \ddots & \vdots \\ - 1 & - 1 & \dots & n - 1 \end{array} \right] \left[ \begin{array}{c c c c} 0 & \ell_ {\psi} \left(a _ {t 2} \mid z _ {t 1}\right) & \dots & \ell_ {\psi} \left(a _ {t n} \mid z _ {t 1}\right) \\ \ell_ {\psi} \left(a _ {t 1} \mid z _ {t 2}\right) & 0 & \dots & \ell_ {\psi} \left(a _ {t n} \mid z _ {t 2}\right) \\ \vdots & \vdots & \ddots & \vdots \\ \ell_ {\psi} \left(a _ {t 1} \mid z _ {t n}\right) & \ell_ {\psi} \left(a _ {t 2} \mid z _ {t n}\right) & \dots & 0 \end{array} \right], \tag {10} +$$ + +to get + +$$ +\mathbf {R} ^ {+} = \mathbf {R} + i \Delta \mathcal {L} _ {\psi}, \tag {11} +$$ + +which is the formula that connects reinforcement learning and mechanism design. + +We show the truthful self-play (TSP) in Algorithm 1. The only modification required from self-play is the imaginary reward. + +Theorem 4.1. (global optimality) For any $\mathcal{G}$ in Comm-POSG, TSP converges to the global optimum $\hat{J}(\mathcal{G})$ if the following convergence condition are met, + +$$ +\sup _ {\phi} \left| \frac {\partial \operatorname {R e} V ^ {\pi_ {\theta}}}{\partial \operatorname {I m} V ^ {\pi_ {\theta}}} \right| < \beta , \tag {15} +$$ + +Table 1: Social welfare $J$ in five Comm-POSG tasks. PP- $n$ : Predator prey and TJ- $n$ : Traffic junction. All the scores are negatives. The experiment was repeated thrice. The average and standard deviation are listed. Bold is the highest score. The models listed in the top three rows show the models optimized by SP, and the bottom row shows IC3Net optimized by TSP. + +
PP-3PP-5TJ-5TJ-10TJ-20
SPLSTM1.92 ± 0.354.97 ± 1.3322.32 ± 1.0447.91 ± 41.2819.97 ± 438.7
CommNet1.54 ± 0.334.30 ± 1.146.86 ± 6.4326.63 ± 4.56463.91 ± 460.8
IC3Net1.03 ± 0.062.44 ± 0.184.35 ± 0.7217.54 ± 6.44216.31 ± 131.7
TSPIC3Net0.69 ± 0.142.34 ± 0.213.93 ± 1.4612.83 ± 2.50132.60 ± 17.91
+ +where $\beta < \infty$ is bounded mass parameter. + +Proof (in summary) From Proposition A.2, $[\beta \Delta \mathcal{L}_{\psi}]$ is unbiased truthful. Therefore, from Proposition A.1, convergence to the global optima is achieved. $\square$ + +# 5 NUMERICAL EXPERIMENT + +In this section, we establish the convergence of TSP through the results of numerical experiments with deep neural nets. We consider three environments for our analysis and experiments $(\rightarrow$ Fig. 1). (a) a predator prey environment (PP) in which predators with limited vision look for a prey on a square grid. (b) a traffic junction environment (TJ) similar to Sukhbaatar et al. (2016) in which agents with limited vision learn to signal in order to avoid collisions. (c) StarCraft: Brood Wars (SC) explore and combat tasks which test control on multiple agents in various scenarios where agent needs to understand and decouple observations for multiple opposing units. + +![](images/973aebbd9941c80ed5b8ec0d848d82efafdb3601c0013162b0a5b185851203e9.jpg) +a + +![](images/9ee0eb7bbafac7282b46b415fe4e84b94c70f16ac75a1f7c33f17ef92ebbc82e.jpg) +b + +![](images/dbd20616c3fb018c53cd4800d6e04ee27ad7eafb725f4af259647f1d88c92c18.jpg) +c +Figure 1: Experimental environments. a: Predator Prey (PP- $n$ ) (Barrett et al., 2011). Each agent receives $r_{ti} = -0.05$ at each time step. After reaching the prey, they receive $r_{ti} = 1/m$ , where $m$ is the number of predators that have reached the prey. b: Traffic Junction (TJ- $n$ ) (Sukhbaatar et al., 2016; Singh et al., 2019). $n$ cars with limited sight inform the other cars of each position to avoid a collision. The cars continue to receive a reward of $r_{ti} = -0.05$ at each time as an incentive to run faster. If cars collide, each car involved in the collision will receive $r_{ti} = -1$ . c: Combat task in StarCraft: Blood Wars (SC) (Synnaeve et al., 2016). + +We compare the performances of TSP with self-play (SP) and SP with curiosity (Houthooft et al., 2016) using three tasks belonging to Comm-POSG, comprising up to 20 agents. The hyperparameters are listed in the appendix. With regard CRAs, three models namely LSTM, CommNet (Sukhbaatar et al., 2016), and IC3Net (Singh et al., 2019), were compared. The empirical mean of the social welfare function $J$ was used as a measure for the comparison. IC3Net is an improvement over CommNet, which is a continuous communication method based on LSTM. Actor-critic and value functions were added to the baselines in all the frameworks. We performed 2,000 epochs of experiment with 500 steps, each using 120 CPUs; the experiment was conducted over a period of three days. + +PP and TJ: Table 1 lists the experimental results for each task. We can see that IC3Net with TSP outperforms the one with SP for all tasks. Fig. 2 (a) shows that TSP elicits truthful information, and + +![](images/74a18e210e5f4bff507f8d5115ff23f46b258bde953f5db3e53e7af043b0792c.jpg) +a + +![](images/685a144ef4ea2660583f42d829bc7d7aa1584edfc1c96628d4bf9e9cb52c488f.jpg) +b +Figure 2: Learning curves in three-agent predator prey (PP-3). a Truthfulness, the fraction of steps that the agent shares a true pre-state $(z_{ij} = h_i)$ , b the real part of the reward, and c the imaginary part. + +![](images/68ddd71aabc7f84111e956f778ef0a934a72381c610c4a5bd944c70f819dbb19.jpg) +c + +Table 2: StarCraft Results: TSP beats the baselines. The experiment was repeated thrice. All the scores are negatives. The average and standard deviation are listed. Bold is the highest score. + +
StarCraft taskCommNetIC3NetIC3Net w/ TSP
Explore-10Medic 50×501.592 ± 0.1692.276 ± 1.4271.364 ± 0.107
Combat-10Mv3Ze 50×503.202 ± 1.3823.815 ± 0.3921.717 ± 1.548
+ +(b) confirms that the social welfare of TSP exceeds that of the SPs. (c) confirms that the average of the imaginary part is zero. From these experimental results, we conclude that the TSP successfully realized truthful learning and state-of-the-art in tasks comprising 3 to 20 agents. + +StarCraft: Table 2 shows a comparison of social welfare in the exploration and combat tasks in StarCraft. (i) In the search task, 10 Medics find one enemy medic on a $50 \times 50$ -cell grid; similar to PP, the reward is a competitive task where the reward is divided by the number of medics found. (ii) In the combat task, 10 Marines versus 3 Zealots fight on a $50 \times 50$ cell grid. The maximum step of the episode is set at 60. We find that IC3Net, with its information-hiding gate, performs less well than CommNet but performs better when trained in TSP due to the truthful mechanism. + +# 6 CONCLUDING REMARK + +Our objective was to construct a general framework for emergent unbiased state representation without any supervision. Firstly, we proposed the TSP and theoretically clarified its convergence to the global optimum in the general case. Secondly, we performed experiments involving up to 20 agents and achieved the state-of-the-art performance for all the tasks. Herein, we summarize the advantages of our framework. + +1. Strong convergence: TSP guarantees convergence to the global optimum theoretically and experimentally; self-play cannot provide such a guarantee. Besides, the imaginary reward $i\Delta \mathcal{L}$ satisfies the baseline condition. +2. Simple solution: The only modification required for TSP is that $i\Delta \mathcal{L}$ should be added to the baseline in order to easily implement it for deep learning software libraries such as TensorFlow and PyTorch. +3. Broad coverage: TSP is a general framework, the same as self-play. Since TSP is independent of both agents and environments and supports both discrete and continuous control, it can be applied to a wide range of domains. No supervision is required. + +To the best of our knowledge, introducing mechanism design to MARL is a new direction for the deep-learning community. In future work, we will consider fairness (Sen, 1984) as the social choice function. We expect that many other frameworks will be developed by using the methodology employed in this study. + +# REFERENCES + +Kenneth J Arrow. Social choice and individual values. Yale university press, 1963. +David Balduzzi, Marta Garnelo, Yoram Bachrach, Wojciech M Czarnecki, Julien Perolat, Max Jaderberg, and Thore Graepel. Open-ended learning in symmetric zero-sum games. ICML, 2019. +Trapit Bansal, Jakub Pachocki, Szymon Sidor, Ilya Sutskever, and Igor Mordatch. Emergent complexity via multi-agent competition. *ICLR*, 2018. +Samuel Barrett, Peter Stone, and Sarit Kraus. Empirical evaluation of ad hoc teamwork in the pursuit domain. In AAMAS, 2011. +Yoshua Bengio. Evolving culture vs local minima. *arxiv:1203.2990*, 2012. +Yoshua Bengio. The consciousness prior. arXiv:1709.08568, 2017. +Lev M Bregman. The relaxation method of finding the common point of convex sets and its application to the solution of problems in convex programming. USSR computational mathematics and mathematical physics, 7(3):200-217, 1967. +Glenn W Brier. Verification of forecasts expressed in terms of probability. Monthly weather review, 78(1):1-3, 1950. +Maxime Chevalier, Dzmitry Bahdanau, Salem Lahlou, Lucas Willems, Chitwan Sahara, Thien Huu Nguyen, and Yoshua Bengio. BabyAI: First steps towards grounded language learning with a human in the loop. In ICLR, 2019. +SM Ali Eslami, Danilo Jimenez Rezende, Frederic Besse, Fabio Viola, Ari S Morcos, Marta Garnelo, Avraham Ruderman, Andrei A Rusu, Ivo Danihelka, Karol Gregor, et al. Neural scene representation and rendering. Science, 360(6394):1204-1210, 2018. +Jakob Foerster, Yannis Assael, Nando de Freitas, and Shimon Whiteson. Learning to communicate with deep multi-agent reinforcement learning. In NIPS, 2016. +Drew Fudenberg. Game theory. MIT Press, 1993. +Tilmann Gneiting and Adrian E Raftery. Strictly proper scoring rules, prediction, and estimation. Journal of the American Statistical Association, 102(477):359-378, 2007. +Claudia V Goldman and Shlomo Zilberstein. Optimizing information exchange in cooperative multi-agent systems. In Proceedings of the second international joint conference on Autonomous agents and multiagent systems, pp. 137-144, 2003. +Irving John Good. Rational decisions. In Breakthroughs in statistics, pp. 365-377. Springer, 1952. +Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In NIPS, 2014. +Abhinav Gupta, Ryan Lowe, Jakob Foerster, Douwe Kiela, and Joelle Pineau. Seeded self-play for language learning. In Proceedings of the beyond vision and language: integrating real-world knowledge, 2019. +David Ha and Jürgen Schmidhuber. World models. arXiv:1803.10122, 2018. +Eric A Hansen, Daniel S Bernstein, and Shlomo Zilberstein. Dynamic programming for partially observable stochastic games. In AAAI, volume 4, pp. 709-715, 2004. +Rein Houthooft, Xi Chen, Yan Duan, John Schulman, Filip De Turck, and Pieter Abbeel. VIME: Variational information maximizing exploration. In NIPS, 2016. +Max Jaderberg, Wojciech M Czarnecki, Iain Dunning, Luke Marris, Guy Lever, Antonio Garcia Castaneda, Charles Beattie, Neil C Rabinowitz, Ari S Morcos, Avraham Ruderman, et al. Human-level performance in first-person multiplayer games with population-based deep reinforcement learning. arXiv:1807.01281, 2018. + +Ryan Lowe, Abhinav Gupta, Jakob Foerster, Douwe Kiela, and Joelle Pineau. On the interaction between supervision and self-play in emergent communication. In ICLR, 2020. +Nolan Miller, Paul Resnick, and Richard Zeckhauser. Eliciting informative feedback: The peer-prediction method. Management Science, 51(9):1359-1373, 2005. +Roger B Myerson. Mechanism design by an informed principal. *Econometrica: Journal of the Econometric Society*, pp. 1767-1797, 1983. +David V Pynadath and Milind Tambe. The communicative multiagent team decision problem: Analyzing teamwork theories and models. Journal of artificial intelligence research, 16:389-423, 2002. +Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. *ICLR*, 2016. +Arthur L Samuel. Some studies in machine learning using the game of checkers. ii recent progress. IBM Journal of Research and Development, 11(6):601-617, 1967. +Amartya Sen. Collective choice and social welfare. Harvard University Press, 1984. +David Silver, Julian Schrittwieser, Karen Simonyan, Ioannis Antonoglou, Aja Huang, Arthur Guez, Thomas Hubert, Lucas Baker, Matthew Lai, Adrian Bolton, et al. Mastering the game of go without human knowledge. Nature, 550(7676):354-359, 2017. +David Silver, Thomas Hubert, Julian Schrittwieser, Ioannis Antonoglou, Matthew Lai, Arthur Guez, Marc Lanctot, Laurent Sifre, Dharshan Kumaran, Thore Graepel, et al. A general reinforcement learning algorithm that masters chess, shogi, and go through self-play. Science, 362(6419): 1140-1144, 2018. +Amanpreet Singh, Tushar Jain, and Sainbayar Sukhbaatar. Learning when to communicate at scale in multiagent cooperative and competitive tasks. In ICLR, 2019. +Sainbayar Sukhbaatar, Rob Fergus, et al. Learning multiagent communication with backpropagation. In NIPS, 2016. +R. S. Sutton and A. G Barto. Reinforcement learning: An introduction. A Bradford Book, 1998. +Gabriel Synnaeve, Nantas Nardelli, Alex Auvolat, Soumith Chintala, Timothee Lacroix, Zeming Lin, Florian Richoux, and Nicolas Usunier. Torchcraft: a library for machine learning research on real-time strategy games. arXiv preprint arXiv:1611.00625, 2016. +Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In *ICLR*, 2014. +Yichuan Tang. Towards learning multi-agent negotiations via self-play. In ICCV, 2019. +Gerald Tesauro. Temporal difference learning and td-gammon. Communications of the ACM, 38(3): 58-68, 1995. +William Vickrey. Counterspeculation, auctions, and competitive sealed tenders. The Journal of Finance, 16(1):8-37, 1961. +Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229-256, 1992. + +# A THEORY + +"...a human brain can learn such high-level abstractions if guided by the messages produced by other humans, which act as hints or indirect supervision for these high-level abstractions; and, language and the recombination and optimization of mental concepts provide an efficient evolutionary recombination operator, and this gives rise to rapid search in the space of communicable ideas that help humans build up better high-level internal representations of their world." (Bengio, 2012) + +Proposition A.1. If $[\mathcal{C}]$ is an unbiased truthful mechanism of $\mathcal{G}$ , self-play with $\mathcal{G}[\mathcal{C}]$ converges to $\hat{J}(\mathcal{G})$ . + +Proof. + +Since $[\mathcal{C}]$ is unbiased, $\mathbb{E}_{\pi_{\theta}}[\mathcal{C}_i] = 0$ holds. Hence, for an arbitrary baseline $b$ , $b + \mathcal{C}_i$ also satisfies the baseline condition. Therefore, from the policy gradient theorem (Sutton & Barto, 1998), self-play converges to $J^{*}(\mathcal{G}[\mathcal{C}])$ . Further, since $[\mathcal{C}]$ is an unbiased truthful mechanism, $J^{*}(\mathcal{G}[\mathcal{C}]) = \hat{J}(\mathcal{G}[\mathcal{C}]) = \hat{J}(\mathcal{G})$ holds from Proposition 3.1. + +A general loss function $\ell_{\psi}:\mathcal{A}\times \mathcal{Z}\to \mathbb{R}_{\infty}$ for any strictly concave nonnegative function $\psi$ .. $\mathfrak{P}(\mathcal{A})\to \mathbb{R}_{\infty}$ is defined as follows: + +$$ +\ell_ {\psi} := \mathcal {D} _ {\psi} \left(\pi_ {\theta} \left(a _ {j} \mid z _ {i}\right) \| \delta \left(a _ {j} \mid \cdot\right)\right), \tag {16} +$$ + +where $\delta(a_j|\cdot)$ is a point-wise probability that satisfies $\lim_{\epsilon \to 0} \int_{B(\epsilon; \tilde{a}_j)} \mathrm{d}\delta(a_j|\tilde{a}_j) = 1$ for an open ball $B(\epsilon; \tilde{a}_j)$ , and $\mathcal{D}_{\psi}$ is Bregman divergence (Bregman, 1967) defined by the following equation. + +$$ +\mathcal {D} _ {\psi} (p \| q) := \psi (p) - \psi (q) + \int \nabla \psi (q) \mathrm {d} (p - q). \tag {17} +$$ + +Sending a truthful signal is the best response to minimize the expectation of the general loss function. For example, KL-divergence is a special case of Bregman divergence when $\psi = -\mathbb{H}[\cdot]$ , and the following equation holds. + +$$ +\begin{array}{l} \mathbb {E} _ {\pi_ {\theta}} \left[ \ell_ {\psi} \right] = \int \mathcal {D} _ {\psi} \left(\pi_ {\theta} \left(a _ {j} \mid z _ {i}\right) \| \delta \left(a _ {j} \mid \cdot\right)\right) \mathrm {d} \pi_ {\theta} \left(a _ {j} \mid h _ {i}\right) \\ = \mathcal {D} _ {\mathrm {K L}} \left(\pi_ {\theta} \left(a _ {i} \mid z _ {i}\right) \mid \mid \pi_ {\theta} \left(a _ {i} \mid h _ {i}\right)\right) \geq 0. \tag {18} \\ \end{array} +$$ + +The equality holds if and only if $z_{i} = h_{i}$ . Notice that $\pi_{\theta}(a_i|h_i) = \pi_{\theta}(a_j|h_i)$ . Now, we generalize the zero-one mechanism to arbitrary signaling games. + +Proposition A.2. (Bregman mechanism) For any signaling games, if $\sup_{\phi} \| \mathrm{d}V^{\pi_{\theta}} / \mathrm{d}\beta \mathcal{I}_{\psi} \| < 1$ , $[\mathfrak{I}_{\psi}]$ is an unbiased truthful mechanism of $\mathcal{G} \in \mathfrak{G}$ for a general cost function: + +$$ +\mathcal {I} _ {\psi} (\mathbf {a} | \mathbf {z}) := \Delta \mathcal {L} _ {\psi} (\mathbf {a} | \mathbf {z}) \mathbf {1} = +$$ + +$$ +\left[ \begin{array}{c c c c} n - 1 & - 1 & \dots & - 1 \\ - 1 & n - 1 & \dots & - 1 \\ \vdots & \vdots & \ddots & \vdots \\ - 1 & - 1 & \dots & n - 1 \end{array} \right] \cdot \left[ \begin{array}{c c c c} 0 & \ell_ {\psi} (a _ {2} | z _ {1}) & \dots & \ell_ {\psi} (a _ {n} | z _ {1}) \\ \ell_ {\psi} (a _ {1} | z _ {2}) & 0 & \dots & \ell_ {\psi} (a _ {n} | z _ {2}) \\ \vdots & \vdots & \ddots & \vdots \\ \ell_ {\psi} (a _ {1} | z _ {n}) & \ell_ {\psi} (a _ {2} | z _ {n}) & \dots & 0 \end{array} \right] \left[ \begin{array}{l} 1 \\ 1 \\ \vdots \\ 1 \end{array} \right], \tag {19} +$$ + +where $\Delta \coloneqq nE - \mathbf{11}^{\mathrm{T}}$ is a graph Laplacian. + +Proof. + +The problem we dealt with is designing a scoring rule for information that satisfies two properties: 1) regularity, the score should be finite if the information is sufficiently correct, and 2) properness, the score should be maximized if and only if the information is true. The well-known example of the scoring rule is mutual information (MI), which compares a pair of probabilistic distributions $p$ and $q$ in the logarithmic domain. However, MI cannot apply to continuous actions. Instead, we introduce a more general tool, the regular proper scoring rule as defined below. + +Definition A.1. (Gneiting & Raftery, 2007) For a set $\Omega$ , $\mathcal{F}(\cdot \| \cdot): \mathfrak{P}(\Omega) \times \Omega \to \mathbb{R}_{\infty}$ is a regular proper scoring rule iff there exists a strictly concave, real-valued function $f$ on $\mathfrak{P}(\Omega)$ such that + +$$ +\mathcal {F} (p \| x) = f (p) - \int_ {\Omega} f ^ {*} (p (\omega), x) \mathrm {d} p (\omega) + f ^ {*} (p, x) \tag {20} +$$ + +for $p\in \mathfrak{P}(\Omega)$ and $x\in \Omega$ , where $f^{*}$ is a subgradient of $f$ that satisfies the following property, + +$$ +f (q) \geq f (p) + \int_ {\Omega} f ^ {*} (p, \omega) \mathrm {d} (q - p) (\omega) \tag {21} +$$ + +for $q \in \mathfrak{P}(\Omega)$ . We also define $\mathcal{F}$ for $q \in \mathfrak{P}(\Omega)$ as $\mathcal{F}(p\| q) := \int_{\Omega} \mathcal{F}(p\| x) \, \mathrm{d}q(x)$ , and describe a set of regular proper scoring rules $\mathfrak{B}$ . + +For $\mathcal{F},\mathcal{F}_1,\mathcal{F}_2\in \mathfrak{B}$ , the following property holds (Gneiting & Raftery, 2007). + +1. Strict concavity: if $q \neq p$ , then $\mathcal{F}(q \| q) > \mathcal{F}(p \| q)$ . +2. $\mathcal{F}_1(p\| q) + a\mathcal{F}_2(p\| q) + f(q)\in \mathfrak{B}$ where $a > 0$ and $f$ are not dependent on $p$ +3. $-\mathcal{D}_{\psi} \in \mathfrak{B}$ , where $\mathcal{D}_{\psi}$ is the Bregman divergence. + +Lemma A.1. For any $\mathcal{F} \in \mathfrak{B}$ and a function $\ell_{\mathcal{F}}$ defined as shown below, if $\sup_{\phi} \| \mathrm{d}V_{\theta}^{\pi} / \mathrm{d}\beta \ell_{\psi} \| < 1$ , then $[\ell_{\mathcal{F}}]$ is a truthful mechanism of $\mathcal{G}$ . + +$$ +\ell_ {\mathcal {F}} \left(a _ {j} \mid z _ {i}\right) := \left\{ \begin{array}{l l} - \mathcal {F} \left(\pi_ {\theta} \left(a _ {j} \mid z _ {i}\right) \| a _ {j}\right) & (i \neq j) \\ 0 & (i = j) \end{array} . \right. \tag {22} +$$ + +Proof. We prove that the surrogate objective of $\mathcal{G}[\ell_{\mathcal{F}}]$ , $V_{\beta}^{\pi_{\theta}} := V^{\pi_{\theta}} - \beta \ell_{\mathcal{F}}$ is strictly concave, and if $\nabla_{\phi} V_{\beta}^{\pi_{\theta}} = 0$ , then $z_i = h_i$ with probability 1. We denote $\hat{\phi}$ as the truthful parameter where $\sigma_{\hat{\phi}}(h_i | h_i) = 1$ . The policy gradient for $\phi$ is + +$$ +\begin{array}{l} \nabla_ {\phi} V _ {\beta} ^ {\pi_ {\theta}} \mathrm {d} q _ {\phi} = \nabla_ {\phi} V ^ {\pi_ {\theta}} \mathrm {d} q _ {\phi} + \beta \nabla_ {\phi} \int \mathcal {F} \left(\pi_ {\theta} \left(a _ {j} \mid z _ {i}\right) \| a _ {j}\right) \mathrm {d} \pi_ {\theta} \mathrm {d} q _ {\phi} \\ = \nabla_ {\phi} V ^ {\pi_ {\theta}} \mathrm {d} q _ {\phi} + \beta \nabla_ {\phi} \mathcal {F} \left(\pi_ {\theta} \left(a _ {j} \mid z _ {i}\right) \| \pi_ {\theta} \left(a _ {j} \mid h _ {i}\right)\right) \mathrm {d} q _ {\phi}. \tag {23} \\ \end{array} +$$ + +First, we consider the local optima, i.e., $\nabla_{\phi}V^{\pi_{\theta}}\mathrm{d}q_{\phi} = \mathbf{0}$ and $\phi \neq \hat{\phi}$ . For Gâteaux differential with respect to $\vec{\phi} \coloneqq (\hat{\phi} - \phi)^{\mathrm{T}} / \|\hat{\phi} - \phi\|$ , $\vec{\phi}\nabla V_{\beta}^{\pi_{\theta}} = \beta \vec{\phi}\nabla \ell_{\psi} > 0$ holds from the strict concavity. At the global optima i.e., $\nabla_{\phi}V^{\pi_{\theta}}\mathrm{d}q_{\phi} = \mathbf{0}$ and $\phi = \hat{\phi}$ , $\nabla_{\phi}V_{\beta}^{\pi_{\theta}} = \beta \nabla \ell_{\psi} = \mathbf{0}$ holds. Next, if $\vec{\phi}\nabla V^{\pi_{\theta}} < 0$ as $\sup_{\phi}\| \mathrm{d}V_{\theta}^{\pi} / \mathrm{d}\ell_{\mathcal{F}}\| < \beta$ , the following equation holds for $\phi \neq \hat{\phi}$ . + +$$ +\begin{array}{l} \vec {\phi} \nabla V _ {\beta} ^ {\pi_ {\theta}} d q _ {\phi} = \vec {\phi} (\nabla V ^ {\pi_ {\theta}} + \beta \nabla \ell_ {\mathcal {F}}) d q _ {\phi} \\ > \vec {\phi} \nabla V ^ {\pi_ {\theta}} \mathrm {d} q _ {\phi} + \sup _ {\phi} \left\| \frac {\mathrm {d} V}{\mathrm {d} \ell_ {\mathcal {F}}} \right\| \vec {\phi} \nabla \ell_ {\mathcal {F}} \mathrm {d} q _ {\phi} \\ \geq \vec {\phi} \nabla V ^ {\pi_ {\theta}} \mathrm {d} q _ {\phi} - \inf _ {\phi} (\vec {\phi} \nabla V ^ {\pi_ {\theta}}) \mathrm {d} q _ {\phi} \geq 0. \tag {24} \\ \end{array} +$$ + +Hence, $\vec{\phi} \nabla V_{\beta}^{\pi_{\theta}} \geq 0$ holds, and the equality holds if and only if $\phi = \hat{\phi}$ . Therefore, $V_{\beta}^{\pi_{\theta}}$ is strictly concave, and the following equation holds for $\alpha_{k} \in o(1 / k)$ . + +$$ +\lim _ {K \rightarrow \infty} \sum_ {k = 1} ^ {K} \frac {\nabla_ {\phi} V _ {\beta} ^ {\pi_ {\theta}} \left(\phi_ {k}\right)}{\| \nabla_ {\phi} V _ {\beta} ^ {\pi_ {\theta}} \left(\phi_ {k}\right) \|} \alpha_ {k} = \hat {\phi}. (a. s.) \square \tag {25} +$$ + +$\mathcal{I}_{\psi}$ is defined for both discrete and continuous actions. Table 3 lists examples of scoring rules $\ell_{\psi}$ for arbitrary actions. In particular, minimizing $\ell_{\psi}$ for continuous action is known as probability density estimation (Gneiting & Raftery, 2007). + +$-\mathcal{I}_{\psi}$ is a proper scoring rule (Gneiting & Raftery, 2007) since it is a linear combination of Bregman divergence. Hence, from Lemma A.1, $[i\mathcal{I}_{\psi}]$ is truthful. Besides, since $\mathbf{1}^{\mathrm{T}}\mathcal{I}_{\psi} = \mathbf{1}^{\mathrm{T}}\Delta \mathcal{L}_{\phi}\mathbf{1} = 0$ , $[i\mathcal{I}_{\psi}]$ is unbiased. + +Table 3: Examples of the scoring rules, where $\kappa >1$ , $\| p\|_{\kappa} = (\int p(a)^{\kappa}\mathrm{d}a)^{1 / \kappa}$ . Readers can refer to (Gneiting & Raftery, 2007) for examples of many other functions. + +
AZψ(p)ℓψ(a|z)
Zero-oneDiscreteDiscrete-p-πθ(a|z)
LogarithmicDiscreteContinuous-[H][p]- log πθ(a|z)
QuadraticDiscreteD/C∑a∈A p(a)2-12πθ(a|z) - ψ(πθ(·|z)) - 2
(Brier, 1950)ContinuousD/C||p||222πθ(a|z) - ||πθ(·|z)||22
PseudosphericalDiscreteContinuous(∑a∈A p(a)κ)1/κπθ(a|z)κ-1/ψ(πθ(·|z))κ-1
(Good, 1952)ContinuousContinuous||p||κ-1πθ(a|z)κ-1/||πθ(·|z)||κ-1
+ +![](images/57be668036429ef9cbf1afb6dc3540fe51418e532c9af9dd6727d90708011dee.jpg) +Figure 3: Left: One-bit two-way communication game $\mathcal{G}_{\mathrm{com}}^2$ . $S = \mathcal{A} = \{0,1\}$ , $\mathcal{X} = S \cup \{\circ\}$ and $p(s) = 1/2$ . Agents are given correct information from the environment with a probability of $\lambda > 0$ : $\mathcal{P}(s|s) = \lambda$ , $\mathcal{P}(\circ|s) = 1 - \lambda$ . $q_i(s|x_i,z_j)$ follows a Bernoulli distribution and estimates the state $p(s)$ of the environment from observations and signals $z_j \in \mathcal{Z} = \mathcal{X}$ . Let $h_i = x_i$ . Right: An example of the non-cooperative solutions: $s = 1$ , $\mathbf{x} = \langle \circ,1\rangle$ , $\mathbf{z} = \langle \circ,0\rangle$ , $\mathbf{a} = \langle 0,1\rangle$ , $\mathbf{r} = \langle -1,1\rangle$ and $r_1 + r_2 = 0 < 2c$ . + +![](images/f4a1be51ebf573030762fe8845c4551e6b3a120d9ad415f4b7209d3143908226.jpg) + +Theorem A.1. (global optimally) For any $\mathcal{G}$ in Comm-POSG, TSP converges to the global optimum $\hat{J}(\mathcal{G})$ if the following convergence condition are met, + +$$ +\sup _ {\phi} \left| \frac {\partial \operatorname {R e} V ^ {\pi_ {\theta}}}{\partial \operatorname {I m} V ^ {\pi_ {\theta}}} \right| < \beta , \tag {26} +$$ + +where $\beta < \infty$ is bounded mass parameter. + +Proof. + +From Proposition A.2, $[\mathbb{1}\mathcal{I}_{\psi}]$ is unbiased truthful. Therefore, from Proposition A.1, convergence to the global optima is achieved. + +# A.1 SELF-PLAY CONVERGES TO LOCAL OPTIMA + +Theorem A.2. If $\mathcal{G} \in \mathfrak{G}$ is non-truthful, self-play does not converge to the global optimum $\hat{J}(\mathcal{G})$ . + +Proof. + +Example A.1. (One-bit two-way communication game) Fig. 4 shows an example of a non-cooperative partially observable environment with 1-bit state. The reward structure is presented in Table 4. The sum of rewards is maximized when both agents report the correct state to the environment, + +$$ +\sum_ {i = 1} ^ {n} \mathcal {R} _ {i} ^ {n} (s, \mathbf {a}) = \left\{ \begin{array}{l l} 2 c & (a _ {1} = a _ {2} = s) \\ 0 & (\mathrm {o t h e r w i s e}) \end{array} \right.. +$$ + +Hence, the objective varies in the range $0 \leq J(\mathcal{G}_{\mathrm{com}}^2) \leq 2c$ . + +Proposition A.3. If $c < 1$ , $J^{*}(\mathcal{G}_{\mathrm{com}}^{2}) < \hat{J}(\mathcal{G}_{\mathrm{com}}^{2})$ holds. + +Proof. + +Table 4: $\mathcal{G}_{\mathrm{com}}^2$ 's reward function $\mathcal{R}^2 (s,\mathbf{a})$ $c > 0$ is a constant that determines the nature of the game. + +
(a1, r2)True sa2 False 1 - s
a1Ts(c, c)(1, -1)
F1 - s(-1, 1)(0, 0)
+ +Since $p(s) = 1/2$ , we can assume $s = 1$ without loss of generality. Besides, we discuss only Agent 1 because of symmetry. From $\mathcal{Z} = \{0,1\}$ , Agent 1's messaging policy $\sigma_1$ sends the correct information $x$ or false information $1 - x$ when it knows $x$ . Hence, we can represent the policy by using parameter $\phi \in [0,1]$ as follows. + +$$ +\sigma_ {\phi} (z | x) = \left\{ \begin{array}{l l} \phi^ {z} (1 - \phi) ^ {1 - z} & (x = 1) \\ 1 / 2 & (x = \circ) \end{array} , \right. \tag {27} +$$ + +Differentiating $\sigma_{\phi}$ with $\phi$ gives the following. + +$$ +\frac {\mathrm {d} \sigma_ {\phi}}{\mathrm {d} \phi} = \left\{ \begin{array}{l l} 2 z - 1 & (x = 1) \\ 0 & (x = \circ) \end{array} \right. \mathcal {G} _ {\text {c o m}} ^ {2}. \tag {28} +$$ + +Therefore, from Eq $(\ref{eq:1})$ , if $\langle \pi^*,\cdot \rangle \in \mathcal{W}^* (\mathcal{G}_{\mathrm{com}}^2)$ , then the policy gradient for $\phi$ is as follows. + +$$ +\begin{array}{l} \frac {\mathrm {d}}{\mathrm {d} \phi} U (\pi^ {*}, \phi) = \frac {\mathrm {d}}{\mathrm {d} \phi} \int V _ {1} ^ {*} \mathrm {d} q _ {1} \mathrm {d} \sigma_ {1} \mathrm {d} \mathcal {P} \mathrm {d} p = \int V _ {1} ^ {*} \mathrm {d} q _ {1} \frac {\mathrm {d} \sigma_ {1}}{\mathrm {d} \phi} \mathrm {d} \mathcal {P} \mathrm {d} p \\ = \lambda \int V _ {1} ^ {*} (2 z _ {1} - 1) \mathrm {d} z _ {1} \Bigg | _ {s = x _ {1} = 1} \\ = \lambda \int (2 z _ {1} - 1) \mathcal {R} _ {1} \mathrm {d} \pi_ {1} ^ {*} \mathrm {d} \pi_ {2} ^ {*} \mathrm {d} q _ {2} \mathrm {d} z _ {1} \mathrm {d} \mathcal {P} \Bigg | _ {s = x _ {1} = 1} \\ = \lambda (1 - \lambda) \int (2 z _ {1} - 1) \mathcal {R} _ {1} \mathrm {d} \pi_ {1} ^ {*} \mathrm {d} \pi_ {2} ^ {*} \mathrm {d} q _ {2} \mathrm {d} z _ {1} \Bigg | _ {s = x _ {1} = 1, x _ {2} = \circ} \\ = \lambda (1 - \lambda) \sum_ {z _ {1} = 0} ^ {1} (2 z _ {1} - 1) \mathcal {R} _ {1} (s, \langle x _ {1}, z _ {1} \rangle) \Bigg | _ {s = x _ {1} = 1} \\ = \lambda (1 - \lambda) \left[ \mathcal {R} _ {1} (1, \langle 1, 1 \rangle) - \mathcal {R} _ {1} (1, \langle 1, 0 \rangle) \right] \\ = \lambda (1 - \lambda) (c - 1) < 0. \tag {29} \\ \end{array} +$$ + +As the policy gradient is negative from the assumption of $c \in (0,1)$ , $\phi^{*} = 0$ gets the Nash equilibrium from $\phi \geq 0$ , thereby resulting in always sending false information to the opposite: + +$$ +\sigma_ {\phi^ {*}} (z | x) = \left\{ \begin{array}{l l} 1 - z & (x = 1) \\ 1 / 2 & (x = \circ) \end{array} . \right. \tag {30} +$$ + +Let $J\langle x_1,x_2\rangle \coloneqq J|_{\mathbf{x} = \langle x_1,x_2\rangle}$ . We can get $J^{*}$ and $\hat{J}$ as follows. + +$$ +\begin{array}{l} J ^ {*} = \int J ^ {*} \langle x _ {1}, x _ {2} \rangle \mathrm {d} \mathcal {P} ^ {2} \mathrm {d} p \\ = J ^ {*} \langle 1, 1 \rangle \lambda^ {2} + J ^ {*} \langle 1, \circ \rangle \cdot 2 \lambda (1 - \lambda) + J ^ {*} \langle \circ , \circ \rangle (1 - \lambda) ^ {2} \\ = 2 c \lambda^ {2} + 0 + 2 c / 2 ^ {2} \cdot (1 - \lambda) ^ {2} \\ = 2 c \left[ \lambda^ {2} + \frac {1}{4} (1 - \lambda) ^ {2} \right], \tag {31} \\ \end{array} +$$ + +and + +$$ +\begin{array}{l} \hat {J} = \int \hat {J} \langle x _ {1}, x _ {2} \rangle \mathrm {d} \mathcal {P} ^ {2} \mathrm {d} p \\ = \hat {J} \langle 1, 1 \rangle \lambda^ {2} + \hat {J} \langle 1, \circ \rangle \cdot 2 \lambda (1 - \lambda) + \hat {J} \langle \circ , \circ \rangle (1 - \lambda) ^ {2} \\ = 2 c \lambda^ {2} + 2 c \cdot 2 \lambda (1 - \lambda) + 2 c / 2 ^ {2} \cdot (1 - \lambda) ^ {2} \\ = 2 c \left[ \lambda^ {2} + 2 \lambda (1 - \lambda) + \frac {1}{4} (1 - \lambda) ^ {2} \right], \tag {32} \\ \end{array} +$$ + +respectively. Therefore, $\hat{J} - J^{*} = 4c\lambda (1 - \lambda) > 0$ , and $J^{*} < \hat{J}$ holds. + +From Proposition A.1, $\mathcal{G} = \mathcal{G}_{\mathrm{com}}^2$ is the counterexample that global optimally does not occur. + +# A.2 ZERO-ONE MECHANISM SOLVES $\mathcal{G}_{\mathrm{com}}^2$ + +Proposition A.4. (zero-one mechanism) Let $\ell : \mathcal{A} \times \mathcal{Z} \to \{0,1\}$ be a zero-one loss between an action and a message $\ell(a_i|z_j) := a_j(1 - z_i) + (1 - a_i)z_i$ , and + +$$ +\mathcal {I} (\mathbf {a} | \mathbf {z}) := \left[ \begin{array}{c c} 1 & - 1 \\ - 1 & 1 \end{array} \right] \left[ \begin{array}{c c} 0 & \ell \left(a _ {2} \mid z _ {1}\right) \\ \ell \left(a _ {1} \mid z _ {2}\right) & 0 \end{array} \right] \left[ \begin{array}{l} 1 \\ 1 \end{array} \right]. \tag {33} +$$ + +If $\beta > (1 - c)(1 - \lambda) / \lambda$ , then $[i\mathcal{I}]$ is an unbiased truthful mechanism of $\mathcal{G}_{\mathrm{com}}^2$ , and self-play with $\mathcal{G}_{\mathrm{com}}^2[\mathcal{I}]$ converges to the global optima $\hat{J}(\mathcal{G}_{\mathrm{com}}^2) = 2c[1 - 3/4 \cdot (1 - \lambda)^2]$ . + +Proof. + +The following equation holds. + +$$ +\begin{array}{l} \frac {\mathrm {d}}{\mathrm {d} \phi} V _ {\beta , 1} ^ {*} \mathrm {d} q _ {1} = \frac {\mathrm {d}}{\mathrm {d} \phi} \int \left(V _ {1} ^ {*} - \beta \mathcal {I} _ {1} \mathrm {d} \pi_ {2} ^ {*} \mathrm {d} q _ {2}\right) \mathrm {d} q _ {1} \\ = - \lambda (1 - \lambda) (1 - c) - \beta \int \mathcal {I} _ {1} d \pi_ {2} ^ {*} d q _ {1} d q _ {2} \frac {d \sigma_ {1}}{d \phi} d \sigma_ {2} d \mathcal {P} ^ {2} d p \\ = - \lambda (1 - \lambda) (1 - c) - \beta \lambda \int \mathcal {I} _ {1} \mathrm {d} \pi_ {2} ^ {*} \mathrm {d} q _ {2} (2 z _ {1} - 1) \mathrm {d} z _ {1} \mathrm {d} \sigma_ {2} \mathrm {d} \mathcal {P} \Bigg | _ {s = x _ {1} = 1} \\ = - \lambda (1 - \lambda) (1 - c) - \beta \lambda^ {2} \int (2 z _ {1} - 1) \ell \left(a _ {2} | z _ {1}\right) \mathrm {d} \pi_ {2} ^ {*} \mathrm {d} q _ {2} \mathrm {d} z _ {1} \Bigg | _ {s = x _ {1} = x _ {2} = 1} \\ = - \lambda (1 - \lambda) (1 - c) - \beta \lambda^ {2} \sum_ {z _ {1} = 0} ^ {1} (2 z _ {1} - 1) \ell (1 | z _ {1}) \\ = - \lambda (1 - \lambda) (1 - c) - \beta \lambda^ {2} (\ell (1 | 1) - \ell (1 | 0)) \\ = - \lambda (1 - \lambda) (1 - c) + \beta \lambda^ {2} \\ = \lambda^ {2} \left[ 1 - (1 - c) \frac {1 - \lambda}{\lambda} \right]. \tag {34} \\ \end{array} +$$ + +Therefore, if $\beta > (1 - c)(1 - \lambda) / \lambda$ , then $\phi^{*} = 1$ holds, and $J^{*} = \hat{J}$ holds. The value of $\hat{J}$ is clear from the proof of Lemma A.1. + +[1] is also known as the peer prediction method (Miller et al., 2005), which is inspired by peer review. This process is illustrated in Fig. 4 Left, and the state-action value functions are listed in Fig. 4 Right. + +# B COMPLEXITY ANALYSIS + +Although the computational complexity of $\beta \mathcal{I}_{\psi}$ per iteration is $O(n^{3})$ as it involves the multiplication of $n$ -order square matrices, we can reduce it to $O(n^{2})$ to obtain $\mathcal{I}_{\psi} = n\mathcal{L}_{\psi} - \mathbf{1}^{\mathrm{T}}\mathcal{L}_{\psi}\mathbf{1}$ . The spatial complexity is $O(n^{2})$ , and the sample size is $O(n)$ . + +![](images/72234922e83f898e67f8bd13b3b76e5f10eab44d6c277331edee6728e74b52e5.jpg) +Figure 4: Left: The information released by one agent $i$ is verified by another agent, and if the information is incorrect, a penalty is given. Right: State-action value function of $\mathcal{G}_{\mathrm{com}}^2[i\mathcal{I}]: Q_i(s_i, \langle z_i, \cdot \rangle)$ . + +
Truez2FalseUnobserved
z1T(c,c)(c+β,c-β)(c,c)
F(c-β,c+β)(c,c)(1,-1)
U(c,c)(-1,1)(c/4,c/4)
+ +# C EXPERIMENTAL ENVIRONMENTS + +In the experiment, we used two partial observation environments. This setting is the same as that adopted in existing studies (Sukhbaatar et al., 2016; Singh et al., 2019). Fig. 1 shows the environments. + +# C.1 PREDATOR PREY (PP) + +Predator-Prey (PP) is a widely used benchmark environment in MARL (Barrett et al., 2011; Sukhbaatar et al., 2016; Singh et al., 2019). Multiple predators search for prey in a randomly initialized location in the grid world with a limited field of view. The field of view of a predator is limited so that only a few blocks can be seen. Therefore, for the predator to reach the prey faster, it is necessary to inform other predators about the prey's location and the locations already searched. Thus, the prey's location is conveyed through communication among the predators, but predators can also send false messages to keep other predators away from the prey. + +In this experiment, experiments are performed using PP-3 and PP-5, which have two difficulty levels. In PP-3, the range of the visual field is set to 0 in a $5 \times 5$ environment. In PP-5, the field of view is set to 1 in a $10 \times 10$ environment. The numbers represent the number of agents. + +# C.2 TRAFFIC JUNCTION (TJ) + +Traffic Junction (TJ) is a simplified road intersection task. An $n$ body agent with a limited field of view informs the other bodies of its location to avoid collisions. In this experiment, the difficulty level of TJ is changed to three. TJ-5 solves the task of crossing two direct one-way streets. For TJ-10, there are two lanes, and each body can not only go straight, but also turn left or right. For TJ-20, the two-lane road will comprise two parallel roads, for a total of four intersections. Each number corresponds to $n$ . + +In the initial state, each vehicle is given a starting point and a destination and is trained to follow a determined path as fast as possible while avoiding collisions. The agent is in each body and takes two actions, i.e., accelerator and brake, in a single time step. It is crucial to ensure that other vehicles do not approach each other to prevent collision while making good use of multiagent communication. That is similar to blinkers and brake lights. + +# C.3 STARCAFT: BLOOD WARS (SC) + +Explore: In order to complete the exploration task, the agent must be within a specific range (field of view) of the enemy unit. Once the agent is within the enemy unit's field of view, it does not take any further action. The reward structure of the enemy unit is the same as the PP task, with the only difference being that the agent The point is that instead of being in the same place, you explore the enemy unit's range of vision and get a non-negative reward. Medic units that do not attack enemy units are used to prevent combat from interfering with the mission objective. For observation, for each agent, it is the agent's (absolute $x$ , absolute $y$ ) and the enemy's (relative $x$ , relative $y$ , visible), where visiblea is a visual range. If the enemy is not in exploration range, the relative $x$ and relative $y$ are zero. The agent has nine actions to choose from: eight basic directions and one stay action. + +Combat: Agents make their own observations (absolute $x$ , absolute $y$ , health point + shield, weapon cooldown, previous action) and (relative $x$ , relative $y$ , visible, health point + shield, weapon cooldown). Relative $x$ and $y$ are only observed when the enemy is visible, corresponds to a visible flag. All observations are normalized to lie between (0, 1). The agent must choose from 9+M actions, including 9 basic actions and 1 action to attack M agents. The attack action is only effective if the enemy is within the agent's view, otherwise is a no-problem. In combat, the environment doesn't compare to Starcraft's predecessors. The setup is much more difficult, restrictive, new and different, and therefore not directly comparable. + +In Combat task, we give a negative reward $r_{\text{time}} = -0.01$ at each time step to avoid delaying the enemy team's detection. When an agent is not participating in a battle, at each time step, the agent is rewarded with (i) normalized health status at the current and previous time step, and (ii) normalized health status at the previous time step displays the time steps of the enemies you have attacked so far and the current time step. The final reward for each agent consists of (i) all remaining health * 3 as a negative reward and (ii) $5 * \text{m} + \text{all remaining health} * 3$ as a positive reward if the agent wins. Give health*3 to all living enemies as a negative reward when you lose. In this task, a group of enemies is randomly initialized in half of the map. Thus the other half making communication-demanding tasks even more difficult. + +# D HYPERPARAMETERS + +Table 5: Hyperparameters used in the experiment. $\beta$ are grid searched in space $\{0.1, 1, 10, 100\}$ , and the best parameter is shown. The other parameters are not adjusted. + +
NotationValue
Agentsn{3,5,10,20}
Observationxti∈XR9
Internal statehti∈HR64
Messagezti∈ZR64
Actionsatii∈A{←,↑,↓,→,astop}
True statest∈S{0,1}25~400
Episode lengthT20
Learning rateα0.001
Truthful rateβ10
Discount rateγ1.0
Metricsψ- H[·]
\ No newline at end of file diff --git a/truthfulselfplay/images.zip b/truthfulselfplay/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..77511da99303cc2bfade1859b1928a33bf1cd58e --- /dev/null +++ b/truthfulselfplay/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c795ef67e40cd7c870e7b1909edce9a06ce705d903cd8e5a80c440bd295475c +size 648628 diff --git a/truthfulselfplay/layout.json b/truthfulselfplay/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..97d31c56bd7ac08c388747cb337a202dfd8fabe5 --- /dev/null +++ b/truthfulselfplay/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ebc69d00bc1e879717e3a34ff3290b09faab9a26114988003ea39df576436b12 +size 847316 diff --git a/tuningfrequencybiasinneuralnetworktrainingwithnonuniformdata/832fc415-b6ec-40b4-bec9-431e44e5a35a_content_list.json b/tuningfrequencybiasinneuralnetworktrainingwithnonuniformdata/832fc415-b6ec-40b4-bec9-431e44e5a35a_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..b281335c203c75adbc69f12ed54a511cadcc1587 --- /dev/null +++ b/tuningfrequencybiasinneuralnetworktrainingwithnonuniformdata/832fc415-b6ec-40b4-bec9-431e44e5a35a_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e0dfaff5a2b9832760a6b76c830bd2646261c685aa5c0ed3203f2c29348e061d +size 326846 diff --git a/tuningfrequencybiasinneuralnetworktrainingwithnonuniformdata/832fc415-b6ec-40b4-bec9-431e44e5a35a_model.json b/tuningfrequencybiasinneuralnetworktrainingwithnonuniformdata/832fc415-b6ec-40b4-bec9-431e44e5a35a_model.json new file mode 100644 index 0000000000000000000000000000000000000000..e44fcc7ab2e9b1ec2e5433c54dc49fec238f343b --- /dev/null +++ b/tuningfrequencybiasinneuralnetworktrainingwithnonuniformdata/832fc415-b6ec-40b4-bec9-431e44e5a35a_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:87f57b8a8da8ea683570aa76957cc450b01ffed824d52399b778a36a43ccf40a +size 364987 diff --git a/tuningfrequencybiasinneuralnetworktrainingwithnonuniformdata/832fc415-b6ec-40b4-bec9-431e44e5a35a_origin.pdf b/tuningfrequencybiasinneuralnetworktrainingwithnonuniformdata/832fc415-b6ec-40b4-bec9-431e44e5a35a_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0dc385eaf9d373490d6284462be6585137295692 --- /dev/null +++ b/tuningfrequencybiasinneuralnetworktrainingwithnonuniformdata/832fc415-b6ec-40b4-bec9-431e44e5a35a_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b10c0d88a876fdf91961798494d379d049624ab5aa744cfc4bcaa1477ee05d35 +size 1685445 diff --git a/tuningfrequencybiasinneuralnetworktrainingwithnonuniformdata/full.md b/tuningfrequencybiasinneuralnetworktrainingwithnonuniformdata/full.md new file mode 100644 index 0000000000000000000000000000000000000000..f5b0aece196e0b7d8fe7046fe7e87af95fe12934 --- /dev/null +++ b/tuningfrequencybiasinneuralnetworktrainingwithnonuniformdata/full.md @@ -0,0 +1,1639 @@ +# TUNING FREQUENCY BIAS IN NEURAL NETWORK TRAINING WITH NONUNIFORM DATA + +Annan Yu + +Cornell University + +ay262@cornell.edu + +Yunan Yang + +ETH Zürich + +yyn0410@gmail.com + +Alex Townsend + +Cornell University + +townsend@cornell.edu + +# ABSTRACT + +Small generalization errors of over-parameterized neural networks (NNs) can be partially explained by the frequency bias phenomenon, where gradient-based algorithms minimize the low-frequency misfit before reducing the high-frequency residuals. Using the Neural Tangent Kernel (NTK), one can provide a theoretical analysis for training where data are drawn from constant or piecewise-constant probability densities. Since most training data sets are not drawn from such distributions, we use the NTK model and a data-dependent quadrature rule to theoretically quantify the frequency bias of NN training given nonuniform data. By replacing the loss function with a selected Sobolev norm, we can amplify or dampen the intrinsic frequency bias in NN training. + +# 1 INTRODUCTION + +Neural networks (NNs) are often trained in supervised learning on a small data set. They are observed to provide accurate predictions for a large number of test examples that are not seen during training. A mystery is how training can achieve small generalization errors in an overparameterized NN and a so-called "double-descent" risk curve (Belkin et al., 2019). In recent years, a potential answer has emerged called "frequency bias," which is the phenomenon that in the early epochs of training, an overparameterized NN finds a low-frequency fit of the training data while higher frequencies are learned in later epochs (Rahaman et al., 2019; Yang & Salman, 2019; Xu, 2020). In addition to generalization errors, it is often useful to understand the convergence rate for each spectral component of the data mismatch to study the robustness of the NN under noises. Currently, frequency bias is theoretically understood via the Neural Tangent Kernel (NTK) (Jacot et al., 2018) for uniform training data (Arora et al., 2019; Cao et al., 2019; Basri et al., 2019) and data distributed according to a piecewise-constant probability measure (Basri et al., 2020). However, most training data sets in practice are highly clustered and not uniform. Yet, frequency bias is still observed during NN training (Fridovich-Keil et al., 2021), even though the theory is absent. This paper proves that frequency bias is present when there is nonuniform training data by using a new viewpoint based on a data-dependent quadrature rule. We use this theory to propose new loss functions for NN training that accelerate its convergence and improve stability with respect to noise. + +An NN function is a map $\mathcal{N}:\mathbb{R}^d\to \mathbb{R}$ given by + +$$ +\mathcal {N} (\mathbf {x}) = \mathbf {W} _ {N _ {L}} \sigma \left(\mathbf {W} _ {N _ {L} - 1} \sigma \left(\dots \left(\mathbf {W} _ {2} \sigma \left(\mathbf {W} _ {1} \mathbf {x} + \mathbf {b} _ {1}\right) + \mathbf {b} _ {2}\right) + \dots\right) + \mathbf {b} _ {N _ {L} - 1}\right) + \mathbf {b} _ {N _ {L}}, +$$ + +where $\mathbf{W}_i\in \mathbb{R}^{m_i\times m_{i - 1}}$ are weights, $m_0 = d$ , $\mathbf{b}_i\in \mathbb{R}^{m_i}$ are biases, and $N_{L}$ is the number of layers. Here, $\sigma$ is the activation function applied entry-wise to a vector, i.e., $\sigma (\mathbf{a})_j = \sigma (\mathbf{a}_j)$ . In this paper, we consider ReLU NNs, which are NNs for which $\sigma$ is the ReLU function given by $\mathrm{ReLU}(t) = \max (t,0)$ . Since $\mathrm{ReLU}(\alpha t) = \alpha \mathrm{ReLU}(t)$ for any $\alpha >0$ , we assume that the input of the NN is normalized so that $\mathbf{x}\in \mathbb{S}^{d - 1}$ . To introduce a continuous perspective, we assume that there is an underlying target function $g:\mathbb{S}^{d - 1}\to \mathbb{R}$ and the training samplers $\mathbf{x}_i$ 's follow distribution $\mu (\mathbf{x})$ . Given training data $\{(x_i,y_i)\}_{i = 1}^n$ drawn from $g$ , where $\mathbf{x}_i\in \mathbb{S}^{d - 1}$ and $y_{i}\approx g(\mathbf{x}_{i})$ , our goal is to train the NN, in a way that is robust when the sampling of $y_{i}$ from $g(\mathbf{x}_i)$ is contaminated by noises, so that $\mathcal{N}$ uniformly approximates $g$ on $\mathbb{S}^{d - 1}$ . One standard training procedure is a gradient-based optimization algorithm that minimizes the residual in the squared $L^2 (d\mu)$ norm, i.e., + +$$ +\Phi (\mathbf {W}) = \frac {A _ {d}}{2} \int_ {\mathbb {S} ^ {d - 1}} | g (\mathbf {x}) - \mathcal {N} (\mathbf {x}; \mathbf {W}) | ^ {2} d \mu (\mathbf {x}) \approx \frac {A _ {d}}{2 n} \sum_ {i = 1} ^ {n} \left| y _ {i} - \mathcal {N} \left(\mathbf {x} _ {i}; \mathbf {W}\right) \right| ^ {2}, \tag {1} +$$ + +where $A_{d}$ is the Lebesgue measure of the hypersphere $\mathbb{S}^{d - 1}$ and $\mathbf{W}$ represents the weights and bias terms. Similar to most theoretical studies investigating frequency bias, we restrict ourselves to 2-layer NNs (Arora et al., 2019; Basri et al., 2019; Su & Yang, 2019; Cao et al., 2019). + +To study NN training, it is common to consider the dynamics of $\Phi (\mathbf{W})$ as one optimizes the coefficients in $\mathbf{W}$ . For example, the gradient flow of the NN weights is given by $\frac{d\mathbf{W}}{dt} = -\frac{\partial\Phi}{\partial\mathbf{W}}$ . Define the residual $z(\mathbf{x};\mathbf{W}) = g(\mathbf{x}) - \mathcal{N}(\mathbf{x};\mathbf{W})$ . Applying gradient flow with the population loss gives us + +$$ +\frac {d z (\mathbf {x} ; \mathbf {W})}{d t} = - A _ {d} \int_ {\mathbb {S} ^ {d - 1}} K (\mathbf {x}, \mathbf {x} ^ {\prime}; \mathbf {W}) z (\mathbf {x} ^ {\prime}; \mathbf {W}) d \mu (\mathbf {x} ^ {\prime}), \tag {2} +$$ + +where $K(\mathbf{x},\mathbf{x}';\mathbf{W}) = \left\langle \frac{\partial\mathcal{N}(\mathbf{x};\mathbf{W})}{\partial\mathbf{W}},\frac{\partial\mathcal{N}(\mathbf{x}';\mathbf{W})}{\partial\mathbf{W}}\right\rangle$ . Under the assumptions that the weights do not change much during training, one can consider the NTK given the underlying time-independent distribution of $\mathbf{W}$ , i.e., $K^{\infty}(\mathbf{x},\mathbf{x}') = \mathbb{E}_{\mathbf{W}}[K(\mathbf{x},\mathbf{x}';\mathbf{W})]$ (Du et al., 2018). Based on eq. (2), one can understand the decay of the residual by studying the reproducing kernel Hilbert space (RKHS) through a spectral decomposition of the integral operator $\mathcal{L}$ defined by $(\mathcal{L}z)(\mathbf{x}) = \int K^{\infty}(\mathbf{x},\mathbf{x}')z(\mathbf{x}')d\mu (\mathbf{x}')$ . Most results in the literature require $\mu (\mathbf{x})$ to be the uniform distribution over the sphere so that the eigenfunctions of $\mathcal{L}$ are spherical harmonics and the eigenvalues have explicit forms (Cao et al., 2019; Basri et al., 2019; Scetbon & Harchaoui, 2021). These explicit formulas for the eigenvalues and eigenfunctions of $\mathcal{L}$ rely on the Funk-Hecke theorem, which provides a formula allowing one to express an integral over a hypersphere by an integral over an interval (Seeley, 1966). The frequency bias of NN training can be explained by the fact that low-degree spherical harmonic polynomials are eigenfunctions of $\mathcal{L}$ associated with large eigenvalues (Basri et al., 2019). Thus, for uniform training data, the optimization of the weights and biases of an NN tends to fit the low-frequency components of the residual first. + +When $\mu (\mathbf{x})$ is nonuniform, it is difficult to analyze the spectral properties of $\mathcal{L}$ and thus the frequency bias properties of NN training. Since the Funk-Hecke formula no longer holds, there are only a few special cases where frequency bias is understood (Williams & Rasmussen, 2006, Sec. 4.3). Although one may derive asymptotic bounds for the eigenvalues (Widom, 1963; 1964; Bach & Jordan, 2002), it is hard to obtain formulas for the eigenfunctions, and one usually relies on numerical approximations (Baker, 1977). For the ReLU-based NTK, Basri et al. (2020) provided explicit eigenfunctions assuming that the $\mu (\mathbf{x})$ is piecewise constant on $\mathbb{S}^1$ , but this analysis does not generalize to higher dimension. To study the frequency bias of NN training, one needs to understand both the eigenvalues and eigenfunctions of $\mathcal{L}$ , and this remains a significant challenge for a general $\mu (\mathbf{x})$ due to the absence of the Funk-Hecke formula. + +To overcome this challenge, we take a different point-of-view. While it is standard to discretize the integral in eq. (1) using a Monte Carlo-like average, we discretize it using a data-dependent quadrature rule where the nodes are at the training data. That is, we investigate the frequency bias of NN training when minimizing the residual in the standard squared $L^2$ norm: + +$$ +\widetilde {\Phi} (\mathbf {W}) = \frac {1}{2} \int_ {\mathbb {S} ^ {d - 1}} | g (\mathbf {x}) - \mathcal {N} (\mathbf {x}; \mathbf {W}) | ^ {2} d \mathbf {x} \approx \frac {1}{2} \sum_ {i = 1} ^ {n} c _ {i} | y _ {i} - \mathcal {N} (\mathbf {x} _ {i}; \mathbf {W}) | ^ {2}, \tag {3} +$$ + +where $c_{1},\ldots ,c_{n}$ are the quadrature weights associated with the (nonuniform) input data $\mathbf{x}_1,\dots ,\mathbf{x}_n$ If $\mathbf{x}_1,\ldots ,\mathbf{x}_n$ are drawn from a uniform distribution over the hypersphere, then one can select $c_{i} = A_{d} / n$ for $1\leq i\leq n$ ; otherwise, one can choose any quadrature weights so that the integration rule is accurate (see section 4.2). If $\mathbf{x}_1,\ldots ,\mathbf{x}_n$ are drawn independently at random from $\mu (\mathbf{x})$ , then it is often reasonable to select $c_{i} = 1 / (np(\mathbf{x}_{i}))$ , where $d\mu (\mathbf{x}) = p(\mathbf{x})d\mathbf{x}$ . While $c_{1},\ldots ,c_{n}$ depend on $\mathbf{x}_1,\ldots ,\mathbf{x}_n$ , the continuous expression for $\widetilde{\Phi} (\mathbf{W})$ is always unaltered in eq. (3). Therefore, we can use the Funk-Hecke formula to analyze the eigenvalues and eigenfunctions of $\tilde{\mathcal{L}}$ defined by $(\tilde{\mathcal{L}} z)(\mathbf{x}) = \int_{\mathbb{S}^{d - 1}}K^{\infty}(\mathbf{x},\mathbf{x}^{\prime})z(\mathbf{x}^{\prime})d\mathbf{x}^{\prime}$ , revealing the frequency bias. We address that by choosing eq. (3) as a loss function instead of eq. (1), we are enforcing the frequency bias of NN training, whereas eq. (1) does not ensure such spectral property (see Section 6.1 for an illustration). + +To further tune the NN frequency bias during training, we also propose to minimize the residual in a squared Sobolev $H^{s}$ norm for a carefully selected $s \in \mathbb{R}$ . Unlike the $L^2$ norm (the case of $s = 0$ ), the $H^{s}$ norm for $s \neq 0$ has its own frequency bias. For $s > 0$ , $H^{s}$ penalizes high frequencies more than low, while for $s < 0$ , low frequencies are penalized the most. We implement the squared $H^{s}$ norm using a quadrature rule, which induces a different integral operator $\mathcal{L}_s$ . We + +analyze the eigenvalues and eigenfunctions of $\mathcal{L}_s$ , and consequently, the frequency bias in the NN training using the Funk-Hecke formula. Given our new understanding of frequency bias, we select $s$ so that the $H^s$ norm amplifies, dampens, counterbalances, or reverses the natural frequency bias from an overparameterized NN training. + +Contributions. Here are our three main contributions to analyzing and tuning NN frequency bias. + +(1) From our quadrature point-of-view, we analyze the frequency bias in training a 2-layer overparameterized ReLU NN with nonuniform training data. In Theorem 2, we show that the theory of frequency bias in Basri et al. (2019) for uniform training data continues to hold in the nonuniform case up to quadrature errors. In Theorem 3, we provide control of the quadrature errors. +(2) We use our understanding of frequency bias to modify the usual squared $L^2$ loss function to a squared $H^s$ norm. By selecting $s$ , we can amplify or dampen the intrinsic frequency bias in NN training, accelerate the convergence of gradient-based optimization procedures, and separate out noises of particular frequencies. +(3) A potential issue with the $H^{s}$ norm is the difficulties of implementing with high-dimensional training data. Using an image dataset of dimension $28^{2} = 784$ , we show how to use an encoder-decoder architecture to implement a practical version of the squared $H^{s}$ norm loss and adjust the frequency bias in NN training to suppress noises of different frequencies (see Figure 4). + +# 2 PRELIMINARIES AND NOTATION + +For $d > 1$ , let $g: \mathbb{S}^{d - 1} \to \mathbb{R}$ be a square-integrable function defined on $\mathbb{S}^{d - 1}$ . The function $g$ can be expressed in a spherical harmonic expansion given by + +$$ +g (\mathbf {x}) = \sum_ {\ell = 0} ^ {\infty} \sum_ {p = 1} ^ {N (d, \ell)} \hat {g} _ {\ell , p} Y _ {\ell , p} (\mathbf {x}), \quad \hat {g} _ {\ell , p} = \int_ {\mathbb {S} ^ {d - 1}} g (\mathbf {x}) Y _ {\ell , p} (\mathbf {x}) d \mathbf {x}, \tag {4} +$$ + +where $Y_{\ell,p}$ is the spherical harmonic basis function of degree $\ell$ and order $p$ (Dai & Xu, 2013). Here, $N(d,\ell)$ is the number of spherical harmonic functions of degree $\ell$ so that $N(d,0) = 1$ and $N(d,\ell) = \frac{(2\ell + d - 2)\Gamma(\ell + d - 2)}{\Gamma(\ell + 1)\Gamma(d - 1)}$ for $\ell \geq 1$ . The set $\{Y_{\ell,p}\}_{\ell \geq 0,1 \leq p \leq N(d,\ell)}$ is an orthonormal basis for $L^2(\mathbb{S}^{d-1})$ . Let $\mathcal{H}_\ell^d$ be the span of $\{Y_{\ell,p}\}_{p=1}^{N(d,\ell)}$ , and $\Pi_\ell^d = \bigoplus_{j=0}^\ell \mathcal{H}_j^d$ be the space of spherical harmonics of degree $\leq \ell$ . + +Given distinct training data $\{\mathbf{x}_i\}_{i=1}^n$ from $\mathbb{S}^{d-1}$ and evaluations $y_i = g(\mathbf{x}_i)$ for $1 \leq i \leq n$ , our goal is to understand the intrinsic frequency bias behavior of training a 2-layer ReLU NN given by + +$$ +\mathcal {N} (\mathbf {x}) = \frac {1}{\sqrt {m}} \sum_ {r = 1} ^ {m} a _ {r} \operatorname {R e L U} \left(\mathbf {w} _ {r} ^ {\top} \mathbf {x} + b _ {r}\right), \quad \operatorname {R e L U} (t) = \max (t, 0), \tag {5} +$$ + +where $m$ is the number of hidden neurons, $\mathbf{w}_1,\ldots ,\mathbf{w}_m$ and $a_1,\dots ,a_m$ are weights, and $b_{1},\ldots ,b_{m}$ are biases. We use the same setup as in (Basri et al., 2020): assuming that (1) $\mathbf{w}_1,\dots ,\mathbf{w}_m$ are initialized independently and identically distributed (i.i.d.) from Gaussian random variables with covariance matrix $\kappa^2\mathbf{I}$ , where $\kappa >0$ , (2) the biases are initialized to 0, and (3) $a_1,\ldots ,a_m$ are initialized i.i.d. as $+1$ with probability $\frac{1}{2}$ and $-1$ otherwise, and $\{a_r\}$ are not updated during training. + +We use a gradient-based optimization scheme to train for the weights and biases and aim to minimize the residual defined by a symmetric positive definite (SPD) matrix $\mathbf{P}$ , which can be written as + +$$ +\Phi_ {\mathbf {P}} (\mathbf {W}) = \frac {1}{2} (\mathbf {y} - \mathbf {u}) ^ {\top} \mathbf {P} (\mathbf {y} - \mathbf {u}), \tag {6} +$$ + +where $\mathbf{y} = (g(\mathbf{x}_1),\dots,g(\mathbf{x}_n))^{\top}$ and $\mathbf{u} = (\mathcal{N}(\mathbf{x}_1),\dots,\mathcal{N}(\mathbf{x}_n))^{\top}$ . For example, we have $\mathbf{P} = A_{d}n^{-1}\mathbf{I}$ in eq. (1) and $\mathbf{P} = \mathrm{diag}(c_1,\ldots ,c_n)$ in eq. (3). Recall that $\mathbf{W}$ represents all the weights and biases of the NN. Given the loss function, we train the NN based on the gradient descent algorithm: + +$$ +\mathbf {w} _ {r} (k + 1) - \mathbf {w} _ {r} (k) = - \eta \frac {\partial \Phi_ {\mathbf {P}}}{\partial \mathbf {w} _ {r}}, \quad b _ {r} (k + 1) - b _ {r} (k) = - \eta \frac {\partial \Phi_ {\mathbf {P}}}{\partial b _ {r}}, \quad 1 \leq r \leq m, \tag {7} +$$ + +where $k$ is the iteration number and $\eta > 0$ is the learning rate. The matrix $\mathbf{P}$ induces an inner product $\langle \pmb{\xi}, \pmb{\zeta} \rangle_{\mathbf{P}} = \pmb{\xi}^{\top} \mathbf{P} \pmb{\zeta}$ , which leads to a finite-dimensional Hilbert space with the + +norm $\| \pmb {\xi}\|_{\mathbf{P}} = \sqrt{\langle\pmb{\xi},\pmb{\xi}\rangle_{\mathbf{P}}}$ . Given a matrix $\mathbf{A}\in \mathbb{R}^{n\times n}$ , we define its operator norm $\| \mathbf{A}\|_{\mathbf{P}} =$ $\sup_{\pmb {\xi}\in \mathbb{R}^n,\| \pmb {\xi}\|_{\mathbf{P}} = 1}\| \mathbf{A}\pmb {\xi}\|_{\mathbf{P}}$ We also define a finite positive number that depends on $\mathbf{P}$ .. + +$$ +M _ {\mathbf {P}} = \sup _ {\boldsymbol {\xi} \in \mathbb {R} ^ {n}, \| \boldsymbol {\xi} \| _ {2} = 1} \| \boldsymbol {\xi} \| _ {\mathbf {P}} = \sup _ {\boldsymbol {\xi} \in \mathbb {R} ^ {n} \backslash \{\mathbf {0} \}} \sqrt {\frac {\boldsymbol {\xi} ^ {\top} \mathbf {P} \boldsymbol {\xi}}{\boldsymbol {\xi} ^ {\top} \boldsymbol {\xi}}} = \sup _ {\boldsymbol {\zeta} \in \mathbb {R} ^ {n} \backslash \{\mathbf {0} \}} \sqrt {\frac {\boldsymbol {\zeta} ^ {\top} \mathbf {P} ^ {1 / 2} \mathbf {P P} ^ {1 / 2} \boldsymbol {\zeta}}{\boldsymbol {\zeta} ^ {\top} \mathbf {P} ^ {1 / 2} \mathbf {P} ^ {1 / 2} \boldsymbol {\zeta}}} = \sup _ {\boldsymbol {\zeta} \in \mathbb {R} ^ {n}, \| \boldsymbol {\zeta} \| _ {\mathbf {P}} = 1} \| \mathbf {P} \boldsymbol {\zeta} \| _ {2}. \tag {8} +$$ + +Note that by the third expression in eq. (8), we also have $M_{\mathbf{P}} = \left\| \mathbf{P}^{1 / 2}\right\| _2 = \sqrt{\|\mathbf{P}\|_2}$ . Furthermore, we define the matrix $\mathbf{H}^{\infty}\in \mathbb{R}^{n\times n}$ by + +$$ +H _ {i j} ^ {\infty} = \mathbb {E} _ {\mathbf {w} \sim \mathcal {N} (\mathbf {0}, \kappa^ {2} \mathbf {I})} \left[ \frac {\mathbf {x} _ {i} ^ {\top} \mathbf {x} _ {j} + 1}{2} \mathbb {I} _ {\{\mathbf {w} ^ {\top} \mathbf {x} _ {i}, \mathbf {w} ^ {\top} \mathbf {x} _ {j} \geq 0 \}} \right] = \frac {(\mathbf {x} _ {i} ^ {\top} \mathbf {x} _ {j} + 1) (\pi - \operatorname {a r c c o s} (\mathbf {x} _ {i} ^ {\top} \mathbf {x} _ {j}))}{4 \pi}. \tag {9} +$$ + +Note that due to the introduction of the biases, $\mathbf{H}^{\infty}$ is slightly different than the one in (Du et al., 2018; Arora et al., 2019). In fact, in contrast with (Du et al., 2018), $\mathbf{H}^{\infty}$ defined in eq. (9) is SPD regardless of the distribution of the training data, as shown in the supplementary material. + +Proposition 1. If $\mathbf{x}_1, \ldots, \mathbf{x}_n$ are distinct, then $\mathbf{H}^\infty$ in eq. (9) is SPD. + +As a consequence of Proposition 1, the matrix $\mathbf{H}^{\infty}\mathbf{P}$ has positive eigenvalues, which we denote by $\lambda_{n - 1}\geq \dots \geq \lambda_0 > 0$ . In fact, let $\Lambda = \mathrm{diag}(\lambda_0,\ldots ,\lambda_{n - 1})$ . Then, $\mathbf{H}^{\infty}\mathbf{P}$ is self-adjoint in $(\mathbb{R}^n,\langle \cdot ,\cdot \rangle_{\mathbf{P}})$ (see appendix A) and can be diagonalized as + +$$ +\mathbf {H} ^ {\infty} \mathbf {P} = \mathbf {P} ^ {- 1 / 2} \mathbf {P} ^ {1 / 2} \mathbf {H} ^ {\infty} \mathbf {P} ^ {1 / 2} \mathbf {P} ^ {1 / 2} = \mathbf {P} ^ {- 1 / 2} \mathbf {V} ^ {- 1} \boldsymbol {\Lambda} \mathbf {V P} ^ {1 / 2}, \tag {10} +$$ + +where $\mathbf{P}^{1/2}\mathbf{H}^{\infty}\mathbf{P}^{1/2} = \mathbf{V}^{-1}\boldsymbol{\Lambda}\mathbf{V}$ is SPD and therefore diagonalizable. One can view $\mathbf{H}^{\infty}$ as coming from sampling a continuous kernel $K^{\infty}: \mathbb{S}^{d-1} \times \mathbb{S}^{d-1} \to \mathbb{R}$ given by + +$$ +K ^ {\infty} (\mathbf {x}, \mathbf {y}) = K ^ {\infty} (\langle \mathbf {x}, \mathbf {y} \rangle) = \frac {(\langle \mathbf {x} , \mathbf {y} \rangle + 1) (\pi - \operatorname {a r c c o s} (\langle \mathbf {x} , \mathbf {y} \rangle))}{4 \pi}, \tag {11} +$$ + +where $\langle \cdot, \cdot \rangle$ is the $\ell^2$ inner-product. The eigenvalues and eigenfunctions of $K^\infty$ are known explicitly via the Funk-Hecke formula (Basri et al., 2019): + +$$ +\int_ {\mathbb {S} ^ {d - 1}} K ^ {\infty} (\mathbf {x}, \mathbf {y}) Y _ {\ell , p} (\mathbf {y}) d \mathbf {y} = \mu_ {\ell} Y _ {\ell , p} (\mathbf {x}), \quad \ell \geq 0. \tag {12} +$$ + +The explicit formulas for $\mu_{\ell}$ with $\ell \geq 0$ are given in the supplementary material. We find that $\mu_{\ell} > 0$ for all $\ell$ and $\mu_{\ell}$ is asymptotically $\mathcal{O}(\ell^{-d})$ for large $\ell$ (Basri et al., 2019; Bietti & Mairal, 2019). + +# 3 TRAINING CONVERGENCE WITH A GENERAL LOSS FUNCTION + +Given the NN model in eq. (5) and a general loss function $\Phi_{\mathbf{P}}$ in eq. (6), we are interested in the convergence rate of NN training. We study this by analyzing the convergence rate for each harmonic component. We start by presenting a convergence result that holds for any SPD matrix $\mathbf{P}$ . It says that up to an error $\epsilon$ , which can be made arbitrarily small by taking $\kappa$ small enough and $m$ large enough, the residual of the NN at the $k$ th iteration is approximately $(\mathbf{I} - 2\eta \mathbf{H}^{\infty}\mathbf{P})^{k}\mathbf{y}$ . + +Theorem 1. In eq. (5), suppose that $\mathbf{w}_1, \ldots, \mathbf{w}_m$ are initialized i.i.d. from Gaussian random variables with covariance matrix $\kappa^2\mathbf{I}$ , $b_1, \ldots, b_m$ are initialized to zero, and $a_1, \ldots, a_m$ are initialized i.i.d. as $+1$ with probability $1/2$ and $-1$ otherwise. Suppose the NN is trained with training data $(\mathbf{x}_i, y_i)$ for $1 \leq i \leq n$ , loss function $\Phi_{\mathbf{P}}$ in eq. (6) for a SPD matrix $\mathbf{P}$ , and the training procedure is the gradient descent update rule eq. (7) with step size $\eta$ . Let $\mathcal{N}_k$ be the NN function after the $k$ th iteration and $\mathbf{u}(k) = (\mathcal{N}_k(\mathbf{x}_1), \ldots, \mathcal{N}_k(\mathbf{x}_n))$ , where $\mathcal{N}_0$ is the initial NN function. Let an accuracy goal $0 < \epsilon < 1$ , a probability of failure $0 < \delta < 1$ , and a time span $T > 0$ be given. Then, there exist constants $C_1, C_2 > 0$ that depend only on the dimension $d$ such that if $0 < \eta \leq 1/(2M_{\mathbf{P}}^2n)$ (see eq. (8)), $\kappa \leq C_1\epsilon M_{\mathbf{P}}^{-1}\sqrt{\delta/n}$ , and $m$ satisfies + +$$ +m \geq C _ {2} \left(\frac {M _ {\mathbf {P}} ^ {6} n ^ {3}}{\kappa^ {2} \epsilon^ {2}} \left(\lambda_ {0} ^ {- 4} + \eta^ {4} T ^ {4} \epsilon^ {4}\right) + \frac {M _ {\mathbf {P}} ^ {4} n ^ {2} \log (n / \delta)}{\epsilon^ {2}} \left(\lambda_ {0} ^ {- 2} + \eta^ {2} T ^ {2} \epsilon^ {2}\right)\right), \tag {13} +$$ + +then with probability $\geq 1 - \delta$ , we have + +$$ +\mathbf {y} - \mathbf {u} (k) = \left(\mathbf {I} - 2 \eta \mathbf {H} ^ {\infty} \mathbf {P}\right) ^ {k} \mathbf {y} + \epsilon (k), \quad \| \epsilon (k) \| _ {\mathbf {P}} \leq \epsilon , \quad 0 \leq k \leq T. \tag {14} +$$ + +Here, $\mathbf{H}^{\infty}$ follows eq. (9), $\mathbf{y} = (g(\mathbf{x}_1),\dots ,g(\mathbf{x}_n))^{\top}$ , and $\lambda_0$ is the smallest eigenvalue of $\mathbf{H}^{\infty}\mathbf{P}$ . + +We defer the proof to the supplementary material, which uses techniques from (Su & Yang, 2019). The main idea behind the proof is that $\mathbf{I} - 2\eta \mathbf{H}^{\infty}\mathbf{P}$ is close to the transition matrix for the residual $\mathbf{y} - \mathbf{u}(k)$ when $m$ is large. By taking $\kappa$ small, we can control the size of $\mathbf{u}(0)$ and therefore obtain $\mathbf{y} - \mathbf{u}(k) \approx (\mathbf{I} - 2\eta \mathbf{H}^{\infty}\mathbf{P})^{k}(\mathbf{y} - \mathbf{u}(0)) \approx (\mathbf{I} - 2\eta \mathbf{H}^{\infty}\mathbf{P})^{k}\mathbf{y}$ . As $\eta$ decreases, the gradient descent algorithm gets closer to the gradient flow algorithm (Du et al., 2018), which allows us to more accurately quantify the frequency bias (see section 4). For a fixed $n$ , if $\mathbf{y}$ is an eigenvector associated to $\lambda_0$ , then $\left\| (\mathbf{I} - 2\eta \mathbf{H}^{\infty}\mathbf{P})^{k}\mathbf{y} \right\| = \exp(-k\log((1 - 2\eta\lambda_0)^{-1}))\|\mathbf{y}\|$ , where $\log((1 - 2\eta\lambda_0)^{-1})$ is called the convergence rate (Su & Yang, 2019). If we assume $\lambda_{\min}(\mathbf{P}) = \mathcal{O}(1/n)$ , which is the case of eq. (1), then as shown in (Su & Yang, 2019, Thm. 2) and (Nguyen et al., 2021), we expect that $\lambda_0 \to 0$ as $n \to \infty$ . Hence, as $n \to \infty$ , there exists a labeling $\mathbf{y}$ on the training data, depending on $n$ , that makes the convergence rate vanish. However, as suggested by (Su & Yang, 2019; Cao et al., 2019), for a fixed bandlimited target function $g$ , its convergence rate in early epochs stays constant as $n \to \infty$ . We make similar observations in section 4. + +# 4 FREQUENCY BIAS WITH AN $\mathbf{L}^2$ -BASED LOSS FUNCTION + +The mean-squared loss function in eq. (1) corresponds to setting $c_{i} = A_{d} / n$ for $1\leq i\leq n$ in eq. (3). When $\mu$ is uniform, eq. (1) and eq. (3) are equivalent; when $\mu$ is nonuniform, we introduce a quadrature rule with nodes $\mathbf{x}_1,\dots ,\mathbf{x}_n$ and weights $c_{1},\ldots ,c_{n}$ to approximate the $L^2$ loss function eq. (3). The weights are selected so that for low-frequency functions $f:\mathbb{S}^{d - 1}\to \mathbb{R}$ , the quadrature error + +$$ +E _ {\mathbf {c}} (f) = \int_ {\mathbb {S} ^ {d - 1}} f (\mathbf {x}) d \mathbf {x} - \sum_ {i = 1} ^ {n} c _ {i} f \left(\mathbf {x} _ {i}\right) \tag {15} +$$ + +is relatively small. A reasonable quadrature rule has positive weights for numerical stability and satisfies $\sum_{i=1}^{n} c_i = A_d$ so that it exactly integrates constants. The continuous squared $L^2$ loss function based on the Lebesgue measure is then discretized to be the square of a weighted discrete $\ell^2$ norm (see eq. (3)). Hence, we take $\mathbf{P} = \mathbf{D}_c = \mathrm{diag}(c_1, \ldots, c_n)$ , which is SPD as the $c_i$ 's are positive. For a vector $\mathbf{v} \in \mathbb{R}^n$ , we write $\| \mathbf{v} \|_{\mathbf{c}}^2 = \mathbf{v}^\top \mathbf{D}_c \mathbf{v}$ and set $c_{\max} = \max_{1 \leq i \leq n} \{c_i\}$ . + +We now apply Theorem 1 to study the frequency bias of NN training with the squared $L^2$ loss eq. (3). We state these results in terms of quadrature errors. Recall our continuous setup where we assume that the training data is taken from a function $g:\mathbb{S}^{d - 1}\to \mathbb{R}$ so that $y_{i} = g(\mathbf{x}_{i})$ for $1\leq i\leq n$ . We further assume that $g$ is bandlimited with bandlimit $L$ where $g = g_0 + \dots +g_L$ and $g_{\ell}\in \mathcal{H}_{\ell}^{d}$ for $0\leq \ell \leq L$ . With $1\leq i\leq n$ , $j,\ell \geq 0$ , and $1\leq p\leq N(d,\ell)$ , we define quadrature errors as + +$$ +e _ {j, \ell , p} ^ {a} = E _ {\mathbf {c}} \left(g _ {j} Y _ {\ell , p}\right), \quad e _ {i, \ell , p} ^ {b} = E _ {\mathbf {c}} \left(K ^ {\infty} \left(\mathbf {x} _ {i}, \cdot\right) Y _ {\ell , p}\right), \quad e _ {j, \ell} ^ {c} = E _ {\mathbf {c}} \left(g _ {j} g _ {\ell}\right), \quad e _ {i, \ell} ^ {d} = E _ {\mathbf {c}} \left(K ^ {\infty} \left(\mathbf {x} _ {i}, \cdot\right) g _ {\ell}\right). \tag {16} +$$ + +We interpret $g_{\ell} = 0$ when $\ell > L$ and function products are interpreted as pointwise products. + +# 4.1 A FREQUENCY-BASED FORMULA FOR THE TRAINING ERROR + +We obtain a similar result to (Arora et al., 2019, Thm. 4.1) when using loss function $\tilde{\Phi}$ in eq. (3). Instead of expressing the training error using the spectrum of $\mathbf{H}^{\infty}\mathbf{D}_c$ , we directly relate the training error to the frequency components of $g$ and the eigenvalues of the continuous kernel $K^{\infty}$ . + +Theorem 2. Under the same setup and assumptions of Theorem 1, let $\mathbf{P} = \mathbf{D}_c$ and $M_{\mathbf{P}} = \sqrt{c_{\max}}$ . If $g:\mathbb{S}^{d - 1}\to \mathbb{R}$ is a bandlimited function with bandlimit $L$ and $1 - 2\eta \mu_{\ell} > 0$ for all $0\leq \ell \leq L$ (see eq. (12)), then with probability $\geq 1 - \delta$ we have + +$$ +\left\| \mathbf {y} - \mathbf {u} (k) \right\| _ {\mathcal {C}} = \sqrt {\sum_ {\ell = 0} ^ {L} \left(1 - 2 \eta \mu_ {\ell}\right) ^ {2 k} \left\| g _ {\ell} \right\| _ {L ^ {2}} ^ {2} + \varepsilon_ {1} (k)} + \varepsilon_ {2} + \varepsilon_ {3} (k), \quad | \varepsilon_ {3} (k) | \leq \epsilon , \quad 0 \leq k \leq T, \tag {17} +$$ + +where $\varepsilon_1(k)$ and $\varepsilon_{2}$ satisfy + +$$ +\left| \varepsilon_ {1} (k) \right| \leq \left| \sum_ {j = 0} ^ {L} \sum_ {\ell = 0} ^ {L} \left(1 - 2 \eta \mu_ {j}\right) ^ {k} \left(1 - 2 \eta \mu_ {\ell}\right) ^ {k} e _ {j, \ell} ^ {c} \right|, \quad \left| \varepsilon_ {2} \right| \leq \sum_ {\ell = 0} ^ {L} \frac {\sqrt {A _ {d}}}{\mu_ {\ell}} \max _ {1 \leq i \leq n} \left| e _ {i, \ell} ^ {d} \right|. +$$ + +The proof of Theorem 2 is postponed to the supplementary material. The idea is that by Theorem 1, we know $\mathbf{y} - \mathbf{u}(k) = (\mathbf{I} - 2\eta \mathbf{H}^{\infty}\mathbf{D}_{\mathbf{c}})^{k}\mathbf{y} + \varepsilon_{3}(k)$ . Using Funk-Hecke formula and quadrature, we have that $1 - 2\eta \mu_{\ell}$ are roughly the eigenvalues of $\mathbf{I} - 2\eta \mathbf{H}^{\infty}\mathbf{D}_{\mathbf{c}}$ and $\mathbf{y}_{\ell} = (g_{\ell}(\mathbf{x}_1),\ldots ,g_{\ell}(\mathbf{x}_n))^{\top}$ are associated eigenvectors. Hence, $\mathbf{y} - \mathbf{u}(k)\approx \sum_{\ell = 0}^{L}(1 - 2\eta \mu_{\ell})^{k}\mathbf{y}_{\ell}$ . This can be made precise by introducing $\varepsilon_{2}$ . Finally, up to some quadrature error $\varepsilon_{1}$ , we have $\langle g_j,g_\ell\rangle_{L^2}\approx A_d n^{-1}\mathbf{y}_j^\top \mathbf{y}_\ell$ which gives us eq. (17). Since $\sum_{i = 1}^{n}c_{i} = A_{d}$ , For a fixed data distribution $\mu$ , we expect that $c_{\mathrm{max}} = \mathcal{O}(n^{-1})$ as $n\to \infty$ so that $\eta$ does not decay as $n\to \infty$ . Up to a quadrature error, $\| \mathbf{y} - \mathbf{u}(k)\|_{\mathbf{c}}$ is close to the $L^2$ norm of the residual function $g - \mathcal{N}_k$ . Explicit formulas for the eigenvalues $\{\mu_{\ell}\}$ (see eq. (12)) are given in (Basri et al., 2019), and it was shown that $\mu_{\ell} = \mathcal{O}(\ell^{-d})$ (Bietti & Mairal, 2019). Theorem 2 demonstrates the frequency bias in NN training as the rate of convergence for frequency $0\leq \ell \leq L$ is $1 - 2\eta \mu_{\ell}$ , which is close to 1 when $\ell$ is large. As $\eta \rightarrow 0$ , we have $(1 - 2\eta \mu_{\ell})^{2t / \eta}\rightarrow e^{-4\mu_{\ell}t}$ , which gives the convergence rate for frequency $\ell$ using gradient flow. Therefore, we expect that NN training approximates the low-frequency content of $g$ faster than its high-frequency one, which is similar to the case of training with uniform data (Basri et al., 2019). + +# 4.2 ESTIMATING THE QUADRATURE ERRORS + +We now quantify the quadrature errors in Theorem 2. If we can design a quadrature rule at the training data $\mathbf{x}_1, \ldots, \mathbf{x}_n$ such that the quadrature error satisfies + +$$ +\left| E _ {\mathbf {c}} (h) \right| = \left| \int_ {\mathbb {S} ^ {d - 1}} h (\mathbf {x}) d \mathbf {x} - \sum_ {i = 1} ^ {n} c _ {i} h \left(\mathbf {x} _ {i}\right) \right| \leq \gamma_ {n, \ell} \| h \| _ {L ^ {\infty}}, \quad h \in \Pi_ {\ell} ^ {d}, \quad \ell \geq 0, \tag {18} +$$ + +for some constant $\gamma_{n,\ell} \geq 0$ , then we can bound the terms in eq. (16). We expect that for each fixed $\ell$ , $\gamma_{n,\ell} \to 0$ as $n \to \infty$ as this is saying that integrals can be calculated more accurately for a denser set of quadrature nodes. In practice, it can require a large amount of training data to make $\gamma_{n,\ell}$ small when $d$ is large. Under the assumption that our quadrature rule satisfies eq. (18) with reasonably small $\gamma_{n,\ell}$ 's when $\ell$ is small, we can bound the quadrature errors appearing in Theorem 2. + +Theorem 3. Under the same assumptions of Theorem 2, and that the quadrature rule satisfies eq. (18), there exist constants $C_1, C_2 > 0$ only depending on the dimension $d$ such that the terms $|\varepsilon_1(k)|$ and $|\varepsilon_2|$ in Theorem 2 satisfy + +$$ +\left| \varepsilon_ {1} (k) \right| \leq C _ {1} \left(\frac {L ^ {3}}{\ell} + L ^ {2} \gamma_ {n, \ell}\right) \max _ {0 \leq j \leq L} \| g _ {j} \| _ {L ^ {\infty}}, \quad \left| \varepsilon_ {2} \right| \leq C _ {2} \left(\frac {L ^ {2}}{\ell} + L \gamma_ {n, \ell}\right) \max _ {0 \leq j \leq L} \| g _ {j} \| _ {L ^ {\infty}} \sum_ {j = 0} ^ {L} \mu_ {j} ^ {- 1} +$$ + +for all $k\geq 0,\ell \geq 1$ , where $g = g_0 + \dots +g_L$ with $g_{j}\in \mathcal{H}_{j}^{d}$ and $\gamma_{n,\ell}$ satisfies eq. (18). + +The proof is in the supplementary material. Theorem 3 states that $\varepsilon_1(k)$ and $\varepsilon_2$ can be made arbitrarily small if the quadrature errors converge to 0 as the number of nodes $n\to \infty$ . In particular, if there is a sequence $\{\ell_n\}$ that increases to $\infty$ such that the quadrature rule is exact for all functions $h\in \Pi_{\ell_n}^d$ , i.e., $E_{\mathbf{c}}(h) = 0$ , where $\ell_n\rightarrow \infty$ (see e.g. (Mhaskar et al., 2000)), the rates of convergence of $\varepsilon_1(k)$ and $\varepsilon_2$ are both $\mathcal{O}(1 / \ell_n)$ for a fixed $g$ . Without the quadrature being exact, we still have nice convergence provided the quadrature errors are small, as the following corollary shows. + +Corollary 1. Suppose there exists a sequence $\ell_n \to \infty$ such that $\gamma_{n,\ell_n} \to 0$ as $n \to \infty$ . Then, for a fixed $L \geq 0$ , we have $\max_{k \geq 0, g \in \Pi_L^d} |\varepsilon_1(k)| / \|g\|_{L^2}^2$ and $\max_{g \in \Pi_L^d} |\varepsilon_2| / \|g\|_{L^2} \to 0$ as $n \to \infty$ . + +Corollary 1 shows that as $n$ increases, the quadrature errors $\varepsilon_1(k)$ and $\varepsilon_2$ converge to zero. Moreover, this convergence is uniform in the sense that it does not depend on the specific choice of $g \in \Pi_L^d$ . Here, we normalize $\varepsilon_1(k)$ and $\varepsilon_2$ by $\| g\|_{L^2}^2$ and $\| g\|_{L^2}$ , respectively, to obtain the "relative" quadrature errors that do not scale when $g$ is multiplied by a scalar (see (17)). + +# 5 FREQUENCY BIAS WITH A SOBOLEV-NORM LOSS FUNCTION + +The frequency bias during the training of an overparameterized NN has several consequences. In many situations, worse convergence rates for high-frequency components of a function are beneficial since the NN training procedure is less sensitive to the oscillatory noise in the data, acting as + +a low-pass filter. This significantly improves the generalization error of overparameterized NNs. However, in other situations, NN training struggles to accurately learn the high-frequency content of $g$ , resulting in slow convergence. To precisely control the frequency bias of NN training, we propose to train a NN with a loss function that has intrinsic spectral bias. + +Let $\mathcal{D}'(\mathbb{S}^{d-1})$ be the space of distributions on $\mathbb{S}^{d-1}$ . Given $s \in \mathbb{R}$ , consider $\mathcal{L}^s: \mathcal{D}'(\mathbb{S}^{d-1}) \to \mathcal{D}'(\mathbb{S}^{d-1})$ , where $\mathcal{L}^s = (I + (-\Delta)^{1/2})^s$ and $\Delta$ is the Laplace-Beltrami operator on the sphere. We follow (Barceló et al., 2021) and define the spherical Sobolev space $H^s(\mathbb{S}^{d-1}) = \{f \in \mathcal{D}'(\mathbb{S}^{d-1}): \mathcal{L}^sf \in L^2(\mathbb{S}^{d-1})\}$ , equipped with a norm equivalent to eq. (1.24) in (Barceló et al., 2021), + +$$ +\left\| f \right\| _ {H ^ {s} (\mathbb {S} ^ {d - 1})} ^ {2} = \sum_ {\ell = 0} ^ {\infty} \sum_ {p = 1} ^ {N (d, \ell)} (1 + \ell) ^ {2 s} \left| \hat {f} _ {\ell , p} \right| ^ {2}, \tag {19} +$$ + +where $\hat{f}_{\ell,p}$ are the spherical harmonic coefficients of $f$ (see eq. (4)) and $N(d,\ell)$ is given in section 2. We propose to set the loss function to be $\frac{1}{2}\|g-\mathcal{N}\|_{H^s}^2$ in replace of $\frac{1}{2}\|g-\mathcal{N}\|_{L^2}^2$ in eq. (3). When $s=0$ , it reduces to the $L^2$ norm. If $s>0$ , the high-frequency spherical harmonic coefficients are amplified by $(1+\ell)^{2s}$ . The high-frequency components of the residual are then penalized more in the loss function, and one can expect the NN training to learn the high-frequency components faster with the squared $H^s$ loss function than the case of eq. (3). Similarly, if $s<0$ , the high-frequency spherical harmonic coefficients are dampened by $(1+\ell)^{2s}$ and one expects the NN training captures the high-frequency components of the residual more slowly with the squared $H^s$ loss function. However, when $s<0$ , the training is more robust to the high-frequency noise in the data. By tuning the parameter $s$ , we can control the frequency bias in NN training (see Theorem 4). The choice of $s$ for a particular application can be determined from theory or by cross-validation. + +First, we justify that the residual function is indeed in $H^s$ . Since we assume that $g$ is bandlimited, $g \in H^s$ for all $s \in \mathbb{R}$ . Proposition 2 shows that we could consider $s < 3/2$ for ReLU-based NNs. + +Proposition 2. Suppose $\mathcal{N}:\mathbb{S}^{d - 1}\to \mathbb{R}$ is a 2-layer ReLU NN (see eq. (5)). Then, we have $\mathcal{N}\in H^s (\mathbb{S}^{d - 1})$ for all $s < 3 / 2$ . Moreover, if $s\geq 3 / 2$ , $\mathcal{N}\in H^{s}(\mathbb{S}^{d - 1})$ if and only if $\mathcal{N}$ is affine. + +The proof is deferred to the supplementary material. When $s \geq 3/2$ , the residual function $\mathcal{N} - g$ may not be in $H^s$ . However, we can still truncate the sum in eq. (19) to a maximum frequency $\ell_{\mathrm{max}}$ to train the NN, although the sum can no longer be interpreted as an approximation of some Sobolev norm at the continuous level. We discretize the Sobolev-based loss function as + +$$ +\Phi_ {s} (\mathbf {W}) = \frac {1}{2} \sum_ {\ell = 0} ^ {\ell_ {\max }} \sum_ {p = 1} ^ {N (d, \ell)} (1 + \ell) ^ {2 s} \left(\sum_ {i = 1} ^ {n} c _ {i} Y _ {\ell , p} (\mathbf {x} _ {i}) (g - \mathcal {N}) (\mathbf {x} _ {i})\right) ^ {2} = \frac {1}{2} (\mathbf {y} - \mathbf {u}) ^ {\top} \mathbf {P} _ {s} (\mathbf {y} - \mathbf {u}), \tag {20} +$$ + +where $\mathbf{u}$ and $\mathbf{y}$ follow eq. (6), and $\mathbf{P}_s = \sum_{\ell=0}^{\ell_{\max}} \sum_{p=1}^{N(d,\ell)} (1 + \ell)^{2s} \mathbf{P}_{\ell,p}, \mathbf{P}_{\ell,p} = \mathbf{a}_{\ell,p} \mathbf{a}_{\ell,p}^\top$ , and $(\mathbf{a}_{\ell,p})_i = c_i Y_{\ell,p}(\mathbf{x}_i)$ . We assume that $\mathbf{P}_s$ is SPD, which requires that $(\ell_{\max} + 1)^2 \geq n$ . Next, we present our convergence theorem for Sobolev training. + +Theorem 4. Suppose $g \in \Pi_L^d$ and $\Phi_s$ is the loss function in eq. (20), where $\mathbf{P}_s$ is SPD and $\ell_{\max} \geq L$ . Under the assumptions of Theorem 1, if $1 - 2\eta \mu_\ell (1 + \ell)^{2s} > 0$ for all $0 \leq \ell \leq L$ , then with probability $\geq 1 - \delta$ over the random initialization, we have + +$$ +\mathbf {y} - \mathbf {u} (k) = \sum_ {\ell = 0} ^ {L} \left(1 - 2 \eta \mu_ {\ell} (1 + \ell) ^ {2 s}\right) ^ {k} \mathbf {y} ^ {\ell} + \varepsilon_ {1} + \varepsilon_ {2} (k), \quad \| \varepsilon_ {2} (k) \| _ {\mathbf {P} _ {s}} \leq \epsilon , \quad 0 \leq k \leq T, \tag {21} +$$ + +where $\mathbf{y}^{\ell} = (g_{\ell}(\mathbf{x}_1),\dots ,g_{\ell}(\mathbf{x}_n))^{\top}$ and $\varepsilon_{1}$ satisfies + +$$ +\| \varepsilon_ {1} \| _ {\mathbf {P} _ {s}} \leq \sum_ {\ell = 0} ^ {L} \mu_ {\ell} ^ {- 1} \| \varepsilon_ {1} ^ {\ell} \| _ {\mathbf {P} _ {s}}, \quad (\varepsilon_ {1} ^ {\ell}) _ {i} = e _ {i, \ell} ^ {d} + \sum_ {j = 0} ^ {\ell_ {m a x}} \frac {(1 + j) ^ {2 s}}{(1 + \ell) ^ {2 s}} \sum_ {p = 1} ^ {N (d, j)} e _ {\ell , j, p} ^ {a} \left(\mu_ {j} Y _ {j, p} (\mathbf {x} _ {i}) + e _ {i, j, p} ^ {b}\right). +$$ + +Compared to Theorem 2, Theorem 4 says that up to the level of quadrature errors, the convergence rate of the degree- $\ell$ component is $1 - 2\eta \mu_{\ell}(1 + \ell)^{2s}$ . In particular, since $\mu_{\ell} = \mathcal{O}(\ell^{-d})$ , there is an $s^{*} > 0$ , which depends on $d$ , such that $(1 + \ell)^{2s^{*}}\mu_{\ell}$ can be bounded from above and below for all $\ell \geq 0$ by positive constants that are independent of $\ell$ . This means for any $s > s^{*}$ , we expect to reverse the frequency bias behavior of NN training. Figure 2 shows the reversal of frequency bias as $s$ increases from $-1$ to $4$ (see section 6.1). + +![](images/8afa8631c8e67cd02079571229ab945b3cde563187c1918442aac0423e077ac9.jpg) + +![](images/ada2e23501431006059b518ca3aa4b1ee501286218a33fb5b9118d96963a0209.jpg) + +![](images/9bddd22395af961ec97bf54afb272c7efcc290ba561a2c2d0afa261c1d81b956.jpg) + +![](images/88e9344af89daffc2b40d216947ffa1a0d57c9400a09506cc2002ee387d5754b.jpg) +Figure 1: Left: the nonuniform data $\mathbf{x} = (\cos \theta, \sin \theta)$ on the unit circle $\mathbb{S}^1$ . Middle: the change of frequency loss for $\ell = 1$ (blue), 5 (red) and 9 (yellow) against the number of iterations for loss function $\Phi$ (solid lines) and $\widetilde{\Phi}$ (dashed lines). Right: the number of iterations for the NN training to achieve a fixed loss threshold in learning $g_{\ell}(\mathbf{x}) = \sin(\ell \theta)$ for $3 \leq \ell \leq 10$ given the loss function $\widetilde{\Phi}$ . The black line represents the $\mathcal{O}(\ell^2)$ rate based on the analysis in (Basri et al., 2019). +Figure 2: Frequency bias during NN training with a squared $H^{s}$ loss function. The blue-to-red rainbow corresponds to low-to-high frequency losses $|\widehat{\mathcal{N}} (\ell) - \hat{g} (\ell)|$ for the frequency index $\ell$ ranging from 1 (blue) to 9 (red) with nonuniform training data, respectively. Here, an overparameterized 2-layer ReLU NN $\mathcal{N}(\mathbf{x})$ is trained for 5000 epochs to learn function $g(\mathbf{x})$ given the $H^{s}$ loss with $-1\leq s\leq 4$ . The inversion of the rainbow demonstrates the reversal of frequency bias. + +# 6 EXPERIMENTS AND DISCUSSION + +This section presents three experiments with synthetic and real-world datasets to investigate the frequency bias of NN training using squared $L^2$ loss and squared $H^{s}$ loss. The first two experiments learn functions on $\mathbb{S}^1$ and $\mathbb{S}^2$ , respectively. In the third test, we train an autoencoder on the MNIST dataset for a denoising task. One can find more details in the supplementary material. + +# 6.1 LEARNING TRIGONOMETRIC POLYNOMIALS ON THE UNIT CIRCLE + +First, we consider learning a function on $\mathbb{S}^1$ . We create a set of $n = 1140$ nonuniform data $\{\mathbf{x}_i\}_{i=1}^n$ as seen in Figure 1, and compute the quadrature weights $\{c_i\}_{i=1}^n$ for the loss function $\widetilde{\Phi}$ in eq. (3) by solving a constrained quadratic program (see appendix F.1). We train a 2-layer ReLU NN to learn $g(\mathbf{x}) = \widetilde{g}(\theta) = \sum_{\ell=1}^{9} \sin(\ell \theta)$ , where $\mathbf{x} = (\cos \theta, \sin \theta)$ . We define the frequency loss $|\widehat{\mathcal{N}}(\ell) - \widehat{g}(\ell)|$ where $\mathcal{N}$ and $\widehat{g}$ are the Fourier coefficients of $\mathcal{N}$ and $g$ , respectively (see appendix F.1). In Figure 1, we plot the frequency loss for $\ell = 1, 5, 9$ in different colors to illustrate how well the NN fits each frequency component. The solid and dashed lines correspond to the loss function $\Phi$ in eq. (1) and $\widetilde{\Phi}$ in eq. (3), respectively. Our observations collaborate with the theoretical statements in Theorem 2. Figure 1 also shows that it takes asymptotically $\mathcal{O}(\ell^2)$ iterations to learn the $\ell$ th frequency $\sin(\ell \theta)$ given the loss function $\widetilde{\Phi}$ . A similar plot appears in Basri et al. (2019) for uniform training data. + +We also use the squared $H^{s}$ norm as the loss function to learn $g$ . After 5000 epochs, we plot the $\ell$ th frequency loss with $\ell$ ranging from 1 (blue) to 9 (red) in Figure 2, given different $s$ values. As $s$ increases, the higher-frequency components are learned faster. When $s > 2$ , the frequency bias is reversed in the sense that higher-frequency parts are learned faster than the lower-frequency ones rather than a low-frequency bias under the squared $L^{2}$ loss (see Theorem 2). The gradually changing "rainbow" in Figure 2 shows that the smoothing property of an overparameterized NN can be compensated by the $H^{s}$ loss function for large enough $s$ , corroborating Theorem 4. + +![](images/af5fa8c6f00737734eeafa520afc556e075bdb61970f53056642727f156933d5.jpg) +Figure 3: Frequency losses for $\ell = 4$ (blue), 10 (red), and 20 (yellow), when learning a function on $\mathbb{S}^2$ using different squared $H^{s}$ loss functions. Compared to low-frequency bias in the cases of $s = -1$ (left) and $s = 0$ (middle), we observe a high-frequency bias when $s = 2.5$ (right). + +![](images/61b5f90f7e24c6016739b72e75189c6e887adbc875f4999553eb152108755930.jpg) + +![](images/1faf3f802b715cb67656ff1f0e79fd89f5468093a81faf31f9e76ad09ff36eda.jpg) + +![](images/d36aefed1b4dd28154d8a2a7581c7366e3d35ee44b96e29df0d2bb0c480faabf.jpg) +(a) blurred image + +![](images/e749e29e10c1e5eb2b0063ec6417fc52856ad9a96c3bdaa30f267ef55d111e99.jpg) +(e) blurred image + +![](images/9293266d2b28e7089ab4ee91c40c5b353454fed56c6c4b30b7d9f3d85b3ce779.jpg) +(b) $s = -1.0$ + +![](images/c0c8eaef0aab911554b8b136035fa00dc91000f35832c8f141f2003ecde067b1.jpg) +(f) $s = -1.0$ + +![](images/fd084d785241f9fcb7134f1167b4a782b68d603bf91e59ec44d570f11f7fced3.jpg) +(c) $s = 0.0$ + +![](images/7aac2cd0834acec7bb71a2c4e2a9049c75aacf3b7acd7a20d35d23f8069ce64c.jpg) +(g) $s = 0.0$ +Figure 4: Outputs of a squared $H^{s}$ loss-trained autoencoder on a typical test image when the input images are contaminated by low-frequency noise (top row) and high-frequency noise (bottom row). + +![](images/a596f3a918a95dad11ce244255f2f33866c568bf45516de8c1dc6e2b6157c0b3.jpg) +(d) $s = 1.0$ + +![](images/3219bc5df48742e0a24daa931b3a036988aa668d1e32fc9bf99423d1f2b33305.jpg) +(h) $s = 1.0$ + +# 6.2 LEARNING SPHERICAL HARMONICS ON THE UNIT SPHERE + +Similar to the previous example in $\mathbb{S}^1$ , we design an experiment on $\mathbb{S}^2$ . We utilize a data set $\{\mathbf{x}_i\}_{i=1}^{2500}$ in (Wright & Michaels, 2015), which comes with carefully designed positive quadrature weights $\{c_i\}_{i=1}^{2500}$ . We test the squared $H^s$ loss function in NN training with a target function $g(\mathbf{x}) = \sum_{\ell=0,\ell \text{ even}}^{30} Y_{\ell,0}$ defined on $\mathbb{S}^2$ that involves many high-frequency components. The results are shown in Figure 3 with different $s$ values. The natural low-frequency bias of the NN in the case of $L^2$ -based training (i.e., $s = 0$ ) is enhanced when $s = -1$ , and is totally reversed when $s = 2.5$ . + +# 6.3 AUTOENCODER ON THE MNIST DATASET + +The idea of Sobolev training is also useful for high-dimensional training data. In Figure 4, we present the results of the autoencoder for image denoising using the MNIST dataset (LeCun et al., 2010). The outputs of the autoencoder are presented when trained with the squared $H^{s}$ norm as the loss function. We contaminate the dataset with random low-frequency noise (top row) and high-frequency noise (bottom row). When high-frequency noise is present, the $H^{s}$ loss function generally performs better with $s < 0$ , while the case of $s > 0$ helps image deblurring when the input image suffers from low-frequency noise. This corroborates our discussion in Section 5. In appendix G, we theoretically justify this phenomenon by studying the frequency bias in operator learning. + +# 7 CONCLUSIONS + +A frequency bias phenomenon is observed in NN training with nonuniform training data. Instead of the standard mean-squared loss function in eq. (1), we propose the use of a different loss function in eq. (3), which involves quadrature weights and has a natural continuous analog. With eq. (3), we rigorously analyze frequency bias with nonuniform training data using the Funk-Hecke formula. By changing the loss function to a squared $L^2$ -type Sobolev norm, we can control the frequency bias in NN training, which can accelerate NN training convergence and improve robustness under noises. + +# ACKNOWLEDGMENTS + +We thank Aparna Gupte and Liu Zhang for discussions and some initial experiments. The work was supported by the National Science Foundation grants DMS-1913129, DMS-1952757, and DMS-2045646, as well as the Simon Foundation. Y. Yang acknowledges support from Dr. Max Rössler, the Walter Haefner Foundation, and the ETH Zürich Foundation. We also gratefully thank the anonymous referees for their constructive comments, suggestions, and discussions. + +# REFERENCES + +S. Arora, S. S. Du, W. Hu, Z. Li, and R. Wang. Fine-grained analysis of optimization and generalization for overparameterized two-layer neural networks. In Inter. Conf. Mach. Learn., pp. 322-332. PMLR, 2019. +A. P. Austin and L. N. Trefethen. Trigonometric interpolation and quadrature in perturbed points. SIAM J. Numer. Anal., 55(5):2113-2122, 2017. doi: 10.1137/16M1107760. +F. R. Bach and M. I. Jordan. Kernel independent component analysis. J. Mach. Learn. Res., 3(Jul): 1-48, 2002. +C. T. H. Baker. The numerical treatment of integral equations. Oxford University Press, 1977. +J. A. Barceló, T. Luque, and S. Pérez-Esteva. Characterization of Sobolev spaces on the sphere. J. Math. Anal. Appl., 491(1):124240, 2020. +J. A. Barceló, M. Folch-Gabayet, T. Luque, S Pérez-Esteva, and M. C. Vilela. The Fourier extension operator of distributions in Sobolev spaces of the sphere and the Helmholtz equation. Proc. Roy. Soc. Edin. Sec. A: Math., 151(6):1768-1789, 2021. +R. Basri, D. Jacobs, Y. Kasten, and S. Kritchman. The convergence rate of neural networks for learned functions of different frequencies. Adv. Neur. Info. Proc. Syst., 32, 2019. +R. Basri, M. Galun, A. Geifman, D. Jacobs, Y. Kasten, and S. Kritchman. Frequency bias in neural networks for input of non-uniform density. In Inter. Conf. Mach. Learn., pp. 685-694. PMLR, 2020. +M. Belkin, D. Hsu, S. Ma, and S. Mandal. Reconciling modern machine-learning practice and the classical bias-variance trade-off. Proc. Nat. Acad. Sci., 116(32):15849-15854, 2019. +A. Bietti and J. Mairal. On the inductive bias of neural tangent kernels. Adv. Neur. Info. Proc. Syst., 32, 2019. +Y. Cao, Z. Fang, Y. Wu, D.-X. Zhou, and Q. Gu. Towards understanding the spectral bias of deep learning. arXiv preprint arXiv:1912.01198, 2019. +F Chollet. Building autoencoders in keras. https://blog.keras.io/building-autoencoders-in-keras.html, 2016. +F. Dai and Y. Xu. Approximation theory and harmonic analysis on spheres and balls, volume 23. Springer, 2013. +S. S. Du, X. Zhai, B. Poczos, and A. Singh. Gradient descent provably optimizes over-parameterized neural networks. Inter. Confer. Learn. Rep., 2018. +B. Engquist, K. Ren, and Y. Yang. The quadratic Wasserstein metric for inverse data matching. Inverse Problems, 36(5):055001, 2020. +S. Fridovich-Keil, R. Gontijo-Lopes, and R. Roelofs. Spectral bias in practice: The role of function frequency in generalization. arXiv preprint arXiv:2110.02424, 2021. +W. Hoeffding. Probability inequalities for sums of bounded random variables. J. Amer. Stat. Assoc., 58:13-30, 1963. + +A. Jacot, F. Gabriel, and C. Hongler. Neural tangent kernel: Convergence and generalization in neural networks. Adv. Neur. Info. Proc. Syst., 31, 2018. +T. Kurbiel. Derivative of the softmax function and the categorical cross-entropy loss, 2021. URL https://towardsdatascience.com/derivative-of-the-softmax-function-and-the-categorical-cross-entropy-loss-ffceefc081d1. +Y. LeCun, C. Cortes, and C. J. Burges. MNIST handwritten digit database. ATT Labs [Online]. Available: http://yann.lecun.com/exdb/mnist, 2, 2010. +S. Li. Concise formulas for the area and volume of a hyperspherical cap. *Asian J. Math. Stat.*, 4: 66-70, 2011. +H. N. Mhaskar, F. J. Narcowich, and J. D. Ward. Spherical Marcinkiewicz-Zygmund inequalities and positive quadrature. Math. Comp., 70(235):1113-1130, 2000. +Q. Nguyen, M. Mondelli, and G. Montufar. Tight bounds on the smallest eigenvalue of the neural tangent kernel for deep ReLU networks. In Inter. Conf. Mach. Learn. PMLR, 2021. +F. W. J. Olver, D. W. Lozier, R. F. Boisvert, and C. W. Clark. NIST handbook of mathematical functions hardback and CD-ROM. Cambridge university press, 2010. +E. Parzen. On Estimation of a Probability Density Function and Mode. The Annals of Mathematical Statistics, 33(3):1065 - 1076, 1962. doi: 10.1214/aoms/1177704472. URL https://doi.org/10.1214/aoms/1177704472. +N. Rahaman, A. Baratin, D. Arpit, F. Draxler, M. Lin, F. Hamprecht, Y. Bengio, and A. Courville. On the spectral bias of neural networks. In Inter. Conf. Mach. Learn., pp. 5301-5310. PMLR, 2019. +M. Rosenblatt. Remarks on Some Nonparametric Estimates of a Density Function. The Annals of Mathematical Statistics, 27(3):832 - 837, 1956. doi: 10.1214/aoms/1177728190. URL https://doi.org/10.1214/aoms/1177728190. +M. Scutbon and Z. Harchaoui. A spectral analysis of dot-product kernels. In Inter. Conf. Art. Intell. and Stat., pp. 3394-3402. PMLR, 2021. +R. T. Seeley. Spherical harmonics. Amer. Math. Mon., 73(4P2):115-121, 1966. +L. Su and P. Yang. On learning over-parameterized neural networks: A functional approximation perspective. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett (eds.), Adv. Neur. Info. Proc. Syst., volume 32. Curran Associates, Inc., 2019. +H. Widom. Asymptotic behavior of the eigenvalues of certain integral equations. Trans. Amer. Math. Soc., 109(2):278-295, 1963. +H. Widom. Asymptotic behavior of the eigenvalues of certain integral equations. II. Arch. Rat. Mech. Anal., 17(3):215-229, 1964. +C. K. Williams and C. E. Rasmussen. Gaussian processes for machine learning. MIT press Cambridge, MA, 2006. +G. Wright and T. Michaels. Spherepts. https://github.com/gradywright/spherepts, 2015. +Z.-Q. J. Xu. Frequency principle: Fourier analysis sheds light on deep neural networks. Commun. Comput. Phys., 28(5):1746-1767, 2020. +G. Yang and H. Salman. A fine-grained spectral perspective on neural networks. arXiv preprint arXiv:1907.10599, 2019. +A. Yu and A. Townsend. On the stability of unevenly spaced samples for interpolation and quadrature. arXiv preprint arXiv:2202.04722, 2022. +B. Zhu, J. Hu, Y. Lou, and Y. Yang. Implicit regularization effects of the Sobolev norms in image processing. arXiv preprint arXiv:2109.06255, 2021. + +# SUPPLEMENTARY MATERIAL + +This is the supplementary material for the paper titled "Tuning Frequency Bias in Neural Network Training with Nonuniform Data." + +The supplementary material is organized as follows. In Appendix A, we recall the notations used in the paper and introduce additional concepts for our analysis. In Appendix B, we prove that $\mathbf{H}^{\infty}$ is a symmetric and positive definite matrix. In Appendix C, we prove Theorem 1 of the paper, while the proofs of results in Section 4 and Section 5 are given in Appendix D and Appendix E, respectively. In Appendix F, we provide further details of our three experiments. The observation made in the third experiment is then briefly justified in Appendix G, in which we study frequency bias in a general operator learning setting. In Appendix H, we formally discuss the computation of positive quadrature weights. + +# A PRELIMINARIES AND NOTATION + +For $d > 1$ , let $g: \mathbb{S}^{d - 1} \to \mathbb{R}$ be a square-integrable function defined on $\mathbb{S}^{d - 1}$ . The function $g$ has a spherical harmonic expansion given in Section 2. We denote the space of harmonic functions of degree $\ell$ by $\mathcal{H}_{\ell}^{d}$ , which is the span of $\{Y_{\ell, p}\}_{p = 1}^{N(d, \ell)}$ . We further denote the space of spherical harmonics of degree $\leq \ell$ by $\Pi_{\ell}^{d} = \bigoplus_{j = 0}^{\ell} \mathcal{H}_{j}^{d}$ . + +Given distinct training data $\{\mathbf{x}_i\}_{i=1}^n$ from $\mathbb{S}^{d-1}$ and evaluations $y_i = g(\mathbf{x}_i)$ for $1 \leq i \leq n$ , our goal is to understand the intrinsic frequency bias behavior of training a 2-layer ReLU NN given in eq. (5). It is important for the theory that we initialize the weights as independently and identically distributed (iid) Gaussian random variables with a covariance matrix $\kappa^2\mathbf{I}$ , the bias terms are initialized to zero, and the coefficients, i.e., $a_1, \ldots, a_m$ , are initialized iid as $+1$ with probability $1/2$ and $-1$ otherwise. During the training process, the values of $\{a_r\}$ are not updated. + +We train with the loss function given in eq. (6) so that the gradient descent algorithm for NN training is given by eq. (7). An important object in understanding the frequency bias of NN training is the symmetric and positive definite matrix $\mathbf{H}^{\infty}\in \mathbb{R}^{n\times n}$ in eq. (9). Since $\mathbf{H}^{\infty}$ and $\mathbf{P}$ are symmetric positive definite matrices (see Proposition 1), $\mathbf{H}^{\infty}\mathbf{P}$ has positive real eigenvalues. To see this, note that $\mathbf{H}^{\infty}\mathbf{P} = \mathbf{H}^{\infty}\mathbf{P}^{1 / 2}\mathbf{P}^{1 / 2} = \mathbf{P}^{-1 / 2}(\mathbf{P}^{1 / 2}\mathbf{H}^{\infty}\mathbf{P}^{1 / 2})\mathbf{P}^{1 / 2}$ . This means that $\mathbf{H}^{\infty}\mathbf{P}$ and $\mathbf{P}^{1 / 2}\mathbf{H}^{\infty}\mathbf{P}^{1 / 2}$ are similar. Since the matrix $\mathbf{P}^{1 / 2}\mathbf{H}^{\infty}\mathbf{P}^{1 / 2}$ is symmetric positive definite, $\mathbf{H}^{\infty}\mathbf{P}$ has positive eigenvalues. We denote the eigenvalues of $\mathbf{H}^{\infty}\mathbf{P}$ by $\lambda_{n - 1}\geq \dots \geq \lambda_0 > 0$ , which partially govern the frequency bias phenomena. It is worth mentioning that although $\mathbf{H}^{\infty}\mathbf{P}$ is not symmetric, it is self-adjoint in the inner product space induced by $\mathbf{P}$ because + +$$ +\left\langle \mathbf {H} ^ {\infty} \mathbf {P} \boldsymbol {\xi}, \zeta \right\rangle_ {\mathbf {P}} = \left(\mathbf {H} ^ {\infty} \mathbf {P} \boldsymbol {\xi}\right) ^ {\top} \mathbf {P} \boldsymbol {\zeta} = \boldsymbol {\xi} ^ {\top} \mathbf {P} \left(\mathbf {H} ^ {\infty} \mathbf {P} \boldsymbol {\zeta}\right) = \left\langle \boldsymbol {\xi}, \mathbf {H} ^ {\infty} \mathbf {P} \boldsymbol {\zeta} \right\rangle_ {\mathbf {P}}. \tag {22} +$$ + +It is convenient to analyze the eigenvalues and eigenvectors of $\mathbf{H}^{\infty}\mathbf{P}$ via the zonal kernel $K^{\infty}$ : $\mathbb{S}^{d - 1}\times \mathbb{S}^{d - 1}\to \mathbb{R}$ given in eq. (11). The key is the Funk-Hecke formula (Seeley, 1966). + +Theorem 5 (Funk-Hecke). Suppose $K:[-1,1]\to \mathbb{R}$ is measurable and $K(t)(1 - t^2)^{(d - 3) / 2}$ is integrable on $[-1,1]$ . Then, for any $h\in \mathcal{H}_{\ell}^{d}$ , we have + +$$ +\int_ {\mathbb {S} ^ {d - 1}} K (\langle \boldsymbol {\xi}, \boldsymbol {\zeta} \rangle) h (\boldsymbol {\xi}) d \boldsymbol {\xi} = \left(A _ {d} \int_ {- 1} ^ {1} K (t) P _ {\ell , d} (t) \left(1 - t ^ {2}\right) ^ {(d - 3) / 2} d t\right) h (\boldsymbol {\zeta}), \quad \boldsymbol {\zeta} \in \mathbb {S} ^ {d - 1}, \tag {23} +$$ + +where $P_{\ell ,d}$ is the ultraspherical polynomial given by + +$$ +P _ {\ell , d} (t) = \frac {(- 1) ^ {\ell} \Gamma ((d - 1) / 2)}{2 ^ {\ell} \Gamma (\ell + (d - 1) / 2) (1 - t ^ {2}) ^ {(d - 3) / 2}} \frac {d ^ {\ell}}{d t ^ {\ell}} (1 - t ^ {2}) ^ {\ell + (d - 3) / 2}. \tag {24} +$$ + +Applying Theorem 5, we have that + +$$ +\int_ {\mathbb {S} ^ {d - 1}} K ^ {\infty} (\mathbf {x}, \mathbf {y}) h (\mathbf {y}) d \sigma (\mathbf {y}) = \mu_ {\ell} h (\mathbf {x}), \qquad h \in \mathcal {H} _ {\ell} ^ {d}, +$$ + +where $\mu_{\ell} > 0, \forall \ell$ , given by (Basri et al., 2019) + +$$ +\mu_ {\ell} = \left\{ \begin{array}{l l} \frac {1}{2} C _ {1} ^ {d} (0) \left(\frac {1}{(d - 1) 2 ^ {d}} \binom {d - 1} {\frac {d - 1}{2}} + \frac {2 ^ {d - 2}}{(d - 1) \binom {d - 2} {\frac {d - 1}{2}}} - \frac {1}{2} \sum_ {p = 0} ^ {\frac {d - 3}{2}} (- 1) ^ {p} \binom {\frac {d - 3}{2}} {p} \frac {1}{2 p + 1}\right), & \ell = 0, \\ \frac {1}{2} C _ {1} ^ {d} (1) \sum_ {p = \lceil \frac {\ell}{2} \rceil} ^ {\ell + \frac {d - 3}{2}} C _ {2} ^ {d} (p, 1) \left(\frac {1}{2 (2 p + 1)} + \frac {1}{4 p} \left(1 - \frac {1}{2 ^ {2 p}} \binom {2 p} {p}\right)\right), & \ell = 1, \\ \frac {1}{2} C _ {1} ^ {d} (\ell) \sum_ {p = \lceil \frac {\ell}{2} \rceil} ^ {\ell + \frac {d - 3}{2}} C _ {2} ^ {d} (p, \ell) \Big (\frac {- 1}{2 (2 p - \ell + 1)} + \frac {1}{2 (2 p - \ell + 2)} \left(1 - \frac {1}{2 ^ {2 p - \ell + 2}} \binom {2 p - \ell + 2} {\frac {2 p - \ell + 2}{2}}\right) \Big), & \ell \geq 2 \text {e v e n}, \\ \frac {1}{2} C _ {1} ^ {d} (\ell) \sum_ {p = \lceil \frac {\ell}{2} \rceil} ^ {\ell + \frac {d - 3}{2}} C _ {2} ^ {d} (p, \ell) \left(\frac {1}{2 (2 p - \ell + 1)} \left(1 - \frac {1}{2 ^ {2 p - \ell + 1}} \binom {2 p - \ell + 1} {\frac {2 p - \ell + 1}{2}}\right)\right), & \ell \geq 2 \text {o d d} \end{array} \right. +$$ + +for $d\geq 3$ $^d$ odd, where + +$$ +C _ {1} ^ {d} (\ell) = \frac {(- 1) ^ {\ell} 2 \pi^ {(d - 1) / 2}}{(d - 1) 2 ^ {\ell} \Gamma (\ell + (d - 1) / 2)}, \qquad C _ {2} ^ {d} (p, \ell) = (- 1) ^ {p} \binom {\ell + \frac {d - 3}{2}} {p} \frac {(2 p) !}{(2 p - \ell) !}. +$$ + +Here, the exclamation mark means a factorial and $\binom{\cdot}{\cdot}$ denotes the binomial coefficient. + +Given $\mathbf{x}$ , $\mathbf{w}_r$ , and $b_{r}$ in eq. (5), we write $\tilde{\mathbf{x}} = \frac{1}{\sqrt{2}} (\mathbf{x}, 1) \in \mathbb{S}^d$ and $\tilde{\mathbf{w}}_r = (\mathbf{w}_r, b_r) \in \mathbb{R}^{d + 1}$ . Therefore, we have $\mathrm{ReLU}(\mathbf{w}_r^\top \mathbf{x} + b_r) = \sqrt{2} \mathrm{ReLU}(\tilde{\mathbf{w}}_r^\top \tilde{\mathbf{x}})$ and the NN function can be rewritten as + +$$ +\mathcal {N} (\mathbf {x}) = \frac {\sqrt {2}}{\sqrt {m}} \sum_ {r = 1} ^ {m} a _ {r} \mathrm {R e L U} \left(\tilde {\mathbf {w}} _ {r} ^ {\top} \tilde {\mathbf {x}}\right). +$$ + +By replacing the expectation over random initialization of $\tilde{\mathbf{w}}$ by $\tilde{\mathbf{w}}(t)$ , we define the instantiations of $\mathbf{H}^\infty$ at the $k$ th iteration by $\mathbf{H}(k)$ , where + +$$ +H _ {i j} (k) = \frac {1}{m} \tilde {\mathbf {x}} _ {i} ^ {\top} \tilde {\mathbf {x}} _ {j} \sum_ {r = 1} ^ {m} \mathbb {1} _ {\{\tilde {\mathbf {x}} _ {i} ^ {\top} \tilde {\mathbf {w}} _ {r} (k) \geq 0, \tilde {\mathbf {x}} _ {j} ^ {\top} \tilde {\mathbf {w}} _ {r} (k) \geq 0 \}}, \tag {25} +$$ + +where $\mathbb{1}$ is an indicator function. + +# B THE MATRIX $\mathbf{H}^{\infty}$ IS SYMMETRIC AND POSITIVE DEFINITE + +Proposition 1 states that the matrix $\mathbf{H}^{\infty}$ defined by eq. (9) is symmetric and positive definite. While the symmetry of $\mathbf{H}^{\infty}$ is immediate from its closed-form expression, the fact that it is positive definite requires a more detailed analysis. The proof idea is similar to that of Theorem 3.1 of (Du et al., 2018), in which the matrix $\mathbf{H}^{\infty}$ is associated with a 2-layer ReLU NN without biases. However, our $\mathbf{H}^{\infty}$ is associated with a 2-layer ReLU NN with biases. While (Du et al., 2018) requires that no two training data points are parallel, we allow the existence of $\mathbf{x}_{i_1} = -\mathbf{x}_{i_2}$ for some $i_1$ and $i_2$ . To deal with this case, our proof employs a pair of nodes denoted by $\mathbf{x}_{i_1}, \mathbf{x}_{i_2}$ . + +Proof of Proposition 1. For a measurable function $f: \mathbb{R}^d \to \mathbb{R}^{d+1}$ , we define a norm of $f$ as + +$$ +\| f \| _ {\mathcal {H}} ^ {2} = \mathbb {E} _ {\mathbf {w} \sim \mathcal {N} (\mathbf {0}, \kappa^ {2} \mathbf {I})} \| f (\mathbf {w}) \| _ {2} ^ {2}, +$$ + +and let $\mathcal{H}$ be the space of measurable functions such that $\| f\|_{\mathcal{H}} < \infty$ . It can be shown that $\mathcal{H}$ is a Hilbert space with respect to the inner product $\langle f,g\rangle_{\mathcal{H}} = \mathbb{E}_{\mathbf{w}\sim \mathcal{N}(\mathbf{0},\kappa^2\mathbf{I})}\left[f(\mathbf{w})^\top g(\mathbf{w})\right]$ (Du et al., 2018). For each $\mathbf{x}_i$ , $1\leq i\leq n$ , we define the function $\phi_i$ by + +$$ +\phi_ {i} (\mathbf {w}) = \tilde {\mathbf {x}} _ {i} \mathbb {1} _ {\left\{\mathbf {w} ^ {\top} \mathbf {x} _ {i} \geq 0 \right\}}, \quad \mathbf {w} \in \mathbb {R} ^ {d}. +$$ + +Then, $\phi_i\in \mathcal{H}$ for all $i$ , and $H_{ij}^{\infty} = \langle \phi_i,\phi_j\rangle_{\mathcal{H}}$ . We prove that $\mathbf{H}^{\infty}$ is positive definite by showing that $\{\phi_i\}_{i = 1}^n$ is a linearly independent set in $\mathcal{H}$ . + +To show $\{\phi_i\}_{i = 1}^n$ is a linearly independent set, we show that + +$$ +\alpha_ {1} \phi_ {1} (\mathbf {w}) + \dots + \alpha_ {n} \phi_ {n} (\mathbf {w}) = \mathbf {0} \quad \text {f o r a l m o s t e v e r y} \mathbf {w} \in \mathbb {R} ^ {d} \tag {26} +$$ + +implies that $\alpha_{i} = 0$ for $1\leq i\leq n$ . We fix some $1\leq i_{1}\leq n$ and, without loss of generality, assume that $\mathbf{x}_{i_2} = -\mathbf{x}_{i_1}$ . Define the set $D_{j} = \{\mathbf{w}\in \mathbb{R}^{d}\mid \mathbf{w}^{\top}\mathbf{x}_{j} = 0\}$ for $1\leq j\leq n$ . As a + +result, $D_{i_1} = D_{i_2}$ . Since each $D_j$ is a hyperplane passing through the origin and $D_{i_1} \neq D_j$ for any $j \neq i_1, i_2$ , $\exists \mathbf{z} \in D_{i_1}$ such that $\mathbf{z} \notin D_j$ for any $j \neq i_1, i_2$ . For a positive radius $R > 0$ , let $B_R = B(\mathbf{z}, R)$ be the ball centered at $\mathbf{z}$ of radius $R$ . Define a partition of $B_R$ into two sets denoted by $B_R^+$ and $B_R^-$ (possibly missing a subset of $B_R$ that has zero Lebesgue measure), where + +$$ +B _ {R} ^ {+} = \left\{\mathbf {w} \in B _ {R} \mid \mathbf {w} ^ {\top} \mathbf {x} _ {i _ {1}} > 0 \right\} = \left\{\mathbf {w} \in B _ {R} \mid \mathbf {w} ^ {\top} \mathbf {x} _ {i _ {2}} < 0 \right\}, +$$ + +$$ +B _ {R} ^ {-} = \left\{\mathbf {w} \in B _ {R} \mid \mathbf {w} ^ {\top} \mathbf {x} _ {i _ {1}} < 0 \right\} = \left\{\mathbf {w} \in B _ {R} \mid \mathbf {w} ^ {\top} \mathbf {x} _ {i _ {2}} > 0 \right\}. +$$ + +Since $D_{j}$ is closed for each $1 \leq j \leq n$ , $B_{R}$ is eventually disjoint from $D_{j}$ as $R \to 0$ . Hence, we have + +$$ +\lim _ {R \to 0} \sup _ {\mathbf {w} \in B _ {R}} | \phi_ {j} (\mathbf {z}) - \phi_ {j} (\mathbf {w}) | = 0, \qquad j \neq i _ {1}, i _ {2}, +$$ + +where $|\cdot|$ denotes the Euclidean distance. Then, for any $j \neq i_1, i_2$ , we have + +$$ +\lim _ {R \to 0} \frac {1}{| B _ {R} ^ {+} |} \int_ {B _ {R} ^ {+}} \phi_ {j} (\mathbf {w}) d \mathbf {w} = \phi_ {j} (\mathbf {z}), \quad \lim _ {R \to 0} \frac {1}{| B _ {R} ^ {-} |} \int_ {B _ {R} ^ {-}} \phi_ {j} (\mathbf {w}) d \mathbf {w} = \phi_ {j} (\mathbf {z}), +$$ + +where $|\cdot|$ denotes the Lebesgue measure of a set. Consequently, we find that + +$$ +\lim _ {R \rightarrow 0} \left(\frac {1}{| B _ {R} ^ {+} |} \int_ {B _ {R} ^ {+}} \phi_ {j} (\mathbf {w}) d \mathbf {w} - \frac {1}{| B _ {R} ^ {-} |} \int_ {B _ {R} ^ {-}} \phi_ {j} (\mathbf {w}) d \mathbf {w}\right) = \mathbf {0}, \qquad j \neq i _ {1}, i _ {2}. +$$ + +Now, consider the integral of $\phi_{i_1}$ and $\phi_{i_2}$ . We have + +$$ +\lim _ {R \to 0} \left(\frac {1}{| B _ {R} ^ {+} |} \int_ {B _ {R} ^ {+}} \phi_ {i _ {1}} (\mathbf {w}) d \mathbf {w} - \frac {1}{| B _ {R} ^ {-} |} \int_ {B _ {R} ^ {-}} \phi_ {i _ {1}} (\mathbf {w}) d \mathbf {w}\right) = \lim _ {R \to 0} \left(\frac {1}{| B _ {R} ^ {+} |} \int_ {B _ {R} ^ {+}} \tilde {\mathbf {x}} _ {i _ {1}} d \mathbf {w} - \frac {1}{| B _ {R} ^ {-} |} \int_ {B _ {R} ^ {-}} \mathbf {0} d \mathbf {w}\right) = \tilde {\mathbf {x}} _ {i _ {1}}, +$$ + +$$ +\lim _ {R \rightarrow 0} \left(\frac {1}{| B _ {R} ^ {+} |} \int_ {B _ {R} ^ {+}} \phi_ {i _ {2}} (\mathbf {w}) d \mathbf {w} - \frac {1}{| B _ {R} ^ {-} |} \int_ {B _ {R} ^ {-}} \phi_ {i _ {2}} (\mathbf {w}) d \mathbf {w}\right) = \lim _ {R \rightarrow 0} \left(\frac {1}{| B _ {R} ^ {+} |} \int_ {B _ {R} ^ {+}} \mathbf {0} d \mathbf {w} - \frac {1}{| B _ {R} ^ {-} |} \int_ {B _ {R} ^ {-}} \tilde {\mathbf {x}} _ {i _ {2}} d \mathbf {w}\right) = - \tilde {\mathbf {x}} _ {i _ {2}}. +$$ + +By applying these limiting expressions to $\sum_{j=1}^{n} \alpha_j \phi_j(\mathbf{w}) = \mathbf{0}$ , we find that $\alpha_{i_1} \tilde{\mathbf{x}}_{i_1} - \alpha_{i_2} \tilde{\mathbf{x}}_{i_2} = \mathbf{0}$ . Since the last entries of both $\tilde{\mathbf{x}}_{i_1}$ and $\tilde{\mathbf{x}}_{i_2}$ are $1/\sqrt{2}$ , we have $\alpha_{i_1} = \alpha_{i_2}$ . Thus, we have $\alpha_{i_1} = 0$ because $\mathbf{x}_{i_1} \neq \mathbf{0}$ . Since $i_1$ is arbitrary, we showed that $\alpha_j = 0$ for every $1 \leq j \leq n$ , and the statement of the proposition follows. + +It is clear that the proof of Proposition 1 is also true if we assume that each entry of $\mathbf{w}_r$ is initialized from an iid sub-Gaussian distribution with zero mean and whose support is the entire $\mathbb{R}$ , and we update the definition of $\mathbf{H}^\infty$ according to eq. (9). + +# C THE CONVERGENCE OF NEURAL NETWORK TRAINING + +In this section, we develop the theory for learning a NN with a general loss function $\Phi_{\mathbf{P}}$ defined by a positive definite matrix $\mathbf{P}$ in eq. (6). In particular, we prove Theorem 1, which states that provided the learning rate is sufficiently small, the weights are initialized without too much variance, and the NN is sufficiently wide, then the residual in the first few epochs can be described with the matrix $\mathbf{H}^{\infty}\mathbf{P}$ . + +While our proof is similar to that of (Su & Yang, 2019), the argument is distinct in three essential ways: (1) Our proof applies to any loss function defined by a positive definite matrix $\mathbf{P}$ , which requires us to use a different Hilbert space $(\mathbb{R}^n,\langle \cdot ,\cdot \rangle_{\mathbf{P}})$ . (2) While the result in (Su & Yang, 2019) bounds the residual using the minimum eigenvalue of $\mathbf{H}^\infty$ , we estimate the residual as a matrix-vector product of $(\mathbf{I} - 2\eta \mathbf{H}^\infty \mathbf{P})^k\mathbf{y}$ , which allows us to analyze the training error using all eigenvalues of $\mathbf{H}^\infty \mathbf{P}$ . (3) We use a different NN function that incorporates the bias terms and we do not assume that we initialize the weights in a way that makes $\mathcal{N}_0 = 0$ . + +Before we prove the theorem, we define some useful quantities. Let $\mathcal{A}$ be the set of indices such that the coefficients $a_{r}$ are initialized to 1 and let $\mathcal{B}$ be the set initialized to $-1$ . We then decompose $\mathbf{H}(k)$ into two parts, where $\mathbf{H}(k)$ is defined in eq. (25), so that $\mathbf{H}(k) = \mathbf{H}^{+}(k) + \mathbf{H}^{-}(k)$ with + +$$ +H_{ij}^{+}(k) = \frac{1}{m}\tilde{\mathbf{x}}_{i}^{\top}\tilde{\mathbf{x}}_{j}\sum_{r\in \mathcal{A}}\mathbb{1}_{\left\{ \begin{array}{c}\tilde{\mathbf{w}}_{r}(k)^{\top}\tilde{\mathbf{x}}_{i}\geq 0\\ \tilde{\mathbf{w}}_{r}(k)^{\top}\tilde{\mathbf{x}}_{j}\geq 0 \end{array} \right\}},\qquad H_{ij}^{-}(k) = \frac{1}{m}\tilde{\mathbf{x}}_{i}^{\top}\tilde{\mathbf{x}}_{j}\sum_{r\in \mathcal{B}}\mathbb{1}_{\left\{ \begin{array}{c}\tilde{\mathbf{w}}_{r}(k)^{\top}\tilde{\mathbf{x}}_{i}\geq 0\\ \tilde{\mathbf{w}}_{r}(k)^{\top}\tilde{\mathbf{x}}_{j}\geq 0 \end{array} \right\}}. +$$ + +Similarly, we define two other matrices $\hat{\mathbf{H}}^{+}(k)$ and $\hat{\mathbf{H}}^{-}(k)$ as + +$$ +\tilde {H} _ {i j} ^ {+} (k) = \frac {1}{m} \tilde {\mathbf {x}} _ {i} ^ {\top} \tilde {\mathbf {x}} _ {j} \sum_ {r \in \mathcal {A}} \mathbb {1} _ {\left\{ \begin{array}{c} \tilde {\mathbf {w}} _ {r} (k + 1) ^ {\top} \tilde {\mathbf {x}} _ {i} \geq 0 \\ \tilde {\mathbf {w}} _ {r} (k) ^ {\top} \tilde {\mathbf {x}} _ {j} \geq 0 \end{array} \right\}}, \quad \tilde {H} _ {i j} ^ {-} (k) = \frac {1}{m} \tilde {\mathbf {x}} _ {i} ^ {\top} \tilde {\mathbf {x}} _ {j} \sum_ {r \in \mathcal {B}} \mathbb {1} _ {\left\{ \begin{array}{c} \tilde {\mathbf {w}} _ {r} (k + 1) ^ {\top} \tilde {\mathbf {x}} _ {i} \geq 0 \\ \tilde {\mathbf {w}} _ {r} (k) ^ {\top} \tilde {\mathbf {x}} _ {j} \geq 0. \end{array} \right\}}. +$$ + +Unfortunately, $\tilde{\mathbf{H}}^{+}(k)$ and $\tilde{\mathbf{H}}^{-}(k)$ are not necessarily symmetric and they differ from $\mathbf{H}^{+}(k)$ and $\mathbf{H}^{-}(k)$ up to sign flips. To simplify the notation later, we also define two auxiliary matrices $\mathbf{L}(k)$ and $\mathbf{M}(k)$ as + +$$ +\mathbf {L} (k) = \tilde {\mathbf {H}} ^ {+} (k) - \mathbf {H} ^ {+} (k), \qquad \mathbf {M} (k) = \tilde {\mathbf {H}} ^ {-} (k) - \mathbf {H} ^ {-} (k). +$$ + +We now prove that $\mathbf{I} - 2\eta \mathbf{H}(k)\mathbf{P}$ is close to the transition matrix for the residual, up to sign flips, i.e., $\mathbf{y} - \mathbf{u}(k + 1) \approx (\mathbf{I} - 2\eta \mathbf{H}(k)\mathbf{P})(\mathbf{y} - \mathbf{u}(k))$ . + +Lemma 1. Let $\mathbf{z}(k) = \mathbf{y} - \mathbf{u}(k)$ be the residual after the $k$ th iteration. For any $k \geq 0$ and $\eta > 0$ , we have + +$$ +\left(\mathbf {I} - 2 \eta \left(\tilde {\mathbf {H}} ^ {+} (k) + \mathbf {H} ^ {-} (k)\right) \mathbf {P}\right) \mathbf {z} (k) \leq \mathbf {z} (k + 1) \leq \left(\mathbf {I} - 2 \eta \left(\mathbf {H} ^ {+} (k) + \tilde {\mathbf {H}} ^ {-} (k)\right) \mathbf {P}\right) \mathbf {z} (k), +$$ + +where the inequalities are entry-wise. + +Proof. First, by the gradient descent update rule, we have + +$$ +\tilde {\mathbf {w}} _ {r} (k + 1) - \tilde {\mathbf {w}} _ {r} (k) = - \eta \frac {\partial \Phi_ {\mathbf {P}} (\tilde {\mathbf {w}} _ {1} (k) , \ldots , \tilde {\mathbf {w}} _ {m} (k))}{\partial \tilde {\mathbf {w}} _ {r}} = - \eta \frac {\partial \mathbf {u} (k)}{\partial \tilde {\mathbf {w}} _ {r}} \frac {\partial \Phi_ {\mathbf {P}} (\mathbf {u})}{\partial \mathbf {u}}, +$$ + +where the $(d + 1)\times n$ Jacobian matrix is given by + +$$ +\frac {\partial \mathbf {u} (k)}{\partial \tilde {\mathbf {w}} _ {r}} = \frac {\sqrt {2} a _ {r}}{\sqrt {m}} \left[ \tilde {\mathbf {x}} _ {1} \mathbb {1} _ {\{\tilde {\mathbf {x}} _ {1} ^ {\top} \tilde {\mathbf {w}} _ {r} (k) \geq 0 \}} \quad \dots \quad \tilde {\mathbf {x}} _ {n} \mathbb {1} _ {\{\tilde {\mathbf {x}} _ {n} ^ {\top} \tilde {\mathbf {w}} _ {r} (k) \geq 0 \}}, \right] \tag {27} +$$ + +and the gradient of the loss function $\Phi_{\mathbf{P}}$ defined in eq. (6) with respect to $\mathbf{u}$ is given by + +$$ +\frac {\partial \Phi_ {\mathbf {P}} (\mathbf {u})}{\partial \mathbf {u}} = - \mathbf {P} (\mathbf {y} - \mathbf {u} (k)) = - \mathbf {P} \mathbf {z} (k), \tag {28} +$$ + +which is a vector of length $n$ . Hence, it follows that + +$$ +\tilde {\mathbf {w}} _ {r} (k + 1) ^ {\top} \tilde {\mathbf {x}} _ {i} - \tilde {\mathbf {w}} _ {r} (k) ^ {\top} \tilde {\mathbf {x}} _ {i} = \frac {\sqrt {2} \eta a _ {r}}{\sqrt {m}} \sum_ {p = 1} ^ {n} \left(\mathbf {P} \mathbf {z} (k)\right) _ {p} \tilde {\mathbf {x}} _ {i} ^ {\top} \tilde {\mathbf {x}} _ {p} \mathbb {1} _ {\{\tilde {\mathbf {x}} _ {p} ^ {\top} \tilde {\mathbf {w}} _ {r} (k) \geq 0 \}}, +$$ + +where $(\mathbf{P}\mathbf{z}(k))_p$ denotes the $p$ th element of $\mathbf{P}\mathbf{z}(k)$ . Using the property of ReLU that + +$$ +(b - a) \mathbb {1} _ {\{a > 0 \}} \leq \mathrm {R e L U} (b) - \mathrm {R e L U} (a) \leq (b - a) \mathbb {1} _ {\{b > 0 \}}, \qquad a, b \in \mathbb {R}, +$$ + +we have + +$$ +\begin{array}{l} \mathrm {R e L U} \left(\tilde {\mathbf {w}} _ {r} (k + 1) ^ {\top} \tilde {\mathbf {x}} _ {i}\right) - \mathrm {R e L U} \left(\tilde {\mathbf {w}} _ {r} (k) ^ {\top} \tilde {\mathbf {x}} _ {i}\right) \\ \leq \frac {\sqrt {2} \eta a _ {r}}{\sqrt {m}} \sum_ {p = 1} ^ {n} (\mathbf {P z} (k)) _ {p} \tilde {\mathbf {x}} _ {i} ^ {\top} \tilde {\mathbf {x}} _ {p} \mathbb {1} _ {\{\tilde {\mathbf {x}} _ {p} ^ {\top} \tilde {\mathbf {w}} _ {r} (k) \geq 0 \}} \mathbb {1} _ {\{\tilde {\mathbf {x}} _ {i} ^ {\top} \tilde {\mathbf {w}} _ {r} (k + 1) \geq 0 \}}, \\ \end{array} +$$ + +and + +$$ +\begin{array}{l} \operatorname {R e L U} \left(\tilde {\mathbf {w}} _ {r} (k + 1) ^ {\top} \tilde {\mathbf {x}} _ {i}\right) - \operatorname {R e L U} \left(\tilde {\mathbf {w}} _ {r} (k) ^ {\top} \tilde {\mathbf {x}} _ {i}\right) \\ \geq \frac {\sqrt {2} \eta a _ {r}}{\sqrt {m}} \sum_ {p = 1} ^ {n} (\mathbf {P z} (k)) _ {p} \tilde {\mathbf {x}} _ {i} ^ {\top} \tilde {\mathbf {x}} _ {p} \mathbb {1} _ {\{\tilde {\mathbf {x}} _ {p} ^ {\top} \tilde {\mathbf {w}} _ {r} (k) \geq 0 \}} \mathbb {1} _ {\{\tilde {\mathbf {x}} _ {i} ^ {\top} \tilde {\mathbf {w}} _ {r} (k) \geq 0 \}}. \\ \end{array} +$$ + +Hence, we have + +$$ +\begin{array}{l} (\mathbf {u} (k + 1)) _ {i} - (\mathbf {u} (k)) _ {i} = \frac {\sqrt {2}}{\sqrt {m}} \sum_ {r \in \mathcal {A}} \left(\mathrm {R e L U} (\tilde {\mathbf {w}} _ {r} (k + 1) ^ {\top} \tilde {\mathbf {x}} _ {i}) - \mathrm {R e L U} (\tilde {\mathbf {w}} _ {r} (k) ^ {\top} \tilde {\mathbf {x}} _ {i})\right) \\ - \frac {\sqrt {2}}{\sqrt {m}} \sum_ {r \in \mathcal {B}} \left(\operatorname {R e L U} \left(\tilde {\mathbf {w}} _ {r} (k + 1) ^ {\top} \tilde {\mathbf {x}} _ {i}\right) - \operatorname {R e L U} \left(\tilde {\mathbf {w}} _ {r} (k) ^ {\top} \tilde {\mathbf {x}} _ {i}\right)\right) \\ \leq \frac {2 \eta}{m} \sum_ {r \in \mathcal {A}} \sum_ {p = 1} ^ {n} (\mathbf {P z} (k)) _ {p} \tilde {\mathbf {x}} _ {i} ^ {\top} \tilde {\mathbf {x}} _ {p} \mathbb {1} _ {\{\tilde {\mathbf {x}} _ {p} ^ {\top} \tilde {\mathbf {w}} _ {r} (k) \geq 0 \}} \mathbb {1} _ {\{\tilde {\mathbf {x}} _ {i} ^ {\top} \tilde {\mathbf {w}} _ {r} (k + 1) \geq 0 \}} \\ + \frac {2 \eta}{m} \sum_ {r \in \mathcal {B}} \sum_ {p = 1} ^ {n} (\mathbf {P z} (k)) _ {p} \tilde {\mathbf {x}} _ {i} ^ {\top} \tilde {\mathbf {x}} _ {p} \mathbb {1} _ {\{\tilde {\mathbf {x}} _ {p} ^ {\top} \tilde {\mathbf {w}} _ {r} (k) \geq 0 \}} \mathbb {1} _ {\{\tilde {\mathbf {x}} _ {i} ^ {\top} \tilde {\mathbf {w}} _ {r} (k) \geq 0 \}} \\ = 2 \eta \sum_ {p = 1} ^ {n} \left(\tilde {H} _ {i p} ^ {+} (k) + H _ {i p} ^ {-} (k)\right) (\mathbf {P z} (k)) _ {p}. \\ \end{array} +$$ + +This proves the first inequality. The second inequality can be shown with a similar argument. + +![](images/f0f686262a5612c798e5379c9df21efc4cdb3501ca5d52830c3feef87efd37d8.jpg) + +In particular, if there is no sign flip of the weights, then $\tilde{\mathbf{H}}(k) = \tilde{\mathbf{H}}^{+}(k) + \tilde{\mathbf{H}}^{-}(k) = \mathbf{H}(k)$ and the inequalities in Lemma 1 are equalities. Next, using Lemma 1, we can derive an expression for $\mathbf{y} - \mathbf{u}(k)$ using $\mathbf{H}^{\infty}$ , up to an error term. + +Lemma 2. For any $0 < \eta < 1 / (2M_{\mathbf{P}}^{2}n)$ and any $k\geq 0$ , we have that + +$$ +\mathbf {y} - \mathbf {u} (k) = \left(\mathbf {I} - 2 \eta \mathbf {H} ^ {\infty} \mathbf {P}\right) ^ {k} (\mathbf {y} - \mathbf {u} (0)) + \epsilon (k), \tag {29} +$$ + +where + +$$ +\begin{array}{l} \left\| \boldsymbol {\epsilon} (k) \right\| _ {\mathbf {P}} \leq 2 \eta \sum_ {t = 0} ^ {k - 1} \left\| \left(\mathbf {H} ^ {\infty} - \mathbf {H} (t)\right) \mathbf {P} \right\| _ {\mathbf {P}} \left\| \left(\mathbf {I} - 2 \eta \mathbf {H} ^ {\infty} \mathbf {P}\right) ^ {t} (\mathbf {y} - \mathbf {u} (0)) \right\| _ {\mathbf {P}} \tag {30} \\ + 2 \eta \sum_ {t = 0} ^ {k - 1} \left(\| \mathbf {M} (t) \mathbf {P} \| _ {\mathbf {P}} + \| \mathbf {L} (t) \mathbf {P} \| _ {\mathbf {P}}\right) \| \mathbf {y} - \mathbf {u} (t) \| _ {\mathbf {P}}. \\ \end{array} +$$ + +Proof. For $k \geq 1$ , we define $\mathbf{r}(k)$ by + +$$ +\mathbf {r} (k) = \mathbf {y} - \mathbf {u} (k) - (\mathbf {I} - 2 \eta \mathbf {H} (k - 1) \mathbf {P}) (\mathbf {y} - \mathbf {u} (k - 1)). \tag {31} +$$ + +Then, by Lemma 1 we have + +$$ +\left\| \mathbf {r} (k) \right\| _ {\mathbf {P}} \leq 2 \eta \left(\left\| \mathbf {M} (k - 1) \mathbf {P} \right\| _ {\mathbf {P}} + \left\| \mathbf {L} (k - 1) \mathbf {P} \right\| _ {\mathbf {P}}\right) \left\| \mathbf {y} - \mathbf {u} (k - 1) \right\| _ {\mathbf {P}}. \tag {32} +$$ + +Note that eq. (31) is a first-order non-homogeneous recurrence relation for $\mathbf{y} - \mathbf{u}(k)$ , which has an analytic solution. Thus, we can expand $\mathbf{y} - \mathbf{u}(k)$ for $k \geq 1$ as + +$$ +\begin{array}{l} \mathbf {y} - \mathbf {u} (k) = ((\mathbf {I} - 2 \eta \mathbf {H} (k - 1) \mathbf {P}) \cdot \cdot \cdot (\mathbf {I} - 2 \eta \mathbf {H} (0) \mathbf {P})) (\mathbf {y} - \mathbf {u} (0)) \\ + \mathbf {r} (k) + \sum_ {t = 1} ^ {k - 1} \left(\left(\mathbf {I} - 2 \eta \mathbf {H} (k - 1) \mathbf {P}\right) \dots \left(\mathbf {I} - 2 \eta \mathbf {H} (t) \mathbf {P}\right)\right) \mathbf {r} (t). \tag {33} \\ \end{array} +$$ + +Moreover, we can write the product of the matrices as (Su & Yang, 2019) + +$$ +\begin{array}{l} (\mathbf {I} - 2 \eta \mathbf {H} (k - 1) \mathbf {P}) \dots (\mathbf {I} - 2 \eta \mathbf {H} (0) \mathbf {P}) \\ = \left(\mathbf {I} - 2 \eta \mathbf {H} ^ {\infty} \mathbf {P}\right) ^ {k} + 2 \eta \left(\mathbf {H} ^ {\infty} \mathbf {P} - \mathbf {H} (k - 1) \mathbf {P}\right) \left(\mathbf {I} - 2 \eta \mathbf {H} ^ {\infty} \mathbf {P}\right) ^ {k - 1} \tag {34} \\ + 2 \eta \sum_ {t = 1} ^ {k - 1} ((\mathbf {I} - 2 \eta \mathbf {H} (k - 1) \mathbf {P}) \dots (\mathbf {I} - 2 \eta \mathbf {H} (t) \mathbf {P})) (\mathbf {H} ^ {\infty} \mathbf {P} - \mathbf {H} (t - 1) \mathbf {P}) (\mathbf {I} - 2 \eta \mathbf {H} ^ {\infty} \mathbf {P}) ^ {t - 1}. \\ \end{array} +$$ + +Combining eq. (33) and eq. (34), we obtain eq. (29) where + +$$ +\begin{array}{l} \boldsymbol {\epsilon} (k) = 2 \eta (\mathbf {H} ^ {\infty} \mathbf {P} - \mathbf {H} (k - 1) \mathbf {P}) (\mathbf {I} - 2 \eta \mathbf {H} ^ {\infty} \mathbf {P}) ^ {k - 1} (\mathbf {y} - \mathbf {u} (0)) \\ + 2 \eta \sum_ {t = 1} ^ {k - 1} (\mathbf {I} - 2 \eta \mathbf {H} (k - 1) \mathbf {P}) \dots (\mathbf {I} - 2 \eta \mathbf {H} (t) \mathbf {P}) (\mathbf {H} ^ {\infty} - \mathbf {H} (t - 1)) \mathbf {P} (\mathbf {I} - 2 \eta \mathbf {H} ^ {\infty} \mathbf {P}) ^ {t - 1} (\mathbf {y} - \mathbf {u} (0)) \\ + \mathbf {r} (k) + \sum_ {t = 1} ^ {k - 1} (\mathbf {I} - 2 \eta \mathbf {H} (k - 1) \mathbf {P}) \dots (\mathbf {I} - 2 \eta \mathbf {H} (t) \mathbf {P}) \mathbf {r} (t). \\ \end{array} +$$ + +Finally, we note that + +$$ +\begin{array}{l} \lambda_ {\max } (\mathbf {H} (t) \mathbf {P}) = \lambda_ {\max } (\mathbf {P} ^ {1 / 2} \mathbf {H} (t) \mathbf {P} ^ {1 / 2}) = \left\| \mathbf {P} ^ {1 / 2} \mathbf {H} (t) \mathbf {P} ^ {1 / 2} \right\| _ {2} = \sup _ {\boldsymbol {\xi} \in \mathbb {R} ^ {n} \backslash \{\mathbf {0} \}} \frac {\left\| \mathbf {P} ^ {1 / 2} \mathbf {H} (t) \mathbf {P} ^ {1 / 2} \boldsymbol {\xi} \right\| _ {2}}{\left\| \boldsymbol {\xi} \right\| _ {2}} \\ = \sup _ {\boldsymbol {\zeta} \in \mathbb {R} ^ {n} \backslash \{\mathbf {0} \}} \frac {\left\| \mathbf {P} ^ {1 / 2} \mathbf {H} (t) \mathbf {P} \boldsymbol {\zeta} \right\| _ {2}}{\left\| \mathbf {P} ^ {1 / 2} \boldsymbol {\zeta} \right\| _ {2}} = \sup _ {\boldsymbol {\zeta} \in \mathbb {R} ^ {n} \backslash \{\mathbf {0} \}} \frac {\left\| \mathbf {H} (t) \mathbf {P} \boldsymbol {\zeta} \right\| _ {\mathbf {P}}}{\left\| \boldsymbol {\zeta} \right\| _ {\mathbf {P}}} = \| \mathbf {H} (t) \mathbf {P} \| _ {\mathbf {P}}, \tag {35} \\ \end{array} +$$ + +and that + +$$ +\left\| \mathbf {H} (t) \mathbf {P} \right\| _ {\mathbf {P}} = \sup _ {\boldsymbol {\xi} \in \mathbb {R} ^ {n} \backslash \{\mathbf {0} \}} \frac {\left\| \mathbf {H} (t) \mathbf {P} \boldsymbol {\xi} \right\| _ {\mathbf {P}}}{\left\| \boldsymbol {\xi} \right\| _ {\mathbf {P}}} = \sup _ {\boldsymbol {\xi} \in \mathbb {R} ^ {n} \backslash \{\mathbf {0} \}} \frac {\left\| \mathbf {H} (t) \mathbf {P} \boldsymbol {\xi} \right\| _ {\mathbf {P}}}{\left\| \mathbf {H} (t) \mathbf {P} \boldsymbol {\xi} \right\| _ {2}} \frac {\left\| \mathbf {H} (t) \mathbf {P} \boldsymbol {\xi} \right\| _ {2}}{\left\| \mathbf {P} \boldsymbol {\xi} \right\| _ {2}} \frac {\left\| \mathbf {P} \boldsymbol {\xi} \right\| _ {2}}{\left\| \boldsymbol {\xi} \right\| _ {\mathbf {P}}}. \tag {36} +$$ + +We can then bound $\| \mathbf{H}(t)\mathbf{P}\|_{\mathbf{P}}$ using $M_{\mathbf{P}}$ defined in eq. (8) and $\| \mathbf{H}(t)\| _2$ as + +$$ +\| \mathbf {H} (t) \mathbf {P} \| _ {\mathbf {P}} \leq M _ {\mathbf {P}} \| \mathbf {H} (t) \| _ {2} M _ {\mathbf {P}} \leq M _ {\mathbf {P}} ^ {2} \sqrt {\| \mathbf {H} (t) \| _ {1} \| \mathbf {H} (t) \| _ {\infty}} \leq M _ {\mathbf {P}} ^ {2} n. +$$ + +By requiring that $\eta < 1 / (2M_{\mathbf{P}}^2 n)$ , we have $\lambda_{\mathrm{min}}(\mathbf{I} - 2\eta \mathbf{H}(t)\mathbf{P}) > 0$ for all $t$ . Hence, $\mathbf{I} - 2\eta \mathbf{H}(t)\mathbf{P}$ is positive definite in $(\mathbb{R}^n,\langle \cdot ,\cdot \rangle_{\mathbf{P}})$ , and according to eq. (35), we have $\| \mathbf{I} - 2\eta \mathbf{H}(t)\mathbf{P}\|_{\mathbf{P}} = \lambda_{\mathrm{max}}(\mathbf{I} - 2\eta \mathbf{H}(t)\mathbf{P}) < 1$ . The upper bound in eq. (30) follows from the triangle inequality and our estimate on $\mathbf{r}_k$ in eq. (32). + +The residual terms in Lemma 2 can be made small by controlling $\| \mathbf{M}(t)\mathbf{P}\|_{\mathbf{P}} + \| \mathbf{L}(t)\mathbf{P}\|_{\mathbf{P}}$ and $\| (\mathbf{H}(0) - \mathbf{H}(t))\mathbf{P}\|_{\mathbf{P}}$ . Their upper bounds are given in Lemma 3. First, we define + +$$ +S _ {i} (t) = \left\{1 \leq r \leq m \mid \mathbb {1} _ {\{\tilde {\mathbf {w}} _ {r} (t ^ {\prime}) ^ {\top} \tilde {\mathbf {x}} _ {i} \geq 0 \}} \neq \mathbb {1} _ {\{\tilde {\mathbf {w}} _ {r} (0) ^ {\top} \tilde {\mathbf {x}} _ {i} \geq 0 \}} \text {f o r s o m e} 0 \leq t ^ {\prime} \leq t \right\} +$$ + +to be the set of indices of the weights that have changed the sign at least once by the $k$ th iteration. + +Lemma 3. For all $t \geq 0$ , we have + +$$ +\max \left(\| \mathbf {M} (t) \mathbf {P} \| _ {\mathbf {P}} + \| \mathbf {L} (t) \mathbf {P} \| _ {\mathbf {P}}, \| (\mathbf {H} (0) - \mathbf {H} (t)) \mathbf {P} \| _ {\mathbf {P}}\right) \leq \sqrt {\frac {4 M _ {\mathbf {P}} ^ {4} n}{m ^ {2}} \sum_ {i = 1} ^ {n} | S _ {i} (t) | ^ {2}}. +$$ + +Moreover, for any $0 < \delta < 1$ , with probability at least $1 - \delta$ , we have + +$$ +\| (\mathbf {H} ^ {\infty} - \mathbf {H} (0)) \mathbf {P} \| _ {\mathbf {P}} \leq 2 M _ {\mathbf {P}} ^ {2} n \sqrt {\frac {\log (2 n / \delta)}{m}}. +$$ + +Proof. First, we have + +$$ +\begin{array}{l} \left\| \mathbf {M} (t) \mathbf {P} \right\| _ {\mathbf {P}} ^ {2} \leq M _ {\mathbf {P}} ^ {4} \left\| \mathbf {M} (t) \right\| _ {2} ^ {2} \leq M _ {\mathbf {P}} ^ {4} \left\| \mathbf {M} (t) \right\| _ {F} ^ {2} \\ \leq \frac {M _ {\mathbf {P}} ^ {4}}{m ^ {2}} \sum_ {i = 1} ^ {n} \sum_ {p = 1} ^ {n} \left(\sum_ {r \in \mathcal {A}} \left| \mathbb {1} _ {\{\tilde {\mathbf {w}} _ {r} (t) ^ {\top} \tilde {\mathbf {x}} _ {i} \geq 0, \tilde {\mathbf {w}} _ {r} (t) ^ {\top} \tilde {\mathbf {x}} _ {p} \geq 0 \}} - \mathbb {1} _ {\{\tilde {\mathbf {w}} _ {r} (t + 1) ^ {\top} \tilde {\mathbf {x}} _ {i} \geq 0, \tilde {\mathbf {w}} _ {r} (t) ^ {\top} \tilde {\mathbf {x}} _ {p} \geq 0 \}} \right|\right) ^ {2} \\ \leq \frac {M _ {\mathbf {P}} ^ {4} n}{m ^ {2}} \sum_ {i = 1} ^ {n} | S _ {i} (t) | ^ {2}. \\ \end{array} +$$ + +The estimate for $\| \mathbf{L}(t)\mathbf{P}\|_{\mathbf{P}}^2$ is exactly the same and obtained by replacing $\mathcal{A}$ with $\mathcal{B}$ . We also have + +$$ +\begin{array}{l} \| (\mathbf {H} (0) - \mathbf {H} (t)) \mathbf {P} \| _ {\mathbf {P}} ^ {2} \leq M _ {\mathbf {P}} ^ {4} \| \mathbf {H} (0) - \mathbf {H} (t) \| _ {2} ^ {2} \leq M _ {\mathbf {P}} ^ {4} \| \mathbf {H} (0) - \mathbf {H} (t) \| _ {F} ^ {2} \\ \leq \frac {M _ {\mathbf {P}} ^ {4}}{m ^ {2}} \sum_ {i = 1} ^ {n} \sum_ {p = 1} ^ {n} \left(\sum_ {r = 1} ^ {m} | \mathbb {1} _ {\{\bar {\mathbf {w}} _ {r} (0) ^ {\top} \bar {\mathbf {x}} _ {i} \geq 0, \bar {\mathbf {w}} _ {r} (0) ^ {\top} \bar {\mathbf {x}} _ {p} \geq 0 \}} - \mathbb {1} _ {\{\bar {\mathbf {w}} _ {r} (t) ^ {\top} \bar {\mathbf {x}} _ {i} \geq 0, \bar {\mathbf {w}} _ {r} (t) ^ {\top} \bar {\mathbf {x}} _ {p} \geq 0 \}} |\right) ^ {2} \\ \leq \frac {M _ {\mathbf {P}} ^ {4}}{m ^ {2}} \sum_ {i = 1} ^ {n} \sum_ {p = 1} ^ {n} \left(| S _ {i} (t) | + | S _ {p} (t) |\right) ^ {2} \leq \frac {M _ {\mathbf {P}} ^ {4}}{m ^ {2}} \sum_ {i = 1} ^ {n} \sum_ {p = 1} ^ {n} \left(2 | S _ {i} (t) | ^ {2} + 2 | S _ {p} (t) | ^ {2}\right) \\ = \frac {4 M _ {\mathbf {P}} ^ {4} n}{m ^ {2}} \sum_ {i = 1} ^ {n} | S _ {i} (t) | ^ {2}. \\ \end{array} +$$ + +This proves the first inequality. Since $H_{ij}(0)$ is the average of $m$ iid random variables bounded in $[0,1]$ , by Hoeffding's inequality (Hoeffding, 1963), for any $t > 0$ and any $1 \leq i,j \leq n$ , we have + +$$ +\mathbb {P} \left(m \left| H _ {i j} (0) - H _ {i j} ^ {\infty} \right| \geq t\right) \leq 2 \exp \left(- \frac {2 t ^ {2}}{m}\right) \leq 2 \exp \left(- \frac {t ^ {2}}{m}\right). \tag {37} +$$ + +Set $t = \sqrt{m\log(2n^2 / \delta)}$ . With probability at least $1 - \delta /n^2$ , we have + +$$ +\left| H _ {i j} (0) - H _ {i j} ^ {\infty} \right| \leq \sqrt {\frac {\log \left(2 n ^ {2} / \delta\right)}{m}} \leq 2 \sqrt {\frac {\log \left(2 n / \delta\right)}{m}}. \tag {38} +$$ + +Hence, by a union bound, we know that with probability at least $1 - \delta$ , we have + +$$ +\| \mathbf {H} ^ {\infty} - \mathbf {H} (0) \| _ {2} \leq \| \mathbf {H} ^ {\infty} - \mathbf {H} (0) \| _ {F} \leq 2 n \sqrt {\frac {\log (2 n / \delta)}{m}}. +$$ + +The last estimate follows from the definitions of $M_{\mathbf{P}}$ (see eq. (8) and eq. (36)). + +![](images/9aaeb8bd73b413ffdab684baf74ec0002940139a57509d79e0bf880a2781f7f3.jpg) + +Now, we state and prove our initial control of the decay of the residual. + +Lemma 4. Let $\epsilon >0,\kappa >0,0 < \delta < 1$ and $T > 0$ be given. There exist constants $C_m,C_m^\prime >0$ such that if $0\leq \eta \leq 1 / (2M_{\mathbf{P}}^{2}n)$ and $m$ satisfies + +$$ +m \geq C _ {m} \frac {M _ {\mathbf {P}} ^ {6} n ^ {3}}{\kappa^ {2} \epsilon^ {2}} \left(\lambda_ {0} ^ {- 4} \left(1 + \frac {\kappa^ {2} M _ {\mathbf {P}} ^ {2} n}{\delta}\right) ^ {2} + \eta^ {4} T ^ {4} \epsilon^ {4}\right) +$$ + +and + +$$ +m \geq C _ {m} ^ {\prime} \frac {M _ {\mathbf {P}} ^ {4} n ^ {2} \log (n / \delta)}{\epsilon^ {2}} \left(\lambda_ {0} ^ {- 2} \left(1 + \frac {\kappa^ {2} M _ {\mathbf {P}} ^ {2} n}{\delta}\right) + \eta^ {2} T ^ {2} \epsilon^ {2}\right), +$$ + +then with probability at least $1 - \delta$ , we have the following for all $0 \leq k \leq T$ : + +$$ +\mathbf {y} - \mathbf {u} (k) = \left(\mathbf {I} - 2 \eta \mathbf {H} ^ {\infty} \mathbf {P}\right) ^ {k} (\mathbf {y} - \mathbf {u} (0)) + \epsilon (k), \quad \| \epsilon (k) \| _ {\mathbf {P}} \leq \epsilon . \tag {39} +$$ + +Proof. Set $\delta' = \delta / 3$ . For any $R > 0$ and $r = 1, \ldots, m$ , since $\mathbf{w}_r(0)^\top \mathbf{x}_i \sim \mathcal{N}(0, \kappa^2)$ , we have + +$$ +\mathbb {P} \left(\left| \tilde {\mathbf {w}} _ {r} (0) ^ {\top} \tilde {\mathbf {x}} _ {i} \right| \leq R\right) = \mathbb {E} \left[ \mathbb {1} _ {\{| \tilde {\mathbf {w}} _ {r} (0) ^ {\top} \tilde {\mathbf {x}} _ {i} | \leq R \}} \right] < \frac {2 R}{\sqrt {\pi} \kappa}. +$$ + +By Hoeffding's inequality (Hoeffding, 1963), for any $t > 0$ we have + +$$ +\mathbb {P} \left(\sum_ {r = 1} ^ {m} \mathbb {1} _ {\{| \bar {\mathbf {w}} _ {r} (0) ^ {\top} \bar {\mathbf {x}} _ {i} | \leq R \}} \geq \frac {2 m R}{\sqrt {\pi} \kappa} + t\right) \leq \exp \left(- \frac {2 t ^ {2}}{m}\right) \leq \exp \left(- \frac {t ^ {2}}{m}\right), \quad 1 \leq i \leq n. \tag {40} +$$ + +Thus, if we set $t = \sqrt{m\log(n / \delta')}$ then we find that with probability at least $1 - \delta' / n$ we have + +$$ +\sum_ {r = 1} ^ {m} \mathbb {1} _ {\{| \tilde {\mathbf {w}} _ {r} (0) ^ {\top} \tilde {\mathbf {x}} _ {i} | \leq R \}} \leq \frac {2 m R}{\sqrt {\pi} \kappa} + \sqrt {m \log (n / \delta^ {\prime})} \leq 2 m \left(\frac {R}{\sqrt {\pi} \kappa} + \sqrt {\frac {\log (n / \delta^ {\prime})}{m}}\right). +$$ + +By a union bound, we have with probability at least $1 - \delta^{\prime}$ + +$$ +\sum_ {i = 1} ^ {n} \left(\sum_ {r = 1} ^ {m} \mathbb {1} _ {\{| \tilde {\mathbf {w}} _ {r} (0) ^ {\top} \tilde {\mathbf {x}} _ {i} | \leq R \}}\right) ^ {2} \leq 4 m ^ {2} n \left(\frac {R}{\sqrt {\pi} \kappa} + \sqrt {\frac {\log (n / \delta^ {\prime})}{m}}\right) ^ {2}. +$$ + +By combining this with Lemma 3, we have that with probability at least $1 - 2\delta'$ , + +$$ +\sqrt {\frac {4 M _ {\mathbf {P}} ^ {4} n}{m ^ {2}} \sum_ {i = 1} ^ {n} \left(\sum_ {r = 1} ^ {m} \mathbb {1} _ {\{| \tilde {\mathbf {w}} _ {r} (0) ^ {\top} \tilde {\mathbf {x}} _ {i} | \leq R \}}\right) ^ {2}} \leq 4 M _ {\mathbf {P}} ^ {2} n \left(\frac {R}{\sqrt {\pi} \kappa} + \sqrt {\frac {\log \left(n / \delta^ {\prime}\right)}{m}}\right), \tag {41} +$$ + +and + +$$ +\left\| \left(\mathbf {H} ^ {\infty} - \mathbf {H} (0)\right) \mathbf {P} \right\| _ {\mathbf {P}} \leq 2 M _ {\mathbf {P}} ^ {2} n \sqrt {\frac {\log \left(2 n / \delta^ {\prime}\right)}{m}}. \tag {42} +$$ + +Since the $i$ th entry of $\mathbf{u}(0)$ has mean 0 and variance $\leq \kappa^2$ , we have $\mathbb{E}[(\mathbf{u}(0))_i^2] \leq \kappa^2$ , where $(\mathbf{u}(0))_i$ is the $i$ th entry of $\mathbf{u}(0)$ . Hence, we have $\mathbb{E}\big[\| \mathbf{u}(0)\|_{\mathbf{P}}^2\big] \leq M_{\mathbf{P}}^2 n\kappa^2$ . By Markov's inequality, with probability at least $1 - \delta'$ , we have + +$$ +\left\| \mathbf {u} (0) \right\| _ {\mathbf {P}} \leq \kappa M _ {\mathbf {P}} \sqrt {n / \delta^ {\prime}}, \quad \left\| \mathbf {y} - \mathbf {u} (0) \right\| _ {\mathbf {P}} \leq \left\| \mathbf {y} \right\| _ {\mathbf {P}} + \kappa M _ {\mathbf {P}} \sqrt {n / \delta^ {\prime}}. \tag {43} +$$ + +By a union bound, we know that eqs. (41) to (43) hold with probability of at least $1 - 3\delta'$ . The theorem now follows using induction, where the base case when $k = 0$ is obvious. Assume eq. (39) holds for $t = 0,\dots ,k - 1$ , where $1\leq k\leq T$ . Then, we have + +$$ +2 \eta \sum_ {t = 0} ^ {k - 1} \| \mathbf {y} - \mathbf {u} (t) \| _ {\mathbf {P}} \leq 2 \eta \sum_ {t = 0} ^ {k - 1} \left[ \left(1 - 2 \eta \lambda_ {0}\right) ^ {t} \| \mathbf {y} - \mathbf {u} (0) \| _ {\mathbf {P}} + \epsilon \right] \leq \lambda_ {0} ^ {- 1} \| \mathbf {y} - \mathbf {u} (0) \| _ {\mathbf {P}} + 2 \eta T \epsilon , \tag {44} +$$ + +where the first inequality follows from the fact that $\mathbf{I} - 2\eta \mathbf{H}^{\infty}\mathbf{P}$ is positive semidefinite in $(\mathbb{R}^n,\langle \cdot ,\cdot \rangle_{\mathbf{P}})$ with the maximum eigenvalue being $1 - 2\eta \lambda_0$ and the second inequality follows by bounding the power series. By the definition of $\lambda_0$ , we have + +$$ +2 \eta \sum_ {t = 0} ^ {k - 1} \left\| \left(\mathbf {I} - 2 \eta \mathbf {H} ^ {\infty} \mathbf {P}\right) ^ {t} (\mathbf {y} - \mathbf {u} (0)) \right\| _ {\mathbf {P}} \leq 2 \eta \sum_ {t = 0} ^ {k - 1} \left(1 - 2 \eta \lambda_ {0}\right) ^ {t} \| \mathbf {y} - \mathbf {u} (0) \| _ {\mathbf {P}} \leq \lambda_ {0} ^ {- 1} \| \mathbf {y} - \mathbf {u} (0) \| _ {\mathbf {P}}. \tag {45} +$$ + +By Lemma 2 and 3, we have + +$$ +\mathbf {y} - \mathbf {u} (k) = \left(\mathbf {I} - 2 \eta \mathbf {H} ^ {\infty} \mathbf {P}\right) ^ {k} (\mathbf {y} - \mathbf {u} (0)) + \epsilon (k) +$$ + +with + +$$ +\begin{array}{l} \| \pmb {\epsilon} (k) \| _ {\mathbf {P}} \leq \lambda_ {0} ^ {- 1} \| (\mathbf {H} (0) - \mathbf {H} ^ {\infty}) \mathbf {P} \| _ {\mathbf {P}} \| \mathbf {y} - \mathbf {u} (0) \| _ {\mathbf {P}} \\ + 2 \sqrt {\frac {4 M _ {\mathbf {P}} ^ {4} n}{m ^ {2}} \sum_ {i = 1} ^ {n} \left| S _ {i} (k) \right| ^ {2}} \left(\lambda_ {0} ^ {- 1} \| \mathbf {y} - \mathbf {u} (0) \| _ {\mathbf {P}} + \eta T \epsilon\right), \tag {46} \\ \end{array} +$$ + +where we used the fact that $|S_i(t)|$ is a nondecreasing function of $t$ and the triangle inequality $\| (\mathbf{H}^{\infty} - \mathbf{H}(t))\mathbf{P}\|_{\mathbf{P}} \leq \| (\mathbf{H}(0) - \mathbf{H}^{\infty})\mathbf{P}\|_{\mathbf{P}} + \| (\mathbf{H}(t) - \mathbf{H}(0))\mathbf{P}\|_{\mathbf{P}}$ . Here, we also combined $\lambda_0^{-1}\| (\mathbf{H}(t) - \mathbf{H}(0))\mathbf{P}\|_{\mathbf{P}}\| \mathbf{y} - \mathbf{u}(0)\|_{\mathbf{P}}$ with the last term on the right-hand side of eq. (30) and applied Lemma 3, eq. (44), and eq. (45) to obtain the last term on the right-hand side of eq. (46). To control $|S_i(k)|$ , we first bound the change of the weights. For any $0 \leq t \leq k - 1$ and $1 \leq r \leq m$ , the change of weights in one iteration can be bounded by + +$$ +\begin{array}{l} \left\| \tilde {\mathbf {w}} _ {r} (t + 1) - \tilde {\mathbf {w}} _ {r} (t) \right\| _ {2} = \eta \left\| \frac {\partial \mathbf {u} (t)}{\partial \tilde {\mathbf {w}} _ {r}} \frac {\partial \Phi_ {\mathbf {P}} (\mathbf {u})}{\partial \mathbf {u}} \right\| _ {2} \\ \leq \eta \left\| \frac {\partial \mathbf {u} (t)}{\partial \tilde {\mathbf {w}} _ {r}} \right\| _ {F} \| \mathbf {P} (\mathbf {y} - \mathbf {u} (t)) \| _ {2} \leq \eta \sqrt {\frac {2 n}{m}} M _ {\mathbf {P}} \| \mathbf {y} - \mathbf {u} (t) \| _ {\mathbf {P}}, \\ \end{array} +$$ + +where the inequalities follow from eq. (27) and eq. (28). Hence, the total change of the weights can be bounded by + +$$ +\left\| \tilde {\mathbf {w}} _ {r} (t) - \tilde {\mathbf {w}} _ {r} (0) \right\| _ {2} \leq \eta M _ {\mathbf {P}} \sqrt {\frac {2 n}{m}} \sum_ {t ^ {\prime} = 0} ^ {t - 1} \| \mathbf {y} - \mathbf {u} \left(t ^ {\prime}\right) \| _ {\mathbf {P}} \leq R _ {T}, \tag {47} +$$ + +where $R_{T} = M_{\mathbf{P}}\sqrt{\frac{n}{2m}}\left(\lambda_{0}^{-1}\| \mathbf{y} - \mathbf{u}(0)\|_{\mathbf{P}} + 2\eta T\epsilon\right)$ . Recall that $S_{i}(k)$ is the set of indices of weights that have gone through at least one sign flip by iteration $k$ . Thus, if $r\in S_i(k)$ , we have $\| \tilde{\mathbf{w}}_r(t) - \tilde{\mathbf{w}}_r(0)\|_2\geq |\tilde{\mathbf{w}}_r(0)^\top \tilde{\mathbf{x}}_i|$ for some $0\leq t\leq k$ as the sign flip leads to $|\tilde{\mathbf{w}}_r(0)^\top \tilde{\mathbf{x}}_i|\leq |\tilde{\mathbf{w}}_r(0)^\top \tilde{\mathbf{x}}_i - \tilde{\mathbf{w}}_r(t)^\top \tilde{\mathbf{x}}_i|$ . This gives us + +$$ +\begin{array}{l} \left| S _ {i} (k) \right| \leq \left| \left\{r \in [ m ]: \left| \tilde {\mathbf {w}} _ {r} (0) ^ {\top} \tilde {\mathbf {x}} _ {i} \right| \leq \| \tilde {\mathbf {w}} _ {r} (t) - \tilde {\mathbf {w}} _ {r} (0) \| _ {2} \text {f o r s o m e} 0 \leq t \leq k \right\} \right| \tag {48} \\ \leq \left| \left\{r \in [ m ]: \left| \tilde {\mathbf {w}} _ {r} (0) ^ {\top} \tilde {\mathbf {x}} _ {i} \right| \leq R _ {T} \right\} \right|, \\ \end{array} +$$ + +where $[m] = \{1, \dots, m\}$ . Hence, there exists a constant $C > 0$ such that + +$$ +\begin{array}{l} \| \boldsymbol {\epsilon} (k) \| _ {\mathbf {P}} \leq 2 M _ {\mathbf {P}} ^ {2} n \sqrt {\frac {\log \left(2 n / \delta^ {\prime}\right)}{m}} \lambda_ {0} ^ {- 1} \| \mathbf {y} - \mathbf {u} (0) \| _ {\mathbf {P}} \\ + 8 M _ {\mathbf {P}} ^ {2} n \left(\frac {R _ {T}}{\sqrt {\pi} \kappa} + \sqrt {\frac {\log (n / \delta^ {\prime})}{m}}\right) \left(\lambda_ {0} ^ {- 1} \| \mathbf {y} - \mathbf {u} (0) \| _ {\mathbf {P}} + \eta T \epsilon\right) \\ \leq 2 M _ {\mathbf {P}} ^ {2} n \underbrace {\sqrt {\frac {\log (6 n / \delta)}{m}} \lambda_ {0} ^ {- 1} C \left(1 + \kappa M _ {\mathbf {P}} \sqrt {\frac {3 n}{\delta}}\right)} _ {A _ {1}} \\ + 8 M _ {\mathbf {P}} ^ {2} n \left(\underbrace {\frac {1}{\sqrt {\pi} \kappa} M _ {\mathbf {P}} \sqrt {\frac {n}{2 m}} \left(\lambda_ {0} ^ {- 1} C \left(1 + \kappa M _ {\mathbf {P}} \sqrt {\frac {3 n}{\delta}}\right) + 2 \eta T \epsilon\right)} _ {A _ {2}} + \underbrace {\sqrt {\frac {\log (3 n / \delta)}{m}}} _ {A _ {3}}\right) \\ \times \underbrace {\left(\lambda_ {0} ^ {- 1} C \left(1 + \kappa M _ {\mathbf {P}} \sqrt {\frac {3 n}{\delta}}\right) + \eta T \epsilon\right)} _ {A _ {4}}, \tag {49} \\ \end{array} +$$ + +where the first inequality follows from eq. (41), eq. (46), and eq. (48), and the second inequality follows from eq. (43) and eq. (47). Finally, eq. (39) follows from the way we define $m$ . By taking $C_m$ large enough, we guarantee that $2M_{\mathbf{P}}^2 nA_1, 8M_{\mathbf{P}}^2 nA_2A_4 < \epsilon / 3$ . By taking $C_m'$ large enough, we guarantee that $8M_{\mathbf{P}}^2 nA_3A_4 < \epsilon / 3$ . Hence, eq. (39) follows. + +Lemma 4 gives us an estimate of the residual $\mathbf{y} - \mathbf{u}(k)$ in terms of the initial residual $\mathbf{y} - \mathbf{u}(0)$ . However, in analyzing the frequency bias, we hope to express the residual in terms of $\mathbf{y}$ only. This can be done by controlling the size of $\mathbf{u}(0)$ . First, we note that the proof of eq. (43) does not rely on the assumptions on $m$ in Lemma 4. Hence, it holds for any $n, m \geq 1, \kappa > 0, 0 < \delta < 1$ , and positive definite matrix $\mathbf{P}$ . Now we are ready to prove our first main result Theorem 1. + +Proof of Theorem 1. By eq. (43), with probability at least $1 - \delta /2$ , we have + +$$ +\left\| \left(\mathbf {I} - \eta \mathbf {H} ^ {\infty} \mathbf {P}\right) ^ {k} \mathbf {u} (0) \right\| _ {\mathbf {P}} \leq \| \mathbf {u} (0) \| _ {\mathbf {P}} \leq \kappa M _ {\mathbf {P}} \sqrt {2 n / \delta}. \tag {50} +$$ + +By taking $\kappa \leq \epsilon \sqrt{\delta / 2n} /(2M_{\mathbf{P}})$ , we guarantee that + +$$ +\left\| \left(\mathbf {I} - \eta \mathbf {H} ^ {\infty} \mathbf {P}\right) ^ {k} \mathbf {u} (0) \right\| _ {\mathbf {P}} \leq \epsilon / 2. +$$ + +By the way we pick $\kappa$ and $m$ , for some constant $C' > 0$ that only depends on $d$ , we have + +$$ +1 + \frac {\kappa^ {2} M _ {\mathbf {P}} ^ {2} n}{\delta} \leq C ^ {\prime}. +$$ + +Hence, by taking $C_2$ in eq. (13) large enough, we guarantee that $m$ satisfies the assumptions in Lemma 4 with $\epsilon, \kappa, T$ , and $\delta$ to be $\epsilon / 2$ , $\kappa, T$ , and $\delta / 2$ , respectively. Then, we have eq. (39) is true with probability of at least $1 - \delta / 2$ , for which $\| \epsilon(k) \|_{\mathbf{P}} \leq \epsilon / 2$ . The result follows from the triangle inequality and union bound. + +Notably, there are other initialization schemes that allow us to avoid using $\kappa$ . One of the examples is to initialize the weights at odd indices $\mathbf{w}_{2p+1}$ and $a_{2p+1}$ randomly and set $\mathbf{w}_{2p+2} = \mathbf{w}_{2p+1}$ , $a_{2p+2} = -a_{2r+1}$ , assuming $m$ is even (Su & Yang, 2019). This initialization scheme guarantees that $\mathbf{u}(0) = \mathbf{0}$ and hence we do not need to introduce $\kappa$ to control the initialization size $\|\mathbf{u}(0)\|_{\mathbf{P}}$ . In addition, if we assume that each entry of $\mathbf{w}_r$ is initialized from an iid sub-Gaussian distribution with zero mean and whose support is the entire $\mathbb{R}$ , then since $\mathbf{H}^{\infty}$ is still SPD (see the remark at the end of Appendix B) and the Hoeffding's inequality holds, the proof does not break down and a result similar to Theorem 1 can be shown. + +Following the same steps of proof, we can study the case when the gradient descent steps are slightly perturbed. That is, Suppose we perturb the output of the NN by $\delta \mathbf{u}_j$ at the $j$ th iteration. Then, we expect that the residual of the NN at the $k$ th iteration is approximately + +$$ +\begin{array}{l} \mathbf {y} - \mathbf {u} (k) \approx (\mathbf {I} - 2 \eta \mathbf {H} ^ {\infty} \mathbf {P}) \dots ((\mathbf {I} - 2 \eta \mathbf {H} ^ {\infty} \mathbf {P}) ((\mathbf {I} - 2 \eta \mathbf {H} ^ {\infty} \mathbf {P}) \mathbf {y} + \delta \mathbf {u} _ {1}) + \delta \mathbf {u} _ {2}) + \dots + \delta \mathbf {u} _ {k} \\ = \left(\mathbf {I} - 2 \eta \mathbf {H} ^ {\infty} \mathbf {P}\right) ^ {k} \mathbf {y} + \sum_ {j = 1} ^ {k} \left(\mathbf {I} - 2 \eta \mathbf {H} ^ {\infty} \mathbf {P}\right) ^ {k - j} \delta \mathbf {u} _ {j}. \\ \end{array} +$$ + +Since the maximum eigenvalue of $\mathbf{I} - 2\eta \mathbf{H}^{\infty}\mathbf{P}$ is less than one, we can then control the errors in this approximation using arguments similar to previous lemmas. + +In Theorem 1, we showed how the parameters of the NN should depend on the desired maximum error $\epsilon$ . Sometimes, it is also very useful to understand the dependence of $\epsilon$ on the parameters $\eta, T, n, m$ , etc. Therefore, we present the following result to show this dependency. + +Theorem 1'. In eq. (5), suppose that $\mathbf{w}_1, \ldots, \mathbf{w}_m$ are initialized iid from Gaussian random variables with covariance matrix $\kappa^2\mathbf{I}$ , $b_1, \ldots, b_m$ are initialized to zero, and $a_1, \ldots, a_m$ are initialized iid as $+1$ with probability $1/2$ and $-1$ otherwise. Suppose the NN is trained with training data $(\mathbf{x}_i, y_i)$ for $1 \leq i \leq n$ , loss function $\Phi_{\mathbf{P}}$ in eq. (6) for a symmetric positive definite matrix $\mathbf{P}$ , and the training procedure is the gradient descent update rule eq. (7) with step size $\eta \leq 1/(2M_{\mathbf{P}}^2n)$ . Let $\mathcal{N}_k$ be the NN function after the kth iteration and $\mathbf{u}(k) = (\mathcal{N}_k(\mathbf{x}_1), \ldots, \mathcal{N}_k(\mathbf{x}_n))$ , where $\mathcal{N}_0$ is the initial NN function. Let a probability of failure $0 < \delta < 1$ be given. Then, there exists a constant $C > 0$ that depends only on the dimension $d$ such that with probability $\geq 1 - \delta$ , the following statement holds: for any $k \geq 1$ , if we define $\epsilon_k$ by + +$$ +\epsilon_ {k} = \max _ {1 \leq t \leq k - 1} \left\| \mathbf {y} - \mathbf {u} (t) - (\mathbf {I} - 2 \eta \mathbf {H} ^ {\infty} \mathbf {P}) ^ {t} \mathbf {y} \right\| _ {\mathbf {P}}, +$$ + +then we have + +$$ +\begin{array}{l} \left\| \mathbf {y} - \mathbf {u} (k) - (\mathbf {I} - 2 \eta \mathbf {H} ^ {\infty} \mathbf {P}) ^ {k} \mathbf {y} \right\| _ {\mathbf {P}} \leq 2 M _ {\mathbf {P}} ^ {2} n \sqrt {\frac {\log (6 n / \delta)}{m}} \lambda_ {0} ^ {- 1} C \left(1 + \kappa M _ {\mathbf {P}} \sqrt {\frac {3 n}{\delta}}\right) \\ + 8 M _ {\mathbf {P}} ^ {2} n \left(\frac {1}{\sqrt {\pi} \kappa} M _ {\mathbf {P}} \sqrt {\frac {n}{2 m}} \left(\lambda_ {0} ^ {- 1} C \left(1 + \kappa M _ {\mathbf {P}} \sqrt {\frac {3 n}{\delta}}\right) + 2 \eta k \epsilon_ {k}\right) + \sqrt {\frac {\log (3 n / \delta)}{m}}\right) \tag {51} \\ \times \left(\lambda_ {0} ^ {- 1} C \left(1 + \kappa M _ {\mathbf {P}} \sqrt {\frac {3 n}{\delta}}\right) + \eta k \epsilon_ {k}\right) + \kappa M _ {\mathbf {P}} \sqrt {\frac {2 n}{\delta}}. \\ \end{array} +$$ + +Proof. The result follows immediately from eq. (49) and eq. (50). + +While this paper is primarily concerned with learning a continuous function using loss functions that are adapted from MSE, we briefly discuss the changes that are needed to study classifiers trained by cross-entropy. If the classification task has $p$ classes, then our NN has $p$ outputs, each of which is then passed through a softmax layer and represents an estimate of the likelihood that the input belongs to the corresponding class. More information on the NN architecture and the cross-entropy loss function can be found in (Kurbiel, 2021). Let $\mathcal{N}_j(\mathbf{x};\mathbf{W})$ be the $j$ th entry of the outputs of the NN and let $u_{j}(\mathbf{x};\mathbf{W}) = \mathrm{softmax}(\mathcal{N}_{j}(\mathbf{x};\mathbf{W}))$ , $1\leq j\leq p$ . Let $g_{j}(\mathbf{x})$ be the ground-truth of the $j$ th entry of the outputs and let $z_{j}(\mathbf{x};\mathbf{W}) = g_{j}(\mathbf{x}) - u_{j}(\mathbf{x};\mathbf{W})$ be the residual. Assume we use the gradient flow and have access to data on the entire domain. Then, to derive a formula analogous + +to eq. (2), for each fixed $\mathbf{x}$ we have + +$$ +\begin{array}{l} \frac {d z _ {j} (\mathbf {x} ; \mathbf {W})}{d t} = - \frac {d u _ {j} (\mathbf {x} ; \mathbf {W})}{d t} = - \sum_ {i = 1} ^ {p} \frac {d u _ {j} (\mathbf {x} ; \mathbf {W})}{d \mathcal {N} _ {i}} \frac {d \mathcal {N} _ {i} (\mathbf {x} ; \mathbf {W})}{d t} \\ = - \sum_ {i = 1} ^ {p} \frac {d u _ {j} (\mathbf {x} ; \mathbf {W})}{d \mathcal {N} _ {i}} \frac {\partial \mathcal {N} _ {i} (\mathbf {x} ; \mathbf {W})}{\partial \mathbf {W}} \frac {d \mathbf {W}}{d t} = \sum_ {i = 1} ^ {p} \frac {d u _ {j} (\mathbf {x} ; \mathbf {W})}{d \mathcal {N} _ {i}} \frac {\partial \mathcal {N} _ {i} (\mathbf {x} ; \mathbf {W})}{\partial \mathbf {W}} \left(\frac {\partial \mathcal {L} (\mathbf {W})}{\partial \mathbf {W}}\right) ^ {\top} \\ = \sum_ {i = 1} ^ {p} \left(\frac {d u _ {j} (\mathbf {x} ; \mathbf {W})}{d \mathcal {N} _ {i}} \frac {\partial \mathcal {N} _ {i} (\mathbf {x} ; \mathbf {W})}{\partial \mathbf {W}} \sum_ {i ^ {\prime} = 1} ^ {p} \int_ {\mathbb {S} ^ {d - 1}} \left(- z _ {i ^ {\prime}} (\mathbf {x} ^ {\prime}; \mathbf {W}) \frac {\partial \mathcal {N} _ {i ^ {\prime}} (\mathbf {x} ^ {\prime} ; \mathbf {W})}{\partial \mathbf {W}}\right) ^ {\top} d \mu (\mathbf {x} ^ {\prime})\right), \\ \end{array} +$$ + +where $\mathcal{L}$ is the cross-entropy loss function computed as an integral over $\mathbb{S}^{d - 1}$ and in the last step we used the fact that $(d / d\mathcal{N}_{i'})\mathcal{L}(\mathbf{x}';\mathbf{W}) = u_{i'}(\mathbf{x}';\mathbf{W}) - g_{i'}(\mathbf{x}') = -z_{i'}(\mathbf{x}';\mathbf{W})$ (Kurbiel, 2021). Hence, eq. (2) now becomes + +$$ +\frac {d z _ {j} (\mathbf {x} ; \mathbf {W})}{d t} = - \sum_ {i = 1} ^ {p} \left(\frac {d u _ {j} (\mathbf {x} ; \mathbf {W})}{d \mathcal {N} _ {i}} \sum_ {i ^ {\prime} = 1} ^ {p} \int_ {\mathbb {S} ^ {d - 1}} \underbrace {\left\langle \frac {\partial \mathcal {N} _ {i}}{\partial \mathbf {W}} (\mathbf {x} ; \mathbf {W}) , \frac {\partial \mathcal {N} _ {i ^ {\prime}}}{\partial \mathbf {W}} (\mathbf {x} ^ {\prime} ; \mathbf {W}) \right\rangle} _ {= K _ {i, i ^ {\prime}} (\mathbf {x}, \mathbf {x} ^ {\prime}; \mathbf {W})} z _ {i ^ {\prime}} (\mathbf {x} ^ {\prime}; \mathbf {W}) d \mu (\mathbf {x} ^ {\prime})\right), +$$ + +where we also know that $(d / d\mathcal{N}_i)u_j(\mathbf{x};\mathbf{W}) = u_i(\mathbf{x};\mathbf{W})(\mathbb{1}_{\{i = j\}} - u_j(\mathbf{x};\mathbf{W}))$ . Again, we define $\mathbf{H}_{i,i'}^\infty$ as the discretization of $K_{i,i'}$ in expectation over random initialization of $\mathbf{W}$ . Note that $\mathbf{H}_{i,i}^\infty$ coincides with $\mathbf{H}^\infty$ that we used extensively in this paper. However, the entries of $\mathbf{H}_{i,i'}^\infty$ might differ with $\mathbf{H}^\infty$ in signs. This potentially causes difficulties in analyzing the spectrum of $\mathbf{H}_{i,i'}^\infty$ . Now, by the formula above, we expect that the residual can approximately be written as + +$$ +\begin{array}{l} \mathbf {z} _ {j} (k + 1) - \mathbf {z} _ {j} (k) = \left[ g _ {j} (\mathbf {x}) - \mathbf {u} _ {j} (k + 1) \right] - \left[ g _ {j} (\mathbf {x}) - \mathbf {u} _ {j} (k) \right] \\ \approx - \eta \sum_ {i = 1} ^ {p} \left(\mathbf {u} _ {i} (k) \circ \left([ \mathbb {1} _ {\{i = j \}}, \dots , \mathbb {1} _ {\{i = j \}} ] ^ {\top} - \mathbf {u} _ {j} (k)\right) \circ \sum_ {i ^ {\prime} = 1} ^ {p} \left(\mathbf {H} _ {i, i ^ {\prime}} ^ {\infty} \mathbf {P} \mathbf {z} _ {i ^ {\prime}} (k)\right)\right), \tag {52} \\ \end{array} +$$ + +where $\circ$ is the Hadamard product, $\mathbf{u}_j(k) = [u_j(\mathbf{x}_1; \mathbf{W}(k)), \dots, u_j(\mathbf{x}_n; \mathbf{W}(k))]^\top$ , and $\mathbf{z}_j(k) = [z_j(\mathbf{x}_1; \mathbf{W}(k)), \dots, z_j(\mathbf{x}_n; \mathbf{W}(k))]^\top$ . Suppose we define the vectorized residual $\mathbf{z} = [\mathbf{z}_1^\top, \dots, \mathbf{z}_p^\top]^\top$ and define the $np \times np$ block matrix $\mathbf{J}(k)$ by $\mathbf{J}(k)_{(in+1): (i+1)n, (jn+1): (j+1)n} = \mathrm{diag}\left(\mathbf{u}_i(k) \circ ([\mathbb{1}_{\{i=j\}}, \dots, \mathbb{1}_{\{i=j\}}]^\top - \mathbf{u}_j(k))\right)$ for $i, j = 0, \dots, p-1$ . Let $\mathcal{H}^\infty$ be the $np \times np$ block matrix such that $\mathcal{H}_{(in+1): (i+1)n, (i'n+1): (i'+1)n}^\infty = \mathbf{H}_{i,i'}^\infty$ for $i, i' = 0, \dots, p-1$ . Then, eq. (52) can be written compactly as + +$$ +\mathbf {z} (k + 1) - \mathbf {z} (k) \approx - \eta \mathbf {J} (k) \mathcal {H} ^ {\infty} \left(\mathbf {I} _ {p} \otimes \mathbf {P}\right) \mathbf {z} (k), \tag {53} +$$ + +where $\otimes$ is the Kronecker product. Frequency bias can be analyzed by studying the dynamics of $\mathbf{z}(k)$ based on eq. (53). However, the fact that $\mathbf{J}$ depends on $k$ is expected to add complication to the analysis. + +# D THE THEORY OF FREQUENCY BIAS WITH AN $\mathbf{L}^2$ -BASED LOSS FUNCTION + +In this section, we prove the results stated in Section 4, where we are concerned with the frequency bias behavior of NN training when using the squared $L^2$ norm as the loss function. We theoretically show the frequency bias phenomena in this setting, up to a quadrature error. + +# D.1 A CONSEQUENCE OF THEOREM 1 + +Given a bandlimited function $g: \mathbb{S}^{d-1} \to \mathbb{R}$ with bandlimit $L$ , we can uniquely decompose $g$ into a spherical harmonic expansion as $g(\mathbf{x}) = \sum_{\ell=0}^{L} g_{\ell}(\mathbf{x})$ , where $g_{\ell}(\mathbf{x}) \in \mathcal{H}_{\ell}^{d}$ . Here, $\mathcal{H}_{\ell}^{d}$ is the space of the restriction of (real) homogeneous harmonic polynomials of degree $\ell$ on $\mathbb{S}^{d-1}$ . That is, + +$$ +g _ {\ell} (\mathbf {x}) = \sum_ {p = 1} ^ {N (d, \ell)} \hat {g} _ {\ell , p} Y _ {\ell , p}, \quad \hat {g} _ {\ell , p} = \int_ {\mathbb {S} ^ {d - 1}} g (\mathbf {x}) Y _ {\ell , p} (\mathbf {x}) d \mathbf {x}. +$$ + +where $N(d,\ell)$ is given in section 2 and $Y_{\ell,p}$ are the spherical harmonic function of degree $\ell$ and order $p$ . As a consequence of Theorem 1, we can consider the NN training error with the squared $L^2$ -based loss function. + +Proof of Theorem 2. By Theorem 1, for every $k = 0,\dots ,T$ , we can write + +$$ +\left\| \mathbf {u} (k) - \mathbf {y} \right\| _ {\mathbf {c}} = \left\| \left(\mathbf {I} - 2 \eta \mathbf {H} ^ {\infty} \mathbf {D} _ {\mathbf {c}}\right) ^ {k} \mathbf {y} \right\| _ {\mathbf {c}} + \varepsilon_ {3} (k), \quad \left| \varepsilon_ {3} (k) \right| \leq \| \boldsymbol {\epsilon} (k) \| _ {\mathbf {c}} \leq \epsilon . \tag {54} +$$ + +To estimate the first term, we first note that the matrix $\mathbf{I} - 2\eta \mathbf{H}^{\infty}\mathbf{D}_c$ is positive semidefinite in $(\mathbb{R}^n,\langle \cdot ,\cdot \rangle_c)$ and $\| \mathbf{I} - 2\eta \mathbf{H}^{\infty}\mathbf{D}_c\|_{\mathbf{c}}\leq 1 - 2\eta \lambda_0$ (see Theorem 1). Since $g(\mathbf{x}) = \sum_{\ell = 0}^{L}g_{\ell}(\mathbf{x})$ , we have + +$$ +\left(\mathbf {I} - 2 \eta \mathbf {H} ^ {\infty} \mathbf {D} _ {c}\right) ^ {k} \mathbf {y} = \sum_ {\ell = 0} ^ {L} \left(\mathbf {I} - 2 \eta \mathbf {H} ^ {\infty} \mathbf {D} _ {c}\right) ^ {k} \mathbf {y} ^ {\ell}, \qquad \mathbf {y} = \sum_ {\ell = 0} ^ {L} \mathbf {y} ^ {\ell}, +$$ + +where $\mathbf{y}^{\ell} = [g_{\ell}(\mathbf{x}_1),\ldots ,g_{\ell}(\mathbf{x}_n)]^\top \in \mathbb{R}^n$ . By the Funk-Hecke formula and the quadrature rule, we have + +$$ +\left(\mathbf {H} ^ {\infty} \mathbf {D} _ {\boldsymbol {c}} \mathbf {y} ^ {\ell}\right) _ {p} = \sum_ {i = 1} ^ {n} c _ {i} K ^ {\infty} (\mathbf {x} _ {p}, \mathbf {x} _ {i}) g _ {\ell} (\mathbf {x} _ {i}) = \int_ {\mathbb {S} ^ {d - 1}} K ^ {\infty} (\mathbf {x} _ {p}, \boldsymbol {\xi}) g _ {\ell} (\boldsymbol {\xi}) d \boldsymbol {\xi} + e _ {p, \ell} ^ {d} = \mu_ {\ell} g _ {\ell} (\mathbf {x} _ {p}) + e _ {p, \ell} ^ {d}, +$$ + +where $e_{p,\ell}^{d}$ is a quadrature error (see eq. (16)). Therefore, in vectorized form, we have $\mathbf{H}^{\infty}\mathbf{D}_{\boldsymbol{c}}\mathbf{y}^{\ell} = \mu_{\ell}\mathbf{y}^{\ell} + \mathbf{e}_{\ell}^{d}$ or, equivalently, $(\mathbf{I} - 2\eta \mathbf{H}^{\infty}\mathbf{D}_{\boldsymbol{c}})\mathbf{y}^{\ell} = (1 - 2\eta \mu_{\ell})\mathbf{y}^{\ell} - 2\eta \mathbf{e}_{\ell}^{d}$ , where $\mathbf{e}_{\ell}^{d} = (e_{1,\ell}^{d},\ldots ,e_{n,\ell}^{d})^{\top}$ . By applying $\mathbf{I} - 2\eta \mathbf{H}^{\infty}\mathbf{D}_{\boldsymbol{c}}$ to $\mathbf{y}^{\ell}$ for $k$ times, we find that + +$$ +(\mathbf {I} - 2 \eta \mathbf {H} ^ {\infty} \mathbf {D} _ {\mathbf {c}}) ^ {k} \mathbf {y} ^ {\ell} = (1 - 2 \eta \mu_ {\ell}) ^ {k} \mathbf {y} ^ {\ell} - \underbrace {2 \eta \sum_ {t = 0} ^ {k - 1} (1 - 2 \eta \mu_ {\ell}) ^ {t} (\mathbf {I} - 2 \eta \mathbf {H} ^ {\infty} \mathbf {D} _ {\mathbf {c}}) ^ {k - t - 1} \mathbf {e} _ {\ell} ^ {d}} _ {\boldsymbol {\varepsilon} _ {2} ^ {\ell}}. +$$ + +The second term, $\varepsilon_2^\ell$ , can be easily bounded from above to obtain + +$$ +\left\| \boldsymbol {\varepsilon} _ {2} ^ {\ell} \right\| _ {\mathbf {c}} \leq 2 \eta \left\| \mathbf {e} _ {\ell} ^ {d} \right\| _ {\mathbf {c}} \sum_ {t = 0} ^ {\infty} \left(1 - 2 \eta \mu_ {\ell}\right) ^ {t} = \frac {1}{\mu_ {\ell}} \left\| \mathbf {e} _ {\ell} ^ {d} \right\| _ {\mathbf {c}}. +$$ + +The inequality above shows that $(\mathbf{I} - 2\eta \mathbf{H}^{\infty}\mathbf{D}_c)^k\mathbf{y}^\ell$ is close to $(1 - 2\eta \mu_{\ell})^{k}\mathbf{y}^{\ell}$ . We define + +$$ +\varepsilon_ {2} = \left\| \sum_ {\ell = 0} ^ {L} (\mathbf {I} - 2 \eta \mathbf {H} ^ {\infty} \mathbf {D} _ {\boldsymbol {c}}) ^ {k} \mathbf {y} ^ {\ell} \right\| _ {\mathbf {c}} - \left\| \sum_ {\ell = 0} ^ {L} (1 - 2 \eta \mu_ {\ell}) ^ {k} \mathbf {y} ^ {\ell} \right\| _ {\mathbf {c}} +$$ + +to be the quantity in the statement of Theorem 2, which measures the accuracy of approximating the eigenvalues and eigenvectors of $\mathbf{H}^{\infty}\mathbf{D}_{\mathbf{c}}$ using the eigenvalues and eigenfunctions of the continuous kernel $K^{\infty}$ . Hence, we have + +$$ +\left\| \left(\mathbf {I} - 2 \eta \mathbf {H} ^ {\infty} \mathbf {D} _ {c}\right) ^ {k} \mathbf {y} \right\| _ {\mathbf {c}} = \left\| \sum_ {\ell = 0} ^ {L} \left(1 - 2 \eta \mu_ {\ell}\right) ^ {k} \mathbf {y} ^ {\ell} \right\| _ {\mathbf {c}} + \varepsilon_ {2}. \tag {55} +$$ + +Using the triangle inequality, we have + +$$ +| \varepsilon_ {2} | \leq \sum_ {\ell = 0} ^ {L} \left\| \boldsymbol {\varepsilon} _ {2} ^ {\ell} \right\| _ {\mathbf {c}} \leq \sum_ {\ell = 0} ^ {L} \frac {1}{\mu_ {\ell}} \left\| \mathbf {e} _ {\ell} ^ {d} \right\| _ {\mathbf {c}} = \sum_ {\ell = 0} ^ {L} \frac {1}{\mu_ {\ell}} \sqrt {\sum_ {i = 1} ^ {n} c _ {i} (e _ {i , \ell} ^ {d}) ^ {2}} \leq \sum_ {\ell = 0} ^ {L} \frac {\sqrt {A _ {d}}}{\mu_ {\ell}} \max _ {1 \leq i \leq n} \left| e _ {i, \ell} ^ {d} \right|. +$$ + +Recall that $\sum_{i=1}^{n} c_{i} = A_{d}$ , the surface area of $\mathbb{S}^{d-1}$ . Next, we can write + +$$ +\begin{array}{l} \left\| \sum_ {\ell = 0} ^ {L} \left(1 - 2 \eta \mu_ {\ell}\right) ^ {k} \mathbf {y} ^ {\ell} \right\| _ {\mathbf {c}} ^ {2} = \left(\sum_ {\ell = 0} ^ {L} \left(1 - 2 \eta \mu_ {\ell}\right) ^ {k} \mathbf {y} ^ {\ell}\right) ^ {\top} \mathbf {D} _ {\mathbf {c}} \left(\sum_ {\ell = 0} ^ {L} \left(1 - 2 \eta \mu_ {\ell}\right) ^ {k} \mathbf {y} ^ {\ell}\right) \\ = \sum_ {j = 0} ^ {L} \sum_ {\ell = 0} ^ {L} \left(1 - 2 \eta \mu_ {j}\right) ^ {k} \left(1 - 2 \eta \mu_ {\ell}\right) ^ {k} \mathbf {y} ^ {j} ^ {\top} \mathbf {D} _ {\mathbf {c}} \mathbf {y} ^ {\ell} \\ = \sum_ {j = 0} ^ {L} \sum_ {\ell = 0} ^ {L} \left(1 - 2 \eta \mu_ {j}\right) ^ {k} \left(1 - 2 \eta \mu_ {\ell}\right) ^ {k} \left(\int_ {\mathbb {S} ^ {d - 1}} g _ {j} (\boldsymbol {\xi}) g _ {\ell} (\boldsymbol {\xi}) d \boldsymbol {\xi} + e _ {j, \ell} ^ {c}\right) \\ = \sum_ {\ell = 0} ^ {L} \left(1 - 2 \eta \mu_ {\ell}\right) ^ {2 k} \| g _ {\ell} \| _ {L ^ {2}} ^ {2} + \underbrace {\sum_ {j = 0} ^ {L} \sum_ {\ell = 0} ^ {L} \left(1 - 2 \eta \mu_ {j}\right) ^ {k} \left(1 - 2 \eta \mu_ {\ell}\right) ^ {k} e _ {j , \ell} ^ {c}} _ {\varepsilon_ {1} (k)}, \tag {56} \\ \end{array} +$$ + +where we used the fact that $g_{j}$ and $g_{\ell}$ are orthogonal in $L^2 (\mathbb{S}^{d - 1})$ for $j \neq \ell$ . Combining eq. (55) and eq. (56), we can write + +$$ +\left\| \left(\mathbf {I} - 2 \eta \mathbf {H} ^ {\infty} \mathbf {D} _ {\mathbf {c}}\right) ^ {k} \mathbf {y} \right\| _ {\mathbf {c}} = \sqrt {\sum_ {j = 0} ^ {L} \left(1 - 2 \eta \mu_ {j}\right) ^ {2 k} \left\| g _ {j} \right\| _ {L ^ {2}} ^ {2} + \varepsilon_ {1} (k)} + \varepsilon_ {2}, \tag {57} +$$ + +where + +$$ +\left| \varepsilon_ {1} (k) \right| \leq \left| \sum_ {j = 0} ^ {L} \sum_ {\ell = 0} ^ {L} \left(1 - 2 \eta \mu_ {j}\right) ^ {k} \left(1 - 2 \eta \mu_ {\ell}\right) ^ {k} e _ {j, \ell} ^ {c} \right|. +$$ + +The result follows from eq. (54) and eq. (57). + +![](images/0713817ae8f581dde02cc59dd4ec6d4fc442f5e062d59f4664787e6f26370be5.jpg) + +Similarly, suppose we use Theorem $1'$ , we can write down Theorem 2 in a form such that $\epsilon_3(k)$ depends on the parameters of the NN. + +Theorem 2'. Under the same setup and assumptions of Theorem $l'$ , let $\mathbf{P} = \mathbf{D}_c$ and $M_{\mathbf{P}} = \sqrt{c_{\max}}$ . If $g: \mathbb{S}^{d-1} \to \mathbb{R}$ is a bandlimited function with bandlimit $L$ and $1 - 2\eta \mu_\ell > 0$ for all $0 \leq \ell \leq L$ (see eq. (12)), then with probability $\geq 1 - \delta$ we have + +$$ +\left\| \mathbf {y} - \mathbf {u} (k) \right\| _ {\mathcal {C}} = \sqrt {\sum_ {\ell = 0} ^ {L} \left(1 - 2 \eta \mu_ {\ell}\right) ^ {2 k} \left\| g _ {\ell} \right\| _ {L ^ {2}} ^ {2} + \varepsilon_ {1} (k)} + \varepsilon_ {2} + \varepsilon_ {3} (k), \quad 0 \leq k \leq T, \tag {58} +$$ + +where $|\varepsilon_3(k)|$ is bounded by eq. (51), and $\varepsilon_{1}(k)$ and $\varepsilon_{2}$ satisfy + +$$ +\left| \varepsilon_ {1} (k) \right| \leq \left| \sum_ {j = 0} ^ {L} \sum_ {\ell = 0} ^ {L} \left(1 - 2 \eta \mu_ {j}\right) ^ {k} \left(1 - 2 \eta \mu_ {\ell}\right) ^ {k} e _ {j, \ell} ^ {c} \right|, \quad \left| \varepsilon_ {2} \right| \leq \sum_ {\ell = 0} ^ {L} \frac {\sqrt {A _ {d}}}{\mu_ {\ell}} \max _ {1 \leq i \leq n} \left| e _ {i, \ell} ^ {d} \right|. +$$ + +We remark that the left-hand side of eq. (17) can be rewritten as + +$$ +\begin{array}{l} \| \mathbf {y} - \mathbf {u} (k) \| _ {\mathcal {C}} = \sqrt {\sum_ {i = 1} ^ {n} c _ {i} \left(y _ {i} - u _ {i} (k)\right) ^ {2}} = \sqrt {\sum_ {i = 1} ^ {n} c _ {i} \left(g (\mathbf {x} _ {i}) - \mathcal {N} _ {k} (\mathbf {x} _ {i})\right) ^ {2}} \\ = \sqrt {\left\| g - \mathcal {N} _ {k} \right\| _ {L ^ {2}} ^ {2} - E _ {\mathbf {c}} ((g - \mathcal {N} _ {k}) ^ {2})}, \\ \end{array} +$$ + +where $\mathcal{N}_k$ is the neural network at the $k$ th iteration. Hence, eq. (17) can also be written as + +$$ +\left\| g - \mathcal {N} _ {k} \right\| _ {L ^ {2}} = \sqrt {\sum_ {\ell = 0} ^ {L} \left(1 - 2 \eta \mu_ {\ell}\right) ^ {2 k} \left\| g _ {\ell} \right\| _ {L ^ {2}} ^ {2} + \varepsilon_ {1} (k)} + \varepsilon_ {2} + \varepsilon_ {3} (k) + \varepsilon_ {4} (k), \tag {59} +$$ + +where $\varepsilon_1, \varepsilon_2, \varepsilon_3$ are as in Theorem 2, and $|\varepsilon_4(k)| \leq \sqrt{|E_{\mathbf{c}}((g - \mathcal{N}_k)^2)|}$ . Moreover, we assumed $g$ is bandlimited, and as we see in Proposition 2, the spherical harmonic coefficients of $\mathcal{N}_k$ decay fast as the frequency $\ell \to \infty$ . This shows that the size of $|\varepsilon_4(k)|$ can also be controlled by $\gamma_{n,\ell}$ in eq. (18). Therefore, we derived a frequency bias statement of the generalization error with respect to the uniform distribution on $\mathbb{S}^{d-1}$ . + +# D.2 FREQUENCY BIAS UP TO AN APPROXIMATION ERROR + +Theorem 2 shows that we theoretically have frequency bias up to the level of quadrature errors $\varepsilon_1(k)$ and $\varepsilon_{2}$ . If the quadrature errors are large, then we may not observe frequency bias in practice. Here, we show that the quadrature errors can be made arbitrarily small by taking enough samples in the training data. Recall that our quadrature rule satisfies eq. (18). + +Next, we pass the quadrature error to the approximation error, which may not necessarily be tight. However, this allows us to use the existing theory of spherical harmonics approximation to show the decay of quadrature errors. + +Lemma 5. Let $f: \mathbb{S}^{d-1} \to \mathbb{R}$ be a function and $\mathrm{dist}(f, \Pi_{\ell}^{d}) = \min_{h \in \Pi_{\ell}^{d}} \| f - h \|_{L^{\infty}}$ . We have + +$$ +\left| \int_ {\mathbb {S} ^ {d - 1}} f (\boldsymbol {\xi}) d \boldsymbol {\xi} - \sum_ {i = 1} ^ {n} c _ {i} f \left(\mathbf {x} _ {i}\right) \right| \leq 2 \gamma_ {n, \ell} \| f \| _ {L ^ {\infty}} + 2 A _ {d} \operatorname {d i s t} (f, \Pi_ {\ell} ^ {d}) \tag {60} +$$ + +for any integer $\ell \geq 0$ + +Proof. Let $h_{\ell} = \underset{h \in \Pi_{\ell}^{d}}{\arg \min} \| f - h \|_{L^{\infty}}$ . By the triangle inequality, we have + +$$ +\begin{array}{l} \left| \int_ {\mathbb {S} ^ {d - 1}} f (\boldsymbol {\xi}) d \boldsymbol {\xi} - \sum_ {i = 1} ^ {n} c _ {i} f (\mathbf {x} _ {i}) \right| \\ \leq \left| \int_ {\mathbb {S} ^ {d - 1}} f (\boldsymbol {\xi}) d \boldsymbol {\xi} - \int_ {\mathbb {S} ^ {d - 1}} h _ {\ell} (\boldsymbol {\xi}) d \boldsymbol {\xi} \right| + \left| \int_ {\mathbb {S} ^ {d - 1}} h _ {\ell} (\boldsymbol {\xi}) d \boldsymbol {\xi} - \sum_ {i = 1} ^ {n} c _ {i} h _ {\ell} (\mathbf {x} _ {i}) \right| + \left| \sum_ {i = 1} ^ {n} c _ {i} \left(h _ {\ell} (\mathbf {x} _ {i}) - f (\mathbf {x} _ {i})\right) \right| \\ \leq A _ {d} \operatorname {d i s t} (f, \Pi_ {\ell} ^ {d}) + \gamma_ {n, \ell} \| h _ {\ell} \| _ {L ^ {\infty}} + A _ {d} \operatorname {d i s t} (f, \Pi_ {\ell} ^ {d}) \leq 2 \gamma_ {n, \ell} \| f \| _ {L ^ {\infty}} + 2 A _ {d} \operatorname {d i s t} (f, \Pi_ {\ell} ^ {d}), \\ \end{array} +$$ + +where we used the fact that $c_{i} > 0$ for $i = 1,\dots ,n$ and the fact that $\| h_{\ell}\|_{L^{\infty}}\leq 2\| f\|_{L^{\infty}}$ + +![](images/b4e515e8bd5df6eafd43e4bad8e5ed37ae5850be4e6da16982b7a786b11c0325.jpg) + +Next, we focus on controlling the minimum approximation error $\mathrm{dist}(f,\Pi_{\ell}^{d})$ on the right-hand side of eq. (60). To do so, we prove the following lemma. + +Lemma 6. Let $f_{ij}(\pmb {\xi}) = K^{\infty}(\mathbf{x}_i,\pmb {\xi})g_j(\pmb {\xi})$ and $g_{jp}(\pmb {\xi}) = g_j(\pmb {\xi})g_p(\pmb {\xi})$ . Then, for a constant $C > 0$ that only depends on $d$ , we have + +$$ +\operatorname {d i s t} \left(f _ {i j}, \Pi_ {\ell} ^ {d}\right) \leq C \frac {j + 1}{\ell} \left\| g _ {j} \right\| _ {L ^ {\infty}}, \quad 1 \leq i \leq n, 0 \leq j \leq L, +$$ + +$$ +\mathrm {d i s t} (g _ {j p}, \Pi_ {\ell} ^ {d}) \leq C \frac {j + p}{\ell} \| g _ {j} \| _ {L ^ {\infty}} \| g _ {p} \| _ {L ^ {\infty}}, 0 \leq j, p \leq L, +$$ + +for all $\ell \geq 1$ + +Proof. For $1 \leq a < b \leq d$ where $a, b \in \mathbb{N}$ , and $t \in [-\pi, \pi)$ , let $Q_{a,b,t}$ denote the action on $\mathbb{S}^{d-1}$ of rotation by the angle $t$ in the $(x_a, x_b)$ -plane. For an integer $\alpha \geq 1$ , we define the operator on functions on $\mathbb{S}^{d-1}$ by + +$$ +\Delta_ {a, b, t} ^ {\alpha} = (I - T (Q _ {a, b, t})) ^ {\alpha}, +$$ + +where $T(Q)f(\mathbf{x}) = f(Q^{-1}\mathbf{x})$ . If $f\in C(\mathbb{S}^{d - 1})$ , then we define for $t > 0$ that + +$$ +\omega_ {\alpha} (f; t) = \max _ {1 \leq a < b \leq d} \sup _ {| \theta | \leq t} \left\| \Delta_ {a, b, \theta} ^ {\alpha} f \right\| _ {L ^ {\infty}}. +$$ + +By (Dai & Xu, 2013, Thm. 4.4.2), we have + +$$ +\operatorname {d i s t} (f, \Pi_ {\ell} ^ {d}) \leq c _ {1} \omega_ {\alpha} (f; \ell^ {- 1}), \quad \ell \geq 1, \alpha \geq 1, +$$ + +where $c_{1} > 0$ is some constant that only depends on $\alpha$ . Then it is sufficient to bound $\omega_{\alpha}(f_{ij};\ell^{-1})$ and $\omega_{\alpha}(g_{jp};\ell^{-1})$ to finish the proof. + +First, we aim to bound the term $\mathrm{dist}(f_{ij},\Pi_\ell^d)$ where $f_{ij}(\pmb {\xi}) = K^{\infty}(\mathbf{x}_i,\pmb {\xi})g_j(\pmb {\xi})$ . We fix $1\leq i\leq n$ $1\le a < b\le d$ where $i,a,b\in \mathbb{N}$ , and choose $\theta$ such that $|\theta |\leq \ell^{-1}$ . We have + +$$ +\left\| \Delta_ {a, b, \theta} ^ {1} f _ {i j} \right\| _ {L ^ {\infty}} = \left\| f _ {i j} (\boldsymbol {\xi}) - f _ {i j} (Q _ {a, b, \theta} ^ {- 1} \boldsymbol {\xi}) \right\| _ {L ^ {\infty}}. +$$ + +We then define + +$$ +\delta K _ {i} ^ {\infty} (\pmb {\xi}) := K ^ {\infty} (\mathbf {x} _ {i}, Q _ {a, b, \theta} ^ {- 1} \pmb {\xi}) - K ^ {\infty} (\mathbf {x} _ {i}, \pmb {\xi}), \qquad \delta g _ {j} (\pmb {\xi}) := g _ {j} (Q _ {a, b, \theta} ^ {- 1} \pmb {\xi}) - g _ {j} (\pmb {\xi}). +$$ + +We then have + +$$ +\begin{array}{l} \left\| f _ {i j} (\boldsymbol {\xi}) - f _ {i j} \left(Q _ {a, b, \theta} ^ {- 1} \boldsymbol {\xi}\right) \right\| _ {L ^ {\infty}} = \| K ^ {\infty} (\mathbf {x} _ {i}, \boldsymbol {\xi}) g _ {j} (\boldsymbol {\xi}) - \left(K ^ {\infty} (\mathbf {x} _ {i}, \boldsymbol {\xi}) + \delta K _ {i} ^ {\infty} (\boldsymbol {\xi})\right) \left(g _ {j} (\boldsymbol {\xi}) + \delta g _ {j} (\boldsymbol {\xi})\right) \| _ {L ^ {\infty}} \\ \leq \left\| \delta K _ {i} ^ {\infty} (\boldsymbol {\xi}) \left(g _ {j} (\boldsymbol {\xi}) + \delta g _ {j} (\boldsymbol {\xi})\right) \right\| _ {L ^ {\infty}} + \left\| K ^ {\infty} \left(\mathbf {x} _ {i}, \boldsymbol {\xi}\right) \delta g _ {j} (\boldsymbol {\xi}) \right\| _ {L ^ {\infty}}. \tag {61} \\ \end{array} +$$ + +We control the two terms separately. First, to control the second term, we write + +$$ +\left\| K ^ {\infty} \left(\mathbf {x} _ {i}, \boldsymbol {\xi}\right) \delta g _ {j} (\boldsymbol {\xi}) \right\| _ {L ^ {\infty}} \leq \left\| K ^ {\infty} \left(\mathbf {x} _ {i}, \boldsymbol {\xi}\right) \right\| _ {L ^ {\infty}} \left\| \delta g _ {j} (\boldsymbol {\xi}) \right\| _ {L ^ {\infty}} \leq \frac {1}{2} \left\| \delta g _ {j} (\boldsymbol {\xi}) \right\| _ {L ^ {\infty}}, \tag {62} +$$ + +based on the definition of $K^{\infty}$ in eq. (11). For some constant $c_{2} > 0$ that depends only on $d$ , we have + +$$ +\left\| \delta g _ {j} (\boldsymbol {\xi}) \right\| _ {L ^ {\infty}} = \left\| \Delta_ {a, b, \theta} ^ {1} g _ {j} (\boldsymbol {\xi}) \right\| _ {L ^ {\infty}} \leq c _ {2} \ell^ {- 1} \left\| D _ {a, b} g _ {j} (\boldsymbol {\xi}) \right\| _ {L ^ {\infty}} \leq c _ {2} \frac {j}{\ell} \| g _ {j} \| _ {L ^ {\infty}}, \tag {63} +$$ + +where $D_{a,b} \coloneqq x_a\partial_b - x_b\partial_a$ and the two inequalities follow from (Dai & Xu, 2013, Lem. 4.2.2 (iii)) and (Dai & Xu, 2013, Lem. 4.2.4), respectively. Next, we control the first term of eq. (61) by writing + +$$ +\left\| \delta K _ {i} ^ {\infty} (\boldsymbol {\xi}) \left(g _ {j} (\boldsymbol {\xi}) + \delta g _ {j} (\boldsymbol {\xi})\right) \right\| _ {L ^ {\infty}} \leq \left\| \delta K _ {i} ^ {\infty} (\boldsymbol {\xi}) \right\| _ {L ^ {\infty}} \left\| g _ {j} \left(Q _ {a, b, \theta} ^ {- 1} \boldsymbol {\xi}\right) \right\| _ {L ^ {\infty}} = \left\| \delta K _ {i} ^ {\infty} (\boldsymbol {\xi}) \right\| _ {L ^ {\infty}} \left\| g _ {j} \right\| _ {L ^ {\infty}}. \tag {64} +$$ + +We fix $\pmb{\xi}$ and define $\pmb{\xi}^{\prime} = Q_{a,b,\theta}^{-1}\pmb{\xi}$ . It follows that + +$$ +\begin{array}{l} \delta K _ {i} ^ {\infty} (\boldsymbol {\xi}) = K ^ {\infty} \left(\mathbf {x} _ {i}, \boldsymbol {\xi} ^ {\prime}\right) - K ^ {\infty} \left(\mathbf {x} _ {i}, \boldsymbol {\xi}\right) \\ = \frac {1}{4 \pi} \left[ \left(\mathbf {x} _ {i} ^ {\top} \boldsymbol {\xi} ^ {\prime} + 1\right) \left(\pi - \operatorname {a r c c o s} (\mathbf {x} _ {i} ^ {\top} \boldsymbol {\xi} ^ {\prime})\right) - \left(\mathbf {x} _ {i} ^ {\top} \boldsymbol {\xi} + 1\right) \left(\pi - \operatorname {a r c c o s} (\mathbf {x} _ {i} ^ {\top} \boldsymbol {\xi})\right) \right] \\ = \frac {1}{4 \pi} \left[ \mathbf {x} _ {i} ^ {\top} \left(\boldsymbol {\xi} ^ {\prime} - \boldsymbol {\xi}\right) \left(\pi - \operatorname {a r c c o s} \left(\mathbf {x} _ {i} ^ {\top} \boldsymbol {\xi}\right)\right) - \left(\mathbf {x} _ {i} ^ {\top} \boldsymbol {\xi} ^ {\prime} + 1\right) \left(\operatorname {a r c c o s} \left(\mathbf {x} _ {i} ^ {\top} \boldsymbol {\xi}\right) - \operatorname {a r c c o s} \left(\mathbf {x} _ {i} ^ {\top} \boldsymbol {\xi} ^ {\prime}\right)\right) \right] \\ \end{array} +$$ + +Next, by the triangle inequality for angles, we have + +$$ +\left| \operatorname {a r c c o s} \left(\mathbf {x} _ {i} ^ {\top} \boldsymbol {\xi}\right) - \operatorname {a r c c o s} \left(\mathbf {x} _ {i} ^ {\top} \boldsymbol {\xi} ^ {\prime}\right) \right| \leq | \theta | \leq \ell^ {- 1}. +$$ + +Since $\arccos$ is monotone and $|(d / dt)\arccos (t)| > 1$ for all $t$ , by the fundamental theorem of calculus, we must have + +$$ +\left| \mathbf {x} _ {i} ^ {\top} \boldsymbol {\xi} ^ {\prime} - \mathbf {x} _ {i} ^ {\top} \boldsymbol {\xi} \right| \leq \left| \operatorname {a r c c o s} \left(\mathbf {x} _ {i} ^ {\top} \boldsymbol {\xi}\right) - \operatorname {a r c c o s} \left(\mathbf {x} _ {i} ^ {\top} \boldsymbol {\xi} ^ {\prime}\right) \right| \leq \ell^ {- 1}. +$$ + +As a result, we have + +$$ +\left| \delta K _ {i} ^ {\infty} (\boldsymbol {\xi}) \right| \leq \frac {1}{4 \pi} \left[ \ell^ {- 1} \pi + 2 \ell^ {- 1} \right] = \frac {\pi + 2}{4 \pi} \ell^ {- 1}. \tag {65} +$$ + +By eq. (64) and eq. (65), we find that + +$$ +\left\| \delta K _ {i} ^ {\infty} (\boldsymbol {\xi}) \left(g _ {j} (\boldsymbol {\xi}) + \delta g _ {j} (\boldsymbol {\xi})\right) \right\| _ {L ^ {\infty}} \leq \frac {\pi + 2}{4 \pi} \ell^ {- 1} \| g _ {j} \| _ {L ^ {\infty}}. \tag {66} +$$ + +Putting eqs. (61) to (63) and (66) together, we obtain + +$$ +\left\| \Delta_ {a, b, \theta} ^ {1} f _ {i j} \right\| _ {L ^ {\infty}} = \left\| f _ {i j} (\boldsymbol {\xi}) - f _ {i j} (Q _ {a, b, \theta} ^ {- 1} \boldsymbol {\xi}) \right\| _ {L ^ {\infty}} \leq \left(c _ {2} j + \frac {\pi + 2}{4 \pi}\right) \ell^ {- 1} \| g _ {j} \| _ {L ^ {\infty}}. +$$ + +Since $a, b$ , and $\theta$ are chosen arbitrarily, this bound also holds for $\omega_{1}(f_{ij}; \ell^{-1})$ . + +Second, we aim to bound the term $\mathrm{dist}(g_{jp},\Pi_\ell^d)$ where $g_{jp}(\pmb {\xi}) = g_j(\pmb {\xi})g_p(\pmb {\xi})$ . As before, we fix the indices $a,b\in \mathbb{N}$ where $1\leq a < b\leq d$ and $\theta$ such that $|\theta |\leq \ell^{-1}$ . Similarly, we define + +$$ +\delta g _ {j} (\boldsymbol {\xi}) = g _ {j} \left(Q _ {a, b, \theta} ^ {- 1} \boldsymbol {\xi}\right) - g _ {j} (\boldsymbol {\xi}), \quad \delta g _ {p} (\boldsymbol {\xi}) = g _ {p} \left(Q _ {a, b, \theta} ^ {- 1} \boldsymbol {\xi}\right) - g _ {p} (\boldsymbol {\xi}). +$$ + +By eq. (63), we have + +$$ +\begin{array}{l} \left\| g _ {j} g _ {p} (\boldsymbol {\xi}) - g _ {j} g _ {p} \left(Q _ {a, b, \theta} ^ {- 1} \boldsymbol {\xi}\right) \right\| _ {L ^ {\infty}} = \| g _ {j} (\boldsymbol {\xi}) g _ {p} (\boldsymbol {\xi}) - \left(g _ {j} (\boldsymbol {\xi}) + \delta g _ {j} (\boldsymbol {\xi})\right) \left(g _ {p} (\boldsymbol {\xi}) + \delta g _ {p} (\boldsymbol {\xi})\right) \| _ {L ^ {\infty}} \\ \leq \left\| \delta g _ {j} (\boldsymbol {\xi}) \left(g _ {p} (\boldsymbol {\xi}) + \delta g _ {p} (\boldsymbol {\xi})\right) \right\| _ {L ^ {\infty}} + \left\| g _ {j} (\boldsymbol {\xi}) \delta g _ {p} (\boldsymbol {\xi}) \right\| _ {L ^ {\infty}} \tag {67} \\ \leq c _ {2} \frac {j + p}{\ell} \left\| g _ {j} \right\| _ {L ^ {\infty}} \left\| g _ {p} \right\| _ {L ^ {\infty}}. \\ \end{array} +$$ + +Since $a, b$ , and $\theta$ are arbitrary numbers, this bound also holds for $\omega_{1}(g_{jp}; \ell^{-1})$ . + +Using these lemmas, we can prove that Theorem 3 asymptotically controls the quadrature errors. + +Proof of Theorem 3. First, we control $\varepsilon_1(k)$ as + +$$ +\begin{array}{l} | \varepsilon_ {1} (k) | \leq \left| \sum_ {j = 0} ^ {L} \sum_ {p = 0} ^ {L} \left(1 - 2 \eta \mu_ {j}\right) ^ {k} \left(1 - 2 \eta \mu_ {p}\right) ^ {k} e _ {j p} ^ {c} \right| \leq \left| \sum_ {j = 0} ^ {L} \sum_ {p = 0} ^ {L} e _ {j p} ^ {c} \right| \\ \leq \sum_ {j = 0} ^ {L} \sum_ {p = 0} ^ {L} \left| 2 \gamma_ {n, \ell} \| g _ {j p} \| _ {L ^ {\infty}} + 2 A _ {d} \mathrm {d i s t} (g _ {j p}, \Pi_ {\ell} ^ {d}) \right| \\ \leq \sum_ {j = 0} ^ {L} \sum_ {p = 0} ^ {L} \left(2 \gamma_ {n, \ell} \| g _ {j} \| _ {L ^ {\infty}} \| g _ {p} \| _ {L ^ {\infty}} + 2 A _ {d} C \frac {j + p}{\ell} \| g _ {j} \| _ {L ^ {\infty}} \| g _ {p} \| _ {L ^ {\infty}}\right), \\ \end{array} +$$ + +where the third and the forth inequalities follow from Lemma 5 and Lemma 6, respectively. The final upper bound for $|\varepsilon_1(k)|$ holds since $\sum_{j=0}^{L} \sum_{p=0}^{L}(j+p) = \mathcal{O}(L^3)$ . Next, there exists $C_2 > 0$ such that we can control $\varepsilon_2$ by writing + +$$ +\begin{array}{l} \left| \varepsilon_ {2} \right| \leq \sum_ {j = 0} ^ {L} \frac {\sqrt {A _ {d}}}{\mu_ {j}} \max _ {1 \leq i \leq n} \left| e _ {i j} ^ {b} \right| \leq \sum_ {j = 0} ^ {L} \frac {\sqrt {A _ {d}}}{\mu_ {j}} \left(2 \gamma_ {n, \ell} \| g _ {j} \| _ {L ^ {\infty}} + 2 A _ {d} C \frac {j + 1}{\ell} \| g _ {j} \| _ {L ^ {\infty}}\right) \\ \leq C _ {2} \left(\sum_ {j = 0} ^ {L} \mu_ {j} ^ {- 1}\right) \left(\frac {L ^ {2}}{\ell} + L \gamma_ {n, \ell}\right) \max _ {j} \| g _ {j} \| _ {L ^ {\infty}}, \\ \end{array} +$$ + +where the second and the third inequalities follow from Lemma 5 and Lemma 6, respectively. The proof is complete. + +Proof of Corollary 1. By Theorem 3, it suffices to show that $\max_{0\leq j\leq L}\| g_j\|_{L^{\infty}}\leq C\| g\|_{L^2}$ for some constant $C > 0$ that does not depend on $g$ . Since $\mathcal{H}_i^d\perp \mathcal{H}_j^d$ in $L^2$ for $i\neq j$ , we have $\| g_j\|_{L^2}\leq \| g\|_{L^2}$ for $0\leq j\leq L$ . The claim follows from the fact that $\| \cdot \|_{L^2}$ and $\| \cdot \|_{L^{\infty}}$ are equivalent in $\Pi_L^d$ . + +# E THE THEORY OF FREQUENCY BIAS WITH A $\mathbf{H}^{\mathrm{s}}$ -BASED LOSS FUNCTION + +This section presents detailed proofs for Proposition 2 and Theorem 4 in Section 5, which concerns the frequency bias behavior of NN training using the $H^{s}$ loss function. + +# E.1 A 2-LAYER RELU NEURAL NETWORK IS IN $\mathbf{H}^s (\mathbb{S}^{d - 1})$ FOR $s < 3 / 2$ + +We prove that a 2-layer ReLU NN map is contained in $H^{s}(\mathbb{S}^{d - 1})$ for any $s < 3 / 2$ (see Proposition 2). + +Proof of Proposition 2. Since $\mathcal{N}$ can be written as + +$$ +\mathcal {N} (\mathbf {x}) = \sum_ {r = 1} ^ {m} a _ {r} \operatorname {R e L U} \left(\mathbf {w} _ {r} ^ {\top} \mathbf {x} + b _ {r}\right), +$$ + +it suffices to prove that $f(\mathbf{x}) = \mathrm{ReLU}(\mathbf{w}^\top \mathbf{x} + b)$ is in $H^s$ for all $\mathbf{w} \in \mathbb{R}^d, b \in \mathbb{R}$ . Since $\mathrm{ReLU}(a\mathbf{x}) = a\mathrm{ReLU}(\mathbf{x})$ for any $a > 0$ , we can assume that $\| \mathbf{w}\|_2 = 1$ . Moreover, since the Sobolev spaces are rotationally invariant, we can assume that $\mathbf{w} = (1,0,\dots,0)^\top$ . Then, $f$ can be written as + +$$ +f (\mathbf {x}) = \operatorname {R e L U} (x _ {1} + b). +$$ + +If $b \leq -1$ or $b \geq 1$ , then $f(\mathbf{x})$ is a constant, and thus $f \in H^{s}(\mathbb{S}^{d-1})$ for all $s \in \mathbb{R}$ . We assume $-1 < b < 1$ . Then, we have + +$$ +f (\mathbf {x}) = \left\{ \begin{array}{l l} x _ {1} + b, & x _ {1} > - b, \\ 0, & x _ {1} \leq - b. \end{array} \right. +$$ + +We define the function + +$$ +\mathcal {S} _ {s} (f) (\mathbf {x}) = \int_ {0} ^ {\pi} \frac {\left| \mathcal {I} _ {t} f (\mathbf {x}) - f (\mathbf {x}) \right| ^ {2}}{t ^ {2 s + 1}} d t, +$$ + +where + +$$ +\mathcal {I} _ {t} f (\mathbf {x}) = \int_ {C (\mathbf {x}, t)} f (\boldsymbol {\xi}) d \boldsymbol {\xi}, \qquad C (\mathbf {x}, t) = \{\boldsymbol {\xi} \in \mathbb {S} ^ {d - 1} \mid \operatorname {a r c c o s} (\boldsymbol {\xi} \cdot \mathbf {x}) \leq t \}. +$$ + +Here, $f_{C(\mathbf{x},t)}f(\pmb {\xi})d\pmb {\xi} = |C(\mathbf{x},t)|^{-1}\int_{C(\mathbf{x},t)}f(\pmb {\xi})d\pmb{\xi}$ is the averaged integral, where $|C(\mathbf{x},t)|$ is the Lebesgue measure of $C(\mathbf{x},t)$ . Then, by (Barcelo et al., 2020, Thm. 1.1), we have $f\in H^{s}(\mathbb{S}^{d - 1})$ if and only if $\mathcal{S}_s(f)$ is integrable. We now show that $\mathcal{S}_s(f)$ is integrable on both $E_{1} = \{\mathbf{x}\in \mathbb{S}^{d - 1}\mid x_1 > - b\}$ and $E_{2} = \{\mathbf{x}\in \mathbb{S}^{d - 1}\mid x_{1} < - b\}$ if $s < 3 / 2$ . + +First, we define the function + +$$ +h (\mathbf {x}) = x _ {1} + b. +$$ + +Then, $h\in H^{s}(\mathbb{S}^{d - 1})$ . If we can show that + +$$ +\mathcal {S} _ {s} (h - f) (\mathbf {x}) = \int_ {0} ^ {\pi} \frac {\left| \mathcal {I} _ {t} (h - f) (\mathbf {x}) - (h - f) (\mathbf {x}) \right| ^ {2}}{t ^ {2 s + 1}} d t +$$ + +is integrable on $E_{1}$ , then we have + +$$ +\begin{array}{l} \int_ {E _ {1}} \mathcal {S} _ {s} (f) (\mathbf {x}) d \mathbf {x} = \int_ {E _ {1}} \int_ {0} ^ {\pi} \frac {\left| \mathcal {I} _ {t} f (\mathbf {x}) - f (\mathbf {x}) \right| ^ {2}}{t ^ {2 s + 1}} d t d \mathbf {x} \\ \leq 2 \int_ {E _ {1}} \int_ {0} ^ {\pi} \frac {\left| \mathcal {I} _ {t} h (\mathbf {x}) - h (\mathbf {x}) \right| ^ {2} + \left| \mathcal {I} _ {t} (h - f) (\mathbf {x}) - (h - f) (\mathbf {x}) \right| ^ {2}}{t ^ {2 s + 1}} d t d \mathbf {x} \tag {68} \\ = 2 \int_ {E _ {1}} \mathcal {S} _ {s} (h) (\mathbf {x}) d \mathbf {x} + 2 \int_ {E _ {1}} \mathcal {S} _ {s} (h - f) (\mathbf {x}) d \mathbf {x} < \infty . \\ \end{array} +$$ + +Assume $\mathbf{x} \in E_1$ , and let $\rho$ be the minimum angular distance between $\mathbf{x}$ and any point in the set $S = \{\pmb{\xi} \in \mathbb{S}^{d-1} \mid \xi_1 = -b\}$ , i.e., $\rho = \min_{\pmb{\xi} \in S} \arccos(\pmb{\xi} \cdot \mathbf{x})$ . Then, for $0 < t \leq \rho$ , we clearly have $\mathcal{I}_t(h - f)(\mathbf{x}) = 0 = (h - f)(\mathbf{x})$ . Assume $\rho < t < \pi$ . We divide $C(\mathbf{x}, t)$ into two parts $C_1$ and $C_2$ up to a Lebesgue null set, where $C_i = C(\mathbf{x}, t) \cap E_i$ . Then, $h - f = 0$ on $C_1$ . Next, by Li (2011), we know that the measure of $C_2$ satisfies3 + +$$ +\frac {| C _ {2} |}{| C (\mathbf {x} , t) |} = \Theta \left(I \left(\frac {t ^ {2} - \rho^ {2}}{t ^ {2}}; \frac {d}{2}, \frac {1}{2}\right)\right) = \Theta \left(B \left(\frac {t ^ {2} - \rho^ {2}}{t ^ {2}}; \frac {d}{2}, \frac {1}{2}\right)\right), \qquad t \to \rho^ {+}, +$$ + +where $I$ is the regularized incomplete beta function and $B$ is the incomplete beta function. Here and throughout the proof, the constants in the big- $\Theta$ notations are independent of $\rho$ or $t$ , but possibly depend on $b$ and $d$ , which are fixed in the proof. Moreover, we have the formula + +$$ +B \left(\frac {t ^ {2} - \rho^ {2}}{t ^ {2}}; \frac {d}{2}, \frac {1}{2}\right) = \frac {\left[ (t ^ {2} - \rho^ {2}) / t ^ {2} \right] ^ {d / 2}}{d / 2} F \left(\frac {d}{2}, \frac {1}{2}, \frac {d + 2}{2}; \frac {t ^ {2} - \rho^ {2}}{t ^ {2}}\right), +$$ + +where $F$ is the hypergeometric function that converges to 1 as $t \to \rho^{+}$ (Olver et al., 2010, sect. 8.17, sect. 15.2). Hence, we have + +$$ +\frac {\left| C _ {2} \right|}{\left| C (\mathbf {x} , t) \right|} = \Theta \left(\frac {(t - \rho) ^ {d / 2}}{t ^ {d / 2}}\right), \quad t \rightarrow \rho^ {+}. \tag {69} +$$ + +Now, by the way we defined $h - f$ , there exist constants $R_{1}, R_{2} > 0$ such that + +$$ +\left| h - f \right| (\boldsymbol {\xi}) \leq R _ {1} (t - \rho), \quad \boldsymbol {\xi} \in C _ {2}, +$$ + +$$ +\left| h - f \right| (\boldsymbol {\xi}) \geq R _ {2} (t - \rho), \quad \boldsymbol {\xi} \in \left\{\boldsymbol {\zeta} \in C _ {2} \middle | \min _ {\boldsymbol {\theta} \in S} \operatorname {a r c c o s} (\boldsymbol {\zeta} \cdot \boldsymbol {\theta}) \geq \frac {t - \rho}{2} \right\}. +$$ + +This gives us + +$$ +\left| \int_ {C (\mathbf {x}, t)} (h - f) (\boldsymbol {\xi}) d \boldsymbol {\xi} \right| = \Theta \left(\frac {(t - \rho) ^ {(d + 2) / 2}}{t ^ {d / 2}}\right), \quad t \rightarrow \rho^ {+}. \tag {70} +$$ + +Now, we have + +$$ +\begin{array}{l} \mathcal {S} _ {s} (h - f) (\mathbf {x}) = \int_ {\rho} ^ {\pi} t ^ {- 2 s - 1} \mathcal {I} _ {t} (h - f) (\mathbf {x}) ^ {2} d t = \int_ {\rho} ^ {\pi} t ^ {- 2 s - 1} \left(\int_ {C (\mathbf {x}, t)} (h - f) (\boldsymbol {\xi}) d \sigma (\boldsymbol {\xi})\right) ^ {2} d t \\ = \Theta \left(\int_ {\rho} ^ {\pi} t ^ {- 2 s - 1 - d} (t - \rho) ^ {d + 2} d t\right) = \Theta (\rho^ {2 - 2 s} + 1). \\ \end{array} +$$ + +To integrate $S_{s}(h - f)$ over $E_{1}$ , we first change the coordinates and integrate over $\mathbb{S}^{d - 2}$ by fixing a $\rho$ . The resulting integral is still in $\Theta(\rho^{2 - 2s} + 1)$ . We then integrate over $\rho$ and the result follows from the fact that a function in $\Theta(\rho^{2 - 2s} + 1)$ is integrable near $\rho = 0$ if and only if $s < 3/2$ . This proves $S_{s}(h - f)$ is integrable on $E_{1}$ if and only if $s < 3/2$ . Note that if $S_{s}(h - f)$ is not integrable on $E_{1}$ , then $S_{s}(f)$ is neither integrable. This proves the proposition when $s \geq 3/2$ . + +To see $S_{s}(f)$ is integrable over $E_{2}$ when $s < 3/2$ , we note that $f$ can be rewritten as $\tilde{f} - \tilde{h}$ , where $\tilde{f}(\mathbf{x}) = \mathrm{ReLU}(-x_{1} - b)$ and $\tilde{h}(\mathbf{x}) = -x_{1} - b$ . By the same argument, we have that $S_{s}(f) = S_{s}(\tilde{f} - \tilde{h})$ is integrable on $E_{2}$ , which completes the proof. + +# E.2 FREQUENCY BIAS WITH A SQUARED SOBOLEV NORM AS THE LOSS FUNCTION + +In this section, we prove Theorem 4 on Sobolev training. Recall that we compute the $H^{s}$ -based loss based on eq. (20). + +Proof of Theorem 4. Fix some $0 \leq \ell \leq L$ . We can write + +$$ +\mathbf {H} ^ {\infty} \mathbf {P} _ {s} \mathbf {y} ^ {\ell} = \sum_ {j = 0} ^ {\ell_ {\max }} \sum_ {p = 1} ^ {N (d, j)} \mathbf {H} ^ {\infty} \omega_ {j} \mathbf {a} _ {j, p} \mathbf {a} _ {j, p} ^ {\top} \mathbf {y} ^ {\ell} = \sum_ {p = 1} ^ {N (d, \ell)} \mathbf {H} ^ {\infty} \omega_ {\ell} \mathbf {a} _ {\ell , p} \hat {g} _ {\ell , p} + \sum_ {j = 0} ^ {\ell_ {\max }} \sum_ {p = 1} ^ {N (d, j)} \mathbf {H} ^ {\infty} \omega_ {j} \mathbf {a} _ {j, p} e _ {\ell , j, p} ^ {a}, \tag {71} +$$ + +where $\omega_{\ell} = (1 + \ell)^{2s}$ and we used the fact that + +$$ +\mathbf{a}_{j,p}^{\top}\mathbf{y}^{\ell} = \int_{\mathbb{S}^{d - 1}}Y_{j,p}(\boldsymbol {\xi})g_{\ell}(\boldsymbol {\xi})d\boldsymbol {\xi} + e_{\ell ,j,p}^{a} = \left\{ \begin{array}{ll}\hat{g}_{\ell ,p} + e_{\ell ,j,p}^{a}, & \quad \text{if $\ell = j$,}\\ e_{\ell ,j,p}^{a}, & \quad \text{otherwise}. \end{array} \right. +$$ + +Next, we have + +$$ +(\mathbf {H} ^ {\infty} \mathbf {a} _ {j, p}) _ {i} = \int_ {\mathbb {S} ^ {d - 1}} K ^ {\infty} (\mathbf {x} _ {i}, \pmb {\xi}) Y _ {j, p} (\pmb {\xi}) d \pmb {\xi} + e _ {i, j, p} ^ {b} = \mu_ {j} Y _ {j, p} (\mathbf {x} _ {i}) + e _ {i, j, p} ^ {b}, +$$ + +where the last equality follows from the Funk-Hecke formula. Hence, the first term in eq. (71) can be written as + +$$ +\left(\sum_ {p = 1} ^ {N (d, \ell)} \mathbf {H} ^ {\infty} \omega_ {\ell} \mathbf {a} _ {\ell , p} \hat {g} _ {\ell , p}\right) _ {i} = \sum_ {p = 1} ^ {N (d, \ell)} \left(\mu_ {j} Y _ {\ell , p} (\mathbf {x} _ {i}) + e _ {i, \ell , p} ^ {b}\right) \omega_ {\ell} \hat {g} _ {\ell , p} = \mu_ {j} \omega_ {\ell} g _ {j} (\mathbf {x} _ {i}) + \sum_ {p = 1} ^ {N (d, \ell)} e _ {i, \ell , p} ^ {b} \omega_ {\ell} \hat {g} _ {\ell , p}. +$$ + +Moreover, the second term in eq. (71) can be written as + +$$ +\left(\sum_ {j = 0} ^ {\ell_ {\max }} \sum_ {p = 1} ^ {N (d, j)} \mathbf {H} ^ {\infty} \omega_ {j} \mathbf {a} _ {j, p} e _ {\ell , j, p} ^ {a}\right) _ {i} = \sum_ {j = 0} ^ {\ell_ {\max }} \sum_ {p = 1} ^ {N (d, j)} \omega_ {j} e _ {\ell , j, p} ^ {a} \left(\mu_ {j} Y _ {j, p} (\mathbf {x} _ {i}) + e _ {i, j, p} ^ {b}\right). +$$ + +Therefore, we have + +$$ +\mathbf {H} ^ {\infty} \mathbf {P} _ {s} \mathbf {y} ^ {\ell} = \mu_ {\ell} \omega_ {\ell} \mathbf {y} ^ {\ell} + \omega_ {\ell} \varepsilon_ {1} ^ {\ell}, \tag {72} +$$ + +where + +$$ +\left(\varepsilon_ {1} ^ {\ell}\right) _ {i} = \sum_ {p = 1} ^ {N (d, \ell)} e _ {i, \ell , p} ^ {b} \hat {g} _ {\ell , p} + \sum_ {j = 0} ^ {\ell_ {\max }} \sum_ {p = 1} ^ {N (d, j)} \frac {\omega_ {j}}{\omega_ {\ell}} e _ {\ell , j, p} ^ {a} \left(\mu_ {j} Y _ {j, p} (\mathbf {x} _ {i}) + e _ {i, j, p} ^ {b}\right). \tag {73} +$$ + +Applying eq. (72) recursively, we have + +$$ +(\mathbf {I} - 2 \eta \mathbf {H} ^ {\infty} \mathbf {P} _ {s}) ^ {k} \mathbf {y} = \sum_ {\ell = 0} ^ {L} \left(1 - 2 \eta \mu_ {\ell} \omega_ {\ell}\right) ^ {k} \mathbf {y} ^ {\ell} \underbrace {- 2 \eta \sum_ {\ell = 0} ^ {L} \sum_ {t = 0} ^ {k - 1} \left(1 - 2 \eta \mu_ {\ell} \omega_ {\ell}\right) ^ {t} \left(\mathbf {I} - 2 \eta \mathbf {H} ^ {\infty} \mathbf {P} _ {s}\right) ^ {k - t - 1} \omega_ {\ell} \pmb {\varepsilon} _ {1} ^ {\ell}} _ {\pmb {\varepsilon} _ {1}}. +$$ + +Now, since $\mathbf{H}^{\infty}\mathbf{P}_s$ is self-adjoint and positive definite in $(\mathbb{R}^n,\langle \cdot ,\cdot \rangle_{\mathbf{P}_s})$ , by the way we pick $\eta$ , we guarantee that $\mathbf{I} - 2\eta \mathbf{H}^{\infty}\mathbf{P}_s$ is positive definite in $(\mathbb{R}^n,\langle \cdot ,\cdot \rangle_{\mathbf{P}_s})$ and hence + +$$ +\left\| \mathbf {I} - 2 \eta \mathbf {H} ^ {\infty} \mathbf {P} _ {s} \right\| _ {\mathbf {P} _ {s}} \leq 1 - 2 \eta \lambda_ {0}. +$$ + +This gives us $\| \varepsilon_1\|_{\mathbf{P}_s}\leq \sum_{\ell = 0}^L\mu_\ell^{-1}\left\| \varepsilon_1^\ell \right\|_{\mathbf{P}_s}$ , and the result follows from Theorem 1. + +![](images/a6f1ffff6662c1fd8f55f1885bbbb205594d6481cf65b0ea72f7a29f3d18c502.jpg) + +While Theorem 4 captures the frequency bias in squared $H^{s}$ loss training up to quadrature errors, analyzing the quadrature errors can be task-specific. Therefore, studying the quadrature rules could be a direction of future research. + +Suppose we use Theorem $1^{\prime}$ in the proof, we can write down Theorem 4 in a form such that $\epsilon_{2}(k)$ depends on the parameters of the NN. + +Theorem $4^{\prime}$ . Suppose $g \in \Pi_L^d$ and $\Phi_s$ is the loss function in eq. (20), where $\mathbf{P}_s$ is positive definite and $\ell_{\max} \geq L$ . Under the assumptions of Theorem $1^{\prime}$ , if $1 - 2\eta \mu_\ell(1 + \ell)^{2s} > 0$ for all $0 \leq \ell \leq L$ , then with probability $\geq 1 - \delta$ over the random initialization, we have + +$$ +\mathbf {y} - \mathbf {u} (k) = \sum_ {\ell = 0} ^ {L} \left(1 - 2 \eta \mu_ {\ell} (1 + \ell) ^ {2 s}\right) ^ {k} \mathbf {y} ^ {\ell} + \varepsilon_ {1} + \varepsilon_ {2} (k), \quad 0 \leq k \leq T, \tag {74} +$$ + +where $\| \varepsilon_2(k)\|_{\mathbf{P}_s}$ is bounded by eq. (51) with $M_{\mathbf{P}} = M_{\mathbf{P}_s}$ , and $\mathbf{y}^{\ell} = (g_{\ell}(\mathbf{x}_1),\dots ,g_{\ell}(\mathbf{x}_n))^{\top}$ and $\varepsilon_{1}$ satisfies + +$$ +\| \pmb {\varepsilon} _ {1} \| _ {\mathbf {P} _ {s}} \leq \sum_ {\ell = 0} ^ {L} \mu_ {\ell} ^ {- 1} \| \pmb {\varepsilon} _ {1} ^ {\ell} \| _ {\mathbf {P} _ {s}}, (\varepsilon_ {1} ^ {\ell}) _ {i} = e _ {i, \ell} ^ {d} + \sum_ {j = 0} ^ {\ell_ {m a x}} \frac {(1 + j) ^ {2 s}}{(1 + \ell) ^ {2 s}} \sum_ {p = 1} ^ {N (d, j)} e _ {\ell , j, p} ^ {a} \left(\mu_ {j} Y _ {j, p} (\mathbf {x} _ {i}) + e _ {i, j, p} ^ {b}\right). +$$ + +Moreover, we note that the remark after the proof of Theorem 2 applies here as well. In particular, using the relation that + +$$ +\| \mathbf {y} - \mathbf {u} (k) \| _ {\mathbf {c}} = \sqrt {\| g - \mathcal {N} _ {k} \| _ {L ^ {2}} ^ {2} - E _ {\mathbf {c}} ((g - \mathcal {N} _ {k}) ^ {2})}, +$$ + +we can rewrite eq. (21) into + +$$ +\left\| g - \mathcal {N} _ {k} \right\| _ {L ^ {2}} = \left\| \sum_ {\ell = 0} ^ {L} \left(1 - 2 \eta \mu_ {\ell} (1 + \ell) ^ {2 s}\right) ^ {k} \mathbf {y} ^ {\ell} \right\| _ {\mathbf {c}} + \varepsilon_ {1} + \varepsilon_ {2} (k) + \varepsilon_ {3} (k), \tag {75} +$$ + +where $|\varepsilon_1| \leq \| \varepsilon_1\|_{\mathbf{c}}, |\varepsilon_2(k)| \leq \| \varepsilon_2(k)\|_{\mathbf{c}}$ are as in Theorem 4, and $|\varepsilon_3(k)| \leq \sqrt{|E_{\mathbf{c}}(g - \mathcal{N}_k)^2|}$ . By eq. (57), we can directly relate $\left\| \sum_{\ell = 0}^{L}\left(1 - 2\eta \mu_{\ell}(1 + \ell)^{2s}\right)^k\mathbf{y}^\ell \right\|_{\mathbf{c}}$ to $\sqrt{\sum_{\ell=0}^{L}\left(1 - 2\eta\mu_{\ell}(1 + \ell)^{2s}\right)^{2k}\|g_{\ell}\|_{L^2}^2}$ up to some quadrature errors. Therefore, the generalization error with respect to the uniform distribution can be written as + +$$ +\left\| g - \mathcal {N} _ {k} \right\| _ {L ^ {2}} = \sqrt {\sum_ {\ell = 0} ^ {L} \left(1 - 2 \eta \mu_ {j} (1 + \ell) ^ {2 s}\right) ^ {2 k} \left\| g _ {\ell} \right\| _ {L ^ {2}} ^ {2}} + E _ {\mathrm {N T K}} + E _ {\mathrm {q u a d}}, +$$ + +where $E_{\mathrm{NTK}}$ is an error that can be made arbitrarily small by taking $\kappa$ small enough and $m$ large enough and $E_{\mathrm{quad}}$ involves only quadrature errors and can be made arbitrarily small if we make the quadrature rule accurate enough. + +# F EXPERIMENTAL DETAILS + +We now present the details of the three experiments in Section 6. + +# F.1 LEARNING TRIGONOMETRIC POLYNOMIALS ON THE UNIT CIRCLE + +In section 6.1, we train a NN with data derived from sampling a trigonometric polynomial at nonuniform points on the unit circle. The $n = 1140$ nonuniform data points $\{\mathbf{x}_i\}$ for this test are generated by taking the union of three sets of equally spaced points, as shown in Figure 1. The data set $\{(\cos (\theta_i),\sin (\theta_i))\}$ contains 100 equally spaced nodes sampled from $\theta \in (0,2\pi ]$ , superimposed with 40 equally spaced nodes sampled from $\theta \in [0,0.3\pi ]$ and 1000 equally spaced nodes sampled from $\theta \in [1.4\pi ,1.8\pi ]$ (see Figure 1, left). We construct the quadrature weights $c_{j}$ by minimizing $\sum_{j = 1}^{n}c_{j}^{2}$ , under the constraints that the $c_{i}$ 's are positive and the quadrature rule is exact on $\Pi_{55}^{2}$ , i.e., $E_{\mathbf{c}}(f) = 0$ for all $f\in \Pi_{55}^{2}$ . Note that due to the linearity of the quadrature rule, it suffices to check a finite set of linear constraints + +$$ +E _ {\mathbf {c}} (Y _ {\ell , p}) = 0, \qquad 0 \leq \ell \leq 5 5, 1 \leq p \leq N (2, \ell). +$$ + +This computation method is proposed in (Mhaskar et al., 2000). Here, 55 is selected to be an integer close to the maximum degree $\ell$ such that there exists a positive quadrature rule exact on $\Pi_{\ell}^{d}$ . In the upper-bounds of the quadrature errors in Theorem 3, there exist terms + +$$ +\frac {L ^ {3}}{\ell} + L ^ {2} \gamma_ {n, \ell}, \quad \frac {L ^ {2}}{\ell} + L \gamma_ {n, \ell}, \tag {76} +$$ + +where $L$ is a constant bandlimit of the target function. By requiring the quadrature rule to be exact on $\Pi_{\ell_0}^2$ , we guarantee that $\gamma_{n,\ell_0} = 0$ . Hence, by requiring $\ell_0$ to be large, we can heuristically make $\gamma_{n,\ell}$ smaller for a moderate $\ell$ . This allows us to show that the upper-bounds in eq. (76) are small by balancing the term that involves $\ell^{-1}$ , which vanishes as $\ell \to \infty$ , and the term that involves $\gamma_{n,\ell}$ which increases as $\ell \to \infty$ . This justifies why we compute the quadrature rule by requiring it to be exact on spherical harmonics of degree as large as possible. + +The experiment consists of two parts. First, we compare the effects of training with the loss function $\Phi$ based on eq. (1) against the squared $L^2$ loss function $\widetilde{\Phi}$ in eq. (3), where + +$$ +\Phi (\mathbf {W}) = \frac {A _ {d}}{2 n} \sum_ {i = 1} ^ {n} | \mathcal {N} (\mathbf {x} _ {i}) - g (\mathbf {x} _ {i}) | ^ {2}, \quad \widetilde {\Phi} (\mathbf {W}) = \frac {1}{2} \sum_ {i = 1} ^ {n} c _ {i} | \mathcal {N} (\mathbf {x} _ {i}) - g (\mathbf {x} _ {i}) | ^ {2}. +$$ + +We define the target function to be + +$$ +g (\mathbf {x}) = \tilde {g} (\theta) = \sum_ {\ell = 1} ^ {9} \sin (\ell \theta), \qquad \mathbf {x} = \mathbf {x} (\theta) = (\cos \theta , \sin \theta) \in \mathbb {S} ^ {1}, +$$ + +where $\tilde{g} (\theta) = g(\mathbf{x}(\theta))$ . We set up two 2-layer ReLU-activated NNs with $5\times 10^{4}$ hidden neurons in each layer and train them using the same training data and gradient descent procedure, except with different loss functions $\Phi$ and $\widetilde{\Phi}$ . In Figure 5, we showed the evolution of the NNs trained using $\Phi$ and $\widetilde{\Phi}$ , respectively. While the NN trained with $\Phi$ approximates the function very well in the region where the training data are dense (i.e., where $\theta \in [1.4\pi ,1.8\pi ]\approx [4.40,5.65]$ ), the NN trained with $\widetilde{\Phi}$ provides a better overall approximation on the entire domain and demonstrates frequency bias much more clearly. + +To evaluate the frequency loss, we collect 100 uniform samples from $\mathcal{N}(\mathbf{x})$ and $g(\mathbf{x})$ and compute the Fourier coefficients $\widehat{\mathcal{N}} (\ell)$ and $\hat{g} (\ell)$ such that functions + +$$ +\mathcal {N} (\mathbf {x}) = \widetilde {\mathcal {N}} (\theta) \approx \sum_ {\ell = 0} ^ {3 0} \widehat {\mathcal {N}} (\ell) e ^ {i \ell \theta}, \qquad g (\mathbf {x}) = \tilde {g} (\theta) \approx \sum_ {\ell = 0} ^ {3 0} \hat {g} (\ell) e ^ {i \ell \theta}, +$$ + +where $\widetilde{\mathcal{N}} (\theta) = \mathcal{N}(\mathbf{x}(\theta))$ . The frequency loss $|\widehat{\mathcal{N}} (\ell) - \hat{g} (\ell)|$ estimates how $g(\mathbf{x})$ is approximated by $\mathcal{N}(\mathbf{x})$ at the frequency $\ell$ when training with the different loss functions (see Figure 1, middle). In addition, we also train the NN to learn each individual frequency with the training data coming from $g_{\ell} = \sin (\ell \theta)$ and count the number of iterations it takes to obtain $\widetilde{\Phi} (\mathbf{W}) < 1.0\times 10^{-3}$ (see Figure 1, right). + +The second part of the experiment focuses on NN training with a discretized squared Sobolev norm as the loss function. More precisely, we fix some $s \in \mathbb{R}$ and consider the Sobolev loss function eq. (20). For $\mathbb{S}^1$ , we have $N(d,\ell) = 2$ if $\ell > 0$ . We take $Y_{\ell,1}(\mathbf{x}) = \sin (\ell \theta) / \sqrt{2\pi}$ and $Y_{\ell,2}(\mathbf{x}) = \cos (\ell \theta) / \sqrt{2\pi}$ , where the $\sqrt{2\pi}$ factor is a normalization factor. + +![](images/5b7b45fdb0a5422a3529aa32734d590df634a30a9ef864c4d2d01283826fe6e2.jpg) +Figure 5: The target function (black, dotted), the NN trained with $\Phi$ (blue, solid), and the NN trained with $\tilde{\Phi}$ (red, solid). The purple bars on the horizontal axes show the positions of the training data. + +![](images/8cad0c7ec55d367825e131f55c79e84e137db872c8651a5cd877e8f1ae2a1c3d.jpg) + +![](images/bb48d9b63cae42de3c65dc54d90d8b58085d5cb75192365f9f3108a4f3531d6f.jpg) + +![](images/b057c9afa55ed6469dc6291d108be694c257c6cebde8d7f21173bbd2954c0d97.jpg) +Figure 6: Frequency loss for $\ell = 3$ (blue), $\ell = 5$ (red), and $\ell = 9$ (yellow) based on the squared $H^s$ norm as the loss function. Left: $s = -1$ ; Middle: $s = 0$ ; Right: $s = 1$ . The error bars are generated using the results obtained by executions with thirty different random seeds. In the left figure, the result of one of the thirty executions is omitted because the NN is trapped by a local minimizer that is not a global one, making the NN not converge to the target function. + +![](images/cc1b5018e655b345adaaec9c1195489e9fdc24b62267b839a01fbb95898ed51e.jpg) + +![](images/6970d49e4094fb37fb6a46f98306167d061e79d5183b4a5c77c39037b2cc80f0.jpg) + +We set $\ell_{\max} = 30$ in eq. (20) and learn $g$ with different $s$ values ranging from $-1$ to 4. For each $s$ , we compute the frequency loss $|\widehat{\mathcal{N}} (\ell) - \hat{g} (\ell)|$ after different numbers of epochs. As $s$ increases, the frequency loss for higher frequencies decays faster (see Figure 6). In particular, we see in Figure 2, the "rainbow" plot, that when $s = -1$ , the lower-frequency losses are much smaller than the higher ones after 5000 iterations, while when $s = 3$ the higher frequencies are learned faster than the lower ones. + +# F.2 LEARNING SPHERICAL HARMONICS ON THE UNIT SPHERE + +In section 6.2, we train a NN with data derived from sampling a function defined on $\mathbb{S}^2$ at nonuniform points. The training data is a maximum determinant set of 2500 points that comes from the so-called "spheres" dataset (Wright & Michaels, 2015). In this experiment, the target function is + +$$ +g (\mathbf {x}) = \sum_ {\ell = 1} ^ {1 5} Y _ {2 \ell , 0} (\mathbf {x}), +$$ + +where $Y_{2\ell,0}$ is the normalized zonal spherical harmonic function of degree $2\ell$ . Therefore, the spherical harmonic coefficients of $g$ defined in eq. (4) satisfy $\hat{g}_{\ell,p} = 1$ if $p = 0$ and $\ell = 2,4,\ldots,30$ , and $\hat{g}_{\ell,p} = 0$ otherwise. We then train an NN with the squared $H^s$ norm as the loss function (see eq. (20)) for $s = -1,0,2.5$ . By Theorem 4, we need $\ell_{\max} \geq L = 30$ . We set $\ell_{\max} = 40$ in eq. (20), assuming that the bandwidth $L$ is not known a priori. We observe frequency bias in this experiment by considering $|\hat{\mathcal{N}}_{\ell,p} - \hat{g}_{\ell,p}|$ after each epoch for $\ell = 4,10,20$ . We confirm that low frequencies of $g$ are captured earlier in training than high frequencies when $s = -1$ and $s = 0$ (see Figure 3, left and middle), and that this frequency bias phenomena can be counterbalanced by taking $s = 2.5$ (see Figure 3, right). + +# F.3 TEST ON AUTOENCODER + +Autoencoders can be used as a generative model to randomly generate new data that is similar to the training data. In this experiment, we use Sobolev-based norms to improve NN training for producing new images of digits that match the MNIST dataset. In our final experiment, we use the same autoencoder architecture as in (Chollet, 2016), except we train the autoencoder with a different loss function (see section 6.3). + +Here, for training images $\{\mathbf{x}_i\}$ , a standard loss function can be + +$$ +\Phi (\mathbf {W}) = \frac {1}{2} \int \operatorname {d i s t} (\mathcal {N} (\mathbf {x}), \mathbf {x}) d \mu (\mathbf {x}) \approx \frac {1}{2 n} \sum_ {i = 1} ^ {n} \operatorname {d i s t} (\mathcal {N} (\mathbf {x} _ {i}), \mathbf {x} _ {i}), +$$ + +where $\mu$ is the distribution of the training images and $\mathrm{dist}(\mathcal{N}(\mathbf{x}_i),\mathbf{x}_i)$ is a distance between the output of the NN given by $\mathcal{N}(\mathbf{x})$ and the image $\mathbf{x}$ . We select the distance metric to measure the difference between $\mathcal{N}(\mathbf{x})$ and $\mathbf{x}$ as + +$$ +\Phi (\mathbf {W}) = \frac {1}{2 n} \sum_ {i = 1} ^ {n} \| \mathcal {N} \left(\mathbf {x} _ {i}\right) - \mathbf {x} _ {i} \| _ {F} ^ {2}, \tag {77} +$$ + +where $\| \cdot \|_F$ denotes the matrix Frobenius norm. The distance metric in eq. (77) can be viewed as a discretization of the continuous $L^2$ norm. That is, if one imagines generating a continuous function $x:[0,1]^2 \to [0,\infty)$ that interpolates an image as well as a function that interpolates the NN, then + +$$ +\frac {1}{N _ {\mathrm {p i x e l}}} \| \mathcal {N} (\mathbf {x}) - \mathbf {x} \| _ {F} ^ {2} \approx \iint | \mathcal {N} (x) (y _ {1}, y _ {2}) - x (y _ {1}, y _ {2}) | ^ {2} d y _ {1} d y _ {2} = \| \mathcal {N} (x) - x \| _ {L ^ {2}} ^ {2}, +$$ + +where $N_{\mathrm{pixel}}$ is the total number of pixels of the image $\mathbf{x}$ . In this continuous viewpoint, the $H^{s}$ norm is given by (assuming that the continuous interpolating functions $x$ and $\mathcal{N}(x)$ are constructed with periodic boundary conditions) + +$$ +\left\| \mathcal {N} (x) - x \right\| _ {H ^ {s}} ^ {2} = \int (1 + | \xi | ^ {2}) ^ {s} \left| \widehat {\mathcal {N} (x)} (\xi) - \widehat {x} (\xi) \right| ^ {2} d \xi \approx \left\| \mathbf {S} _ {s} \circ \left(\mathbf {F} _ {l} (\mathcal {N} (\mathbf {x}) - \mathbf {x}) \mathbf {F} _ {r} ^ {\top}\right) \right\| _ {F} ^ {2}, \tag {78} +$$ + +where $\mathbf{F}_l, \mathbf{F}_r$ are the left and right 2D-DFT matrices, respectively, $(S_s)_{j\ell} = (1 + j^2 + \ell^2)^{s/2}$ , and $\circ'$ is the Hadamard product. Hence, if we define $\operatorname{vec}(\mathbf{A})$ to be the vector obtained by reshaping a matrix $\mathbf{A}$ using the column-major order, then we have + +$$ +\left\| \mathbf {S} _ {s} \circ \left(\mathbf {F} _ {l} \left(\mathcal {N} (\mathbf {x}) - \mathbf {x}\right) \mathbf {F} _ {r} ^ {\top}\right) \right\| _ {F} ^ {2} = \left\| \operatorname {d i a g} \left(\operatorname {v e c} \left(\mathbf {S} _ {s}\right)\right) \left(\mathbf {F} _ {r} \otimes \mathbf {F} _ {l}\right) \operatorname {v e c} \left(\mathcal {N} (\mathbf {x}) - \mathbf {x}\right) \right\| _ {2} ^ {2}, +$$ + +where $\otimes$ is the Kronecker product of two matrices. Setting $\mathbf{J}_s = \mathrm{diag}(\mathrm{vec}(\mathbf{S}_s))(\mathbf{F}_r\otimes \mathbf{F}_l)$ , the loss function in our NN training can be written as + +$$ +\Phi_ {s} (\mathbf {W}) = \frac {1}{2 n} \sum_ {i = 1} ^ {n} \| \mathbf {J} _ {s} \operatorname {v e c} \left(\mathcal {N} \left(\mathbf {x} _ {i}\right) - \mathbf {x} _ {i}\right) \| _ {2} ^ {2} = \frac {1}{2 n} (\mathbf {u} - \mathbf {y}) ^ {\top} \left(\mathbf {I} \otimes \mathbf {J} _ {s} ^ {\top} \mathbf {J} _ {s}\right) (\mathbf {u} - \mathbf {y}), \tag {79} +$$ + +where $\mathbf{I}$ is the $n$ -by- $n$ identity matrix and $\mathbf{u}, \mathbf{y}$ are the vectors of length $n \times N_{\mathrm{pixel}}$ given by $\mathbf{u} = (\mathrm{vec}(\mathcal{N}(\mathbf{x}_1))^{\top}, \ldots, \mathrm{vec}(\mathcal{N}(\mathbf{x}_n))^{\top})^{\top}$ and $\mathbf{y} = (\mathrm{vec}(\mathbf{x}_1)^{\top}, \ldots, \mathrm{vec}(\mathbf{x}_n)^{\top})^{\top}$ . Hence, the discrete NTK matrix is given by $n^{-1}\mathbf{H}^{\infty}(\mathbf{I} \otimes \mathbf{J}_s^{\top}\mathbf{J}_s)$ , where the $(i,j)$ th sub-block is $\mathbf{H}_{ij}^{\infty} = \left\langle \frac{\partial\mathrm{vec}(\mathcal{N}(\mathbf{x}_i;\mathbf{W}))}{\partial\mathbf{W}}, \frac{\partial\mathrm{vec}(\mathcal{N}(\mathbf{x}_j;\mathbf{W}))}{\partial\mathbf{W}} \right\rangle$ for $i,j=1,\ldots,n$ . Here, $\left\langle \frac{\partial\mathrm{vec}(\mathcal{N}(\mathbf{x}_i;\mathbf{W}))}{\partial\mathbf{W}}, \frac{\partial\mathrm{vec}(\mathcal{N}(\mathbf{x}_j;\mathbf{W}))}{\partial\mathbf{W}} \right\rangle$ is interpreted as the $N_{\mathrm{pixel}}$ -by- $N_{\mathrm{pixel}}$ matrix whose $(i',j')$ th entry is $\left\langle \frac{\partial[\mathrm{vec}(\mathcal{N}(\mathbf{x}_i;\mathbf{W}))_{i'}]}{\partial\mathbf{W}}, \frac{\partial[\mathrm{vec}(\mathcal{N}(\mathbf{x}_j;\mathbf{W}))_{j'}]}{\partial\mathbf{W}} \right\rangle$ . This means that the frequency bias behavior during NN training is directly affected by the choice of $s$ . Alternatively, one can consider this problem more abstractly from an operator learning perspective, which is presented in appendix G. We remark that while eq. (79) is a mathematically equivalent expression for the loss function that allows us to easily express the NTK, in practice, we implement the loss function based on eq. (78) using a 2D FFT protocol. + +We use the same autoencoder architecture as in (Chollet, 2016), except with the loss function in eq. (79) for $s = -1,0,1$ . We train the autoencoder using mini-batch gradient descent with batch size equal to 256. We first pollute the training images with low-frequency noise and train the NN, hoping that the trained NN will act as a filter for the noise. We see that training the NN with eq. (79) for $s = 1$ gives us the best results due to the high-frequency bias induced by choice of the loss function. Although $\mathbf{H}^{\infty}$ is low-frequency bias, the high-frequency bias of $\mathbf{J}_s^\top \mathbf{J}_s$ dominates for sufficiently large $s$ . In that case, the low-frequency noise barely changes the training in the earlier epochs as the low-frequency components of the residual correspond to small eigenvalues of $\mathbf{H}^{\infty}(\mathbf{I}\otimes \mathbf{J}_s^\top \mathbf{J}_s)$ . Similar results are discussed in (Engquist et al., 2020) and (Zhu et al., 2021) in the inverse problem and image processing contexts, respectively. + +The opposite phenomenon occurs when we add high-frequency noise (see Figure 4, bottom row). Since $\mathbf{H}^{\infty}$ by itself makes the NN training procedure bias towards low-frequencies, the output for $s = 0$ does already filter high-frequency noise. Since $\mathbf{J}_s^\top \mathbf{J}_s$ for $s < 0$ further biases towards low-frequencies, one can obtain better high-frequency filters. We observe that the best denoising results for the autoencoder come from selecting $s = -1$ (see Figure 4, bottom row). + +# G NTK AND FREQUENCY BIAS IN OPERATOR LEARNING + +We saw how using the $H^s$ -based losses can help us tune frequency bias in training the autoencoder (see section 6.3). In fact, in training the autoencoder, we are learning the identity operator on the space of images. In this section, we briefly mention the NTK associated with operator learning and its consequences. Let $\mathcal{L}$ be a linear operator on $L^2(\mathbb{S}^{d-1})$ . Let $\mathcal{D} = \{f_1, \ldots, f_N\}$ be a finite subset of $L^2(\mathbb{S}^{d-1})$ , and $\mathbf{x}_1, \ldots, \mathbf{x}_M$ be distinct "samplers" in $\mathbb{S}^{d-1}$ . Since $\mathcal{L}$ is linear, without loss of generality, we assume $\left\| (f_i(\mathbf{x}_1), \ldots, f_i(\mathbf{x}_M))^{\top} \right\|_2 = 1$ for $i = 1, \ldots, N$ . Given a function $f$ , we use $f(\mathbf{x})$ to denote the vector $(f(\mathbf{x}_1), \ldots, f(\mathbf{x}_M))^{\top}$ . We consider a fully-connected two-layer ReLU NN, $\mathcal{N} = (\mathcal{N}_1, \ldots, \mathcal{N}_M)$ , that takes $M$ inputs and produces $M$ outputs. The goal of training is to learn the linear operator $\mathcal{L}$ on $\mathcal{D}$ . That is, we want $\mathcal{N}_j(f(\mathbf{x}_1), \ldots, f(\mathbf{x}_M)) \approx (\mathcal{L}f)(\mathbf{x}_j)$ . In other words, given the samples $f(\mathbf{x})$ of a function $f$ , we want the NN to output the values of $\mathcal{L}f$ at $\mathbf{x}_1, \ldots, \mathbf{x}_M$ , i.e., $(\mathcal{L}f)(\mathbf{x})$ . As before, we let $\mathbf{P}$ be an $M \times M$ symmetric positive definite matrix that measures the distance between two $L^2$ functions given their samples at $\mathbf{x}_1, \ldots, \mathbf{x}_M$ . That is, + +$$ +D (f (\mathbf {x}), g (\mathbf {x})) = \left(f (\mathbf {x}) - g (\mathbf {x})\right) ^ {\top} \mathbf {P} (f (\mathbf {x}) - g (\mathbf {x})). +$$ + +We then consider a loss function of the operator NN given by + +$$ +\Phi (\mathbf {W}) = \frac {1}{N} \sum_ {i = 1} ^ {N} D ((\mathcal {L} f _ {i}) (\mathbf {x}), \mathcal {N} (f _ {i})), \tag {80} +$$ + +where $\mathcal{N}(f_i) \coloneqq (\mathcal{N}_1(f_i), \ldots, \mathcal{N}_M(f_i))^{\top}$ in which $\mathcal{N}_j(f_i)$ denotes the $j$ th output of the NN when we input $f_i$ . That is, $\mathcal{N}_j(f_i) = \mathcal{N}_j(f_i(\mathbf{x}))$ . Let $w_{i,j}^{(1)}$ be the $i$ th weight in the $j$ th neuron of the first hidden layer, $1 \leq i \leq M$ and $1 \leq j \leq m$ , where $m$ is the number of hidden neurons. Let $b_j$ be the bias term of the $j$ th neuron in the hidden layer. Let $w_{i,j}^{(2)}$ be the $i$ th weight in the $j$ th neuron of the output layer, so $1 \leq i \leq m$ and $1 \leq j \leq M$ . We assume the same initialization scheme. That is, $w_{i,j}^{(1)}$ are initialized from iid Gaussian and $b_j$ are initialized to 0, and they are updated during training, whereas $w_{i,j}^{(2)}$ are initialized from iid Rademacher random variables and are not updated during training. In the derivation of the NTK below, we let $\mathbf{W}$ to be the vector of all trainable weights and biases, $w_{i,j}^{(1)}$ and $b_j$ , enumerated in an (arbitrary) fixed order. This allows us to write $\mathbf{W} = (w_1, \ldots, w_K)^{\top}$ , where $K = m(M + 1)$ . + +We assume that the gradient flow algorithm is used to train the NN, i.e., $\frac{d\mathbf{W}}{dt} = -\frac{\partial\Phi}{\partial\mathbf{W}}$ . We define the vector of labels by + +$$ +\mathbf {y} _ {i} = \left(\mathcal {L} f _ {i} (\mathbf {x} _ {1}), \ldots , \mathcal {L} f _ {i} (\mathbf {x} _ {M})\right) ^ {\top}, \qquad \mathbf {y} = \left(\mathbf {y} _ {1} ^ {\top}, \ldots , \mathbf {y} _ {N} ^ {\top}\right) ^ {\top}. +$$ + +Similarly, we define the vector of the NN outputs by + +$$ +\mathbf {u} _ {i} (\mathbf {W}) = \left(\mathcal {N} _ {1} (f _ {i}; \mathbf {W}), \dots , \mathcal {N} _ {M} (f _ {i}; \mathbf {W})\right) ^ {\top}, \qquad \mathbf {u} = \left(\mathbf {u} _ {1} ^ {\top}, \dots , \mathbf {u} _ {N} ^ {\top}\right) ^ {\top}. +$$ + +Our goal is to understand $\frac{d}{dt} (\mathbf{y} - \mathbf{u})$ and write it in terms of $\mathbf{y} - \mathbf{u}$ . To this end, we first consider + +$$ +\frac {d \left(\mathbf {y} _ {i} - \mathbf {u} _ {i} (\mathbf {W})\right)}{d t} = - \frac {d \mathbf {u} _ {i} (\mathbf {W})}{d t} = - \frac {d \mathbf {u} _ {i} (\mathbf {W})}{d \mathbf {W}} \frac {d \mathbf {W}}{d t} = \frac {d \mathbf {u} _ {i} (\mathbf {W})}{d \mathbf {W}} \frac {\partial \Phi (\mathbf {W})}{\partial \mathbf {W}}. \tag {81} +$$ + +Denote by $w_{k}$ the $k$ th entry of $\mathbf{W}$ , where $1 \leq k \leq K$ . Then, by the chain rule, the $k$ th entry of $\frac{\partial \Phi(\mathbf{W})}{\partial \mathbf{W}}$ can be written as + +$$ +\begin{array}{l} \left(\frac {\partial \Phi (\mathbf {W})}{\partial \mathbf {W}}\right) _ {k} = \frac {\partial \Phi (\mathbf {W})}{\partial w _ {k}} = \frac {1}{N} \sum_ {i ^ {\prime} = 1} ^ {N} \frac {\partial}{\partial w _ {k}} D \left((\mathcal {L} f _ {i ^ {\prime}}) (\mathbf {x}), \mathcal {N} (f _ {i ^ {\prime}}) (\mathbf {x})\right) \\ = \frac {1}{N} \sum_ {i ^ {\prime} = 1} ^ {N} \left[ \frac {\partial D \left((\mathcal {L} f _ {i ^ {\prime}}) (\mathbf {x}) , \mathcal {N} (f _ {i ^ {\prime}}) (\mathbf {x})\right)}{\partial \mathcal {N} (f _ {i ^ {\prime}} ; \mathbf {W})} \right] \left[ \frac {\partial \mathcal {N} (f _ {i ^ {\prime}} ; \mathbf {W})}{\partial w _ {k}} \right] \\ = - \frac {1}{N} \sum_ {i ^ {\prime} = 1} ^ {N} \left[ \frac {\partial \mathcal {N} _ {1} (f _ {i ^ {\prime}})}{\partial w _ {k}} \dots \frac {\partial \mathcal {N} _ {M} (f _ {i ^ {\prime}})}{\partial w _ {k}} \right] \mathbf {P} \left[ \begin{array}{c} \mathcal {L} f _ {i ^ {\prime}} (\mathbf {x} _ {1}) - \mathcal {N} _ {1} (f _ {i ^ {\prime}}) \\ \vdots \\ \mathcal {L} f _ {i ^ {\prime}} (\mathbf {x} _ {M}) - \mathcal {N} _ {M} (f _ {i ^ {\prime}}) \end{array} \right]. \\ \end{array} +$$ + +Hence, we have + +$$ +\frac {\partial \Phi (\mathbf {W})}{\partial \mathbf {W}} = - \frac {1}{N} \sum_ {i ^ {\prime} = 1} ^ {N} \left[ \begin{array}{c c c} \frac {\partial \mathcal {N} _ {1} \left(f _ {i ^ {\prime}}\right)}{\partial w _ {1}} & \dots & \frac {\partial \mathcal {N} _ {M} \left(f _ {i ^ {\prime}}\right)}{\partial w _ {1}} \\ \vdots & \ddots & \vdots \\ \frac {\partial \mathcal {N} _ {1} \left(f _ {i ^ {\prime}}\right)}{\partial w _ {K}} & \dots & \frac {\partial \mathcal {N} _ {M} \left(f _ {i ^ {\prime}}\right)}{\partial w _ {K}} \end{array} \right] \mathbf {P} \left[ \begin{array}{c} \mathcal {L} f _ {i ^ {\prime}} (\mathbf {x} _ {1}) - \mathcal {N} _ {1} \left(f _ {i ^ {\prime}}\right) \\ \vdots \\ \mathcal {L} f _ {i ^ {\prime}} (\mathbf {x} _ {M}) - \mathcal {N} _ {M} \left(f _ {i ^ {\prime}}\right) \end{array} \right]. \tag {82} +$$ + +Now, combining eq. (81) with eq. (82), we have + +$$ +\begin{array}{l} - \frac {d \mathbf {u} _ {i} (\mathbf {W})}{d t} = - \frac {1}{N} \left[ \begin{array}{c c c} \frac {\partial \mathcal {N} _ {1} (f _ {i})}{\partial w _ {1}} & \dots & \frac {\partial \mathcal {N} _ {1} (f _ {i})}{\partial w _ {K}} \\ \vdots & \ddots & \vdots \\ \frac {\partial \mathcal {N} _ {M} (f _ {i})}{\partial w _ {1}} & \dots & \frac {\partial \mathcal {N} _ {M} (f _ {i})}{\partial w _ {K}} \end{array} \right] \times \\ \left(\sum_ {i ^ {\prime} = 1} ^ {N} \underbrace {\left[ \begin{array}{c c c} \frac {\partial \mathcal {N} _ {1} (f _ {i ^ {\prime}})}{\partial w _ {1}} & \cdots & \frac {\partial \mathcal {N} _ {M} (f _ {i ^ {\prime}})}{\partial w _ {1}} \\ \vdots & \ddots & \vdots \\ \frac {\partial \mathcal {N} _ {1} (f _ {i ^ {\prime}})}{\partial w _ {K}} & \cdots & \frac {\partial \mathcal {N} _ {M} (f _ {i ^ {\prime}})}{\partial w _ {K}} \end{array} \right]} _ {\mathbf {J} _ {i ^ {\prime}}} \mathbf {P} \left[ \begin{array}{c} \mathcal {L} f _ {i ^ {\prime}} (\mathbf {x} _ {1}) - \mathcal {N} _ {1} (f _ {i ^ {\prime}}) \\ \vdots \\ \mathcal {L} f _ {i ^ {\prime}} (\mathbf {x} _ {M}) - \mathcal {N} _ {M} (f _ {i ^ {\prime}}) \end{array} \right]\right), \\ \end{array} +$$ + +which gives us + +$$ +\frac {d (\mathbf {y} - \mathbf {u} (\mathbf {W}))}{d t} = - \frac {d \mathbf {u} (\mathbf {W})}{d t} = - \frac {1}{N} \left[ \begin{array}{c c c} \mathbf {J} _ {1} ^ {\top} \mathbf {J} _ {1} & \dots & \mathbf {J} _ {1} ^ {\top} \mathbf {J} _ {N} \\ \hline \vdots & \ddots & \vdots \\ \hline \mathbf {J} _ {N} ^ {\top} \mathbf {J} _ {1} & \dots & \mathbf {J} _ {N} ^ {\top} \mathbf {J} _ {N} \end{array} \right] (\mathbf {I} _ {N} \otimes \mathbf {P}) (\mathbf {y} - \mathbf {u}). \tag {83} +$$ + +The derivation so far does not rely on the architecture of the NN. In fact, it holds for the loss function $\Phi$ defined in eq. (80) with any abstract function $\mathcal{N}(f_i; \mathbf{W})$ . Now, we exploit the NN architecture to study $\mathbf{J}_i^\top \mathbf{J}_{i'}$ . Consider the $(j, j')$ th entry of $\mathbf{J}_i^\top \mathbf{J}_{i'}$ . We have + +$$ +\left(\mathbf {J} _ {i} ^ {\top} \mathbf {J} _ {i ^ {\prime}}\right) _ {(j, j ^ {\prime})} = \frac {1}{m} \sum_ {k = 1} ^ {m} w _ {k, j} ^ {(2)} w _ {k, j ^ {\prime}} ^ {(2)} \frac {f _ {i} (\mathbf {x}) ^ {\top} f _ {i ^ {\prime}} (\mathbf {x}) + 1}{2} \mathbb {1} _ {\left\{f _ {i} (\mathbf {x}) ^ {\top} \mathbf {w} _ {k} ^ {(1)} + b _ {k} ^ {(1)} \geq 0, f _ {i ^ {\prime}} (\mathbf {x}) ^ {\top} \mathbf {w} _ {k} ^ {(1)} + b _ {k} ^ {(1)} \geq 0 \right\}}, \tag {84} +$$ + +where $\mathbf{w}_k^{(1)} = (w_{1,k}^{(1)},\ldots ,w_{M,k}^{(1)})$ is the collection of weights on the $k$ th hidden neuron. Now, note that $w_{k,j}^{(2)}w_{k,j'}^{(2)} = 1$ if $j = j'$ and is a Rademacher random variable when $j\neq j'$ . Hence, by the way we initialize $w_{i,j}^{(1)}$ , we have + +$$ +\mathbf {J} _ {i} ^ {\top} \mathbf {J} _ {i ^ {\prime}} \xrightarrow {m \rightarrow \infty} \left[ \frac {\left(f _ {i} (\mathbf {x}) ^ {\top} f _ {i ^ {\prime}} (\mathbf {x}) + 1\right)\left(\pi - \operatorname {a r c c o s} \left(f _ {i} (\mathbf {x}) ^ {\top} f _ {i ^ {\prime}} (\mathbf {x})\right)\right)}{4 \pi} \right] \mathbf {I} _ {M}, \tag {85} +$$ + +where the convergence is entry-wise. Now, suppose we define the $N\times N$ matrix $\mathbf{H}^{\infty}$ as + +$$ +H _ {i, i ^ {\prime}} ^ {\infty} = \frac {\left(f _ {i} (\mathbf {x}) ^ {\top} f _ {i ^ {\prime}} (\mathbf {x}) + 1\right) \left(\pi - \operatorname {a r c c o s} \left(f _ {i} (\mathbf {x}) ^ {\top} f _ {i ^ {\prime}} (\mathbf {x})\right)\right)}{4 \pi}. \tag {86} +$$ + +That is, we define $\mathbf{H}^{\infty}$ as in the function learning case, except that the inputs are $\{f_i(\mathbf{x})\}_{i=1}^{N}$ instead of $\{\mathbf{x}_i\}_{i=1}^n$ . By eq. (85), we have + +$$ +\left[\begin{array}{c c c}\mathbf {J} _ {1} ^ {\top} \mathbf {J} _ {1}&\dots&\mathbf {J} _ {1} ^ {\top} \mathbf {J} _ {N}\\\hline \vdots&\ddots&\vdots\\\hline \mathbf {J} _ {N} ^ {\top} \mathbf {J} _ {1}&\dots&\mathbf {J} _ {N} ^ {\top} \mathbf {J} _ {N}\end{array}\right] \xrightarrow {m \rightarrow \infty} \mathbf {H} ^ {\infty} \otimes \mathbf {I} _ {M}, \tag {87} +$$ + +where the convergence is entrywise. Hence, if we discretize the gradient flow algorithm and apply gradient descent with step size $\eta$ , then by eq. (83) and eq. (87), we expect that + +$$ +\mathbf {y} _ {i} - \mathbf {u} _ {i} (k) \approx \left(\mathbf {y} _ {i} - \mathbf {u} _ {i} (k - 1)\right) - \frac {\eta}{N} \sum_ {i ^ {\prime} = 1} ^ {N} H _ {i, i ^ {\prime}} ^ {\infty} \mathbf {P} \left(\mathbf {y} _ {i ^ {\prime}} - \mathbf {u} _ {i ^ {\prime}} (k - 1)\right), \tag {88} +$$ + +or otherwise written more compactly, + +$$ +\mathbf {y} - \mathbf {u} (k) \approx \left(\mathbf {I} _ {M N} - \frac {\eta}{N} \left(\mathbf {H} ^ {\infty} \otimes \mathbf {I} _ {M}\right) \left(\mathbf {I} _ {N} \otimes \mathbf {P}\right)\right) ^ {k} \mathbf {y} \tag {89} +$$ + +if the variance in the initialization is small enough. + +Given this characterization of the residual equation 89, we can see how the usage of the Sobolev loss plays a role in tuning frequency bias. Suppose we decompose the residual vector into + +$$ +\mathbf {y} _ {i} - \mathbf {u} _ {i} (k) = \sum_ {\ell = 0} ^ {\infty} \sum_ {p = 1} ^ {N (d, \ell)} \hat {\gamma} _ {i} ^ {\ell , p} \mathbf {Y} _ {\ell , p}, +$$ + +where $\mathbf{Y}_{\ell,p} = (Y_{\ell,p}(\mathbf{x}_1), \ldots, Y_{\ell,p}(\mathbf{x}_M))^{\top}$ is the evaluation of the spherical harmonic on $\mathbb{S}^{d-1}$ . Then, $\hat{\gamma}_i^{\ell,p}$ measures the amount of frequency loss associated with the $(\ell,p)$ th frequency in learning the function $f_i$ . Let $\hat{\gamma}^{\ell,p}(k) = (\hat{\gamma}_i^{\ell,p}(k), \ldots, \hat{\gamma}_N^{\ell,p}(k))^{\top}$ . The size of $\hat{\gamma}^{\ell,p}(k)$ measures the amount of overall frequency- $\ell$ components (in the $p$ th direction) in the residuals after the $k$ th iteration. Assume $\omega_\ell$ is an eigenvalue of $\mathbf{P}$ associated with the eigenspace that is approximately spanned by $\{\mathbf{Y}_{\ell,p}\}_{p=1}^{N(d,\ell)}$ . Note that this is the case when $\mathbf{P} = \mathbf{P}_s$ is associated with the squared- $H^s$ loss on $\mathbb{S}^{d-1}$ . Then, by eq. (88), we have + +$$ +\hat {\gamma} ^ {\ell , p} (k) \approx \left(\mathbf {I} _ {N} - \frac {\eta}{N} \omega_ {\ell} \mathbf {H} ^ {\infty}\right) ^ {k} \hat {\mathbf {y}} ^ {\ell , p}, \tag {90} +$$ + +where $\hat{\mathbf{y}}^{\ell,p} = (\hat{y}_1^{\ell,p},\dots,\hat{y}_N^{\ell,p})$ is defined by the decomposition + +$$ +\mathbf {y} _ {i} = \sum_ {\ell = 0} ^ {\infty} \sum_ {p = 1} ^ {N (d, \ell)} \hat {y} _ {i} ^ {\ell , p} \mathbf {Y} _ {\ell , p}. +$$ + +Equation (90) demonstrates that if $\omega_{\ell}$ is relatively large for bigger $\ell$ (e.g., when we use the squared- $H^{s}$ loss with a large $s > 0$ ), then we expect that $\gamma^{\ell,p}(k)$ decays much faster for high frequencies than the low ones, and vice versa. This connects frequency bias in operator learning to the spectral properties of $\mathbf{P}_{s}$ . We studied and justified the phenomena in the autoencoder experiment in Sec. 6.3. + +# H COMPUTATION OF QUADRATURE WEIGHTS + +In practice, the training dataset usually does not come with a carefully designed quadrature rule. Hence, we inevitably need to compute a set of quadrature weights before training the NN. In this section, we briefly discuss methods for computing positive quadrature weights. + +Given a set of points $\{\mathbf{x}_i\}_{i=1}^n$ on $\mathbb{S}^{d-1}$ , we wish to construct a quadrature rule so that + +$$ +I _ {n} (f) := \sum_ {i = 1} ^ {n} c _ {i} f (\mathbf {x} _ {i}) \approx \int_ {\mathbb {S} ^ {d - 1}} f (\mathbf {x}) d \mathbf {x} +$$ + +for sufficiently smooth $f$ , where $c_{i} > 0$ are positive quadrature weights. One approach that could give us a very accurate quadrature rule is to guarantee that + +$$ +I _ {n} (f) = \int_ {\mathbb {S} ^ {d - 1}} f (\mathbf {x}) d \mathbf {x}, \quad f \in \Pi_ {\ell} ^ {d}, \tag {91} +$$ + +where $\dim(\Pi_{\ell}^{d}) \leq n$ . The one-dimensional case of such quadrature rules was studied in (Austin & Trefethen, 2017; Yu & Townsend, 2022) and the general higher-dimensional case was analyzed in (Mhaskar et al., 2000; Dai & Xu, 2013). Given any dataset $\{\mathbf{x}_i\}_{i=1}^n$ and $\ell$ so that $\dim(\Pi_{\ell}^{d}) \leq n$ , one cannot guarantee the existence of a positive quadrature rule satisfying eq. (91) (Mhaskar et al., 2000; Dai & Xu, 2013), even when the distribution of $\{\mathbf{x}_i\}_{i=1}^n$ is very regular (Yu & Townsend, 2022). On the other hand, by choosing $\ell$ to be small, we can eventually find an $\ell$ for which eq. (91) holds. When such a positive quadrature rule exists, Mhaskar et al. (2000) proposed to solve the + +following feasible constrained quadratic program + +$$ +\begin{array}{l} \min _ {c _ {i}} \sum_ {i = 1} ^ {n} c _ {i} ^ {2} \\ \begin{array}{l l} \text {s . t .} & c _ {i} > 0 \quad \forall 1 \leq i \leq n, \end{array} \\ \sum_ {i = 1} ^ {n} c _ {i} Y _ {j, p} (\mathbf {x} _ {i}) = \int_ {\mathbb {S} ^ {d - 1}} Y _ {j, p} (\mathbf {x}) d \mathbf {x} \quad \forall 0 \leq j \leq \ell , 1 \leq p \leq N (d, j). \\ \end{array} +$$ + +While eq. (91) gives us a guarantee on the accuracy of the quadrature rule (provided $\ell$ is not too small), it is not always practical to compute the quadrature weights in this way. Indeed, if $d$ is large, then we need a tremendous amount of points to guarantee that $\dim(\Pi_{\ell}^{d}) \leq n$ even for a small $\ell$ . Also, if we have too many data points, then the quadratic program can get infeasible to solve. Hence, we need some other methods for computing quadrature weights that, albeit less accurate, can be applied more cheaply to general datasets. One of the many possible approaches is to do kernel density estimation (Rosenblatt, 1956; Parzen, 1962). To do so, we fix a positive kernel $\mathcal{K}(\mathbf{x}, \mathbf{y}) = \mathcal{K}(\arccos(\mathbf{x}^{\top} \mathbf{y}))$ defined on $\mathbb{S}^{d-1} \times \mathbb{S}^{d-1}$ . A common choice of $\mathcal{K}$ can be the Gaussian density function of standard deviation 1 centered at 0. For each $h > 0$ , we then define a function $p_h$ on $\mathbb{S}^{d-1}$ by + +$$ +p _ {h} (\mathbf {x}) = \sum_ {i = 1} ^ {n} \mathcal {K} \left(\frac {\operatorname {a r c c o s} \left(\mathbf {x} ^ {\top} \mathbf {x} _ {i}\right)}{h}\right). +$$ + +The bandwidth $h$ is a hyperparameter, and with an appropriate $h$ , the function $p_h$ is an (unnormized) estimate of the density function of the distribution of nodes. Hence, by setting + +$$ +c _ {i} = A _ {d} \frac {p _ {h} ^ {- 1} \left(\mathbf {x} _ {i}\right)}{\sum_ {j = 1} ^ {n} p _ {h} ^ {- 1} \left(\mathbf {x} _ {j}\right)}, \tag {92} +$$ + +we obtain a positive quadrature rule that approximates the integral of smooth functions on $\mathbb{S}^{d - 1}$ . \ No newline at end of file diff --git a/tuningfrequencybiasinneuralnetworktrainingwithnonuniformdata/images.zip b/tuningfrequencybiasinneuralnetworktrainingwithnonuniformdata/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..e054885eb0402bc9f8a1262046518d2caf27c12b --- /dev/null +++ b/tuningfrequencybiasinneuralnetworktrainingwithnonuniformdata/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:93ef781ea9271b4b3ea13972e1ce41130b6957c76198d187634421b3f8689c31 +size 2445054 diff --git a/tuningfrequencybiasinneuralnetworktrainingwithnonuniformdata/layout.json b/tuningfrequencybiasinneuralnetworktrainingwithnonuniformdata/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..4f3c4192060796357943d561f6c1839fa50d4849 --- /dev/null +++ b/tuningfrequencybiasinneuralnetworktrainingwithnonuniformdata/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d04ecb29e5b360a6f459883e706bb571b1dd6b34c85e1f41e914c47e6e01bcae +size 2275689 diff --git a/typet5seq2seqtypeinferenceusingstaticanalysis/8f9d0ff5-b137-4e5f-80da-1d5125258b09_content_list.json b/typet5seq2seqtypeinferenceusingstaticanalysis/8f9d0ff5-b137-4e5f-80da-1d5125258b09_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..58c1f829c48dd85033774138848ee0ba7606aa91 --- /dev/null +++ b/typet5seq2seqtypeinferenceusingstaticanalysis/8f9d0ff5-b137-4e5f-80da-1d5125258b09_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8c79a92f3419c70b835032c74c1e9d63b733e1c20d599c96812675873704a32a +size 101772 diff --git a/typet5seq2seqtypeinferenceusingstaticanalysis/8f9d0ff5-b137-4e5f-80da-1d5125258b09_model.json b/typet5seq2seqtypeinferenceusingstaticanalysis/8f9d0ff5-b137-4e5f-80da-1d5125258b09_model.json new file mode 100644 index 0000000000000000000000000000000000000000..d2ca7a26529ba0efa2f65d2c42441d113d06664e --- /dev/null +++ b/typet5seq2seqtypeinferenceusingstaticanalysis/8f9d0ff5-b137-4e5f-80da-1d5125258b09_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a8bb0f5f1489e6412b68170974be03a314de05bd9e14e875d536ddb4915f0af +size 122985 diff --git a/typet5seq2seqtypeinferenceusingstaticanalysis/8f9d0ff5-b137-4e5f-80da-1d5125258b09_origin.pdf b/typet5seq2seqtypeinferenceusingstaticanalysis/8f9d0ff5-b137-4e5f-80da-1d5125258b09_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..176c632d04684eb187fe230dec890a5281d5d1c5 --- /dev/null +++ b/typet5seq2seqtypeinferenceusingstaticanalysis/8f9d0ff5-b137-4e5f-80da-1d5125258b09_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:59aaaaa0b007d60513ad0e392c97c72ff292d1b7c8f86ec4088b7cbd8d742aba +size 4358884 diff --git a/typet5seq2seqtypeinferenceusingstaticanalysis/full.md b/typet5seq2seqtypeinferenceusingstaticanalysis/full.md new file mode 100644 index 0000000000000000000000000000000000000000..0835c811abc10b169e538c32b5f011e5b8be4920 --- /dev/null +++ b/typet5seq2seqtypeinferenceusingstaticanalysis/full.md @@ -0,0 +1,425 @@ +# TYPET5: SEQ2SEQ TYPE INFERENCE USING STATIC ANALYSIS + +Jiayi Wei, Greg Durrett, Isil Dillig + +Department of Computer Science + +University of Texas at Austin + +{jiayi,gdurrett,isil}@cs.utexas.edu + +# ABSTRACT + +There has been growing interest in automatically predicting missing type annotations in programs written in Python and JavaScript. While prior methods have achieved impressive accuracy when predicting the most common types, they often perform poorly on rare or complex types. In this paper, we present a new type inference method that treats type prediction as a code infilling task by leveraging CodeT5, a state-of-the-art seq2seq pre-trained language model for code. Our method uses static analysis to construct dynamic contexts for each code element whose type signature is to be predicted by the model. We also propose an iterative decoding scheme that incorporates previous type predictions in the model's input context, allowing information exchange between related code elements. Our evaluation shows that the proposed approach, TypeT5, not only achieves a higher overall accuracy (particularly on rare and complex types) but also produces more coherent results with fewer type errors—while enabling easy user intervention. + +# 1 INTRODUCTION + +In languages like Python and JavaScript, the lack of a static type system makes it harder to maintain and analyze codebases. To address this issue, gradual typing (Siek & Taha, 2007) was proposed to allow type annotations to be incrementally added to untyped codebases, thereby marrying the benefits of static typing with the convenience of easy prototyping. As a result, many mainstream programming languages, including Python and JavaScript, have already adopted this idea, and researchers have also developed learning-based techniques to predict missing type annotations (Raychev et al., 2015; Hellendoorn et al., 2018; Wei et al., 2020; Pradel et al., 2020; Allamanis et al., 2020; Pandi et al., 2020; Jesse et al., 2021; Mir et al., 2022; Jesse et al., 2022; Peng et al., 2022). + +Meanwhile, with the advent of large-scale pretraining and the explosion of transformer architectures, seq2seq models have proven to be very effective for programming tasks like code comments generation (Panthaplackel et al., 2020), completion (Wang et al., 2021; Ahmad et al., 2021), and synthesis (Li et al., 2022). One particularly attractive feature of such models is that, due to the use of subword tokenization (Gage, 1994; Schuster & Nakajima, 2012; Sennrich et al., 2016), they can generate arbitrary code expressions—including novel identifier names and AST structures—at test time. However, unlike code completion tasks that can often work well with just the surrounding code as context, effective type inference generally requires non-local information, including code fragments that may belong to an entirely different file. For instance, consider a function $f$ that passes a generically named parameter $x$ directly into another function $g$ . It can be hard to figure out the type of $x$ by just looking at $f$ 's body. When programmers find themselves in such a situation, they often inspect the callers and callees of $f$ , sometimes even transitively, in order to figure out the intended type of $x$ . Thus, in many cases, looking at the immediate context of a given variable may be insufficient for accurately predicting its type. + +Our approach, TypeT5, solves this challenge by using static analysis to identify which parts of the codebase are useful for each prediction. In particular, we construct a so-called usage graph, where nodes correspond to code elements (i.e., functions or variables whose types we want to predict) and edges denote a potential user-use relation between them. Given such a graph, we then encode the users and usees of a given code element in a form that resembles normal code and feeds them as + +additional contexts to the transformer model. To take full advantage of the seq2seq paradigm, we also propose an iterative decoding scheme that pass in previous type predictions using the contexts, allowing information to be propagated between distant code elements across the entire codebase. + +We have implemented TypeT5 on top of the popular CodeT5 model and use it to synthesize type annotations for untyped Python code. Our evaluation compares TypeT5 with three state-of-the-art type inference tools (Allamanis et al., 2020; Mir et al., 2022; Peng et al., 2022) and a CodeT5 baseline that does not leverage static analysis. The results show that TypeT5 outperforms all baselines by a large margin, while drastically improving the accuracy on rare and complex types. Our ablation studies confirm the benefits of the various modifications we made to the CodeT5 baseline, while an additional type checking experiment shows that the proposed iterative decoding scheme also improves the coherence of the produced type assignments, resulting in fewer type constraint violations. Finally, we explore an alternative use case of our model, where the user interactively inspects the model's predictions and makes necessary corrections. The result demonstrates the usefulness of our approach as a developer tool to annotate entirely untyped projects—on average, the user only needs to correct one in every five model predictions. + +To summarize, this papers makes the following contributions: + +- We apply CodeT5 to infer Python type annotations and show significant improvement over prior approaches. To our knowledge, this is the first ML-based technique capable of predicting both parametric and user-defined types. +- We improve the vanilla CodeT5 model by applying static analysis techniques to help the model reason about information beyond local contexts, further boosting its performance. +- We propose an iterative decoding scheme that particularly helps with coherence, as measured by the number of type errors reported by the type checker. We additionally propose the novel setting that combines the seq2seq decoding scheme with user intervention. + +# 2 OVERVIEW + +In this section, we motivate the design of TypeT5 using the example shown in Figure 1. This example features a method predict and two functions eval_on_dataset and chuck_srcs, each of which is implemented in a different file. Given an untyped version of this code, our goal is to automatically infer the type annotations (highlighted in green). This example is challenging for existing type inference techniques due to the heavy use of user-defined types (such as ChunkedDataset, PythonType, and ModelWrapper) and complex parametric type like dict[int, list[PythonType]]. + +![](images/b9b23c074761c1344732f6a48c6b48fd519fdcad9a2026729f10940f71b4889f.jpg) +Figure 1: Simplified code snippets taken from our own codebase. The eval_on_dataset function first calls the chunk_srcs function to convert the given textual data into equally sized chunks, and it then feed them into the ModelWrapper.predict method. + +![](images/c6b39fe17f6a6e6cd31276683872c4a2e139c248fbc4f9a2c54b1353119d96d4.jpg) + +![](images/64a7d3644c59ac686aa1660550e10c29b8a2a477c0d78a837d72f42b9e5245cd.jpg) +Figure 2: How CodeT5 encodes and decodes source code using BPE. Marker tokens (highlighted in blue) indicate gaps (input) and their corresponding fillers (output). + +![](images/f4d1e55a5a03b7e776fdaf7024d2c309159c1f8c6bff755c5000c30d8490b70f.jpg) +Figure 3: The two-pass iterative decoding process. + +Type inference as code infilling In this work, we advocate a new approach that views type inference as an instance of code infilling. Because type annotations can be viewed as missing code fragments, we fine-tune a state-of-the-art code infilling model, namely CodeT5, as our starting point. Since CodeT5 produces sequences of subword tokens using Byte Pair Encoding (Radford et al.; Gage, 1994) (see Figure 2), it can, in principle, predict arbitrary code snippets to fill masked gaps—including type annotations with complex parametric types and user-defined classes. + +Incorporating context through static analysis By using surrounding code as the prediction context, our fine-tuned version of CodeT5 can relatively easily predict the correct type annotations of some of the variables. For example, based on the names and default values of n_seqs (model.py, line 7) or window_size (eval.py, line 4), CodeT5 can figure out the correct types of these parameters. However, for other parameters such as model in line 2 of eval.py, the surrounding context does not contain enough information to make a reasonable prediction. To see why, observe that ModelWrapper is a new class defined in a separate file, so, (1) it has never been seen during training, and (2) its definition is not available as part of the context. Similarly, it is also very difficult to predict the return type of eval_on_dataset since it directly returns the result of model.predict, whose definition is also not available to the model. + +To address this issue, our approach enhances the prediction context of CodeT5 using static analysis. The details of how we construct the context from static analysis will be described in subsection 3.3, but, in a nutshell, our approach analyzes the user-see relations among code elements and pulls in the relevant definitions into the context. For example, when the model is making a prediction for eval_on_dataset, the context includes the definitions of DefaultWindow and predict, which are defined in ModelWrapper and invoked at line 6 and line 12 of eval.py, respectively. + +TypeT5 architecture As there are many dependencies between different code elements, making independent type predictions for each code element is not ideal. For example, to infer the return type of eval_on_dataset, we would need to know the return type of ModelWrapper.predict, which depends on the return type of the self.predict_on_batch (model.py, line 12). However, since there is limited context that can be fed to the model, it is not feasible to include all transitive users and uses. To deal with this problem, TypeT5 utilizes an iterative decoding scheme that allows conditioning on previous type predictions. In more detail, our decoding scheme first sorts the user-see graph topologically and then performs two sequential prediction passes, first from usee to users and then going in the reverse direction, as illustrated in Figure 3. To see why both of these directions are useful, observe that the return type of eval_on_dataset depends on predict, which in turn depends on predict_on_batch. Thus, propagating information from callees to callers is clearly useful. Conversely, consider predicting the type of data, the first parameter of predict. Since the return value of chunk_srcs is passed as the first argument of predict, propagating information in the reverse direction can also be helpful. + +![](images/78a77af9eb5db8b266531991e6462d9727aaa464b0c82398321b331a78a31074.jpg) +Figure 4: The usage graph corresponding to the code snippets in Figure 1. WindowArgs and ChunkedDataset are assumed to be defined elsewhere in the same project. + +# 3 METHODS + +# 3.1 USING CODET5 FOR TYPE PREDICTION + +We formulate type prediction as a sequence-to-sequence (seq2seq) task. Let $\mathbf{u} = (u_{1},\dots,u_{n})$ represent a sequence of code tokens, where each token is a single untyped code element $e$ (function or variable). We insert into $\mathbf{u}$ indexed marker tokens () at each point where we wish to predict types and let the model predict $t = (t_{1},\ldots ,t_{m})$ , the token sequence that encodes types for the marked locations in $\mathbf{u}$ . Note that $t$ only contains the types, no other code tokens, in the format [type 1 tokens] [type 2 tokens], etc. We use the same tokenizer as CodeT5, which allows encoding any Python expression as a (typically short) sequence of subword tokens. + +Our baseline CodeT5 model is a Transformer seq2seq model $P(t \mid u, \bar{u})$ placing a distribution over type sequences $t$ given the raw code sequence $u$ and its surrounding code $\bar{u}$ . This process is shown in Figure 2, and $\bar{u}$ is omitted for clarity. + +Our improved model, TypeT5, replaces the surrounding code $\bar{u}$ with a context constructed from static analysis, which we denote as $s$ . Thus, we can write the model as $P(\pmb{t} \mid \pmb{u}, s)$ . Note that, in both models, we remove all comments and Python docstrings as a pre-processing step, as was done in prior work. We now show how $s$ is constructed from static analysis. + +# 3.2 BUILDING THE USAGE GRAPH + +To overcome the limitations of using only the surrounding code as context, our approach relies on static analysis to extract relevant global information about the codebase. In particular, our analysis constructs a usage graph, whose nodes correspond to code elements and edges represent a direct usage. For example, if $x$ and $y$ are both functions, an edge from $x$ to $y$ means that $x$ calls $y$ . Similarly, for variables, an edge from $x$ to $y$ means that the value of $x$ depends on $y$ . + +The usage graph for our previous example is shown in Figure 4. We show two types of usages: a certain usage, shown as solid arrows, and a potential usage, shown as dotted arrows. A certain usage is one that can be statically determined without knowing the types of the involved variables. For example, the global function chunk_srcs is directly used by eval_on_dataset, and we also know that predict_on_batch is called by predict (self method call on line 12). For other cases like a non-self attribute access or method call, the target depends on the type of the receiver, so we first collect all attributes and methods with a matching name from the current project and then generate a potential usage for each of them. We give more details of usage graph construction in subsection A.1. + +# 3.3 CONSTRUCTING MODEL INPUTS + +TypeT5 leverages the usage graph $\mathcal{G}$ to construct the inputs to our model. In particular, we define the model input for a code element $e$ to be a concatenation of four parts: the preamble $s_{\mathrm{pre}}$ , uses $s_{\mathrm{usee}}$ , main code $u$ , and users $s_{\mathrm{user}}$ , which are constructed as follows (see subsection A.9 for a concrete example). + +- Preamble: The main purpose of $s_{\mathrm{pre}}$ is to help the model map each local name to the definition that it is referring to, so the preamble includes all import statements. Additionally, to help the model see which types are available in the current scope, the preamble also includes the headers of all class definitions as well as all the type variable declarations from the current file. +- Main code: For the code element $e$ of interest, we use its definition to construct $u$ . If $e$ is a function, $u$ is just its source code, and if $e$ is a variable, $u$ includes all top-level assignment statements in which $e$ appears as the left hand side. Additionally, if $e$ is a method or attribute of a class $C$ , we also indent $u$ and prepend it with the header of $C$ , as shown in Figure 7. +- Users: Given the usage graph $\mathcal{G}$ , we construct $s_{\mathrm{user}}$ by including the source tokens of all elements from users $(\mathcal{G}, e)$ . Since these elements can come from different source files, we also pretend each element with a special comment denoting the Python module it comes from. Note that these elements can optionally contain the types predicted by our TypeT5 model, as described later in subsection 3.4. +- Uses: $s_{\text{usee}}$ contains not just the direct users of $e$ , but also anything that is used in the user context $s_{\text{user}}$ . i.e., $s_{\text{usee}}$ contains the elements from uses $(\mathcal{G}, e) \cup \bigcup_{e' \in \text{users}(\mathcal{G}, e)} \text{uses}(\mathcal{G}, e')$ . Since this generally contains many more elements than $s_{\text{user}}$ , we only use the (typed or untyped) signatures of the elements to construct $s_{\text{usee}}$ . + +We limit the total input size to be at most 4096 subword tokens and cut off any exceeding tokens from both left and right, centered around the main code. Context elements involving certain usages are arranged to be closer to the center so that they are always prioritized over potential usages. + +# 3.4 ITERATIVE DECODING INFERENCE + +We now describe how to conduct inference in our base model as well as our context-augmented model using an iterative decoding scheme. + +CodeT5 decoding: Given our trained model $P(\pmb{t} \mid \pmb{u}, \bar{\pmb{u}})$ , we can infer a most likely set of types $\pmb{t}$ for $\pmb{u}$ (with surrounding context $\bar{\pmb{u}}$ ) using beam search. Our implementation performs joint prediction of the output types for a single code block $\pmb{u}$ , since later types in the block condition on the predictions of earlier types. However, note that both $\pmb{u}$ and $\bar{\pmb{u}}$ are always completely untyped code: while we condition on previous types as we predict, these are not inserted into the prediction context for the next element.1 + +TypeT5 iterative decoding: Part of our motivation for including the context $s$ is to exploit its type information at inference time. Crucially, this requires $s$ to be typed. However, the contexts that are drawn from the original codebase are not typed, so TypeT5 iteratively adds type signatures to these contexts using its own predictions. Let $\mathcal{M}$ be the type assignment produced by the model, which maps each code element $e$ to its predicted type $t_e$ , and denote $\mathcal{M}(s)$ as the context obtained by annotating the elements in $s$ according to $\mathcal{M}$ . Starting with an empty $\mathcal{M}$ (which leaves any context $s$ unchanged), TypeT5 then iteratively updates $\mathcal{M}$ using an iterative decoding scheme that traverses the usage graph $\mathcal{G}$ twice, as shown in Figure 3. The first prediction pass follows the use-to-user order, while the second pass goes in the reverse direction to allow for bidirectional information flow. At any given time step, we can denote the model's prediction for element $e$ as drawn from $P(t_e \mid u_e, \mathcal{M}(s_e))$ , and the predicted types $t_e'$ are then used to update $\mathcal{M}$ such that $\mathcal{M}(e) = t_e'$ . + +# 3.5 TRAINING + +To save computation and improve parallelism during training, we use the available human annotations as a gold type assignment $\mathcal{M}^*$ instead of letting the model condition on its own prediction. Note that this type assignment is generally incomplete and may not contain a label for every missing type. We train the model to maximize the log likelihood of predicting the ground truth, i.e., $\log P(\pmb{t}_e^* \mid \pmb{u}_e, \mathcal{M}^*(\pmb{s}_e))$ , for every element $e$ where $\pmb{t}_e^*$ is available, using teacher-forcing. We train the CodeT5 baseline model similarly on the same dataset.3 + +Table 1: Basic statistics of our two datasets. + +
BetterTypes4PyInferTypes4Py
trainvalidtesttest
Projects57340503
Nonempty files16.5K109894999
Lines of code2.4M174K139K21K
Top-level type slots541K38.2K28.4K4.6K
Top-level user-added types275K19.3K15.8K2.7k
Rare type ratio25.7%23.3%35.0%33.8%
Complex type ratio20.4%16.6%20.8%33.4%
Average type size1.421.331.431.72
+ +# 4 EXPERIMENTS + +We implement TypeT5 in Python, whose the source code and model weights can be found on GitHub4. We list the hyperparameters and hardware details in subsection A.6. Below, we first compare TypeT5 against three state-of-the-art type inference systems for Python, namely Typilus (Allamanis et al., 2020), Type4Py (Mir et al., 2022), and HiTyper (Peng et al., 2022). We then present ablation studies to evaluate different factors contributing to the model's performance. + +# 4.1 EVALUATION SETUP + +Datasets In our evaluation, we predict the type annotations for top-level code elements of each Python project. These include all class attributes, methods, top-level functions, and global variables. We treat any existing user-added type annotations as the ground truth, and we use per type accuracy as the main performance metric. Following a setting similar to that of Allamanis et al. (2020) and Wei et al. (2020), we split our dataset per Python project. This way, types newly defined in the test projects will not have been seen during training. Such a setting is more challenging than splitting the dataset per file, as is done in Type4Py and other work (Pradel et al., 2020; Mir et al., 2022), but more closely reflects the model's real-world performance (Gruner et al., 2022). + +Our main dataset, BetterTypes4Py, is constructed by selecting a high-quality subset from the Many-Types4Py dataset (Mir et al., 2021), which was used to train Type4Py. We describe the selection criteria in subsection A.2. Since our model is fine-tuned from the CodeT5 model (which may have already been pre-trained on some of the test repositories in the aforementioned dataset), we additionally construct InferTypes4Py, a test set derived from the source code of Typilus, Type4Py, and our own tool, none of which were used as CodeT5's (pre-)training data. We further discuss the potential code duplication issue (subsection A.3) and label quality issue (subsection A.4) in the appendix. + +We summarize key properties of both datasets in Table 1. We define the size of a type as the number of type constructors in its body and categorize a type as simple if its size is 1, and complex otherwise. We also categorize a type as rare or common depending on whether it contains a rare type constructor that is not from the top-100 most frequent type constructors in our training set. + +Accuracy metrics. Since Python allows the same type to be written in different syntactic forms, we first perform type normalization to convert both the predicted and ground-truth types into a canonical form. The details of this normalization step can be found in subsection A.5, and we use the term full accuracy to refer to the accuracy against all human annotations after normalization. To better compare with prior work, we also define adjusted accuracy (our main metric), which (1) filters out all None and Any labels (as in prior work); (2) converts fully qualified names to simple names (e.g., Tensor instead of torch). Tensor) since some prior approach does not output correctly qualified types; (3) rewrites any outermost Optional [T] and Final [T] into T since they + +Table 2: Accuracy comparison on common types. + +
BetterTypes4PyInferTypes4Py
full allalladjusted simplecomplexbase allfull allalladjusted simplecomplexbase all
Typilusn/a54.0555.1233.2360.37n/a52.3352.1953.9164.67
Type4Pyn/a50.3451.9132.1447.51n/a32.0833.4716.5429.83
HiTyper59.2054.2857.7026.4459.0145.6743.5446.0019.2747.99
CodeT576.7478.0482.4353.0382.4477.8378.0685.3163.4181.87
TypeT579.2481.4385.6956.7584.8281.7582.9587.6272.7884.17
+ +Table 3: Accuracy comparison on rare types. + +
BetterTypes4PyInferTypes4Py
full alladjustedbase allfull alladjustedbase all
allsimplecomplexallsimplecomplex
Type4Pyn/a12.3713.174.0514.15n/a0.250.140.980.17
HiTyper10.3025.5127.599.7929.339.369.3610.791.1912.33
CodeT549.4752.9557.2834.2657.6551.6453.2859.9730.6266.47
TypeT558.5661.4765.2140.2268.4453.4456.2761.5036.9269.23
+ +tend not to be used consistently across programmers. $^{7}$ Finally, we also define a base accuracy metric that is the same as adjusted accuracy except that it only checks the outermost type (e.g., Dict[str, List] will match any Dict but, for example, not Mapping.) + +# 4.2 COMPARING TYPE5 WITH OTHER APPROACHES + +We compare TypeT5 with the basic CodeT5 model described in subsection 3.4 as well as the released versions of three other state-of-the-art approaches from prior work. $^{8}$ Typilus (Allamanis et al., 2020) models the program as a graph and applies a graph neural network to compute the types of variables. The original Typilus model can predict from a set of common types as well as (nonparametric) user-defined types, but their released model can only predict common types, so we only evaluate its performance on common types. Type4Py (Mir et al., 2022) uses variable names and the surrounding code to compute an embedding and performs type prediction via a nearest-neighbor search in the type embedding space. We run the released Type4Py model via its web interface. HiTyper (Peng et al., 2022) combines the strengths of a rule-based type inference algorithm with ML type inference models by only invoking the ML model on places where the inference algorithm gets stuck and deducing the types elsewhere using typing constraints. Its implementation uses Type4Py as the default ML backend, which we use to run HiTyper. + +We show each tool's accuracy in Table 2 (on common types) and Table 3 (on rare types), and we put the combined results in appendix (Table 6). Since HiTyper was only able to make a prediction for about $67\%$ of all labels, we report its performance on this subset. From Table 2, we can make the following observations. (1) Our CodeT5 baseline model already outperforms all prior approaches by a large margin, demonstrating the advantage of using a seq2seq pre-trained language model. (2) TypeT5 further improves the adjusted accuracy by $3.4\%$ and $4.9\%$ on the two datasets. (3) Type4Py's performance on InferTypes4Py dataset is significantly lower than on BetterTypes4Py, likely because Type4Py was originally trained on some of the test files in BetterTypes4Py.9 Looking at Table 6, we see that both CodeT5 and TypeT5 dramatically outperform the other approaches on rare types. Moreover, TypeT5 achieves the largest improvements on types that are both rare and complex, improving upon CodeT5 by about $6\%$ on both datasets, suggesting that that global information is especially important in these cases. For a qualitative analysis, we also show TypeT5's outputs on a real-world example in subsection A.9. + +Table 4: Performance of different model modifications. All models are retrained with the corresponding inputs. + +
ModificationAccuracyType Error
No Preamble64.206067
No Users71.207053
No Uses67.257332
Nonincremental72.525720
Original (TypeT5)73.025087
+ +Table 5: Performance of different decoding strategies. The same TypeT5 model weights are used for different decoding strategies. + +
StrategyAccuracyType Error
Independent71.686876
Random71.666215
UserToUse70.677415
UseToUser72.656402
TwoPass (TypeT5)73.025087
+ +# 4.3 ABLATIONS ON TYPE5 + +We next present a series of ablations that evaluate how various factors contribute to TypeT5's performance. In addition to accuracy (on all types), we also report the type error count as a way to estimate how coherent the model's predictions are. $^{10}$ Note that we only report errors that are directly related to type coherence (since the type checker also reports errors unrelated to type coherence, such as unresolved import statements. We give more details about this metric in subsection A.8.). + +How do different components contribute to the model's performance? To evaluate the impact of each context element, we remove one component at a time and retrain the model accordingly. In particular, the No Preamble, No Users, and No Uses ablations correspond to removing the $s_{\mathrm{pre}}$ , $s_{\mathrm{user}}$ , and $s_{\mathrm{usee}}$ context elements (introduced in subsection 3.3) from the model's input, respectively. The Nonincremental model does not perform iterative decoding and is trained to condition on an untyped context. We use the same input size limit (4096 subword tokens) for all models, so a model that does not utilize one kind of information have more space for other kinds. We show both the adjusted accuracy on all types and type error count in Table 4 (and show other accuracy metrics in Table 7). We can see that (1) all components improve the overall accuracy, with the preamble having the largest impact, and (2) while the iterative decoding scheme only improves overall accuracy slightly, it significantly improves the model's coherence, resulting in $12\%$ fewer type errors. + +How do different decoding strategies compare? In addition to the two-pass iterative decoding strategy introduced in subsection 3.4, we also test four other decoding strategies: (1) Independent, which independently predicts the type signature for each element without conditioning on the model's own prediction (same as the Nonincremental model except not retrained); (2) Random, which visits each element once following a random order; (3) UserToUse, which visits the users before the useses; (4) UseToUser, which visits the useses before the users. The results are shown in Table 5 (and show other accuracy metrics in Table 8). We can see that our proposed TwoPass decoding scheme yields the largest accuracy and type error improvement over Independent; whereas UserToUse performs worse than Independent, suggesting that bad decoding ordering can have adverse effects on the model's performance. + +# 4.4 USER-GUIDED INTERACTIVE DECODING + +Compared to prior work, our approach has a unique strength: because the model can condition on previous types, it allows easy user intervention by conditioning on any corrections made by the user. We thus explore an alternative use case of our model where the user interactively inspects each type signature predicted by the model and makes any necessary corrections before the model moves on to the next prediction. We emulate this interactive process using the ground-truth human annotations $\mathcal{M}^*$ , and we modify the use-to-user decoding process to let the model predict the types of each element $e$ (as before), but then override the predicted types $t_e$ with the corresponding human annotations $\mathcal{M}^*(e)$ if $e \in \mathcal{M}^*$ . On the BetterTypes4Py dataset, this interactive decoding process achieves a full accuracy of $78.04\%$ and an adjusted accuracy of $79.37\%$ —meaning that + +on average, it only requires the user to correct one in every five model-predicted types to fully annotate an entirely untyped project from scratch. Note that only $59\%$ of the test set contains a user type annotation, so some incorrect type annotations may not be corrected immediately and can get propagated to other places. Thus, in an interactive real-world setting, we can expect the actual accuracy to be even higher. + +# 5 RELATED WORK + +Deep Learning Type Inference Most prior approaches predict user-defined types via some form of type embedding matching. For example, LambdaNet (Wei et al., 2020) tackles this challenge by combining graph neural networks with a pointer network. Typilus (Allamanis et al., 2020) performs nearest-neighbor search in the type embedding space. However, neither approach can handle the unbounded type space induced by parametric types. TypeBert (Jesse et al., 2021) is the first type inference method based on pre-trained transformer models and has demonstrated superior performance in predicting common types. Jesse et al. (2022) later improved TypeBert using deep similarity learning to better support user-defined types. Different from our work, TypeBert does not use a seq2seq model or construct context from static analysis. Apart from just using the source code, other forms of information have also been utilized for type prediction. Both TypeWriter (Pradel et al., 2020) and HiTyper (Peng et al., 2022) combines type checking with inference-time search to avoid generating type errors. OptTyper (Pandi et al., 2020) explicitly models type constraints by turning them into a continuous optimization objective. NL2Type (Malik et al., 2019) focuses on predicting types from natural language information such as code comments and documentation. + +Retrieval-based models in NLP Similar to our context augmentation with static analysis, a number of methods have been developed to augment pre-trained models with context in natural language processing (NLP). For open-domain question answering (Chen et al., 2017), approaches like REALM Guu et al. (2020) and DPR (Karpukhin et al., 2020) can retrieve knowledge relevant to a query, and retrieval-augmented generation (Lewis et al., 2020) and its extensions (e.g., Fusion-in-Decoder (Izacard & Grave, 2020)) have shown that it is possible to generate longer outputs using this information. RETRO (Borgeaud et al., 2021) and WebGPT (Nakano et al., 2021) take this to a web-scale extreme. However, we are also able to leverage static analysis based on the usage graph, which has no analogue for text. + +Linking with T5 While our use of CodeT5 for type prediction is novel to our knowledge, T5 (Raffel et al., 2019) has been applied to a range of NLP tasks like summarization. Most similar to ours is its use for entity linking (Petroni et al., 2021): Systems in this vein generate names of entities token by token (De Cao et al., 2020) and are able to generalize to new entities like TypeT5. However, the presence of ad hoc types for each new context and the types of context clues needed are very different in the code setting than in natural language. + +Structured Prediction Our iterative decoding process can be viewed as applying a learned policy to perform structured prediction (BakIr et al., 2007; Daumé et al., 2009). In this work, our training scheme can be viewed as behavior cloning since the model directly conditions on ground-truth human annotations, which can lead to distributional mismatch between training and inference time. Applying more advanced training schemes such as Scheduled Sampling (Bengio et al., 2015), DAgger (Ross et al., 2011), or reinforcement learning (Sutton & Barto, 2018) may help further boost the performance of iterative decoding. + +# 6 CONCLUSION + +In this work, we showed that TypeT5, a system integrating CodeT5 with lightweight static analysis and a new decoding scheme, is effective at predicting types for untyped codebases. We show that fine-tuning a pre-trained code model already results in a strong baseline, outperforming systems from past work, and that incorporating the right context with static analysis is particularly helpful to enable accurate prediction on more challenging cases. We believe that even larger models can further improve the accuracy, but they will still need to leverage the methods in this work to achieve high accuracy on rare and complex types. + +# ACKNOWLEDGMENT + +This work is partly funded by NSF Award CCF-1918889. We would like to express our sincere gratitude to Miltiadis Allamanis and Amir Mir for generously helping us in setting up their tools and completing the comparison experiments. We would also like to thank members of the UTOPIA group, especially Jocelyn Chen, for their assistance in managing the GPU server for the experiments. + +# REFERENCES + +Wasi Ahmad, Saikat Chakraborty, Baishakhi Ray, and Kai-Wei Chang. Unified pre-training for program understanding and generation. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 2655-2668, 2021. +Miltiadis Allamanis. The adverse effects of code duplication in machine learning models of code. In Proceedings of the 2019 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software, pp. 143-153, 2019. +Miltiadis Allamanis, Earl T Barr, Soline Ducousso, and Zheng Gao. Typilus: Neural type hints. In PLDI, 2020. +G. BakIr, Neural Information Processing Systems Foundation, T. Hofmann, A.J. Smola, B. Schölkopf, and B. Taskar. Predicting Structured Data. Advances in neural information processing systems. MIT Press, 2007. ISBN 9780262026178. URL https://books.google.com/books?id=b1EFKUoFF8IC. +Samy Bengio, Oriol Vinyals, Navdeep Jaitly, and Noam Shazeer. Scheduled sampling for sequence prediction with recurrent neural networks. In C. Cortes, N. Lawrence, D. Lee, M. Sugiyama, and R. Garnett (eds.), Advances in Neural Information Processing Systems, volume 28. Curran Associates, Inc., 2015. URL https://proceedings.neurips.cc/paper/2015/file/e995f98d56967d946471af29d7bf99f1-Paper.pdf. +Sebastian Borgeaud, Arthur Mensch, Jordan Hoffmann, Trevor Cai, Eliza Rutherford, Katie Millican, George van den Driessche, Jean-Baptiste Lespiau, Bogdan Damoc, Aidan Clark, Diego de Las Casas, Aurelia Guy, Jacob Menick, Roman Ring, Tom Hennigan, Saffron Huang, Loren Maggiore, Chris Jones, Albin Cassirer, Andy Brock, Michela Paganini, Geoffrey Irving, Oriol Vinyals, Simon Osindero, Karen Simonyan, Jack W. Rae, Erich Elsen, and Laurent Sifre. Improving language models by retrieving from trillions of tokens. In arXiv, 2021. URL https://arxiv.org/abs/2112.04426. +Danqi Chen, Adam Fisch, Jason Weston, and Antoine Bordes. Reading Wikipedia to Answer Open-Domain Questions. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), 2017. URL https://aclanthology.org/P17-1171. +Hal Daumé, John Langford, and Daniel Marcu. Search-based structured prediction. Machine learning, 75(3):297-325, 2009. +Nicola De Cao, Gautier Izacard, Sebastian Riedel, and Fabio Petroni. Autoregressive entity retrieval. In Proceedings of the International Conference on Learning Representations (ICLR), 2020. URL: https://arxiv.org/abs/2010.00904. +Philip Gage. A new algorithm for data compression. C Users Journal, 12(2):23-38, 1994. +Bernd Gruner, Tim Sonnekalb, Thomas S Heinze, and Clemens-Alexander Brust. Cross-domain evaluation of a deep learning-based type inference system. arXiv preprint arXiv:2208.09189, 2022. +Kelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat, and Ming-Wei Chang. REALM: Retrieval-Augmented Language Model Pre-Training. In Proceedings of the 37th International Conference on Machine Learning, 2020. + +Vincent J Hellendoorn, Christian Bird, Earl T Barr, and Miltiadis Allamanis. Deep learning type inference. In Proceedings of the 2018 26th acm joint meeting on European software engineering conference and symposium on the foundations of software engineering, pp. 152-162, 2018. +Gautier Izacard and Edouard Grave. Leveraging Passage Retrieval with Generative Models for Open Domain Question Answering. In arXiv, 2020. URL https://arxiv.org/abs/2007.01282. +Kevin Jesse, Premkumar T Devanbu, and Toufique Ahmed. Learning type annotation: is big data enough? In Proceedings of the 29th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering, pp. 1483-1486, 2021. +Kevin Jesse, Premkumar Devanbu, and Anand Ashok Sawant. Learning to predict user-defined types. IEEE Transactions on Software Engineering, 2022. +Vladimir Karpukhin, Barlas Oguz, Sewon Min, Patrick Lewis, Ledell Wu, Sergey Edunov, Danqi Chen, and Wen-tau Yih. Dense Passage Retrieval for Open-Domain Question Answering. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), 2020. URL https://aclanthology.org/2020.emnlp-main.550. +Patrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Küttler, Mike Lewis, Wen-tau Yih, Tim Roktäschel, Sebastian Riedel, and Douwe Kiela. Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. In Proceedings of the 34th International Conference on Neural Information Processing Systems, 2020. +Yujia Li, David Choi, Junyoung Chung, Nate Kushman, Julian Schrittwieser, Rémi Leblond, Tom Eccles, James Keeling, Felix Gimeno, Agustin Dal Lago, et al. Competition-level code generation with alphabet. arXiv preprint arXiv:2203.07814, 2022. +Rabee Sohail Malik, Jibesh Patra, and Michael Pradel. Nl2type: inferring javascript function types from natural language information. In 2019 IEEE/ACM 41st International Conference on Software Engineering (ICSE), pp. 304-315. IEEE, 2019. +A. M. Mir, E. Latoskinas, and G. Gousios. Manytypes4py: A benchmark python dataset for machine learning-based type inference. In IEEE/ACM 18th International Conference on Mining Software Repositories (MSR), pp. 585-589. IEEE Computer Society, May 2021. doi: 10.1109/MSR52588.2021.00079. +Amir M Mir, Evaldas Latoškinas, Sebastian Proksch, and Georgios Gousios. Type4py: practical deep similarity learning-based type inference for python. In Proceedings of the 44th International Conference on Software Engineering, pp. 2241-2252, 2022. +Reiichiro Nakano, Jacob Hilton, Suchir Balaji, Jeff Wu, Long Ouyang, Christina Kim, Christopher Hesse, Shantanu Jain, Vineet Kosaraju, William Saunders, Xu Jiang, Karl Cobbe, Tyna Eloundou, Gretchen Krueger, Kevin Button, Matthew Knight, Benjamin Chess, and John Schulman. WebGPT: Browser-assisted question-answering with human feedback. In arXiv, 2021. URL https://arxiv.org/abs/2112.09332. +John-Paul Ore, Sebastian Elbaum, Carrick Detweiler, and Lambros Karkazis. Assessing the type annotation burden. In Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering, pp. 190-201, 2018. +Irene Vlassi Pandi, Earl T Barr, Andrew D Gordon, and Charles Sutton. Opttyper: Probabilistic type inference by optimising logical and natural constraints. arXiv preprint arXiv:2004.00348, 2020. +Sheena Panthaplackel, Pengyu Nie, Milos Gligoric, Junyi Jessy Li, and Raymond Mooney. Learning to update natural language comments based on code changes. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 1853-1868, 2020. +Yun Peng, Cuiyun Gao, Zongjie Li, Bowei Gao, David Lo, Qirun Zhang, and Michael Lyu. Static inference meets deep learning: A hybrid type inference approach for python. In Proceedings of the 44th International Conference on Software Engineering, ICSE '22, pp. 2019-2030, New York, NY, USA, 2022. Association for Computing Machinery. ISBN 9781450392211. doi: 10.1145/3510003.3510038. URL https://doi.org/10.1145/3510003.3510038. + +Fabio Petroni, Aleksandra Piktus, Angela Fan, Patrick Lewis, Majid Yazdani, Nicola De Cao, James Thorne, Yacine Jernite, Vladimir Karpukhin, Jean Maillard, Vassilis Plachouras, Tim Roektaschel, and Sebastian Riedel. KILT: a Benchmark for Knowledge Intensive Language Tasks. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, 2021. URL https://aclanthology.org/2021.naacl-main.200. +Michael Pradel, Georgios Gousios, Jason Liu, and Satish Chandra. Typewriter: Neural type prediction with search-based validation. In Proceedings of the 28th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering, pp. 209-220, 2020. +Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. Language models are unsupervised multitask learners. +Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer. In arXiv, 2019. URL https://arxiv.org/abs/1910.10683. +Veselin Raychev, Martin Vechev, and Andreas Krause. Predicting program properties from" big code". ACM SIGPLAN Notices, 50(1):111-124, 2015. +Stéphane Ross, Geoffrey Gordon, and Drew Bagnell. A reduction of imitation learning and structured prediction to no-regret online learning. In Proceedings of the fourteenth international conference on artificial intelligence and statistics, pp. 627-635. JMLR Workshop and Conference Proceedings, 2011. +Mike Schuster and Kaisuke Nakajima. Japanese and korean voice search. In 2012 IEEE international conference on acoustics, speech and signal processing (ICASSP), pp. 5149-5152. IEEE, 2012. +Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1715-1725, Berlin, Germany, August 2016. Association for Computational Linguistics. doi: 10.18653/v1/P16-1162. URL https://aclanthology.org/P16-1162. +Jeremy Siek and Walid Taha. Gradual typing for objects. In European Conference on Object-Oriented Programming, pp. 2-27. Springer, 2007. +Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press, 2018. +Yue Wang, Weishi Wang, Shafiq Joty, and Steven CH Hoi. Codet5: Identifier-aware unified pretrained encoder-decoder models for code understanding and generation. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pp. 8696-8708, 2021. +Jiayi Wei, Maruth Goyal, Greg Durrett, and Isil Dillig. Lambdanet: Probabilistic type inference using graph neural networks. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=Hkx6hANTwH. +Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumont, Clement Delangue, Anthony Moi, Pierrick Cistac, Tim Rault, Rémi Louf, Morgan Funtowicz, Joe Davison, Sam Shleifer, Patrick von Platen, Clara Ma, Yacine Jernite, Julien Plu, Canwen Xu, Teven Le Scao, Sylvain Gugger, Mariama Drame, Quentin Lhoest, and Alexander M. Rush. Transformers: State-of-the-art natural language processing. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pp. 38-45, Online, October 2020. Association for Computational Linguistics. URL https://www.aclweb.org/anthology/2020.emnlp-demos.6. + +# A APPENDIX + +# A.1 CONSTRUCTING THE USAGE GRAPH + +To resolve the user-usee relations at the project level (used in subsection 3.2), we built a custom static analysis pipeline on top of the libcst library. We use libcst to parse Python files and also rely on its utilities to resolve symbol references within the same file (i.e., it tells us whether a local name refers to a function defined in the current file or comes from an import statement, etc.) We then implement custom import resolution logic (following Python's module rules) and combine it with libcst to resolve all certain usages within the current project. For unresolved usages with a syntactic form matching a class attribute/method usage, we generate a potential usage to each class members with a matching name. Since the involved static analysis operations are fairly lightweight and we parallelize the construction of different graphs on CPUs, the time spent on constructing the usage graphs only makes up a tiny fraction of the total training or inference time. For example, using 28 Python processes, it only takes about 8 minutes to process the entire BetterTypes4Py training set, including the time spent on other tasks such as parsing, code transformation, and tokenization. + +While our implementation limits the analysis scope to the current project, it is straightforward to extend the analysis to also include usages involving library definitions, which may help the model see type signatures of uncommon library APIs. We did not do this in our experiments mainly due to the manual effort it would require to install the correct library dependencies for all the projects in our datasets. + +# A.2 CONSTRUCTING THE BETTERMYPES4PY DATASET + +Our dataset is constructed from the ManyTypes4Py dataset as follows: we first filter out the GitHub repositories that are no longer accessible or that fail to download within 10 seconds. This leaves us with 4890 out of the 5996 original projects. Then, we discard projects that have not been updated for more than one year (to avoid outdated library APIs), reducing the number of repositories to 1218. To limit the influence of any particular project, we also filter out the 37 projects with more than 50K lines of code. Finally, to exclude those projects that have very few type annotations, we compare the number of type annotations $n_t$ of each project with its lines of code $n_c$ and filter out those with a $n_t$ -to- $n_c$ ratio less than 1:20. This gives us our final set of 663 projects. We then randomly select 50 test and 40 validation projects and use the rest for training. + +# A.3 CODE DUPLICATION + +Code duplication (Allamanis, 2019) has been shown to have adverse effects on the performance of ML models and can blur the evaluation results. Hence, prior work like Type4Py applies file-level deduplication to remove duplicated source files. However, this is hard to do in our project-based setting since we need all files to be present during inference. To address this, we have manually verified that our InferTypes4Py dataset does not contain files that are copy-pasted from elsewhere. We also run the popular code duplication tool jscpda11 on our test set to detect duplicated code blocks. The analysis shows that there is relatively little duplication in the dataset (only around $4\%$ of duplicated lines), and the majority of these duplications came from the same project rather than across projects, so we believe code duplication is not a major issue under our by-project evaluation. + +# A.4 LABEL QUALITY + +In our evaluation, developer-provided type annotations are used as the ground truth, which are not always accurate or coherent (Ore et al., 2018). This partially motivated us to construct the InferTypes4Py dataset, which consists of high-quality type annotations with a relatively low error rate. In particular, our own codebase (which are included in InferTypes4Py) makes heavy use of type annotations throughout the development process and is continuously type-checked by VSCode. As a very rough metric to approximate label quality, we report the coherence error (defined in subsection A.8) of the human labels on both datasets: On BetterTypes4Py and InferTypes4Py, the average coherence error per human annotation is 0.019 and 0.045, respectively. + +Table 6: Accuracy comparison on all types (common + rare). + +
BetterTypes4PyInferTypes4Py
full allalladjusted simplecomplexbase allfull allalladjusted simplecomplexbase all
Type4Pyn/a34.5235.8719.6835.61n/a21.1122.359.6122.64
HiTyper42.5341.9544.8619.0247.8834.8332.5035.1111.4039.23
CodeT567.0767.4772.1244.0573.4468.8068.9575.1454.0477.78
TypeT571.8973.0277.0749.7278.8771.9873.1577.1662.6680.20
+ +# A.5 TYPE NORMALIZATION + +To compute the accuracy metrics in subsection 4.1, we recursively apply the following steps to normalize a Python type: + +1. Rewrite any Optional[T] to Union[T, None]. +2. Sort the arguments of Union types and flatten any nested Unions. e.g., rewrite Union[B, Union[C,A]] into Union[A,B,C]. +3. If all type arguments are Any, drop them all. e.g., rewrite List[Any] to List. +4. Capitalize the names of basic types. e.g., rewrite list to List. + +# A.6 HYPERPARAMETERS AND RUNNING TIMES + +We initialize our model's weights from the CodeT5 model provided by Huggingface Transformers library (Wolf et al., 2020) and train our model for exactly one epoch using the library's default optimizer configuration (AdamW with a base learning rate of 2e-5 and a weight decay of 0.01.) During inference, we use beam search with a beam width of 16 and diversity penalty of 1.0. We adaptively set the maximal output sequence length to be $16n + 10$ , where $n$ is the number of types to be predicted in the input. + +We set the size limit of preamble, use Context, main code, and user Context to 1000, 2048, 512, 1536, respectively, both during training and test time. Note that preamble uses the space within use context, so the total maximal input size is 4096. + +Training the model took about 11 hours on a single Quadro RTX 8000 GPU with 48GB memory. Performing the two-pass inference on the BetterTypes4Py test set takes about 4 hours, whereas performing a single-pass inference (e.g., UseToUser) takes about half the time. For comparison, training CodeT5 model on the same machine takes about 3.7 hours, and the corresponding evaluation takes about 0.5 hour. + +# A.7 WHY TYPE4PY HAS MUCH LOWER PERFORMANCE ON OUR DATASET + +We have discussed our experiments with the authors of Type4Py and believe that the discrepancy we observe is likely due to the combination of two reasons: First, while our evaluation only counts the type annotations on all top-level APIs, Mir et al. (2022) includes all local variables in their evaluation as well. Second, while we only evaluate on human annotations, they also include machine-inferred type annotations (via the type checker Pyre) as ground-truth labels. As a result, the distributions of labels reported by the two papers are significantly different: in our setting, function annotations (parameters + return types) constitute the majority (87%) of the labels, whereas in Mir et al. (2022), their portion is significantly smaller, merely 18%. This suggests that their label set is likely inflated by simple labels inferrable from the type checker, which explain the performance drop when evaluated on our datasets. + +# A.8 MEASURING TYPE COHERENCE USING TYPE ERRORS + +To estimate the type coherence (subsection 4.3), we call the type checker $\mathrm{MyPy}^{12}$ on codebases annotated with the types predicted by the model. Since not all errors reported by $\mathrm{MyPy}$ are type + +Table 7: Detailed comparison of different model modifications on BetterTypes4Py. All models are retrained with the corresponding input format. Accuracy is measured on all types. + +
Modificationfull allaccuracybase allType Error
allsimplecomplex
No Preamble63.0364.2071.2233.5169.986067
No Uses67.7067.1570.2748.0973.017053
No Users70.2271.2077.8741.3477.267332
Nonincremental71.8672.5277.2347.2678.475720
Original (TypeT5)71.8973.0277.0749.7278.875087
+ +Table 8: Detailed comparison of different decoding strategies on BetterTypes4Py. The same TypeT5 model weights are used for different decoding strategies. Accuracy is measured on all types, and the UserGuided decoding is introduced in subsection 4.4. + +
Modificationfull allaccuracybase allType Error
allsimplecomplex
Independent70.8771.6875.9946.9277.586876
Random70.6871.6675.6847.8977.656215
UserToUsee69.9870.6774.4847.6076.467415
UseeToUser71.5872.6576.8048.8878.486402
TwoPass (TypeT5)71.8973.0277.0749.7278.875087
UserGuided78.0979.3683.2758.6184.02n/a
+ +errors or are related to type coherence, we only count the errors with the following 5 error codes, whose meaning according to MyPy's documentation are: + +- attr-defined checks that an attribute is defined in the target class or module when using the dot operator. +- arg-type checks that argument types in a call match the declared argument types in the signature of the called function. +- return-value checks that the returned value is compatible with the type signature of the function. +- assignment checks that the assigned expression is compatible with the assignment target. +- name-defined checks that a name is defined in the current scope. + +Note that this metric does have its limitations. One undesired property we found is that it can favor predicting a non-existing type over an incorrect type. For instance, when the model predicts an incorrect type on a function, the type checker will check all the usages of that function against this declared type and will thus likely report multiple errors. However, if the model predicts a non-existing type, the type checker will only report a single name-defined error at the declaration site and will skip checking its usages. This effect has caused the No Preamble variant in Table 4 to have a lower error count than other two other variants since it tends to predict a lot more non-existing types. But we have verified that it was not the cause of the type error count improvement by our two-pass iterative decoding model. + +# A.9 REAL EXAMPLES PRODUCED BY TYPE5 + +We run TypeT5 on the actual code corresponding to the example shown in Figure 1 and show the obtained preamble (Figure 5), usee context (Figure 6), main code (Figure 7), and user context (Figure 8) for the ModelWrapper.predict element. For each type predicted by the model, we indicate whether it is correct with a green or red marker, and if not, also show the ground truth type in red. Note that these outputs were generated by the model in the second pass of the iterative decoding process (described in subsection 3.4), so all the elements have already been annotated at least once (but some may have not been annotate the second time). + +```txt +model_input.py Preamble +1 import random +2 from copy import copy, deepcopy +3 import numpy as np +4 from collections import Counter +5 from mypy Extensions import mypyc_attr +6 from torch import Tensor +7 from transformers.data.data.collator import DataCollatorForSeq2Seq +8 from typing import NamedTuple, overload +9 from datasets-arrow_dataset import Dataset +10 from torch.utils.data import DataLoader, RandomSampler +11 from.data import ( +12 ChunkedDataset, +13 CtxArgs, +14 TokenizedSrcSet, +15 output_ids_as_types, +16 preds_to accuracies, +17 } +18 from.type_env import AccuracyMetric, PythonType +19 from.utils import * +20 @dataclass +21 class DecodingArgs: +22 ... +23 @dataclass +24 class DatasetPredResult(Generic[T1]): +25 ... +26 @dataclass +27 class ModelWrapper: +28 ... +``` + +Figure 5: The preamble gathers all the important statements and class headers from the current file. This helps the model see which types are available and where each symbol comes from. + +```txt +71 # spot.model Usee Context +72 @dataclass +73 class DecodingArgs: +74 sampling_max_tokens: int +75 ctx_args: CtxArgs +76 +77 # spot.utils +78 def assert_eq(x: T1, $\ast \times \mathrm{s}$ : T1, extra_message: Callable[ ], str] = lam +79 +80 # spot.model +81 @dataclass +82 class DatasetPredResult(Generic[T1]): +83 chunks: ChunkedDataset +84 predictions: list[T1] list[list[PythonType]] +85 extra_info: list[dict] $=$ field(defaultFACTory=list) +86 list[T1] +87 # spot.model +88 @dataclass +89 class ModelWrapper: +90 model: PythonType $\clubsuit$ ModelSPOT +91 tokenizer: PythonType $\clubsuit$ TokenizerSPOT +92 args: CtxArgs $\clubsuit$ DecodingArgs +93 def predict_on_batch( +94 self, +95 batch: dict, +96 num_return_sequences: int $=$ None, +97 )-> tuple[list[PythonType], Tensor]:... +98 tuple[list[list[PythonType]], Tensor] +99 +100 # spot.model +101 def dynamic_dataloader( +102 dataset: ChunkedDataset, $\clubsuit$ Dataset +103 max_tokens: int, +104 collate_fn: DataCollatorForSeq2Seq, +105 shuffle: bool $=$ False, +106 ) -> DataLoader:.. +107 +108 # Used above +``` + +Figure 6: The usee context shows the signature of the elements that are used by the main code or by elements from the user context. By seeing their predicted type signatures, the model can understand the type-level behavior of these definitions without having to dive into their implementation. + +![](images/baec3fc046f594ab0d06ab75d3396698e8652d81670619f8c0d87cd14ab4a6d7.jpg) +Figure 7: The main code is the element that is being annotated by the model at the current decoding step. The model has made two errors in this example, both of which can be directly attributed to the previous two errors made in the usee context (line 102 and line 97). This shows that the model is making coherent predictions according to the context, and such errors can be avoided if the user has corrected the previous errors (as described in subsection 4.4). + +```txt +147 #Users below User Context, first half +148 #spot.model +149 @dataclass +150 class ModelWrapper: +151 defeval_on_dataset( +152 self, +153 src_data:TokenizedSrcSet, +154 max_labels:int $=$ None, +155 tqdm_args:dict $= \{\}$ , +156 )->DatasetPredResult: +157 ctx_args $=$ self.args.ctx_args +158 ifmax_labelsisnotNone: +159 ctx_args $=$ copy(ctx_args) +160 ctx_args.max_labels $=$ max_labels +161 +162 chunks $=$ src_data.toChunks(ctx_args,tqdm_args=tqdm_args) +163 preds $=$ self.predict( +164 chunks.data,num_return_sequences $\equiv$ None,tqdm_args $\equiv$ tqdm_args +165 ) +166 return DatasetPredResult(chunks,preds) +167 +``` + +```python +169 # spotdecode User Context, second half +170 def sampleCandidates( +171 wrapper: ModelWrapper, +172 src_data: TokenizedSrcSet, +173 n_samples: int, tuple[ChunkedDataset, list[list[list[PythonType]]]) +174 ) -> tuple[ChunkedDataset, list[PythonType]]: +175 ctx_args = wrapper.argsCtx_args +176 do_sample = wrapper.args.do_sample +177 if not do_sample: assert wrapper.args num_beams is not None, "num_beams needs to be set" +179 assert n_samples <= wrapper.args num_beams +180 +181 chunks = src_data.toChunks(ctx_args) +182 n_chunks = len(chunks.data) +183 +184 if do_sample: samples = [ wrapper.predict(chunks.data, tqdm_args={})) for _ in tqdm(range(n_samples), desc="Sampling") ] +185 +186 +187 +188 +189 > else: +197 +198 def get_preds(chunk_id, sample_id): return ( samples[sample_id][chunk_id] if do_sample else samples[chunk_id][sample] +200 +201 +202 +203 +204 predCandidates = [ [get_preds(cidid, sid) for sid in range(n_samples)] for cid in range(n_chunk) +205 ] +206 return chunks, predCandidates +207 +``` + +Figure 8: The user context shows two callers of the predict method from the main code. We see that the model successfully predicts all user-defined types, despite the fact that these are all new classes defined in the current project. \ No newline at end of file diff --git a/typet5seq2seqtypeinferenceusingstaticanalysis/images.zip b/typet5seq2seqtypeinferenceusingstaticanalysis/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..1ac893ec0391274233e813ab49cd514311722db5 --- /dev/null +++ b/typet5seq2seqtypeinferenceusingstaticanalysis/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc22590287ed57bf5b5e87a159bf80196a77106d9fdacf32fbc79ad26ba66e54 +size 569985 diff --git a/typet5seq2seqtypeinferenceusingstaticanalysis/layout.json b/typet5seq2seqtypeinferenceusingstaticanalysis/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..5690c4952bdef5bafb12f61ca0cf831df2a33fce --- /dev/null +++ b/typet5seq2seqtypeinferenceusingstaticanalysis/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e16ff821431f913582a2ea620235cc3f0e9e159698e1a640c3b6e4f1db43ed5f +size 493784 diff --git a/ul2unifyinglanguagelearningparadigms/91c48397-a1cb-4bfc-b0d2-b0f845f52ca1_content_list.json b/ul2unifyinglanguagelearningparadigms/91c48397-a1cb-4bfc-b0d2-b0f845f52ca1_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..3344b50e049094e38b01186548bf82c93052fe72 --- /dev/null +++ b/ul2unifyinglanguagelearningparadigms/91c48397-a1cb-4bfc-b0d2-b0f845f52ca1_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:30133b0dc37fb4f4a24073b8da422689d971fdda532b7050e51e4b49c9a28407 +size 183893 diff --git a/ul2unifyinglanguagelearningparadigms/91c48397-a1cb-4bfc-b0d2-b0f845f52ca1_model.json b/ul2unifyinglanguagelearningparadigms/91c48397-a1cb-4bfc-b0d2-b0f845f52ca1_model.json new file mode 100644 index 0000000000000000000000000000000000000000..ba6717243f270f749a4650c718f0f718a8556d59 --- /dev/null +++ b/ul2unifyinglanguagelearningparadigms/91c48397-a1cb-4bfc-b0d2-b0f845f52ca1_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ec0ec0a8e4988cb788838da9668ac9ceb16cc2384c33a9aa2f835cc4a942816c +size 226807 diff --git a/ul2unifyinglanguagelearningparadigms/91c48397-a1cb-4bfc-b0d2-b0f845f52ca1_origin.pdf b/ul2unifyinglanguagelearningparadigms/91c48397-a1cb-4bfc-b0d2-b0f845f52ca1_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fcb7a06f3898393840e3d1929807befb3e64b7a6 --- /dev/null +++ b/ul2unifyinglanguagelearningparadigms/91c48397-a1cb-4bfc-b0d2-b0f845f52ca1_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:06db27011b17370449a869de2355b3b6409f3656082fe6ad571dab4316d6cb60 +size 474035 diff --git a/ul2unifyinglanguagelearningparadigms/full.md b/ul2unifyinglanguagelearningparadigms/full.md new file mode 100644 index 0000000000000000000000000000000000000000..1f6c208dfb19e67f5c15e9e2a585b5c7d6d30d75 --- /dev/null +++ b/ul2unifyinglanguagelearningparadigms/full.md @@ -0,0 +1,581 @@ +# UL2: UNIFYING LANGUAGE LEARNING PARADIGMS + +Yi Tay*, Mostafa Dehghani*, Vinh Q. Tran, Xavier Garcia, Jason Wei, Xuezhi Wang, Hyung Won Chung, Dara Bahri, Tal Schuster, Huaixiu Steven Zheng +Denny Zhou, Neil Houlsby, Donald Metzler + +Google Research, Brain Team + +{yitag, dehghani}@google.com + +# ABSTRACT + +Existing pre-trained models are generally geared towards a particular class of problems. To date, there seems to be still no consensus on what the right architecture and pre-training setup should be. This paper presents a unified framework for pre-training models that are universally effective across datasets and setups. We begin by disentangling architectural archetypes with pre-training objectives – two concepts that are commonly conflated. Next, we present a generalized and unified perspective for self-supervision in NLP and show how different pre-training objectives can be cast as one another and how interpolating between different objectives can be effective. We then propose Mixture-of-Denoisers (MoD), a pretraining objective that combines diverse pre-training paradigms together. We furthermore introduce a notion of mode switching, wherein downstream fine-tuning is associated with specific pre-training schemes. We conduct extensive ablative experiments to compare multiple pre-training objectives and find that our method pushes the Pareto-frontier by outperforming T5 and/or GPT-like models across multiple diverse setups. Finally, by scaling our model up to 20B parameters, we achieve SOTA performance on 50 well-established supervised NLP tasks ranging from language generation (with automated and human evaluation), language understanding, text classification, question answering, commonsense reasoning, long text reasoning, structured knowledge grounding and information retrieval. Our model also achieve strong results at in-context learning, outperforming 175B GPT-3 on zero-shot SuperGLUE and tripling the performance of T5-XXL on one-shot summarization. Finally, we show that UL2 20B works well with chain-of-thought prompting and reasoning tasks, making it an appealing choice for research into reasoning at a small to medium scale of 20B parameters. We publicly release Flax-based T5X model checkpoints for the 20B model. + +# 1 INTRODUCTION + +Note: This is a static copy of this paper as of the ICLR submission. Please use the arxiv version for future updates : https://arxiv.org/abs/2205.05131. TYVM. + +There is a wide spectrum of pre-trained model options for NLP researchers and practitioners these days (Devlin et al., 2018; Brown et al., 2020; Raffel et al., 2019; Radford et al., 2019; Liu et al., 2019; Yang et al., 2019; Thoppilan et al., 2022; Fedus et al., 2021; Du et al., 2021; Chowdhery et al., 2022). When faced with the question of what model should one use, the answer is often it depends, followed by on what task? + +Answering this can be overwhelming, comprising of a number of fine-grained follow-up questions like, 'encoder-only or encoder-decoder?', 'span corruption or language model?'. Pressing further, the answer always seems to depend on the target downstream task. This paper questions and rethinks this thought process, specifically answering the questions of why should the choice of the pre-trained LM depend on the downstream task? and how can we pre-train models that work universally well across many tasks?. + +This paper proposes a step towards making a universally applicable language model possible. We present a framework for Unifying Language Learning Paradigms or UL2 in short, that is consistently + +![](images/d36a7260dc4a2214da91ecbc84a9ea909b8725be7c4abab8f6bc5cb976268b7a.jpg) +Figure 1: In both decoder-only and encoder-decoder setups, UL2 strikes a significantly improved balance in performance between fine-tuned discriminative tasks and prompt-based 1-shot open-ended text generation than previous methods. Note: Dec and EncDec are compute matched but EncDec models have double the parameters. + +effective across a very diverse set of tasks and setups. Figure 1 shows an example of how UL2 can perform universally well, unlike other models that often have to make a trade-off. + +The appeal of a universal model is clear, i.e., as this not only allows concentrated effort in improving and scaling a single model, instead of diversifying resources across $N$ models. Moreover, under resource constrained settings where only a few models can be served (e.g., on device), it would be preferable to have a single pretrained model that can perform well on many types of tasks. + +At the core of UL2 is a newly proposed Mixture-of-Denoisers (MoD), a pre-training objective that enables strong performance across tasks. MoD is a mixture of several well-established denoising objectives along with new ones; namely X-denoising (extreme denoising) which considers extreme span lengths and corruption rates, S-denoising (sequential denoising) that strictly follows sequence order, and R-denoising (regular denoising) that is a standard span corruption objective introduced in (Raffel et al., 2019). We show that MoD is conceptually simple but highly effective for a diverse set of tasks. + +Our approach exploits the realization that most (if not all) well-studied pre-training objectives differ in the type of context a model is conditioned on. For example, the span corruption objective is akin to invoking multiple regions of prefix language modeling (PLM) (Liu et al., 2018; Raffel et al., 2019) whereby prefixes are contiguous segments of non-corrupted tokens and targets have full access to prefixes of all PLM segments. The setting where the span approaches the full sequence length is approximately a language modeling objective conditioned on long-range context. Thus, we are able to design a pre-training objective that smoothly interpolates these different paradigms (span corruption vs language modeling vs prefix language modeling). + +It is also easy to see that each denoiser is difficult in different ways. They also differ in the nature of extrapolation (or interpolation). For example, bounding a model by bidirectional context (or the future) (ie., span corruption) makes the task easier and becomes more akin to fact completion. Meanwhile, PrefixLM/LM objectives are generally more 'open ended'. These behaviours can be easily observed by monitoring the cross entropy losses of these different denoising objectives. + +Given the MoD formulation, we conjecture that it is beneficial for our model to not only distinguish between different denoisers during pre-training but also to adaptively switch modes when learning + +downstream tasks. We introduce mode switching, a new concept that associates pre-training tasks with dedicated sentinel tokens and allows dynamic mode switching via discrete prompting. Our model is able to switch modes between R,S and X denoisers on-demand after being pre-trained. + +We then disentangle the architecture from the self-supervision scheme. While it might be a common misconception, as previously noted in Raffel et al. (2019), that a pre-trained model is strongly characterized by its backbone architecture (e.g., decoder-only vs. encoder-decoder), we find that the choice of the denoiser has significantly more impact. MoD supports either backbone, similar to how T5's span corruption may be trained with a decoder-only model. As such, UL2 is agnostic to architecture. We argue that the choice of backbone architecture is mainly a trade-off across different efficiency metrics. + +We conduct systematic and ablative experiments on a suite of 9 diverse tasks aimed to capture different problem formulations (supervised and prompt-based in-context few-shot learning). We experiment with the SuperGLUE suite (Wang et al., 2019), and three tasks from the GEM benchmark (Gehrmann et al., 2021). In addition, we evaluate on open text generation, as well as prompt-based one-shot settings on all tasks. In this ablative setup, our experimental results show that UL2 outperforms T5 and GPT-like baselines on all 9 setups. On average, UL2 outperforms a T5 baseline by $+43.6\%$ and a language model by $+76.1\%$ . Among all the other competitive baselines considered, UL2 is the only method that outperforms T5 and GPT-like models on all tasks. + +We scale UL2 up to a moderate scale setting of approximately 20B (19.5 to be exact) parameters. We publicly release T5X-based Flax checkpoints of the trained 20B UL2 model. We run experiments across a very diverse suite of $50+$ NLP tasks ranging from language generation (with automated and human evaluation), language understanding, text classification, question answering, commonsense reasoning, long text reasoning, structured knowledge grounding and information retrieval. Our results show that UL2 achieves SOTA on a vast majority of tasks and setups. + +Additionally, we conduct zero/few-shot experiments and show that UL2 outperforms GPT-3 175B on zero shot SuperGLUE. When compared with newer state-of-the-art models like GLaM (Du et al., 2021), PaLM (Chowdhery et al., 2022) and ST-MoE (Zoph et al., 2022), UL2 remains competitive at a compute-matched setup despite only training on C4 corpus which is known to be less effective than specially curated datasets used in (Du et al., 2021; Chowdhery et al., 2022). We delve into understanding trade-offs between zero-shot and finetuning performance and show that UL2 is Pareto-efficient with respect to both learning paradigms. On one-shot summarization, UL2 triples the performance of an LM adapted T5 XXL model and is competitive with (or outperforms) PaLM and LaMDA at the same compute cost. + +Finally, we conduct experiments on reasoning tasks using the recent chain-of-thought (CoT) prompting (Wei et al., 2022b) and shows that UL2 20B benefits from CoT, making it an appealing and accessible open source option to conduct research on the reasoning capabilities language models. + +# 2 UNIFYING LANGUAGE LEARNING PARADIGMS (UL2) + +This section describes the UL2 framework and the proposed pre-training objectives which we study for the remainder of the paper. + +![](images/87136c518a9449d398a7b6cc06c60dc8de3e9c0fc0131f037333016c88ec4ced.jpg) +Figure 2: Mixture of denoisers for training UL2. Greyed out rectangles are masked tokens that are shifted to 'targets' for prediction. + +# 2.1 UNIFIED PERSPECTIVE FOR PRE-TRAINING TASKS + +Many pre-training tasks can be simply formulated as an 'input-to-target' task, wherein the input refers to any form of memory or context that the model conditions on, and the target is the model's expected output. Language models use all previous time-steps as inputs to the model to predict the next token, which is the target. In span corruption, the model leverages all uncorrupted tokens from the past and future as inputs for predicting the corrupted span (targets). Prefix-LMs are LMs that use past tokens as inputs, but consume the inputs bidirectionally: this offer more modelling power than unidirectional encoding of inputs in vanilla LM. + +Given this perspective, we can approximately reduce one pre-training objective to another. For instance, in the span corruption objective, when the corrupted span, i.e., target, is equal to the entire sequence, the problem becomes effectively1 a language modeling problem. With this in mind, using span corruption, by setting the span length to be large, we can effectively mimic the LM objective in local regions. + +We define a notation that covers all of the different denoising tasks that we use in this paper. The inputs and targets of the denoising tasks are generated by a SPANCORRUPT function that is parameterized by three values $(\mu, r, n)$ , where $\mu$ is the mean span length, $r$ is the corruption rate, and $n$ which is number of corrupted spans. Note that $n$ may be a function of the input length, $L$ , and the span length $\mu$ , e.g. $L\mu$ , but in some cases, we use a fixed value of $n$ . Given an input text, SPAN-CORRUPT introduces corruptions to the spans of lengths that are drawn from a (normal or uniform) distribution with mean of $\mu$ . After corruption, the input text is then fed to the denoising task and the corrupted spans are used as targets to be recovered. + +As an example, to construct an objective analogous to causal language modeling using this formulation, one would simply set $(\mu = L, r = 1.0, n = 1)$ , i.e. a single span with its span length equal to the length of the sequence. To express one similar to Prefix LM objective, one would set $(\mu = L - P, r = 1.0 - P / L, n = 1)$ where $P$ is the length of the prefix, with the additional constraint that the single corrupted span always reaches the end of the sequence. + +We note that this inputs-to-targets formulation can be applied to both encoder-decoder models and single-stack transformer models (e.g., decoder models). We opt to select models that predict the next target token instead of those that do so in-place (e.g., predict the current masked token in BERT) because the next-target formulation is more general and can subsume more tasks instead of using a special "CLS" tokens and task-specific projection heads. + +# 2.2 MIXTURE OF DENOISERS + +We conjecture that a strong universal model has to be exposed to solving diverse set of problems during pre-training. Given that pre-training is done using self-supervision, we argue that such diversity should be injected to the objective of the model, otherwise the model might suffer from lack a certain ability, like long-coherent text generation. + +Motivated by this, as well as current class of objective functions, we define three main paradigms that are used during pre-training: + +- R-Denoiser - The regular denoising is the standard span corruption introduced in Raffel et al. (2019) that uses a range of 2 to 5 tokens as the span length, which masks about $15\%$ of input tokens. These spans are short and potentially useful to acquire knowledge instead of learning to generate fluent text. +- S-Denoiser - A specific case of denoising where we observe a strict sequential order when framing the inputs-to-targets task, i.e., prefix language modeling. To do so, we simply partition the input sequence into two sub-sequences of tokens as context and target such that the targets do not rely on future information. This is unlike standard span corruption where there could be a target token with earlier position than a context token. Note that similar to the Prefix-LM setup, the context (prefix) retains a bidirectional receptive field. We note that S-Denoising with very short memory or no memory is in similar spirit to standard causal language modeling. + +- X-Denoiser - An extreme version of denoising where the model must recover a large part of the input, given a small to moderate part of it. This simulates a situation where a model needs to generate long target from a memory with relatively limited information. To do so, we opt to include examples with aggressive denoising where approximately $50\%$ of the input sequence is masked. This is by increasing the span length and/or corruption rate. We consider a pre-training task to be extreme if it has a long span (e.g., $\geq 12$ tokens) or have a large corruption rate (e.g., $\geq 30\%$ ). X-denoising is motivated by being an interpolation between regular span corruption and language model like objectives. + +This set of denoisers has strong connections with previously used objective functions: R-Denoising is the T5 span corruption objective, S-Denoising is connected to causal language models that are GPT-like, and X-Denoising can expose the model to a combination of objectives from T5 and Causal LMs. Notably, X-denoisers are also connected to improve sample efficiency since more tokens are learned to be predicted in each sample, in similar spirit to LMs. We propose blending all these tasks in a uniform fashion and have a hybrid self-supervised objective. The final objective is a mixture of 7 denoisers that are configured as follows: + +
DenoiserSetting
R(μ = 3, r = 0.15, n) ∪ (μ = 8, r = 0.15, n)
S(μ = L4, r = 0.25, 1)
X(μ = 3, r = 0.5, n) ∪ (μ = 8, r = 0.5, n) ∪ (μ = 64, r = 0.15, n) ∪ (μ = 64, r = 0.5, n)
+ +Table 1: Configuration of UL2's mixture-of-denoisers used in the paper. + +For X- and R-Denoisers, the span length is sampled from a normal distribution with mean of $\mu$ . For S-Denoisers, we use a uniform distribution, fix the number of corrupted spans to 1, and have an additional constraint that the corrupted span should end at the end of the original input text, i.e. no un-cropped token should appear after the corrupted part. This is roughly equivalent to seq2seq denoising or the Prefix LM pre-training objective. + +Since LM is a special case of Prefix-LM, we did not find it necessary to include a casual LM task into the mixture. All tasks have an approximate equal participation in the mixture. We also explore an alternative where we increase number of S-denoisers up to $50\%$ of denoisers in the Mixture and all other denoisers take up the remainder. We present detailed ablation studies of various design choices in the later sections. + +Finally, the mixing in Mixture-of-Denoisers is what makes it universally powerful. Alone, some of the denoiser types do not perform well. For instance, the original T5 paper explored an option with $50\%$ corruption rate (X-denoising) and found that to not work well. + +The implementation of UL2's mixture of denoiser is simple and easy to implement using a library like seqio² (Roberts et al., 2022). See appendix for more details on implementation. + +# 2.3 MODE SWITCHING + +We introduce the notion of paradigm-shifting via mode switching. During pre-training, we feed the model an extra paradigm token, i.e., $\{[\mathbb{R}], [\mathbb{S}], [\mathbb{X}]\}$ that helps the model switch gears and operate on a mode that is more suitable for the given task. For fine-tuning and downstream few-shot learning, to trigger the model to learn better solutions, we also add a paradigm token with respect to the setups and requirements of the downstream task. Mode switching in fact binds downstream behavior to one of the modes we used during upstream training. + +# 2.4 MODEL ARCHITECTURE + +UL2 adopts an architecture-agnostic philosophy. We argue that the choice between both architectures (encoder-decoder vs decoder-only) is a more of an efficiency trade-off and that architecture + +Table 2: Experimental results on a suite of language understanding and generation tasks on both supervised and one-shot setup. Models are pretrained on 32B tokens. + +
ObjArchParamsSupervised FinetuningIn-context One-shot
SGXSSGDTOTSGXSSGDTOTLM
CLMDec167M62.2428.1855.4459.4039.221.161.400.20-2.35
PLMDec167M62.4428.2155.5559.5242.541.083.706.40-2.54
SCDec167M67.6729.1455.4860.4738.531.162.201.60-3.62
SCLMDec167M63.3629.0255.7160.0040.783.031.270.10-2.38
UL2Dec167M65.5028.9055.8060.3942.308.016.305.80-2.34
PLMED335M69.3031.9555.7060.9138.186.507.113.90-2.42
SCED335M72.0031.0555.8061.2538.517.491.432.10-7.23
SCLMED335M72.5031.6955.7060.9439.745.138.707.30-2.40
UniLMED335M71.1031.0055.8361.0339.866.706.504.10-2.65
UL2ED335M73.1031.8656.1061.5041.3011.516.636.50-2.55
+ +choice should not be conflated with the pretraining objective. Hence, we have both a UL2 decoder and UL2 encoder-decoder in similar spirit to how there are multiple sizes per model. We discuss this efficiency trade-off in detail in our experiment section. UL2 adopts a pretty standard vanilla T5 Transformer that have been enhanced with modifications that have withstood the test of time, i.e., GLU layers (Shazeer, 2020) and T5-style relative attention. To not further conflate architectural modifications with pretraining contributions, the backbone of the model remains similar to a T5-like model. This is also in light of results such as (Narang et al., 2021). + +# 3 ABLATIVE EXPERIMENTS + +This section describes our ablative experimental setup (e.g., baselines, datasets, implementation details) and results. Our overall findings show that UL2 outperforms T5-like and GPT-like models on 9 out of 9 tasks. + +Baselines For pre-training objectives, we compare with the following pre-training baselines: (1) Causal Language Model, (2) Prefix Language model, (3) Span Corruption (SC), (4) Span Corruption + LM (SCLM), and (5) UniLM (Dong et al., 2019). For all objectives, we explore both singlestack and encoder-decoder architectures. All architectures are inputs-to-targets either implemented in encoder-decoder or decoder-only model structures since we consider BERT-style masked language modeling pretraining to have already been effectively subsumed by this style of pretraining, as empirically made evident in (Raffel et al., 2019). Task-specific classification heads are also not recommended, since they clearly go against the principle of having a universal model (and are also very cumbersome). + +Experimental Setup We conduct our experiments on a diverse set of supervised and prompt-based few-shot learning tasks. To enable the comparison between models from this perspective, we need an aggregate performance score. However, metrics on different tasks we include are widely different in nature – take, for example, F1 and perplexity. To address this, we opt to report and use the normalized relative gain with respect to baselines as an overall metric. For this purpose, we use the standard language model (decoder-only) (GPT-like) and standard span denoising encoder-decoder (T5) as prime baselines and report all methods against their relative performance against these well-established candidates. We believe this is the most suitable method for comparing these models since it is easy to reason about how much a new model is generally better than a popular setting (e.g., GPT or T5-like). The full details of our experimental setup, including metrics, datasets and implementation details can be found in the Appendix. + +# 3.1 OVERVIEW OF ABLATIVE EXPERIMENTAL RESULTS + +Table 2 reports the raw results on all the benchmark tasks and datasets. To facilitate easier comparison across setups, we also report relative comparisons against well-established baselines such as T5 and GPT models. This is reported in Tables 3 and 4 respectively. + +Table 3: Relative performance compared to standard encoder-decoder span corruption model (T5). Results in this table are expressed in terms of relative percentage improvements over a baseline. Model with $\star$ denotes the main compared baseline. Overall score column is normalized to be weighted equally across tasks. + +
ObjArchSupervisedOne-shot
SGXSSGDTOTSGLXSSGDTOTLMAllWin
CLMDec-13.6-9.2-0.7-3.0+1.8-91.7-2.2-90.5+208-31.72/9
PLMDec-13.3-9.2-0.5-2.8+10.5-85.6+158+205+185-11.04/9
SCDec-5.6-6.2-0.6-1.3+0.05-84.5+54-23.8+99-20.63/9
SCLMDec-6.0-6.5-0.2-2.0+5.9-59.6-11.3-95+204-16.12/9
UniLMDec-10.1-8.2-0.2-2.3-5.3-69.1+382+110+200-16.13/9
UL2Dec-9.0-6.90.0-1.4+9.8+6.9+340+176+209+14.15/9
PLMED-3.7+2.9-0.2-0.6-0.86-13.3+397+86+199+16.75/9
SC*ED0.00.00.00.00.00.00.00.00.00.0-
SCLMED+0.7+2.1-0.2-0.5+3.2-31.6+508+248+201+28.37/9
UniLMED-1.2-0.2+0.1-0.4+3.5-11.0+355+95+173+19.85/9
UL2ED+1.5+2.6+0.5+0.4+7.2+53.6+363+210+184+43.69/9
+ +Table 4: Relative performance compared to standard decoder causal language model (GPT-like). Results in this table are expressed in terms of relative percentage improvements over a baseline. Model with $\star$ denotes the main compared baseline. Overall score column is normalized to be weighted equally across tasks. + +
ObjArchSupervisedOne-shot
SGXSSGDTOTSGXSSGDTOTLMAllWin
CLM*Dec0.00.00.00.00.00.00.00.00.00.0-
PLMDec+0.3+0.1+0.2+0.2+8.5+74.3+164+3100-8.0+21.48/9
UniLMDec+4.0+1.1+0.5+0.7-7.0+274+393+2100-2.5+21.07/9
SCDec+8.7+3.4+0.1+1.8-1.8+87.0+57.1+700-54.2+13.97/9
SCLMDec+1.8+3.0+0.5+1.0+4.0+387-9.3-50-1.3+15.86/9
UL2Dec+5.2+2.6+0.6+1.7+7.9+1190+350+2800+0.3+45.79/9
PLMED+11.3+13.4+0.5+2.5-2.6+946+408+1850-2.9+48.67/9
SCED+16.5+10.2+0.6+3.1-1.8+1107+2.3+950-208+31.77/9
SCLMED+15.7+12.5+0.5+2.6+1.3+726+522+3550-2.2+60.38/9
UniLMED+14.2+10.0+0.7+2.7+1.6+974+365+1950-12.9+52.68/9
UL2ED+17.4+13.1+1.2+3.5+5.3+1754+373+3150-8.3+76.18/9
+ +Decoder Vs Encoder-Decoder Before we dive into the results of this segment, we would like to remind readers that there is no easy way to compare decoder-only models with encoder-decoder models. In short, we can either compare them in a compute-matched setup or a parameter-matched way. Therefore, the encoder-decoder models in these set of results have approximately twice the number of parameters as the decoder models but have similar speeds. + +We note that this may slightly favor encoder-decoders since this can be interpreted form of model sparsity. Moving back to the results, when using T5 as the reference baseline, we note that, with the exception of UL2 Decoder, none of the pre-trained decoders models outperform T5. Additionally, there is a $10\%$ to $30\%$ degradation in overall relative performance. The best decoder baseline model here is the Prefix-LM decoder model, which is about $10\%$ worse than the T5 baseline. It is clear from these results that encoder-decoder models should be preferred over decoder-only models if and only if there is no concern about storage, i.e., parameter counts are generally less important than actual throughput (see (Dehghani et al., 2021a) for a detailed discussion). + +When there is a parameter constraint, the Prefix-LM decoder makes for a suitable alternative. Finally, an interesting data point is how we were able to push the UL2 decoder to outperform the T5 encoder-decoder setup by $+14.6\%$ . That said, this UL2 decoder does not outperform our UL2 encoder-decoder. However, this reinforces our point that the self-supervision objective may be intrinsically more important than the backbone architecture and negotiating architectural choices is mainly about efficiency trade-offs that can be studied independently. + +Is GPT and/or T5 the optimal setup? Based on the relative comparisons against a GPT-like (causal LM + decoder) and T5-like (span corruption + encoder decoder) setup, we are able to easily identify if the well-established setups are indeed optimal or already close to optimal. Firstly, the causal LM (GPT-like) setup appears to be the worse configuration as it is outperformed by all our baselines. We thus make the straightforward recommendation of always at least training with Prefix-LM or UniLM whenever possible. The best decoder-only model (with the exception of UL2) is the Prefix-LM pre-training that keeps a memory prefix for a language model to condition on. Regarding Prefix-LM pre-training, it is interesting that Prefix-LM actually outperforms the T5 span corrupt setup by $+16.7\%$ . The Prefix-LM encoder-decoder model is indeed less effective than the default T5 model on SuperGLUE but is on a whole, stronger especially when it comes to one-shot or open text-generation. Overall, between the Prefix-LM and the span corruption encoder-decoder model (T5), it is unclear to which is the universally superior model as there are gives and takes across the different sub-tasks although it is worthy noting the Prefix-LM EncDec model only sacrifices a minor degradation in certain tasks for a huge multifold increase in other tasks. + +On the Performance of UniLM and SCLM On the encoder-decoder setup, both the UniLM and SCLM objective performs better than the standard span corruption objective in terms of aggregated and normalized overall gain. This shows that, in general, mixing pre-training objectives is helpful. On the decoder setup, there is an overall gain of $+9.4\%$ gain for UniLM and $+16.1\%$ for SCLM compared to the baseline causal LM. In terms of individual tasks, UniLM and SCLM both outperforms T5 on 6 out of 9 tasks. It is also noteworthy that SCLM performs the best out of all models on 1shot generation (SGD and TOTTO). + +On the Performance of the Proposed UL2 Finally, we note that UL2 performs the best when compared against both the GPT-like model and the T5-like model. Overall, UL2 outperforms by $\mathrm{T}5 + 43.4\%$ and $+76.2\%$ when compared to the GPT-like CLM decoder model. This is the highest relative (overall) gain compared to all other alternatives. We also note that on all individual tasks, UL2 outperforms T5 on all 9 out of 9 considered tasks. Hence, UL2 is a universally better option compared to the span corruption T5 model. While UL2 doesn't always outperform all baselines on all individual tasks, UL2 is very consistent. Even when it loses to another method on a task, the loss is relatively marginal (e.g., 6.5 vs 7.3 on one-shot TOTTO). Conversely, when UL2 outperforms a baseline like T5, the gain can be as large as $+363\%$ . UL2 remains the most consistently strong method. The consistent improvement also suggests that it can be used as a more consistent replacement to T5 and GPT-like models. + +# 4 SCALING TO 20B PARAMETERS + +We are also interested to evaluate UL2 in a scaled up setting. We trained a 20B UL2 model that we eventually released publicly. This section describes the highlights of our experimental results for UL2 20B. + +# 4.0.1 EXPERIMENTS ON SUPERVISED FINETUNING + +We conduct experiments over 50 NLP tasks under the supervised finetuning paradigm. These tasks range from language generation (with automated and human evaluation), language understanding, text classification, question answering, commonsense reasoning, long text reasoning, structured knowledge grounding and information retrieval. The full list of 50 tasks and their corresponding experimental results can be found in the Appendix in 11. Overall, our experimental results show that UL2 achieves state-of-the-art performance on around $50+$ NLP tasks and setups. Finally, we note that UL2 20B does pretty well on human evaluation on GENIE tasks, outperforming sota on several metrics. This ascertains that the generation quality of UL2 is reasonably solid. + +# 4.0.2 RESULTS ON ZERO-SHOT AND ONE-SHOT LEARNING + +Table 5 reports results on zero-shot SuperGLUE. We note that UL2 20B outperforms GPT-3 and other compute-matched models on zero-shot NLU. + +Table 5: Results on zero-shot learning on SuperGLUE dataset. We compare with GPT-3, GLaM and PaLM (Chowdhery et al., 2022). We also include models that are relatively compute-matched with UL20B such as T5-XXL with LM adaptation (Lester et al., 2021), GPT-3 13B and GLaM-8B dense. Notably, UL20B outperforms GPT-3 175B and all other models in a similar compute class on average score. + +
ModelBoolQCBRTEReCORDWSCWiCCOPAMultiRCAvg
ST-MoE-32B (269B)40.841.152.750.057.550.056.030.347.6
GPT-3 175B60.546.463.590.265.40.091.072.961.2
GLaM-MoE 1.2T83.033.968.890.384.950.590.045.168.3
PaLM 540B88.051.872.992.989.159.193.083.578.8
T5-XXL44.337.548.885.859.350.970.023.052.5
GPT-3 13B66.219.662.889.064.40.084.071.457.2
PaLM-Dense 8B68.341.154.287.878.947.086.047.563.9
UL2 20B (single ckpt)63.141.160.788.179.949.885.036.263.0
UL2 20B (best)63.150.060.788.180.655.288.036.265.2
+ +Table 6: Results on One-Shot Summarization on XSUM. + +
ModelRouge-1Rouge-2Rouge-L
LaMDA 137B-5.4-
PaLM 62B-11.2-
PaLM 540B-12.2-
PaLM 8B-7.9-
T5 XXL 11B0.60.10.6
T5 XXL 11B + LM13.32.310.7
UL2 20B25.58.619.8
+ +Table 14 reports results on 1-shot summarization. Our results show that the performance of UL2 20B is about $3\mathrm{x}$ the performance of LM adapted T5 XXL model. Moreover, UL2 20B outperform LaMDA 137B and has better performance compared to PaLM 8B which is approximately compute-matched with UL2. The best result, however, is still the larger 540B and 62B PaLM models. + +# 4.0.3 RESULTS ON CHAIN-OF-THOUGHT REASONING + +We conduct experiments (full details in Appendix) to show that UL2 20B is capable of performing chain-of-thought reasoning (Wei et al., 2022b). Whereas most prior success on chain-of-thought has been shown on large and non-public models, UL2 is a comparatively smaller and publicly available. + +Table 7: Chain-of-thought prompting and self-consistency (SC) results on five arithmetic reasoning benchmarks. Full details in Appendix. + +
ModelGSM8KSVAMPASDivAQuAMAWPSAverage
UL2 20B: standard prompting4.110.116.020.516.613.5
UL2 20B: CoT prompting4.412.516.923.619.115.3
UL2 20B: CoT prompting + calc.6.928.334.323.642.727.2
UL2 20B: CoT prompting + calc. + SC10.241.443.526.957.936.0
+ +# 5 CONCLUSION + +We proposed a new paradigm for training universally effective models. UL2 is characterized by two key ideas. Firstly, we propose a new Mixture of Denoisers (MoD) pretraining that frames multiple pretraining tasks as span corruption, diversifies and then mixes them. Secondly, we introduce mode switching, a way of associating downstream task behaviour to upstream pretraining. Extensive ablative experiments show that UL2 consistently outperforms GPT-like and T5 models on a wide range of supervised and few-shot tasks, outperforming T5 on 9 out of 9 tasks and by a normalized overall gain of $+76.1\%$ . Finally, we scale UL2 up to 20B parameters and conduct experiments on a diverse suite of 50 to 60 NLP tasks and setups. UL2 achieves sota performance on 50 of them. Pretrained checkpoints will be released at https://github.com/anonymous. + +# REFERENCES + +Armen Aghajanyan, Akshit Shrivastava, Anchit Gupta, Naman Goyal, Luke Zettlemoyer, and Sonal Gupta. Better fine-tuning by reducing representational collapse. arXiv preprint arXiv:2008.03156, 2020. +Armen Aghajanyan, Dmytro Okhonko, Mike Lewis, Mandar Joshi, Hu Xu, Gargi Ghosh, and Luke Zettlemoyer. Htlm: Hyper-text pre-training and prompting of language models. arXiv preprint arXiv:2107.06955, 2021. +Rami Aly, Zhijiang Guo, Michael Sejr Schlichtkrull, James Thorne, Andreas Vlachos, Christos Christodoulopoulos, Oana Cocarascu, and Arpit Mittal. The fact extraction and VERIFICATION over unstructured and structured information (FEVEROUS) shared task. In Proceedings of the Fourth Workshop on Fact Extraction and VERIFICATION (FEVER), pp. 1-13, Dominican Republic, November 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.fever-1.1. URL https://aclanthology.org/2021.fever-1.1. +Vamsi Aribandi, Yi Tay, Tal Schuster, Jinfeng Rao, Huaixiu Steven Zheng, Sanket Vaibhav Mehta, Honglei Zhuang, Vinh Q Tran, Dara Bahri, Jianmo Ni, et al. Ext5: Towards extreme multi-task scaling for transfer learning. arXiv preprint arXiv:2111.10952, 2021. +Shreyan Bakshi, Soumya Batra, Peyman Heidari, Ankit Arun, Shashank Jain, and Michael White. Structure-to-text generation with self-training, acceptability classifiers and context-conditioning for the gem shared task. In Proceedings of the 1st Workshop on Natural Language Generation, Evaluation, and Metrics (GEM 2021), pp. 136-147, 2021. +Chandra Bhagavatula, Ronan Le Bras, Chaitanya Malaviya, Keisuke Sakaguchi, Ari Holtzman, Hannah Rashkin, Doug Downey, Scott Wen-tau Yih, and Yejin Choi. Abductive commonsense reasoning. arXiv preprint arXiv:1908.05739, 2019. +Yonatan Bisk, Rowan Zellers, Jianfeng Gao, Yejin Choi, et al. Piqa: Reasoning about physical commonsense in natural language. In Proceedings of the AAAI conference on artificial intelligence, volume 34, pp. 7432-7439, 2020. +Daniel Borkan, Lucas Dixon, Jeffrey Sorensen, Nithum Thain, and Lucy Vasserman. Nuanced metrics for measuring unintended bias with real data for text classification. CoRR, abs/1903.04561, 2019. URL http://arxiv.org/abs/1903.04561. +James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal Maclaurin, George Necula, Adam Paszke, Jake VanderPlas, Skye Wanderman-Milne, and Qiao Zhang. JAX: composable transformations of Python+NumPy programs, 2018. URL http://github.com/google/jax. +Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020. +Thiago Castro Ferreira, Claire Gardent, Nikolai Ilinykh, Chris van der Lee, Simon Mille, Diego Moussallem, and Anastasia Shimorina. The 2020 bilingual, bi-directional webnlg+ shared task overview and evaluation results (webnlg+ 2020). In Proceedings of the 3rd WebNLG Workshop on Natural Language Generation from the Semantic Web (WebNLG+ 2020), pp. 55-76, Dublin, Ireland (Virtual), 2020. Association for Computational Linguistics. +Mingda Chen, Zewei Chu, Sam Wiseman, and Kevin Gimpel. Summscreen: A dataset for abstractive screenplay summarization. arXiv preprint arXiv:2104.07091, 2021. +Wenhu Chen, Hongmin Wang, Jianshu Chen, Yunkai Zhang, Hong Wang, Shiyang Li, Xiyou Zhou, and William Yang Wang. Tabfact: A large-scale dataset for table-based fact verification. arXiv preprint arXiv:1909.02164, 2019. +Wenhu Chen, Hanwen Zha, Zhiyu Chen, Wenhan Xiong, Hong Wang, and William Wang. Hybridqa: A dataset of multi-hop question answering over tabular and textual data. arXiv preprint arXiv:2004.07347, 2020. + +Aakanksha Chowdhery, Sharan Narang, and Jacob Devlin. Palm: Scaling language modeling with pathways. arXiv preprint, 2022. +Peter Clark, Isaac Cowhey, Oren Etzioni, Tushar Khot, Ashish Sabharwal, Carissa Schoenick, and Oyvind Tafjord. Think you have solved question answering? try arc, the AI2 reasoning challenge. CoRR, abs/1803.05457, 2018. URL http://arxiv.org/abs/1803.05457. +Jordan Clive, Kris Cao, and Marek Rei. Control prefixes for text generation. CoRR, abs/2110.08329, 2021. URL https://arxiv.org/abs/2110.08329. +Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Jacob Hilton, Reiichiro Nakano, Christopher Hesse, and John Schulman. Training verifiers to solve math word problems. arXiv preprint arXiv:2110.14168, 2021. URL https://arxiv.org/abs/2110.14168. +Andrew M Dai and Quoc V Le. Semi-supervised sequence learning. Advances in neural information processing systems, 28:3079-3087, 2015. +Pradeep Dasigi, Kyle Lo, Iz Beltagy, Arman Cohan, Noah A Smith, and Matt Gardner. A dataset of information-seeking questions and answers anchored in research papers. arXiv preprint arXiv:2105.03011, 2021. +Mostafa Dehghani, Anurag Arnab, Lucas Beyer, Ashish Vaswani, and Yi Tay. The efficiency m-nomer. arXiv preprint arXiv:2110.12894, 2021a. +Mostafa Dehghani, Yi Tay, Alexey A Gritsenko, Zhe Zhao, Neil Houlsby, Fernando Diaz, Donald Metzler, and Oriol Vinyals. The benchmark lottery. 2021b. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018. +Li Dong, Nan Yang, Wenhui Wang, Furu Wei, Xiaodong Liu, Yu Wang, Jianfeng Gao, Ming Zhou, and Hsiao-Wuen Hon. Unified language model pre-training for natural language understanding and generation. arXiv preprint arXiv:1905.03197, 2019. +Nan Du, Yanping Huang, Andrew M Dai, Simon Tong, Dmitry Lepikhin, Yuanzhong Xu, Maxim Krikun, Yanqi Zhou, Adams Wei Yu, Orhan First, et al. Glam: Efficient scaling of language models with mixture-of-experts. arXiv preprint arXiv:2112.06905, 2021. +Ondrej Dusek, David M Howcroft, and Verena Rieser. Semantic Noise Matters for Neural Natural Language Generation. In Proceedings of the 12th International Conference on Natural Language Generation (INLG 2019), pp. 421-426, Tokyo, Japan, 2019. URL https://www.aclweb.org/anthology/W19-8652/. +Julian Martin Eisenschlos, Maharshi Gor, Thomas Müller, and William W Cohen. Mate: Multi-view attention for table transformer efficiency. arXiv preprint arXiv:2109.04312, 2021. +Alexander R Fabbri, Irene Li, Tianwei She, Suyi Li, and Dragomir R Radev. Multi-news: A large-scale multi-document summarization dataset and abstractive hierarchical model. arXiv preprint arXiv:1906.01749, 2019. +William Fedus, Barret Zoph, and Noam Shazeer. Switch transformers: Scaling to trillion parameter models with simple and efficient sparsity. arXiv preprint arXiv:2101.03961, 2021. +Wikipedia Foundation. Acl 2019 fourth conference on machine translation (wmt19), shared task: Machine translation of news. URL http://www.statmt.org/wmt19/translation-task.html. +Sebastian Gehrmann, Tosin Adewumi, Karmanya Aggarwal, Pawan Sasanka Ammanamanchi, Aremu Anuoluwapo, Antoine Bosselut, Khyathi Raghavi Chandu, Miruna Clinciu, Dipanjan Das, Kaustubh D Dhole, et al. The gem benchmark: Natural language generation, its evaluation and metrics. arXiv preprint arXiv:2102.01672, 2021. +Sebastian Gehrmann, Elizabeth Clark, and Thibault Sellam. Repairing the cracked foundation: A survey of obstacles in evaluation practices for generated text. arXiv preprint arXiv:2202.06935, 2022. + +Mor Geva, Daniel Khashabi, Elad Segal, Tushar Khot, Dan Roth, and Jonathan Berant. Did aristotle use a laptop? A question answering benchmark with implicit reasoning strategies. TACL, 2021. doi: 10.1162/tacl_a_00370. URL https://aclanthology.org/2021.tacl-1.21. +Bogdan Gliwa, Iwona Mochol, Maciej Biesek, and Aleksander Wawer. Samsum corpus: A human-annotated dialogue dataset for abstractive summarization. arXiv preprint arXiv:1911.12237, 2019. +Pengcheng He, Xiaodong Liu, Jianfeng Gao, and Weizhu Chen. Deberta: Decoding-enhanced bert with disentangled attention. arXiv preprint arXiv:2006.03654, 2020. +Yun He, Huaixiu Steven Zheng, Yi Tay, Jai Gupta, Yu Du, Vamsi Aribandi, Zhe Zhao, YaGuang Li, Zhao Chen, Donald Metzler, et al. Hyperprompt: Prompt-based task-conditioning of transformers. arXiv preprint arXiv:2203.00759, 2022. +Karl Moritz Hermann, Tomas Kocisky, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa Suleyman, and Phil Blunsom. Teaching machines to read and comprehend. In Advances in neural information processing systems, pp. 1693-1701, 2015. +Jeremy Howard and Sebastian Ruder. Universal language model fine-tuning for text classification. arXiv preprint arXiv:1801.06146, 2018. +Lifu Huang, Ronan Le Bras, Chandra Bhagavatula, and Yejin Choi. Cosmos qa: Machine reading comprehension with contextual commonsense reasoning. arXiv preprint arXiv:1909.00277, 2019. +Luyang Huang, Shuyang Cao, Nikolaus Parulian, Heng Ji, and Lu Wang. Efficient attentions for long document summarization. arXiv preprint arXiv:2104.02112, 2021. +Mohit Iyyer, Wen-tau Yih, and Ming-Wei Chang. Search-based neural structured learning for sequential question answering. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1821-1831, 2017. +Mandar Joshi, Danqi Chen, Yinhan Liu, Daniel S Weld, Luke Zettlemoyer, and Omer Levy. Spanbert: Improving pre-training by representing and predicting spans. Transactions of the Association for Computational Linguistics, 8:64-77, 2020. +Norman P Jouppi, Doe Hyun Yoon, George Kurian, Sheng Li, Nishant Patil, James Laudon, Cliff Young, and David Patterson. A domain-specific supercomputer for training deep neural networks. Communications of the ACM, 63(7):67-78, 2020. +Jared Kaplan, Sam McCandlish, Tom Henighan, Tom B Brown, Benjamin Chess, Rewon Child, Scott Gray, Alec Radford, Jeffrey Wu, and Dario Amodei. Scaling laws for neural language models. arXiv preprint arXiv:2001.08361, 2020. +Daniel Khashabi, Sewon Min, Tushar Khot, Ashish Sabharwal, Oyvind Tafjord, Peter Clark, and Hannaneh Hajishirzi. Unifiedqa: Crossing format boundaries with a single qa system. arXiv preprint arXiv:2005.00700, 2020. +Daniel Khashabi, Gabriel Stanovsky, Jonathan Bragg, Nicholas Lourie, Jungo Kasai, Yejin Choi, Noah A. Smith, and Daniel S. Weld. GENIE: A leaderboard for human-in-the-loop evaluation of text generation. CoRR, abs/2101.06561, 2021. URL https://arxiv.org/abs/2101.06561. +Daniel Khashabi, Yeganeh Kordi, and Hannaneh Hajishirzi. Unifiedqa-v2: Stronger generalization via broader cross-format training. arXiv preprint arXiv:2202.12359, 2022. +Tushar Khot, Peter Clark, Michal Guerquin, Peter Jansen, and Ashish Sabharwal. Qasc: A dataset for question answering via sentence composition. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pp. 8082-8090, 2020. +Tomáš Kočisky, Jonathan Schwarz, Phil Blunsom, Chris Dyer, Karl Moritz Hermann, Gábor Melis, and Edward Grefenstette. The NarrativeQA Reading Comprehension Challenge. Transactions of the Association for Computational Linguistics, 2018. + +Rik Koncel-Kedziorski, Subhro Roy, Aida Amini, Nate Kushman, and Hannaneh Hajishirzi. MAWPS: A math word problem repository. NAACL, 2016. doi: 10.18653/v1/N16-1136. URL https://aclanthology.org/N16-1136. +Yuta Koreeda and Christopher D Manning. Contractnli: A dataset for document-level natural language inference for contracts. arXiv preprint arXiv:2110.01799, 2021. +Tom Kwiatkowski, Jennimaria Palomaki, Olivia Redfield, Michael Collins, Ankur Parikh, Chris Alberti, Danielle Epstein, Illia Polosukhin, Jacob Devlin Kenton Lee, Kristina Toutanova, Llion Jones Matthew Kelcey, Ming-Wei Chang, Andrew M Dai, Jakob Uszkoreit, Quoc Le, and Slav Petrov. Natural Questions: a Benchmark for Question Answering Research. In Transactions of the ACL, 2019. +Guokun Lai, Qizhe Xie, Hanxiao Liu, Yiming Yang, and Eduard Hovy. RACE: Large-scale ReAding comprehension dataset from examinations. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pp. 785-794, Copenhagen, Denmark, September 2017. Association for Computational Linguistics. doi: 10.18653/v1/D17-1082. URL https://aclanthology.org/D17-1082. +Alyssa Lees, Vinh Q Tran, Yi Tay, Jeffrey Sorensen, Jai Gupta, Donald Metzler, and Lucy Vasserman. A new generation of perspective api: Efficient multilingual character-level transformers. arXiv preprint arXiv:2202.11176, 2022. +Dmitry Lepikhin, HyoukJoong Lee, Yuanzhong Xu, Dehao Chen, Orhan First, Yanping Huang, Maxim Krikun, Noam Shazeer, and Zhifeng Chen. Gshard: Scaling giant models with conditional computation and automatic sharding. arXiv preprint arXiv:2006.16668, 2020. +Brian Lester, Rami Al-Rfou, and Noah Constant. The power of scale for parameter-efficient prompt tuning. arXiv preprint arXiv:2104.08691, 2021. +Haoran Li, Abhinav Arora, Shuohui Chen, Anchit Gupta, Sonal Gupta, and Yashar Mehdad. Mtop: A comprehensive multilingual task-oriented semantic parsing benchmark. arXiv preprint arXiv:2008.09335, 2020. +Bill Yuchen Lin, Wangchunshu Zhou, Ming Shen, Pei Zhou, Chandra Bhagavatula, Yejin Choi, and Xiang Ren. CommonGen: A constrained text generation challenge for generative commonsense reasoning. In Findings of the Association for Computational Linguistics: EMNLP 2020, pp. 1823-1840, Online, November 2020. Association for Computational Linguistics. URL https://www.aclweb.org/anthology/2020-findings-emnlp.165. +Wang Ling, Dani Yogatama, Chris Dyer, and Phil Blunsom. Program induction by rationale generation: Learning to solve and explain algebraic word problems. ACL, 2017. doi: 10.18653/v1/P17-1015. URL https://aclanthology.org/P17-1015. +Peter J Liu, Mohammad Saleh, Etienne Pot, Ben Goodrich, Ryan Sepassi, Lukasz Kaiser, and Noam Shazeer. Generating wikipedia by summarizing long sequences. arXiv preprint arXiv:1801.10198, 2018. +Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692, 2019. +Nicholas Lourie, Ronan Le Bras, Chandra Bhagavatula, and Yejin Choi. *Unicorn on rainbow: A universal commonsense reasoning model on a new multitask benchmark.* arXiv preprint arXiv:2103.13009, 2021. +Andrew L. Maas, Raymond E. Daly, Peter T. Pham, Dan Huang, Andrew Y. Ng, and Christopher Potts. Learning word vectors for sentiment analysis. In Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies, pp. 142-150, Portland, Oregon, USA, June 2011. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/P11-1015. + +Shen Yun Miao, Chao Chun Liang, and Keh Yih Su. A diverse corpus for evaluating and developing English math word problem solvers. ACL, 2020. doi: 10.18653/v1/2020.acl-main.92. URL https://aclanthology.org/2020.acl-main.92. +Todor Mihaylov, Peter Clark, Tushar Khot, and Ashish Sabharwal. Can a suit of armor conduct electricity? a new dataset for open book question answering. arXiv preprint arXiv:1809.02789, 2018. +Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems, pp. 3111-3119, 2013. +Linyong Nan, Dragomir Radev, Rui Zhang, Amrit Rau, Abhinand Sivaprasad, Chiachun Hsieh, Xiangru Tang, Aadit Vyas, Neha Verma, Pranav Krishna, et al. Dart: Open-domain structured data record to text generation. arXiv preprint arXiv:2007.02871, 2020. +Linyong Nan, Chiachun Hsieh, Ziming Mao, Xi Victoria Lin, Neha Verma, Rui Zhang, Wojciech Krysciński, Nick Schoelkopf, Riley Kong, Xiangru Tang, et al. Fetaqa: Free-form table question answering. arXiv preprint arXiv:2104.00369, 2021. +Sharan Narang, Hyung Won Chung, Yi Tay, William Fedus, Thibault Fevry, Michael Matena, Karishma Malkan, Noah Fiedel, Noam Shazeer, Zhenzhong Lan, et al. Do transformer modifications transfer across implementations and applications? arXiv preprint arXiv:2102.11972, 2021. +Shashi Narayan, Shay B. Cohen, and Mirella Lapata. Don't give me the details, just the summary! topic-aware convolutional neural networks for extreme summarization. ArXiv, abs/1808.08745, 2018. +Shashi Narayan, Yao Zhao, Joshua Maynez, Goncalo Simões, Vitaly Nikolaev, and Ryan McDonald. Planning with learned entity prompts for abstractive summarization. Transactions of the Association for Computational Linguistics, 9:1475-1492, 2021. doi: 10.1162/tacl_a_00438. URL https://aclanthology.org/2021.tacl-1.88. +ME Peters M Neumann, M Iyyer, M Gardner, C Clark, K Lee, and L Zettlemoyer. Deep contextualized word representations. arXiv preprint arXiv:1802.05365, 2018. +Yixin Nie, Adina Williams, Emily Dinan, Mohit Bansal, Jason Weston, and Douwe Kiela. Adversarial nli: A new benchmark for natural language understanding. arXiv preprint arXiv:1910.14599, 2019. +Long Ouyang, Jeff Wu, Xu Jiang, Diogo Almeida, Carroll L Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, et al. Training language models to follow instructions with human feedback. arXiv preprint arXiv:2203.02155, 2022. URL http://go/arxiv/2203.02155. +Richard Yuanzhe Pang, Alicia Parrish, Nitish Joshi, Nikita Nangia, Jason Phang, Angelica Chen, Vishakh Padmakumar, Johnny Ma, Jana Thompson, He He, et al. Quality: Question answering with long input texts, yes! arXiv preprint arXiv:2112.08608, 2021. +Ankur P Parikh, Xuezhi Wang, Sebastian Gehrmann, Manaal Faruqui, Bhuwan Dhingra, Diyi Yang, and Dipanjan Das. Toutto: A controlled table-to-text generation dataset. arXiv preprint arXiv:2004.14373, 2020. +Panupong Pasupat and Percy Liang. Compositional semantic parsing on semi-structured tables. arXiv preprint arXiv:1508.00305, 2015. +Arkil Patel, Satwik Bhattachamishra, and Navin Goyal. Are NLP models really able to solve simple math word problems? NAACL, 2021. URL https://aclanthology.org/2021.naacl-main.168.pdf. +Jeffrey Pennington, Richard Socher, and Christopher D Manning. Glove: Global vectors for word representation. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pp. 1532-1543, 2014. + +Guanghui Qin, Yukun Feng, and Benjamin Van Durme. The nlp task effectiveness of long-range transformers. arXiv preprint arXiv:2202.07856, 2022. +Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language Models are Unsupervised Multitask Learners. 2019. +Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. arXiv preprint arXiv:1910.10683, 2019. +Abhinav Rastogi, Xiaoxue Zang, Srinivas Sunkara, Raghav Gupta, and Pranav Khaitan. Towards scalable multi-domain conversational agents: The schema-guided dialogue dataset. arXiv preprint arXiv:1909.05855, 2019. +Adam Roberts, Hyung Won Chung, Anselm Levskaya, Gaurav Mishra, James Bradbury, Daniel Andor, Sharan Narang, Brian Lester, Colin Gaffney, Afroz Mohiuddin, Curtis Hawthorne, Aitor Lewkowycz, Alex Salcianu, Marc van Zee, Jacob Austin, Sebastian Goodman, Livio Baldini Soares, Haitang Hu, Sasha Tsvyashchenko, Aakanksha Chowdhery, Jasmijn Bastings, Jannis Bulian, Xavier Garcia, Jianmo Ni, Andrew Chen, Kathleen Kenealy, Jonathan H. Clark, Stephan Lee, Dan Garrette, James Lee-Thorp, Colin Raffel, Noam Shazeer, Marvin Ritter, Maarten Bosma, Alexandre Passos, Jeremy Maitin-Shepard, Noah Fiedel, Mark Omernick, Brennan Saeta, Ryan Sepassi, Alexander Spiridonov, Joshua Newlan, and Andrea Gesmundo. Scaling up models and data with t5x and seqio, 2022. URL https://arxiv.org/abs/2203.17189. +Anna Rogers, Olga Kovaleva, Matthew Downey, and Anna Rumshisky. Getting closer to ai complete question answering: A set of prerequisite real tasks. In Proceedings of the AAAI conference on artificial intelligence, volume 34, pp. 8722-8731, 2020. +Victor Sanh, Albert Webson, Colin Raffel, Stephen H Bach, Lintang Sutawika, Zaid Alyafeai, Antoine Chaffin, Arnaud Stiegler, Teven Le Scao, Arun Raja, et al. Multitask prompted training enables zero-shot task generalization. arXiv preprint arXiv:2110.08207, 2021. +Maarten Sap, Hannah Rashkin, Derek Chen, Ronan LeBras, and Yejin Choi. Socialiaq: Common-sense reasoning about social interactions. arXiv preprint arXiv:1904.09728, 2019. +Tal Schuster, Adam Fisch, and Regina Barzilay. Get your vitamin c! robust fact verification with contrastive evidence. arXiv preprint arXiv:2103.08541, 2021a. +Tal Schuster, Ashwin Kalyan, Alex Polozov, and Adam Tauman Kalai. Programming puzzles. In Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track (Round 1), 2021b. URL https://openreview.net/forum?id=fe_hCc4RBrg. +Uri Shaham, Elad Segal, Maor Ivgi, Avia Efrat, Ori Yoran, Adi Haviv, Ankit Gupta, Wenhan Xiong, Mor Geva, Jonathan Berant, and Omer Levy. Scrols: Standardized comparison over long language sequences, 2022. +Noam Shazeer. Glu variants improve transformer. arXiv preprint arXiv:2002.05202, 2020. +Noam Shazeer and Mitchell Stern. Adafactor: Adaptive learning rates with sublinear memory cost. In International Conference on Machine Learning, pp. 4596-4604. PMLR, 2018. +Mohammad Shoeybi, Mostofa Patwary, Raul Puri, Patrick LeGresley, Jared Casper, and Bryan Catanzaro. Megatron-lm: Training multi-billion parameter language models using model parallelism. arXiv preprint arXiv:1909.08053, 2019. +Aarohi Srivastava, Abhinav Rastogi, Abhishek Rao, Abu Awal Md Shoeb, Abubakar Abid, Adam Fisch, Adam R Brown, Adam Santoro, Aditya Gupta, Adrià Garriga-Alonso, et al. Beyond the imitation game: Quantifying and extrapolating the capabilities of language models. arXiv preprint arXiv:2206.04615, 2022. +Alon Talmor and Jonathan Berant. The web as a knowledge-base for answering complex questions. arXiv preprint arXiv:1803.06643, 2018. + +Alon Talmor, Jonathan Herzig, Nicholas Lourie, and Jonathan Berant. *Commonsenseqa: A question answering challenge targeting commonsense knowledge.* arXiv preprint arXiv:1811.00937, 2018. +Alon Talmor, Jonathan Herzig, Nicholas Lourie, and Jonathan Berant. *CommonsenseQA: A question answering challenge targeting commonsense knowledge*. *NAACL*, 2019. doi: 10.18653/v1/N19-1421. URL https://aclanthology.org/N19-1421. +Alon Talmor, Ori Yoran, Ronan Le Bras, Chandra Bhagavatula, Yoav Goldberg, Yejin Choi, and Jonathan Berant. *CommonsenseQA* 2.0: Exposing the limits of AI through gamification. In *Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track* (Round 1), 2021. URL https://openreview.net/forum?id=qF7FlUT5dxa. +Yi Tay, Zhe Zhao, Dara Bahri, Donald Metzler, and Da-Cheng Juan. Hypergrid: Efficient multi-task transformers with grid-wise decomposable hyper projections. arXiv preprint arXiv:2007.05891, 2020. +Yi Tay, Mostafa Dehghani, Jai Gupta, Dara Bahri, Vamsi Aribandi, Zhen Qin, and Donald Metzler. Are pre-trained convolutions better than pre-trained transformers? arXiv preprint arXiv:2105.03322, 2021a. +Yi Tay, Mostafa Dehghani, Jinfeng Rao, William Fedus, Samira Abnar, Hyung Won Chung, Sharan Narang, Dani Yogatama, Ashish Vaswani, and Donald Metzler. Scale efficiently: Insights from pre-training and fine-tuning transformers. arXiv preprint arXiv:2109.10686, 2021b. +Yi Tay, Vinh Q Tran, Sebastian Ruder, Jai Gupta, Hyung Won Chung, Dara Bahri, Zhen Qin, Simon Baumgartner, Cong Yu, and Donald Metzler. Charformer: Fast character transformers via gradient-based subword tokenization. arXiv preprint arXiv:2106.12672, 2021c. +Yi Tay, Vinh Q Tran, Mostafa Dehghani, Jianmo Ni, Dara Bahri, Harsh Mehta, Zhen Qin, Kai Hui, Zhe Zhao, Jai Gupta, et al. Transformer memory as a differentiable search index. arXiv preprint arXiv:2202.06991, 2022. +Romal Thoppilan, Daniel De Freitas, Jamie Hall, Noam Shazeer, Apoorv Kulshreshtha, Heng-Tze Cheng, Alicia Jin, Taylor Bos, Leslie Baker, Yu Du, YaGuang Li, Hongrae Lee, Huaixiu Steven Zheng, Amin Ghafouri, Marcelo Menegali, Yanping Huang, Maxim Krikun, Dmitry Lepikhin, James Qin, Dehao Chen, Yuanzhong Xu, Zhifeng Chen, Adam Roberts, Maarten Bosma, Yanqi Zhou, Chung-Ching Chang, Igor Krivokon, Will Rusch, Marc Pickett, Kathleen Meier-Hellstern, Meredith Ringel Morris, Tulsee Doshi, Renelito Delos Santos, Toju Duke, Johnny Soraker, Ben Zevenbergen, Vinodkumar Prabhakaran, Mark Diaz, Ben Hutchinson, Kristen Olson, Alejandra Molina, Erin Hoffman-John, Josh Lee, Lora Aroyo, Ravi Rajakumar, Alena Butryna, Matthew Lamm, Viktoriya Kuzmina, Joe Fenton, Aaron Cohen, Rachel Bernstein, Ray Kurzweil, Blaise Aguera-Arcas, Claire Cui, Marian Croak, Ed Chi, and Quoc Le. Lamda: Language models for dialog applications, 2022. +Hui Wan. Multi-task learning with multi-head attention for multi-choice reading comprehension. arXiv preprint arXiv:2003.04992, 2020. +Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R Bowman. Glue: A multi-task benchmark and analysis platform for natural language understanding. arXiv preprint arXiv:1804.07461, 2018. +Alex Wang, Yada Pruksachatkun, Nikita Nangia, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R Bowman. Superglue: A stickier benchmark for general-purpose language understanding systems. arXiv preprint arXiv:1905.00537, 2019. +Boxin Wang, Shuohang Wang, Yu Cheng, Zhe Gan, Ruoxi Jia, Bo Li, and Jingjing Liu. Infobert: Improving robustness of language models from an information theoretic perspective. arXiv preprint arXiv:2010.02329, 2020. +Thomas Wang, Adam Roberts, Daniel Hesslow, Teven Le Scao, Hyung Won Chung, Iz Beltagy, Julien Launay, and Colin Raffel. What language model architecture and pretraining objective work best for zero-shot generalization? arXiv preprint arXiv:2204.05832, 2022a. + +Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc Le, Ed Chi, Sharan Narang, Aakanksha Chowdhery, and Denny Zhou. Self-consistency improves chain of thought reasoning in language models. arXiv preprint arXiv:2203.11171, 2022b. URL https://arxiv.org/abs/2203.11171. +Jason Wei, Yi Tay, Rishi Bommasani, Colin Raffel, Barret Zoph, Sebastian Borgeaud, Dani Yogatama, Maarten Bosma, Denny Zhou, Donald Metzler, et al. Emergent abilities of large language models. Transactions on Machine Learning Research (TMLR), 2022a. URL http://go/arxiv/2206.07682. +Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Brian Ichter, Fei Xia, Ed Chi, Quoc Le, and Denny Zhou. Chain of thought prompting elicits reasoning in large language models. Conference on Neural Information Processing Systems (NeurIPS), 2022b. URL http://go/arxiv/2201.11903. +Alexander Wettig, Tianyu Gao, Zexuan Zhong, and Danqi Chen. Should you mask $15\%$ in masked language modeling? arXiv preprint arXiv:2202.08005, 2022. +Wen Xiao, Iz Beltagy, Giuseppe Carenini, and Arman Cohan. Primer: Pyramid-based masked sentence pre-training for multi-document summarization. arXiv preprint arXiv:2110.08499, 2021. +Tianbao Xie, Chen Henry Wu, Peng Shi, Ruiqi Zhong, Torsten Scholak, Michihiro Yasunaga, Chien-Sheng Wu, Ming Zhong, Pengcheng Yin, Sida I Wang, et al. Unifiedskg: Unifying and multi-tasking structured knowledge grounding with text-to-text language models. arXiv preprint arXiv:2201.05966, 2022. +Wenhan Xiong, Jiawei Wu, Hong Wang, Vivek Kulkarni, Mo Yu, Shiyu Chang, Xiaoxiao Guo, and William Yang Wang. Tweetqa: A social media focused question answering dataset. arXiv preprint arXiv:1907.06292, 2019. +Linting Xue, Noah Constant, Adam Roberts, Mihir Kale, Rami Al-Rfou, Aditya Siddhant, Aditya Barua, and Colin Raffel. mt5: A massively multilingual pre-trained text-to-text transformer. arXiv preprint arXiv:2010.11934, 2020. +Linting Xue, Aditya Barua, Noah Constant, Rami Al-Rfou, Sharan Narang, Mihir Kale, Adam Roberts, and Colin Raffel. Byt5: Towards a token-free future with pre-trained byte-to-byte models. arXiv preprint arXiv:2105.13626, 2021. +Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Russ R Salakhutdinov, and Quoc V Le. Xlnet: Generalized autoregressive pretraining for language understanding. Advances in neural information processing systems, 32, 2019. +Wenpeng Yin, Dragomir Radev, and Caiming Xiong. Docnli: A large-scale dataset for document-level natural language inference. arXiv preprint arXiv:2106.09449, 2021. +Rowan Zellers, Ari Holtzman, Yonatan Bisk, Ali Farhadi, and Yejin Choi. Hellaswag: Can a machine really finish your sentence? arXiv preprint arXiv:1905.07830, 2019. +Xiang Zhang, Junbo Zhao, and Yann LeCun. Character-level convolutional networks for text classification. Advances in neural information processing systems, 28, 2015. +Ming Zhong, Da Yin, Tao Yu, Ahmad Zaidi, Mutethia Mutuma, Rahul Jha, Ahmed Hassan Awadallah, Asli Celikyilmaz, Yang Liu, Xipeng Qiu, et al. Qmsum: A new benchmark for query-based multi-domain meeting summarization. arXiv preprint arXiv:2104.05938, 2021. +Victor Zhong, Caiming Xiong, and Richard Socher. Seq2sql: Generating structured queries from natural language using reinforcement learning. CoRR, abs/1709.00103, 2017. +Barret Zoph, Irwan Bello, Sameer Kumar, Nan Du, Yanping Huang, Jeff Dean, Noam Shazeer, and William Fedus. Designing effective sparse expert models, 2022. + +# A EXPERIMENTAL SETUP FOR ABLATIVE EXPERIMENTS + +# A.0.1 DATASETS AND TASKS + +The datasets we use are SuperGLUE (Wang et al., 2019), comprising of 8 NLU sub-tasks. We also conduct experiments on 3 datasets from the GEM benchmark (Gehrmann et al., 2021) that focuses on language generation problems. We arbitrarily select XSUM (summarization), ToTTo (table-to-text generation) (Parikh et al., 2020) and Schema Guided Dialog (SGD) (Rastogi et al., 2019) from the GEM benchmark. For all these tasks, we evaluate on both supervised fine-tuning and prompt-based one-shot learning. Finally we also compare our models on their general ability for text generation using perplexity scores on the C4 validation set. We believe our suite of tasks gives us good coverage across many setups in the literature including supervised and conditional few-shot learning. + +# A.0.2 METRICS AND HOLISTIC EVALUATION + +For SuperGLUE, we report well-established metrics such as accuracy, F1 or Exact Match, whenever appropriate. For GEM benchmark, we use the Rouge-L metric. For language modeling we report negative log perplexity. The universality of the models, i.e., their collective performance across all range of tasks, is a main evaluation criteria here. To enable the comparison between models from this perspective, we need an aggregate performance score. However, metrics on different tasks we include are widely different in nature – take, for example, F1 and perplexity. To address this, we opt to report and use the normalized relative gain with respect to baselines as an overall metric. For this purpose, we use the standard language model (decoder-only) (GPT-like) and standard span denoising encoder-decoder (T5) as prime baselines and report all methods against their relative performance against these well-established candidates. We believe this is the most suitable method for comparing these models since it is easy to reason about how much a new model is generally better than a popular setting (e.g., GPT or T5-like). We also highlight the fact that the overall gain is normalized, so this becomes harder to exploit or be susceptible to benchmark lottery effects (Dehghani et al., 2021b). + +# A.0.3 IMPLEMENTATION DETAILS + +Our experiments are all conducted in JAX/Flax (Bradbury et al., 2018) using the open source $\mathrm{T5X^3}$ framework (Roberts et al., 2022) and Flaxformer. We pre-train all models for $500\mathrm{K}$ steps with a batch size of 128 and a sequence length of 512 inputs and 512 targets using the C4 corpus. The total approximate tokens seen during pre-training is approximately 32 billion tokens. Each pretraining run is typically trained using 64 to 128 TPUv4 chips (Jouppi et al., 2020). We optimize our model with the Adafactor (Shazeer & Stern, 2018) optimizer with an inverse square root learning rate. To understand the trade-off of different backbone architectures, we run all baseline pre-training objectives with both the decoder-only architecture and encoder-decoder architecture. We report key experiment results using a base architecture of approximately 167M parameters for the decoder model and 335M parameters for the encoder-decoder model. All models use a standard Transformer that uses SwiGLU layers as described in (Shazeer, 2020). We utilize the default T5 English 32K sentencepiece for all models. Within the context of decoder-only models, except for the case of the decoder model trained on causal LM, our experiments always use a bidirectional receptive field only in its input segment and autoregressive decoding at the targets segment. This is essentially the a PrefixLM-type architecture (Raffel et al., 2019) which we find to be consistently better than a full causal decoder model. + +# A.1 MODE SWITCHING ABLATIONS + +In order to ascertain that our mode switching capabilities have an effective on performance, we conduct ablation experiments. + +Table 9: Ablation study for Mixture-of-Denoisers. Span, Rate and SD are in percentages $(\%)$ . We report SuperGLUE score (SG) and XSUM Rouge-L (XS). + +
NameAblation MethodSupervisedOne-shot
Span (μ)Rate (r)SD%SGXSSGXS
A--10069.331.138.26.5
B350072.032.038.57.5
C3,8,1215,501471.932.138.64.1
D3,8,12,3215,501171.032.242.710.6
E3,8,32,6415,501173.132.240.710.4
F3,8,6415,501770.631.641.311.5
G3,8,32,64152569.231.642.410.1
H8,64152572.531.239.210.9
I3,8,12,3215,505071.232.038.111.7
J3,8,6415,505071.331.638.111.8
K3,8,1215,50073.732.039.32.6
L3,8,6415,50070.132.138.07.3
+ +Table 8: Effect of different paradigm prompts on 1-shot evaluation, using a Encoder-Decoder architecture pre-trained using UL2 on 7B tokens. + +
Model/Prompt1Shot XSum1Shot SuperGLUE
Baseline T56.9/0.6/6.133.9
UL2 / None13.2/1.4/10.838.3
UL2 / [R]13.5/1.5/11.138.5
UL2 / [S]11.6/1.2/10.038.5
UL2 / [X]8.9/0.9/7.638.7
+ +We conduct experiments on one-shot XSum and one-shot SuperGLUE. Table 8 reports the result of varying the paradigm prompt to the model. Firstly, we observe that the prompt has quite substantial effect on model performance - i.e., using the right or wrong prompt can lead to a $48\%$ gap in performance (on XSum, Rouge-1). SuperGLUE, on the other hand, is less sensitive to prompting. On SuperGLUE, using prompts are almost always better than not using prompts during one-shot eval. However, for XSum, getting the prompt right seems to be crucial for good performance. + +# A.2 MIXTURE-OF-DENOISERS ABLATIONS + +We conduct extensive experiments to verify the effectiveness of individual objectives within the MoD objective. Table 9 reports results for these ablations. We report results for varying the mean span, and corruption rate, along with the percentage of S-denoising used (denoted by $\%$ SD). Note that the total number of denoisers in a mixture is $\| Span\| \times \| Corrupt\_Rate\| + 1$ . We label these configurations from Var-A through Var-J to refer to them easily. + +X-Denoising is Complementarily Effective but Does Not Suffice as a Standalone We observe that mixing Extreme Denoising is effective. Most of the best results across the board come from mixtures with long spans (e.g., 32 or 64). When compared with variants without long spans (Var-D vs. Var-C), we see that Var-D is strictly better. We also draw the readers attention to Var-H, which is a variant that only employs long spans. In general, Var-H performs poorly, suggesting that extreme denoising complements regular denoising but does not suffice in isolation. This also corroborates the result from Raffel et al. (2019) that shows that a $50\%$ corruption rate does not perform well. This slightly conflicts with the finding of (Wettig et al., 2022) although our architectures use a inputs-to-targets form of pretraining instead of BERT-style masked language modeling. + +Small Amounts of S-Denoisers is Preferred We explore a setting where we scale S-denoisers to $50\%$ of the entire MoD mixture. We find that this generally hurts performance. Hence, we make a conclusion that S-denoisers are necessary but only small amounts of S-denoisers $(\approx 20\%)$ + +are preferred. Var-K and Var-L also explore the case where there is no S-denoising at all. While performance on one task substantially improves (SuperGLUE), another substantially degrades (one-shot XSUM). Meanwhile for Var-L which is identical to var-F (but without S-denoising), performs on a whole, substantially worse. Hence, we showed that S-denoising is crucial. + +# A.3 MODESTLY SCALING MODEL SIZE AND PRETRAINING DATA + +We conduct additional experiments by scaling up both 1) the model size and 2) pre-training dataset size. Concretely, we scale the UL2 Encoder-Decoder model up to approximately 1B parameters and increase the number of pre-training tokens to 0.5 trillion tokens. Our motivation is to conduct a sanity check that the proposed formulation also works at different model scales and to observe if there are differences and implications at operating at a larger scale. Moreover, it has also become a staple for language model research to derive scaling laws (Kaplan et al., 2020; Tay et al., 2021b). Table 10 reports results in this scaled setting. At large scale, we find that the proposed of the UL2 encoder-decoder model is still competitive. A key difference now is that UL2 drops the SuperGLUE suite against T5 (1B). However, this is compensated by not only out-performing on 7 out of 8 tasks but also improving performance by 2-4 times on one-shot evaluation. The gains on supervised finetuning is smaller, but still noticeable across the board on XSUM, SGD and TOT. + +Table 10: Experiments with moderately scaled up models in terms of model compute (e.g., 1B for EncDec and 0.5B for decoder-only) and dataset size (0.5T tokens). + +
ModelFinetuningIn-context Learning
SGXSSGDTOTSGXSSGDTOT
GPT-like62.337.1/15.7/30.256.060.336.41.2/0.1/1.13.50.0
T584.743.0/20.8/35.656.062.129.48.9/0.8/7.82.11.4
UL283.343.3/21.0/35.956.562.645.415.4/2.5/11.19.67.8
+ +# B 20B UL2 EXPERIMENTAL SETUP + +This section describes the setup for our 20B experiments. + +# B.1 PRETRAINING AND MODEL CONFIGURATION + +We follow the same training protocol in earlier experiments by pretraining on the C4 corpus but by also scaling the number of tokens the model sees during pretraining. We use a batch size of 1024 and 512 TPUv4 chips for pretraining this model. The model is trained on a total of 1 trillion tokens on C4 (2 million steps). The sequence length is set to 512/512 for inputs and targets. Dropout is set to 0 during pretraining. Pre-training took approximately slight more than one month for about 1 trillion tokens. We use the same mixture of denoisers as earlier sections. The model has 32 encoder layers and 32 decoder layers, $d_{model}$ of 4096 and $d_{ff}$ of 16384. The dimension of each head is 256 for a total of 16 heads. Our model uses a model parallelism of 8. We retain the same sentencepiece tokenizer as T5 of 32k vocab size. Hence, UL20B can be interpreted as a model that is quite similar to T5 but trained with a different objective and slightly different scaling knobs. Similar to earlier experiments, UL20B is trained with Jax and T5X infrastructure. We release and open source T5X-based model checkpoints of this 20B model. + +# B.1.1 SETUP AND IMPLEMENTATION DETAILS + +We conduct experiments on both finetuning and in-context learning. For supervised finetuning, our models are continuously finetuned after $N$ pretraining steps where $N$ is typically from 50k to 100k. In other words, after each $N$ k steps of pretraining, we finetune on each downstream task and record its results. This is generally done in a manual fashion. While some tasks were finetuned on earlier pretrained checkpoints as the model was still pretraining, many were finetuned on checkpoints nearer to convergence that we release. As we continuously finetune, we stop finetuning on a task once it has reached sota to save compute. Finetuning is generally done in a per-task basis and not co-trained. + +Details of tasks where co-training is performed is found in the appendix. We leave the combination of massive multi-task training (Aribandi et al., 2021) and UL2 to future work. + +For supervised finetuning, we generally adopt a learning rate in the range of $\{5 \times 10^{-5}, 1 \times 10^{-5}, 1 \times 10^{-4}\}$ using the Adafactor optimizer. The general recipe is that we reset Adafactor optimizer states and/or adopt a loss normalization based on the number of real target tokens. This is reminiscent of the PaLM finetuning setup (Chowdhery et al., 2022). Batch size is generally a range of 32 to 128 although we did not find much impact of batch size on finetuning performance. Many of the evaluated tasks were not tuned much and we only ran once or twice before performing leaderboard submissions. + +# B.1.2 DATASETS FOR SUPERVISED FINETUNING + +To demonstrate the universality of the approach, we consider a total of nearly $50+$ NLP tasks. We list our categorization of tasks below. Note that the categorization of tasks are generally soft in nature and some tasks may cross into different categorization boundaries. + +- Language Generation - We consider summarization and data-to-text generation tasks. We use CNN/Dailymail (Hermann et al., 2015), XSUM (Narayan et al., 2018), MultiNews (Fabbri et al., 2019), SAMSum (Gliwa et al., 2019), WebNLG (Castro Ferreira et al., 2020) (English), E2E (Dušek et al., 2019) and CommonGen (Lin et al., 2020) to evaluate our models. For WebNLG, E2E and CommonGen, we use the versions from the GEM benchmark (Gehrmann et al., 2021). +- Language Generation with Human Evaluation - We evaluate on a variety of text generation tasks using human evaluation, via the GENIE leaderboard (Khashabi et al., 2021). These tasks include aNLG (Bhagavatula et al., 2019), ARC-DA (Clark et al., 2018), WMT19 (Foundation), and XSUM (Narayan et al., 2018). +- Language Understanding, Classification and Question Answering - We use Reading Comprehension, Question Answering, Text Classification and natural language inference datasets. Concretely, we use RACE (Reading comprehension) (Lai et al., 2017), QASC (Khot et al., 2020), OpenBookQA (Mihaylov et al., 2018), TweetQA (Xiong et al., 2019), QuAIL (Rogers et al., 2020), IMDB (Maas et al., 2011), Agnews (Zhang et al., 2015), DocNLI (Yin et al., 2021), Adversarial NLI (Nie et al., 2019), VitaminC (Schuster et al., 2021a), Civil Comments and Wikipedia Toxicity detection datasets (Borkan et al., 2019). We also use standard SuperGLUE (Wang et al., 2019) and GLUE (Wang et al., 2018) datasets. +- Commonsense Reasoning - We use HellaSwag (Zellers et al., 2019), SocialQA/SIQA (Sap et al., 2019), PhysicalQA/PIQA (Bisk et al., 2020), CosmosQA (Huang et al., 2019), AbductiveNLI (Bhagavatula et al., 2019), CommonsenseQA (Talmor et al., 2018), CommonsenseQA2 (Talmor et al., 2021). +- Long Range Reasoning - We use the Scrolls benchmark (Shaham et al., 2022) which comprises of seven component tasks including GovReport (Huang et al., 2021), SumScr (Chen et al., 2021), QMSUm (Zhong et al., 2021), QASPER (Dasigi et al., 2021), NarrativeQA (Kočisky et al., 2018), QuaLITY (Pang et al., 2021), and ContractNLI (Koreeda & Manning, 2021). +- Structured Knowledge Grounding - We use several component tasks from UnifiedSKG (Xie et al., 2022), namely WikiTQ (Pasupat & Liang, 2015), CompWQ (Talmor & Berant, 2018), FetaQA (Nan et al., 2021), HybridQA (Chen et al., 2020), WikiSQL (Zhong et al., 2017), TabFat (Chen et al., 2019), Feverous (Aly et al., 2021), SQA (Iyyer et al., 2017), MTOP (Li et al., 2020) and DART (Nan et al., 2020). We select datasets that are relatively convenient to perform evaluation and uses mainstream metrics such as accuracy or exact match instead of obscure ones or those that require significant domain specific post-processing. +- Information Retrieval - IR is the task of retrieving relevant documents given queries. We use the setup of the latest next generation IR paradigm, i.e., differentiable search index (Tay et al., 2022) for our experiments. We use the same NQ (Kwiatkowski et al., 2019) splits in the DSI paper. + +For each dataset, we report the best previous sota result. For generation tasks, we generally report ROUGE-2 following the advice of (Gehrmann et al., 2022). For the rest of the datasets, we report the dominant metric that is reported in prior work. For BLEU scores, we use sacrebleu. For commonsense reasoning tasks, we do not compare against approaches that use external knowledge bases as they are orthogonal and out of scope for this paper. For most part, GLUE is generally considered to be saturated and there are many unpublished results on the GLUE leaderboard. For this reason, we make a very reasonable decision of considering (Raffel et al., 2019) to be the state-of-the-art since we believe that there has not been any real advance on the GLUE benchmark since the T5 model (Raffel et al., 2019). GLUE results, given how saturated it already is, are provided as a reference and should be taken with a pinch of salt. + +# B.1.3 SUMMARY OF SUPERVISED FINETUNING RESULTS + +This section describes the overview results of our experiments. + +Table 11: Summary of UL20B results compared to state-of-the-art. $(l)$ denotes leaderboard submission. $(\sharp)$ denotes the best published we could find on the leaderboard. $(e)$ denotes SOTA used an ensembled approach. Because we evaluate finetuning and in-context trade-offs for SuperGLUE, SuperGLUE scores have their own dedicated section below. + +
DatasetMetricEvalSota ReferenceSOTAOurs
CNN/DMRouge-2TestZoph et al.21.721.9
XSUMRouge-2TestZoph et al.27.126.6
MultiNewsRouge-2TestXiao et al.21.121.7
SAMSumRouge-2TestNarayan et al.28.329.6
GigawordRouge 2TestAghajanyan et al.20.720.7
WebNLG (en)Rouge-2TestBakshi et al.53.555.4
E2E-NLGRouge-2TestXue et al.45.846.5
CommonGenRouge-2DevGehrmann et al.32.537.4
Schema-Guided DialogRouge-2TestGehrmann et al.36.844.1
GENIE - aNLGHuman (H)TestKhashabi et al.76.077.0(1)
GENIE - ARC-DA (w/o IR)HumanTestKhashabi et al.72.072.0(1)
GENIE - WMT19HumanTestKhashabi et al.71.067.0(1)6
GENIE - XSUMH-OverallTestClive et al.51.050.0(1)
GENIE - XSUMH-ConciseTestClive et al.53.053.0(1)
GENIE - XSUMH-FluencyTestClive et al.51.052.0(1)
GENIE - XSUMH-No-HallucinationTestClive et al.53.054.0(1)
GENIE - XSUMH-InformativenessTestClive et al.49.049.0(1)
SIQAAccuracyTestLourie et al.83.283.3(1)
PIQAAccuracyTestLourie et al.90.190.7(1)
CSQAAccuracyDevLourie et al.79.184.9
CSQA2AccuracyTestLourie et al.69.6(1)70.1(1)
QASC (w/o IR)AccuracyDevKhashabi et al.81.883.8
QASC (w IR)AccuracyTestKhashabi et al.89.690.7(1)
TweetQABLEU-1DevKhashabi et al.77.578.4
QuAILAccuracyTestKhashabi et al.74.287.2
AdversarialQA (Bert)F1DevKhashabi et al.53.670.1
AdversarialQA (Roberta)F1DevKhashabi et al.45.557.5
AdversarialQA (Bidaf)F1DevKhashabi et al.71.577.5
MCScriptAccuracyTestKhashabi et al.95.197.3
MCScript 2.0AccuracyTestKhashabi et al.94.697.9
RACEAccuracyTestShoeybi et al.90.9(1)90.9
DREAMAccuracyTestWan91.891.8
OBQAAccuracyTestKhashabi et al.87.287.2(1)
+ +Continued on next page +This task is German-to-English translation. Our submission is pretrained on only English C4 then finetuned on only the provided WMT19 data (no German pretraining, parallel data or backtranslation.) + +Table 11 - continued from previous page + +
CosmosQAAccuracyTestLourie et al.91.891.6(1)
Winogrande XLAccuracyTestLourie et al.91.390.1(1)
DocNLIAccuracyTestQin et al.76.988.2
AdversarialNLI (r3)AccuracyTestWang et al.47.753.5
VitaminCAccuracyTestSchuster et al.90.891.1
HellaswagAccuracyTestLourie et al.93.994.1(1)
QQPF1DevRaffel et al.90.190.6
QNLIAccuracyDevRaffel et al.96.196.5
CoLAMatthewsDevRaffel et al.68.671.5
STSBSpearmanDevRaffel et al.92.192.3
AbductiveNLIAccuracyTestHe et al.89.8(1)87.5(1)
MultiNLIAccuracyDevRaffel et al.92.191.9
IMDBAccuracyTestYang et al.96.297.3
AgNewsErrorTestYang et al.4.454.42
Civil CommentsF1DevTay et al.87.887.9
Wikipedia ToxicityF1DevTay et al.96.597.0
SST-2AccDevRaffel et al.97.397.0
Scrolls ChallengeAggregateTestShaham et al.29.237.9(1)
SumScrRouge (Avg)TestShaham et al.16.320.0(1)
QMSumRouge (Avg)TestShaham et al.19.920.0(1)
QASPERF1TestShaham et al.26.637.6(1)
NarrativeQAF1TestShaham et al.18.524.2(1)
QUALITYEMTestShaham et al.26.045.8(1)
ContractNLIEMTestShaham et al.77.488.7(1)
GovRepRouge (Avg)TestShaham et al.37.236.2(1)
WikiTQAccuracyTestXie et al.49.354.6
CompWebQAccuracyTestXie et al.73.375.9
FetaQABLEU-4TestXie et al.33.435.8
HybridQAAccuracyDevEisenschlos et al.60.861.0
WikiSQLAccuracyTestXie et al.86.087.3
TabFatAccuracyTestXie et al.83.487.1
FeverousAccuracyDevXie et al.82.485.6
SQASent.AccTestXie et al.62.470.5
MTOPMatchTestXie et al.86.887.5
DARTBLEU-4TestAghajanyan et al.47.250.4
DSI-NQHITS@10DevTay et al.70.373.8
+ +# B.1.4 TRADEOFFS BETWEEN FINETUNING AND PROMPT-BASED ZERO-SHOT LEARNING (SUPERGLUE) + +In this section, we explore finetuning and in-context learning trade-offs on the SuperGLUE benchmark. We conduct experiments on SuperGLUE with UL20B. While UL20B does not achieve SOTA on this benchmark, we note that UL20B at least remains competitive and outperforms T5-11B. This section reassures that UL2 indeed scales and matches/slightly outperforms T5-11B on SuperGLUE (while strongly outperforming T5-XXL on many other in-context tasks). UL20B still lacks behind the SOTA model ST-MoE-32B given two main reasons. Firstly, ST-MoE-32B has $200\mathrm{B}+$ parameters and is costs equivalent to a 32B dense model. Secondly, ST-MoE-32B is trained solely on span corruption using an encoder-decoder architecture which is known to be very advantageous on NLU finetuning. + +Table 12: Results on SuperGLUE dev set. We compare with T5-11B (Raffel et al., 2019), STMoE-32B (Zoph et al., 2022) and PaLM-8B, PaLM-62B and PaLM-540B (Chowdhery et al., 2022). Scores reported are the peak validation scores per task. + +
ModelBoolQCBCoPAMultiRCRecordRTEWiCWSCAvg
PaLM 62B90.696.4/95.798.087.7/61.993.0/92.489.575.996.289.2
PaLM 540B92.2100/10010090.1/69.294.0/94.695.778.810092.6
ST-MoE 32B269B93.1100/10010090.4/69.995.0/95.695.781.010093.2
PaLM 8B87.696.4/92.186.081.6/64.089.7/89.384.573.488.583.4
T5 11B90.894.9/96.498.087.4/66.193.8/93.293.977.396.289.9
UL2 20B90.898.7/98.299.088.4/64.893.7/93.292.177.398.190.7
+ +Table 13: Results on zero-shot learning on SuperGLUE dataset. We compare with GPT-3, GLaM and PaLM (Chowdhery et al., 2022). We also include models that are relatively compute-matched with UL20B such as T5-XXL with LM adaptation (Lester et al., 2021), GPT-3 13B and GLaM-8B dense. Notably, UL20B outperforms GPT-3 175B and all other models in a similar compute class on average score. + +
ModelBoolQCBRTEReCORDWSCWiCCOPAMultiRCAvg
ST-MoE-32B (269B)40.841.152.750.057.550.056.030.347.6
GPT-3 175B60.546.463.590.265.40.091.072.961.2
GLaM-MoE 1.2T83.033.968.890.384.950.590.045.168.3
PaLM 540B88.051.872.992.989.159.193.083.578.8
T5-XXL44.337.548.885.859.350.970.023.052.5
GPT-3 13B66.219.662.889.064.40.084.071.457.2
GLaM-Dense 8B73.633.944.089.280.744.086.039.061.3
GLaM-MoE 64E72.240.760.388.981.849.586.052.466.5
PaLM-Dense 8B68.341.154.287.878.947.086.047.563.9
UL2 20B (single ckpt)63.141.160.788.179.949.885.036.263.0
UL2 20B (best)63.150.060.788.180.655.288.036.265.2
+ +# B.1.5 GENERATIVE FEW-SHOT: XSUM SUMMARIZATION + +Finally, we conduct additional few-shot in-context one-shot learning using the XSum dataset We compare our model with the baseline T5-XXL, T5-XXL with LM Adaptation (Lester et al., 2021), LaMDA 137B (Thoppilan et al., 2022), and PaLM (8B, 62B, 540B) (Chowdhery et al., 2022). We run T5-XXL ourselves in the same experimental setup but report results from (Chowdhery et al., 2022) for the other models. + +Table 14: Results on One-Shot Summarization on XSUM. + +
ModelRouge-1Rouge-2Rouge-L
LaMDA 137B-5.4-
PaLM 62B-11.2-
PaLM 540B-12.2-
PaLM 8B-7.9-
T5 XXL 11B0.60.10.6
T5 XXL 11B + LM13.32.310.7
UL2 20B25.58.619.8
+ +Table 14 reports results on 1-shot summarization. We note that T5-XXL performs poorly on this task. Even with LM adaptation, the Rouge-2 score is only 2.3, which substantially lacks behind decoder-only causal language models (e.g., PaLM 8B models). Notably, the off-the-shelf T5-XXL is not able to generate meaningful summaries even with prompting just because it is only trained with span corruption so it is intuitive that some form of adaptation is required for generative few-shot settings. Here is worth that the performance of UL2 20B is about $3\mathrm{x}$ the performance of + +LM adapted T5 XXL model. Moreover, UL2 20B outperform LaMDA 137B and has improved performance compared to PaLM 8B. The best result, however, is still the larger 540B and 62B PaLM models. + +# B.2 UL2 FOR CHAIN-OF-THOUGHT PROMPTING + +It has recently been shown that language models at scale can perform multi-step reasoning tasks such as math word problems or commonsense reasoning via chain-of-thought prompting, which prompts the model to generate a step-by-step reasoning path before giving the final answer (Wei et al., 2022b). Notably, chain-of-thought (CoT) prompting does not require any additional fine-tuning of the model. + +A crucial consideration of CoT prompting is that it is an emergent ability of scale (Wei et al., 2022a)—it requires a sufficiently large language model to improve performance, and actually hurts performance for small language models. Hence, the successful use cases of chain-of-thought prompting use either LaMDA 137B (Thoppilan et al., 2022), PaLM 540B (Chowdhery et al., 2022), or OpenAI models (Brown et al., 2020; Ouyang et al., 2022). These models, however, are compute intensive and not available as public checkpoints. + +Here we demonstrate that UL2 20B can successfully leverage CoT prompting to solve multi-step arithmetic and commonsense tasks. We use the same benchmark tasks and prompts from Wei et al. (2022b). In Table 15 below, we see that on five arithmetic reasoning datasets, CoT prompting outperforms standard prompting (directly outputting the answer without a chain of thought) for UL2 20B. Similar to Wei et al. (2022b), we also show that CoT prompting can be augmented by using an external calculator ("calc.") to perform arithmetic computational only $(+, -, \times, /)$ to further improve performance by a large margin. In addition, we add self-consistency (Wang et al., 2022b) (denoted as "SC") on top of CoT prompting and observed significant gains consistently across all benchmarks, with an average improvement of $22.5\%$ compared to standard prompting. + +Table 15: Chain-of-thought prompting and self-consistency (SC) results on five arithmetic reasoning benchmarks. GSM8K: (Cobbe et al., 2021). SVAMP: (Patel et al., 2021). ASDiv: (Miao et al., 2020). AQuA: (Ling et al., 2017). MAWPS: (Koncel-Kedziorski et al., 2016). + +
ModelGSM8KSVAMPASDivAQuAMAWPSAverage
UL2 20B: standard prompting4.110.116.020.516.613.5
UL2 20B: CoT prompting4.412.516.923.619.115.3
UL2 20B: CoT prompting + calc.6.928.334.323.642.727.2
UL2 20B: CoT prompting + calc. + SC10.241.443.526.957.936.0
+ +In addition to arithmetic reasoning, Table 16 shows the performance of CoT prompting using UL2 20B compared to standard prompting on five commonsense reasoning benchmarks. CoT prompting plus self-consistency outperforms standard prompting in four of the five benchmarks, with an average improvement of $14.4\%$ . + +Table 16: Chain-of-thought prompting and self-consistency (SC) results on five commonsense reasoning benchmarks. CSQA: (Talmor et al., 2019). StrategyQA: (Geva et al., 2021). Date Understanding and Sports Understanding: (Srivastava et al., 2022). ARC-easy/challenge: (Clark et al., 2018). + +
ModelCSQAStrategyQADateSportsARC-eARC-cAverage
UL2 20B: standard prompting34.259.013.557.932.229.837.8
UL2 20B: CoT prompting51.453.314.065.361.642.948.1
UL2 20B: CoT prompting + SC55.754.916.366.869.849.552.2
+ +Overall, we have shown that whereas prior CoT work have required large pre-trained models such as PaLM 540B, UL2 20B is a relatively smaller model that can also perform multi-step reasoning. We hypothesize that the mixture of denoisers may contribute to the ability of UL2 to leverage CoT + +prompting at 20B parameters, although we leave further investigation of what unlocks emergent chain-of-thought reasoning to future work. + +# C REFERENCE BACKGROUND: PRE-TRAINED LANGUAGE MODELS + +In this section, we discuss background surrounding pretrained language models, pretraining objectives and other unified pretraining proposals. + +# C.1 PRE-TRAINED LANGUAGE MODELS + +Learning pre-trained representations for language is a far-reaching pillar of modern NLP research, dating back to (Mikolov et al., 2013; Pennington et al., 2014; Neumann et al., 2018; Dai & Le, 2015; Howard & Ruder, 2018). The first pre-trained Transformer, GPT, was proposed by (Radford et al., 2019) and was trained as a causal language model. Subsequently, BERT (Devlin et al., 2018) demonstrated the importance of bidirectional modeling for many downstream tasks. BERT introduced masked language modeling (MLM), a denoising objective that reconstructs the input in-place using bidirectional receptive fields. XLNet Yang et al. (2019) introduced the Permutation Language Modeling to account for dependencies between masked tokens during training. A number of additional papers (e.g., RoBERTA (Liu et al., 2019), SpanBERT (Joshi et al., 2020)) suggested further improvements to the pre-training process. + +At the same time, two-stack encoder-decoder architectures such as T5 (Raffel et al., 2019) gained popularity due to their improved performance on classification and sequence-to-sequence ("seq2seq") tasks. However, so far, these models have shown limited performance on open-text generation and prompt-based inference (i.e., in-context learning), which motivates the use of decoder-only models that are trained with different objectives (e.g., GPT-3 (Brown et al., 2020), GLaM (Du et al., 2021), LaMDa (Thoppilan et al., 2022) and PaLM (Chowdhery et al., 2022)). In this work, we aim to bridge the performance gap between the two by means of a general training paradigm that suits both architectures. + +Decoder-only vs Encoder-only The key similarities of decoder-only and encoder-only architectures is that decoder-only architectures operate with an input-to-target paradigm or targets-only paradigm if CausalLM is used over PrefixLM used. For both architectures, the objective is always to predict the next token (LM) and are therefore autoregressive models. Notably this is different from position-wise masked LM denoising (sometimes known as autoencoding), which have been popularized by encoder-only BERT-style models. These class of models are very restricted in their generative capabilities. On top of that, task specific classification heads are also typically employed for downstream tasks. Because of the cumbersomeness of task specific classification heads, we strongly do not recommend using this class of autoencoding models moving forward and consider them somewhat deprecated. Caveats do apply. For instance, regression is the probably only reason why one would add a task specific head (Lees et al., 2022), or to squeeze out some efficiency gains from eliminating a full vocabulary. Either way, one can always start from a encoder-decoder and chop off the decoder later so there is no good reason to use an encoder-only model. Hence the only real objective consideration here is between decoder-only and encoder-decoder architectures. + +Decoder-only vs Encoder-Decoder The line between decoder-only and encoder-decoder models is less clear. PrefixLM models are almost encoder-decoder models with shared parameters (but not quite). From an inductive bias point of view, there are multiple differences. Encoder-Decoder models process input and targets independently with a different set of parameters. This is a form of sparsity where different set of parameters are used for different tokens. Encoder-Decoder models also have a cross attention component that connects input tokens to target tokens. Meanwhile, decoder-only models process inputs and targets by concatenating them. Hence, the representations of inputs and targets are concurrently build layer by layer as the input/targets propagate up the network. Conversely, the decoder in Encoder-decoder models generally only looks at the fully processed encoder input. Overall, the inductive bias of PrefixLM decoder-only models and Encoder-Decoder models could be pretty similar modulo the subtle differences stated above. The distinct property is that Encoder-Decoder models are generally approximately $2\mathrm{x}$ parameters of a decoder-only model when compute-matched. + +Sparse Models On a side note, there have also been also an emerging trend of sparse pretrained models that achieve state-of-the-art performance. Sparse mixture-of-expert models such as the Switch Transformer (Fedus et al., 2021), GLaM (Du et al., 2021) and/or GShard (Lepikhin et al., 2020) have also demonstrated a lot of promise. While orthogonal to the topic of pretraining objectives, sparse models achieve a very different flop-per-parameter ratio compared to dense models - a core recurring motif in the debate surrounding encoder-decoder models vs decoder-only models. + +# C.2 PRE-TRAINING OBJECTIVES FOR LARGE LANGUAGE MODELS + +While recent research demonstrates the potential of large supervised multi-task pre-training (Aribandi et al., 2021; Sanh et al., 2021; Wang et al., 2022a), most pre-training objectives rely on the vast availability of unsupervised data and use self-training techniques. As mentioned above, different architectures typically leverage different objectives. Decoder-only models are typically trained with causal language model objectives to mimic auto-regressive generation (Radford et al., 2019). Raffel et al. (2019) explored many objectives for encoder-decoder models and found span corruption to be effective. (Wang et al., 2022a) conducts a systematic study of different architectures combined with three different pretraining objectives (causal LM, prefixLM and span corruption) and analyzed their impact on zero-shot generalization. Related to our proposed X-denoisers, (Wettig et al., 2022) studies the effect of corruption rate in BERT-style masked language modeling and hypothesizes that this improves sample efficiency along with benefitting larger models. Notably, the benefits of heightened corruption rates as a standalone denoiser is still unclear, as noted by (Raffel et al., 2019) and also apparent in our own ablations. Pre-training (or denoising) is generally applied on the subword level (Raffel et al., 2019; Devlin et al., 2018) but it is worth to note that it has also been applied on the character or byte-level (Xue et al., 2021; Tay et al., 2021c). In these setups, the corrupted spans are generally much larger than subword-based denoising. + +# C.3 UNIFIED PRE-TRAINING PROPOSALS + +UniLM (Dong et al., 2019) proposed to train on multiple language modeling objectives using a single Transformer model. Specifically, UniLM trains on unidirectional LM, bidirectional LM and seq2seq LM. This is quite similar to combining auto-regressive LMs with BERT and prefix-LM models. Notably, UniLM trains using a cloze-type formulation which adds explicit mask tokens to the inputs. Losses are then computed by the difference of the predicted token and target token in a position-wise fashion. Aside from pretraining unification, there have been a recent trend of thematic unification, i.e., unifying common tasks into one model. Examples of these include UNICORN (Lourie et al., 2021) for commonsense reasoning, UnifiedQA (Khashabi et al., 2020; 2022) for question answering, Programming Puzzles (Schuster et al., 2021b) for problem solving, and UnifiedSKG (Xie et al., 2022) for Structured Knowledge Grounding. + +# C.4 IMPLEMENTATION DETAILS AND UL2 CODE + +This section aims to give more insight to how UL2 pretraining is implemented. Our implementation is actually pretty simple. It is simply a mixture of different pretraining objectives that is implemented in seqio7. Most of our experiments were run with simply mixing different seqio tasks with seqio's Mixture Registry. However, one could also implement a generalized UL2 objective with the following function which could be cleaner. + +```python +def ul2_objective(dataset: tf.data.Dataset, sequence_length: seqio.preprocessors.SequenceLengthType, output_features: seqio.preprocessors.OutputFeaturesType, use_prefix_lm_task: bool = False, rates: Optional[Sequence[float]] = None, mean_noiseSpanlengths: Sequence[float] = (3.0,) noise_densities: Sequence[float] = (0.15,) shard_ds: bool = True, optional_task prefixes: Optional[Sequence[str]] = None, input_feature_key: str = "inputs", merge/examples_to Reduce(padding: bool = True, +``` + +```txt + +``` + +```python +reserved_for_packing: bool = None, seed: int = 7) -> tf.data.Dataset: +"''"UL2-like pre-training objectives. +This preprocessor amounts to calling the 'span-corruption' function several +times with different values of 'noise_density' and 'mean-noise spans_length'. +We either shard or copy the dataset, then apply each function to each shard. +Add S-denoising (prefixLM) using use_prefix_lm_task. +Args: +dataset: A tf.data.Dataset with dictionaries containing the key 'input_feature_key'. +sequence_length: dict mapping of feature key to int length for that feature. +output_features: mapping of keys to features. +use_prefix_lm_task: If True, include PrefixLM in the task mix. +rates: > List of rates per task. If None, tasks are sampled uniformly. +mean_noise spans lengths: List of mean number of tokens per masked span per example. +noisedensities: List of what fraction of the tokens to mask. +shard_ds: If True, shard dataset per objective. +optional_task prefixes: > Strings to preprocess for each corruption scheme. NOTE: If including prefixLM task, it must be the last prefix. +input_feature_key: which feature to use from the dataset as the input text tokens. +mergeexamples_to Reduce-padding: if True, combines multiple input examples to reduce padding. +reserved_for_packing: if specified, reduces the desired inputs length by the specified amount to enable multiple examples to be packed together downstream. +seed: tf.int64 for controlling the random choice of spans. +Returns: +a dataset +""" +if optional_task prefixes: # Ensure each task has a prefix. +num_tasks = len(noisedensities) + int(use_prefix_lm_task) +valid_number_of prefixes = num.tasks == len(optional_task prefixes) +if not valid_number_of prefixes: +raise ValueError("Number of task prefixes must match number of tasks.") +inputs_length = sequence_length[input_feature_key] +input_lengths, targets_lengths = [], [] +sequence lengths = {x: y for x, y in sequence_length.items()} if reserved_for_packing: +inputs_length -= reserved_for_packing +for x, y in sequence_length.items(): + sequence lengths[x] = y - reserved_for_packing +hyperparams = list(zip(mean噪音Spanlengths, noisedensities)) +for mean噪音Span_length, noise_density in hyperparams: + input_length, targets_length = +t5.data.preprocessors.random_spans_helper( extra_tokens_per_spans Inputs=1, +``` + +```python +extra_tokens_per spans_targets $= 1$ inputs_length $\equiv$ inputs_length, mean_noise_perspan_length $\equiv$ mean_noise_perspan_length, noise_density $\equiv$ noise_density) input_length.append(input_length) targets_lengths.append(target_length) +if sequence_length["targets"] $< <$ targets_length: upper_bound $\equiv$ max(targetllaengths) raise ValueError( f'Expected max targets length for span corruption ( {upper_bound} ) is' f'greater than configured targets length' f''({sequence_length['targets']})") +ds $=$ dataset +ds $=$ t5.data.preprocessors.select_random_chunk( ds, output_features $\equiv$ output_features, feature_key $\equiv$ "targets", max_length $\equiv$ 65536) +if merge/examples_to Reduce-padding: ds $=$ t5.data.preprocessors.reduce_concat_tokens( ds, feature_key $\equiv$ "targets", batch_size $\equiv$ 128) num_shards $=$ len(input_lengths) $^+$ int(use_prefix_lm_task) +if shard_ds: ds_shards $=$ [ds.shard(num_shards,i) for i in range(num_shards)] +else: ds_shards $=$ [ds for _ in range(num_shards)] +processed_ds $=$ [] +hyperparams $=$ zip(input_lengths, hyperparams, range(num_shards)) +for input_length, (noiseSpan_length, noise_density), i in hyperparams: ds $=$ ds_shards[i] ds $=$ t5.data.preprocessors.split_tokens( ds, feature_key $\equiv$ "targets", min_tokens_per_segment $\equiv$ None, max_tokens_per_segment $\equiv$ input_length) +ds $=$ t5.data.preprocessors.denoise( ds, output_features, inputs_fn $\equiv$ t5.data.preprocessors.noiseSpan_to_unique_sentinel, targets_fn $\equiv$ t5.data.preprocessors.nonnoiseSpan_to_unique_sentinel, noise_density $\equiv$ noise_density, noise_mask_fn $\equiv$ functools.full(t5.data.preprocessors.random_spans_noise_mask, mean-noiseSpan_length $\equiv$ noiseSpan_length), inputFeature_key $\equiv$ inputFeature_key) +if optional_task prefixes: ds $=$ preprocess_prompt( ds, output_features, prompt_mode $\equiv$ optional_task prefixes[i], mode $\equiv$ optional_task prefixes[i]) processed_ds.append(ds) +if use_prefix_lm_task: ds $=$ ds_shards[-1] ds $=$ t5.data.preprocessors-prefix_lm(ds, sequence lengths, output_features) +if optional_task prefixes: ds $=$ preprocess_prompt( ds, output_features, prompt_mode $\equiv$ optional_task prefixes[-1], mode $\equiv$ optional_task prefixes[-1]) +``` + +```python +processed_ds.append(ds) +ds $=$ tf.data.experimental.sample_fromDatasets( processed_ds, rates, seed) +return ds +``` + +# C.5 DETAILS OF SUPERVISED FINETUNING SOTA RUNS + +Most of our supervised finetuning runs were finetuned as single tasks. The only exception was that: + +- We finetuned GLUE as a single mixture with proportionate sampling. This has become standard and defacto setup (Raffel et al., 2019; He et al., 2022; Tay et al., 2020; 2021b). +- We finetuned SuperGLUE as a single mixture which is also a standard setup these days (Fedus et al., 2021; Raffel et al., 2019; Chowdhery et al., 2022). +- SIQA, PIQA, AbductiveNLI, Winogrande XL and CosmosQA were co-trained in a proportionate mixture similar to (Lourie et al., 2021) under the Rainbow benchmark. +- For CSQA, CSQA2. OBQA, and ARC-DA we co-trained with the rainbow mixture to obtain results on these three datasets. +- All other tasks were single-task finetuned. + +# C.6 QUALITATIVE SAMPLES + +This section lists some qualitative samples that are randomly sampled (and not cherrypicked) on 1shot XSUM summarization. + +Summarize: John Martin, 48, denies murdering Russian pianist Natalia Strelchenko, 38, at their Manchester home on their second wedding anniversary last August. ; Manchester Crown Court heard he took the diazepam believing it to be his prescribed anti-depressant medication. ; He said "everything is very blurry". ; It is alleged the double bass player strangled and beat Ms Strelchenko, who was also known by the surname Strelle, in a loss of temper at their home in Newton Heath on 30 August. ; Giving evidence, Mr Martin, also known as Jon Skogsbakken, said he had been suffering with depression and that he had unwittingly taken unmarked diazepam tablets for around six weeks. ; He said he "guessed" they had been prescribed to his wife. ; Mr Martin told the jury he had suffered with depression since 2005 and his GP would prescribe him Escitalopram. ; He told the court that taking the diazepam was "the biggest mistake of my life". ; Mr Martin said: "I would never have taken the two together, absolutely not", if he was aware the tablets could have a "paradoxical and aggressive response" and when taken with alcohol it could increase the effects. ; The court heard following an argument with Ms Strelchenko, he drank four cans of cider and then returned home. ; He said: "I just sat down on the floor and poured myself a glass of wine. I started to drink it. Natalia was angry because I was drinking wine and she tried to take it away from me. ; Everything is very blurry for me. I can't recall anything after that point. ; "I still love her very much. I would never wish to do such terrible things to her. I recall virtually nothing." ; Mr Denney QC said: "Do you accept that on evidence you killed Natalia?" ; Mr Martin replied: "Well according to what the witnesses described...I perfectly understand that I must be the man behind it." ; Mr Martin, who had worked for the computer firm IBM in his home country of Norway, met Ms Strelchenko in 2007. ; She had performed piano recitals at New York's Carnegie Hall and London's Wigmore Hall. ; The trial continues. + +Output: A man has denied murdering his Russian pianist wife after taking a cocktail of drugs and alcohol. + +Summarize: The pair, dressed in Team GB tracksuits and wearing plastic medals, admitted to Sky News they "blagged" their way on to the float and joined the celebrations. ; The float was carrying Britain's gold medal-winning women's hockey team and athletes from the modern pentathlon. ; The BOA said: "It didn't spoil anyone's enjoyment of a wonderful event." ; "We are aware of the matter and are disappointed anyone would want to detract from the athletes' celebration," it added. ; Four hundred athletes took part in the Manchester celebrations with more 150,000 people lining the streets. ; A second parade is to take place in Trafalgar Square in London from 13:00 BST after which the athletes will visit Buckingham Palace. ; Greater Manchester Police said it did not provide security for the floats and had received no reports regarding the incident. ; Manchester City Council is yet to comment. ; Team GB set an Olympic record in Rio 2016 by winning 67 medals - two more than they managed at London 2012. ; The Paralympians also beat their previous performance with 147 medals - 27 more than four years ago. Output: Two men have been arrested after attempting to join the Olympic and Paralympic parade in Manchester. + +Summarize: Laura Stewart, 20, was walking on North Hanover Street with her friend Mhairi Convy, 18, when they were hit by a Range Rover on 17 December. ; The funeral of Ms Stewart, an accounts student from Cumbernauld, was held at Our Lady and St Helen's Parish Church in her home town. ; About 200 people attended the ceremony to pay their respects. ; Outside the church floral tributes were laid, including the name "Laura" written out in red and white flowers opposite the word "sister" in purple flowers. ; Tributes left with the flowers included a card saying "with all our love for always, mum and dad" and another to a "beautiful" girl who was a "loving friend and sister". ; The order of service showed a photo of the student with the words "Courage grows strong at a wound" - the motto of the Stewart clan. ; Mourners wept as the white coffin with purple handles was carried out of the church to the hymn Walk With Me Oh My Lord. ; Father Gerald Sharkey led the procession out of the church through the snow. The body was then driven to Eastfield Cemetery in Cumbernauld for a private burial. ; Ms Stewart and Ms Convy, of Lennoxtown, + +studied at Glasgow College of Commerce. ; Following the crash, the two women were taken to Glasgow Royal Infirmary, where they died. ; A 36-year-old male pedestrian and the 50-year-old male driver of the Range Rover were also treated in hospital after the crash. ; Strathclyde Police are investigating the deaths. + +Output: The funeral of a student who died in a car crash in Glasgow has taken place. + +Summarize: Eleven of Scotland's 14 territorial health boards were hit by the "ransomware" attack linked to other IT attacks around the world. ; The hack has encrypted information on NHS computers, denying access unless a payment is made. ; First Minister Nicola Sturgeon said work to fix the systems affected had entered a "recovery phase"; She called the attack "hugely concerning" but said there was no evidence as yet to suggest outdated computer systems were responsible for the breach. ; Scotland's Health Secretary Shona Robison said there was a "level of confidence" that systems would be back up and running by Monday and that no breach of patient confidentiality had been detected. ; The health boards which have been affected are: ; The Scottish Ambulance Service has also been affected, along with NHS National Services Scotland. ; The incidents are thought to be part of a wider attack affecting organisations in about 100 countries around the world. ; IT problems have also caused disruption in about 30 health authorities in England, while the NHS in Wales and Northern Ireland are so far unaffected. ; The Scottish government said most incidents had been confined to desktop computers in GP surgeries, dental practices and other primary care centres. ; A spokesman said the only acute hospital sites so far affected had been in NHS Lanarkshire. ; BBC Scotland understands that computer systems at Hairmyres Hospital in East Kilbride were compromised. ; Ms Robison told the BBC's Good Morning Scotland programme that IT specialists had been working non-stop to get GP systems back up and running. ; She said: "People are working very, very hard and have worked through the night. The update I've got this morning is that we're very much into recovery phase now, with a lot of work going on to get systems back up running. ; "The GP systems, which of course were the main problem across our health boards - work is going on, and there is a level of confidence that many will be back up and running before GP surgeries open on Monday morning." ; Ms Sturgeon told the BBC: "Obviously cyber-attacks of this nature are hugely concerning and I think they underline the vulnerability not just of the public sector, but also of society generally to cyber-attacks, but they also underline the importance of all organisations making sure that they have all appropriate measures in place to protect against those kinds of attack." ; She added: "Obviously there is a lot of investigation into exactly why the health service has been affected in the way it has. I think it's important to stress that this has been a global international attack." ; Shona Robison said NHS Lanarkshire had been more affected in terms of its acute hospitals, but said manual systems had worked safely and insisted that patients had not been negatively impacted by the breach. ; "The intention today is to begin testing those IT systems and to gradually and safely try to bring those back on over the course of the weekend." ; Ms Robison added: "Throughout all of this there's been no breach to patient confidentiality that has been detected to date so patients should be reassured by that." ; Patient services, including emergency services, are continuing to operate across Scotland, the Scottish government confirmed. ; Ms Robison emphasised there had been no impact on the majority of the out-of-hours systems across Scotland, with NHS 24 working as normal along with the Scottish Ambulance Service, where the only issue had been with desktop PCs that were "non-patient facing". ; "All the other parts of the system that people would use over the weekend are working as normal," Ms Robison said. ; In NHS Lanarkshire, non-emergency patients have been urged to stay away from its hospitals as it deals with the ransomware attack. ; Dr Helen Mackie, chief of medical services at Hairmyres Hospital, said staff had reverted to paper and manual records for patients. ; She has urged any patients turning up at the authorities emergency departments to bring their medication with them because medics may have problems accessing their records. ; She said: "Help us by bringing as much information with you, So bring your medicines, bring any information you have about health care. Relatives can really help us as well because they're a wealth of information for us." ; Dr Mackie said the IT issues were leading to the cancellation of planned out-patient appoints for tests such as CT scans. However, she said that any emergency diagnostic tests would continue to take place. ; She added: "It's business as usual in terms of emergency care in our Lanarkshire hospitals. We are asking the public to help us by only coming to emergency departments if it is an emergency. But please be reassured that all our emergency access to treatment and care is up and fully running." + +Output: Eleven of Scotland's 14 territorial health boards were hit by the "ransomware" attack + +linked to other IT attacks around the world. + +Summarize: Two-time major winner McIlroy, 25, and Danish former world number one Wozniacki, 23, announced their engagement on New Year's Eve. ; Media playback is not supported on this device ; "The problem is mine," McIlroy said. "The wedding invitations issued at the weekend made me realise that I wasn't ready for all that marriage entails." ; The couple had been together for more than two years. ; McIlroy is currently at Wentworth for the BMW PGA Championship, the European Tour's flagship event which starts on Thursday. ; Wozniacki is set to compete in the French Open in Paris starting on 25 May. ; In a statement issued through his management company, McIlroy added: "There is no right way to end a relationship that has been so important to two people. ; "I wish Caroline all the happiness she deserves and thank her for the great times we have had." ; "The news has shocked the worlds of both golf and tennis, particularly with the timing of the split. McIlroy is due to start a crucial run of tournaments, while Wozniacki is playing the upcoming French Open." ; Speaking at Wentworth on Wednesday, McIlroy said the decision to end the engagement had been mutual and amicable. ; He said it was a difficult time, but that the move was best for both of them. ; McIlroy won the US Open in 2011 and US PGA Championship the following year. ; Wozniacki, who has reached the final of one grand slam tournament - the US Open in 2009 - is currently ranked 13th in the world. ; When McIlroy announced their engagement, he tweeted: "I have a feeling it is going to be a great year." + +Output: Rory McIlroy and Caroline Wozniacki have ended their engagement. \ No newline at end of file diff --git a/ul2unifyinglanguagelearningparadigms/images.zip b/ul2unifyinglanguagelearningparadigms/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..4b66a8292a5ba4a7e3daa9401c994374279ffc2a --- /dev/null +++ b/ul2unifyinglanguagelearningparadigms/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c4df784d90c2c08fb413da9594ae30d3f04d5f8339bfa025073b7a3384c42eb3 +size 1117418 diff --git a/ul2unifyinglanguagelearningparadigms/layout.json b/ul2unifyinglanguagelearningparadigms/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..b03bc15d8a7cf071da1b0123a00163222d529675 --- /dev/null +++ b/ul2unifyinglanguagelearningparadigms/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d3e73c0cc20020cb424f33cfdb3584b5e33599edc0b53ebca9f8017428d815e +size 752291 diff --git a/unbiasedstochasticproximalsolverforgraphneuralnetworkswithequilibriumstates/459142da-a291-4c4d-a15a-919a0049565f_content_list.json b/unbiasedstochasticproximalsolverforgraphneuralnetworkswithequilibriumstates/459142da-a291-4c4d-a15a-919a0049565f_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..ff1a2c0a15763010bdf89b1b8d1576ce88c147d7 --- /dev/null +++ b/unbiasedstochasticproximalsolverforgraphneuralnetworkswithequilibriumstates/459142da-a291-4c4d-a15a-919a0049565f_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07f4bb104bd3f80b92c1eb4e0dfa965ce30cc8bc9a2f9e7d26653b09aab12248 +size 77137 diff --git a/unbiasedstochasticproximalsolverforgraphneuralnetworkswithequilibriumstates/459142da-a291-4c4d-a15a-919a0049565f_model.json b/unbiasedstochasticproximalsolverforgraphneuralnetworkswithequilibriumstates/459142da-a291-4c4d-a15a-919a0049565f_model.json new file mode 100644 index 0000000000000000000000000000000000000000..068f70c0d222aa76cfe407e6df94042b9dec05a9 --- /dev/null +++ b/unbiasedstochasticproximalsolverforgraphneuralnetworkswithequilibriumstates/459142da-a291-4c4d-a15a-919a0049565f_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d947184b678b86954228674bea5aac84dfe6d8eb096e470a36cd2969ca1ee23 +size 101470 diff --git a/unbiasedstochasticproximalsolverforgraphneuralnetworkswithequilibriumstates/459142da-a291-4c4d-a15a-919a0049565f_origin.pdf b/unbiasedstochasticproximalsolverforgraphneuralnetworkswithequilibriumstates/459142da-a291-4c4d-a15a-919a0049565f_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3f8036064550b5de401d91535c202afe63a567d0 --- /dev/null +++ b/unbiasedstochasticproximalsolverforgraphneuralnetworkswithequilibriumstates/459142da-a291-4c4d-a15a-919a0049565f_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ec747bf53ba16a92334ecddae1ce94aba95f4efb0a8b7f39160d8b488adbcff5 +size 634547 diff --git a/unbiasedstochasticproximalsolverforgraphneuralnetworkswithequilibriumstates/full.md b/unbiasedstochasticproximalsolverforgraphneuralnetworkswithequilibriumstates/full.md new file mode 100644 index 0000000000000000000000000000000000000000..12f73b0e4bade29747a4a4a8130772858bccd871 --- /dev/null +++ b/unbiasedstochasticproximalsolverforgraphneuralnetworkswithequilibriumstates/full.md @@ -0,0 +1,330 @@ +# UNBIASED STOCHASTIC PROXIMAL SOLVER FOR GRAPH NEURAL NETWORKS WITH EQUILIBRIUM STATES + +Mingjie Li $^{1}$ , Yifei Wang $^{2}$ , Yisen Wang $^{1,3}$ , Zhouchen Lin $^{1,3,4}$ * + +$^{1}$ National Key Lab of General Artificial Intelligence, School of Intelligence Science and Technology, Peking University +$^{2}$ School of Mathematical Sciences, Peking University +3 Institute for Artificial Intelligence, Peking University +4 Peng Cheng Laboratory + +# ABSTRACT + +Graph Neural Networks (GNNs) are widely used deep learning models that can extract meaningful representations from graph datasets and achieve great success in many machine learning tasks. Among them, graph neural networks with iterative iterations like unfolded GNNs and implicit GNNs can effectively capture long-range dependencies in graphs and demonstrate superior performance on large graphs since they can mathematically ensure its convergence to some nontrivial solution after lots of aggregations. However, the aggregation time for such models costs a lot as they need to aggregate the full graph in each update. Such weakness limits the scalability of the implicit graph models. To tackle such limitations, we propose two unbiased stochastic proximal solvers inspired by the stochastic proximal gradient descent method and its variance reduction variant called USP and USP-VR solvers. From the point of stochastic optimization, we theoretically prove that our solvers are unbiased, which can converge to the same solution as the original solvers for unfolded GNNs and implicit GNNs. Furthermore, the computation complexities for unfolded GNNs and implicit GNNs with our proposed solvers are significantly less than their vanilla versions. Experiments on various large graph datasets show that our proposed solvers are more efficient and can achieve state-of-the-art performance. + +# 1 INTRODUCTION + +Graph Neural Networks (GNNs) (Zhou et al., 2020; Wu et al., 2020) can effectively aggregate information from its neighbors and then encode graph information into meaningful representations and have been widely used to extract meaningful representations of nodes in graph-structured data recently. Furthermore, Graph Convolution Networks (GCNs)(Kipf & Welling, 2016) involve the convolution structure in the GNNs and drastically improve the performance on a wide range of tasks like computer vision (Xu et al., 2020b), recommendation systems (He et al., 2020; Zhang et al., 2020b) and biochemical researches (Mincheva & Roussel, 2007; Wan et al., 2019). Due to these results, GCN models have attracted a lot of attention and various techniques have be proposed recently, including graph attention (Veličković et al., 2017), normalization (Zhao & Akoglu, 2019), linearization (Wu et al., 2019; Li et al., 2022) and others (Klicpera et al., 2018; Rong et al., 2020). + +Current GNN models usually capture topological information of $T$ -hops by performing $T$ iterations graph aggregation. However, $T$ cannot be large. Otherwise, their outputs may degenerate to some trivial points and such a phenomenon is called over-smoothing (Yang et al., 2020; Li et al., 2019). Therefore, traditional GNNs cannot discover the dependency with longer ranges. To tackle these problems, researchers have proposed some graph neural networks with iterative update algorithms (Yang et al., 2021a;b). The implicit graph neural networks (IGNNs) (Gu et al., 2020) is another type of such + +model. Since these models will finally converge to an equilibrium state (stationary points or fixed points), we call these models Graph Equilibrium Models for convenience in the following paper. + +Above graph equilibrium models enjoy superior advantages in capturing the long-range information because they implicitly finish the "huge hop" aggregation via its forward procedure. However, graph equilibrium models have to recursively aggregate the neighborhoods of graph nodes since solving their equilibrium state needs iteratively aggregating the full graph. Therefore, it needs expensive computation costs to deal with large graphs especially when they are dense. Although many works (Chen et al., 2018; Hamilton et al., 2017) propose different aggregation methods through the sampling nodes in traditional graph models, there are no guarantees for their convergence and unbiased approximation when applying them to the graph equilibrium models. + +For the above reasons, how to efficiently obtain the outputs for these graph equilibrium models is an interesting problem worth exploring. Inspired by Yang et al. (2021b); Zhu et al. (2021); Zhang et al. (2020a)'s works which reveal the connections between the implicit and the unfolded graph neural networks' architecture and learnable graph denoising problems, we are trying to study the efficiency of the above models from the optimization view. Then we propose two stochastic solvers for these graph equilibrium models with convergence guarantees inspired by the stochastic proximal gradient descent algorithms. Since our forward procedure only needs to aggregate subgraphs, the proposed solvers are much more efficient than vanilla deterministic solvers by gradient descent or fixed-point iterations. Furthermore, we can theoretically prove that our solvers can obtain the unbiased output as the vanilla deterministic solvers do. + +Our Contributions. We summarize the contributions of our methods as follows: + +- By splitting the graph denoising optimization for the graph equilibrium models as several sub-optimization problems, we treat their forward procedure as solving the proper finite-sum optimization problem. Then we propose two stochastic solvers for graph equilibrium models: Unbiased Stochastic Proximal Solver (USP solver) and its variant with variance reduction USP-VR solver. +- Compared with the vanilla deterministic solvers which aggregate the full graph for graph equilibrium models' forward procedure, our USP solver and its variant only need to aggregate subgraphs to reach the equilibrium. Therefore, graph equilibrium models can be more efficient than before with our stochastic solvers. +- We theoretically prove that USP solvers can converge to the same outputs obtained by the vanilla deterministic forward procedure in expectation. Furthermore, we empirically demonstrate our proposed method's advantages with various experiments. + +# 2 RELATED WORKS + +# 2.1 GRAPH NEURAL NETWORKS + +Most GNNs (Kipf & Welling, 2016; Velicković et al., 2017; Xu et al., 2018; Li et al., 2022) aggregate the graph information for finite times due to the over-smoothing problem. Thereby, they can hardly capture very long-range dependency. Contrary to these models, implicit graph models (Liu et al., 2021a; Gu et al., 2020; Park et al., 2021) aggregate the graph information for a lot of iterations or "infinite" iterations with theoretically non-trivial equilibrium outputs. + +Moreover, recent works tries to explore the connections between the graph neural models and the graph denoising optimization problem. Some works (Zhu et al., 2021; Zhang et al., 2020a) recover different graph models to various graph denoising problems. Furthermore, Zhu et al. (2021) also proposed two types of models by reformulating graph denoising problems from spectral filters perspective. Some researchers focus on interpreting existing graph models from the view of redesigning the correlated graph denoising models (Yang et al., 2021a; Ma et al., 2021; Yang et al., 2021b). + +Researchers also pay attention to GNNs from a different perspective. For example, robust graph neural networks (Jin et al., 2020; Luo et al., 2021), pretraining graph neural networks (Hu et al., 2019b; Qiu et al., 2020), explanations for graph networks (Ying et al., 2019; Yuan et al., 2020) and connections to differential systems (Xu et al., 2020a; Chamberlain et al., 2021; Wang et al., 2021). + +# 2.2 GRAPH EQUILIBRIUM MODELS AND IMPLICIT MODELS + +Since the implicit graph models (Gu et al., 2020; Chen et al., 2022) and unfolded graph Yang et al. (2021a); Liu et al. (2021c); Klicpera et al. (2018)'s forward procedure will converge to the equilibrium state of the corresponding optimization problem and Yang et al. (2021b) has already shown their relationships, we call these models the graph equilibrium models in the following. Yang et al. (2021a) briefly discusses the deterministic proximal gradient descent method's implementation for explicit graph models. Different regularizers' impacts on graph models' robustness have also been explored in Liu et al. (2021b;c) by adding them and reformulating their correlated optimization problems. Implicit graph models(El Ghaoui et al., 2021) are new types of graph neural architectures inspired by the deep equilibrium models (Bai et al., 2019; Li et al., 2021) in deep learning whose outputs are determined implicitly by the designation of fixed-point equations with graph aggregation. Since these models' forward procedures are all trying to reach the equilibrium points by iteratively aggregating on graphs, these models can capture the long-range information of graphs. Therefore, the graph equilibrium models can perform well on various large-scale graphs. However, as these models need aggregating whole graphs lots of times for the outputs, the computation complexity is large when dealing with large and dense graphs if we use the original solvers for graph equilibrium models. + +# 2.3 GRAPH NEURAL NETWORKS FOR LARGE GRAPHS + +Aggregating through large or dense graphs needs huge computation complexity. Different training or inference strategy have been proposed to reduce the computation cost for training and testing procedures. GraphSAINT (Zeng et al., 2019) and Cluster-GCN (Chiang et al., 2019) propose subgraph sampling and restrict the back-propagation within the subgraphs to reduce the complexity of training. VR-GCN (Chen et al., 2017) uses the variance elimination method for training to improve the training performance. Narayanan et al. (2021) uses lazy update for weight parameters' training. GraphSAGE (Hamilton et al., 2017) updates a sub-sampled neighborhood of a node during training and inferencing to speed up GNNs. + +# 3 GRAPH EQUILIBRIUM MODELS USING THE UNBIASED STOCHASTIC SOLVER + +# 3.1 PRELIMINARIES AND SETTINGS + +Implicit graph neural networks and other unfolded graph neural networks' forward procedure to get the output features after $n$ iterations $\mathbf{Z}^{(n)}$ for given input $\mathbf{X}$ can be formulated as follows: + +$$ +\mathbf {Z} ^ {(n)} = \sigma \left(\mathbf {Z} ^ {(n - 1)} - \gamma \mathbf {Z} ^ {(n - 1)} + \gamma \mathbf {B} - \gamma \tilde {\mathbf {A}} \mathbf {Z} \mathbf {W} \mathbf {W} ^ {\top}\right), \tag {1} +$$ + +with $\tilde{\mathbf{A}} = \mathbf{I} - \mathbf{D}^{-1/2}\mathbf{A}\mathbf{D}^{-1/2}$ denotes the Laplacian matrix, $\mathbf{A}$ is the adjacent matrix, input injection is $\mathbf{B} = \tilde{\mathbf{A}}\mathbf{X}\mathbf{W}_B$ as former works (Gu et al., 2020; Park et al., 2021) and $\sigma$ is the activation function. It can be viewed as the implicit graph neural networks when $\gamma = 1$ and otherwise it can be regarded as other unfolded graph neural networks. The above equation can also be regarded as solving the following graph denoising problems by deterministic gradient descent with step size $\gamma$ , + +$$ +\min _ {\mathbf {Z}} G (\mathbf {Z}) = \min _ {\mathbf {Z}} g (\mathbf {Z}) + f (\mathbf {Z}) = \min _ {\mathbf {Z}} \left(\frac {1}{2} \| \mathbf {Z} - \mathbf {B} \| _ {F} ^ {2} + \frac {1}{2} t r \left(\left(\mathbf {Z W}\right) ^ {\top} \tilde {\mathbf {A}} (\mathbf {Z W})\right)\right) + f (\mathbf {Z}), \tag {2} +$$ + +where $f$ is the proximal function that tries to constrain the output features and can induce the widely used activation functions by different choices. For example, if we choose to constrain the output features to be non-negative by setting $f$ as the positive indicator function, then the corresponding graph equilibrium models will use ReLU activation functions. Furthermore, the above formulation is the general formulation for different models. For example, IRLS (Yang et al., 2021a) sets $\mathbf{W} = \mathbf{I}$ , APPNP (Klicpera et al., 2018) needs weight $\mathbf{W}$ and activation all be identity. Although our formulation Eqn (1) restricts the symmetric weight structure $\mathbf{W}\mathbf{W}^{\top}$ , our optimization problem's weight parameter in Eqn (2) is not be constrained. Therefore, it won't have many impacts on the representative ability of the hidden problem and the graph equilibrium models, which are also illustrated in Hu et al. (2019a)'s work. To solve the above problem to get the equilibrium state, + +most works apply the deterministic gradient descent method like Eqn (1). However, such a solver is time-consuming, especially when aggregating large graphs in each update. Therefore, we are going to propose new solvers for the above graph equilibrium models to make them more efficient. Before that, we are going to make some assumptions for the convenience of our analysis. + +Firstly, we assume $\| \mathbf{W}\mathbf{W}^{\top}\|_{2}\leq 1 / \| \tilde{\mathbf{A}}\|_{2}$ which can easily be achieved by weight normalization (Salimans & Kingma, 2016) following Gu et al. (2020)'s setting. As shown in former works (Bai et al., 2020; Li et al., 2021), such a technique will not influence the performance much. Furthermore, we assume the derivative of $g(\mathbf{Z})$ are Lipschitz continuous with Lipschitz constant $L$ satisfying $1 < L < 2$ , which can also be achieved by weight normalization. $G(\mathbf{Z})$ is strongly convex with $\mu = 1$ , which can easily be achieved for many activation functions including ReLU. And in our work, we mainly focus on the graph equilibrium models without attention. + +# 3.2 SOLVE GRAPH EQUILIBRIUM MODELS VIA UNBIASED STOCHASTIC SOLVER + +In order to obtain the solutions in a stochastic way, we first reformulate the graph optimization problem (2) from the view of edges as follows: + +$$ +\min _ {\mathbf {Z}} G (\mathbf {Z}) = \min _ {\mathbf {Z}} g (\mathbf {Z}) + f (\mathbf {Z}) = \min _ {\mathbf {Z}} \left(\frac {1}{2} \| \mathbf {Z} - \mathbf {B} \| _ {F} ^ {2} + \frac {1}{2} \sum_ {(i, j) \in \mathcal {E}} \tilde {\mathbf {A}} _ {i j} \| \mathbf {z} _ {i} \mathbf {W} - \mathbf {z} _ {j} \mathbf {W} \| _ {2} ^ {2}\right) + f (\mathbf {Z}), \tag {3} +$$ + +where $\mathcal{E}$ is the full edges set of the graph, $(i,j)\in \mathcal{E}$ means an edge between node $i$ and $j$ exist in the edge set $\mathcal{E}$ , $\mathbf{z}_i$ is the output feature vector for the $i$ -th node and $\tilde{\mathbf{A}}_{ij}$ denotes $(i,j)$ -th element of original Laplacian $\tilde{\mathbf{A}}$ . Viewing graph edges as samples of the dataset, the original algorithm can be viewed as using the global proximal gradient descent method for the problem (3). However, acquiring the global gradient in each iteration is expensive as we demonstrate above. To make them more efficient, we convert the deterministic solvers for graph equilibrium models to the stochastic scheme. + +First, we separate the global graph denoising objective $g$ into $m$ sub-objectives: + +$$ +g _ {\hat {\mathcal {E}} _ {k}} (\mathbf {Z}) = \frac {1}{2} \| \mathbf {Z} - \mathbf {B} \| _ {F} ^ {2} + \frac {m}{2} \sum_ {(i, j) \in \hat {\mathcal {E}} _ {k}} \tilde {\mathbf {A}} _ {i j} \| \mathbf {z} _ {i} \mathbf {W} - \mathbf {z} _ {j} \mathbf {W} \| _ {2} ^ {2}, \tag {4} +$$ + +where $\hat{\mathcal{E}}_k\subset \mathcal{E}$ is the $k$ -th subset of edges which are randomly split into $m$ sets from the full graph set and each contains around $\lfloor \frac{\lfloor\mathcal{E}\rfloor}{m}\rfloor$ edges. Then the original optimization problem can be regarded as a finite sum optimization problem: $G(\mathbf{Z}) = \frac{1}{m}\sum_{k = 1}^{m}g_{\hat{\mathcal{E}}_k}(\mathbf{Z}) + f(\mathbf{Z})$ + +Then we can use the stochastic proximal gradient method by randomly choosing $k \in \{1, \dots, m\}$ with the same probability and calculate the stochastic gradient for updating as follows: + +$$ +\mathbf {V} ^ {(t)} = \mathbf {Z} ^ {(t)} + m \hat {\mathbf {A}} _ {\hat {\varepsilon} _ {k}} \mathbf {Z} ^ {(t)} \mathbf {W} \mathbf {W} ^ {\top} - \mathbf {B}, \tag {5} +$$ + +$$ +\mathbf {Z} ^ {(t + 1)} = \sigma (\mathbf {Z} ^ {(t)} - \eta_ {t} \mathbf {V} ^ {(t)}), \tag {6} +$$ + +where $\eta_t = \frac{1}{t}$ is the step size and $\hat{\mathbf{A}}_{\hat{\mathcal{E}}_k}$ is the laplacian matrix for $g_{\hat{\mathcal{E}}_k}$ with $m\mathbb{E}_k\hat{\mathbf{A}}_{\hat{\mathcal{E}}_k} = \tilde{\mathbf{A}}$ and its $(k_1, k_2)$ -th element defined as: + +$$ +\hat {\mathbf {A}} _ {\hat {\mathcal {E}} _ {k}} (k _ {1}, k _ {2}) = \left\{ \begin{array}{l l} \sum_ {(k _ {1}, j) \in \hat {\mathcal {E}} _ {k}} \tilde {\mathbf {A}} _ {k _ {1} j}, & i f k _ {1} = k _ {2}, \\ \tilde {\mathbf {A}} _ {k _ {1} k _ {2}}, & i f (k _ {1}, k _ {2}) \in \hat {\mathcal {E}} _ {k}, \\ 0, & o t h e r w i s e. \end{array} \right. +$$ + +We call the graph equilibrium models "A" using our solvers are Eqn (6) as the "A w. USP" in the following. "A w. USP" can converge to the equilibrium state $\mathbf{Z}^*$ as the following proposition states: + +Proposition 1. With the assumptions in Section 3.1, the expectations of our uniformly sampled stochastic gradient defined in Eqn (5) is the same as the $g(\mathbf{Z})$ 's gradient, i.e. $\mathbb{E}_{\hat{\mathcal{E}}}\nabla_{\mathbf{Z}}\left[g_{\hat{\mathcal{E}}_k}(\mathbf{Z})\right] = \nabla_{\mathbf{Z}}g(\mathbf{Z})$ . Furthermore, we can conclude that with our USP solver Eqn (6) and $\eta_t = \frac{1}{t}$ , the result will converge to the solution of the global objective Eqn (3) in expectation with the sub-linear convergent rate, i.e., (We use $\mathbf{Z}^*$ to denote the minimizer of Eqn (3). + +$$ +\mathbb {E} \left\| \mathbf {Z} ^ {(t)} - \mathbf {Z} ^ {*} \right\| _ {F} ^ {2} = O \left(\frac {1}{t}\right). \tag {7} +$$ + +Proofs can be found in the Appendix. The above proposition indicates that iteratively forwarding the stochastic proximal gradient descent step Eqn (6) can finally get the solution for the problem Eqn (3), which means that our proposed stochastic solver is unbiased. Since the inner iterations Eqn (5) and (6) only need subgraphs instead of the full graph, our stochastic proximal solver can be much more efficient than the original solvers for graph equilibrium models in practice. However, the USP solver's forward procedure can only provide sub-linear convergence. Thereby, the outputs of our proposed solver will be less accurate than the vanilla deterministic models when their propagation times are limited during the forward procedure in practice and may influence performance. To solve such a problem, we propose another stochastic solver with the linear convergent rate in the following. + +# 3.3 SOLVE GRAPH EQUILIBRIUM MODELS VIA UNBIASED STOCHASTIC SOLVER WITH VARIANCE REDUCTION + +Although using the stochastic proximal gradient defined in Eqn. (5) is unbiased, the large variance of the stochastic gradient still hinders our stochastic solver's convergence speed. A straightforward way to reduce the variance is utilizing the full gradient to correct the gradient every $m_2$ iteration. For example, if next $m_2$ iterations of graph equilibrium models' forwarding are initialized with $\mathbf{Z}^{(0)} = \tilde{\mathbf{Z}}$ , then for the $k$ -th iteration with $k \geq 1$ , we can use the modified gradient $\hat{\mathbf{V}}^{(k)}$ to replace the original $\mathbf{V}^{(k)}$ in Eqn (5): + +$$ +\hat {\mathbf {V}} ^ {(k)} = \nabla g _ {\hat {\mathcal {E}} _ {i _ {k}}} (\mathbf {Z} ^ {(k - 1)}) - \nabla g _ {\hat {\mathcal {E}} _ {i _ {k}}} (\tilde {\mathbf {Z}}) + \nabla g (\tilde {\mathbf {Z}}), \tag {8} +$$ + +with $i_k$ sampled randomly from 1 to $m$ with the same probability. Moreover, we can easily conclude that the modified direction $\hat{\mathbf{V}}_k$ is unbiased and have a smaller variance than $\mathbf{V}^{(k)}$ in Eqn (5): + +$$ +\mathbb {E} \left[ \hat {\mathbf {V}} ^ {(k)} \right] = \nabla g (\mathbf {Z} ^ {(k - 1)}), +$$ + +$$ +\mathbb {E} \left\| \hat {\mathbf {V}} ^ {(k)} - \nabla g (\mathbf {Z} ^ {(k - 1)}) \right\| ^ {2} \leq \mathbb {E} \left\| \mathbf {V} ^ {(k)} - \nabla g (\mathbf {Z} ^ {(k - 1)}) \right\| ^ {2}. +$$ + +Replacing the original stochastic gradient with this modified version in the USP solver, we obtain our Unbiased Stochastic Proximal Solver with Variance Reduction (USP-VR) which is inspired by the variance reduction algorithm proposed in Xiao & Zhang (2014). The procedure for our USP-VR solver is listed in Algorithm 1. + +Algorithm 1 USP-VR solver's procedure for the equilibrium state. + +Input: Input graph Laplacian $\tilde{\mathbf{A}}$ , input injection $\mathbf{B}$ , initial state $\tilde{\mathbf{z}}_0$ , step size $\eta$ , maximum iteration number $m_{1}$ , $i = 1$ , maximum inner iteration number $m_{2}$ , $\mathbf{W},\sigma$ depend on the choices of different graph equilibrium models. + +Output: output $\tilde{\mathbf{Z}}$ + +1: Randomly split the whole edge set $\mathcal{E}$ into $m$ subsets $\{\hat{\mathcal{E}}_1,\dots ,\hat{\mathcal{E}}_m\}$ and generate the subgraph's laplacian matrix. $\{\hat{\mathbf{A}}_{\hat{\mathcal{E}}_1},\dots ,\hat{\mathbf{A}}_{\hat{\mathcal{E}}_m}\}$ . +2: while $i \leq m_1$ and $\tilde{\mathbf{Z}}^{(i)}$ not satisfies stop condition do +3: $\tilde{\mathbf{Z}} = \tilde{\mathbf{Z}}^{(i)}$ +4: $\tilde{\mathbf{V}} = \tilde{\mathbf{Z}} +\tilde{\mathbf{A}}\tilde{\mathbf{Z}}\mathbf{W}\mathbf{W}^{\top} - \mathbf{B}.$ +5: $\mathbf{Z}^{(0)} = \tilde{\mathbf{Z}}$ . +6: for $k = 1$ to $m_2$ do +7: Randomly pick $s_k \in \{1, \dots, m\}$ with the same probability. +8: $\hat{\mathbf{V}}^{(k)} = (\mathbf{Z}^{(k - 1)} - \tilde{\mathbf{Z}}) + m\hat{\mathbf{A}}_{\hat{\mathcal{E}}_{s_k}}(\mathbf{Z}^{(k - 1)} - \tilde{\mathbf{Z}})\mathbf{W}\mathbf{W}^\top +\tilde{\mathbf{V}}.$ +9: $\mathbf{Z}^{(k)} = \sigma \left(\mathbf{Z}^{(k - 1)} - \eta \hat{\mathbf{V}}^{(k)}\mathbf{W}\right)$ +10: end for +11: $\bar{\mathbf{Z}}^{(i + 1)} = \frac{1}{m_2}\sum_{k = 1}^{m_2}\mathbf{Z}^{(k)}.$ +12: $i = i + 1$ +13: end while + +Since the global optimization problem $G(\mathbf{Z})$ is strongly convex, the USP-VR solver's multi-stage procedure can progressively reduce the variance of the stochastic gradient $\mathbf{V}_k$ and both $\tilde{\mathbf{Z}}, \mathbf{Z}^{(k)}$ will finally converge to $\mathbf{Z}^*$ with proper step size $\eta$ . + +Proposition 2. With the same settings and assumptions in Proposition 1, we can conclude that our proposed USP-VR solver can converge to the equilibrium state with step size $\eta < \frac{1}{8L_{\mathrm{max}}}$ and sufficiently large $m_2$ so that + +$$ +\rho = \frac {8 L _ {\mathrm {m a x}} \eta^ {2} (m _ {2} + 1) + 1}{(\eta - 8 L _ {\mathrm {m a x}} \eta^ {2}) m _ {2}} < 1. +$$ + +where $L_{\mathrm{max}} = \max_k L_{g_{\hat{\mathcal{E}}_k}}$ where $L_i$ are the Lipschitz constants for $g_{\hat{\mathcal{E}}_i}$ 's derivatives. The output $\tilde{\mathbf{Z}}^{(i)}$ after $i$ iterations will converge to the optimal solution $\mathbf{Z}^*$ linearly in expectation as follows: + +$$ +\mathbb {E} \left\| \tilde {\mathbf {Z}} ^ {(i)} - \mathbf {Z} ^ {*} \right\| _ {F} ^ {2} \leq \rho^ {i} \left\| \tilde {\mathbf {Z}} ^ {(0)} - \mathbf {Z} ^ {*} \right\| _ {F} ^ {2}. +$$ + +As the above proposition shows, our USP-VR solver enjoys a linear convergent rate like the vanilla deterministic solvers. Therefore, our USP-VR solver can achieve the solution which are more near to optimal compared with the USP-VR solver with limited propagation times in the forward procedure. Moreover, our USP-VR solver is still much faster than the original deterministic solvers since we only use the full graph for every $m_2$ iteration. + +# 3.4 BACK PROPAGATION WHEN USING OUR SOLVERS + +Assuming all the graph equilibrium models have achieved the equilibrium $\mathbf{Z}^{\mathrm{f}}$ during its iterative forward pass, we use the one-step gradient by feeding $\mathbf{Z}^{\mathrm{f}}$ to one deterministic iteration update (Eqn (1)) inspired by former works (Geng et al., 2021; Guo, 2013; Fung et al., 2022). Using $h$ to represent the deterministic iteration update (Eqn (1)) for convenience, the output for down-stream tasks is $\mathbf{Z}^{\mathrm{o}} = h(\mathbf{Z}^{\mathrm{f}},\mathbf{A},\mathbf{X})$ . Since we can regard the whole structure as only propagating once from a near-optimal initialization point, we can only backward the final iteration to get the gradients. Gradients for learnable parameters in our methods can be written as follows: + +$$ +\frac {\partial L \left(\mathbf {Z} ^ {\circ}\right)}{\partial \theta} = \frac {\partial L \left(\mathbf {Z} ^ {\circ}\right)}{\partial \mathbf {Z} ^ {\circ}} \left(\mathbf {I} + \frac {\partial h \left(\mathbf {Z} ^ {\mathrm {f}}, \mathbf {A} , \mathbf {X}\right)}{\partial \mathbf {Z} ^ {\mathrm {f}}}\right) \frac {\partial h \left(\mathbf {Z} ^ {\mathrm {f}} , \mathbf {A} , \mathbf {X}\right)}{\partial \theta} \tag {9} +$$ + +where $\theta$ denotes the learnable parameters for the graph equilibrium models $h$ . The one-step gradient can be regarded as the first-order Neumann approximation of the original gradients with a more efficient memory cost. We adopt this approximated gradient in all our experiments. + +# 4 EXPERIMENTS + +In this section, we demonstrate the efficiency of our proposed USP and USP-VR solver compared with the traditional implicit models on large graph datasets with better performance on both node classification and graph classification tasks. Specifically, we test graph equilibrium models using our solvers against their vanilla version and other models on 6 popular node classification datasets (Flickr, Reddit, Yelp, PPI (Zitnik & Leskovec, 2017), OGBN (Hu et al., 2020) (Arxiv and Products)) and 2 graph classification datasets. These datasets are challenging for not only graph equilibrium models but also vanilla graph neural networks due to their sizes. We conduct the experiments on PyTorch (Paszke et al., 2019) with Torch-Geometric (Fey & Lenssen, 2019) and DGL (Wang et al., 2019). All the experiments are finished on an RTX-3090 GPU. The hyper-parameter settings and other details for the experiments are listed in the Appendix. + +# 4.1 NUMERICAL EVALUATION + +We first conduct an experiment to explore whether our proposed method can converge to equilibrium as our analysis shows. As we cannot obtain the closed-form solution for Problem (2), we use the gradient of $g(\mathbf{Z})$ in Eqn (3) as the evaluation of the convergence. This is because $\nabla_{\mathbf{Z}}g(\mathbf{Z}) = 0$ also demonstrates $\mathbf{Z}$ satisfies the first-order condition of Problem (2) if $\mathbf{Z}$ is obtained by our methods. + +In this part, we use Reddit to draw the convergence curve for one layer IGNN, IGNN w. USP, and IGNN w. USP-VR layer with 128 output feature size for each node. We set $m = 20$ for our proposed solvers and $m_2 = 10$ for IGNN w. USP-VR. Then we draw the convergence curve of the relative gradient concerning the equivalent subgraph aggregation times (Each IGNN's iteration through the full graph is equivalent to $m$ times subgraph aggregation) as Figure 1 shows. + +![](images/b507e0c3fe78f7b14fee03580303b72f60ce262062e5c639769fad46b95c8dd7.jpg) +Figure 1: The convergence curve of each model's equilibrium state on Reddit Dataset. + +The convergence curve is consistent with our analysis: IGNN w. USP can quickly converge compared with IGNN and IGNN w. USP-VR in the beginning while IGNN w. USP-VR will finally converge to a better solution compared with the other two models. + +# 4.2 NODE CLASSIFICATION + +Comparison on popular large-scale graphs. In this section, we first evaluate the performance of our methods on popular large-scale benchmark node classification graph datasets with the benchmark model APPNP and IGNN. The statistics of the four datasets are listed in Table 1. We compare the performance of the above models with their vanilla and our USP solvers. Apart from that, we also report the vanilla GCN and its sampling variants as baselines. All models share the uniform hidden dimensions of 256, $m = 20$ for our stochastic solvers, and other training details can be found in the Appendix. Furthermore, all models are trained without subgraph training except the results for the ClusterGCN and GraphSAINT. The results are listed in Table 2. + +Table 1: Data Statistic ("m" stands for multi-label classification, and "s" for single-label). + +
DatasetNodesEdgesDegreeClassesTraining/Validation/Test
Flickr89,250899,756107(s)0.50/0.25/0.25
Reddit232,965114,615,8925041(s)0.66/0.10/0.24
Yelp716,84713,954,81910100(m)0.75/0.10/0.15
PPI (Multi Graph)14,755225,27014121(m)0.79/0.11/0.10
OGBN-Arxiv169,3431,166,243740(s)0.54/0.18/0.18
OGBN-Product2,449,02961,859,1402547(s)0.90/0.02/0.08
+ +From the table, one can see that our methods can outperform other vanilla models with notable advantages on most datasets, which means that our USP solvers can also capture long-range information such as APPNP and IGNN with their vanilla models. Moreover, the USP-VR solver is slightly better than USP solver because USP-VR can obtain outputs that are nearer to the optimal. + +In addition to evaluating the prediction performance, we also draw the testing and training time for different models in Figure 2 to demonstrate the efficiency of our proposed solvers. From the figures, one can see that our USP solvers can accelerate APPNP and IGNN for more than $2 \times$ . Moreover, our USP solvers are more than $10 \times$ faster than the vanilla solver on Reddit because its scale is larger than the other three datasets. Our USP-VR solver is slightly slower with better results than our USP solver since they need additional full graph aggregation in the forward procedure. + +Comparison on OGBN dataset. Apart from the above datasets, we also conduct experiments for different models with their vanilla solvers and our USP solver on OGBN datasets listed in Table 3. From the table, one can see that our USP solvers can still return comparable results on OGBN datasets + +Table 2: Comparison of test set Test Accuracy/F1-micro score with different methods. "OOT" here denotes that the time cost is more than $10 \times$ longer than using USP solvers. + +
ModelFlickrRedditYelpPPI
GCN (Kipf & Welling, 2016)49.2 ± 0.3%93.3 ± 0.1%37.8 ± 0.1%51.2 ± 0.3%
GraphSAGE (Hamilton et al., 2017)50.1 ± 1.3%95.3 ± 0.1%63.4 ± 0.6%63.4 ± 0.4%
FastGCN (Chen et al., 2018)50.1 ± 1.3%95.3 ± 0.1%63.4 ± 0.6%51.3 ± 3.2%
ASGCN (Huang et al., 2018)50.1 ± 1.3%95.3 ± 0.1%63.4 ± 0.6%68.7 ± 1.2%
ClusterGCN (Chiang et al., 2019)48.1 ± 0.5%95.4 ± 0.1%60.9 ± 0.5%87.3 ± 0.4%
GraphSAINT (Zeng et al., 2019)51.5 ± 0.1%96.7 ± 0.1%64.5 ± 0.3%98.0 ± 0.2%
APPNP (Klicpera et al., 2018)51.2 ± 0.2%95.9 ± 0.2%63.2 ± 0.2%98.1 ± 0.2%
APPNP w. USP52.4 ± 0.1%96.2 ± 0.2%63.5 ± 0.3%97.9 ± 0.2%
APPNP w. USP-VR52.3 ± 0.2%96.4 ± 0.3%63.7 ± 0.1%98.2 ± 0.3%
IGNN (Gu et al., 2020)53.0 ± 0.2%OOT65.8 ± 0.2%97.8 ± 0.1%
IGNN w. USP54.1 ± 0.2%96.7 ± 0.3%66.2 ± 0.2%98.3 ± 0.2%
IGNN w. USP-VR54.3 ± 0.1%96.8 ± 0.2%66.1 ± 0.2%98.5 ± 0.2%
+ +![](images/4105d77a09ac29fa7c4c64018bd888eed24290cae9014784dba677b56b3654e8.jpg) +(a) Epoch time for IGNN. + +![](images/39a462a13b18e89a3546561afc984d84a2cf9aa6f65491fbf200ce7c756b05e3.jpg) +(b) Epoch time for APPNP. +Figure 2: Comparison of the training time per epoch and test time through the full graph of IGNN and APPNP with and without our proposed solvers for different node classification datasets. + +with much faster speed. From the above results, we can conclude that our proposed solvers can effectively improve the efficiency of various graph equilibrium models, especially on large graphs with comparable or even better performance on the node classification tasks. + +
IGNNIRLSAPPNPDAGNNJKNet
ArxivAccuracy70.4 ± 0.8%71.1 ± 0.3%71.1 ± 0.2%71.1 ± 0.1%71.0 ± 0.2%
w. USP Accuracy72.7 ± 0.2%71.6 ± 0.2%71.4 ± 0.2%71.3 ± 0.1%71.5 ± 0.4%
w. USP Speedup3.5×2×2.5×2.3×2.4×
ProductAccuracy69.7 ± 0.8%73.8 ± 0.2%74.2 ± 0.6%73.7 ± 0.6%75.4 ± 0.3%
w. USP Accuracy73.6 ± 0.3%73.8 ± 0.3%74.6 ± 0.5%73.5 ± 0.7%75.2 ± 0.4%
w. USP Speedup5×3×6×6.2×4.5×
+ +Table 3: The empirical results for different Graph Equilibrium Models with their vanilla solver and our proposed USP solvers on OGBN datasets. + +# 4.3 GRAPH CLASSIFICATION + +Aside from the node classification, we also conduct experiments on graph classification datasets to see whether our methods can show consistent advantages on graph classification tasks. We use D&D (Dobson & Doig, 2003) (Bioinformatics Graphs) and COLLAB (Yanardag & Vishwanathan, 2015) (Social Graphs) for our experiments and use CGS and IGNNs as baselines. Training details can be found in the Appendix. Results are listed in Table 3a and test time for IGNN and our methods are drawn in Figure 3b. From the results, our proposed solvers also perform well. + +
datasetD&DCOLLAB
# Graphs11785000
Avg # Edges7162458
CGS-176.75 ± 2.9%77.4 ± 3.5%
CGS-4OOM77.5 ± 3.1%
IGNN76.5 ± 8.1%78.5 ± 1.6%
IGNN w. USP78.1 ± 6.2%78.4 ± 1.2%
IGNN w. USP-VR81.8 ± 2.1%78.1 ± 1.5%
+ +![](images/3ad27ea8b0641a06d9de1b7b0e840de91e4c5babb9fa5ccea106f8efa2d95573.jpg) +(b) Test time for IGNN and IGNN with our proposed solvers. +Figure 3: Graph classification accuracy and test time. Accuracies are averaged (and std are computed) on the outer 10 folds. CGS- $k$ denotes the CGS model with $k$ heads. "OOM" denotes out-of-memory. +Figure 4: Comparison of different accelerating methods. + +IGNN with our proposed solvers is also faster than its origin in the experiment, $3 \times$ on COLLAB and $1.5 \times$ on D&D as the figure shows. We notice that our efficiency advantages are less significant than using our methods in the node classification tasks. The reason is that the scale of a single graph is much smaller in the graph classification task and the time cost of graph aggregations is not too large compared with others like linear layers' propagation or data processing. Furthermore, we can conclude that our stochastic solvers can perform more efficiently as the graph scale goes larger as our experiments show because the time cost of graph aggregation can gradually dominate the total cost of the implicit models as the graph gets larger. + +# 4.4 ABLATION STUDY: COMPARISON WITH FORMER SAMPLING METHODS. + +First, we use the "SAGE" aggregator to directly replace APPNP's graph aggregation to conduct the experiments on OGBN-Arxiv. The results are shown in Table (4a). From the table, one can see that the original sage aggregator is not stable when applying them on APPNP because they cannot ensure convergence like our USP solvers. + +(a) Graph classification accuracy. + +
Vanillawith USPwith SAGE
Acc71.1 ± 0.2%71.4 ± 0.2%67.8 ± 5.7%
Epoch Time4.1s1.7s3.1s
+ +(a) APPNP variants with full-graph training. + +
GraphSAINTGraphSAINT w. USP
Acc64.8 ± 0.265.2 ± 0.3%
Epoch Time14s9.5s
+ +(b) IGN with sub-graph training on Yelp. + +Furthermore, we conduct experiments using GraphSAINT on IGNN with and without our USP solvers in Table (4b) on Yelp. From the table, one can see that our USP solver can also accelerate the models when training them with the sub-graph techniques. + +# 5 CONCLUSIONS + +In our work, we first propose two stochastic solvers for the graph equilibrium models from the view of their relationship to the graph denoising optimization problem. Our proposed solvers can be applied to different graph equilibrium models such as APPNP and IGNN. Since our proposed solvers only need to propagate sub-graphs in each aggregation, our methods are much faster than the original fixed point iterative or gradient descent solvers used for implicit graph models and unfolded graph models, especially on large and dense graphs. Furthermore, we also theoretically prove that our solvers are unbiased and can finally output the same equilibrium state as the vanilla equilibrium models. The empirical results also demonstrate the advantages of different models with our proposed solvers for large-scale graphs. + +# ACKNOWLEDGMENTS + +Zhouchen Lin and Yisen Wang were supported by National Key R&D Program of China (2022ZD0160302), the major key project of PCL, China (No. PCL2021A12), the NSF China (No. 62276004, 62006153), Open Research Projects of Zhejiang Lab (No. 2022RC0AB05), Huawei Technologies Inc., Qualcomm, and Project 2020BD006 supported by PKU-Baidu Fund. + +# REFERENCES + +Shaojie Bai, J Zico Kolter, and Vladlen Koltun. Deep equilibrium models. In NeurIPS, 2019. +Shaojie Bai, Vladlen Koltun, and J Zico Kolter. Multiscale deep equilibrium models. In NeurIPS, 2020. +Ben Chamberlain, James Rowbottom, Maria I Gorinova, Michael Bronstein, Stefan Webb, and Emanuele Rossi. Grand: Graph neural diffusion. In ICML, 2021. +Jianfei Chen, Jun Zhu, and Le Song. Stochastic training of graph convolutional networks with variance reduction. In arXiv preprint arXiv:1710.10568, 2017. +Jie Chen, Tengfei Ma, and Cao Xiao. Fastgen: fast learning with graph convolutional networks via importance sampling. In arXiv preprint arXiv:1801.10247, 2018. +Qi Chen, Yifei Wang, Yisen Wang, Jiansheng Yang, and Zhouchen Lin. Optimization-induced graph implicit nonlinear diffusion. In ICML, 2022. +Wei-Lin Chiang, Xuanqing Liu, Si Si, Yang Li, Samy Bengio, and Cho-Jui Hsieh. Cluster-GCN. In SIGKDD, 2019. +Paul D Dobson and Andrew J Doig. Distinguishing enzyme structures from non-enzymes without alignments. In *Inproceedings of Molecular Biology*, 2003. +Laurent El Ghaoui, Fangda Gu, Bertrand Travacca, Armin Askari, and Alicia Tsai. Implicit deep learning. In SIMODS, 2021. +Matthias Fey and Jan E. Lenssen. Fast graph representation learning with PyTorch Geometric. In ICLR Workshop on Representation Learning on Graphs and Manifolds, 2019. +Samy Wu Fung, Howard Heaton, Qiuwei Li, Daniel McKenzie, Stanley Osher, and Wotao Yin. Jfb: Jacobian-free backpropagation for implicit networks. In AAAI, 2022. +Zhengyang Geng, Xin-Yu Zhang, Shaojie Bai, Yisen Wang, and Zhouchen Lin. On training implicit models. In NeurIPS, 2021. +Fangda Gu, Heng Chang, Wenwu Zhu, Somayeh Sojoudi, and Laurent El Ghaoui. Implicit graph neural networks. In NeurIPS, 2020. +Jiang Guo. Backpropagation through time. In Unpubl. ms., Harbin Institute of Technology, 2013. +William L. Hamilton, Rex Ying, and Jure Leskovec. Inductive representation learning on large graphs. In arXiv preprint arXiv:1706.02216, 2017. +Xiangnan He, Kuan Deng, Xiang Wang, Yan Li, Yongdong Zhang, and Meng Wang. Lightgen: Simplifying and powering graph convolution network for recommendation. In SIGIR, 2020. +Shell Xu Hu, Sergey Zagoruyko, and Nikos Komodakis. Exploring weight symmetry in deep neural networks. In CVIU, 2019a. +Weihua Hu, Bowen Liu, Joseph Gomes, Marinka Zitnik, Percy Liang, Vijay Pande, and Jure Leskovec. Strategies for pre-training graph neural networks. In arXiv preprint arXiv:1905.12265, 2019b. +Weihua Hu, Matthias Fey, Marinka Zitnik, Yuxiao Dong, Hongyu Ren, Bowen Liu, Michele Catasta, and Jure Leskovec. Open graph benchmark: Datasets for machine learning on graphs. In arXiv preprint arXiv:2005.00687, 2020. + +Wenbing Huang, Tong Zhang, Yu Rong, and Junzhou Huang. Adaptive sampling towards fast graph representation learning. In NeurIPS, 2018. +Wei Jin, Yao Ma, Xiaorui Liu, Xianfeng Tang, Suhang Wang, and Jiliang Tang. Graph structure learning for robust graph neural networks. In SIGKDD, 2020. +Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In arXiv preprint arXiv:1609.02907, 2016. +Johannes Klicpera, Aleksandar Bojchevski, and Stephan Gunnemann. Predict then propagate: Graph neural networks meet personalized pagerank. In arXiv preprint arXiv:1810.05997, 2018. +Guohao Li, Matthias Muller, Ali Thabet, and Bernard Ghanem. Deepgcns: Can gcns go as deep as cnns? In ICCV, 2019. +Mingjie Li, Yisen Wang, Xingyu Xie, and Zhouchen Lin. Optimization inspired multi-branch equilibrium models. In ICLR, 2021. +Mingjie Li, Xiaojun Guo, Yifei Wang, Yisen Wang, and Zhouchen Lin. $\mathbf{G}^2\mathbf{cn}$ : Graph gaussian convolution networks with concentrated graph filters. In ICML, 2022. +Juncheng Liu, Kenji Kawaguchi, Bryan Hooi, Yiwei Wang, and Xiaokui Xiao. Eignn: Efficient infinite-depth graph neural networks. In NeurIPS, 2021a. +Xiaorui Liu, Jiayuan Ding, Wei Jin, Han Xu, Yao Ma, Zitao Liu, and Jiliang Tang. Graph neural networks with adaptive residual. In NeurIPS, 2021b. +Xiaorui Liu, Wei Jin, Yao Ma, Yaxin Li, Hua Liu, Yiqi Wang, Ming Yan, and Jiliang Tang. Elastic graph neural networks. In ICML, 2021c. +Dongsheng Luo, Wei Cheng, Wenchao Yu, Bo Zong, Jingchao Ni, Haifeng Chen, and Xiang Zhang. Learning to drop: Robust graph neural network via topological denoising. In WSDM, 2021. +Yao Ma, Xiaorui Liu, Tong Zhao, Yozen Liu, Jiliang Tang, and Neil Shah. A unified view on graph neural networks as graph signal denoising. In CIKM, 2021. +Maya Mincheva and Marc R Roussel. Graph-theoretic methods for the analysis of chemical and biochemical networks. ii. oscillations in networks with delays. In *Inproceedings of Mathematical Biology*, Springer, 2007. +S Deepak Narayanan, Aditya Sinha, Prateek Jain, Purushottam Kar, and Sundararajan Sellamanickam. Iglu: Efficient gcn training via lazy updates. In arXiv preprint arXiv:2109.13995, 2021. +Junyoung Park, Jinhyun Choo, and Jinkyoo Park. Convergent graph solvers. In arXiv preprint arXiv:2106.01680, 2021. +Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, high-performance deep learning library. In NeurIPS, 2019. +Jiezhong Qiu, Qibin Chen, Yuxiao Dong, Jing Zhang, Hongxia Yang, Ming Ding, Kuansan Wang, and Jie Tang. GCC: Graph contrastive coding for graph neural network pre-training. In SIGKDD, 2020. +Yu Rong, Wenbing Huang, Tingyang Xu, and Junzhou Huang. Droppedge: Towards deep graph convolutional networks on node classification. In ICLR, 2020. +Tim Salimans and Durk P Kingma. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. In NeurIPS, 2016. +Petar Velicković, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. Graph attention networks. In arXiv preprint arXiv:1710.10903, 2017. + +Fangping Wan, Lixiang Hong, An Xiao, Tao Jiang, and Jianyang Zeng. Neodti: neural integration of neighbor information from a heterogeneous network for discovering new drug-target interactions. In Bioinformatics, 2019. +Minjie Wang, Da Zheng, Zihao Ye, Quan Gan, Mufei Li, Xiang Song, Jinjing Zhou, Chao Ma, Lingfan Yu, Yu Gai, Tianjun Xiao, Tong He, George Karypis, Jinyang Li, and Zheng Zhang. Deep graph library: A graph-centric, highly-performant package for graph neural networks. In arXiv preprint arXiv:1909.01315, 2019. +Yifei Wang, Yisen Wang, Jiansheng Yang, and Zhouchen Lin. Dissecting the diffusion process in linear graph convolutional networks. In NeurIPS, 2021. +Felix Wu, Amauri Souza, Tianyi Zhang, Christopher Fifty, Tao Yu, and Kilian Weinberger. Simplifying graph convolutional networks. In ICML, 2019. +Zonghan Wu, Shirui Pan, Fengwen Chen, Guodong Long, Chengqi Zhang, and S Yu Philip. A comprehensive survey on graph neural networks. In IEEE TNNLS, 2020. +Lin Xiao and Tong Zhang. A proximal stochastic gradient method with progressive variance reduction. In SIAM, 2014. +Bingbing Xu, Huawei Shen, Qi Cao, Keting Cen, and Xueqi Cheng. Graph convolutional networks using heat kernel for semi-supervised learning. In arXiv preprint arXiv:2007.16002, 2020a. +Keyulu Xu, Chengtao Li, Yonglong Tian, Tomohiro Sonobe, Ken-ichi Kawarabayashi, and Stefanie Jegelka. Representation learning on graphs with jumping knowledge networks. In ICML, 2018. +Qiangeng Xu, Xudong Sun, Cho-Ying Wu, Panqu Wang, and Ulrich Neumann. Grid-gcn for fast and scalable point cloud learning. In CVPR, 2020b. +Pinar Yanardag and SVN Vishwanathan. Deep graph kernels. In SIGKDD, 2015. +Chaoqi Yang, Ruijie Wang, Shuochao Yao, Shengzhong Liu, and Tarek F. Abdelzaher. Revisiting "over-smoothing" in deep gcns. In arXiv preprint arXiv:2003.13663, 2020. +Yongyi Yang, Tang Liu, Yangkun Wang, Jinjing Zhou, Quan Gan, Zhewei Wei, Zheng Zhang, Zengfeng Huang, and David Wipf. Graph neural networks inspired by classical iterative algorithms. In ICML, 2021a. +Yongyi Yang, Yangkun Wang, Zengfeng Huang, and David Wipf. Implicit vs unfolded graph neural networks. In arXiv preprint arXiv:2111.06592, 2021b. +Zhitao Ying, Dylan Bourgeois, Jiaxuan You, Marinka Zitnik, and Jure Leskovec. Gnnexplainer: Generating explanations for graph neural networks. In NeurIPS, 2019. +Hao Yuan, Jiliang Tang, Xia Hu, and Shuiwang Ji. Xgnn: Towards model-level explanations of graph neural networks. In SIGKDD, 2020. +Hanqing Zeng, Hongkuan Zhou, Ajitesh Srivastava, Rajgopal Kannan, and Viktor Prasanna. Graph-saint: Graph sampling based inductive learning method. In arXiv preprint arXiv:1907.04931, 2019. +Hongwei Zhang, Tijin Yan, Zenjun Xie, Yuanqing Xia, and Yuan Zhang. Revisiting graph convolutional network on semi-supervised node classification from an optimization perspective. In arXiv preprint arXiv:2009.11469, 2020a. +Shijie Zhang, Hongzhi Yin, Tong Chen, Quoc Viet Nguyen Hung, Zi Huang, and Lizhen Cui. Gcn-based user representation learning for unifying robust recommendation and fraudster detection. In SIGIR, 2020b. +Lingxiao Zhao and Leman Akoglu. Pairnorm: Tackling oversmoothing in gnns. In arXiv preprint arXiv:1909.12223, 2019. + +Jie Zhou, Ganqu Cui, Shengding Hu, Zhengyan Zhang, Cheng Yang, Zhiyuan Liu, Lifeng Wang, Changcheng Li, and Maosong Sun. Graph neural networks: A review of methods and applications. In AI Open, Elsevier, 2020. +Meiqi Zhu, Xiao Wang, Chuan Shi, Houye Ji, and Peng Cui. Interpreting and unifying graph neural networks with an optimization framework. In Web Conference, 2021. +Marinka Zitnik and Jure Leskovec. Predicting multicellular function through multi-layer tissue networks. In Bioinformatics, 2017. \ No newline at end of file diff --git a/unbiasedstochasticproximalsolverforgraphneuralnetworkswithequilibriumstates/images.zip b/unbiasedstochasticproximalsolverforgraphneuralnetworkswithequilibriumstates/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..39929699e6a7ffdee6213a63261dbbea89a4b527 --- /dev/null +++ b/unbiasedstochasticproximalsolverforgraphneuralnetworkswithequilibriumstates/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:efd9489a3234f0b3033e4c8b81c903bbcb4a5713c37f63b75a0994b603206766 +size 430221 diff --git a/unbiasedstochasticproximalsolverforgraphneuralnetworkswithequilibriumstates/layout.json b/unbiasedstochasticproximalsolverforgraphneuralnetworkswithequilibriumstates/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..f78179023a753b92bb41611c00439266c95b071f --- /dev/null +++ b/unbiasedstochasticproximalsolverforgraphneuralnetworkswithequilibriumstates/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:59bc6664366887c5e6d871ac23bfdc34abb2f2435380722219f803109cd23860 +size 447564 diff --git a/unbiasedsupervisedcontrastivelearning/b12901a3-9b75-426f-8a3a-ea01687e032e_content_list.json b/unbiasedsupervisedcontrastivelearning/b12901a3-9b75-426f-8a3a-ea01687e032e_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..0fb511f6cf2cba34dce90c820f4e6a6350ab7bdf --- /dev/null +++ b/unbiasedsupervisedcontrastivelearning/b12901a3-9b75-426f-8a3a-ea01687e032e_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2032a2042f8c374cc94b90ab2d09881ca53021ab710d425a098f96a5290ae132 +size 142902 diff --git a/unbiasedsupervisedcontrastivelearning/b12901a3-9b75-426f-8a3a-ea01687e032e_model.json b/unbiasedsupervisedcontrastivelearning/b12901a3-9b75-426f-8a3a-ea01687e032e_model.json new file mode 100644 index 0000000000000000000000000000000000000000..e02077afc2fe6c1dc0a60bc984ca14a16a3fb5d5 --- /dev/null +++ b/unbiasedsupervisedcontrastivelearning/b12901a3-9b75-426f-8a3a-ea01687e032e_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b4cc89a142213ab2f98b3ff95090930bb5b73524b90bae881bfccdac04e69606 +size 167411 diff --git a/unbiasedsupervisedcontrastivelearning/b12901a3-9b75-426f-8a3a-ea01687e032e_origin.pdf b/unbiasedsupervisedcontrastivelearning/b12901a3-9b75-426f-8a3a-ea01687e032e_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..eb340e95c87d5397d5fdc92f668f3fd4203e02c0 --- /dev/null +++ b/unbiasedsupervisedcontrastivelearning/b12901a3-9b75-426f-8a3a-ea01687e032e_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:81c8ccbf49eb548a2a5689f534adcb8fbc1139b2c41715eb2cc02f9808dadd82 +size 2817683 diff --git a/unbiasedsupervisedcontrastivelearning/full.md b/unbiasedsupervisedcontrastivelearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..bcb30874339f1559c7f1f3aa32bbb32f6a28f429 --- /dev/null +++ b/unbiasedsupervisedcontrastivelearning/full.md @@ -0,0 +1,588 @@ +# UNBIASED SUPERVISED CONTRASTIVE LEARNING + +Carlo Alberto Barbano* + +University of Turin +LTCI, Telecom Paris, IP Paris + +Benoit Dufumier + +LTCI, Telecom Paris, IP Paris + +Enzo Tartaglione + +LTCI, Telecom Paris, IP Paris + +Marco Grangetto + +University of Turin + +Pietro Gori + +LTCI, Telecom Paris, IP Paris + +# ABSTRACT + +Many datasets are biased, namely they contain easy-to-learn features that are highly correlated with the target class only in the dataset but not in the true underlying distribution of the data. For this reason, learning unbiased models from biased data has become a very relevant research topic in the last years. In this work, we tackle the problem of learning representations that are robust to biases. We first present a margin-based theoretical framework that allows us to clarify why recent contrastive losses (InfoNCE, SupCon, etc.) can fail when dealing with biased data. Based on that, we derive a novel formulation of the supervised contrastive loss ( $\epsilon$ -SupInfoNCE), providing more accurate control of the minimal distance between positive and negative samples. Furthermore, thanks to our theoretical framework, we also propose FairKL, a new debiasing regularization loss, that works well even with extremely biased data. We validate the proposed losses on standard vision datasets including CIFAR10, CIFAR100, and ImageNet, and we assess the debiasing capability of FairKL with $\epsilon$ -SupInfoNCE, reaching state-of-the-art performance on a number of biased datasets, including real instances of biases "in the wild". + +# 1 INTRODUCTION + +Deep learning models have become the predominant tool for learning representations suited for a variety of tasks. Arguably, the most common setup for training deep neural networks in supervised classification tasks consists in minimizing the cross-entropy loss. Cross-entropy drives the model towards learning the correct label distribution for a given sample. However, it has been shown in many works that this loss can be affected by biases in the data (Alvi et al., 2018; Kim et al., 2019; Nam et al., 2020; Sagawa et al., 2019; Tartaglione et al., 2021; Torralba et al., 2011) or suffer by noise and corruption in the labels Elsayed et al. (2018); Graf et al. (2021). In fact, in the latest years, it has become increasingly evident how neural networks tend to rely on simple patterns in the data (Geirhos et al., 2019; Li et al., 2021). As deep neural networks grow in size and complexity, guaranteeing that they do not learn spurious elements in the training set is becoming a pressuring issue to tackle. It is indeed a known fact that most of the commonly-used datasets are biased (Torralba et al., 2011) and that this affects the learned models (Tommasi et al., 2017). In particular, when the biases correlate very well with the target task, it is hard to obtain predictions that are independent of the biases. This can happen, e.g., in presence of selection biases in the data. Furthermore, if the bias is easy to learn (e.g. a simple pattern or color), we will most likely obtain a biased model, whose predictions majorly rely on these spurious attributes and not on the true, generalizable, and discriminative features. Learning fair and robust representations of the underlying samples, especially when dealing with highly-biased data, is the main objective of this work. Contrastive learning has recently gained attention for this purpose, showing superior robustness to cross-entropy Graf et al. (2021). For this reason, in this work, we adopt a metric learning approach for supervised representation learning. Based on that, we provide a unified framework to analyze and compare existing formulations of contrastive losses1 such as the InfoNCE loss (Chen et al., 2020; Oord et al., + +![](images/ee27ea8d18aef6d355d7916a76a7a3774af22bdcf1ea568c05eca1662649502e.jpg) +(a) + +![](images/ab68456084584a13f76fe700edd5f365b8c91e3d176739783fdae7fc7467bff4.jpg) +(b) + +![](images/8695457e3b215cc69e644a53e423541d8f263cb81f72d0928577280260ff6100.jpg) +(c) +Figure 1: With $\epsilon$ -SupInfoNCE (a) we aim at increasing the minimal margin $\epsilon$ , between the distance $d^{+}$ of a positive sample $x^{+}$ (+ symbol inside) from an anchor $x$ and the distance $d^{-}$ of the closest negative sample $x^{-}$ (- symbol inside). By increasing the margin, we can achieve a better separation between positive and negative samples. We show two different scenarios without margin (b) and with margin (c). Filling colors of datapoints represent different biases. We observe that, without imposing a margin, biased clusters might appear containing both positive and negative samples (b). This issue can be mitigated by increasing the $\epsilon$ margin (c). + +2019), the InfoL1O loss (Poole et al., 2019) and the SupCon loss (Khosla et al., 2020). Furthermore, we also propose a new supervised contrastive loss that can be seen as the simplest extension of the InfoNCE loss (Chen et al., 2020; Oord et al., 2019) to a supervised setting with multiple positives. Using the proposed metric learning approach, we can reformulate each loss as a set of contrastive, and surprisingly sometimes even non-contrastive, conditions. We show that the widely used SupCon loss is not a "straightforward" extension of the InfoNCE loss since it actually contains a set of "latent" non-contrastive constraints. Our analysis results in an in-depth understanding of the different loss functions, fully explaining their behavior from a metric point of view. Furthermore, by leveraging the proposed metric learning approach, we explore the issue of biased learning. We outline the limitations of the studied contrastive loss functions when dealing with biased data, even if the loss on the training set is apparently minimized. By analyzing such cases, we provide a more formal characterization of bias. This eventually allows us to derive a new set of regularization constraints for debiasing that is general and can be added to any contrastive or non-contrastive loss. Our contributions are summarized below: + +1. We introduce a simple but powerful theoretical framework for supervised representation learning, from which we derive different contrastive loss functions. We show how existing contrastive losses can be expressed within our framework, providing a uniform understanding of the different formulations. We derive a generalized form of the SupCon loss $(\epsilon\text{-SupCon})$ , propose a novel loss $\epsilon\text{-SupInfoNCE}$ , and demonstrate empirically its effectiveness; +2. We provide a more formal definition of bias, thanks to the proposed metric learning approach, which is based on the distances among representations, This allows us to derive a new set of effective debiasing regularization constraints, which we call FairKL. We also analyze, theoretically and empirically, the debiasing power of the different contrastive losses, comparing $\epsilon$ -SupInfoNCE and SupCon. + +# 2 RELATED WORKS + +Our work is related to the literature in contrastive learning, metric learning, fairness, and debiasing. Contrastive Learning Many different contrastive losses and frameworks have been proposed (Chen et al., 2020; Khosla et al., 2020; Oord et al., 2019; Poole et al., 2019). Supervised contrastive learning approaches aim at pulling representations of the same class close together while repelling representations of different classes apart from each other. It has been shown that, in a supervised setting, this kind of optimization can yield better results than standard cross-entropy, and can be more robust against label corruption (Khosla et al., 2020; Graf et al., 2021). Related to contrastive learning, we + +can also find methods such as triplet losses (Chopra et al., 2005; Hermans et al., 2017) and based on distance metrics Schroff et al. (2015); Weinberger et al. (2006). The latter are the most relevant for this work, as we propose a metric learning approach for supervised representation learning. + +Debiasing Addressing the issue of biased data and how it affects generalization in neural networks has been the subject of numerous works. Some approaches in this direction include the use of different data sources in order to mitigate biases (Gupta et al., 2018) and data clean-up thanks to the use of a GAN (Sattigeri et al., 2018; Xu et al., 2018). However, they share some major limitations due to the complexity of working directly on the data. In the debiasing related literature, we can most often find approaches based on ensembling or adversarial setups, and regularization terms that aim at obtaining an unbiased model using biased data. The typical adversarial approach is represented by BlindEye (Alvi et al., 2018). They employ an explicit bias classifier, trained on the same representation space as the target classifier, in an adversarial way, forcing the encoder to extract unbiased representations. This is also similar to Xie et al. (2017). Kim et al. (2019) use adversarial learning and gradient inversion to reach the same goal. Wang et al. (2019b) adopt an adversarial approach to remove unwanted features from intermediate representations of a neural network. All of these works share the limitations of adversarial training, which is well known for its potential training instability. Other ensembling approaches can be found in Clark et al. (2019); Wang et al. (2020), where feature independence among the different models is promoted. Bahng et al. (2020) propose ReBias, aiming at promoting independence between biased and unbiased representations with a min-max optimization. In (Lee et al., 2021) disentanglement between bias features and target features is maximized to perform the augmentation in the latent space. Nam et al. (2020) propose LfF, where a bias-capturing model is trained with a focus on easier samples (bias-aligned), while a debiased network is trained by giving more importance to the samples that the bias-capturing model struggles to discriminate. Another approach is proposed in Wang et al. (2019a) with HEX, where a neural-network-based gray-level co-occurrence matrix (Haralick et al., 1973; Lam, 1996), is employed for learning invariant representations to some bias. However, all these methods require training additional models, which in practice can be resource and time-consuming. Obtaining representations that are robust and/or invariant to some secondary attribute can also be achieved by applying constraints and regularization to the model. Using regularization terms for debiasing has gained traction also due to the typically lower complexity when compared to methods such as exemplifying. For example, recent works attempt to discourage the learning of certain features with the aim of data privacy (Barbano et al., 2021; Song et al., 2017) and fairness (Beutel et al., 2019). For example, Sagawa et al. (2019) propose Group-DRO, which aims at improving the model performance on the worst-group, defined based on prior knowledge of the bias distribution. In RUBi (Cadene et al., 2019), logits re-weighting is used to promote the independence of the predictions on the bias features. Tartaglione et al. (2021) propose EnD, which is a regularization term that aims at bringing representations of positive samples closer together in case of different biases, and pulling apart representations of negative samples sharing the same bias attributes. A similar method is presented in (Hong & Yang, 2021), where a contrastive formulation is employed to reach a similar goal. Our method belongs to this latter class of approaches, as it consists of a regularization term which can be optimized during training. + +# 3 CONTRASTIVE LEARNING: AN $\epsilon$ -MARGIN POINT OF VIEW + +Let $x \in \mathcal{X}$ be an original sample (i.e., anchor), $x_{i}^{+}$ a similar (positive) sample, $x_{j}^{-}$ a dissimilar (negative) sample and $P$ and $N$ the number of positive and negative samples respectively. Contrastive learning methods look for a parametric mapping function $f: \mathcal{X} \to \mathbb{S}^{d-1}$ that maps "semantically" similar samples close together in the representation space (a (d-1)-sphere) and dissimilar samples far away from each other. Once pre-trained, $f$ is fixed and its representation is evaluated on a downstream task, such as classification, through linear evaluation on a test set. In general, positive samples $x_{i}^{+}$ can be defined in different ways depending on the problem: using transformations of $x$ (unsupervised setting), samples belonging to the same class as $x$ (supervised) or with similar image attributes of $x$ (weakly-supervised). The definition of negative samples $x_{j}^{-}$ varies accordingly. Here, we focus on the supervised case, thus samples belonging to the same/different class, but the proposed framework could be easily applied to the other cases. We define $s(f(a), f(b))$ as a similarity measure (e.g., cosine similarity) between the representation of two samples $a$ and $b$ . Please note that since $||f(a)||_2 = ||f(b)||_2 = 1$ , using a cosine similarity is equivalent to using a L2-distance $(d(f(a), f(b)) = ||f(a) - f(b)||_2^2)$ . Similarly to Chopra et al. (2005); Hadsell et al. (2006); Schroff et al. (2015); Sohn (2016); Wang et al. (2014; 2019c); Weinberger et al. (2006); Yu & Tao (2019), + +we propose to use a metric learning approach which allows us to better formalize recent contrastive losses, such as InfoNCE (Chen et al., 2020; Oord et al., 2019), InfoL1O (Poole et al., 2019) and SupCon (Khosla et al., 2020), and derive new losses that better approximate the mutual information and can take into account data biases. Using an $\epsilon$ -margin metric learning point of view, probably the simplest contrastive learning formulation is looking for a mapping function $f$ such that the following $\epsilon$ -condition is always satisfied: + +$$ +\underbrace {d \left(f (x) , f \left(x ^ {+}\right)\right)} _ {d ^ {+}} - \underbrace {d \left(f (x) , f \left(x _ {j} ^ {-}\right)\right)} _ {d _ {j} ^ {-}} < - \epsilon \Longleftrightarrow \underbrace {s \left(f (x) , f \left(x _ {j} ^ {-}\right)\right)} _ {s _ {j} ^ {-}} - \underbrace {s \left(f (x) , f \left(x ^ {+}\right)\right)} _ {s ^ {+}} \leq - \epsilon \quad \forall j \tag {1} +$$ + +where $\epsilon \geq 0$ is a margin between positive and negative samples and we consider, for now, a single positive sample. + +Derivation of InfoNCE The constraint of Eq. 1 can be transformed in an optimization problem using, as it is common in contrastive learning, the max operator and its smooth approximation LogSumExp (full derivation in the Appendix A.1.1): + +$$ +s _ {j} ^ {-} - s ^ {+} \leq - \epsilon \quad \forall j +$$ + +$$ +\underset {f} {\arg \min } \max (- \epsilon , \{s _ {j} ^ {-} - s ^ {+} \} _ {j = 1, \dots , N}) \approx \underset {f} {\arg \min } \underbrace {- \log \left(\frac {\exp (s ^ {+})}{\exp (s ^ {+} - \epsilon) + \sum_ {j} \exp (s _ {j} ^ {-})}\right)} _ {\epsilon - I n f o N C E} \tag {2} +$$ + +Here, we can notice that when $\epsilon = 0$ , we retrieve the InfoNCE loss, also known as N-Pair loss (Sohn, 2016), whereas when $\epsilon \rightarrow \infty$ we obtain the InfoL1O loss. It has been shown in Poole et al. (2019) that these two losses are lower and upper bound of the Mutual Information $I(X^{+},X)$ respectively: + +$$ +\underbrace {\log \frac {\exp s ^ {+}}{\exp s ^ {+} + \sum_ {j} \exp s _ {j} ^ {-}}} _ {\text {I n f o N C E}} \leq I \left(X ^ {+}, X\right) \leq \underbrace {\log \frac {\exp s ^ {+}}{\sum_ {j} \exp s _ {j} ^ {-}}} _ {\text {I n f o L 1 O}} \tag {3} +$$ + +By using a value of $\epsilon \in [0,\infty)$ , one might find a tighter approximation of $I(X^{+},X)$ since the exponential function at the denominator $\exp (-\epsilon)$ monotonically decreases as $\epsilon$ increases. + +Proposed supervised loss ( $\epsilon$ -SupInfoNCE) The inclusion of multiple positive samples $(s_i^+)$ can lead to different formulations. Some of them can be found in the Appendix A.1.2. Here, considering a supervised setting, we propose to use the following one, that we call $\epsilon$ -SupInfoNCE: + +$$ +s _ {j} ^ {-} - s _ {i} ^ {+} \leq - \epsilon \quad \forall i, j +$$ + +$$ +\sum_ {i} \max (- \epsilon , \{s _ {j} ^ {-} - s _ {i} ^ {+} \} _ {j = 1, \dots , N}) \approx \underbrace {- \sum_ {i} \log \left(\frac {\exp (s _ {i} ^ {+})}{\exp (s _ {i} ^ {+} - \epsilon) + \sum_ {j} \exp (s _ {j} ^ {-})}\right)} _ {\epsilon - S u p I n f o N C E} \tag {4} +$$ + +Please note that this loss could also be used in other settings, like in an unsupervised one, where positive samples could be defined as transformations of the anchor. Furthermore, even here, the $\epsilon$ value can be adjusted in the loss function, in order to increase the $\epsilon$ -margin. This time, contrarily to what happens with Eq. 2 and InfoNCE, if we consider $\epsilon = 0$ , we do not obtain the SupCon loss. + +Derivation of $\epsilon$ -SupCon (generalized SupCon) It's interesting to notice that Eq. 4 is similar to $\mathcal{L}_{out}^{sup}$ , which is one of the two SupCon losses proposed in Khosla et al. (2020), but they differ for a sum over the positive samples at the denominator. The $\mathcal{L}_{out}^{sup}$ loss, presented as the "most straightforward way to generalize" the InfoNCE loss, actually contains another non-contrastive constraint on the positive samples: $s_t^+ - s_i^+ \leq 0$ $\forall i, t$ . Fulfilling this condition alone would force all positive samples to collapse to a single point in the representation space. However, it does not take into account negative samples. That is why we define it as a non-contrastive condition. Considering both + +contrastive and non-contrastive conditions, we obtain: + +$$ +s _ {j} ^ {-} - s _ {i} ^ {+} \leq - \epsilon \quad \forall i, j \quad \text {a n d} \quad s _ {t} ^ {+} - s _ {i} ^ {+} \leq 0 \quad \forall i, t \neq i +$$ + +$$ +\frac {1}{P} \sum_ {i} \max \left(0, \left\{s _ {j} ^ {-} - s _ {i} ^ {+} + \epsilon \right\} _ {j}, \left\{s _ {t} ^ {+} - s _ {i} ^ {+} \right\} _ {t \neq i}\right) \approx \underbrace {\epsilon - \frac {1}{P} \sum_ {i} \log \left(\frac {\exp \left(s _ {i} ^ {+}\right)}{\sum_ {t} \exp \left(s _ {t} ^ {+} - \epsilon\right) + \sum_ {j} \exp \left(s _ {j} ^ {-}\right)}\right)} _ {\epsilon - S u p C o n} \tag {5} +$$ + +when $\epsilon = 0$ we retrieve exactly $\mathcal{L}_{out}^{sup}$ . The second loss proposed in Khosla et al. (2020), called $\mathcal{L}_{in}^{sup}$ , minimizes a different contrastive problem, which is a less strict condition and probably explains the fact that this loss did not work well in practice (Khosla et al., 2020): + +$$ +\max \left(s _ {j} ^ {-}\right) < \max \left(s _ {i} ^ {+}\right) \approx \log \left(\sum_ {j} \exp \left(s _ {j} ^ {-}\right)\right) - \log \left(\sum_ {i} \exp \left(s _ {i} ^ {+}\right)\right) < 0 \tag {6} +$$ + +$$ +\underset {f} {\arg \min } \max (0, \max (s _ {j} ^ {-}) - \max (s _ {i} ^ {+})) \approx \underbrace {- \log \left(\sum_ {i} \frac {\exp (s _ {i} ^ {+})}{\sum_ {t} \exp (s _ {t} ^ {+}) + \sum_ {j} \exp (s _ {j} ^ {-})}\right)} _ {\mathcal {L} _ {i n} ^ {s u p}} \tag {7} +$$ + +It's easy to see that, differently from Eq. 4 and $\mathcal{L}_{out}^{sup}$ , this condition is fulfilled when just one positive sample is more similar to the anchor than all negative samples. Similarly, another contrastive condition that should be avoided is: $\sum_{j} s(f(x), f(x_j^-)) - \sum_{i} s(f(x), f(x_i^+)) < -\epsilon$ since one would need only one (or few) negative samples far away from the anchor in the representation space (i.e., orthogonal) to fulfil the condition. + +# 3.1 FAILURE CASE OF INFONCE: THE ISSUE OF BIASES + +Satisfying the $\epsilon$ -condition (1) can generally guarantee good downstream performance, however, it does not take into account the presence of biases (e.g. selection biases). A model could therefore take its decision based on certain visual features, i.e. the bias, that are correlated with the target downstream task but don't actually characterize it. This means that the same bias features would probably have a worse performance if transferred to a different dataset (e.g. different acquisition settings or image quality). Specifically, in contrastive learning, this can lead to settings where we are still able to minimize any InfoNCE-based loss (e.g. SupCon or $\epsilon$ -SupInfoNCE), but with degraded classification performance (Fig. 1b). To tackle this issue, in this work, we propose the FairKL regularization technique, a set of debiasing constraints that prevent the use of the bias features within the proposed metric learning approach. In order to give a more in-depth explanation of the $\epsilon$ -InfoNCE failure case, we employ the notion of bias-aligned and bias-conflicting samples as in Nam et al. (2020). In our context, a bias-aligned sample shares the same bias attribute of the anchor, while a bias-conflicting sample does not. In this work, we assume that the bias attributes are either known $a$ priori or that they can be estimated using a bias-capturing model, such as in Hong & Yang (2021). + +Characterization of bias We denote bias-aligned samples with $x^{*,b}$ and bias-conflicting samples with $x^{*,b'}$ . Given an anchor $x$ , if the bias is "strong" and easy-to-learn, a positive bias-aligned sample $x^{+,b}$ will probably be closer to the anchor $x$ in the representation space than a positive bias-conflicting sample (of course, the same reasoning can be applied for the negative samples). This is why even in the case in which the $\epsilon$ -condition is satisfied and the $\epsilon$ -SupInfoNCE is minimized, we could still be able to distinguish between bias-aligned and bias-conflicting samples. Hence, we say that there is a bias if we can identify an ordering on the learned representations, such as: + +$$ +\underbrace {d \left(f (x) , f \left(x _ {i} ^ {+, b}\right)\right)} _ {d _ {i} ^ {+, b}} < \underbrace {d \left(f (x) , f \left(x _ {k} ^ {+, b ^ {\prime}}\right)\right)} _ {d _ {k} ^ {+, b ^ {\prime}}} \leq \underbrace {d \left(f (x) , f \left(x _ {t} ^ {- , b}\right)\right)} _ {d _ {t} ^ {-, b}} - \epsilon < \underbrace {d \left(f (x) , f \left(x _ {j} ^ {- , b ^ {\prime}}\right)\right)} _ {d _ {j} ^ {-, b ^ {\prime}}} - \epsilon \quad \forall i, k, t, j \tag {8} +$$ + +This represents the worst-case scenario, where the ordering is total (i.e., $\forall i, k, t, j$ ). Of course, there can also be cases in which the bias is not as strong, and the ordering may be partial. + +FairKL regularization for debiasing Ideally, we would enforce the conditions $d_k^{+,b'} - d_i^{+,b} = 0$ $\forall i, k$ and $d_t^{-,b'} - d_j^{-,b} = 0$ $\forall t, j$ , meaning that every positive (resp. negative) bias-conflicting + +sample should have the same distance from the anchor as any other positive (resp. negative) bias-aligned sample. However, in practice, this condition is very strict, as it would enforce uniform distance among all positive (resp. negative) samples. A more relaxed condition would instead force the distributions of distances, $\{d_k^{*,b'}\}$ and $\{d_i^{*,b}\}$ , to be similar. Here, we propose two new debiasing constraints for both positive and negative samples using either the first moment (mean) of the distributions or the first two moments (mean and variance). Using only the average of the distributions, we obtain: + +$$ +\frac {1}{P _ {a}} \sum_ {i} d _ {i} ^ {+, b} - \frac {1}{P _ {c}} \sum_ {k} d _ {k} ^ {+, b ^ {\prime}} = 0 \Longleftrightarrow \frac {1}{P _ {c}} \sum_ {k} \left| s _ {k} ^ {+, b ^ {\prime}} \right| - \frac {1}{P _ {a}} \sum_ {i} \left| s _ {i} ^ {+, b} \right| = 0 \tag {9} +$$ + +where $P_{a}$ and $P_{c}$ are the number of positive bias-aligned and bias-conflicting samples, respectively2. + +Denoting the first moments with $\mu_{+,b} = \frac{1}{P_a}\sum_i d_i^{+,b}$ , $\mu_{+,b'} = \frac{1}{P_c}\sum_k d_k^{+,b'}$ , and the second moments of the distance distributions with $\sigma_{+,b}^2 = \frac{1}{P_a}\sum_i (d_i^{+,b} - \mu_{+,b})^2$ , $\sigma_{+,b'}^2 = \frac{1}{P_c}\sum_k (d_k^{+,b'} - \mu_{+,b-})^2$ , and making the hypothesis that the distance distributions follow a normal distribution, we can define a new set of debiasing constraints using, for example, the Kullback-Leibler divergence: + +$$ +D _ {K L} \left(\left\{d _ {i} ^ {+, b} \right\} \mid \mid \left\{d _ {k} ^ {+, b ^ {\prime}} \right\}\right) = \frac {1}{2} \left[ \frac {\sigma_ {+, b} ^ {2} + \left(\mu_ {+, b} - \mu_ {+, b ^ {\prime}}\right) ^ {2}}{\sigma_ {+, b ^ {\prime}} ^ {2}} - \log \frac {\sigma_ {+, b} ^ {2}}{\sigma_ {+, b ^ {\prime}} ^ {2}} - 1 \right] = 0 \tag {10} +$$ + +In practice, one could also use another distribution such as the log-normal, the Jeffreys divergence $(D_{KL}(p||q) + D_{KL}(q||p))$ , or a simplified version, such as the difference of the two statistics (e.g., $(\mu_{+,b} - \mu_{+,b'})^2 + (\sigma_{+,b} - \sigma_{+,b'})^2)$ . The proposed debiasing constrains can be easily added to any contrastive loss using the method of the Lagrange multipliers, as a regularization term $\mathcal{R}^{FairKL} = D_{KL}(\{d_i^{+,b}\} ||\{d_k^{+,b'}\})$ . Thus, the final loss function that we propose to minimize is: + +$$ +\mathcal {L} = \underbrace {- \alpha \sum_ {i} \log \left(\frac {\exp \left(s _ {i} ^ {+}\right)}{\exp \left(s _ {i} ^ {+} - \epsilon\right) + \sum_ {j} \exp \left(s _ {j} ^ {-}\right)}\right)} _ {\epsilon - S u p I n f o N C E} + \lambda \mathcal {R} ^ {F a i r K L} \tag {11} +$$ + +where $\alpha$ and $\lambda$ are positive hyperparameters. + +# 3.1.1 COMPARISON WITH OTHER DEBIASING METHODS + +SupCon It is interesting to notice that the non-contrastive conditions in Eq. 5: $s_t^+ - s_i^+ \leq 0 \quad \forall i, t \neq i$ are actually all fulfilled only when $s_i^+ = s_t^+ \quad \forall i, t \neq i$ . This means that one tries to align all positive samples, regardless of their bias $b$ , to a single point in the representation space. In other terms, at the optimal solution, one would also fulfill the following conditions: + +$$ +s _ {i} ^ {+, b} = s _ {t} ^ {+, b}, s _ {i} ^ {+, b ^ {\prime}} = s _ {t} ^ {+, b ^ {\prime}}, s _ {i} ^ {+, b} = s _ {t} ^ {+, b ^ {\prime}}, s _ {i} ^ {+, b ^ {\prime}} = s _ {t} ^ {+, b} \quad \forall i, t \neq i \tag {12} +$$ + +Realistically, this could lead to suboptimal solutions: we argue that the optimization process would mainly focus on the easier task, namely aligning bias-aligned samples, and neglecting the bias-conflicting ones. In highly biased settings, this could lead to worse performance than $\epsilon$ -SupInfoNCE. More empirical results supporting this hypothesis are presented in Appendix C.2. + +End The constraint in Eq. 9 is very similar to what was recently proposed in Tartaglione et al. (2021) with EnD. However, EnD lacks the additional constraint on the standard deviation of the distances, which is given by Eq. 10. An intuitive difference can be found in Fig. 3 and 4 of the Appendix. The constraints imposed by EnD (only first moments) can be fulfilled even if there is an effect of the bias features on the ordering of the positive samples. The use of constraints on the second moments, as in the proposed method, can remove the effect of the bias. An analytical comparison can be found in Appendix A.3. + +BiasCon In Hong & Yang (2021), authors propose the BiasCon loss, which is similar to SupCon but only aligns positive bias-conflicting samples. It looks for an encoder $f$ that fulfills: + +$$ +s _ {j} ^ {-} - s _ {i} ^ {+, b ^ {\prime}} \leq - \epsilon \quad \forall i, j \quad \text {a n d} \quad s _ {p} ^ {+, b} - s _ {i} ^ {+, b ^ {\prime}} \leq 0 \quad \forall i, p \text {a n d} \quad s _ {t} ^ {+, b ^ {\prime}} - s _ {i} ^ {+, b ^ {\prime}} \leq 0 \quad \forall i, t \neq i \tag {13} +$$ + +The problem here is that we try to separate the negative samples from only the positive bias-conflicting samples, ignoring the positive bias-aligned samples. This is probably why the authors proposed to combine this loss with a standard Cross Entropy. + +# 4 EXPERIMENTS + +In this section, we describe the experiments we perform to validate our proposed losses. We perform two sets of experiments. First, we benchmark our framework, presented in Sec. 3, on standard vision datasets such as: CIFAR-10 (Krizhevsky et al., a), CIFAR-100 (Krizhevsky et al., b) and ImageNet-100 (Deng et al., 2009). Then, we analyze biased settings, employing BiasedMNIST (Bahng et al., 2020), Corrupted-CIFAR10 (Hendrycks & Dietterich, 2019), bFFHQ (Lee et al., 2021), 9-Class ImageNet (Ilyas et al., 2019) and ImageNet-A (Hendrycks et al., 2021). The code can be found at https://github.com/EIDOSLAB/unbiased-contrastive-learning. + +# 4.1 EXPERIMENTS ON GENERIC VISION DATASETS + +We conduct an empirical analysis of the $\epsilon$ -SupCon and $\epsilon$ -SupInfoNCE losses on standard vision datasets to evaluate the different formulations and to assess the impact of the $\epsilon$ parameter. We compare our results with baseline implementations including Cross Entropy (CE) and SupCon. + +Experimental details We use the original setup from SupCon (Khosla et al., 2020), employing a ResNet-50, a large batch size (1024), a learning rate of 0.5, a temperature of 0.1, and multiview augmentation, for CIFAR-10 and CIFAR-100. Additional experimental details (including ImageNet $100^3$ ) and the different hyperparameters configurations are provided in Sec. B of the Appendix. + +Results First, we compare our proposed $\epsilon$ -SupInfoNCE loss with the $\epsilon$ -SupCon loss derived in Sec. 3. As reported in Tab. 1, $\epsilon$ -SupInfoNCE performs better than $\epsilon$ -SupCon: we conjecture that the lack of the non-contrastive term of Eq. 5 leads to increased robustness, as it will also be shown in Sec. 4.2. For this reason, we focus on $\epsilon$ -SupInfoNCE. Further comparison with different values of $\epsilon$ can be found in Sec. C.1, showing that $SupCon \leq \epsilon$ -SupCon $\leq \epsilon$ -SupInfoNCE in terms of accuracy. Results + +Table 1: Comparison of $\epsilon$ -SupInfoNCE and $\epsilon$ -SupCon on ImageNet-100. + +
LossAcc@1
ε-SupInfoNCE83.3±0.06
ε-SupCon82.83±0.11
+ +on general computer vision datasets are presented in Tab. 2, in terms of top-1 accuracy. We report the performance for the best value of $\epsilon$ ; the complete results can be found in Sec. C.1. The results are averaged across 3 trials for every configuration, and we also report the standard deviation. We obtain significant improvement with respect to all baselines and, most importantly, SupCon, on all benchmarks: on CIFAR-10 (+0.5%), on CIFAR-100 (+0.63%), and on ImageNet-100 (+1.31%). + +Table 2: Accuracy on vision datasets. SimCLR and Max-Margin results from Khosla et al. (2020). Results denoted with * are (re)implemented with mixed precision due to memory constraints. + +
DatasetNetworkSimCLRMax-MarginSimCLR*CE*SupCon*ε-SupInfoNCE*
CIFAR-10ResNet-5093.692.491.74±0.0594.73±0.1895.64±0.0296.14±0.01
CIFAR-100ResNet-5070.770.568.94±0.1273.43±0.0875.41±0.1976.04±0.01
ImageNet-100ResNet-50--66.14±0.0882.1±0.5981.99±0.0883.3±0.06
+ +# 4.2 EXPERIMENTS ON BIASED DATASETS + +Next, we move on to analyzing how our proposed loss performs on biased learning settings. We employ five datasets, ranging from synthetic data to real facial images: Biased-MNIST, Corrupted-CIFAR10, bFFHQ, and 9-Class ImageNet along with ImageNet-A. The detailed setup and experimental details are provided in the appendix B. + +Biased-MNIST is a biased version of MNIST (Deng, 2012), proposed in Bahng et al. (2020). A color bias is injected into the dataset, by colorizing the image background with ten predefined colors associated with the ten different digits. Given an image, the background is colored with the predefined color for that class with a probability $\rho$ , and with any one of the other colors with a probability $1 - \rho$ . Higher values of $\rho$ will lead to more biased data. In this work, we explore the datasets in + +![](images/b5be4fe47e2ba267a325b0652b6e5aba0eb8c9f91f6c92a419f0fbd825633fe0.jpg) +Figure 2: Comparison of $\epsilon$ -SupCon and $\epsilon$ -SupInfoNCE on Biased-MNIST. It is noticeable that for $\rho \leq 0.997$ , $\epsilon$ -SupInfoNCE and $\epsilon$ -SupCon are comparable, while for $\rho = 0.999$ the gap is significantly larger: this could be due to the additional non-contrastive condition of SupCon. + +![](images/25ff07b0fed1198dce4eb41700f0959a39ecef4f92763d4c340e6353d14e6eb2.jpg) + +![](images/0991d356d8df8f3d8c4c94f59be1b4817477859f9e15ab113efd296d07aca544.jpg) + +![](images/687ef924df7e2e95dc143158efb6f6f5b20a000fb4fd41ff0f0727d7fef6a5a0.jpg) + +different values of $\rho$ : 0.999, 0.997, 0.995 and 0.99. An unbiased test set is built with $\rho = 0.1$ . We compare with cross entropy baseline and with other debiasing techniques, namely EnD (Tartaglione et al., 2021), LNL (Nam et al., 2020) and BiasCon and BiasBal (Hong & Yang, 2021). + +Analysis of $\epsilon$ -SupInfoNCE and $\epsilon$ -SupCon: First, we perform an evaluation of the $\epsilon$ -SupCon and $\epsilon$ -SupInfoNCE losses alone, without our debiasing regularization term. Fig. 2 shows the accuracy on the unbiased test set, with the different values of $\rho$ . Baseline results of a cross-entropy model (CE) are reported in Tab. 3. Both losses result in higher accuracy compared to the cross entropy. The generally higher robustness of contrastive-based formulations is also confirmed by the related literature (Khosla et al., 2020). Interestingly, in the most biased setting ( $\rho = 0.999$ ), we observe that $\epsilon$ -SupInfoNCE obtains higher accuracy than $\epsilon$ -SupCon. Our conjecture is that the non-contrastive term of SupCon in Eq. 5 ( $s_t^+ - s_i^+ \leq 0$ $\forall i, t$ ) can lead, in highly biased settings, to more biased representations as the bias-aligned samples will be especially predominant among the positives. For this reason, we focus on $\epsilon$ -SupInfoNCE in the remaining of this work. + +Debiasing with FairKL: Next, we apply our regularization technique FairKL jointly with $\epsilon$ -SupInfoNCE, and compare it with the other debiasing methods. The results are shown in Tab. 3. Our technique achieves the best results in all experiments, with high gaps in accuracy, especially in the most difficult settings (lower $\rho$ ). For completeness, we also evaluate the debiasing power of FairKL with different losses, i.e. CE and $\epsilon$ -SupCon. With FairKL we obtain better results than most of the other baselines with either CE, $\epsilon$ -SupCon or $\epsilon$ -SupInfoNCE; the latter achieves the best performance, confirming the results observed in Sec 4.1. For this reason, in the rest of the work, we focus on $\epsilon$ -SupInfoNCE. + +Table 3: Top-1 accuracy (%) on Biased-MNIST. Reference results from Hong & Yang (2021). Results denoted with * are re-implemented without color-jittering and bias-conflicting oversampling. + +
Method0.9990.9970.9950.99
CE Hong & Yang (2021)11.8±0.762.5±2.979.5±0.190.8±0.3
LNL Kim et al. (2019)18.2±1.257.2±2.272.5±0.986.0±0.2
ε-SupCon24.36±3.2374.35±0.0984.13±1.3191.12±0.35
ε-SupInfoNCE33.16±3.5773.86±0.8183.65±0.3691.18±0.49
EnD Tartaglione et al. (2021)59.5±2.382.70±0.394.0±0.694.8±0.3
BiasCon+BiasBal* Hong & Yang (2021)30.26±11.0882.83±4.1788.20±2.2795.04±0.86
BiasBal Hong & Yang (2021)76.8±1.691.2±0.293.9±0.196.3±0.2
BiasCon+CE* Hong & Yang (2021)15.06±2.2290.48±5.2695.95±0.1197.67±0.09
CE + FairKL79.9±4.2993.86±1.1394.85±0.5595.92±0.17
ε-SupCon + FairKL89.45±1.8295.75±0.1696.31±0.8196.72±0.2
ε-SupInfoNCE + FairKL90.51±1.5596.19±0.2397.00±0.0697.86±0.02
+ +Corrupted CIFAR-10 is built from the CIFAR-10 dataset, by correlating each class with a certain texture (brightness, frost, etc.) following the protocol proposed in Hendrycks & Dietterich (2019). Similarly to Biased-MNIST, the dataset is provided with five different levels of ratio between bias + +conflicting and bias-aligned samples. The results are shown in Tab. 4. Notably, we obtain the best results in the most difficult scenario, when the amount of bias-conflicting samples is the lowest. Again, for the other settings, we obtain comparable results with the state of the art. + +bFFHQ is proposed by Lee et al. (2021), and contains facial images. They construct the dataset in such a way that most of the females are young (age range 10-29), while most of the males are older (age range 40-59). The ratio between bias-conflicting and bias-aligned provided for this dataset is 0.5. The results are shown in Tab. 4, where our technique outperforms all other methods. + +9-Class ImageNet and ImageNet-A We also test our method on the more complex and realistic 9-Class ImageNet (Ilyas et al., 2019) dataset. This dataset is a subset of ImageNet, which is known to contain textural biases (Geirhos et al., 2019). It aggregates 42 of the original classes into 9 macro categories. Following Hong & Yang (2021), we train a BagNet18 (Brendel & Bethge, 2019) as the bias-capturing model, which we then use to compute a bias score for the training samples, to apply within our regularization term. More details and the experimental setup can be found in the Sec. B.2.4. We evaluate the accuracy on the test set (biased) along with the unbiased accuracy (UNB), computed with the texture labels assigned in Brendel & Bethge (2019). We also report accuracy results on ImageNet-A (IN-A) dataset, which contains bias-conflicting samples (Hendrycks et al., 2021). Results are shown in Tab. 5. On the biased test set, the results are comparable with SoftCon, while on the harder sets unbiased and ImageNet-A we achieve SOTA results. + +Table 4: Top-1 accuracy (%) on Corrupted CIFAR-10 with different corruption ratio (%) and on bFFHQ. Reference results are taken from Lee et al. (2021). + +
MethodCorrupted CIFAR-10 RatiobFFHQ Ratio
0.51.02.05.00.5
Vanilla Lee et al. (2021)23.08±1.2525.82±0.3330.06±0.7139.42±0.6456.87±2.69
EnD Tartaglione et al. (2021)19.38±1.3623.12±1.0734.07±4.8136.57±3.9856.87±1.42
HEX Wang et al. (2019a)13.87±0.0614.81±0.4215.20±0.5416.04±0.6352.83±0.90
ReBias Bahng et al. (2020)22.27±0.4125.72±0.2031.66±0.4343.43±0.4159.46±0.64
LfF Nam et al. (2020)28.57±1.3033.07±0.7739.91±0.3050.27±1.5662.2±1.0
DFA Lee et al. (2021)29.95±0.7136.49±1.7941.78±2.2951.13±1.2863.87±0.31
ε-SupInfoNCE + FairKL33.33±0.3836.53±0.3841.45±0.4250.73±0.9064.8±0.43
+ +Table 5: Top-1 accuracy (%) on 9-Class ImageNet biased and unbiased (UNB) sets, and ImageNet-A (IN-A). Reference results from Hong & Yang (2021). + +
VanillaSINLMRUBiReBiasLffSoftConε-SupInfoNCE + FairKL
Biased94.0±0.188.4±0.979.2±1.193.9±0.294.0±0.291.2±0.195.3±0.295.1±0.1
UNB92.7±0.286.6±1.076.6±1.292.5±0.292.7±0.289.6±0.394.1±0.394.8±0.3
IN-A30.5±0.524.6±2.419.0±1.231.0±0.230.5±0.229.4±0.834.1±0.635.7±0.5
+ +# 5 CONCLUSIONS + +In this work, we propose a metric-learning-based framework for supervised representation learning. We propose a new loss, called $\epsilon$ -SupInfoNCE, that is based on the definition of the $\epsilon$ -margin, which is the minimal margin between positive and negative samples. By adjusting this value, we are able to find a tighter approximation of the mutual information and achieve better results compared to standard Cross-Entropy and to the SupCon loss. Then, we tackle the problem of learning unbiased representations when the training data contains strong biases. This represents a failure case for InfoNCE-like losses. We propose FairKL, a debiasing regularization term derived from our framework. With it, we enforce equality between the distribution of distances of bias-conflicting samples and bias-aligned samples. This, together with the increase of the $\epsilon$ margin, allows us to reach state-of-the-art performances in the most extreme cases of biases in different datasets, comprising both synthetic data and real-world images. + +# REFERENCES + +Mohsan Alvi, Andrew Zisserman, and Christoffer Nellåker. Turning a blind eye: Explicit removal of biases and variation from deep neural network embeddings. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 0-0, 2018. +Hyojin Bahng, Sanghyuk Chun, Sangdoo Yun, Jaegul Choo, and Seong Joon Oh. Learning de-biased representations with biased representations. In International Conference on Machine Learning (ICML), 2020. +Carlo Alberto Barbano, Enzo Tartaglione, and Marco Grangetto. Bridging the gap between debiasing and privacy for deep learning. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) Workshops, pp. 3806-3815, October 2021. +Alex Beutel, Jilin Chen, Tulsee Doshi, Hai Qian, Allison Woodruff, Christine Luu, Pierre Kreitmann, Jonathan Bischof, and Ed H Chi. Putting fairness principles into practice: Challenges, metrics, and improvements. In Proceedings of the 2019 AAAI/ACM Conference on AI, Ethics, and Society, pp. 453-459, 2019. +Wieland Brendel and Matthias Bethge. Approximating cnns with bag-of-local-features models works surprisingly well on imagenet. 7th International Conference on Learning Representations, ICLR 2019, 3 2019. doi: 10.48550/arxiv.1904.00760. URL https://arxiv.org/abs/1904.00760v1. +Remi Cadene, Corentin Dancette, Matthieu Cord, Devi Parikh, et al. Rubi: Reducing unimodal biases for visual question answering. In Advances in neural information processing systems, pp. 841-852, 2019. +Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A Simple Framework for Contrastive Learning of Visual Representations. In International Conference on Machine Learning, pp. 1597-1607. PMLR, November 2020. URL http://proceedings.mlr.press/v119/chen20j.html. ISSN: 2640-3498. +S. Chopra, R. Hadsell, and Y. LeCun. Learning a Similarity Metric Discriminatively, with Application to Face Verification. In CVPR, volume 1, pp. 539-546. IEEE, 2005. ISBN 978-0-7695-2372-9. doi: 10.1109/CVPR.2005.202. URL http://ieeexplore.ieee.org/document/1467314/. +Christopher Clark, Mark Yatskar, and Luke Zettlemoyer. Don't take the easy way out: Ensemble based methods for avoiding known dataset biases. In Kentaro Inui, Jing Jiang, Vincent Ng, and Xiaojun Wan (eds.), Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing, EMNLP-IJCNLP 2019, Hong Kong, China, November 3-7, 2019, pp. 4067-4080. Association for Computational Linguistics, 2019. doi: 10.18653/v1/D19-1418. URL https://doi.org/10.18653/v1/D19-1418. +Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248-255. IEEE, 2009. +Li Deng. The mnist database of handwritten digit images for machine learning research. IEEE Signal Processing Magazine, 29(6):141-142, 2012. +Gamaleldin F. Elsayed, Dilip Krishnan, Hossein Mobahi, Kevin Regan, and Samy Bengio. Large margin deep networks for classification. Advances in Neural Information Processing Systems, 2018-December:842-852, 3 2018. ISSN 10495258. doi: 10.48550/arxiv.1803.05598. URL https://arxiv.org/abs/1803.05598v2. +Robert Geirhos, Patricia Rubisch, Claudio Michaelis, Matthias Bethge, Felix A. Wichmann, and Wieland Brendel. Imagenet-trained CNNs are biased towards texture; increasing shape bias improves accuracy and robustness. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=Bygh9j09KX. + +Florian Graf, Christoph D Hofer, Marc Niethammer, and Roland Kwitt. Dissecting supervised constrastive learning. 2021. +Abhinav Gupta, Adithyavairavan Murali, Dhiraj Prakashchand Gandhi, and Lerrel Pinto. Robot learning in homes: Improving generalization and reducing dataset bias. In Advances in Neural Information Processing Systems, pp. 9094-9104, 2018. +R. Hadsell, S. Chopra, and Y. LeCun. Dimensionality Reduction by Learning an Invariant Mapping. In CVPR, volume 2, pp. 1735-1742. IEEE, 2006. +Robert M. Haralick, K. Shanmugam, and Its'Hak Dinstein. Textural features for image classification. IEEE Transactions on Systems, Man, and Cybernetics, SMC-3(6):610-621, 1973. doi: 10.1109/ TSMC.1973.4309314. +Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition, 2016-December:770-778, 12 2015. ISSN 10636919. doi: 10.48550/axiv.1512.03385. URL https://arxiv.org/abs/1512.03385v1. +Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. 7th International Conference on Learning Representations, ICLR 2019, 3 2019. doi: 10.48550/arxiv.1903.12261. URL https://arxiv.org/abs/1903.12261v1. +Dan Hendrycks, Kevin Zhao, Steven Basart, Jacob Steinhardt, and Dawn Song. Natural adversarial examples. CVPR, 2021. +Alexander Hermans, Lucas Beyer, and Bastian Leibe. In defense of the triplet loss for person re-identification. arXiv preprint arXiv:1703.07737, 2017. +Youngkyu Hong and Eunho Yang. Unbiased classification through bias-contrastive and bias-balanced learning. In Thirty-Fifth Conference on Neural Information Processing Systems, 2021. URL https://openreview.net/forum?id=20qZZAqxnn. +Andrew Ilyas, Shibani Santurkar, Dimitris Tsipras, Logan Engstrom, Brandon Tran, and Aleksander Madry. Adversarial examples are not bugs, they are features. Advances in Neural Information Processing Systems, 32, 5 2019. ISSN 10495258. doi: 10.48550/arxiv.1905.02175. URL https://arxiv.org/abs/1905.02175v4. +Prannay Khosla, Piotr Teterwak, Chen Wang, Aaron Sarna, Yonglong Tian, Phillip Isola, Aaron Maschinot, Ce Liu, and Dilip Krishnan. Supervised contrastive learning. volume 33, pp. 18661-18673. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper/2020/file/d89a66c7c80a29b1bdbab0f2a1a94af8-Paper.pdf. +Byungju Kim, Hyunwoo Kim, Kyungsu Kim, Sungjin Kim, and Junmo Kim. Learning not to learn: Training deep neural networks with biased data. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2019. +Alex Krizhevsky, Vinod Nair, and Geoffrey Hinton. Cifar-10 (canadian institute for advanced research). a. URL http://www.cs.toronto.edu/~kriz/cifar.html. +Alex Krizhevsky, Vinod Nair, and Geoffrey Hinton. Cifar-100 (canadian institute for advanced research). b. URL http://www.cs.toronto.edu/~kriz/cifar.html. +S.W.-C. Lam. Texture feature extraction using gray level gradient based co-occurrence matrices. In 1996 IEEE International Conference on Systems, Man and Cybernetics. Information Intelligence and Systems (Cat. No.96CH35929), volume 1, pp. 267-271 vol.1, 1996. doi: 10.1109/ICSMC.1996.569778. +Jungsoo Lee, Eungyeup Kim, Juyoung Lee, Jihyeon Lee, and Jaegul Choo. Learning debiased representation via disentangled feature augmentation. In Thirty-Fifth Conference on Neural Information Processing Systems, 2021. URL https://openreview.net/forum?id= -oUhJJILWHb. + +Yingwei Li, Qihang Yu, Mingxing Tan, Jieru Mei, Peng Tang, Wei Shen, Alan Yuille, and cihang xie. Shape-texture debiased neural network training. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=Db4yerZTYkz. +Junhyun Nam, Hyuntak Cha, Sungsoo Ahn, Jaeho Lee, and Jinwoo Shin. Learning from failure: Training debiased classifier from biased classifier. In Advances in Neural Information Processing Systems, 2020. +Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation Learning with Contrastive Predictive Coding. arXiv:1807.03748 [cs, stat], January 2019. URL http://arxiv.org/abs/1807.03748.arXiv:1807.03748. +Ben Poole, Sherjil Ozair, Aaron van den Oord, Alexander A. Alemi, and George Tucker. On Variational Bounds of Mutual Information. In ICML, 2019. +Shiori Sagawa, Pang Wei Koh, Tatsunori B Hashimoto, and Percy Liang. Distributionally robust neural networks. In International Conference on Learning Representations, 2019. +Prasanna Sattigeri, Samuel C Hoffman, Vijil Chenthamarakshan, and Kush R Varshney. Fairness gan. arXiv preprint arXiv:1805.09910, 2018. +Florian Schroff, Dmitry Kalenichenko, and James Philbin. FaceNet: A Unified Embedding for Face Recognition and Clustering. 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 815-823, June 2015. doi: 10.1109/CVPR.2015.7298682. URL http://arxiv.org/abs/1503.03832. arXiv: 1503.03832. +Kihyuk Sohn. Improved Deep Metric Learning with Multi-class N-pair Loss Objective. In Advances in Neural Information Processing Systems, volume 29. Curran Associates, Inc., 2016. URL https://papers.nips.cc/paper/2016/bitstream/6b180037abbebea991d8b1232f8a8ca9-Abstract.html. +Congzheng Song, Thomas Ristenpart, and Vitaly Shmatikov. Machine learning models that remember too much. In Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, pp. 587-601. ACM, 2017. +Enzo Tartaglione, Carlo Alberto Barbano, and Marco Grangetto. End: Entangling and disentangling deep representations for bias correction. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 13508-13517, June 2021. +Tatiana Tommasi, Novi Patricia, Barbara Caputo, and Tinne Tuytelaars. A deeper look at dataset bias. In Domain adaptation in computer vision applications, pp. 37-55. Springer, 2017. +Antonio Torralba, Alexei A Efros, et al. Unbiased look at dataset bias. In CVPR, pp. 7. CiteSeer, 2011. +Haohan Wang, Zexue He, Zachary L. Lipton, and Eric P. Xing. Learning robust representations by projecting superficial statistics out. In International Conference on Learning Representations, 2019a. URL https://openreview.net/forum?id=rJEjjoR9K7. +Jiang Wang, Yang song, Thomas Leung, Chuck Rosenberg, Jinbin Wang, James Philbin, Bo Chen, and Ying Wu. Learning Fine-grained Image Similarity with Deep Ranking. In CVPR, 2014. +Tianlu Wang, Jieyu Zhao, Mark Yatskar, Kai-Wei Chang, and Vicente Ordonez. Balanced datasets are not enough: Estimating and mitigating gender bias in deep image representations. In International Conference on Computer Vision (ICCV), October 2019b. +Xinshao Wang, Yang Hua, Elyor Kodirov, and Neil M. Robertson. Ranked List Loss for Deep Metric Learning. In CVPR, 2019c. +Zeyu Wang, Clint Qinami, Ioannis Karakozis, Kyle Genova, Prem Nair, Kenji Hata, and Olga Russakovsky. Towards fairness in visual recognition: Effective strategies for bias mitigation. In IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2020. + +Kilian Q Weinberger, John Blitzer, and Lawrence Saul. Distance Metric Learning for Large Margin Nearest Neighbor Classification. In Advances in Neural Information Processing Systems, volume 18. MIT Press, 2006. URL https://proceedings.neurips.cc/paper/2005/ hash/a7f592cef8b130a6967a90617db5681b-Abstract.html. +Qizhe Xie, Zihang Dai, Yulun Du, E. Hovy, and Graham Neubig. Controllable invariance through adversarial feature learning. In NIPS, 2017. +Depeng Xu, Shuhan Yuan, Lu Zhang, and Xintao Wu. Fairgan: Fairness-aware generative adversarial networks. In 2018 IEEE International Conference on Big Data (Big Data), pp. 570-575. IEEE, 2018. +Baosheng Yu and Dacheng Tao. Deep Metric Learning With Tuplet Margin Loss. In IEEE ICCV, pp. 6489-6498, 2019. + +# A THEORETICAL RESULTS + +# A.1 COMPLETE DERIVATIONS FOR SECTION 3 + +In this section, we present the complete analytical derivation for the equations found in Sec. 3. All of the presented derivations are based on the smooth max approximation with the LogSumExp (LSE) operator: + +$$ +\max \left(x _ {1}, x _ {2}, \dots , x _ {3}\right) \approx \log \left(\sum_ {i} \exp \left(x _ {i}\right)\right) \tag {14} +$$ + +# A.1.1 COMPUTATIONS OF $\epsilon$ -INFONCE (2) + +We consider Eq. 2 and we obtain: + +$$ +\underset {f} {\arg \min } \max (- \epsilon , \left\{s _ {j} ^ {-} - s ^ {+} \right\} _ {j = 1, \dots , N}) \approx \underset {f} {\arg \min } \underbrace {\left[ - \log \left(\frac {\exp \left(s ^ {+}\right)}{\exp \left(s ^ {+} - \epsilon\right) + \sum_ {j} \exp \left(s _ {j} ^ {-}\right)}\right) \right]} _ {\epsilon - I n f o N C E} \tag {15} +$$ + +Starting from the left-hand side, we have: + +$$ +\begin{array}{l} \max (- \epsilon , \{s _ {j} ^ {-} - s ^ {+} \} _ {j = 1, \dots , N}) \approx \log \left(\exp (- \epsilon) + \sum_ {j} \exp (s _ {j} ^ {-} - s ^ {+})\right) \\ = \log \left(\exp (- \epsilon) + \exp (- s ^ {+}) \sum_ {j} \exp (s _ {j} ^ {-})\right) \\ = \log \left(\exp (- s ^ {+}) \left(\exp (s ^ {+} - \epsilon) + \sum_ {j} \exp \left(s _ {j} ^ {-}\right)\right)\right) \tag {16} \\ = \log \exp (- s ^ {+}) + \log \left(\exp (s ^ {+} - \epsilon) + \sum_ {j} \exp (s _ {j} ^ {-})\right) \\ = \underbrace {- \log \left(\frac {\exp (s ^ {+})}{\exp (s ^ {+} - \epsilon) + \sum_ {j} \exp (s _ {j} ^ {-})}\right)} _ {\epsilon - I n f o N C E} \\ \end{array} +$$ + +# A.1.2 MULTIPLE POSITIVE EXTENSION + +Extending Eq. 2 to multiple positives can be done in different ways. Here, we list four possible choices. Empirically, we found that solution c) gave the best results and is the most convenient to implement for efficiency reasons. + +$a)\max (-\epsilon ,\{s_j^- - s_i^+\} _{\substack{i = 1,\ldots ,P\\ j = 1,\ldots ,N}}) = -\log \left(\frac{\exp(\sum_is_i^+)}{\exp(\sum_is_i^+ - \epsilon) + (\sum_j\exp(s_j^-))(\sum_i\exp(\sum_{t\neq i}s_t^+))}\right)$ +$b)\sum_{j}\max (-\epsilon ,\{s_{j}^{-} - s_{i}^{+}\}_{i = 1,\dots ,P}) = -\sum_{j}\log \left(\frac{\exp(\sum_{i}s_{i}^{+})}{\exp(\sum_{i}s_{i}^{+} - \epsilon) + \exp(s_{j}^{-})(\sum_{i}\exp(\sum_{t\neq i}s_{t}^{+}))}\right)$ +$c)\sum_{i}\max (-\epsilon ,\{s_{j}^{-} - s_{i}^{+}\}_{j = 1,\dots ,N}) = -\sum_{i}\log \left(\frac{\exp(s^{+})}{\exp(s^{+} - \epsilon) + \sum_{j}\exp(s_{j}^{-})}\right)$ +$d)\sum_{i}\sum_{j}\max (-\epsilon ,s_{j}^{-} - s_{i}^{+}) = -\sum_{i}\sum_{j}\log \left(\frac{\exp(s^{+})}{\exp(s^{+} - \epsilon) + \exp(s_{j}^{-})}\right)$ (17) + +# A.1.3 COMPUTATIONS OF $\epsilon$ -SUPINFONCE (4) + +The computations are very similar to Eq. 16. We obtain: + +$$ +\underset {f} {\arg \min } \sum_ {i} \max (- \epsilon , \left\{s _ {j} ^ {-} - s _ {i} ^ {+} \right\} _ {j = 1, \dots , N}) \approx \underset {f} {\arg \min } \left[ \sum_ {i} \log \left(\exp (- \epsilon) + \sum_ {j} \exp \left(s _ {j} ^ {-} - s _ {i} ^ {+}\right)\right) \right] \tag {18} +$$ + +Starting from the left-hand side, we have: + +$$ +\begin{array}{l} \sum_ {i} \max (- \epsilon , \left\{s _ {j} ^ {-} - s _ {i} ^ {+} \right\} _ {j = 1, \dots , N}) \approx \sum_ {i} \log \left(\exp (- \epsilon) + \sum_ {j} \exp \left(s _ {j} ^ {-} - s _ {i} ^ {+}\right)\right) \\ = \sum_ {i} \log \left(\exp (- \epsilon) + \frac {\sum_ {j} \exp \left(s _ {j} ^ {-}\right)}{\exp \left(s _ {i} ^ {+}\right)}\right) \\ = \sum_ {i} \log \left(\frac {\exp \left(s _ {i} ^ {+} - \epsilon\right) \sum_ {j} \exp \left(s _ {j} ^ {-}\right)}{\exp \left(s _ {i} ^ {+}\right)}\right) \tag {19} \\ = \underbrace {- \sum_ {i} \log \left(\frac {\exp (s _ {i} ^ {+})}{\exp (s _ {i} ^ {+} - \epsilon) \sum_ {j} \exp (s _ {j} ^ {-})}\right)} _ {\epsilon - S u p I n f o N C E} \\ \end{array} +$$ + +# A.1.4 COMPUTATIONS OF $\epsilon$ -SUPCON (5) + +We extend Eq. 4 by adding the non contrastive conditions: + +$$ +s _ {j} ^ {-} - s _ {i} ^ {+} \leq - \epsilon \quad \forall i, j \quad \text {a n d} \quad s _ {t} ^ {+} - s _ {i} ^ {+} \leq 0 \quad \forall i, t \neq i \tag {20} +$$ + +and we show + +$$ +\frac {1}{P} \sum_ {i} \max \left(0, \left\{s _ {j} ^ {-} - s _ {i} ^ {+} + \epsilon \right\} _ {j}, \left\{s _ {t} ^ {+} - s _ {i} ^ {+} \right\} _ {t \neq i}\right) \approx \epsilon \underbrace {- \frac {1}{P} \sum_ {i} \log \left(\frac {\exp \left(s _ {i} ^ {+}\right)}{\sum_ {t} \exp \left(s _ {i} ^ {+} - \epsilon\right) + \sum_ {j} \exp \left(s _ {j} ^ {-}\right)}\right)} _ {\epsilon - S u p C o n} \tag {21} +$$ + +Starting from the left-hand side, we have: + +$$ +\begin{array}{l} \frac {1}{P} \sum_ {i} \max (0, \{s _ {j} ^ {-} - s _ {i} ^ {+} + \epsilon \} _ {j = 1, \dots , N}, \{s _ {t} ^ {+} - s _ {i} ^ {+} \} _ {t \neq i}) \approx \frac {1}{P} \sum_ {i} \log \left(1 + \sum_ {j} \exp (s _ {j} ^ {-} - s _ {i} ^ {+} + \epsilon) + \sum_ {t \neq i} \exp (s _ {t} ^ {+} - s _ {i} ^ {+})\right) \\ = = \frac {1}{P} \sum_ {i} \log \left(1 + \frac {\sum_ {j} \exp (s _ {j} ^ {-})}{\exp (s _ {i} ^ {+} - \epsilon)} + \frac {\sum_ {t \neq i} \exp (s _ {t} ^ {+})}{\exp (s _ {i} ^ {+})}\right) \\ = \frac {1}{P} \sum_ {i} \log \left(\frac {\exp (s _ {i} ^ {+} - \epsilon) + \sum_ {j} \exp (s _ {j} ^ {-}) + \sum_ {t \neq i} \exp (s _ {t} ^ {+} - \epsilon)}{\exp (s _ {i} ^ {+} - \epsilon)}\right) \\ = - \frac {1}{P} \sum_ {i} \log \left(\frac {\exp \left(s _ {i} ^ {+} - \epsilon\right)}{\sum_ {t} \exp \left(s _ {t} ^ {+} - \epsilon\right) + \sum_ {j} \exp \left(s _ {j} ^ {-}\right)}\right) \\ = \epsilon \underbrace {- \frac {1}{P} \sum_ {i} \log \left(\frac {\exp \left(s _ {i} ^ {+}\right)}{\sum_ {t} \exp \left(s _ {t} ^ {+} - \epsilon\right) + \sum_ {j} \exp \left(s _ {j} ^ {-}\right)}\right)} _ {\epsilon - S u p C o n} \tag {22} \\ \end{array} +$$ + +# A.1.5 COMPUTATIONS OF $\mathcal{L}_{in}^{sup}$ (7) + +Here we show that: + +$$ +\max \left(s _ {j} ^ {-}\right) < \max \left(s _ {i} ^ {+}\right) \approx \underbrace {- \log \left(\sum_ {i} \frac {\exp \left(s _ {i} ^ {+}\right)}{\sum_ {t} \exp \left(s _ {t} ^ {+}\right) + \sum_ {j} \exp \left(s _ {j} ^ {-}\right)}\right)} _ {\mathcal {L} _ {i n} ^ {s u p}} \tag {23} +$$ + +Starting from the left-hand side, and given that: + +$$ +\max \left(s _ {j} ^ {-}\right) < \max \left(s _ {i} ^ {+}\right) \approx \log \left(\sum_ {j} \exp \left(s _ {j} ^ {-}\right)\right) - \log \left(\sum_ {i} \exp \left(s _ {i} ^ {+}\right)\right) < 0 +$$ + +we have: + +$$ +\begin{array}{l} \max \left(0, \log (\sum_ {j} \exp (s _ {j} ^ {-})) - \log (\sum_ {i} \exp (s _ {i} ^ {+}))\right) \approx \log \left(1 + \exp \left(\log (\sum_ {j} \exp (s _ {j} ^ {-})) - \log (\sum_ {i} \exp (s _ {i} ^ {+}))\right)\right) \\ = \log \left(1 + \exp \left(\log \left(\frac {\sum_ {j} \exp (s _ {j} ^ {-})}{\sum_ {i} \exp (s _ {i} ^ {+})}\right)\right)\right) \\ = \log \left(1 + \frac {\sum_ {j} \exp \left(s _ {j} ^ {-}\right)}{\sum_ {i} \exp \left(s _ {i} ^ {+}\right)}\right) \\ = \log \left(\frac {\sum_ {i} \exp (s _ {i} ^ {+}) + \sum_ {j} \exp (s _ {j} ^ {-}))}{\sum_ {i} \exp (s _ {i} ^ {+})}\right) \\ = \underbrace {- \log \left(\sum_ {i} \frac {\exp \left(s _ {i} ^ {+}\right)}{\sum_ {t} \exp \left(s _ {t} ^ {+}\right) + \sum_ {j} \exp \left(s _ {j} ^ {-}\right)}\right)} _ {\mathcal {L} _ {i n} ^ {s u p}} \tag {24} \\ \end{array} +$$ + +# A.1.6 COMPUTATIONS OF EQ.17-A + +$$ +\underset {f} {\arg \min } \max (- \epsilon , \left\{s _ {j} ^ {-} - s _ {i} ^ {+} \right\} _ {\substack {i = 1, \dots , P \\ j = 1, \dots , N}}) \approx \underset {f} {\arg \min } \log \left(\exp (- \epsilon) + \sum_ {i} \sum_ {j} \exp \left(s _ {j} ^ {-} - s _ {i} ^ {+}\right)\right) \tag{25} +$$ + +We have: + +$$ +\begin{array}{l} \mathcal {L} = \log \left(\exp (- \epsilon) + \sum_ {i} ^ {P} \left(\frac {\sum_ {j} \exp (s _ {j} ^ {-})}{\exp (s _ {i} ^ {+}))}\right)\right) = \log \left(\sum_ {i} ^ {P} \left(\frac {\exp (- \epsilon)}{P} + \frac {\sum_ {j} \exp (s _ {j} ^ {-})}{\exp (s _ {i} ^ {+}))}\right)\right) \\ = \log \left(\sum_ {i} ^ {P} \left(\frac {\exp (s _ {i} ^ {+} - \epsilon) + P (\sum_ {j} \exp (s _ {j} ^ {-}))}{P (\exp (s _ {i} ^ {+})))}\right)\right) = \log \left(\sum_ {i} \left(\frac {\frac {1}{P} \exp (s _ {i} ^ {+} - \epsilon)) + \sum_ {j} \exp (s _ {j} ^ {-})}{\exp (s _ {i} ^ {+})}\right)\right) \\ = \log \left(\frac {\sum_ {i} \left[ \frac {1}{P} \exp \left(s _ {i} ^ {+} - \epsilon\right) \left(\prod_ {t \neq i} \exp \left(s _ {t} ^ {+}\right)\right) + \left(\sum_ {j} \exp \left(s _ {j} ^ {-}\right)\right) \left(\prod_ {t \neq i} \exp \left(s _ {t} ^ {+}\right)\right) \right]}{\prod_ {i} \exp \left(s _ {i} ^ {+}\right)}\right) \\ = \log \left(\frac {\exp (- \epsilon) \prod_ {i} \exp \left(s _ {i} ^ {+}\right) + \left(\sum_ {j} \exp \left(s _ {j} ^ {-}\right)\right) \left(\sum_ {i} \prod_ {t \neq i} \exp \left(s _ {t} ^ {+}\right)\right)}{\prod_ {i} \exp \left(s _ {i} ^ {+}\right)}\right) \\ = - \log \left(\frac {\exp \left(\sum_ {i} s _ {i} ^ {+}\right)}{\exp \left(\sum_ {i} s _ {i} ^ {+} - \epsilon\right) + \left(\sum_ {j} \exp \left(s _ {j} ^ {-}\right)\right) \left(\sum_ {i} \exp \left(\sum_ {t \neq i} s _ {t} ^ {+}\right)\right)}\right) \tag {26} \\ \end{array} +$$ + +# A.2 BOUNDNESS OF THE $\epsilon$ -MARGIN + +In this section, we give insights on how an optimal value of $\epsilon$ can be estimated. First of all, it is easy to show that $\epsilon$ is bounded and cannot grow to infinity. Given that $||f(x)||_2 = 1$ , then we + +![](images/07278877107694d1a98b9c37079f1bdf901132f74d1202f220e1fbb797f67e8c.jpg) +(a) + +![](images/bf7bf1d39aeec98017226ddc69b4054349df9b6ab153f38a01e1139e7b344b9a.jpg) +(b) +Figure 3: When considering only Eq. 9 a-left (average of distances) or Eq. 9a-right (average of similarities), that is when using EnD Tartaglione et al. (2021), we may obtain a suboptimal configuration such as (a), where we can still (partially) order the distances of positive samples from the anchor based on the bias features. We can see that the conditions in Eq. 9 are fulfilled, namely the average of the distances of bias-aligned and bias-conflicting samples from the anchor are the same $(\mu_{+,b} = \mu_{+,b'} = 2)$ . This is only partially mitigated when using a margin $\epsilon > 0$ (b). However, the standard deviations of the distances of bias-aligned and bias-conflicting samples in (a) and (b) are different $(\sigma_{+,b} = 0$ , while $\sigma_{+,b'} = 1)$ . This can be computed using the distances $d$ reported in the figure. If we also consider the conditions on the standard deviations of the distances, as proposed in FairKL (Eq. 10), the ordering is removed and thus also the effect of the bias (c). In (c), we show the case in which both mean and standard deviation of the distributions match (in a simplified case with $\sigma = 0$ ). A simulated example is shown in Fig. 4. + +![](images/70ad03ae6b5c0b1ea3fb2cd57df9e038fe15841bd5b971dd783aeb4dee05fd71.jpg) +(c) + +$\max(d^{+} - d^{-}) = 2$ . This is the case in which the two samples are aligned at opposite poles of the hypersphere. We can conclude that, in general, $\epsilon$ will be less than 2. If we also take into account the temperature $\tau$ , when $\epsilon \leq 2 / \tau$ . This is always true, however, a stricter upper bound can be found if we consider the geometric properties of the latent space. For example, Graf et al. (2021) show that when the SupCon loss converges to its minimum value, then the representations of the different classes are aligned on a regular simplex. This property could be used to compute a precise upper bound of the $\epsilon$ margin, depending on the number of classes in the dataset. We leave further analysis on this matter as future work. + +# A.3 THEORETICAL COMPARISON WITH END + +Here, we present a more detailed theoretical analysis of EnD (Tartaglione et al., 2021), and we show that the EnD regularization term can be equivalent to the condition in Eq. 9: + +$$ +a) \frac {1}{P _ {c}} \sum_ {k} \left| s _ {k} ^ {+, b ^ {\prime}} \right| - \frac {1}{P _ {a}} \sum_ {i} \left| s _ {i} ^ {+, b} \right| = 0 \quad b) \frac {1}{N _ {c}} \sum_ {t} \left| s _ {t} ^ {-, b ^ {\prime}} \right| - \frac {1}{N _ {a}} \sum_ {j} \left| s _ {j} ^ {-, b} \right| = 0 \tag {27} +$$ + +which can be turned into a minimization term $\mathcal{R}$ , using the method of Lagrange multipliers: + +$$ +\mathcal {R} = - \lambda_ {1} \left(\frac {1}{P _ {c}} \sum_ {k} \left| s _ {k} ^ {+, b ^ {\prime}} \right| - \frac {1}{P _ {a}} \sum_ {i} \left| s _ {i} ^ {+, b} \right|\right) - \lambda_ {2} \left(\frac {1}{N _ {c}} \sum_ {t} \left| s _ {t} ^ {-, b ^ {\prime}} \right| - \frac {1}{N _ {a}} \sum_ {j} \left| s _ {j} ^ {-, b} \right|\right) \tag {28} +$$ + +Now, if we assume $\lambda_1 = \lambda_2 = 1$ , we can re-arrange the terms, obtaining: + +$$ +\mathcal {R} = \underbrace {\left(\frac {1}{P _ {a}} \sum_ {i} \left| s _ {i} ^ {+, b} \right| + \frac {1}{N _ {a}} \sum_ {j} \left| s _ {j} ^ {- , b} \right|\right)} _ {\mathcal {R} ^ {\perp}} - \underbrace {\left(\frac {1}{P _ {c}} \sum_ {k} \left| s _ {k} ^ {+, b ^ {\prime}} \right| + \frac {1}{N _ {c}} \sum_ {t} \left| s _ {t} ^ {- , b ^ {\prime}} \right|\right)} _ {\mathcal {R} ^ {\parallel}} \tag {29} +$$ + +![](images/79d9a3c3622193d0f17cd084fe01e58c1b7f3c55deacbc3326b559e64cd683f8.jpg) + +![](images/333fd673e1a92195d69d4b9069bf50babc4a0c847e61245d432955c72a03c3b9.jpg) +Figure 4: Toy example with simulated data to better explain the suboptimal solution of Fig. 3. We make the hypothesis that the distributions of the distances do follow a Gaussian distribution. In blue and in orange are shown the bias-aligned and the bias-conflicting samples respectively. The green sample represents the anchor. On the left, data points are sampled from two normal distributions with the same mean but different std. We can see that the two distributions do not match. This shows that, even if the first order constraints of EnD are fulfilled, there might still be an effect of the bias. On the contrary, on the right, the two distributions have almost the same statistics (both average and std) and the KL divergence is almost 0. In that case, the bias effect is basically removed. + +![](images/c633bfc43b6560ec544dfc6689c3474545138371b05f956af8d07060a645da92.jpg) + +![](images/a42b32202737712358f43ee9f276581c7d0119292a098c7e91e5836aba84cdb6.jpg) + +The two terms we obtain are equivalent to the disentangling term $\mathcal{R}^{\perp}$ and to the entangling term $\mathcal{R}^{\parallel}$ of EnD: $\mathcal{R}^{\perp}$ tries to decorrelate all of the samples which share the same bias attribute, while the $\mathcal{R}^{\parallel}$ tries to maximize the correlation of samples which belong to the same class but have different bias attributes. However, some practical differences between the two formulation remain in how the different terms are weighted: for Eq. 9 we would have: + +$$ +\mathcal {R} = \lambda_ {1} \left(\mu_ {+, b ^ {\prime}} - \mu_ {+, b}\right) + \lambda_ {2} \left(\mu_ {-, b ^ {\prime}} - \mu_ {-, b}\right) \tag {30} +$$ + +while for EnD we would have: + +$$ +\mathcal {R} = \lambda_ {1} \left(\mu_ {+, b} - \mu_ {-, b}\right) + \lambda_ {2} \left(\mu_ {+, b ^ {\prime}} - \mu_ {-, b ^ {\prime}}\right) \tag {31} +$$ + +# B EXPERIMENTAL SETUP + +All of our experiments were run using PyTorch 1.10.0. We used a cluster with 4 NVIDIA V100 GPUs and a cluster of 8 NVIDIA A40 GPUs. For consistency, when training with constrastive losses we use a temperature value $\tau = 0.1$ across all of our experiments. + +# B.1 GENERIC VISION DATASETS + +# B.1.1 CIFAR-10 AND CIFAR-100 + +We use the original setup from SupCon (Khosla et al., 2020), employing a ResNet-50, large batch size (1024), learning rate of 0.5, temperature of 0.1 and multiview augmentation, for CIFAR-10 and CIFAR-100. We use SGD as optimizer with a momentum of 0.9, and train for 1000 epochs. Learning rate is decayed with a cosine policy with warmup from 0.01, with 10 warmup epochs. + +# B.1.2 IMAGENET-100 + +For ImageNet-100 we employ the ResNet50 architectures (He et al., 2015). We use SGD as optimizer with a weight decay of $10^{-4}$ and momentum of 0.9, with an initial learning rate of 0.1. We + +train for 100 epochs with a batch size of 512, and we decay the learning rate by a factor of 0.1 every 30 epochs. + +# B.2 BIASED DATASETS + +When employing our debiasing term, we find that scaling the $\epsilon$ -SupInfoNCE loss by a small factor $\alpha$ ( $\leq 1$ ) and using $\lambda$ closer to 1, is stabler then using values of $\lambda >> 1$ (as done in Tartaglione et al. (2021)) and tends to produce better results. For biased datasets, we do not make use of the projection head used in Khosla et al. (2020); Chen et al. (2020). For this reason, we also avoid the aggressive augmentation usually employed by contrastive methods (more on this in Sec. C.3). Furthermore, as also done by Hong & Yang (2021), we also experimented with a small contribution of the cross entropy loss for training the model end-to-end; however, we did not find any benefit in doing so, compared to training a linear classifier separately. + +# B.2.1 BIASED-MNIST + +We empty the network architecture SimpleConvNet proposed by Bahng et al. (2020), consisting of four convolutional layers with $7 \times 7$ kernels. We use the Adam optimizer with a learning rate of 0.001, a weight decay of $10^{-5}$ and a batch size of 256. We decay the learning rate by a factor of 0.1 at 1/3 and 2/3 of the epochs (26 and 53). We train for 80 epochs. + +Hyperparameters configuration The hyperparameters for Tab. 3 are reported in Tab. 6. + +Table 6: Biased-MNIST hyperparameters of Tab. 3 + +
Corr (ρ)
0.9990.9970.9950.990
ε-SupConα0.030.030.030.03
λ0.750.50.50.5
ε0.2500.50
ε-SupInfoNCEα0.030.030.030.03
λ0.750.750.750.5
ε0.50.50.50.5
+ +# B.2.2 CORRUPTED CIFAR-10 + +For this dataset we employ the ResNet-18 architecture. We use the Adam optimizer, with an initial learning rate of 0.001, a weight decay of 0.0001. The other Adam parameters are the pytorch default ones $(\beta_{1} = 0.9, \beta_{2} = 0.999, \epsilon = 10^{-8})$ . We train for 200 epochs with a batch size of 256. We decay the learning rate using a cosine annealing policy. + +Hyperparameters configuration: Table 7 shows the hyperparameters for the results reported in Tab. 4 of the main paper. + +Table 7: Corrupted CIFAR-10 hyperparameters + +
Ratio (%)
0.51.02.05.0
α0.10.10.10.1
λ1.01.01.01.0
ε0.10.250.50.25
+ +# B.2.3 BFFHQ + +Following Lee et al. (2021), we use the ResNet-18 architecture. We use the Adam optimizer, with an initial learning rate of 0.0001, and train for 100 epochs. For this experiment, we set $\alpha = 0.1$ + +$\epsilon = 0.25$ and $\lambda = 1.5$ . Differently from Lee et al. (2021) we use a batch size of 256 (vs 64) as contrastive losses benefit more from larger batch sizes (Chen et al., 2020; Khosla et al., 2020). Additionally, we also use a weight decay of $10^{-4}$ , rather than 0. These changes do not provide advantages to the debiasing task: we obtain an accuracy of $54.8\%$ without FairKL, which is in line with the $56.87\%$ reported for the vanilla model. + +# B.2.4 9-CLASS IMAGENET AND IMAGENET-A + +Our proposed method can also be applied in cases in which no prior label about the bias attributes is given, with only a slight change in formulation. For example, for ImageNet. Similarly to other works (Nam et al., 2020; Hong & Yang, 2021) we exploit a bias-capturing model for this purpose. + +FairKL with bias-capturing model To use a continuous score, rather than a discrete bias label, we compute the similarity of the bias features $\tilde{b}_i^+ = s(g(x), g(x_i^+))$ , where $g(\cdot)$ is the bias-capturing BagNet18 model. The bias similarity $\tilde{b}_i$ is used to obtain a weighted sample similarity: $\tilde{s}_i^{+,b} = s_i^+ \tilde{b}_i^+$ for bias-aligned samples, and $\hat{s}_i^{+,b'} = s_i^+(1 - \tilde{b}_i^+)$ for bias-conflicting. By doing so, for example, the terms $\mu_{+,b} = \frac{1}{P_a} \sum_i d_i^{+,b}$ and $\mu_{+,b'} = \frac{1}{P_c} \sum_k d_k^{+,b'}$ become $\hat{\mu}_{+,b} = \frac{1}{N} \sum_i d_i^+ \hat{b}_i^+$ and $\hat{\mu}_{+,b'} = \frac{1}{N} \sum_i d_i^+(1 - \hat{b}_i^+)$ , where N is the batch size. + +Setup We pretrain the bias-capturing model BagNet18 (Brendel & Bethge, 2019) for 120 epochs. For the main model ResNet18, we use the Adam optimizer, with learning rate $0.001$ , $\beta_{1} = 0.9$ and $\beta_{2} = 0.999$ , weight decay of 0.0001 and a cosine decay of the learning rate. We use a batch size of 256 and train for 200 epochs. We employ as augmentation: random resized crop, random flip, and, as done in Hong & Yang (2021) random color jitter and random gray scale ( $p = 0.2$ ). We use $\epsilon = 0.5$ and $\lambda = 1$ . Given the higher complexity of this dataset, we employ $\alpha = 0.5$ . + +# C ADDITIONAL EXPERIMENTS + +In this section, we present some additional experiments we conducted, for a more in depth analysis of our proposed framework. + +# C.1 COMPLETE RESULTS FOR COMMON VISION DATASETS + +In Table 8 we report the results on CIFAR-10, CIFAR-100 and ImageNet-100 for different values of $\epsilon$ . In Table 9 the full comparison between $\epsilon$ -SupCon and $\epsilon$ -SupInfoNCE on ImageNet-100 is presented. Our proposed $\epsilon$ -SupInfoNCE outperforms SupCon in all datasets for all the $\epsilon$ values, reaching the best results. Furthermore, on ImageNet-100, we observe that the lowest accuracy obtained by $\epsilon$ -SupInfoNCE (83.02%) is still higher than the best accuracy obtained by $\epsilon$ -SupCon (82.83%) on the same dataset, even though $\epsilon$ -SupCon is always higher than SupCon. In terms of accuracy, the results in Tab. 9 show that SupCon $\leq \epsilon - \text{SupCon} \leq \epsilon - \text{SupInfoNCE}$ . + +Table 8: Complete results for common vision datasets, for different values of $\epsilon$ , in terms of top-1 accuracy (\%). With every value of $\epsilon$ we obtain better results than SupCon (and CE) on the same dataset. + +
DatasetCESupConε-SupInfoNCE
ε = 0.1ε = 0.25ε = 0.5
CIFAR-1094.73±0.1895.64±0.0295.93±0.0296.14±0.0195.95±0.12
CIFAR-10073.43±0.0875.41±0.1975.85±0.0776.04±0.0175.99±0.06
ImageNet-10082.1±0.5981.99±0.0883.25±0.3983.02±0.4183.3±0.06
+ +# C.2 ANALYSIS OF $\epsilon$ -SUPCON FOR DEBIASING + +We perform a more in-depth analysis of the debiasing capabilities of $\epsilon$ -SupInfoNCE and $\epsilon$ -SupCon. In Sec. 4.2 of the main text, we hypothesize that the non-constrastive condition of Eq. 20 + +$$ +s _ {i} ^ {+} - s _ {j} ^ {+} \leq 0 \quad \forall i, t \neq i +$$ + +Table 9: Complete comparison of $\epsilon$ -SupInfoNCE and $\epsilon$ -SupCon on ImageNet-100 in terms of top-1 accuracy (\%). The results of $\epsilon$ -SupInfoNCE are higher than any results of $\epsilon$ -SupCon. + +
Lossε = 0.1ε = 0.25ε = 0.5
ε-SupInfoNCE83.25±0.3983.02±0.4183.3±0.06
ε-SupCon82.83±0.1182.54±0.0982.77±0.14
+ +might actually be the reason for the loss of accuracy in $\epsilon$ -SupCon when compared to $\epsilon$ -InfoNCE, as shown on the analysis on Biased-MNIST in Fig. 2 of the main text. + +In this section, we provide more empirical insights supporting this hypothesis. We plot the similarity of bias-aligned samples $(s^{+,b})$ and bias-conflicting samples $(s^{+,b'})$ during training, to understand how they are affected. Fig. 5 shows the bivariate histogram of the similarities obtained with the two loss functions, at different training epochs and values of $\epsilon$ , on Biased-MNIST, with a training $\rho$ of 0.999. Focusing on the bias-aligned samples (first two columns), we observe that, in both cases, most values are close to 1. However, while this is true for most of the shown histograms, the presence of the non-contrastive condition of Eq. 20 produces a much tighter distribution for $\epsilon$ -SupCon, when compared to $\epsilon$ -SupInfoNCE. In fact, with $\epsilon$ -SupInfoNCE we obtain significantly more bias-aligned samples with a similarity smaller than 1. This is especially evident if we focus on the last training epochs. + +More interestingly, if we focus on the bias-conflicting similarities (last two columns), we can also notice how, on average, the distribution of similarities of bias-conflicting samples for $\epsilon$ -SupCon tends to be more concentrated around the value of 0. This means that bias-conflicting samples have dissimilar representations even if they are both positives and should be mapped to the same point in the representation space. The effect of the bias is thus still quite important and it has not been discarded. On the other hand, with $\epsilon$ -SupInfoNCE, we obtain a much more spread distribution, especially as the number of training epochs increases. This means that a higher number of bias-conflicting samples have a greater similarity (in the representation space), leading to more robust representations. + +Clearly, $\epsilon$ -SupCon focuses more on bias-aligned samples as most of them have a similarity close to 1, whereas most of the bias-conflicting samples have a similarity close to 0. With our proposed loss $\epsilon$ -SupInfoNCE, this behavior is less pronounced, as the lack of the non-contrastive condition leads the model to be less focused on bias-aligned samples. This could explain why $\epsilon$ -SupInfoNCE can perform better than $\epsilon$ -SupCon in highly biased settings. + +# C.3 TRAINING WITH A PROJECTION HEAD + +In Tab. 10 we show the results on Corrupted CIFAR-10 with and without using a projection head. When employing a projection head, the loss term and the regularization are applied on the projected and original space respectively, and the final classification is performed in the original latent space before the projection head. We conjecture that the loss in accuracy is likely due i.) to the absence of the aggressive augmentation typically used for generating multiviews in contrastive setups, which are probably attenuated by the projection head ii.) minimizing $\epsilon$ -SupInfoNCE and the FairKL term on the same latent space rather than two different ones, could be more beneficial for the optimization process. + +Table 10: Accuracy on Corrupted CIFAR-10 with and without projection head + +
Ratio (%)
0.51.02.05.0
With Head30.85±0.1932.75±0.5737.95±0.1445.67±0.66
Without Head33.33±0.3836.53±0.3841.45±0.4250.73±0.90
+ +![](images/853c786f46d1ab67ed7962d47567c709a5f77140ed93a5d1131f33a2e5995fbd.jpg) + +![](images/edc8bb5c8b10050ff580a75ce406be3a1f9f77a6aaade3a34c6e94a95c43fff5.jpg) + +![](images/b5fa9b1230caad7321cc11f48d17f523fe0621e18d81abbdaffa7ca0c3147d5f.jpg) + +![](images/493c5da54b97aa870b0655250fdfdde481ce7a535fe5d2fcfa4e11e3b1a8e638.jpg) + +![](images/1b65f865a1553989eece6db21d3f6b0886c665b42c8c16aba5b405ad9ba0ab3a.jpg) + +![](images/98d13abe26872f5cca871b75abc18f3346cd66a41123d4c871ba7211dd238ee3.jpg) + +![](images/a02aeb60bc0a06b0bc3689f56af4bf7e7b3a539d93083d4141500cefc6e0d978.jpg) +Figure 5: (first and second columns) Distribution of positive bias-aligned similarities $s^{+,b}$ . Here $\epsilon$ -SupCon tends to produce a much tighter distribution, with similarities close to 1; (third and fourth columns) Distribution of positive bias-conflicting similarities $s^{+,b'}$ . Here $\epsilon$ -SupInfoNCE, even if marginally, is able to increase the number of similar bias-conflicting samples. $\epsilon$ -SupCon focuses more on bias-aligned samples, resulting in more biased representations. With $\epsilon$ -SupInfoNCE, this behavior is less pronounced, as the lack of the non-contrastive condition leads to be less focused on bias-aligned samples and more focused on the bias-conflicting ones. We hypothesize that this is the reason $\epsilon$ -SupInfoNCE appears to obtain better results than $\epsilon$ -SupCon in more biased datasets. + +![](images/39bd9ce6381a01fc521910ca5cdbc6a62c46c024fb11e014f5229a700b2dca63.jpg) + +![](images/d3ccb0d0c2150247ae3b940dd9d2bc1785b3e56e8d1ff1561e473c11135602de.jpg) + +# C.4 ABLATION STUDY OF DEBIASING REGULARIZATION + +We perform an ablation study of our debiasing regularization on Corrupted CIFAR-10 and on bFFHQ. We test two variants of the regularization term: + +1. Only with the conditions on the mean of the representations $\mu_{+}$ and $\mu_{-}$ (Eq. equation 9-a and equation 9-b), similarly to (Tartaglione et al., 2021), but with the differences in formulations of Sec. A.3; +2. Full FairKL debiasing term of Eq. 9-c and Eq. 9-d. + +The results are shown in Tab. 11. As it can be easily observed, employing the full regularization constraint consistently results in better accuracy. + +Table 11: Ablation study of $\mathcal{R}^{FairKL}$ on Corrupted CIFAR-10 and bFFHQ + +
Corrupted CIFAR-10 Ratio (%)bFFHQ Ratio (%)
0.51.02.05.00.5
FairKL (mean)32.37±1.7235.65±0.7539.94±0.5050.25±0.1660.55±1.05
FairKL (full)33.33±0.3836.53±0.3841.45±0.4250.73±0.9063.70±0.90
+ +# C.5 IMPORTANCE OF THE REGULARIZATION WEIGHT + +We conduct an analysis on the importance and stability of the weights $\alpha$ and $\lambda$ of Eq. 11. We perform multiple experiments selecting $\alpha \in \{0.01, 0.1, 1.0\}$ . For simplicity, we fix $\epsilon = 0$ , and we report the accuracy scored on the Biased-MNIST test. The results are show in Tab. 12. There seems to be a correlation between the value of $\alpha$ and the strength of the bias: for stronger biases it is better to give more importance to the regularization term rather than the target loss function. Additionally, we also find that $\alpha$ depends on the complexity of the dataset: for example on Corrupted-CIFAR10 and bFFHQ we use $\alpha = 0.1$ , for 9-Class ImageNet we use $\alpha = 0.5$ . + +Table 12: Importance of the weights $\alpha$ and $\lambda$ . + +
Corr.\αλ=0.5λ=1
0.010.11.00.010.11.0
0.99989.55±1.4331.63±2.3038.38±1.2684.98±2.2943.21±10.0831.84±4.31
0.99794.08±0.1082.11±2.4878.91±2.4891.08±0.8284.98±10.2379.03±3.15
0.99592.42±3.7690.60±3.3586.63±2.2688.39±5.0093.97±1.8388.27±1.72
0.9995.00±0.2196.60±0.1793.75±0.2590.72±0.5197.13±0.3894.74±0.40
\ No newline at end of file diff --git a/unbiasedsupervisedcontrastivelearning/images.zip b/unbiasedsupervisedcontrastivelearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..73a86236de48bdc27875e04972194030c76319ac --- /dev/null +++ b/unbiasedsupervisedcontrastivelearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5982a715e5200c45aa1a449e32c4be4ebfadc404c9cf10105d77cf450ec2bc5b +size 1157640 diff --git a/unbiasedsupervisedcontrastivelearning/layout.json b/unbiasedsupervisedcontrastivelearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..63a219f6fe65f8d3038778423638efd50a48b6f8 --- /dev/null +++ b/unbiasedsupervisedcontrastivelearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c058e76083fb13fd93bf2fd14214f84eec60710e1cb3e830f852a3f0419594d +size 754711 diff --git a/understandingddpmlatentcodesthroughoptimaltransport/097558b3-3719-4906-a548-215887fb2663_content_list.json b/understandingddpmlatentcodesthroughoptimaltransport/097558b3-3719-4906-a548-215887fb2663_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..fbe6310ecea1dfa8674d17b924e533e164f74177 --- /dev/null +++ b/understandingddpmlatentcodesthroughoptimaltransport/097558b3-3719-4906-a548-215887fb2663_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fea1faf54baf2ff4d084fdbbb94536ffbe0cc6b2178a7bd733a1d9cb2967cf44 +size 96329 diff --git a/understandingddpmlatentcodesthroughoptimaltransport/097558b3-3719-4906-a548-215887fb2663_model.json b/understandingddpmlatentcodesthroughoptimaltransport/097558b3-3719-4906-a548-215887fb2663_model.json new file mode 100644 index 0000000000000000000000000000000000000000..d3f0608e5d857a914904d44e2916315a07e59204 --- /dev/null +++ b/understandingddpmlatentcodesthroughoptimaltransport/097558b3-3719-4906-a548-215887fb2663_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dd292387e0300ceda21616bcbea4676a7b4f1d0686cfcffd326f0743730736bd +size 116718 diff --git a/understandingddpmlatentcodesthroughoptimaltransport/097558b3-3719-4906-a548-215887fb2663_origin.pdf b/understandingddpmlatentcodesthroughoptimaltransport/097558b3-3719-4906-a548-215887fb2663_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a3c4dca352af9190dba91d8d1c872f9252efdf38 --- /dev/null +++ b/understandingddpmlatentcodesthroughoptimaltransport/097558b3-3719-4906-a548-215887fb2663_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8c19f6506435d96d25ffd0e77d9e0df4771c2ef546c4dcac6a1d89b25daa0934 +size 10345760 diff --git a/understandingddpmlatentcodesthroughoptimaltransport/full.md b/understandingddpmlatentcodesthroughoptimaltransport/full.md new file mode 100644 index 0000000000000000000000000000000000000000..9c14479e259e19e7690131a3761f79a6b14ab766 --- /dev/null +++ b/understandingddpmlatentcodesthroughoptimaltransport/full.md @@ -0,0 +1,507 @@ +# UNDERSTANDING DDPM LATENT CODES THROUGH OPTIMAL TRANSPORT + +# Valentin Khrulkov + +Yandex + +Moscow, Russia + +khrulkov.v@gmail.com + +# Gleb Ryzhakov & Andrei Chertkov + +Skolkovo Institute of Science and Technology Moscow, Russia + +{a.chertkov,g.ryzhakov}@skoltech.ru + +# Ivan Oseledets + +Skolkovo Institute of Science and Technology and AIRI + +Moscow, Russia + +i.oseledets@skoltech.ru + +# ABSTRACT + +Diffusion models have recently outperformed alternative approaches to model the distribution of natural images. Such diffusion models allow for deterministic sampling via the probability flow ODE, giving rise to a latent space and an encoder map. While having important practical applications, such as the estimation of the likelihood, the theoretical properties of this map are not yet fully understood. In the present work, we partially address this question for the popular case of the VP-SDE (DDPM) approach. We show that, perhaps surprisingly, the DDPM encoder map coincides with the optimal transport map for common distributions; we support this hypothesis by extensive numerical experiments using advanced tensor train solver for multidimensional Fokker-Planck equation. We provide additional theoretical evidence for the case of multivariate normal distributions. + +# 1 INTRODUCTION + +Denoising diffusion probabilistic models (DDPMs) (Sohl-Dickstein et al., 2015; Ho et al., 2020) have recently outperformed alternative approaches to model the distribution of natural images both in the realism of individual samples and their diversity (Dhariwal & Nichol, 2021). These advantages of diffusion models are successfully exploited in applications, such as colorization (Song et al., 2021b), inpainting (Song et al., 2021b), super-resolution (Saharia et al., 2021; Li et al., 2022), and semantic editing (Meng et al., 2021), where DDPM often achieve more impressive results compared to GANs. + +One crucial feature of diffusion models is the existence of a deterministic invertible mapping from the data distribution to the limiting distribution of the diffusion process, commonly being a standard normal distribution. This approach termed denoising diffusion implicit model (DDIM) (Song et al., 2021a), or the probability flow ODE in the continuous model (Song et al., 2021b), allows to invert real images easily, perform data manipulations, obtain a uniquely identifiable encoding, as well as to compute exact likelihoods. Despite these appealing features, not much is known about the actual mathematical properties of the encoder map and corresponding latent codes, which is the question we address in this work. Concretely, in this paper, we show that for the DDPM diffusion process, based on the Variance Preserving (VP) SDE (Song et al., 2021b), this encoder map with a large numerical accuracy coincides with the Monge optimal transport map between the data distribution and the standard normal distribution. We provide extensive empirical evidence on controlled synthetic examples and real datasets and give a proof of equality for the case of multivariate normal distributions. Our findings suggest a complete description of the encoder map and an intuitive approach to understanding the 'structure' of a latent code for DDPMs trained on visual data. In this case, the pixel-based Euclidean distance corresponds to high-level texture and color-level similarity, directly observed on real DDPMs. To summarize, the contributions of our paper are: + +1. We theoretically verify that for the case of multivariate normal distributions the Monge optimal transport map coincides with the DDPM encoder map. +2. We study the DDPM encoder map by numerically solving the Fokker-Planck equation on a large class of synthetic distributions and show that the equality holds up to negligible errors. +3. We provide additional qualitative empirical evidence supporting our hypothesis on real image datasets. + +# 2 REMINDER ON DIFFUSION MODELS + +We start by recalling various concepts from the theory of diffusion models and stochastic differential equations (SDEs). + +# 2.1 DENOISING DIFFUSION PROBABILISTIC MODELS + +Denoising diffusion probabilistic models (DDPMs) is a class of generative models recently shown to obtain excellent performance on the task of image synthesis (Dhariwal & Nichol, 2021; Ho et al., 2020; Song et al., 2021b). We start with a forward (non-parametric) diffusion which gradually adds noise to data, transforming it into a Gaussian distribution. Formally, we specify the transitions probabilities as + +$$ +q \left(x _ {t} \mid x _ {t - 1}\right) := \mathcal {N} \left(x _ {t}; \sqrt {1 - \beta_ {t}} x _ {t - 1}, \beta_ {t} I\right), \tag {1} +$$ + +for some fixed variance schedule $\beta_{1},\ldots ,\beta_{t}$ . Importantly, a noisy sample $x_{t}$ can be obtained directly from the clean sample $x_0$ as $x_{t} = \sqrt{\bar{\alpha}_{t}} x_{0} + \sqrt{1 - \bar{\alpha}_{t}}\mathbf{z}$ , with $\mathbf{z}\sim \mathcal{N}(0,I)$ and $\alpha_{t}\coloneqq 1 - \beta_{t}$ , $\bar{\alpha}_t\coloneqq \prod_{s = 1}^t\alpha_s$ . The generative model then learns to reverse this process and thus gradually produce realistic samples from noise. Specifically, DDPM learns parameterized Gaussian transitions: + +$$ +p _ {\theta} \left(x _ {t - 1} \mid x _ {t}\right) := \mathcal {N} \left(x _ {t}; a _ {\theta} \left(x _ {t}, t\right), \sigma_ {t}\right). \tag {2} +$$ + +In practice, rather than predicting the mean of the distribution in Equation (2), the noise predictor network $\epsilon_{\theta}(x_t,t)$ predicts the noise component from the sample $x_{t}$ and the step $t$ ; the mean is then a linear combination of this noise component and $x_{t}$ . The covariances $\sigma_t$ can be either fixed or learned as well; the latter was shown to improve the quality of models (Nichol & Dhariwal, 2021). Interestingly, the noise predictor $\epsilon_{\theta}(x_t,t)$ is tightly related to the score function (Stein, 1972; Liu et al., 2016; Gorham, 2017) of the intermediate distributions; specifically by defining $s_\theta (x_t,t)$ as + +$$ +s _ {\theta} \left(x _ {t}, t\right) = \frac {\epsilon_ {\theta} \left(x _ {t} , t\right)}{\sqrt {1 - \bar {\alpha} _ {t}}} \tag {3} +$$ + +we obtain that $s_{\theta^*}(x_t, t) \approx \nabla_x \log p_t(x_t)$ , with $p_t(x_t)$ being the density of the target distribution after $t$ steps of the diffusion process and $\theta^*$ are the parameters at convergence. + +Stochastic and deterministic sampling. Given the DDPM model, the generative process is expressed as + +$$ +x _ {t - 1} = \frac {1}{\sqrt {\alpha_ {t}}} \left(x _ {t} - \frac {1 - \alpha_ {t}}{\sqrt {1 - \bar {\alpha} _ {t}}} \epsilon_ {\theta} (x _ {t}, t)\right) + \sigma_ {t} \mathbf {z}, +$$ + +with the initial sample $x_{T} \sim \mathcal{N}(0, I)$ and $\mathbf{z} \sim \mathcal{N}(0, I)$ . The sampling procedure is stochastic, and no single 'latent space' exists. The authors of Song et al. (2021a) proposed a deterministic approach to produce samples from the target distribution, termed DDIM (denoising diffusion implicit model). Importantly, this approach does not require retraining DDPM and only changes the sampling algorithm; the obtained marginal probability distributions $p_{t}$ are equal to those produced by the stochastic sampling. It takes the following form: + +$$ +x _ {t - 1} = \sqrt {\bar {\alpha} _ {t - 1}} \left(\frac {x _ {t} - \sqrt {1 - \bar {\alpha} _ {t}} \epsilon_ {\theta} (x _ {t} , t)}{\sqrt {\bar {\alpha} _ {t}}}\right) + \sqrt {1 - \bar {\alpha} _ {t - 1}} \cdot \epsilon_ {\theta} (x _ {t}, t). \tag {4} +$$ + +By utilizing DDIM, we obtain a concept of a latent space and encoder for diffusion models, since the only input to the generative model now is $x_{T} \sim \mathcal{N}(0, I)$ for sufficiently large $T$ . In the next section, we will see how it is defined in the continuous setup. + +# 2.2 SDE VIEW ON DIFFUSION MODELS + +The authors of Meng et al. (2021) proposed to view diffusion models as a discretization of certain stochastic differential equations. SDEs generalize standard ordinary differential equations (ODEs) by injecting random noise into dynamics. Specifically, the diffusion process specified by Equation (1) is a discretization of the following SDE: + +$$ +d x = - \frac {1}{2} \beta (t) x d t + \sqrt {\beta (t)} d w. \tag {5} +$$ + +where $dx$ is an increment of $x$ over the infinitesimal time step $dt$ . Here, $w$ represents a Brownian motion process, so $dw$ can be intuitively understood as an infinitesimal Gaussian noise. Similar to DDPMs, an initial distribution with density $p_0$ evolves into a standard normal distribution under this SDE. Various DDPM algorithms can be seen as discretizations of SDE-based algorithms. For instance, the continuous analogue of DDIM sampling (4) is constructed in the following way. The following (deterministic) ODE, termed probability flow ODE (Song et al., 2021b) + +$$ +d x = - \frac {\beta (t)}{2} [ x + \nabla_ {x} \log p _ {t} (x) ] d t, \tag {6} +$$ + +results in the same marginal distributions $p_t$ as given by the SDE (5). Here, the score function $\nabla_x \log p_t(x)$ is similarly approximated via a neural network during training. If we reverse this ODE, we obtain a mapping from the limiting distribution to the data distribution. It turns out that the DDIM sampling is a discretization of this continuous approach (Song et al., 2021b). + +The well-developed theory of SDEs provides us with a rigorous mathematical apparatus allowing us to study the properties of diffusion models at hand. We will utilize the following well-known equation termed the forward Kolmogorov, or Fokker-Planck equation (Risken, 1996). This equation determines how a density $p_0$ evolves under a (general) SDE. For (5) it takes the following form: + +$$ +\frac {\partial p _ {t}}{\partial t} = \frac {\beta (t)}{2} \left[ \nabla_ {x} \cdot \left(x p _ {t}\right) + \nabla_ {x} ^ {2} p _ {t} \right]. \tag {7} +$$ + +Note, that $\beta (t)$ can be removed from (7) by change of variables $dt\coloneqq \frac{\beta(t)}{2} dt$ , resulting in the PDE of the form + +$$ +\frac {\partial p _ {t}}{\partial t} = \nabla_ {x} \cdot (x p _ {t}) + \nabla_ {x} ^ {2} p _ {t}. \tag {8} +$$ + +Without loss of generality, we will work with this simplified equation since the specific form of $\beta (t)$ does not affect the results. In this case, the probability flow ODE takes the following form: + +$$ +d x = - \left[ x + \nabla_ {x} \log p _ {t} (x) \right] d t. \tag {9} +$$ + +Encoder map. As mentioned above, by considering the probability flow ODE (6), we can obtain latent codes for samples from the original distribution. For a given distribution $\mu_0$ and a timestep $t$ , let us denote the flow generated by this vector field as $E_{\mu_0}(t,\cdot)$ . I.e., a point $x \sim \mu_0$ is mapped to $E_{\mu_0}(t,x)$ when transported along the vector field for a time $t$ . The 'final' encoding map is obtained when $t \to \infty$ , i.e, + +$$ +E _ {\mu_ {0}} (x) := \lim _ {t \to \infty} E _ {\mu_ {0}} (t, x). +$$ + +Note that $E_{\mu_0}$ implicitly depends on all the intermediate densities $\mu_t$ obtained from the diffusion process (or the Fokker-Planck equation). + +# 3 DDPM ENCODER AND OPTIMAL TRANSPORT + +By construction and properties of the phase flow, the map $E_{\mu}$ transforms the original distribution $\mu_0$ into the standard normal distribution $\pi \coloneqq \mu_{\infty} \sim \mathcal{N}(0, I)$ . Our further analysis investigates a perhaps surprising hypothesis that this map is very close to the optimal transport map. How to arrive at this idea? A priori, it seems nontrivial that the theory of optimal transportation is related to the Fokker-Planck equation and diffusion processes. Some intuition may be obtained from the Otto calculus (Otto, 1996; 2001; Villani, 2009). It presents an alternative view of the solutions of the Fokker-Planck-type PDEs and diffusion equations in the following manner. It can be shown that the trajectory $\{\mu_t\}_{t=0}^{\infty}$ , obtained by solving the Fokker-Planck equation (or an equivalent diffusion SDE), + +![](images/caf4811c1609c5fa480bfe212afef4ec450fd8de0f82c5d4b571c8fdc83a9208.jpg) +Figure 1: A toy example of our approach on a $2d$ multivariate normal distribution $\mu$ . The first four plots visualize the diffusion process. The fifth plot demonstrates the trajectories of the probability flow ODE. In this case, the optimal transport map is known analytically and exactly coincides with the mapping $E_{\mu}$ , introduced in Section 3.2. Note that the trajectories of the probability flow ODE are not straight lines even in this simple case. + +![](images/66be83feadc16254c30506eecbbec580fadf8e9a6213c30ca0eaf648dfe5bd86.jpg) + +![](images/92bbd93a1c28027104d72d3ea9fdf78561fc55a984892096eebc8e67946a218e.jpg) + +![](images/5376eb071be35c8e083ba35a87effe61a0311a47059caf65a46298377477722d.jpg) + +![](images/e43b00c6a166e67489e46ecac4983a8fec20af4814a0dc101e3c19af01c85833.jpg) + +is, in fact, the gradient flow of a certain functional in the Wasserstein space of probability measures. Moreover, locally, optimal transport maps between two 'consecutive' densities (i.e., separated by an infinitesimal time interval) along this trajectory are given precisely by the flow of the ODE (6). Thus, this trajectory is generally a sequence of infinitesimal optimal transports, which may not result in the 'global' optimal transport map. However, our experiments suggested that in the case when the target density is $\mathcal{N}(0,I)$ as in DDPMs, the map is practically indistinguishable from the optimal transport map. We start with a toy example and then proceed to more general cases. + +# 3.1 TOY EXAMPLE + +One of the few cases when both optimal transport and diffusion equations can be solved explicitly is the case of multivariate Gaussian distributions. For simplicity, in this example, we consider $\mu_0\sim \mathcal{N}(a,I)$ with $a\in \mathbb{R}^n$ and $I\in \mathbb{R}^{n\times n}$ being the identity matrix. Rather than utilizing Equation (8) to obtain intermediate density values, we can do it directly from the transition formulas for SDE (5) found in Song et al. (2021b); Särkkä & Solin (2019); the corresponding probabilities then take the form: + +$$ +\mu_ {t} \sim \mathcal {N} \left(a e ^ {- t}, I\right). \tag {10} +$$ + +The probability flow ODE takes the form $\frac{dx}{dt} = -ae^{-t}$ . Solving this ODE amounts to simply integrating the function in the right-hand side, and in the limit $t\to \infty$ we obtain $E_{\mu_0}(x) = x - a$ . Note that this is exactly the optimal transport map between $\mu_0$ and $\mathcal{N}(0,I)$ . + +# 3.2 REMINDER ON OPTIMAL TRANSPORT + +We now briefly recall the main definitions of the optimal transport theory. For a thorough review of optimal transport, we refer the reader to classical texts such as Thorpe (2018); Villani (2009); Ambrosio et al. (2005). + +Kantorovich and Monge formulation. Suppose we have two random variables with densities $\mu$ and $\nu$ supported on spaces $X$ and $Y$ respectively (in our work, we only consider distributions in Euclidean spaces). We consider the optimal transport problem between $\mu$ and $\nu$ . There are several possible formulations of this task, namely the Kantorovich formulation and Monge formulation. Under quite general assumptions, these two formulations are equivalent. We will start from the Kantorovich formulation. In this formulation, we consider densities $\gamma \in \mathcal{P}(X \times Y)$ such that their marginal densities are $\mu$ and $\nu$ respectively. Such set is denoted by $\Pi(\mu, \nu)$ and its elements are termed transport plans. The Kantorovich formulation of the optimal transport problem is finding the optimal transport plan: + +$$ +\int c (x, y) \gamma (x, y) d x d y \rightarrow \min _ {\gamma \in \Pi (\mu , \nu)}, \tag {11} +$$ + +where $c(x,y)$ is a cost function. Under quite general assumptions on $\mu, \nu$ , there exists a unique solution to the Kantorovich problem. Rather than working with transport plans, it is more convenient to work with transport maps, which provide the means to actually move one distribution to another. In this formulation (termed the Monge formulation), our goal is to find a transport map $S: X \to Y$ + +such that + +$$ +\int c (x, S (x)) \mu (x) d x \rightarrow \inf _ {S}, \tag {12} +$$ + +over all $\mu$ -measurable transport maps $S$ such that $\nu = S_{\#}\mu$ . Here, $S_{\#}\mu$ is the push-forward measure, i.e., $(S_{\#}\mu)(A) = \mu(S^{-1}(A))$ for all measurable sets $A$ . + +Importantly, for non-atomic measures, these two definitions are equivalent (Villani, 2009). Given an optimal transport map, it can be straightforwardly converted to the optimal transport plan. Such a plan is deterministic, as we know precisely where to move each point. In this work, we consider the quadratic cost function, i.e., $c(x,y) = \| x - y\| ^2$ , as commonly done in the study of diffusion equations and gradient flows in Wasserstein spaces Villani (2009). In this case, the distance between distributions is denoted as $W_{2}(\cdot ,\cdot)$ and is given by the square root of the optimal transport cost (11). In the appendix, we also discuss the Benamou-Brenier formulation of optimal transport. + +# 3.3 MULTIVARIATE NORMAL DISTRIBUTION CASE + +We start by showing theoretically that for arbitrary multivariate normal distributions, the DDPM encoder map coincides with the optimal transport map. This map is known analytically for normal distributions in the case of the quadratic cost function (Givens & Shortt, 1984). + +Theorem 3.1. Let $\mu_0\sim \mathcal{N}(a(0),\Sigma (0))$ be a multivariate normal distribution. Then $E_{\mu_0}$ is the Monge optimal transport map between $\mu_0$ and $\mathcal{N}(0,I)$ , i.e., + +$$ +E _ {\mu_ {0}} (x) = \Sigma (0) ^ {- 1 / 2} (x - a (0)). +$$ + +See the appendix for the proof. + +Discussion. We show that for multivariate normal distributions, the probability flow induced by the DDPM diffusion reduces to the optimal transport map in the limit. Despite the apparent simplicity of this case, the proof requires a non-trivial argument about the probability flow ODE. Thus, it is hard to attribute this result to a mere coincidence. We hypothesize that the statement of Theorem 3.1 is valid, perhaps, approximately, for arbitrary distributions (or at least a very large class of distributions), but defer more precise theoretical analysis of this statement to future work. For now, we thoroughly evaluate this hypothesis on a large class of synthetic and real distributions and show that it holds with high numerical precision. Very recently, in Lavenant & Santambrogio (2022) appeared a counterexample to the above statement with the two maps not being exactly equal (at a single point). However, our further analysis suggests that when given a finite number of samples in higher dimensions, the difference is still extremely low. + +# 3.4 NUMERICAL EXPERIMENTS ON SYNTHETIC DATA + +In this section, we numerically evaluate the aforementioned optimal transport map hypothesis. The main computational difficulty is the solution of the multidimensional Fokker-Planck equation (8). To maintain accuracy in traditional discretization-based numerical methods, the number of degrees of freedom of the approximation, i.e., the number of unknowns, grows exponentially as the dimensionality of the underlying state-space increases. In recent years, low-rank (low-parametric) tensor approximations have become especially popular for solving multidimensional problems in various fields of knowledge (Cichocki et al., 2016; 2017). Recently proposed approach (Chertkov & Oseledets, 2021) for the solution of the Fokker-Planck equation utilizing low-rank tensor train (TT) format (Oseledets, 2011), Chebyshev interpolation, splitting and spectral differentiation techniques, allowing us to consider sufficiently fine grids. + +Method. We start by numerically solving the Fokker-Planck equation for an initial density $p_0(x) \equiv p(x, 0)$ . According to approach (Chertkov & Oseledets, 2021), Equation (8) is discretized on a tensor-product Chebyshev grid with $N$ nodes for each dimension, and the density $p$ at each time step is represented as a $d$ -dimensional tensor (array) $\mathcal{P}$ . This tensor is approximated in the low-rank TT-format + +$$ +\mathcal {P} \left[ n _ {1}, n _ {2}, \dots , n _ {d} \right] \approx \sum_ {r _ {1} = 1} ^ {R _ {1}} \sum_ {r _ {2} = 1} ^ {R _ {2}} \dots \sum_ {r _ {d - 1} = 1} ^ {R _ {d - 1}} \mathcal {G} _ {1} \left[ 1, n _ {1}, r _ {1} \right] \mathcal {G} _ {2} \left[ r _ {1}, n _ {2}, r _ {2} \right] \dots \mathcal {G} _ {d} \left[ r _ {d - 1}, n _ {d}, 1 \right], \tag {13} +$$ + +where $n_k = 1,2,\ldots ,N$ $(k = 1,2,\dots ,d)$ represent the multi-index, three-dimensional tensors $\mathcal{G}_k\in \mathbb{R}^{R_{k - 1}\times N\times R_k}$ are named TT-cores, and integers $R_0,R_1,\ldots ,R_d$ (with convention $R_0 =$ $R_{d} = 1$ ) are named TT-ranks. Storage of the TT-cores $\mathcal{G}_1,\mathcal{G}_2,\dots ,\mathcal{G}_d$ requires less or equal than $d\times N\times \max_{1\leq k\leq d}R_k^2$ memory cells instead of $N^d$ cells for the uncompressed tensor, and hence the TT-decomposition is free from the curse of dimensionality if the TT-ranks are bounded. Thus, at each time step $m = 1,2,\ldots ,\frac{t_{max}}{h}$ , we obtain discrete values of the density $p(x,mh)$ , represented in the compact TT-format as in Equation (13). In the appendix, we describe the algorithm in more details. + +Next, we solve the probability flow ODE from Equation (9). We sample a set of points, termed $X_0$ , from the original density $p_0(x)$ (since the initial density is presented in the TT-format, we use a specialized method for sampling from (Dolgov & Scheichl, 2019)). Then we numerically solve the probability flow ODE with the Runge-Kutta method (DeVries & Wolf, 1994) for each point (we calculate the density logarithm gradient using the spectral differentiation methods in the TT-format from (Chertkov & Oseledets, 2021)). The resulting set is denoted as $X_1$ . + +Given these two point clouds, $X_0$ and $X_1$ , we numerically compute the optimal transport cost with the Python Optimal Transport (POT) library (Flamary et al., 2021). We then compute the transport cost for the map sending a point $x_i \in X_0$ to its counterpart $E_p(x_i) \in X_1$ . Our hypothesis suggests that these two costs will be equal to a reasonable precision. + +Distributions. We consider $d$ -dimensional distributions specified by the following set of parameters: $a_1 \in \mathbb{R}^d, a_2 \in \mathbb{R}^d, Q_1 \in \mathbb{R}^{d \times d}, Q_2 \in \mathbb{R}^{d \times d}$ , with $Q_1$ and $Q_2$ being symmetric positive definite. Given these parameters, we set the density $p(x)$ (with $x \in \mathbb{R}^d$ ) by the following formula + +$$ +p (x) = \frac {1}{Z} \exp \left(- q _ {1} (x) - q _ {2} (x)\right), +$$ + +$$ +q _ {1} (x) = \left(x - a _ {1}\right) ^ {T} Q _ {1} (x - a _ {1}), \quad q _ {2} (x) = \left(\left(x - a _ {2}\right) ^ {2}\right) ^ {T} Q _ {2} (x - a _ {2}) ^ {2}, +$$ + +where the square in $q_{2}$ is understood elementwise (so $q_{2}$ is a polynomial of degree 4) and $Z$ is a normalizing constant obtained by numerical integration. We then consider uniform mixtures of up to 5 of such randomly generated distributions, i.e., + +$$ +p (x) = \frac {1}{K} \sum_ {i = 1} ^ {K} p _ {i} (x), \quad K \sim \operatorname {U n i f o r m} (5), \tag {14} +$$ + +with $p_i$ being as above. Some examples for the 2-dimensional case (i.e., $d = 2$ ) are visualized at Figure 2. We see that the distributions are quite diverse and lack any symmetry. + +We use the distribution from Equation (14) for the 2 and 3-dimensional case. If $d > 3$ , the number of parameters in the TT-representation of this distribution turns out to be too large, so we use a density of a simpler form + +$$ +\hat {p} (x) = \frac {1}{Z} q (x) \cdot (2 \pi) ^ {- \frac {d}{2}} \cdot e x p \left(- \frac {\| x \| ^ {2}}{2}\right), \tag {15} +$$ + +where $Z$ is a normalizing constant obtained by numerical integration in the TT-format and $q(x)$ is a random function in the TT-format with positive TT-cores (each element of the TT-cores was sampled from $\mathcal{U}(0,1)$ ) and of rank 2. Since the Gaussian density has rank 1 with variables being completely separated, the above formula provides us with a low-rank fast decaying density suitable for experiments. + +Experiment and results. We consider three dimension numbers $d = 2,3,7$ . For the case $d = 2$ and $d = 3$ we use the density from Equation (14) and for the case $d = 7$ we use the density from Equation (15). As the spatial domain, we consider the square $[-8,8]^d$ , and densities were scaled beforehand to decay sufficiently fast towards the boundary. For the time dimension, we consider the range [0, 5]. We construct 100 random densities for each $d$ and compute two transport costs as described above. Some examples of the obtained encoder maps for the 2-dimensional case are given at Figure 3. The trajectories of the probability flow ODE are highly nonlinear, despite providing the optimal transport map in the limit. + +The obtained results are presented at Table 1. Here, the error is defined as + +$$ +\varepsilon_ {r e l} (p) = \frac {\operatorname {C o s t} \left(E _ {p}\right) - \operatorname {C o s t} (O T)}{\operatorname {C o s t} (O T)}, +$$ + +![](images/fb273c6de401b8a3794888187f985d76649c2952fa98fa4543a41feb51cccb97.jpg) +Figure 2: An example of 2-dimensional distributions considered for numerical comparison of the Monge optimal transport map against the DDPM encoder map. + +![](images/b69856e27b2c6f209dfa38de5f93a0d3fff228f4a3e747d46a3c658c2493fabe.jpg) +Figure 3: An example of the trajectories of the probability flow ODE and the limiting encoder map for two 2-dimensional distributions studied in Section 3.4. + +Table 1: Numerical results for synthetic data of different dimensions. + +
Dimensionality dSpatial grid sizeTemporal grid sizeMaximum error εrel(p)
22502505.7 · 10-15
31001002.2 · 10-15
750502.1 · 10-15
+ +and in the table we report the obtained maximum value of the error for 100 random densities. For all three considered settings, we have a very high (up to machine precision) accuracy, and we conclude that this experiment fully supported our hypothesis. Note that these calculations were carried out on a regular laptop and run for one random density took about 100 seconds on average for each model problem. We have additionally run this experiment for the counterexample provided in Lavenant & Santambrogio (2022), again obtaining a machine precision level difference, which is not surprising since the difference between two maps is shown to hold only at $(0,0)$ . This suggests that constructing a 'numerical' counterexample is a nontrivial task. The code is available in the supplementary material. + +We now attempt to verify it on a more qualitative level for high-dimensional distributions, where solving the Fokker-Planck equation directly is infeasible. Namely, we consider DDPMs trained on high-resolution image data. + +# 3.5 EXPERIMENTS OF IMAGE DATASETS + +Our experiments in this section are organized as follows. Suppose that we are given two datasets and train a DDPM for each dataset. Then, by the hypothesis, each DDPM encoder performs optimal transport from respective distributions to $\mathcal{N}(0,I)$ . Since the optimal transport in our setting is performed in the $L_{2}$ sense, for images, this will be reflected by similarity in the pixel space, i.e., high-level texture similarity. We can perform the following experiment to see if this indeed holds. Take a latent code from $\mathcal{N}(0,I)$ , and compute a corresponding image from each distribution respectively by reversing the encoder map. We can now compare if these images share texture and a high level semantic structure. Indeed, if each of those images is $L_{2}$ -close 'on average' to the same latent code, we expect them to also be similar on the pixel level. Additionally, on datasets of relatively small sizes, we again can compare the directly computed OT map in the pixel space with the DDPM encoder map. + +Datasets. We consider the AFHQ animal dataset (Choi et al., 2020). It consists of 15000 images split into 3 categories: cat, dog, and wild. This is a common benchmark for image-to-image methods. We also verify our theory on the FFHQ dataset of 70.000 human faces (Karras et al., 2019) and the + +MetFaces dataset (Karras et al., 2020) consisting of 1000 human portraits. Finally, we consider a conditional DDPM on the ImageNet dataset (Deng et al., 2009). By changing the conditioning label, we can control what distribution is being produced, and the argument above still holds. + +Models. We consider guided-diffusion, state-of-the-art DDPMs (Dhariwal & Nichol, 2021). We use the official implementation available at github1. For each of the datasets we train a separate DDPM model with the same config as utilized for the LSUN datasets in Dhariwal & Nichol (2021) (with dropout); we use default 1000 timesteps for sampling. The AFHQ models were trained for $3 \cdot 10^{5}$ steps, the FFHQ model was trained for $10^{6}$ steps; for the MetFaces model, we finetune the FFHQ checkpoint for $25 \cdot 10^{3}$ steps similar to Choi et al. (2021). All models were trained on $256 \times 256$ resolution. For the ImageNet experiment, we utilize the 256 resolution checkpoint for the conditional model available at the GitHub link above. + +Algorithm. We follow the aforementioned experimental setup: we sample a number of latent codes from $\mathcal{N}(0, I)$ in the pixel space $(\mathbb{R}^{256 \times 256 \times 3})$ and decode them by different DDPMs with the DDIM algorithm. For the ImageNet, we have a single DDPM model but vary the conditioning label. + +![](images/a91d4724fcfe5f4e4afcaf59f0db7abdb8a301116da12c4685532dcf500d1fb5.jpg) + +![](images/a98e2927da736e274c3c71393f5d41dbf8a564d562f298afb5deba1befa05833.jpg) +Figure 4: Examples of synthetic samples produced with DDIM sampling from the same latent codes. (Top) Three independent DDPMs trained on AFHQ Dog/Cat/Wild. Each row translates into each row in most cases preserving high-level semantics such as pose and texture, thus supporting the claim of our hypothesis. (Bottom) Two DDPMs trained on FFHQ/MetFaces; high-level features such as gender and texture/color are transferred. 'Noisy' samples seem also to be shared across models. + +Qualitative results. We fix a number of latent codes and produce images by all the AFHQ models. The obtained samples are visualized on Figure 4 (top). We observe that samples from different rows indeed share high-level features such as texture and pose. Similarly, we visualize samples from FFHQ and MetFaces on Figure 4 (bottom). We note that samples are aligned in this case as well; notably, in most cases, pose, gender, and various features such as hairstyle and mustache are transferred. Interestingly, artifacts of models such as slight noisiness also seem to be shared. + +Results obtained with the ImageNet model are provided at Figure 5. We selected a number of diverse classes, namely, rooster, pizza, crab, corgi. We sampled a number of latent codes and produced images by conditioning on the respective label. We see that in this case, high-level textures are transferred as well, sometimes in quite amusing ways (e.g., rooster/pizza rows). As a sanity check, we performed a similar experiment with the conditional BigGAN model (Brock et al., 2019) pretrained + +on ImageNet. We did not observe similar behavior, suggesting that the texture alignment is an artifact specific to DDPM and not happening simply due to the conditioning mechanism. + +Numerical results. We now apply the evaluation scheme of Section 3.4 to the AFHQ dataset. We take the validation subset of each part of the dataset (Cat/Dog/Wild) containing 500 images and invert them with DDIM. We then compute the optimal transport matrix between the images and their respective codes (understood as vectors in $\mathbb{R}^{256\times 256\times 3}$ ) with POT. We then compared the obtained OT cost with the cost for the ODE induced map. In all three cases, they matched up to a machine precision. Given the high dimensionality of the pixel space and a low number of samples, the exact coincidence with the hypothesis is not surprising, since for the majority of synthetic experiments, there was an exact match. Intuitively, this should become easier in high dimensions as we may trade some inaccuracies in the model with there being 'more space'. + +To conclude, experiments on real image datasets support our hypothesis and provide interesting examples of how latent codes can be utilized to transfer images from one distribution to another via a 'proxy' normal distribution. + +![](images/a581912804e86dc8a24f013e134fa1c1cfddf9387753d0a4212fa4458d5dc6a8.jpg) +Figure 5: Examples of synthetic samples produced with DDIM sampling from same latent codes for different classes with a conditional ImageNet model. We observe that samples share texture and pixel-based similarity. + +# 4 RELATED WORK + +OT is a classical area of mathematics tightly related to diffusion processes and PDEs. With hundreds of papers on this topic, we can not provide a thorough review of all the literature and refer the reader to great texts such as Villani (2009); Ambrosio et al. (2005); Thorpe (2018). Computational approaches to OT have been extensively studied by the machine learning communities (Cuturi, 2013; Altschuler et al., 2017; Lin et al., 2019). We also note the work (Onken et al., 2021) in which the relationship between OT and normalizing flows was considered, as well as the work (Mokrov et al., 2021), where a method based on the Wasserstein gradient flows was proposed for solution of the Fokker-Planck equation. A recently introduced class of score-based models termed diffusion Schrödinger bridges (Chen et al., 2016; De Bortoli et al., 2021; Gushchin et al., 2022) is tightly related to the entropy-regularized OT problem, providing a continuous analog of the Sinkhorn algorithm. In our paper, we show a connection between DDIM and (non-regularized) OT formulations, not covered by the Schrödinger bridge theory. As mentioned in Section 3.2, a similar question was studied in Lavenant & Santambrogio (2022) providing a theoretical counterexample, while our analysis is mostly numerical and is motivated by the practical goal of understanding the DDPM encoder. + +# 5 CONCLUSION + +In this work, we provided theoretical and experimental evidence that due to the nature of DDPMs, the encoder map turns out to be the optimal transport map. We believe that this result will be interesting to both optimal transport and diffusion models communities. We hope that it will inspire other researchers to obtain general proof of this hypothesis. One observation about the obtained results is that the quadratic cost in the pixel space seems suboptimal when working with visual data. Perhaps, a more elaborate diffusion process leading to feature-based cost may be constructed. We leave this analysis to future work. + +# ACKNOWLEDGMENTS + +The work was supported by the Analytical center under the RF Government (subsidy agreement 000000D730321P5Q0002, Grant No. 70-2021-00145 02.11.2021). + +# REFERENCES + +Jason Altschuler, Jonathan Niles-Weed, and Philippe Rigollet. Near-linear time approximation algorithms for optimal transport via sinkhorn iteration. Advances in neural information processing systems, 30, 2017. 9 +Luigi Ambrosio, Nicola Gigli, and Giuseppe Savaré. Gradient flows: in metric spaces and in the space of probability measures. Springer Science & Business Media, 2005. 4, 9 +Jean-David Benamou and Yann Brenier. A computational fluid mechanics solution to the Monge-Kantorovich mass transfer problem. Numerische Mathematik, 84(3):375-393, 2000. 13 +Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale GAN training for high fidelity natural image synthesis. In International Conference on Learning Representations, 2019. 8 +Yongxin Chen, Tryphon T Georgiou, and Michele Pavon. On the relation between optimal transport and schrödinger bridges: A stochastic control viewpoint. Journal of Optimization Theory and Applications, 169(2):671-691, 2016. 9 +Andrei Chertkov and Ivan Oseledets. Solution of the Fokker-Planck Equation by Cross Approximation Method in the Tensor Train Format. Frontiers in Artificial Intelligence, 4, 2021. doi: 10.3389/frai.2021.668215. 5, 6, 15 +Jooyoung Choi, Sungwon Kim, Yonghyun Jeong, Youngjune Gwon, and Sungroh Yoon. ILVR: Conditioning method for denoising diffusion probabilistic models. Proceedings of the IEEE international conference on computer vision, 2021. 8 +Yunjey Choi, Youngjung Uh, Jaejun Yoo, and Jung-Woo Ha. Stargan v2: Diverse image synthesis for multiple domains. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 8188-8197, 2020. 7 +Andrzej Cichocki, Namgil Lee, Ivan Oseledets, Anh-Huy Phan, Qibin Zhao, and Danilo Mandic. Tensor networks for dimensionality reduction and large-scale optimization: Part 1 low-rank tensor decompositions. Foundations and Trends in Machine Learning, 9(4-5):249-429, 2016. 5 +Andrzej Cichocki, Anh Phan, Qibin Zhao, Namgil Lee, Ivan Oseledets, Masashi Sugiyama, and Danilo Mandic. Tensor networks for dimensionality reduction and large-scale optimization: Part 2 applications and future perspectives. Foundations and Trends in Machine Learning, 9(6):431-673, 2017. 5 +Marco Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. Advances in neural information processing systems, 26, 2013. 9 +Valentin De Bortoli, James Thornton, Jeremy Heng, and Arnaud Doucet. Diffusion schrödinger bridge with applications to score-based generative modeling. Advances in Neural Information Processing Systems, 34, 2021. 9 +Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248-255. IEEE, 2009. 8 +Paul L DeVries and Robert P Wolf. A first course in computational physics. Computers in Physics, 8 (2):178-179, 1994. 6 +Prafulla Dhariwal and Alexander Quinn Nichol. Diffusion models beat GANs on image synthesis. In A. Beygelzimer, Y. Dauphin, P. Liang, and J. Wortman Vaughan (eds.), Advances in Neural Information Processing Systems, 2021. 1, 2, 8 +Sergey Dolgov and Robert Scheicl. A hybrid alternating least squares- tt-cross algorithm for parametric pdes. SIAM/ASA Journal on Uncertainty Quantification, 7(1):260-291, 2019. 6 +DC Dowson and BV666017 Landau. The frechet distance between multivariate normal distributions. Journal of multivariate analysis, 12(3):450-455, 1982. 14 + +Rémi Flamary, Nicolas Courty, Alexandre Gramfort, Mokhtar Z. Alaya, Aurélie Boisbunon, Stanislas Chambon, Laetitia Chapel, Adrien Corenflos, Kilian Fatras, Nemo Fournier, Léo Gautheron, Nathalie T.H. Gayraud, Hicham Janati, Alain Rakotomamonjy, Ievgen Redko, Antoine Rolet, Antony Schutz, Vivien Seguy, Danica J. Sutherland, Romain Tavenard, Alexander Tong, and Titouan Vayer. POT: Python Optimal Transport. Journal of Machine Learning Research, 22(78): 1-8, 2021. 6 +Clark Givens and Rae Shortt. A class of Wasserstein metrics for probability distributions. Michigan Mathematical Journal, 31(2):231-240, 1984. 5 +Roland Glowinski, Stanley J Osher, and Wotao Yin. Splitting methods in communication, imaging, science, and engineering. Springer, 2017. 15 +Jackson Gorham. Measuring sample quality with Stein's method. Stanford University, 2017. 2 +Nikita Gushchin, Alexander Kolesov, Alexander Korotin, Dmitry Vetrov, and Evgeny Burnaev. Entropic neural optimal transport via diffusion processes. arXiv preprint arXiv:2211.01156, 2022.9 +Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. Advances in neural information processing systems, 30, 2017. 14 +Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising Diffusion Probabilistic Models. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 6840-6851. Curran Associates, Inc., 2020. 1, 2 +Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 4401-4410, 2019. 7 +Tero Karras, Miika Aittala, Janne Hellsten, Samuli Laine, Jaakko Lehtinen, and Timo Aila. Training generative adversarial networks with limited data. In Proc. NeurIPS, 2020. 8 +Hugo Lavenant and Filippo Santambrogio. The flow map of the fokker-planck equation does not provide optimal transport. Applied Mathematics Letters, 133:108225, 2022. ISSN 0893-9659. doi: https://doi.org/10.1016/j.aml.2022.108225.5,7,9 +Haoying Li, Yifan Yang, Meng Chang, Shiqi Chen, Huajun Feng, Zhihai Xu, Qi Li, and Yueting Chen. SRDiff: Single Image Super-resolution with Diffusion Probabilistic Models. Neurocomputing, 2022. ISSN 0925-2312. doi: https://doi.org/10.1016/j.neucom.2022.01.029.1 +Tianyi Lin, Nhat Ho, and Michael Jordan. On efficient optimal transport: An analysis of greedy and accelerated mirror descent algorithms. In International Conference on Machine Learning, pp. 3982-3991. PMLR, 2019. 9 +Qiang Liu, Jason Lee, and Michael Jordan. A kernelized Stein discrepancy for goodness-of-fit tests. In International conference on machine learning, pp. 276-284. PMLR, 2016. 2 +Chenlin Meng, Yang Song, Jiaming Song, Jiajun Wu, Jun-Yan Zhu, and Stefano Ermon. SDEdit: Image synthesis and editing with stochastic differential equations. arXiv preprint arXiv:2108.01073, 2021. 1, 3 +Petr Mokrov, Alexander Korotin, Lingxiao Li, Aude Geneva, Justin M Solomon, and Evgeny Burnaev. Large-scale wasserstein gradient flows. Advances in Neural Information Processing Systems, 34:15243-15256, 2021. 9 +Alex Nichol and Prafulla Dhariwal. Improved denoising diffusion probabilistic models. ICML, 2021. 2 +Ingram Olkin and Friedrich Pukelsheim. The distance between two random vectors with given dispersion matrices. Linear Algebra and its Applications, 48:257-263, 1982. 14 + +Derek Onken, Samy Wu Fung, Xingjian Li, and Lars Ruthotto. Ot-flow: Fast and accurate continuous normalizing flows via optimal transport. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pp. 9223-9232, 2021. 9 +Ivan Oseledets. Tensor-train decomposition. SIAM Journal on Scientific Computing, 33(5):2295-2317, 2011. 5 +Ivan Oseledets and Eugene Tyrtyshnikov. Tt-cross approximation for multidimensional arrays. Linear Algebra and its Applications, 432(1):70-88, 2010. 15 +Felix Otto. Double degenerate diffusion equations as steepest descent. Citeseer, 1996. 3 +Felix Otto. The geometry of dissipative evolution equations: the porous medium equation. 2001. 3 +Hannes Risken. Fokker-Planck equation. In The Fokker-Planck Equation. Springer, 1996. 3 +Chitwan Sahara, Jonathan Ho, William Chan, Tim Salimans, David J Fleet, and Mohammad Norouzi. Image super-resolution via iterative refinement. 2021. 1 +Simo Särkkä and Arno Solin. Applied stochastic differential equations, volume 10. Cambridge University Press, 2019. 4, 13 +Jascha Sohl-Dickstein, Eric Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics. In International Conference on Machine Learning, pp. 2256-2265. PMLR, 2015. 1 +Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising Diffusion Implicit Models. In International Conference on Learning Representations, 2021a. 1, 2 +Yang Song, Jascha Sohl-Dickstein, Diederik P Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. In International Conference on Learning Representations, 2021b. 1, 2, 3, 4, 13 +Charles Stein. A bound for the error in the normal approximation to the distribution of a sum of dependent random variables. In Proceedings of the sixth Berkeley symposium on mathematical statistics and probability, volume 2: Probability theory, volume 6, pp. 583-603. University of California Press, 1972. 2 +Matthew Thorpe. Introduction to optimal transport, 2018. 4, 9 +Lloyd N Trefethen. Spectral methods in MATLAB, volume 10. Siam, 2000. 15 +Cedric Villani. Optimal transportation, dissipative pde's and functional inequalities. In Optimal transportation and applications, pp. 53-89. Springer, 2003. 13 +Cédric Villani. Optimal transport: old and new, volume 338. Springer, 2009. 3, 4, 5, 9 + +# A BENAMOU-BRENIER FORMULATION OF OPTIMAL TRANSPORT + +It will be instructive to consider another formulation of the optimal transport, originating in spirit from the fluid dynamics (Benamou & Brenier, 2000; Villani, 2003). Assume that at $t = 0$ we are given a set of 'particles' from the density $\rho_0$ which move in such a way that at $t = 1$ their state is described by the density $\rho_1$ . Moreover, these particles move in such that they perform the least amount of work. Formally, they minimize the following action: + +$$ +A = \int_ {0} ^ {1} \left(\sum_ {x} | \dot {x} (t) | ^ {2}\right) d t, +$$ + +with $x$ varying in the set of particles. In the continuous limit, we obtain the following formulation (with $v_{t}$ being the velocity field): + +$$ +\left. \inf _ {\rho , v} \left\{\int_ {0} ^ {1} \int \rho_ {t} (x) | v _ {t} (x) | ^ {2} d x d t; \frac {\partial \rho_ {t}}{\partial t} + \nabla \cdot (\rho_ {t} v _ {t}) = 0 \right\} \right. \tag {16} +$$ + +where the infimum is taken over all time-dependent probability densities $\{\rho_t\}_{t=0}^1$ which agree with $\rho_0$ and $\rho_1$ at respective times $t = 0$ and $t = 1$ , and overall time-dependent velocity fields $\{v_t\}_{t=0}^1$ which convect $\rho_t$ , as expressed by the continuity equation in the right-hand side of Equation (16). + +It can be shown that the infimum in Equation (16) is given by $W_{2}(\rho_{0},\rho_{1})^{2}$ . Moreover, given an optimal transport map the corresponding admissible trajectory for the Benamou-Brenier formulation can be easily constructed. Importantly, trajectories generated by this vector field are straight lines, which does not hold for the probability flow ODE (see, e.g., Figure 1). There is no contradiction here: we do not claim that the probability flow ODE is the solution of the Benamou-Brenier problem, but only that the flow map induced by this ODE (in the limit $t\to \infty$ ) solves the Monge problem. So, in general, the vector field solving (16) and the vector field of the probability flow ODE will be different. + +# B PROOF OF THEOREM 3.1 + +The proof of Theorem 3.1 is based on the fact that in the case of $\mu_0$ being normal distribution, all the intermediate densities $\mu_t$ are normal as well, i.e., $\mu_t \sim \mathcal{N}(a(t), \Sigma(t))$ . Moreover, we can easily obtain ODEs describing how their means and covariances transform (Song et al., 2021b; Särkkä & Solin, 2019). These ODEs take the following form: + +$$ +\frac {d \Sigma (t)}{d t} = 2 (I - \Sigma (t)); \quad \frac {d a (t)}{d t} = - a (t), +$$ + +with the solutions + +$$ +\Sigma (t) = I + e ^ {- 2 t} (\Sigma (0) - I); \quad a (t) = e ^ {- t} a (0). +$$ + +Let us start with the homogeneous case $a(0) = 0$ , so $a(t) \equiv 0$ (we provide the proof of the general case below). The probability flow ODE then takes the following form: + +$$ +\frac {d x}{d t} = - (I - \Sigma^ {- 1} (t)) x. \tag {17} +$$ + +We start by noticing that all the matrices $\Sigma(t)$ commute with each other. We then can write the solution of Equation (20) as: + +$$ +x (t) = \exp \left(- \int_ {0} ^ {t} I - \Sigma^ {- 1} (\tau) d \tau\right) x (0), +$$ + +with $\exp$ being the matrix exponential. Let us consider the eigendecomposition of $\Sigma(0)$ , i.e., assume that $\Sigma(0) = U^T\Lambda U$ with $\Lambda = \mathrm{diag}(\lambda_1, \dots, \lambda_d)$ being a diagonal matrix of positive eigenvalues and $U^T U = I$ . We obtain that + +$$ +x (t) = U ^ {T} \operatorname {d i a g} \left(f \left(\lambda_ {1}, t\right), f \left(\lambda_ {2}, t\right), \dots f \left(\lambda_ {d}, t\right)\right) U x (0), \tag {18} +$$ + +where $f(\lambda, t)$ is a function defined as + +$$ +f (\lambda , t) = \exp \left(- \int_ {0} ^ {t} 1 - (1 + e ^ {- 2 \tau} (\lambda - 1)) ^ {- 1} d \tau\right), +$$ + +where now all the functions operate on real numbers. Direct integration shows that: + +$$ +\begin{array}{l} f (\lambda , t) = \exp \left(- t + \frac {1}{2} \log \left(\lambda - 1 + e ^ {2 t}\right) - \frac {1}{2} \log \lambda\right) \tag {19} \\ = \sqrt {\frac {\lambda - 1 + e ^ {2 t}}{\lambda e ^ {2 t}}} = \sqrt {\frac {e ^ {- 2 t (\lambda - 1) + 1}}{\lambda}}. \\ \end{array} +$$ + +We see that $\lim_{t\to \infty}f(\lambda ,t) = \lambda^{-1 / 2}$ . Then, by definition of the matrix square root, $E_{\mu_0}(x) = \Sigma (0)^{-1 / 2}x$ . This is exactly the optimal transport map between $\mu_0$ and $\mathcal{N}(0,I)$ . + +For a general case, we obtain the following ODE. + +$$ +\frac {d x}{d t} = - (I - \Sigma^ {- 1} (t)) x - \Sigma^ {- 1} (t) a (t). \tag {20} +$$ + +This is an inhomogeneous ODE. We can obtain its solution via the following standard approach. Let $Z(t)$ be the fundamental solution of the homogeneous part (see Equation (18)), i.e, + +$$ +Z (t) = U ^ {T} \operatorname {d i a g} (f (\lambda_ {1}, t), f (\lambda_ {2}, t), \dots f (\lambda_ {d}, t)) U, +$$ + +with + +$$ +f (\lambda , t) = \sqrt {\frac {e ^ {- 2 t} (\lambda - 1) + 1}{\lambda}}. +$$ + +We find that a particular solution (with 0 initial condition) of the inhomogeneous problem is given by: + +$$ +\bar {x} (t) = - Z (t) \int_ {0} ^ {t} Z ^ {- 1} (\tau) \Sigma^ {- 1} (\tau) a (\tau) d \tau . +$$ + +Recall that + +$$ +\Sigma (t) = I + e ^ {- 2 t} (\Sigma (0) - I); \quad a (t) = e ^ {- t} a (0). +$$ + +We obtain: + +$$ +\bar {x} (t) = \left(- Z (t) \int_ {0} ^ {t} Z ^ {- 1} (\tau) \Sigma^ {- 1} (\tau) e ^ {- \tau} d \tau\right) a (0). +$$ + +Again, it suffices to work on the level of the spectrum. I.e, + +$$ +\bar {x} (t) = U ^ {T} \operatorname {d i a g} \left(g \left(\lambda_ {1}, t\right), g \left(\lambda_ {2}, t\right), \dots , g \left(\lambda_ {d}, t\right)\right) U a (0), +$$ + +with + +$$ +\begin{array}{l} g (\lambda , t) = - f (\lambda , t) \int_ {0} ^ {t} \frac {e ^ {- \tau}}{(1 + e ^ {- 2 \tau} (\lambda - 1)) f (\lambda , \tau)} d \tau \\ = - \frac {f (\lambda , t)}{\lambda} \int_ {0} ^ {t} \frac {e ^ {- \tau}}{f ^ {3} (\lambda , \tau)} d \tau \tag {21} \\ = - \sqrt {\lambda} f (\lambda , t) \int_ {0} ^ {t} \frac {e ^ {- \tau}}{\left(e ^ {- 2 \tau} (\lambda - 1) + 1\right) ^ {3 / 2}} d \tau . \\ \end{array} +$$ + +Direct integration shows that: + +$$ +\lim _ {t \to \infty} g (\lambda , t) = - \frac {1}{\sqrt {\lambda}}. +$$ + +Thus, we obtain that + +$$ +\lim _ {t \to \infty} \bar {x} (t) = - \Sigma (0) ^ {- 1 / 2} a (0). +$$ + +By combining this piece with the limit of general solution obtained above, we find that + +$$ +E _ {\mu_ {0}} (x) = \Sigma (0) ^ {- 1 / 2} x - \Sigma (0) ^ {- 1 / 2} a (0) = \Sigma^ {- 1 / 2} (0) (x - a (0)), +$$ + +which is exactly the desired optimal transport map between $\mu_0$ and $\mathcal{N}(0,1)$ (Dowson & Landau, 1982; Olkin & Pukelsheim, 1982). This expression is also familiar from the commonly used Frechet Inception Distance metric, where the OT distance is used to evaluate generative models (Heusel et al., 2017). + +# C TENSOR-TRAIN SOLVER FOR THE FOKKER-PLANCK EQUATION + +Let us briefly summarize the algorithm from (Chertkov & Oseledets, 2021) for solving the Fokker-Planck equation. If we introduce diffusion and convection operators from Equation (8) + +$$ +\widehat {V} p (x, t) \equiv \nabla_ {x} ^ {2} p (x, t), \quad \widehat {W} p (x, t) \equiv \nabla_ {x} \left(x p (x, t)\right), +$$ + +then on each time step $m$ ( $m = 1,2,\dots,M$ ) the standard second order operator splitting technique (Glowinski et al., 2017) may be formulated + +$$ +p _ {m + 1} = e ^ {h \left(\widehat {V} + \widehat {W}\right)} p _ {m} \approx e ^ {\frac {h}{2} \widehat {V}} e ^ {h \widehat {W}} e ^ {\frac {h}{2} \widehat {V}} p _ {m}, +$$ + +where $h$ is the size of the temporal grid and $p_{m}(x) = p(x, mh)$ is a solution on the $m$ -th time step. It is equivalent to the sequential solution of the following equations + +$$ +\frac {\partial p _ {D} ^ {(1)}}{\partial t} = \nabla_ {x} ^ {2} p _ {D} ^ {(1)}, \quad p _ {D} ^ {(1)} (\cdot , t _ {m}) = \rho_ {m} (\cdot), \tag {22} +$$ + +$$ +\frac {\partial p _ {C}}{\partial t} = \nabla_ {x} \left(x p _ {C}\right), \quad p _ {C} (\cdot , t _ {m}) = p _ {C} ^ {(1)} (\cdot , t _ {m} + \frac {h}{2}), \tag {23} +$$ + +$$ +\frac {\partial p _ {D} ^ {(2)}}{\partial t} = \nabla_ {x} ^ {2} p _ {D} ^ {(2)}, \quad p _ {D} ^ {(2)} (\cdot , t _ {m}) = p _ {C} (\cdot , t _ {m} + h), \tag {24} +$$ + +with the final approximation of the solution $\rho_{m + 1}(\cdot) = p_D^{(2)}(\cdot ,t_m + \frac{h}{2})$ + +To solve the diffusion part (see Equations (22) and (24)), we discretize the Laplace operator using the second order Chebyshev differential matrices (Trefethen, 2000), and convolve the matrix exponential with the TT-cores of $p_m$ . The convection part (see Equation (23)) is solved by efficient interpolation in the TT-format with the TT-cross method (Oseledets & Tyrtyshnikov, 2010). Finally, at each time step $m$ , we obtain discrete values of the density $p(x, mh)$ , represented in the low rank TT-format as in Equation (13). Then we can solve the probability flow ODE, using these tensors, as described in the main text. \ No newline at end of file diff --git a/understandingddpmlatentcodesthroughoptimaltransport/images.zip b/understandingddpmlatentcodesthroughoptimaltransport/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..693cca65f0665af7d3e6530ae96f8377ec423ecc --- /dev/null +++ b/understandingddpmlatentcodesthroughoptimaltransport/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6159921a217a229c2b6c1cc77d196862da9083f385b9b269b4b4ceaaf15a88b7 +size 553037 diff --git a/understandingddpmlatentcodesthroughoptimaltransport/layout.json b/understandingddpmlatentcodesthroughoptimaltransport/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..0fd0925e507102fcd57d193268e54b012af16e5a --- /dev/null +++ b/understandingddpmlatentcodesthroughoptimaltransport/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8573c89fa2b6bbf6fbf668cdb05972181003d34cd809f6ddca34a98c734a0721 +size 549387 diff --git a/understandingedgeofstabilitytrainingdynamicswithaminimalistexample/efab9929-a1a3-49e0-9e92-036b893c011f_content_list.json b/understandingedgeofstabilitytrainingdynamicswithaminimalistexample/efab9929-a1a3-49e0-9e92-036b893c011f_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..2dceb7f1606178a2f8b7089315315d2a93972cdd --- /dev/null +++ b/understandingedgeofstabilitytrainingdynamicswithaminimalistexample/efab9929-a1a3-49e0-9e92-036b893c011f_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa4fb3c3ed9bb2763a7fa67bd6f6e7b68fd5c43a6e54581b0f067d5ddc940f80 +size 473728 diff --git a/understandingedgeofstabilitytrainingdynamicswithaminimalistexample/efab9929-a1a3-49e0-9e92-036b893c011f_model.json b/understandingedgeofstabilitytrainingdynamicswithaminimalistexample/efab9929-a1a3-49e0-9e92-036b893c011f_model.json new file mode 100644 index 0000000000000000000000000000000000000000..de659c7766d59e76fac44b2adfc7769195a72073 --- /dev/null +++ b/understandingedgeofstabilitytrainingdynamicswithaminimalistexample/efab9929-a1a3-49e0-9e92-036b893c011f_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:982947a606c0c1216453dec6edc6617921cc67bab2e3644331e755befa7948ca +size 540348 diff --git a/understandingedgeofstabilitytrainingdynamicswithaminimalistexample/efab9929-a1a3-49e0-9e92-036b893c011f_origin.pdf b/understandingedgeofstabilitytrainingdynamicswithaminimalistexample/efab9929-a1a3-49e0-9e92-036b893c011f_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c045989ce9f099e5fb43e6c3d4dca4ee6a006896 --- /dev/null +++ b/understandingedgeofstabilitytrainingdynamicswithaminimalistexample/efab9929-a1a3-49e0-9e92-036b893c011f_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:04e5927a2f8111a11e616bda94b14bdd814b975de9e141bde472f0029848f17a +size 6293448 diff --git a/understandingedgeofstabilitytrainingdynamicswithaminimalistexample/full.md b/understandingedgeofstabilitytrainingdynamicswithaminimalistexample/full.md new file mode 100644 index 0000000000000000000000000000000000000000..e4a55a888b17c68d915bc173cafe258bea77426a --- /dev/null +++ b/understandingedgeofstabilitytrainingdynamicswithaminimalistexample/full.md @@ -0,0 +1,2441 @@ +# UNDERSTANDING EDGE-OF-STABILITY TRAINING DYNAMICS WITH A MINIMALIST EXAMPLE + +Xingyu Zhu\*1, Zixuan Wang\*2, Xiang Wang1, Mo Zhou1, Rong Ge1 + +$^{1}$ Duke University, $^{2}$ Tsinghua University + +{xingyu.zhu,zw270}@duke.edu,{xwang,mozhou,rongge}@cs.duke.edu + +# ABSTRACT + +Recently, researchers observed that gradient descent for deep neural networks operates in an "edge-of-stability" (EoS) regime: the sharpness (maximum eigenvalue of the Hessian) is often larger than stability threshold $2 / \eta$ (where $\eta$ is the step size). Despite this, the loss oscillates and converges in the long run, and the sharpness at the end is just slightly below $2 / \eta$ . While many other well-understood nonconvex objectives such as matrix factorization or two-layer networks can also converge despite large sharpness, there is often a larger gap between sharpness of the endpoint and $2 / \eta$ . In this paper, we study EoS phenomenon by constructing a simple function that has the same behavior. We give rigorous analysis for its training dynamics in a large local region and explain why the final converging point has sharpness close to $2 / \eta$ . Globally we observe that the training dynamics for our example have an interesting bifurcating behavior, which was also observed in the training of neural nets. + +# 1 INTRODUCTION + +Many works tried to understand how simple gradient-based methods can optimize complicated neural network objectives. However, recently some empirical observations show that optimization for deep neural networks may operate in a more surprising regime. In particular, Cohen et al. (2021) observed that when running gradient descent on neural networks with a fixed step-size $\eta$ , the sharpness (largest eigenvalue of the Hessian) of the training trajectory often oscillates around the stability threshold of $2 / \eta^1$ , while the loss still continues to decrease in the long run. This phenomenon is called "edge-of-stability" and has received a lot of attention (see Section 1.2 for related works). + +While many works try to understand why (variants of) gradient descent can still converge despite that the sharpness is larger than $2 / \eta$ , empirically gradient descent for deep neural networks has even stronger properties. As shown in Fig. 1a, for a fixed initialization, if one changes the step size $\eta$ , the final converging point has sharpness very close to the corresponding $2 / \eta$ . We call this phenomenon "sharpness adaptivity". Another perspective on the same phenomenon is that for a wide range of initializations, for a fixed step-size $\eta$ , their final converging points all have sharpness very close to $2 / \eta$ . We call this phenomenon "sharpness concentration". + +Surprisingly, both sharpness adaptivity and sharpness concentration happen on deeper networks, while for shallower models of non-convex optimization such as matrix factorization or 2-layer neural networks, the gap between sharpness and $2 / \eta$ is often much larger (see Fig. 1b). This suggests that these phenomena are related to network depth. What is the mechanism for sharpness adaptivity and concentration, and how does that relate to the number of layers? To answer these questions, in this paper we consider a minimalist example of edge-of-stability. + +More specifically, we construct an objective function (4-layer scalar network with coupling entries), such that gradient descent on this objective has similar empirical behavior as deeper networks. We give a rigorous analysis for the training dynamics of this objective function in a large local region, which proves that the dynamics satisfy both sharpness adaptivity and sharpness concentration. The global training dynamics for our objective exhibit a complicated fractal behavior (which is also why our rigorous results are local), and such behavior has been observed in training of neural networks. + +![](images/52a736fa7e7183244d4d5f46650d606e825fc6e426ebab24900159454b9f599e.jpg) +(a) ReLU 5-layer FC network with 50 neurons per layer. $(\lambda \approx 2 / \eta)$ + +![](images/826a06df0059a5f73a23c51bb2e6d020cde926b9a08837c270c6a74fcae5215c.jpg) +(b) Linear 2-layer FC network with 10 neurons per layer $(\lambda < 2 / \eta)$ + +![](images/a4bbd7738a9ac1e575a2d2eb63e86c897c8af52cb32c9973f999081ec6aa7532.jpg) +(c) 4-layer scalar network. $(\lambda \approx 2 / \eta)$ +Figure 1: EoS Phenomena in NN Training. We consider three models including a 5-layer ReLU activated fully connected network, a 2-layer fully connected linear network with asymmetric initialization factor (4,0.1) (see Appendix A.1 for explanation), and a 4-layer scalar network equivalent to $\min_{x,y}\frac{1}{4}(1 - x^2y^2)^2$ . For each model we run gradient descent from the same initialization using different learning rates. For (a) and (c), the sharpness converges very close to $2/\eta$ with loss continuing to decrease. For (b), the sharpness decreases to be significantly lower than $2/\eta$ . + +# 1.1 OUR RESULTS + +The objective function we consider is very simple: $\mathcal{L}(x,y,z,w) \triangleq \frac{1}{2} (1 - xyzw)^2$ . One can view this as a 4-layer scalar network (each layer has a single neuron). We even couple the initialization so that $x = z, y = w$ so effectively it becomes an objective on two variables $\mathcal{L}(x,y) \triangleq \frac{1}{4} (1 - x^2y^2)^2$ . For this objective function we prove its convergence and sharpness concentration properties: + +Theorem 1.1 (Sharpness Concentration, Informal). For any learning rate $\eta$ smaller than some constant, there is a constant size region $\mathbb{S}_{\eta}$ such that the GD trajectory with step size $\eta$ from all initializations in $\mathbb{S}_{\eta}$ converge to a global minimum with sharpness within $(2 / \eta -\frac{20}{3}\eta ,2 / \eta)$ . + +As a direct corollary, we can also prove that it has the sharpness adaptivity property. + +Corollary 1.1 (Sharpness Adaptivity, Informal). There exists a constant size region $\mathbb{S}$ and a corresponding range of step sizes $\mathbb{K}$ that for all $\eta \in \mathbb{K}$ , the GD trajectory with step size $\eta$ from any initialization in $\mathbb{S}$ converges to a global minimum with sharpness within $(2 / \eta -\frac{20}{3}\eta ,2 / \eta)$ . + +The training dynamics are illustrated in Fig. 2. To analyze the training dynamics, we reparametrize the objective function and show that the 2-step dynamics of gradient descent roughly follow a parabola trajectory. The extreme point of this parabola is the final converging point which has sharpness very close to $2 / \eta$ . Intuitively, the parabola trajectory comes from a cubic term in the approximation of the training dynamics (see Section 3.1 for detailed discussions). We can also extend our result to a setting where $x, y$ are replaced by vectors, see Theorem 3.2 in Section 3.3. + +In Section 4 we explain the difference between the dynamics of our degree-4 model with degree-2 models (which are more similar to matrix factorizations or 2-layer neural networks). We show that the dynamics for degree-2 models do not have the higher order terms, and their trajectories form an ellipse instead of a parabola. + +In Section 5 we show why it is difficult to extend Theorem 3.1 to global convergence – the training trajectory exhibits fractal behavior globally. Such behaviors can be qualitatively approximated by simple low-degree nonlinear dynamics standard in chaos theory, but are still very difficult to analyze. + +Finally, in Section 6 we present the similarity between our minimalist model and the GD trajectory of some over-parameterized deep neural networks trained on a real-world dataset. Toward the end of convergence, the trajectory of the deep networks mostly lies on a 2-dimensional subspace and can be well characterized by a parabola as in the scalar case. + +# 1.2 RELATED WORKS + +The phenomenon of gradient descent on the Edge of Stability (EoS) was first formalized and empirically demonstrated in Cohen et al. (2021). They show that the loss can non-monotonically decrease even when the sharpness $\lambda > 2 / \eta$ . The non-monotone property of the loss has also been observed in many other settings (Jastrzebski et al., 2020; Xing et al., 2018; Lewkowycz et al., 2020; Wang et al., 2022; Arora et al., 2018; Li et al., 2022a). + +Recently several works try to understand the mechanism behind EoS with different loss functions under various assumptions (Ahn et al., 2022; Ma et al., 2022; Arora et al., 2022; Lyu et al., 2022; Li et al., 2022b). Ahn et al. (2022) studied the non-monotonic decreasing behavior of gradient descent (which they call unstable convergence) and discussed the possible causes of this phenomenon. From a landscape perspective, Ma et al. (2022) defined a special subquadratic property of the loss function, and proved that EoS occurs based on this assumption. Despite the simplicity, their model displayed the EoS phenomenon without sharpness adaptivity. Instead, our model focuses on a minimalist scalar network and proves the convergence results together with the sharpness adaptive phenomenon. + +Arora et al. (2022) and Lyu et al. (2022) studied the implicit bias on the sharpness of gradient descent in some general loss function. Both works focus on the regime where the parameter is close to the manifold of minimum loss. Arora et al. (2022) proved that with a modified loss $\sqrt{L}$ or using normalized GD, gradient descent enters the EoS regime and has a sharpness reduction effect around the manifold of minima. Lyu et al. (2022) provably showed how GD enters EoS regime and keeps reducing spherical sharpness on a scale-invariant objective. In both works, the effective step-size $\eta$ changes throughout the training process, so sharpness adaptivity and concentration do not apply. Our results start from a simpler example without normalization, whereas the above works focus on general functions with normalized gradient or scale-invariance property. + +Another line of works (Lewkowycz et al., 2020; Wang et al., 2022) focuses on the implicit bias introduced by a large learning rate. Lewkowycz et al. (2020) first proposed "catapult phase", a regime similar to the EoS, where loss does not diverge even if sharpness is larger than $2 / \eta$ . Wang et al. (2022) provided a convergence analysis on the matrix factorization problem for large learning rate beyond $2 / \lambda$ where $\lambda$ is the sharpness. Their results include two stages: in the first phase, the loss may oscillate but never diverge; the sharpness decreases to enter the second phase, where the loss decreases monotonically. Recently Li et al. (2022b) provided a theoretical analysis on sharpness along the GD trajectory in a two-layer linear network setting under some assumptions during the training process. These works mostly focus on the degree-2 setting which does not have the sharpness adaptivity and sharpness concentration properties. + +# 2 PRELIMINARIES AND NOTATIONS + +In this section, we introduce the minimalist model which exhibits both sharpness adaptivity and sharpness concentration. + +# 2.1 GRADIENT DESCENT ON PRODUCT OF 4 SCALAR + +We focus on the simple objective $\mathcal{L}(x,y,z,w)\triangleq \frac{1}{2} (1 - xyzw)^2$ . Let the learnable parameters $x,y,z,w\in \mathbb{R}$ to be trained using gradient descent with a fixed step size $\eta \in \mathbb{R}^+$ that + +$$ +\left(x _ {t + 1}, y _ {t + 1}, z _ {t + 1}, w _ {t + 1}\right) = \left(x _ {t}, y _ {t}, z _ {t}, w _ {t}\right) - \eta \nabla \mathcal {L} \left(x _ {t}, y _ {t}, z _ {t}, w _ {t}\right). \tag {1} +$$ + +Here $x_{t}$ denotes the value of parameter $x$ after the $t$ -th update. To further simplify the problem, we consider the symmetric initialization of $z_{0} = x_{0}$ , $w_{0} = y_{0}$ . Note that due to symmetry of objective, the identical entries will remain identical throughout the training process, so the training dynamics reduces to two dimensional and the 1-step update of $x$ and $y$ follows + +$$ +x _ {t + 1} = x _ {t} - x _ {t} y _ {t} ^ {2} \eta \left(x _ {t} ^ {2} y _ {t} ^ {2} - 1\right), \quad y _ {t + 1} = y _ {t} - x _ {t} ^ {2} y _ {t} \eta \left(x _ {t} ^ {2} y _ {t} ^ {2} - 1\right). \tag {2} +$$ + +It's easy to show that the set of global minima for this function form the hyperbola $xy = 1$ . Without loss of generality we focus on the case when $x, y > 0$ , and in most of the analysis we also focus on the side where $x > y$ . As shown in Fig. 2, with GD running on such a minimal model, we observe convergence on EoS for a wide range of initializations. Eventually all such trajectories converge to minima that are just slightly flatter than the "EoS minima" (the minima whose sharpness is exactly $2 / \eta$ , see Definition 1). + +![](images/9cbc54199d958d4905451c3e4b51a2b217c5d350121548e275f3f0b5c6cc4092.jpg) +(a) Evolution of training loss, sharpness, and trajectory of GD on the 4 scalar example from the same initialization with different learning rates. + +![](images/3a56ba41297e4035ad9515e42869a82d79c33c5ef4b9b36e58f6b3abc5a887cc.jpg) + +![](images/73f27142a910deb3893ca88a9096edc265cfd809e9e88497fca2a8ebed2a6d79.jpg) +(b) Initializations converging close to $\lambda = 2 / \eta$ ( $\eta = 0.2$ ) +Figure 2: EoS phenomenon on degree-4 model. In (a) we demonstrate sharpness adaptivity by running GD with learning rate $\eta = \frac{2}{8}, \frac{2}{10}, \frac{2}{12}$ from the same initialization. The sharpness of all trajectories converges to around their corresponding stability threshold $2 / \eta$ while the loss decreases exponentially. In the 2D trajectory, the 2-step movement quickly converges to some smooth curves ending very close to the EoS minimum. In (b) we demonstrate sharpness concentration by running GD with constant learning rate $\eta = 0.2$ for 50000 iterations from a dense grid of initializations and plot the sharpness of their converging minima. Initializations in the red shaded area all converge to a minima with sharpness in $(2 / \eta - 0.1, 2 / \eta)$ . + +# 2.2 EOS MINIMA AND REPARAMETERIZATION + +Given that a wide range of initializations all converge very close to the "EoS minima" with sharpness $2 / \eta$ , we want to concretely characterize those points. The complete calculations are deferred to Appendix B.1. Denote $\gamma = xy$ , the Hessian of the objective $\mathcal{L}$ at $(x,x,y,y)$ admits eigenvalues + +$$ +\lambda_ {1} = \frac {1}{2} \left(\left(x ^ {2} + y ^ {2}\right) \left(3 \gamma^ {2} - 1\right) + \sqrt {\left(x ^ {2} + y ^ {2}\right) ^ {2} \left(1 - 3 \gamma^ {2}\right) ^ {2} + 4 \gamma^ {2} \left(3 - 1 0 \gamma^ {2} + 7 \gamma^ {4}\right)}\right), +$$ + +$$ +\lambda_ {2} = \frac {1}{2} \left(\left(x ^ {2} + y ^ {2}\right) \left(3 \gamma^ {2} - 1\right) - \sqrt {\left(x ^ {2} + y ^ {2}\right) ^ {2} \left(1 - 3 \gamma^ {2}\right) ^ {2} + 4 \gamma^ {2} \left(3 - 1 0 \gamma^ {2} + 7 \gamma^ {4}\right)}\right). \tag {3} +$$ + +and $\lambda_3 = x^2 (1 - \gamma),\lambda_4 = y^2 (1 - \gamma)$ . When $(x,y)$ converges to any minimum, $\gamma = xy = 1$ , so $\lambda_{2},\lambda_{3},\lambda_{4}$ all vanishes. Therefore it is $\lambda_{1}$ that corresponds to the EoS phenomenon people observe. When $\eta < \frac{1}{2}$ , solving $\lambda_{1} = 2 / \eta$ with $x^{2}y^{2} = 1$ gives $x = \pm \frac{1}{\sqrt{2}} ((-4 + \eta^{-2})^{\frac{1}{2}} + \eta^{-1})^{\frac{1}{2}}$ , $y = \pm \sqrt{2} ((-4 + \eta^{-2})^{\frac{1}{2}} + \eta^{-1})^{-\frac{1}{2}}$ and their multiplicative inverses. These solutions correspond to the minima with sharpness exactly equal to the EoS threshold of $2 / \eta$ . Since they are all symmetric with each other, without loss of generality we pick the minimum of interest as follows. + +Definition 1 ( $\eta$ -EoS Minimum). For any step size $\eta \in (0, \frac{1}{2})$ , the $\eta$ -EoS minimum under the $(x, y)$ -parameterization is + +$$ +(\check {x}, \check {y}) \triangleq \left(\frac {1}{\sqrt {2}} \left((- 4 + \eta^ {- 2}) ^ {\frac {1}{2}} + \eta^ {- 1}\right) ^ {\frac {1}{2}}, \sqrt {2} \left((- 4 + \eta^ {- 2}) ^ {\frac {1}{2}} + \eta^ {- 1}\right) ^ {- \frac {1}{2}}\right). \tag {4} +$$ + +Though we are able to obtain a closed-form expression for the EoS minimum, its $x - y$ coordinate could still be tricky to analyze. Thus we consider the following reparameterization: For any $(x,y)\in \{(x,y)\in \mathbb{R}^{+}\times \mathbb{R}^{+}:x > y\}$ , define $c\triangleq (x^2 -y^2)^{\frac{1}{2}}$ and $d\triangleq xy$ . This gives a bijective continuous mapping between $\{(x,y)\in \mathbb{R}^{+}\times \mathbb{R}^{+}:x > y\}$ and $\{(c,d)\in \mathbb{R}^{+}\times \mathbb{R}^{+}\}$ . This is a natural reparameterization since intuitively the basis in the new coordinate system are the two orthogonal family of hyperbolas $xy = C$ and $x^{2} - y^{2} = C$ . The former captures the movement orthogonal to the manifold of minima $xy = 1$ while the latter captures the movement along the manifold of minima. Note that a similar separation of dynamics was also used in Arora et al. (2022). + +With $c, d$ as defined, the $\eta$ -EoS minimum simplifies to $(\check{c}, \check{d}) \triangleq ((\eta^{-2} - 4)^{\frac{1}{4}}, 1)$ . To expand the dynamics near the $\eta$ -EoS minimum, we let $a \triangleq c - (\eta^{-2} - 4)^{\frac{1}{4}}$ and $b \triangleq d - 1$ to be the offset from $(\check{c}, \check{d})$ . Our analysis will primarily be using the $(a, b)$ -parameterization. + +Definition 2 ( $\eta$ -EoS Reparameterization). For any step size $\eta > 0$ , for any $(x, y) \in \mathbb{R}^{+} \times \mathbb{R}^{+}$ such that $x > y$ , the $(a, b)$ reparameterization of $(x, y)$ are respectively given by + +$$ +(a, b) \triangleq \left(\left(x ^ {2} - y ^ {2}\right) ^ {\frac {1}{2}} - \left(\eta^ {- 2} - 4\right) ^ {\frac {1}{4}}, x y - 1\right). \tag {5} +$$ + +Let $\kappa \triangleq \sqrt{\eta}$ , following Eq. (2), the 1-step update under the reparameterization becomes + +$$ +\begin{array}{l} a _ {t + 1} = (\kappa^ {- 4} - 4) ^ {\frac {1}{4}} + \left(a _ {t} + (\kappa^ {- 4} - 4) ^ {\frac {1}{4}}\right) \left(1 - \left((1 + b _ {t}) ^ {3} - (1 + b _ {t})\right) ^ {2} \kappa^ {4}\right) ^ {\frac {1}{2}}, \\ b _ {t + 1} = b _ {t} + \left(\left(1 + b _ {t}\right) ^ {3} - 2 \left(1 + b _ {t}\right) ^ {5} + \left(1 + b _ {t}\right) ^ {7}\right) \kappa^ {4} \tag {6} \\ + \left((1 + b _ {t}) - (1 + b _ {t}) ^ {3}\right) \left(4 (1 + b _ {t}) ^ {2} \kappa^ {4} + (a _ {t} \kappa + (1 - 4 \kappa^ {4}) ^ {\frac {1}{4}}) ^ {4}\right) ^ {\frac {1}{2}}. \\ \end{array} +$$ + +Now we can proceed to analyze the dynamics of this simple example. + +# 3 DYNAMICS OF GRADIENT DESCENT ON DEGREE-4 MODEL + +In this section, we will rigorously analyze the training dynamics characterized by Eq. (6). First we will introduce the approximation of one and two-step update and build up intuition on the dynamics. Then we will present our main theoretical results that the degree-4 model exhibits both characterizations of EoS training. + +# 3.1 APPROXIMATING 1-STEP AND 2-STEP UPDATES + +Here we introduce the informal approximation on Eq. (6) and the corresponding two-step updates. For cleanness of presentation we will use $\approx$ to hide all dominated terms. The rigorous statements of the approximations and corresponding proofs are deferred to Appendix B.3. When we are only describing the one/two-step dynamics, we use $a, a', a''$ to denote $a_t, a_{t+1}, a_{t+2}$ and $b, b', b''$ to denote $b_t, b_{t+1}, b_{t+2}$ . Denoting $\kappa \triangleq \sqrt{\eta}$ , when $\kappa, |a|, |b|$ are all not too large (see precise ranges in condition B.1), we have + +$$ +a ^ {\prime} \approx a - 2 b ^ {2} \kappa^ {3}, \quad b ^ {\prime} \approx - b - 4 a b \kappa - 3 b ^ {2} - b ^ {3}; +$$ + +$$ +a ^ {\prime \prime} \approx a - 4 b ^ {2} \kappa^ {3}, \quad b ^ {\prime \prime} \approx b + 8 a b \kappa - 1 6 b ^ {3}. \tag {7} +$$ + +In the approximation, $a$ is monotonically decreasing at a steady rate of $2b^{3}\kappa^{3}$ per step. The one-step update of $b$ is flipping signs and contains second and third order terms of $b$ . For the two-step approximation however, the oscillation behavior and the even-order terms of $b$ all cancel. This is consistent with the analysis in (Arora et al., 2022) that the two step dynamics travels along a sharpness reducing flow. + +Before proceeding to analyze the discrete GD movement, we first get intuition by approximating the two-step dynamics with a simple ODE + +$$ +\frac {\mathrm {d} b}{\mathrm {d} a} = \frac {b ^ {\prime \prime} - b}{a ^ {\prime \prime} - a} = \frac {1 6 b ^ {3} - 8 a b \kappa}{4 b ^ {2} \kappa^ {3}}. \tag {8} +$$ + +This would be the limit when $\kappa$ is going to 0 and the movement of two-step dynamics become very small. The general solution for Eq. (8) is given by + +$$ +b ^ {2} = \frac {1}{2} a \kappa + \frac {1}{1 6} \kappa^ {4} + C \exp (8 a \kappa^ {- 3}) \tag {9} +$$ + +for some constant $C \in \mathbb{R}$ . As $a$ decreases following Eq. (7), the trajectory converges toward the parabola $b^2 = \frac{1}{2} a\kappa + \frac{1}{16}\kappa^4$ . Note that the convergence to the parabola is exponential with respect to $a$ , so if $a$ is initialized positive and not too small, it will converge to a minima that is very close to $a = -\frac{1}{8}\kappa^3$ as shown in Fig. 3. This is a minimum that is just slightly flatter than the $\kappa^2$ -EoS minimum. + +![](images/8f600d6c45ebee1fc8b0fbba256a7c02d4592dd1ed97b2b98e185161424138bf.jpg) +Figure 3: Solutions of Eq. (8) ( $\kappa = 1$ ) + +# 3.2 CONVERGENCE ON EOS FOR THE DEGREE-4 MODEL + +Now we state our convergence result on the 4 scalar objective under $(a,b)$ -parameterization. + +Theorem 3.1 (Sharpness Concentration). For a large enough absolute constant $K$ , suppose $\kappa < \frac{1}{2000\sqrt{2}} K^{-1}$ , and the initialization $(a_0, b_0)$ satisfies $a_0 \in (12\kappa^{\frac{5}{2}}, \frac{1}{4} K^{-2}\kappa^{-1})$ and $b_0 \in (-K^{-1}, K^{-1}) \setminus \{0\}$ . Consider the GD trajectory characterized in Eq. (6) with fixed step size $\kappa^2$ from $(a_0, b_0)$ , for any $\epsilon > 0$ there exists $T = \mathcal{O}(K^{-2}\kappa^{-\frac{15}{2}} + \log(\epsilon^{-1}) + \log(|b_0|^{-1})\kappa^{-\frac{7}{2}})$ such that for all $t > T$ , $|b_t| < \epsilon$ and $a_t \in (-\frac{5}{3}\kappa^3, -\frac{1}{10}\kappa^3)$ . + +Under the context of $x, y$ coordinate and sharpness, Theorem 3.1 gives the following corollary: + +Corollary 3.1 (Sharpness Concentration under $(x,y)$ -Parameterization). For a large enough absolute constant $K$ , suppose $\eta < \frac{1}{800000} K^{-2}$ , and the initialization $(x_0,y_0)$ satisfies $x_0 \in (\check{x} + 13\eta^{\frac{5}{4}}, \check{x} + \frac{1}{5} K^{-2}\eta^{-\frac{1}{2}})$ and $|x_0y_0 - 1| \in (0, K^{-1})$ where $(\check{x}, \check{y})$ is the $\eta$ -EoS minima defined in Definition 1. The GD trajectory characterized in Eq. (2) with fixed step size $\eta$ from $(x_0,y_0)$ will converge to a global minimum with sharpness $\lambda \in (\frac{2}{\eta} - \frac{20}{3}\eta, \frac{2}{\eta})$ . + +Note that when the step size $\eta$ (and hence $\kappa$ ) is relatively small, the final sharpness is very close to $2 / \eta$ . The range of initialization that satisfies the requirement is quite large: in the original $(x,y)$ -parameterization it contains a box of width $\Theta(K^{-2}\eta^{-\frac{1}{2}})$ and height $\Theta(K^{-1}\eta^{\frac{1}{2}})$ . Many of the initial points can be far from the EoS-minimum. + +The complete proofs are deferred to Appendix B.6. Here we discuss the proof sketch of Theorem 3.1. Our convergence analysis focuses on the 2-step update. It contains two phases: + +# Phase 1. (Convergence to near parabola) + +We consider initializations in region I, II, and III. + +- In I, $b'' - b$ is dominated by $-b^3$ and $(a, b)$ follows an exponential trajectory. We show that $|b|$ decreases exponentially with respect to $a$ and enters region II (Lemma 8). +- In III, $b'' - b$ is dominated by $ab\kappa$ and $(a,b)$ follows an elliptic trajectory centered at $(0,0)$ . We show that $|b|$ increases at superlinearly with respect to $a$ and enters II (Lemma 9). +- We also show that once $(a, b)$ enters II, it will stay in II until it exits from the left and enters IV (Lemma 11). Thus after Phase 1, all initializations will be in IV. + +# Phase 2. (Convergence along parabola) + +- After $(a, b)$ enters IV, we show that it will further converge to the parabola that $|b^2 - \frac{1}{2} a\kappa - \frac{1}{16}\kappa^4| < \frac{1}{200}\kappa^4$ will be satisfied before $a$ decreases to $\kappa^{\frac{5}{2}}$ and enters V (Lemma 13). +- Then we show that the inequality will be preserved in V while it moves left until it enters VI (Lemma 14). +- In VI, the dynamics is again similar to III, but with $a$ being negative. We conclude our proof by showing $|b|$ will converge to 0 superlinearly with respect to $a$ (Lemma 15). + +![](images/be754e30b391d37e8c6964b015dad9c4723e8abe0af045e63daa893fa6ebe796.jpg) +Figure 4: Convergence Diagram for GD on the degree-4 example. The quiver arrows indicate the directions of local 2-step movement. This diagram is only for demonstration purpose and ratios are not exact. + +Following Theorem 3.1, we can also formally characterize the sharpness adaptive phenomenon for a local region using the following corollary. The proof is deferred to Appendix B.6.2. + +Corollary 3.2 (Sharpness Adaptivity). For a large enough constant $K$ , fix any $\alpha < \frac{1}{2000\sqrt{2}} K^{-1}$ . + +For all initialization $(x_0,y_0)$ in the region characterized by + +$$ +x _ {0} \in \left(\alpha^ {- 1} + \frac {1}{1 5} K ^ {- 2} \alpha^ {- 1}, \alpha^ {- 1} + \frac {1}{6} K ^ {- 2} \alpha^ {- 1}\right) \tag {10} +$$ + +and $|x_0y_0 - 1| \in (0, K^{-1})$ , the $GD$ trajectory from $(x_0, y_0)$ characterized by Eq. (2) with any step size $\eta \in (\alpha^2 - \frac{1}{10}K^{-2}\alpha^2, \alpha^2)$ will converge to a minima with sharpness $\lambda \in (\frac{2}{\eta} - \frac{20}{3}\eta, \frac{2}{\eta})$ . + +# 3.3 CONVERGENCE ON EOS FOR RANK-1 FACTORIZATION OF ISOTROPIC MATRIX + +Inspired by the scalar factorization problem, we extend it to a rank-1 factorization of an isotropic matrix. In particular, we consider the following optimization problem: + +$$ +\min _ {\boldsymbol {x}, \boldsymbol {y} \in \mathbb {R} ^ {d}} \frac {1}{4} \left\| \boldsymbol {I} _ {d \times d} - \boldsymbol {x} \boldsymbol {y} ^ {\top} \boldsymbol {x} \boldsymbol {y} ^ {\top} \right\| _ {\mathrm {F}} ^ {2} \tag {11} +$$ + +Similar to the under-parameterized case in Wang et al. (2022), this problem also guarantees the alignment between $\mathbf{x}$ and $\mathbf{y}$ if $(\mathbf{x},\mathbf{y})$ is a global minimum, i.e., $\mathbf{x} = c\mathbf{y}$ for some $c\in \mathbb{R}$ . To prove the convergence for Eq. (11) at the edge of stability, we first prove the alignment can be soon achieved. After the alignment, we prove the equivalence between this problem and the degree-4 scalar model, and prove the convergence of this problem. + +We directly give the final theorem and the proof is deferred to Appendix C. The experiments demonstrate similar EoS phenomenon (See Appendix A.5). + +Theorem 3.2. For a large enough absolute constant $K$ , with all the initialization $(\pmb{x}_0, \pmb{y}_0)$ satisfying $\pmb{x}_0 \sim \delta_xUnif(\mathbb{S}^{d-1})$ , $\pmb{y}_0 \sim \delta_yUnif(\mathbb{S}^{d-1})^2$ , $\delta_x\delta_y = \frac{1}{2}$ , $\delta_x \in (\check{x} + \frac{1}{80} K^{-2}\eta^{-\frac{1}{2}}, \check{x} + \frac{1}{8} K^{-2}\eta^{-\frac{1}{2}})$ , if step size $\eta < \min\{\frac{K^{-4}}{8000000}, \frac{K^{-2}}{20000 + 2000(\log(d) - \log(\delta_0))}\}$ , and a multiplicative perturbation $\pmb{y}_t' = \pmb{y}_t(1 + 2K^{-1})$ is performed at time $t = t_p$ for some $t_p > \mathcal{O}(-\log(\eta) + \log(d) - \log(\delta_0) + K^3)$ , then for any $\epsilon > 0$ , with probability $p > 1 - 2\delta_0 - 2\exp\{-\Omega(d)\}$ there exists $T = \mathcal{O}(K^{-2}\kappa^{-\frac{15}{2}} - \log(\epsilon) - \log(\delta_0))$ such that for all $t > T$ , $\mathcal{L}(x,y) < \epsilon$ and $\|x_t\|^2 + \|y_t\|^2 \in (\frac{1}{\eta} - \frac{10}{3}\eta, \frac{1}{\eta})$ . + +Note that we require an additional perturbation because we need to guarantee that the trajectory does not converge to an unstable point (where sharpness $\lambda > 2 / \eta$ ). This was proved without perturbation for the scalar case but is more challenging in higher dimensions. The objective will still converge to a minimum very close to an $\eta$ -EoS minimum. The experiment results are available in Appendix A.5. + +# 4 DIFFERENCES IN DEGREE-2 AND HIGHER DEGREE MODELS + +In this section, we will look at some similar models of lower degree, and explain why for degree-2 models the sharpness of final converging point is often farther from $2 / \eta$ compared to higher degree models. We will use similar methods as in Section 2 and Section 3 to gain intuition for the dynamics. + +Previous works including (Chen & Bruna, 2022) and (Wang et al., 2022) have studied the dynamics of beyond EoS training on the problem of factorizing a single scalar or an isotropic matrix into two components. The objectives studied include $\min_{\boldsymbol{x},\boldsymbol{y}\in \mathbb{R}^d}(\mu -\boldsymbol{x}^\top \boldsymbol{y})^2,\min_{\boldsymbol{x},\boldsymbol{y}\in \mathbb{R}^d}\| \mu \boldsymbol{I}_d - \boldsymbol{x}\boldsymbol{y}^\top \| _F^2$ and the corresponding scalar case $\min_{x,y\in \mathbb{R}}(\mu -xy)^2$ . They were able to show that for initializations with sharpness greater than $2 / \eta$ , GD with constant learning rate $\eta$ provably converges to a global minimum with sharpness less or equal to $2 / \eta$ . Empirically, the sharpness reduction process on these 2-component objectives will usually "overshoot" the EoS threshold and converge to a minima that is significantly flatter than the EoS minimum, and one does not observe the oscillation of sharpness around the EoS threshold (see Appendix A.3). + +In this section we consider the scalar objective $\min_{x,y\in \mathbb{R}}(1 - xy)^2$ since it is able to captures the major dynamical properties of those more complex objectives as discussed in Wang et al. (2022). As shown in Fig. 5, initializations with sharpness exceeding the EoS threshold will converge to a minima that is distinguishably flatter than the EoS minimum, and globally there is not a region of initialization that gives EoS convergence. Unlike the parabola for the degree-4 case, the 2-step update travels in a roughly circular trajectory centered at the $\kappa^2$ -EoS minimum as shown in Fig. 5a (right). Therefore locally we observe that sharper initializations tend to converge to flatter minima. + +The difference between the degree-2 and degree-4 case can be easily explained by a local expansion. Using the same $(c,d)$ -reparameterization and setting $(a,b)$ to be the offset of $(c,d)$ from the EoS minimum, the two step update of $(a,b)$ under learning rate $\kappa^2$ can be approximated by + +$$ +a ^ {\prime \prime} \approx a - \sqrt {2} b ^ {2} \kappa^ {3}, \quad b ^ {\prime \prime} \approx b + 4 \sqrt {2} a b \kappa . \tag {12} +$$ + +This is very similar to Eq. (7) except that we no longer have the $-b^{3}$ term for the 2-step update on $b$ which was attracting $b$ close to 0. In this case, the ODE approximation $\mathrm{db} / \mathrm{da} = 4a / b\kappa^2$ gives the general solution $b^{2} = 4(C - a^{2}) / \kappa^{2}$ for $C\in \mathbb{R}^{+}$ , which corresponds to the family of ellipses centered at $(0,0)$ and matches the two step trajectory in Fig. 5a. + +![](images/71b0b660077639962d4f9ddafe83fef50e755a648b3278c730bf45ceade36f5a.jpg) +(a) Evolution of training loss, sharpness, and trajectory of GD on the 2 scalar example from the same initialization with different learning rates. + +![](images/4aa61efa7d49a7541c77154171d0bcb4b4214dc93f08e1dc8ceebd6b70d5d773.jpg) + +![](images/fe160b91d5138deb5ccddf8021a056120cccbd902da4a1eeb201fdd229abc0fa.jpg) +(b) Converging sharpness of initializations $(\eta = 0.2)$ +Figure 5: Beyond EoS training on product of two scalars. We run the same experiment as in Fig. 2 except for using objective $\min_{x,y\in \mathbb{R}}(1 - xy)^2$ . Note that in this case the two-step trajectories form circular curves and converge to points that are farther from EoS minima. + +In Appendix A.2.3, we discuss a degree-3 model exhibiting mixed behavior around different EoS minima, which further verifies our explanation above. We also empirically note that the coupling of entries will naturally arise when training general scalar networks from non-coupling initializations. Thus it is not an artifact we have to impose on the model to observe EoS (see Appendix A.4). + +# 5 GLOBAL TRAJECTORY AND CHAOS + +There exists very limited global convergence analysis for constant step size gradient descent training beyond EoS on complicated non-convex objectives. Even for the product of 4 scalars, the boundary separating converging and diverging initializations (Fig. 6a) exhibits complicated fractal structures. + +Moreover, we observe that for initializations close to such boundary, their GD training trajectories usually begin with a phase of chaotic oscillation which eventually "de-bifurcates" and converges to the parabolic two-step trajectory as discussed in Section 3. Similar oscillation phenomenon has also been empirically observed by Ruiz-Garcia et al. (2021) in neural networks when they increase the learning rate and destabilize the network from a local trajectory. + +So what is causing the bifurcation? Previously, Ruiz-Garcia et al. (2021) attributed the phenomenon to the cascading effect of oscillation along multiple large eigendirections of the network. Yet this explanation is quite unsatisfying for our simple model as there is only one oscillating direction. + +![](images/e8a8991ae61ce54ca309d445ea1c2da29a54cae1742884037ff7fa56021cddbe.jpg) +(a) Converging and diverging initialization $(\eta = 0.2)$ . +Figure 6: Bifurcation behavior of GD on the degree-4 model. In (a) we show the zoomed in version of the lower right part of Fig. 2b, the fractal boundary can be clearly observed. In (b), we run GD with $\eta = 0.01$ starting from the asymmetric initialization $(x_0, y_0) = (12.5, 0.05)$ close to the boundary of divergence until it converges close to the EoS minimum at around $(10, 0.1)$ . In (c), we plot the trajectory with bifurcation under $(a, b)$ -reparameterization and compare it with the bifurcation diagram of the approximated dynamical system characterized by $b'' = b(1 + 8a\kappa - 16b^2)$ . + +![](images/8bf340c2b27f17bc08544e2ef12520c3bfbc52df2971c9402f748e407498b89f.jpg) +(b) GD step-wise trajectory with asymmetric init. $(\eta = 0.01)$ . + +![](images/5ffa124e48d450fe70498ede399b1b813f584d70d54294740871b08a582a2015.jpg) +(c) GD trajectory and bifurcation diagram of approximated $b^{\prime \prime}$ + +Looking closely to the trajectory (Fig. 6b), one will find it very similar to the bifurcation diagram of self-recurrent polynomial maps (such as the famous logistic map $x_{t+1} = r x_t (1 - x_t)$ parameterized by $r$ ). In the degree-4 model, the existence of such self-recurrent map is explicit since following Eq. (7), the approximate 2-step update of $b$ can be rewritten as $b'' = b(1 + 8a\kappa - 16b^2)$ . + +If we consider $a$ to be relatively stationary, the trajectory of $b$ will be locally characterized by the self-recurrent 1D nonlinear dynamical system $b_{t+1} = b_t (1 + 8a\kappa - 16b_t^2)$ parameterized by $a$ . In Fig. 6c, we compute the bifurcation diagram for the recurrent map numerically and see that they are qualitatively similar. Following this analogy, one may instantly relate the first bifurcating point with the EoS minima that the trajectory eventually converges to, and the non-bifurcating regime for the polynomial maps with the "sub-EoS regime" on the left (in Fig. 6b) of the EoS minima. + +# 6 CONNECTION TO REAL-WORLD MODELS + +In this section we show how the degree-4 model analyzed above resembles the converging dynamics of over-parameterized regression models trained on real-world dataset. We train a 5-layer ELU-activated fully connected network on a 2-class small subset of CIFAR-10 (Krizhevsky et al., 2009) with GD. The loss converges to 0 and the sharpness converges to just slightly below $2 / \eta$ . + +We visualize the dynamics by projecting the trajectory onto the subspace spanned by the top eigenvector of minimum (oscillation direction) and the movement direction of parameters orthogonal to oscillation (see Definition 4 in Appendix A.6.1 for exact characterization). As shown in Fig. 7 (mid), after some initial bifurcation-like oscillation, the 2-step trajectory stabilizes and moves along some smooth curves toward the minimum. Near the minimum (Fig. 7, right), the trajectory in fact lies mostly in this 2-dimensional subspace (see Fig. 23c in Appendix) and can be very well-captured by a parabola, which is very similar to our minimalist example. More experimental results on real-world models are available in Appendix A.6. + +![](images/2693fb47b4afdffbd0ba2c870a1809da2b2f33eddae5681b5ce53386e5f1eb89.jpg) +Figure 7: Training trajectory of 5-layer ELU-activated FC Network. We train the model using with $\eta = 0.01$ for 18500 iterations. The sharpness converges to 199.97 while $2 / \eta = 200$ . The local trajectory (right) can be very well approximated by the parabola $x = 7500y^{2}$ . + +![](images/781377e64a9223845ec04a45c40ad0e2b9843d5cf8e59ff5133be30c49401572.jpg) + +![](images/e8dd20e98f282ec35617d8f2e2c179626b9313e014a7a11e33377ed440a6100e.jpg) + +# 7 DISCUSSION AND CONCLUSION + +In this paper we proposed a simple degree-4 model that captures the sharpness adaptivity and sharpness concentration phenomena that happen in gradient descent training of deep neural networks. The simplicity of the model allowed us to perform rigorous analysis on the training dynamics for a large local region. The analysis gives new insights on why the training dynamics of the degree-4 model is inherently different from the training dynamics of degree-2 models. Finally we show that the over-paramterized deep networks trained on real data exhibits a similar parabolic converging trajectory as the scalar example. We hope many of these observations can be generalized to highlight the difference between training dynamics of deeper networks and the shallower models. + +There are still many open problems. Can we identify the hidden dynamics of the real world model that yields the parabolic converging trajectory? Can we theoretically understand the automatic coupling of small entries as discussed in Appendix A.4? Is there a way to understand and leverage the fractal/bifurcation behavior in Section 5 toward global dynamics analysis? + +# 8 ACKNOWLEDGMENTS + +This work is supported by NSF Award DMS-2031849, CCF-1845171 (CAREER), CCF-1934964 (Tripods) and a Sloan Research Fellowship. + +# REFERENCES + +Kwangjun Ahn, Jingzhao Zhang, and Suvrit Sra. Understanding the unstable convergence of gradient descent. arXiv preprint arXiv:2204.01050, 2022. +Sanjeev Arora, Zhiyuan Li, and Kaifeng Lyu. Theoretical analysis of auto rate-tuning by batch normalization. arXiv preprint arXiv:1812.03981, 2018. +Sanjeev Arora, Zhiyuan Li, and Abhishek Panigrahi. Understanding gradient descent on edge of stability in deep learning. arXiv preprint arXiv:2205.09745, 2022. +Lei Chen and Joan Bruna. On gradient descent convergence beyond the edge of stability. arXiv preprint arXiv:2206.04172, 2022. +Jeremy M Cohen, Simran Kaur, Yuanzhi Li, J Zico Kolter, and Ameet Talwalkar. Gradient descent on neural networks typically occurs at the edge of stability. arXiv preprint arXiv:2103.00065, 2021. +Alex Damian, Tengyu Ma, and Jason D Lee. Label noise sgd provably prefers flat global minimizers. Advances in Neural Information Processing Systems, 34:27449-27461, 2021. +Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the thirteenth international conference on artificial intelligence and statistics, pp. 249-256. JMLR Workshop and Conference Proceedings, 2010. +Stanislaw Jastrzebski, Maciej Szymczak, Stanislav Fort, Devansh Arpit, Jacek Tabor, Kyunghyun Cho, and Krzysztof Geras. The break-even point on optimization trajectories of deep neural networks. arXiv preprint arXiv:2002.09572, 2020. +Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009. +Aitor Lewkowycz, Yasaman Bahri, Ethan Dyer, Jascha Sohl-Dickstein, and Guy Gur-Ari. The large learning rate phase of deep learning: the catapult mechanism. arXiv preprint arXiv:2003.02218, 2020. +Zhiyuan Li, Tianhao Wang, and Sanjeev Arora. What happens after sgd reaches zero loss? a mathematical framework. arXiv preprint arXiv:2110.06914, 2021. +Zhiyuan Li, Srinadh Bhojanapalli, Manzil Zaheer, Sashank Reddi, and Sanjiv Kumar. Robust training of neural networks using scale invariant architectures. In International Conference on Machine Learning, pp. 12656-12684. PMLR, 2022a. +Zhouzi Li, Zixuan Wang, and Jian Li. Analyzing sharpness along gd trajectory: Progressive sharpening and edge of stability. arXiv preprint arXiv:2207.12678, 2022b. +Kaifeng Lyu, Zhiyuan Li, and Sanjeev Arora. Understanding the generalization benefit of normalization layers: Sharpness reduction. arXiv preprint arXiv:2206.07085, 2022. +Chao Ma, Lei Wu, and Lexing Ying. The multiscale structure of neural network loss functions: The effect on optimization and origin. arXiv preprint arXiv:2204.11326, 2022. +Vardan Papyan. The full spectrum of deepnet hessenians at scale: Dynamics with sgd training and sample size. arXiv preprint arXiv:1811.07062, 2018. +Miguel Ruiz-Garcia, Ge Zhang, Samuel S Schoenholz, and Andrea J Liu. Tilting the playing field: Dynamical loss functions for machine learning. In International Conference on Machine Learning, pp. 9157-9167. PMLR, 2021. + +Levent Sagun, Leon Bottou, and Yann LeCun. Eigenvalues of the hessian in deep learning: Singularity and beyond. arXiv preprint arXiv:1611.07476, 2016. +Roman Vershynin. High-dimensional probability: An introduction with applications in data science, volume 47. Cambridge university press, 2018. +Yuqing Wang, Minshuo Chen, Tuo Zhao, and Molei Tao. Large learning rate tames homogeneity: Convergence and balancing effect. International Conference on Learning Representations, 2022. +Yikai Wu, Xingyu Zhu, Chenwei Wu, Annie Wang, and Rong Ge. Dissecting hessian: Understanding common structure of hessian in neural networks. arXiv preprint arXiv:2010.04261, 2020. +Chen Xing, Devansh Arpit, Christos Tsirigotis, and Yoshua Bengio. A walk with sgd. arXiv preprint arXiv:1802.08770, 2018. +Zhewei Yao, Amir Gholami, Kurt Keutzer, and Michael W Mahoney. Pyhessian: Neural networks through the lens of the hessian. In 2020 IEEE international conference on big data (Big data), pp. 581-590. IEEE, 2020. + +# Supplementary Materials for Understanding Edge-of-Stability Training Dynamics with a Minimalist Example + +# A ADDITIONAL EXPERIMENTS + +In this section, we provide more empirical evidences supporting the main text. + +In Appendix A.1, we will first introduce our experiment setup including the structure and initialization for the neural network models as well as the generative model for the synthetic datasets. + +In Appendix A.2, we will present some additional figures demonstrating the training dynamics near the EoS minima for the degree-2 and degree-4 examples discussed in Section 3 and Section 4. We will also discuss a degree-3 example exhibiting different behavior around different EoS minima. We will explain the phenomenon using our understanding of the 2 and degree-4 models. + +In Appendix A.3, we will provide additional empirical evidence that shallow neural networks usually does not converge to the exact EoS threshold. + +In Appendix A.4, we will present some results on the training dynamics of scalar networks without the coupling initialization. We will empirically show that the coupling of entries will arise along the training process. + +In Appendix A.5, we will demonstrate the EoS phenomenon on the rank-1 factorization. + +In Appendix A.6, we will introduce the experiment on learning real-world images (as presented in Section 6) in more detail. We will also present additional experiment results on networks with different activations and local trajectory with perturbation. + +In Appendix A.7, we will present some experiments on the edge of stability phenomenon when the model is optimized with stochastic gradient descent. + +# A.1 EXPERIMENT SETTINGS + +# A.1.1 CALCULATION OF NUMERICAL SHARPNESS + +For the scalar network examples the closed-form Hessian is simple. We compute the exact parameter Hessian and use numerical packages to compute its top eigenvalue. + +For neural networks, we use the PyHessian package by (Yao et al., 2020), which compute the top eigenvector eigenvalue pair by inferencing the Hessian vector product and do power iteration. For all numerical sharpness computed for neural networks, we set $\text{tol} = 1e - 6$ and $\text{max\_iter} = 10000$ . + +# A.1.2 SYNTHETIC EXPERIMENTS + +For all experiments involving neural networks on synthetic datasets (Fig. 1a, Fig. 1b, Fig. 15), we use fully connected networks with the same dimension for input, output, and all hidden layers. The bias of all layers are fixed to 0. Formally, a $L$ -layer width $d$ network can be modeled by $f: \mathbb{R}^d \to \mathbb{R}^d$ such that for input vector $\boldsymbol{x} \in \mathbb{R}^d$ , + +$$ +f (\boldsymbol {x}) = \boldsymbol {W} _ {L} \sigma \left(\boldsymbol {W} _ {L - 1} \dots \sigma \left(\boldsymbol {W} _ {2} \sigma \left(\boldsymbol {W} _ {1} \boldsymbol {x}\right)\right) \dots\right) \tag {13} +$$ + +where $\sigma : \mathbb{R}^d \to \mathbb{R}^d$ is some entry-wise activation function and $\mathbf{W}_l \in \mathbb{R}^{d \times d}$ for all $l \in [L]$ . For this paper we only considered $\sigma$ being the ReLU activation $\sigma(x) = x\mathbf{1}_{x \geq 0}$ or the identity $\sigma(x) = x$ . + +# Initialization of Neural Networks + +We use Xavier initialization (Glorot & Bengio, 2010) with gain of 1 to initialize the all weight matrices. For shallow two-layer networks that will not enter the EoS regime if using completely random initialization, we will asymmetrically re-scale the layers after random initialization by multiplying a constant to all entries of the same layer. When we present results for the re-scaled experiments, we will state the re-scale factor. + +# Synthetic Dataset and Loss Function + +For the experiments involving neural networks, we use synthetic datasets very similar to the linear network experiment in section L.3 of Cohen et al. (2021). For a neural network as described above with dimension $d$ , we consider the problem of mapping $n$ inputs $\boldsymbol{x}_1, \ldots, \boldsymbol{x}_n \in \mathbb{R}^d$ to $n$ outputs $\boldsymbol{y}_1, \ldots, \boldsymbol{y}_n \in \mathbb{R}^d$ . Let $\boldsymbol{X} \in \mathbb{R}^{d \times d}$ and $\boldsymbol{Y} \in \mathbb{R}^{d \times d}$ denote the vertically stacked inputs and outputs respectively (Here $n = d$ ). We generate $\boldsymbol{X}$ as a whitened matrix such that $\boldsymbol{X}\boldsymbol{X}^T = d\boldsymbol{I}_d$ and generate $Y$ by $\boldsymbol{Y} = \boldsymbol{X}\boldsymbol{A}$ where $\boldsymbol{A} = \mathrm{diag}(1, \frac{d-1}{d}, \ldots, \frac{2}{d}, \frac{1}{d})$ . + +For all experiments with neural networks on synthetic datasets, we consider the simple squared loss + +$$ +\frac {1}{n} \sum_ {i = 1} ^ {n} \| f (\boldsymbol {x} _ {i}) - \boldsymbol {y} _ {i} \| _ {2} ^ {2}, \tag {14} +$$ + +which matches our analysis on scalar networks. + +# A.1.3 REAL-WORLD DATA EXPERIMENTS + +Here we provide the detailed setting for the experiment results shown in Section 6 in the main text as well as Appendix A.6. We consider a binary classification problem on a subset of CIFAR-10 image classification dataset (Krizhevsky et al., 2009). + +# Dataset + +To study the training process in an over-parameterized setting (in which the loss can converge close to 0), we take a binary 50-sample subset from CIFAR-10 containing the first 25 samples of class 0 (airplane) and class 1 (automobile). Then we label samples from class 0 by -1 and samples from class 1 by +1. + +Here we are consider a binary classification problem since for networks with output dimension larger than 2, there is typically not a strong eigengap between the first eigenvalue and the other eigenvalues (Sagun et al., 2016; Papyan, 2018; Wu et al., 2020). The dynamics with multiple eigenvalues around the stability threshold may exhibits cascading oscillation along different eigendirections (Ruiz-Garcia et al., 2021), and could be complicated to analyze. + +# Network Structure + +We conduct the experiment on fully-connected neural networks with four hidden layers of width 200. We consider tanh and ELU as activations. In Table 1 we provide the structure of a fully-connected ELU-activated architecture. This architecture follows the experiments in Li et al. (2022b). + +Table 1: Structure of fully-connected network + +
#NameModuleIn ShapeOut Shape
1Flatten()(32,32,3)3072
2fc1nn.Linear(3072, 200, bias=False)3072200
3nn.ELU()200200
4fc2nn.Linear(200, 200, bias=False)200200
5nn.ELU()200200
6fc3nn.Linear(200, 200, bias=False)200200
7nn.ELU()200200
8fc4nn.Linear(200, 200, bias=False)200200
9nn.ELU()200200
10fc5nn.Linear(200, 1, bias=False)2001
+ +Loss Function For the CIFAR-10 subset experiment $\{(x_1, y_i)\}_{i=1}^n$ where $n = 50$ , $x_i \in \mathbb{R}^{3072}$ , and $y_i \in \{1, -1\}$ , we consider the mean squared loss + +$$ +\frac {1}{n} \sum_ {i = 1} ^ {n} \| f \left(\boldsymbol {x} _ {i}\right) - y _ {i} \| _ {2} ^ {2}, \tag {15} +$$ + +which matches our theoretical analysis on the scalar example. + +# A.2 ADDITIONAL EXPERIMENTS FOR SCALAR NETWORK EXAMPLES + +In this section we show some additional figures demonstrating the local training dynamics and convergence boundary for the two cases we analyzed in Section 3 and Section 4. + +![](images/8d244c351bdff90747382383f4bde2a191ef78bc39d142b6a63f3c1ee7f3f964.jpg) +A.2.1 4-LAYER SCALAR NETWORK + +![](images/9c3ad43dff5e3c95e234ed3e0fdf8ca199db350411e5913c1849fd992ab08a27.jpg) +Figure 8: Sharpness concentration for the degree-4 example. We run GD with $\eta = 0.2$ from 3 initializations that are above, below, and very close to the line of global minima. The sharpness of all trajectories converges to around $2 / \eta$ while the loss decreases exponentially. In the 2D trajectory, the 2-step movement quickly converges to the parabolic curves ending very close to the EoS minimum. + +![](images/74186b106ab92a849245631adc75cfe72f54ce6f288a6a47c88cd501bfb014b1.jpg) + +![](images/a4313a430eda17c7ad928ce5e8dd31e9f66622f55a088054932651194ace9dca.jpg) +Figure 9: Local two-step movement for the degree-4 example. We record the two-step movement with $\eta = 0.2$ from a grid of initializations near the EoS minima. At each point, the arrow points toward the direction of two-step movement from that point and the color of arrow indicates the converging sharpness of trajectories passing that point. We can see the parabolic trajectory and how initialization to the right of the EoS minima all tend to converge to it. + +![](images/f89f4e4e895efccac36076c586a9969d7f14c3dee71c1cd0dc58dad8a7a71954.jpg) + +![](images/35d7a3f99abd3cbba49cde25e621ad23e2deb858a59d48750635edbdbc26e899.jpg) +(a) $\eta = 0.3$ + +![](images/39eab64092d4b32363c1bc688fa337e9d7c81ad3d4f1508deed51cfebdc61b36.jpg) + +![](images/cbbd44d3c10d8eb23600fd72e7ccf9e963a86ca4134b99b141bd03b01e99a5e5.jpg) +(b) $\eta = 0.4$ +Figure 10: Converging Sharpness of Initializations Under Different Step Sizes. Please see the caption of Fig. 2b for detailed description. + +![](images/27b0046ed565cddfeece579b27815e58ed9176ba23d4b45ddad3026a52f3ca0b.jpg) +A.2.2 2-LAYER SCALAR NETWORK + +![](images/7979150864fa186798854dd8b3f9291ad865c869fdb85f56bb4cd391b1e73169.jpg) +Figure 11: Beyond EoS training on product of two scalars. We run the identical experiment as in Fig. 8 except for the objective $\min_{x,y\in \mathbb{R}}(1 - xy)^2$ . Note that in this case we do not observe both sharpness concentration and sharpness adaptivity. The two-step trajectory follows an elliptical trajectory centered at the EoS minima. In this context, a sharper initialization (e.g. the purple curve) will eventually converge to a flatter minima (as shown in the left figure). + +![](images/d255518c2c55f6d5f01073885118a0010e1eec3f93d424cba6ccf2f956eaf28b.jpg) +Figure 12: Local two-step movement for the degree-2 example. This is the same figure as Fig. 9 except for the degree-2 example. We use the same step size $\eta = 0.2$ . There is no longer the concentration behavior as we see for the degree-4 case. Locally, only the initialization very close to the EoS minimum will converge to a sharpness near the stability threshold (which is 10 with $\eta = 0.2$ ). + +# A.2.3 3-LAYER SCALAR NETWORK + +Now we look into an interesting example with different behaviors around different EoS minima. + +We consider a 3-layer scalar network with objective + +$$ +\min _ {x, y, z \in \mathbb {R}} \frac {1}{2} (1 - x y z) ^ {2}. \tag {16} +$$ + +To make the dynamics two dimensional, we consider the initialization with $z = y$ . The equality of the last two entries will be preserved through training so the dynamics is two dimensional in terms of $x$ and $y$ . In the positive quadrant, the global minima is $\sqrt{xy} = 1$ and there are two EoS minima. + +In Fig. 13, we plot the converging sharpness from different initializations in comparison with Fig. 2b and Fig. 5b in the main text. Around the EoS minimum that the single entry $x$ is small and the duplicated entries $y$ are large (upper left of Fig. 13), the behavior is similar to the 2 scalar case (Fig. 5b) with no sharpness concentration. Around the EoS minima with large single entry and small duplicating entries (lower right of Fig. 13), we have a region of initialization (the red shaded area) with sharpness concentration similar to the 4 scalar case (Fig. 2b). + +![](images/d534a1121f3e84316924035784c6a54f9e76de631cf2c279cb2aa4d0666d1831.jpg) +Figure 13: Converging sharpness of $(x,y,y)$ parameterized initializations $(\eta = 0.2)$ . + +A heuristic explanation to this difference lies in the difference in the degree of the small entries. Around the EoS minima that the single entry is small, the local two-step approximation is similar to Eq. (12) and gives us elliptical two-step trajectories. Around the minima with small duplicating entries, the two-step approximation would contain the cubic term as in Eq. (7), which gives us both sharpness concentration and adaptivity. + +Such heuristics can be further verified by visualizing the local dynamics around the minima. As shown in Fig. 14, the local dynamics around the minima with small duplicating entries is similar to the case of the degree-4 example with convergence toward a parabolic trajectory. On the other hand, the local dynamics around the minima with only one small entry is similar to the case of the degree-2 example where parameters follow an locally elliptic trajectory centered at the EoS minima. + +![](images/897f93a63fbd169e5f7a8ded6ff2be3573b1ee268e2293998dd1e8066daa3a4f.jpg) +Figure 14: Local two-step movement for the degree-3 example. In this figure, we show the local dynamics near the two EoS minima in the positive quadrant of the degree-3 example. The left figure corresponds to the EoS minima at the lower right of Fig. 13. At this EoS minima, the duplicated entry $y$ is small, and the local behavior is very similar to the case of degree-4 example (Fig. 9) for which we have provable sharpness concentration. The right figure corresponds to the EoS minima at the top left of Fig. 13. The local behavior is very similar to the case of degree-2 example (Fig. 12), for which we do not have EoS behaviors. + +![](images/fa7c1b3a4ecfb9c58c19c2ce4d4aa4a65d8496ac52057fccdc9e6baf6f0221a1.jpg) + +# A.3 ADDITIONAL EXPERIMENTS FOR 2-COMPONENT SCALAR FACTORIZATION + +In this section we present the experiment results for 2-component scalar factorization deferred from Section 4. The dynamics as shown in Fig. 15 is very similar to the degree-2 example in Fig. 11. + +![](images/126dd4c9901cd560f91ffd1f9fef3f4f05be7766c6de78813c80f433e7475a00.jpg) +(a) $\min_{\pmb{x},\pmb{y}\in \mathbb{R}^d}(1 - \pmb{x}^\top \pmb{y})^2$ + +![](images/083a066ab973e7c547558fa64b045009376f9adb0060221d1b7324d13983ea83.jpg) +(b) $\min_{\pmb {x},\pmb {y}\in \mathbb{R}^d}\| \pmb {I}_d - \pmb {xy}^\top \| _F^2$ +Figure 15: GD on 2-component scalar factorization problems. We run gradient descent with $\eta = 0.05$ for two different objectives. Both models are asymmetrically initialized with factor (5, 0.1) so that they have an initial sharpness larger than $2 / \eta$ . For both cases, the converging sharpness is distinguishably smaller than the stability threshold. + +# A.4 EXPERIMENTS FOR GENERAL SCALAR NETWORKS + +In this section, we will present some empirical observations on training dynamics of more general scalar networks related to the sharpness concentration and adaptation phenomena. A $n$ -layer scalar network is defined to be the model parameterized by $n$ entries $x_{1}, \ldots, x_{n} \in \mathbb{R}$ with objective + +$$ +\mathcal {L} \left(x _ {1}, \dots , x _ {n}\right) \triangleq \frac {1}{2} \left(1 - \prod_ {i = 1} ^ {n} x _ {i}\right). \tag {17} +$$ + +# A.4.1 INITIALIZATION WITHOUT DUPLICATED ENTRIES + +We first consider a variant of the degree-3 example as discussed in Appendix A.2.3. In particular, we initialize the two small entries differently and record their values throughout the training trajectory. + +![](images/96f77a5b68fb950f7773bb4ed0516c670443c72ec27570a7d5ec6f23aafcb95c.jpg) +Figure 16: This figure records the training loss (left) and sharpness (middle) of a degree-3 scalar network with initialization $(6,0.1,0.4)$ optimized by gradient descent with fixed step size $\eta = 0.2$ . In (right) we plot the distance of the last entry $x_{3}$ to other entries. + +![](images/360f7da5652605931c5075a44b6373fe2d1b0614b70c13ff2bf5cbdaa762c33d.jpg) + +![](images/eb2202190999335770434e5255693f86e2d5b3a14cf8c9905cf59ec53170b038.jpg) + +As we can see in Fig. 16, at the very beginning of the training, the second entry $x_{2}$ converges to $x_{3}$ geometrically, then the dynamics is reduced to the case of duplicated entries, which we know that the sharpness concentration behavior would happen for sufficiently asymmetric initialization. In Fig. 17 we consider a 7-layer scalar network with 3 different large entries and 4 different small entries. We observe similar behavior as $x_{4}, x_{5}, x_{6}$ all converges to $x_{7}$ geometrically, and we observe concentration of sharpness with 4 duplicated small entries. + +![](images/decaad24ba0c372c127a841c594c6f556b0b64d8d7d91a3d967ee64df752d055.jpg) +Figure 17: This figure records the training loss (left) and sharpness (middle) of a 7-layer scalar network with initialization $(2,2.5,3,0.1,0.2,0.3,0.4)$ optimized by gradient descent with fixed step size $\eta = 0.2$ . In (right) we plot the distance of the last entry $x_{7}$ to other entries. + +![](images/ae1f0795a07cc886ff676971e68e863ce1db8081bc12502e2bc57f629ebcb15f.jpg) + +![](images/cc7f5df5a74e19344e65ac86d492a13797607d194a58acad89e0b151e21f1311.jpg) + +To probe into the detailed training dynamics of general scalar networks, we plot the pairwise dynamics of the entries as shown in Fig. 18. + +![](images/16b3a7269de1ee0e4b3cf65d5738e04194c1af9270e6548792bb6d3000528186.jpg) + +![](images/64a069fccd7c542670e46bb49d6b6f0a508141d790012ee988f306f2113bebfe.jpg) + +![](images/c3c78c68719ebc05e51cbaa00a49628cb9aaa828b7e6fe4bf5d0c824dc6473cf.jpg) + +![](images/2617c5a8c37962b52a6a43482887977a01a9d14905282c21e91e36a260de2871.jpg) +Figure 18: Pairwise Training Dynamics. This set of figures record the pairwise training dynamics for entries $x_{2}, x_{3}, x_{4}, x_{5}$ in the same experiment as Fig. 17. $x_{2}$ and $x_{3}$ are initialized large while $x_{4}$ and $x_{5}$ are initialized small. We see that within the small entries and the large entries, the pairwise dynamics are all approximately linear while the cross comparisons across the small entries and large entries gives the parabolic two-step trajectory (and also some bifurcation behavior). + +![](images/cbf54d2b1a058a5b4153872875fdca59b10bd991eda2e7d45aedc236cbf4cb3a.jpg) + +![](images/197a50b6ab48cd1391b3eac16fa37c49f8f721ef7da3008ecde0d1befdb817c6.jpg) + +![](images/bd42e3df8c8a145a540df130fd40f00721434021ae31cfe2df704f6f01da7b7e.jpg) +Figure 19: Single Entry Movement. We plot the value of $x_{3}$ (initialized to 3) and $x_{3}$ (initialized to 0.1) along the training process. The larger entry decreases in an approximately monotone manner and the small entry increase while oscillating. + +![](images/21d8ef0754b451330f1c6fdbd074fc11bc55f82138f8725d37754f851001f7bc.jpg) + +# A.4.2 ON "LARGE" AND "SMALL" INITIALIZATIONS + +In the experiments shown above, we have seen that there are mainly two classes of behaviors for the entries: the entries that were initialized to be large moves slowly with little oscillation while the entries that were initialized to be small has significant oscillation along the trajectory. Intuitively, it is the decreasing large entry that decreases the sharpness and stabilizes the oscillating small entries and result in the final convergence close to the EoS minimum. A natural question to ask is whether there exists a clear boundary separating the "small" and "large" entries. + +We consider a 4-layer scalar network with initialization $(6,0.7,0.3,0.2)$ optimized with GD with step size $\eta = 0.2$ . In Fig. 20 and Fig. 21 we visualize the training loss, sharpness, and the pairwise dynamics. The mixed behaviors suggest a clear boundary between the "large" and "small" entries does not exist, and the complexity of this problem is beyond this simple heuristics. + +![](images/0177756ab6cdcb578e3250f60120feb3349f51ef0622cbf400e7a03637e4c0bf.jpg) +Figure 20: This figure records the training loss (left) and sharpness (middle) of a 4-layer scalar network with initialization $(6,0.7,0.3,0.2)$ optimized by gradient descent with fixed step size $\eta = 0.2$ . In (right) we plot the distance of the last entry $x_{4}$ to other entries. In this example, the small entries did not converge to be exactly the same value, yet the loss still decreased geometrically and the sharpness concentration phenomenon still occurred. + +![](images/5d97e1d31e7d9bc50bb112fd67f95c3776fefb4f93e21b2d5814b618be6d831f.jpg) + +![](images/afd7a4a6ec59bd6e70079b95116582d7e0db5e88d00228ff450451133af3aa5e.jpg) + +![](images/b74b5903aca47e02048d501123505f2f71d2c8cb30b2d70fda86d2df0a076832.jpg) + +![](images/bf9578bc2d842dcb2a782b93dc0c030b9cde307a2546b240f7eef6ab2fbd879e.jpg) + +![](images/66acb074946d001dfcfe3ba35df5d562d9882b476686277e12ebf337935bdcfd.jpg) + +![](images/07d3adb5c714f16b2634c0701c04f32d2a8dc0c3a7274b35478100f58fbd07f7.jpg) +Figure 21: Pairwise Training Dynamics. This set of figures record the pairwise training dynamics for entries $x_{1}, x_{2}, x_{3}, x_{4}$ in the same experiment as Fig. 20. $x_{1}$ was initialized large (at 6), $x_{3}, x_{4}$ were initialized small (at 0.2, 0.3), and $x_{2}$ was initialized moderately small (at 0.7). We see that the two-step pairwise dynamics between $x_{2}$ and $x_{3}$ roughly follows a parabolic trajectory, yet the pairwise dynamics between $x_{1}$ and $x_{2}$ also exhibits similar features while still following a roughly linear relation. + +![](images/346223e190da6b06711d5981b4c4d63a70ef47f43a029cd419620c7bc34c666d.jpg) + +![](images/b6db90ed5a3bbc65d44ca19049c0e9daec5f87c4786be2973939c8253a72690f.jpg) + +# A.5 ADDITIONAL EXPERIMENTS FOR RANK-1 FACTORIZATION OF ISOTROPIC MATRIX + +In this section, we will demonstrate the EoS phenomenon on the rank-1 factorization of isotropic matrix in Section 3.3. + +We first show that the loss, the sharpness and the trajectory of GD is very similar to the degree-4 scalar network case. For each different learning rate, the sharpness concentrates to a tiny interval close to the stability threshold $2 / \eta$ when trained with gradient descent. + +Also, we consider the 2D trajectory of the two vectors $\pmb{x}, \pmb{y}$ . We plot the trajectory in the norm of each vector, i.e. $\| \pmb{x} \| \| \pmb{y} \|$ , and get a similar figure to the scalar case. Actually, we can prove that the dynamics of this training objective will eventually be reduced to our degree-4 scalar network. That is because all the global minima of this optimization problem requires that $\pmb{x}$ is aligned with $\pmb{y}$ , i.e. $\pmb{x} = c\pmb{y}$ . After the two vectors are aligned, the training dynamics of $\| x \|, \| y \|$ will be exactly equivalent to those of the scalar network. + +The following figure shows how GD enters EoS on the rank-1 factorization problem, and how fast the alignment of the two vectors is achieved. Here we consider an alignment indicator $\| \pmb{x} \|^{2} \| \pmb{y} \|^{2} - (\pmb{x}^{\top} \pmb{y})^{2}$ showing how the two vectors are aligned. If $\pmb{x}$ is parallel to $\pmb{y}$ , i.e. $\pmb{x} = c\pmb{y}$ , then the variable becomes 0. Detailed analysis for this problem is deferred to Appendix C. + +![](images/cdd0d6628995498cba7bae4c6c2e7f74e370ca876c03ce9d9b5d92d0d2a10717.jpg) +(a) Evolution of training loss, sharpness and the trajectory of GD on the rank-1 factorization of isotropic matrix. + +![](images/a57bcc5410d79853c927959ec5b17bce3f3717f113d62ec65ba936bd083513a8.jpg) +(b) Evolution of the alignment indicator $\| \pmb{x} \|^2 \| \pmb{y} \|^2 - (\pmb{x}^\top \pmb{y})^2$ . +Figure 22: EoS phenomenon on the rank-1 factorization of isotropic matrix. In (a), similar to the degree-4 scalar case, we demonstrate sharpness adaptivity by running GD with learning rate $\eta = \frac{2}{8}, \frac{2}{10}, \frac{2}{12}$ from the same initialization ( $\|x_0\| \|y_0\| = 1/2$ ). All the sharpness of each trajectory converges to around their corresponding stability threshold $2/\eta$ while the loss decreases exponentially. In the 2D trajectory, GD quickly converges along some smooth curves ending near the EoS minimum. In (b), we see that in the first 30 iterations, the alignment indicator ( $\|x\|^2 \|y\|^2 - (x^\top y)^2$ ) decreases geometrically, and stabilizes at its numerical minimal value. Theoretically, we characterize the geometric decay for the alignment variable by Lemma 20 in Appendix C. + +# A.6 EOS CONVERGENCE FOR DEEP NEURAL NETWORKS TRAINED ON REAL DATA + +In this section, we present a more comprehensive description and additional results for the experiment of learning a 2-class small subset of CIFAR-10 with 50 images in an over-parameterized regression setting. The details for the network structures and dataset construction are available in Appendix A.1.3. + +In this experiment, we train two 5-layer fully connected (fc) networks of width 200 with ELU and tanh activation using (full-batch) gradient descent on the binary dataset with mean squared loss. We chose these two activation functions following the empirical experiments in Cohen et al. (2021). ReLU is not being used since its training dynamics as the loss converges to 0 is very unstable. + +We record the training loss and sharpness of the two training processes. To better visualize the training trajectory, we consider the following projection mechanism. + +# A.6.1 TRAJECTORY PROJECTION + +Inspired by the observation on the scalar example, we note that the dynamics toward the end of the convergence has two distinctive directions: an "oscillation direction" which is aligned with the first eigenvector of the Hessian, and an "movement direction" which the 2-step average of the model moves along and converges to the final minimum. + +In the context of our $(a,b)$ -reparameterization for theoretical analysis (Definition 2), the oscillation direction corresponds to $b$ and the movement direction corresponds to $a$ . In a local region around the converging minima, $(a,b)$ constitutes a parabolic trajectory that can be well captured by the solution of the ODE in Eq. (8). In a high-dimensional setting, the oscillation direction is still naturally the top eigenvector at minimum, but we have to manually pick a movement direction to project onto. + +To be concrete, consider a trajectory of the parameters $\{\theta_1,\theta_2,\dots ,\theta_{T - 1},\theta_T\}$ , where $\theta_t\in \mathbb{R}^d$ is the parameter vector for the model after the $t$ -th iteration. We define the oscillation direction $v_{\mathrm{osc}}$ as the first eigenvector of the parameter Hessian $\pmb {H}(\theta_T)$ and the movement direction $v_{\mathrm{move}}(\hat{t})$ as follows: + +Definition 3 (Movement direction). For some iteration $\hat{t} \in [T]$ , define $v_{\mathrm{move}}(\hat{t})$ as + +$$ +v _ {\text {m o v e}} (\hat {t}) \triangleq \frac {1}{2} \left(\theta_ {\hat {t} - 1} + \theta_ {\hat {t}}\right) - \frac {1}{2} \left(\theta_ {T - 1} + \theta_ {T}\right). \tag {18} +$$ + +Fix some iteration $\hat{t}$ , $v_{\mathrm{move}}(\hat{t})$ captures the non-oscillatory movement of the parameters from step $\hat{t}$ to step $T$ . We orthonormalize the basis by projecting $v_{\mathrm{osc}}$ off from $v_{\mathrm{move}}(\hat{t})$ and get + +$$ +\tilde {v} _ {\text {m o v e}} (\hat {t}) \triangleq v _ {\text {m o v e}} (\hat {t}) - \operatorname {p r o j} _ {v _ {\text {m o v e}} (\hat {t})} (v _ {\text {o s c}}), +$$ + +$$ +\bar {v} _ {\text {m o v e}} (\hat {t}) \triangleq \tilde {v} _ {\text {m o v e}} (\hat {t}) / \| \tilde {v} _ {\text {m o v e}} (\hat {t}) \|, \tag {19} +$$ + +$$ +\bar {v} _ {\mathrm {o s c}} \triangleq v _ {\mathrm {o s c}} / \left\| v _ {\mathrm {o s c}} \right\|. +$$ + +Now with the orthonormal basis, we define the movement-oscillation projection of $\theta_t$ to be the projection of its offset from the minima (which we approximate by the mean of the last two steps in the trajectory) onto $\bar{v}_{\mathrm{move}}(\hat{t})$ and $\bar{v}_{\mathrm{osc}}$ . + +Definition 4 (Movement-Oscillation Projection). Fix an iteration $\hat{t}$ for determining the movement direction, the movement-oscillation projection of $\theta_t$ is + +$$ +\left(\bar {v} _ {\text {m o v e}} (\hat {t}) ^ {\top} \left(\theta_ {t} - \frac {1}{2} \left(\theta_ {T - 1} + \theta_ {T}\right)\right), \bar {v} _ {\mathrm {o s c}} ^ {\top} \left(\theta_ {t} - \frac {1}{2} \left(\theta_ {T - 1} + \theta_ {T}\right)\right)\right) \tag {20} +$$ + +When doing the projection in practice (as in Fig. 24 and Fig. 26), we fix $\hat{t} = 5000$ , which is when the 2-step trajectory becomes relatively stable. We also record the norm of the component of the offset $\theta_{t} - \frac{1}{2}\left(\theta_{T-1} + \theta_{T}\right)$ that is orthogonal to the subspace spanned by $\bar{v}_{\mathrm{move}}(\hat{t})$ and $\bar{v}_{\mathrm{osc}}$ . These results are shown in Fig. 23c and Fig. 25c. + +# A.6.2 ELU-ACTIVATED FULLY CONNECTED NETWORK + +Here we present the experiment results for training a 5-layer ELU-activated FC network on the binary subset of CIFAR-10. In Fig. 23, we show the evolution of loss and sharpness along the training process. The sharpness eventually converge to just slightly below the $2 / \eta$ threshold. We also observe that the dynamics toward the end of the converging process is mainly happening in the 2-dimensional subspace spanned by the oscillation and movement directions (Fig. 23c). + +In Fig. 24 we plot the projected trajectory of the training process. Toward the end of the training process, the trajectory can be very accurately characterized by a parabola and the converging sharpness is just slightly below the stability threshold. This is identical to what we observe (and proved) for the scalar network case. + +![](images/a2a13ce2cef3c04bbc681cc573569309c467b7c1cc5acc8cba1869b56cb715c6.jpg) + +![](images/28433f754e2b03048680056fe21b82680061025859251fb32f81ac4b672b7251.jpg) +(a) Training loss and sharpness. (iteration 0-18500) + +![](images/b973e1f15ffe42e77b3ccaf4f5d22ae300b537664605fd71bdffd71edc001036.jpg) + +![](images/d5af5225404b93cb06d71730e4859d9893e0c2d55d4099696e4f81eb059252bb.jpg) +(b) Training loss and sharpness. (iteration 5000-5030) + +![](images/5e5281888bec87a918af065db377d8feb6553580566314c528a54e1a0c56eda1.jpg) +(c) Residual orthogonal to oscillation-movement subspace. + +![](images/da7e52faf644c622d7ffa563b596770d44378e696741e364d86865eef2dca528.jpg) +Figure 23: Training Statistics for ELU-activated 5-layer FC network. $(\eta = 0.01, 2 / \eta = 200)$ (a) is identical to Fig. 7 (left) in the main text. We see that the model is capable of memorizing all data as the loss decreases exponentially to 0. Toward convergence, the sharpness oscillates very close to the stability threshold and eventually converges to 199.97. In (b) we show a section of (a) between iteration 5000 and 5030. We can clearly observe two distinctive features of the EoS regime: the loss decreases non-monotonically and the sharpness oscillates around $2 / \eta$ . In (c) we plot the norm of the offset from minima that is orthogonal to the movement-oscillation projection. After 3000 iterations the residual becomes very small, suggesting that dynamics is mainly happening in the 2 dimensional subspace and hence the projection captures the dynamics quite well. +(a) Projected Trajectory. (iteration 0-18500) +Figure 24: Projected Trajectory of ELU-activated 5-layer FC network. $(\eta = 0.01, 2 / \eta = 200)$ In (a), we plot the projected trajectory for the entire training process. After some large bifurcation like oscillation, the 2-step trajectory quickly stabilizes and moves toward the minimum along the movement direction. In (b), we show the tip of the trajectory, which can be very well captured by a parabola. These figures are identical to Fig. 7 in the main text. The color of the dots reflects the local numerical sharpness. + +![](images/719cb0812fa30f87a34a3b97083fee7d9ac0f017ee369f816984f468c6852573.jpg) +(b) Projected Trajectory. (iteration 5000-18500) + +# A.6.3 TANH-ACTIVATED FULLY CONNECTED NETWORK + +Here we show the results for the same experiment on a tanh-activated 5-layer FC network. The phenomena are qualitatively identical to the ELU case described above. + +![](images/59b1ac02357c2d361bb763454ac347f75947ff29358f40418a58e43533910a48.jpg) + +![](images/6b9b9471d8b90bbfe5152ca84a0dd214c20ca33cc9dc4ce6d15e5c1ebceb2de8.jpg) + +![](images/bd47f5050b85c625b3b5979059a7e0dd5af9dae751894cde57497d831a575245.jpg) +(c) Residual orthogonal to oscillation-movement subspace. + +![](images/eb4e15227ddf633d37d95479cf3537d8ab9a107fb29a134aafd921c49004a49a.jpg) +(a) Training loss and sharpness. (iteration 0-18500) + +![](images/7a50eeab30a93433fd9cbb23cd6fd3f0d73e46c0962f497e0ad7b8108f68fe32.jpg) +(b) Training loss and sharpness. (iteration 5000-5030) + +![](images/f682f572483c2db2c3d3af24437b10fb93942a4e416a39ba4a95fdb448c08d58.jpg) +Figure 25: Training Statistics for tanh-activated 5-layer FC network. $(\eta = 0.01, 2 / \eta = 200)$ Please refer to the caption of Fig. 23 for detailed explanation. +(a) Projected trajectory. (iteration 0-18500) +Figure 26: Projected Trajectory of tanh-activated 5-layer FC network. $(\eta = 0.01, 2 / \eta = 200)$ Please refer to the caption of Fig. 24 for detailed explanation. + +![](images/4973f8e718ad2c20255c5a71f2bd1a7992d5c95a5f5439fddfa400165650d3d8.jpg) +(b) Projected trajectory. (iteration 5000-5030) + +# A.7 EDGE OF STABILITY AND STOCHASTIC GRADIENT DESCENT + +In this section, we will briefly discuss some empirical observations of EoS in stochastic gradient descent (SGD). In Appendix A.7.1, we will first empirically present the effects of different forms of noise on our scalar model. Then in Appendix A.7.2 we will compare it with the observations made on real world models trained with mini-batch gradient descent. Finally, we will discuss the limitations of our scalar model in explaining what people observe about EoS when the model is trained with SGD. + +# A.7.1 GD WITH NOISE ON SCALAR NETWORK + +We first look into the training trajectory of our degree-4 scalar network example with noise injected to the gradient descent process. We consider label noise, which perturbs the target by a small amount per iteration, and gradient noise, which perturbs the gradient by a small amount per iteration before updating the parameter according to it. + +# Label Noise: + +To simulate the existence of label noise, at each iteration we compute the gradient for the objective + +$$ +\mathcal {L} _ {\mathrm {L N}} (x, y, \delta) = \frac {1}{4} (1 + \delta - x ^ {2} y ^ {2}) ^ {2} +$$ + +where $\delta$ is sampled from a zero-mean Gaussian $\mathcal{N}(0, \sigma^2)$ for each iteration. This is equivalent to adding a perturbation of $\delta$ to the label (which is 1 in our original model). We start from the same initialization as in Fig. 8 and plot the trajectory in Fig. 27. + +As shown in Fig. 27a and Fig. 27b, the trajectory first roughly follows a parabolic boundary and reaches close to the set of global minima near the EoS-minimum relatively quickly (for around 200 iterations). This part of the trajectory resembles our analysis for the case without label noise. + +After the model reaches the tip of the parabola, the dynamics is mainly dominated by the label noise. The gradient is dominated by its noise component of $\delta xy(y,x)$ , which is orthogonal to the manifold of global minima $xy = 1$ , thus the model starts oscillating around the global minima. As shown in Fig. 27c and Fig. 27d, the sharpness further decreases very slowly (for $10^{6}$ iterations) and eventually reaches the flattest global minimum at $(1,1)$ with sharpness of 4. We believe this is within the regime of the sharpness reduction flow near the manifold of minima, which is comprehensively studied by Damian et al. (2021); Li et al. (2021; 2022b); Lyu et al. (2022). + +![](images/d9cb754d20312793a082aa446d2005141b21a3f34aa47754dd5d640de1e16583.jpg) +(a) Training loss and sharpness. (iteration 0-1000) + +![](images/dbfea2ffbf33d2a65509e8924baf9e0221a539ae7430ef0593c3c08375e444bf.jpg) +(b) Training trajectory. (iteration 0-1000) + +![](images/31b075eccfa9da1ac47380dc9a6b0a96f19011ada9c06955be6f3d6632d459bf.jpg) +(c) Training loss and sharpness. (iteration 0-1000000) + +![](images/bc589fa58a29ff9638c46be998e281b929e036653b731d394257a1b00f2ea4c9.jpg) +(d) Training trajectory. (iteration 0-1000000) +Figure 27: Training Trajectory of Degree-4 Model with Label Noise. $(\eta = 0.2)$ We plot the loss, sharpness, and training trajectory of the label noise model with $\sigma = 0.01$ . The label noise model first follows a trajectory similar to the original GD training trajectory and reaches near the EoS minimum as shown in (a, b). Then it follows the sharpness reduction flow along the manifold of minima and reaches the flattest minima as shown in (c, d). + +# Gradient Noise: + +For gradient noise model, we sample a perturbation of $(\delta, \delta')$ from a 2-dimensional spherical Gaussian $\mathcal{N}(0, \sigma^2 I_2)$ at each iteration and apply this perturbation to the gradient before we update the parameter. The one-step dynamics with gradient noise $(\delta, \delta')$ is then: + +$$ +x _ {t + 1} = x _ {t} - \eta (x _ {t} y _ {t} ^ {2} (x _ {t} ^ {2} y _ {t} ^ {2} - 1) + \delta), y _ {t + 1} = y _ {t} - \eta (x _ {t} ^ {2} y _ {t} (x _ {t} ^ {2} y _ {t} ^ {2} - 1) + \delta^ {\prime}). +$$ + +With gradient noise, the initial parabolic trajectory can still be observed as shown in Fig. 28b. As the model reaches close to the manifold of global minima near the tip of the parabola, it no longer follows a monotone sharpness reduction flow (as in Fig. 27c for the label noise case) but instead randomly oscillates along the manifold of global minima between the two EoS minima. We believe this is due to the component of the gradient noise parallel to the minima manifold, which dominates the sharpness reduction effect. + +![](images/422e139c1272e61c4e1050fc4dcccdee63ab5f55d1bbcec3f68f557a74a6f0e0.jpg) +(a) Training loss and sharpness. (iteration 0-500000) + +![](images/ff761f9afe1d359ca1d0dc19edb65316c42267f78c379f2265405ea1cf136ab6.jpg) +(b) Training trajectory. (iteration 0-500000) + +![](images/9689970c535f330d73af32dc8cab3e2d3addb9a5d589ead0c52bd785a5ade1d7.jpg) +(c) Training loss and sharpness. (iteration 0-500000) + +![](images/2fa56cdb73e5a68ff740211bb8ab1776e27e4d125d2b8d6154784c5bf6f76345.jpg) +(d) Training trajectory. (iteration 0-500000) +Figure 28: Training Trajectory of Degree-4 Model with Gradient Noise. $(\eta = 0.2)$ We plot the loss, sharpness, and training trajectory of the gradient noise model with $\sigma = 0.01$ . Like the label noise model, the gradient noise model first follows a trajectory similar to the original GD training trajectory and reaches near the EoS minimum as shown in (a, b). After getting around the EoS-minimum, the parameter begins to randomly oscillate and traverse around the manifold of global minima between the two EoS minima as shown in (c,d). It is likely that the gradient noise finally converges to some distribution along the manifold of global minima. + +# A.7.2 MINIBATCH SGD FOR OVER-PARAMETERIZED MODELS + +In this section, we empirically investigate what happens to the converging sharpness when overparameterized network are trained with minibatch SGD. We use the same 5-layer FC models and dataset as used in Section 6. Other than full-batch gradient descent, we also train the models with mini-batch gradient descent with varying batchsizes and record their converging sharpness. + +![](images/e3cb1e462f8864d4aff1efcd1fa0dd750e2ecaf56a4cc26baec4315eba80bc28.jpg) +(a) 5-layer FC network with ELU activation + +![](images/a78bc0f847a89c2d51629ba65b6c3ab98b8655bc9e8c553c4de840690a58e5b2.jpg) +(b) 5-layer FC network with tanh activation +Figure 29: FC networks trained with SGD of varying batchesizes. $(\eta = 0.005, 0.01, 0.02)$ + +For each learning rate and batchsize, we train 10 models from different random initialization for 20000 epochs and record their converging sharpness. The standard deviation of sharpness is represented by the shaded area. (The loss of all models converges to lower than $10^{-8}$ ). When the batch size of SGD is large, the converging sharpness is close to $2 / \eta$ , which is very similar to the gradient descent cases. On the other hand, the converging sharpness is significantly lower when the batch size is small compared with the dataset. It is worth noting that the converging sharpness for each batch size is quite concentrated. + +Instead of going to the flattest minima (as in the label noise case) or randomly oscillating below the EoS threshold (as in the gradient noise case), the converging minima of overparameterized deep networks trained with mini-batch SGD have highly concentrated sharpness that is correlated to the batch size. + +We note that a key difference between the over-parameterized mini-batch SGD and the noisy GD experiment discussed in Appendix A.7.1 is that the loss for mini-batch SGD can converge to a fixed point with loss 0 (i.e. the model can memorize all training data) while the models with fixed additive noise will not converge to a fixed point. Currently the minimalist scalar model example we analyzed can only memorize one data point. We believe it is an interesting future direction to generalize the model to memorize more data and understand why mini-batch SGD converges below the EoS threshold. + +# B THEORETICAL ANALYSIS ON THE DEGREE-4 EXAMPLE + +In this section we present the complete rigorous analysis on the training dynamics of the degree-4 example discussed in Section 3. The section will be organized in the following way: + +In Appendix B.1 we will first define the problem and two reparameterizations we used for analysis, this serves as a more comprehensive version of Section 2 in the main text. + +In Appendix B.2 we will first restate our main theorem for the degree-4 example (Theorem 3.1) along with two corollaries (Corollary 3.1, and Corollary 3.2). These theoretical results characterized the sharpness concentration and sharpness adaptivity phenomenon of the degree-4 example. Then we will provide a more comprehensive proof sketch for Theorem 3.1 that is similar to the discussion in Section 3.2 of the main text. + +Then we will provide the lemmas for dynamics approximation (Appendix B.3), phase I convergence (Appendix B.4), and phase II convergence (Appendix B.5). + +Finally, in Appendix B.6 we will use the lemmas to complete the proof for the main theorem along with its corollaries. + +# B.1 PRELIMINARIES + +We consider a simple objective function $\mathcal{L}(x,y,z,w) = \frac{1}{2} (xyzw - 1)^2$ . Denote $\gamma \coloneqq xyzw$ , then + +$$ +\nabla \mathcal {L} (x, y, z, w) = (\gamma^ {2} - \gamma) [ x, y, z, w ] ^ {- 1}, \tag {21} +$$ + +$$ +\nabla^ {2} \mathcal {L} (x, y, z, w) = (\gamma^ {2} - \gamma) \left[ \begin{array}{c c c c} \gamma^ {2} / x ^ {2} & (2 \gamma^ {2} - \gamma) / x y & (2 \gamma^ {2} - \gamma) / x z & (2 \gamma^ {2} - \gamma) / x w \\ (2 \gamma^ {2} - \gamma) / x y & \gamma^ {2} / y ^ {2} & (2 \gamma^ {2} - \gamma) / y z & (2 \gamma^ {2} - \gamma) / y w \\ (2 \gamma^ {2} - \gamma) / x z & (2 \gamma^ {2} - \gamma) / y z & \gamma^ {2} / z ^ {2} & (2 \gamma^ {2} - \gamma) / z w \\ (2 \gamma^ {2} - \gamma) / x w & (2 \gamma^ {2} - \gamma) / y w & (2 \gamma^ {2} - \gamma) / z w & \gamma^ {2} / w ^ {2} \end{array} \right]. \tag {22} +$$ + +Let the parameter $[x,y,z,w]$ to be optimized by gradient descent with step size $\eta$ , that + +$$ +[ x _ {(t + 1)}, y _ {(t + 1)}, z _ {(t + 1)}, w _ {(t + 1)} ] = [ x _ {(t)}, y _ {(t)}, z _ {(t)}, w _ {(t)} ] - \eta \nabla \mathcal {L} (x _ {(t)}, y _ {(t)}, z _ {(t)}, w _ {(t)}). \tag {23} +$$ + +To further simplify the problem, we consider the symmetric initialization of $z_0 = x_0$ , $w_0 = y_0$ . Note that due to symmetry of objective, the identical entries will remain identical throughout the training process, so the training dynamics reduces to two dimensional, and the global minima is simply $S = \{(x,y) \in \mathbb{R}^2 : x^2y^2 = 1\}$ . Computing the closed-form of the gradient, we know the 1-step update of $x$ and $y$ follows + +$$ +x _ {t + 1} = x _ {t} - x _ {t} y _ {t} ^ {2} \eta \left(x _ {t} ^ {2} y _ {t} ^ {2} - 1\right), \quad y _ {t + 1} = y _ {t} - x _ {t} ^ {2} y _ {t} \eta \left(x _ {t} ^ {2} y _ {t} ^ {2} - 1\right). \tag {24} +$$ + +Denote $\gamma = xy$ , the parameter Hessian of the objective $\mathcal{L}$ at $(x,y,x,y)$ admits eigenvalues $\lambda_{1} = x^{2}(1 - \gamma), \lambda_{2} = y^{2}(1 - \gamma)$ and + +$$ +\lambda_ {3} = \frac {1}{2} \left(\left(x ^ {2} + y ^ {2}\right) \left(3 \gamma^ {2} - 1\right) - \sqrt {\left(x ^ {2} + y ^ {2}\right) ^ {2} \left(1 - 3 \gamma^ {2}\right) ^ {2} + 4 \gamma^ {2} \left(3 - 1 0 \gamma^ {2} + 7 \gamma^ {4}\right)}\right), \tag {25} +$$ + +$$ +\lambda_ {4} = \frac {1}{2} \left(\left(x ^ {2} + y ^ {2}\right) \left(3 \gamma^ {2} - 1\right) + \sqrt {(x ^ {2} + y ^ {2}) ^ {2} (1 - 3 \gamma^ {2}) ^ {2} + 4 \gamma^ {2} (3 - 1 0 \gamma^ {2} + 7 \gamma^ {4})}\right). +$$ + +When $(x,y)$ converges to any minimum, $\gamma = x^{2}y^{2} = 1$ , so $\lambda_{1},\lambda_{2},\lambda_{3}$ all vanishes. Therefore it is $\lambda_{4}$ that corresponds to the EoS phenomenon people observe. When $\eta < \frac{1}{2}$ , solving $\lambda_{4} = 2 / \eta$ with $x^{2}y^{2} = 1$ gives + +$$ +x = \pm \frac {1}{\sqrt {2}} \left(\left(- 4 + \eta^ {- 2}\right) ^ {\frac {1}{2}} + \eta^ {- 1}\right) ^ {\frac {1}{2}}, \tag {26} +$$ + +$$ +y = \pm \sqrt {2} \left(\left(- 4 + \eta^ {- 2}\right) ^ {\frac {1}{2}} + \eta^ {- 1}\right) ^ {- \frac {1}{2}} +$$ + +and their multiplicative inverses. These solutions correspond to the minima with sharpness exactly equal to the EoS threshold of $2 / \eta$ . Since they are all symmetric with each other, without loss of generality we pick the minimum of interest as + +$$ +(\check {x}, \check {y}) \triangleq \left(\frac {1}{\sqrt {2}} \left((- 4 + \eta^ {- 2}) ^ {\frac {1}{2}} + \eta^ {- 1}\right) ^ {\frac {1}{2}}, \sqrt {2} \left((- 4 + \eta^ {- 2}) ^ {\frac {1}{2}} + \eta^ {- 1}\right) ^ {- \frac {1}{2}}\right). \tag {27} +$$ + +To better analyze the dynamics under a more natural coordinate, we consider the reparameterization that For any $(x,y)\in \{(x,y)\in \mathbb{R}^{+}\times \mathbb{R}^{+}:x > y\}$ , define + +$$ +c \triangleq (x ^ {2} - y ^ {2}) ^ {\frac {1}{2}}, \quad d \triangleq x y. \tag {28} +$$ + +This gives a bijective continuous mapping between $\{(x,y) \in \mathbb{R}^{+} \times \mathbb{R}^{+} : x > y\}$ and $\{(c,d) \in \mathbb{R}^{+} \times \mathbb{R}^{+}\}$ . Intuitively, we are taking the lower half of $y = 1 / x$ on the positive quadrant as $d = 1$ . With $c, d$ as defined, the $\eta$ -EoS minimum simplifies to $(\check{c}, \check{d}) \triangleq ((\eta^{-2} - 4)^{\frac{1}{4}}, 1)$ . The inverse map can be computed as + +$$ +x = \frac {\sqrt {c ^ {2} + \sqrt {c ^ {4} + 4 d ^ {2}}}}{\sqrt {2}}, \quad y = \frac {\sqrt {2} d}{\sqrt {c ^ {2} + \sqrt {c ^ {4} + 4 d ^ {2}}}}. \tag {29} +$$ + +To expand the dynamics near the $\eta$ -EoS minimum, we define + +$$ +a \triangleq c - \left(\eta^ {- 2} - 4\right) ^ {\frac {1}{4}}, \quad b \triangleq d - 1 \tag {30} +$$ + +to be the offset from $(\check{c},\check{d})$ . Our analysis will primarily be using the $(a,b)$ -parameterization. To summarize, the $(c,d)$ and $(a,b)$ reparameterization of $(x,y)$ are respectively given by + +$$ +(c, d) \triangleq \left(\left(x ^ {2} - y ^ {2}\right) ^ {\frac {1}{2}}, x y\right), \quad (a, b) \triangleq \left(\left(x ^ {2} - y ^ {2}\right) ^ {\frac {1}{2}} - \left(\eta^ {- 2} - 4\right) ^ {\frac {1}{4}}, x y - 1\right). \tag {31} +$$ + +Let $\kappa \triangleq \sqrt{\eta}$ , under the reparameterization Eq. (24) becomes. + +$$ +\begin{array}{l} a _ {t + 1} = \left(\kappa^ {- 4} - 4\right) ^ {\frac {1}{4}} + \left(a _ {t} + \left(\kappa^ {- 4} - 4\right) ^ {\frac {1}{4}}\right) \left(1 - \left((1 + b _ {t}) ^ {3} - (1 + b _ {t})\right) ^ {2} \kappa^ {4}\right) ^ {\frac {1}{2}}, \\ b _ {t + 1} = b _ {t} + \left(\left(1 + b _ {t}\right) ^ {3} - 2 \left(1 + b _ {t}\right) ^ {5} + \left(1 + b _ {t}\right) ^ {7}\right) \kappa^ {4} \tag {32} \\ + \left((1 + b _ {t}) - (1 + b _ {t}) ^ {3}\right) \left(4 (1 + b _ {t}) ^ {2} \kappa^ {4} + (a _ {t} \kappa + (1 - 4 \kappa^ {4}) ^ {\frac {1}{4}}) ^ {4}\right) ^ {\frac {1}{2}}. \\ \end{array} +$$ + +# B.2 THEORETICAL RESULTS AND PROOF SKETCH + +Now with the reparameterization defined, we restate our convergence result on the 4 scalar objective and discuss the proof sketch. + +Theorem 3.1 (Sharpness Concentration). For a large enough absolute constant $K$ , suppose $\kappa < \frac{1}{2000\sqrt{2}} K^{-1}$ , and the initialization $(a_0, b_0)$ satisfies $a_0 \in (12\kappa^{\frac{5}{2}}, \frac{1}{4} K^{-2}\kappa^{-1})$ and $b_0 \in (-K^{-1}, K^{-1}) \setminus \{0\}$ . Consider the GD trajectory characterized in Eq. (6) with fixed step size $\kappa^2$ from $(a_0, b_0)$ , for any $\epsilon > 0$ there exists $T = \mathcal{O}(K^{-2}\kappa^{-\frac{15}{2}} + \log(\epsilon^{-1}) + \log(|b_0|^{-1})\kappa^{-\frac{7}{2}})$ such that for all $t > T$ , $|b_t| < \epsilon$ and $a_t \in (-\frac{5}{3}\kappa^3, -\frac{1}{10}\kappa^3)$ . + +# B.2.1 PROOF SKETCH OF THEOREM 3.1 + +Our analysis begins with approximating the local movement using primarily Taylor expansion around the $\kappa^2$ -EoS Minimum (Appendix B.3). We show that for initialization within a local region of width $2K^{-2}\kappa^{-1}$ and height $2K^{-1}$ centered at the $\kappa^2$ -EoS minimum (condition B.1), the local two-step update of $a$ and $b$ can be characterized by + +$$ +a ^ {\prime \prime} = a - 4 b ^ {2} \kappa^ {3} + R _ {a}, \quad b ^ {\prime \prime} = b - 1 6 b ^ {3} + 8 a b \kappa + R _ {b}. \tag {33} +$$ + +Where $R_{a}, R_{b}$ are remainders that we can effectively bound (Corollary B.1). We note that in the region we are considering, $a$ is always monotonically decreasing at $b^{2}\kappa^{3}$ per 2 steps (Lemma 5). + +With the approximation ready, we will conduct our convergence analysis with 2 phases. + +![](images/49bebfd48967090992f17702b1ff0fcb05e6763f6395ce833f64e508a458ba6f.jpg) +Figure 30: Convergence Diagram for GD on the 4 scalar example. The horizontal directions represent $a$ and the vertical direction represents $b$ . The arrows indicate the directions of local 2-step movement. This diagram is for demonstration and ratios are not exact. + +In Phase 1 (Appendix B.4), we consider all possible initializations $(a_0, b_0)$ such that $a_0 \in (12\kappa^{\frac{5}{2}}, \frac{1}{4} K^{-2}\kappa^{-1})$ and $b_0 \in (-K^{-1}, K^{-1}) \backslash \{0\}$ . We partition the region of initializations into three parts separated by $b^2 = 2a\kappa$ and $b^2 = \frac{1}{4} a\kappa$ (shown as region I, II, III in Fig. 30). + +- For initializations in region I where $b^{2} > 2a\kappa$ (condition B.3), we show that the cubic term $b^{3}$ in the expression of $b''$ in Eq. (33) dominates the $ab\kappa$ term as well as the remainder, so that the two step update on $|b|$ is monotonically decreasing with at least an additive update of $-|b^{3}|$ . Combining with slow movement of $a$ , we show that initializations in region I will quickly enter region II (Lemma 8). +- For initializations in region III where $b^{2} \in (0, \frac{1}{4} a\kappa)$ (condition B.4), we show that the $ab\kappa$ term will dominate the $b^{3}$ term and other remainders. Thus the two-step update of $|b|$ will monotonically increase with a multiplicative rate of at least $(1 + a\kappa)$ . Combining with slow movement of $a$ , we show that initializations in region III will also quickly enter region II (Lemma 9). +- For the last step in Phase 1, we show that the 2-step trajectories entering region II will stay in the region in the sense that $b^{2} \in \left(\frac{1}{4} a\kappa, 2a\kappa\right)$ . (Lemma 11) We also show that $a$ will keep decreasing and enter $\left(\frac{3}{2}\kappa^{\frac{5}{2}}, 2\kappa^{\frac{5}{2}}\right)$ . In the diagram (Fig. 30) this corresponds to the phase of entering region IV from II. + +At the end of Phase I, we would have shown that all trajectories starting from the required initialization will converge to near the parabola $b^{2} = \frac{1}{2} a\kappa$ and enter region IV from the right. + +In Phase 2 (Appendix B.5), we begin with initialization $(a_0, b_0)$ such that $a_0 \in \left(\frac{3}{2}\kappa^{\frac{5}{2}}, 2\kappa^{\frac{5}{2}}\right)$ and $b_0^2 \in \left(\frac{1}{4}a_0\kappa, 2a_0\kappa\right)$ . In phase 1 we have shown a rough convergence result close to the parabola $b^2 = \frac{1}{2}a\kappa$ with the extreme point of $(0,0)$ . In phase 2 we will change the parabola of interest to be $b^2 = \frac{1}{2}a\kappa + \frac{1}{16}\kappa^4$ which is characterized by the ODE approximation as discussed in Section 3.1. In particular we will focus on the residual $\xi \triangleq b^2 - \frac{1}{2}a\kappa - \frac{1}{16}\kappa^4$ . The phase 2 convergence has the following three stages. Throughout the analysis we fix a small constant $\delta = 0.04$ + +- Stage 1. After the trajectory enters $a \in \left(\frac{3}{2}\kappa^{\frac{5}{2}}, 2\kappa^{\frac{5}{2}}\right)$ and $b^{2} \in \left(\frac{1}{4}a\kappa^{\frac{5}{2}}, 2a\kappa^{\frac{5}{2}}\right)$ , we will show that the two-step update of $\xi$ follows $|\xi'' - (1 - 32c^{2})\xi| < \delta b^{2}\kappa^{4}$ . (Lemma 12). Then we show that $|\xi|$ will further decrease to less than $\frac{1}{8}\delta\kappa^{4}$ before $a$ decreases to less than $\kappa^{\frac{5}{2}}$ , and the trajectory will enter region V from the right (Lemma 13). +- Stage 2. After the trajectory enters region V, we will show that it will remain close to the parabola $\xi \triangleq b^{2} - \frac{1}{2} a\kappa - \frac{1}{16}\kappa^{4}$ that $|\xi|$ will remain less than $\frac{1}{8}\delta \kappa^{4}$ while $a$ decreases + +into the interval $a \in (-\frac{1}{8}(1 - 3\delta \kappa^3), -\frac{1}{10}(1 + 2\delta)\kappa^3)$ and the trajectory enters region VI (Lemma 14). + +- **Stage 3.** Finally we conclude the proof by a convergence analysis in region VI. The two-step dynamics approximation in region VI is very similar to region III, that the $ab\kappa$ term in the two-step update of $b$ will dominate. Since $a$ is now negative, $|b|$ will follow the multiplicative update $|b''| < (1 + a\kappa)|b|$ . We will also show that the movement of $a$ will be small, and the final converging minima will not be far from the extreme point $a = \frac{1}{8}\kappa^3$ (Lemma 15). + +# B.3 1 AND 2-STEP DYNAMICS OF $a$ AND $b$ + +Now we begin our rigorous analysis on the dynamics of $(a_{t},b_{t})$ . + +For simplicity of notations, when analyzing the 1-step and 2-step dynamics of $(a_{t},b_{t})$ , we use $a,a^{\prime},a^{\prime \prime}$ to denote $a_{t},a_{t + 1},a_{t + 2}$ and $b,b^{\prime},b^{\prime \prime}$ to denote $b_{t},b_{t + 1},b_{t + 2}$ . For simplicity of calculation, we consider the change of variable $\kappa = \sqrt{\eta}$ . + +In the following analysis, use operator $\mathcal{O}(\cdot)$ to only hides absolute constants that are independent of $\epsilon, \kappa, a, b$ and no asymptotic limits are taken. Concretely, for monomial $x$ and polynomial $y$ of some variables, we denote $y = \mathcal{O}(x)$ if there exists some absolute constant $K$ independent of the variables such that for any parameterization of the variables, $|y| < K|x|$ . Note that this is stronger than the usual big- $O$ notations. Throughout the analysis we will use $K$ to represent the absolute constant that uniformly upper bounds all the absolute constants of the $\mathcal{O}(\cdot)$ terms. This is well defined as we will only be considering finite number of $\mathcal{O}(\cdot)$ terms. + +# B.3.1 ONE STEP DYNAMICS APPROXIMATION OF $a$ AND $b$ + +Lemma 1. Fix any positive $\epsilon$ that $\epsilon < 0.5$ , for any $\kappa \in (0, \epsilon^{\frac{1}{4}})$ , for all $(a, b)$ such that $|a| < \epsilon \kappa^{-1}$ and $|b| < \min \{1, \frac{1}{5} \epsilon \kappa^{-2}\}$ , we have + +$$ +a ^ {\prime} = a - 2 b ^ {2} \kappa^ {3} + \mathcal {O} \left(\epsilon b ^ {2} \kappa^ {3}\right) + \mathcal {O} \left(b ^ {2} \kappa^ {4}\right). \tag {34} +$$ + +Proof of Lemma 1. Recall from Eq. (32) that + +$$ +a ^ {\prime} = \left(a + \left(\kappa^ {- 4} - 4\right) ^ {\frac {1}{4}}\right) \left(1 - b ^ {2} (1 + b) ^ {2} (2 + b) ^ {2} \kappa^ {4}\right) ^ {\frac {1}{2}} - \left(\kappa^ {- 4} - 4\right) ^ {\frac {1}{4}}. \tag {35} +$$ + +Since $\left(\kappa^{-4} - 4\right)^{\frac{1}{4}}$ will approach infinity as $\kappa$ goes to 0, we instead analyze + +$$ +\kappa a ^ {\prime} = \left(\kappa a + \left(1 - 4 \kappa^ {4}\right) ^ {\frac {1}{4}}\right) \left(1 - b ^ {2} (1 + b) ^ {2} (2 + b) ^ {2} \kappa^ {4}\right) ^ {\frac {1}{2}} - \left(1 - 4 \kappa^ {4}\right) ^ {\frac {1}{4}}. \tag {36} +$$ + +Note that $\left(1 - b^{2}(1 + b)^{2}(2 + b)^{2}\kappa^{4}\right)^{\frac{1}{2}}$ will be close to $1 - 2b^{2}(1 + b)^{2}(2 + b)^{2}\kappa^{4}$ for not so large $b$ and $1 - 4\kappa^4$ will be close to 1 for small $\kappa$ , we will leverage these two properties to approximate $a^\prime$ . + +First observe that for any $x \in (0, 8\epsilon / (1 + 2\epsilon)^2)$ we have $1 - \frac{x}{2} - \epsilon x < \sqrt{1 - x} < 1 - \frac{x}{2}$ . Since $\epsilon < 0.5$ , $(1 + 2\epsilon)^2 < 4$ , so it is sufficient to let $x < 2\epsilon$ for the inequality to hold. + +Now we substitute $x$ by $b^{2}(1 + b)^{2}(2 + b)^{2}\kappa^{4}$ . Since $|b| < 1$ , $(1 + b)^{2}(2 + b)^{2} < 36$ . Thus when $|b| < \frac{1}{5}\epsilon\kappa^{-2}$ we have $b^{2}(1 + b)^{2}(2 + b)^{2}\kappa^{4} < 36b^{2}\kappa^{4} < 36(\frac{1}{5}\epsilon\kappa^{-2})^{2}\kappa^{4} < 2\epsilon$ , and therefore + +$$ +\begin{array}{l} \left(1 - b ^ {2} (1 + b) ^ {2} (2 + b) ^ {2} \kappa^ {4}\right) ^ {\frac {1}{2}} = 1 - \frac {1}{2} \left(b ^ {2} (1 + b) ^ {2} (2 + b) ^ {2} \kappa^ {4}\right) + \mathcal {O} (\epsilon b ^ {2} \kappa^ {4}) \tag {37} \\ = 1 - 2 b ^ {2} \kappa^ {4} + \mathcal {O} (b ^ {2} \kappa^ {5}) + \mathcal {O} (\epsilon b ^ {2} \kappa^ {4}). \\ \end{array} +$$ + +Since $1 - 4\kappa^4 >0$ , by Bernoulli inequality we have $(1 - \kappa^{4})^{4}\geq 1 - 4\kappa^{4}$ , combining with the requirement of $\kappa < \epsilon^{\frac{1}{4}}$ , we have $(1 - 4\kappa^{4})^{\frac{1}{4}}\geq 1 - \kappa^{4} > 1 - \epsilon$ . Meanwhile since we required $|d| < \epsilon \kappa^{-1}$ , $|\kappa d| < \epsilon$ , so + +$$ +\left(\kappa d + \left(1 - 4 \kappa^ {4}\right) ^ {\frac {1}{4}}\right) = 1 + \mathcal {O} (\epsilon). \tag {38} +$$ + +Combining Eq. (37) and Eq. (38) we have + +$$ +\begin{array}{l} \kappa a ^ {\prime} = \left(\kappa a + \left(1 - 4 \kappa^ {4}\right) ^ {\frac {1}{4}}\right) \left(1 - b ^ {2} (1 + b) ^ {2} (2 + b) ^ {2} \kappa^ {4}\right) ^ {\frac {1}{2}} - \left(1 - 4 \kappa^ {4}\right) ^ {\frac {1}{4}} \\ = \left(\kappa a + \left(1 - 4 \kappa^ {4}\right) ^ {\frac {1}{4}}\right) \left(1 - 2 b ^ {2} \kappa^ {4} + \mathcal {O} (b ^ {2} \kappa^ {5}) + \mathcal {O} (\epsilon b ^ {2} \kappa^ {4})\right) - \left(1 - 4 \kappa^ {4}\right) ^ {\frac {1}{4}} \\ = \kappa a \left(1 - 2 b ^ {2} \kappa^ {4} + \mathcal {O} (b ^ {2} \kappa^ {5}) + \mathcal {O} (\epsilon b ^ {2} \kappa^ {4})\right) + \left(1 - 4 \kappa^ {4}\right) ^ {\frac {1}{4}} \left(- 2 b ^ {2} \kappa^ {4} + \mathcal {O} (b ^ {2} \kappa^ {5}) + \mathcal {O} (\epsilon b ^ {2} \kappa^ {4})\right) \\ = \kappa a - \left(\kappa a + \left(1 - 4 \kappa^ {4}\right) ^ {\frac {1}{4}}\right) \left(- 2 b ^ {2} \kappa^ {4} + \mathcal {O} (b ^ {2} \kappa^ {5}) + \mathcal {O} (\epsilon b ^ {2} \kappa^ {4})\right) \\ = \kappa a - (1 + \mathcal {O} (\epsilon)) (- 2 b ^ {2} \kappa^ {4} + \mathcal {O} (b ^ {2} \kappa^ {5}) + \mathcal {O} (\epsilon b ^ {2} \kappa^ {4})) \\ = \kappa a - 2 b ^ {2} \kappa^ {4} + \mathcal {O} \left(b ^ {2} \kappa^ {5}\right) + \mathcal {O} \left(\epsilon b ^ {2} \kappa^ {4}\right). \tag {39} \\ \end{array} +$$ + +Dividing both sides by $\kappa$ completes the proof. + +![](images/abacec6b8826141c3887e235cb6f1688db823497fcbb6d7751ce690b615e0e74.jpg) + +Lemma 2. For any $\kappa \in (0,0.1)$ , for all $(a,b)$ such that $|a| < \kappa^{-1}$ and $|b| < 1$ , + +$$ +b ^ {\prime} = - b - 4 a b \kappa - 3 b ^ {2} - b ^ {3} + \mathcal {O} \left(a b ^ {2} \kappa\right) + \mathcal {O} \left(a ^ {2} b \kappa^ {2}\right) + \mathcal {O} \left(b ^ {2} \kappa^ {4}\right) + \mathcal {O} \left(b \kappa^ {5}\right). \tag {40} +$$ + +Proof of Lemma 2. For simplicity of notation, let + +$$ +\delta \triangleq \sqrt {4 \eta^ {2} (1 + b) ^ {2} + \left(a \eta^ {\frac {1}{2}} + (1 - 4 \eta^ {2}) ^ {\frac {1}{4}}\right) ^ {4}} = \sqrt {4 \kappa^ {4} (1 + b) ^ {2} + \left(a \kappa + (1 - 4 \kappa^ {4}) ^ {\frac {1}{4}}\right) ^ {4}}. \tag {41} +$$ + +Plugging Eq. (41) into Eq. (32), since $|b| < 1$ we have + +$$ +4 b ^ {2} \kappa^ {4} + 1 6 b ^ {3} \kappa^ {4} + 2 5 b ^ {4} \kappa^ {4} + 1 9 b ^ {5} \kappa^ {4} + 7 b ^ {6} \kappa^ {4} + b ^ {7} \kappa^ {4} = \mathcal {O} (b ^ {2} \kappa^ {4}). \tag {42} +$$ + +Thus + +$$ +\begin{array}{l} b ^ {\prime} = b - 2 b \delta - 3 b ^ {2} \delta - b ^ {3} \delta + 4 b ^ {2} \kappa^ {4} + 1 6 b ^ {3} \kappa^ {4} + 2 5 b ^ {4} \kappa^ {4} + 1 9 b ^ {5} \kappa^ {4} + 7 b ^ {6} \kappa^ {4} + b ^ {7} \kappa^ {4} \tag {43} \\ = b - 2 b \delta - 3 b ^ {2} \delta - b ^ {3} \delta + \mathcal {O} (b ^ {2} \kappa^ {4}) \\ \end{array} +$$ + +Since $\kappa < 0.1$ , $|a| < \kappa^{-1}$ and $|b| < 1$ , by Lemma 18 we have + +$$ +\delta = 1 + 2 a \kappa + a ^ {2} \kappa^ {2} + (4 b + 2 b ^ {2}) \kappa^ {4} + \mathcal {O} \left(\kappa^ {5}\right). \tag {44} +$$ + +Thus + +$$ +\begin{array}{l} b ^ {\prime} = b - 2 b - 4 a b \kappa - 3 b ^ {2} - 6 a b ^ {2} \kappa - b ^ {3} - 2 a b ^ {3} \kappa \\ + \left(2 b + 3 b ^ {2} + b ^ {3}\right) \left(\mathcal {O} \left(a ^ {2} \kappa^ {2}\right) + \mathcal {O} \left(b \kappa^ {4}\right) + \mathcal {O} \left(\kappa^ {5}\right)\right) \tag {45} \\ = - b - 4 a b \kappa - 3 b ^ {2} - b ^ {3} + \mathcal {O} (a b ^ {2} \kappa) + \mathcal {O} \left(a ^ {2} b \kappa^ {2}\right) + \mathcal {O} \left(b ^ {2} \kappa^ {4}\right) + \mathcal {O} \left(b \kappa^ {5}\right). \\ \end{array} +$$ + +![](images/2db34e5b53a3f04b5f58a30f727176db8ba059f937097a66bba634d5c6df528e.jpg) + +Combining the conditions required by Lemma 1 and Lemma 2 we have + +Condition B.1 (One-step Dynamics Approximation Condition). + +$$ +\epsilon < 0. 5, +$$ + +$$ +\kappa < \min \{0. 1, \epsilon^ {\frac {1}{4}} \}, \tag {46} +$$ + +$$ +\left| a \right| < \epsilon \kappa^ {- 1}, +$$ + +$$ +| b | < \min \{1, \frac {1}{5} \epsilon \kappa^ {- 2} \}. +$$ + +When condition B.1 is satisfied, we have + +$$ +\begin{array}{l} a ^ {\prime} = a - 2 b ^ {2} \kappa^ {3} + \mathcal {O} \left(\epsilon b ^ {2} \kappa^ {3}\right) + \mathcal {O} \left(b ^ {2} \kappa^ {4}\right), \tag {47} \\ b ^ {\prime} = - b - 4 a b \kappa - 3 b ^ {2} - b ^ {3} + \mathcal {O} (a b ^ {2} \kappa) + \mathcal {O} (a b ^ {2} \kappa^ {2}) + \mathcal {O} (b ^ {2} \kappa^ {4}) + \mathcal {O} (b \kappa^ {5}). \\ \end{array} +$$ + +# B.3.2 TWO STEP DYNAMICS APPROXIMATION OF $a$ AND $b$ + +Now we approximate the 2-step dynamics for $(a,b)$ . + +Lemma 3. Fix some positive constant $\epsilon < 0.1$ , with $\kappa, a, b$ satisfying condition B.1, + +$$ +b ^ {\prime \prime} = b - 1 6 b ^ {3} + 8 a b \kappa + \mathcal {O} (b ^ {4}) + \mathcal {O} (a b ^ {2} \kappa) + \mathcal {O} \left(a ^ {2} b \kappa^ {2}\right) + \mathcal {O} \left(b ^ {2} \kappa^ {4}\right) + \mathcal {O} \left(b \kappa^ {5}\right) + \mathcal {O} \left(\epsilon b ^ {2} \kappa^ {3}\right). \tag {48} +$$ + +Proof. Combining the one step dynamics characterized in Lemma 1 and Lemma 2 we have + +$$ +b ^ {\prime \prime} = - b ^ {\prime} - 4 a ^ {\prime} b ^ {\prime} \kappa - 3 b ^ {\prime 2} - b ^ {\prime 3} + \mathcal {O} \left(a ^ {\prime 2} b ^ {\prime} \kappa^ {2}\right) + \mathcal {O} \left(a ^ {\prime} b ^ {\prime 2} \kappa\right) + \mathcal {O} \left(b ^ {\prime 2} \kappa^ {4}\right) + \mathcal {O} \left(b ^ {\prime} \kappa^ {5}\right). \tag {49} +$$ + +We will analyze these terms one by one. + +$$ +\begin{array}{l} a ^ {\prime} b ^ {\prime} \kappa = \kappa \left(a - 2 b ^ {2} \kappa^ {3} + \mathcal {O} \left(\epsilon b ^ {2} \kappa^ {3}\right) + \mathcal {O} \left(b ^ {2} \kappa^ {4}\right)\right) (- b - 4 a b \kappa - 3 b ^ {2} - b ^ {3} + \mathcal {O} (a b ^ {2} \kappa) \\ \left. + \mathcal {O} \left(a ^ {2} b \kappa^ {2}\right) + \mathcal {O} \left(b ^ {2} \kappa^ {4}\right) + \mathcal {O} \left(b \kappa^ {5}\right)\right) \\ = a \kappa (- b - 4 a b \kappa - 3 b ^ {2} - b ^ {3} + \mathcal {O} (a b ^ {2} \kappa) + \mathcal {O} (a ^ {2} b \kappa^ {2}) + \mathcal {O} (b ^ {2} \kappa^ {4}) + \mathcal {O} (b \kappa^ {5})) \tag {50} \\ - 2 b ^ {2} \kappa^ {4} (- b - 4 a b \kappa - 3 b ^ {2} - b ^ {3} + \mathcal {O} (a b ^ {2} \kappa) + \mathcal {O} (a ^ {2} b \kappa^ {2}) + \mathcal {O} (b ^ {2} \kappa^ {4}) + \mathcal {O} (b \kappa^ {5})) \\ + \mathcal {O} (\epsilon b ^ {2} \kappa^ {3}) + \mathcal {O} (b ^ {2} \kappa^ {4}) \\ = - a b \kappa + \mathcal {O} \left(a b ^ {2} \kappa\right) + \mathcal {O} \left(a ^ {2} b \kappa^ {2}\right) + \mathcal {O} \left(b ^ {2} \kappa^ {4}\right) + \mathcal {O} \left(b \kappa^ {5}\right) + \mathcal {O} \left(\epsilon b ^ {2} \kappa^ {3}\right), \\ \end{array} +$$ + +$$ +\begin{array}{l} b ^ {\prime 2} = \left(- b - 4 a b \kappa - 3 b ^ {2} - b ^ {3} + \mathcal {O} (a b ^ {2} \kappa) + \mathcal {O} (a ^ {2} b \kappa^ {2}) + \mathcal {O} (b ^ {2} \kappa^ {4}) + \mathcal {O} (b \kappa^ {5})\right) ^ {2} \\ = \left(b (- 1 - 4 a \kappa - 3 b - b ^ {2}) + \mathcal {O} (a b ^ {2} \kappa) + \mathcal {O} \left(a ^ {2} b \kappa^ {2}\right) + \mathcal {O} \left(b ^ {2} \kappa^ {4}\right) + \mathcal {O} \left(b \kappa^ {5}\right)\right) ^ {2} \tag {51} \\ = \left(- b - 4 a b \kappa - 3 b ^ {2} - b ^ {3}\right) ^ {2} + \mathcal {O} \left(b ^ {3} a \kappa\right) + \mathcal {O} \left(a ^ {2} b ^ {2} \kappa^ {2}\right) + \mathcal {O} \left(b ^ {3} \kappa^ {4}\right) + \mathcal {O} \left(b ^ {2} \kappa^ {5}\right) \\ = b ^ {2} + 6 b ^ {3} + \mathcal {O} (b ^ {4}) + \mathcal {O} \left(a ^ {2} b ^ {2} \kappa^ {2}\right) + \mathcal {O} \left(b ^ {3} \kappa^ {4}\right) + \mathcal {O} \left(b ^ {2} \kappa^ {5}\right), \\ \end{array} +$$ + +$$ +\begin{array}{l} b ^ {\prime 3} = \left(- b - 4 a b \kappa - 3 b ^ {2} - b ^ {3} + \mathcal {O} (a b ^ {2} \kappa) + \mathcal {O} (a ^ {2} b \kappa^ {2}) + \mathcal {O} (b ^ {2} \kappa^ {4}) + \mathcal {O} (b \kappa^ {5})\right) ^ {3} \\ = \left(b (- 1 - 4 a \kappa - 3 b - b ^ {2}) + \mathcal {O} (a b ^ {2} \kappa) + \mathcal {O} \left(a ^ {2} b \kappa^ {2}\right) + \mathcal {O} \left(b ^ {2} \kappa^ {4}\right) + \mathcal {O} \left(b \kappa^ {5}\right)\right) ^ {3} \tag {52} \\ = \left(- b - 4 a b \kappa - 3 b ^ {2} - b ^ {3}\right) ^ {3} + \mathcal {O} \left(a b ^ {2} \kappa\right) + \mathcal {O} \left(a ^ {2} b \kappa^ {2}\right) + \mathcal {O} \left(b ^ {2} \kappa^ {4}\right) + \mathcal {O} \left(b \kappa^ {5}\right) \\ = - b ^ {3} + \mathcal {O} (b ^ {4}) + \mathcal {O} \left(a ^ {2} b \kappa^ {2}\right) + \mathcal {O} \left(b ^ {2} \kappa^ {4}\right) + \mathcal {O} \left(b \kappa^ {5}\right). \\ \end{array} +$$ + +Note that $b' = \mathcal{O}(b) + \mathcal{O}(ab\kappa)$ and $a' = a + \mathcal{O}(b^2\kappa^3)$ , so + +$$ +\mathcal {O} \left(a ^ {\prime} b ^ {\prime 2} \kappa\right) = \mathcal {O} \left(a b ^ {2} \kappa\right) + \mathcal {O} \left(b ^ {3} \kappa^ {4}\right), +$$ + +$$ +\begin{array}{l} \mathcal {O} \left(a ^ {\prime 2} b ^ {\prime} \kappa^ {2}\right) = \mathcal {O} \left(a ^ {2} b \kappa^ {2}\right) + \mathcal {O} \left(a ^ {2} b \kappa^ {2}\right), \\ a ^ {(1 2, 4)} = a ^ {(1 2, 4)} - a ^ {(1 2, 5)} \end{array} \tag {53} +$$ + +$$ +\mathcal {O} \left(b ^ {\prime 2} \kappa^ {4}\right) = \mathcal {O} \left(b ^ {2} \kappa^ {4}\right) + \mathcal {O} \left(a b ^ {2} \kappa^ {5}\right), +$$ + +$$ +\mathcal {O} \left(b ^ {\prime} \kappa^ {5}\right) = \mathcal {O} \left(b \kappa^ {5}\right) + \mathcal {O} \left(a b \kappa^ {6}\right). +$$ + +Hence + +$$ +\mathcal {O} \left(b ^ {\prime 2} a ^ {\prime} \kappa\right) + \mathcal {O} \left(b ^ {\prime} a ^ {\prime 2} \kappa^ {2}\right) + \mathcal {O} \left(b ^ {\prime 2} \kappa^ {4}\right) + \mathcal {O} \left(b ^ {\prime} \kappa^ {5}\right) = \mathcal {O} \left(a b ^ {2} \kappa\right) + \mathcal {O} \left(a ^ {2} b \kappa^ {2}\right) + \mathcal {O} \left(b ^ {2} \kappa^ {4}\right) + \mathcal {O} \left(b \kappa^ {5}\right). (5 4) +$$ + +Combining above we have + +$$ +\begin{array}{l} b ^ {\prime \prime} = - (- b - 4 a b \kappa - 3 b ^ {2} - b ^ {3}) - 4 (- a b \kappa) - 3 (b ^ {2} + 6 b ^ {3}) - (- b ^ {3}) \\ + \mathcal {O} (b ^ {4}) + \mathcal {O} (a b ^ {2} \kappa) + \mathcal {O} (a ^ {2} b \kappa^ {2}) + \mathcal {O} (b ^ {2} \kappa^ {4}) + \mathcal {O} (b \kappa^ {5}) + \mathcal {O} (\epsilon b ^ {2} \kappa^ {3}) \\ = b + 8 a b \kappa - 1 6 b ^ {3} + \mathcal {O} \left(b ^ {4}\right) + \mathcal {O} \left(a b ^ {2} \kappa\right) + \mathcal {O} \left(a ^ {2} b \kappa^ {2}\right) + \mathcal {O} \left(b ^ {2} \kappa^ {4}\right) + \mathcal {O} \left(b \kappa^ {5}\right) + \mathcal {O} \left(\epsilon b ^ {2} \kappa^ {3}\right). \tag {55} \\ \end{array} +$$ + +□ + +Lemma 4. Fix some positive constant $\epsilon < 0.5$ , with $\kappa, a, b$ satisfying condition B.1, + +$$ +a ^ {\prime \prime} = a - 4 b ^ {2} \kappa^ {4} + \mathcal {O} \left(\epsilon b ^ {2} \kappa^ {3}\right) + \mathcal {O} \left(b ^ {2} \kappa^ {4}\right). \tag {56} +$$ + +Proof of Lemma 4. Combining Lemma 1 and Lemma 2 we have + +$$ +a ^ {\prime \prime} = a ^ {\prime} - 2 b ^ {\prime 2} \kappa^ {3} + \mathcal {O} \left(\epsilon b ^ {\prime 2} \kappa^ {3}\right) + \mathcal {O} \left(b ^ {\prime 2} \kappa^ {4}\right). \tag {57} +$$ + +From Eq. (51) in the proof of Lemma 3 we have + +$$ +b ^ {\prime 2} = b ^ {2} + \mathcal {O} \left(b ^ {3}\right) + \mathcal {O} \left(a ^ {2} b ^ {2} \kappa^ {2}\right) + \mathcal {O} \left(b ^ {3} \kappa^ {4}\right) + \mathcal {O} \left(b ^ {2} \kappa^ {5}\right). \tag {58} +$$ + +Hence the last three terms of Eq. (57) can be calculated that + +$$ +b ^ {\prime 2} \kappa^ {3} = b ^ {2} \kappa^ {3} + \mathcal {O} \left(b ^ {4} \kappa^ {3}\right) + \mathcal {O} \left(a ^ {2} b ^ {2} \kappa^ {5}\right) + \mathcal {O} \left(b ^ {3} \kappa^ {7}\right) + \mathcal {O} \left(b ^ {2} \kappa^ {8}\right), \tag {59} +$$ + +$$ +\begin{array}{l} \mathcal {O} (\epsilon b ^ {\prime 2} \kappa^ {3}) = \mathcal {O} (b ^ {\prime 2}) \epsilon \kappa^ {3} \\ = \mathcal {O} \left(\epsilon b ^ {3} \kappa^ {3}\right) + \mathcal {O} \left(\epsilon b ^ {4} \kappa^ {3}\right) + \mathcal {O} \left(\epsilon a ^ {2} b ^ {2} \kappa^ {5}\right) + \mathcal {O} \left(\epsilon b ^ {3} \kappa^ {7}\right) + \mathcal {O} \left(\epsilon b ^ {2} \kappa^ {8}\right) \tag {60} \\ = \mathcal {O} \left(\epsilon b ^ {2} \kappa^ {3}\right) + \mathcal {O} \left(\epsilon b \kappa^ {8}\right), \\ \end{array} +$$ + +$$ +\begin{array}{l} \mathcal {O} (b ^ {\prime 2} \kappa^ {4}) = \mathcal {O} (b ^ {\prime 2}) \kappa^ {4} \\ = \mathcal {O} \left(b ^ {2} \kappa^ {4}\right) + \mathcal {O} \left(b ^ {3} \kappa^ {4}\right) + \mathcal {O} \left(a ^ {2} b ^ {2} \kappa^ {6}\right) + \mathcal {O} \left(b ^ {3} \kappa^ {8}\right) + \mathcal {O} \left(b ^ {2} \kappa^ {9}\right) \tag {61} \\ = \mathcal {O} \left(b ^ {2} \kappa^ {4}\right) + \mathcal {O} \left(a ^ {2} b ^ {2} \kappa^ {6}\right) + \mathcal {O} \left(b ^ {2} \kappa^ {9}\right). \\ \end{array} +$$ + +Combining above we have that + +$$ +\begin{array}{l} a ^ {\prime \prime} = a ^ {\prime} - 2 b ^ {\prime 2} \kappa^ {3} + \mathcal {O} \left(\epsilon b ^ {\prime 2} \kappa^ {3}\right) + \mathcal {O} \left(b ^ {\prime 2} \kappa^ {4}\right) \\ = a - 2 b ^ {2} \kappa^ {3} + \mathcal {O} (\epsilon b ^ {2} \kappa^ {3}) + \mathcal {O} (b ^ {2} \kappa^ {4}) - 2 b ^ {2} \kappa^ {3} \\ + \mathcal {O} \left(b ^ {3} \kappa^ {3}\right) + \mathcal {O} \left(a ^ {2} b ^ {2} \kappa^ {5}\right) + \mathcal {O} \left(b ^ {3} \kappa^ {7}\right) + \mathcal {O} \left(b ^ {2} \kappa^ {8}\right) + \mathcal {O} \left(\epsilon b ^ {2} \kappa^ {3}\right) + \mathcal {O} \left(\epsilon a ^ {2} b ^ {2} \kappa^ {5}\right) \tag {62} \\ + \mathcal {O} (\epsilon b ^ {2} \kappa^ {8}) + \mathcal {O} (b ^ {2} \kappa^ {4}) + \mathcal {O} (a ^ {2} b ^ {2} \kappa^ {6}) + \mathcal {O} (b ^ {2} \kappa^ {9}). \\ = a - 4 b ^ {2} \kappa^ {3} + \mathcal {O} \left(\epsilon b ^ {2} \kappa^ {3}\right) + \mathcal {O} \left(b ^ {3} \kappa^ {3}\right) + \mathcal {O} \left(b ^ {2} \kappa^ {4}\right). \\ \end{array} +$$ + +This completes the proof. + +![](images/e7e6978b8c8d523fedbc0d979251077b62bc20e7ce398a99cb413be48e905ade.jpg) + +Combining Lemma 4 and Lemma 3, the 2-step dynamics approximation can be summarized as: + +Corollary B.1. For any positive constant $\epsilon < 0.5$ , with $\kappa, a, b$ satisfying condition B.1 we have + +$$ +b ^ {\prime \prime} = b - 1 6 b ^ {3} + 8 a b \kappa + \mathcal {O} (b ^ {4}) + \mathcal {O} (a b ^ {2} \kappa) + \mathcal {O} (a ^ {2} b \kappa^ {2}) + \mathcal {O} (b ^ {2} \kappa^ {4}) + \mathcal {O} (b \kappa^ {5}) + \mathcal {O} (\epsilon b ^ {2} \kappa^ {3}), +$$ + +$$ +a ^ {\prime \prime} = a - 4 b ^ {2} \kappa^ {3} + \mathcal {O} \left(\epsilon b ^ {2} \kappa^ {3}\right) + \mathcal {O} \left(b ^ {3} \kappa^ {3}\right) + \mathcal {O} \left(b ^ {2} \kappa^ {4}\right). \tag {63} +$$ + +# B.4 PHASE I: CONVERGENCE TO NEAR PARABOLA + +Now we show that under the $(a,b)$ parameterization, any initialization $(a_0,b_0)$ such that $a_0\in (3\kappa^{\frac{5}{2}},\frac{1}{4} K^{-2}\kappa^{-1})$ and $b_{0}\in (-K^{-1},K^{-1})$ will converge near the parabola very fast. As mentioned above, there are mainly three regimes of interest. We will first determine the region in which the two step update $b'' - b$ is solely dominated by $-b^{3}$ or $ab\kappa$ + +To formally analyze the different dynamics and characterizing the regimes for them, in this section we use $K$ to denote the uniform upper bound over the absolute constants hidden by the $\mathcal{O}(\cdot)$ operator in the 2-step dynamics approximation characterized by Corollary B.1. Since there is only finite terms with $\mathcal{O}$ -notation, such constant $K$ is well defined and independent of $\epsilon, \kappa, a, b$ . Without loss of generality we assume $K > 512$ . + +Rewriting Corollary B.1 with the uniform upper bound $K$ , we have the following corollary: + +Corollary B.2. (2-step dynamics approximation of $a$ and $b$ ) There exists some absolute constants $K$ such that for any constant $\epsilon < 0.5$ , for all $\kappa, a, b$ satisfying condition B.1, the 2-step update of $(a, b)$ can be characterized by + +$$ +a ^ {\prime \prime} = a - 4 b ^ {2} \kappa^ {3} + R _ {a}, \quad b ^ {\prime \prime} = b - 1 6 b ^ {3} + 8 a b \kappa + R _ {b}. \tag {64} +$$ + +where the remainder $R_{a}$ and $R_{b}$ have upper bound: + +$$ +\left| R _ {a} \right| < K \left| \epsilon c ^ {2} \kappa^ {3} \right| + K \left| c ^ {3} \kappa^ {3} \right| + K \left| c ^ {2} \kappa^ {4} \right|, \tag {65} +$$ + +$$ +\left| R _ {b} \right| < K \left| c ^ {4} \right| + K \left| c ^ {2} d \kappa \right| + K \left| c d ^ {2} \kappa^ {2} \right| + K \left| c ^ {2} \kappa^ {4} \right| + K \left| c \kappa^ {5} \right| + K \left| \epsilon c ^ {2} \kappa^ {3} \right|. +$$ + +Now we establish the conditions to characterize the work zones in order for the analysis to be more tractable in different regimes. + +# B.4.1 WHEN $a'' - a$ IS CLOSE TO $-4b^{2}\kappa^{3}$ + +Here we formalize the observation that when $b$ and $\kappa$ are not large, the two-step movement of $a$ is monotone and always close to $4b^{2}\kappa^{3}$ . Concretely we have the following lemma: + +Lemma 5. Fix $\epsilon = K^{-1}$ , for all $\kappa, a, b$ satisfying condition B.1 as well as the extra condition of $|\kappa| < K^{-1}$ and $|b| < K^{-1}$ , we have $|a'' - (a - 4b^2\kappa^3)| < 3b^2\kappa^3$ . + +Proof of Lemma 5. Since we assume $K > 512$ , we have $\epsilon = K^{-1} < 0.5$ as required by Corollary B.2. Since $\kappa, a, b$ satisfies condition B.1, by Corollary B.2 we have $a'' = a - 4b^2\kappa^3 + R_a$ where + +$$ +\left| R _ {a} \right| < K \left| \epsilon b ^ {2} \kappa^ {3} \right| + K \left| b ^ {3} \kappa^ {3} \right| + K \left| b ^ {2} \kappa^ {4} \right|. \tag {66} +$$ + +Thus to prove the lemma we only need to bound every term on RHS of Eq. (66) by $b^{2}\kappa^{3}$ . + +(i) Since we fixed $\epsilon = K^{-1}$ , $K\left|\epsilon b^{2}\kappa^{3}\right| = b^{2}\kappa^{3}$ . +(ii) Since $|b| < K^{-1}$ , $K\left|b^{3}\kappa^{3}\right| < K\left|K^{-1}b^{2}\kappa^{3}\right| < b^{2}\kappa^{3}$ . +(iii) Since $\kappa < K^{-1}$ $K\left|b^{2}\kappa^{4}\right| < K\left|K^{-1}b^{2}\kappa^{3}\right| < b^{2}\kappa^{3}$ + +Therefore $|R_{a}| < 3b^{2}\kappa^{3}$ which completes the proof. + +![](images/dd0b2fd6b06945f4cd27c5680720db53a8a62ecd8d84c273496cf75dd5490594.jpg) + +Note that when we fix $\epsilon = K^{-1}$ , condition B.1 becomes + +$$ +\kappa < \min \{0. 1, K ^ {- \frac {1}{4}} \}, +$$ + +$$ +\left| a \right| < K ^ {- 1} \kappa^ {- 1}, \tag {67} +$$ + +$$ +| b | < \min \{1, \frac {1}{5} K ^ {- 1} \kappa^ {- 2} \}. +$$ + +Combining with the additional condition of Lemma 5, we can summarize the condition for Lemma 5 to hold as + +$$ +\kappa < \min \{0. 1, K ^ {- \frac {1}{4}}, K ^ {- 1} \}, \tag {1} +$$ + +$$ +\left| a \right| < K ^ {- 1} \kappa^ {- 1}, \tag {68} +$$ + +$$ +| b | < \min \{1, K ^ {- 1}, \frac {1}{5} K ^ {- 1} \kappa^ {- 2} \}. \tag {3} +$$ + +With $K > 512$ , $K^{-1} < 0.1$ , so (1) can be reduced to $\kappa < K^{-1}$ . Since $\kappa < K^{-1}$ , $\frac{1}{5}\kappa^{-2} > \frac{1}{5}K^2$ , so $\frac{1}{5}K^{-1}\kappa^{-2} > \frac{1}{5}K > 1 > K^{-1}$ , and thus (3) can be reduced to $|b| < K^{-1}$ . In conclusion, the following condition is sufficient for $|a'' - (a - 4b^2\kappa^3)| < 3b^2\kappa^3$ . + +Condition B.2 (Condition for $(4\pm 3)b^{2}\kappa^{3}$ movement of $a$ + +$$ +\kappa < K ^ {- 1}, +$$ + +$$ +\left| a \right| < K ^ {- 1} \kappa^ {- 1}, \tag {69} +$$ + +$$ +| b | < K ^ {- 1}. +$$ + +# B.4.2 WHEN $-b^{3}$ DOMINATES THE DYNAMICS OF $b$ + +Lemma 6. For all $\kappa, a, b$ satisfying + +$$ +\kappa < K ^ {- 1}, +$$ + +$$ +\left| a \right| \in \left(\kappa^ {3}, K ^ {- 2} \kappa^ {- 1}\right), \tag {70} +$$ + +$$ +| b | \in (\sqrt {| a | \kappa}, K ^ {- 1}). +$$ + +We have $|b'' - (b - 16b^3)| \leq 14|b^3|$ . + +Proof of Lemma 6. First it is straightforward to check that the condition on $\kappa, a, b$ is stronger than condition B.1 if we set $\epsilon = 0.1$ , thus by Corollary B.2 we have $b'' = b - 16b^3 + 8ab\kappa + R_b$ where + +$$ +\left| R _ {b} \right| < K \left| b ^ {4} \right| + K \left| a b ^ {2} \kappa \right| + K \left| a ^ {2} b \kappa^ {2} \right| + K \left| b ^ {2} \kappa^ {4} \right| + K \left| b \kappa^ {5} \right| + K \left| e b ^ {2} \kappa^ {3} \right|. \tag {71} +$$ + +Thus to prove the claim, it is sufficient to bound $|8ab\kappa|$ by $8|b^3|$ and every term on RHS of Eq. (71) by $|b^3|$ . We will now bound them term by term. + +(i) Since $\sqrt{|a| \kappa} < |b|$ , $|a \kappa| < b^2$ , so $8|ab \kappa| = 8|b||a \kappa| < 8|b^3|$ . +(ii) Since $|b| < K^{-1}$ , $K|b^4| < K|K^{-1}b^3| = |b^3|$ . +(iii) Since $|a| < K^{-2}\kappa^{-1}$ , multiplying $K^2 |a\kappa^2|$ on both side gives $K^2 a^2\kappa^2 < |a|\kappa$ . It follows by taking square root that $K|a|\kappa < \sqrt{|a|\kappa}$ . Since $|b| > \sqrt{|a|\kappa}$ , we have $K|a|\kappa < |b|$ . Multiply $b^2$ on both side gives $K|ab^2\kappa| < |b^3|$ . +(iv) Since $|a| < K^{-2}\kappa^{-1} < K^{-1}\kappa^{-1}$ , multiply $K|a|\kappa$ on both side gives $Ka^2\kappa^2 < |a|\kappa$ and hence $\sqrt{K}|a|\kappa < \sqrt{|a|\kappa} < |b|$ . Squaring both sides and multiply by $b$ gives $K|a^2b\kappa^2| < |b^3|$ . +(v) Since $|a| > \kappa^3$ and $|b| > \sqrt{|a|\kappa}$ , we have $|b| > \kappa^2 > K\kappa^4$ . Multiplying $b^2$ on both sides, we have $K|b^2\kappa^4| < |b^3|$ . +(vi) In (v) we observe that $|b| > \kappa^2$ , so $|b| > \sqrt{K} \kappa^{\frac{5}{2}}$ and hence $b^2 > K \kappa^5$ . Multiplying $|b|$ on both side gives $K|b\kappa^3| < |b^3|$ . +(vii) Since we fixed $\epsilon = 0.1$ while $\kappa < K^{-1} < 0.1$ , we have $\epsilon \kappa < 1$ . Since $|b| > \kappa^2$ , we have $|b| > \kappa^3 \epsilon > K \epsilon \kappa^3$ . Multiply $b^2$ on both side gives $K|\epsilon c^2 \kappa^3| < |c^3|$ . + +Therefore we have $|8ab\kappa| + |R_b| < 14|c^3|$ , which completes the proof. + +![](images/966c0b9a0625ceece71bc7414bca6c1af0f1c8263251f0e2d2eecfe84e6e5603.jpg) + +We restate the sufficient condition for $|b'' - (b - 16b^3)| \leq 14|b^3|$ as follow + +Condition B.3 (Condition for $-b^3$ Dominated $b$ Movement). + +$$ +\kappa < K ^ {- 1}, +$$ + +$$ +\left| a \right| \in \left(\kappa^ {3}, K ^ {- 2} \kappa^ {- 1}\right), \tag {72} +$$ + +$$ +| b | \in (\sqrt {| a | \kappa}, K ^ {- 1}). +$$ + +# B.4.3 WHEN $ab \kappa$ DOMINATES THE $b'' - b$ + +Lemma 7. For any $\kappa, a, b$ satisfying + +$$ +\kappa < K ^ {- 1}, +$$ + +$$ +\left| a \right| \in \left(\kappa^ {3}, K ^ {- 2} \kappa^ {- 1}\right), \tag {73} +$$ + +$$ +| b | < \min \left\{\frac {1}{2 \sqrt {2}} \sqrt {| a | \kappa}, K ^ {- 1} \right\}. +$$ + +We have $|b'' - (b + 8ab\kappa)| \leq 7|ab\kappa|$ . + +Proof of Lemma 7. First fix $\epsilon = 0.5$ . It is straightforward to check that for all $\kappa, a, b$ satisfying the given condition, condition B.1 is also satisfied, so by Corollary B.2 we have $b'' = b - 16b^3 + 8ab\kappa + R_b$ where + +$$ +\left| R _ {b} \right| < K \left| b ^ {4} \right| + K \left| a b ^ {2} \kappa \right| + K \left| a ^ {2} b \kappa^ {2} \right| + K \left| b ^ {2} \kappa^ {4} \right| + K \left| b \kappa^ {5} \right| + K \left| \epsilon b ^ {2} \kappa^ {3} \right|. \tag {74} +$$ + +Thus to prove the claim, it is sufficient to bound $16|b^3|$ by $2|ab\kappa|$ , two terms in RHS of Eq. (74) by $\frac{1}{2}|b^3|$ and the remaining 4 terms by $|b^3|$ . We will now bound them term by term. + +(i) Since $|b| < \frac{1}{2\sqrt{2}}\sqrt{|a|\kappa}, b^2 < \frac{1}{8}|a|\kappa$ . Multiply $16|b|$ on both side gives $16|b^3| < 2|ab\kappa|$ . +(ii) Since $|a| < K^{-2}\kappa$ , we have $|a|\kappa < K^{-2}$ . Multiplying $a^2\kappa^2$ on both side gives $|a^3|\kappa^3 < K^{-2}a^2\kappa^3$ . If we take the 6-th root, we have $\sqrt{|a|\kappa} < (K^{-1}|a|\kappa)^{\frac{1}{3}}$ . Since $|b| < \sqrt{|a|\kappa}$ , we have $|b| < (K^{-1}|a|\kappa)^{\frac{1}{3}}$ and hence $|b^3| < K^{-1}|a|\kappa$ . Multiply $K|b|$ on both side gives $K|b^4| < |ab\kappa|$ . +(iii) Since $|b| < K^{-1}$ , multiply both side by $K|ab\kappa|$ gives $K|ab^2\kappa| < |ab\kappa|$ . +(iv) Since $|a| < K^{-2}\kappa^{-1} < \frac{1}{2} K^{-1}\kappa^{-1}$ (as we assumed $K > 512$ ), multiply both side by $|ab|\kappa^2$ gives $K|a^2b\kappa^2| < \frac{1}{2}|ab\kappa|$ . + +(v) Since $|a| > \kappa^3$ and $\kappa < K^{-1}$ , we have $|a| > \kappa^3 > K^{-2}\kappa^5 > K^2\kappa^7$ . Multiplying $K^{-2}|a|\kappa^{-6}$ on both side gives $K^{-2}a^{2}\kappa^{-6} > |a|\kappa$ . It follows by taking the square root that $\sqrt{|a|\kappa} < K^{-1}|a|\kappa^{-3}$ . Since we have $|b| < \frac{1}{2\sqrt{2}}\sqrt{|a|\kappa} < \frac{1}{2}\sqrt{|a|\kappa}$ , combining with above gives $|b| < \frac{1}{2}K^{-1}|a|\kappa^{-3}$ . Multiply $K|b|\kappa^4$ on both side gives $K|b^2\kappa^4| < \frac{1}{2}|ab\kappa|$ . +(vi) Since $|a| > \kappa^3$ , we have $|a| > K\kappa^4$ . Multiplying $|b|\kappa$ on both side gives $K|b\kappa^5| < |ab\kappa|$ . +(vii) Since $|a| > \kappa^3$ and $\epsilon = 0.5$ , we have $|a| > K^2\epsilon^2\kappa^5$ . Taking the multiplicative inverse and multiply $a^2\kappa$ on both side gives $|a|\kappa < K^{-2}\epsilon^{-2}\kappa^{-6}a^2$ . It follows by taking the square root that $\sqrt{|a|\kappa} < K^{-1}\epsilon^{-1}\kappa^{-3}|a|$ . Since $|b| < \sqrt{|a|\kappa}$ , we have $|b| < K^{-1}\epsilon^{-1}\kappa^{-3}|a|$ . Finally multiply $K\epsilon |b|\kappa^3$ on both side, we have $K|\epsilon b^2\kappa^3| < |ab\kappa|$ . + +From (i) we have $16|b^3| < 2|ab\kappa|$ , from (ii) - (vii) we have $R_b = K\left|b^4\right| + K\left|ab^2\kappa\right| + K\left|a^2b\kappa^2\right| + K\left|b^2\kappa^4\right| + K\left|b\kappa^5\right| + K\left|\epsilon b^2\kappa^3\right| < 5|ab\kappa|$ . Therefore $|b'' - (b + 8ab\kappa)| \leq 16|b^3| + R_b \leq 7|ab\kappa|$ , which completes the proof. + +We restate the sufficient condition for $|b'' - (b + 8ab\kappa)| \leq 7|ab\kappa|$ as follows: + +Condition B.4 (Condition for $ab\kappa$ Dominated $b'' - b$ Movement). + +$$ +\kappa < K ^ {- 1}, +$$ + +$$ +\left| a \right| \in \left(\kappa^ {3}, K ^ {- 2} \kappa^ {- 1}\right), \tag {75} +$$ + +$$ +| b | < \min \left\{\frac {1}{2 \sqrt {2}} \sqrt {| a | \kappa}, K ^ {- 1} \right\}. +$$ + +# B.4.4 CONVERGENCE WHEN $-b^{3}$ DOMINATES $ab\kappa$ + +Now we are ready to analyze the dynamics when $c^3$ dominates the movement of $c$ . For $t \in \mathbb{N}$ , we abuse the notation to let $(c_t, d_t)$ denote $c$ and $d$ after the $t$ -th 2-step update with step size $\eta = \kappa^2$ from the initialization $(c_0, d_0)$ . + +Lemma 8 (Convergence to near parabola from large $b$ ). For any $\kappa < K^{-1}$ , for any initialization $(a_0, b_0)$ satisfying $a_0 \in (12\kappa^{\frac{5}{2}}, \frac{1}{4}K^{-2}\kappa^{-1})$ and $|b_0| \in [2\sqrt{|a_0| \kappa}, K^{-1})$ , there exists some $T < \kappa^{-4}$ such that $a_T \in (2\kappa^{\frac{5}{2}}, K^{-2}\kappa^{-1})$ and $|b_T| \in (\sqrt{a_T \kappa}, 2\sqrt{a_T \kappa})$ . + +Proof of Lemma 8. We will prove the claim using induction. + +Consider the inductive hypothesis for $k\in \{0,1,\dots ,\lfloor \kappa^{-4}\rfloor \}$ that + +$$ +P (k): | a _ {k} | \in \left(2 \kappa^ {\frac {5}{2}}, \frac {1}{4} K ^ {- 2} \kappa^ {- 1}\right) \text {a n d} | b _ {k} | \in \left(2 \sqrt {a _ {k} \kappa}, \min \{K ^ {- 1}, (k + 1) ^ {- \frac {1}{2}}\}\right). +$$ + +Since $|b_0| < K^{-1} < 1 = (0 + 1)^{-\frac{1}{2}}$ and $a_0 \in (3\kappa^{\frac{5}{2}}, \frac{1}{4}K^{-2}\kappa^{-1}) \subset (2\kappa^{\frac{5}{2}}, \frac{1}{4}K^{-2}\kappa^{-1})$ as required by the initialization, the base case $P(0)$ holds trivially. Now we can proceed to the inductive step. + +Assume $P(l)$ holds for all $l \leq k$ , we want to show that $P(k + 1)$ holds unless $|b_{k + 1}| < 2\sqrt{|a_{k + 1}|\kappa}$ . By the inductive hypothesis, $(a_k, b_k)$ satisfies condition B.2 and condition B.3. Thus by Lemma 5 and Lemma 6 we have + +$$ +a _ {k + 1} \in \left(a _ {k} - 7 b _ {k} ^ {2} \kappa^ {3}, a _ {k} - b _ {k} ^ {2} \kappa^ {3}\right), \quad | b _ {k + 1} | \in \left(| b _ {k} | - 3 0 | b _ {k} ^ {3} |, | b _ {k} | - 2 | b _ {k} ^ {3} |\right). \tag {76} +$$ + +By the strong inductive hypothesis, these properties also hold when substituting $k$ by any $l < k$ . + +We first check the lower bound for $a_{k+1}$ under the assumption that $k < \kappa^{-4}$ . Since $a_{l+1} > a_l - 7b_l^2\kappa^3$ for all $l \leq k$ , we have + +$$ +\begin{array}{l} a _ {k + 1} > a _ {0} - \sum_ {l = 0} ^ {k} 7 b _ {l} ^ {2} \kappa^ {3} \\ > a _ {0} - \sum_ {l = 0} ^ {k} 7 \left(\left(l + 1\right) ^ {- \frac {1}{2}}\right) ^ {2} \kappa^ {3} \quad (\text {S i n c e} b _ {l} < (l + 1) ^ {- \frac {1}{2}} \text {b y I H}) \\ > 1 2 \kappa^ {\frac {5}{2}} - 7 \kappa^ {3} \sum_ {l = 0} ^ {k} \frac {1}{l + 1} \tag {77} \\ > 1 2 \kappa^ {\frac {5}{2}} - 7 \kappa^ {3} \left(1 + \int_ {1} ^ {k + 1} \frac {1}{\tau} d \tau\right) \\ = 1 2 \kappa^ {\frac {5}{2}} - 7 \kappa^ {3} (1 + \log (k + 1)). \\ \end{array} +$$ + +Under the assumption that $k < \kappa^{-4}$ and $\kappa < K^{-1} < \frac{1}{512}$ , it is not hard to check that + +$$ +1 + \log (k + 1) < 2 + \log (\kappa^ {- 4}) = 2 - 4 \log (\kappa) < \frac {1 0}{7} \kappa^ {- \frac {1}{2}}. \tag {78} +$$ + +The last inequality holds since when $\kappa = \frac{1}{512}$ we have $2 - 4\log \left(\frac{1}{512}\right) - \frac{10}{7} \left(\frac{1}{512}\right)^{-\frac{1}{2}} < -5$ and $2 + \log (\kappa^{-4}) = 2 - 4\log (\kappa)$ is monotonically increasing when $\kappa < \frac{1}{512}$ . Plugging back into Eq. (77), we know that if $P(l)$ holds for all $l \leq k$ and $k < \kappa^{-4}$ , then + +$$ +a _ {k} + 1 > 1 2 \kappa^ {\frac {5}{2}} - 7 \kappa^ {3} \left(\frac {1 0}{7} \kappa^ {- \frac {1}{2}}\right) = 1 2 \kappa^ {\frac {5}{2}} - 1 0 \kappa^ {\frac {5}{2}} = 2 \kappa^ {\frac {5}{2}}. \tag {79} +$$ + +The upper bound of $a_{k} < \frac{1}{4} K^{-2}\kappa^{-1}$ always holds since $a$ is monotonically decreasing by Eq. (76). + +Now we check the upper bound for $|b_{k + 1}|$ . Consider $f(x) = x^{-\frac{1}{2}}$ , we have $f^{\prime}(x) = -\frac{1}{2} x^{-\frac{3}{2}} = -\frac{1}{2} f(x)^{3}$ and $f''(x) = \frac{3}{4} x^{-\frac{5}{2}}$ . Note that $f''(x) > 0$ for all $x > 0$ , so by a first order Taylor expansion around $x = k + 1$ we have $f(k + 2) > f(k + 1) - \frac{1}{2} f(k + 1)^{3}$ . Combined with $|b_{k + 1}| < |b_k| - |b_k^3|$ , it follows + +$$ +\begin{array}{l} f (k + 2) - \left| b _ {k + 1} \right| \geq f (k + 1) - \frac {1}{2} f (k + 1) ^ {3} - \left| b _ {k} \right| + \left| b _ {k} ^ {3} \right| \\ = (f (k + 1) - | b _ {k} |) - \frac {1}{2} (f (k + 1) ^ {3} - | b _ {k} ^ {3} |) + \frac {1}{2} b _ {k} ^ {3} \\ \geq \left(f (k + 1) - | b _ {k} |\right) - \frac {1}{2} \left(f (k + 1) - | b _ {k} |\right) \left(b _ {k} ^ {2} + | b _ {k} | f (k + 1) + f (k + 1) ^ {2}\right) \\ = \left(f (k + 1) - \left| b _ {k} \right|\right) \left(1 - \frac {1}{2} \left(b _ {k} ^ {2} + \left| b _ {k} f (k + 1) + f (k + 1) ^ {2}\right)\right)\right). \tag {80} \\ \end{array} +$$ + +Since $f(k + 1) \leq 1$ and $|b_k| < |b_0| < K^{-1} < \frac{1}{2}$ . for all $k \geq 1$ , we have $b_k^2 + |b_k| f(k + 1) + f(k + 1)^2 < 2$ , and hence $\left(1 - \frac{1}{2} \left(b_k^2 + |b_k| f(k + 1) + f(k + 1)^2\right)\right) > 0$ . Since $|b_k| < (k + 1)^{-\frac{1}{2}} = f(k + 1)$ by the induction hypothesis, we have $f(k + 2) - |b_{t + 1}| > 0$ , so $|b_{k + 1}| < (k + 2)^{-\frac{1}{2}}$ . The other upper bound $|b_{k + 1}| < K^{-1}$ holds trivially since $|b_0| < K^{-1}$ as required by the initialization and $|b_k|$ is monotonically decreasing according to Eq. (76). + +Now we will show that there exists some $\tau < \kappa^{-4}$ that $|b_{\tau}| < 2\sqrt{|a_{\tau}|\kappa}$ . Assume toward contradiction that there is no such $\tau$ , then the induction may proceed to $h \triangleq \lfloor \kappa^{-4} \rfloor$ so that $a_{h} > 2\kappa^{\frac{5}{2}}$ , $|b_{h}| < (h + 1)^{\frac{1}{2}} < (\kappa^{-4})^{\frac{1}{2}} < \kappa^{2}$ and $|b_{h}| > 2\sqrt{a_{h}\kappa} > 2\sqrt{2\kappa^{\frac{5}{2}}\kappa} = 2\sqrt{2}\kappa^{\frac{7}{4}}$ . The last two inequalities lead to contradiction as $2\sqrt{2}\kappa^{\frac{7}{4}} > \kappa^{2}$ , so the assumption does not hold and there exists some $\tau < \kappa^{-4}$ for $|b_{\tau}| < 2\sqrt{a_{\tau}\kappa}$ . + +Let $T < \lfloor \kappa^{-4} \rfloor$ be the smallest such $\tau$ , then the induction may proceed to $k = T - 1$ , which guarantees $P(t)$ for all $t < T$ . Thus for all $t < T$ , $a_t > (2\kappa^{\frac{5}{2}}, K^{-2}\kappa^{-1})$ and $|b_t| \in (2\sqrt{a_T\kappa}, K^{-1})$ . Since $P(T - 1)$ holds, following Eq. (77) we also have $a_T > 2\kappa^{\frac{5}{2}}$ . + +Now we still need to show $|b_T| > \sqrt{a_T\kappa}$ . Since $a_{k}$ is monotonically decreasing, it is sufficient to show $|b_{T}| > \sqrt{a_{T - 1}\kappa}$ . From Eq. (76) we have $|b_{T}| > |b_{T - 1}| - 30|b_{T - 1}^{3}| = |b_{T - 1}|(1 - 30b_{T - 1}^{2})$ . Since $b_{T - 1} < K^{-1} < \frac{1}{512}$ , $(1 - 30b_{T - 1}^{2}) > \frac{1}{2}$ . Combined with $|b_{T - 1}| > 2\sqrt{a_{T - 1}\kappa}$ as shown above, we have $|b_{T}| > \frac{1}{2}(2\sqrt{a_{T - 1}\kappa}) > \sqrt{a_{T - 1}\kappa}$ , which completes the proof. + +![](images/f47ffa063d08940903f31376034a5f00da8fef862c73e9fd0f2e2feae1bd9991.jpg) + +# B.4.5 CONVERGENCE WHEN $ab\kappa$ DOMINATES $b^{3}$ + +Lemma 9 (Convergence to near parabola from small $b$ ). For any $\kappa < K^{-1}$ , for any initialization $(a_0, b_0)$ satisfying $a_0 \in (12\kappa^{\frac{5}{2}}, \frac{1}{4}K^{-2}\kappa^{-1})$ and $|b_0| \in (0, \frac{1}{4}\sqrt{a_0\kappa}]$ , there exists some $T < \frac{1}{2}\log(|b_0|^{-1})\kappa^{-\frac{7}{2}}$ such that $|b_T| \in (\frac{1}{4}\sqrt{a_T\kappa}, \frac{1}{2}\sqrt{a_T\kappa})$ and $a_T \in (2\kappa^{\frac{5}{2}}, \frac{1}{4}K^{-2}\kappa^{-1})$ . + +Proof of Lemma Lemma 9. We will prove this claim using induction. + +Consider the inductive hypothesis for $k \in \mathbb{N}$ that + +$$ +P (k): | b _ {k} | \in \left(| b _ {0} | \left(1 + 4 \kappa^ {\frac {7}{2}}\right) ^ {k}, \frac {1}{4} \sqrt {a _ {k} \kappa}\right), a _ {0} \in \left(2 \kappa^ {\frac {5}{2}}, \frac {1}{4} K ^ {- 2} \kappa^ {- 1}\right) +$$ + +$$ +\text {a n d i f} k \geq 1, (| b _ {k} | - | b _ {0} |) / (a _ {0} - a _ {k}) > \kappa^ {- \frac {5}{4}}. +$$ + +The base case when $k = 0$ holds from the initialization, so we proceed to the inductive step. Assume $P(l)$ holds for all $l \leq k$ , we want to show $P(k + 1)$ holds unless $|b_k| > \frac{1}{4}\sqrt{a_k\kappa}$ . + +First note that by the inductive hypothesis, since $a_{k} < \frac{1}{4} K^{-2}\kappa^{-1}$ , we have $|b_{k}| < \frac{1}{4}\sqrt{a_{k}\kappa} < \frac{1}{4}\sqrt{K^{-2}\kappa^{-1}\kappa} < K^{-1}$ . Combining with conditions on $|a_{k}|$ and $|b_{k}|$ from the inductive hypothesis we have $(a_{k}, b_{k})$ satisfying condition B.2 and condition B.4. Thus by Lemma 5 and Lemma 7 we have + +$$ +a _ {k + 1} \in \left(a _ {k} - 7 b _ {k} ^ {2} \kappa^ {3}, a _ {k} - b _ {k} ^ {2} \kappa^ {3}\right), \quad | b _ {k + 1} | \in \left(| b _ {k} | + 2 | a _ {k} b _ {k} \kappa |, | b _ {k} | + 1 4 | a _ {k} b _ {k} \kappa |\right). \tag {81} +$$ + +Observe that when $a$ is not too small, the movement of $b$ is significantly larger than the movement of $a$ . From Eq. (81) we have $a_{k} - a_{k + 1} < 8b_{k}^{2}\kappa^{3}$ and $|b_{k + 1}| - |b_k| > 2a_k|b_k|\kappa$ , so + +$$ +\begin{array}{l} \frac {\left| b _ {k + 1} \right| - \left| b _ {k} \right|}{a _ {k} - a _ {k + 1}} > \frac {2 a _ {k} \left| b _ {k} \right| \kappa}{8 b _ {k} ^ {2} \kappa^ {3}} = \frac {1}{\left| b _ {k} \right|} \frac {a _ {k}}{4 \kappa^ {2}} \\ > \frac {4}{\sqrt {a _ {k} \kappa}} \frac {a _ {k}}{4 \kappa^ {2}} \quad \left(\text {s i n c e} | b _ {t} | < \frac {1}{4} \sqrt {a _ {t} \kappa}\right) \tag {82} \\ = \frac {\sqrt {a _ {k}}}{\kappa^ {\frac {5}{2}}} > \kappa^ {- \frac {5}{4}}. \quad (\text {s i n c e} a _ {k} > \kappa^ {\frac {5}{2}}) \\ \end{array} +$$ + +When $k = 0$ , we directly have $(|b_1| - |b_0|) / (a_0 - a_1) > \kappa^{-\frac{5}{4}}$ . When $k \geq 1$ , from the inductive hypothesis we have $(|b_k| - |b_0|) / (a_0 - a_k) > \kappa^{-\frac{5}{4}}$ , combining with $(|b_{k + 1}| - |b_k|) / (a_k - a_{k + 1}) > \kappa^{-\frac{5}{4}}$ , we have $(|b_{k + 1}| - |b_0|) / (a_0 - a_{k + 1}) > \kappa^{-\frac{5}{4}}$ by the mediant inequality. + +Now we check the bounds on $|a_{k + 1}|$ and $|b_{k + 1}|$ . + +Since $a$ is monotonically decreasing from Eq. (81), we have $a_{k + 1} < a_0 < \frac{1}{4} K^{-2}\kappa^{-1}$ . + +Since $\left( |b_k| - |b_0| \right) / (a_0 - a_k) > \kappa^{-\frac{5}{4}}$ according to the inductive hypothesis and $(a_0 - a_k) > 0$ by monotonicity of $a$ , $a_0 - a_k < \left( |b_k| - |b_0| \right) \kappa^{\frac{5}{4}} < |b_k| \kappa^{\frac{5}{4}} < \frac{1}{4} \sqrt{a_k \kappa} \kappa^{\frac{5}{4}} = \frac{1}{4} \sqrt{a_k} \kappa^{\frac{7}{4}} < \frac{1}{4} \sqrt{a_0} \kappa^{\frac{7}{4}}$ . Here the last step holds again by monotonicity of $a$ . Reorganizing the inequality we have $a_k > a_0 - \frac{1}{4} \sqrt{a_0} \kappa^{\frac{7}{4}} = \sqrt{a_0} (\sqrt{a_0} - \frac{1}{4} \kappa^{\frac{7}{4}})$ . Since $a_0 > 12 \kappa^{\frac{5}{2}}$ by the initialization condition, $\sqrt{a_0} > 3 \kappa^{\frac{5}{4}}$ and $\sqrt{a_0} - \frac{1}{4} \kappa^{\frac{7}{4}} > 2 \kappa^{\frac{5}{4}}$ . Thus $a_k > \sqrt{a_0} (\sqrt{a_0} - \frac{1}{4} \kappa^{\frac{7}{4}}) > 6 \kappa^{\frac{5}{2}}$ . Note that since $|b_k| < K^{-1} < \frac{1}{512}$ , $7 b_k^2 \kappa^3 < 7 K^{-2} \kappa^3 < \kappa^3$ . From Eq. (81) we have $a_{k+1} > a_k - 8 b_k^2 \kappa^3 > 6 \kappa^{\frac{5}{2}} - \kappa^3 > 2 \kappa^{\frac{5}{2}}$ . This gives the desired lower bound for $a_{k+1}$ + +Since $|b_{k + 1}| > |b_k| + 2a_k|b_k| \kappa$ from Eq. (81), combining with $a_{k} > 2\kappa^{\frac{5}{2}}$ we have $|b_{k + 1}| > |b_k|(1 + 2a_k\kappa) > |b_k|(1 + 4\kappa^{\frac{5}{2}}\kappa)$ . Since $|b_{k}| > |b_{0}|(1 + 4\kappa^{\frac{7}{2}})^{k}$ by the inductive hypothesis, we have $|b_{k + 1}| > |b_0|(1 + 4\kappa^{\frac{7}{2}})^{k + 1}$ . + +With the guarantees on $|a_{k + 1}|, |b_{k + 1}|$ , and $\left( |b_k| - |b_0| \right) / (a_0 - a_k)$ as shown above, if we additionally assume that $|b_{k + 1}| < \frac{1}{4} \sqrt{a_{k + 1} \kappa}$ , $P(k + 1)$ will hold and the induction can proceed. + +Now claim that there exists some $\tau < \frac{1}{2}\log (|b_0|^{-1})\kappa^{-\frac{\tau}{2}}$ that $|b_{\tau}|\geq \frac{1}{4}\sqrt{a_{\tau}\kappa}$ . Assume toward contradiction that there is no such $\tau$ , then the induction can proceed for any $t\in \mathbb{N}$ . + +Consider $t \geq \frac{1}{2} \log (|b_0|^{-1})\kappa^{-\frac{7}{2}}$ , we have + +$$ +\begin{array}{l} t \geq \log (| b _ {0} | ^ {- 1}) (\frac {1}{4} \kappa^ {- \frac {7}{2}} + \frac {1}{4} \kappa^ {- \frac {7}{2}}) \\ > \log (| b _ {0} | ^ {- 1}) \left(1 + \frac {1}{4} \kappa^ {- \frac {7}{2}}\right) \quad \left(\text {S i n c e} \kappa^ {- \frac {7}{2}} > \frac {1}{2}\right) \\ > \left(\frac {1}{2} \log (K ^ {- 2}) + \log \left(| b _ {0} | ^ {- 1}\right)\right) \left(1 + \frac {1}{4} \kappa^ {- \frac {7}{2}}\right) \quad (\text {S i n c e} K ^ {- 2} < 0) \\ = \left(\frac {1}{2} \log \left(\left(K ^ {- 2} \kappa^ {- 1}\right) \kappa\right) + \log \left(\left| b _ {0} \right| ^ {- 1}\right)\right) \left(1 + \frac {1}{4} \kappa^ {- \frac {7}{2}}\right) \tag {83} \\ > \left(\frac {1}{2} \log \left(a _ {k} \kappa\right) + \log \left(\left| b _ {0} \right| ^ {- 1}\right)\right) \left(1 + \frac {1}{4} \kappa^ {- \frac {7}{2}}\right) \quad (\text {S i n c e} K ^ {- 2} \kappa^ {- 1} > a _ {k}) \\ = \left(\frac {1}{2} \log \left(a _ {k} \kappa\right) + \log \left(\left| b _ {0} \right| ^ {- 1}\right)\right) \left(1 + 4 \kappa^ {\frac {7}{2}}\right) / 4 \kappa^ {\frac {7}{2}} \\ = \left(\frac {1}{2} \log \left(a _ {k} \kappa\right) + \log \left(\left| b _ {0} \right| ^ {- 1}\right)\right) \log \left(1 + 4 \kappa^ {\frac {7}{2}}\right) ^ {- 1} \quad \left(\text {S i n c e} \log (1 + x) \geq x / (1 + x)\right). \\ \end{array} +$$ + +It follows that + +$$ +\begin{array}{l} t > \left(\frac {1}{2} \log (a _ {k} \kappa) + \log (| b _ {0} | ^ {- 1})\right) \log (1 + 4 \kappa^ {\frac {7}{2}}) ^ {- 1} \\ = \left(\log \left(\sqrt {a _ {k} \kappa}\right) + \log \left(| b _ {0} | ^ {- 1}\right)\right) \log \left(1 + 4 \kappa^ {\frac {7}{2}}\right) ^ {- 1} \\ > \left(\log \left(\frac {1}{4} \sqrt {a _ {k} \kappa}\right) + \log \left(| b _ {0} | ^ {- 1}\right)\right) \log \left(1 + 4 \kappa^ {\frac {7}{2}}\right) ^ {- 1} \tag {84} \\ = \log_ {\left(1 + 4 \kappa^ {\frac {7}{2}}\right)} \left(\frac {1}{4} \sqrt {a _ {t} \kappa} / | b _ {0} |\right). \\ \end{array} +$$ + +Hence $(1 + 4\kappa^{\frac{7}{2}})^t > \frac{1}{4}\sqrt{a_t\kappa} / |b_0|$ , and therefore $|b_t| > |b_0|(1 + 4\kappa^{\frac{7}{2}})^t > \frac{1}{4}\sqrt{a_t\kappa}$ , which contradicts that $P(t)$ holds and lead to contradiction. + +Therefore there must exist some $\tau$ such that $|b_{\tau}| > \frac{1}{4}\sqrt{a_{\tau}\kappa}$ . Let $T < \frac{1}{2}\log (|b_0|^{-1})\kappa^{-\frac{7}{2}}$ be the smallest such $\tau$ , then the induction will proceed to $k = T - 1$ . Moreover since $P(T - 1)$ holds, following the previous analysis, the bounds on $|a_T|$ also hold, so we have $|a_T|\in (2\kappa^{\frac{5}{2}},\frac{1}{4} K^{-2}\kappa^{-1})$ . + +Now to complete the proof we only need to show that $|b_{T}| < \frac{1}{2}\sqrt{a_{T}\kappa}$ . + +From Eq. (81) we have $|b_{T}| < |b_{T - 1}| + 14a_{T - 1}|b_{T - 1}|\kappa = (1 + 14a_{T - 1}\kappa)|b_{T - 1}|$ . Since $a_{T - 1} < \frac{1}{4} K^{-2}\kappa^{-1}$ and $K > 512$ , $(1 + 14a_{T - 1}\kappa) < (1 + 14K^{-2}) < 1.1$ . So + +$$ +\left| b _ {T} \right| < 1. 1 \left| b _ {T - 1} \right| < 1. 1 \left(\frac {1}{4} \sqrt {a _ {T - 1} \kappa}\right). \tag {85} +$$ + +On the other side, note that $a_{T} > a_{T - 1} - 7b_{T - 1}^{2}\kappa^{3}$ by Eq. (81), where $b_{T - 1}^2 < (\frac{1}{4}\sqrt{a_{T - 1}\kappa})^2 = \frac{1}{16} a_{T - 1}\kappa$ . We have $a_{T} > a_{T - 1} - \frac{7}{16} a_{T - 1}\kappa > (1 - \kappa)a_{T - 1}$ . Since $\kappa < K^{-1} < \frac{1}{512}$ , we have $a_{T} > 0.99a_{T - 1}$ and hence + +$$ +\frac {1}{4} \sqrt {a _ {T - 1} \kappa} < 1. 1 \left(\frac {1}{4} \sqrt {a _ {T} \kappa}\right). \tag {86} +$$ + +Combining Eq. (85) and Eq. (86) we have $|b_{T}| < 1.21\left(\frac{1}{4}\sqrt{a_{T}\kappa}\right) < \frac{1}{2}\sqrt{a_{T}\kappa}$ . This concludes the proof for this lemma. + +![](images/dff0d50bbd3cbebc615a5482b1327f74949b55c4c1406bcfae575401946bfeb5.jpg) + +# B.4.6 $|b|$ STAYS IN $\left(\frac{1}{4}\sqrt{a\kappa},2\sqrt{a\kappa}\right)$ AS a DECREASES WHEN a IS NOT TOO SMALL + +After showing that $b$ will enter $\left(\frac{1}{4}\sqrt{a\kappa}, 2\sqrt{a\kappa}\right)$ , we now show that it will not leave this region unless $a$ is very small. To do so, we first determine a regime in which we can effectively bound the two-step movement of $b$ . + +Lemma 10. For any $\kappa, a, b$ satisfying + +$$ +\begin{array}{l} \kappa < K ^ {- 1}, \\ \left| a \right| < \frac {1}{4} K ^ {- 2} \kappa^ {- 1}, \tag {87} \\ | b | < 2 \sqrt {a \kappa}. \\ \end{array} +$$ + +we have $|b'' - b| < \frac{1}{16}\sqrt{a\kappa}$ . + +Proof of Lemma 10. Fix $\epsilon = 0.1$ , it is straightforward to check that $\kappa, a, b$ satisfies condition B.1. Hence from Eq. (64) and Eq. (65) we have that + +$$ +\left| b ^ {\prime \prime} - b \right| < 1 6 \left| b ^ {3} \right| + 8 \left| a b \kappa \right| + K b ^ {4} + K \left| a b ^ {2} \kappa \right| + K \left| a ^ {2} b \kappa^ {2} \right| + K b ^ {2} \kappa^ {4} + K \left| b \kappa^ {5} \right| + K | \epsilon | b ^ {2} \kappa^ {3}. \tag {88} +$$ + +To prove the claim it is sufficient to bound all terms on RHS under $\frac{1}{128}\sqrt{a\kappa}$ . Note that with $b < 2\sqrt{a\kappa}$ and $a < K^{-2}\kappa^{-1}$ , $\sqrt{a\kappa} < \sqrt{K^{-2}} = K^{-1} < \frac{1}{128}$ and hence $b < 2K^{-1}$ . + +(i) Since $K > 512$ , $a\kappa < K^{-2} < \frac{1}{16384}$ . Multiplying $128\sqrt{a\kappa}$ on both sides we have $128(a\kappa)^{\frac{3}{2}} < \frac{1}{128}\sqrt{a\kappa}$ . Since $|b| < 2\sqrt{a\kappa}$ , $|b^3| < 8(a\kappa)^{\frac{3}{2}}$ , thus $16|b^3| < 128(a\kappa)^{\frac{3}{2}} < \frac{1}{128}\sqrt{a\kappa}$ . +(ii) Since $|b| < 2\sqrt{a\kappa}$ , $8|ab\kappa| < 16(a\kappa)^{\frac{3}{2}} < \frac{1}{1024}\sqrt{a\kappa}$ . The last inequality holds directly from (i). +(iii) Since $|b| < 2\sqrt{a\kappa}$ , $Kb^4 < 16Ka^2\kappa^2 = 16K(a\kappa)^{\frac{3}{2}}\sqrt{a\kappa}$ . Since $\sqrt{a\kappa} < K^{-1}$ , $16K(a\kappa)^{\frac{3}{2}}\sqrt{a\kappa} < 16K^{-2}\sqrt{a\kappa} < \frac{16}{16284}\sqrt{a\kappa} < \frac{1}{128}\sqrt{a\kappa}$ . Therefore $Kb^4 < \frac{1}{128}\sqrt{ab\kappa}$ . +(iv) Since $|b| < 2K^{-1}$ , $K|ab^2\kappa| < 2|ab\kappa|$ , which is less than $\frac{1}{512}\sqrt{a\kappa}$ from (ii). +(v) Since $|a\kappa| < K^{-1}$ , $K|ab^2\kappa^2| < |ab\kappa| < \frac{1}{1024}\sqrt{ab\kappa}$ . +(vi) Note that as $\kappa < 0.1$ in condition B.1, $\kappa^4 < \frac{1}{512}$ . Since $|b| < 2\sqrt{a\kappa} < 2K^{-1}$ , $b^2 < 4K^{-1}\sqrt{a\kappa}$ , and thus $K b^2 \kappa^4 < 4\sqrt{a\kappa} \kappa^4 < \frac{1}{128} \sqrt{a\kappa}$ . +(vii) Since $b < 2\sqrt{a\kappa}$ , $K|b\kappa^5| < 2K\kappa^5\sqrt{a\kappa}$ . Given $\kappa < K^{-1} < \frac{1}{4}K^{-\frac{1}{5}}$ , we have $\kappa^5 < \frac{1}{1024}K^{-1}$ and hence $2K\kappa^5\sqrt{a\kappa} < \frac{1}{512}\sqrt{a\kappa}$ . Thus $K|b\kappa^5| < \frac{1}{512}\sqrt{ab\kappa}$ . +(viii) Since we fixed $\epsilon = 0.1$ , $\kappa < K^{-1} < \frac{1}{512} < \frac{1}{8}\epsilon^{-\frac{1}{3}}$ , $\kappa^3 < \frac{1}{512}\epsilon^{-1}$ . Multiplying $4\epsilon \sqrt{a\kappa}$ on both sides we have $4\epsilon \sqrt{a\kappa}\kappa^3 < \frac{1}{128}\sqrt{a\kappa}$ . Since $b^2 < 4K^{-1}\sqrt{a\kappa}$ from (vi), we have $K\epsilon b^2\kappa^3 < K(4K^{-1}\sqrt{a\kappa})\kappa^3 = 4\epsilon \sqrt{a\kappa}\kappa^3 < \frac{1}{128}\sqrt{a\kappa}$ . + +Now that we have bounded every monomial term on RHS of Eq. (88) by $\frac{1}{128}\sqrt{a\kappa}$ , we have $|b'' - b| < \frac{1}{16}\sqrt{a\kappa}$ , which completes the proof. + +Here we restate the condition for Lemma 10 + +Condition B.5 (Condition for small $b$ movement). + +$$ +\kappa < K ^ {- 1}, +$$ + +$$ +\left| a \right| < K ^ {- 2} \kappa^ {- 1}, \tag {89} +$$ + +$$ +| b | < 2 \sqrt {d \kappa}. +$$ + +With the two-step movement of $c$ bounded above, we may proceed to state the lemma that guarantees $c$ will not leave $\left(\frac{1}{4}\sqrt{d\kappa}, 2\sqrt{d\kappa}\right)$ unless $d$ is very small. + +Lemma 11. For any $\kappa$ and initialization $a_0, b_0$ satisfying + +$$ +\kappa < \frac {1}{1 6} K ^ {- 1}, +$$ + +$$ +a _ {0} \in \left(\kappa^ {\frac {5}{2}}, \frac {1}{4} K ^ {- 2} \kappa^ {- 1}\right), \tag {90} +$$ + +$$ +\left| b _ {0} \right| \in \left(\frac {1}{4} \sqrt {a _ {0} \kappa}, 2 \sqrt {a _ {0} \kappa}\right). +$$ + +There exists some $T \leq 16a_0\kappa^{-\frac{13}{2}}$ such that $a_T < \kappa^{\frac{5}{2}}$ and for all $t < T$ , $a_t > \kappa^{\frac{5}{2}}$ and $b_t \in (\frac{1}{4}\sqrt{a_t\kappa}, 2\sqrt{a_t\kappa})$ . + +Proof of Lemma 11. First we check that the region defined is not empty. This is true since given $\kappa < \frac{1}{16} K^{-1}$ , we have $\frac{1}{4} K^{-2}\kappa^{-1} > 4K^{-1} > K^{-\frac{5}{2}} > \kappa^{\frac{5}{2}}$ . + +To prove the claim we consider the inductive hypothesis + +$$ +P (k) \colon a _ {k} \in (\kappa^ {\frac {5}{2}}, a _ {0} - \frac {1}{1 6} (k - 1) \kappa^ {\frac {1 3}{2}} ] \mathrm {a n d} | b _ {k} | \in (\frac {1}{4} \sqrt {a _ {k} \kappa}, 2 \sqrt {a _ {k} \kappa}). +$$ + +Assume that $P(k)$ holds for some $k$ . Since $a_{k} < a_{0} < \frac{1}{4} K^{-2}\kappa^{-1}$ , we have $|b_{k}| < 2\sqrt{a_{k}\kappa} < 2\sqrt{\frac{1}{4}K^{-2}\kappa^{-1}\kappa} = K^{-1}$ . With $\kappa < \frac{1}{16} K^{-1}$ and $a_{k} < a_{0} < \frac{1}{4} K^{-2}\kappa^{-1}$ , we have $\kappa, b_{k}, a_{k}$ satisfying condition B.2 and condition B.5. Thus $a_{k + 1} < a_{k} - b_{k}^{2}\kappa^{3}, a_{k + 1} > a_{k} - 8b_{k}^{2}\kappa^{3}$ (by Lemma 5), and $|b_{k + 1} - b_{k}| < \frac{1}{16}\sqrt{a_{k}\kappa}$ (by Lemma 10). + +Observe that since $a_{k + 1} > a_k - 8b_k^2\kappa^3$ + +$$ +\begin{array}{l} 2 \sqrt {a _ {k + 1} \kappa} > 2 \sqrt {\left(a _ {k} - 8 b _ {k} ^ {2} \kappa^ {3}\right) \kappa} \\ > 2 \sqrt {\left(a _ {k} - 8 \left(4 a _ {k} \kappa\right) \kappa^ {3}\right) \kappa} \quad (\sin \mathrm {b e} b _ {k} < 2 \sqrt {a _ {k} \kappa}) \tag {91} \\ = 2 \sqrt {(a _ {k} \kappa) (1 - 3 2 \kappa^ {4})} \\ = 2 \sqrt {1 - 3 2 \kappa^ {4}} \sqrt {a _ {k} \kappa} \\ \end{array} +$$ + +Note that with $\kappa < \frac{1}{16} K^{-1}$ where we assume $K > 128$ , we have $\sqrt{1 - 32\kappa^4} > 0.99$ and hence $\sqrt{a_{k + 1}\kappa} > 0.99\sqrt{a_k\kappa}$ . Now we will show that $b_{k + 1}$ will not leave $(\frac{1}{4}\sqrt{a_{k + 1}\kappa}, 2\sqrt{a_{k + 1}\kappa})$ . There are three cases to consider: + +1. When $|b_k| \in (\sqrt{a_k\kappa}, 2\sqrt{a_k\kappa})$ , along with $|b_k| < K^{-1}$ we have condition B.3 satisfied and thus $|b_{k+1}| < |b_k|(1 - b_k^2)$ by Lemma 6. Since $\kappa < \frac{1}{16}K^{-1} < \frac{1}{2048}$ , we have $\kappa^{\frac{1}{4}} < \frac{1}{4\sqrt{2}}$ , and thus $\kappa^{\frac{7}{4}} > 4\sqrt{2}\kappa^2$ . Moreover, since $a_k > \kappa^{\frac{5}{2}}$ , we have $|b_k| > \sqrt{a_k\kappa} > \kappa^{\frac{7}{4}} > 4\sqrt{2}\kappa^2$ . Squaring both sides we have $b_k^2 > 32\kappa^4$ . Hence $1 - 32\kappa^4 > 1 - b_k^2 > 1 - 2b_k^2 + b_k^4 = (1 - b_k^2)^2$ . The last inequality holds since $b_k^2 > b_k^4$ as $|b_k| < 1$ . Now taking the square root on both sides we have $1 - b_k^2 < \sqrt{1 - 32\kappa^4}$ . Since $|b_k| < 2\sqrt{a_k\kappa}$ , combining with Eq. (91) and $1 - b_k^2 < \sqrt{1 - 32\kappa^4}$ we have $|b_{k+1}| < 2\sqrt{a_k\kappa}(1 - b_k^2) < 2\sqrt{1 - 32\kappa^4}\sqrt{a_k\kappa} < 2\sqrt{a_{k+1}\kappa}$ , which gives the desired upper bound to $|b_{k+1}|$ . + +Now we prove the lower bound for $|b_{k + 1}|$ . Since we know $|b_{k + 1} - b_k| < \frac{1}{16}\sqrt{a_k\kappa}$ , by triangle inequality, $|b_{k}| > \sqrt{a\kappa}$ implies $|b_{k + 1}| > \frac{15}{16}\sqrt{a_k\kappa} > \frac{1}{4}\sqrt{a_k\kappa} > \frac{1}{4}\sqrt{a_{k + 1}\kappa}$ . + +2. When $|b_k| \in [\frac{1}{2\sqrt{2}}\sqrt{a_k\kappa}, \sqrt{a_k\kappa}]$ , since $|b_{k+1} - b_k| < \frac{1}{16}\sqrt{a_k\kappa}$ , by triangle inequality we have $|b_{k+1}| \in [(\frac{1}{2\sqrt{2}} - \frac{1}{16})\sqrt{a_k\kappa}, \frac{17}{16}\sqrt{a_k\kappa}]$ . Since $(\frac{1}{2\sqrt{2}} - \frac{1}{16})\sqrt{a_k\kappa} > \frac{1}{4}\sqrt{a_k\kappa} > \frac{1}{4}\sqrt{a_{k+1}\kappa}$ and $\frac{17}{16}\sqrt{a_k\kappa} < 2\sqrt{a_{k+1}\kappa}$ as $\sqrt{a_{k+1}\kappa} > 0.99\sqrt{a_k\kappa}$ , we have $|b_{k+1}| \in (\frac{1}{4}\sqrt{a_k\kappa}, 2\sqrt{a_k\kappa})$ . +3. When $|b_k| \in \left( \frac{1}{4} \sqrt{a_k \kappa}, \frac{1}{2\sqrt{2}} \sqrt{a_k \kappa} \right)$ , along with $|b_k| < K^{-1}$ we have condition B.4 satisfied, and thus $|b_{k+1}| > |b_k| + |b_k a_k \kappa| > |b_k|$ . Since $\sqrt{a_{k+1} \kappa} < \sqrt{a_k \kappa}$ , $|b_{k+1}| > \frac{1}{4} \sqrt{a_{k+1} \kappa}$ . + +On the other side, since $|b_{k+1} - b_k| < \frac{1}{16}\sqrt{a_k\kappa}$ , and $|b_k| < \frac{1}{2\sqrt{2}}\sqrt{a_k\kappa}$ , by triangle inequality we have $|b_{k+1}| < \left(\frac{1}{16} + \frac{1}{2\sqrt{2}}\right)\sqrt{a_k\kappa} < 2\sqrt{a_{k+1}\kappa}$ . The last step holds since $\sqrt{a_{k+1}\kappa} > 0.99\sqrt{a_k\kappa}$ . + +Summarizing the three cases, we know that $b_{k + 1} \in \left( \frac{1}{4} \sqrt{a_{k + 1} \kappa}, 2 \sqrt{a_{k + 1} \kappa} \right)$ . + +By the assumption of $P(k)$ we also have $a_{k} > \kappa^{\frac{5}{2}}$ and $a_{k} < a_{0} - \frac{1}{16}(k - 1)\kappa^{\frac{13}{2}}$ . Since we know $b_{k} > \frac{1}{4}\sqrt{a_{k}\kappa}$ , we have $b_{k}^{2}\kappa^{3} > \frac{1}{16}a_{k}\kappa^{4} > \frac{1}{16}\kappa^{\frac{13}{2}}$ . Thus $a_{k + 1} < a_{k} - b_{k}^{2}\kappa^{3} < a_{k} - \frac{1}{16}\kappa^{\frac{13}{2}} < a_{0} - \frac{1}{16}k\kappa^{\frac{13}{2}}$ . Therefore unless $b_{k + 1} < \kappa^{\frac{5}{2}}$ , $P(k + 1)$ holds. Note that there must be some $t$ such that $a_{t} < \kappa^{\frac{5}{2}}$ since when $t > 16a_{0}\kappa^{-\frac{13}{2}} + 1$ , $a_{0} - \frac{1}{16}(t - 1)\kappa^{\frac{13}{2}} < 0$ . We induct on $k$ from 1, the + +base case holds by the initialization of $b_{0}$ and $a_{0}$ . Let $T$ be the smallest $t$ such that $a_{t} < \kappa^{\frac{5}{2}}$ , at which we terminate the induction. Then for all $t < T$ , $a_{t} \in (\kappa^{\frac{5}{2}}, a_{0}]$ and $b_{t} \in (\frac{1}{4}\sqrt{a_{t}\kappa}, 2\sqrt{a_{t}\kappa})$ . This concludes the proof. + +Corollary B.3. Following the initialization condition and notation of Lemma 11, if $a_0 > 2\kappa^{\frac{5}{2}}$ , there exists some $\tau < T$ such that $a_t \in \left(\frac{3}{2}\kappa^{\frac{5}{2}}, 2\kappa^{\frac{5}{2}}\right)$ . + +Proof of Corollary B.3. We will follow the notations defined in the proof of Lemma 11. By definition of $T$ , $P(t)$ holds for all $t < T$ . Then for all $t < T$ , we have $a_t > \kappa^{\frac{5}{2}}$ , $b_t < K^{-1}$ , and $a_{t+1} < a_t - b_t^2 \kappa^3$ . Hence $|a_{t+1} - a_t| < K^{-2} \kappa^3 < \frac{1}{2} \kappa^{\frac{5}{2}}$ since we assumed $K > 128$ . + +Since $a_0 > 2\kappa^{\frac{5}{2}}$ and $a_T < \kappa^{\frac{5}{2}} < \frac{3}{2}\kappa^{\frac{5}{2}}$ , combining with $|a_{t + 1} - a_t| < \frac{1}{2}\kappa^{\frac{5}{2}}$ we know that there must exist some $\tau$ such that $a_{\tau} \in \left(\frac{3}{2}\kappa^{\frac{5}{2}}, 2\kappa^{\frac{5}{2}}\right)$ . + +Corollary B.4. Following Lemma 11, if $a_0 \in \left(\frac{3}{2}\kappa^{\frac{5}{2}}, 2\kappa^{\frac{5}{2}}\right)$ , $T > \frac{1}{128}\kappa^{-4}$ + +Proof of Corollary B.4. We will follow the notations defined in the proof of Lemma 11. By definition of $T$ , $P(t)$ holds for all $t < T$ . Then for all $t < T$ , we have $a_t < a_0 = 2\kappa^{\frac{5}{2}}$ and $b_t < 2\sqrt{a_t\kappa} < 2\sqrt{2}\kappa^{\frac{7}{4}}$ . It follows that $a_{t+1} > a_t - 8b_t^2\kappa^3 > a_t - 64\kappa^{\frac{13}{2}}$ . Since $a_0 - a_T > \frac{3}{2}\kappa^{\frac{5}{2}} - \kappa^{\frac{5}{2}} = \frac{1}{2}\kappa^{\frac{5}{2}}$ , we must have $T > \frac{1}{2}\kappa^{\frac{5}{2}} / 64\kappa^{\frac{13}{2}} = \frac{1}{128}\kappa^{-4}$ . + +# B.5 PHASE II: CONVERGENCE ALONG THE PARABOLA + +In Appendix B.4 we have shown that for a certain range of initializations, $(a,b)$ converges close to the parabola $2b^{2} = a\kappa$ very fast. In this section, we will show that $(a,b)$ will slowly move along the parabola, and will eventually converge to a point with sharpness just below the EoS threshold $2 / \eta = 2 / \kappa^2$ . + +To facilitate the analysis, we define the residual $\xi \triangleq b^{2} - \frac{1}{2} a\kappa -\frac{1}{16}\kappa^{4}$ and consider a small perturbation constant threshold $\delta = 0.04$ + +Follow from Corollary B.1 we have that for any $\epsilon < 0.5$ , for any $\kappa, a, b$ satisfying condition B.1, + +$$ +\begin{array}{l} \xi^ {\prime \prime} = b ^ {\prime \prime 2} - \frac {1}{2} a ^ {\prime \prime} \kappa - \frac {1}{1 6} \kappa^ {4} \\ = \left(b ^ {2} + 8 a b \kappa - 1 6 b ^ {3}\right) ^ {2} \\ + \mathcal {O} (b) \left(\mathcal {O} (b ^ {4}) + \mathcal {O} (a b ^ {2} \kappa) + \mathcal {O} (a b ^ {2} \kappa^ {2}) + \mathcal {O} (b ^ {2} \kappa^ {4}) + \mathcal {O} (b \kappa^ {5}) + \mathcal {O} (\epsilon b ^ {2} \kappa^ {3})\right) \\ - \frac {1}{2} a \kappa + 2 b ^ {2} \kappa^ {4} + \kappa \left(\mathcal {O} \left(\epsilon b ^ {2} \kappa^ {3}\right) + \mathcal {O} \left(b ^ {3} \kappa^ {3}\right) + \mathcal {O} \left(b ^ {2} \kappa^ {4}\right)\right) - \frac {1}{1 6} \kappa^ {4} \\ = b ^ {2} - 3 2 b ^ {4} + 1 6 b ^ {2} a \kappa - \frac {1}{2} a \kappa + 2 b ^ {2} \kappa^ {4} - \frac {1}{1 6} \kappa^ {4} \\ + \mathcal {O} (b ^ {5}) + \mathcal {O} (a b ^ {3} \kappa) + \mathcal {O} (a ^ {2} b ^ {2} \kappa^ {2}) + \mathcal {O} (b ^ {3} \kappa^ {4}) + \mathcal {O} (b ^ {2} \kappa^ {5}) + \mathcal {O} (\epsilon b ^ {3} \kappa^ {3}) + \mathcal {O} (\epsilon b ^ {2} \kappa^ {4}). \\ = \left(1 - 3 2 b ^ {2}\right) \left(b ^ {2} - \frac {1}{2} a \kappa - \frac {1}{1 6} \kappa^ {4}\right) + \\ + \mathcal {O} (b ^ {5}) + \mathcal {O} (a b ^ {3} \kappa) + \mathcal {O} (a ^ {2} b ^ {2} \kappa^ {2}) + \mathcal {O} (b ^ {3} \kappa^ {4}) + \mathcal {O} (b ^ {2} \kappa^ {5}) + \mathcal {O} (\epsilon b ^ {3} \kappa^ {3}) + \mathcal {O} (\epsilon b ^ {2} \kappa^ {4}) \\ = \left(1 - 3 2 b ^ {2}\right) \xi + \mathcal {O} \left(b ^ {5}\right) + \mathcal {O} \left(a b ^ {3} \kappa\right) + \mathcal {O} \left(a ^ {2} b ^ {2} \kappa^ {2}\right) + \mathcal {O} \left(b ^ {3} \kappa^ {4}\right) + \mathcal {O} \left(b ^ {2} \kappa^ {5}\right) + \mathcal {O} \left(\epsilon b ^ {3} \kappa^ {3}\right) + \mathcal {O} \left(\epsilon b ^ {2} \kappa^ {4}\right). \tag {92} \\ \end{array} +$$ + +When $|b| < \kappa$ , the above expression can be further reduced to + +$$ +\xi^ {\prime \prime} = (1 - 3 2 b ^ {2}) \xi + \mathcal {O} (b ^ {5}) + \mathcal {O} (a b ^ {3} \kappa) + \mathcal {O} (a ^ {2} b ^ {2} \kappa^ {2}) + \mathcal {O} (b ^ {3} \kappa^ {4}) + \mathcal {O} (\epsilon b ^ {2} \kappa^ {4}). \tag {93} +$$ + +Hence there exists absolute constants $K$ such that for all $\epsilon < 0.5$ , for all $a, b, \kappa$ satisfying condition B.1 and $|b| < \kappa$ , we have $\xi'' = (1 - 32b^2)\xi + R_\xi$ where + +$$ +\left| R _ {\xi} \right| < K \left| b ^ {5} \right| + K \left| a b ^ {3} \kappa \right| + K \left| a ^ {2} b ^ {2} \kappa^ {2} \right| + K \left| b ^ {3} \kappa^ {4} \right| + K \left| \epsilon b ^ {2} \kappa^ {4} \right| \tag {94} +$$ + +Now fix $\delta = 0.04$ , we will determine the regime such that $|R_{\xi}|$ is less than $\delta b^{2}\kappa^{4}$ . + +Lemma 12. For any $\kappa, a, b$ satisfying + +$$ +\kappa < \frac {1}{8 0 \sqrt {2}} \delta K ^ {- 1}, \quad | b | < 2 \sqrt {2} \kappa^ {\frac {7}{4}}, \quad | a | < 2 \kappa^ {\frac {5}{2}} \tag {95} +$$ + +where $\delta = 0.04$ , we have + +$$ +\left| \xi^ {\prime \prime} - \left(1 - 3 2 c ^ {2}\right) \xi \right| < \delta b ^ {2} \kappa^ {4}. \tag {96} +$$ + +Proof of Lemma 12. Fix $\epsilon = \frac{1}{5}\delta K^{-1}$ , claim that $\kappa, b, a$ in the given regime satisfies condition B.1. We check the conditions one by one: + +(i) Since we assume $K > 128$ , fixing $\epsilon = \frac{1}{5}\delta K^{-1}$ satisfies $\epsilon < 0.5$ +(ii) With both $\delta$ and $K^{-1}$ less than 0, $\kappa < \frac{1}{80\sqrt{2}}\delta K^{-1} < 0.1$ . Also $\frac{1}{80\sqrt{2}}\delta K^{-1} < \frac{1}{5}\delta K^{-1} = \epsilon < \epsilon^{\frac{1}{4}}$ . Thus $\kappa < \min \{0.1, \epsilon^{\frac{1}{4}}\}$ . +(iii) With $\epsilon = \frac{1}{5}\delta K^{-1}$ and $\kappa < \frac{1}{80\sqrt{2}}\delta K^{-1}$ , $\epsilon \kappa^{-1} > 16\sqrt{2} > 2\kappa^{\frac{5}{2}} > |a|$ . Thus $|a| < \epsilon \kappa^{-1}$ . +(iv) Since $\epsilon \kappa^{-1} > 16\sqrt{2}$ and $\kappa < 1$ , $\epsilon \kappa^{-2}/5 > \frac{16}{5}\sqrt{2} > 1 > 2\sqrt{2}\kappa^{\frac{7}{4}}$ . Thus $|b| < \min\{1, \epsilon \kappa^{-2}/5\}$ . + +Thus Eq. (94) applies, and we only need to bound every term on its RHS by $\frac{1}{5}\delta b^2\kappa^4$ to complete the proof. We will do that term by term. + +(i) Since $\kappa < \frac{1}{80\sqrt{2}}\delta K^{-1} < 1$ , we have $\kappa^{\frac{5}{4}} < \frac{1}{80\sqrt{2}}\delta K^{-1}$ . Multiplying $16\sqrt{2}\kappa^{4}$ on both sides we have $16\sqrt{2}\kappa^{\frac{21}{4}} < \frac{1}{5}\delta K^{-1}\kappa^{4}$ . Note that since $|b| < 2\sqrt{2}\kappa^{\frac{7}{2}}, |b^{3}| < 16\sqrt{2}\kappa^{\frac{21}{4}}$ , so $|b^{3}| < \frac{1}{5}\delta K^{-1}\kappa^{4}$ . Multiplying $K b^{2}$ on both sides gives $K|b^{5}| < \frac{1}{5}\delta b^{2}\kappa^{4}$ . +(ii) Since $\kappa^{\frac{5}{4}} < \frac{1}{80\sqrt{2}}\delta K^{-1} < \frac{1}{20\sqrt{2}}\delta K^{-1}$ , multiplying $4\sqrt{2}\kappa^{3}$ on both sides we have $4\sqrt{2}\kappa^{\frac{17}{4}} < \frac{1}{5}\delta K^{-1}\kappa^{3}$ . Note that since $|b| < 2\sqrt{2}\kappa^{\frac{7}{4}}$ and $|a| < 2\kappa^{\frac{5}{2}}$ , $|ab| < 4\sqrt{2}\kappa^{\frac{17}{4}}$ , we have $|ab| < \frac{1}{5}\delta K^{-1}\kappa^{3}$ . Multiplying $Kb^{2}\kappa$ on both sides gives $K|ab^{3}\kappa| < \frac{1}{5}\delta b^{2}\kappa^{4}$ . +(iii) Since $\kappa < \frac{1}{80\sqrt{2}}\delta K^{-1} < 1$ , we have $\kappa^3 < \kappa < \frac{1}{20}\delta K^{-1}$ . Multiplying $4\kappa^2$ on both side gives $4\kappa^5 < \frac{1}{5} K^{-1}\delta \kappa^2$ . Since $|a| < 2\kappa^{\frac{5}{2}}$ , we have $a^2 < 4\kappa^5 < \frac{1}{5} K^{-1}\delta \kappa^2$ . Multiplying $Kb^{2}\kappa^{2}$ on both side, we have $Ka^{2}b^{2}\kappa^{2} < \frac{1}{5}\delta b^{2}\kappa^{4}$ . +(iv) Since $\kappa < \frac{1}{2}$ , $2\kappa^{\frac{5}{2}} < \kappa$ . Thus $|b| < 2\kappa^{\frac{5}{2}} < \kappa < \frac{1}{80\sqrt{2}}\delta K^{-1} < \frac{1}{5}\delta K^{-1}$ . Multiplying $K b^{2}\kappa^{4}$ on both side gives $K|b^{3}\kappa^{4}| < \frac{1}{5}\delta b^{2}\kappa^{4}$ . +(v) Since we fixed $\epsilon = \frac{1}{5}\delta K^{-1}$ , $K\epsilon b^{2}\kappa^{4} = \frac{1}{5}\delta b^{2}\kappa^{4}$ . + +Therefore we have + +$$ +\left| R _ {\xi} \right| < K \left| b ^ {5} \right| + K \left| a b ^ {3} \kappa \right| + K \left| a ^ {2} b ^ {2} \kappa^ {2} \right| + K \left| b ^ {3} \kappa^ {4} \right| + K \left| \epsilon b ^ {2} \kappa^ {4} \right| < \delta b ^ {2} \kappa^ {4}. \tag {97} +$$ + +Plugging back to $\xi'' = (1 - 32b^2)\xi + R_{\xi}$ completes the proof. + +![](images/95e3285c590a853d7e0af843bedac5401386c690bb6c02baa5ee5af267f8f2ed.jpg) + +Here we restate the condition for Lemma 13: + +Condition B.6. With $\delta = 0.04$ and $K > 512$ , + +$$ +\kappa < \frac {1}{8 0 \sqrt {2}} \delta K ^ {- 1}, \quad | b | < 2 \sqrt {2} \kappa^ {\frac {7}{4}}, \quad | a | < 2 \kappa^ {\frac {5}{2}}. \tag {98} +$$ + +Corollary B.5. For any $\kappa, a, b$ satisfying condition B.6, if $|\xi| > \frac{1}{16} \delta \kappa^4$ , we have $|\xi''| < (1 - 4\kappa^{\frac{7}{2}})|\xi|$ . + +Proof of Corollary B.5. Since condition B.6 holds, by Lemma 13 we have + +$$ +\left| \xi^ {\prime \prime} \right| < \left| \left(1 - 3 2 b ^ {2}\right) \xi \right| + \delta b ^ {2} \kappa^ {4}. \tag {99} +$$ + +Thus if $|\xi| > \frac{1}{16}\delta\kappa^4$ , it follows that + +$$ +\begin{array}{l} | \xi^ {\prime \prime} | < | (1 - 3 2 b ^ {2}) \xi | + \delta b ^ {2} \kappa^ {4} \\ = (1 - 3 2 b ^ {2}) | \xi | + \delta b ^ {2} \kappa^ {4} \quad (\text {S i n c e} 3 2 b ^ {2} < 1) \\ = | \xi | - 1 6 b ^ {2} | \xi | - (1 6 b ^ {2} | \xi | - \delta b ^ {2} \kappa^ {4}) \\ < | \xi | - 1 6 b ^ {2} | \xi | - b ^ {2} \left(1 6 \left(\frac {1}{1 6} \delta \kappa^ {4}\right) - \delta \kappa^ {4}\right) (\text {S i n c e} | \xi | > \frac {1}{1 6} \delta \kappa^ {4}) \tag {100} \\ = | \xi | - 1 6 b ^ {2} | \xi | \\ < | \xi | - 4 \kappa^ {\frac {7}{2}} | \xi | \quad \left(\text {S i n c e} | b | > \frac {1}{2} \kappa^ {\frac {7}{4}}\right) \\ = \left(1 - 4 \kappa^ {\frac {7}{2}}\right) | \xi |. \\ \end{array} +$$ + +![](images/d95adeb07def94f585f792e0e10b3842579326a9f509dc8f3b78455479d3069b.jpg) + +# B.5.1 PHASE II STAGE 1 + +In this stage we will show that after $|b|$ gets close to $\sqrt{a\kappa / 2}$ while $a$ decreases to around $2\kappa^{\frac{5}{2}}$ from Phase I of the convergence, the residual of $(b,a)$ to the parabola will further decrease to below $\frac{1}{8}\delta \kappa^4$ . + +Lemma 13. For any $\kappa < \frac{1}{80\sqrt{2}}\delta K^{-1}$ , for all initialization $(b_0, a_0)$ such that $a_0 \in \left(\frac{3}{2}\kappa^{\frac{5}{2}}, 2\kappa^{\frac{5}{2}}\right)$ and $|b_0| \in \left(\frac{1}{4}\sqrt{a_0\kappa}, 2\sqrt{a_0\kappa}\right)$ . Let $T$ be the time that a exists $(\kappa^{\frac{5}{2}}, 2\kappa^{\frac{5}{2}})$ as characterized in Lemma 11 and Corollary B.4. There exists some $\tau < T$ such that $\xi_{\tau} < \frac{1}{8}\delta \kappa^{4}$ . + +Proof of Lemma 13. First note that since $\kappa < \frac{1}{80\sqrt{2}}\delta K^{-1} < \frac{1}{16}K^{-1}$ , the initialization condition given is a subset of the valid initialization for Lemma 11. Thus for all $t < T$ , we have $a_{t} \in (\kappa^{\frac{5}{2}}, 2\kappa^{\frac{5}{2}})$ and $|b_{t}| \in (\frac{1}{4}\sqrt{a_{t}\kappa}, 2\sqrt{a_{t}\kappa})$ . Hence $|b_{t}| < 2\sqrt{2\kappa^{\frac{5}{2}}\kappa} = 2\sqrt{2}\kappa^{\frac{7}{4}}$ and $|b_{t}| > \sqrt{\frac{1}{4}\kappa^{\frac{5}{2}}\kappa} = \frac{1}{2}\kappa^{\frac{7}{4}}$ . Therefore $(b_{t}, a_{t})$ satisfies condition B.6 and $|\xi_{t+1} - (1 - 32b_{t}^{2})\xi_{t}| < \delta b_{t}^{2}\kappa^{4}$ . Also note that with $K > 512$ and $\delta = 0.05$ , $b_{t}^{2} < 8\kappa^{\frac{7}{2}} < 8\kappa < \frac{1}{10\sqrt{2}}\delta K^{-1} < 1$ . + +For all $t < T$ that $|\xi_t| > \frac{1}{16}\delta \kappa^4$ , by Corollary B.5 we have $|\xi_{t + 1}| < (1 - 4\kappa^{\frac{7}{2}})|\xi_t|$ . At the initialization, we have $|\xi_1|\leq |b_0^2 | + |\frac{1}{2} a_0\kappa | + \frac{1}{16}\kappa^4 < \frac{9}{2} a_0\kappa +\frac{1}{16}\kappa^4 < 9\kappa^{\frac{7}{2}} + \frac{1}{16}\kappa^4 < 10\kappa^{\frac{7}{2}}$ . Thus for all $\tau < T$ such that for all $t < \tau$ , $|\xi_t| > \frac{1}{16}\delta \kappa^4$ , we have $|\xi_{\tau}| < (1 - 4\kappa^{\frac{7}{2}})^{\tau}10\kappa^{\frac{7}{2}}$ . Now we only need to show that $|\xi_{\tau}|$ will decrease sufficiently fast. + +Consider + +$$ +\tau = \left\lceil \log_ {\left(1 - 4 \kappa^ {\frac {7}{2}}\right)} \left(\frac {\frac {1}{8} \delta \kappa^ {4}}{1 0 \kappa^ {\frac {7}{2}}}\right)\right\rceil \geq \frac {\log \left(\frac {1}{8 0} \delta \kappa^ {\frac {1}{2}}\right)}{\log \left(1 - 4 \kappa^ {\frac {7}{2}}\right)} = \frac {\log \left(8 0 \delta^ {- 1} \kappa^ {- \frac {1}{2}}\right)}{- \log \left(1 - 4 \kappa^ {\frac {7}{2}}\right)}. \tag {101} +$$ + +Since $\log (1 - 4\kappa^{\frac{7}{2}}) < -4\kappa^{\frac{7}{2}}$ by a second order Taylor expansion, we have $\tau < \log (80\delta^{-1}\kappa^{-\frac{1}{2}}) / 4\kappa^{\frac{7}{2}}$ . Substituting $\delta = 0.04$ in the expression, $\log (80\delta^{-1}\kappa^{-\frac{1}{2}}) = \log (2000) + \log (\kappa^{-\frac{1}{2}}) < 8 + \log (\kappa^{-\frac{1}{2}})$ . Observe that for all $x > 175$ , we have $8 + \log (x) < \sqrt{x}$ . + +Since $\kappa < \frac{1}{80\sqrt{2}}\delta K^{-1} < \frac{1}{512\times 2000\sqrt{2}} < \frac{1}{175^2}$ , let $x = \kappa^{-\frac{1}{2}}$ , we have $8 + \log (\kappa^{-\frac{1}{2}}) < \kappa^{-\frac{1}{4}}$ . Hence $\log (80\delta^{-1}\kappa^{-\frac{1}{2}}) < \kappa^{-\frac{1}{4}}$ and $\tau < \kappa^{-\frac{1}{4}} / 4\kappa^{\frac{7}{2}} = \frac{1}{4}\kappa^{-\frac{15}{4}}$ . Recall from Corollary B.4 we have $T > \frac{1}{512}\kappa^{-4}$ . If we assume $K > 512$ , then $\kappa < \frac{1}{512\times 2000\sqrt{2}} < \frac{1}{32^4}$ , and thus $\kappa^{-\frac{1}{4}} > 32$ and $T > \frac{1}{512}\kappa^{-4} > \frac{1}{4}\kappa^{-\frac{15}{4}} > \tau$ . + +Since $\tau < T$ , $a_{\tau} > \kappa^{\frac{5}{2}}$ . If for all $t < \tau$ , $|\xi_t| > \frac{1}{16}\delta \kappa^4$ , then following the analysis above, by definition of $\tau$ we have $|\xi_{\tau}| < \frac{1}{8}\delta \kappa^{4}$ . If there exists some $t < \tau$ that $|\xi_t| \leq \frac{1}{16}\delta \kappa^4$ , then setting $\tau = t$ directly completes the proof. + +# B.5.2 PHASE II STAGE 2 + +In this phase, we show that once $|\xi|$ is smaller than $\frac{1}{8}\delta\kappa^4$ , $a$ will decrease slowly while $|\xi|$ does not increase beyond $\frac{1}{8}\delta\kappa^4$ . + +Lemma 14. For all $\kappa < \frac{1}{80\sqrt{2}}\delta K^{-1}$ , for all initialization $(a_0, b_0)$ satisfying $a_1 \in (\kappa^{\frac{5}{2}}, 2\kappa^{\frac{5}{2}})$ and $|\xi_1| < \frac{1}{8}\delta \kappa^4$ , there exists some $T < 48\delta^{-1}\kappa^{-\frac{9}{2}} + 1$ such that $a_T < -\frac{1}{8}(1 - 3\delta)\kappa^3$ and for all $t < T$ , $a_t > -\frac{1}{8}(1 - 3\delta)\kappa^3$ and $|\xi_k| < \frac{1}{8}\delta \kappa^4$ . + +We will prove the claim using induction. Consider the inductive hypothesis + +$$ +P (k): | \xi_ {k} | < \frac {1}{8} \delta \kappa^ {4} \text {a n d} a _ {k} \in (- \frac {1}{8} (1 - 3 \delta) \kappa^ {3}, a _ {1} - \frac {1}{1 6} \delta \kappa^ {7} k ]. +$$ + +Note that $P(0)$ holds directly from construction, so we proceed to the inductive step. Assuming $P(k)$ holds, We will show that either $a_{k} < -\frac{1}{8}(1 - 3\delta)\kappa^{3}$ or $P(k + 1)$ holds. + +First we verify that $b_{k}$ , $a_{k}$ satisfies condition B.6. Since $\delta = 0.05$ , $|- \frac{1}{8}(1 - 3\delta)\kappa^{3}| < |\frac{1}{8}\kappa^{3}| < 2\kappa^{\frac{5}{2}}$ . Also since $a_{1} < 2\kappa^{\frac{5}{2}}$ as required, we have $|a_{t}| < \max \{| - \frac{1}{8}(1 - 3\delta)\kappa^{3}|, |a_{1} - \frac{1}{16}\delta\kappa^{7}k|\} < 2\kappa^{\frac{5}{2}}$ . Since $|\xi_{k}| < \frac{1}{8}\delta\kappa^{4}$ , we have $b_{k}^{2} < \frac{1}{2}a_{k}\kappa + \frac{1}{16}\kappa^{4} + \frac{1}{8}\delta\kappa^{4} < \frac{1}{2}(2\kappa^{\frac{5}{2}}) + \kappa^{4} < 2\kappa^{\frac{7}{2}}$ . Hence $|b_{t}| < 2\sqrt{2}\kappa^{\frac{7}{4}}$ as required. Therefore we have $|\xi_{k+1} - (1 - 32b^{2})\xi_{k}| < \delta b_{k}^{2}\kappa^{4}$ . + +Next we establish the lower bounds for $|b_k|$ , which will give lower bounds for the movement of $a$ . Since $a_k > -\frac{1}{8} (1 - 3\delta)\kappa^3$ and $|\xi_k| = |b_k^2 - (\frac{1}{2}a_k\kappa + \frac{1}{16}\kappa^4)| < \frac{1}{8}\delta \kappa^4$ , we have + +$$ +c _ {k} ^ {2} > \frac {1}{2} d _ {k} \kappa + \frac {1}{1 6} \kappa^ {4} - \frac {1}{8} \delta \kappa^ {4} > \frac {1}{2} \left(- \frac {1}{8} (1 - 3 \delta) \kappa^ {3}\right) \kappa + \frac {1}{1 6} \kappa^ {4} - \frac {1}{8} \delta \kappa^ {4} = \frac {1}{1 6} \delta \kappa^ {4}. \tag {102} +$$ + +Since $|b_k| < K^{-1}$ and $|a_k| < K^{-1}$ , condition B.2 is satisfied and we have $a_{k+1} < a_k - b_k^2\kappa^3 < a_k - \frac{1}{16}\delta\kappa^4\kappa^3$ . Given that $a_k \leq a_1 - \frac{1}{16}\delta\kappa^7 k$ by the inductive hypothesis, $a_{k+1} \leq a_1 - \frac{1}{16}\delta\kappa^7 (k+1)$ . + +What remains to show for the inductive step is that $|\xi_{k + 1}| < \frac{1}{8}\delta \kappa^3$ . There are two cases to consider. When $|\xi_k| \in (\frac{1}{16}\delta \kappa^4, \frac{1}{8}\delta \kappa^4)$ , by Corollary B.5 we know $|\xi_{k + 1}| < (1 - 4\kappa^{\frac{7}{2}})|\xi_k| < |\xi_k| < \frac{1}{8}\delta \kappa^4$ . When $|\xi_k| \leq \frac{1}{16}\delta \kappa^4$ , since $|\xi_{k + 1} - (1 - 32b^{2})\xi_{k}| < \delta b_{k}^{2}\kappa^{4}$ , we have + +$$ +\left| \xi_ {k + 1} - \xi_ {k} \right| < \delta b _ {k} ^ {2} \kappa^ {4} + 3 2 b _ {k} ^ {2} \left| \xi_ {k} \right| \leq \delta b _ {k} ^ {2} \kappa^ {4} + 3 2 b _ {k} ^ {2} \left(\frac {1}{1 6} \delta \kappa^ {4}\right) = 3 \delta b _ {k} ^ {2} \kappa^ {4}. \tag {103} +$$ + +Since $b_k^2 < 2\kappa^{\frac{7}{2}} < \frac{1}{48}$ , $|\xi_{k+1} - \xi_k| < \frac{1}{48} 3\delta \kappa^4 = \frac{1}{16} \delta \kappa^4$ . Since $|\xi_k| \leq \frac{1}{16} \delta \kappa^4$ , we have $|\xi_{k+1}| \leq |\xi_{k+1} - \xi_k| + |\xi_k| \leq \frac{1}{8} \delta \kappa^4$ as desired. + +In summary we have $P(k)$ implies $P(k + 1)$ unless $a_{k + 1} < -\frac{1}{8}(1 - 3\delta)\kappa^3$ . Note that there must exist some $t$ such that $a_{t + 1} < -\frac{1}{8}(1 - 3\delta)\kappa^3$ since for any $\tau \geq 48\delta^{-1}\kappa^{-\frac{9}{2}} + 1$ , if the induction proceeds to $P(\tau)$ , then $a_1 - \frac{1}{16}\delta\kappa^7(\tau - 1) < a_1 - 3\kappa^{\frac{5}{2}} < -\kappa^{\frac{5}{2}} < -\frac{1}{8}(1 - 3\delta)\kappa^3$ , which violates $P(\tau)$ . Let $T < 48\delta^{-1}\kappa^{-\frac{9}{2}} + 1$ be the first $t$ such that $a_t < -\frac{1}{8}(1 - 3\delta)\kappa^3$ , then by construction we have for all $t < T$ , $P(t)$ holds. This completes the proof of the lemma. + +Corollary B.6. Following Lemma 14, $a_{T - 1}\in (-\frac{1}{8} (1 - 3\delta)\kappa^3, - \frac{1}{10} (1 + 2\delta)\kappa^3)$ + +Proof of Corollary B.6. Denote $T - 1$ by $\tau$ , by definition of $T$ , we know $P(\tau)$ holds and therefore we have $b_{\tau}^{2} < 2\kappa^{\frac{7}{2}}$ , $a_{\tau} > -\frac{1}{8}(1 - 3\delta)\kappa^{3}$ and $a_{T} > a_{\tau} - 5b_{\tau}^{2}\kappa^{3}$ . Combining above we have $a_{T} > a_{\tau} - 10\kappa^{\frac{7}{2}}\kappa^{3}$ , so $a_{\tau} < a_{T} + 10\kappa^{\frac{13}{2}} < -\frac{1}{8}(1 - 3\delta)\kappa^{3} + 10\kappa^{\frac{13}{2}}$ . Note that since we set $\delta = 0.04$ , we have + +$$ +- \frac {1}{1 0} (1 + 2 \delta) \kappa^ {3} - (- \frac {1}{8} (1 - 3 \delta) \kappa^ {3}) = (\frac {1}{4 0} - (\frac {2}{1 0} + \frac {3}{8}) \delta) \kappa^ {3} = \frac {1}{5 0 0} \kappa^ {3}. \tag {104} +$$ + +Since $\kappa^{-\frac{7}{2}} > K^{\frac{7}{2}} > 5000$ , we have $10\kappa^{\frac{13}{2}} < \frac{1}{500}\kappa^{3} = -\frac{1}{10}(1 + 2\delta)\kappa^{3} - \left(-\frac{1}{8}(1 - 3\delta)\kappa^{3}\right)$ . Adding $-\frac{1}{8}(1 - 3\delta)\kappa^{3}$ on both sides, we have $a_{\tau} < -\frac{1}{8}(1 - 3\delta)\kappa^{3} + 10\kappa^{\frac{13}{2}} < -\frac{1}{10}(1 + 2\delta)\kappa^{3}$ . Combining with $a_{\tau} > -\frac{1}{8}(1 - 3\delta)\kappa^{3}$ concludes the proof. + +# B.5.3 PHASE II STAGE 3 + +Here we state the lemma which proves the final convergence of the two step trajectory. The proof is very similar to that of Lemma 7 except $a$ is negative now and $|b|$ is decreasing. + +Lemma 15 (Final Convergence). For all $\kappa < \frac{1}{16} K^{-1}$ , for all $a_0, b_0$ satisfying $a_0 \in (-\frac{1}{8}(1 - 3\delta)\kappa^3, -\frac{1}{10}(1 + 2\delta)\kappa^3)$ and $|\xi_0| = |b_0^2 - \frac{1}{2} a_0\kappa - \frac{1}{16}\kappa^4| < \frac{1}{8}\delta\kappa^4$ , for all $\epsilon > 0$ , there exists some $T < 25\log(\epsilon^{-1})$ such that for all $t \geq T$ , $|b_t| < \epsilon$ and $a_t \in (-\frac{5}{3}\kappa^3, -\frac{1}{10}\kappa^3)$ . + +Proof. We will prove the claim using induction. Consider the inductive hypothesis + +$$ +P (k) \colon | b _ {k} | \leq | b _ {0} | \bigl (1 - \frac {1}{1 0} (1 + 2 \delta) \bigr) ^ {k}, a _ {0} - a _ {k} \in [ 0, 8 \sqrt {2} \kappa (| b _ {0} | - | b _ {k} |)). +$$ + +When $k = 0$ , the statement holds trivially, so we proceed to the inductive step. Assume $P(k)$ holds for some $k \in \mathbb{N}$ , we want to show that $P(k + 1)$ holds as well. + +First we check that $(a_{k},b_{k})$ with $\kappa < \frac{1}{16} K^{-1}$ satisfies condition B.4. + +Since $\left(1 - \frac{1}{10} (1 + 2\delta)\right) < 1$ , by the inductive hypothesis and the initialization condition on $|b_0|$ we have $|b_k| < |b_0|$ . It is also from the inductive hypothesis that $|a_k| > |a_0|$ , thus to show $|b_k| < \frac{1}{2\sqrt{2}} \sqrt{|a_k| \kappa}$ , one only need to show for $k = 0$ case, which is equivalent to $b_0^2 < -\frac{1}{8} a_0 \kappa$ . + +From the initialization condition, $\xi_0 = |b_0^2 -\frac{1}{2} a_0\kappa -\frac{1}{16}\kappa^4 | < \frac{1}{8}\delta \kappa^4$ . Since $a_0 < - \frac{1}{10} (1 + 2\delta)\kappa^3$ we must have $\frac{1}{2} a_0 + \frac{1}{16}\kappa^4 < 0\leq b_0^2$ . It follows that + +$$ +\begin{array}{l} b _ {0} ^ {2} < \frac {1}{2} a _ {0} \kappa + \frac {1}{1 6} \kappa^ {4} + \frac {1}{8} \kappa^ {4} \\ = \frac {5}{8} a _ {0} \kappa + \frac {1}{1 6} (1 + 2 \delta) - \frac {1}{8} a _ {0} \kappa \\ < \frac {5}{8} \left(- \frac {1}{1 0} (1 + 2 \delta) \kappa^ {3}\right) \kappa + \frac {1}{1 6} (1 + 2 \delta) \kappa^ {4} - \frac {1}{8} a _ {0} \kappa \quad (\text {S i n c e} a _ {0} < - \frac {1}{1 0} (1 + 2 \delta) \kappa^ {3}) \tag {105} \\ = - \frac {1}{1 6} (1 + 2 \delta) \kappa^ {4} + \frac {1}{1 6} (1 + 2 \delta) \kappa^ {4} - \frac {1}{8} a _ {0} \kappa \\ = \frac {1}{8} \left| a _ {0} \right| \kappa . \\ \end{array} +$$ + +From the initialization condition we have $a_0 < -\frac{1}{10}(1 + 2\delta)\kappa^3 = -0.108\kappa^3 < -\frac{1}{16}\kappa^3$ , so $|a_k| > |a_0| > \frac{1}{16}\kappa^3$ . For upper-bound on $|a_k|$ we note that $a_0 > -\frac{1}{8}(1 - 3\delta)\kappa^3 > -\kappa^3$ by initialization, combining with the inductive hypothesis we have $a_k > -\kappa^3 - 2\kappa(|b_0| - |b_t|) > -\kappa^3 - 2|b_0|$ . Since $b_0^2 < \frac{1}{8}|a_0|\kappa < \frac{1}{64}(1 - 3\delta)\kappa^4 < (\frac{1}{8}\kappa^2)^2$ , $|b_0| < \frac{1}{8}\kappa^2$ , so $a_k > -\kappa^3 - \frac{1}{4}\kappa^3$ and hence $|a_k| < \frac{5}{4}\kappa^3 < K^{-2}\kappa^{-1}$ since we assumed $\kappa < \frac{1}{16}K^{-1}$ . Therefore we have shown that $\kappa, a_k, b_k$ satisfies condition B.4 and by Lemma 7 we have $|b_{k+1}| < |b_k + a_kb_k\kappa|$ . + +Since $1 + a_{k}\kappa >0$ as $|a_{k}| < \frac{1}{8}\kappa^{3}$ and $\kappa < K^{-1} < \frac{1}{512}$ , we may write the update of $b_{k}$ as $|b_{k + 1}| < |b_k|(1 + a_k\kappa)$ . Since $a_{k} < a_{0} < -\frac{1}{10} (1 + 2\delta)\kappa^{3}$ , we have $|b_{k + 1}| < |b_{k}|(1 - \frac{1}{10} (1 + 2\delta)\kappa^{3})$ . Combining with the inductive hypothesis that $|b_{k}| < |b_{0}|(1 - \frac{1}{10} (1 + 2\delta)\kappa^{3})^{k}$ , we have $|b_{k + 1}| < |b_0|(1 - \frac{1}{10} (1 + 2\delta)\kappa^3)^{k + 1}$ . + +Since condition B.4 is stronger than condition B.2, by Lemma 5 we have $a_{k} - a_{k + 1} < 8b_{k}^{2}\kappa^{3}$ . Combining with $|b_{k}| - |b_{k + 1}| > |a_{k}||b_{k}|\kappa$ , we have + +$$ +\begin{array}{l} \frac {a _ {k} - a _ {k + 1}}{| b _ {k} | - | b _ {k + 1} |} < \frac {8 b _ {k} ^ {2} \kappa^ {3}}{| a _ {k} b _ {k} | \kappa} \\ = \frac {8 | b _ {k} | \kappa^ {2}}{| a _ {k} |} \\ < \frac {8 \frac {1}{2 \sqrt {2}} \sqrt {\left| a _ {k} \right| \kappa} \kappa^ {2}}{\left| a _ {k} \right|} \quad (\text {S i n c e} | b _ {k} | < \frac {1}{2 \sqrt {2}} \sqrt {\left| a _ {k} \right| \kappa}) \tag {106} \\ = 2 \sqrt {2} \left| a _ {k} \right| ^ {- \frac {1}{2}} \kappa^ {\frac {5}{2}} \\ < 2 \sqrt {2} \left(\frac {1}{1 6} \kappa^ {3}\right) ^ {- \frac {1}{2}} \kappa^ {\frac {5}{2}} \quad \left(\operatorname {S i n c e} | a _ {k} | > \frac {1}{1 6} \kappa^ {3}\right) \\ < 8 \sqrt {2} \kappa . \\ \end{array} +$$ + +Since the inductive hypothesis gives $(a_0 - a_k) / (|b_0| - |b_k|) < 8\sqrt{2}\kappa$ , it follows by the median inequality that $(a_0 - a_{k + 1}) / (|b_0| - |b_{k + 1}|) < 8\sqrt{2}\kappa$ . + +Thus we have shown $P(k) \to P(k + 1)$ , and by induction we know $P(k)$ holds for any $k \in \mathbb{N}$ . Now we can wrap up the convergence analysis leveraging this property. + +Since for all $t, |b_t| \leq |b_0|(1 - \frac{1}{10}(1 + 2\delta))^k$ , for any $\epsilon > 0$ we may pick $T > \log_{(1 - \frac{1}{10}(1 + 2\delta))}(\epsilon / |b_0|)$ such that for all $t > T, |b_t| < \epsilon$ . Note that since $|b_0| < \frac{1}{8}\kappa^2 < 1$ and $1 - \frac{1}{10}(1 + 2\delta)$ , we have + +$$ +T < \log_ {\left(1 - \frac {1}{1 0} (1 + 2 \delta)\right)} (\epsilon / | b _ {0} |) < \frac {\log (\epsilon)}{\log \left(1 - \frac {1}{1 0} (1 . 0 8)\right)} < 2 5 \log \left(\epsilon^ {- 1}\right). \tag {107} +$$ + +For the region of final convergence, for any $t$ we know that from $P(t)$ that $a_0 - a_t \in [0, 8\sqrt{2}\kappa(|b_0| - |b_t|))$ , so we have $a_t > a_0 - 8\sqrt{2}\kappa|b_0|$ . Since we know $|b_0| < \frac{1}{8}\kappa^2$ and $a_0 > -\frac{1}{8}\kappa^3$ by initialization, it follows that $a_t > -\frac{1}{8} - \sqrt{2}\kappa^2 > -\frac{5}{3}\kappa^3$ . The upper bound of $a_t < -\frac{1}{10}(1 + 2\delta)\kappa^3 < \frac{1}{10}\kappa^3$ is trivial since $a$ is monotonically decreasing. + +Thus in summary we have shown that for any $\epsilon > 0$ , there exists some $T < 25\log (\epsilon^{-1})$ such that for all $t > T, |b_t| < \epsilon$ and $a_{t} \in \left(-\frac{5}{3}\kappa^{3}, -\frac{1}{10}\kappa^{3}\right)$ . + +# B.6 PROOF OF THEOREM 3.1 AND ITS COROLLARIES + +With all the lemmas ready, we may now prove Theorem 3.1 and its corollaries. + +We first restate Theorem 3.1 here. + +Theorem 3.1 (Sharpness Concentration). For a large enough absolute constant $K$ , suppose $\kappa < \frac{1}{2000\sqrt{2}} K^{-1}$ , and the initialization $(a_0, b_0)$ satisfies $a_0 \in (12\kappa^{\frac{5}{2}}, \frac{1}{4} K^{-2}\kappa^{-1})$ and $b_0 \in (-K^{-1}, K^{-1}) \setminus \{0\}$ . Consider the GD trajectory characterized in Eq. (6) with fixed step size $\kappa^2$ from $(a_0, b_0)$ , for any $\epsilon > 0$ there exists $T = \mathcal{O}(K^{-2}\kappa^{-\frac{15}{2}} + \log (\epsilon^{-1}) + \log (|b_0|^{-1})\kappa^{-\frac{7}{2}})$ such that for all $t > T$ , $|b_t| < \epsilon$ and $a_t \in (-\frac{5}{3}\kappa^3, -\frac{1}{10}\kappa^3)$ . + +The proof for the main theorem is very simple after we have all the lemmas as discussed above. + +Proof of Theorem 3.1. We consider any initialization $(a_0, b_0)$ satisfying $a_0 \in (12\kappa^{\frac{5}{2}}, \frac{1}{4} K^{-2}\kappa^{-1})$ and $b_0 \in (-K^{-1}, K^{-1}) \setminus \{0\}$ . We abuse the notation to let $a_t$ and $b_t$ be the value of $a$ and $b$ after the $t$ -th two step update from $a_0$ and $b_0$ . + +If $|b_0| \geq 2\sqrt{a_0\kappa}$ , then by Lemma 8 there exists some $\tau_1 < \kappa^{-4}$ such that $a_{\tau_1} \in (2\kappa^{\frac{5}{2}}, \frac{1}{4}K^{-2}\kappa^{-1})$ and $|b_{\tau_1}| \in (\sqrt{a_{\tau_1}\kappa}, 2\sqrt{a_{\tau_1}\kappa})$ . If $|b_0| \leq \frac{1}{4}\sqrt{|a_0\kappa|}$ , by Lemma 9 there exists some $\tau_2 < \frac{1}{2}\log(|b_0|^{-1})\kappa^{-\frac{7}{2}}$ such that $|b_{\tau_2}| \in (\frac{1}{4}\sqrt{a_{\tau_2}\kappa}, \frac{1}{2}\sqrt{a_{\tau_2}\kappa})$ and $a_{\tau_2} \in (2\kappa^{\frac{5}{2}}, \frac{1}{4}K^{-2}\kappa^{-1})$ . Thus there exists some $T_1 = \mathcal{O}(\kappa^{-4} + \log(|b_0|^{-1})\kappa^{-\frac{7}{2}})$ such that $a_{T_1} \in (2\kappa^{\frac{5}{2}}, \frac{1}{4}K^{-2}\kappa^{-1})$ and $b_{T_1} \in (\frac{1}{4}\sqrt{a_{T_1}\kappa}, 2\sqrt{a_{T_1}\kappa})$ . + +Now by Lemma 11 and Corollary B.3, we know that there exists some $\tau_3 \leq a_0\kappa^{-\frac{13}{2}}$ such that within $\tau_3$ two-step updates from $(a_{T_1}, b_{T_1})$ we have $a_{T_1 + \tau_3} \in \left(\frac{3}{2}\kappa^{\frac{5}{2}}, 2\kappa^{\frac{5}{2}}\right)$ and $b_{T_1 + \tau_3} \in \left(\frac{1}{4}\sqrt{a_{T_1 + \tau_3}\kappa}, 2\sqrt{a_{T_1 + \tau_3}\kappa}\right)$ . Let $T_2 = T_1 + \tau_3$ . + +This completes phase 1 of convergence. + +For phase 2, since $a_{T_2} \in \left(\frac{3}{2}\kappa^{\frac{5}{2}}, 2\kappa^{\frac{5}{2}}\right)$ and $|b_{T_2}| \in \left(\frac{1}{4}\sqrt{a_{T_2}\kappa}, 2\sqrt{a_{T_2}\kappa}\right)$ , by Lemma 13, there exists $\tau_4 < |a_{T_2}|\kappa^{-\frac{13}{2}} < 2\kappa^{-6}$ such that within $\tau_4$ steps from $(a_{T_2}, b_{T_2})$ , we have $a_{T_2 + \tau_4} \in \left(\kappa^{-\frac{5}{2}}, 2\kappa^{-\frac{5}{2}}\right)$ and $|\xi_{T_2 + \tau_4}| < \frac{1}{8}\delta \kappa^4$ where we fixed $\delta = 0.04$ . Let $T_3 = T_2 + \tau_4$ . + +After the residual $|\xi|$ decreases to less than $\frac{1}{8}\delta\kappa^4$ with $T_3$ two-step updates, by Lemma 14 and Corollary B.6 there exists some $\tau_5 < 48\delta_{-1}\kappa^{-\frac{9}{2}}$ such that $a_{T_3 + \tau_5} \in (-\frac{1}{8}(1 - 3\delta)\kappa^3, -\frac{1}{10}(1 + 2\delta)\kappa^3)$ while $|\xi_{T_3 + \tau_5}| < \frac{1}{8}\delta\kappa^4$ . Let $T_4 = T_3 + \tau_5$ . + +Finally, by Lemma 15 we have that starting from $(a_{T_4}, b_{T_4})$ , there exists some $\tau_6 < 25 \log (\epsilon^{-1})$ that for any $t > T_4 + \tau_6$ , $|b_t| < \epsilon$ and $a_t \in \left(-\frac{5}{3}\kappa^3, -\frac{1}{10}\kappa^3\right)$ . Thus we have the trajectory converging to some minima with $a \in \left(-\frac{5}{3}\kappa^3, -\frac{1}{10}\kappa^3\right)$ . + +Finally we bound the total number of steps required for convergence. Since $|a_0| < \frac{1}{4} K^{-2}\kappa^{-1}$ , we have $\tau_{3} < \frac{1}{4} K^{-2}\kappa^{-\frac{15}{2}}$ . Moreover, since $\kappa < K^{-1}$ , we have $\kappa^{-4} = \mathcal{O}(K^{-2}\kappa^{-\frac{15}{2}})$ . Since $T_{5} = T_{1} + \tau_{3} + \tau_{4} + \tau_{5} + \tau_{6}$ , we have + +$$ +T = \mathcal {O} \left(K ^ {- 2} \kappa^ {- \frac {1 5}{2}} + \log \left(\left| b _ {0} \right| ^ {- 1}\right) \kappa^ {- \frac {7}{2}} + \log \left(\epsilon^ {- 1}\right)\right). \tag {108} +$$ + +This completes the proof of the theorem. + +![](images/936e939688d182595d2c4a56555fbdacef7316a13b9c51de9d1961b29ad6e7f8.jpg) + +# B.6.1 PROOF OF COROLLARY 3.1 + +Before we proceed to prove Corollary 3.1, we first show a simple lemma on the proximity of $x$ and $c(x,y) \triangleq \sqrt{x^2 - y^2}$ when $x$ is large and $|1 - xy|$ is small. Recall that $c$ was previously defined in Eq. (31) and the $(a,b)$ coordinate that we have been focusing on is the offset from the $\kappa^2$ -EoS minima in the $(c,d)$ coordinate. + +Lemma 16 (Approximity of $c$ to $x$ ). For any large constant $K > 512$ , fix any $\kappa < \frac{1}{2000\sqrt{2}} K^{-1}$ . For any $x \in (\frac{\sqrt{2}}{2}\kappa^{-1}, 2\kappa^{-1})$ and any $y$ such that $|1 - xy| < K^{-1}$ , we have $c(x, y) \triangleq \sqrt{x^2 - y^2} \in (x - 32\kappa^3, x)$ . + +Proof of Lemma 16. Since $xy < 1 + K^{-1}$ and $x > \frac{\sqrt{2}}{2}\kappa^{-1}$ , we must have $y < 2(1 + K^{-1})\kappa < 2\sqrt{2}\kappa$ , where the last step holds since we assumed $K > 512$ . Meanwhile $1 - xy < K^{-1}$ also implies $xy > 1 - K^{-1} > 0$ , so $y > 0$ . + +Thus we have + +$$ +\begin{array}{l} c (x, y) = \sqrt {x ^ {2} - y ^ {2}} \\ > \sqrt {x ^ {2} - (2 \sqrt {2} \kappa) ^ {2}} = x \sqrt {1 - 8 \kappa^ {2} x ^ {- 2}} > x \sqrt {1 - 8 \kappa^ {2} (2 \kappa^ {2})} > x \left(1 - 1 6 \kappa^ {4}\right). \tag {109} \\ \end{array} +$$ + +where the last two inequality holds since $x > \frac{\sqrt{2}}{2}\kappa^{-1}$ and $\sqrt{x} > x$ when $x \in (0, 1)$ . Thus $c(x, y) > x - 16x\kappa^4 > x - 32\kappa^3$ since we assume $x < 2\kappa^{-1}$ . Since $y > 0$ , $\sqrt{x^2 - y^2} < x$ , so $c(x, y) \in (x - 32\kappa^3, x)$ . + +Now we can proceed to proving Corollary 3.1. We first restate the result here: + +Corollary 3.1 (Sharpness Concentration under $(x,y)$ -Parameterization). For a large enough absolute constant $K$ , suppose $\eta < \frac{1}{8000000} K^{-2}$ , and the initialization $(x_0,y_0)$ satisfies $x_0 \in (\check{x} + 13\eta^{\frac{5}{4}}, \check{x} + \frac{1}{5} K^{-2}\eta^{-\frac{1}{2}})$ and $|x_0y_0 - 1| \in (0, K^{-1})$ where $(\check{x}, \check{y})$ is the $\eta$ -EoS minima defined in Definition 1. The GD trajectory characterized in Eq. (2) with fixed step size $\eta$ from $(x_0,y_0)$ will converge to a global minimum with sharpness $\lambda \in (\frac{2}{\eta} - \frac{20}{3}\eta, \frac{2}{\eta})$ . + +Proof of Corollary 3.1. Following the convergence proof for Theorem 3.1, to prove this corollary we only need to show that all initializations $x_0, y_0$ satisfies the initialization condition of Theorem 3.1 after re-parameterized to $(a, b)$ , and the sharpness $\lambda$ of the minima will satisfy $\lambda \in (\frac{2}{\eta} - \frac{20}{3}\eta, \frac{2}{\eta})$ . + +We first check the initialization in the $(x,y)$ coordinate satisfies the initialization condition in Theorem 3.1. Due to the different contexts, we will use $\kappa = \sqrt{\eta}$ and $\eta$ itself interchangeably. + +Recall from Eq. (27) that $\check{x} = \frac{\sqrt{2}}{2} \left( (-4 + \eta^{-2})^{\frac{1}{2}} + \eta^{-1} \right)^{\frac{1}{2}}$ . It is not hard to check that $\check{x} > \frac{\sqrt{2}}{2} \kappa^{-1}$ and $\check{x} < \kappa^{-1}$ where $\kappa = \sqrt{\eta}$ . Since $|x_0y_0 - 1| < K^{-1}$ as required by the initialization, from Lemma 16 we have $c_0 \triangleq c(x_0,y_0) \in (x_0 - 32\kappa^3,x_0)$ . By the same reasoning we also have $\check{c} \triangleq c(\check{x},\check{y}) \in (\check{x} - 32\kappa^3,\check{x})$ . Thus $x_0 > \check{x} + 13\kappa^{\frac{5}{2}}$ implies $c_0 > \check{c} + 13\kappa^{\frac{5}{2}} - 32\kappa^3$ . Since we assume $\kappa < \frac{1}{2000\sqrt{2}} K^{-1}$ where $K > 512$ , $32\kappa^3 < \kappa^{\frac{5}{2}}$ , and hence $c_0 > \check{c} + 12\kappa^{\frac{5}{2}}$ . Therefore $a_0 \triangleq c_0 - \check{c} > 12\kappa^{\frac{5}{2}}$ . + +On the other end, since $\check{x} < \kappa^{-1}$ as shown above, we have $\check{x} + \frac{1}{4} K^{-2}\kappa^{-1} < 2\kappa^{-1}$ . So we can again apply Lemma 16 so that $c_{0} < c(\check{x} + \frac{1}{4} K^{-2}\eta^{-\frac{1}{2}}, y_{0}) < \check{x} + \frac{1}{4} K^{-2}\eta^{-\frac{1}{2}}$ . Since $\check{c} > \check{x} - 32\kappa^{3}$ , we have $c_{0} < \check{c} + \frac{1}{5} K^{-2}\eta^{-\frac{1}{2}} + 32\kappa^{3} < \check{c} + \frac{1}{4} K^{-2}\eta^{-\frac{1}{2}}$ . The last step holds since $32\kappa^{3} < K^{-2}\eta^{-\frac{1}{2}}$ . Therefore $a_{0} \triangleq c_{0} - \check{c} < \frac{1}{20}\frac{1}{4} K^{-2}\eta^{-\frac{1}{2}}$ . Since $|b_{0}| = |1 - xy| \in (0, K^{-1})$ by construction, we know $(a_{0}, b_{0})$ satisfies the initialization condition of Theorem 3.1, and we can have the trajectory converging to a global minima with $a \in [-\frac{5}{3}, -\frac{1}{10}]$ and $b = 0$ . + +Now we show that for global minima with satisfies $a_{k} \in \left[-\frac{5}{3}, -\frac{1}{10}\right]$ and $b_{k} = 0$ , the sharpness $\lambda$ satisfies $\lambda \in \left(\frac{2}{\eta} - \frac{20}{3}\eta, \frac{2}{\eta}\right)$ . + +Recall from Eq. (3) that the sharpness of $(x,y)$ near the global minima is given by + +$$ +\lambda = \frac {1}{2} \left(\left(x ^ {2} + y ^ {2}\right) \left(3 \gamma^ {2} - 1\right) + \sqrt {\left(x ^ {2} + y ^ {2}\right) ^ {2} \left(1 - 3 \gamma^ {2}\right) ^ {2} + 4 \gamma^ {2} \left(3 - 1 0 \gamma^ {2} + 7 \gamma^ {4}\right)}\right) \tag {110} +$$ + +where $\gamma \triangleq xy$ . When $(x,y)$ is a global minima, $\gamma = 1$ , and Eq. (110) reduces to + +$$ +\begin{array}{l} \lambda = \frac {1}{2} \left(\left(x ^ {2} + y ^ {2}\right) (3 - 1) + \sqrt {\left(x ^ {2} + y ^ {2}\right) ^ {2} (1 - 3) ^ {2}}\right) \\ = \frac {1}{2} \left(2 \left(x ^ {2} + y ^ {2}\right) + 2 \left(x ^ {2} + y ^ {2}\right)\right) \\ = 2 (x ^ {2} + y ^ {2}) \\ = 2 \sqrt {\left(x ^ {2} + x ^ {- 2}\right) ^ {2}} \tag {111} \\ = 2 \sqrt {4 + (x ^ {2} - x ^ {- 2}) ^ {2}} \\ = 2 \sqrt {4 + (\sqrt {x ^ {2} - y ^ {2}}) ^ {4}} \\ = 2 \sqrt {4 + c ^ {4}}. \\ \end{array} +$$ + +Since $c = (\kappa^{-4} - 4)^{\frac{1}{4}} + a$ , where $a \in [-\frac{5}{3}\kappa^3, -\frac{1}{10}\kappa^3]$ , we have $c < (\kappa^{-4} - 4)^{\frac{1}{4}}$ and hence $\lambda = 2\sqrt{4 + c^4} < 2\sqrt{4 + \kappa^{-4} - 4} = 2\kappa^{-2} = \frac{2}{\eta}$ . + +Now we prove the lower bound for $\lambda$ . Follow from $c > (\kappa^{-4} - 4)^{\frac{1}{4}} - \frac{5}{3}\kappa^3$ , we have + +$$ +\begin{array}{l} c ^ {4} > \left((\kappa^ {- 4} - 4) ^ {\frac {1}{4}} - \frac {5}{3} \kappa^ {3}\right) ^ {4} \\ = \left(\left(\kappa^ {- 4} - 4\right) ^ {- \frac {1}{4}} (\kappa^ {- 4} - 4) ^ {\frac {1}{4}} - \frac {5}{3} \kappa^ {3} (\kappa^ {- 4} - 4) ^ {- \frac {1}{4}}\right) ^ {4} (\kappa^ {- 4} - 4) \\ = \left(1 - \frac {5}{3} \kappa^ {3} (\kappa^ {- 4} - 4) ^ {- \frac {1}{4}}\right) ^ {4} (\kappa^ {- 4} - 4) \\ \geq \left(1 - \frac {2 0}{3} \kappa^ {3} \left(\kappa^ {- 4} - 4\right) ^ {- \frac {1}{4}}\right) \left(\kappa^ {- 4} - 4\right) \quad (\text {B e r n o u l l i i n e q u a l i t y}) \\ = \kappa^ {- 4} - 4 - \frac {2 0}{3} \kappa^ {3} \left(\kappa^ {- 4} - 4\right) ^ {\frac {3}{4}} \\ \geq \kappa^ {- 4} - 4 - \frac {2 0}{3} \kappa^ {3} \big (\kappa^ {- 4} \big) ^ {\frac {3}{4}} \\ = \kappa^ {- 4} - 4 - \frac {2 0}{3}. \tag {112} \\ \end{array} +$$ + +Thus + +$$ +\begin{array}{l} \lambda = 2 \sqrt {4 + c ^ {4}} \\ \geq 2 \sqrt {4 + \kappa^ {- 4} - 4 - \frac {2 0}{3}} \\ = 2 \sqrt {\kappa^ {- 4} - \frac {2 0}{3}} \tag {113} \\ = 2 \sqrt {1 - \frac {2 0}{3} \kappa^ {4}} \kappa^ {- 2} \\ \geq 2 (1 - \frac {2 0}{3} \kappa^ {4}) \kappa^ {- 2} \\ = 2 \kappa^ {- 2} - \frac {2 0}{3} \kappa^ {2} = \frac {2}{\eta} - \frac {2 0}{3} \eta . \\ \end{array} +$$ + +Hence in conclusion, the converging minima has sharpness $\lambda \in (\frac{2}{\eta} - \frac{20}{3}\eta, \frac{2}{\eta})$ , which completes the proof for the corollary. + +# B.6.2 PROOF OF COROLLARY 3.2 + +Before proving Corollary 3.2, we first show a simple lemma on the approximation of $\check{x}$ and $\kappa^{-1}$ where $\check{x}$ is the $x$ -coordinate for the $\kappa^2$ -EoS minima. + +Lemma 17 (Approximity of $\check{x}$ and $\kappa^{-1}$ ). For any large constant $K > 512$ , fix any $\kappa < \frac{1}{2000\sqrt{2}} K^{-1}$ . With $\check{x} \triangleq \frac{1}{\sqrt{2}}((-4 + \eta^{-2})^{\frac{1}{2}} + \eta^{-1})^{\frac{1}{2}}$ , we have $|\check{x} - \kappa^{-1}| < 36\kappa^{3}$ . + +Proof of Lemma 17. Since the condition for $\kappa$ is identical to that of Lemma 16, we have $|\check{x} -\check{c}| < 32\kappa^3$ from Lemma 16 where $\check{c} = (\kappa^{-4} - 4)^{\frac{1}{4}}$ from the calculation in Appendix B.1. Note that + +$$ +\check {c} = \left(\kappa^ {- 4} - 4\right) ^ {\frac {1}{4}} = \kappa^ {- 1} \left(1 - 4 \kappa^ {- 4}\right) ^ {\frac {1}{4}} > \kappa^ {- 1} \left(1 - 4 \kappa^ {- 4}\right) = \kappa^ {- 1} - 4 \kappa^ {3}. \tag {114} +$$ + +It is straightforward that $\check{c} < \kappa^{-1}$ , so $|\check{c} - \kappa^{-1}| < 4\kappa^3$ . Combining with $|\check{x} - \check{c}| < 32\kappa^3$ , we have $|\check{x} - \kappa^{-1}| < 36\kappa^3$ , which completes the proof. + +Now we can proceed to prove Corollary 3.2. We first restate the corollary. + +Corollary 3.2 (Sharpness Adaptivity). For a large enough constant $K$ , fix any $\alpha < \frac{1}{2000\sqrt{2}} K^{-1}$ . For all initialization $(x_0, y_0)$ in the region characterized by + +$$ +x _ {0} \in \left(\alpha^ {- 1} + \frac {1}{1 5} K ^ {- 2} \alpha^ {- 1}, \alpha^ {- 1} + \frac {1}{6} K ^ {- 2} \alpha^ {- 1}\right) \tag {10} +$$ + +and $|x_0y_0 - 1| \in (0, K^{-1})$ , the $GD$ trajectory from $(x_0, y_0)$ characterized by Eq. (2) with any step size $\eta \in (\alpha^2 - \frac{1}{10}K^{-2}\alpha^2, \alpha^2)$ will converge to a minima with sharpness $\lambda \in (\frac{2}{\eta} - \frac{20}{3}\eta, \frac{2}{\eta})$ . + +Proof of Corollary 3.2. To prove this corollary, we only need to show that for all $\eta$ in the required range, the initialization region characterized by the corollary is a subset of the initialization region required by Corollary 3.1 for that particular $\eta$ . + +For the ease of derivation, we will use $\kappa^2$ to substitute for $\eta$ . Since we are dealing with different step sizes, we augment our notation to let $(\check{x}_{\kappa^2},\check{y}_{\kappa^2})$ denote the $\kappa^2$ -EoS minimum. Note that the condition for $y_0$ , namely $|x_0y_0 - 1|\in (0,K^{-1})$ is identical to what is required by Corollary 3.1 so we only need to show for any learning rate $\kappa^2\in (\alpha^2 -\frac{1}{10} K^{-2}\alpha^2,\alpha^2)$ + +$$ +\left(\alpha^ {- 1} + \frac {1}{1 5} K ^ {- 2} \alpha^ {- 1}, \alpha^ {- 1} + \frac {1}{6} K ^ {- 2} \alpha^ {- 1}\right) \subseteq \left(\check {x} _ {\kappa^ {2}} + 1 3 \kappa^ {\frac {5}{2}}, \check {x} _ {\kappa^ {2}} + \frac {1}{5} K ^ {- 2} \kappa^ {- 1}\right). \tag {115} +$$ + +We will first show $\check{x}_{\eta} + 13\kappa^{\frac{5}{2}} < \alpha^{-1} + \frac{1}{15} K^{-2}\alpha^{-1}$ . + +Since $\kappa^2 >\alpha^2 -\frac{1}{10} K^{-2}\alpha^2$ , we have $\kappa >(1 - \frac{1}{10} K^{-2})^{\frac{1}{2}}\alpha >(1 - \frac{1}{9} K^{-2} + \frac{1}{324} K^{-4})^{\frac{1}{2}}\alpha = (1-$ $\frac{1}{16} K^{-2})\alpha$ where the last inequality holds since we may assume $K > 512$ . Taking the multiplicative inverse, we have $\kappa^{-1} < (1 - \frac{1}{18} K^{-2})^{-1}\alpha^{-1}$ . + +Now note that since $K^{-1} < 1$ , $(1 + \frac{1}{16} K^{-2})(1 - \frac{1}{18} K^{-2}) = 1 + \frac{1}{144} K^{-2} - \frac{1}{288} K^{-4} > 1$ , so $(1 - \frac{1}{18} K^{-2})^{-1} < 1 + \frac{1}{16} K^{-2}$ and hence $\kappa^{-1} < (1 - \frac{1}{18} K^{-2})^{-1}\alpha^{-1} < (1 + \frac{1}{16} K^{-2})\alpha^{-1}$ . From Lemma 17 we know $\check{x}_{\kappa^2} < \kappa^{-1} + 36\kappa^3$ , so + +$$ +\check {x} _ {\kappa^ {2}} + 1 3 \kappa^ {\frac {5}{2}} < \kappa^ {- 1} + 3 6 \kappa^ {3} + 1 3 \kappa^ {\frac {5}{2}} < (1 + \frac {1}{1 6} K ^ {- 2}) \alpha^ {- 1} + 3 6 \kappa^ {3} + 1 3 \kappa^ {\frac {5}{2}}. \tag {116} +$$ + +Note that since $\kappa < \alpha < \frac{1}{2000\sqrt{2}} K^{-1}$ where $K > 512$ , we have + +$$ +3 6 \kappa^ {3} + 1 3 \kappa^ {\frac {5}{2}} < \kappa^ {2} < \frac {1}{8 0 0 0 0 0 0} K ^ {- 2} < \frac {1}{4 8 0} K ^ {- 2} < \left(\frac {1}{1 5} - \frac {1}{1 6}\right) K ^ {- 2} \alpha^ {- 1}. \tag {117} +$$ + +Thus combining with $\check{x}_{\kappa^2} + 13\kappa^{\frac{5}{2}} < (1 + \frac{1}{16} K^{-2})\alpha^{-1} + 36\kappa^3 + 13\kappa^{\frac{5}{2}}$ , we have + +$$ +\check {x} _ {\kappa^ {2}} + 1 3 \kappa^ {\frac {5}{2}} < (1 + \frac {1}{1 6} K ^ {- 2}) \alpha^ {- 1} + (\frac {1}{1 5} - \frac {1}{1 6}) K ^ {- 2} \alpha^ {- 1} < \alpha^ {- 1} + \frac {1}{1 5} K ^ {- 2} \alpha^ {- 1}. \tag {118} +$$ + +The other side is much simpler to show. Since $\kappa < \alpha$ , we have $\kappa^{-1} > \alpha^{-1}$ . From Lemma 17 we have $\check{x}_{\kappa^2} > \kappa^{-1} - 36\kappa^3$ , so $\check{x}_{\kappa^2} + \frac{1}{5} K^{-2}\kappa^{-1} > \alpha^{-1} - 36\kappa^3 + \frac{1}{5} K^{-2}\alpha^{-1}$ . From Eq. (117) we know $36\kappa^3 < \frac{1}{480} K^{-2} < \frac{1}{30} K^{-2}\alpha^{-1} = (\frac{1}{5} - \frac{1}{6})K^{-2}\alpha^{-1}$ . Therefore $\check{x}_{\kappa^2} + \frac{1}{5} K^{-2}\kappa^{-1} > \alpha^{-1} + \frac{1}{6} K^{-2}\alpha^{-1}$ . This concludes the proof for the corollary. + +# B.7 OTHER AUXILIARY LEMMAS + +# B.7.1 CONSTANT BOUND ON $R_{\delta}(\kappa)$ + +Lemma 18. For all $\kappa < 0.1$ , for all $(a,b) \in (-\kappa^{-1},\kappa^{-1}) \times (-1,1)$ , there exists some absolute constant $K$ independent of $a,b,\kappa$ such that + +$$ +\delta \triangleq \sqrt {4 \kappa^ {4} (1 + b) ^ {2} + \left(a \kappa + (1 - 4 \kappa^ {4}) ^ {\frac {1}{4}}\right) ^ {4}} = 1 + 2 a \kappa + a ^ {2} \kappa^ {2} + 2 b (2 + b) \kappa^ {4} + K \kappa^ {5}. \tag {119} +$$ + +Proof of Lemma 18. By explicitly computing the derivatives for $\delta$ with respect to $\kappa$ , we know that $\delta$ is $C^6$ with respect to $\kappa$ and have the Taylor expansion + +$$ +\delta = 1 + 2 a \kappa + a ^ {2} \kappa^ {2} + 2 b (2 + b) \kappa^ {4} + R _ {\delta} (\kappa) \kappa^ {5}. \tag {120} +$$ + +where $R_{\delta}(\kappa)$ is the Lagrangian remainder that $R_{\delta}(\kappa) = \frac{\partial^{5}\delta}{\partial\kappa^{5}} (x) / 120$ for some $x\in [0,\kappa ]$ . To prove the lemma we only need to bound the $R_{\delta}$ by some absolute constants. For simplicity of notation, denote $\alpha \triangleq (1 - 4x^4)^{\frac{1}{4}},\beta = \alpha +ax,\gamma = 1 + b,$ and $\phi = \left(4\gamma^{2}x^{4} + \beta^{4}\right)^{\frac{1}{2}}$ . Moreover, let + +$$ +\rho_ {1} = a - \frac {4 \kappa^ {3}}{\alpha^ {3}}, +$$ + +$$ +\rho_ {2} = - \frac {1 2 \kappa^ {2}}{\alpha^ {3}} - \frac {4 8 \kappa^ {6}}{\alpha^ {7}}, +$$ + +$$ +\rho_ {3} = - \frac {2 4 \kappa}{\alpha^ {3}} - \frac {4 3 2 \kappa^ {5}}{\alpha^ {7}} - \frac {1 3 4 4 \kappa^ {9}}{\alpha^ {1 1}}, \tag {121} +$$ + +$$ +\rho_ {4} = - \frac {2 4}{\alpha^ {3}} - \frac {2 4 4 8 \kappa^ {4}}{\alpha^ {7}} - \frac {2 4 1 9 2 \kappa^ {8}}{\alpha^ {1 1}} - \frac {5 9 1 3 6 \kappa^ {1 2}}{\alpha^ {1 5}}, +$$ + +$$ +\rho_ {5} = - \frac {1 0 0 8 0 \kappa^ {3}}{\alpha^ {7}} - \frac {2 6 2 0 8 0 \kappa^ {7}}{\alpha^ {1 1}} - \frac {1 7 7 4 0 8 0 \kappa^ {1 1}}{\alpha^ {1 5}} - \frac {3 5 4 8 1 6 0 \kappa^ {1 5}}{\alpha^ {1 9}}. +$$ + +By doing some tedious calculation we have + +$$ +\begin{array}{l} \frac {\partial^ {5} \delta}{\partial \kappa^ {5}} (x) = \frac {1 0 5 \left(1 6 \gamma^ {2} \kappa^ {3} + 4 \beta^ {3} \rho_ {1}\right) ^ {5}}{3 2 \phi^ {9}} - \frac {7 5 \left(1 6 \gamma^ {2} \kappa^ {3} + 4 \beta^ {3} \rho_ {1}\right) ^ {3} \left(4 8 \gamma^ {2} \kappa^ {2} + 1 2 \beta^ {2} \rho_ {1} ^ {2} + 4 \beta^ {3} \rho_ {2}\right)}{8 \phi^ {7}} \\ + \frac {4 5 \left(1 6 \gamma^ {2} \kappa^ {3} + 4 \beta^ {3} \rho_ {1}\right) \left(4 8 \gamma^ {2} \kappa^ {2} + 1 2 \beta^ {2} \rho_ {1} ^ {2} + 4 \beta^ {3} \rho_ {2}\right) ^ {2}}{8 \phi^ {5}} \\ + \frac {1 5 \left(1 6 \gamma^ {2} \kappa^ {3} + 4 \beta^ {3} \rho_ {1}\right) ^ {2} \left(9 6 \gamma^ {2} \kappa + 2 4 \beta \rho_ {1} ^ {3} + 3 6 \beta^ {2} \rho_ {1} \rho_ {2} + 4 \beta^ {3} \rho_ {3}\right)}{4 \phi^ {5}} \\ - \frac {5 \left(4 8 \gamma^ {2} \kappa^ {2} + 1 2 \beta^ {2} \rho_ {1} ^ {2} + 4 \beta^ {3} \rho_ {2}\right) \left(9 6 \gamma^ {2} \kappa + 2 4 \beta \rho_ {1} ^ {3} + 3 6 \beta^ {2} \rho_ {1} \rho_ {2} + 4 \beta^ {3} \rho_ {3}\right)}{2 \phi^ {3}} \\ - \frac {5 \left(1 6 \gamma^ {2} \kappa^ {3} + 4 \beta^ {3} \rho_ {1}\right) \left(9 6 \gamma^ {2} + 2 4 \rho_ {1} ^ {4} + 1 4 4 \beta \rho_ {1} ^ {2} \rho_ {2} + 3 6 \beta^ {2} \rho_ {2} ^ {2} + 4 8 \beta^ {2} \rho_ {1} \rho_ {3} + 4 \beta^ {3} \rho_ {4}\right)}{4 \phi^ {3}} \\ + \frac {2 4 0 \rho_ {1} ^ {3} \rho_ {2} + 3 6 0 \beta \rho_ {1} \rho_ {2} ^ {2} + 2 4 0 \beta \rho_ {1} ^ {2} \rho_ {3} + 1 2 0 \beta^ {2} \rho_ {2} \rho_ {3} + 6 0 \beta^ {2} \rho_ {1} \rho_ {4} + 4 \beta^ {3} \rho_ {5}}{2 \phi} \tag {122} \\ \end{array} +$$ + +Since $\kappa < 0.1$ , we have $\alpha = (1 - 4x^4)^{\frac{1}{4}} > 0.99$ and $\phi = \left(4\gamma^{2}x^{4} + \beta^{4}\right)^{\frac{1}{2}} \geq \beta^{2} = (\alpha + dx)^{2} \geq \alpha^{2} > 0.9$ . Thus $\alpha$ and $\phi$ are bounded from below by some constants. Since $\kappa$ is bounded from above, we have $\rho_{1}, \ldots, \rho_{5}$ bounded from above by some constants. + +Now we give upper bounds for $\beta$ and $\gamma$ . Since $|x| < 0.1$ , we have $(1 - 4x^4)^{\frac{1}{4}} \leq 1$ . Since $|a| < \kappa^{-1}$ , we have $\beta = \alpha + ax < \alpha + a\kappa < \alpha + 1 < 2$ . Since $|b| < 1$ , we have $\gamma = 1 + b < 2$ . Note that it is straightforward from construction that all these terms are positive. + +From Eq. (122) we have $\frac{\partial^6\delta}{\partial\kappa^6} (x)$ as some finite degree polynomial of $\beta ,\gamma ,\kappa ,\rho_1,\ldots ,\rho_6$ , and $\phi^{-1}$ Since the absolute value for all of these terms are bounded above by some constants independent of $x$ , we have $\left|\frac{\partial^6\delta}{\partial\kappa^6} (x)\right|$ uniformly bounded above by some constant $K$ for all $x\in [0,\kappa ]$ . This completes the proof of the lemma. + +# C THEORETICAL ANALYSIS ON RANK-1 APPROXIMATION OF ISOTROPIC MATRIX + +In this section we prove the convergence of the vector case. + +# C.1 PRELIMINARIES + +Model: We consider a generalized model from the scalar product case. + +$$ +\min _ {\boldsymbol {x}, \boldsymbol {y} \in \mathbb {R} ^ {d}} \frac {1}{4} \| \boldsymbol {I} - \boldsymbol {x y} ^ {\top} \boldsymbol {x y} ^ {\top} \| _ {F} ^ {2} \tag {123} +$$ + +The normalization factor $\frac{1}{4}$ is added to show the equivalence of this rank-1 isotropic matrix factorization problem and the scalar case considered in Appendix B.6. We will show how the equivalence is achieved due to the alignment in the next section. + +Update Rule: We use gradient descent to optimize this problem. By computing the closed-form of the gradient, we know the 1-step update of $\pmb{x}$ and $\pmb{y}$ follows: + +$$ +\boldsymbol {x} _ {t + 1} = \boldsymbol {x} _ {t} + \eta \left(\left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) \boldsymbol {y} _ {t} - \frac {1}{2} \left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) \| \boldsymbol {x} _ {t} \| ^ {2} \| \boldsymbol {y} _ {t} \| ^ {2} \boldsymbol {y} _ {t} - \frac {1}{2} \left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) ^ {2} \| \boldsymbol {y} _ {t} \| ^ {2} \boldsymbol {x} _ {t}\right), \tag {124} +$$ + +$$ +\boldsymbol {y} _ {t + 1} = \boldsymbol {y} _ {t} + \eta \left(\left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) \boldsymbol {x} _ {t} - \frac {1}{2} \left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) \| \boldsymbol {x} _ {t} \| ^ {2} \| \boldsymbol {y} _ {t} \| ^ {2} \boldsymbol {x} _ {t} - \frac {1}{2} \left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) ^ {2} \| \boldsymbol {x} _ {t} \| ^ {2} \boldsymbol {y} _ {t}\right). +$$ + +With the gradient descent update above, we can have the dynamics of the following four quantities: $\| \pmb{x} \|^{2}$ , $\| \pmb{y} \|^{2}$ , and $(\pmb{x}^{\top} \pmb{y})^{2}$ . + +$$ +\begin{array}{l} \left\| \boldsymbol {x} _ {t + 1} \right\| ^ {2} = \left\| \boldsymbol {x} _ {t} \right\| ^ {2} + 2 \eta \left(\left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) ^ {2} - \left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) ^ {2} \left\| \boldsymbol {x} _ {t} \right\| \left\| \boldsymbol {y} _ {t} \right\|\right) \\ + \frac {\eta^ {2}}{4} \left(4 \left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) ^ {2} \| \boldsymbol {y} _ {t} \| ^ {2} + \left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) ^ {2} \| \boldsymbol {x} _ {t} \| ^ {4} \| \boldsymbol {y} _ {t} \| ^ {6} + 3 \left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) ^ {4} \| \boldsymbol {x} _ {t} \| ^ {2} \| \boldsymbol {y} _ {t} \| ^ {4} \right. \\ - 4 \left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) ^ {2} \left\| \boldsymbol {x} _ {t} \right\| ^ {2} \left\| \boldsymbol {y} _ {t} \right\| ^ {4} - 4 \left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) ^ {4} \left\| \boldsymbol {y} _ {t} \right\| ^ {2}), \tag {125} \\ \end{array} +$$ + +$$ +\begin{array}{l} \left\| \boldsymbol {y} _ {t + 1} \right\| ^ {2} = \left\| \boldsymbol {y} _ {t} \right\| ^ {2} + 2 \eta \left(\left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) ^ {2} - \left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) ^ {2} \left\| \boldsymbol {x} _ {t} \right\| \left\| \boldsymbol {y} _ {t} \right\|\right) \\ + \frac {\eta^ {2}}{4} \left(4 \left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) ^ {2} \| \boldsymbol {x} _ {t} \| ^ {2} + \left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) ^ {2} \| \boldsymbol {x} _ {t} \| ^ {6} \| \boldsymbol {y} _ {t} \| ^ {4} + 3 \left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) ^ {4} \| \boldsymbol {x} _ {t} \| ^ {4} \| \boldsymbol {y} _ {t} \| ^ {2} \right. \\ \left. - 4 \left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) ^ {2} \left\| \boldsymbol {x} _ {t} \right\| ^ {4} \left\| \boldsymbol {y} _ {t} \right\| ^ {2} - 4 \left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) ^ {4} \left\| \boldsymbol {x} _ {t} \right\| ^ {2}\right), \\ \end{array} +$$ + +$$ +\begin{array}{l} \left(\boldsymbol {x} _ {t + 1} ^ {\top} \boldsymbol {y} _ {t + 1}\right) ^ {2} = \left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) ^ {2} \left(1 + \eta \left(\| \boldsymbol {x} _ {t} \| ^ {2} + \| \boldsymbol {y} _ {t} \| ^ {2}\right) \left(1 - \frac {1}{2} \| \boldsymbol {x} _ {t} \| ^ {2} \| \boldsymbol {y} _ {t} \| ^ {2} - \frac {1}{2} \left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) ^ {2}\right) \right. \\ \left. + \frac {\eta^ {2}}{4} \left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) ^ {2} \left[ 4 \left(\| \boldsymbol {x} _ {t} \| ^ {2} \| \boldsymbol {y} _ {t} \| ^ {2} - 1\right) ^ {2} - \| \boldsymbol {x} _ {t} \| ^ {2} \| \boldsymbol {y} _ {t} \| ^ {2} \left(\| \boldsymbol {x} _ {t} \| ^ {2} \| \boldsymbol {y} _ {t} \| ^ {2} - \left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) ^ {2}\right) \right] \right) ^ {2}. \tag {126} \\ \end{array} +$$ + +Furthermore, we define an alignment notation for the variable: $\xi_t \coloneqq \| \pmb{x}_t\|^2\|\pmb{y}_t\|^2 - (\pmb{x}_t^\top \pmb{y}_t)^2$ . By Eq. (126) and Eq. (125), we can derive the following update rule of $\xi$ . + +$$ +\xi_ {t + 1} = \xi_ {t} \left(1 - \left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) ^ {2} \eta \left(\frac {\| \boldsymbol {x} _ {t} \| ^ {2}}{2} + \frac {\| \boldsymbol {y} _ {t} \| ^ {2}}{2} + \frac {\eta}{4} \left((2 - \| \boldsymbol {x} _ {t} \| ^ {2} \| \boldsymbol {y} _ {t} \| ^ {2}) ^ {2} - \| \boldsymbol {x} _ {t} \| ^ {2} \| \boldsymbol {y} _ {t} \| ^ {2} \left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) ^ {2}\right)\right)\right) ^ {2} \tag {127} +$$ + +# C.2 PROOF OF THEOREM 3.2 + +We restate the theorem of the vector case. + +Theorem C.1. For a large enough absolute constant $K$ , with all the initialization $(\pmb{x}_0, \pmb{y}_0)$ satisfying $\pmb{x}_0 \sim \delta_x \text{Unif}(\mathbb{S}^{d-1})$ , $\pmb{y}_0 \sim \delta_y \text{Unif}(\mathbb{S}^{d-1})$ , $\delta_x \delta_y = \frac{1}{2}$ , $\delta_x \in (\check{x} + \frac{1}{80} K^{-2} \eta^{-\frac{1}{2}}, \check{x} + \frac{1}{8} K^{-2} \eta^{-\frac{1}{2}})$ , if + +step size $\eta < \min \left\{\frac{K^{-4}}{8000000}, \frac{K^{-2}}{20000 + 2000(\log(d) - \log(\delta_0))}\right\}$ , and a multiplicative perturbation $\mathbf{y}_t' = \mathbf{y}_t(1 + 2K^{-1})^3$ is performed at time $t = t_p$ for some $t_p > \mathcal{O}(-\log(\eta) + \log(d) - \log(\delta_0) + K^3)$ , then for any $\epsilon > 0$ , with probability $p > 1 - 2\delta_0 - 2\exp\{-\Omega(d)\}$ there exists $T = \mathcal{O}(K^{-2}\kappa^{-\frac{15}{2}} - \log(\epsilon) - \log(\delta_0))$ such that for all $t > T$ , $\mathcal{L}(x,y) < \epsilon$ and $\| x_t\|^2 + \| y_t\|^2 \in (\frac{1}{\eta} - \frac{10}{3}\eta, \frac{1}{\eta})$ . + +In the following analysis, we still use the operator $\mathcal{O}(\cdot)$ to only hides absolute constants, and $K$ to represent the absolute constant that uniformly upper bounds all the absolute constants of the $\mathcal{O}(\cdot)$ terms. Also $K > 512$ . We still use the notation of $\eta$ -EoS minimum $(\tilde{x},\tilde{y})$ of the scalar case in the vector case. + +We first prove some properties of the global minimizers. The following lemma guarantees the alignment of the two vectors $\pmb{x}, \pmb{y}$ at any global minimizer $(\pmb{x}, \pmb{y})$ . + +Lemma 19. (Global minimizers) For all global minimizers $(\pmb{x},\pmb{y})$ of the optimization problem Eq. (123), we have $\pmb{x} = c\pmb{y}$ for some $c\in \mathbb{R}$ , and $\| \pmb {x}\| \| \pmb {y}\| = 1$ . + +Proof. We directly consider the objective $\left\| \boldsymbol{I} - \boldsymbol{x}\boldsymbol{y}^\top \boldsymbol{x}\boldsymbol{y}^\top \right\|_F^2$ . + +$$ +\begin{array}{l} \left\| \boldsymbol {I} - \boldsymbol {x y} ^ {\top} \boldsymbol {x y} ^ {\top} \right\| _ {F} ^ {2} = \operatorname {T r} \left(\left(\boldsymbol {I} - \boldsymbol {x y} ^ {\top} \boldsymbol {x y} ^ {\top}\right) ^ {\top} \left(\boldsymbol {I} - \boldsymbol {x y} ^ {\top} \boldsymbol {x y} ^ {\top}\right)\right) \\ = \operatorname {T r} (\boldsymbol {I} - \boldsymbol {y} \boldsymbol {x} ^ {\top} \boldsymbol {y} \boldsymbol {x} ^ {\top} - \boldsymbol {x} \boldsymbol {y} ^ {\top} \boldsymbol {x} \boldsymbol {y} ^ {\top} - (\boldsymbol {x} ^ {\top} \boldsymbol {y}) ^ {2} \| \boldsymbol {x} \| ^ {2} \boldsymbol {y} \boldsymbol {y} ^ {\top}) \\ = d - 2 \left(\boldsymbol {x} ^ {\top} \boldsymbol {y}\right) ^ {2} + \left(\boldsymbol {x} ^ {\top} \boldsymbol {y}\right) ^ {2} \| \boldsymbol {x} \| ^ {2} \| \boldsymbol {y} \| ^ {2} \\ = d - 1 + \left(\left(\boldsymbol {x} ^ {\top} \boldsymbol {y}\right) ^ {2} - 1\right) ^ {2} + \left(\boldsymbol {x} ^ {\top} \boldsymbol {y}\right) ^ {2} \left(\| \boldsymbol {x} \| ^ {2} \| \boldsymbol {y} \| ^ {2} - \left(\boldsymbol {x} ^ {\top} \boldsymbol {y}\right) ^ {2}\right) \\ \geq d - 1. \\ \end{array} +$$ + +The global minimizer takes value $\frac{d - 1}{4}$ and the equality holds when + +$$ +\left(\left(\boldsymbol {x} ^ {\top} \boldsymbol {y}\right) ^ {2} - 1\right) ^ {2} = \left(\boldsymbol {x} ^ {\top} \boldsymbol {y}\right) ^ {2} \left(\| \boldsymbol {x} \| ^ {2} \| \boldsymbol {y} \| ^ {2} - \left(\boldsymbol {x} ^ {\top} \boldsymbol {y}\right) ^ {2}\right) = 0. +$$ + +which is equivalent to $\pmb{x} = c\pmb{y}$ for some $c \in \mathbb{R}$ , and $\| \pmb{x} \| \| \pmb{y} \| = 1$ . + +![](images/fb9f74140ad661a149aeea609414c4e606a98ddad6ecca40cfb4ff21d586f2fe.jpg) + +Now we consider the formal proof. To prove the theorem we have four steps: (i) we prove the two vectors $\mathbf{x}, \mathbf{y}$ will decay geometrically after $T = \mathcal{O}(-\log(\eta) - \log(\delta_0) + \log(d))$ time (Lemma 20, Lemma 21); (ii) we prove the norm of the two vectors $\| \mathbf{x} \|, \| \mathbf{y} \|$ will satisfy the initialization condition in $T' < 6K^3 + 4K$ time (Lemma 22); (iii) To escape from some sharp minima, we add some deterministic perturbation, and we prove that after the perturbation gradient descent will re-enter the feasible regime, while at the same time keep a constant distance to the manifold of the minimizers; (iv) after entering the feasible region and $\xi$ is small enough, the re-parameterized dynamics of $\| \mathbf{x} \|$ and $\| \mathbf{y} \|$ can be captured by the scalar dynamics (Lemma 25). Then, we can reduce this vector case to the scalar product case and finish the proof. + +Here we present the following key lemmas to prove the convergence at the edge of stability. For simplicity, we denote $\alpha(t) \coloneqq \eta(\| \pmb{x}_t \|^2 + \| \pmb{y}_t \|^2) - 1$ . + +Lemma 20. (Alignment) Assume $0 < \alpha(0) < \frac{1}{8}$ , $0 < \pmb{x}_0^\top \pmb{y}_0 < \| \pmb{x}_0 \| \| \pmb{y}_0 \| \leq \frac{1}{2}$ , $\eta < 0.01$ . Then as long as $-\frac{1}{100} < \alpha(t) < \frac{1}{8}$ holds for $t \in [0, t_1]$ for some $t_1$ , then for all $t \in [0, t_1 + 1]$ , $0 < (\pmb{x}_t^\top \pmb{y}_t)^2 < \frac{13}{10}$ and $\xi_{t+1} < \xi_t$ ; Moreover, there exists some $t_0 < \log_2(\frac{7}{20 \pmb{x}_0^\top \pmb{y}_0})$ , for all $t \in [t_0, t_1 + 1]$ , $\frac{7}{20} < (\pmb{x}_t^\top \pmb{y}_t)^2 < \frac{13}{10}$ and $\xi_{t+1} < 0.7\xi_t$ . + +Proof. We use induction. For iteration 0, the induction basis holds. Now we consider iteration $t + 1$ when assuming the conclusion holds at iteration 0, 1, 2, ..., $t$ . + +Consider Equation (126). We denote $c_{t} = (\pmb{x}_{t}^{\top}\pmb{y}_{t})^{2}$ . And from the induction hypothesis, $\xi_{t} < \| \pmb{x}_{0}\|^{2}\|\pmb{y}_{0}\|^{2} < 1/4$ for all time. Thus $\| \pmb{x}_{t}\|^{2}\|\pmb{y}_{t}\|^{2} = c_{t} + \xi_{t} < \frac{31}{20}$ . Then we have + +$$ +c _ {t + 1} < c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t}) + 2 0 \eta^ {2}) ^ {2} < c _ {t} (\frac {1 0 0 1}{5 0 0} + \alpha (t) - (1 + \alpha (t)) c _ {t}) ^ {2}. +$$ + +Since $0 < c_{t} < 13 / 10$ and $-0.01 < \alpha < 1 / 8$ , this function takes maximal value when $c_{t} = \frac{1001}{1500(1 + \alpha(t))}$ . + +$$ +c _ {t + 1} < c _ {t} \left(\frac {1 0 0 1}{5 0 0} + \alpha (t) - (1 + \alpha (t)) c _ {t}\right) ^ {2} \leq \frac {1 0 0 1}{1 5 0 0} \cdot \frac {\left(\frac {1 0 0 1}{7 5 0} + \alpha (t)\right) ^ {2}}{1 + \alpha (t)} < \frac {1 3}{1 0}. +$$ + +The lower bound 0 of $c_t$ is straightforward since we have + +$$ +c _ {t + 1} > c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t} - \xi_ {t} / 2)) ^ {2} > 0 +$$ + +due to $c_{t} + \xi_{t} / 2 < 31 / 20$ and $-0.01 < \alpha (t) < 1 / 8$ . + +Then we consider the tighter bound and a faster decaying rate after some $t_0$ . If $c_0 > 7/20$ and the lower bound holds at $t = 0$ , then $t_0 = 0 < \log_2\left(\frac{7}{20x_0^\top y_0}\right)$ . Then we begin the induction from $t_0$ . Consider $t \geq t_0$ , + +$$ +\xi_ {t} < \xi_ {0} (- 1 + (\boldsymbol {x} _ {0} ^ {\top} \boldsymbol {y} _ {0}) ^ {2} \eta (\| \boldsymbol {x} _ {0} \| ^ {2} + \| \boldsymbol {y} _ {0} \| ^ {2}) / 2) ^ {2} < \frac {1}{4} +$$ + +and the lower bound of $c_{t + 1}$ becomes (since $7 / 20 < c_t < 1.3$ ) + +$$ +\begin{array}{l} c _ {t + 1} > \min \{c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t} - \xi_ {t} / 2)) ^ {2}, c _ {t} (1 + (1 - c _ {t} - \xi_ {t} / 2)) ^ {2} \} \\ > \min \left\{c _ {t} \left(1 + \frac {9}{8} \left(1 - c _ {t} - 1 / 8\right)\right) ^ {2}, c _ {t} \left(1 + \left(1 - c _ {t} - 1 / 8\right)\right) ^ {2} \right\} \\ > 7 / 2 0. \\ \end{array} +$$ + +The last inequality is because of the monotonic decrement of the last function, which takes minimal value at $c_{t} = \frac{13}{10}$ . This proves the first statement. + +Then consider the alignment dynamics by Equation (127). The factor can be bounded as follow: + +$$ +\begin{array}{l} \left. \left(- 1 + (\boldsymbol {x} ^ {\top} \boldsymbol {y}) ^ {2} \eta \left(\| \boldsymbol {x} \| ^ {2} / 2 + \| \boldsymbol {y} \| ^ {2} / 2 + \eta ((2 - \| \boldsymbol {x} \| ^ {2} \| \boldsymbol {y} \| ^ {2}) ^ {2} - \| \boldsymbol {x} \| ^ {2} \| \boldsymbol {y} \| ^ {2} (\boldsymbol {x} ^ {\top} \boldsymbol {y}) ^ {2}) / 4\right)\right) ^ {2} \right. \\ < \max \{1 - \frac {7}{2 0} \times \frac {1}{2} + 1 0 0 \eta^ {2}, - 1 + \frac {3}{2} \times \frac {9}{8} + 1 0 \eta^ {2} \} ^ {2} < 0. 7 \\ \end{array} +$$ + +By induction, we finish the proof. + +If $c_0 \leq 7/20$ , then we prove that $c_t$ will eventually become larger than $7/20$ after some time $t_0$ , and then apply the same induction process above to finish the proof. + +Still we consider the lower bound of the dynamics of $c_{t}$ . If we have $c_{t} < 7 / 20$ + +$$ +c _ {t + 1} > c _ {t} \left(1 + \left(1 - c _ {t} - \xi_ {t} / 2\right)\right) ^ {2} > c _ {t} \left(1 + \left(1 - c _ {t} - 1 / 8\right)\right) ^ {2} > 2 c _ {t} +$$ + +Then it at most takes $t_0 = \lceil \log_2\left(\frac{7}{20x_0^\top y_0}\right) \rceil$ to satisfy the condition. Now we finish the proof. + +![](images/b3aa17d6697e7c9710fb1504a74a364baca42107ca01df7381c3541cd87e66eb.jpg) + +We first consider the time $\xi$ takes to become smaller than $\eta^2$ . + +Lemma 21. (Alignment convergence time) Suppose all the conditions in Theorem C.1 hold. Then with probability $1 - 2\delta_0 - 2\exp \{-\Omega (d)\}$ , there exists some time $T_{0} = \log_{0.7}(\eta^{2}) + \log_{2}(\frac{21d}{20\delta_{0}^{2}}) = \mathcal{O}(-\log (\eta) + \log (d) - \log (\delta_{0}))$ such that $\xi_t < \eta^2$ and $\| \pmb {x}_t\| \in (\check{x} +\frac{1}{200} K^{-2}\eta^{-\frac{1}{2}},\check{x} +\frac{1}{6} K^{-2}\eta^{-\frac{1}{2}})$ for $t\in [T_0,T_0 + 6K^3 +4K]$ . + +Proof. We first prove that the bound of $(\pmb{x}^{\top}\pmb{y})^{2}$ can be reached with probability $1 - 2\delta_{0} - 2\exp \{-\Omega (d)\}$ , and meanwhile the alignment $\xi$ begins to shrink after $t_0 = \lceil \log_2(\frac{21d}{20\delta_0^2})\rceil$ + +For the initialization, $\delta_x\delta_y = \frac{1}{2}$ , and by symmetry we know + +$$ +\Pr \left[ \left(\boldsymbol {x} _ {0} ^ {\top} \boldsymbol {y} _ {0}\right) ^ {2} < \frac {\delta_ {0} ^ {2}}{3 d} \right] = \Pr \left[ \boldsymbol {x} _ {i} ^ {2} < \frac {\delta_ {0} ^ {2}}{1 . 5 d} \right] +$$ + +It is equivalent to consider sampling from $\mathcal{N}(0, I)$ and then divide it by its norm. By the initialization condition, we apply the Gaussian concentration bound and Theorem 3.1.1 in Vershynin (2018) and get + +$$ +\operatorname * {P r} [ (\pmb {x} _ {0} ^ {\top} \pmb {y} _ {0}) ^ {2} < \frac {\delta_ {0} ^ {2}}{3 d} ] < \operatorname * {P r} [ \pmb {x} _ {1} ^ {2} < \delta_ {0} ^ {2} ] + \operatorname * {P r} [ \| \pmb {x} \| ^ {2} < 1. 5 d ] < 2 \delta_ {0} + 2 \exp \{- \Omega (d) \} +$$ + +Then with probability $p > 1 - 2\delta_0 - 2\exp \{-\Omega (d)\}$ , $\frac{\delta_0^2}{d}\leq (\pmb{x}_0^\top \pmb{y}_0)^2 < \frac{1}{2}$ . During $t\in [0,T + 6K^3 +4K]$ , we can apply the first argument in Lemma 20 and induction to prove that $(\pmb{x}_t^\top \pmb{y}_t)^2 < \frac{13}{10}$ and $0 < \alpha (t) < \frac{13K^{-2}}{50}$ . + +For $t = 0$ , since $\delta_x \in (\check{x} + \frac{1}{80} K^{-2}\eta^{-\frac{1}{2}}, \check{x} + \frac{1}{8} K^{-2}\eta^{-\frac{1}{2}})$ , $\frac{1}{40} K^{-2} < \alpha(0) < \frac{1}{4} K^{-2} < \frac{1}{8}$ and $(\pmb{x}_0^\top \pmb{y}_0)^2 < \| \pmb{x}_0\|^2 \| \pmb{y}_0\|^2 = \frac{1}{4} < \frac{13}{10}$ . Then we suppose for time $t \in [0, t_1 - 1]$ the statement is correct. By the induction hypothesis, we know for $t \in [0, t_1 - 1]$ the condition of Lemma 20 holds. Therefore, by Lemma 20, for all $t \in [0, t_1]$ , $(\pmb{x}_t^\top \pmb{y}_t)^2 < \frac{13}{10}$ . + +With the upper bound of $(\pmb{x}_t^\top \pmb{y}_t)^2$ , the one step movement of $\| \pmb{x}\|^2 + \| \pmb{y}\|^2$ can be bounded: + +$$ +\begin{array}{l} \left\| \boldsymbol {x} _ {t + 1} \right\| ^ {2} + \left\| \boldsymbol {y} _ {t + 1} \right\| ^ {2} - \left\| \boldsymbol {x} _ {t} \right\| ^ {2} - \left\| \boldsymbol {y} _ {t} \right\| ^ {2} \\ = \left(\| \boldsymbol {x} _ {t} \| ^ {2} + \| \boldsymbol {y} _ {t} \| ^ {2}\right) \left(\eta^ {2} \left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) ^ {2} \left(\left(\| \boldsymbol {x} _ {t} \| ^ {2} \| \boldsymbol {y} _ {t} \| ^ {2} - 1\right) ^ {2} \right. \right. \\ + \left(2 - \frac {3}{4} \| \boldsymbol {x} _ {t} \| ^ {2} \| \boldsymbol {y} _ {t} \| ^ {2}\right) \left(\| \boldsymbol {x} _ {t} \| ^ {2} \| \| \boldsymbol {y} _ {t} \| ^ {2} - \left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) ^ {2}\right)) + 4 \eta \left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) ^ {2} \left(1 - \| \boldsymbol {x} _ {t} \| ^ {2} \| \boldsymbol {y} _ {t} \| ^ {2}\right) \\ < \eta \cdot (1 + \alpha (t)) \cdot \frac {1 3}{1 0} \cdot (1 + 1) + 2 \eta < 5 \eta . \\ \end{array} +$$ + +For $t < T_0 + 6K^3 + 4K$ , the total movement of $\| \pmb{x}_t\|^2 + \| \pmb{y}_t\|^2$ is smaller than $5\eta (T + 6K^3 + 4K)$ and the corresponding movement of $\alpha(t)$ is smaller than $5\eta^2 (T + 6K^3 + 4K) < \frac{K^{-2}}{200}$ (since $\eta < \min \left\{\frac{K^{-4}}{8000000}, \frac{K^{-2}}{20000 + 2000(\log(d) - \log(\delta_0))}\right\}$ ). Thus by induction, $(\pmb{x}_t^\top \pmb{y}_t)^2 < \frac{13}{10}$ and $0 < \alpha(t) < \frac{K^{-2}}{100} + \frac{K^{-2}}{4} < \frac{13K^{-2}}{50}$ . Then by the second argument of Lemma 20, we have $\frac{7}{20} < (\pmb{x}_t^\top \pmb{y}_t)^2 < \frac{13}{10}$ and $\xi_{t+1} < 0.7\xi_t$ for $t > \log_2\left(\frac{21d}{20\delta_0^2}\right) = O(\log(d) - \log(\delta_0))$ . + +After $t = \lceil \log_2(\frac{21d}{20\delta_0^2}) \rceil$ , we can calculate the time when $\xi_t < \eta^2$ . It needs at most $\log_{0.7}(\eta^2) = -\mathcal{O}(\log (\eta))$ for $\xi_t$ to become smaller than $\eta^2$ . Now we know with $T_0 = \log_{0.7}(\eta^2) + \log_2(\frac{21d}{20\delta_0^2}) = \mathcal{O}(-\log (\eta) + \log (d) - \log (\delta_0))$ , within $t \in [T_0, T_0 + 6K^3 + 4K]$ , $\xi_t < \eta^2$ always holds. + +On the other hand, we can also have the lower bound of the $\| \pmb{x}_t\|^2 +\| \pmb{y}_t\|^2$ . The one step movement has the lower bound + +$$ +\begin{array}{l} \left\| \boldsymbol {x} _ {t + 1} \right\| ^ {2} + \left\| \boldsymbol {y} _ {t + 1} \right\| ^ {2} - \left\| \boldsymbol {x} _ {t} \right\| ^ {2} - \left\| \boldsymbol {y} _ {t} \right\| ^ {2} \\ = \left(\| \boldsymbol {x} _ {t} \| ^ {2} + \| \boldsymbol {y} _ {t} \| ^ {2}\right) \left(\eta^ {2} \left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) ^ {2} \left(\left(\| \boldsymbol {x} _ {t} \| ^ {2} \| \boldsymbol {y} _ {t} \| ^ {2} - 1\right) ^ {2} \right. \right. \\ + \left(2 - \frac {3}{4} \| \boldsymbol {x} _ {t} \| ^ {2} \| \boldsymbol {y} _ {t} \| ^ {2}\right) \left(\| \boldsymbol {x} _ {t} \| ^ {2} \| \| \boldsymbol {y} _ {t} \| ^ {2} - \left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) ^ {2}\right)) + 4 \eta \left(\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {y} _ {t}\right) ^ {2} \left(1 - \| \boldsymbol {x} _ {t} \| ^ {2} \| \boldsymbol {y} _ {t} \| ^ {2}\right) \\ > 0 - 2 \eta > - 5 \eta . \\ \end{array} +$$ + +So for $t < T_0 + 6K^3 + 4K$ , the total decrement of $\| \pmb{x}_t\|^2 + \| \pmb{y}_t\|^2$ is larger than $-5\eta (T_0 + 6K^3 + 4K) > -\frac{K^{-2}}{200}\eta^{-\frac{1}{2}}$ . Because $\pmb{x}_t^\top \pmb{y}_t \in (\frac{7}{20}, \frac{13}{10})$ , $\| \pmb{y}_t\|^2 < \frac{13}{10} / \| \pmb{x}_t\|^2 < \frac{1}{1000} K^{-2}\eta^{-\frac{1}{2}}$ . Therefore, $\| \pmb{x}_t\|^2 > \frac{1}{200} K^{-2}\eta^{-\frac{1}{2}}$ . + +After we have the alignment guarantee, we can prove that we will enter the feasible regime for the scalar case with high probability. Still, we denote $c_{t} = (\pmb{x}_{t}^{\top}\pmb{y}_{t})^{2}$ . + +Lemma 22. (Feasible regime guarantee) If $\xi_t < \eta^2$ , $\eta < \frac{1}{8000000} K^{-4}$ , $-\frac{1}{100} < \alpha(t) < \frac{1}{2} K^{-2}$ for all $t \in [t_1, t_1 + 6K^3 + 4K]$ , then there exists some $T < 6K^3 + 4K$ such that for all $t \in [t_1 + T, t_1 + 6K^3 + 4K]$ , $\|\pmb{x}_t\| \| \pmb{y}_t\| - 1| < K^{-1}$ . + +Proof. To prove the statement, we try to prove a stronger statement: + +$$ +c _ {t} \in (1 - K ^ {- 1}, 1 + K ^ {- 1} - K ^ {- 2}). +$$ + +If this statement holds, because $\xi_t < \eta^2$ , the product of the norms are + +$$ +\left\| \boldsymbol {x} _ {t} \right\| ^ {2} \left\| \boldsymbol {y} _ {t} \right\| ^ {2} \in (1 - K ^ {- 1}, 1 + K ^ {- 1} - K ^ {- 2} + \eta^ {2}) +$$ + +So we have $\| \pmb{x}_t \| \| \pmb{y}_t \| \in (1 - \frac{2}{3} K^{-1}, 1 + \frac{1}{2} K^{-2})$ and the lemma is proved. So in the rest of the proof, we will prove this stronger statement. + +First we prove that there exists some time $t < 4K + 1$ that the square of the inner product $c_{t}$ will be larger than $1 - K^{-1}$ . + +If $c_{t} \in (\frac{7}{20}, 1/2)$ , then + +$$ +c _ {t + 1} > c _ {t} \left(1 + 1 \times \left(1 - 1 / 4 - \eta^ {2} - 1 / 4\right)\right) ^ {2} > \frac {7}{2 0} \times 1. 4 ^ {2} > 1 / 2. +$$ + +Thus $c_{t}$ will provably enter $c_{t} > 1 / 2$ in one step. And if $1 / 2 < c_{t} < 1 - K^{-1}$ , we have + +$$ +c _ {t + 1} > c _ {t} \left(1 + \left(1 - c _ {t} - \eta^ {2}\right)\right) ^ {2} > c _ {t} \left(1 + \frac {1}{2} K ^ {- 1}\right) > c _ {t} + \frac {1}{4} K ^ {- 1}, +$$ + +which means it takes at most $4K$ steps for $c_t$ to become larger than $1 - K^{-1}$ . + +Now we prove if $c_t > 1 - K^{-1}$ , then it will take at most $T = 6K^3$ steps s.t. for $t' > t + T$ , $c_{t'} \in (1 - K^{-1}, 1 + K^{-1} - K^{-2})$ , which finishes the proof. We first prove there exists some $t, c_t \in (1 - K^{-1}, 1 + K^{-1} - K^{-2})$ ; afterwards we prove that once $c_t$ gets in, it will never get out of the region. + +If at first $c_t \in (1 - K^{-1}, 1 + K^{-1} - K^{-2})$ , the proof is done. Otherwise, we suppose $c_t > 1 + K^{-1} - K^{-2}$ . Next, we consider the two step dynamics of $c_t$ and prove it will decay by a constant factor every two steps. + +First we pick out the relatively small terms, and find out the main part of the two step dynamics. If $\alpha(t) < \alpha_0 < 1/8$ , and $1 + K^{-1} - K^{-2} < c_t < 1.3$ , we have: + +$$ +c _ {t + 1} \leq c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t}) + 1 0 \eta^ {2}) ^ {2} +$$ + +$$ +c _ {t + 1} \geq c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t}) - 2 \eta^ {2}) ^ {2} +$$ + +$$ +\begin{array}{l} c _ {t + 2} \leq c _ {t + 1} (1 + (1 + \alpha (t + 1)) (1 - c _ {t + 1}) + 1 0 \eta^ {2}) ^ {2} \\ < c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t}) + 1 0 \eta^ {2}) ^ {2} (1 + (1 + \alpha (t + 1)) (1 - c _ {t + 1}) + 1 0 \eta^ {2}) ^ {2} \\ \end{array} +$$ + +Then we upper bound the difference $\alpha(t + 1) - \alpha(t)$ in one step. Consider the dynamics of $\|\pmb{x}\|^2 + \|\pmb{y}\|^2$ . The difference each step is at most + +$$ +\begin{array}{l} \left\| \boldsymbol {x} ^ {\prime} \right\| ^ {2} + \left\| \boldsymbol {y} ^ {\prime} \right\| ^ {2} - \left\| \boldsymbol {x} \right\| ^ {2} - \left\| \boldsymbol {y} \right\| ^ {2} \\ = (\| \boldsymbol {x} \| ^ {2} + \| \boldsymbol {y} \| ^ {2}) (\eta^ {2} (\boldsymbol {x} ^ {\top} \boldsymbol {y}) ^ {2} ((\| \boldsymbol {x} \| ^ {2} \| \boldsymbol {y} \| ^ {2} - 1) ^ {2} + (2 - \frac {3}{4} \| \boldsymbol {x} \| ^ {2} \| \boldsymbol {y} \| ^ {2}) (\| \boldsymbol {x} \| ^ {2} \| | | \boldsymbol {y} \| ^ {2} - (\boldsymbol {x} ^ {\top} \boldsymbol {y}) ^ {2}))) \\ + 4 \eta (\boldsymbol {x} ^ {\top} \boldsymbol {y}) ^ {2} (1 - \| \boldsymbol {x} \| ^ {2} \| \boldsymbol {y} \| ^ {2}) \\ < \eta \cdot (1 + \alpha (t)) \cdot \frac {1 3}{1 0} \cdot (1 + 1) + 2 \eta < 5 \eta \\ \end{array} +$$ + +Then the corresponding update of $\alpha(t)$ will be less than $5\eta^2$ . That means we have + +$$ +\begin{array}{l} c _ {t + 2} < c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t}) + 1 0 \eta^ {2}) ^ {2} (1 + (1 + \alpha (t + 1)) (1 - c _ {t + 1}) + 1 0 \eta^ {2}) ^ {2} \\ < c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t}) + 1 0 \eta^ {2}) ^ {2} (1 + (1 + \alpha (t)) (1 - c _ {t + 1}) + 1 5 \eta^ {2}) ^ {2} \\ < c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t})) ^ {2} (1 + (1 + \alpha (t)) (1 - c _ {t + 1})) ^ {2} + 1 0 0 \eta^ {2} \\ < c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t})) ^ {2} (1 + (1 + \alpha (t)) (1 - c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t}) - 2 \eta^ {2})) ^ {2}) + 1 0 0 \eta^ {2} \\ < c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t})) ^ {2} (1 + (1 + \alpha (t)) (1 - c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t})) ^ {2})) ^ {2} + 2 0 0 \eta^ {2} \\ \end{array} +$$ + +(128) + +Similarly, we can have the lower bound of the 2-step dynamics. + +$$ +\begin{array}{l} c _ {t + 2} > c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t}) - 2 \eta^ {2}) ^ {2} (1 + (1 + \alpha (t + 1)) (1 - c _ {t + 1}) - 2 \eta^ {2}) ^ {2} \\ > c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t}) - 2 \eta^ {2}) ^ {2} (1 + (1 + \alpha (t)) (1 - c _ {t + 1}) - 7 \eta^ {2}) ^ {2} \\ > c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t})) ^ {2} (1 + (1 + \alpha (t)) (1 - c _ {t + 1})) ^ {2} - 1 0 0 \eta^ {2} \\ > c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t})) ^ {2} (1 + (1 + \alpha (t)) (1 - c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t}) + 1 0 \eta^ {2}) ^ {2})) ^ {2} - 1 0 0 \eta^ {2} \\ > c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t})) ^ {2} (1 + (1 + \alpha (t)) (1 - c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t})) ^ {2})) ^ {2} - 2 0 0 \eta^ {2} \tag {129} \\ \end{array} +$$ + +After bound all small terms to $200\eta^2$ , we consider the main part + +$$ +c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t})) ^ {2} (1 + (1 + \alpha (t)) (1 - c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t})) ^ {2})) ^ {2} +$$ + +To prove it will decrease, we need to prove the factor + +$$ +f (\alpha , c) = (1 + (1 + \alpha) (1 - c)) (1 + (1 + \alpha) (1 - c (1 + (1 + \alpha) (1 - c)) ^ {2})) < 1 +$$ + +when $\alpha \in \left(-\frac{1}{100}, \min \left\{\frac{1}{2} K^{-2}, 1/8\right\}\right), 1 + K^{-1} - K^{-2} < c < 1.3$ . + +We first prove that the function $f(\alpha, c)$ monotonically increases when $\alpha > -\frac{1}{100}$ increases, i.e. $\frac{\partial f(\alpha, c)}{\partial \alpha} > 0$ . We directly give the simplified expression of this partial derivative. + +$$ +\begin{array}{l} \frac {\partial f (\alpha , c)}{\partial \alpha} = (c - 1) (- 4 - 2 \alpha + c (1 + \alpha) [ \frac {1 5}{1 6} + (2 c (1 + \alpha) - \frac {1 7}{4} - 2 \alpha) ^ {2} ]) \\ = (c - 1) (- 4 - 2 \alpha + (1 + \alpha) [ \frac {1 5}{1 6} c + (2 c (1 + \alpha) - \frac {1 7}{4} - 2 \alpha) ^ {2} c ]) \\ > (c - 1) (- 2 \alpha - 4 + (1 + \alpha) (\frac {1 5}{1 6} c + \frac {8 1}{4} (1 - \frac {1}{2} c) ^ {2} c)) \quad (\text {s i n c e} - \frac {1}{1 0 0} < \alpha < 1 / 8) \\ > (c - 1) (- 2 \alpha - 4 + (1 + \alpha) \times 4) \quad (c \in (1, \frac {1 3}{1 0})) \\ > 0. \tag {130} \\ \end{array} +$$ + +Therefore, $f(\alpha, c) < f\left(\frac{1}{2} K^{-2}, c\right)$ for all $1 + K^{-1} - K^{-2} < c < 1.3$ . Denote $\beta = \frac{1}{2} (K^{-2} - 2K^{-3} + K^{-4})$ and suppose $c = 1 + t\sqrt{\beta}$ for some $t > \sqrt{2}$ (since $c > 1 + K^{-1} - K^{-2}$ ). Meanwhile, since $t\sqrt{\beta} < 0.3$ , $t < 0.3\beta^{-1/2}$ . + +Then we plug in $c = 1 + t\sqrt{\beta}$ and expand $f(\beta, c)$ . + +$$ +\begin{array}{l} f (\beta , c) = f (\beta , 1 + t \sqrt {\beta}) \\ = 1 + 2 t \beta^ {3 / 2} - 2 t ^ {3} \beta^ {3 / 2} - 3 t ^ {2} \beta^ {2} + t ^ {4} \beta^ {2} + 2 t \beta^ {5 / 2} - 5 t ^ {3} \beta^ {5 / 2} - 6 t ^ {2} \beta^ {3} + 4 t ^ {4} \beta^ {3} - 3 t ^ {3} \beta^ {7 / 2} \\ - 3 t ^ {2} \beta^ {4} + 6 t ^ {4} \beta^ {4} + t ^ {3} \beta^ {9 / 2} + 4 t ^ {4} \beta^ {5} + t ^ {3} \beta^ {1 1 / 2} + t ^ {4} \beta^ {6} \\ \leq 1 + (2 t - t ^ {3}) \beta^ {3 / 2} - t ^ {3} \beta^ {3 / 2} - 3 t ^ {2} \beta^ {2} + 0. 3 t ^ {3} \beta^ {3 / 2} + 2 t \beta^ {5 / 2} - 5 t ^ {3} \beta^ {5 / 2} - 6 t ^ {2} \beta^ {3} + 1. 2 t ^ {3} \beta^ {5 / 2} \\ - 3 t ^ {3} \beta^ {7 / 2} - 3 t ^ {2} \beta^ {4} + 1. 8 t ^ {3} \beta^ {7 / 2} + 0. 3 t ^ {2} \beta^ {4} + 0. 3 6 t ^ {2} \beta^ {4} + 0. 3 t ^ {2} \beta^ {5} + 0. 0 9 t ^ {2} \beta^ {5} \\ < 1 - 0. 7 t ^ {3} \beta^ {3 / 2} - 3 t ^ {2} \beta^ {2} < 1 - \beta^ {3 / 2} - 6 \beta^ {2} \tag {131} \\ \end{array} +$$ + +Thus we have + +$$ +c _ {t + 2} < c _ {t} \left(1 - \beta^ {3 / 2} - 6 \beta^ {2}\right) ^ {2} + 2 0 0 \eta^ {2} < c _ {t} - \beta^ {3 / 2} < c _ {t} - \frac {1}{1 0} K ^ {- 3} +$$ + +Thus it takes at most $2 \times 0.3 / \left(\frac{1}{10} K^{-3}\right) < 6K^3$ steps for $c_{t}$ to get into the region $c_{t} \in (1 - K^{-1}, 1 + K^{-1} - K^{-2})$ . + +Finally we prove that if $c_s \in (1 - K^{-1}, 1 + K^{-1} - K^{-2})$ for some $s$ , then for all $t > s$ , + +$$ +c _ {t} \in (1 - K ^ {- 1}, 1 + K ^ {- 1} - K ^ {- 2}). +$$ + +We use induction and suppose $c_{t}$ satisfies the condition above. Note that we have the upper and lower bound of $c_{t + 1}$ above: + +$$ +c _ {t + 1} \leq c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t}) + 1 0 \eta^ {2}) ^ {2} \leq c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t})) ^ {2} + 1 0 0 \eta^ {2} +$$ + +$$ +c _ {t + 1} \geq c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t}) - 2 \eta^ {2}) ^ {2} \geq c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t})) ^ {2} - 1 0 0 \eta^ {2} +$$ + +Meanwhile $c_{t}(1 + (1 + \alpha(t))(1 - c_{t}))^{2}$ is monotonically decreasing with $c_{t}$ when $-\frac{1}{100} < \alpha(t) < \frac{1}{2} K^{-2}$ and $c_{t} \in (1 - K^{-1}, 1 + K^{-1} - K^{-2})$ . Thus we have: + +$$ +\begin{array}{l} c _ {t + 1} \leq c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t})) ^ {2} + 1 0 0 \eta^ {2} \\ \leq (1 - K ^ {- 1}) \left(1 + K ^ {- 1} \left(1 + \frac {1}{2} K ^ {- 2}\right)\right) ^ {2} + 1 0 0 \eta^ {2} \\ = 1 + K ^ {- 1} - K ^ {- 2} \left(1 + \frac {1}{2} K ^ {- 2}\right) ^ {2} + K ^ {- 3} - K ^ {- 3} \left(1 + \frac {1}{2} K ^ {- 2}\right) ^ {2} + 1 0 0 \eta^ {2} \\ < 1 + K ^ {- 1} - K ^ {- 2}. \\ \end{array} +$$ + +$$ +\begin{array}{l} c _ {t + 1} \geq c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t})) ^ {2} - 1 0 0 \eta^ {2} \\ > (1 + K ^ {- 1} - K ^ {- 2}) (1 - (K ^ {- 1} - K ^ {- 2}) (1 + \frac {1}{2} K ^ {- 2})) ^ {2} - 1 0 0 \eta^ {2} \\ = 1 - K ^ {- 1} + 2 K ^ {- 3} - 3 K ^ {- 4} + 4 K ^ {- 5} - \frac {1 5}{4} K ^ {- 6} + \frac {1 1}{4} K ^ {- 7} - \frac {3}{2} K ^ {- 8} \\ + \frac {3}{4} K ^ {- 9} - \frac {1}{4} K ^ {- 1 0} - 1 0 0 \eta^ {2} \\ > 1 - K ^ {- 1}. \\ \end{array} +$$ + +Therefore, by induction we prove that for all $t > s$ , $c_{t} \in (1 - K^{-1}, 1 + K^{-1} - K^{-2})$ . In this way, $\| \pmb{x}_t \| \| \pmb{y}_t \| - 1 | < K^{-1}$ for $t > t_1 + T$ . + +Entering the feasible region is not enough for establishing the equivalence to the scalar case. Furthermore, we need the alignment variable $\xi_{t}$ to be small enough, such that some $\mathcal{O}(\cdot)$ notation term can contain all the terms with $\xi$ in the $(a,b)$ -parameterization dynamics. + +However, we need to guarantee that the trajectory does not converge to an unstable point near the minima. We can prove that for the scalar case if the initialization is not exactly on the manifold of minimizers, but it becomes more challenging in higher dimensions. Therefore, we require an additional perturbation to escape from any unstable point. We pick the time $t_p = T_0 + 6K^3 + 4K = \mathcal{O}(-\log(\eta) + \log(d) - \log(\delta_0) + K^3)$ to guarantee that when the perturbation happens, $\pmb{x}$ and $\pmb{y}$ are aligned and $(\pmb{x}^\top \pmb{y})^2$ is not large enough to cause instability. After the perturbation at $t_p$ , the gradient descent dynamics prevent the objective from hitting the manifold of minimizers. + +The following lemma proves that the properties of the bound of $c_t \coloneqq (\pmb{x}^\top \pmb{y})^2$ , $\alpha = \eta(\| \pmb{x} \|^2 + \| \pmb{y} \|^2) - 1$ and $\xi$ are still valid after the perturbation. + +Lemma 23. After the perturbation at time $t_p$ , we have the following properties hold in $t \in [t_p, 2t_p + 2]$ : (i) After the perturbation $c_{t_p}' \in (1 + K^{-1} - 2K^{-2}, 1 + 3K^{-1} + 2K^{-2})$ , and $c_t \in (\frac{7}{20}, \frac{13}{10})$ ; (ii) $\frac{K^{-2}}{100} < \alpha(t) < \frac{1}{2} K^{-2}$ ; (iii) $\xi_t < (0.7)^{t - t_p}\eta^2$ . + +Proof. We prove this property by induction. Firstly, we prove the basis of induction at $t = t_p$ . + +For (i), before perturbation we have $c_{t_p} \in (1 - K^{-1}, 1 + K^{-1} - K^{-2})$ , so after the perturbation we have $c_{t_p}' \in (1 + K^{-1} - 2K^{-2}, 1 + 3K^{-1} + 2K^{-2}) \subset (\frac{7}{20}, \frac{13}{10})$ . + +For (ii), the initial value of $\alpha(t)$ satisfies that $\frac{1}{40} K^{-2} < \alpha(0) < \frac{1}{4} K^{-2}$ . But the total movement of $\alpha(t)$ before perturbation is bounded within $(-5\eta^2 t_p, 5\eta^2 t_p) \subset (-\frac{K^{-2}}{200}, \frac{K^{-2}}{200})$ , and the perturbation introduces a movement of $\| \pmb{y} \|^2$ by $\| \pmb{y}_t \|^2 < \frac{13}{10} / \| \pmb{x}_t \|^2 < \frac{1}{1000} K^{-2}\eta^{-\frac{1}{2}}$ . Due to the upper bound of $\eta$ , $\alpha(t) \in (\frac{K^{-2}}{100}, \frac{K^{-2}}{2})$ . + +For (iii), since $K > 512$ , thus at $t_p$ , $\xi_{t_p} < (0.7)^{6K^3}\xi_t < (0.7)^{6K^3}\eta^2$ . After the perturbation $\xi_{t_p}' = (1 + 2K^{-1})^2\xi_{t_p} < \eta^2$ . So all three statements hold for $t = t_p$ . + +Then we suppose for $t \in [t_p, t_p + t_1]$ all three statements hold and prove them for $t_p + t_1 + 1$ . First by the dynamics of $c_t$ with condition $c_t \in \left(\frac{7}{20}, \frac{13}{10}\right)$ and $0 < \alpha(t) < \frac{K^{-2}}{2}$ , we have $c_{t+1} < c_t (1 + (1 + \frac{K^{-2}}{2})(1 - c_t))^2 < 13/10$ and $c_{t+1} > c_t (1 + (1 - c_t) - 10\eta^2)^2 > \frac{7}{20}$ . Statement (i) is proved. + +For (ii), since $c_t$ and $\xi_t$ are bounded for $t \leq t_p + t_1 + 1$ , we can still have the total movement of $\alpha(t)$ lies in $(-5\eta^2 t_p, 5\eta^2 t_p) \subset (-\frac{K^{-2}}{200}, \frac{K^{-2}}{200})$ . Combine with the movement of $y$ at perturbation $(< \frac{1}{1000} K^{-2}\eta^{-\frac{1}{2}})$ , the total movement is still bounded by $(-\frac{6K^{-2}}{1000}, \frac{6K^{-2}}{1000})$ , which proves the bound in (ii). + +Finally for (iii), as long as $c_t < \frac{13}{10}$ , $\xi_{t+1} < 0.7\xi_t < 0.7^{t_1 + 1}\eta^2$ . Therefore all three statements are proved by induction. + +After reclaiming all the bounds after the perturbation, we need to prove that the alignment variable $\xi$ will be small enough to approximate the scalar case. The following lemma proves that $b$ stays at a constant level when $\alpha(t)$ is some constant. + +Lemma 24. Suppose $\xi_t < \eta^2$ , $\eta < \frac{1}{8000000} K^{-4}$ , $\frac{K^{-2}}{100} < \alpha(t) < \frac{1}{2} K^{-2}$ for all $t \in [t_1, 2t_1 + 2]$ for some $t_1$ . If $(\pmb{x}_{t_1}^\top \pmb{y}_{t_1})^2 \in (1 + K^{-1} - 2K^{-2}, 1 + 3K^{-1} + 2K^{-2})$ , then for all $t \in [t_1, 2t_1]$ , $(\pmb{x}_{t_1 + 2k}^\top \pmb{y}_{t_1 + 2k})^2 \in (1 + \frac{1}{20} K^{-1}, 1 + 3K^{-1} + 2K^{-2})$ , $(\pmb{x}_{t_1 + 2k - 1}^\top \pmb{y}_{t_1 + 2k - 1})^2 < 1 - \frac{1}{20} K^{-1}$ , $k \in \mathbb{N}$ , $k < t_1/2$ . + +Proof. Denote $c_t \coloneqq (\pmb{x}_t^\top \pmb{y}_t)^2$ . Here we consider the two step dynamics of the inner product (Eq. (128) and Eq. (129)). + +$$ +c _ {t + 2} < c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t})) ^ {2} (1 + (1 + \alpha (t)) (1 - c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t})) ^ {2})) ^ {2} + 2 0 0 \eta^ {2} +$$ + +$$ +c _ {t + 2} > c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t})) ^ {2} (1 + (1 + \alpha (t)) (1 - c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t})) ^ {2})) ^ {2} - 2 0 0 \eta^ {2} +$$ + +We first consider the lower bound of the $(\pmb{x}_{t_1 + 2k}^{\top}\pmb{y}_{t_1 + 2k})^2$ . We prove the sequence of the $c_{t + 2k}, k = 0, 1, 2, \ldots$ by induction, and then use this conclusion to prove the upper bound of $c_{t + 2k - 1}$ . We know that $k = 0$ the statement holds. Then suppose the lower bound holds for $k \leq k_0$ , and we prove it for $k = k_0 + 1$ . + +Here we consider the function as we do in Lemma 22: + +$$ +f (\alpha , c) = (1 + (1 + \alpha) (1 - c)) (1 + (1 + \alpha) (1 - c (1 + (1 + \alpha) (1 - c)) ^ {2})). +$$ + +Denote $\gamma = \frac{1}{100} K^{-2}$ . By Eq. (130), we know + +$$ +f (\alpha , c) > f (\gamma , c) +$$ + +Suppose $c_{t_1 + 2k} = 1 + q\sqrt{\gamma}, q \in \left(\frac{1}{2}, 30 + 40K^{-1}\right)$ . Then the expression $f(\gamma, c)$ becomes: + +$$ +\begin{array}{l} f (\gamma , c) = f (\gamma , 1 + q \sqrt {\gamma}) \\ = 1 + 2 q \gamma^ {3 / 2} - 2 q ^ {3} \gamma^ {3 / 2} - 3 q ^ {2} \gamma^ {2} + q ^ {4} \gamma^ {2} + 2 q \gamma^ {5 / 2} - 5 q ^ {3} \gamma^ {5 / 2} - 6 q ^ {2} \gamma^ {3} + 4 q ^ {4} \gamma^ {3} - 3 q ^ {3} \gamma^ {7 / 2} \\ - 3 q ^ {2} \gamma^ {4} + 6 q ^ {4} \gamma^ {4} + q ^ {3} \gamma^ {9 / 2} + 4 q ^ {4} \gamma^ {5} + q ^ {3} \gamma^ {1 1 / 2} + q ^ {4} \gamma^ {6} \\ \end{array} +$$ + +Notice that when $c > 1$ , $f(\gamma, c)$ decreases as $c$ increases. Now we consider the range of $q$ : If $q \in (\frac{1}{2}, \frac{2}{3}]$ , we have: + +$$ +\begin{array}{l} f (\gamma , c) \geq f (\gamma , 1 + \frac {2}{3} \sqrt {\gamma}) \\ = \frac {2 0 \gamma^ {3 / 2}}{2 7} - \frac {4 \gamma^ {5 / 2}}{2 7} - \frac {8 \gamma^ {7 / 2}}{9} + \frac {8 \gamma^ {9 / 2}}{2 7} + \frac {8 \gamma^ {1 1 / 2}}{2 7} \\ \end{array} +$$ + +$$ +\begin{array}{l} + \frac {1 6 \gamma^ {6}}{8 1} + \frac {6 4 \gamma^ {5}}{8 1} - \frac {4 \gamma^ {4}}{2 7} - \frac {1 5 2 \gamma^ {3}}{8 1} - \frac {9 2 \gamma^ {2}}{8 1} + 1 \\ > 1 + \frac {1 0}{2 7} \gamma^ {3 / 2}. \quad \left(\text {s i n c e} K > 5 1 2, \gamma^ {1 / 2} = \frac {K ^ {- 1}}{1 0}\right) \\ \end{array} +$$ + +That means $c_{t_1 + 2k + 2} > ((1 + \frac{10}{27} K^{-2})^2 - 200\eta^2)c_{t_1 + 2k} > c_{t_1 + 2k} > (1 + \frac{K^{-1}}{20})$ and the proof is done. Otherwise, we have $q \in (\frac{2}{3}, 30 + 40K^{-1})$ , also we have the lower bound of this function: + +$$ +\begin{array}{l} f (\gamma , c) \geq f (\gamma , 1 + \frac {2}{3} \sqrt {\gamma}) \\ = - 1 2 7 9 2 0 \gamma^ {3 / 2} - 3 1 9 9 2 0 \gamma^ {5 / 2} - 1 9 2 0 0 0 \gamma^ {7 / 2} + 6 4 0 0 0 \gamma^ {9 / 2} + 6 4 0 0 0 \gamma^ {1 1 / 2} \\ + 2 5 6 0 0 0 0 \gamma^ {6} + 1 0 2 4 0 0 0 0 \gamma^ {5} + 1 5 3 5 5 2 0 0 \gamma^ {4} + 1 0 2 3 0 4 0 0 \gamma^ {3} + 2 5 5 5 2 0 0 \gamma^ {2} + 1 \\ > 1 - 1 0 0 0 0 0 \gamma^ {3 / 2}. \quad \left(\text {s i n c e} K > 5 1 2, \gamma^ {1 / 2} = \frac {K ^ {- 1}}{1 0}\right) \\ \end{array} +$$ + +That means + +$$ +\begin{array}{l} c _ {t _ {1} + 2 k + 2} > \left(\left(1 - 1 0 0 0 0 0 \gamma^ {3 / 2}\right) ^ {2} - 2 0 0 \eta^ {2}\right) c _ {t _ {1} + 2 k} \\ > (1 - 2 0 0 0 0 0 \gamma^ {3 / 2} - 2 0 0 \eta^ {2}) (1 + \frac {2}{3} \sqrt {\gamma}) \\ > \left(1 - \frac {2 0 0 0 0 0}{2 6 2 1 4 4 0 0} \gamma^ {1 / 2} - 2 0 0 \eta^ {2}\right) \left(1 + \frac {2}{3} \sqrt {\gamma}\right) \\ > \left(1 - \frac {1}{1 0 0 0} K ^ {- 1} - \frac {1}{4 0 0 0} K ^ {- 4}\right) \left(1 + \frac {K ^ {- 1}}{1 5}\right) \\ > (1 + \frac {K ^ {- 1}}{2 0}) \\ \end{array} +$$ + +Then the lower bound of $c_{t_1 + 2k}$ is proved. + +As for the upper bound, since when $t = t_1 + 2k$ , $x, y$ satisfies all the conditions in Lemma 22. If $c_{t_1 + 2k} < 1 + K^{-1} - K^{-2}$ , we have proved that it will never be larger than $1 + K^{-1} - K^{-2}$ . Otherwise if $c_{t_1 + 2k} \in (1 + K^{-1} - K^{-2}, 1 + 3K^{-1} + 2K^{-2})$ We apply the inequality Eq. (131) and know $c_{t_1 + 2k + 2} < c_{t_1 + 2k}$ . In this way, by induction we prove the bound $(\pmb{x}_{t_1 + 2k}^{\top}\pmb{y}_{t_1 + 2k})^2 \in (1 + \frac{1}{20} K^{-1}, 1 + 3K^{-1} + 2K^{-2})$ . + +As for the upper bound of $(\pmb{x}_{t_1 + 2k - 1}^\top \pmb{y}_{t_1 + 2k - 1})^2$ , we directly apply the upper bound of 1-step dynamics (if $c_{t} > 1 + \frac{1}{20} K^{-1}$ ): + +$$ +\begin{array}{l} c _ {t + 1} \leq c _ {t} (1 + (1 + \alpha (t)) (1 - c _ {t}) + 1 0 \eta^ {2}) ^ {2} \\ < c _ {t} \left(2 - c _ {t} + 1 0 \eta^ {2}\right) ^ {2} \\ < (1 + \frac {K ^ {- 1}}{2 0}) (1 - \frac {K ^ {- 1}}{2 0}) ^ {2} + 1 0 0 \eta^ {2} \\ < 1 - \frac {K ^ {- 1}}{2 0} - \frac {1}{4 0 0} K ^ {- 2} + \frac {1}{8 0 0 0} K ^ {- 3} + 1 0 0 \eta^ {2} \\ < 1 - \frac {1}{2 0} K ^ {- 1} \\ \end{array} +$$ + +Therefore the upper bound $(\pmb{x}_{t_1 + 2k - 1}^\top \pmb{y}_{t_1 + 2k - 1})^2 < 1 - \frac{1}{20} K^{-1}$ holds for all $k < t_1 / 2$ + +![](images/cd23b0dc3af2d6e9f1bfcde40a38e823ba41e68a6fd106061bcafda99f0f2223.jpg) + +Finally, we denote $a \coloneqq \sqrt{\|\pmb{x}\|^2 - \|\pmb{y}\|^2} - (\eta^{-2} - 4)^{\frac{1}{2}}, b \coloneqq \|\pmb{x}\| \|\pmb{y}\| - 1$ . With all the lemmas above, we prove the equivalence between the dynamics of $(a, b)$ and the one-step dynamics of in the scalar case (Lemma 1, Lemma 2). For simplicity of notations, when analyzing the 1-step and 2-step dynamics of $(a_t, b_t)$ , we use $a, a'$ to denote $a_t, a_{t+1}$ and $b, b'$ to denote $b_t, b_{t+1}$ , etc. For simplicity of calculation, we consider the change of variable $\kappa = \sqrt{\eta}$ . + +Lemma 25. (Equivalence with scalar updates) If $\xi_t < \min\{\eta^2, \eta b_t^4\}$ , $\| \boldsymbol{x}_t \| \in (\check{x} + \frac{1}{200} K^{-2}\eta^{-\frac{1}{2}}, \check{x} + \frac{1}{4} K^{-2}\eta^{-\frac{1}{2}})$ and $||\boldsymbol{x}_t||\|\boldsymbol{y}_t\|-1| < K^{-1}$ , the following equations hold for some fixed constant $\epsilon = \min\{0.5, \frac{1}{125} K^{-1}\}$ : + +$$ +a ^ {\prime} = a - 2 b ^ {2} \kappa^ {3} + \mathcal {O} \left(\epsilon b ^ {2} \kappa^ {3}\right) + \mathcal {O} \left(b ^ {2} \kappa^ {4}\right). \tag {132} +$$ + +$$ +b ^ {\prime} = - b - 4 a b \kappa - 3 b ^ {2} - b ^ {3} + \mathcal {O} (a b ^ {2} \kappa) + \mathcal {O} (a ^ {2} b \kappa^ {2}) + \mathcal {O} (b ^ {2} \kappa^ {4}) + \mathcal {O} (b \kappa^ {5}). +$$ + +Proof. For simplicity, we denote $x = \| \pmb{x} \|$ and $y = \| \pmb{y} \|$ . We first prove that: + +$$ +x ^ {\prime} = x + \kappa^ {2} x y ^ {2} \left(1 - x ^ {2} y ^ {2}\right) + \mathcal {O} \left(\kappa^ {4} b ^ {2}\right). \tag {133} +$$ + +$$ +y ^ {\prime} = y + \kappa^ {2} x ^ {2} y (1 - x ^ {2} y ^ {2}) + \mathcal {O} (\kappa^ {2} b ^ {2}). +$$ + +We suppose $\pmb{y} = c\pmb{x} + \pmb{\theta}$ for some $\pmb{\theta} \in \mathbb{R}^d$ and $\langle \pmb{\theta}, \pmb{x} \rangle = 0$ . In this way, we have $\pmb{x}^\top \pmb{y} = c x^2, y^2 = c^2 x^2 + \| \pmb{\theta} \|^2, \xi = x^2 \| \pmb{\theta} \|^2$ . Since $\xi < \eta b^4$ and $x = \mathcal{O}(\kappa^{-1})$ , $\| \pmb{\theta} \| = \mathcal{O}(b^2 \kappa^2)$ . + +Then check the dynamics of $\pmb{x}$ and plug in $\pmb{y} = c\pmb{x} + \pmb{\theta}$ . + +$$ +\boldsymbol {x} ^ {\prime} = \boldsymbol {x} + \eta ((\boldsymbol {x} ^ {\top} y) y - \frac {1}{2} (\boldsymbol {x} ^ {\top} \boldsymbol {y}) x ^ {2} y ^ {2} \boldsymbol {y} - \frac {1}{2} (\boldsymbol {x} ^ {\top} \boldsymbol {y}) ^ {2} y ^ {2} \boldsymbol {x}) +$$ + +$$ +(1 + \eta y ^ {2} - \eta x ^ {2} y ^ {4}) \pmb {x} + (- \eta \| \pmb {\theta} \| ^ {2} + \eta x ^ {2} y ^ {2} \| \pmb {\theta} \| ^ {2}) \pmb {x} + (\eta (\pmb {x} ^ {\top} \pmb {y}) - \frac {1}{2} \eta (\pmb {x} ^ {\top} \pmb {y}) x ^ {2} y ^ {2}) \pmb {\theta}. +$$ + +Since $(\pmb{x}^{\top}\pmb{y})$ and $xy$ are both bounded as constant, we can directly take the norm of both sides and with triangle inequality we have: + +$$ +x ^ {\prime} = x + \kappa^ {2} x y ^ {2} (1 - x ^ {2} y ^ {2}) + \mathcal {O} (b ^ {2} \kappa^ {4}). +$$ + +Similarly, we have the dynamics of $y$ . + +$$ +y ^ {\prime} = y + \kappa^ {2} x ^ {2} y (1 - x ^ {2} y ^ {2}) + \mathcal {O} \left(b ^ {2} \kappa^ {2}\right). +$$ + +We now reparameterize the dynamics in $(a,b)$ -parameterization. + +$$ +a ^ {\prime} = \left(a + \left(\kappa^ {- 4} - 4\right) ^ {\frac {1}{4}}\right) \left(1 - b ^ {2} (1 + b) ^ {2} (2 + b) ^ {2} \kappa^ {4}\right) ^ {\frac {1}{2}} - \left(\kappa^ {- 4} - 4\right) ^ {\frac {1}{4}} + \mathcal {O} \left(b ^ {2} \kappa^ {4}\right). +$$ + +$$ +b ^ {\prime} = b - 2 b \delta - 3 b ^ {2} \delta - b ^ {3} \delta + 4 b ^ {2} \kappa^ {4} + 1 6 b ^ {3} \kappa^ {4} + 2 5 b ^ {4} \kappa^ {4} + 1 9 b ^ {5} \kappa^ {4} + 7 b ^ {6} \kappa^ {4} + b ^ {7} \kappa^ {4} + \mathcal {O} (a b ^ {2} \kappa^ {2}) +$$ + +$$ +\text {w h e r e} \delta \triangleq \sqrt {4 \eta^ {2} (1 + b) ^ {2} + \left(a \eta^ {\frac {1}{2}} + (1 - 4 \eta^ {2}) ^ {\frac {1}{4}}\right) ^ {4}}. \tag {134} +$$ + +And by the bound of $\| \pmb{x}_t\|$ and $||\pmb{x}_t||\| \pmb{y}_t\| -1|$ , we can have $|a| < \epsilon \kappa, |b| < \min \{1,\frac{1}{5}\epsilon \kappa^{-2}\}$ , which satisfies the condition in Lemma 1 and Lemma 2. Then we follow the proof of Lemma 1 and Lemma 2 to finish the proof (since the only difference is the two $\mathcal{O}(\cdot)$ notation). + +After we can reduce the dynamics of vector case to the scalar case dynamics, we need to prove that in the scalar case (in all stages), for any $t \geq 0$ , $\left(\frac{b_{t+1}}{b_t}\right)^4 > 0.7$ , which means $\xi_t$ shrinks faster than $b_t^4$ . In that case, we can conclude that $\xi_t > \eta b_t^4$ always holds along the scalar case trajectory. + +Lemma 26. Suppose all conditions in Theorem 3.1 hold. Then for all $t > 0$ , $\left(\frac{b_{t + 1}}{b_t}\right)^4 > 0.7$ . + +Proof. From the proof of Theorem 3.1, we know that for all $t > 0$ , $|b_t| < K^{-1}$ and $|a_t| < \kappa^{-1}$ . Thus Lemma 2 holds and for all $t \geq 0$ we have + +$$ +b _ {t + 1} = - b _ {t} - 4 a _ {t} b _ {t} \kappa - 3 b _ {t} ^ {2} - b _ {t} ^ {3} + \mathcal {O} \left(a _ {t} b _ {t} ^ {2} \kappa\right) + \mathcal {O} \left(a _ {t} ^ {2} b _ {t} \kappa^ {2}\right) + \mathcal {O} \left(b _ {t} ^ {2} \kappa^ {4}\right) + \mathcal {O} \left(b _ {t} \kappa^ {5}\right). \tag {135} +$$ + +Since we know all constants hidden by the $\mathcal{O}(\cdot)$ operator are upper bounded by $K$ , we have the following lower bound on the multiplicative update of $b$ : + +$$ +\frac {b _ {t + 1} ^ {4}}{b _ {t} ^ {4}} \geq \left(1 - 4 a _ {t} \kappa - 3 b _ {t} - b _ {t} ^ {2} - K a _ {t} b _ {t} \kappa - K a _ {t} ^ {2} \kappa^ {2} - K b _ {t} \kappa^ {4} - K \kappa^ {5}\right) ^ {4} +$$ + +$$ +\begin{array}{l} \geq \left(1 - 2 K ^ {- 2} - 3 K ^ {- 1} - K ^ {- 2} - K ^ {- 2} - \kappa - \kappa^ {4} - \kappa^ {4}\right) ^ {4} \\ \geq (1 - 1 0 K ^ {- 1}) ^ {4} > \left(\frac {5 0 2}{5 1 2}\right) ^ {4} > 0. 7. \\ \end{array} +$$ + +![](images/ea81b262a8bead4c79544c1edc6473b42f495f980f3b9e2200e21ad99fc36330.jpg) + +Finally we conclude the proof of Theorem C.1. + +Proof of Theorem C.1. By Lemma 21, we know with probability $1 - 2\delta_0 - 2\exp \{-\Omega (d)\}$ , there exists some time $T_{0} = \mathcal{O}(-\log (\eta) - \log (\delta_{0}) + \log (d))$ that $\xi_t < \eta^2$ for all $t > T_0$ . Also for $t\in [T_0,T_0 + 6K^3 +4K]$ , $\| \pmb {x}_t\| \in (\check{x} +\frac{1}{200} K^{-2}\eta^{-\frac{1}{2}},\check{x} +\frac{1}{6} K^{-2}\eta^{-\frac{1}{2}})$ . This bound of $\| \pmb {x}\|$ guarantees that for $t\in [T_0,T_0 + 6K^3 +4K]$ , $\alpha (t)\in (0,\frac{K^{-2}}{2})$ , which satisfies the condition of Lemma 22. + +Then by Lemma 22, we know for some $t^* < T_0 + 6K^3 + 4K < t_p$ , $||\pmb{x}_t||\|\pmb{y}_t\| - 1| < K^{-1}$ for $t \in [t^*, t_p]$ . After entering and staying in the region, we add the perturbation at $t_p$ . By Lemma 23, we have the bounds before perturbation still hold: (i) After the perturbation $c_{t_p}' \in (1 + K^{-1} - 2K^{-2}, 1 + 3K^{-1} + 2K^{-2})$ , and $c_t \in (\frac{7}{20}, \frac{13}{10})$ ; (ii) $\frac{K^{-2}}{100} < \alpha(t) < \frac{1}{2}K^{-2}$ ; (iii) $\xi_t < (0.7)^{t - t_p}\eta^2$ . Therefore, the condition of Lemma 22 and Lemma 24 are both met. So after another $6K^3 + 4K$ steps, we have $|b_t| = ||\pmb{x}_t||\|\pmb{y}_t\| - 1| < K^{-1}$ and $|(x_t^\top y_t)^2 - 1| > 1 - \frac{K^{-1}}{20}$ . The second expression can lead to $|b_t| > \frac{K^{-1}}{20} / (1 + ||\pmb{x}_t||\|\pmb{y}_t\|) > \frac{K^{-1}}{41}$ . This means $\xi_t < (0.7)^{4K}\eta^2 < (0.7)^{2000}\eta \cdot \frac{K^{-4}}{8000000} < \eta |b_t|^4$ . + +By Lemma 25, we know the dynamics of the norm of the vectors $(\| x\| ,\| y\|)$ can be captured by the scalar case (including the initialization condition and the one step update rules). And by Lemma 26, we know the alignment will be kept and the dynamics of the vectors will always be true. + +Finally, we apply Theorem 3.1 and finish the proof. \ No newline at end of file diff --git a/understandingedgeofstabilitytrainingdynamicswithaminimalistexample/images.zip b/understandingedgeofstabilitytrainingdynamicswithaminimalistexample/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..ff236c3c09c79f0dedae5a8aa5bff3b21caa1824 --- /dev/null +++ b/understandingedgeofstabilitytrainingdynamicswithaminimalistexample/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2b1b420932d7db28a8b4edf37bd9b8dd2e1fb81a20be9b6aeacbcd249b1d7778 +size 3944776 diff --git a/understandingedgeofstabilitytrainingdynamicswithaminimalistexample/layout.json b/understandingedgeofstabilitytrainingdynamicswithaminimalistexample/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..5c05207da7e3899ae4a82703deabc8387ca34baf --- /dev/null +++ b/understandingedgeofstabilitytrainingdynamicswithaminimalistexample/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8b948de142b9e54d232c2a118c792a0f475c9b0d5e5d13d9e687c5790d7f2c5c +size 3550790 diff --git a/understandingembodiedreferencewithtouchlinetransformer/3279c5c8-e4c3-4c8b-9657-0690e3a4afd0_content_list.json b/understandingembodiedreferencewithtouchlinetransformer/3279c5c8-e4c3-4c8b-9657-0690e3a4afd0_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..c4140ff04bb79b64e02877ec999d1495d4d3d7cb --- /dev/null +++ b/understandingembodiedreferencewithtouchlinetransformer/3279c5c8-e4c3-4c8b-9657-0690e3a4afd0_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:631f8da24bd749c6141933ef9ba27a669ff85ee34cfb8c5f75b95e0dbcfe12dc +size 98141 diff --git a/understandingembodiedreferencewithtouchlinetransformer/3279c5c8-e4c3-4c8b-9657-0690e3a4afd0_model.json b/understandingembodiedreferencewithtouchlinetransformer/3279c5c8-e4c3-4c8b-9657-0690e3a4afd0_model.json new file mode 100644 index 0000000000000000000000000000000000000000..7936b9b708d5af5b5af065db4d8a6e923595b307 --- /dev/null +++ b/understandingembodiedreferencewithtouchlinetransformer/3279c5c8-e4c3-4c8b-9657-0690e3a4afd0_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:40ba0a5194e29f3ffd2240dcce41e9e349b4ae767bd70d90db7e135910fb7e7a +size 120166 diff --git a/understandingembodiedreferencewithtouchlinetransformer/3279c5c8-e4c3-4c8b-9657-0690e3a4afd0_origin.pdf b/understandingembodiedreferencewithtouchlinetransformer/3279c5c8-e4c3-4c8b-9657-0690e3a4afd0_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..38b4bf56897f748d93eef83d7f1a9cbdf134ed92 --- /dev/null +++ b/understandingembodiedreferencewithtouchlinetransformer/3279c5c8-e4c3-4c8b-9657-0690e3a4afd0_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0268f10d7ae505d490229c6cbf1eee71e36fed410b7fdb93698b55effa8feae8 +size 51908361 diff --git a/understandingembodiedreferencewithtouchlinetransformer/full.md b/understandingembodiedreferencewithtouchlinetransformer/full.md new file mode 100644 index 0000000000000000000000000000000000000000..501089097c88f6b18c334b36cc477be7a0671d07 --- /dev/null +++ b/understandingembodiedreferencewithtouchlinetransformer/full.md @@ -0,0 +1,477 @@ +# UNDERSTANDING EMBodied REFERENCE WITH TOUCH-LINE TRANSFORMER + +Yang Li $^{1}$ , Xiaoxue Chen $^{1}$ , Hao Zhao $^{1}$ , Jiangtao Gong $^{1}$ , Guyue Zhou $^{1}$ , Federico Rossano $^{2}$ , Yixin Zhu $^{3}$ + +$^{1}$ Institute for AI Industry Research, Tsinghua University +$^{2}$ Department of Cognitive Science, UCSD $^{3}$ Institute for Artificial Intelligence, Peking University +$\boxtimes$ liyang@air.tsinghua.edu.cn, zhaohao@air.tsinghua.com, yixin.zhu@pku.edu.cn + +https://yang-li-2000.github.io/Touch-Line-Transformer + +# ABSTRACT + +We study embodied reference understanding, the task of locating referents using embodied gestural signals and language references. Human studies have revealed that, contrary to popular belief, objects referred to or pointed to do not lie on the elbow-wrist line, but rather on the so-called virtual touch line. Nevertheless, contemporary human pose representations lack the virtual touch line. To tackle this problem, we devise the touch-line Transformer: It takes as input tokenized visual and textual features and simultaneously predicts the referent's bounding box and a touch-line vector. Leveraging this touch-line prior, we further devise a geometric consistency loss that promotes co-linearity between referents and touch lines. Using the touch line as gestural information dramatically improves model performances: Experiments on the YouRefIt dataset demonstrate that our method yields a $+25.0\%$ accuracy improvement under the 0.75 IoU criterion, hence closing $63.6\%$ of the performance difference between models and humans. Furthermore, we computationally validate prior human studies by demonstrating that computational models more accurately locate referents when employing the virtual touch line than when using the elbow-wrist line. + +# 1 INTRODUCTION + +Understanding human intents is essential when intelligent robots interact with humans. Nevertheless, most prior work in the modern learning community disregards the multi-modal facet of human-robot communication. Consider the scenario depicted in Figure 1, wherein a person instructs the robot to interact with a chair behind the table. In response, the robot must comprehend what humans are referring to before taking action (e.g., approaching the object and cleaning it). Notably, both embodied gesture signals and language reference play significant roles. Without the pointing gesture, the robot could not distinguish between the two chairs using the utterance the chair that is occluded. Likewise, without the language expression, the robot could not differentiate the chair from other objects in that vicinity (e.g., bags on the table). To address this deficiency, we investigate the embodied ref + +ereence understanding (ERU) task introduced by Chen et al. (2021). This task requires an algorithm to detect the referent (referred object) using (i) an image/video containing nonverbal communication signals and (ii) a sentence as a verbal communication signal. + +![](images/7d21e867dd9fa827bd5c1ae6dca680f536e563a4fd424eb0752dfa3ec827df86.jpg) +Figure 1: To accurately locate the referent in complex scenes, both nonverbal and verbal expressions are vital. Without nonverbal expression (in this case, the pointing gesture), the verbal expression ("the chair") cannot uniquely refer to the chair because multiple chairs are present in this context. Conversely, one cannot distinguish the intended referent "the chair" from other nearby objects with only nonverbal expressions. + +The first fundamental challenge in tackling ERU is the representation of human pose. The de facto and prevalent pose representation in modern computer vision is defined by COCO (Lin et al., 2014)—a graph consisting of 17 nodes (keypoints) and 14 edges (keypoint connectivities). Existing models for ERU (Chen et al., 2021) assume pre-extracted COCO-style pose features to be the algorithm inputs. However, we rethink the limitations of the COCO-style pose graph in the context of ERU and uncover a counter-intuitive fact: The referent does not lie on the elbow-wrist line (i.e., the line that links the human elbow and wrist). As shown in Figure 2, this line (in red) does not cross the referred microwave, exhibiting a typical misinterpretation of human pointing (Herbort & Kunde, 2018). + +A recent developmental study (O'Madagain et al., 2019) presents compelling evidence supporting the above hypothesis. It studies how humans mentally develop pointing gestures and argues that it is a virtual form of reaching out to touch. This new finding challenges conventional psychological views (McGinn, 1981; Kita, 2003) that the pointing gesture is mentally a behavior of using the limb as an arrow. Inheriting the terminology in O'Madagain et al. (2019), we coin the red line in Figure 2 as an elbow-wrist line (EWL) and the yellow line (which connects the eye and the fingertip) as a virtual touch line (VTL). Inspired by this essential ob + +![](images/d1da4d048bdab181c9d82dd18e6e87657f362473afd8f6a44211ba61b8854d7a.jpg) +Figure 2: Virtual touch line (VTL) (in green) vs. elbow-wrist line (EWL) (in red). VTLs affords a more accurate location of referents than EWLs. + +servation that VTLs are more accurate than EWLs in embodied reference, we augment the existing COCO-style pose graph with an edge that connects the eye and the fingertip. As validated by a series of experiments in Section 4, this augmentation significantly improves the performance on YouRefIt. + +The second fundamental issue in tackling ERU is how to jointly model gestural signals and language references. Inspired by the success of multi-modal Transformers (Chen et al., 2020; Li et al., 2020; Tan & Bansal, 2019; Lu et al., 2019; Kamath et al., 2021) in multi-modal tasks (Hudson & Manning, 2019; Antol et al., 2015; Zellers et al., 2019), we devise the Touch-Line Transformer. Our Transformer-based model takes as inputs both visual and natural-language modalities. Our Touch-Line Transformer jointly models gestural signals and language references by simultaneously predicting the touch-line vector and the referent's bounding box. To further help our model utilize gestural signals (i.e., the touch-line vector), we integrate a geometric consistency loss to encourage co-linearity between the touch line and the predicted referent's location, resulting in significant performance improvements. + +By leveraging the above two insights, our proposed method achieves a $+25.0\%$ accuracy gain under the 0.75 IoU criterion on the YouRefIt dataset compared to state-of-the-art methods. Our approach closes $63.6\%$ of the gap between model performance and human performance. + +This paper makes four contributions by introducing (i) a novel computational pose representation, VTL, (ii) the Touch-Line Transformer that jointly models nonverbal gestural signals and verbal references, (iii) a computational model leveraging the concept of touch line by a novel geometric consistency loss that improves the co-linearity between the touch line and the predicted object, and (iv) a new state-of-the-art performance on ERU, exceeding the 0.75 IoU threshold by $+25.0\%$ . + +# 2 RELATED WORK + +Misinterpretation of pointing gestures Pointing enables observers and pointers to direct visual attention and establish references in communication. Recent research reveals, surprisingly, that observers make systematic errors (Herbort & Kunde, 2016): While pointers produce gestures using VTLs, observers interpret pointing gestures using the "arm-finger" line. O'Madagain et al. (2019) founded the VTL mechanism: Pointing gestures orient toward their targets as if the pointers were to touch them. In neuroscience, gaze effects occur for tasks that require gaze alignment with finger pointing (Bédard et al., 2008). The preceding evidence demonstrates that eye position and gaze direction are crucial for understanding pointing. Critically, Herbort & Kunde (2018) verify that directing human observers to extrapolate the touch-line vector reduces the systematic misinterpretation during human-human communication. Inspired by these discoveries, we incorporate the touch-line vector to enhance the performance of pointing gesture interpretation. + +Detection of gaze targets The gazing gesture itself can refer to particular objects in the absence of language expressions. The detection of the gaze targets is the localization of the objects people gaze at. Recasens et al. (2015) and Chong et al. (2018) introduce two-stage methods that build saliency maps and estimate gaze directions before combining them to predict gaze targets. Tu et al. (2022) devise a one-stage end-to-end approach for simultaneously locating human heads and gaze targets for all individuals in an image. Fang et al. (2021) develop a three-stage method that predicts first the 2D and 3D gaze direction, then the field of views and depth ranges, and finally the gaze target. Zhao et al. (2020) assume that humans find gaze targets from salient objects on the sight line, designing a model to validate this hypothesis in images and videos. Li et al. (2021) extend the detection of gaze target to 360-degree images. Chong et al. (2020) and Recasens et al. (2017) extend the detection of gaze target into videos, wherein the gazed object may not be in the same frame as the gazing gesture. + +Referring expression comprehension Language expressions can also refer to particular objects. Referring expression comprehension is to locate referents in an image using only language expressions. Multiple datasets (e.g., RefCOCO (Yu et al., 2016), RefCOCO+ (Yu et al., 2016), RefCOCO-g (Mao et al., 2016), and Guesswhat (De Vries et al., 2017)) serve as the benchmark. To encode images and sentences, Du et al. (2022) develop a Transformer-based framework and use the language to guide the extraction of discriminative visual features. Rohrbach et al. (2016) recognize the bidirectional nature between language expressions and objects in images, obviating the need for bounding box annotations. Yu et al. (2018) devise a modular network, wherein three modules attend to subjects, their location in images, and their relationships with nearby objects, respectively. While the above efforts locate referents using language expressions, they rarely use human-like nonverbal gestures. + +Language-conditioned imitation learning Robots must identify target objects when completing goal-conditioned tasks (Stepputtis et al., 2020). Counterintuitively, Stepputtis et al. (2020) argue against describing the target object using (one-hot) vectors due to inflexibility to support continued learning in deployed robots. Instead, Stepputtis et al. (2020) employ natural language to refer to target objects in goal-conditioned manipulation tasks. Specifically, leveraging a semantic module for understanding what the referents referred to by language expressions, their architecture helps robots locate and attend to the target object when the natural language expression unambiguously refers to an object. However, this method struggles to resolve ambiguities (e.g., in cases with pointing gestures). Recent work on language-conditioned imitation learning (Stepputtis et al., 2020; Lynch & Sermanet, 2021; Mees et al., 2022) may therefore benefit from our VTL by more accurately locating the target object, especially when the natural language alone is ambiguous. + +# 3 METHOD + +# 3.1 NETWORK ARCHITECTURE + +Our framework, illustrated in Figure 3, consists of a multi-modal encoder, a Transformer decoder, and prediction heads. We describe each component in detail below. + +Multimodal encoder We generate a visual embedding vector by extracting visual features from input images with a pre-trained ResNet (He et al., 2016) backbone, flattening them, and then adding them to a set of position embeddings (Parmar et al., 2018; Bello et al., 2019). Meanwhile, we generate a textural embedding vector from input texts using a pre-trained BERT (Liu et al., 2019). After obtaining visual and textural embedding vectors, we concatenate and feed them into a Transformer encoder to learn multi-modal representations. + +Transformer decoder We feed the above multi-modal representations to our Transformer decoder, which additionally takes as input a set of learnable object queries and gestural key point queries. With multi-modal representations and input queries, our Transformer decoder (pre-trained MDETR (Kamath et al., 2021)) generates object output embeddings and gestural output embeddings. + +Prediction heads Object and gestural output embeddings from the Transformer decoder are the inputs for our prediction heads (MLPs), which predict bounding boxes (for referents) and gestural key points. We keep one object bounding box and one pair of gestural key points with the highest scores as the final prediction. Specifically, we define the score of a bounding box as 1 minus the non-object class column of the softmax of the predicted object logits. For a pair of gestural key points, the score is the is-a-VTL/EWL column of the predicted arm logits' softmax. + +![](images/7792de6e4c7ad3b0788c4b5935e8665f009409874122fe974a67359d70a564fd.jpg) +Figure 3: Overall network architecture. Language and visual inputs are first encoded by the text encoder and visual encoder to obtain language and visual embeddings, respectively. Next, these embeddings are concatenated and fed into the Transformer encoder to learn multimodal representations. The Transformer decoder and prediction heads output the predicted bounding box and VTL/EWL. A geometric consistency loss is integrated to encourage the use of gestural signals. + +# 3.2 EXPLICIT LEARNING OF NONVERBAL GESTURAL SIGNALS + +Measure co-linearity Ideally, a referent should have a high co-linearity with the VTL. We measure this co-linearity using cosine similarity: + +$$ +\cos_ {-} \operatorname {s i m} = \operatorname {C o s i n e S i m i l a r i t y} \left[ \left(x _ {f} - x _ {e}, y _ {f} - y _ {e}\right), \left(x _ {o} - x _ {e}, y _ {o} - y _ {e}\right) \right], \tag {1} +$$ + +where $(x_{f},y_{f}),(x_{e},y_{e})$ , and $(x_o,y_o)$ are the x-y coordinates of the fingertip, the eye, and the center of the referent bounding box, respectively. + +Encourage co-linearity We encourage our model to predict referent bounding boxes that are highly co-linear with VTLs using a referent alignment loss, which is a geometric consistency loss: + +$$ +L _ {\text {a l i g n}} = \operatorname {R e L U} \left(\cos_ {-} \operatorname {s i m} _ {g t} - \cos_ {-} \operatorname {s i m} _ {p r e d}\right). \tag {2} +$$ + +We compute $\cos\_sim_{gt}$ using the ground-truth referent boxes and compute $\cos\_sim_{pred}$ using the predicted referent boxes. Ground-truth VTLs are used for both $\cos\_sim_{gt}$ and $\cos\_sim_{pred}$ . Of note, the design of the offset $\cos\_sim_{gt}$ ensures the predicted object is as co-linear as the ground-truth object to the VTL. In other words, the loss in Equation (2) is minimized to zero when the predicted object box is as co-linear as the ground-truth one to the VTL. + +Modify for EWLs In experiments using EWLs instead of VTLs, we replace the fingertip $(x_{f},y_{f})$ and the eye $(x_{e},y_{e})$ in Equation (1) using the wrist $(x_{w},y_{w})$ and the elbow $(x_{l},y_{l})$ , respectively. + +# 3.3 IMPLICIT LEARNING OF NONVERBAL GESTURAL SIGNALS + +We eliminate the postural signals (by removing humans) from images to investigate whether our model can implicitly learn to utilize nonverbal gestural signals without being explicitly asked to learn. Please refer to Appendix A for details of our procedure. + +# 3.4 ADDITIONAL LOSSES + +We define the total loss during training as + +$$ +\mathcal {L} _ {\text {t o t a l}} = \lambda_ {1} \mathcal {L} _ {\text {b o x}} + \lambda_ {2} \mathcal {L} _ {\text {g e s t u r e}} + \lambda_ {3} \mathcal {L} _ {\text {a l i g n}} + \lambda_ {4} \mathcal {L} _ {\text {t o k e n}} + \lambda_ {5} \mathcal {L} _ {\text {c o n t r a s t i v e}}, \tag {3} +$$ + +where $\lambda_{i}$ s are the weights of various losses, $\mathcal{L}_{\mathrm{box}}$ is the weighted sum of the L1 and GIoU losses for predicted referent bounding boxes, and $\mathcal{L}_{\mathrm{gesture}}$ is the L1 loss for the predicted VTLs or EWLs. The soft token loss $\mathcal{L}_{\mathrm{token}}$ and the contrastive loss $\mathcal{L}_{\mathrm{contrastive}}$ follow those in Kamath et al. (2021); these two losses help our model align visual and textural signals. + +# 4 EXPERIMENTS + +# 4.1 DATASET, EVALUATION METRIC, AND IMPLEMENTATION DETAILS + +We use the YouRefIt dataset (Chen et al., 2021) with 2,950 training instances and 1,245 test instances. YouRefIt has two portions: videos and images; we only use the image portion. The inputs are images without temporal information. Each instance contains an image, a sentence, and the location of the referent. We provide additional annotations of VTLs and EWLs for the YouRefIt dataset. + +For fair comparisons with prior models, we follow Chen et al. (2021) and report precision under three different IoU thresholds: 0.25, 0.50, and 0.75. A prediction is correct under a threshold if its IoU with the ground-truth box is greater than that threshold. Additionally, we choose our best models by the precision under the GIoU (Rezatofighi et al., 2019) threshold of 0.75. Compared with IoU, GIoU is an improved indicator of the model's ability to locate objects accurately. We report the results using GIoU thresholds in Section 4.5. + +During training, we use the Adam variant, AMSGrad (Reddi et al., 2018), and train our models for 200 epochs. We use the AMSGrad variant because we observe a slow convergence of the standard Adam optimizer in experiments. We set the learning rate to 5e-5 except for the text encoder, whose learning rate is 1e-4. We do not perform learning rate drops because we rarely observe demonstrable performance improvements after dropping them. We use NVIDIA A100 GPUs. The sum of the batch sizes on all graphic cards is 56. Augmentations follow those in Kamath et al. (2021). The total number of queries is 20; 15 for objects, and 5 for gestural key points. + +# 4.2 COMPARISON WITH STATE-OF-THE-ART METHODS + +Our approach outperforms prior state-of-the-art methods by $16.4\%$ , $23.0\%$ , and $25.0\%$ under the IoU threshold of 0.25, 0.50, and 0.75, respectively; see Table 1. Specifically, our model performs better than visual grounding methods (Yang et al., 2019; 2020), which do not explicitly utilize nonverbal gestural signals. Our approach also performs better than the method proposed in YouRefIt (Chen et al., 2021), which did not leverage the touch line or the Transformer models for multi-modal tasks. + +Table 1: Comparison with the state-of-the-art methods. + +
IoU=.25IoU=.50IoU=.75
FAOA (Yang et al., 2019)44.530.48.5
ReSC (Yang et al., 2020)49.234.910.5
YouRefIT PAF-only (Chen et al., 2021)52.637.612.7
YouRefIt Full (Chen et al., 2021)54.740.514.0
Ours (Inpainting)59.1 (+4.4)51.3 (+10.8)32.4 (+18.4)
Ours (No explicit gestural key points)64.9 (+10.2)57.4 (+16.9)37.2 (+23.2)
Ours (EWL)69.5 (+14.8)60.7 (+20.2)35.5 (+21.5)
Ours (VTL)71.1 (+16.4)63.5 (+23.0)39.0 (+25.0)
Human94.285.853.3
+ +# 4.3 EXPLICITLY LEARNED NONVERBAL SIGNALS + +We report performances of models that explicitly predict either the VTLs or the EWLs. + +Results Overall, the model trained to predict the VTLs performs better than the one trained to predict the EWLs under all three IoU thresholds; see details in Table 2. The model trained to explicitly predict the EWLs performs even worse than the one not trained + +Table 2: Effects of learning two different types of postural key points. + +
IoUNoneEWLVTL
0.2564.969.5 (+4.6)71.1 (+6.2)
0.5057.460.7 (+3.3)63.5 (+6.1)
0.7537.235.5 (-1.7)39.0 (+1.8)
+ +to explicitly predict any gestural signals under the IoU threshold of 0.75. + +Analysis Under the IoU threshold of 0.75, the unreliability of the arm's orientation and the stringent precision requirement can partly explain the worse performance of the model with explicit EWL predictions. As we observed in Figure 4, the EWLs are unreliable for predicting objects' locations simply because they frequently do not pass through the referents. This mismatch prevents the model + +![](images/331e169635658d6df4abea1ec330d4505f547c3e88ffe2ffc30921ef46f0f69c.jpg) +Figure 4: The model explicitly trained to predict VTLs more accurately locates referents than the one trained to predict EWLs. We draw green arrows (different from the predictions) to illustrate eyes and fingertips more accurately indicate object locations. (Green sentence: natural language inputs; Green box: ground-truth referent location; Red box: predicted referent location; Red numbers near predicted box: GIoU between the predicted box and the ground-truth box.) + +from correctly determining the referents' locations using the EWLs' orientations. For instance, in Figure 4a (right), the EWL fails to pass the glass cup in the yellow box; it passes a ceramic cup instead. The model struggles to identify the referent correctly with contradictory nonverbal (the ceramic cup) and verbal (the glass cup) signals. + +In contrast, VTLs partly explains the model's improved performance. For example, in Figure 4b, the VTL passes the comb in the green box while the EWL fails. Similarly, in other subfigures in Figure 4, VTLs passes the referent while EWLs do not, or VTLs are closer to the referents' box centers than EWL are. The higher consistency between verbal and nonverbal signals increases the chance of successfully identifying the referents. + +Under the lower IoU thresholds of 0.25 and 0.50, the rough orientations provided by the EWLs and the more lenient precision requirements can partly explain the improved model performances. Specifically, the rough orientations provided by the EWLs might help the model eliminate objects that significantly deviate from this direction. Hence, the model can choose from fewer objects, leading to a higher probability of correctly locating referents. + +# 4.4 IMPLICITLY LEARNED NONVERBAL SIGNALS + +We investigate whether our model can implicitly learn nonverbal gestural signals without being explicitly asked to predict the VTLs or the EWLs. + +To investigate this hypothesis, we conducted two sets of experiments: original images and inpainted images (human removed). In either case, we do not provide our annotated gestural key points (eyes, fingertips, elbows, and wrists) to our model or ask our model to predict any of these gestural key points. + +The set of experiments using original images without providing or predicting gestural key points corresponds to the "Original" column in Table 3, the "No explicit gestural key points" column in Table 1, the "No exp. ges. k. poi." column in Table 7, and the "None" column in Table 2. + +Our model performs much worse when nonverbal gestural signals are absent. Specifically, removing humans from input images results in $5.8\%$ , $6.1\%$ , and $4.8\%$ performance drop under the IoU threshold of 0.25, 0.50, and 0.75, respectively; see details in Table 3. + +Table 3: Effects of implicitly learned nonverbal signals. + +
IoUOriginalInpainting
0.2564.959.1 (-5.8)
0.5057.451.3 (-6.1)
0.7537.232.4 (-4.8)
+ +![](images/58225c97351c491d51d6861173b292242a583f7fa08e8e19ef897ef663353b9e.jpg) +Figure 5: Training with inpainted images leads to a performance drop. Removing human contexts increase the difficulties in determining which object is referred to by the natural language expression (a, b, c, i) or even makes it impossible (d, e, f, g, h, j). We call it impossible to determine the referent using natural language input when multiple objects in the image satisfy the descriptions in the natural language input sentence. (Green sentence: natural language input; Green box: ground-truth referent location; Red box: predicted referent location; Red numbers near boxes: GIoU between the predicted box and ground-truth box.) + +These performance drops indicate that the model lacks some helpful information when only inpainted images are given. Specifically, removing humans in the scenes eliminates useful communicative signals, including pointing, poses, and the gaze direction (Sebanz et al., 2006). The lack of human context introduces additional ambiguities in identifying the referents, especially when the natural language input alone cannot uniquely refer to an object in the scene. + +For example, in Figure 5f, given the natural language input "the books in front of me," determining which piles of books this person refers to is difficult: one on the table and one in the scene's lower right corner, thus in need of nonverbal gestural signals, such as pointing. Similarly, in Figure 5e, we cannot distinguish which picture frame the person refers to without considering the pointing gesture. + +![](images/c1c4b99b9745b5d30e631c55c0de56f8c17dabad3a76c9516f26e3c7f7c8d369.jpg) +Figure 6: Attention weights visualizations. Attention visualization of models trained to learn VTLs explicitly. (Blue: attention from object tokens; Yellow: attention from gestural key point tokens; Green sentence: natural language input; Green box: ground-truth referent location; Red box: predicted referent location; Red numbers near boxes: GIoU between the predicted box and ground-truth box.) + +![](images/44b207723299f46cf37d3941dfc2207964b35e499c8a8d3462ed63dd526db9e3.jpg) +(a) +(b) +(c) +(d) + +![](images/adfca31aca95f4d8f7c625cdab21ae02e32231e47e179791d150277f37cdc1c7.jpg) +Figure 7: Examples of failure cases. Green sentence: natural language input; Green box: ground-truth referent location; Red box: predicted referent location; Red numbers near boxes: GIoU between the predicted box and ground-truth box. +(a) +(b) +(c) +Figure 8: Rare cases where the human heads are invisible. + +# 4.5 ADDITIONAL RESULTS + +Attention weights visualizations We visualize the attention weights of our model trained with VTL (Figure 6). We use yellow to visualize the attention weights of matched gesture keypoint queries and blue for matched object queries. Visualizations show that the attention of object queries can attend to the regions of target objects, whereas the attention of keypoint queries primarily focuses on humans' heads and hands. These results indicate that our model successfully learns gestural features that boost performance. + +Failure cases While the VTL effectively helps the model leverage the nonverbal gestural signals, the performance of our model still could not surpass $74\%$ human performance. The gap between the model and human performance can be partly attributed to the model's inability to distinguish the subtle differences among similar objects. In other words, while explicitly predicting the VTLs helps our model utilize gestural signals to determine the object's direction, it does not help the model recognize the minor differences among multiple objects in the same direction. + +For example, the VTL passes two bottles in Figure 7a. While the VTL indeed helps narrow down the options to these two bottles, it does not help our model recognize which one is the body lotion. Similarly, in Figure 7b, the VTL indicates two bottles—one with a red lid and the other with a yellow lid. However, it does not help the model distinguish the subtle differences between lid colors. + +Additionally, in very rare cases (Figure 8), failure to detect the human head in the image prevents the application of our VTL. + +Computed cosine similarities The computed cosine similarity is much higher when using the VTLs (Table 4), indicating the VTLs are more co-linear to the referents. This result verifies our hypothesis that the VTLs are more reliable in referring to the objects' locations. + +Referent alignment loss An ablation study (Table 5) shows that our reference alignment loss plays a significant role in leveraging nonverbal gestural signals. + +Table 4: Computed cosine similarities. (tgt: computed using groundtruth box centers; pred: computed using predicted box centers.) + +
gesturecos sim tgtcos sim pred
EWL0.95800.9579
VTL0.99010.9878
+ +Table 5: Effects of the referent alignment loss $\mathcal{L}_{\mathrm{align}}$ . Removing the reference alignment loss leads to performance drops in locating referents. + +
gestureref. align. lossIoU=.25IoU=.50IoU=.75cos sim pred
VTLTrue71.163.539.00.9878
VTLFalse67.159.036.40.9815
(-4.0)(-4.5)(-2.6)(-0.0063)
+ +Effects of object sizes We evaluate the model performance w.r.t. the object detection of different object sizes (Table 6). We define small (S), medium (M), and large (L) objects following the size thresholds in Chen et al. (2021). Compared to the relatively consistent human performance, deep learning models' performances are significantly lower when detecting diminutive objects than when detecting more prominent objects, especially under the less stringent IoU thresholds of 0.25 and 0.50. The degraded performance indicates that future artificial intelligence models need to improve the performance of small object detection. + +Table 6: Model performances w.r.t. the detection of different object sizes. Numbers in red and blue denote the highest and the second highest performance, respectively. + +
IoUs0.250.500.75
Object SizesAllSMLAllSMLAllSML
FAOA (Yang et al., 2019)44.530.648.654.130.415.836.239.38.51.49.614.4
ReSC (Yang et al., 2020)49.232.354.760.134.914.142.547.710.50.210.620.1
Yourelf PAF (Chen et al., 2021)52.635.960.561.437.614.649.149.112.71.016.520.5
YouRefIt Full (Chen et al., 2021)54.738.564.161.640.516.354.451.114.01.217.223.3
Ours (Inpainting)59.041.359.375.851.332.154.666.732.49.433.353.4
Ours (No explicit gestural key points)64.949.667.976.757.440.862.169.037.214.439.756.7
Ours (EWL)69.556.671.780.060.744.466.271.235.511.838.955.0
Ours (VTL)71.155.975.581.763.547.070.273.139.013.445.257.8
Human (Chen et al., 2021)94.293.792.396.385.881.086.789.453.333.955.968.1
+ +Precision computed using GIoU thresholds We provide the performance of our models when evaluated using GIoU instead of IoU thresholds; see Table 7. + +Table 7: Model performances when evaluated using GIoU thresholds. + +
IoU=.25IoU=.50IoU=.75
Ours (Inpainting)57.950.931.4
Ours (No exp. ges. k. poi.)63.756.536.2
Ours (EWL)67.959.734.8
Ours (VTL)70.062.538.2
+ +Language inputs with more ambiguities We investigate the performance of our model when using language inputs with more ambiguities by changing each input sentence to the word "object." Our results (Table 8) show that language inputs with more ambiguities impair the performance of our models severely. + +Table 8: Model performances when using language inputs with more ambiguities. + +
More ambiguousRe-trainingIoU=.25IoU=.50IoU=.75
Ours (No Exp. Ges. K. Poi.)TrueFalse19.516.07.8
Ours (VTL)TrueFalse31.425.313.1
Ours (No Exp. Ges. K. Poi.)TrueTrue49.242.123.4
Ours (VTL)TrueTrue49.441.723.9
Ours (No Exp. Ges. K. Poi.)FalseFalse64.957.437.2
Ours (VTL)FalseFalse71.163.539.0
+ +# 5 CONCLUSION AND LIMITATIONS + +We presented an effective approach, Touch-Line Transformer, to utilize the simple but effective VTLs to improve an artificial agent's ability to locate referents referred to by humans in the wild. Our approach is inspired by recent findings in human studies on the touch-line hypothesis, which further revealed that people frequently misinterpret other people's referring expressions. Our proposed architecture, combined with the proposed VTL, significantly reduced the gap between model performance and human performance. + +Some limitations exist in our work. First, resizing operations before and after inpainting might influence model performance. Next, we primarily study the eyes' location and the upper limbs' orientation regarding nonverbal signals, leaving the study of other types of nonverbal signals to future works, such as gazing direction, the direction of the finger, and the orientation of the lower limbs. + +# ACKNOWLEDGMENTS + +The authors would like to thank Miss Chen Zhen (BIGAI) for making the nice figures and three anonymous reviews for constructive feedback. This work is supported in part by the National Key R&D Program of China (2022ZD0114900), the Beijing Nova Program, and Beijing Didi Chuxing Technology Co., Ltd. + +# REFERENCES + +Stanislaw Antol, Aishwarya Agrawal, Jiasen Lu, Margaret Mitchell, Dhruv Batra, C Lawrence Zitnick, and Devi Parikh. Vqa: Visual question answering. In International Conference on Computer Vision (ICCV), 2015. +Patrick Bédard, Arul Thangavel, and Jerome N Sanes. Gaze influences finger movement-related and visual-related activation across the human brain. Experimental Brain Research, 188(1):63-75, 2008. +Irwan Bello, Barret Zoph, Ashish Vaswani, Jonathon Shlens, and Quoc V Le. Attention augmented convolutional networks. In International Conference on Computer Vision (ICCV), 2019. +Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In European Conference on Computer Vision (ECCV), 2020. +Yen-Chun Chen, Linjie Li, Licheng Yu, Ahmed El Kholy, Faisal Ahmed, Zhe Gan, Yu Cheng, and Jingjing Liu. Uniter: Universal image-text representation learning. In European Conference on Computer Vision (ECCV), 2020. +Yixin Chen, Qing Li, Deqian Kong, Yik Lun Kei, Song-Chun Zhu, Tao Gao, Yixin Zhu, and Siyuan Huang. Yourefit: Embodied reference understanding with language and gesture. In International Conference on Computer Vision (ICCV), 2021. +Eunji Chong, Nataniel Ruiz, Yongxin Wang, Yun Zhang, Agata Rozga, and James M Rehg. Connecting gaze, scene, and attention: Generalized attention estimation via joint modeling of gaze and scene saliency. In European Conference on Computer Vision (ECCV), 2018. +Eunji Chong, Yongxin Wang, Nataniel Ruiz, and James M Rehg. Detecting attended visual targets in video. In Conference on Computer Vision and Pattern Recognition (CVPR), 2020. +Harm De Vries, Florian Strub, Sarath Chandar, Olivier Pietquin, Hugo Larochelle, and Aaron Courville. Guesswhat?! visual object discovery through multi-modal dialogue. In Conference on Computer Vision and Pattern Recognition (CVPR), 2017. +Ye Du, Zehua Fu, Qingjie Liu, and Yunhong Wang. Visual grounding with transformers. In International Conference on Multimedia and Expo (ICME), 2022. +Yi Fang, Jiapeng Tang, Wang Shen, Wei Shen, Xiao Gu, Li Song, and Guangtao Zhai. Dual attention guided gaze target detection in the wild. In Conference on Computer Vision and Pattern Recognition (CVPR), 2021. +Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Conference on Computer Vision and Pattern Recognition (CVPR), 2016. +Oliver Herbort and Wilfried Kunde. Spatial (mis-)interpretation of pointing gestures to distal referents. Journal of Experimental Psychology: Human Perception and Performance, 42(1):78, 2016. +Oliver Herbort and Wilfried Kunde. How to point and to interpret pointing gestures? instructions can reduce pointer-observer misunderstandings. Psychological Research, 82(2):395-406, 2018. +Drew A Hudson and Christopher D Manning. Gqa: A new dataset for real-world visual reasoning and compositional question answering. In Conference on Computer Vision and Pattern Recognition (CVPR), 2019. + +Aishwarya Kamath, Mannat Singh, Yann LeCun, Gabriel Synnaeve, Ishan Misra, and Nicolas Carion. Mdetr-modulated detection for end-to-end multi-modal understanding. In International Conference on Computer Vision (ICCV), 2021. +Sotaro Kita. Pointing: Where language, culture, and cognition meet. Psychology Press, 2003. +Harold W Kuhn. The hungarian method for the assignment problem. Naval research logistics quarterly, 2(1-2):83-97, 1955. +Gen Li, Nan Duan, Yuejian Fang, Ming Gong, and Daxin Jiang. Unicoder-vl: A universal encoder for vision and language by cross-modal pre-training. In AAAI Conference on Artificial Intelligence (AAAI), 2020. +Wenbo Li, Zhe Lin, Kun Zhou, Lu Qi, Yi Wang, and Jiaya Jia. Mat: Mask-aware transformer for large hole image inpainting. In Conference on Computer Vision and Pattern Recognition (CVPR), 2022. +Yunhao Li, Wei Shen, Zhongpai Gao, Yucheng Zhu, Guangtao Zhai, and Guodong Guo. Looking here or there? gaze following in 360-degree images. In Conference on Computer Vision and Pattern Recognition (CVPR), 2021. +Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dólar, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In European Conference on Computer Vision (ECCV), 2014. +Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692, 2019. +Jiasen Lu, Dhruv Batra, Devi Parikh, and Stefan Lee. Vilbert: Pretraining task-agnostic visiolinguistic representations for vision-and-language tasks. In Advances in Neural Information Processing Systems (NeurIPS), 2019. +Corey Lynch and Pierre Sermanet. Language conditioned imitation learning over unstructured data. In Robotics: Science and Systems (RSS), 2021. +Junhua Mao, Jonathan Huang, Alexander Toshev, Oana Camburu, Alan L Yuille, and Kevin Murphy. Generation and comprehension of unambiguous object descriptions. In Conference on Computer Vision and Pattern Recognition (CVPR), 2016. +Francisco Massa and Ross Girshick. maskrcnn-benchmark: Fast, modular reference implementation of instance segmentation and object detection algorithms in pytorch, 2018. +Colin McGinn. The mechanism of reference. Synthese, pp. 157-186, 1981. +Oier Mees, Lukas Hermann, and Wolfram Burgard. What matters in language conditioned robotic imitation learning over unstructured data. IEEE Robotics and Automation Letters (RA-L), 2022. +Cathal O'Madagain, Gregor Kachel, and Brent Strickland. The origin of pointing: Evidence for the touch hypothesis. Science Advances, 5(7):eaav2558, 2019. +Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, Lukasz Kaiser, Noam Shazeer, Alexander Ku, and Dustin Tran. Image transformer. In International Conference on Machine Learning (ICML), 2018. +Adria Recasens, Aditya Khosla, Carl Vondrick, and Antonio Torralba. Where are they looking? In Advances in Neural Information Processing Systems (NeurIPS), 2015. +Adria Recasens, Carl Vondrick, Aditya Khosla, and Antonio Torralba. Following gaze in video. In International Conference on Computer Vision (ICCV), 2017. +Sashank J Reddi, Satyen Kale, and Sanjiv Kumar. On the convergence of adam and beyond. In International Conference on Learning Representations (ICLR), 2018. + +Hamid Rezatofighi, Nathan Tsoi, JunYoung Gwak, Amir Sadeghian, Ian Reid, and Silvio Savarese. Generalized intersection over union: A metric and a loss for bounding box regression. In Conference on Computer Vision and Pattern Recognition (CVPR), 2019. +Anna Rohrbach, Marcus Rohrbach, Ronghang Hu, Trevor Darrell, and Bernt Schiele. Grounding of textual phrases in images by reconstruction. In European Conference on Computer Vision (ECCV), 2016. +Natalie Sebanz, Harold Bekkering, and Gunther Knoblich. Joint action: bodies and minds moving together. Trends in Cognitive Sciences, 10(2):70-76, 2006. +Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. In Annual Meeting of the Association for Computational Linguistics (ACL), 2016. +Simon Stepputtis, Joseph Campbell, Mariano Phielipp, Stefan Lee, Chitta Baral, and Henri Ben Amor. Language-conditioned imitation learning for robot manipulation tasks. In Advances in Neural Information Processing Systems (NeurIPS), 2020. +Hao Tan and Mohit Bansal. Lxmert: Learning cross-modality encoder representations from transformers. In Annual Conference on Empirical Methods in Natural Language Processing (EMNLP), 2019. +Danyang Tu, Xiongkuo Min, Huiyu Duan, Guodong Guo, Guangtao Zhai, and Wei Shen. End-to-end human-gaze-target detection with transformers. In Conference on Computer Vision and Pattern Recognition (CVPR), 2022. +Zhengyuan Yang, Boqing Gong, Liwei Wang, Wenbing Huang, Dong Yu, and Jiebo Luo. A fast and accurate one-stage approach to visual grounding. In International Conference on Computer Vision (ICCV), 2019. +Zhengyuan Yang, Tianlang Chen, Liwei Wang, and Jiebo Luo. Improving one-stage visual grounding by recursive sub-query construction. In European Conference on Computer Vision (ECCV), 2020. +Licheng Yu, Patrick Poirson, Shan Yang, Alexander C Berg, and Tamara L Berg. Modeling context in referring expressions. In European Conference on Computer Vision (ECCV), 2016. +Licheng Yu, Zhe Lin, Xiaohui Shen, Jimei Yang, Xin Lu, Mohit Bansal, and Tamara L Berg. Mattnet: Modular attention network for referring expression comprehension. In Conference on Computer Vision and Pattern Recognition (CVPR), 2018. +Rowan Zellers, Yonatan Bisk, Ali Farhadi, and Yejin Choi. From recognition to cognition: Visual commonsense reasoning. In Conference on Computer Vision and Pattern Recognition (CVPR), 2019. +Hao Zhao, Ming Lu, Anbang Yao, Yurong Chen, and Li Zhang. Learning to draw sight lines. International Journal of Computer Vision (IJCV), 128(5):1076-1100, 2020. + +# A INPAINTING + +We hypothesize that our model may learn to use postural signals without being explicitly asked to. To test our hypothesis, we remove postural signals (by removing humans) from the images mainly using the Mask R-CNN (Massa & Girshick, 2018) and MAT (Li et al., 2022). We investigate whether our model performs worse when trained using images without gestural signals. + +We hypothesize that Transformer models may learn to use postural signals without being explicitly asked to learn these types of signals. To test our hypothesis, we conduct two groups of experiments: the inpainting group and the control group. In the inpainting group, we remove postural signals in the input image. In the control group, we do not modify the input image. + +In the inpainting group, we modify input images. Specifically, we remove postural signals from input images by removing humans and filling in missing portions of the image (initially occupied by humans) using MAT (Li et al., 2022). Specifically, we first use Mask R-CNN X-101 (Massa & Girshick, 2018) to produce human masks. After that, we expand the human masks created by the mask rcnn to both the left and right sides to cover the edge of humans entirely. We ensure that the expanded mask never encroaches on regions occupied by the ground truth bounding box for the referent. After that, we feed the expanded masks into MAT. With input masks, MAT removes the regions covered by the masks and fills these regions. Examples of masks, expanded masks, and inpaintings are in Figure A1. + +![](images/0795ec288825362ecfeb20c21101f8200d41bc7d393b97b73c561505e2071ae7.jpg) +Figure A1: Illustration of the inpainting process. We remove gestural signals from input images before feeding images into our model to study the effects of implicitly learned postural signals. + +![](images/311aebc9f978629782755bb5818d79ff3839fda668cf58b957590f8fde385a1b.jpg) + +![](images/bbb493dc24cb5b0c420469693c301f6dbb034068a8bff53bc315077cc4f437d6.jpg) + +We remove gestural signals (through inpainting) from images when studying our model's ability to learn these signals implicitly. Before generating inpaintings, we expand the human mask to both sides by 50 pixels. We reshape masks and images to $512 \times 512$ before feeding them into the MAT model because the checkpoint produced by MAT only works for inputs of size $512 \times 512$ . Outputs of the MAT model are reshaped to their original sizes before feeding into our model. We observe that, for a tiny number of images, human masks cannot be generated by F-RCNNs. In these sporadic cases, we use the original image instead. + +# B ADDITIONAL LOSSES + +# B.1 LOSSES FOR PREDICTED REFERENT BOUNDING BOXES + +We use a weighted sum of L1 and GIoU losses for predicted bounding boxes. Each bounding box $B = (x, y, w, h)$ is represented using the x and y coordinate of the box center (x and y), width (w), and height (h). We denote the predicted box as $B_{p}$ and its ground truth as $B_{t}$ . + +L1 Loss For each pair of predicted box $B_{p_i}$ and ground truth box $B_{t_i}$ , the L1 loss is: + +$$ +L _ {L 1 _ {i}} = \left| B _ {p _ {i}} - B _ {t _ {i}} \right| = \left| x _ {p _ {i}} - x _ {t _ {i}} \right| + \left| y _ {p _ {i}} - y _ {t _ {i}} \right| + \left| w _ {p _ {i}} - w _ {t _ {i}} \right| + \left| h _ {p _ {i}} - h _ {t _ {i}} \right|. \tag {A1} +$$ + +Each time, there are $n$ pairs of predicted and ground truth boxes. The total L1 loss for all pairs is: + +$$ +L _ {L 1} = \frac {1}{n} \sum_ {i = 1} ^ {n} L _ {L 1 _ {i}}. \tag {A2} +$$ + +GIoU loss Before computing the GIoU Loss (Rezatofighi et al., 2019), each box $B = (x, y, w, h)$ is transformed to $\bar{B} = (x_{min}, y_{min}, x_{max}, y_{max})$ , where $x_{min} = x - \frac{w}{2}$ , $x_{max} = x + \frac{w}{2}$ , $y_{min} = y - \frac{h}{2}$ , $y_{max} = y + \frac{h}{2}$ . + +The area of predicted box $\bar{B}_p$ and ground truth box $\bar{B}_t$ are computed as: + +$$ +A r e a _ {p _ {i}} = \left(x _ {p } - x _ {p }\right) \times \left(y _ {p } - x _ {y }\right) \tag {A3} +$$ + +$$ +A r e a _ {t _ {i}} = \left(x _ {t _ {m a x _ {i}}} - x _ {t _ {m i n _ {i}}}\right) \times \left(y _ {t _ {m a x _ {i}}} - x _ {t _ {m i n _ {i}}}\right). +$$ + +The IoU and Union of $\bar{B}_p$ and $\bar{B}_t$ are computed as: + +$$ +x _ {l e f t _ {i}} = \max (x _ {p _ {m i n _ {i}}}, x _ {t _ {m i n _ {i}}}) +$$ + +$$ +y _ {t o p _ {i}} = \max \left(y _ {p _ {\min _ {i}}}, y _ {t _ {\min _ {i}}}\right) +$$ + +$$ +x _ {r i g h t _ {i}} = \min \left(x _ {p _ {m a x _ {i}}}, x _ {t _ {m a x _ {i}}}\right) +$$ + +$$ +y _ {\text {b o t t o m} i} = \min \left(y _ {p _ {\max} i}, y _ {t _ {\max} i}\right) \tag {A4} +$$ + +$$ +I n t e r s e c t i o _ {i} = \left(x _ {r i g h t _ {i}} - x _ {l e f t _ {i}}\right) \times \left(y _ {b o t t o m _ {i}} - y _ {t o p _ {i}}\right) +$$ + +$$ +U n i o n _ {i} = A r e a _ {p _ {i}} + A r e a _ {t _ {i}} - I n t e r s e c t i o n _ {i} +$$ + +$$ +I o U _ {i} = \frac {\text {I n t e r s e c t i o n} _ {i}}{\text {U n i o n} _ {i}}. +$$ + +For each pair of $\bar{B}_{p_i}$ and $\bar{B}_{t_i}$ , the GIoU is: + +$$ +x _ {l e f t _ {i}} ^ {\prime} = \min \left(x _ {p _ {m i n _ {i}}}, x _ {t _ {m i n _ {i}}}\right) +$$ + +$$ +y _ {t o p _ {i}} ^ {\prime} = \min (y _ {p _ {m i n _ {i}}}, y _ {t _ {m i n _ {i}}}) +$$ + +$$ +x _ {r i g h t _ {i}} ^ {\prime} = \max \left(x _ {p _ {m a x _ {i}}}, x _ {t _ {m a x _ {i}}}\right) +$$ + +$$ +y _ {\text {b o t t o m} i} ^ {\prime} = \max \left(y _ {p _ {\text {m a x}} i}, y _ {t _ {\text {m a x}} i}\right) \tag {A5} +$$ + +$$ +A r e a _ {i} ^ {\prime} = \left(x _ {r i g h t _ {i}} ^ {\prime} - x _ {l e f t _ {i}} ^ {\prime}\right) \times \left(y _ {b o t t o m _ {i}} ^ {\prime} - y _ {t o p _ {i}} ^ {\prime}\right) +$$ + +$$ +G I o U _ {i} = I o U _ {i} - \frac {A r e a _ {i} ^ {\prime} - U n i o n _ {i}}{A r e a _ {i} ^ {\prime}}. +$$ + +The GIoU loss for one pair of the predicted box and target box is: + +$$ +L _ {G I o U _ {i}} = 1 - G I o U _ {i}. \tag {A6} +$$ + +The GIoU loss for all pairs of predicted and target boxes is: + +$$ +L _ {G I o U} = \frac {1}{n} \sum_ {i = 1} ^ {n} L _ {G I o U _ {i}}. \tag {A7} +$$ + +# B.2 LOSSES FOR GESTURAL KEY POINTS + +For the predicted eyes and fingertips or elbows and wrists, we use L1 loss. Specifically, each time, our model predicts m pairs of gestural key points. Each pair is denoted as $pair_{pi} = (x_{eye_{pi}}, y_{eye_{pi}}, x_{fgt_{pi}}, y_{fgt_{pi}})$ (for VTL) or $pair_{pi} = (x_{elb_{pi}}, y_{elb_{pi}}, x_{wst_{pi}}, y_{wst_{pi}})$ (for EWL). The ground truth gestural key points are represented as $pair_{t_i} = (x_{eyet_i}, y_{eyet_i}, x_{fgt_{t_i}}, y_{fgt_{t_i}})$ (for VTL) or $pair_{t_i} = (x_{elb_{t_i}}, y_{elb_{t_i}}, x_{wst_{t_i}}, y_{wst_{t_i}})$ (for EWL). + +The loss for each predicted gestural pair is defined as: + +$$ +L _ {\text {g e s t u r e} - L 1 _ {i}} = \left| x _ {e y e _ {p _ {i}}} - x _ {e y e _ {t _ {i}}} \right| + \left| y _ {e y e _ {p _ {i}}} - y _ {e y e _ {t _ {i}}} \right| + \left| x _ {f g t _ {p _ {i}}} - x _ {f g t _ {t _ {i}}} \right| + \left| y _ {f g t _ {p _ {i}}} - y _ {f g t _ {t _ {i}}} \right| \tag {A8} +$$ + +for VTL, or + +$$ +L _ {\text {g e s t u r e} - L 1 _ {i}} = \left| x _ {e l b _ {p _ {i}}} - x _ {e l b _ {t _ {i}}} \right| + \left| y _ {e l b _ {p _ {i}}} - y _ {e l b _ {t _ {i}}} \right| + \left| x _ {w s t _ {p _ {i}}} - x _ {w s t _ {t _ {i}}} \right| + \left| y _ {w s t _ {p _ {i}}} - y _ {w s t _ {t _ {i}}} \right| \tag {A9} +$$ + +for EWL. + +The L1 gestural key point loss is: + +$$ +L _ {\text {g e s t u r e} - L 1} = \min L _ {\text {g e s t u r e} i}, i \in \{1, \dots , m \}. \tag {A10} +$$ + +Additionally, we apply a cross entropy loss $L_{\text{gesture\_CE}}$ for predicted gestural key points with two classes: "are gestural key points" and "are not gestural key points." + +The total loss for gestural key points is: + +$$ +L _ {\text {g e s t u r e}} = \alpha_ {\text {g e s t u r e} - L 1} \cdot L _ {\text {g e s t u r e} - L 1} + \alpha_ {\text {g e s t u r e} - C E} \cdot L _ {\text {g e s t u r e} - C E}, \tag {A11} +$$ + +where $\alpha_{\text{gesture\_L1}} = 6$ and $L_{\text{gesture\_CE}} = 1.5$ . + +# B.3 SOFTTOKENLOSS + +For each object, we predict token spans produced by the BPE scheme (Sennrich et al., 2016), instead of object categories, and set the maximum number of tokens to 256 following Kamath et al. (2021). Following Kamath et al. (2021), we use a soft token loss $L_{token}$ for the predicted token spans. The soft token loss is a cross-entropy loss. Specifically, an object may correspond to k token locations $(1 \leqslant k \leqslant 256)$ , and the ground-truth probability for each of the k token locations is $\frac{1}{k}$ . + +# B.4 MATCHING STRATEGY + +We match prediction and ground truth using the Hungarian algorithm (Kuhn, 1955; Carion et al., 2020) by minimizing the cost $C$ : + +$$ +C = \alpha_ {L 1} \cdot L _ {L 1} + \alpha_ {G I o U} \cdot L _ {G I o U} + \alpha_ {\text {t o k e n}} \cdot L _ {\text {t o k e n}}, \tag {A12} +$$ + +where $\alpha_{L1} = 5$ , $\alpha_{GIoU} = 2$ , and $\alpha_{token} = 1$ . + +# B.5 CONTRASTIVE ALIGNMENT LOSS + +The contrastive alignment loss encourages alignment between the object feature from the Transformer decoder and the text feature from the Transformer encoder. + +The number of predicted objects is $n$ , and the number of text tokens is $l$ . Let $F_{o_i}$ and $F_{t_j}$ denote the feature of the $i$ th object and the feature of the $j$ th token, respectively. At the same time, let $T_i^+$ denote the set of tokens to be aligned to by the $i$ th object, and let $O_i^+$ denote the set of objects to be aligned to the $i$ th token. Meanwhile, $\tau = 0.07$ is the temperature. + +For all objects, the contrastive alignment loss is: + +$$ +L _ {\text {c o n t r a s t i v e} _ {o}} = \sum_ {i = 1} ^ {n} \frac {1}{\left| T _ {i} ^ {+} \right|} \sum_ {j \in T _ {i} ^ {+}} - \log \frac {\exp \left(F _ {o _ {i}} ^ {T} F _ {t _ {j}} / \tau\right)}{\sum_ {k = 1} ^ {l} \exp \left(F _ {o _ {i}} ^ {T} F _ {t _ {k}} / \tau\right)}, \tag {A13} +$$ + +For all text tokens, the contrastive alignment loss is: + +$$ +L _ {\text {c o n t r a s t i v e} _ {t}} = \sum_ {i = 1} ^ {l} \frac {1}{\left| O _ {i} ^ {+} \right|} \sum_ {j \in O _ {i} ^ {+}} - \log \frac {\exp \left(F _ {t _ {i}} ^ {T} F _ {o _ {j}} / \tau\right)}{\sum_ {k = 1} ^ {n} \exp \left(F _ {t _ {i}} ^ {T} F _ {o _ {k}} / \tau\right)}. \tag {A14} +$$ + +The final contrastive alignment loss is the average of $L_{\text{contrastive}_o}$ and $L_{\text{contrastive}_t}$ : + +$$ +L _ {\text {c o n t r a s t i v e}} = \frac {L _ {\text {c o n t r a s t i v e} _ {o}} + L _ {\text {c o n t r a s t i v e} _ {t}}}{2}. \tag {A15} +$$ + +# C COMPUTING COSINE SIMILARITIES USING DIFFERENT LINES + +The cosine similarity in Equation (1) can be computed using different lines. Specifically, the eye, the fingertip, and the object can form a triangle, and there are three ways of choosing two lines from a triangle. In Equation (1), we use the two lines connected by the eye. + +We investigate the effects of using different lines for cosine similarity computation. Specifically, we conducted an additional experiment using two lines connected by the fingertip. In other words, we use the following two vectors: one from the fingertip to the eye, and the other from the object center to the fingertip. + +Our results (Table A1) show that using the lines connected by the eye and using the two lines connected by the fingertip can be regarded as fungible. + +In specific, using the two lines connected by the fingertip, the model's performance is 69.0, 60.8, and 37.3 under the IoU threshold of 0.25, 0.50, and 0.75, respectively. Compared to the EWL model, it obtains a +1.5 performance boost under the IoU threshold of 0.75. Compared to the No Explicit Gestural Key Points Model, it obtains a +4.1 and +3.4 performance boost under the IoU threshold of 0.25 and 0.50, respectively. + +Table A1: Using different lines for cosine similarity computation in the VTL model. + +
IoU=.25IoU=.50IoU=.75
Ours (No explicit gestural key points)64.957.437.2
Ours (EWL)69.560.735.5
Ours (VTL, cos_sim Vertex = Fingertip)69.060.837.3
\ No newline at end of file diff --git a/understandingembodiedreferencewithtouchlinetransformer/images.zip b/understandingembodiedreferencewithtouchlinetransformer/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..3c27f69fb79054a92bcf345ac642ce4ce543e397 --- /dev/null +++ b/understandingembodiedreferencewithtouchlinetransformer/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bfcc5b9debc416ac682202fad186e9b5460b266f8f454f2ac3d7081e2f704cb9 +size 973132 diff --git a/understandingembodiedreferencewithtouchlinetransformer/layout.json b/understandingembodiedreferencewithtouchlinetransformer/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..847243c8d85c1996579b37e4764967cea7be6809 --- /dev/null +++ b/understandingembodiedreferencewithtouchlinetransformer/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc8206aa23443654316e15f6bcd5430746dc91df1436c4f39bfdb3cdc372d9a3 +size 482301 diff --git a/understandinginfluencefunctionsanddatamodelsviaharmonicanalysis/81002f1e-35eb-4069-8c01-f2855e2c89d4_content_list.json b/understandinginfluencefunctionsanddatamodelsviaharmonicanalysis/81002f1e-35eb-4069-8c01-f2855e2c89d4_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..26e95d5a944e651144a508982b1e4fe1d8e08fae --- /dev/null +++ b/understandinginfluencefunctionsanddatamodelsviaharmonicanalysis/81002f1e-35eb-4069-8c01-f2855e2c89d4_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a245a8e92201f35e507ef554094c5d83d29dcdafcab665508c6a3eee6d3b13e +size 154554 diff --git a/understandinginfluencefunctionsanddatamodelsviaharmonicanalysis/81002f1e-35eb-4069-8c01-f2855e2c89d4_model.json b/understandinginfluencefunctionsanddatamodelsviaharmonicanalysis/81002f1e-35eb-4069-8c01-f2855e2c89d4_model.json new file mode 100644 index 0000000000000000000000000000000000000000..5a9420aba3fb7161ee4be38b64f4ee5c34e0220a --- /dev/null +++ b/understandinginfluencefunctionsanddatamodelsviaharmonicanalysis/81002f1e-35eb-4069-8c01-f2855e2c89d4_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:282e390f848f0473f284d04e47b8ce61460ac3306bba0bdd368df391eb7f144f +size 174991 diff --git a/understandinginfluencefunctionsanddatamodelsviaharmonicanalysis/81002f1e-35eb-4069-8c01-f2855e2c89d4_origin.pdf b/understandinginfluencefunctionsanddatamodelsviaharmonicanalysis/81002f1e-35eb-4069-8c01-f2855e2c89d4_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d8de702757039daa58aa9e7649674d1db9bf30f7 --- /dev/null +++ b/understandinginfluencefunctionsanddatamodelsviaharmonicanalysis/81002f1e-35eb-4069-8c01-f2855e2c89d4_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:427731cd05b4e1ae69b4476e2cd32c99d131f1919723bd3d4dcbcddb7af0d76d +size 817200 diff --git a/understandinginfluencefunctionsanddatamodelsviaharmonicanalysis/full.md b/understandinginfluencefunctionsanddatamodelsviaharmonicanalysis/full.md new file mode 100644 index 0000000000000000000000000000000000000000..b2e3cb32d69b6d4b04768369dedd491bb53898c2 --- /dev/null +++ b/understandinginfluencefunctionsanddatamodelsviaharmonicanalysis/full.md @@ -0,0 +1,728 @@ +# UNDERSTANDING INFLUENCE FUNCTIONS AND DATAMODELS VIA HARMONIC ANALYSIS + +Nikunj Saunshi, Arushi Gupta, Mark Braverman, Sanjeev Arora + +Department of Computer Science, Princeton University + +{nsaunshi, arushig, mbraverm, arora}@cs.princeton.edu + +# ABSTRACT + +Influence functions estimate effect of individual data points on predictions of the model on test data and were adapted to deep learning in Koh & Liang (2017). They have been used for detecting data poisoning, detecting helpful and harmful examples, influence of groups of datapoints, etc. Recently, Ilyas et al. (2022) introduced a linear regression method they termed datamodels to predict the effect of training points on outputs on test data. The current paper seeks to provide a better theoretical understanding of such interesting empirical phenomena. The primary tool is harmonic analysis and the idea of noise stability. Contributions include: (a) Exact characterization of the learnt datamodel in terms of Fourier coefficients. (b) An efficient method to estimate the residual error and quality of the optimum linear datamodel without having to train the datamodel. (c) New insights into when influences of groups of datapoints may or may not add up linearly. + +# 1 INTRODUCTION + +It is often of great interest to quantify how the presence or absence of a particular training data point affects the trained model's performance on test data points. Influence functions is a classical idea for this (Jaeckel, 1972; Hampel, 1974; Cook, 1977) that has recently been adapted to modern deep models and large datasets Koh & Liang (2017). Influence functions have been applied to explain predictions and produce confidence intervals (Schulam & Saria, 2019), investigate model bias (Brunet et al., 2019; Wang et al., 2019), estimate Shapley values (Jia et al., 2019; Ghorbani & Zou, 2019), improve human trust (Zhou et al., 2019), and craft data poisoning attacks (Koh et al., 2019). + +Influence actually has different formalizations. The classic calculus-based estimate (henceforth referred to as continuous influence) involves conceptualizing training loss as a weighted sum over training datapoints, where the weighting of a particular datapoint $z$ can be varied infinitesimally. Using gradient and Hessian one obtains an expression for the rate of change in test error (or other functions) of $z'$ with respect to (infinitesimal) changes to weighting of $z$ . Though the estimate is derived only for infinitesimal change to the weighting of $z$ in the training set, in practice it has been employed also as a reasonable estimate for the discrete notion of influence, which is the effect of completely adding/removing the data point from the training dataset (Koh & Liang, 2017). Informally speaking, this discrete influence is defined as $f(S \cup \{i\}) - f(S)$ where $f$ is some function of the test points, $S$ is a training dataset and $i$ is the index of a training point. (This can be noisy, so several papers use expected influence of $i$ by taking the expectation over random choice of $S$ of a certain size; see Section 2.) Koh & Liang (2017) as well as subsequent papers have used continuous influence to estimate the effect of decidedly non-infinitesimal changes to the dataset, such as changing the training set by adding or deleting entire groups of datapoints (Koh et al., 2019). Recently Bae et al. (2022) show mathematical reasons why this is not well-founded, and give a clearer explanation (and alternative implementation) of Koh-Liang style estimators. + +Yet another idea related to influence functions is linear datamodels in Ilyas et al. (2022). By training many models on subsets of $p$ fraction of datapoints in the training set, the authors show that some interesting measures of test error (defined using logit values) behave as follows: the measure $f(x)$ is well-approximable as a (sparse) linear expression $\theta_0 + \sum_i\theta_ix_i$ , where $x$ is a binary vector denoting a sample of $p$ fraction of training datapoints, with $x_{i} = 1$ indicating presence of $i$ -th training point and $x_{i} = -1$ denoting absence. The coefficients $\theta_{i}$ are estimated via lasso + +regression. The surprise here is that $f(x)$ —which is the result of deep learning on dataset $x$ —is well-approximated by $\theta_0 + \sum_i \theta_i x_i$ . The authors note that the $\theta_i$ 's can be viewed as heuristic estimates for the discrete influence of the $i$ th datapoint. + +The current paper seeks to provide better theoretical understanding of above-mentioned phenomena concerning discrete influence functions. At first sight this quest appears difficult. The calculus definition of influence functions (which as mentioned is also used in practice to estimate the discrete notions of influence) involves Hessians and gradients evaluated on the trained net, and thus one imagines that any explanation for properties of influence functions must await better mathematical understanding of datasets, net architectures, and training algorithms. + +Surprisingly, we show that the explanation for many observed properties turns out to be fairly generic. Our chief technical tool is harmonic analysis, and especially theory of noise stability of functions (see O'Donnell (2014) for an excellent survey). + +# 1.1 OUR CONCEPTUAL FRAMEWORK (DISCRETE INFLUENCE) + +Training data points are numbered 1 through $N$ , but the model is being trained on a random subset of data points, where each data point is included independently in the subset with probability $p$ . (This is precisely the setting in linear datamodels.) For notational ease and consistency with harmonic analysis, we denote this subset by $x \in \{-1, +1\}^N$ where $+1$ means the corresponding data point was included. We are interested in some quantity $f(x)$ associated with the trained model on one or more test data points. Note $f$ is a probabilistic function of $x$ due to stochasticity in deep net training - SGD, dropout, data augmentation etc. - but one can average over the stochastic choices and think of $f$ as deterministic function $f \colon \{\pm 1\}^N \to \mathbb{R}$ . (In practice, this means we estimate $f(x)$ by repeating the training on $x$ , say, 10 to 50 times.) + +This scenario is close to classical study of boolean functions via harmonic analysis, except our function is real-valued. Using those tools we provide the following new mathematical understanding: + +1. We give reasons for existence of datamodels of Ilyas et al. (2022), the phenomenon that functions related to test error are well-approximable by a linear function $\theta_0 + \sum_i\theta_ix_i$ . See Section 3.1. +2. Section 2 gives exact characterizations of the $\theta_{i}$ 's for data models with/without regularization. (Earlier, Ilyas et al. (2022) noted this for a special case: $p = 0.5$ , $\ell_{2}$ regularization) +3. Using our framework, we give a new algorithm to estimate the degree to which a test function $f$ is well-approximated by a linear datamodel, without having to train the datamodel per se. See Section 3.2, where our method needs only $\mathcal{O}(1 / \epsilon^3)$ samples instead of $\mathcal{O}(N / \epsilon^2)$ . +4. We study group influence, which quantifies the effect of adding or deleting a set $I$ of datapoints to $x$ . Ilyas et al. (2022) note that this can often be well-approximated by linearly adding the individual influences of points in $I$ . Section 4 clarifies simple settings where linearity would fail, by a factor exponentially large in $|I|$ , and also discusses potential reasons for the observed linearity. + +# 1.2 OTHER RELATED WORK + +Narasimhan et al. (2015) investigate when influence is PAC learnable. Basu et al. (2020) use second order influence functions and find they make better predictions than first order influence functions. Cohen et al. (2020) use influence functions to detect adversarial examples. Kong et al. (2021) propose an influence based re-labeling function that can relabel harmful examples to improve generalization instead of just discarding them. Zhang & Zhang (2022) use Neural Tangent Kernels to understand influence functions rigorously for highly overparametrized nets. + +Pruthi et al. (2020) give another notion of influence by tracing the effect of data points on the loss throughout gradient descent. Chen et al. (2020) define multi-stage influence functions to trace influence all the way back to pre-training to find which samples were most helpful during pre-training. Basu et al. (2021) find that influence functions are fragile, in the sense that the quality of influence estimates depend on the architecture and training procedure. Alaa & Van Der Schaar (2020) use higher order influence functions to characterize uncertainty in a jack-knife estimate. Teso et al. (2021) introduce Cincer, which uses influence functions to identify suspicious pairs of examples for interactive label cleaning. Rahaman et al. (2019) use harmonic analysis to decompose a neural network into a piecewise linear Fourier series, thus finding that neural networks exhibit spectral bias. + +Other instance based interpretability techniques include Representer Point Selection (Yeh et al., 2018), Grad-Cos (Charpiat et al., 2019), Grad-dot (Hanawa et al., 2020), MMD-Critic (Kim et al., 2016), and unconditional counter-factual explanations (Wachter et al., 2017). + +Variants on influence functions have also been proposed, including those using Fisher kernels (Khanna et al., 2019), tricks for faster and more scalable inference (Guo et al., 2021; Schioppa et al., 2022), and identifying relevant training samples with relative influence (Barshan et al., 2020). Discrete influence played a prominent role in the surprising discovery of long tail phenomenon in Feldman (2020); Feldman & Zhang (2020): the experimental finding that in large datasets like ImageNet, a significant fraction of training points are atypical, in the sense that the model does not easily learn to classify them correctly if the point is removed from the training set. + +# 2 HARMONIC ANALYSIS, INFLUENCE FUNCTIONS AND DATAMODELS + +In this section we introduce notations for the standard harmonic analysis for functions on the hypercube (O'Donnell, 2014), and establish connections between the corresponding fourier coefficients, discrete influence of data points and linear datamodels from Ilyas et al. (2022). + +# 2.1 PRELIMINARIES: HARMONIC ANALYSIS + +In the conceptual framework of Section 1.1, let $[N] \coloneqq \{1,2,3,\dots,N\}$ . Viewing $f \colon \{\pm 1\}^N \to \mathbb{R}$ as a vector in $\mathbb{R}^{2^N}$ , for any distribution $\mathcal{D}$ on $\{\pm 1\}^N$ , the set of all such functions can be treated as a vector space with inner product defined as $\langle f,g\rangle_{\mathcal{D}} = \mathbb{E}_{x\sim \mathcal{D}}[f(x)g(x)]$ , leading to a norm defined as $\|f\|_{\mathcal{D}} = \sqrt{\mathbb{E}_{x\sim\mathcal{D}}[f(x)^2]}$ . Harmonic analysis involves identifying special orthonormal bases for this vector space. We are interested in $f$ ’s values at or near $p$ -biased points $x \in \{\pm 1\}^N$ , where $x$ is viewed as a random variable whose each coordinate is independently set to $+1$ with probability $p$ . We denote this distribution as $\mathcal{B}_p$ . Properties of $f$ in this setting are best studied using the orthonormal basis functions $\{\phi_S : S \subseteq [N]\}$ defined as $\phi_S(x) = \prod_{i \in S} \left( \frac{x_i - \mu}{\sigma} \right)$ , where $\mu = 2p - 1$ and $\sigma^2 = 4p(1 - p)$ are the mean and variance of each coordinate of $x$ . Orthonormality implies that $\mathbb{E}_x[\phi_S(x)] = 0$ when $S \neq \emptyset$ and $\langle \phi_S, \phi_{S'} \rangle_{\mathcal{B}_p} = \mathbb{1}_{S = S'}$ . Then every $f \colon [N] \to \mathbb{R}$ can be expressed as $f = \sum_{S \subseteq [N]} \widehat{f}_S \phi_S$ . Our discussion will often refer to $\widehat{f}_S$ ’s as “Fourier” coefficients of $f$ , when the orthonormal basis is clear from context. This also implies Parseval's identity: $\sum_S \widehat{f}_S^2 = \|f\|_{\mathcal{B}_p}^2$ . For any vector $z \in \mathbb{R}^d$ , we denote $z_i$ to denote its $i$ -th coordinate (with 1-indexing). For a matrix $A \in \mathbb{R}^{d \times r}$ , $A_{i,:} \in \mathbb{R}^r$ and $A_{:,j} \in \mathbb{R}^d$ denote its $i$ -th row and $j$ -th column respectively. We use $\|\cdot\|$ to denote Euclidean norm when not specified. + +# 2.2 INFLUENCE FUNCTIONS + +We use the notion of influence of a single point from Feldman & Zhang (2020); Ilyas et al. (2022). Influence of the $i$ -th coordinate on $f$ at $x$ is defined as $\operatorname{Inf}_i(f(x)) = f(x|_{i\to 1}) - f(x|_{i\to -1})$ , where $x$ is sampled as a $p$ -biased training set and $x|_{i\to 1}$ is $x$ with the $i$ -th coordinate set to 1. + +Proposition 2.1 (Individual influence). The "leave-one-out" influences satisfy the following: + +$$ +\operatorname {I n f} _ {i} (f (x)) = \frac {2}{\sigma} \sum_ {S \ni i} \widehat {f} _ {S} \phi_ {S \backslash \{i \}} (x), \quad \operatorname {I n f} _ {i} (f) := \mathbb {E} _ {x} [ \operatorname {I n f} _ {i} (f (x)) ] = \frac {2}{\sigma} \widehat {f} _ {\{i \}}. \tag {1} +$$ + +Thus the degree-1 Fourier coefficients are directly related to average influence of individual points. Similar results can be shown for other definition of single point influence: $\mathbb{E}_x[f(x) - f(x|_{i\to -1})]$ and $\mathbb{E}_x[f(x|_{i\to 1}) - f(x)]$ are equal to $p\operatorname{Inf}_i(f)$ and $(1 - p)\operatorname{Inf}_i(f)$ respectively. The proof of this follows by observing that $\mathbb{E}_x[f(x|_{i\to 1}) - f(x|_{i\to -1})] = \sum_{S\ni i}\widehat{f}_S\left(\frac{1 - \mu}{\sigma} -\frac{-1 - \mu}{\sigma}\right)\phi_{S\setminus \{i\}}(x)$ . The only term that is not zero in expectation is the one for $S = \{i\}$ , thus proving the result. Section 4 deals with the influence of add or deleting larger subsets of points. + +Continuous vs Discrete Influence Koh & Liang (2017) utilize a continuous notion of influence: train a model using dataset $x \in \{\pm 1\}^N$ , and then treat the $i$ -th coordinate of $x$ as a continuous variable $x_i$ . Compute $\frac{d}{dx_i} f$ at $x_i = 1$ using gradients and Hessians of the loss at end of training. + +This is called the continuous influence of the $i$ -th datapoint on $f$ . As mentioned in Section 1 in several other contexts one uses the discrete influence 1, which has a better connection to harmonic analysis. While experiments in Koh & Liang (2017) suggest that continuous influence closely tracks the discrete influence in linear models, Bae et al. (2022) show that this breaks in deep learning settings. For the rest of the paper we will use discrete influences. + +# 2.3 LINEAR DATAMODELS FROM A HARMONIC ANALYSIS LENS + +Next we turn to the phenomenon Ilyas et al. (2022) that a function $f(x)$ related to average test error1 (where $x$ is the training set) often turns out to be approximable by a linear function $\theta_0 + \sum_i \theta_i \bar{x}_i$ , where $\bar{x} \in \{0, 1\}^N$ is the binary version of $x \in \{\pm 1\}^N$ . It is important to note that this approximation (when it exists) holds only in a least squares sense, meaning that the following is small: $\mathbb{E}_x[(f(x) - \theta_0 - \sum_i \theta_i \bar{x}_i)^2]$ where the expectation is over $p$ -biased $x$ . + +The authors suggest that $\theta_{i}$ can be seen as an estimate of the average discrete influence of variable $i$ . While this is intuitive, they do not give a general proof (their Lemma 2 proves it for $p = 1/2$ with $\ell_{2}$ regularization). The following result exactly characterizes the solutions for arbitrary $p$ and with both $\ell_{1}$ and $\ell_{2}$ regularization. + +Theorem 2.2 (Characterizing solutions to linear datamodels). Denote the quality of a linear datamodel $\theta \in \mathbb{R}^{N + 1}$ on the $p$ -biased distribution over training sets $\mathcal{B}_p$ by + +$$ +\mathcal {R} (\theta) := \mathbb {E} _ {x \sim \mathcal {B} _ {p}} \left[ \left(f (x) - \theta_ {0} - \sum_ {i = 1} ^ {N} \theta_ {i} \bar {x} _ {i}\right) ^ {2} \right]. \tag {2} +$$ + +where $\bar{x} \in \{0,1\}^N$ is the binary version for any $x \in \{\pm 1\}^N$ . Then for $\mu = 2p - 1$ and $\sigma = \sqrt{4p(1 - p)}$ , the following are true about the optimal datamodels with and without regularization: + +(a) The unregularized minimizer $\theta^{\star} = \arg \min \mathcal{R}(\theta)$ satisfies + +$$ +\theta_ {i} ^ {\star} = \frac {2}{\sigma} \widehat {f} _ {\{i \}}, \quad \theta_ {0} ^ {\star} = \widehat {f} _ {\emptyset} - \frac {(\mu + 1)}{2} \sum_ {i} \theta_ {i} ^ {\star}. \tag {3} +$$ + +Furthermore the residual error is the sum of all Fourier coefficients of order 2 or higher. + +$$ +\mathcal {R} \left(\theta^ {\star}\right) = B _ {\geq 2} := \sum_ {S \subseteq [ N ]: | S | \geq 2} \widehat {f} _ {S} ^ {2} \tag {4} +$$ + +(b) The minimizer with $\ell_2$ regularization $\theta^{\star}(\lambda ,\ell_{2}) = \arg \min \left\{\mathcal{R}(\theta) + \lambda \| \theta_{1:N}\| _2^2\right\}$ satisfies + +$$ +\theta^ {\star} (\lambda , \ell_ {2}) _ {i} = \frac {2}{\sigma} \left(1 + \frac {4 \lambda}{\sigma^ {2}}\right) ^ {- 1} \widehat {f} _ {\{i \}}, \tag {5} +$$ + +(c) The minimizer with $\ell_1$ regularization $\theta^{\star}(\lambda ,\ell_1) = \arg \min \left\{\mathcal{R}(\theta) + \lambda \| \theta_{1:N}\| _1\right\}$ satisfies + +$$ +\theta^ {\star} (\lambda , \ell_ {1}) _ {i} = \frac {2}{\sigma} \left(\left(\widehat {f} _ {\{i \}} - \lambda / \sigma\right) _ {+} - \left(- \widehat {f} _ {\{i \}} - \lambda / \sigma\right) _ {+}\right) = \frac {2}{\sigma} \operatorname {s i g n} \left(\widehat {f} _ {\{i \}}\right) \left(\left| \widehat {f} _ {\{i \}} \right| - \lambda / \sigma\right) _ {+} \tag {6} +$$ + +where $z_{+} = z\mathbb{1}_{z > 0}$ is the standard ReLU operation. + +This result shows that the optimal linear datamodel with various regularization schemes, for any $p \in (0,1)$ are directly related to the first order Fourier coefficients at $p$ . Given that the average discrete influences, from Equation (1), are also the first order coefficients, this result directly establishes a connection between datamodels and influences. Result (c) suggests that $\ell_1$ regularization has the effect of clipping the Fourier coefficients such that those with small magnitude are set to 0, thus encouraging sparse datamodels. Furthermore, Equation (4) also gives a simple expression for the residual of the best linear fit which we utilize for our efficient residual estimation procedure in Section 3.2. + +The proof of the full result is presented in Appendix B.1, however we present a proof sketch of the result (a) to highlight the role of the Fourier basis and coefficients. + +Proof sketch for Theorem 2.2(a). Since $\{\phi_S\}_{S\subseteq [N]}$ is an orthonormal basis for the inner product space with $\langle f,g\rangle_{\mathcal{B}_p} = \underset {x\sim \mathcal{B}_p}{\mathbb{E}}[f(x)g(x)]$ , we can rewrite $\mathcal{R}(\theta)$ as follows + +$$ +\begin{array}{l} \mathcal {R} (\theta) = \mathbb {E} _ {x \sim \mathcal {B} _ {p}} \left(f (x) - \theta_ {0} - \sum_ {i} \theta_ {i} \bar {x} _ {i}\right) ^ {2} = \mathbb {E} _ {x \sim \mathcal {B} _ {p}} \left(f (x) - \bar {\theta} _ {0} - \sum_ {i} \bar {\theta} _ {i} \phi_ {\{i \}} (x)\right) ^ {2} \\ = \left\| f - \bar {\theta} _ {0} - \sum_ {i} \bar {\theta} _ {i} \phi_ {\{i \}} \right\| _ {\mathcal {B} _ {p}} ^ {2}, \text {w h e r e} \| \cdot \| _ {\mathcal {B} _ {p}} := \langle \cdot , \cdot \rangle_ {\mathcal {B} _ {p}} \\ \end{array} +$$ + +where $\bar{\theta}_i = \sigma /2\theta_i$ and $\bar{\theta}_0 = \theta_0 + (\mu +1) / 2\sum_i\theta_i$ . Due to the orthonormality of $\{\phi_S\}_{S\subseteq [N]}$ , the minimizer $\bar{\theta}^{\star}$ will lead to a projection of $f$ onto the span of $\{\phi_S\}_{|S|\leq 1}$ , which gives $\bar{\theta}_i = \widehat{f}_{\{i\}}$ and thus $\theta_{i} = 2 / \sigma \widehat{f}_{\{i\}}$ . Furthermore the residual is the norm of the projection of $f$ onto the orthogonal subspace span $\left(\{\phi_S\}_{|S|\geq 2}\right)$ , which is precisely $\sum_{|S|\geq 2}\widehat{f}_S^2$ . + +# 3 NOISE STABILITY AND QUALITY OF LINEAR DATAMODELS + +Theorem 2.2 characterizes that best linear datamodel from Ilyas et al. (2022) for any the test function. The unanswered question is: Why does this turn out to be a good surrogate (i.e. with low residual error) for the actual function $f$ ? A priori, one expects $f(x)$ , the result of deep learning on $x$ , to be a complicated function. In this section we use the idea of noise stability to provide an intuitive explanation. Furthermore we show how noise stability can be leveraged for efficient estimation of the quality of fit of linear datamodels, without having to learn the datamodel (which, as noted in Ilyas et al. (2022), requires training a large number of nets corresponding to random training sets $x$ ). + +Noise stability. Suppose $x$ is $p$ -biased as above. We define a $\rho$ -correlated r.v. as follows: + +Definition 3.1 ( $\rho$ -correlated). For $x \in \{\pm 1\}^N$ , we say a r.v. $x'$ is $\rho$ -correlated to $x$ if it is sampled as follows: If $x_i = 1$ , then $x_i' = -x_i$ w.p. $(1 - \rho)(1 - p)$ . If $x_i = -1$ , $x_i' = -x_i$ w.p. $(1 - \rho)p$ . + +Note that $x_{i}^{\prime} = 1$ w.p. $p(1 - (1 - \rho)(1 - p)) + (1 - p)(1 - \rho)p = p$ , so both $x$ and $x^{\prime}$ represent training datasets of expected size $pN$ with expected intersection of $(p + \rho (1 - p))N$ . Define the noise-stability of $f$ at noise rate $\rho$ as $h(\rho) = \mathbb{E}_{x,x'}[f(x)f(x')']$ where $x, x'$ are $\rho$ -correlated. Noise-stability plays a role reminiscent of moment generating function in probability, since ortho-normality implies + +$$ +h (\rho) = \mathbb {E} _ {x, x ^ {\prime}} [ f (x) f \left(x ^ {\prime}\right) ] = \sum_ {S} \widehat {f} _ {S} ^ {2} \rho^ {| S |} = \sum_ {i = 1} ^ {d} B _ {i} \rho^ {i}, \text {w h e r e} B _ {i} = \sum_ {S: | S | = i} \widehat {f} _ {S} ^ {2}. \tag {7} +$$ + +Thus $h(\rho)$ is a polynomial in $\rho$ where the coefficient of $\rho^i$ captures the $\ell_2$ weight of coefficients corresponding to sets $S$ of size $i$ . + +# 3.1 WHY SHOULD LINEAR DATAMODELS BE A GOOD APPROXIMATION? + +Suppose $f = \sum_{S} \widehat{f}_S \phi_S$ is the function of interest. Let $B_i$ stand for $\sum_{S:|S| = i} \widehat{f}_S^2$ . Define the normalized noise stability as $\bar{h}(\rho) = \mathbb{E}_{x,x'} [f(x)f(x')] / \mathbb{E}_x [f(x)^2]$ for $\rho \in [0,1]$ . Intuitively, since $f$ concerns test loss, one expects that as the number of training samples grows, test behavior of two correlated data sets $x, x'$ would not be too different, since we can alternatively think of picking $x, x'$ as first randomly picking their intersection and then augmenting this common core with two disjoint random datasets. Thus intuitively, normalized noise stability should be high, and perhaps close to its maximum value of 1. If it is indeed close to 1 then the next theorem (a modification of a related theorem for boolean-valued functions in O'Donnell (2014)) gives a first-cut bound on the quality of the best linear approximation in terms of the magnitude of the residual error. (Note that linear approximation includes the case that $f$ is constant.) + +Theorem 3.1. The quality of the best linear approximation to $f$ can be bounded in terms of the normalized noise stability $\bar{h}$ as + +$$ +\text {(N o r m a l i z e d r e s i d u a l)} \frac {\sum_ {S : | S | \geq 2} \widehat {f} _ {S} ^ {2}}{\sum_ {S} \widehat {f} _ {S} ^ {2}} \leq \frac {1 - \bar {h} (\rho)}{1 - \rho^ {2}}. \tag {8} +$$ + +![](images/6e01b973bff8ae99d5427cd3310954e960762f8165714e49d6e34ca3c4d9ff1f.jpg) +(a) Noise stability vs margin + +![](images/ad981099e2269aea1a129eed2761335313e4cca3e8e44431f7f9fb52e1be835e.jpg) +Figure 1: Scatter plots for 1000 test examples and their margin functions $f$ (log of ratio of correct label probability and the best probability for another label), for networks trained on $p$ -biased sets $x$ . (a) The normalized noise stability from Theorem 3.1 is high for many points; $\approx 44\%$ points are higher than 0.9. Also, noise stability is low for points that have margin close to 0, i.e. those that are close to the decision boundary. (b) Similarly, the estimated quality of linear fit (using Algorithm 1) is good when the model is confidently correct or wrong. (c) Noise stability for $\rho = 0.05$ correlates highly with the estimated quality of linear fit, providing credibility to Theorem 3.1. + +![](images/e07257084533946f59a76e1e7c3c049ad1e48e8facfc49025d7acad26300c89a.jpg) +(b) Quality of fit vs margin +(c) Quality of fit vs noise stability + +Theorem 3.1 is well-known in Harmonic analysis and is in some sense the best possible estimate if all we have is the noise stability for a single (and small) value of $\rho$ . In fact we find in Figure 1c that the noise stability estimate does correlate strongly with the estimated quality of linear fit (based on our procedure from Section 3.2). Figure 3 plots noise stability estimates for small values of $\rho$ . + +In standard machine learning settings, it is not any harder to estimate $h(\rho)$ for more than one $\rho$ , and this is used in next section in a method to better estimate of the quality of linear approximation. + +# 3.2 BETTER ESTIMATE OF QUALITY OF LINEAR APPROXIMATION + +A simple way to test the quality of the best linear fit, as in Ilyas et al. (2022), is to learn a datamodel using samples and evaluate it on held out samples. However learning a linear datamodel requires solving a linear regression on $N$ -dimensional inputs $x$ , which could require $\mathcal{O}(N)$ samples in general. A sample here corresponds to training a neural net on a $p$ -biased dataset $x$ , and training $\mathcal{O}(N)$ such models can be expensive. (Ilyas et al. (2022) needed to train around a million models.) + +Instead, can we estimate the quality of the linear fit without having to learn the best linear datamodel? This question relates to the idea of property testing in boolean functions, and indeed our next result yields a better estimate by using noise stability at multiple points. The idea is to leverage Equation (7), where the Fourier coefficients of sets of various sizes show up in the noise stability function $h(\rho) = \sum_{i=0}^{N} B_i \rho^i$ as the non-negative coefficients of the polynomial in $\rho$ . Since the residual of the best linear datamodel, from Theorem 2.2, is the total mass of Fourier coefficients of sizes at least 2, i.e., $B_{\geq 2} = \sum_{i=2}^{N} B_i$ , we can hope to learn this by fitting a polynomial on estimates of $h(\rho)$ at multiple $\rho$ 's. Algorithm 1 precisely leverages by first estimating the degree 0 and 1 coefficients $(B_0$ and $B_1)$ using noise stability estimates at a few $\rho$ 's, estimating $B = \sum_{i=0}^{N} B_i = h(1)$ using $\rho = 1$ , and finally estimating the residual using the expression $B_{\geq 2} = B - B_0 - B_1$ . The theorem below shows that this indeed leads to a good estimate of the residual with having to train way fewer (independent of $N$ ) models. + +Theorem 3.2. Let $\hat{B}_{\geq 2} = \mathrm{RESIDUALESTIMATION}(f,n,[0,\rho,2\rho],2)$ be the estimated residual (see Algorithm 1) after fitting a degree 2 polynomial to noise stability estimates at $0,\rho,2\rho$ , using $n$ calls to $f$ . If $n = \mathcal{O}(1 / \epsilon^3)$ and $\rho = \sqrt{\epsilon}$ , then with high probability we have that $|\hat{B}_{\geq 2} - B_{\geq 2}| \leq \epsilon$ . + +The proof of this is presented in Appendix B.2. This improves upon prior results on residual estimation for linear thresholds from Maturef et al. (2010) that do a degree-1 approximation to $h(\rho)$ with $1 / \epsilon^4$ samples, more than $1 / \epsilon^3$ samples needed with our degree-2 approximation instead. In fact, we hypothesize using a degree $d > 2$ likely improves upon the dependence on $\epsilon$ ; we leave that for future work. This result provides us a way to estimate the quality of the best linear datamodel without + +Algorithm 1 Efficient algorithm for residual estimation +1: procedure RESIDUALESTIMATION(f, n, [ρ1, ..., ρk], d) +2: /* f: function, n: evaluation budget, d: degree of approximation */ +3: y ∈ R^k, A ∈ R^{k \times (d+1)} +4: for i ∈ [1, ..., k] do +5: yi← NOISESTABILITY(f, n/(k+1), ρi) ▷ Estimate h(ρi) +6: Ai,: ← [1, ρi, ..., ρi^d] +7: end for +8: Solve z = minz∈Rd+1 \|Az - y\|_2^2 s.t. z ≥ 0 ▷ Requires solving a convex program +9: B0, B1 ← z1, z2 +10: B ← NOISESTABILITY(f, n/(k+1), 1) ▷ Estimate h(1) = ∑iBi; see Equation (7) +11: B≥2 ← B - B0 - B1 +12: return B≥2 ▷ B≥2 is the residual from Theorem 2.2 +13: end procedure +14: +15: procedure NOISESTABILITY(f, n, ρ) +16: hρ ← 0 +17: for j ∈ [1, ..., n/2] do +18: x ∼ Bp +19: x' ∼ RHOCORR(x, ρ) ▷ x' is ρ-correlated to x; see Definition 3.1 +20: hρ ← hρ + 2/nf(x)f(x') ▷ Two evaluations of f per x needed +21: end for +22: return hρ ▷ Returns an unbiased estimate for h(ρ); see Lemma B.1 +23: end procedure + +having to use $\mathcal{O}(N / \epsilon^2)$ samples (in the worse case) for linear regression $^2$ . The guarantee does not even depend on $N$ , although it has a worse dependence of $\epsilon$ that can likely be improved upon. + +Experiments. We run our residual estimation algorithm for 1000 test examples (see Appendix C for details) and Figure 2 summarizes our findings. The histogram of the estimated normalized residuals (8) in Figure 2a indicates that a good linear fit exists for majority of the points, echoing the findings from Ilyas et al. (2022). Figures 2b and 2c study the effects of choices like degree $d$ and $\rho$ . Furthermore we find in Figure 1b an interesting connection between the predicted quality of linear fit (1 - normalized residual) and the average margin of the test point: linear fit is best when models trained on $p$ -biased datasets are confidently right or wrong on average. The fit is much worse for examples that are closer to the decision boundary (smaller margin); exploration of this finding is an interesting future direction. Finally, Figures 3 and 4 provide visualizations of the learned polynomial fits as the degree $d$ and list of $\rho$ 's are varied. + +# 4 UNDERSTANDING GROUP INFLUENCE AND ABILITY FOR COUNTERFACTUAL REASONING + +Both influence functions as well as linear datamodels display some ability to do counterfactual reasoning: to predict the effect of small changes to the training set on the model's behavior on test data. Specifically, they allow reasonable estimation of the difference between a model trained with $x$ and one trained with $x|_{I\to -1}$ , the training set containing $x$ after deleting the points in $I$ . Averaged over $x$ , this can be thought of as average group influence of deleting $I$ . We study this effect through the lens of Fourier coefficients in the upcoming section. + +# 4.1 EXPRESSION FOR GROUP INFLUENCE + +Let $I$ be a subset of variables and let $x \in \{-1, 1\}^N$ denote a random $p$ -biased variable with distribution $\mathcal{B}_p$ . Then the expectation of $f(x) - f(x|_{I \to -1})$ can be thought of as the average + +![](images/c940e11c02ad1380ea2e2182f4a2c083d8168e1a8640a447096d2fa78303334b.jpg) +(a) Histogram of residuals + +![](images/25fc7d95b9a8c84c580fff63f6949bf6e099ed4eb4782a25e0ded10fe98f53e0.jpg) +(b) Effect of degree $d$ + +![](images/459db505c15f6c66e6ed3d1663f6e5628769a6c30c56c06884e9f39ced043d77.jpg) +(c) Effect of list of $\rho$ 's +Figure 2: (a) Histogram of estimated normalized residual $(\hat{B}_{\geq 2} / \hat{B})$ , for 1000 test examples, using Algorithm 1 with degree $d = 2$ and list $[0, 0.1, 0.2, 1]$ for $\rho$ 's. Almost half of the test examples have normalized residuals below 0.1. (b) Estimations using $d = 2$ and $d = 3$ , for various test points, are highly correlated to each other, suggesting a small effect of degree of approximation in this case. (c) Estimates using $[0, \rho, 2\rho, 1]$ in Algorithm 1, for $\rho = 0.05$ and $\rho = 0.1$ ; Spearman correlation is $\approx 0.8$ . The choice of $\rho$ does have some effect, suggesting that there is still some noise in the estimate. Note that Theorem 3.2 requires the right scale of $\rho$ for the estimate to be accuracy. + +influence of deleting $I$ . An interesting empirical phenomenon in Koh et al. (2019) is that the group influence is often well-correlated with the sum of individual influences in $I$ , i.e. $\sum_{i} \operatorname{Inf}_{i}(f(x))$ . In fact this is what makes empirical study of group influence feasible in various settings, because influential subsets $I$ can be found without having to spend time exponential in $|I|$ to search among all subsets of this size. The claim in Ilyas et al. (2022) is that linear data models exhibit the same phenomenon: the sum of coefficients of coordinates in $I$ approximates the effect of training on $x|_{I \to -1}$ . We give the mathematics of such "counterfactual reasoning" as well as its potential limits. + +Theorem 4.1. [Group influence] The following are true about group influence of deletion. + +$$ +\begin{array}{l} \operatorname {I n f} _ {I} (f) := \mathbb {E} _ {x \sim \mathcal {B} _ {p}} [ f (x) - f (x | _ {I \rightarrow - 1}) ] = p \sum_ {i \in I} \theta^ {\star} - \sum_ {I ^ {\prime} \subseteq I, | I ^ {\prime} | \geq 2} (- 1) ^ {| I ^ {\prime} |} \left(\frac {p}{1 - p}\right) ^ {| I ^ {\prime} | / 2} \widehat {f} _ {I ^ {\prime}} \\ = p \sum_ {i \in I} \operatorname {I n f} _ {i} (f) - \sum_ {I ^ {\prime} \subseteq I, | I ^ {\prime} | \geq 2} (- 1) ^ {| I ^ {\prime} |} \left(\frac {p}{1 - p}\right) ^ {| I ^ {\prime} | / 2} \widehat {f} _ {I ^ {\prime}} \\ \end{array} +$$ + +where $\theta^{\star}$ is the optimal datamodel (Equation (3)) and $Inf_{i}$ is an individual influence (Equation (1)). + +Thus we see the that average group influence of deletion3 is equal to the sum of individual influence, plus a residual term. Proof for the above theorem for this is presented in Appendix B.3. + +This residual term can in turn be upper bounded by $(1 - p)^{-|I|/2} \sqrt{B_{\geq 2}}$ (see Lemma B.2), which blows up exponentially in $|I|$ . However the findings in Figure F.1 from Ilyas et al. (2022) suggest that the effect of number of points deleted is linear (or sub-linear), and far from an exponential growth. In the next section we provide a simple example where the exponential blow-up is unavoidable, and also provide some hypothesis and hints as to why this exponential blow is not observed in practice. + +# 4.2 THRESHOLD FUNCTION AND EXPONENTIAL GROUP INFLUENCE + +We exhibit the above exponential dependence on set size using a natural function inspired by empirics around the long tail phenomenon (Feldman, 2020; Feldman & Zhang, 2020), which suggests that successful classification on a specific test point depends on having seeing a certain number of "closely related" points during training. We model this as a sigmoidal function that depends on a special set $A$ of coordinates (i.e., training points) and assigns probability close to 1 when many more than $\beta$ fraction of the coordinates in $A$ are +1. + +For any vector $z \in \{\pm 1\}^d$ , let $\mathrm{avg}(z) = \frac{1}{d}\sum_{i=1}^{d}\frac{(1 + z_i)}{2}$ denote the fraction of 1's in $z$ and $z_A = (z_i)_{i \in A}$ denotes the subset of coordinates indexed by $A \subseteq [d]$ . + +Example 1 (Sigmoid). Consider a function $f(x) = S(\alpha (\mathrm{avg}(x_A) - \beta))$ for a subset $A\subseteq [N]$ of size $M$ , where $S(u) = (1 + e^{-u})^{-1}$ is the sigmoid function. The function $f$ could represent the probability of the correct label for a test point when trained on the training set $x\in \{\pm 1\} ^N$ . + +For this function, we show below that for a large enough $p$ , the group influence of a $\gamma$ -fraction subset of $A$ is exponential in the size of the set. + +Lemma 4.2. Consider the function $f$ from Example 1 with $\beta = 0.5$ and $\alpha \to \infty$ ; so $f(x) = \mathbb{1}\{avg(x_A) > 0.5\}$ . If $x$ is $p$ -biased with $p > 0.5$ , then for any constant fraction subset $A' \subseteq A$ , its group influence is exponentially larger than sum of individual influences. + +$$ +\operatorname {I n f} _ {A ^ {\prime}} (f) \geq \frac {(2 (1 - p)) ^ {- | A ^ {\prime} | + 1}}{| A ^ {\prime} |} \left(\sum_ {i \in A ^ {\prime}} \operatorname {I n f} _ {i} (f)\right). \tag {9} +$$ + +Thus in the above example when $p > 0.5$ , the group influence can be exponentially larger than what is captured by individual influences. Proof of this lemma is presented in Appendix B.3 + +Margin v/s probability. The function $f$ from Lemma 4.2 has a property that it saturates to 1 quickly, so once $p$ is large enough, the individual influence of deleting 1 point can be extremely small, but the group influence of deleting sufficiently many of the influential points can switch the probability to close to 0. Ilyas et al. (2022) however do not fit a datamodel to the probability and instead fit it to the "margin", which is the log of the ratio of probabilities of the correct label to the highest probability assigned to another label. Presumably this choice was dictated by better empirical results, and now we see that it may play an important role in the observed linearity of group influence. Specifically, their margin does not saturate and can get arbitrarily large as the probability of the correct label approaches 1. This can be seen by considering a slightly different (but related) notion of margin, defined as $\bar{f} = \log \left( \frac{f}{(1 - f)} \right)$ , where the denominator is the total probability assigned to other labels instead of the max among other labels. For this case, the following result shows that group influence is now adequately represented by the individual influences. + +Corollary 4.3. For a function $f$ from Example 1, the group influence of any set $A' \subseteq [N]$ on the margin function $\bar{f}$ satisfies the following: + +$$ +\operatorname {I n f} _ {A ^ {\prime}} (\bar {f}) = p \sum_ {i \in A ^ {\prime}} \operatorname {I n f} _ {i} (\bar {f}) \tag {10} +$$ + +This result follows directly by observing that the margin function is simply the inverse of the sigmoid function, and so its expression is $\bar{f}(x) = \alpha (\mathrm{avg}(x_A) - \beta)$ which is just a linear function. Since all the Fourier coefficients of sets of size 2 or larger will be zero for a linear function, the result follows from Theorem 4.1 where the residual term becomes 0. + +# 5 CONCLUSION + +This paper has shown how harmonic analysis can shed new light on interesting phenomena around influence functions. Our ideas use a fairly black box view of deep nets, which helps bypass the current incomplete mathematical understanding of deep learning. Our new algorithm of Section 3.2 has the seemingly paradoxical property of being able to estimate exactly the quality of fit of datamodels without actually having to train (at great expense) the datamodels. We hope this will motivate other algorithms in this space. + +One limitation of harmonic analysis is that an arbitrary $f(x)$ could in effect behave very differently for on $p$ -biased distributions at $p = 0.5$ versus $p = 0.6$ . But in deep learning, the trained net probably does not change much upon increasing the training set by $20\%$ . Mathematically capturing this stability over $p$ (not to be confused with noise stability of Equation (7) via a mix of theory and experiments promises to be very fruitful. It may also lead to a new and more fine-grained generalization theory that accounts for the empirically observed long-tail phenomenon. Finally, harmonic analysis is often the tool of choice for studying phase transition phenomena in random systems, and perhaps could prove useful for studying emergent phenomena in deep learning with increasing model sizes. + +# REFERENCES + +Ahmed Alaa and Mihaela Van Der Schaar. Discriminative jackknife: Quantifying uncertainty in deep learning via higher-order influence functions. In International Conference on Machine Learning, pp. 165-174. PMLR, 2020. +Juhan Bae, Nathan Hoyen Ng, Alston Lo, Marzyeh Ghassemi, and Roger Baker Grosse. If influence functions are the answer, then what is the question? In Alice H. Oh, Alekh Agarwal, Danielle Belgrave, and Kyunghyun Cho (eds.), Advances in Neural Information Processing Systems, 2022. +Elnaz Barshan, Marc-Etienne Brunet, and Gintare Karolina Dziugaite. Relatif: Identifying explanatory training samples via relative influence. In International Conference on Artificial Intelligence and Statistics, pp. 1899-1909. PMLR, 2020. +Samyadeep Basu, Xuchen You, and Soheil Feizi. On second-order group influence functions for black-box predictions. In International Conference on Machine Learning, pp. 715-724. PMLR, 2020. +Samyadeep Basu, Phil Pope, and Soheil Feizi. Influence functions in deep learning are fragile. In International Conference on Learning Representations, 2021. +Marc-Etienne Brunet, Colleen Alkalay-Houlihan, Ashton Anderson, and Richard Zemel. Understanding the origins of bias in word embeddings. In International conference on machine learning, pp. 803-811. PMLR, 2019. +Guillaume Charpiat, Nicolas Girard, Loris Felardos, and Yuliya Tarabalka. Input similarity from the neural network perspective. Advances in Neural Information Processing Systems, 32, 2019. +Hongge Chen, Si Si, Yang Li, Ciprian Chelba, Sanjiv Kumar, Duane Boning, and Cho-Jui Hsieh. Multi-stage influence function. Advances in Neural Information Processing Systems, 33:12732-12742, 2020. +Gilad Cohen, Guillermo Sapiro, and Raja Giryes. Detecting adversarial samples using influence functions and nearest neighbors. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 14441-14450. IEEE, 2020. +R Dennis Cook. Detection of influential observation in linear regression. Technometrics, 19(1): 15-18, 1977. +Vitaly Feldman. Does learning require memorization? a short tale about a long tail. In Proceedings of the 52nd Annual ACM SIGACT Symposium on Theory of Computing, pp. 954-959, 2020. +Vitaly Feldman and Chiyuan Zhang. What neural networks memorize and why: Discovering the long tail via influence estimation. Advances in Neural Information Processing Systems, 33:2881-2891, 2020. +Amirata Ghorbani and James Zou. Data shapley: Equitable valuation of data for machine learning. In International Conference on Machine Learning, pp. 2242-2251. PMLR, 2019. +Han Guo, Nazneen Rajani, Peter Hase, Mohit Bansal, and Caiming Xiong. Fastif: Scalable influence functions for efficient model interpretation and debugging. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pp. 10333-10350, 2021. +Frank R Hampel. The influence curve and its role in robust estimation. Journal of the american statistical association, 69(346):383-393, 1974. +Kazuaki Hanawa, Sho Yokoi, Satoshi Hara, and Kentaro Inui. Evaluation of similarity-based explanations. arXiv preprint arXiv:2006.04528, 2020. +Andrew Ilyas, Sung Min Park, Logan Engstrom, Guillaume Leclerc, and Aleksander Madry. Datab-models: Predicting predictions from training data. arXiv preprint arXiv:2202.00622, 2022. +Louis A Jaeckel. The infinitesimal jackknife. Bell Telephone Laboratories, 1972. + +Ruoxi Jia, David Dao, Boxin Wang, Frances Ann Hubis, Nick Hynes, Nezihe Merve Gürel, Bo Li, Ce Zhang, Dawn Song, and Costas J Spanos. Towards efficient data valuation based on the shapley value. In The 22nd International Conference on Artificial Intelligence and Statistics, pp. 1167-1176. PMLR, 2019. +Rajiv Khanna, Been Kim, Joydeep Ghosh, and Sanmi Koyejo. Interpreting black box predictions using fisher kernels. In The 22nd International Conference on Artificial Intelligence and Statistics, pp. 3382-3390. PMLR, 2019. +Been Kim, Rajiv Khanna, and Oluwasanmi O Koyejo. Examples are not enough, learn to criticize! criticism for interpretability. Advances in neural information processing systems, 29, 2016. +Pang Wei Koh and Percy Liang. Understanding black-box predictions via influence functions. In International conference on machine learning, pp. 1885-1894. PMLR, 2017. +Pang Wei W Koh, Kai-Siang Ang, Hubert Teo, and Percy S Liang. On the accuracy of influence functions for measuring group effects. Advances in neural information processing systems, 32, 2019. +Shuming Kong, Yanyan Shen, and Linpeng Huang. Resolving training biases via influence-based data relabeling. In International Conference on Learning Representations, 2021. +Guillaume Leclerc, Andrew Ilyas, Logan Engstrom, Sung Min Park, Hadi Salman, and Aleksander Madry. ffcv. https://github.com/libffcv/ffcv/, 2022. commit xxxxxx. +Kevin Matulef, Ryan O'Donnell, Ronitt Rubinfeld, and Rocco A Servedio. Testing halfspaces. SIAM Journal on Computing, 2010. +Harikrishna Narasimhan, David C Parkes, and Yaron Singer. Learnability of influence in networks. Advances in Neural Information Processing Systems, 28, 2015. +Ryan O'Donnell. Analysis of boolean functions. Cambridge University Press, 2014. +Garima Pruthi, Frederick Liu, Satyen Kale, and Mukund Sundararajan. Estimating training data influence by tracing gradient descent. Advances in Neural Information Processing Systems, 33: 19920-19930, 2020. +Nasim Rahaman, Aristide Baratin, Devansh Arpit, Felix Draxler, Min Lin, Fred Hamprecht, Yoshua Bengio, and Aaron Courville. On the spectral bias of neural networks. In International Conference on Machine Learning, pp. 5301-5310. PMLR, 2019. +Andrea Schioppa, Polina Zablotskaia, David Vilar, and Artem Sokolov. Scaling up influence functions. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pp. 8179-8186, 2022. +Peter Schulam and Suchi Saria. Can you trust this prediction? auditing pointwise reliability after learning. In The 22nd International Conference on Artificial Intelligence and Statistics, pp. 1022-1031. PMLR, 2019. +Stefano Teso, Andrea Bontempelli, Fausto Giunchiglia, and Andrea Passerini. Interactive label cleaning with example-based explanations. Advances in Neural Information Processing Systems, 34:12966-12977, 2021. +Sandra Wachter, Brent Mittelstadt, and Chris Russell. Counterfactual explanations without opening the black box: Automated decisions and the gdpr. Harv. JL & Tech., 31:841, 2017. +Hao Wang, Berk Ustun, and Flavio Calmon. Repairing without retraining: Avoiding disparate impact with counterfactual distributions. In International Conference on Machine Learning, pp. 6618-6627. PMLR, 2019. +Chih-Kuan Yeh, Joon Kim, Ian En-Hsu Yen, and Pradeep K Ravikumar. Representative point selection for explaining deep neural networks. Advances in neural information processing systems, 31, 2018. + +Rui Zhang and Shihua Zhang. Rethinking influence functions of neural networks in the overparameterized regime. AAAI, 2022. +Jianlong Zhou, Zhidong Li, Huaiwen Hu, Kun Yu, Fang Chen, Zelin Li, and Yang Wang. Effects of influence on user trust in predictive decision making. In Extended Abstracts of the 2019 CHI Conference on Human Factors in Computing Systems, pp. 1-6, 2019. + +# A ADDITIONAL BACKGROUND + +# A.1 HARMONIC ANALYSIS AND BOOLAN FUNCTIONS + +We provide some more details for the classical Harmonic analysis on the boolean hypercube. Please refer to O'Donnell (2014) for an extensive discourse on this topic. The set of all functions $f\colon \{\pm 1\}^N\to \mathbb{R}$ can be trivially viewed as a vector space, since it is closed under linear combinations. Further for any distribution $\mathcal{D}$ over the hypercube $\{\pm 1\}^N$ , the set of real valued functions can be viewed as an inner product space, where the inner product is defined as $\langle f,g\rangle_{\mathcal{D}} = \mathbb{E}_{x\sim \mathcal{D}}[f(x)g(x)]$ . An alternative way to view this inner product is to define a $2^{N}$ dimensional vector $\pmb {f}\in \mathbb{R}^{2^N}$ for every function $f$ , where $\pmb {f} = \left(\sqrt{\mathcal{D}(x)} f(x)\right)_{x\in \{\pm 1\} ^N}$ . Under this parameterization, the aforementioned inner product between $f$ and $g$ can be viewed as the standard dot product between $\pmb{f}$ and $g$ , i.e. $\pmb{f}^{\top}\pmb {g} = \sum_{x\in \{\pm 1\}^{N}}\sqrt{\mathcal{D}(x)} f(x)\sqrt{\mathcal{D}(x)} g(x) = \sum_{x\in \{\pm 1\}^{N}}\mathcal{D}(x)f(x)g(x) = \mathbb{E}_{x\sim \mathcal{D}}[f(x)g(x)] = \langle f,g\rangle_{\mathcal{D}}$ . This inner product leads to the norm defined as $\| f\|_{\mathcal{D}} = \sqrt{\mathbb{E}_{x\sim\mathcal{D}}[f(x)^2]}$ . + +Harmonic analysis involves identifying special orthonormal bases for this vector space. Studying the behavior of function $f$ for points that have roughly $p$ -fraction of the coordinates 1 is possible by considering the distribution of $p$ -biased points $x \in \{\pm 1\}^N$ , where $x$ is viewed as a random variable whose each coordinate is independently set to $+1$ with probability $p$ . We denote this distribution as $\mathcal{B}_p$ . Properties of functions $f$ on the hypercube in this setting are best studied by decomposing it using an orthonormal basis functions for the inner product space defined by $\langle \cdot, \cdot \rangle_{\mathcal{D}}$ . It turns out that the functions $\{\phi_S : S \subseteq [N]\}$ defined as $\phi_S(x) = \prod_{i \in S} \left( \frac{x_i - \mu}{\sigma} \right)$ form the necessary orthonormal basis, where $\mu = 2p - 1$ and $\sigma^2 = 4p(1 - p)$ are the mean and variance of each coordinate of $x$ . For orthonormality, we require that $\langle \phi_S, \phi_{S'} \rangle_{\mathcal{B}_p} = \mathbb{1}_{S = S'}$ . To see why this is true, we note that + +$$ +\begin{array}{l} \left\langle \phi_ {S}, \phi_ {S ^ {\prime}} \right\rangle_ {\mathcal {B} _ {p}} = \mathbb {E} _ {x} \left[ \prod_ {i \in S} \left(\frac {x _ {i} - \mu}{\sigma}\right) \prod_ {i \in S ^ {\prime}} \left(\frac {x _ {i} - \mu}{\sigma}\right) \right] (11) \\ = \mathbb {E} _ {x} \left[ \prod_ {i \in S \cap S ^ {\prime}} \left(\frac {x _ {i} - \mu}{\sigma}\right) ^ {2} \prod_ {i \in S \Delta S ^ {\prime}} \left(\frac {x _ {i} - \mu}{\sigma}\right) \right] (12) \\ = \prod_ {i \in S \cap S ^ {\prime}} \mathbb {E} _ {x _ {i}} \left[ \left(\frac {x _ {i} - \mu}{\sigma}\right) ^ {2} \right] \prod_ {i \in S \Delta S ^ {\prime}} \mathbb {E} _ {x _ {i}} \left[ \left(\frac {x _ {i} - \mu}{\sigma}\right) \right] (13) \\ = \prod_ {i \in S \Delta S ^ {\prime}} \mathbb {E} _ {x _ {i}} \left[ \left(\frac {x _ {i} - \mu}{\sigma}\right) \right] (14) \\ \end{array} +$$ + +where the $S\Delta S'$ denotes the symmetric difference between the sets. The second to last equality follows from the independence of $x_{i}$ 's in $\mathcal{B}_p$ , while the last equality follows from the definition of mean $\mu$ and variance $\sigma^2$ . Thus if $S = S'$ , $S\Delta S' = \emptyset$ and this inner product is 1, while if $S \neq S'$ , $|S\Delta S'| > 0$ and this product is 0 by definition of $\mu$ . Hence $\phi_S$ 's indeed form an orthonormal basis. + +Given an orthonormal basis, every function $f\colon [N]\to \mathbb{R}$ can be expressed as a linear combination of this basis, i.e. $f = \sum_{S\subseteq [N]}\widehat{f}_S\phi_S$ . The coefficients are often referred to $\widehat{f}_S$ 's as "Fourier" coefficients of $f$ , when the orthonormal basis is clear from context. The orthonormality of $\phi_S$ 's also implies Parseval's identity: $\sum_{S}\widehat{f}_{S}^{2} = \| f\|_{\mathcal{B}_{p}}^{2}$ , since the $\ell_2$ norm measured using any orthonormal basis should be the same. + +# A.2 LINEAR DATAMODELS + +We provide some more background on linear datamodels from Ilyas et al. (2022) in the context of this paper; please refer to the original paper for more details. Consider a training set that is a subset of $[N]$ , denoted by $x \in \{\pm 1\}^N$ . The goal of datamodels is to be able to predict the outcome of training a neural network, using a fixed training algorithm, on a particular training set. Consider a function $f(x)$ that denotes that results of training on $x$ , where $f$ can denote any function of the resultant network, e.g. test loss, loss on a particular test example, margin for a test example, + +norm of parameters etc. Since the training algorithm involves randomness from various sources (initialization, SGD), $f$ can be viewed as an average over this randomness for a given training set $x$ . + +In general, $f$ could be a very complicated function of the training set $x$ ; for instance it could strongly depend on the presence or absence of particular subsets of datapoints. Furthermore due to the black-box nature of trained networks, one would not expect there to be a simple description of the function $f$ . Rather surprisingly, Ilyas et al. (2022) found that for the function $f$ that denotes the margin for a single test example, $f$ can on average be approximated by a linear function of the indicator of the training set $x$ , i.e. $f(x) \approx \theta^{\top}x$ for $x \sim \mathcal{B}_p$ . One implication of this result is that the effect of adding or deleting a single point $i \in [N]$ is independent of the rest of the training set and only depends on the size of the training set. A more important consequence is that $\theta$ can be estimated by training evaluating $f$ on many $x$ 's – which would require training a net for these $x$ 's – and then fitting a linear function $\hat{\theta}$ on those samples. This can be used to not only estimate the individual influence $\hat{\theta}_i$ of datapoints, but also gives a way to predict $f$ on a new $x$ by using the estimate $\hat{\theta}^{\top}x$ rather than actually training a net on $x$ . Details on how $\hat{\theta}$ is learned using Lasso regression (to encourage sparsity) can be found in Ilyas et al. (2022). Using Harmonic analysis, we show in Theorem 2.2 that the outcome of linear/Ridge/Lasso regression will provably be equal to the individual discrete influence of each point $i$ . + +# B OMITTED PROOFS + +# B.1 PROOFS FOR SECTION 2 + +We recall Theorem 2.2: + +Theorem 2.2 (Characterizing solutions to linear datamodels). Denote the quality of a linear datamodel $\theta \in \mathbb{R}^{N + 1}$ on the $p$ -biased distribution over training sets $\mathcal{B}_p$ by + +$$ +\mathcal {R} (\theta) := \mathbb {E} _ {x \sim \mathcal {B} _ {p}} \left[ \left(f (x) - \theta_ {0} - \sum_ {i = 1} ^ {N} \theta_ {i} \bar {x} _ {i}\right) ^ {2} \right]. \tag {2} +$$ + +where $\bar{x} \in \{0,1\}^N$ is the binary version for any $x \in \{\pm 1\}^N$ . Then for $\mu = 2p - 1$ and $\sigma = \sqrt{4p(1 - p)}$ , the following are true about the optimal datamodels with and without regularization: + +(a) The unregularized minimizer $\theta^{\star} = \arg \min \mathcal{R}(\theta)$ satisfies + +$$ +\theta_ {i} ^ {\star} = \frac {2}{\sigma} \widehat {f} _ {\{i \}}, \quad \theta_ {0} ^ {\star} = \widehat {f} _ {\emptyset} - \frac {(\mu + 1)}{2} \sum_ {i} \theta_ {i} ^ {\star}. \tag {3} +$$ + +Furthermore the residual error is the sum of all Fourier coefficients of order 2 or higher. + +$$ +\mathcal {R} \left(\theta^ {\star}\right) = B _ {\geq 2} := \sum_ {S \subseteq [ N ]: | S | \geq 2} \widehat {f} _ {S} ^ {2} \tag {4} +$$ + +(b) The minimizer with $\ell_2$ regularization $\theta^{\star}(\lambda ,\ell_2) = \arg \min \left\{\mathcal{R}(\theta) + \lambda \| \theta_{1:N}\| _2^2\right\}$ satisfies + +$$ +\theta^ {\star} (\lambda , \ell_ {2}) _ {i} = \frac {2}{\sigma} \left(1 + \frac {4 \lambda}{\sigma^ {2}}\right) ^ {- 1} \widehat {f} _ {\{i \}}, \tag {5} +$$ + +(c) The minimizer with $\ell_1$ regularization $\theta^{\star}(\lambda ,\ell_1) = \arg \min \left\{\mathcal{R}(\theta) + \lambda \| \theta_{1:N}\| _1\right\}$ satisfies + +$$ +\theta^ {\star} (\lambda , \ell_ {1}) _ {i} = \frac {2}{\sigma} \left(\left(\widehat {f} _ {\{i \}} - \lambda / \sigma\right) _ {+} - \left(- \widehat {f} _ {\{i \}} - \lambda / \sigma\right) _ {+}\right) = \frac {2}{\sigma} \operatorname {s i g n} \left(\widehat {f} _ {\{i \}}\right) \left(\left| \widehat {f} _ {\{i \}} \right| - \lambda / \sigma\right) _ {+} \tag {6} +$$ + +where $z_{+} = z\mathbb{1}_{z > 0}$ is the standard ReLU operation. + +Proof. For all three parts, we will study the problem in the Fourier basis corresponding to the distribution $\mathcal{B}_p$ and the proof works for every $p\in (0,1)$ . Since $\{\phi_S\}_{S\subseteq [N]}$ is an orthonormal basis for the inner product space with $\langle f,g\rangle_{\mathcal{B}_p} = \underset {x\sim \mathcal{B}_p}{\mathbb{E}}[f(x)g(x)]$ , we can rewrite $\mathcal{R}(\theta)$ as follows + +$$ +\begin{array}{l} \mathcal {R} (\theta) := \mathbb {E} _ {x \sim \mathcal {B} _ {p}} \left(f (x) - \theta_ {0} - \sum_ {i} \theta_ {i} \bar {x} _ {i}\right) ^ {2} = ^ {(i)} \mathbb {E} _ {x \sim \mathcal {B} _ {p}} \left(f (x) - \bar {\theta} _ {0} - \sum_ {i} \bar {\theta} _ {i} \phi_ {\{i \}} (x)\right) ^ {2} (15) \\ = ^ {(i i)} \left\| f - \bar {\theta} _ {0} - \sum_ {i} \bar {\theta} _ {i} \phi_ {\{i \}} \right\| _ {\mathcal {B} _ {p}} ^ {2}, \text {w h e r e} \| g \| _ {\mathcal {B} _ {p}} := \langle g, g \rangle_ {\mathcal {B} _ {p}} = \mathbb {E} _ {x \sim \mathcal {B} _ {p}} [ g (x) ^ {2} ] (16) \\ \text {a n d} \bar {\theta} _ {i} = \frac {\sigma}{2} \theta_ {i}, \bar {\theta} _ {0} = \theta_ {0} + \frac {(\mu + 1)}{2} \sum_ {i} \theta_ {i} (17) \\ \end{array} +$$ + +The first equality (i) follows by observing that $x_{i} = 2\bar{x}_{i} - 1$ and that $\phi_{\{i\}}(x) = (x_i - \mu) / \sigma$ . Step (ii) follows by applying the definition of $\| g\|_{\mathcal{B}_p}$ to the function $g = f - \bar{\theta}_0 - \sum_i\bar{\theta}_i\phi_{\{i\}}$ . + +We can further simplify Equation (16) as follows: + +$$ +\begin{array}{l} \mathcal {R} (\theta) = \left\| f - \bar {\theta} _ {0} - \sum_ {i} \bar {\theta} _ {i} \phi_ {\{i \}} \right\| _ {\mathcal {B} _ {p}} ^ {2} = \left\| \widehat {f} _ {\emptyset} - \bar {\theta} _ {0} + \sum_ {S: | S | = 1} \left(\widehat {f} _ {S} - \bar {\theta} _ {i}\right) \phi_ {S} + \sum_ {S: | S | \geq 2} \widehat {f} _ {S} \phi_ {S} \right\| _ {\mathcal {B} _ {p}} ^ {2} (18) \\ = ^ {(i)} \left(\bar {\theta} _ {0} - \widehat {f} _ {\emptyset}\right) ^ {2} + \sum_ {i = 1} ^ {N} \left(\bar {\theta} _ {i} - \widehat {f} _ {\{i \}}\right) ^ {2} + \sum_ {S: | S | \geq 2} \widehat {f} _ {S} ^ {2} (19) \\ \end{array} +$$ + +where $(i)$ uses orthonormality of $\{\phi_S\}_{S\subseteq [N]}$ and Parseval's theorem (O'Donnell, 2014). With this expression for $\mathcal{R}(\theta)$ , we are now ready to prove the main results. + +Proof for (a): From Equation (19), it is evident that the minimizer for the unregularized objective will satisfy $\hat{\theta}_0^\star = \widehat{f}_{\emptyset}$ and $\bar{\theta}_i^\star = \widehat{f}_{\{i\}}$ for $i \in [N]$ . Plugging this into Equation (17) yields the desired expressions for $\theta^\star$ . Furthermore, the residual for this optimal $\theta^\star$ is $\sum_{S:|S| \geq 2} \widehat{f}_S^2$ . + +Proof for (b): The $\ell_2$ regularized objective can be written as follows: + +$$ +\mathcal {R} (\theta) + \lambda \| \theta_ {1: N} \| _ {2} ^ {2} = \mathcal {R} (\theta) + \lambda \sum_ {i = 1} ^ {N} \theta_ {i} ^ {2} = ^ {(i)} \mathcal {R} (\theta) + \frac {4 \lambda}{\sigma^ {2}} \sum_ {i = 1} ^ {N} \bar {\theta} _ {i} ^ {2} \tag {20} +$$ + +where $(i)$ follows from Equation (17). Combining this with Equation (19), we observe that minimization w.r.t. $\bar{\theta}_i$ can be done independently of each other. Thus $\bar{\theta}_i^\star = \arg \min_{\bar{\theta}_i}\left(\bar{\theta}_i - \widehat{f}_{\{i\}}\right)^2 + \frac{4\lambda}{\sigma^2}\bar{\theta}_i^2 = \left(1 + \frac{4\lambda}{\sigma^2}\right)^{-1}\widehat{f}_{\{i\}}$ . Plugging this into Equation (17) gives the desired expression for $\theta^\star$ . + +Proof for (c): The $\ell_1$ regularized objective can be written as follows: + +$$ +\mathcal {R} (\theta) + \lambda \| \theta_ {1: N} \| ^ {1} = \mathcal {R} (\theta) + \lambda \sum_ {i = 1} ^ {N} | \theta_ {i} | = ^ {(i)} \mathcal {R} (\theta) + \frac {2 \lambda}{\sigma} \sum_ {i = 1} ^ {N} | \bar {\theta} _ {i} | \tag {21} +$$ + +Again the minimization w.r.t. $\bar{\theta}_i$ can be done independently: $\bar{\theta}_i^\star = \arg \min_{\bar{\theta}_i} \left( \bar{\theta}_i - \widehat{f}_{\{i\}} \right)^2 + \frac{2\lambda}{\sigma} |\bar{\theta}_i| = \left( \widehat{f}_{\{i\}} - \lambda / \sigma \right)_+ - \left( -\widehat{f}_{\{i\}} - \lambda / \sigma \right)_+$ . Plugging this into Equation (17) gives the desired expression for $\theta^\star$ . + +# B.2 PROOFS FOR SECTION 3 + +# We recall Theorem 3.1 + +Theorem 3.1. The quality of the best linear approximation to $f$ can be bounded in terms of the normalized noise stability $\bar{h}$ as + +$$ +\text {(N o r m a l i z e d r e s i d u a l)} \frac {\sum_ {S : | S | \geq 2} \widehat {f} _ {S} ^ {2}}{\sum_ {S} \widehat {f} _ {S} ^ {2}} \leq \frac {1 - \bar {h} (\rho)}{1 - \rho^ {2}}. \tag {8} +$$ + +Proof. We first note that $\bar{h} (\rho) = h(\rho) / h(1)$ since $\mathbb{E}[f(x)^2 ]$ is the noise stability when $x^{\prime} = x$ which happens at $\rho = 1$ . Let $B_{k} = \sum_{S:|S| = k}\widehat{f}_{S}^{2}$ . From Equation (7) we get + +$$ +\bar {h} (\rho) = \frac {\sum_ {S} \rho^ {| S |} \widehat {f} _ {S} ^ {2}}{\sum_ {S} \widehat {f} _ {S} ^ {2}} = \frac {\sum_ {k} \rho^ {k} B _ {k}}{\sum_ {k} B _ {k}} \leq \frac {B _ {0} + B _ {1} + \rho^ {2} \sum_ {k \geq 2} B _ {k}}{\sum_ {k} B _ {k}} +$$ + +Let $B = \sum_{S} \widehat{f}_S^2 = \sum_{k} \widehat{f}_k^2$ and $B_{\geq 2} = \sum_{S:|S| \geq 2} \widehat{f}_S^2 = \sum_{k \geq 2} \widehat{f}_k^2$ . Then we get, + +$$ +\bar {h} (\rho) \leq \frac {(B - B _ {\geq 2}) + \rho^ {2} B _ {\geq 2}}{B} = 1 - (1 - \rho^ {2}) \frac {B _ {\geq 2}}{B} \Rightarrow \frac {B _ {\geq 2}}{B} \leq \frac {1 - \bar {h} (\rho)}{1 - \rho^ {2}} +$$ + +This completes the proof. + +![](images/28da49693013024454233891184710084d8e5b7e1da6303baa1e5ca148f768ff.jpg) + +Lemma B.1. For a function $f$ and $\rho \in [0,1]$ and evaluation budget $n$ , let $\hat{h}(\rho) = \text{NOISESTABILITY}(f, n, \rho)$ be the noise stability estimate from Algorithm 1. If $|f(x)| \leq C$ for every $x$ , then with probability at least $1 - \eta$ , the error in the estimate can be upper bounded by + +$$ +\left| \hat {h} (\rho) - h (\rho) \right| \leq \delta (n) = \mathcal {O} \left(\sqrt {C ^ {2} \log (1 / \eta) / n}\right) \tag {22} +$$ + +Proof. The proof follows from a straightforward application of Hoeffding's inequality. Note that $\hat{h} (\rho) = \frac{2}{n}\sum_{i = 1}^{n / 2}[f(x^{(i)})f(x^{\prime (i)})]$ is a sum of $n / 2$ i.i.d. variables that are all in the range $[-C^2,C^2 ]$ . Additionally since $\mathbb{E}[\hat{h} (\rho)] = h(\rho)$ , Hoeffding's inequality gives us + +$$ +P \left(\left| \hat {h} (\rho) - h (\rho) \right| \geq \delta\right) \leq 2 e ^ {- \frac {\delta^ {2} n}{C ^ {2}}}. \tag {23} +$$ + +Setting $\delta = \sqrt{C^2\log(2 / \eta) / n}$ makes this probability at most $\eta$ , thus completing the proof. + +![](images/079e19e982fbf1212288a0dc5f1bc287d115e70d12ecd36937f6ee301b23b2ab.jpg) + +We now prove Theorem 3.2. Recall the statement: + +Theorem 3.2. Let $\hat{B}_{\geq 2} = \mathrm{RESIDUALESTIMATION}(f,n,[0,\rho,2\rho],2)$ be the estimated residual (see Algorithm 1) after fitting a degree 2 polynomial to noise stability estimates at $0,\rho,2\rho$ , using $n$ calls to $f$ . If $n = \mathcal{O}(1 / \epsilon^3)$ and $\rho = \sqrt{\epsilon}$ , then with high probability we have that $|\hat{B}_{\geq 2} - B_{\geq 2}| \leq \epsilon$ . + +Proof. Using standard concentration inequalities, Lemma B.1 shows that the estimations are close enough to the true values with high probability, i.e. $\pmb{y}_i = \hat{h}(\rho_i) = h(\rho_i) + \delta_i$ where $|\delta_i| \leq \delta$ where $\delta := \delta(n/k) = \mathcal{O}\left(\sqrt{k/n}\right)$ from Lemma B.1. Let $\hat{\pmb{z}}$ be the solution to Algorithm 1 and let $z^{\star} = [B_j]_{j=0}^d$ be the "true" coefficients up to degree $d$ . Since $\hat{\pmb{z}}$ minimizes $\| \pmb{A}\pmb{z} - \pmb{y} \|^2$ and $z^{\star}$ is also a valid solution, we have + +$$ +\left\| \boldsymbol {A} \hat {\boldsymbol {z}} - \boldsymbol {y} \right\| ^ {2} \leq \left\| \boldsymbol {A} \boldsymbol {z} ^ {\star} - \boldsymbol {y} \right\| ^ {2} \tag {24} +$$ + +Furthermore, we note the following about $A z^{\star}$ : + +$$ +\left(\boldsymbol {A} \boldsymbol {z} ^ {\star}\right) _ {i} = \sum_ {j = 0} ^ {d} B _ {j} \rho_ {i} ^ {j} = h \left(\rho_ {i}\right) - \sum_ {j > d} B _ {j} \rho^ {i} \in \left[ h \left(\rho_ {i}\right) - B _ {> d} \rho_ {i} ^ {d + 1}, h \left(\rho_ {i}\right) \right] \tag {25} +$$ + +We can upper bound $\| A z^{\star} - y\|^{2}$ by observing that + +$$ +\left| \left(\boldsymbol {A} \boldsymbol {z} ^ {\star}\right) _ {i} - \boldsymbol {y} _ {i} \right| \leq \left| \delta_ {i} \right| + B _ {> d} \rho_ {i} ^ {d + 1} \leq \delta + B _ {> d} \rho_ {i} ^ {d + 1} \tag {26} +$$ + +$$ +\left\| \boldsymbol {A} \boldsymbol {z} ^ {\star} - \boldsymbol {y} \right\| ^ {2} \leq k \left(\delta + B _ {> d} \rho_ {i} ^ {d + 1}\right) ^ {2} \tag {27} +$$ + +Using these, we measure the closeness of $\hat{z}$ to $z^{\star}$ as follows: + +$$ +\left\| \boldsymbol {A} \boldsymbol {z} ^ {\star} - \boldsymbol {A} \hat {\boldsymbol {z}} \right\| ^ {2} \leq 2 \left(\left\| \boldsymbol {A} \boldsymbol {z} ^ {\star} - \boldsymbol {y} \right\| ^ {2} + \left\| \boldsymbol {A} \hat {\boldsymbol {z}} - \boldsymbol {y} \right\| ^ {2}\right) \leq 4 \left\| \boldsymbol {A} \boldsymbol {z} ^ {\star} - \boldsymbol {y} \right\| ^ {2} \tag {28} +$$ + +where the first inequality follows from triangle inequality and Cauchy-Schwarz inequality, and the last inequality follows from Equation (24). + +A naive upper bound for $\| z^{\star} - \hat{z}\|$ is $\lambda_{\min}(A)^{-1}\| Az^{\star} - A\hat{z}\|$ . However this turns out to be quite a large and suboptimal upper bound. Since Algorithm 1 only returns $\hat{z}_1$ and $\hat{z}_2$ , corresponding to estimates of $B_0$ and $B_1$ , we only need to upper bound $|\hat{z}_i - z_i^\star|$ for $i \in [2]$ . + +We now analyze the special case of $k = 3$ , $d = 2$ , $\rho_1 = 0$ , $\rho_2 = \rho$ , $\rho_3 = 2\rho$ . Here we have $A = \left( \begin{array}{ccc} 1 & 0 & 0 \\ 1 & \rho & \rho^2 \\ 1 & 2\rho & 4\rho^2 \end{array} \right)$ . Let $\Delta = z^{\star} - \hat{z}$ . Firstly note that $(A\Delta)_1 = \Delta_1$ and so $|\Delta_1| \leq \| A\Delta \|$ . To upper bound $\Delta_2$ , we note that + +$$ +\boldsymbol {A} \Delta = \Delta_ {2} \left( \begin{array}{c} 0 \\ \rho \\ 2 \rho \end{array} \right) + \left( \begin{array}{l l} 1 & 0 \\ 1 & \rho^ {2} \\ 1 & 4 \rho^ {2} \end{array} \right) \left( \begin{array}{c} \Delta_ {1} \\ \Delta_ {3} \end{array} \right) = \rho \Delta_ {2} \underbrace {\left( \begin{array}{l} 0 \\ 1 \\ 2 \end{array} \right)} _ {\boldsymbol {v}} + \underbrace {\left( \begin{array}{l l} 1 & 0 \\ 1 & 1 \\ 1 & 4 \end{array} \right)} _ {\boldsymbol {B}} \underbrace {\left( \begin{array}{c} \Delta_ {1} \\ \rho^ {2} \Delta_ {3} \end{array} \right)} _ {\boldsymbol {u}} \tag {29} +$$ + +$$ +\left\| \boldsymbol {A} \Delta \right\| = \left\| \rho \Delta_ {2} \boldsymbol {v} + \boldsymbol {B} \boldsymbol {u} \right\| \geq \min _ {\boldsymbol {w}} \left\| \rho \Delta_ {2} \boldsymbol {v} + \boldsymbol {B} \boldsymbol {w} \right\| = \rho | \Delta_ {2} | \| (I - \boldsymbol {B} ^ {\dagger} \boldsymbol {B}) \boldsymbol {v} \| \geq 0. 3 9 \rho | \Delta_ {2} | \tag {30} +$$ + +where the last inequality follows from numeric calculation of the norm, and the last inequality follows from the fact that the minimum $\ell_2$ can be obtained by finding the residual after projecting onto $\pmb{B}$ . Thus $|\hat{\pmb{z}}_1 - B_0| = |\Delta_1| \leq \| \pmb{A} \Delta\|$ and $|\hat{\pmb{z}}_2 - B_1| = |\Delta_1| \leq \| \pmb{A} \Delta\| / (0.39\rho)$ . + +Combining Equations (27), (28) and (30), we get that + +$$ +\left| \hat {z} _ {1} - B _ {0} \right| \text {a n d} \left| \hat {z} _ {2} - B _ {1} \right| \leq \mathcal {O} \left(\frac {\delta + B _ {\geq 3} \rho^ {3}}{\rho}\right) = \mathcal {O} \left(\frac {\delta}{\rho} + B _ {\geq 3} \rho^ {2}\right) \tag {31} +$$ + +Picking the optimal value of $\rho = \Theta\left((\delta / B_{\geq 3})^{1/3}\right) = \mathcal{O}\left(n^{-1/6} B_{\geq 3}^{-1/3}\right)$ , and using the fact that $\hat{B}_{\geq 2} = \hat{h}(1) - \hat{z}_1 - \hat{z}_2$ we get + +$$ +B _ {\geq 2} = h (1) - B _ {0} - B _ {1} = \hat {B} _ {\geq 2} + \mathcal {O} \left(\delta^ {2 / 3} B _ {\geq 3} ^ {1 / 3}\right) = \tilde {\mathcal {O}} \left(\left(\frac {B _ {\geq 3}}{n}\right) ^ {1 / 3}\right) \tag {32} +$$ + +Thus to achieve an $\epsilon$ approximation, we need $\rho = \Theta (\sqrt{\epsilon})$ and $n = \Omega (B_{\geq 3} / \epsilon^3)$ , which completes the proof. + +![](images/ae7efbfae0fed06dc2c1f7de98dccf4e6eed958ea639061229eb1e479a339d2c.jpg) + +# B.3 PROOFS FOR SECTION 4 + +We recall Theorem 4.1 + +Theorem 4.1. [Group influence] The following are true about group influence of deletion. + +$$ +\begin{array}{l} \operatorname {I n f} _ {I} (f) := \mathbb {E} _ {x \sim \mathcal {B} _ {p}} [ f (x) - f (x | _ {I \rightarrow - 1}) ] = p \sum_ {i \in I} \theta^ {\star} - \sum_ {I ^ {\prime} \subseteq I, | I ^ {\prime} | \geq 2} (- 1) ^ {| I ^ {\prime} |} \left(\frac {p}{1 - p}\right) ^ {| I ^ {\prime} | / 2} \widehat {f} _ {I ^ {\prime}} \\ = p \sum_ {i \in I} \operatorname {I n f} _ {i} (f) - \sum_ {I ^ {\prime} \subseteq I, | I ^ {\prime} | \geq 2} (- 1) ^ {| I ^ {\prime} |} \left(\frac {p}{1 - p}\right) ^ {| I ^ {\prime} | / 2} \widehat {f} _ {I ^ {\prime}} \\ \end{array} +$$ + +where $\theta^{\star}$ is the optimal datamodel (Equation (3)) and $Inf_{i}$ is an individual influence (Equation (1)). + +Proof. Recall that the function $f$ can be decomposed into the Fourier basis as $f(x) = \sum_{S \subseteq [N]} \widehat{f}_S \phi_S(x) = \sum_{S \subseteq [N]} \widehat{f}_S \prod_{i \in S} \frac{(x_i - \mu)}{\sigma}$ , where $\mu = 2p - 1$ and $\sigma = \sqrt{4p(1 - p)}$ . Thus setting $x_I$ to $-1$ will have the following effect: + +$$ +f (x | _ {I \rightarrow - 1}) = \sum_ {S \subseteq [ N ]} \widehat {f} _ {S} \left(\frac {- 1 - \mu}{\sigma}\right) ^ {| S \cap I |} \phi_ {S \setminus I} (x) = \sum_ {S \subseteq [ N ]} \widehat {f} _ {S} \left(\frac {- 2 p}{2 \sqrt {p (1 - p)}}\right) ^ {| S \cap I |} \phi_ {S \setminus I} (x) \tag {33} +$$ + +$$ +\begin{array}{l} = \sum_ {S \subseteq [ N ]} \widehat {f} _ {S} (- 1) ^ {| S \cap I |} \left(\frac {p}{1 - p}\right) ^ {| S \cap I | / 2} \phi_ {S \backslash I} (x) (34) \\ = ^ {(i)} \sum_ {S: S \cap I = \emptyset} \phi_ {S} (x) \sum_ {I ^ {\prime} \subseteq I} (- 1) ^ {| I ^ {\prime} |} \left(\frac {p}{1 - p}\right) ^ {| I ^ {\prime} | / 2} \widehat {f} _ {S \cup I ^ {\prime}} (35) \\ \end{array} +$$ + +where in step (i) we collect all terms that share the same $\phi_{S\setminus I}$ by relabeling $S\gets S\backslash I$ and $I^{\prime}\gets S\cap I$ . This proves the first part of the result. + +For the second part we first note that $\mathbb{E}_x[f(x)] = \widehat{f}_{\emptyset}$ . Secondly, the only term that remains in $\mathbb{E}_x[f(x|_{I\to -1})]$ is the constant term (i.e. coefficient of the basis function $\phi_{\emptyset}(x)$ ). From Equation (35), only the terms with $S = \emptyset$ remain. So, + +$$ +\begin{array}{l} \mathbb {E} _ {x} [ f (x) - f (x | _ {I \rightarrow - 1}) ] = \widehat {f} _ {\emptyset} - \sum_ {I ^ {\prime} \subseteq I} (- 1) ^ {| I ^ {\prime} |} \left(\frac {p}{1 - p}\right) ^ {| I ^ {\prime} | / 2} \widehat {f} _ {I ^ {\prime}} (36) \\ = ^ {(i)} \sum_ {i \in I} \sqrt {\frac {p}{1 - p}} \widehat {f} _ {\{i \}} - \sum_ {I ^ {\prime} \subseteq I, | I ^ {\prime} | \geq 2} (- 1) ^ {| I ^ {\prime} |} \left(\frac {p}{1 - p}\right) ^ {| I ^ {\prime} | / 2} \widehat {f} _ {I ^ {\prime}} (37) \\ = p \sum_ {i \in I} \frac {2}{\sigma} \widehat {f} _ {\{i \}} - \sum_ {I ^ {\prime} \subseteq I, | I ^ {\prime} | \geq 2} (- 1) ^ {| I ^ {\prime} |} \left(\frac {p}{1 - p}\right) ^ {| I ^ {\prime} | / 2} \widehat {f} _ {I ^ {\prime}} (38) \\ = ^ {(i i)} p \sum_ {i \in I} \theta_ {i} ^ {\star} - \sum_ {I ^ {\prime} \subseteq I, | I ^ {\prime} | \geq 2} (- 1) ^ {| I ^ {\prime} |} \left(\frac {p}{1 - p}\right) ^ {| I ^ {\prime} | / 2} \widehat {f} _ {I ^ {\prime}} (39) \\ = ^ {(i i i)} p \sum_ {i \in I} \operatorname {I n f} _ {i} (f) - \sum_ {I ^ {\prime} \subseteq I, | I ^ {\prime} | \geq 2} (- 1) ^ {| I ^ {\prime} |} \left(\frac {p}{1 - p}\right) ^ {| I ^ {\prime} | / 2} \widehat {f} _ {I ^ {\prime}} (40) \\ \end{array} +$$ + +where $(i)$ follows by separating out the size 0 and size $1I^{\prime}\mathrm{s}$ , $(ii)$ follows from Theorem 2.2 and $(iii)$ follows from Proposition 2.1. + +![](images/4108c326780406a2b9ed9fd49a9b20282406bf65f41c26a94fc3f7291a8d49ac.jpg) + +We now show an upper bound on the residual term from the previous result in terms of the residual of a linear datamodels. + +Lemma B.2. The residual term of group influence minus sum of individual influences from Theorem 4.1 can be upper bounded as follows: + +$$ +\left| \sum_ {I ^ {\prime} \subseteq I, | I ^ {\prime} | \geq 2} (- 1) ^ {| I ^ {\prime} |} \left(\frac {p}{1 - p}\right) ^ {| I ^ {\prime} | / 2} \widehat {f} _ {I ^ {\prime}} \right| < (1 - p) ^ {- | I | / 2} \sqrt {B _ {\geq 2}} \tag {41} +$$ + +where $B_{\geq 2}$ is the residual of the best linear datamodel as defined in Equation (4). + +Proof. We use Cauchy-Schwarz inequality to upper bound this residual. + +$$ +\begin{array}{l} \left(\sum_ {I ^ {\prime} \subseteq I, | I ^ {\prime} | \geq 2} (- 1) ^ {| I ^ {\prime} |} \left(\frac {p}{1 - p}\right) ^ {| I ^ {\prime} | / 2} \widehat {f} _ {I ^ {\prime}}\right) ^ {2} \leq \left(\sum_ {I ^ {\prime} \subseteq I, | I ^ {\prime} | \geq 2} \left(\frac {p}{1 - p}\right) ^ {| I ^ {\prime} |}\right) \left(\sum_ {I ^ {\prime} \subseteq I, | I ^ {\prime} | \geq 2} \widehat {f} _ {I ^ {\prime}} ^ {2}\right) (42) \\ < \left(\sum_ {I ^ {\prime} \subseteq I} \left(\frac {p}{1 - p}\right) ^ {| I ^ {\prime} |}\right) \left(\sum_ {I ^ {\prime} \subseteq [ N ], | I ^ {\prime} | \geq 2} \widehat {f} _ {I ^ {\prime}} ^ {2}\right) (43) \\ = \left(1 + \frac {p}{1 - p}\right) ^ {| I |} B _ {\geq 2} = (1 - p) ^ {- | I |} B _ {\geq 2} (44) \\ \end{array} +$$ + +This completes the proof. + +We now prove the exponential blow up in group influence from Lemma 4.2 (restated below). + +Lemma 4.2. Consider the function $f$ from Example 1 with $\beta = 0.5$ and $\alpha \to \infty$ ; so $f(x) = \mathbb{1}\{avg(x_A) > 0.5\}$ . If $x$ is $p$ -biased with $p > 0.5$ , then for any constant fraction subset $A' \subseteq A$ , its group influence is exponentially larger than sum of individual influences. + +$$ +\operatorname {I n f} _ {A ^ {\prime}} (f) \geq \frac {(2 (1 - p)) ^ {- | A ^ {\prime} | + 1}}{| A ^ {\prime} |} \left(\sum_ {i \in A ^ {\prime}} \operatorname {I n f} _ {i} (f)\right). \tag {9} +$$ + +Proof. Let $M = |A|$ and suppose $|A'| = \gamma |A|$ for a small constant $\gamma$ . We study $\operatorname{Inf}_{A'}(f)$ using its definition and for a general $\beta \in (0,1)$ . The function of interest is $f(x) = \mathbb{1}\{\mathrm{avg}(x_A) > \beta\}$ . Let $B(n,q)$ denote the binomial r.v. that is a sum of $n$ independent Bernoulli's with parameter $q$ . We first note that we can rewrite the expected value of $f$ as follows: + +$$ +\mathbb {E} _ {x} [ f (x) ] = \Pr (B (M, p) > \beta M) \tag {45} +$$ + +This is because the only times $f(x)$ is 1 is when at least $\beta$ fraction of indices in $A$ are 1, which is precisely capture by the Binomial distribution tail probability. Similarly, we can argue that + +$$ +\mathbb {E} _ {x} [ f (x | _ {A ^ {\prime} \rightarrow - 1}) ] = \Pr (B (M (1 - \gamma), p) > \beta M) \tag {46} +$$ + +The group influence can be calculated as follows: + +$$ +\begin{array}{l} \operatorname {I n f} _ {A ^ {\prime}} (f) = \mathbb {E} _ {x} [ f (x) ] - \mathbb {E} _ {x} [ f (x | _ {A ^ {\prime} \rightarrow - 1}) ] (47) \\ = \Pr (B (M, p) > \beta M) - \Pr (B (M (1 - \gamma), p) > \beta M) (48) \\ = \Pr (B (M (1 - \gamma), p) \leq \beta M) - \Pr (B (M, p) \leq \beta M) (49) \\ = \sum_ {\beta^ {\prime} \in \left[ \frac {1}{M}, \frac {2}{M}, \dots \beta \right]} \binom {M (1 - \gamma)} {\beta^ {\prime} M} p ^ {\beta^ {\prime} M} (1 - p) ^ {M (1 - \gamma - \beta^ {\prime})} (50) \\ - \sum_ {\beta^ {\prime} \in \left[ \frac {1}{M}, \frac {2}{M}, \dots \beta \right]} \binom {M} {\beta^ {\prime} M} p ^ {\beta^ {\prime} M} (1 - p) ^ {M \left(1 - \beta^ {\prime}\right)} (51) \\ \end{array} +$$ + +Define $c_{\beta}(\gamma) = \binom{M(1 - \gamma)}{\beta M} p^{\beta M} (1 - p)^{M(1 - \gamma - \beta)}$ . The above expression reduces to + +$$ +\operatorname {I n f} _ {A ^ {\prime}} (f) = \sum_ {\beta^ {\prime} \in \left[ \frac {1}{M}, \frac {2}{M}, \dots , \beta \right]} \left(c _ {\beta^ {\prime}} (\gamma) - c _ {\beta^ {\prime}} (0)\right). \tag {52} +$$ + +Note that individual influences $\operatorname{Inf}_i(f)$ corresponds sets of size $|A'| = 1$ , i.e. $\gamma = 1 / M$ . So, + +$$ +\operatorname {I n f} _ {i} (f) = \sum_ {\beta^ {\prime} \in \left[ \frac {1}{M}, \frac {2}{M}, \dots \beta \right]} \left(c _ {\beta^ {\prime}} \left(1 / M\right) - c _ {\beta^ {\prime}} (0)\right). \tag {53} +$$ + +We study the quantity $c_{\beta}(\gamma)$ in more detail. In particular, we use Stirling's approximation for binomial coefficients $\log_2\binom{n}{qn}\approx nH(q)$ , where $H(q) = -q\log_2q - (1 - q)\log_2(1 - q)$ is the entropy function. This gives a cleaner expression for $\log_2(c_{\beta}(\gamma))$ . + +$$ +\begin{array}{l} \log_ {2} \left(c _ {\beta} (\gamma)\right) = \log_ {2} \binom {M (1 - \gamma)} {\beta M} + \beta M \log_ {2} (p) + (1 - \beta - \gamma) \log_ {2} (1 - p) (54) \\ = M (1 - \gamma) H \left(\frac {\beta}{1 - \gamma}\right) + M \beta \log_ {2} (p) + M (1 - \beta - \gamma) \log_ {2} (1 - p) (55) \\ \end{array} +$$ + +For a small $\gamma$ , we use a linear approximation for $\log_2(c_{\beta}(\gamma))$ at $\gamma = 0$ . The derivate is + +$$ +\frac {d}{d \gamma} \log_ {2} \left(c _ {\beta} (\gamma)\right) | _ {\gamma = 0} = M \left(\log_ {2} \left(\frac {1 - \beta}{\beta}\right) - H (\beta) - \log_ {2} (1 - p)\right) = g (\beta) \tag {56} +$$ + +where $g(\beta)$ is a decreasing function of $\beta$ . This gives us the approximation for $c_{\beta}(\gamma)$ + +$$ +\log_ {2} \left(c _ {\beta} (\gamma)\right) \approx \log_ {2} \left(c _ {\beta} (0)\right) + \gamma g (\beta) \tag {57} +$$ + +$$ +c _ {\beta} (\gamma) \approx c _ {\beta} (0) 2 ^ {\gamma g (\beta)} \tag {58} +$$ + +We note that for $\beta' \leq 0.5$ and $p > 1/2$ , $g(\beta') > 0$ and so $c_{\beta'}(\gamma)$ is an increasing function in $\gamma$ . For ratio of group to individual influence from Equations (52) and (53), we consider the following expression for $\beta' \leq \beta = 0.5$ : + +$$ +\begin{array}{l} \frac {c _ {\beta^ {\prime}} (\gamma) - c _ {\beta^ {\prime}} (0)}{c _ {\beta^ {\prime}} (1 / M) - c _ {\beta^ {\prime}} (0)} \geq \frac {c _ {\beta^ {\prime}} (\gamma)}{c _ {\beta^ {\prime}} (1 / M)} \approx 2 ^ {(\gamma - 1 / M) g (\beta^ {\prime})} \geq 2 ^ {(\gamma - 1 / M) g (0. 5)} (59) \\ = 2 ^ {(\gamma - 1 / M) M (- 1 - \log (1 - p))} = (2 (1 - p)) ^ {- \gamma M + 1} (60) \\ = (2 (1 - p)) ^ {- | A ^ {\prime} | + 1} (61) \\ \end{array} +$$ + +Plugging this back into Equations (52) and (53), we see that the terms for each $\beta^{\prime}$ in the summation are upper bounded by Equation (61). This gives + +$$ +\frac {\operatorname {I n f} _ {A ^ {\prime}} (f)}{\operatorname {I n f} _ {i} (f)} \geq (2 (1 - p)) ^ {- | A ^ {\prime} | + 1} \tag {62} +$$ + +Considering the total individual influences instead of just influence for just 1 point completes the proof. + +# C EXPERIMENTAL SETUP + +Experiments are conducted on the CIFAR-10 data to test the estimation procedure and the quality of the linear fit in Figures 1 and 2. We use the FFCV library Leclerc et al. (2022) to train models on CIFAR-10; each model takes $\sim 30$ s to train on our GPUs. We first pick a subset of $10\mathrm{k}$ images from the CIFAR-10 training dataset. Our models trained are then trained on sets of size 5000 (corresponding to $p = 0.5$ ), which achieve an average of $\sim 71\%$ accuracy on the CIFAR-10 test set. For the noise stability estimates from Algorithm 1, we sample 600 pairs of $\rho$ -correlated datasets $(x,x^{\prime})$ each for $\rho = 0.05, 0.1$ , and 0.2. We train 12,000 models for each setting of $\rho$ , where there are 600 distinct sets $x + 600$ distinct $\rho$ -correlated sets $x^{\prime}$ chosen and the remaining $10\times$ runs are due to running 10 random seeds per training set. We use the default ResNet based architecture in FFCV with a batch size of 512, an initial learning rate of 0.5, 24 epochs, weight decay of $5e - 4$ and SGD with momentum as the optimizer. + +For the experiment with residual estimation, we use the set of $\rho$ 's to be $[0, 0.1, 0.2, 1]$ for most experiments, $[0, 0.05, 0.1, 1]$ for Figure 2c and $[0, 0.1, 0.2]$ for Figure 4. Furthermore we use degree $d = 2$ in Algorithm 1 for most experiments and $d = 3$ for comparison in Figure 2b. Although the theoretical analysis in Theorem 3.2 does not use $\rho = 1$ for the polynomial fitting, we find experimentally that adding $\rho = 1$ gives more robust estimations. This is evident from the polynomial fits obtained for 20 randomly selected test examples in Figures 3 and 4, where the fits from $[0, 0.1, 0.2, 1]$ are clearly better than those from $[0, 0.1, 0.2]$ . The theory can also be extended for this case, with a slightly modified analysis. + +![](images/8968037b7391d8383be037128c1f320591c40e3a692fee285a9448b7922be4c1.jpg) + +![](images/c0c8dbdb677c7f592cd0de990b2516264281edd01eff3b4c9e0165df7a8954e8.jpg) + +![](images/9bcea6babc56121e8a86b3322aabf4e7fafe254ab22f25f0a8ae0437409c81fb.jpg) + +![](images/b0fb8efa88bc3ef41de7815ff90366ecd44467e1d5f078700ef0cb2f8aff9219.jpg) + +![](images/8b4821b381637040fef1e1382e12def46676c49e249dfb6efbff18458771e555.jpg) + +![](images/002c7222390fe6416a8dcfec5443357f29f023434cc9b999e17f422a235cff90.jpg) + +![](images/eabd6c005eb6e712a3d61213a7fe8d892700b41858e44558fdf7fb8d7ca82977.jpg) + +![](images/6aa5186d36274f5b9c5a89f948959fd30952d3f48ccd85d6671b00d2e6aa7685.jpg) + +![](images/115ac0cdc8a0bda90ee3323e5be6a3b6bcf2fd252c46650677ea598e4eb1ca91.jpg) + +![](images/865add01fefc66781bae97372e2a3e8f84472ad8868ebb454f4eb0ba7a2a43cf.jpg) + +![](images/a149c314d175621ab1df31e15ea75b0ab2d0f2fa7cac435e40a5335999702ad5.jpg) + +![](images/78251963db981712ca853e455a9976affc99da3cbc7a0d68b4a40a2f0bdcd17f.jpg) + +![](images/f3808d458833261644c217876383bd86033315b2690a8559c136032591d6a8a6.jpg) + +![](images/543651390d06fbac1a62942578631345a02815e4fe34727f54f77247445f6d13.jpg) + +![](images/44f9275b41dfcfdce6895789e60289336cdb79c46c2c5bbf5494a91ac22cf698.jpg) + +![](images/71a1652c1fa014a8e75225d7ff15d881711ec7c8eca5f85ef50ba0e089345c4c.jpg) + +![](images/5ea618f28bb12646bac3fb97f0fd0e39f7d77546fc55ce05b4b7b37136bf429b.jpg) +Figure 3: Noise stability estimates plotted for 20 randomly sampled test examples. For each example (corresponding to a plot), we plot the estimated $\hat{h}(\rho)$ in blue dots and the best degree $d \in \{1,2,3\}$ (black, red and blue curves respectively) polynomial fits obtained from Algorithm 1 for the list of $\rho$ s being $[0,0.1,0.2,1]$ . The test examples are rearranged such that the first 4 rows contain points with $\min_{\rho} \hat{h}(\rho) > 0.7$ and the y-axis range is set to $[0.6,1]$ for clarity of presentation. The y-axis range for the last row is set to $[0,1]$ . The estimated residual from Algorithm 1 is precisely equal to one minus the sum of the constant and degree-1 coefficients. + +![](images/6f2a6c61522fb6fdcec0f0ad015b65d53f2bc86ebd8dc1b20f5fad7414cdb6df.jpg) + +![](images/a0522d02c70d237d407d99a95b9a33b3611d8ac1145d9ce8649d0973bd57c520.jpg) + +![](images/1d93389e310774685e98ab52c2725c3a06ba3842dd030ab7841ed8aa72e598f7.jpg) + +![](images/81b18722175e30126c2e0a75592dd4ca8ae08eb1d3faf2c6e01527746fa6d434.jpg) + +![](images/28d4a0fde51a38f2c641323dad63b3afaefb7e1b9c5f64c861af6c83a58cb8b3.jpg) + +![](images/a64a218be6ceba8031845711e365b55f7d745cc1481350e861b22b172e7ac46d.jpg) + +![](images/3cc014a77a7de77b6518d994985de258b85d4ed405143b1514c94ee1a3992b05.jpg) + +![](images/7ea34017b27662f4acdb7ea41bdfee2910ecb722be4cda6624ae5f84123195a2.jpg) + +![](images/ee2d2c90b7fbab813184152c483f566d4f9b4dc99647ca00af43512cd87faab4.jpg) + +![](images/59f13d78bbb3d01bfcbba021367872412f9e6d19de537a752b03e2e246c40d19.jpg) + +![](images/ca992d24d57e650f833dbbf688131fee5a69eb8a58297d37bffb7d7aed687767.jpg) + +![](images/ad1673fc0dafc7e4d2e2208d5cf84a323a091702c043bcec6e26a107aadd2bfc.jpg) + +![](images/b79bc8347cf1a21af313ecd2d7fe7612d4c4f4dad7a3ec2979c39a0560678450.jpg) + +![](images/6aff655e0d2a2330aa950a20d390845868d9227ea3cffd579307d4d5ac21ae57.jpg) + +![](images/3889a38788e1261b5b5bd3d8b8bd37bbe18f9b4a9532d7a4a76b4f2851c5be7e.jpg) + +![](images/a696c1cbf71b86eb8c8154b8a53cad97b9bef1e247c9aeb07d37eea81115c8ae.jpg) + +![](images/92e52912030b50e03bba9cd43439f3aa1ec2b01367380426d79d59779c74b7ba.jpg) + +![](images/26d05afa1b979a8a4750f797e331296bb060462fb67d6779590cf22a0dac6fe5.jpg) + +![](images/7c4f72e4fac1a2ed2bd5af9823e4937370dd2d6b0d3b39485e0306b00631cc31.jpg) + +![](images/58e969426f233c0a3915c7a0f5e4d21d0b499703c2d88bd896e48f58b6860470.jpg) +Figure 4: Noise stability estimates plotted for 20 randomly sampled test examples. For each example (corresponding to a plot), we plot the estimated $\hat{h}(\rho)$ in blue dots and the best degree $d \in \{1, 2, 3\}$ (black, red and blue curves respectively) polynomial fits obtained from Algorithm 1 for the list of $\rho$ ’s being $[0, 0.1, 0.2]$ . The test examples are rearranged such that the first 4 rows contain points with $\min_{\rho} \hat{h}(\rho) > 0.7$ and the y-axis range is set to $[0.6, 1]$ for clarity of presentation. The y-axis range for the last row is set to $[0, 1]$ . The estimated residual from Algorithm 1 is precisely equal to one minus the sum of the constant and degree-1 coefficients. + +![](images/ffb71613508e4293b0d1e9e6f222a10089d1dea35c8f2270d5891957fba06947.jpg) + +![](images/d70f21fcbd589834ca9757f935191850144cbfc2d7c6d9f1dcd93b23d66d0d7d.jpg) + +![](images/0728324f8d3be8fe967d3493c9b981ab2cdd94194207c05faa20797e10a50b67.jpg) \ No newline at end of file diff --git a/understandinginfluencefunctionsanddatamodelsviaharmonicanalysis/images.zip b/understandinginfluencefunctionsanddatamodelsviaharmonicanalysis/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..0639e411921645b58d16544d237c81f27a98b39c --- /dev/null +++ b/understandinginfluencefunctionsanddatamodelsviaharmonicanalysis/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c78457eb04ffc14d63fe733a7e2b30d3bdf6f3941df1ee5767dc6e3e4c536612 +size 999537 diff --git a/understandinginfluencefunctionsanddatamodelsviaharmonicanalysis/layout.json b/understandinginfluencefunctionsanddatamodelsviaharmonicanalysis/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..6cf9157d3593c9ee758f5e272b1dfa586aea0e84 --- /dev/null +++ b/understandinginfluencefunctionsanddatamodelsviaharmonicanalysis/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad97acd5306143a1d03a5daee300ea0cda0895486170f04847877d37e7496a63 +size 1109666 diff --git a/understandingneuralcodingonlatentmanifoldsbysharingfeaturesanddividingensembles/fc1bf7c9-04bb-402f-8d39-f28fc5230907_content_list.json b/understandingneuralcodingonlatentmanifoldsbysharingfeaturesanddividingensembles/fc1bf7c9-04bb-402f-8d39-f28fc5230907_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..4875e2e586f431baf42438b74091cef005dc6e9b --- /dev/null +++ b/understandingneuralcodingonlatentmanifoldsbysharingfeaturesanddividingensembles/fc1bf7c9-04bb-402f-8d39-f28fc5230907_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a57306bd51f7ee7af72c0892c7ce30371f3d2b441071031bd0cdd6f0e7688c86 +size 144492 diff --git a/understandingneuralcodingonlatentmanifoldsbysharingfeaturesanddividingensembles/fc1bf7c9-04bb-402f-8d39-f28fc5230907_model.json b/understandingneuralcodingonlatentmanifoldsbysharingfeaturesanddividingensembles/fc1bf7c9-04bb-402f-8d39-f28fc5230907_model.json new file mode 100644 index 0000000000000000000000000000000000000000..5da13f232c9010c1de26cb757fe5b3f4619f24cb --- /dev/null +++ b/understandingneuralcodingonlatentmanifoldsbysharingfeaturesanddividingensembles/fc1bf7c9-04bb-402f-8d39-f28fc5230907_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6c598c06970ae4a10427f8fb6dd884f291d9c2da7c5ea611018b1772132bead +size 175136 diff --git a/understandingneuralcodingonlatentmanifoldsbysharingfeaturesanddividingensembles/fc1bf7c9-04bb-402f-8d39-f28fc5230907_origin.pdf b/understandingneuralcodingonlatentmanifoldsbysharingfeaturesanddividingensembles/fc1bf7c9-04bb-402f-8d39-f28fc5230907_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8ba83c2362fa74d587038c6dd9fafa255a285501 --- /dev/null +++ b/understandingneuralcodingonlatentmanifoldsbysharingfeaturesanddividingensembles/fc1bf7c9-04bb-402f-8d39-f28fc5230907_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cfeafc85851d51f70320a11e972397d41b6ed582804e4ec62554b35ff1d5fe9a +size 23244453 diff --git a/understandingneuralcodingonlatentmanifoldsbysharingfeaturesanddividingensembles/full.md b/understandingneuralcodingonlatentmanifoldsbysharingfeaturesanddividingensembles/full.md new file mode 100644 index 0000000000000000000000000000000000000000..d6e60eb4378fe3b098ad48caa8d673d577635ee0 --- /dev/null +++ b/understandingneuralcodingonlatentmanifoldsbysharingfeaturesanddividingensembles/full.md @@ -0,0 +1,512 @@ +# UNDERSTANDING NEURAL CODING ON LATENT MANIFOLDS BY SHARING FEATURES AND DIVIDING ENSEMBLES + +Martin Bjerke1, Lukas Schott2, Kristopher T. Jensen3, Claudia Battistin1, David A. Klindt**, 1, Benjamin A. Dunn**, 1 + +$^{1}$ Norwegian University of Science and Technology, $^{2}$ Bosch Center for Artificial Intelligence, $^{3}$ University of Cambridge, *Equal contribution {martin.bjerke, benjamin.dunn}@ntnu.no, klindt.david@gmail.com + +# ABSTRACT + +Systems neuroscience relies on two complementary views of neural data, characterized by single neuron tuning curves and analysis of population activity. These two perspectives combine elegantly in neural latent variable models that constrain the relationship between latent variables and neural activity, modeled by simple tuning curve functions. This has recently been demonstrated using Gaussian processes, with applications to realistic and topologically relevant latent manifolds. Those and previous models, however, missed crucial shared coding properties of neural populations. We propose feature sharing across neural tuning curves which significantly improves performance and helps optimization. We also propose a solution to the ensemble detection problem, where different groups of neurons, i.e., ensembles, can be modulated by different latent manifolds. Achieved through a soft clustering of neurons during training, this allows for the separation of mixed neural populations in an unsupervised manner. These innovations lead to more interpretable models of neural population activity that train well and perform better even on mixtures of complex latent manifolds. Finally, we apply our method on a recently published grid cell dataset, and recover distinct ensembles, infer toroidal latents and predict neural tuning curves in a single integrated modeling framework. + +# 1 INTRODUCTION + +Neural population activity can appear high-dimensional (Stringer et al., 2019), yet much recent work has reported that neural populations in higher brain areas are often confined to low dimensional subspaces (Yu et al., 2008; Harvey et al., 2012; Mante et al., 2013; Stokes et al., 2013; Shenoy et al., 2013; Kaufman et al., 2014; Sadtler et al., 2014; Gallego et al., 2017; Elsayed & Cunningham, 2017; Gao et al., 2017). The bread and butter of classic systems neuroscience is linking neural activity to experimentally controlled or observable covariates such as orientation (Hubel & Wiesel, 1979), pitch (Lewicki, 2002), movement (Churchland et al., 2012; Kao et al., 2015), posture (Mimica et al., 2018) and orientation in space (Taube et al., 1990). These two parallel streams of neuroscientific research might at first seem to be at odds with each other (Kriegeskorte & Wei, 2021); tuning studies of individual neurons give a very different picture of neural coding than distributed representations over high-dimensional neural populations. However, they combine elegantly in the form of (neural) latent variable models (LVMs, see Lawrence, 2003; Yu et al., 2008; Pandarinath et al., 2018). + +In their basic form, neural LVMs find the low-dimensional structure of neural population activity, for instance, when a large network of neurons is coding mostly along few linear subspaces (Mante et al., 2013; Gao et al., 2017). One advantage is that these models can help us discover latent variables which may not be tracked as classical covariates in systems neuroscience. However, when the mapping from latent variables to predicted spike rate (decoding) is fully unconstrained, e.g., by using a multi-layer neural network, we lose the simple biological interpretation of tuning curves. + +In an effort to maintain a biologically interpretable relationship between the latent variables and the neural activity, recent work has proposed more constrained decoders approximating simple tuning + +![](images/016f60efbe0f82f4591ad360976477d0cb09ab929b2429b46a086c11c926ac3e.jpg) +Figure 1: Model outline. Our main contributions are outlined in purple. The input is a matrix of neural spiking activity. The encoder (1) is a multilayered neural network. The latent spaces are separate with, potentially, different topologies (e.g. $\mathbb{R}^1$ and $\mathbb{T}^2$ ). The decoder is a parametric tuning curve model with feature sharing (2). The ensemble detection is a weighted (ideally one-hot) selection of latent spaces for each neuron (3). For decoding of the activity, we assume Poisson spiking. + +curves. These tuning curves have been parameterized as Gaussian processes in the framework of Gaussian process latent variable models (GPLVM, Wu et al., 2017; 2018). Through the tuning curve approach, we limit ourselves to biologically plausible solutions that reveal the actual algorithmic structure of the neural system. Thus, LVMs with simple tuning curve decoders bring together the view on neural populations as distributed representations of low-dimensional latent variables, along with the biologically meaningful perspective on individual neural tuning properties. + +Some neural populations exhibit topologically interesting latent manifolds (Singh et al., 2008; Peyrache et al., 2015a; Gardner et al., 2022). For instance, grid cells represent navigational space in toroidal coordinates of spatially repeating two dimensional hexagonal grids (Hafting et al., 2005). They appear in different ensembles, commonly referred to as modules, each coding for space at different resolutions (Fyhn et al., 2007; Stensola et al., 2012). Thus, the complete population of grid cells is best described as a collection of ensembles of neurons, where neurons in each ensemble have tuning curves of specific shapes on their respective toroidal latent representations of space (Curto, 2017). By contrast, a two-dimensional Euclidean representation might also account for the complete population of grid cells, but would also completely obscure their efficient and theoretically interesting coding scheme for representing space (Solstad et al., 2006; Sreenivasan & Fiete, 2011; Mathis et al., 2012; Wei et al., 2015; Klukas et al., 2020). A driving motivation behind this work was to model this beautiful neural structure with an LVM that separates the algorithmic and biological parts, while uniting shared tuning properties to be more accurate and trainable than previous approaches. + +We propose to train neural LVMs that not only have simple tuning curve decoders, but are also fully differentiable. Thus, we use a flexible encoder, i.e., a neural network as in variational autoencoders (Kingma & Welling, 2014; Rezende et al., 2014), and a simple tuning curve based decoder, akin to GPLVM. The encoder can readily be made convolutional to allow for better latent estimation from adjacent time points. Additionally, we implement a feature basis for the tuning curve shapes in the decoder which can be shared across neurons. We demonstrate that the neural feature sharing, along with the variational end-to-end training, vastly improves both the training stability as well as the final performance of neural LVMs. Moreover, we propose hybrid inference at test-time and show that this, again, brings a considerable improvement in performance. Finally, we integrate the problem of separating distinct ensembles of neurons into our approach — a crucial task for the discovery of different biological structures and the precise mathematical understanding of their topological tuning properties. An illustration of our approach is provided in Fig. 1. + +To summarize, our full model performs the task of finding latent variables, separating distinct ensembles of neurons and fitting the prototypical tuning curves on each ensemble's latent space in a single efficient framework. In the following, we therefore refer to our model as feature sharing and ensemble detection Latent Variable Model or faeLVM. + +# 2 BACKGROUND + +Let $\lambda_{i}$ be the instantaneous firing rate of a neuron $i$ . To relate this to the spiking activity $x_{i}$ , we assume a Poisson noise model $x_{i} \sim \mathcal{P}(\lambda_{i})$ . We define latent variables $z \coloneqq \{z_{1}, \ldots, z_{k}\}$ (in distinct + +![](images/a1e1e0138cf387d603d194482503e3521b2c0dad1744db269bf44ebf34257803.jpg) + +![](images/f523ff8194a2f26748eeb7c673d0c9f2802e35e8974f3b19e4bdb439da0569cd.jpg) +Figure 2: The feature sharing assumption. A, Tuning curves for 26 head direction tuned neurons. B, The same 26 tuning curves, shifted and scaled to visualize structural similarity, along with a standard Gaussian shape (dotted line). + +spaces and possibly with different topologies) that change over time and to which neurons are tuned. More precisely, we suppose that there exists a deterministic function $f_{i}$ , which for every neuron $i$ relates the latent variables to the firing rate, i.e., $\lambda_{i} = f_{i}(z)$ . One additional assumption is that each $f_{i}$ is only sensitive to a subset $J_{i}$ of latent variables and invariant to all others. That means, for two values $z, \hat{z}$ with $z_{j} = \hat{z}_{j} \forall j \in J_{i}$ and $z_{j} \neq \hat{z}_{j} \forall j \notin J_{i}$ we have $f_{i}(z) = f_{i}(\hat{z})$ . + +As a concrete example, consider a mixed population of head direction neurons $I_{1}$ and a grid cell module $I_{2}$ . The former are tuned to a circular latent variable $z_{1} \in \mathbb{S}^{1}$ (Peyrache et al., 2015a; Rybakken et al., 2019; Rubin et al., 2019; Chaudhuri et al., 2019), the latter to a toroidal latent variable $z_{2} \in \mathbb{T}^{2}$ (McNaughton et al., 2006; Fuhs & Touretzky, 2006; Gardner et al., 2022). That means, for every neuron in the head direction ensemble we have $J_{i} = \{1\}$ , $\forall i \in I_{1}$ ; whereas for every neuron in the grid cell ensemble we have $J_{i} = \{2\}$ , $\forall i \in I_{2}$ . Conceivably, there exist shared latent variables, e.g. attentional state, running speed or pupil dilation, to which multiple or even all neurons are tuned. + +Within each ensemble, the tuning functions $f_{i}$ , $i \in I_{j}$ are likely to have similar structure (Albright, 1984; Taube et al., 1990; Hafting et al., 2005). This is the concept of feature sharing (Klindt et al., 2017), which in visual systems neuroscience has proven to be a useful assumption (Batty et al., 2017; Sinz et al., 2018; Ecker et al., 2018; Walker et al., 2018; Cadena et al., 2019; Ustyuzhaninov et al., 2019; Cotton et al., 2020; Zhuang et al., 2021; Burg et al., 2021; Bashiri et al., 2021; Safarani et al., 2021; Franke et al., 2021; Lurz et al., 2021; Nayebi et al., 2021; Seeliger et al., 2021; Goldin et al., 2021; Ustyuzhaninov et al., 2022). In vision, this can be motivated by the fact that visual (especially early retinal) neurons form mosaics, that tile the input space and compute the same response function (i.e., tuning curve) across space (Wässle & Riemann, 1978). Precisely, let $f_{\mu}$ denote the response function of a visual neuron with receptive field center $\mu \in \mathbb{R}^2$ , let $T: \mathbb{R}^2 \to \mathbb{R}^2$ be a spatial translation, and let $z: \mathbb{R}^2 \to \mathbb{R}^1$ be an image (with slight abuse of notation, $z$ is, here, a function that assigns a grey scale value to every position in two-dimensional space, i.e., an image). Let us think of $f_{i} = f_{\mu}$ and $f_{i'} = f_{T(\mu)}$ as two neurons of the same type (i.e., same tuning curve shape) but with their receptive field centers at different locations $\mu$ and $T(\mu)$ . Then we have $f_{i}(z) = f_{i'}(z \circ T)$ . Thus, for visual neurons we assume translational equivariance. + +Consequently, we should be able to marginalize over spatial translations to learn the shared structure among all $f_{i}$ as demonstrated in Klindt et al. (2017). The same intuition holds for populations of auditory neurons that are equivariant to pitch, i.e., that have similar tuning properties translated across log-frequency space (Kell et al., 2018; Kell & McDermott, 2019) and possibly other sensory neurons such as somatosensory populations (Lieber & Bensmaia, 2019). But it also holds true for higher cognitive neurons, such as the ones discussed above, where, for instance, each grid cell is tuned to a different location on the torus and the receptive fields (tuning curves) across grid cells are remarkably similar in shape (Hafting et al., 2005; Fyhn et al., 2007; Gardner et al., 2022). Thus, we propose to introduce feature sharing also in this case. More precisely, we argue that every $f_{i}$ within an ensemble $I_{j}$ , should be modeled by a shared tuning curve function $g_{j}(z,\theta_{i}) = f_{i}(z)$ that applies a simple neuron specific transformation, parameterized by $\theta_{i}$ , to obtain the specific $f_{i}$ of each neuron. For instance, in the case of a neuron-specific spatial translation $(\mu_{i}$ , the receptive field center as above) and scaling $(\alpha_{i})$ , we would define $\theta_{i} = \{\mu_{i},\alpha_{i}\}$ and thus $g_{j}(z,\theta_{i}) = \alpha_{i}g_{j}(T_{\mu_{i}}(z),\theta_{0}) = f_{i}(z)$ $(\theta_0$ yielding simply the centered prototype of the shared tuning curve). Evidence for this assumption is provided in Fig. 2, where centering and rescaling all tuning curves of head direction selective neurons on $\mathbb{S}^1$ (recorded by Peyrache et al., 2015b) clearly exhibits a shared, Gaussian-like tuning. + +In visual perception there is translational equivariance, however, only among cells of the same types (Wässle & Riemann, 1978). Therefore, previous work proposed feature sharing in combination with functional cell type identification (Klindt et al., 2017). Specifically, equating neural ensembles with cell types in the retina, this posits that all neurons in a given ensemble $I_{j}$ be tuned to the same set of latent variables $J_{j}$ , i.e., $J_{i} = J_{j}$ , $\forall i \in I_{j}$ . As an example, the toroidal structures $z_{j} \in \mathbb{T}^{2}$ of different + +grid cell ensembles $I_{j}$ only become apparent after the successful separation of distinct modules with different spatial resolutions (Gardner et al., 2022). Thus, we argue that feature sharing hinges on the successful identification and separation of distinct neural ensembles in a mixed population recording. + +The problem of ensemble detection can be formalized as partitioning $n$ recorded neurons $I = \bigcup_{j}^{k}I_{j}$ into $k$ non-empty subsets $I_{j}\cap I_{j^{\prime}} = \emptyset, \forall j\neq j^{\prime}$ . Unfortunately, this is a combinatorial problem with $k^n$ possible states. Even for a 'simple' problem such as clustering neurons into $k = 2$ groups, this already exceeds the number of atoms in the universe (1082) at $n\geq 273$ . With modern neuroscience routinely yielding thousands of recorded neurons per experiment (Jun et al., 2017), brute-force exhaustive search is clearly not a viable approach. To mitigate this issue, we propose a soft-relaxation of the clustering problem. Specifically, we define a convex combination of weights over responses derived from tuning curves on each latent variable, and train the neurons to maximize their likelihood given those weights in a differentiable fashion (explained in more detail in the next section). + +# 3 METHODS + +As above, we denote neural activity $x$ and the collections of latent variables as $z$ . We want to learn a latent variable model $p(x,z) = p(x|z)p(z)$ . We choose a variational autoencoder (VAE, Kingma & Welling, 2014), which maximizes a lower bound to the data likelihood called the evidence lower bound, which necessitates the introduction of an approximation to the posterior distribution, i.e., a variational (input dependent) posterior with non-zero support across the domain, $q(z|x) > 0, \forall z,x$ . + +At test-time, we focus on a precise estimate for the latents $z$ . These latents are usually inferred with the encoder that computes the approximate variational posterior $q(z|x)$ . Here, we aim to further refine this estimate by performing inference based on the decoder $p(x|z)$ . Technically, this can be achieved by directly performing gradient descent on the latents, with the decoder starting from the encoder estimate (Schott et al., 2018; Ghosh et al., 2019) (see Appx. J for further details). + +For Euclidean latent spaces $z \in \mathbb{R}^n$ , we can simply rely on the standard VAE framework, using a Normal $(\mathcal{N})$ posterior and prior for those dimensions. For spherical latent spaces $\mathbb{S}^n$ , we use a wrapped Normal distribution $(w\mathcal{N})$ , akin to previous work (Falorsi et al., 2019; Jensen et al., 2020), which satisfies the topology of the latent space. For the relevant case of a toroidal latent space, we can use $\mathbb{T}^2 = \mathbb{S}^1 \times \mathbb{S}^1$ , together with the fact that the variational posterior is, usually, assumed to factorize across dimensions. This factorization also helps keep the equations the same when working with multiple latents (corresponding to multiple ensembles), i.e., $z = \{z_1, \dots, z_k\}$ . + +More precisely, we assume that each latent $z_{j}$ lives either in Euclidean space $\mathbb{R}^{n_j}$ or on a torus $\mathbb{T}^{n_j} = \mathbb{S}_1^1\times \ldots \times \mathbb{S}_{n_j}^1$ (with $\mathbb{S}^1 = \mathbb{T}^1$ ). Further, we let our prior factorize (Kingma & Welling, 2014), i.e., + +$$ +p (z) = \prod_ {j = 1} ^ {k} p \left(z _ {j}\right), \quad p \left(z _ {j}\right) = \prod_ {l = 1} ^ {n _ {j}} p \left(z _ {j} ^ {(l)}\right), \quad z _ {j} ^ {(l)} \sim \left\{ \begin{array}{c} \mathcal {N} (0, 1), \text {i f} z _ {j} \in \mathbb {R} ^ {n _ {j}} \\ w \mathcal {N} (0, 1), \text {i f} z _ {j} \in \mathbb {T} ^ {n _ {j}} \end{array} , \right. \tag {1} +$$ + +giving uniform prior distributions. Analogously, we let our variational posteriors factorize as + +$$ +q (z | x) = \prod_ {j = 1} ^ {k} q \left(z _ {j} | x\right), \quad q \left(z _ {j} | x\right) = \prod_ {l = 1} ^ {n _ {j}} q \left(z _ {j} ^ {(l)} | x\right), \quad z _ {j} ^ {(l)} \sim \left\{ \begin{array}{c} \mathcal {N} (\mu (x), \sigma (x)), \text {i f} z _ {j} \in \mathbb {R} ^ {n _ {j}} \\ w \mathcal {N} (\mu (x), \sigma (x)), \text {i f} z _ {j} \in \mathbb {T} ^ {n _ {j}} \end{array} . \right. \tag {2} +$$ + +Here, the distribution-specific parameters $\mu(x)$ and $\sigma(x)$ are themselves input dependent, and given by a functional mapping which is learned using the reparametrization trick. We use a temporal (1D) convolutional neural network to parameterize $q$ . To enforce circular latents, we let the encoder output vectors in $\mathbb{R}^2$ , which we subsequently normalize to avoid discontinuities when estimating angles (Zhou et al., 2019). We remark that although a convolutional filter was used, temporal smoothness was not explicitly included in the latent dynamics of $z$ in the model used for producing the results in Sec. 4. It is, however, a straightforward inclusion to incorporate (see Appx. D.1). + +For the decoder, in clear contrast to standard VAEs, we pick a simple parametric function $f$ to parameterize the reconstruction term $p(x|z)$ . As argued above, this is a crucial choice in the interest of defining simple biologically meaningful link functions (i.e., tuning curves) between (potentially complex) latent variables and neural activity. Specifically, we have + +$$ +p \left(x _ {i} \mid z\right) \sim \mathcal {P} \left(f _ {i} (z)\right), \quad f _ {i} (z) = \sum_ {j} w _ {i j} g _ {j} \left(z _ {j}, \theta_ {i}\right), \tag {3} +$$ + +![](images/74c64f67415e976f841739813b929bc5b57cff5d7ebdced0c601f2a3ca975213.jpg) + +![](images/b350f46c2ccf8e5408d619c739928843def859804a6a963aa2a073c9dbcc398e.jpg) +Figure 3: Schematic outline of model evaluation. Evaluation pipeline as suggested in Pei et al. (2021). During training, the models are all trained on spikes from 'train' neurons (1), learning their tuning curves, and the latent variable representation which is used to infer tuning curves on 'test' neurons at train time (2). For testing, we fix all tuning curve shapes and infer the latents from test data (3), before performing spike prediction on held-out data from held-out neurons (4). Thus, our encoder only receives train neurons (1, 3) to infer latents. + +![](images/76245984cfad2d7c48678ca367414c0c5a42833b5938c3b087291366195d0a1c.jpg) + +where $\mathcal{P}(f_i(z))$ is a Poisson distribution with rate $f_{i}(z)$ , and the weights for each neuron $i$ the output of a softmax function, such that $w_{ij} > 0$ and $\sum_{j}w_{ij} = 1$ . That is, $w_{ij}$ models the participation of neuron $i$ in ensemble $j$ . The function $g_{j}(z_{j},\theta_{i})\in \mathbb{R}$ characterizes the (shared) tuning curves of neurons in the latent space of $z_{j}$ , and takes as input the corresponding latent $z_{j}$ and a (set of) neuron specific parameter(s) $\theta_{i}$ , to produce the response of the neuron based on each latent space. + +The function $g_{j}(z_{j},\theta_{i})$ can be specified in a multitude of ways, while still embodying the concept of feature sharing. Here we present two possible options: the first simply assumes a single heat kernel shape (i.e., Gaussian-like bump) with shared tuning width $\sigma$ for all neurons. Since neural activity is non-negative, we model the log of the instantaneous firing rates as + +$$ +\log g _ {j} \left(z _ {j}, \mu_ {i}\right) = - \frac {d _ {j} \left(z _ {j} , \mu_ {i}\right) ^ {2}}{\sigma^ {2}}, \tag {4} +$$ + +where $\mu_{i}$ denotes (as above) the center of the $i$ -th neuron's tuning curve and $d_{j}(\cdot)$ a distance function in the space of $z_{j}$ (i.e., Euclidean distance in $\mathbb{R}^n$ and geodesic distance in $\mathbb{T}^n$ ). The second, and more flexible, feature space consists of a sum of $M$ weighted $(\beta_{m})$ Gaussian basis functions (i.e., a spline) + +$$ +\log g _ {j} \left(z _ {j}, \mu_ {i}\right) = \sum_ {m} \beta_ {m} \exp \left[ - \frac {d _ {j} \left(z _ {j} , \mu_ {m} - \mu_ {i}\right) ^ {2}}{\sigma_ {m} ^ {2}} \right], \tag {5} +$$ + +with center $\mu_{m}$ and width $\sigma_{m}$ of the $m$ -th basis function. We consider three variations of faeLVM: sharing of features by utilizing Eq. 4 to model $g_{j}$ with a shared (bump) heat kernel (faeLVM-b), sharing of features through Eq. 5 using a Gaussian basis (faeLVM-s), as well as a model allowing each neuron to learn its own set of the basis weights in Eq. 5, i.e. no shared features (faeLVM-n). + +# 4 EXPERIMENTS + +# 4.1 SIMULATIONS: FEATURE SHARING + +Motivated by the evaluation pipeline in Pei et al. (2021), we split our data into four parts (Fig. 3), exploring the benefits of feature sharing in the following way: We generate $z \in \mathbb{S}^1$ , a circular 1D latent variable and simulate spikes according to a Poisson distribution with heat kernel tuning curves (see also Appx. F for a retinal ganglion simulation with calcium dynamics). We fix $T_{\mathrm{test}}$ and $N_{\mathrm{test}}$ (1000 and 30), and investigate model performance based on fixed $T_{\mathrm{train}}$ and varying $N_{\mathrm{train}}$ , and vice versa. For each condition, we repeat the experiment over 20 seeds (while data is different for each repeat, all models are trained on the same seed, ensuring valid comparisons), reporting mean negative log-likelihood (NLLH) and geodesic error (GE) on test data (lower numbers are better, in both cases). We also compare our models with mGPLVM (Jensen et al., 2020), an extension of GPLVM (Wu et al., 2018) designed for inference on non-Euclidean spaces, as well as a conventional VAE using a standard multi-layer perceptron decoder (MLP; with essentially a reverse architecture of the encoder). As mGPLVM assumes a Gaussian noise model, the Poisson NLLH is unsuitable as a measure, hence it is only included when evaluating latent recoveries. + +Fig. 4A-B clearly show the regime where feature sharing excels: datasets with a satisfactory number of neurons, but with short recording times. This coincides well with the current state-of-affairs for neural recording techniques, where experiments are usually limited by the possible experimental length, not by the amount of recordable neurons (Stevenson & Kording, 2011). Moreover, even with further technical innovations, we may eventually be able to record from all neurons, but we will likely never be able to record during all possible natural inputs or behaviors. + +![](images/bc5fcd1636021cc51b2584f0e3ddea4c2c56a2e5901b5b0fd9ffb2b30606cb44.jpg) +Figure 4: Latent and Rate Prediction. The models faeLVM-n,s,b are described in the main text, mGP is the model from Jensen et al. (2020), VAE a traditional approach using an MLP decoder. A, Mean NLLH of predicted test neuron rate, as a function of amount of training neurons. As the performance is averaged over 20 seeds of varying data, error bars would also reflect the variability in NLLH across data, resulting in inappropriate visualization. Hence, we report the mean rank of 20 seeds for each model at each condition, in an effort to more appropriately capture the variability of the models. B, Same as A, now as a function of training time points. C, Mean GE between true latent and inferred latent, on test data, with corresponding SEM error bars, as a function of number of training neurons. D, Same as C, now as a function of training time points. + +![](images/37eea1fb92e0b7ee6b56c345c6d24884bc8426be08ee3be9e0f8a22842075509.jpg) + +![](images/43545e13e45579faa3c24f0ecc226210e769895572d76cffecc3b4460e49728d.jpg) + +![](images/a00a60e718af03e7b78958698dd8f67bd56d4a94eb8097ae7db25147152e9ba5.jpg) + +We also remark that while faeLVM-n seems to perform better on rate prediction in the low neuron regime (Fig. 4A), the performance of LVMs ultimately hinges on how well the models can recover the correct latent variable. In the setting of latent recovery (Fig. 4C-D), we see that feature sharing is evidently beneficial both in low neuron- and low recording-time regimes. faeLVM-b outperforms the other models, perhaps somewhat expected given the shape of the synthetic tuning curves, while all faeLVMs outperform both mGPLVM and VAE. We also observe that while mGPLVM, which uses tuning curve decoders, is more interpretable, it is worse than neural network decoders. However, our approach with feature sharing closes that gap and even improves upon the existing VAE method, thus highlighting the importance of sharing features; more accurate inference, while also being interpretable. Note that although the faeLVMs leverage the benefit of a convolutional layer (which mGPLVM does not, being a non-convolutional model), we emphasize that the faeLVMs still outperforms mGPLVM, even after reducing the convolutional filter size down to 1, which forces the model to infer the latents independently at each time point (see Appx. E). + +# 4.2 SIMULATIONS: ENSEMBLE DETECTION + +![](images/7859b3cc90022f69778acfff075b8eb00b60494a683c484c23834c7c398036b5.jpg) +Figure 5: Ensemble Detection. Ensemble detection accuracy, with corresponding SEM error bars, on two (A) and three (B) equally sized ensembles of neurons tuned to separate $\mathbb{S}^1$ latent variables. The models are: k-means on PCA reduced data ('raw-pca'), k-means on PCA reduced covariance matrix of the data ('cov-pca'), supervised clustering based on the mutual information scores between the cell responses and the latent variables, faeLVM with shared heat kernel tuning curves ('faeLVM-b'), and the same model optimized over 5 seeds, selecting the one that produced the highest LLH ('faeLVM-b5'). Chance levels are computed from 100,000 random labels with optimal permutations. C, Relation between likelihood and accuracy for different data amounts. + +![](images/cc2c9094d7c2aa4f2e6d014d4a52040c4f9f48cbe175e1009f196a026f2fe8ed.jpg) + +![](images/0315f384ee37c53f8296e25fd62da566016187e2da3bdc0b86597a54ca82a9c4.jpg) + +![](images/02b69433c9939f9d4c95618c5817b2374ddefdfd1adb6698af4746b58c2f0427.jpg) + +Next, we shift our focus to the challenge of ensemble detection, comparing the performance of faeLVM-b against other common methods. Specifically, we contrast against clustering methods (see Appx. C for more details) that either i) perform k-means clustering on dimensionally reduced neural activity over time (loosely inspired by Lopes-dos Santos et al., 2011; Baden et al., 2016; Hamm et al., 2021), or ii) perform clustering on the neural covariance matrix (loosely inspired by Carrillo-Reid et al., 2015). As an additional upper bound to the achievable performance, we include a supervised + +clustering method that receives both the mutual information score between each neuron's activity, and the true latent variables, as input. We run our model over five different random seeds and pick the run that yields the highest LLH (faeLVM-b5 in Fig. 5), a fair approach as the likelihood is an unsupervised metric (k-means is run over 100 seeds, picking the one with the lowest inertia). + +The setting we chose for these experiments was the separation of ensembles of neurons that live on a ring, i.e. $\mathbb{S}^1$ . The comparison methods failed to separate the ensembles when scaling up to neural activity on a torus, in contrast to faeLVM, which further highlights the novelty of an unsupervised method that can accomplish this task (see Sec. 4.4 for tori, and also Appx. I for an additional ensemble separation ablation). We tested the accuracy on separating two and three distinct (no shared latents across ensembles) neural ensembles of equal size on rings, in addition to investigating accuracy for all models as a function of available data points (recording length). + +Fig. 5A-B shows that our model outperforms both comparison methods and quickly approaches the performance of the supervised upper bound, for both two and three rings. This is even more pronounced for the model selected based on LLH — a viable option when the analysis result warrants additional computing time. Fig. 5C shows that the relationship between ensemble detection accuracy and LLH is monotonically increasing. Thus, the unsupervised likelihood score is indeed a good proxy to arbitrate between different optimization runs. + +# 4.3 REAL DATASETS: HEAD DIRECTION DATA + +![](images/286bc342cbcc9906872996ce88a02d42224c80dd68bd143e90906d0c39d7726b.jpg) +Figure 6: Application to head direction data. A, Variational mean of faeLVM-n plotted against recorded mouse head direction (for additional visualizations, see Appx. H). We trained 20 models, selecting the one with highest training likelihood on training neurons, before performing inference at test-time. B, True test neuron spikes (grey), and predicted test neuron rates (black) from the model used in A, per bin, for three randomly selected neurons. C, NLLH of test neuron rate, over 20 seeds, as a violin plot. Performance of the best model, based on train LLH, is indicated by the black dot. D, Same as C, but comparing GE between recorded head direction and inferred latent, on test data. + +![](images/521e41bfca2a725ead9a2402410faf855cb8984ed59e143bd0c486dd6d8a5809.jpg) + +![](images/6c2daf246347030c51910ba9dd6830b487e18a05de15c4f66615afb170800471.jpg) + +![](images/d6b4a079113fad21459c7c75b4834390f927628e76d71f5fc4245f98b421babc.jpg) + +Transitioning to real datasets, we first apply our models to data from Peyrache et al. (2015b); more specifically the awake trials from the dataset labeled Mouse 28, session 140313, recorded from the anterodorsal thalamic nucleus (ADN). Recordings yield approx. $35\mathrm{min}$ of data, which we bin in $100~\mathrm{ms}$ bins, before separating it with a train-test split of $95\% -5\%$ . 3 neurons are allocated as test neurons (out of 26 total) and we run 20 seeds of each model, selecting the best performing model for visualization (faeLVM-n). The inferred latent (Fig. 6A) is observed to match the true head direction to a high degree, and the model is able to predict rates on test neurons (Fig. 6B), even though the average and peak activity over test bins are quite low ( $\sim 1$ and $5\mathrm{Hz}$ respectively) for the first two. + +As we can see from Fig. 6C, the unconstrained model (faeLVM-n) outperforms the other two. This is not an unsurprising result, given the model's higher complexity and the sufficiently large amount of training data. As for the latent prediction, mGPLVM and the traditional VAE (Fig. 6D) are close in comparison to the performance of faeLVM-s, although less accurate than faeLVM-n. We also note that the VAE does perform better on the rate prediction, which, conceivably, might be explained by the fact that it is not constrained by a particular tuning curve model and thus might learn interactions that incorporate non-head direction variables in an effort to improve its rate prediction. Training multiple models and making a selection based on train LLH generally correlates well with solid results on the test set, as also shown in Fig 5C. Note that faeLVM-b achieves much more consistent optimization results over different random initializations, suggesting a typical bias-variance tradeoff. + +Overall, we recognize that while there are differences in performances, all models recover the correct circular manifold. The faeLVMs however, are noticeably faster ( $\sim 5$ min. run time for one seed, on + +![](images/2c85e703527a0b9bbbb27d111222ccbc98ba8ad531402129f3aec011cf1c77d0.jpg) + +![](images/8aa7d6346e901d8e596e1aeb3c40bb34960e9fd3b4ec7b7ac86216b12390f3a1.jpg) + +![](images/df9748a681a747e3da02e83b85902afe147ddd0133c32122bbdfe9ab65ca919b.jpg) + +![](images/eb79f894c4613e41a3e72c3ed4cf621a7abdc9e0c7a810011ddd16d9eb61e103.jpg) +Figure 7: Application to grid cell data. A, Learned ensemble weights. Neurons are ordered by decreasing spatial information, dashed line separates first and second reported module (Gardner et al., 2022). B, Greedy test for each neuron, checking which latent provides higher likelihood (i.e., one-hot ensemble weights), colored by reported module. C, Classification accuracy when successively removing neurons with low spatial selectivity. The same number of neurons were removed from each ensemble, starting with least spatially informative ones. Accuracy is measured against supervised ensemble detection from Gardner et al. (2022). D, Rate map of every $25^{\text{th}}$ neuron, first grid cell module (smoothed for visualization purposes). Maps shown as function of rat's position in arena, as well as inferred coordinates on latent torus. Red circles indicate inferred receptive field mean and width (SD) for the heat kernel (i.e., Gaussian-like bump). E, Same as D for second module. For a full set of rate maps, as well as latent dynamics, see Appx. G & H. + +a CPU), compared to mGPLVM ( $\sim 50$ min. run time for one seed on a GPU). While not critical in the case of this particular dataset, it is paramount when inferring latents of higher dimensionality. We also note that while the circular manifold was in this case known, it is possible to do model selection over different latent spaces (toroidal, circular, planar, etc.) as was demonstrated in Jensen et al. (2020). Thus, it is not strictly necessary to know the latent topology when applying our method, rather it allows for the restriction of possible models to a limited hypothesis class. + +# 4.4 REAL DATASETS: GRID CELL DATA + +Finally, we apply the complete model pipeline to data recorded from the medial entorhinal cortex (MEC) of a freely moving rat (Gardner et al., 2022). Neurons in the MEC are selective to a number of features like space (Fyhn et al., 2004), head direction (Sargolini et al., 2006), speed (Kropff et al., 2015), as well as conjunctive representations of the three (Sargolini et al., 2006; Hardcastle et al., 2017), though most demonstrate a strong preference for single features (Kropff et al., 2015; Tukker et al., 2022). We consider data from the rat R, day 1-session, using recordings from neurons labeled module 2 and 3, considering 149 and 145 non-conjunctive neurons respectively. Spike data was binned in $100\mathrm{ms}$ bins, after removing periods in time when the rat was considered stationary (speed $< 2.5\mathrm{cm~s}^{-1}$ ). Recordings from both the open field and maze experiments yields approx. $170\mathrm{min}$ of data. We train 20 models from different seeds, selecting the one with highest in-sample likelihood. + +Compared with the modules discovered in the dataset (Gardner et al., 2022), our model's results coincide with an accuracy of 0.83. The inferred weights (Fig. 7A) show a clear separation between the two modules, becoming less distinct as the neurons' spatial information decreases. This is also reflected in Fig 7B, where neurons further away from the diagonal tend to be more accurately classified. However, we note that the original separation of neurons into ensembles is not an intrinsic truth; a number of the less informative neurons exhibit structurally ambiguous rate maps (see Appx. G), a possible indication that they may belong to a different ensemble altogether. Excluding these neurons + +while evaluating the model (Fig. 7C), we observe a significant increase in performance, reaching 0.90 accuracy after removing approx. 50 of the least informative neurons from each ensemble. + +Fig. 7D-E show a selection of rate maps for neurons from both ensembles. We see that the model infers toroidal decodings that keep the structural integrity of the receptive fields, akin to the findings in Gardner et al. (2022). The inferred centers and widths also correspond well with the rate maps. We note that, while promising, the dataset included here contains just 294 of the 2460 neurons originally recorded and that the full dataset (currently not available) would require additional steps to determine the number of ensembles, the corresponding shapes and allow for some degree of conjunctivity. + +# 5 CONCLUSION + +In this paper we provide a proof-of-concept that the paradigm of share and divide is a successful application of the old idea of carving nature at the joints, in the sense that similar observations are grouped while differences are highlighted. This principle, instantiated in a group equivariant computation core and a cell-type specific readout, has been successfully deployed in visual neuroscience; we show that it also provides an excellent inductive bias (or prior) in the case of higher cognitive variables such as (but not necessarily limited to) head direction or position in space. It is advantageous from a statistical perspective to leverage the similarity in tuning functions across neurons, as well as from a biological point of view, as finding protootypical tuning curves can help us unravel the common tuning properties across individual neurons. + +The idea of separating ensembles is at the core of the scientific endeavor where the task is to group our observations of nature into distinct categories. In the case of grid cell modules, it is absolutely crucial, as the topological properties that define this class of neurons are completely hidden when the separate ensembles of different spatial resolution are not properly distinguished. One might wonder whether other brain areas such as primary visual cortex, for which a power law in the population activation space has been stipulated (Stringer et al., 2019), may not resolve into simpler underlying topological ensembles of neurons, such as the special orthogonal group of three-dimensional rotations $SO(3)$ (vision), 2-spheres $\mathbb{S}^2$ (Singh et al., 2008), or the Klein bottle shape of oriented and phase shifted wavelets (Carlsson et al., 2008) (relevant to multiple sensory modalities). + +Furthermore, the assumption of feature sharing relies on an equivariant neural code, such as the approximate translation equivariance in the visual system, which certainly is an abstraction from the actual inter-neural variability that exists in the real world. In some cases, it might be that neurons are better described along some continuous space of variations, rather than by a fixed set of discrete prototypical tuning curves (Ustyuzhaninov et al., 2022). On the other hand, if we can identify the parameters (e.g., tuning width) that describe the continuous variations across neurons and separate them from the stable features of tuning curves (e.g., Gaussian-like heat kernel shape), we can use that to build a more flexible parametric (but still shared) feature basis. Examples of such approaches include rotation (Ustyuzhaninov et al., 2019), kinetic (Zhao et al., 2020) or more general nonlinear modifications (Shah et al., 2022) to shared feature spaces. Further challenges to the feature sharing idea could arise from recent findings of representational drift (Rule et al., 2019) and location(Qiu et al., 2020) or context dependent tuning (Kanter et al., 2017), although future directions might consider addressing these in the model. Other limitations are the fact that the grid cell torus is hexagonal, while we use an orthogonal basis; further analyses might reveal if the encoder compensates for that, e.g., by adjusting the distribution of speeds on the torus per direction. + +Finally, although the choice of variational posteriors might at first seem restrictive, we would argue that the corresponding topologies (circles, tori, $\mathbb{R}^n$ ) are natural choices for latent spaces and likely to keep appearing in the brain, as is suggested in recent work (Kriegeskorte & Wei, 2021). Other authors conjectured that, e.g., prefrontal cortex deploys grid cell-like codes to explore physical (Doeller et al., 2010; Jacobs et al., 2013) and conceptual spaces (Constantinescu et al., 2016; Bao et al., 2019), as well as rules in a reinforcement learning task (Baram et al., 2021). The challenge of constructing or observing the relevant space has proven a hurdle for previous supervised methods, being unable to discover cognitive maps without a priori knowledge of the represented covariates. Our model is particularly suited in this setting, offering a targeted method to identify neural ensembles and summarizing as well as leveraging their shared tuning properties. + +# ETHICS STATEMENT + +More generally, reducing high dimensional nonlinear dynamical systems to a set of latent variables can have a broad array of possible applications, for instance, in climate sciences, crop forecasting or flood prediction. Restraining the decoders to interpretable mechanisms and groups of observations could, also in those cases, help us further our understanding of the underlying processes or relations between low dimensional summaries and data observations. As for any complex and versatile modern machine learning method, there also exists a danger of translating the insights from this work to detrimental purposes and intents. Applications to sensitive data with protected attributes, such as gender or ethnicity, should pay special attention to the en- and decoding of those attributes in the learned latent spaces. Therefore, while we do not see any obvious misuse, nor want to explicitly name any possible malicious purposes, we still strongly discourage any nefarious applications of the ideas developed in this work. Lastly, we tried to minimize the environmental impact of our research by performing the hyper-parameter search on the GPU cluster of a carbon-neutral organization. + +# REPRODUCIBILITY STATEMENT + +Code and implementation are included as supplementary material, and is also made available at: https://github.com/david-klindt/NeuralLVM. Datasets are public, and details regarding model parameters, data generation, etc. are specified under the relevant sections (e.g., Sec. 4), as well as more thoroughly in the Appendix (e.g., Appx. A, B, C, J & K). + +# ACKNOWLEDGMENTS + +We thank Erik Hermansen for valuable discussions and feedback related to the grid cell data, as well as Ta-Chu Kao for fruitful discussions. This work was supported by a Norwegian Research Council Large-scale Interdisciplinary Researcher Project Grant iMOD (NFR grant no. 325114). + +# REFERENCES + +Thomas D Albright. Direction and orientation selectivity of neurons in visual area mt of the macaque. Journal of neurophysiology, 52(6):1106-1130, 1984. +Tom Baden, Philipp Berens, Katrin Franke, Miroslav Roman Rosón, Matthias Bethge, and Thomas Euler. The functional diversity of retinal ganglion cells in the mouse. Nature, 529(7586):345-350, 2016. +Xiaojun Bao, Eva Gjorgieva, Laura K Shanahan, James D Howard, Thorsten Kahnt, and Jay A Gottfried. Grid-like neural representations support olfactory navigation of a two-dimensional odor space. Neuron, 102(5):1066-1075, 2019. +Alon Boaz Baram, Timothy Howard Muller, Hamed Nili, Mona Maria Garvert, and Timothy Edward John Behrens. Entorhinal and ventromedial prefrontal cortices abstract and generalize the structure of reinforcement learning problems. *Neuron*, 109(4):713-723, 2021. +Mohammad Bashiri, Edgar Walker, Konstantin-Klemens Lurz, Akshay Jagadish, Taliah Muhammad, Zhiwei Ding, Zhuokun Ding, Andreas Tolias, and Fabian Sinz. A flow-based latent state generative model of neural population responses to natural images. Advances in Neural Information Processing Systems, 34, 2021. +Eleanor Batty, Josh Merel, Nora Brackbill, Alexander Heitman, Alexander Sher, Alan Litke, EJ Chichilnisky, and Liam Paninski. Multilayer recurrent network models of primate retinal ganglion cell responses. In 5th International Conference on Learning Representations, 2017. +James Bergstra and Yoshua Bengio. Random search for hyper-parameter optimization. Journal of machine learning research, 13(2), 2012. +Max F Burg, Santiago A Cadena, George H Denfield, Edgar Y Walker, Andreas S Tolias, Matthias Bethge, and Alexander S Ecker. Learning divisive normalization in primary visual cortex. PLOS Computational Biology, 17(6):e1009028, 2021. + +Santiago A Cadena, Fabian H Sinz, Taliah Muhammad, Emmanouil Froudarakis, Erick Cobos, Edgar Y Walker, Jake Reimer, Matthias Bethge, Andreas Tolias, and Alexander S Ecker. How well do deep neural networks trained on object recognition characterize the mouse visual system? 2019. +Gunnar Carlsson, Tigran Ishkhanov, Vin De Silva, and Afra Zomorodian. On the local behavior of spaces of natural images. International journal of computer vision, 76(1):1-12, 2008. +Luis Carrillo-Reid, Jae-eun Kang Miller, Jordan P Hamm, Jesse Jackson, and Rafael Yuste. Endogenous sequential cortical activity evoked by visual stimuli. Journal of neuroscience, 35(23): 8813-8828, 2015. +Rishidev Chaudhuri, Berk Gerçek, Biraj Pandey, Adrien Peyrache, and Ila Fiete. The intrinsic attractor manifold and population dynamics of a canonical cognitive circuit across waking and sleep. Nature neuroscience, 22(9):1512-1520, 2019. +Mark M Churchland, John P Cunningham, Matthew T Kaufman, Justin D Foster, Paul Nuyujukian, Stephen I Ryu, and Krishna V Shenoy. Neural population dynamics during reaching. Nature, 487 (7405):51-56, 2012. +Alexandra O Constantinescu, Jill X O'Reilly, and Timothy EJ Behrens. Organizing conceptual knowledge in humans with a gridlike code. Science, 352(6292):1464-1468, 2016. +Ronald James Cotton, Fabian Sinz, and Andreas Tolias. Factorized neural processes for neural processes: K-shot prediction of neural responses. Advances in Neural Information Processing Systems, 33:11368-11379, 2020. +Carina Curto. What can topology tell us about the neural code? Bulletin of the American Mathematical Society, 54(1):63-78, 2017. +Tim R Davidson, Luca Falorsi, Nicola De Cao, Thomas Kipf, and Jakub M Tomczak. Hyperspherical variational auto-encoders. arXiv preprint arXiv:1804.00891, 2018. +Christian F Doeller, Caswell Barry, and Neil Burgess. Evidence for grid cells in a human memory network. Nature, 463(7281):657-661, 2010. +Alexander S Ecker, Fabian H Sinz, Emmanouil Froudarakis, Paul G Fahey, Santiago A Cadena, Edgar Y Walker, Erick Cobos, Jacob Reimer, Andreas S Tolias, and Matthias Bethge. A rotation-equivariant convolutional neural network model of primary visual cortex. arXiv preprint arXiv:1809.10504, 2018. +Gamaleldin F Elsayed and John P Cunningham. Structure in neural population recordings: an expected byproduct of simpler phenomena? Nature neuroscience, 20(9):1310-1318, 2017. +Luca Falorsi, Pim de Haan, Tim R Davidson, and Patrick Forre. Reparameterizing distributions on lie groups. In The 22nd International Conference on Artificial Intelligence and Statistics, pp. 3244-3253. PMLR, 2019. +Katrin Franke, Konstantin F Willeke, Kayla Ponder, Mario Galdamez, Taliah Muhammad, Saumil Patel, Emmanouil Froudarakis, Jacob Reimer, Fabian Sinz, and Andreas Tolias. Behavioral state tunes mouse vision to ethological features through pupil dilation. bioRxiv, 2021. +Mark C Fuhs and David S Touretzky. A spin glass model of path integration in rat medial entorhinal cortex. Journal of Neuroscience, 26(16):4266-4276, 2006. +Marianne Fyhn, Sturla Molden, Menno P Witter, Edvard I Moser, and May-Britt Moser. Spatial representation in the entorhinal cortex. Science, 305(5688):1258-1264, 2004. +Marianne Fyhn, Torkel Hafting, Alessandro Treves, May-Britt Moser, and Edvard I Moser. Hippocampal remapping and grid realignment in entorhinal cortex. Nature, 446(7132):190-194, 2007. +Juan A Gallego, Matthew G Perich, Lee E Miller, and Sara A Solla. Neural manifolds for the control of movement. Neuron, 94(5):978-984, 2017. + +Peiran Gao, Eric Trautmann, Byron Yu, Gopal Santhanam, Stephen Ryu, Krishna Shenoy, and Surya Ganguli. A theory of multineuronal dimensionality, dynamics and measurement. *BioRxiv*, pp. 214262, 2017. +Richard J Gardner, Erik Hermansen, Marius Pachtarium, Yoram Burak, Nils A Baas, Benjamin A Dunn, May-Britt Moser, and Edvard I Moser. Toroidal topology of population activity in grid cells. Nature, pp. 1-6, 2022. +Partha Ghosh, Arpan Losalka, and Michael J Black. Resisting adversarial attacks using gaussian mixture variational autoencoders. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 541-548, 2019. +Matías A Goldin, Baptiste Lefebvre, Samuele Virgili, Alexander Ecker, Thierry Mora, Ulisse Ferrari, and Olivier Marre. Context-dependent selectivity to natural scenes in the retina. *bioRxiv*, 2021. +Torkel Hafting, Marianne Fyhn, Sturla Molden, May-Britt Moser, and Edvard I Moser. Microstructure of a spatial map in the entorhinal cortex. Nature, 436(7052):801-806, 2005. +Jordan P Hamm, Yuriy Shymkiv, Shuting Han, Weijian Yang, and Rafael Yuste. Cortical ensembles selective for context. Proceedings of the National Academy of Sciences, 118(14), 2021. +Kiah Hardcastle, Niru Maheswaranathan, Surya Ganguli, and Lisa M Giocomo. A multiplexed, heterogeneous, and adaptive code for navigation in medial entorhinal cortex. Neuron, 94(2): 375-387, 2017. +Christopher D Harvey, Philip Coen, and David W Tank. Choice-specific sequences in parietal cortex during a virtual-navigation decision task. Nature, 484(7392):62-68, 2012. +D. H. Hubel and T. N. Wiesel. Brain mechanisms of vision. Scientific American, 241:130, 1979. +Joshua Jacobs, Christoph T Weidemann, Jonathan F Miller, Alec Solway, John F Burke, Xue-Xin Wei, Nanthia Suthana, Michael R Sperling, Ashwini D Sharan, Itzhak Fried, et al. Direct recordings of grid-like neuronal activity in human spatial navigation. Nature neuroscience, 16(9):1188-1190, 2013. +Kristopher Jensen, Ta-Chu Kao, Marco Tripodi, and Guillaume Hennequin. Manifold gplvms for discovering non-euclidean latent structure in neural data. Advances in Neural Information Processing Systems, 33:22580-22592, 2020. +Kristopher T Jensen, David Liu, Ta-Chu Kao, Máté Lengyel, and Guillaume Hennequin. Beyond the euclidean brain: inferring non-euclidean latent trajectories from spike trains. bioRxiv, 2022. +James J Jun, Nicholas A Steinmetz, Joshua H Siegle, Daniel J Denman, Marius Bauza, Brian Barbarits, Albert K Lee, Costas A Anastassiou, Alexandru Andrei, Căgatay Aydin, et al. Fully integrated silicon probes for high-density recording of neural activity. Nature, 551(7679):232-236, 2017. +Benjamin R Kanter, Christine M Lykken, Daniel Avesar, Aldis Weible, Jasmine Dickinson, Benjamin Dunn, Nils Z Borgesius, Yasser Roudi, and Clifford G Kentros. A novel mechanism for the grid-to-place cell transformation revealed by transgenic depolarization of medial entorhinal cortex layer ii. Neuron, 93(6):1480-1492, 2017. +Jonathan C Kao, Paul Nuyujukian, Stephen I Ryu, Mark M Churchland, John P Cunningham, and Krishna V Shenoy. Single-trial dynamics of motor cortex and their applications to brain-machine interfaces. Nature communications, 6(1):1-12, 2015. +Matthew T Kaufman, Mark M Churchland, Stephen I Ryu, and Krishna V Shenoy. Cortical activity in the null space: permitting preparation without movement. Nature neuroscience, 17(3):440-448, 2014. +Alexander JE Kell and Josh H McDermott. Deep neural network models of sensory systems: windows onto the role of task constraints. Current opinion in neurobiology, 55:121-132, 2019. + +Alexander JE Kell, Daniel LK Yamins, Erica N Shook, Sam V Norman-Haignere, and Josh H McDermott. A task-optimized neural network replicates human auditory behavior, predicts brain responses, and reveals a cortical processing hierarchy. Neuron, 98(3):630-644, 2018. +Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. +Diederik P Kingma and Max Welling. Auto-encoding variational bayes. In Proceedings of the International Conference on Learning Representations (ICLR), 2014. +David Klindt, Alexander S Ecker, Thomas Euler, and Matthias Bethge. Neural system identification for large populations separating "what" and "where". Advances in Neural Information Processing Systems, 30, 2017. +David A. Klindt, Lukas Schott, Yash Sharma, Ivan Ustyuzhaninov, Wieland Brendel, Matthias Bethge, and Dylan Paiton. Towards nonlinear disentanglement in natural data with temporal sparse coding. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=EbIDjBynYJ8. +Mirko Klukas, Marcus Lewis, and Ila Fiete. Efficient and flexible representation of higher-dimensional cognitive variables with grid cells. PLoS computational biology, 16(4):e1007796, 2020. +Nikolaus Kriegeskorte and Xue-Xin Wei. Neural tuning and representational geometry. Nature Reviews Neuroscience, 22(11):703-718, 2021. +Emilio Kropff, James E Carmichael, May-Britt Moser, and Edvard I Moser. Speed cells in the medial entorhinal cortex. Nature, 523(7561):419-424, 2015. +Neil Lawrence. Gaussian process latent variable models for visualisation of high dimensional data. Advances in neural information processing systems, 16, 2003. +Michael S Lewicki. Efficient coding of natural sounds. Nature neuroscience, 5(4):356-363, 2002. +Justin D Lieber and Sliman J Bensmaia. High-dimensional representation of texture in somatosensory cortex of primates. Proceedings of the National Academy of Sciences, 116(8):3268-3277, 2019. +Vitor Lopes-dos Santos, Sergio Conde-Ocazonez, Miguel AL Nicolelis, Sidarta T Ribeiro, and Adriano BL Tort. Neuronal assembly detection and cell membership specification by principal component analysis. PloS one, 6(6):e20996, 2011. +Konstantin-Klemens Lurz, Mohammad Bashiri, Konstantin Willeke, Akshay K Jagadish, Eric Wang, Edgar Y Walker, Santiago A Cadena, Taliah Muhammad, Erick Cobos, Andreas S Tolias, et al. Generalization in data-driven models of primary visual cortex. bioRxiv, pp. 2020-10, 2021. +Valerio Mante, David Sussillo, Krishna V Shenoy, and William T Newsome. Context-dependent computation by recurrent dynamics in prefrontal cortex. Nature, 503(7474):78-84, 2013. +Alexander Mathis, Andreas VM Herz, and Martin Stemmler. Optimal population codes for space: grid cells outperform place cells. Neural computation, 24(9):2280-2317, 2012. +Bruce L McNaughton, Francesco P Battaglia, Ole Jensen, Edvard I Moser, and May-Britt Moser. Path integration and the neural basis of the 'cognitive map'. Nature Reviews Neuroscience, 7(8): 663-678, 2006. +Bartul Mimica, Benjamin A Dunn, Tuce Tombaz, VPTNC Srikanth Bojla, and Jonathan R Whitlock. Efficient cortical coding of 3d posture in freely behaving rats. Science, 362(6414):584-589, 2018. +Aran Nayebi, Javier Sagastuy-Brena, Daniel M Bear, Kohitij Kar, Jonas Kubilius, Surya Ganguli, David Sussillo, James J DiCarlo, and Daniel LK Yamins. Goal-driven recurrent neural network models of the ventral visual stream. bioRxiv, 2021. + +Chethan Pandarinath, Daniel J O'Shea, Jasmine Collins, Rafal Jozefowicz, Sergey D Stavisky, Jonathan C Kao, Eric M Trautmann, Matthew T Kaufman, Stephen I Ryu, Leigh R Hochberg, et al. Inferring single-trial neural population dynamics using sequential auto-encoders. Nature methods, 15(10):805-815, 2018. +Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, high-performance deep learning library. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett (eds.), Advances in Neural Information Processing Systems 32, pp. 8024-8035. Curran Associates, Inc., 2019. URL http://papers.neurips.cc/paper/9015-pytorch-an-imperative-style-high-performance-deep-learning-library.pdf. +Felix Pei, Joel Ye, David M. Zoltowski, Anqi Wu, Raeed H. Chowdhury, Hansem Sohn, Joseph E. O'Doherty, Krishna V. Shenoy, Matthew T. Kaufman, Mark Churchland, Mehrdad Jazayeri, Lee E. Miller, Jonathan Pillow, Il Memming Park, Eva L. Dyer, and Chethan Pandarinath. Neural latents benchmark '21: Evaluating latent variable models of neural population activity. In Advances in Neural Information Processing Systems (NeurIPS), Track on Datasets and Benchmarks, 2021. URL https://arxiv.org/abs/2109.04463. +Adrien Peyrache, Marie M Lacroix, Peter C Petersen, and György Buzsáki. Internally organized mechanisms of the head direction sense. Nature neuroscience, 18(4):569-575, 2015a. +Adrien Peyrache, Peter C Petersen, and György Buzsáki. Extracellular recordings from multi-site silicon probes in the anterior thalamus and subicular formation of freely moving mice. CR-CNS.org. http://dx.doi.org/10.6080/K0G15XS1, 2015b. +Yongrong Qiu, Zhijian Zhao, David Klindt, Magdalena Kautzky, Klaudia P Szatko, Frank Schaeffel, Katharina Rifai, Katrin Franke, Laura Busse, and Thomas Euler. Mouse retinal specializations reflect knowledge of natural environment statistics. bioRxiv, 2020. +Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In International conference on machine learning, pp. 1278-1286. PMLR, 2014. +Alon Rubin, Liron Sheintuch, Noa Brande-Eilat, Or Pinchasof, Yoav Rechavi, Nitzan Geva, and Yaniv Ziv. Revealing neural correlates of behavior without behavioral measurements. Nature communications, 10(1):1-14, 2019. +Michael E Rule, Timothy O'Leary, and Christopher D Harvey. Causes and consequences of representational drift. Current opinion in neurobiology, 58:141-147, 2019. +Erik Rybakken, Nils Baas, and Benjamin Dunn. Decoding of neural data using cohomological feature extraction. Neural computation, 31(1):68-93, 2019. +Patrick T Sadtler, Kristin M Quick, Matthew D Golub, Steven M Chase, Stephen I Ryu, Elizabeth C Tyler-Kabara, Byron M Yu, and Aaron P Batista. Neural constraints on learning. Nature, 512 (7515):423-426, 2014. +Shahd Safarani, Arne Nix, Konstantin Willeke, Santiago Cadena, Kelli Restivo, George Denfield, Andreas Tolias, and Fabian Sinz. Towards robust vision by multi-task learning on monkey visual cortex. Advances in Neural Information Processing Systems, 34, 2021. +Francesca Sargolini, Marianne Fyhn, Torkel Hafting, Bruce L McNaughton, Menno P Witter, May-Britt Moser, and Edvard I Moser. Conjunctive representation of position, direction, and velocity in entorhinal cortex. Science, 312(5774):758-762, 2006. +Elad Schneidman, Michael J Berry, Ronen Segev, and William Bialek. Weak pairwise correlations imply strongly correlated network states in a neural population. Nature, 440(7087):1007-1012, 2006. + +Lukas Schott, Jonas Rauber, Matthias Bethge, and Wieland Brendel. Towards the first adversarially robust neural network model on mnist. arXiv preprint arXiv:1805.09190, 2018. +Katja Seeliger, Luca Ambrogioni, Yaghmur Güçlütürk, Leonieke M van den Bulk, Umut Güçlü, and MAJ van Gerven. End-to-end neural system identification with neural information flow. PLOS Computational Biology, 17(2):e1008558, 2021. +Nishal P Shah, Nora Brackbill, Ryan Samarakoon, Colleen Rhoades, Alexandra Kling, Alexander Sher, Alan Litke, Yoram Singer, Jonathon Shlens, and EJ Chichilnisky. Individual variability of neural computations in the primate retina. Neuron, 110(4):698-708, 2022. +Krishna V Shenoy, Maneesh Sahani, and Mark M Churchland. Cortical control of arm movements: a dynamical systems perspective. Annual review of neuroscience, 36:337-359, 2013. +Gurjeet Singh, Facundo Memoli, Tigran Ishkhanov, Guillermo Sapiro, Gunnar Carlsson, and Dario L Ringach. Topological analysis of population activity in visual cortex. Journal of vision, 8(8):11-11, 2008. +Fabian Sinz, Alexander S Ecker, Paul Fahey, Edgar Walker, Erick Cobos, Emmanouil Froudarakis, Dimitri Yatsenko, Zachary Pitkow, Jacob Reimer, and Andreas Tolias. Stimulus domain transfer in recurrent models for large scale cortical population prediction on video. Advances in neural information processing systems, 31, 2018. +William Skaggs, Bruce Mcnaughton, and Katalin Gothard. An information-theoretic approach to deciphering the hippocampal code. Advances in neural information processing systems, 5, 1992. +Trygve Solstad, Edvard I Moser, and Gaute T Einevoll. From grid cells to place cells: a mathematical model. Hippocampus, 16(12):1026-1031, 2006. +Sameet Sreenivasan and Ila Fiete. Grid cells generate an analog error-correcting code for singularly precise neural computation. Nature neuroscience, 14(10):1330-1337, 2011. +Hanne Stensola, Tor Stensola, Trygve Solstad, Kristian Frøland, May-Britt Moser, and Edvard I Moser. The entorhinal grid map is discretized. Nature, 492(7427):72-78, 2012. +Ian H Stevenson and Konrad P Kording. How advances in neural recording affect data analysis. Nature neuroscience, 14(2):139-142, 2011. +Mark G Stokes, Makoto Kusunoki, Natasha Sigala, Hamed Nili, David Gaffan, and John Duncan. Dynamic coding for cognitive control in prefrontal cortex. Neuron, 78(2):364-375, 2013. +Carsen Stringer, Marius Pachitariu, Nicholas Steinmetz, Matteo Carandini, and Kenneth D Harris. High-dimensional geometry of population responses in visual cortex. Nature, 571(7765):361-365, 2019. +Jeffrey S Taube, Robert U Muller, and James B Ranck. Head-direction cells recorded from the postsubiculum in freely moving rats. i. description and quantitative analysis. Journal of Neuroscience, 10(2):420-435, 1990. +John J Tukker, Prateep Beed, Michael Brecht, Richard Kempter, Edvard I Moser, and Dietmar Schmitz. Microcircuits for spatial coding in the medial entorhinal cortex. Physiological reviews, 102(2):653-688, 2022. +Ivan Ustyuzhaninov, Santiago A Cadena, Emmanouil Froudarakis, Paul G Fahey, Edgar Y Walker, Erick Cobos, Jacob Reimer, Fabian H Sinz, Andreas S Tolias, Matthias Bethge, et al. Rotation-invariant clustering of neuronal responses in primary visual cortex. In International Conference on Learning Representations, 2019. +Ivan Ustyuzhaninov, Max F Burg, Santiago A Cadena, Jiakun Fu, Taliah Muhammad, Kayla Ponder, Emmanouil Froudarakis, Zhiwei Ding, Matthias Bethge, Andreas Tolias, et al. Digital twin reveals combinatorial code of non-linear computations in the mouse primary visual cortex. bioRxiv, 2022. + +Edgar Y Walker, Fabian H Sinz, Emmanouil Froudarakis, Paul G Fahey, Taliah Muhammad, Alexander S Ecker, Erick Cobos, Jacob Reimer, Xaq Pitkow, and Andreas S Tolias. Inception in visual cortex: in vivo-silico loops reveal most exciting images. bioRxiv, pp. 506956, 2018. +H Wässle and HJ Riemann. The mosaic of nerve cells in the mammalian retina. Proceedings of the Royal Society of London. Series B. Biological Sciences, 200(1141):441-461, 1978. +Xue-Xin Wei, Jason Prentice, and Vijay Balasubramanian. A principle of economy predicts the functional architecture of grid cells. *Elife*, 4:e08362, 2015. +Anqi Wu, Nicholas A Roy, Stephen Keeley, and Jonathan W Pillow. Gaussian process based nonlinear latent structure discovery in multivariate spike train data. Advances in neural information processing systems, 30, 2017. +Anqi Wu, Stan Pashkovski, Sandeep R Datta, and Jonathan W Pillow. Learning a latent manifold of odor representations from neural responses in piriform cortex. Advances in Neural Information Processing Systems, 31, 2018. +Byron M Yu, John P Cunningham, Gopal Santhanam, Stephen Ryu, Krishna V Shenoy, and Maneesh Sahani. Gaussian-process factor analysis for low-dimensional single-trial analysis of neural population activity. Advances in neural information processing systems, 21, 2008. +Zhijian Zhao, David A Klindt, André Maia Chagas, Klaudia P Szatko, Luke Rogerson, Dario A Protti, Christian Behrens, Deniz Dalkara, Timm Schubert, Matthias Bethge, et al. The temporal structure of the inner retina at a single glance. *Scientific reports*, 10(1):1-17, 2020. +Yi Zhou, Connelly Barnes, Jingwan Lu, Jimei Yang, and Hao Li. On the continuity of rotation representations in neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 5745-5753, 2019. +Chengxu Zhuang, Siming Yan, Aran Nayebi, Martin Schrimpf, Michael C Frank, James J DiCarlo, and Daniel LK Yamins. Unsupervised neural network models of the ventral visual stream. Proceedings of the National Academy of Sciences, 118(3), 2021. + +# APPENDIX + +# A MODEL DETAILS + +All models are trained with the Adam optimizer (Kingma & Ba, 2014), a learning rate of 0.001, temporal chunks of size 128 (64 if data length is smaller than 128) and a batch size of 1. Moreover, training is concluded after the training objective has not improved for 5 steps (10 for grid cell data). All models are implemented in Pytorch (Paszke et al., 2019). The architecture of the encoder is as follows: a 1D grouped convolution with kernel size 9; followed by two layers of 1D convolutions with kernel size 1 (i.e., effectively just MLPs at each time point) and 64 filters (128 for grid cell data), followed by a linear projection onto the dimensionality of the mean and variance parameters required by the variational posterior. The decoder follows the feature sharing tuning curve structure as presented in the paper. All experiments where executed with specified random seeds for data generation, model initialisation and training batch selection to maintain complete reproducibility. + +# A.1 A FAST APPROXIMATION TO THE OBJECTIVE FUNCTION + +Next, we present our simplification of the theoretical setup from (Davidson et al., 2018), concerning the use of von Mises distributions when inferring latent variables on circular manifolds. First, we note that as the variance $\sigma^2$ of a Gaussian and the inverse concentration $1 / \kappa$ of a von Mises approach 0, they both become delta functions. Moreover, they each define the maximum entropy distribution for a fixed variance (concentration) in their respective domains. Hence, the von Mises is also referred to as the circular normal distribution. + +We therefore explored the model behavior when replacing the KL term in Eq. (11) with a simpler expression, akin to the standard VAE KL, which simply pushes the variance of the variational encoder towards 1 (i.e., standard normal), but without constraints on the mean (uniform over the latent space, as the full von Mises prior). Reparameterisation and sampling was then performed by drawing from that Gaussian and adding the scaled perturbation (same as in standard VAEs) to the angle that the variational posterior returned as mean estimate. + +In general, performing variational inference in non-Euclidean spaces is challenging (Falorsi et al., 2019), which has warranted the use of specialized inference procedures in previous latent variable models on such manifolds (Davidson et al., 2018; Falorsi et al., 2019; Jensen et al., 2020; 2022). In this work, we follow the 'ReLie' approach outlined by Falorsi et al. (2019) for general Lie groups, which involves defining a parameterizable (in our case Gaussian) distribution on the tangent space of the group and projecting it onto the manifold using the so-called 'exponential map' of the group. This approach is particularly simple for the toroidal manifolds we consider, where the projection step can be achieved by a simple modulo $2\pi$ operation (Jensen et al., 2020). This leaves the challenge of computing the KL term in Eq. 11, which is given by + +$$ +\operatorname {K L} [ q (z) | p (z) ] = E _ {q (z)} \left[ \log q (z) - \log p (z) \right]. \tag {6} +$$ + +As a prior $p(z)$ , we use a unit Gaussian projected onto the circle, with a mean matched to the posterior mean. Since the KL divergence in Eq. 6 is invariant to a rotation around the circle (Falorsi et al., 2019), we can compute it simply as the KL divergence between two wrapped Gaussian distributions centered at the origin with variances $\sigma_q^2$ and $\sigma_p^2 = 1$ respectively. In general, the projected densities needed in Eq. 6 are given by + +$$ +q _ {\theta} (z) = \sum_ {x \in \mathbb {R}: \exp_ {G} (x) = z} r _ {\theta} (x) | J (x) | ^ {- 1}, \tag {7} +$$ + +as derived in Falorsi et al. (2019). Here, $\exp_G$ is the exponential map, $J(x)$ is the Jacobian at $x$ in the tangent space, and $r_\theta$ is the parameterized reference distribution on the tangent space. + +For the circle, the Jacobian is simply given by the identity $J(x) = 1 \forall x$ . With a zero-centered Gaussian reference distribution, we can therefore rewrite Eq. 7 as + +$$ +q _ {\theta} (z) = \sum_ {k \in \mathbb {Z}} \mathcal {N} (z + 2 k \pi ; \mu = 0, \sigma_ {q} ^ {2}), \tag {8} +$$ + +and similarly for the prior $p(z)$ (Jensen et al., 2020). To approximate this infinite sum, it is necessary to truncate it after a finite number of elements (Falorsi et al., 2019; Jensen et al., 2020; 2022). In the case where $\sigma_q \ll 1$ , it is sufficient to use a single term since there is negligible probability mass outside the area of injectivity $([\pi, \pi])$ . This is in fact the regime we are operating in, since less than $0.2\%$ of the prior probability mass falls outside the interval $[-\pi, \pi]$ , and the posterior variance will in general be smaller than the prior variance. + +Additionally, while the integral in Eq. 6 covers the domain $[- \pi, \pi]$ , we can approximate it with an integral from $-\infty$ to $\infty$ since the posterior probability mass outside the area of injectivity is negligible, $\int_{x = \pi}^{\infty} \mathcal{N}(x; 0, \sigma_q^2) dx \approx 0$ . These approximations together imply that we can simply approximate the KL term in Eq. 6 as the KL between our prior and posterior Gaussians directly in the tangent space, and we verified numerically that this approximation is excellent for $\sigma_q^2 \leq 1$ . We thus obtain a simple analytical expression for the KL: + +$$ +\begin{array}{l} \operatorname {K L} [ q (z) | p (z) ] \approx \operatorname {K L} \left[ \mathcal {N} (z; 0, \sigma_ {q} ^ {2}) | \mathcal {N} (z; 0, 1) \right] (9) \\ = \frac {1}{2} \left(\sigma_ {q} ^ {2} - 1 - \log \sigma_ {q} ^ {2}\right). (10) \\ \end{array} +$$ + +Note that this is only possible because our prior is localized, in contrast to previous work which often uses a more diffuse or even uniform prior distribution (Falorsi et al., 2019; Jensen et al., 2020), and because we consider circular latent spaces where the Jacobian is 1. Since our prior and posterior both factorize across dimensions, these considerations also generalize to higher dimensional spaces, where the multivariate KL divergence is simply the sum across dimensions of the corresponding univariate KL divergences. + +Finally, to verify that these approximations do not affect our results or conclusions, we repeated several key analyses with the variational inference framework described in Davidson et al. (2018). The simplified setup trained about $5 \times$ faster, while behaving nearly identically on all test cases that we evaluated, hence, all experiments in the paper are performed with the simplified objective. We note that this simplified procedure may be of interest to those who might need to iterate over models without access to a large compute cluster. + +# B DATA GENERATION FOR SIMULATIONS + +When conducting the experiments that showcase the scaling of various models with respect to the amount of data (Sec. 4.1), we generate the spikes according to Gaussian-like tuning curves. More specifically, we assume a common shape for each curve (location assigned randomly on $\mathbb{S}^1$ ), with a tuning width of 1.2 radians. Peak rates are set to 0.5 spikes per bin, the background rate to 0.005, with a signal-to-noise ratio of 1 for the Poisson noise. The latent variable is simulated according to a Gaussian process with kernel standard deviation equal to 5.0, and with kernel scale 50.0. It is then projected onto $\mathbb{S}^1$ via the modulo operation. The ensemble detection experiments in Sec. 4.2 use the same data generation, only with multiple (2 or 3) ensembles, with distinct latent variables for each ensemble. + +# C ENSEMBLE DETECTION COMPARISONS + +For raw-pca, we performed k-means clustering on dimensionally reduced neural activity over time (loosely inspired by Lopes-dos Santos et al., 2011; Baden et al., 2016; Hamm et al., 2021). Specifically, we took the projection of the spike matrix onto its first 8 (cross-validated) principal components. We then computed k-means clustering on this reduced matrix with the standard scikit-learn implementation, using a fixed number of 2 (3, depending on the setting) clusters, 100 initializations and 1000 maximum iterations. + +For cov-pca, we performed clustering on the neural covariance matrix (loosely inspired by Carrillo-Reid et al., 2015). Specifically, we computed the covariance across neurons from the spike matrix. Again, we computed the first 8 (cross-validated) principal components of the absolute value of this covariance matrix. The absolute value was taken to preserve any negative or positive dependencies across neurons, as one would presumably observe within an ensemble — removing the modulus operator drastically reduced ensemble detection accuracy. From the projection onto the principal components we proceeded again as above. We also performed a clustering of the inverse of the + +covariance matrix, as a first order approximation to an Ising model (Schneidman et al., 2006), but this approach did not yield results above chance level, hence it was not included in the figures. + +Finally, for the supervised method we performed clustering on the mutual information score (see scikit-learn for implementation) between each neuron's activity, and the true latent variables, as input. Specifically, the features $y$ that were used as input to k-means (same settings as above) were $y_{ij} \sim I[x_i;z_j]$ for every neuron $i$ and every ground truth latent dimension $j$ . This presents an upper bound to the achievable performance, since it assumes supervised knowledge of the true latent variable values. + +# D THE EVIDENCE LOWER BOUND (ELBO) + +Here we show the derivation of the ELBO, which is maximized as part of the objective function during the model training procedure + +$$ +\begin{array}{l} \log p (x) = \log \int p (x | z) p (z) d z = \log \int p (x | z) p (z) \frac {q (z | x)}{q (z | x)} d z \\ = \log E _ {z \sim q (z | x)} \left[ p (x | z) \frac {p (z)}{q (z | x)} \right] \overset {\text {J e s s e n s i n e q u a l i t y}} {\geq} E _ {z \sim q (z | x)} \left[ \log p (x | z) \frac {p (z)}{q (z | x)} \right] \tag {11} \\ = E _ {z \sim q (z | x)} \underbrace {\left[ \log p (x | z) \right]} _ {=: \mathcal {L} _ {\mathrm {r e c}} (x, z)} - \underbrace {E _ {z \sim q (z | x)} \left[ \log q (z | x) - \log p (z) \right]} _ {=: \mathrm {K L} (\mathrm {q} (\mathrm {z} - \mathrm {x}) - \mathrm {p} (\mathrm {z}))} =: \operatorname {E L B O} (q). \\ \end{array} +$$ + +# D.1 TEMPORAL TRANSITION PRIORS + +All experiments in the article are conducted using the objective function from Eq. 11. Extending this with additional terms however, e.g. by including a Laplacian temporal transition prior (Klindt et al., 2021) or a Gaussian transition prior (i.e. an $L_{1}$ or $L_{2}$ penalty across latent time steps, respectively) is relatively simple, and both the $L_{1}$ and $L_{2}$ penalties are included as optional regularization terms in our model. While exhaustive experiments have not been performed regarding these priors, results seem to indicate that the inclusion of these priors do little to improve the model performance in the settings we have studied in the article, which is in agreement with results in Appendix Section E and K regarding the convolutional kernel size. + +# E ABLATION STUDY — CONVOLUTIONAL FILTER + +As mentioned in Sec. 4.1, we conduct a similar model performance comparison between the faeLVMs and mGPLVM, while reducing the kernel size of the convolutional layer for the faeLVMs to 1 (effectively allowing the encoder network to let the variational posterior only depend on the instantaneous neural population activity). This is done to reduce the potential gap in information content available between a convolutional and a non-convolutional model. Note, however, that this applies only to the variational posterior. At inference time, both models infer the best latent at each point in time separately. Experimental settings are precisely the same as those in Sec. 4.1, other than the size of the convolutional kernel. + +One of the main observations from Fig. 8C-D is that the faeLVMs still outperform mGPLVM, even without contributions from the convolutional kernel. In fact, faeLVM-s performs much better now, compared with the results from Fig. 4, achieving results that rivals those of faeLVM-b (Fig. 8A-B) + +# F MODEL EXTENSION — CALCIUM RESPONSES AND VISUAL DATA SIMULATION + +In an effort to improve on the applicability of faeLVM, and showcase its relevance regarding applications to different brain regions, different latent topologies and different input data, we include a toy example on visual data, where we modeled a moving dot stimulus (Fig. 9A) and a population response of retinal ganglion cells with center surround receptive fields and Poisson spiking (Fig. + +![](images/fff7a4981178f207465992f6b90e6a5a650748d8d05b66d9723f5d2ea4ff0564.jpg) +Figure 8: Model performance comparison, with convolutional filter size 1. The models faeLVMn,s,b are described in the main text, mGP is the model from Jensen et al. (2020). A, Mean NLLH (negative log-likelihood, lower is better) of predicted test neuron rate, as a function of amount of training neurons. As the performance is averaged over 20 seeds of varying data, error bars would also reflect the variability in NLLH across data, resulting in inappropriate visualization. Hence, we report the mean rank of 20 seeds for each model at each condition, in an effort to more appropriately capture the variability of the models. B, Same as in A, now as a function of training time points. C, Mean GE (geodesic error, lower is better) between true latent and inferred latent, on test data, with corresponding SEM error bars, as a function of number of training neurons. D, Same as in C, now as a function of amount of training time points. + +![](images/ab1151758de97964bff8a23ca39ae768a706f9ef52e0d6d685c2780a5d07f19f.jpg) + +![](images/c3eb4cc82731bafe87d75b5aeb2c5b22b1968f60647e7884d02150819c651c77.jpg) + +![](images/ff20e52c62dcaa42c52aede10790293fb549d0a6b7b74a875306e0a052b4729f.jpg) + +![](images/801d9ac8cc789f5fb6e920d0c7b055ed305f6c75c42ead900b7d9b43d9bf2312.jpg) +Figure 9: Visual data, toy example. A, Scatter plot of trajectory of simulated visual stimulus, colored according to its temporal evolution. B, Receptive fields for three training neurons. C, Same three training neurons, showing firing rate in shaded dark blue and the corresponding Poisson spikes in orange. D, Neural responses after passing the neural activity from C through a calcium kernel. E, Scatter plot of true latent trajectory against inferred latent trajectory (variational mean). F True Ca2+ neural responses (grey) plotted against predicted neural responses for three test neurons (black). + +![](images/7a6c8b81cd598a12657d0815ec3dd0a54b73bef3948ca683319b8df03e74fb5d.jpg) + +![](images/86cf83ea0d29b431c5ac220f1ff8645e1beaea84ffe9da41ce59430b8006f0bb.jpg) + +![](images/f24db137a7ec26a1493498806bf1b31e9c9557fd1953ac1f21a48fa5e3e1614b.jpg) + +![](images/9de1deb29390802ff900336d74189c2b88427aac0822ed2dfe2b8d3dbd47cdf6.jpg) + +![](images/8a97c80eb7821bee95935a5045547e4d458fe14e541d4dc6a93277bda7221e83.jpg) + +![](images/80b07f941b17676a4405f5effef8138d3c4aeb7049277fcb2f6596588aefaa66.jpg) + +9B-C). Each neuron's spiking response was then convolved with a double exponential calcium fluorescence kernel (Fig. 9D). We further extended faeLVM by including a Gaussian likelihood as a modeling option, as well as an option to infer latent trajectories not restricted to circular and toroidal latent manifolds. + +Results can be seen in Fig. 9E-F, where the model is able to infer the correct two-dimensional latent variable, as well as accurately predict calcium responses of test neurons on test data. Although this experiment is less comprehensive, being a toy example, it still gives a clear indication that our model is also applicable to both calcium traces and non-grid and head direction cells. + +# G ALL GRID CELL RATE MAPS + +In this section, we showcase rate maps for all neurons in each of the two ensembles (149 and 145 neurons in the first and second grid cell module respectively). The data used is the same as discussed in Sec. 4.4, pre-processed in the same way, and we used the same model to produce latent decodings, receptive fields and ensembles. + +Fig. 10 and Fig. 11 show the rate maps (using $50 \times 50$ spatial bins, smoothed for visualization purposes in the same manner as Gardner et al. (2022), with a Gaussian kernel of smoothing width + +![](images/9b126f0c526df6f5f9ad20144f0af269d5f6d1372fd5234b3d7e6f4dcaa7ab80.jpg) +Figure 10: All rate maps, first grid cell module. + +![](images/f1726fee2281894dc36171c0a2cc536703c6026e603a55038194cd5731e12644.jpg) +Figure 11: All rate maps, second grid cell module. + +![](images/de95c768d6e10e5a7243be6e9155feb95320d1419ec8de99f274750e7852361d.jpg) +Figure 12: Supplementary visualizations for analyses on real datasets. A, Recorded mouse head direction ('True HD') and inferred latent trajectories on test data. Results from the experiment on head direction data, Sec. 4.3. B, Dynamics of the inferred toroidal coordinates plotted as a function of the $(x,y)$ spatial position of the animal (two tori, each with two circular coordinates, hence four figures). Results from the experiment on grid cell data, Sec. 4.4. + +![](images/c35429322a10e269f5fbc8ff5c62656f8a44b6485aa99ca43540cf07fd42e0c3.jpg) + +![](images/52e22d122b8847e9594b4282b3d725d2fb0791ad25bc4c9cf760ce48cf3180e0.jpg) + +![](images/44f4dcbdcface8be45a62d584b37383f8aedfcb47404711fea34b28f48877fdc.jpg) + +![](images/7177585dbbac824b8744ea1f078e3337e3a416b282bd8dd0aabad1cc991b58a8.jpg) + +2.75), both as function of spatial position and inferred toroidal coordinates. For the rate maps in toroidal coordinates, we also include the inferred receptive field center and width. Neural rate maps are shown in decreasing spatial information content (Skaggs et al., 1992; Gardner et al., 2022), going from left to right, top to bottom. + +As mentioned in Sec. 4.4, we clearly see the more ambiguous rate maps at the bottom of these two figures (in particular, the three-four bottom-most rows). Here, the spatial resolution is not as distinct as for the more informative neurons, and the rate maps less clear, for which one might surmise that these neurons need not necessarily belong to the module originally assigned to. + +# H ADDITIONAL VISUALIZATIONS FOR HEAD DIRECTION AND GRID CELL DATA + +To supplement the results shown in Sec. 4.3 and Sec. 4.4, we have included additional figures for both the head direction application and the grid cell application. More precisely, Fig. 12A shows the inferred variational mean of faeLVM-n plotted against the recorded mouse head direction (now as trajectories, in contrast to the scatterplot in Fig. 6A, while Fig. 12B shows inferred latent dynamics on grid cell data, as function of spatial position. As there is no way of recording the 'true' toroidal coordinates (akin to what is done in the head direction dataset), this figure is included in an effort to demonstrate the clear correspondence between each of the inferred toroidal axes and the spatial position, with the results being in agreement with what was found in Gardner et al. (2022). + +# I EXTENDED ENSEMBLE DETECTION SIMULATION + +In this section we present an additional experiment related to the ensemble detection task. Namely, we ask the model to separate five distinct ring-like ensembles, $z_{j}\in \mathbb{S}^{1}$ , to complement the experiments from Section 4.2, which only considered two and three ensembles. + +From Fig. 13, we can see that faeLVM-b is able to separate the five ensembles quite clearly. The weights in Fig. 13A is approaching the desired one-hot encoding, and we see that the five inferred ensembles correspond very nicely with the true ensembles (Fig. 13C). The model is also able to accurately predict spike rates on held out neurons from each ensemble (13B). Thus, this simulation provides evidence that our model is also able to work on more challenging ensemble separation tasks, and is not only limited to lower ensemble numbers. + +# J HYBRID INFERENCE + +# J.1 OVERVIEW + +Here, we give an overview on how the hybrid inference is performed. In contrast to the traditional variational approach, where one uses a single sample from the variational posterior as prediction for the latent variable, we propose drawing a selection of samples, then performing gradient descent on said latents using the Adam optimizer. Specifically, if $z$ are the latents for the test set (as inferred by + +![](images/0dd0c5c0aa768b3fa12381aadcee1cc9357a8cb90a5e2f35f32185fe21b22ccf.jpg) + +![](images/5ca5bf9f81caf63a78078a0d2ed74887e748316b4d21dc633487fdd21137111a.jpg) +C + +![](images/7e611f8bc06bbeff7019f9f2424e2393202de675663a51417aeef38d4f26697b.jpg) +Figure 13: Ensemble detection of 5 circles. A, Learned ensemble weights for the neurons belonging to five unique circular ensembles. B, True spike rate (grey) vs predicted spike rate (black) for five randomly selected test neurons, one from each ensemble. C, Scatter plot of true latent trajectory against inferred latent trajectory. + +the encoder and variational posterior) and $x$ the responses of the training neurons on the test set, we maximize + +$$ +z ^ {*} = \max _ {z} \log p (x | z) \tag {12} +$$ + +for 2000 steps with the Adam optimizer and a learning rate of 0.001. We perform this in parallel on $M = 10$ distinct samples from the variational posterior and pick the one with the highest final likelihood (note that all samples usually converge to the same value). We emphasize that all model parameters are fixed during hybrid inference, and the optimization only affects the sampled latents. + +Empirically, we observe that this not only improves the likelihood for the training neurons (i.e., the objective we are maximizing), but crucially also the likelihood of the test neurons. This means that we are not just overfitting but actually improving our point estimates of the latents in this inference procedure. We leave optimization of the full likelihood, including uncertainty estimates on the latents, for future research. + +# J.2 HYBRID INFERENCE SIMULATIONS + +For evaluate of the performance gain with hybrid inference at test-time, we consider six variations of the faeLVM; that being the three cases described in Sec. 3, each alternative including a case of using hybrid inference and one using the standard variational posterior approach (fae vs v-fae). + +As in Sec. 4.1, we divide our data into four parts (Fig. 3), generate a 1D periodic latent variable and simulate spikes according to a Poisson distribution with Gaussian tuning curves. We fix $T_{\mathrm{test}}$ and $N_{\mathrm{test}}$ (1000 and 30), vary $T_{\mathrm{train}}$ and $N_{\mathrm{train}}$ over a selection of values, and for each condition, repeat the experiment over 20 seeds (synthetic data is different for each seed, but all of the models are trained on the same dataset, to ensure that comparisons are still valid), reporting mean negative log-likelihood (NLLH) and mean geodesic error (GE) on test data. + +The results presented in Table 1 indicate that performance, in almost every case, increases substantially by including the hybrid inference step. Hence, all other experiments performed in this article are done solely using the hybrid inference where applicable (e.g., when applying the model to grid + +Table 1: Hybrid inference comparison. Table showing mean negative log-likelihood (NLLH) and mean geodesic error (GE) for the six models specified (lower is better for both criterions), under varying amounts of synthetically generated training data with different numbers of training neurons $(N)$ and different training dataset lengths $(T)$ . + +
N / T30 / 10030 / 50030 / 100015 / 100045 / 1000
LVMNLLHGENLLHGENLLHGENLLHGENLLHGE
v-fae-n127450.5789710.2887810.2791100.4586420.27
v-fae-s117980.6491670.3489490.3197180.4088200.31
v-fae-b109120.5091520.3688300.3094920.3386330.26
fae-n119750.5887750.2086080.1790180.4484150.09
fae-s109630.4286940.1386570.1494600.2984910.13
fae-b100400.2586360.1285010.1292270.2382670.05
+ +cell data, evaluations are done in-training-sample, and without the focus on latent prediction on a test set, hence there is no need for hybrid inference at test-time). + +# K HYPERPARAMETER SEARCH + +To investigate hyperparameters and their effect, we selected relevant parameters and estimated their ranges based on related literature. The relevant parameters can be seen on the left in Table 2. + +To determine optimal values of hyperparameters, we relied on a random search strategy. A grid search is not feasible due to the curse of dimensionality, and a random search can also be more effective (Bergstra & Bengio, 2012). Furthermore, the random search can easily be used for discrete and continuous variables, that could be on linear or logarithmic scales. The selected scales and ranges, can be found in the middle in Table 2. + +In total, we sample 500 hyperparameter configurations. Next, we train and test each configuration for 3 random seeds. We evaluate the models on the test accuracy and mean correlation. The final selected model is shown on the far right in Table 2. + +Lastly, we also measure whether there is an ordinal correlation (Spearman) between the varied factors and the test LLH. The results are shown in Fig. 14. We see that learning the variance (learn_var) increases the performance on average. Also, lower learning rates and larger batch-sizes lead to better results. Lastly, also lower weighting for the KL term leads to better results. + +Table 2: Hyperparameter search. We show our selected hyperparameters and their corresponding ranges. + +
HyperparameterRangesBest
kernel_sizechoice([1, 9, 17])1
num Hiddenchoice([16, 32, 64, 128, 256, 512])128
sharedchoice([\True, False])False
learn_coeffchoice([\True, False])True
learn_meanchoice([\True, False])False
learn_varchoice([\True, False])False
isotropicchoice([\True, False])False
num BASISchoice([1, 2, 4, 8])4
nonlinearitychoice([exp, softplus])softplus
batch_sizechoice([1, 16, 32])32
batch_lengthchoice([64, 128])64
learning_rateloguniform(1e-4, 1e-1)0.001003
num_worsechoice([10, 50, 100])10
weight_klchoice([0., loguniform(1e-9, 1e0)])0.0
weight_timechoice([0., loguniform(1e-9, 1e0)])0.0
weight_entropychoice([0., loguniform(1e-9, 1e0)])0.0
+ +![](images/408ff9d7b04d434f30771edcb452f63ba6dba59446aeda7356d89c28a4c6ffdb.jpg) +Figure 14: Correlations with test LLH. A, Spearman correlation. B, P-values. + +![](images/ebeee0aa2437dbd4826d11d8c5a67d05d5ff497d1295dc61f08f3a84cd98f021.jpg) \ No newline at end of file diff --git a/understandingneuralcodingonlatentmanifoldsbysharingfeaturesanddividingensembles/images.zip b/understandingneuralcodingonlatentmanifoldsbysharingfeaturesanddividingensembles/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..828f1f8e21d0efab75808ba781c482857e6d7b11 --- /dev/null +++ b/understandingneuralcodingonlatentmanifoldsbysharingfeaturesanddividingensembles/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39356b81378753c20a16c55364fc8b1f2aedf05ef9a8d7f5b7788dace72d871c +size 1544487 diff --git a/understandingneuralcodingonlatentmanifoldsbysharingfeaturesanddividingensembles/layout.json b/understandingneuralcodingonlatentmanifoldsbysharingfeaturesanddividingensembles/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..a1f7e4697a63b32cc911678cc51c275d3a49f59a --- /dev/null +++ b/understandingneuralcodingonlatentmanifoldsbysharingfeaturesanddividingensembles/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3fe75d0b997b0e87b2aa7b46005181981f02354570cc2497614689605212cbdc +size 721455 diff --git a/understandingnewtasksthroughthelensoftrainingdataviaexponentialtilting/afecc5cc-8c03-4938-9651-5c291fd3f262_content_list.json b/understandingnewtasksthroughthelensoftrainingdataviaexponentialtilting/afecc5cc-8c03-4938-9651-5c291fd3f262_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..2a9fab10cedcb8bcabb3b2de28099189e7cb4700 --- /dev/null +++ b/understandingnewtasksthroughthelensoftrainingdataviaexponentialtilting/afecc5cc-8c03-4938-9651-5c291fd3f262_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f7b14aa1c4244e5829a4f13d74ea30ea933028e4f675fa2e16694c073a3a6f8c +size 92682 diff --git a/understandingnewtasksthroughthelensoftrainingdataviaexponentialtilting/afecc5cc-8c03-4938-9651-5c291fd3f262_model.json b/understandingnewtasksthroughthelensoftrainingdataviaexponentialtilting/afecc5cc-8c03-4938-9651-5c291fd3f262_model.json new file mode 100644 index 0000000000000000000000000000000000000000..7b2ac756ddbc0005d473536dbfa40846090da838 --- /dev/null +++ b/understandingnewtasksthroughthelensoftrainingdataviaexponentialtilting/afecc5cc-8c03-4938-9651-5c291fd3f262_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2630552f6dd6f2d12f8a9ac9ea980a1623d0d55ff1e7e97d8824c18e15b4be00 +size 115901 diff --git a/understandingnewtasksthroughthelensoftrainingdataviaexponentialtilting/afecc5cc-8c03-4938-9651-5c291fd3f262_origin.pdf b/understandingnewtasksthroughthelensoftrainingdataviaexponentialtilting/afecc5cc-8c03-4938-9651-5c291fd3f262_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d2b54eebb35f96b24c6bf77f95183475ebb2a52d --- /dev/null +++ b/understandingnewtasksthroughthelensoftrainingdataviaexponentialtilting/afecc5cc-8c03-4938-9651-5c291fd3f262_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:00e15591731c8780deea993b2431b51a018c824f488214bf73f36c9fa1fb1f3f +size 806392 diff --git a/understandingnewtasksthroughthelensoftrainingdataviaexponentialtilting/full.md b/understandingnewtasksthroughthelensoftrainingdataviaexponentialtilting/full.md new file mode 100644 index 0000000000000000000000000000000000000000..4b54bd753620b0ab25c202359716e1f7666e12e6 --- /dev/null +++ b/understandingnewtasksthroughthelensoftrainingdataviaexponentialtilting/full.md @@ -0,0 +1,410 @@ +# UNDERSTANDING NEW TASKS THROUGH THE LENS OF TRAINING DATA VIA EXPONENTIAL TILTING + +# Subha Maity + +Department of Statistics University of Michigan smaity@umich.edu + +# Mikhail Yurochkin + +IBM Research +MIT-IBM Watson AI lab +mikhail.yurochkin@ibm.com + +# Moulinath Banerjee + +Department of Statistics +University of Michigan +moulib@umich.edu + +# Yuekai Sun + +Department of Statistics +University of Michigan +yuekai@umich.edu + +# ABSTRACT + +Deploying machine learning models on new tasks is a major challenge due to differences in distributions of the train (source) data and the new (target) data. However, the training data likely captures some of the properties of the new task. We consider the problem of reweighing the training samples to gain insights into the distribution of the target task. Specifically, we formulate a distribution shift model based on the exponential tilt assumption and learn train data importance weights minimizing the KL divergence between labeled train and unlabeled target datasets. The learned train data weights can then be used for downstream tasks such as target performance evaluation, fine-tuning, and model selection. We demonstrate the efficacy of our method on WATERBIRDS and BREEDS benchmarks. + +# 1 INTRODUCTION + +Machine learning models are often deployed in a target domain that differs from the domain in which they were trained and validated in. This leads to the practical challenges of adapting and evaluating the performance of models on a new domain without costly labeling of the dataset of interest. For example, in the Inclusive Images challenge (Shankar et al., 2017), the training data largely consists of images from countries in North America and Western Europe. If a model trained on this data is presented with images from countries in Africa and Asia, then (i) it is likely to perform poorly, and (ii) its performance in the training (source) domain may not mirror its performance in the target domain. However, due to the presence of a small fraction of images from Africa and Asia in the source data, it may be possible to reweigh the source samples to mimic the target domain. + +In this paper, we consider the problem of learning a set of importance weights so that the reweighted source samples closely mimic the distribution of the target domain. We pose an exponential tilt model of the distribution shift between the train and the target data and an accompanying method that leverages unlabeled target data to fit the model. Although similar methods are widely used in statistics Rosenbaum & Rubin (1983) and machine learning Sugiyama et al. (2012) to train and evaluate models under covariate shift (where the decision function/boundary does not change), one of the main benefits of our approach is it allows concept drift (where the decision boundary/function are expected to differ) (Cai & Wei, 2019; Gama et al., 2014) between the source and the target domains. We summarize our contributions below: + +- In Section 3 we develop a model and an accompanying method for learning source importance weights to mimic the distribution of the target domain without labeled target samples. +- In Section 4 we establish theoretical guarantees on the quality of the weight estimates and their utility in the downstream tasks of fine-tuning and model selection. + +- We demonstrate applications of our method on WATERBIRDS (Sagawa et al., 2019) (Section 5), BREEDS (Santurkar et al., 2020) (Section 6) and synthetic (Appendix C) datasets. + +# 2 RELATED WORK + +Out-of-distribution generalization is essential for safe deployment of ML models. There are two prevalent problem settings: domain generalization and subpopulation shift (Koh et al., 2020). Domain generalization typically assumes access to several datasets during training that are related to the same task, but differ in their domain or environment (Blanchard et al., 2011; Muandet et al., 2013). The goal is to learn a predictor that can generalize to unseen related datasets via learning invariant representations (Ganin et al., 2016; Sun & Saenko, 2016), invariant risk minimization (Arjovsky et al., 2019; Krueger et al., 2021), or meta-learning (Dou et al., 2019). Domain generalization is a very challenging problem and recent benchmark studies demonstrate that corresponding methods rarely improve over vanilla empirical risk minimization (ERM) on the source data unless given access to labeled target data for model selection (Gulrajani & Lopez-Paz, 2020; Koh et al., 2020). + +Subpopulation shift setting assumes that both train and test data consist of the same groups with different group fractions. This setting is typically approached via distributionally robust optimization (DRO) to maximize worst group performance (Duchi et al., 2016; Sagawa et al., 2019), various reweighing strategies (Shimodaira, 2000; Byrd & Lipton, 2019; Sagawa et al., 2020; Idrissi et al., 2021). These methods require group annotations which could be expensive to obtain in practice. Several methods were proposed to sidestep this limitation, however they still rely on a validation set with group annotations for model selection to obtain good performance (Hashimoto et al., 2018; Liu et al., 2021; Zhai et al., 2021; Creager et al., 2021). Our method is most appropriate for the subpopulation shift setting (see Section 3), however it differs in that it does not require group annotations, but requires unlabeled target data. + +Model selection on out-of-distribution (OOD) data is an important and challenging problem as noted by several authors (Gulrajani & Lopez-Paz, 2020; Koh et al., 2020; Zhai et al., 2021; Creager et al., 2021). Xu & Tibshirani (2022); Chen et al. (2021b) propose solutions specific to covariate shift based on parametric bootstrap and reweighing; Garg et al. (2022); Guillory et al. (2021); Yu et al. (2022) align model confidence and accuracy with a threshold; Jiang et al. (2021); Chen et al. (2021a) train several models and use their ensembles or disagreement. Our importance weighting approach is computationally simpler than the latter and is more flexible in comparison to the former, as it allows for concept drift and can be used in downstream tasks beyond model selection as we demonstrate both theoretically and empirically. + +Domain adaptation is another closely related problem setting. Domain adaptation (DA) methods require access to labeled source and unlabeled target domains during training and aim to improve target performance via a combination of distribution matching (Ganin et al., 2016; Sun & Saenko, 2016; Shen et al., 2018), self-training (Shu et al., 2018; Kumar et al., 2020), data augmentation (Cai et al., 2021; Ruan et al., 2021), and other regularizers. DA methods are typically challenging to train and require retraining for every new target domain. On the other hand, our importance weights are easy to learn for a new domain allowing for efficient fine-tuning, similar to test-time adaptation methods (Sun et al., 2020; Wang et al., 2020; Zhang et al., 2020), which adjust the model based on the target unlabeled samples. Our importance weights can also be used to define additional regularizers to enhance existing DA methods. + +Importance weighting has often been used in the domain adaptation literature on label shift (Lipton et al., 2018; Azizzadenesheli et al., 2019; Maity et al., 2022) and covariate shift (Sugiyama et al., 2007; Hashemi & Karimi, 2018) but the application has been lacking in the area of concept drift models (Cai & Wei, 2019; Maity et al., 2021), due to the reason that it is generally impossible to estimate the weights without seeing labeled data from the target. In this paper, we introduce an exponential tilt model which accommodates concept drift while allowing us to estimate the importance weights for the distribution shift. + +# 3 THE EXPONENTIAL TILT MODEL + +Notation We consider a $K$ -class classification problem. Let $\mathcal{X} \in \mathbf{R}^d$ and $\mathcal{Y} \triangleq [K]$ be the space of inputs and set of possible labels, and $P$ and $Q$ be probability distributions on $\mathcal{X} \times \mathcal{Y}$ for the + +source and target domains correspondingly. A (probabilistic) classifier is a map $f: \mathcal{X} \to \Delta^{K-1}$ . We define $p\{x, Y = k\}$ as the weighted source class conditional density, i.e. $p\{x, Y = k\} = p\{x \mid Y = k\} \times P\{Y = k\}$ , where $p\{x \mid Y = k\}$ is the density of the source feature distribution in class $k$ and $P\{Y = k\}$ is the class probability in source. We similarly define $q\{x, Y = k\}$ for target. + +We consider the problem of learning importance weights on samples from a source domain so that the weighted source samples mimic the target distribution. We assume that the learner has access to labeled samples $\{(X_{P,i},Y_{P,i})\}_{i = 1}^{n_P}$ from the source domain and and unlabeled samples $\{X_{Q,i}\}_{i = 1}^{n_Q}$ from the target domain. The learner's goal is to estimate a weight function $\omega (x,y) > 0$ such that + +$$ +\mathbf {E} \left[ \omega \left(X _ {P}, Y _ {P}\right) g \left(X _ {P}, Y _ {P}\right)\right] \approx \mathbf {E} \left[ g \left(X _ {Q}, Y _ {Q}\right)\right] \text {f o r a l l (r e a s o n a b l e)} g: \mathcal {X} \times \mathcal {Y} \rightarrow \mathbf {R}. \tag {3.1} +$$ + +Ideally, $\omega = \frac{dQ}{dP}$ is the likelihood ratio between the source and target domains (this leads to equality in (3.1)), but learning this weight function is generally impossible without labeled samples from the target domain (David et al., 2010). Thus we must impose additional restrictions on the domains. + +The exponential tilt model We assume that there is a vector of sufficient statistics $T:\mathcal{X}\to \mathbf{R}^p$ and the parameters $\{\theta_k\in \mathbf{R}^p,\alpha_k\in \mathbf{R}\}_{k = 1}^{K}$ such that + +$$ +\log \frac {q \{x , Y = k \}}{p \{x , Y = k \}} = \theta_ {k} ^ {\top} T (x) + \alpha_ {k} \text {f o r a l l} k \in [ K ]; \tag {3.2} +$$ + +i.e. $q\{x, Y = k\}$ is a member of the exponential family with base measure $p\{x, Y = k\}$ and sufficient statistics $T$ . We call (3.2) the exponential tilt model. It implies the importance weights between the source and target samples are + +$$ +\omega (x, y) = \exp \left(\theta_ {y} ^ {\top} T (x) + \alpha_ {y}\right). +$$ + +Model motivation The exponential tilt model is motivated by the rich theory of exponential families in statistics. In machine learning, it was used for learning with noisy labels and for improving worst-group performance when group annotations are available (Li et al., 2020; 2021). It is also closely related to several common models in transfer learning and domain adaptation. In particular, it implies there is a linear concept drift between the source and target domains. It also extends the widely used covariate shift (Sugiyama & Kawanabe, 2012) and label shift models (Alexandari et al., 2020; Lipton et al., 2018; Azizzadenesheli et al., 2019; Maity et al., 2022; Garg et al., 2020) of distribution shifts. It extends the covariate shift model because the exponential tilt model permits (linear in $T(X)$ ) concept drifts between the source and target domains; it extends the label shift model because it allows the class conditionals to differ between the source and target domains. It does, however, come with a limitation: implicit in the model is the assumption that there is some amount of overlap between the source and target domains. In the subpopulation shift setting, this assumption is always satisfied, while in domain generalization it may be violated if the new domain drastically differs from the source data (see Appendix C for a synthetic data example). + +Choosing $T$ The goal of $T$ is to identify the common subpopulations across domains, such that + +$$ +\left(X _ {P}, Y _ {P}\right) \mid \left\{T \left(X _ {P}\right) = t, Y _ {P} = k \right\} \stackrel {{d}} {{\approx}} \left(X _ {Q}, Y _ {Q}\right) \mid \left\{T \left(X _ {Q}\right) = t, Y _ {P} = k \right\}. +$$ + +If $T$ segments the source domain into its subpopulations (i.e. the subpopulations are $\{(x,y) \in \mathcal{X} \times \mathcal{Y} \mid T(x) = t, y = k\}$ for different values of $t$ 's and $k$ 's), then it is possible to achieve perfect reweighting of the source domain with the exponential tilt model: the weight of the $\{T(X) = t, Y = k\}$ subpopulation is $\exp(\theta_k^\top t + \alpha_k)$ . However, in practice, such a $T$ that perfectly segments the subpopulations may not exist (e.g. the subpopulations may overlap) or is very hard to learn (e.g. we don't have prior knowledge of the subpopulations to guide $T$ ). + +If no prior knowledge of the domains is available, we can use a neural network to parameterize $T$ and learn its weights along with the tilt parameters, or simply use a pre-trained feature extractor as $T$ , which we demonstrate to be sufficiently effective in our empirical studies. We also study the effects of misspecification of $T$ using a synthetic dataset example in Appendix C. + +Fitting the exponential tilt model We fit the exponential tilt model via distribution matching. This step is based on the observation that under the exponential tilt model (3.2) + +$$ +q _ {X} \{x \} = \sum_ {k = 1} ^ {K} p \{x, Y = k \} \exp \left(\theta_ {k} ^ {\top} T (x) + \alpha_ {k}\right), \tag {3.3} +$$ + +where $q_{X}$ is the (marginal) density of the inputs in the target domain. It is possible to obtain an estimate $\widehat{q}_{X}$ of $q_{X}$ from the unlabeled samples $\{X_{i,Q}\}_{i=1}^{n}$ and estimates $\widehat{p}\{x,Y=k\}$ of the $p\{x,Y=k\}$ 's from the labeled samples $\{(X_{i,P},Y_{i,P})\}_{i=1}^{m}$ . This suggests we find $\theta_{k}$ 's and $\alpha_{k}$ 's such that + +$$ +\sum_ {k = 1} ^ {K} \widehat {p} \{x, Y = k \} \exp \left(\theta_ {k} ^ {\top} T (x) + \alpha_ {k}\right) \approx \widehat {q} _ {X} \{x \}. +$$ + +Note that the $\theta_{k}$ 's and $\alpha_{k}$ 's are dependent because $\widehat{q}_X$ must integrate to one. We enforce this restriction as a constraint in the distribution matching problem: + +$$ +\left\{\left(\hat {\theta} _ {k}, \hat {\alpha} _ {k}\right) \right\} _ {k = 1} ^ {K} \in \left\{ \begin{array}{l} \arg \min _ {\left\{\left(\theta_ {k}, \alpha_ {k}\right) \right\} _ {k = 1} ^ {K}} D \left(\widehat {q} _ {X} \{x \} \| \sum_ {k = 1} ^ {K} \widehat {p} \{x, Y = k \} \exp \left(\theta_ {k} ^ {\top} T (x) + \alpha_ {k}\right)\right) \\ \text {s u b j e c t t o} \int_ {\mathcal {X}} \sum_ {k = 1} ^ {K} \widehat {p} \{x, Y = k \} \exp \left(\theta_ {k} ^ {\top} T (x) + \alpha_ {k}\right) d x = 1, \end{array} \right. \tag {3.4} +$$ + +where $D$ is a discrepancy between probability distributions on $\mathcal{X}$ . Although there are many possible choices of $D$ , we pick the Kullback-Leibler (KL) divergence in the rest of this paper because it leads to some computational benefits. We reformulate the above optimization for KL-divergence to relax the constraint which we state in the following lemma. + +Lemma 3.1. If $D$ is the Kullback-Leibler (KL) divergence then optima in (3.3) is achieved at $\{(\hat{\theta}_k,\hat{\alpha}_k)\}_{k = 1}^K$ where + +$$ +\begin{array}{l} \left\{\left(\hat {\theta} _ {k}, \hat {\alpha} _ {k} ^ {\prime}\right) \right\} _ {k = 1} ^ {K} \in \arg \max _ {\left\{\left(\theta_ {k}, \alpha_ {k} ^ {\prime}\right) \right\} _ {k = 1} ^ {K}} \mathbf {E} _ {\widehat {Q} _ {X}} \left[ \log \left\{\sum_ {k = 1} ^ {K} \widehat {\eta} _ {P, k} (X) e x p \left(\theta_ {k} ^ {\top} T (X) + \alpha_ {k} ^ {\prime} \right. \right\} \right] \\ - \log \left\{\mathbf {E} _ {\hat {P}} \big [ e x p (\theta_ {Y} ^ {\top} T (X) + \alpha_ {Y} ^ {\prime}) \big ] \right\} \\ \end{array} +$$ + +$\widehat{\eta}_{P} = \{\widehat{\eta}_{P,k}\}_{k=1}^{K}$ is a probabilistic classifier for $P$ and $\hat{\alpha}_{k} = \hat{\alpha}_{k}^{\prime} - \log \left\{\mathbf{E}_{\widehat{P}}\bigl[\exp(\hat{\theta}_{Y}^{\top}T(X) + \hat{\alpha}_{Y}^{\prime})\bigr]\right\}$ . + +One benefit of minimizing the KL divergence is that the learner does not need to estimate the $p\{x, Y = k\}$ 's, a generative model that is difficult to train. They merely need to train a discriminative model to estimate $\hat{\eta}_P$ from the (labeled) samples from the source domain. + +We plug the fitted $\hat{\theta}_k$ 's and $\hat{\alpha}_k$ 's into (3.5) to obtain Exponential Tilt Reweighting Alignment (ExTRA) importance weights: + +$$ +\widehat {\omega} (x, y) = \exp \left(\widehat {\theta} _ {y} ^ {\top} T (x) + \widehat {\alpha} _ {y}\right). \tag {3.5} +$$ + +We summarize the ExTRA procedure in Algorithm 1 in Appendix B.2. + +Next we describe two downstream tasks where ExTRA weights can be used: + +1. ExTRA model evaluation in the target domain. Practitioners may estimate the target performance of a model in the target domain by reweighing the empirical risk in the source domain: + +$$ +\mathbf {E} \left[ \ell (f (X _ {Q}), Y _ {Q}) \right] \approx \frac {1}{n _ {P}} \sum_ {i = 1} ^ {n _ {P}} \ell (f (X _ {P, i}), Y _ {P, i}) \widehat {\omega} (X _ {P, i}, Y _ {P, i}), \tag {3.6} +$$ + +where $\ell$ is a loss function. This allows to evaluate models in the target domain without target labeled samples even in the presence of concept drift between the training and target domain. + +2. ExTRA fine-tuning for target domain performance. Since the reweighted empirical risk (in the source domain) is a good estimate of the risk in the target domain, practitioners may fine-tune models for the target domain by minimizing the reweighted empirical risk: + +$$ +\widehat {f} _ {Q} \in \arg \min _ {f \in \mathcal {F}} \mathbf {E} _ {\widehat {P}} [ \ell (f (X), Y) \widehat {\omega} (X, Y) ]. \tag {3.7} +$$ + +We note that the correctness of (3.4) depends on the identifiability of the $\theta_{k}$ 's and $\alpha_{k}$ 's from (3.3); i.e. the uniqueness of the parameters that satisfy (3.3). As long as the tilt parameters are identifiable, then (3.4) provides consistent estimates of them. However, without additional assumptions on the $p\{x,Y = k\}$ 's and $T$ , the tilt parameters are generally unidentifiable from (3.3). Next we elaborate on the identifiability of the exponential tilt model. + +# 4 THEORETICAL PROPERTIES OF EXPONENTIAL TILTING + +# 4.1 IDENTIFIABILITY OF THE EXPONENTIAL TILT MODEL + +To show that the $\theta_{k}$ 's and $\alpha_{k}$ 's are identifiable from (3.3), we must show that there is a unique solution to (3.3). Unfortunately, this is not always the case. For example, consider a linear discriminant + +analysis (LDA) problem in which the class conditionals drift between the source and target domains: + +$$ +p \{x, Y = k \} = \pi_ {k} \phi (x - \mu_ {P, k}), \quad q \{x, Y = k \} = \pi_ {k} \phi (x - \mu_ {Q, k}), +$$ + +where $\phi$ is the standard multivariate normal density, $\pi_k\in (0,1)$ are the class proportions in both source and target domains, and $\mu_{P,k}$ 's (resp. the $\mu_{Q,k}$ 's) are the class conditional means in the source (resp. target) domains. We see that this problem satisfies the exponential tilt model with $T(x) = x$ : + +$$ +\log \frac {q \{x , Y = k \}}{p \{x , Y = k \}} = (\mu_ {Q, k} - \mu_ {P, k}) ^ {\top} x - \frac {1}{2} \| \mu_ {Q, k} \| _ {2} ^ {2} + \frac {1}{2} \| \mu_ {P, k} \| _ {2} ^ {2}. +$$ + +This instance of the exponential tilt model is not identifiable. Any permutation of the class labels $\sigma : [K] \to [K]$ also leads to the same (marginal) distribution of inputs: + +$$ +\begin{array}{l} \sum_ {k = 1} ^ {K} p \{x, Y = k \} \exp \left(\left(\mu_ {Q, k} - \mu_ {P, k}\right) ^ {\top} x + \frac {1}{2} \| \mu_ {P, k} \| _ {2} ^ {2} - \frac {1}{2} \| \mu_ {Q, k} \| _ {2} ^ {2}\right) \\ = \sum_ {k = 1} ^ {K} p \{x, Y = k \} \exp \left(\left(\mu_ {Q, \sigma (k)} - \mu_ {P, k}\right) ^ {\top} x + \frac {1}{2} \| \mu_ {P, k} \| _ {2} ^ {2} - \frac {1}{2} \| \mu_ {Q, \sigma (k)} \| _ {2} ^ {2}\right). \\ \end{array} +$$ + +From this example, we see that the non-identifiability of the exponential tilt model is closely related to the label switching problem in clustering. Intuitively, the exponential tilt model in the preceding example is too flexible because it can tilt any $p\{x,Y = k\}$ to $q\{x,Y = l\}$ . Thus there is ambiguity in which $p\{x,Y = k\}$ tilts to which $q\{x,Y = l\}$ . In the rest of this subsection, we present an identification restriction that guarantees the identifiability of the exponential tilt model. + +A standard identification restriction in related work on domain adaptation is a clustering assumption. For example, Tachet et al. (2020) assume there is a partition of $\mathcal{X}$ into disjoint sets $\mathcal{X}_k$ such that $\mathrm{supp}(P\{\cdot \mid Y = k\})$ , $\mathrm{supp}(Q\{\cdot \mid Y = k\}) \subset \mathcal{X}_k$ for all $k \in [K]$ . This assumption is strong: it implies there is a perfect classifier in the source and target domains. Here we consider a weaker version of the clustering assumption: there are sets $\mathcal{S}_k$ such that + +$$ +P \{Y = k \mid X \in \mathcal {S} _ {k} \} = Q \{Y = k \mid X \in \mathcal {S} _ {k} \} = 1. +$$ + +We note that the $S_{k}$ 's can be much smaller than the $\mathcal{X}_k$ 's; this permits the supports of $P\{\cdot \mid Y = k\}$ and $P\{\cdot \mid Y = l\}$ to overlap. + +Definition 4.1 (anchor set). A set $S_{k} \subset \mathcal{X}$ is an anchor set for class $k$ if $p\{x, Y = k\} > 0$ and $p\{x, Y = l\} = 0, l \neq k$ for all $x \in S_{k}$ . + +Proposition 4.2 (identifiability from anchor sets). If there are anchor sets $S_{k}$ for all $K$ classes (in the source domain) and $T(S_{k})$ is $p$ -dimensional, then there is at most one set of $\theta_{k}$ 's and $\alpha_{k}$ 's that satisfies (3.3). + +This identification restriction is also closely related to the linear independence assumption in Gong et al. (2016). Inspecting the proof of proposition 4.2 (see Appendix A.3), we see that the anchor set assumption implies linear independence of $\{p_k(x)\exp (\theta_k^\top T(x) + \alpha_k)\}_{k = 1}^K$ for any set of $\theta_{k}$ 's and $\alpha_{k}$ 's. We study the anchor set assumption empirically in a synthetic experiment in Appendix C. Our experiments show that the assumption is mild and is violated only under extreme data scenarios. + +# 4.2 CONSISTENCY IN ESTIMATION OF THE TILT PARAMETERS + +Here, we establish a convergence rate for the estimated tilt parameters (Lemma (3.1)) and the ExTRA importance weights (Equation (3.1)). To simplify the notation, we define $S(x) = (1,T(x)^{\top})^{\top}$ as the extended sufficient statistics for the exponential tilt and denote the corresponding tilt parameters as $\xi_{k} = (\alpha_{k},\theta_{k}^{\top})^{\top}$ . We let $\xi_k^\star = (\alpha_k^\star ,\theta_k^\star {}^\top)^\top$ 's be the true values of the tilt parameters $\xi_{k}$ 's and let $\xi = (\xi_1^\top ,\dots ,\xi_K^\top)^\top \in \mathbf{R}^{K(p + 1)}$ be the long vector containing all the tilt parameters. We recall that estimating the parameters from the optimization stated in Lemma 3.1 requires a classifier $\widehat{\eta}_P$ on the source data. So, we define our objective for estimating $\xi$ through a generic classifier $\eta :\mathcal{X}\to \Delta^K$ . Denoting $\eta_{k}(x)$ as the $k$ -th co-ordinate of $\eta (x)$ we define the expected log-likelihood objective as: + +$$ +\mathfrak {L} (\eta , \xi) = \mathbf {E} _ {Q _ {X}} \left[ \log \left\{\sum_ {k = 1} ^ {K} \eta_ {k} (X) \exp \left(\xi_ {k} ^ {\top} S (X)\right) \right\} \right] - \log \left[ \mathbf {E} _ {P} \left\{\exp \left(\xi_ {Y} ^ {\top} S (X)\right) \right\} \right], +$$ + +and its empirical version as + +$$ +\hat {\mathfrak {L}} (\eta , \xi) = \mathbf {E} _ {\widehat {Q} _ {X}} \left[ \log \left\{\sum_ {k = 1} ^ {K} \eta_ {k} (X) \exp \left(\xi_ {k} ^ {\top} S (X)\right) \right\} \right] - \log \left[ \mathbf {E} _ {\widehat {P}} \left\{\exp \left(\xi_ {Y} ^ {\top} S (X)\right) \right\} \right]. +$$ + +To establish the consistency of MLE we first make an assumption that the loss $\xi \mapsto -\mathfrak{L}(\eta_P^\star, \xi)$ is strongly convex at the true parameter value. + +Assumption 4.3. The loss $\xi \mapsto -\mathfrak{L}(\eta_P^\star, \xi)$ is strongly convex at $\xi^\star$ , i.e., there exists a constant $\mu > 0$ such that for any $\xi$ it holds: + +$$ +- \mathfrak {L} (\eta_ {P} ^ {\star}, \xi) \geq - \mathfrak {L} (\eta_ {P} ^ {\star}, \xi^ {\star}) - \partial_ {\xi} \mathfrak {L} (\eta_ {P} ^ {\star}, \xi^ {\star}) ^ {\top} (\xi - \xi^ {\star}) + \frac {\mu}{2} \| \xi - \xi^ {\star} \| _ {2} ^ {2}. +$$ + +We note that the assumption is a restriction on the distribution $Q$ rather than the objective itself. For technical convenience we next assume that the feature space is bounded. + +Assumption 4.4. $\mathcal{X}$ is bounded, i.e., there exists an $M > 0$ such that $\mathcal{X} \subset B(0, M)$ . + +Recall, from Lemma 3.1, that we need a fitted source classifier $\widehat{\eta}_P$ to estimate the tilt parameter: $\xi^{\star}$ is estimated by maximizing $\hat{\mathfrak{L}} (\widehat{\eta}_P,\xi)$ rather than the unknown $\hat{\mathfrak{L}} (\eta_P^\star ,\xi)$ . While analyzing the convergence of $\hat{\xi}$ we are required to control the difference $\hat{\mathfrak{L}} (\hat{\eta}_P,\xi) - \hat{\mathfrak{L}} (\eta_P^\star ,\xi)$ . To ensure the difference is small, assume the pilot estimate of the source regression function $\hat{\eta}_P$ is consistent at some rate $r_{n_P}$ . + +Assumption 4.5. Let $f_{P,k}^{\star}(x) = \log \{\eta_{P,k}^{\star}(x)\} - \frac{1}{K}\sum_{j=1}^{K}\log \{\eta_{P,j}^{\star}(x)\}$ . We assume that there exist an estimators $\{\hat{f}_{P,k}(x)\}_{k=1}^{K}$ for $\{f_{P,k}^{\star}(x)\}_{k=1}^{K}$ such that the following holds: there exists a constant $c > 0$ and a sequence $r_{n_P} \to 0$ such that for almost surely $[\mathbb{P}_X]$ it holds + +$$ +\mathbf {P} \left(\| \hat {f} _ {P} (x) - f _ {P} ^ {\star} (x) \| _ {2} > t\right) \leq e x p \left(- c t ^ {2} / r _ {n _ {P}} ^ {2}\right), t > 0. +$$ + +We use the estimated logits $\{\hat{f}_{P,k}(x)\}_{k=1}^{K}$ to construct the regression functions as $\widehat{\eta}_{P,k}(x) = \exp(\hat{f}_{P,k}(x)) / \{\sum_{j=1}^{K} \exp(\hat{f}_{P,j}(x))\}$ , which we use in the objective stated in Lemma 3.1 to analyze the convergence of the tilt parameter estimates and the ExTRA weights. With the above assumptions we're now ready to state concentration bounds for $\hat{\xi} - \xi^{\star}$ and $\hat{\omega} - \omega^{\star}$ , where the true importance weight $\omega^{\star}$ is defined as $\omega^{\star}(x, y) = \exp(\xi_y^{\star \top} S(x))$ . + +Theorem 4.6. Let the assumptions 4.3, 4.4 and 4.5 hold. For the sample sizes $n_P, n_Q$ define $\alpha_{n_P, n_Q} = r_{n_P}\sqrt{\log(n_Q)} + \{(p + 1)K / n_P\}^{1/2} + \{(p + 1)K / n_Q\}^{1/2}$ . There exists constants $k_1, k_2 > 0$ such that for any $\delta > 0$ with probability at least $1 - (2K + 1)\delta$ the following hold: + +$$ +\| \hat {\xi} - \xi^ {\star} \| _ {2} \leq k _ {1} \alpha_ {n _ {P}, n _ {Q}} \sqrt {\log (1 / \delta)}, a n d \| \hat {\omega} - \omega^ {\star} \| _ {1, P} \leq k _ {2} \alpha_ {n _ {P}, n _ {Q}} \sqrt {\log (1 / \delta)}. +$$ + +In Theorem 4.6 we notice that as long as $r_{n_P}\log (n_Q)\to 0$ for $n_P,n_Q\to \infty$ we have $\alpha_{n_P,n_Q}\rightarrow 0$ . This implies both the estimated tilt parameters and the ExTRA weights converge to their true values as the sample sizes $n_P,n_Q\to \infty$ . + +We next provide theoretical guarantees for the downstream tasks (1) fine-tuning and (2) target performance evaluation that we described in Section 3. + +Fine-tuning We establish a generalization bound for the fitted model (3.7) using weighted-ERM on source domain. We denote $\mathcal{F}$ as the classifier hypothesis class. For $f\in \mathcal{F}$ and a weight function $\omega :\mathcal{X}\times \mathcal{Y}\to \mathbf{R}_{\geq 0}$ define the weighted loss function and its empirical version on source data as: + +$$ +\mathcal {L} _ {P} (f, w) = \mathbf {E} _ {P} [ \omega (X, Y) \ell (f (X), Y) ], \hat {\mathcal {L}} _ {P} (f, w) = \mathbf {E} _ {\hat {P}} [ \omega (X, Y) \ell (f (X), Y) ]. +$$ + +We also define the loss function on the target data as: $\mathcal{L}_Q(f) = \mathbf{E}_Q\left[\ell (f(X),Y)\right]$ . If $\{(\theta_k^\star ,\alpha_k^\star)\}_{k = 1}^K$ is the true value of the tilt parameters in (3.2), i.e., the following holds: + +$$ +q \{x, Y = k \} = p \{x, Y = k \} \exp \left\{\alpha_ {k} ^ {\star} + \left(\theta_ {k} ^ {\star}\right) ^ {\top} T (x) \right\}; k \in [ K ], +$$ + +then defining $\omega^{\star}(x,k) = \exp \{\alpha_k^{\star} + (\theta_k^{\star})^\top T(x)\}$ as the true weight we notice that $\mathcal{L}_P(f,\omega^{\star}) = \mathcal{L}_Q(f)$ , which is easily observed by setting $g(x,y) = \ell (f(x),y)$ in the display (3.1). + +To establish our generalization bound we require Rademacher complexity (Bartlett & Mendelson, 2002) (denoted as $\mathcal{R}_{n_P}(\mathcal{G})$ ; see Appendix A.1 for details) and the following assumption on the loss function. + +Assumption 4.7. The loss function $\ell$ is bounded, i.e., for some $B > 0$ , $|\ell \{f(x),y\} |\leq B$ for any $f\in \mathcal{F}$ , $x\in \mathcal{X}$ and $y\in [K]$ . + +With the above definitions and the assumption we establish our generalization bound. + +Lemma 4.8. For a weight function $\omega$ and the source samples $\{(X_{P,i},Y_{P,i})\}_{i = 1}^{n_P}$ of size $n_P$ let $\hat{f}_{\omega} = \arg \min_{f\in \mathcal{F}}\hat{\mathcal{L}}_P(f,\omega)$ . There exists a constant $c > 0$ such that the following generalization bound holds with probability at least $1 - \delta$ + +$$ +\mathcal {L} _ {Q} \left(\hat {f} _ {\omega}\right) - \min _ {f \in \mathcal {F}} \mathcal {L} _ {Q} (f) \leq 2 \mathcal {R} _ {n _ {P}} (\mathcal {G}) + B \| \omega - \omega^ {\star} \| _ {1, P} + c \sqrt {\frac {\log (1 / \delta)}{n _ {P}}}, \tag {4.1} +$$ + +where $\mathcal{R}_{n_P}(\mathcal{G})$ is the Rademacher complexity of $\mathcal{G} = \{\omega^{\star}(x,y)\ell (f(x),y):f\in \mathcal{F}\}$ defined in Appendix A.1. + +In Theorem 4.6 we established an upper bound for the estimated weights $\hat{\omega}$ , which concludes that $\hat{f}_{\hat{\omega}}$ has the following generalization bound: for any $\delta >0$ , with probability at least $1 - (2K + 2)\delta$ + +$$ +\mathcal {L} _ {Q} (\hat {f} _ {\hat {\omega}}) - \min _ {f \in \mathcal {F}} \mathcal {L} _ {Q} (f) \leq 2 \mathcal {R} _ {n _ {P}} (\mathcal {G}) + k _ {2} \alpha_ {n _ {P}, n _ {Q}} \sqrt {\log (1 / \delta)} + c \sqrt {\log (1 / \delta) / n _ {P}}, +$$ + +where $k_{2}$ is the constant in Theorem 4.6 and $c$ is the constant in Lemma 4.8. The generalization bound implies that for large sample sizes $(n_{P}, n_{Q} \to \infty)$ the target accuracy of weighted ERM on source data well approximates the accuracy of ERM on target data. + +Target performance evaluation We provide a theoretical guarantee for the target performance evaluation (3.6) using our importance weights. Here we only consider the functions $g: \mathcal{X} \times \mathcal{Y} \to \mathbf{R}$ which are bounded by some $B > 0$ , i.e. $|g(x, y)| \leq B$ for all $x \in \mathcal{X}$ and $y \in \mathcal{Y}$ . The simplest and the most frequently used example is the model accuracy which uses 0-1-loss as the loss function: for a model $f$ the loss $g(x, y) = \mathbb{I}\{f(x) = y\}$ is bounded with $B = 1$ . For such functions we notice that $\mathbf{E}_Q[g(X, Y)] = \mathbf{E}_P[g(X, Y) \omega^{\star}(X, Y)]$ , as observed in display (3.1). This implies the following bound on the target performance evaluation error + +$$ +\begin{array}{l} \left. \left| \mathbf {E} _ {Q} [ g (X, Y) ] - \mathbf {E} _ {P} [ g (X, Y) \hat {\omega} (X, Y) ] \right| = \left| \mathbf {E} _ {P} [ g (X, Y) \omega^ {\star} (X, Y) ] - \mathbf {E} _ {P} [ g (X, Y) \hat {\omega} (X, Y) ] \right| \right. \\ \leq B \mathbf {E} _ {P} [ | \hat {\omega} ^ {\star} (X, Y) - \omega^ {\star} (X, Y) | ] \leq B \| \hat {\omega} - \omega^ {\star} \| _ {1, P}. \\ \end{array} +$$ + +We recall the concentration bound for $\| \hat{\omega} -\omega^{\star}\|_{1,P}$ from Theorem 4.6 and conclude that the estimated target performance in (3.6) converges to the true target performance at rate $\alpha_{n_P,n_Q}$ . + +# 5 WATERBIRDS CASE STUDY + +To demonstrate the efficacy of the ExTRA algorithm for reweighing the source data we (i) verify the ability of ExTRA to upweigh samples most relevant to the target task; (ii) evaluate the utility of weights in downstream tasks such as fine-tuning and (iii) model selection. + +WATERBIRDS dataset combines bird photographs from the Caltech-UCSD Birds-200-2011 (CUB) dataset (Wah et al., 2011) and the image backgrounds from the Places dataset (Zhou et al., 2017). The birds are labeled as one of $\mathcal{V} = \{\text{waterbird, landbird}\}$ and placed on one of $\mathcal{A} = \{\text{water background, land background}\}$ . The images are divided into four groups: landbirds on land (0); landbirds on water (1); waterbirds on land (2); waterbirds on water (3). The source dataset is highly imbalanced, i.e. the smallest group (2) has 56 samples. We embed all images with a pre-trained ResNet18 (He et al., 2016). See Appendix B.1 for details. + +We consider five subpopulation shift target domains: all pairs of domains with different bird types and the original test set (Sagawa et al., 2019) where all 4 groups are present with proportions vastly different from the source. For all domains, we fit ExTRA weights (with ResNet18 features as $T(x)$ ) from 10 different initializations and report means and standard deviations for the metrics. See Appendix B.2 for the implementation details. + +ExTRA weights quality For a given target domain it is most valuable to upweigh the samples in the source data corresponding to the groups comprising that domain. The most challenging is the target $\{1,2\}$ consisting only of birds appearing on their atypical backgrounds. Groups $\{1,2\}$ correspond to $5\%$ of the source data making them most difficult to "find". To quantify the ability of ExTRA to upweigh these samples we report precision (proportion of samples from groups $\{1,2\}$ within the top $x\%$ of the weights) and recall (proportion of $\{1,2\}$ samples within the top $x\%$ of the weights) in Figure 1. We notice that samples corresponding to $10\%$ largest ExTRA weights contain slightly + +Table 1: Model selection results on WATERBIRDS + +
target groupstarget accuracyrank correlation
ExTRASrcValATC-NEExTRASrcValATC-NE
{0,2}0.819±0.0120.8540.8710.419±0.010.8070.760
{1,2}0.741±0.0470.6160.6460.747±0.106-0.519-0.590
{0,3}0.978±0.0010.9780.9760.962±0.0040.9560.906
{1,3}0.757±0.0110.7370.7470.361±0.168-0.318-0.411
{0,1,2,3}0.856±0.0340.8030.8180.658±0.2950.2630.178
average0.830.7980.8120.7530.1660.110
+ +over $80\%$ of the groups $\{1,2\}$ in the source data (recall). This demonstrates the ability of ExTRA to upweigh relevant samples. We present examples of upweighted images and results for other target domains in Appendix B.3. + +Model fine-tuning We demonstrate the utility of ExTRA weights in the fine-tuning (3.7). The basic goal of such importance weighing is to improve the performance in the target in comparison to training on uniform source weights S -> T, i.e. ERM. Another baseline is the DRO model (Hashimoto et al., 2018) that aims to maximize worst-group performance without access to the group labels, and JTT (Liu et al., 2021) that retransmits a model after upweighting the misclassified samples by ERM. We consider two additional baselines that utilize group annotations to improve worst-group performance: re-weighing the source to equalize group proportions $(\mathrm{RW}_{\mathrm{gr}})$ and group DRO (gDRO) (Sagawa et al., 2019). The afore + +![](images/cfbf1b812e34dc984f5715b90b756b74732082cfca8c5ef88ad41e9928d74b4a.jpg) +Figure 1: ExTRA precision and recall for samples with top $x\%$ weights. + +mentioned baselines do not try to adjust to the target domain. Finally, we compare to $\pi \mathrm{T} \rightarrow \mathrm{T}$ that fine-tunes the model only using the subset of the source samples corresponding to the target domain groups. In all cases we use logistic regression as model class. + +We compare target accuracy across domains in Figure 2. Analogous comparison with area under the receiver operator curve can be found in Figure 6 in Appendix B.3.1. Model trained with ExTRA weights outperforms all "fair" baselines and matches the performance of the three baselines that had access to additional information. In all target domains ExTRA fine-tuning is comparable with the $\pi T$ - $->$ T supporting its ability to upweigh relevant samples. Notably, on $\{1,2\}$ domain of both minority groups and on $\{0,3\}$ domain of both majority groups, ExTRA outperforms $\mathrm{RW}_{\mathrm{gr}}$ and gDRO that utilize group annotations. This emphasizes the advantage of adapting to the target domain instead of pursuing a more conser + +![](images/5bfeef58a94bfde91f11ab0efef7d5847b1343d2e34daf32156c7d188921fd94.jpg) +Figure 2: Performance on WATERBIRDS. + +vative goal of worst-group performance maximization. Finally, we note that ExTRA fine-tuning did not perform as well on the domain $\{1,3\}$ , however neither did $\pi T \rightarrow T$ . + +Model selection out-of-distribution is an important task, that is difficult to perform without target data labels and group annotations (Gulrajani & Lopez-Paz, 2020; Zhai et al., 2021). We evaluate the ability of choosing a model for the target domain based on accuracy on the ExTRA reweighted source validation data. We compare to the standard source validation model selection (SrcVal) and to the recently proposed ATC-NE (Garg et al., 2022) that uses negative entropy of the predicted probabilities on the target domain to score models. We fit a total of 120 logistic regression models with different weighting (uniform, label balancing, and group balancing) and varying regularizers. See Appendix B.2 for details. + +In Table 1 we compare the target performance of models selected using each of the model evaluation scores and rank correlation between the corresponding model scores and true target accuracies. + +Model selection with ExTRA results in the best target performance and rank correlation on 4 out of 5 domains and on average. Importantly, the rank correlation between the true performance and ExTRA model scores is always positive, unlike the baselines, suggesting its reliability in providing meaningful information about the target domain performance. + +# 6 BREEDS CASE STUDY + +BREEDS (Santurkar et al., 2020) is a subpopulation shift benchmark derived from ImageNet (Deng et al., 2009). It uses the class hierarchy to define groups within classes. For example, in the Entity-30 task considered in this experiment, class fruit is represented by strawberry, pineapple, jackfruit, Granny Smith in the source and buckeye, corn, ear, acorn in the target. This is an extreme case of subpopulation shift where source and target groups have zero overlap. We modify the dataset by adding a small fraction $\pi$ of random samples from the target to the source for two reasons: (i) our exponential tilt model requires some amount of overlap between source and target; (ii) arguably, in practice, it is more likely that the source dataset has at least a small representation of all groups. + +Our goal is to show that ExTRA can identify the target samples mixed into the source for efficient fine-tuning. We obtain feature representations from a pre-trained self-supervised SwAV (Caron et al., 2020). To obtain the ExTRA weights we use SwAV features as sufficient statistic. We then train logistic regression models on (i) the source dataset re-weighted with ExTRA, (ii) uniformly weighted source $(S - > T)$ , (iii) target samples mixed into the source $(\pi T - > T)$ , (iv) all target samples (oracle). See Appendix B.1, B.2 for details. We report performance for varying mixing proportion $\pi$ in Figure 3. First, we note that even when $\pi = 0$ , i.e. source and target have completely dis + +![](images/48e84ba7965f9a89f86ad792a1bb33faf75a80206469512b1a0e7d01b1621f02.jpg) +Figure 3: Performance on BREEDS. + +joint groups (similar to domain generalization), ExTRA improves over the vanilla S -> T. Next, we see that S -> T improves very slowly in comparison to ExTRA as we increase the mixing proportion; $\pi \mathrm{T} \rightarrow \mathrm{T}$ improves faster as we increase the number of target samples it has access to, but never suppresses ExTRA and matches its improvement slope for the larger $\pi$ values. We conclude that ExTRA can effectively identify target samples mixed into source that are crucial for the success of fine-tuning and find source samples most relevant to the target task allowing it to outperform $\pi \mathrm{T} \rightarrow \mathrm{T}$ . We report analogous precision and recall for the WATERBIRDS experiment in Appendix B.3. + +# 7 CONCLUSION + +In this paper, we developed an importance weighing method for approximating expectations of interest on new domains leveraging unlabeled samples (in addition to a labeled dataset from the source domain). We demonstrated the applicability of our method on downstream tasks such as model evaluation/selection and fine-tuning both theoretically and empirically. Unlike other importance weighing methods that only allow covariate shift between the source and target domains, we permit concept drift between the source and target. Though we demonstrate the efficacy of our method in synthetic setup of concept drift (Appendix C), in a future research it would be interesting to investigate the performance in more realistic setups (e.g. CIFAR10.2 to CIFAR10.2 (Lu et al., 2020), Imagenet to Imagenetv2 (Recht et al., 2019)). + +Despite its benefits, the exponential tilt model does suffer from a few limitations. Implicit in the exponential tilt assumption is that the supports of the target class conditionals have some overlap with the corresponding source class conditionals. Although this assumption is likely satisfied in many instances of domain generalization problems (and is always satisfied in the subpopulation shift setting), an interesting avenue for future studies is to accommodate support alignment in the distribution shift model, i.e. to align the supports for class conditioned feature distributions in source and target domains. One way to approach this is to utilize distribution matching techniques from domain adaptation literature (Ganin et al., 2016; Sun & Saenko, 2016; Shen et al., 2018), similarly to Cai et al. (2021). We hope aligning supports via distribution matching will allow our method to succeed on domain generalization problems where the support overlap assumption is violated. + +# 8 ETHICS STATEMENT + +We recommend considering the representation of the minority groups when applying ExTRA in the context of fairness-sensitive applications. The goal of ExTRA is to approximate the distribution of the target domain, thus, in order to use ExTRA weights for fine-tuning or model selection to obtain a fair model, the target domain should be well representative of both privileged and unprivileged groups. If the target domain has miss/under-represented groups, a model obtained using ExTRA weights may be biased. + +# ACKNOWLEDGMENTS + +This paper is based upon work supported by the National Science Foundation (NSF) under grants no. 2027737 and 2113373. + +# REFERENCES + +Amr Alexandari, Anshul Kundaje, and Avanti Shrikumar. EM with Bias-Corrected Calibration is Hard-To-Beat at Label Shift Adaptation. arXiv:1901.06852 [cs, stat], January 2020. +Martin Arjovsky, Léon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant Risk Minimization. arXiv:1907.02893 [cs, stat], September 2019. +Kamyar Azizzadenesheli, Anqi Liu, Fanny Yang, and Animashree Anandkumar. Regularized Learning for Domain Adaptation under Label Shifts. arXiv:1903.09734 [cs, stat], March 2019. +Peter L Bartlett and Shahar Mendelson. Rademacher and gaussian complexities: Risk bounds and structural results. Journal of Machine Learning Research, 3(Nov):463-482, 2002. +Gilles Blanchard, Gyemin Lee, and Clayton Scott. Generalizing from several related classification tasks to a new unlabeled sample. In Proceedings of the 24th International Conference on Neural Information Processing Systems, NIPS'11, pp. 2178-2186, Red Hook, NY, USA, December 2011. Curran Associates Inc. ISBN 978-1-61839-599-3. +Jonathon Byrd and Zachary Lipton. What is the Effect of Importance Weighting in Deep Learning? In International Conference on Machine Learning, pp. 872-881. PMLR, May 2019. +T. Tony Cai and Hongji Wei. Transfer Learning for Nonparametric Classification: Minimax Rate and Adaptive Classifier. arXiv:1906.02903 [cs, math, stat], June 2019. +Tianle Cai, Ruiqi Gao, Jason D. Lee, and Qi Lei. A Theory of Label Propagation for Subpopulation Shift. arXiv:2102.11203 [cs, stat], February 2021. +Mathilde Caron, Ishan Misra, Julien Mairal, Priya Goyal, Piotr Bojanowski, and Armand Joulin. Unsupervised learning of visual features by contrasting cluster assignments. Advances in Neural Information Processing Systems, 33:9912-9924, 2020. +Jiefeng Chen, Frederick Liu, Besim Avci, Xi Wu, Yingyu Liang, and Somesh Jha. Detecting errors and estimating accuracy on unlabeled data with self-training ensembles. Advances in Neural Information Processing Systems, 34, 2021a. +Mayee Chen, Karan Goel, Nimit S Sohoni, Fait Poms, Kayvon Fatahalian, and Christopher Ré. Mandoline: Model evaluation under distribution shift. In International Conference on Machine Learning, pp. 1617-1629. PMLR, 2021b. +Elliot Creager, Joern-Henrik Jacobsen, and Richard Zemel. Environment Inference for Invariant Learning. In Proceedings of the 38th International Conference on Machine Learning, pp. 2189-2200. PMLR, July 2021. +Shai Ben David, Tyler Lu, Teresa Luu, and David Pal. Impossibility Theorems for Domain Adaptation. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, pp. 129-136. JMLR Workshop and Conference Proceedings, March 2010. + +Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248-255. IEEE, 2009. +Qi Dou, Daniel C. Castro, Konstantinos Kamnitsas, and Ben Glocker. Domain Generalization via Model-Agnostic Learning of Semantic Features. arXiv:1910.13580 [cs], October 2019. +John Duchi, Peter Glynn, and Hongseok Namkoong. Statistics of Robust Optimization: A Generalized Empirical Likelihood Approach. arXiv:1610.03425 [stat], October 2016. +João Gama, Indre Žliobaité, Albert Bifet, Mykola Pechenizkiy, and Abdelhamid Bouchachia. A survey on concept drift adaptation. ACM Computing Surveys, 46(4):44:1-44:37, March 2014. ISSN 0360-0300. doi: 10.1145/2523813. +Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. The Journal of Machine Learning Research, 17(1):2096-2030, January 2016. ISSN 1532-4435. +Saurabh Garg, Yifan Wu, Sivaraman Balakrishnan, and Zachary C. Lipton. A Unified View of Label Shift Estimation. arXiv:2003.07554 [cs, stat], March 2020. +Saurabh Garg, Sivaraman Balakrishnan, Zachary C Lipton, Behnam Neyshabur, and Hanie Sedghi. Leveraging unlabeled data to predict out-of-distribution performance. arXiv preprint arXiv:2201.04234, 2022. +Mingming Gong, Kun Zhang, Tongliang Liu, Dacheng Tao, Clark Glymour, and Bernhard Scholkopf. Domain Adaptation with Conditional Transferable Components. In Proceedings of Machine Learning Research, volume 48, pp. 17, New York, New York, USA, June 2016. +Devin Guillory, Vaishaal Shankar, Sayna Ebrahimi, Trevor Darrell, and Ludwig Schmidt. Predicting with confidence on unseen distributions. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 1134-1144, 2021. +Ishaan Gulrajani and David Lopez-Paz. In Search of Lost Domain Generalization. In International Conference on Learning Representations, September 2020. +Mahdi Hashemi and Hassan Karimi. Weighted machine learning. Statistics, Optimization and Information Computing, 6(4):497-525, 2018. +Tatsunori B. Hashimoto, Megha Srivastava, Hongseok Namkoong, and Percy Liang. Fairness Without Demographics in Repeated Loss Minimization. arXiv:1806.08010 [cs, stat], June 2018. +Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep Residual Learning for Image Recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770-778, Las Vegas, NV, USA, June 2016. IEEE. ISBN 978-1-4673-8851-1. doi: 10.1109/CVPR.2016.90. +Badr Youbi Idrissi, Martin Arjovsky, Mohammad Pezeshki, and David Lopez-Paz. Simple data balancing achieves competitive worst-group-accuracy. arXiv preprint arXiv:2110.14503, 2021. +Yiding Jiang, Vaishnavh Nagarajan, Christina Baek, and J Zico Kolter. Assessing generalization of sgd via disagreement. arXiv preprint arXiv:2106.13799, 2021. +Diederik P. Kingma and Jimmy Ba. Adam: A Method for Stochastic Optimization. arXiv:1412.6980 [cs], January 2017. +Pang Wei Koh, Shiori Sagawa, Henrik Marklund, Sang Michael Xie, Marvin Zhang, Akshay Bal-subramani, Weihua Hu, Michihiro Yasunaga, Richard Lanas Phillips, Sara Beery, Jure Leskovec, Anshul Kundaje, Emma Pierson, Sergey Levine, Chelsea Finn, and Percy Liang. WILDS: A Benchmark of in-the-Wild Distribution Shifts. arXiv:2012.07421 [cs], December 2020. +David Krueger, Ethan Caballero, Joern-Henrik Jacobsen, Amy Zhang, Jonathan Binas, Dinghuai Zhang, Remi Le Priol, and Aaron Courville. Out-of-distribution generalization via risk extrapolation (rex). In International Conference on Machine Learning, pp. 5815-5826. PMLR, 2021. + +Ananya Kumar, Tengyu Ma, and Percy Liang. Understanding Self-Training for Gradual Domain Adaptation. arXiv:2002.11361 [cs, stat], February 2020. +Ananya Kumar, Aditi Raghunathan, Robbie Jones, Tengyu Ma, and Percy Liang. Fine-Tuning can Distort Pretrained Features and Underperform Out-of-Distribution. February 2022. doi: 10.48550/arXiv.2202.10054. +Tian Li, Ahmad Beirami, Maziar Sanjabi, and Virginia Smith. Tilted Empirical Risk Minimization. In International Conference on Learning Representations, September 2020. +Tian Li, Ahmad Beirami, Maziar Sanjabi, and Virginia Smith. On tilted losses in machine learning: Theory and applications. arXiv preprint arXiv:2109.06141, 2021. +Zachary C. Lipton, Yu-Xiang Wang, and Alex Smola. Detecting and Correcting for Label Shift with Black Box Predictors. arXiv:1802.03916 [cs, stat], July 2018. +Evan Z. Liu, Behzad Haghloo, Annie S. Chen, Aditi Raghunathan, Pang Wei Koh, Shiori Sagawa, Percy Liang, and Chelsea Finn. Just Train Twice: Improving Group Robustness without Training Group Information. In Proceedings of the 38th International Conference on Machine Learning, pp. 6781-6792. PMLR, July 2021. +Shangyun Lu, Bradley Nott, Aaron Olson, Alberto Todeschini, Hossein Vahabi, Yair Carmon, and Ludwig Schmidt. Harder or different? a closer look at distribution shift in dataset reproduction. In ICML Workshop on Uncertainty and Robustness in Deep Learning, 2020. +Subha Maity, Diptavo Dutta, Jonathan Terhorst, Yuekai Sun, and Moulinath Banerjee. A linear adjustment based approach to posterior drift in transfer learning. arXiv:2111.10841 [stat], December 2021. +Subha Maity, Yuekai Sun, and Moulinath Banerjee. Minimax optimal approaches to the label shift problem in non-parametric settings. Journal of Machine Learning Research, 23(346):1-45, 2022. +Krikamol Muandet, David Balduzzi, and Bernhard Scholkopf. Domain Generalization via Invariant Feature Representation. January 2013. +Benjamin Recht, Rebecca Roelofs, Ludwig Schmidt, and Vaishaal Shankar. DoImagenet classifiers generalize to imagenet? In International Conference on Machine Learning, pp. 5389-5400. PMLR, 2019. +Paul R Rosenbaum and Donald B Rubin. The central role of the propensity score in observational studies for causal effects. Biometrika, 70(1):41-55, 1983. +Elan Rosenfeld, Pradeep Ravikumar, and Andrej Risteski. Domain-adjusted regression or: Erm may already learn features sufficient for out-of-distribution generalization. arXiv preprint arXiv:2202.06856, 2022. +Yangjun Ruan, Yann Dubois, and Chris J Maddison. Optimal representations for covariate shift. arXiv preprint arXiv:2201.00057, 2021. +Shiori Sagawa, Pang Wei Koh, Tatsunori B. Hashimoto, and Percy Liang. Distributionally Robust Neural Networks for Group Shifts: On the Importance of Regularization for Worst-Case Generalization. arXiv:1911.08731 [cs, stat], November 2019. +Shiori Sagawa, Aditi Raghunathan, Pang Wei Koh, and Percy Liang. An Investigation of Why Overparameterization Exacerbates Spurious Correlations. arXiv:2005.04345 [cs, stat], August 2020. +Shibani Santurkar, Dimitris Tsipras, and Aleksander Madry. BREEDS: Benchmarks for Subpopulation Shift. August 2020. doi: 10.48550/arXiv.2008.04859. +Shreya Shankar, Yoni Halpern, Eric Breck, James Atwood, Jimbo Wilson, and D. Sculley. No Classification without Representation: Assessing Geodiversity Issues in Open Data Sets for the Developing World. arXiv:1711.08536 [stat], November 2017. + +Jian Shen, Yanru Qu, Weinan Zhang, and Yong Yu. Wasserstein distance guided representation learning for domain adaptation. In Thirty-second AAAI conference on artificial intelligence, 2018. +Hidetoshi Shimodaira. Improving predictive inference under covariate shift by weighting the log-likelihood function. Journal of Statistical Planning and Inference, 90(2):227-244, October 2000. ISSN 0378-3758. doi: 10.1016/S0378-3758(00)00115-4. +Avanti Shrikumar and Anshul Kundaje. Calibration with bias-corrected temperature scaling improves domain adaptation under label shift in modern neural networks. Preprint at https://arxiv.org/abs/1901.06852v1, 2019. +Rui Shu, Hung Bui, Hirokazu Narui, and Stefano Ermon. A DIRT-T Approach to Unsupervised Domain Adaptation. In International Conference on Learning Representations, February 2018. +Masashi Sugiyama and Motoaki Kawanabe. Machine Learning in Non-Stationary Environments: Introduction to Covariate Shift Adaptation. Adaptive Computation and Machine Learning Series. MIT Press, Cambridge, MA, USA, March 2012. ISBN 978-0-262-01709-1. +Masashi Sugiyama, Matthias Krauledat, and Klaus-Robert Müller. Covariate Shift Adaptation by Importance Weighted Cross Validation. The Journal of Machine Learning Research, 8:985-1005, December 2007. ISSN 1532-4435. +Masashi Sugiyama, Taiji Suzuki, and Takafumi Kanamori. Density Ratio Estimation in Machine Learning. Cambridge University Press, Cambridge, 2012. ISBN 978-0-521-19017-6. doi: 10. 1017/CBO9781139035613. +Baochen Sun and Kate Saenko. Deep CORAL: Correlation Alignment for Deep Domain Adaptation. In Gang Hua and Hervé Jégou (eds.), Computer Vision - ECCV 2016 Workshops, Lecture Notes in Computer Science, pp. 443-450, Cham, 2016. Springer International Publishing. ISBN 978-3-319-49409-8. doi: 10.1007/978-3-319-49409-8_35. +Yu Sun, Xiaolong Wang, Zhuang Liu, John Miller, Alexei A. Efros, and Moritz Hardt. Test-Time Training with Self-Supervision for Generalization under Distribution Shifts. arXiv:1909.13231 [cs, stat], July 2020. +Remi Tachet, Han Zhao, Yu-Xiang Wang, and Geoff Gordon. Domain Adaptation with Conditional Distribution Matching and Generalized Label Shift. March 2020. +A. W. van der Vaart and Jon A Wellner. Weak Convergence and Empirical Processes: With Applications to Statistics. Springer, New York, 2000. ISBN 978-0-387-94640-5 978-1-4757-2547-6. +Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge Belongie. The caltech-ucsd birds-200-2011 dataset. 2011. +Dequan Wang, Evan Shelhamer, Shaoteng Liu, Bruno Olshausen, and Trevor Darrell. Tent: Fully Test-Time Adaptation by Entropy Minimization. In International Conference on Learning Representations, September 2020. +Jon Wellner et al. Weak convergence and empirical processes: with applications to statistics. Springer Science & Business Media, 2013. +Hui Xu and Robert Tibshirani. Estimation of prediction error with known covariate shift. arXiv preprint arXiv:2205.01849, 2022. +Yaodong Yu, Zitong Yang, Alexander Wei, Yi Ma, and Jacob Steinhardt. Predicting out-of-distribution error with the projection norm. arXiv preprint arXiv:2202.05834, 2022. +Runtian Zhai, Chen Dan, Zico Kolter, and Pradeep Ravikumar. DORO: Distributional and Outlier Robust Optimization. In Proceedings of the 38th International Conference on Machine Learning, pp. 12345-12355. PMLR, July 2021. +Marvin Zhang, Henrik Marklund, Nikita Dhawan, Abhishek Gupta, Sergey Levine, and Chelsea Finn. Adaptive Risk Minimization: A Meta-Learning Approach for Tackling Group Shift. arXiv:2007.02931 [cs, stat], October 2020. + +Bolei Zhou, Agata Lapedriza, Aditya Khosla, Aude Oliva, and Antonio Torralba. Places: A 10 million image database for scene recognition. IEEE transactions on pattern analysis and machine intelligence, 40(6):1452-1464, 2017. \ No newline at end of file diff --git a/understandingnewtasksthroughthelensoftrainingdataviaexponentialtilting/images.zip b/understandingnewtasksthroughthelensoftrainingdataviaexponentialtilting/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..6004975105f0f0c5c29fa10fe746478745d886cb --- /dev/null +++ b/understandingnewtasksthroughthelensoftrainingdataviaexponentialtilting/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d5303363edd71fbaea99aa3cb21f3b172ad2bfdb7694e8fcbc044fd03d762e9 +size 342996 diff --git a/understandingnewtasksthroughthelensoftrainingdataviaexponentialtilting/layout.json b/understandingnewtasksthroughthelensoftrainingdataviaexponentialtilting/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..0f2af0a308c3ee12d4d1e3f3c9f460b9241bbffa --- /dev/null +++ b/understandingnewtasksthroughthelensoftrainingdataviaexponentialtilting/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c8f2fc9e9fd3cb1591fa4edf88c9d4590743eb8e36d5311ad48f656745da070 +size 554624 diff --git a/understandingthecovariancestructureofconvolutionalfilters/c850f5ed-3c1a-4d1a-818b-78549f281820_content_list.json b/understandingthecovariancestructureofconvolutionalfilters/c850f5ed-3c1a-4d1a-818b-78549f281820_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..3664027ec10003263e20d3c960bb8660c37ed21b --- /dev/null +++ b/understandingthecovariancestructureofconvolutionalfilters/c850f5ed-3c1a-4d1a-818b-78549f281820_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a9fe2f052dffd9ab6685fd3f0940c75117d11d97c2e257f6bff5373483b0ab19 +size 127561 diff --git a/understandingthecovariancestructureofconvolutionalfilters/c850f5ed-3c1a-4d1a-818b-78549f281820_model.json b/understandingthecovariancestructureofconvolutionalfilters/c850f5ed-3c1a-4d1a-818b-78549f281820_model.json new file mode 100644 index 0000000000000000000000000000000000000000..f943041db9726b6f68703fb6ebd961a0e815879b --- /dev/null +++ b/understandingthecovariancestructureofconvolutionalfilters/c850f5ed-3c1a-4d1a-818b-78549f281820_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33e0e7a2c98e736b293c42ac8867d2fd31c45699584ad754122c4609fbdb5b4c +size 142362 diff --git a/understandingthecovariancestructureofconvolutionalfilters/c850f5ed-3c1a-4d1a-818b-78549f281820_origin.pdf b/understandingthecovariancestructureofconvolutionalfilters/c850f5ed-3c1a-4d1a-818b-78549f281820_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..699e76c046c68042aa89895e497c60768ff0c4df --- /dev/null +++ b/understandingthecovariancestructureofconvolutionalfilters/c850f5ed-3c1a-4d1a-818b-78549f281820_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:97f25a2ba64d34177a1ee15d282c4430592c167ddf73148a4aa55ee8c8d81d8b +size 2751781 diff --git a/understandingthecovariancestructureofconvolutionalfilters/full.md b/understandingthecovariancestructureofconvolutionalfilters/full.md new file mode 100644 index 0000000000000000000000000000000000000000..94064e8626db2e2dda105f7f670c893191027b8d --- /dev/null +++ b/understandingthecovariancestructureofconvolutionalfilters/full.md @@ -0,0 +1,519 @@ +# UNDERSTANDING THE COVARIANCE STRUCTURE OF CONVOLUTIONAL FILTERS + +Asher Trockman1, Devin Willmott2, J. Zico Kolter12 + +$^{1}$ Carnegie Mellon University and $^{2}$ Bosch Center for AI + +Correspondence to: ashert@cs.cmu.edu + +# ABSTRACT + +Neural network weights are typically initialized at random from univariate distributions, controlling just the variance of individual weights even in highly-structured operations like convolutions. Recent ViT-inspired convolutional networks such as ConvMixer and ConvNeXt use large-kernel depthwise convolutions whose learned filters have notable structure; this presents an opportunity to study their empirical covariances. In this work, we first observe that such learned filters have highly-structured covariance matrices, and moreover, we find that covariances calculated from a small network may be used to effectively initialize a variety of larger networks of different depths, widths, patch sizes, and kernel sizes, indicating a degree of model-independence to the covariance structure. Motivated by this finding, we then propose a learning-free multivariate initialization scheme for convolutional filters using a simple, closed-form construction of their covariance. Models using our initialization outperform those using traditional univariate initializations, and typically meet or exceed the performance of those initialized from the covariances of learned filters; in some cases, this improvement can be achieved without training the depthwise convolutional filters at all. Our code is available at https://github.com/locuslab/convcov. + +# 1 INTRODUCTION + +Early work in deep learning for vision demonstrated that the convolutional filters in trained neural networks are often highly-structured, in some cases being qualitatively similar to filters known from classical computer vision (Krizhevsky et al., 2017). However, for many years it became standard to replace large-filter convolutions with stacked small-filter convolutions, which have less room for any notable amount of structure. But in the past year, this trend has changed with inspiration from the long-range spatial mixing abilities of vision transformers. Some of the most prominent new convolutional neural networks, such as ConvNeXt and ConvMixer, once again use large-filter convolutions. These new models also completely separate the processing of the channel and spatial dimensions, meaning that the now-single-channel filters are, in some sense, more independent from each other than in previous models such as ResNets. This presents an opportunity to investigate the structure of convolutional filters. + +In particular, we seek to understand the statistical structure of convolutional filters, with the goal of more effectively initializing them. Most initialization strategies for neural networks focus simply on controlling the variance of weights, as in Kaiming (He et al., 2015) and Xavier (Glorot & Bengio, 2010) initialization, which neglect the fact that many layers in neural networks are highly-structured, with interdependencies between weights, particularly after training. Consequently, we study the covariance matrices of the parameters of convolutional filters, which we find to have a large degree of perhaps-interpretable structure. We observe that the covariance of filters calculated from pretrained models can be used to effectively initialize new convolutions by sampling filters from the corresponding multivariate Gaussian distribution. + +We then propose a closed-form and completely learning-free construction of covariance matrices for randomly initializing convolutional filters from Gaussian distributions. Our initialization is highly effective, especially for larger filters, deeper models, and shorter training times; it usually outperforms both standard uniform initialization techniques and our baseline technique of initializing by + +sampling from the distributions of pre-trained filters, both in terms of final accuracy and time-to-convergence. Models using our initialization often see gains of over $1\%$ accuracy on CIFAR-10 and short-training ImageNet classification; it also leads to small but significant performance gains on full-scale, $\approx 80\%$ -accuracy ImageNet training. Indeed, in some cases our initialization works so well that it outperforms uniform initialization even when the filters aren't trained at all. And our initialization is almost completely free to compute. + +Related work Saxe et al. (2013) proposed to replace random i.i.d. Gaussian weights with random orthogonal matrices, a constraint in which weights depend on each other and are thus, in some sense, "multivariate"; Xiao et al. (2018) also proposed an orthogonal initialization for convolutions. Similarly to these works, our initialization greatly improves the trainability of deep (depthwise) convolutional networks, but is much simpler and constraint-free, being just a random sample from a multivariate Gaussian distribution. Zhang et al. (2022) suggests that the main purpose of pretraining may be to find a good initialization, and crafts a mimicking initialization based on observed, desirable information transfer patterns. We similarly initialize convolutional filters to be closer to those found in pre-trained models, but do so in a completely random and simpler manner. Romero et al. (2021) proposes an analytic parameterization of variable-size convolutions, based in part on Gaussian filters; while our covariance construction is also analytic and built upon Gaussian filters, we use them to specify the distribution of filters. + +Our contribution is most advantageous for large-filter convolutions, which have become prevalent in recent work: ConvNeXt (Liu et al., 2022b) uses $7 \times 7$ convolutions, and ConvMixer (Trockman & Kolter, 2022) uses $9 \times 9$ ; taking the trend a step further, Ding et al. (2022) uses $31 \times 31$ , and Liu et al. (2022a) uses $51 \times 51$ sparse convolutions. Many other works argue for large-filter convolutions (Wang et al., 2022; Chen et al., 2022; Han et al., 2021). + +Preliminaries This work is concerned with depthwise convolutional filters, each of which is parametrized by a $k \times k$ matrix, where $k$ (generally odd) denotes the filter's size. Our aim is to study distributions that arise from convolutional filters in pretrained networks, and to explore properties of distributions whose samples produce strong initial parameters for convolutional layers. More specifically, we hope to understand the covariance among pairs of filter parameters for fixed filter size $k$ . This is intuitively expressed as a covariance matrix $\Sigma \in \mathbb{R}^{k^2 \times k^2}$ with block structure: $\Sigma$ has $k \times k$ blocks, where each block $[\Sigma_{i,j}] \in \mathbb{R}^{k \times k}$ corresponds to the covariance between filter pixel $i,j$ and all other $k^2 - 1$ filter pixels. That is, $[\Sigma_{i,j}]_{\ell,m} = [\Sigma_{\ell,m}]_{i,j}$ gives the covariance of pixels $i,j$ and $\ell,m$ . + +In practice, we restrict our study to multivariate Gaussian distributions, which by convention are considered as distributions over $n$ -dimensional vectors rather than matrices, where the distribution $\mathcal{N}(\mu, \Sigma')$ has a covariance matrix $\Sigma' \in \mathbb{S}_+^n$ where $\Sigma_{i,j}' = \Sigma_{j,i}'$ represents the covariance between vector elements $i$ and $j$ . To align with this convention when sampling filters, we convert from our original block covariance matrix representation to the representation above by simple reassignment of matrix entries, given by + +$$ +\Sigma_ {k i + j, k \ell + m} ^ {\prime} := \left[ \Sigma_ {i, j} \right] _ {\ell , m} \text {f o r} 1 \leq i, j, \ell , m \leq k. \tag {1} +$$ + +In this form, we may now easily generate a filter $F \in \mathbb{R}^{k \times k}$ by drawing a sample $f \in \mathbb{R}^{k^2}$ from $\mathcal{N}(\mu, \Sigma')$ and assigning $F_{i,j} \coloneqq f_{ki + j}$ . In this paper, we assume covariance matrices are in the block form unless we are sampling from a distribution, where the conversion between forms is assumed. + +Scope We restricted our study to the large-filter depthwise convolutions found in new ViT-style CNNs, namely the popular ConvMixer and ConvNeXt architectures. These networks consist of a patch embedding layer followed by alternating spatial- and channel-mixing steps. Both use depthwise convolution for spatial mixing, but ConvMixer uses pointwise convolution (equivalently, linear layers) for spatial mixing while ConvNeXt uses MLPs. ConvMixer uses no internal downsampling, while ConvNeXt includes several downsampling stages. Unlike normal convolutions, the filters in depthwise convolutions act on each input channel separately rather than summing features over input channels. The depth of networks throughout the paper is synonymous with the number of depthwise convolutional layers. All networks investigated use a fixed filter size throughout the network, though the methods we present could easily be extended to the non-uniform case. Further, all methods presented do not concern the biases of convolutional layers. + +![](images/19b5fd9146a2023ac3945e3ba10f95097b95e1fb33f10d1317f11f43e7d7ae6a.jpg) +Figure 1: In pre-trained models, the covariance matrices of convolutional filters are highly-structured. Filters in earlier layers tend to be focused, becoming more diffuse as depth increases. Observing the structure of each block, we note that there is often a static, centered negative component and a dynamic positive component that moves according to the block's position. Often, covariances are higher towards the center of the filters. + +# 2 THE COVARIANCES OF TRAINED CONVOLUTIONAL FILTERS AND THEIR TRANSFERABILITY ACROSS ARCHITECTURES + +In this section, we propose a simple starting point in our investigation of convolutional filter covariance structure: using the distribution of filters from pre-trained models to initialize filters in new models, a process we term covariance transfer. In the simplest case, we use a pre-trained model with exactly the same architecture as the model to be initialized; we then show that we can actually transfer filter covariances across very different models. + +Basic method. We use $i \in 1, \ldots, D$ to denote the $i^{\text{th}}$ depthwise convolutional layer of a model with $D$ layers. We denote the $j \in 1, \ldots, H$ filters of the $i^{\text{th}}$ pre-trained layer of the model by $F_{ij}$ for a model with $H$ convolutional filters in a particular layer (i.e., hidden dimension $H$ ) and $F'$ to denote the filters of a new, untrained model. Then the empirical covariance of the filters in layer $i$ is + +$$ +\Sigma_ {i} = \operatorname {C o v} \left[ \operatorname {v e c} \left(F _ {i 1}\right), \dots , \operatorname {v e c} \left(F _ {i H}\right) \right], \tag {2} +$$ + +with the mean $\mu_{i}$ computed similarly. Then the new model can be initialized by drawing filters from the multivariate Gaussian distribution with parameters $\mu_{i},\Sigma_{i}$ : + +$$ +F _ {i j} ^ {\prime} \sim \mathcal {N} \left(\mu_ {i}, \Sigma_ {i}\right) \quad \text {f o r} j \in 1, \dots , H, i \in 1, \dots , D \tag {3} +$$ + +Note that in this section, we use the means of the filters in addition to the covariances to define the distributions from which to initialize. However, we found that the mean can be assumed to be zero with little change in performance, and we focus solely on the covariance in later sections. + +Experiment design. We test our initialization methods primarily on ConvMixer since it is simple and exceptionally easy to train on CIFAR-10. We use FFCV (Leclerc et al., 2022) for fast data loading using our own implementations of fast depthwise convolution and RandAugment (Cubuk et al., 2020). To demonstrate the performance of our methods across a variety of training times, we train for 20, 50, or 200 epochs with a batch size of 512, and we repeat all experiments with three random seeds. For all experiments, we use a simple triangular learning rate schedule (see Appendix A.1) with the AdamW optimizer, a learning rate of .01, and weight decay of .01 as in Trockman & Kolter (2022). + +Most of our CIFAR experiments use a ConvMixer-256/8 with either patch size 1 or 2; a ConvMixer- $H / D$ has precisely $D$ depthwise convolutional layers with $H$ filters each, ideal for testing our initial covariance transfer techniques. We train ConvMixers using popular filter sizes 3, 7, and 9, as well as 15. We also test our methods on ConvNeXt (Liu et al., 2022b), which includes downsampling unlike ConvMixer; we use a patch size of 1 or 2 with ConvNeXt rather than the default 4 to accommodate relatively small CIFAR-10 images, and the default $7 \times 7$ filters. + +For most experiments, we provide two baselines for comparison: standard uniform initialization, the standard in PyTorch (He et al., 2015), as well as directly transferring the learned filters from a pre-trained model to the new model. In most cases, we expect new random initializations to fall between the performance of uniform and direct transfer initializations. For our covariance transfer experiments, we trained a variety of reference models from which to compute covariances; these are all trained for the full 200 epochs using the same settings as above. + +Frozen filters. Cazenavette et al. noticed that ConvMixers with $3 \times 3$ filters perform well + +even when the filters are frozen; that is, the filter weights remain unchanged over the course of training, receiving no gradient updates. As we are initializing filters from the distribution of trained filters, we suspect that additional training may not be completely necessary. Consequently, in all experiments we investigate both models with thawed filters as well as their frozen counterparts. Freezing filters removes one of the two gradient calculations from depthwise convolution, resulting in substantial training speedups as kernel size increases (see Figure 2). ConvMixer-512/12 with kernel size $9 \times 9$ is around $20\%$ faster, while $15 \times 15$ is around $40\%$ faster. Further, good performance in the frozen filter setting suggests that an initialization technique is highly effective. + +![](images/bda26d01348684bb800f2948562b53111455e3ccd8f8dae76a46726141ae353d.jpg) +Figure 2: The backward pass is faster with frozen filters. + +# 2.1 RESULTS + +The simplest case of covariance transfer (from exactly the same architecture) is a fairly effective initialization scheme for convolutional filters. In Fig. 3, note that this case of covariance transfer (group B) results in somewhat higher accuracies than uniform initialization (group A), particularly for 20-epoch training; it also substantially improves the case for frozen filters. Across all trials, the effect of using this initialization is higher for larger kernel sizes. In Fig. 8, we show that covariance transfer (gold) initially increases convergence, but the advantage over uniform initialization quickly fades. As expected, covariance transfer tends to fall between the performance of direct transfer, where we directly initialize using the filters of the pre-trained model, and default uniform initialization (see group D in Fig. 3 and the green curves in Fig. 8). + +However, we acknowledge that it is not appealing to pre-train models just for an initialization technique with rather marginal gains, so we explore the feasibility of covariance transfer from smaller models, both in terms of width and depth. + +Narrower models. We first see if it's possible to train a narrower reference model to calculate filter covariances to initialize a wider model; for example, using a ConvMixer-32/8 to initialize a ConvMixer-256/8. In Figure 4, we show that the optimal performance surprisingly comes from the covariances of a smaller model. For filter sizes sizes greater than 3, the covariance transfer performance increases with width until width 32, and then decreases for width 256 for both the thawed and frozen cases. We plot this method in Fig. 3 (group C), and note that it almost uniformly exceeds the performance of covariance transfer from the same-sized model. Note that the method does not change; the covariances are simply calculated from a smaller sample of filters. + +Shallower models. Covariance transfer from a shallow model to a deeper model is somewhat more complicated, as there is no longer a one-to-one mapping between layers. Instead, we linearly interpolate the covariance matrices to the desired depth (see Appendix A.1 for more details). Surprisingly, we find that this technique is also highly effective: for example, for a 32-layer-deep ConvMixer, the optimal covariance transfer result is from an 8-layer-deep ConvMixer, and 4-deep models are also quite effective (see Figure 4). + +Different patch sizes. Similarly, it is straightforward to transfer covariances between models with different patch sizes. We find that initializing ConvMixers with $1 \times 1$ patches from filter covariances of ConvMixers with $2 \times 2$ patches leads to a decrease in performance relative to using a reference model of the correct patch size; however, using the filters of a $1 \times 1$ patch-size ConvMixer to initialize a $2 \times 2$ patch size ConvMixer increases performance (see group b vs. group B in Fig. 9). Yet, in both cases, the performance is better than uniform initialization. + +![](images/5c04b6291c992f242230388bcd672611f0027307cbd9ade0816b835dba325d16.jpg) +Figure 3: CIFAR-10 accuracy for uniform initialization (A), baseline covariance transfer (B-D), and our custom initialization results (E). + +![](images/46e10cc24f0f0844eaec905442cc8eee7b4567f27202705b619624c9a8cb949d.jpg) +Figure 4: CIFAR-10 experimental results from initializing via covariances from narrower (top) and shallower (bottom) models. The numeric annotations represent the width (top) and depth (bottom) of the pre-trained model we use to initialize. $\mathbf{U}$ represents uniform initialization. + +Different filter sizes. Covariance transfer between models with different filter sizes is more challenging, as the covariance matrices have different sizes. In the block form, we mean-pad or clip each block to the target filter size, and then bilinearly interpolate over the blocks to reach a correctly-sized covariance matrix. This technique is still better than uniform initialization for filter sizes larger than 3 (which naturally has very little structure to transfer), especially in the frozen case (see Fig. 9) + +Discussion. We have demonstrated that it is possible to initialize filters from the covariances of pre-trained models of different widths, depths, patch sizes, and kernel sizes; while some of these techniques perform better than others, they are almost all better than uniform initialization. Our ob- + +servations indicate that the optimal choice of reference model is narrower or shallower, and perhaps with a smaller patch size or kernel size. We also found that covariance transfer from ConvMixers trained on ImageNet led to greater performance still (Appendix A). This suggests that the best covariances for filter initialization may be quite unrelated to the target model, i.e., model independent. + +# 3 D.I.Y. FILTER COVARIANCES + +Ultimately, the above methods for initializing convolutional filters via transfer are limited by the necessity of a trained network from which to form a filter distribution, which must be accessible at initialization. We thus use observations on the structure of filter covariance matrices to construct our own covariance matrices from scratch. Using our construction, we propose a depth-dependent but simple initialization strategy for convolutional filters that greatly outperforms previous techniques. + +Visual observations. Filter covariance matrices in pre-trained ConvMixers and ConvNeXts have a great deal of structure, which we observe across models with different patch sizes, architectures, and data sets; see Fig. 1 and 32 for examples. In both the block and rearranged forms of the covariance matrices, we noticed clear repetitive structure, which led to an initial investigation on modeling covariances via Kronecker factorizations; see Appendix A for experimental results. Beyond this, we first note that the overall variance of filters tends to increase with depth, until breaking down towards the last layer. Second, we note that the blocks of the covariances often have a static negative component in the center, with a dynamic positive component whose position mirrors that of the block itself. Finally, the covariance of filter parameters is greater in their center, i.e., covariance matrices are at first centrally-focused and become more diffuse with depth. These observations agree with intuition about the structure of convolutional filters: most filters have the greatest weight towards their center, and their parameters are correlated with their neighbors. + +Constructing covariances. With these observations in mind, we propose a construction of covariance matrices. We fix the (odd) filter size $k \in \mathbb{N}^{+}$ , let $\mathbf{1} \in \mathbb{R}^{k \times k}$ be the all-ones matrix, and, as a building block for our initialization, use unnormalized Gaussian-like filters $Z_{\sigma} \in \mathbb{R}^{k \times k}$ with a single variance parameter $\sigma$ , defined elementwise by + +$$ +(Z _ {\sigma}) _ {i, j} := \exp \left(- \frac {(i - \lceil \frac {k}{2} \rceil) ^ {2} + (j - \lceil \frac {k}{2} \rceil) ^ {2}}{2 \sigma}\right) \text {f o r} 1 \leq i, j, \leq k. \tag {4} +$$ + +Such a construction produces filters similar to those observed in the blocks of the Layer #5 covariance matrix in Fig. 1. + +To capture the dynamic component that moves according to the position of its block, we define the block matrix $C \in \mathbb{R}^{k^2 \times k^2}$ with $k \times k$ blocks by + +$$ +[ C _ {i, j} ] = \operatorname {S h i f t} \left(Z _ {\sigma}, i, j\right) \tag {5} +$$ + +where the Shift operation translates each element of the matrix $i$ and $j$ positions forward in their respective dimensions; see Appendix E for details. We then define two additional components, both constructed from Gaussian filters: a static component $S = \mathbf{1} \otimes Z_{\sigma} \in \mathbb{R}^{k^2 \times k^2}$ and a blockwise mask component $M = Z_{\sigma} \otimes \mathbf{1} \in \mathbb{R}^{k^2 \times k^2}$ , which encodes higher variance as pixels approach the center of the filter. + +Using these components and our intuition, we first consider $\hat{\Sigma} = M\odot (C - \frac{1}{2} S)$ , where $\odot$ is an elementwise product. While this adequately represents what we view to be the important structural components of filter covariance matrices, it does not satisfy the property $[\Sigma_{i,j}]_{\ell ,m} = [\Sigma_{\ell ,m}]_{i,j}$ (i.e., covariance matrices must be symmetric, accounting for our block representation). Consequently, we instead calculate its symmetric part, using the notation as follows to denote a "block-transpose": + +$$ +\Sigma^ {B} = \Sigma^ {\prime} \Longleftrightarrow [ \Sigma_ {i, j} ] _ {\ell , m} = \left[ \Sigma_ {\ell , m} ^ {\prime} \right] _ {i, j} \text {f o r} 1 \leq i, j, \ell , m \leq k. \tag {6} +$$ + +Equivalently, this is the perfect shuffle permutation such that $(X\otimes Y)^{B} = Y\otimes X$ with $X,Y\in \mathbb{R}^{k\times k}$ . First, we note that $C^B = C$ due to the definition of the shift operation used in Eq. 5 (see Appendix E). Then, noting that $S^B = M$ and $M^B = S$ by the previous rule, we define our construction + +![](images/7e7464c14b4ea8d5234b0a2cc050fb4c5af84a56d63f7a0d7c907ac19f48ddd9.jpg) +Figure 5: Our convolutional covariance matrix construction with $\sigma = \pi /2$ + +![](images/f1defe2c6faa6b477aa16f134c39c4e880ac38aa7a773c5f6f404c4fc9d10b35.jpg) +Figure 6: How our initialization changes with depth. Variance increases quadratically with depth according to a schedule which can be chosen through visual inspection of pre-trained models or through grid search. Here we use the parameters + +![](images/c01da59adbd5760d2921744fe10aeb50bee253761e8f41c55530edcfc6418b56.jpg) + +![](images/b7b714c86fd3ee081248f13fd8dd284b7b0a75d834e943171e9adeadb7f72c3b.jpg) + +![](images/006e097932af6d7023b5207058880984a960a745b2c273f0eff306d2a260f8c8.jpg) + +![](images/15cb8502cea803f9300369a0ea0847c4aca153d4db5d6decaa069fbff6b29721.jpg) +$\sigma_0 = .5, v_\sigma = .5, a_\sigma = 3.$ + +of $\Sigma$ to be the symmetric part of $\hat{\Sigma}$ (where $C, S, M$ are implicitly parameterized by the $\sigma$ of $Z_{\sigma}$ ): + +$$ +\begin{array}{l} \Sigma = \frac {1}{2} (\hat {\Sigma} + \hat {\Sigma} ^ {T}) = \frac {1}{2} \left[ M \odot (C - \frac {1}{2} S) + (M \odot (C - \frac {1}{2} S)) ^ {B} \right] (7) \\ = \frac {1}{2} \left[ M \odot \left(C - \frac {1}{2} S\right) + \left(M ^ {B} \odot \left(C ^ {B} - \frac {1}{2} S ^ {B}\right)\right) \right] = M \odot \left(C - \frac {1}{2} S\right) + S \odot \left(C - \frac {1}{2} M\right) (8) \\ = \frac {1}{2} [ M \odot (C - S) + S \odot C ]. (9) \\ \end{array} +$$ + +While $\Sigma$ is now symmetric (in the rearranged form of Eq. 1), it is not positive semi-definite, but can easily be projected to $\mathbb{S}_+^{k^2}$ , as is often done automatically by multivariate Gaussian procedures. We illustrate our construction in Fig. 5, and provide an implementation in Fig. 30. + +Completing the initialization. As explained in Fig. 1, we observed that in pre-trained models, the filters become more "diffuse" as depth increases; we capture this fact in our construction by increasing the parameter $\sigma$ with depth according to a simple quadratic schedule; let $d$ be the percentage depth, i.e., $d = \frac{i - 1}{D - 1}$ for the $i^{\text{th}}$ convolutional layer of a model with $D$ total such layers. Then for layer $i$ , we parameterize our covariance construction by a variance schedule: + +$$ +\sigma (d) = \sigma_ {0} + v _ {\sigma} d + \frac {1}{2} a _ {\sigma} d ^ {2} \tag {10} +$$ + +where $\sigma_0, v_\sigma, a_\sigma$ jointly describe how the covariance evolves with depth. Then, for each layer $i \in 1, \ldots, D$ , we compute $d = \frac{i - 1}{D - 1}$ and initialize the filters as $F_{i,j} \sim \mathcal{N}(0, \Sigma_{\sigma(d)}')$ for $j \in 1, \ldots, H$ . We illustrate our complete initialization scheme in Figure 6. + +# 4 RESULTS + +In this section, we present the performance of our initialization within ConvMixer and ConvNeXt on CIFAR-10 and ImageNet classification, finding it to be highly effective, particularly for deep models with large filters. Our new initialization overshadows our previous covariance transfer results. + +Settings of initialization hyperparameters $\sigma_0$ , $v_{\sigma}$ , and $a_{\sigma}$ were found and fixed for CIFAR-10 experiments, while two such settings were used for ImageNet experiments. Appendix C.1 contains full details on our (relatively small) hyperparameter searches and experimental setups, as well as empirical evidence that our method is robust to a large swath of hyperparameter settings. Additional experiments on more datasets and baseline initializations may be found in Appendix B. + +# 4.1 CIFAR-10 RESULTS + +Thawed filters. In Fig. 3, we show that large-kernel models using our initialization (group $\mathbf{E}$ ) outperform those using uniform initialization (group $\mathbf{A}$ ), covariance transfer (groups $\mathbf{B}$ , $\mathbf{C}$ ), and + +even those directly initializing via learned filters (group D). For $2 \times 2$ -patch models (200 epochs), relative to uniform, our initialization causes up to a $1.1\%$ increase in accuracy for ConvMixer-256/8, and up to $1.6\%$ for ConvMixer-256/24. The effect size increases with the the filter size, and is often more prominent for shorter training times. Results are similar for $1 \times 1$ -patch models, but with a smaller increase for $7 \times 7$ filters ( $0.15\%$ vs. $0.5\%$ ). Our initialization has the same effects for ConvNeXt (Fig. 7). However, our method works poorly for $3 \times 3$ filters, which we believe have fundamentally different structure than larger filters; this setting is better-served by our original covariance transfer techniques. + +In addition to improving the final accuracy, our initialization also drastically speeds up convergence of models with thawed filters (see Fig. 8), particularly for deeper models. A ConvMixer-256/16 with $2 \times 2$ patches using our initialization reaches $90\%$ accuracy in approximately $50\%$ fewer epochs than uniform initialization, and around $25\%$ fewer than direct learned filter transfer. The same occurs, albeit to a lesser extent, for $1 \times 1$ patches—but note that for this experiment we used the same initialization parameters for both patch sizes to demonstrate robustness to parameter choices. + +Frozen filters. Our initialization leads to even more surprising effects in models with frozen filters. In Fig. 3, we see that frozen-filter $2 \times 2$ -patch models using our initialization often exceed the performance of their uniform, thawed-filter counterparts by a significant margin of $0.4\% - 2.0\%$ for 200 epochs, and an even larger margin of $0.6\% - 5.0\%$ for 20 epochs (for large filters). That is, group E (frozen) consistently outperforms groups A-D (thawed), and in + +![](images/a18763e830a0ef6905b1da5bd586f938e487c1e82578847be6f6a9934bfe9cba.jpg) +Figure 7: Our init also improves ConvNeXt's accuracy on CIFAR-10 (group E vs. A). + +some cases even group E (thawed), especially for the deeper 24-layer ConvMixer. While this effect breaks down for $1 \times 1$ patch models, such frozen-filter models still see accuracy increases of $0.6\% - 3.5\%$ . However, the effect can still be seen for $1 \times 1$ -patch ConvNeXts (Fig. 7). Also note that frozen-filter models can be up to $40\%$ faster to train (see Fig. 2), and may be more robust (Cazenavette et al.). + +![](images/7e5082cfe1df71fb4659408d7bf5e91f4aeb93055a50fa2b69b86b1acca072c5.jpg) +Figure 8: Convergence plots: each data point runs through a full cycle of the LR schedule, and all points are averaged over three trials with shaded standard deviation. + +![](images/18a14a01e63473bac0fbbad27ba4bc635e0899151aa2051a47eb37aa75028336.jpg) + +# 4.2 IMAGENET EXPERIMENTS + +Our initialization performs extremely well on CIFAR-10 for large-kernel models, almost always helping and rarely hurting. Here, we explore if the performance gains transfer to larger-scale ImageNet models. We observe in Fig. 32, Appendix F that filter covariances for such models have finer-grained structure than models trained on CIFAR-10, perhaps due to using larger patches. Nonetheless, our initialization leads to quite encouraging improvements in this setting. + +Experiment design. We used the "A1" training recipe from Wightman et al. (2021), with cross-entropy loss, fewer epochs, and a triangular LR schedule as in Trockman & Kolter (2022). We primarily demonstrate our initialization for 50-epoch training, as the difference between initializations is most pronounced for lower training times. We also present two full, practical-scale 150-epoch experiments on large models. We also included covariance transfer experiments in Appendix F. + +Table 1: ImageNet-1k accuracy from various architectures and initializations. "Ours" denotes our proposed initialization. Bold indicates best within architecture and category (frozen or thawed). + +
ModelTHAWEDFROZEN
ArchitectureFilter SizePatch Size# EpochsUniformOurs .15 .5 .25Ours .15 .25 1.0UniformOurs .15 .5 .25Ours .15 .25 1.0
ConvMixer-512/129145067.0367.4167.3460.4764.4364.12
ConvMixer-512/249145067.7669.6069.5262.5066.5766.38
ConvMixer-512/329145065.0068.7868.8455.7966.5966.32
ConvMixer-1024/129145073.5573.6273.7568.9671.4871.30
ConvMixer-1024/249145074.1975.3375.5069.6573.4274.31
ConvMixer-1024/329145072.1874.9874.9564.9473.0073.12
ConvMixer-512/12975072.0571.9272.3267.2568.9168.92
ConvNeXt-Atto745069.9667.8468.0651.4364.5264.43
ConvNeXt-Tiny745075.9976.0877.1164.1774.6275.21
ConvMixer-1536/2491415080.1180.28
ConvNeXt-Tiny7415079.7479.81
+ +Thawed filters. On models trained for 50 epochs with thawed filters, our initialization improves the final accuracy by $0.4\% - 3.8\%$ (see Table 1). For the relatively-shallow ConvMixer-512/12 on which we tuned the initialization parameters, we see a gain of just $0.4\%$ ; however, when increasing the depth to 24 or 32, we see larger gains of $1.8\%$ and $3.8\%$ , respectively, and a similar trend among the wider ConvMixer-1024 models. Our initialization also boosts the accuracy of the 18-layer ConvNeXt-Tiny from $76.0\%$ to $77.1\%$ ; however, it decreased the accuracy of the smaller, 12-layer ConvNeXt-Atto. This is perhaps unsurprising, seeing as our initialization seems to be more helpful for deep models, and we used hyperparameters optimized for a model with a substantially different patch and filter size. + +Our initialization is also beneficial for more-practical 150-epoch training, boosting accuracy by around $0.1\%$ on both ConvMixer-1536/24 and ConvNeXt-Tiny (see Table 1, bottom rows). While the effect is small, this demonstrates that our initialization is still helpful even for longer training times and very wide models. We expect that within deeper models and with slightly more parameter tuning, our initialization could lead to still larger gains in full-scale ImageNet training. + +**Frozen filters.** Our initialization is extremely helpful for models with frozen filters. Using our initialization, the difference between thawed and frozen-filter models decreases with increasing depth, i.e., it leads to $2 - 11\%$ improvements over models with frozen, uniformly-initialized filters. For ConvMixer-1024/32, the accuracy improves from $64.9\%$ to $73.1\%$ , which is over $1\%$ better than the corresponding thawed, uniformly-initialized model, and only $2\%$ from the best result using our initialization. This mirrors the effects we saw for deeper models on our earlier CIFAR-10 experiments. We see a similar effect for ConvNeXt-Tiny, with the frozen version using our initialization achieving $75.2\%$ accuracy vs. the thawed $76.0\%$ . In other words, our initialization so effectively captures the structure of convolutional filters that it is hardly necessary to train them after initialization; one benefit of this is that it substantially speeds up training for large-filter convolutions. + +# 5 CONCLUSION + +In this paper, we proposed a simple, closed-form, and learning-free initialization scheme for large depthwise convolutional filters. Models using our initialization typically reach higher accuracies more quickly than uniformly-initialized models. We also demonstrated that our random initialization of convolutional filters is so effective, that in many cases, networks perform nearly as well (or even better) if the resulting filters do not receive gradient updates during training. Moreover, like the standard uniform initializations generally used in neural networks, our technique merely samples from a particular statistical distribution, and it is thus almost completely computationally free. In summary, our initialization technique for the increasingly-popular large-kernel depthwise convolution operation almost always helps, rarely hurts, and is also free. + +# REFERENCES + +George Cazenavette, Joel Julin, and Simon Lucey. Rethinking the role of spatial mixing. +Yukang Chen, Jianhui Liu, Xiaojuan Qi, Xiangyu Zhang, Jian Sun, and Jiaya Jia. Scaling up kernels in 3d cnns. arXiv preprint arXiv:2206.10555, 2022. +Ekin D Cubuk, Barret Zoph, Jonathon Shlens, and Quoc V Le. Randaugment: Practical automated data augmentation with a reduced search space. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition workshops, pp. 702-703, 2020. +Xiaohan Ding, Xiangyu Zhang, Jungong Han, and Guiguang Ding. Scaling up your kernels to 31x31: Revisiting large kernel design in cnns. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11963-11975, 2022. +Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the thirteenth international conference on artificial intelligence and statistics, pp. 249-256. JMLR Workshop and Conference Proceedings, 2010. +Qi Han, Zejia Fan, Qi Dai, Lei Sun, Ming-Ming Cheng, Jiaying Liu, and Jingdong Wang. On the connection between local attention and dynamic depth-wise convolution. In International Conference on Learning Representations, 2021. +Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In Proceedings of the IEEE international conference on computer vision, pp. 1026-1034, 2015. +Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Communications of the ACM, 60(6):84-90, 2017. +Guillaume Leclerc, Andrew Ilyas, Logan Engstrom, Sung Min Park, Hadi Salman, and Aleksander Madry. ffcv. https://github.com/libffcv/ffcv/, 2022. commit f253865. +Shiwei Liu, Tianlong Chen, Xiaohan Chen, Xuxi Chen, Qiao Xiao, Boqian Wu, Mykola Pechenizkiy, Decebal Mocanu, and Zhangyang Wang. More convnets in the 2020s: Scaling up kernels beyond 51x51 using sparsity. arXiv preprint arXiv:2207.03620, 2022a. +Zhuang Liu, Hanzi Mao, Chao-Yuan Wu, Christoph Feichtenhofer, Trevor Darrell, and Saining Xie. A convnet for the 2020s. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11976-11986, 2022b. +David W Romero, Robert-Jan Bruintjes, Jakub M Tomczak, Erik J Bekkers, Mark Hoogendoorn, and Jan C van Gemert. Flexconv: Continuous kernel convolutions with differentiable kernel sizes. arXiv preprint arXiv:2110.08059, 2021. +Andrew M Saxe, James L McClelland, and Surya Ganguli. Exact solutions to the nonlinear dynamics of learning in deep linear neural networks. arXiv preprint arXiv:1312.6120, 2013. +Asher Trockman and J Zico Kolter. Patches are all you need? arXiv preprint arXiv:2201.09792, 2022. +Zeyu Wang, Yutong Bai, Yuyin Zhou, and Cihang Xie. Can cnns be more robust than transformers? arXiv preprint arXiv:2206.03452, 2022. +Ross Wightman, Hugo Touvron, and Hervé Jégou. Resnet strikes back: An improved training procedure in timm. arXiv preprint arXiv:2110.00476, 2021. +Lechao Xiao, Yasaman Bahri, Jascha Sohl-Dickstein, Samuel Schoenholz, and Jeffrey Pennington. Dynamical isometry and a mean field theory of cnns: How to train 10,000-layer vanilla convolutional neural networks. In International Conference on Machine Learning, pp. 5393-5402. PMLR, 2018. +Yi Zhang, Arturs Backurs, Sébastien Bubeck, Ronen Eldan, Suriya Gunasekar, and Tal Wagner. Unveiling transformers with lego: a synthetic reasoning task. arXiv preprint arXiv:2206.04301, 2022. + +# A ADDITIONAL CIFAR RESULTS + +![](images/e2e855edaaa83226485361a65c3e7fe8d3e643271b0100889bc23ec51ef36c94.jpg) +Figure 9: Initializing via covariances from models with different patch (left) and filter sizes (right). Left: Lowercase denotes initializing from patch size $1 \times 1$ , and uppercase $2 \times 2$ . Right: Annotations denote the reference filter size, $\mathbf{U}$ is uniform. + +![](images/57f24b50759766f095a051059c55432919e1d0357586cc9dafd36587cc86d754.jpg) + +![](images/d7cc1d06630e596ed1a9b04f7f26e180c547173f1fc71ebc44d86da40753c788.jpg) + +![](images/327f68ea65e1bdb35bf60130ea2e5376011228158e8b16ea9e1f0503bde09075.jpg) +Figure 10: Using filter distributions from pre-trained ImageNet models to initialize models trained on CIFAR-10 is also effective (represented by groups $\mathbf{E}$ and $\mathbf{F}$ , with hatch marks). + +![](images/904436f776970eb4115a95576e494cd2ecbde0ea3ba02546e032fa75d5ba1e30.jpg) +Figure 11: Convergence plots: each data point runs through a full cycle of the LR schedule, and all points are averaged over three trials with shaded standard deviation. + +![](images/acd4a238c13a6c9b21c886b766cbe4cd4da554321410928a5808b18f486df778.jpg) + +Covariance structure. As a first step towards modeling the structure of filter covariances, we replaced covariances with their Kronecker-factorized counterparts using the rearranged form of the covariance matrix defined in Eq. (1), i.e., $\Sigma = A\otimes A$ where $A\in \mathbb{S}_{+}^{k}$ . Surprisingly, this slightly improved performance over unfactorized covariance transfer (see Fig. 12), suggesting that filter covariances are not only eminently transferrable for initialization, but that their core structure may be simpler than meets the eye. Kronecker factorizations were computed via gradient descent minimizing the mean squared error. + +![](images/a1288b8976f875fceb0381ce848056e6535b26f0f1bfbee2a1a97f9ff96f193b.jpg) +Figure 12: Approx. covs. + +![](images/8dfc3980d2bfb8a7e93b5b9e8c1fa233b423a98144e571ced3ebb5cc4ce4c6ba.jpg) +Figure 13: Filters learned or generated for ConvMixer-256/8 with $2 \times 2$ patches and $9 \times 9$ filters trained on CIFAR-10: learned filters (left), filters sampled from the Gaussian defined by the empirical covariance matrix of learned filters (center), and filters from our initialization technique (right). + +# A.1 ADDITIONAL EXPERIMENT DETAILS + +```txt +1 epochs $= 100$ +2 lr_max $= 0.01$ +3 lr_sched $=$ lambda t: np.interp([t], $\backslash$ +4 [0, epochs\*2//5, epochs\*4//5, epochs], $\backslash$ +5 [0, lr_max, lr_max/20.0, 0]) [0] +6 for epoch in range(epoehs): +7 for i, (X, y) in enumerate loader): +8 #... +9 lr $=$ lr_sched(epoeh + (i + 1)/len(loader)) +10 opt param_groups[O].update(lr $\equiv$ lr) +11 #... +``` + +![](images/1513827b55a0c8dd69955b81ed470e3945aa18c05217906a1429e8e1356fd506.jpg) +Figure 14: Implementation and visualization of the piecewise triangular learning rate schedule we used for all experiments. We used the implementation from Trockman & Kolter (2022). +Figure 15: Implementation of linear interpolation used for transferring covariances from shallower to deeper models. We treat the depth of a layer as a percent of the full depth of the network, i.e., our notion of depth is always in the interval [0, 1]. + +```python +1 def linear_interpolation(covs,from_depth,to_depth): +2 #covs:list of covariance matrices (np.array) +3 #from_depth:depth of model from which we are transferring +4 #to_depth:depth of model we are transferring to +5 from_knots $=$ np.arange(0,from_depth)/(from_depth-1) +6 to_knots $=$ np.arange(0,to_depth)/(to_depth-1) +7 ret $\equiv$ [] +8 for knot in to Knots: +9 for i in range(len(from Knots)-1): +10 if knot $\rightharpoondown$ from_knots[i] and knot $\leftarrow$ from_knots[i+1]: a_weight $=$ (knot - from_knots[i+1]) / (from_knots[i] - from_knots[i + 1]) b_weight $=$ (knot - from_knots[i]) / (from_knots[i+1] - from_knots[i]) ret.append(a_weight \* covs[i] + b_weight \* covs[i+1]) +14 break +15 return ret +``` + +# B ADDITIONAL BASELINES AND DATASETS + +![](images/88f3f18d06cb57169efdf4b1d5dc6f4a5386fc8b7f3f0c07b5008d7fe154fa57.jpg) +Figure 16: Our initialization technique outperforms alternatives (uniform, dirac, all-zero, and orthogonal initialization) for filter sizes larger than 3, especially for short-duration training. Note that for dirac and all-zero initialization (B, C) in the frozen case, accuracies are $\approx 60\%$ and thus are not on the graph. Results on CIFAR-10. + +![](images/e917fadf9fadd396addc32ca704e9fc5fdb1e917f115e35d23a4aa4265746df1.jpg) +Figure 17: Our initialization also generally outperforms or matches baselines on the Street View House Numbers (SVHN) dataset. Since this task is relatively easy, we used a much smaller ConvMixer-64/4. The advantage of our method is most noticeable for short-duration (20 epoch) training and the frozen-filter setting. + +![](images/f6f984580babf34d77ca7e41457f16ef479c7d28dc8eec9f283ceb686058f177.jpg) +Figure 18: Our initialization is again competitive with baselines on the EuroSAT dataset, where we used a random 75/25 train/test split. We found our models converged quickly on this task, and thus used fewer epochs for all experiments (10, 20, and 50). Our initialization approximately matches uniform initialization and outperforms other methods in the 50-epoch setting, but performs better in the 10- and 20- epoch settings. It is also particularly effective for frozen filters. + +![](images/df3fc8f914a6c29419c78d05d55c463e31e01f981b9ab945787669e10acd68f2.jpg) +Figure 19: Our initialization is particularly advantageous on the more-difficult CIFAR-100 dataset, with 50-epoch training meeting or even surpassing 200-epoch uniformly-initialized training. + +![](images/edd270a8e4bf467cc5ae7af05181a60bb0e8922addae9fbe9f9153964e9de23a.jpg) + +![](images/e4090d89908e24c99032751d0c5f74b5cd679240bc1d86b314d123db5962d860.jpg) +Figure 20: Our initialization is also helpful on Tiny ImageNet. Here we increased the patch size to $4 \times 4$ to accommodate the increased input size of $64 \times 64$ (for computational efficiency). + +![](images/0c9fdfd0890691c16611ac2b1a6e4ccf097770ae132073c72ddadb5554c28590.jpg) +Figure 21: Compared to other initialization techniques, ours results in faster convergence when training a ConvMixer-256/16 on CIFAR-10 and CIFAR-100. That is, one can often train models for fewer epochs when using our initialization to achieve results comparable to those from using other initialization techniques. + +![](images/b0e26718138e3322ecd7bb9334692b7942073ac975262a792579d9eea79024a6.jpg) + +![](images/8e90debbf30547c8d1be498e8522bcf603a120c6f310f5a350fdeabfdbad7c7f.jpg) +(a) + +![](images/1ca9aea1d4f639a10b93b027071dba1f63370a023c3db962b03c7a0c9bab4486.jpg) +(b) +Figure 22: We investigated how our initialization affects data efficiency by training on random (smaller) subsets of CIFAR-10. Each trial is averaged over 3 such subsets. In the very low-data setting (a), we trained for 300 epochs to compensate for the smaller number of iterations overall. In (b), we trained for 100 epochs. In some cases, using our initialization is comparable to doubling the number of training points. + +# C HYPERPARAMETER GRID SEARCHES & EXPERIMENTAL SETUP + +CIFAR-10 hyperparameter search. We chose an initial setting of our method's three hyperparameters via visual inspection, and then refined them via small-scale grid searches. For CIFAR-10 experiments, we searched over parameters for ConvMixer-256/8 with frozen $9 \times 9$ filters trained for 20 epochs, and chose $\sigma_0 = .08$ , $v_\sigma = .37$ , $a_\sigma = 2.9$ for $2 \times 2$ -patch models, and found the optimal parameters for $1 \times 1$ -patch models to be approximately doubled. However, note that our initialization is quite robust to different parameter settings, with the difference from our doubling choice being less than $0.1\%$ (see Figure 23). We used the same parameters across all kernel sizes, as well as for ConvNeXt, a choice which is likely sub-optimal; our search only serves as a rough heuristic. + +ImageNet-1k hyperparameter search. We did a small grid search using a ConvMixer-512/12 with $14 \times 14$ patches and $9 \times 9$ filters trained for 10 epochs on ImageNet-1k (see Appendix F), from which we chose two candidate settings: $\sigma_0 = .15, v_\sigma = .5, a_\sigma = .25$ for frozen-filter models and $\sigma_0 = .15, v_\sigma = 0.25, a_\sigma = 1.0$ for thawed models. We use these parameters for all the ImageNet experiments, even for models with different patch and kernel sizes (e.g., ConvNeXt). This demonstrates that hyperparameter tuning is optional for our technique; its transferability is not surprising given our results in Sec. 2. + +# C.1 CIFAR-10 GRID SEARCHES + +![](images/b9bf3bf240e0048131c87c5836ed4d56644135c79aec0ab35b34ddf01bc2486a.jpg) + +![](images/fe4e3f3f47ea3eb7cb4135cc87de34326ce6f4462f028ab99be6f3c17fbbcb14.jpg) + +![](images/456a22c1506888f52bbb8ff39c715e9da519c7965892cdffe2f7841e1144a643.jpg) + +![](images/61ed28201874062dc036c7ec10130cce0a2b72bf203bfe29113923d4c24ba1a1.jpg) +Figure 23: Grid search over initialization parameters $\sigma_0, v_\sigma, a_\sigma$ for ConvMixer-258/8 with $9 \times 9$ frozen filters and $2 \times 2$ patches trained for 20 epochs on CIFAR-10. Note that the performance of uniform initialization is only $\approx 85\%$ , i.e., almost all choices result in some improvement. + +![](images/7d329d9da6a242548820eb9efe58dc13168903efaf4560392f56e92eefee097c.jpg) + +![](images/911b88b89a7e11e355dd3055f19812ec9ea73b1e0c84bd28e981960c5a67737c.jpg) + +![](images/2eb157e9d1826aa6130e787c781fb87bfeb743e059b24d618adb0f1f29993cfe.jpg) + +![](images/8610ab9466c075d123b92701862f7d6bed16c0e5148620328b119c9f86bd228a.jpg) + +![](images/33c62c74fae7595d1a21fd8098b70a80e78377107b01a44b2d3fdbf0f4409b56.jpg) +Figure 24: Grid search over initialization parameters $\sigma_0, v_\sigma, a_\sigma$ for ConvMixer-258/8 with $9 \times 9$ frozen filters and $1 \times 1$ patches trained for 20 epochs on CIFAR-10. Note that the performance of uniform initialization is only $\approx 88\%$ , i.e., almost all choices result in some improvement. + +![](images/4a7813e3bf79df303efeacd249c5f7d1036a72272846550a70f25cf0c415b485.jpg) + +![](images/6eff3ba5f1a2d067d4ec51238d0380aa9cb6131d8eed6c3f94f1a7c8346ca03f.jpg) + +![](images/51a490fc47261d085a2aa589285804ece252af18c4340bb594a9035cc577ab45.jpg) + +![](images/b9038b7ad27dcd71b04171dc7e99a7a1ea11debb011233304d905f61af2c65fc.jpg) + +![](images/04d6363f118feb6850e27155953575636fe472ab03c7fcdfa77e2708314d447d.jpg) + +![](images/d6ce2942fdfff1ed1b65666922aa05aab85a0b14408fcdd0c7f907da293c553d.jpg) +Figure 25: Grid search over initialization parameters $\sigma_0, v_\sigma, a_\sigma$ for ConvNeXt-atto on CIFAR-10 with frozen filters and $1 \times 1$ patches trained for 20 epochs on CIFAR-10. Note the baseline performance with uniform initialization is around $80\%$ , i.e., compared to ConvMixer there are more potentially disadvantageous parameter combinations. + +![](images/717acfd8a30f8286585af4142d34641a7ed19a45e192c8eada7ef84f313a3d50.jpg) + +![](images/b4e4c343a5f5f6e236d9a22f8c7d49379cc42091dc6394818e426491a7e14991.jpg) + +![](images/77183379354dce963951e5c95081068a613caca65396326a982c08e697c47ba9.jpg) + +![](images/55332ad5a62100fe91fd56a3b26542721ab871fd8aa3d35076903b682fd834f1.jpg) + +![](images/4a439e3132a65ef6c43b75acc5b0a9ac7981d4ca4a0b94ba19776cd19d2ff767.jpg) +Figure 26: Grid search over initialization parameters $\sigma_0, v_\sigma, a_\sigma$ for ConvNeXt-atto on CIFAR-10 with frozen filters and $1 \times 1$ patches trained for 20 epochs, using the "sawtooth" variance schedule (see Fig 27) to account for downsampling layers. While this perhaps shows better robustness to parameter changes than Fig. 26, the effect could also be due to effectively dividing the parameters by two. + +![](images/e66b55b99aa3625f444a9456f7c800b2854aaa804bf668b30b2ec3063867ec8d.jpg) + +![](images/5e9cc12a871c8f1c818250e5aaf8307ac630b9e89ce2e5dc37a457da7e10fd9f.jpg) + +![](images/943d7a4766bb27449481786a476bf2939b88beb770d8bfececf929557c86d58d.jpg) + +![](images/294a0d81d2989cd8df6242f1e9cdf70d42dce5f68f045d1d3f4e59e1cc7a4454.jpg) +Figure 27: Proposed stepwise variance schedule for ConvNeXt, i.e., a model including downsampling layers. In our experiments, we saw no advantage to using this scheme. + +![](images/b1fb797a1b90284c53d5a43e1b49bf4903cb45bb492a3ba88005ddf6e46af3f7.jpg) + +# C.2 IMAGENET GRID SEARCHES + +![](images/17ffa276b2fa4c9f7195847bcf3312f10b12d6a8cd95887731f002c6eece5ebb.jpg) +Figure 28: Frozen filters: Grid search over initialization parameters for ConvMixer-512/12 with $14 \times 14$ patches and $9 \times 9$ filters, 10 epochs. + +![](images/120e5043f1515770aa1926cae14f4027281b023dcf0561fda95a9d35f41110d9.jpg) + +![](images/954383295d8c55fe282d59b1c91ca9e796137674bcb52d89e1400b15b0736375.jpg) + +![](images/69e2ae0fb93b7f8f13cd97a2c38053a9973afb5efe9d477c5b8d9757e003ae6d.jpg) +Figure 29: Thawed filters: Grid search over initialization parameters for ConvMixer-512/12 with $14 \times 14$ patches and $9 \times 9$ filters, 10 epochs. + +![](images/9ffa86257ffb8b3d500ad229ef0011f0cb20bce2dfe1d9976242da62fd571d34.jpg) + +![](images/8cfed7fa662914516eb00288726467b6f33b3203f4ab1f294b31efaf81240b3d.jpg) + +# D IMPLEMENTATIONS + +# D.1 TERSE IMPLEMENTATION + +Figure 30: Implementation of our convolution covariance construction in NumPy. +```python +1 def ConvCov (k, s): 1 def Gauss (k, mx, my, s): +2 C = np.zeros((k**2,)*2) 2 res = np.zeros((k, k)) +3 for i, j in np.index (k, k): 3 for i, j in np.index (k, k): +4 C[k*i:k*i+k, k*j: k*j+k] = Gauss (k, j, i, s) 4 cx, cy = (j-mx-k//2-1)%k, (i-my-k//2-1)%k +5 Z, l = Gauss (k, k//2, k//2, s), np.ones((k, k)) 5 z = ((cx-k//2)**2+(cy-k//2)**2)/s +6 S, M = np.kron(1, Z), np.kron(Z, l) 6 res[i, j] = np.exp(-0.5*z) +7 return 0.5 * (M * (C - S) + C * S) 7 return res.reshape(k, k) +``` + +```python +def Initialize(wconv, d, s0, sv, sa): + c, _, ks, _ = wconv.shape + s = s0 + sv * d + 0.5 * sa * d**2 + cov = ConvCov(ks, s).reshape((ks,)*4).transpose(0,2,1,3).reshape((ks**2),*2) + filters = np.random.multivariate_normal(np.zeros(ks**2), cov, size=(c)) + wconv.data = torch.tensor(filters.reshape(c,1,ks,ks), dtype=wconvdtype device=wconv_device) +# Find depthwise convolutional layers +convs = [x for x in model/modules() if isinstance(x, nn.Conv2d) \ and len(x.weight.shape) == 4 and x.weight.shape[1] == 1] +# Initialize them according to variance schedule +for i, conv in enumerate(convs): + Initialize(conv.weight, i / (len(convs) - 1), 0.16, 0.32, 2.88) +``` + +Figure 31: Code to use our covariance construction and variance schedule to initialize depthwise convolutional layers in PyTorch. wconv is the weight of a depthwise convolutional layer (nn.Conv2d), and $\mathrm{d} \in [0,1]$ is its depth as a fraction of the total depth. + +# E SHIFT FUNCTION DEFINITION & PROOF + +For a given matrix $Z \in \mathbb{R}^{k \times k}$ (say, a Gaussian kernel centered at 0, 0—the top left of the filter), we assume the shift operator is defined as follows: + +$$ +\operatorname {S h i f t} (Z, \delta x, \delta y) _ {i, j} = Z _ {(i + \delta x) \bmod k, (j + \delta y) \bmod k}. \tag {11} +$$ + +Then, if + +$$ +[ C _ {i, j} ] = \operatorname {S h i f t} \left(Z _ {\sigma}, i, j\right) \tag {12} +$$ + +and the operation $(.)^{B}$ is defined by + +$$ +\Sigma^ {B} = \Sigma^ {\prime} \Longleftrightarrow [ \Sigma_ {i, j} ] _ {\ell , m} = \left[ \Sigma_ {\ell , m} ^ {\prime} \right] _ {i, j}, \tag {13} +$$ + +and + +$$ +[ C _ {i, j} ] _ {\ell , m} = \operatorname {S h i f t} (Z, i, j) _ {\ell , m} = Z _ {(i + \ell) \bmod k, (j + m) \bmod k} \tag {14} +$$ + +$$ +[ C _ {\ell , m} ] _ {i, j} = \operatorname {S h i f t} (Z, \ell , m) _ {i, j} = Z _ {(\ell + i) \bmod k, (m + j) \bmod k}, \tag {15} +$$ + +this shows that $[C_{i,j}]_{\ell,m} = [C_{\ell,m}]_{i,j}$ for all $1 \leq i, j, \ell, m \leq k$ (i.e., $C$ is "block-symmetric"), which shows $C = C^B$ . + +# F ADDITIONAL IMAGENET EXPERIMENTS + +![](images/054417421bfc03092d110fa1e1f4c400a91a246a7e7abb7ad3c53d6f05e748e6.jpg) +Figure 32: Covariance matrices from a ConvMixer trained on ImageNet exhibit similar structure to those of ConvMixers trained on CIFAR-10; however, later layers tend to have more structure, including a "checkerboard" pattern in each block. + +F.1 10-EPOCH IMAGENET RESULTS + +
ConvMixer-512/12: Patch Size 14, Kernel Size 9ThawedFrozen
Uniform init54.547.4
Stats from CM-512/1255.553.4
Stats from CM-64/1255.252.7
Filters transferred from CM-512/1255.154.4
Our init (.15, .3, .5)55.452.2
Our init (.15, .5, .25)55.552.4
+ +Table 2: ConvMixer performance on ImageNet-1k training with 10 epochs. Our initialization performs comparably to loading covariance matrices from previously-trained models (which were trained for 150 epochs). + +
ConvMixer-512/12: Patch Size 7, Kernel Size 9ThawedFrozen
Uniform init61.8756.73
Stats from CM-512/1262.5660.79
Stats from CM-64/1262.7260.86
Filters transferred from CM-512/1262.8161.83
Our init (.15, .3, .5)62.4958.94
Our init (.15, .5, .25)62.5959.31
+ +Table 3: ImageNet 10-epoch training + +
ConvMixer-512/24: Patch Size 14, Kernel Size 9ThawedFrozen
Uniform init50.4043.00
Stats from CM-512/1253.0351.45
Stats from CM-64/1253.1651.25
Filters transferred from CM-512/1252.8752.12
Our init (.15, .3, .5)53.8051.16
Our init (.15, .5, .25)53.7650.81
+ +Table 4: ImageNet 10-epoch training + +
ConvNeXt-AttoThawedFrozen
Uniform init31.3723.63
Stats from the same arch33.4440.41
Stats from 1/8th-width arch29.8131.47
Filters transferred from same arch31.6840.48
Our init (.15, .3, .5)37.6434.59
Our init (.15, .5, .25)31.3434.23
Our init (.15, .25, 1.0)38.0133.98
+ +Table 5: ImageNet 10-epoch training + +
ConvNeXt-TinyThawedFrozen
Uniform init32.5125.94
Stats from the same arch42.7841.54
Stats from 1/8th-width arch44.6042.86
Filters transferred from same arch31.0145.32
Our init (.15, .3, .5)35.6435.04
Our init (.15, .5, .25)40.1738.91
Our init (.15, .25, 1.0)40.7836.62
+ +Table 6: ImageNet 10-epoch training + +F.2 50-EPOCH IMAGENET RESULTS + +
ConvNeXt-AttoThawedFrozen
Uniform init69.9651.43
Stats from the same arch68.8366.71
Stats from 1/8th-width arch68.6966.31
Filters transferred from same arch68.0167.29
Our init (.15, .3, .5)65.5563.48
Our init (.15, .5, .25)67.8464.52
Our init (.15, .25, 1.0)68.0663.43
+ +Table 7: ImageNet 50-epoch training + +
ConvMixer-512/12: Patch Size 14, Kernel Size 9ThawedFrozen
Uniform init67.0360.47
Stats from the same arch67.1365.08
Stats from 1/8th-width arch66.7564.94
Filters transferred from same arch67.2866.11
Our init (.15, .3, .5)66.1264.39
Our init (.15, .5, .25)67.4164.43
Our init (.15, .25, 1.0)67.3464.12
+ +Table 8: ImageNet 50-epoch training + +
ConvMixer-512/24: Patch Size 14, Kernel Size 9ThawedFrozen
Uniform init67.7662.50
Stats from the same arch68.9267.91
Stats from 1/8th-width arch68.7867.36
Filters transferred from same arch69.4268.66
Our init (.15, .3, .5)69.0566.20
Our init (.15, .5, .25)69.6066.57
Our init (.15, .25, 1.0)69.5266.38
+ +Table 9: ImageNet 50-epoch training + +G ADDITIONAL CIFAR-10 TABLES + +Table 10: CIFAR-10 results for ConvMixer-256/8 with patch size 2. Bold denotes the highest per group, and blue bold denotes the second highest. + +
THAWEDFROZEN
Filt. Size#EpsUniformCov. transferCov. transfer(1/8 width)Direct transferOur initUniformCov. transferCov. transfer(1/8 width)Direct transferOur init
32089.69 ± .2090.08 ± .3989.76 ± .1490.02 ± .1489.64 ± .1388.99 ± .4189.56 ± .1189.54 ± .4089.94 ± .0888.94 ± .25
5091.92 ± .0392.01 ± .2191.83 ± .0291.69 ± .1891.63 ± .0791.12 ± .2291.42 ± .1591.34 ± .2791.62 ± .1791.02 ± .25
20093.08 ± .1692.94 ± .2692.92 ± .1992.97 ± .1892.84 ± .1192.38 ± .2792.55 ± .0992.27 ± .2192.47 ± .1992.09 ± .13
72089.66 ± .2189.91 ± .0990.63 ± .1090.48 ± .2690.79 ± .2486.73 ± .2788.86 ± .3689.36 ± .0990.00 ± .2790.22 ± .03
5091.81 ± .1591.77 ± .2691.88 ± .1991.91 ± .2092.48 ± .0889.44 ± .2390.72 ± .1391.05 ± .1291.54 ± .3792.02 ± .23
20092.86 ± .1592.77 ± .2892.74 ± .1592.72 ± .0693.40 ± .2090.70 ± .1291.68 ± .1691.84 ± .0592.36 ± .2092.83 ± .24
92089.26 ± .3589.70 ± .0690.22 ± .3690.14 ± .0690.85 ± .1484.97 ± .0388.18 ± .1289.67 ± .0789.50 ± .3790.56 ± .09
5091.74 ± .1291.63 ± .1592.11 ± .1891.79 ± .1892.54 ± .1688.25 ± .3990.22 ± .0991.01 ± .1291.23 ± .1391.96 ± .12
20092.65 ± .1692.53 ± .1392.85 ± .1292.62 ± .2693.21 ± .0990.04 ± .3391.34 ± .0892.00 ± .1892.05 ± .2893.00 ± .05
152086.64 ± .3088.19 ± .5189.27 ± .0589.17 ± .1990.33 ± .2281.99 ± .2186.31 ± .1587.52 ± .2388.39 ± .2890.38 ± .06
5089.94 ± .4590.26 ± .1690.81 ± .2690.79 ± .2492.17 ± .2385.05 ± .3388.71 ± .0889.51 ± .0690.08 ± .0992.11 ± .24
20091.79 ± .2391.60 ± .2192.01 ± .1991.87 ± .2692.94 ± .1187.64 ± .0589.93 ± .2590.61 ± .1790.94 ± .1293.02 ± .09
+ +Table 11: CIFAR-10 results for ConvMixer-256/24 with patch size 2. Bold denotes the highest per group, and blue bold denotes the second highest. + +
THAWEDFROZEN
Filt. Size#EpsUniformCov. transferCov. transfer\( (\frac{1}{8} width) \)Direct transferOur initUniformCov. transferCov. transfer\( (\frac{1}{8} width) \)Direct transferOur init
32088.37 ± .1188.79 ± .0788.97 ± .1389.22 ± .2688.42 ± .1487.74 ± .3288.63 ± .2088.80 ± .1288.95 ± .1188.05 ± .09
5092.38 ± .1592.30 ± .2492.46 ± .0792.56 ± .1992.19 ± .2491.86 ± .1892.02 ± .3292.37 ± .0392.31 ± .1492.00 ± .23
20094.13 ± .0794.32 ± .1294.41 ± .1194.37 ± .0394.16 ± .2093.71 ± .1593.91 ± .1394.28 ± .2093.95 ± .2393.84 ± .10
72088.49 ± .4689.08 ± .1589.90 ± .1489.81 ± .1690.28 ± .1885.81 ± .0587.98 ± .0889.19 ± .1289.34 ± .4090.09 ± .22
5091.90 ± .1791.73 ± .2692.39 ± .1792.25 ± .1293.15 ± .0889.94 ± .1790.86 ± .0791.56 ± .0991.91 ± .0892.80 ± .27
20093.57 ± .0893.43 ± .2193.71 ± .2093.62 ± .1994.44 ± .2691.78 ± .2292.78 ± .1693.24 ± .2593.00 ± .2594.03 ± .23
92087.99 ± .4188.25 ± .1389.44 ± .0389.42 ± .2690.54 ± .1583.42 ± .3387.38 ± .1888.46 ± .4588.90 ± .5290.31 ± .12
5091.06 ± .1191.36 ± .1791.87 ± .1191.69 ± .0693.03 ± .1088.38 ± .0890.25 ± .3491.12 ± .1691.04 ± .1892.78 ± .27
20093.12 ± .3793.08 ± .1793.42 ± .2193.16 ± .2194.12 ± .1890.86 ± .0791.86 ± .2892.60 ± .0992.53 ± .1594.03 ± .09
152084.95 ± .5085.80 ± .4886.67 ± .2987.69 ± .5790.08 ± .2380.72 ± .2084.27 ± .4185.70 ± .2586.75 ± .5290.03 ± .06
5089.74 ± .1189.68 ± .1590.10 ± .1290.22 ± .2792.30 ± .1685.10 ± .2788.05 ± .1188.78 ± .3389.72 ± .2192.93 ± .24
20092.03 ± .1092.02 ± .2392.22 ± .1892.20 ± .0393.66 ± .3388.18 ± .1690.19 ± .3290.67 ± .1891.19 ± .2094.16 ± .12
+ +Table 12: CIFAR-10 results for ConvMixer-256/8 with patch size 1. Bold denotes the highest per group, and blue bold denotes the second highest. + +
THAWEDFROZEN
Filt. Size#EpsUniformCov. transferCov. transfer(1/8 width)Direct transferOur initUniformCov. transferCov. transfer(1/8 width)Direct transferOur init
32090.41 ± .1190.60 ± .3190.78 ± .2290.66 ± .1889.84 ± .2789.39 ± .0990.37 ± .0690.14 ± .0390.64 ± .1789.07 ± .21
5091.89 ± .0692.00 ± .2392.09 ± .1892.05 ± .2091.49 ± .1090.97 ± .1991.87 ± .0991.65 ± .1091.90 ± .2690.73 ± .26
20092.16 ± .1992.38 ± .1292.58 ± .0992.54 ± .1891.85 ± .1591.71 ± .2092.12 ± .0892.05 ± .3691.98 ± .1691.47 ± .14
72091.70 ± .1691.94 ± .0892.02 ± .0592.37 ± .0791.80 ± .2389.84 ± .0490.78 ± .2791.30 ± .1191.92 ± .0391.08 ± .15
5093.30 ± .1593.00 ± .2593.31 ± .1093.42 ± .0793.33 ± .2991.51 ± .2092.21 ± .0692.68 ± .0793.01 ± .0292.31 ± .32
20093.67 ± .1393.59 ± .0893.68 ± .1293.81 ± .2393.83 ± .1892.48 ± .1692.89 ± .1892.98 ± .0593.38 ± .0493.16 ± .20
92091.92 ± .1691.74 ± .2592.07 ± .1992.21 ± .1792.37 ± .1989.45 ± .0290.41 ± .2491.25 ± .1691.85 ± .0391.35 ± .05
5093.25 ± .2392.92 ± .0593.22 ± .1693.37 ± .0193.45 ± .1991.13 ± .1391.93 ± .1792.52 ± .0392.85 ± .1692.45 ± .27
20093.74 ± .3593.60 ± .1693.68 ± .1493.83 ± .0394.12 ± .2491.96 ± .0792.67 ± .0493.08 ± .1793.38 ± .0193.56 ± .14
152090.65 ± .2391.00 ± .0591.91 ± .1791.70 ± .2892.29 ± .2186.64 ± .1489.09 ± .3290.70 ± .0791.32 ± .1091.53 ± .12
5092.76 ± .0692.54 ± .1092.99 ± .1392.95 ± .1093.42 ± .0789.20 ± .1790.65 ± .1591.72 ± .2392.35 ± .1392.73 ± .07
20093.55 ± .1693.22 ± .1693.57 ± .0393.59 ± .0294.13 ± .1390.20 ± .2291.83 ± .1492.79 ± .1793.01 ± .2793.47 ± .05
+ +Table 13: CIFAR-10 results for ConvNeXt-atto with patch size 1. Bold denotes the highest per group, and blue bold denotes the second highest. + +
THAWEDFROZEN
Filt. Size#EpsUniformCov. transferCov. transfer (1/8 width)Direct transferOur initUniformCov. transferCov. transfer (1/8 width)Direct transferOur init
72081.46 ± .5185.00 ± .2184.71 ± .2586.18 ± .5986.44 ± .7880.45 ± .8883.91 ± .1384.06 ± .1986.12 ± .5784.71 ± .08
5087.55 ± .4688.38 ± .1087.92 ± .2789.07 ± .7590.54 ± .1685.18 ± .3987.81 ± .1086.92 ± .3789.32 ± .2190.13 ± .14
20090.47 ± .6890.77 ± .4690.69 ± .1191.05 ± .4092.03 ± .3587.10 ± .0889.70 ± .2189.08 ± .2490.83 ± .2192.27 ± .22
+ +Table 14: CIFAR-10 results for ConvNeXt-atto with patch size 2. Bold denotes the highest per group, and blue bold denotes the second highest. + +
THAWEDFROZEN
Filt. Size#EpsUniformCov. transferCov. transfer (1/8 width)Direct transferOur initUniformCov. transferCov. transfer (1/8 width)Direct transferOur init
72072.96 ± .7082.36 ± .3281.29 ± .7883.42 ± .4781.13 ± .5472.18 ± .3080.82 ± .1779.03 ± .0783.61 ± .2379.36 ± .07
5083.71 ± .6086.21 ± .2186.32 ± .1686.28 ± .2085.97 ± .2477.92 ± .3485.16 ± .4584.83 ± .0985.93 ± .2085.45 ± .20
20086.28 ± .0287.40 ± .2788.14 ± .1887.02 ± .1088.20 ± .5279.82 ± .3886.25 ± .1086.60 ± .0286.59 ± .3387.69 ± .28
\ No newline at end of file diff --git a/understandingthecovariancestructureofconvolutionalfilters/images.zip b/understandingthecovariancestructureofconvolutionalfilters/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..af409b6974ef093bafcd937bc7b4eafb7d1f3f9f --- /dev/null +++ b/understandingthecovariancestructureofconvolutionalfilters/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f9532c3f0d93e5a34c8b145648bc6f7854ca1d02478dacc1409d1fa3b080a8e +size 2456626 diff --git a/understandingthecovariancestructureofconvolutionalfilters/layout.json b/understandingthecovariancestructureofconvolutionalfilters/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..9d8ce9c4e4b973c2617bfba4a75ad11c7c046ca9 --- /dev/null +++ b/understandingthecovariancestructureofconvolutionalfilters/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2225b4a89060d2b5363eed33677cbd309b477b7d6838b1805ad2fd3674598caf +size 677257 diff --git a/understandingthegeneralizationofadaminlearningneuralnetworkswithproperregularization/4aeee7ef-5596-462f-8e63-74aa3d5edbdd_content_list.json b/understandingthegeneralizationofadaminlearningneuralnetworkswithproperregularization/4aeee7ef-5596-462f-8e63-74aa3d5edbdd_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..83b0114f6b4c17bafa8cff9057b2230ad5f05d54 --- /dev/null +++ b/understandingthegeneralizationofadaminlearningneuralnetworkswithproperregularization/4aeee7ef-5596-462f-8e63-74aa3d5edbdd_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd197d3065d3c0d8e2875e5196c426829486d3e76435512aa4b359b9acc8bebe +size 325895 diff --git a/understandingthegeneralizationofadaminlearningneuralnetworkswithproperregularization/4aeee7ef-5596-462f-8e63-74aa3d5edbdd_model.json b/understandingthegeneralizationofadaminlearningneuralnetworkswithproperregularization/4aeee7ef-5596-462f-8e63-74aa3d5edbdd_model.json new file mode 100644 index 0000000000000000000000000000000000000000..66c7f544c912e8883e7202e7a704982985d987d0 --- /dev/null +++ b/understandingthegeneralizationofadaminlearningneuralnetworkswithproperregularization/4aeee7ef-5596-462f-8e63-74aa3d5edbdd_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:67dfd719459a79dcbefe8e7a13b724e947fbe0ecb6cf63d53be031f0c28eab94 +size 366115 diff --git a/understandingthegeneralizationofadaminlearningneuralnetworkswithproperregularization/4aeee7ef-5596-462f-8e63-74aa3d5edbdd_origin.pdf b/understandingthegeneralizationofadaminlearningneuralnetworkswithproperregularization/4aeee7ef-5596-462f-8e63-74aa3d5edbdd_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3969bbd51ddfd975ea2cc6432569605df8831bba --- /dev/null +++ b/understandingthegeneralizationofadaminlearningneuralnetworkswithproperregularization/4aeee7ef-5596-462f-8e63-74aa3d5edbdd_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cea8f292e72d35c47402279a81eec5ef5b35712b70aeaf37a650d819fdb0fe60 +size 578770 diff --git a/understandingthegeneralizationofadaminlearningneuralnetworkswithproperregularization/full.md b/understandingthegeneralizationofadaminlearningneuralnetworkswithproperregularization/full.md new file mode 100644 index 0000000000000000000000000000000000000000..3db942609467c0d5e92f5c6302079e9e18814efc --- /dev/null +++ b/understandingthegeneralizationofadaminlearningneuralnetworkswithproperregularization/full.md @@ -0,0 +1,1626 @@ +# UNDERSTANDING THE GENERALIZATION OF ADAM IN LEARNING NEURAL NETWORKS WITH PROPER REGULARIZATION + +Difan Zou $^{1}$ , Yuan Cao $^{2}$ , Yanzhi Li $^{3}$ , Quanquan Gu $^{4}$ + +$^{1}$ Department of Computer Science & Institute of Data Science, The University of Hong Kong dzou@cs.hku.hk +$^{2}$ Department of Statistics & Actuarial Science, The University of Hong Kong yuancao@hku.hk +3 Machine Learning Department, Carnegie Mellon University +yuanzhil@andrew.cmu.edu +$^{4}$ Department of Computer Science, University of California, Los Angeles qgu@cs.ucla.edu + +# ABSTRACT + +Adaptive gradient methods such as Adam have gained increasing popularity in deep learning optimization. However, it has been observed in many deep learning applications such as image classification, Adam can converge to a different solution with a worse test error compared to (stochastic) gradient descent, even with a fine-tuned regularization. In this paper, we provide a theoretical explanation for this phenomenon: we show that in the nonconvex setting of learning over-parameterized two-layer convolutional neural networks starting from the same random initialization, for a class of data distributions (inspired from image data), Adam and gradient descent (GD) can converge to different global solutions of the training objective with provably different generalization errors, even with weight decay regularization. In contrast, we show that if the training objective is convex, and the weight decay regularization is employed, any optimization algorithms including Adam and GD will converge to the same solution if the training is successful. This suggests that the generalization gap between Adam and SGD in the presence of weight decay regularization is closely tied to the nonconvex landscape of deep learning optimization, which cannot be covered by the recent neural tangent kernel (NTK) based analysis. + +# 1 INTRODUCTION + +Adaptive gradient methods (Duchi et al., 2011; Hinton et al., 2012; Kingma & Ba, 2015; Reddi et al., 2018) such as Adam are very popular optimizers for training deep neural networks. By adjusting the learning rate coordinate-wisely based on historical gradient information, they are known to be able to automatically choose appropriate learning rates to achieve fast convergence in training. Because of this advantage, Adam and its variants are widely used in deep learning. + +Despite their fast convergence, adaptive gradient methods have been observed to achieve worse generalization performance compared with gradient descent and stochastic gradient descent (SGD) (Wilson et al., 2017; Luo et al., 2019; Chen et al., 2020; Zhou et al., 2020) in many deep learning tasks such as image classification (we have done some simple deep learning experiments to justify this, the results are reported in Table 1). Even with explicit weight decay regu + +larization, achieving good test error with adaptive gradient methods seems to be challenging. Moreover, we have also visualized the first layer of AlexNet trained by Adam and SGD in Figure 1, where + +
ModelsAlexNetVGG-16ResNet-18
SGD75.2293.2594.62
Adam73.0892.1992.93
+ +Table 1: Test accuracy $(\%)$ comparison between Adam and SGD on the CIFAR-10 dataset. + +we can also observe a clear difference between Adam and SGD: the model learned by Adam is more "noisy" than that learned by SGD. + +Several recent works provided theoretical explanations of this generalization gap between Adam and GD by showing that Adam and GD have different implicit bias. Wilson et al. (2017); Agarwal et al. (2019) considered a setting of linear regression, and showed that Adam can fail when learning an overparameterized linear model on certain specifically designed data, while SGD can learn the linear model to achieve zero test error. This example in linear regression offers valuable insights into the difference between SGD and Adam. However, there is a gap between their theoretical results and the practical observations, since they consider a convex optimization setting, and the difference between Adam and SGD will no longer be observed when adding weight decay regularization. In fact, as we will show in this paper (Theorem 4.2), regularization can successfully correct the different implicit bias and push different algorithms to find the same solution, since the regularized training loss function of a convex model becomes strongly convex, which exhibits one unique global optimum. For this reason, we argue that the example in the convex setting cannot fully capture the differences between GD and Adam for training neural networks. More recently, Zhou et al. (2020) studied the expected escaping time of Adam and SGD from a local basin, and utilized this to explain the difference between SGD and Adam. However, their results do not take NN architecture into consideration, and do not provide an analysis of test errors either. + +In this paper, we aim at answering the following question + +Why is there a generalization gap between Adam and gradient descent in learning neural networks, even with weight decay regularization? + +Specifically, we study Adam and GD for training neural networks with weight decay regularization on an image-like data model, and demonstrate the different behaviors of Adam and GD based on the notion of feature learning/noise memorization decomposition. Inspired by the experimental observation in Figure 1 where Adam tends to overfit the noise component of the data, we consider a model where the data are generated as a combination of feature and noise patches, and analyze the convergence and generalization of Adam and GD for training a two-layer convolutional neural network (CNN). The contributions of this paper are summarized as follows. + +- We establish global convergence guarantees for Adam and GD with weight decay regularization. We show that, starting at the same random initialization, Adam and GD can both train a two-layer convolutional neural network to achieve zero training error after polynomially many iterations, despite the nonconvex optimization landscape. +- We further show that GD and Adam in fact converge to different global solutions with different generalization performance: when performed on the considered image-like data model, GD can achieve nearly zero test error, while the generalization performance of the model found by Adam is no better than a random guess. In particular, we show that the reason for this gap is due to the different training behaviors of Adam and GD: Adam is more likely to fit dense noises and output a model that is largely contributed by the noise patches; GD prefers to fit training data using their feature patch and finds a solution that is mainly composed by the true features. +- We also show that for convex settings with weight decay regularization, both Adam and gradient descent converge to the same solution and therefore have no test error difference. This suggests that the difference between Adam and GD cannot be fully explained by linear models or neural networks trained in the "almost convex" neural tangent kernel (NTK) regime (Jacot et al., 2018; Allen-Zhu et al., 2019b; Du et al., 2019a; Zou et al., 2019). It also demonstrates that the inferior generalization performance of Adam is closely tied to the nonconvex landscape of deep learning optimization, and cannot be solved by adding regularization. + +# 2 RELATED WORK + +In this section, we discuss the works that are closely related to our paper. + +Generalization gap between Adam and SGD. The worse generalization of Adam compared with SGD has also been observed by some recent works and has motivated new variants of neural network training algorithms. Keskar & Socher (2017) proposed to switch between Adam and SGD to achieve better generalization. Merity et al. (2018) proposed a variant of the averaged stochastic gradient method to achieve good generalization performance for LSTM language models. Luo et al. (2019) proposed to use dynamic bounds on learning rates to achieve a smooth transition from adaptive methods to SGD to improve generalization. Our theoretical results for GD and Adam can also + +![](images/564f3e1723585bff57119a03f3ab3bc4cb8ac4fa3a5ce6d1b4f3211cdfe6b5fa.jpg) +(a) Adam + +![](images/731b32ef09c7cbc747ca926bffc55345cb11bb35b8fb65c564e2c45ce48f4288.jpg) +(b) SGD +Figure 1: Visualization of the first layer of AlexNet trained by Adam and SGD on the CIFAR-10 dataset. Both algorithms are run for 100 epochs with weight decay regularization and standard data augmentations. Clearly, the model learned by Adam is more "noisy" than that learned by SGD, implying that Adam is more likely to overfit the noise in the training data. + +provide theoretical insights into the effectiveness of these empirical studies. + +Optimization and generalization in deep learning. Our work is also closely related to the recent line of work studying the optimization and generalization guarantees of neural networks in the neural tangent kernel (NTK) regime (Jacot et al., 2018) or lazy training regime (Chizat et al., 2019). In particular, recent works (Du et al., 2019b; a; Allen-Zhu et al., 2019b; Zou et al., 2019) showed that the optimization only happens within a small neighborhood region around the random initialization and proved the global convergence of GD and SGD when the neural network is sufficiently wide. Moreover, the generalization ability of GD/SGD has been further studied in the same setting (Allen-Zhu et al., 2019a; Arora et al., 2019a;b; Ji & Telgarsky, 2020; Chen et al., 2021), which suggests that wide neural network trained by GD/SGD can learn a low-dimensional function class. Moreover, Allen-Zhu & Li (2019); Bai & Lee (2019) initiated the study of learning neural networks beyond the NTK regime as it differs from the practical DNN training. Our analysis in this paper is also beyond NTK, and gives a detailed comparison between GD and Adam. + +Feature learning by neural networks. This paper is also closely related to several recent works that studied how neural networks can learn features. Allen-Zhu & Li (2020a) showed that adversarial training purifies the learned features by removing certain "dense mixtures" in the hidden layer weights of the network. Allen-Zhu & Li (2020b) studied how ensemble and knowledge distillation work in deep learning when the data have "multi-view" features. Frei et al. (2022b) studied the feature learning for two-layer networks, and demonstrated its superior performance than linear models. Shen et al. (2022) explored the benefit of data augmentation by showing its ability to achieve more effective feature learning. This paper studies a different aspect of feature learning by Adam and GD, and shows that GD can learn the features while Adam may fail even with proper regularization. + +# 3 PROBLEM SETUP AND PRELIMINARIES + +We consider learning a CNN with Adam and GD based on $n$ independent training examples $\{(\mathbf{x}_i, y_i)\}_{i=1}^n$ generated from a data model $\mathcal{D}$ . In the following, we first introduce our data model $\mathcal{D}$ , and then explain our neural network model and the details of the training algorithms. + +Data model. We consider a data model where the data inputs consist of feature and noise patches. Such a data model is motivated by image classification problems where the label of an image usually only depends on part of an image, and the other parts of the image showing random objects, or features that belong to other classes, can be considered as noises. When using CNN to fit the data, the convolution operation is applied to each patch of the data input separately. We claim that our data model is more practical than those considered in Wilson et al. (2017); Reddi et al. (2018), which are handcrafted for showing the failure of Adam in terms of either convergence or generalization (detailed illustrations of the data models in these works are deferred to the appendix). For simplicity, we only consider the case where the data consists of one feature patch and one noise patch. However, our result can be easily extended to cover the setting where there are multiple feature/noise patches. The detailed definition of our data model is given in Definition 3.1 as follows. + +Definition 3.1. Each data point $(\mathbf{x},y)$ with $\mathbf{x} \in \mathbb{R}^{2d}$ and $y \in \{-1,1\}$ is generated as follows: $\mathbf{x} = [\mathbf{x}_1^\top, \mathbf{x}_2^\top]^\top$ , where one of $\mathbf{x}_1$ and $\mathbf{x}_2$ denotes the feature patch that consists of a feature vector + +$y\cdot \mathbf{v}$ , which is assumed to be 1-sparse, and the other one denotes the noise patch and consists of a noise vector $\pmb{\xi}$ . Without loss of generality, we assume $\mathbf{v} = [1,0,\dots,0]^{\top}$ . The noise vector $\pmb{\xi}$ is generated according to the following process: + +- Randomly select $s$ coordinates from $[d] \backslash \{1\}$ uniformly, denoted as a vector $\mathbf{s} \in \{0, 1\}^d$ . +- Generate $\pmb{\xi}$ from distribution $\mathcal{N}(\mathbf{0},\sigma_p^2\mathbf{I})$ , and then mask off the first coordinate and other $d - s - 1$ coordinates, i.e., $\pmb{\xi} = \pmb{\xi}\odot \mathbf{s}$ . +- Add feature noise to $\pmb{\xi}$ , i.e., $\pmb{\xi} = \pmb{\xi} - \alpha y\mathbf{v}$ , where $0 < \alpha < 1$ is the strength of the feature noise. + +In particular, throughout this paper we set $d = \Omega(n^4)$ , $s = \Theta\left(\frac{d^{1/2}}{n^2}\right)$ , $\sigma_p^2 = \Theta\left(\frac{1}{s \cdot \mathrm{polylog}(n)}\right)$ and $\alpha = \Theta\left(\sigma_p \cdot \mathrm{polylog}(n)\right)$ . + +The most natural way to think of our data model is to treat $\mathbf{x}$ as the output of some intermediate layer of a CNN. In literature, Papyan et al. (2017) pointed out that the outputs of an intermediate layer of a CNN are usually sparse. Yang (2019) also discussed the setting where the hidden nodes in such an intermediate layer are sampled independently. This motivates us to study sparse features and entry-wisely independent noises in our model. In this paper, we focus on the case where the feature vector $\mathbf{v}$ is 1-sparse and the noise vector is $s$ -sparse for simplicity. However, these sparsity assumptions can be generalized to the settings where the feature and the noises are denser, as long as the sparsity gap between feature and noises exists. + +Note that in Definition 3.1, each data input consists of two patches: a feature patch $y\mathbf{v}$ that is positively correlated with the label, and a noise patch $\xi$ which contains the "feature noise" $-\alpha y\mathbf{v}$ as well as random Gaussian noises. Importantly, the feature noise $-\alpha y\mathbf{v}$ in the noise patch plays a pivotal role in both the training and test processes, which connects the noise overfitting in the training process and the inferior generalization ability in the test process. + +Moreover, we would like to clarify that the data distribution considered in our paper is an extreme case where we assume there is only one feature vector and all data has a feature noise, since we believe this is the simplest model that captures the fundamental difference between Adam and SGD. With this data model, we aim to show why Adam and SGD perform differently. Our theoretical results and analysis techniques can also be extended to more practical settings where there are multiple feature vectors and multiple patches, each data can either contain a single feature or multiple features, together with pure random noise or feature noise. + +Two-layer CNN model. We consider a two-layer CNN model $F$ using truncated polynomial activation function $\sigma (z) = (\max \{0,z\})^q$ and fix the weights of second layer to be all 1's, where $q\geq 3$ . Given the data $(\mathbf{x},y)$ , the $j$ -th output of the CNN can be formulated as + +$$ +F _ {j} (\mathbf {W}, \mathbf {x}) = \sum_ {r = 1} ^ {m} \left[ \sigma \left(\left\langle \mathbf {w} _ {j, r}, \mathbf {x} _ {1} \right\rangle\right) + \sigma \left(\left\langle \mathbf {w} _ {j, r}, \mathbf {x} _ {2} \right\rangle\right) \right] = \sum_ {r = 1} ^ {m} \left[ \sigma \left(\left\langle \mathbf {w} _ {j, r}, y \cdot \mathbf {v} \right\rangle\right) + \sigma \left(\left\langle \mathbf {w} _ {j, r}, \boldsymbol {\xi} \right\rangle\right) \right], \tag {3.1} +$$ + +where $m$ is the width of the network, $\mathbf{w}_{j,r} \in \mathbb{R}^d$ denotes the $r$ -th CNN filter, and $\mathbf{W}$ is the collection of model weights. For the ease of analysis, we set the output layer as all 1's. Our analyses and results can still be applied if we use random second layer weights. + +Besides, the motivation of using polynomial ReLU activation function is to guarantee that the loss function is (locally) smooth and the amplification ability of pattern learning. It can be replaced by a smoothed ReLU activation function (e.g., the activation function used in Allen-Zhu & Li (2020b)). If we assume the input data distribution is Gaussian, we can also deal with ReLU activation function (Li et al., 2020). A set of similar smoothed ReLU-type activation functions have also been widely considered to study the generalization performance of two-layer neural networks from different aspects (Frei et al., 2022a; Cao et al., 2022; Shen et al., 2022; Chen et al., 2022). Moreover, we would like to emphasize that $\mathbf{x}_1$ and $\mathbf{x}_2$ denote two data patches, which are randomly assigned with feature vectors or noise vectors independently for each data point. The leaner has no knowledge about which one is the feature patch (or noise patch). + +In this paper we assume the width of the network is polylogarithmic in the training sample size, i.e., $m = \mathrm{polylog}(n)$ . We assume $j \in \{-1, 1\}$ in order to make the logit index be consistent with the data label. Moreover, we assume that the each weight is initialized from a random draw of Gaussian random variable $\sim N(0, \sigma_0^2)$ with $\sigma_0 = \Theta(d^{-1/4})$ . + +Training objective. Given the training data points $\{(\mathbf{x}_i, y_i)\}_{i=1,\dots,n}$ , we consider to learn the model parameter $\mathbf{W}$ by optimizing the empirical loss function with weight decay regularization + +$$ +L (\mathbf {W}) = \frac {1}{n} \sum_ {i = 1} ^ {n} L _ {i} (\mathbf {W}) + \frac {\lambda}{2} \| \mathbf {W} \| _ {F} ^ {2}, \tag {3.2} +$$ + +where $L_{i}(\mathbf{W}) = -\log \frac{e^{F_{y_{i}}(\mathbf{W},\mathbf{x}_{i})}}{\sum_{j\in\{-1,1\}}e^{F_{j}(\mathbf{W},\mathbf{x}_{i})}}$ denotes the individual loss for the data point $(\mathbf{x}_i,y_i)$ and $\lambda \geq 0$ is the regularization parameter. In particular, the regularization parameter can be arbitrary as long as it satisfies $\lambda \in (0,\lambda_0)$ with $\lambda_0 = \Theta \left( \frac{1}{d^{(q-1)/4}n \cdot \mathrm{polylog}(n)} \right)$ . We claim that the $\lambda_0$ is the largest feasible regularization parameter that the training process will not stuck at the origin point (recall that $L(\mathbf{W})$ admits zero gradient at $\mathbf{W} = \mathbf{0}$ ). + +Training algorithms. In this paper, we consider full-batch gradient descent and Adam1. In particular, starting from $\mathbf{W}^{(0)} = \{\mathbf{w}_{j,r}^{(0)}, j = \{\pm 1\}, r \in [m]\}$ , the gradient descent update rule is + +$$ +\mathbf {w} _ {j, r} ^ {(t + 1)} = \mathbf {w} _ {j, r} ^ {(t)} - \eta \cdot \nabla_ {\mathbf {w} _ {j, r}} L (\mathbf {W} ^ {(t)}), +$$ + +where $\eta$ is the learning rate. Meanwhile, Adam store historical gradient information in the momentum $\mathbf{m}^{(t)}$ and a vector $\mathbf{v}^{(t)}$ as follows + +$$ +\mathbf {m} _ {j, r} ^ {(t + 1)} = \beta_ {1} \mathbf {m} _ {j, r} ^ {(t)} + (1 - \beta_ {1}) \cdot \nabla_ {\mathbf {w} _ {j, r}} L (\mathbf {W} ^ {(t)}), \tag {3.3} +$$ + +$$ +\mathbf {v} _ {j, r} ^ {(t + 1)} = \beta_ {2} \mathbf {v} _ {j, r} ^ {(t)} + (1 - \beta_ {2}) \cdot \left[ \nabla_ {\mathbf {w} _ {j, r}} L (\mathbf {W} ^ {(t)}) \right] ^ {2}, \tag {3.4} +$$ + +and entry-wisely adjusts the learning rate: + +$$ +\mathbf {w} _ {j, r} ^ {(t + 1)} = \mathbf {w} _ {j, r} ^ {(t)} - \eta \cdot \mathbf {m} _ {j, r} ^ {(t)} / \sqrt {\mathbf {v} _ {j , r} ^ {(t)}}, \tag {3.5} +$$ + +where $\beta_{1},\beta_{2}$ are the hyperparameters of Adam (a popular choice in practice is $\beta_{1} = 0.9$ , and $\beta_{2} = 0.99)$ , which are considered as constants in our paper, and in (3.4) and (3.5), the square $(\cdot)^{2}$ , square root $\sqrt{\cdot}$ , and division $\cdot /\cdot$ all denote entry-wise calculations. We would like to clarify the original Adam paper (Kingma & Ba, 2015) considers to normalize the gradient $\mathbf{m}_{j,r}^{(t)}$ via $[\mathbf{v}_{j,r}^{(t)} + \epsilon ]^{1 / 2}$ while the small bias term $\epsilon$ is ignored in our paper. In practice, tuning $\epsilon$ can help improve the generalization ability of Adam (Choi et al., 2019), as it allows to make a trade-off between the normalized gradient update and gradient update. We remark that considering tunable $\epsilon$ is beyond the focus of this paper. For the ease of analysis, we do not consider the initialization bias correction in the original Adam paper either and set $\mathbf{m}_{j,r}^{(0)} = \nabla_{\mathbf{w}_{j,r}}L(\mathbf{W}^{(0)})$ and $\mathbf{v}_{j,r}^{(0)} = [\nabla_{\mathbf{w}_{j,r}}L(\mathbf{W}^{(0)})]^{2}$ + +# 4 MAIN RESULTS + +In this section we will state the main theorems in this paper. We first provide the learning guarantees of Adam and Gradient descent for training a two-layer CNN model in the following theorem. Recall that in this setting the training objective is nonconvex. + +Theorem 4.1 (Nonconvex setting). Consider a two-layer CNN defined in (3.1) with $d = \Omega(n^4)$ and regularized training objective (3.2) with a regularization parameter $\lambda > 0$ , suppose the network width is $m = \mathrm{polylog}(n)$ and the data distribution follows Definition 3.1, then we have the following guarantees on the training and test errors for the models trained by Adam and Gradient descent: + +1. Suppose we run Adam for $T = \frac{\mathrm{poly}(n)}{\eta}$ iterations with $\eta = \frac{1}{\mathrm{poly}(n)}$ , then with probability at least $1 - O(n^{-1})$ , we can find a NN model $\mathbf{W}_{\mathrm{Adam}}^*$ such that $\| \nabla L(\mathbf{W}_{\mathrm{Adam}}^*) \|_1 \leq \frac{1}{T\eta}$ . Moreover, the model $\mathbf{W}_{\mathrm{Adam}}^*$ also satisfies: + +- Training error is zero: $\frac{1}{n}\sum_{i = 1}^{n}\mathbb{1}\left[F_{y_i}(\mathbf{W}_{\mathrm{Adam}}^*,\mathbf{x}_i)\leq F_{-y_i}(\mathbf{W}_{\mathrm{Adam}}^*,\mathbf{x}_i)\right] = 0.$ +- Test error is high: $\mathbb{P}_{(\mathbf{x},y)\sim \mathcal{D}}\big[F_y(\mathbf{W}_{\mathrm{Adam}}^*,\mathbf{x})\leq F_{-y}(\mathbf{W}_{\mathrm{Adam}}^*,\mathbf{x})\big]\geq \frac{1}{2}$ . + +2. Suppose we run gradient descent for $T = \frac{\mathrm{poly}(n)}{\eta}$ iterations with learning rate $\eta = \frac{1}{\mathrm{poly}(n)}$ , then with probability at least $1 - O(n^{-1})$ , we can find a NN model $\mathbf{W}_{\mathrm{GD}}^{*}$ such that $\| \nabla L(\mathbf{W}_{\mathrm{GD}}^{*}) \|_{F}^{2} \leq \frac{1}{T\eta}$ . Moreover, the model $\mathbf{W}_{\mathrm{GD}}^{*}$ also satisfies: + +- Training error is zero: $\frac{1}{n}\sum_{i = 1}^{n}\mathbb{1}\left[F_{y_i}(\mathbf{W}_{\mathrm{GD}}^*,\mathbf{x}_i)\leq F_{-y_i}(\mathbf{W}_{\mathrm{GD}}^*,\mathbf{x}_i)\right] = 0.$ +- Test error is nearly zero: $\mathbb{P}_{(\mathbf{x},y)\sim \mathcal{D}}\left[F_y(\mathbf{W}_\mathrm{GD}^*,\mathbf{x})\leq F_{-y}(\mathbf{W}_\mathrm{GD}^*,\mathbf{x})\right] = \frac{1}{\mathrm{poly}(n)}.$ + +From the optimization perspective, Theorem 4.1 shows that both Adam and GD can be guaranteed to find a point with a very small gradient, which can also achieve zero classification error on the training data. Moreover, it can be seen that given the same iteration number $T$ and learning rate $\eta$ , Adam can be guaranteed to find a point with up to $1 / (T\eta)$ gradient norm in $\ell_1$ metric, while gradient descent can only be guaranteed to find a point with up to $1 / \sqrt{T}\eta$ gradient norm in $\ell_2$ metric. More specifically, let $\epsilon$ be a sufficiently small quantity and ignoring other problem parameters, we can set $\eta = O(\epsilon)$ for Adam and $\eta = O(\epsilon^2)$ for GD, then Adam and GD will need $T = O(\epsilon^2)$ and $T = O(\epsilon^4)$ to find a first-order $\epsilon$ -stationary point. This suggests that Adam could enjoy a faster convergence rate compared to SGD in the training process, which is consistent with the practice findings. We would also like to point out that there is no contradiction between our result and the recent work (Reddi et al., 2019) showing that Adam can fail to converge, as the counterexample in Reddi et al. (2019) is for the online version of Adam, while we study the full batch Adam. + +In terms of the test performance, their generalization abilities are largely different, even with weight decay regularization. In particular, the output of gradient descent can generalize well and achieve nearly zero test error, while the output of Adam gives nearly $1/2$ test error. In fact, this gap is due to two major aspects of the training process: (1) At the early stage of training where weight decay exhibits negligible effect, Adam and GD behave very differently. In particular, Adam prefers the denser and thus tends to fit the noise vectors $\xi$ , gradient descent prefers the data patch of larger $\ell_2$ norm and thus will learn the feature patch; (2) At the late stage of training where the weight decay regularization cannot be ignored, both Adam and gradient descent will be enforced to converge to a local minimum of the regularized objective, which maintains the pattern learned in the early stage. Consequently, the model learned by Adam will be biased towards the noise patch to fit the feature noise vector $-\alpha y\mathbf{v}$ , which is opposite in direction to the true feature vector and therefore leads to a test error no better than a random guess. More details about the training behaviors of Adam and GD are given in Section 5. Experimental justification are provided in Appendix. + +Theorem 4.1 shows that when optimizing a nonconvex training objective, Adam and gradient descent will converge to different global solutions with different generalization errors, even with weight decay regularization. In comparison, the following theorem gives the learning guarantees of Adam and gradient descent when optimizing convex and smooth training objectives (e.g., linear model $F(\mathbf{w},\mathbf{x}) = \mathbf{w}^{\top}\mathbf{x}$ with logistic loss). + +Theorem 4.2 (Convex setting). For any convex and smooth training objective with positive regularization parameter $\lambda$ , suppose we run Adam and gradient descent for $T = \frac{\mathrm{poly}(n)}{\eta}$ iterations, then with probability at least $1 - n^{-1}$ , the obtained parameters $\mathbf{W}_{\mathrm{Adam}}^{*}$ and $\mathbf{W}_{\mathrm{GD}}^{*}$ satisfy that $\| \nabla L(\mathbf{W}_{\mathrm{Adam}}^{*}) \|_{1} \leq \frac{1}{T\eta}$ and $\| \nabla L(\mathbf{W}_{\mathrm{Adam}}^{*}) \|_{2}^{2} \leq \frac{1}{T\eta}$ respectively. Moreover, let $F(\mathbf{W}, \mathbf{x}) \in \mathbb{R}$ be the output of the convex model with parameter $\mathbf{W}$ and input $\mathbf{x}$ , it holds that: + +- Training errors are the same, $\frac{1}{n}\sum_{i = 1}^{n}\mathbb{1}\left[\mathrm{sgn}\big(F(\mathbf{W}_{\mathrm{Adam}}^{*},\mathbf{x}_{i})\big)\neq \mathrm{sgn}\big(F(\mathbf{W}_{\mathrm{GD}}^{*},\mathbf{x}_{i})\big] = 0.\right.$ +- Test errors are nearly the same: $\mathbb{P}_{(\mathbf{x},y)\sim \mathcal{D}}\big[\mathrm{sgn}\big(F(\mathbf{W}_{\mathrm{Adam}}^{*},\mathbf{x}_{i})\big)\neq \mathrm{sgn}\big(F(\mathbf{W}_{\mathrm{GD}}^{*},\mathbf{x}_{i})\big]\leq \frac{1}{\mathrm{poly}(n)}.$ + +Theorem 4.2 shows that when optimizing a convex and smooth training objective (e.g., a linear model with logistic loss) with weight decay regularization, both Adam and gradient can converge to almost the same solution and enjoy very similar generalization performance. The proof will be relying on the strong convexity of the training objective and the convergence (to the first-order stationary) guarantee of Adam (Défossez et al., 2020) and GD. Combining this result and Theorem 4.1, it is clear that the inferior generalization performance is closely tied to the nonconvex landscape of deep learning, and cannot be understood by standard weight decay regularization. + +# 5 PROOF OUTLINE OF THE MAIN RESULTS + +In this section we provide the proof sketch of Theorem 4.1 and explain the different generalization abilities of the models found by gradient descent and Adam. + +Before moving to the proof of main results, we first give the following lemma which shows that for data generated from the data distribution $\mathcal{D}$ in Definition 3.1, with high probability all noise vectors $\{\pmb {\xi}_i\}_{i = 1,\dots,n}$ have nearly disjoint supports. + +Lemma 5.1. Let $\{(\mathbf{x}_i, y_i)\}_{i=1,\dots,n}$ be the training dataset generated by Definition 3.1. Moreover, recall that $\mathbf{x}_i = [y_i \mathbf{v}^\top, \boldsymbol{\xi}_i^\top]^\top$ (or $\mathbf{x}_i = [\boldsymbol{\xi}_i^\top, y_i \mathbf{v}^\top]^\top$ ), let $\mathcal{B}_i = \operatorname{supp}(\boldsymbol{\xi}_i) \backslash \{1\}$ be the support of $\boldsymbol{\xi}_i$ except the first coordinate. Then with probability at least $1 - n^{-2}$ , $\mathcal{B}_i \cap \mathcal{B}_j = \emptyset$ for all $i \neq j$ . + +This lemma implies that the optimization of each coordinate of the model parameter $\mathbf{W}$ , except for the first one, is mostly determined by only one training data. Technically, this lemma can greatly simplify the analysis for Adam so that we can better illustrate its optimization behavior and explain the generalization performance gap between Adam and gradient descent. + +Proof outline. For both Adam and gradient descent, we will show that the training process can be decomposed into two stages. In the first stage, which we call pattern learning stage, the weight decay regularization will be less important and can be ignored, while the algorithms tend to learn the pattern from the training data. In particular, we will show that in the pattern learning stage, the optimization algorithms have different algorithmic bias: Adam tends to fit the noise patch while gradient descent will mainly learn the feature patch. In the second stage, which we call it regularization stage, the effect of regularization cannot be neglected, which will regularize the algorithm to converge at some local stationary points. However, due to the nonconvex landscape of the training objective, the pattern learned in the first stage will remain unchanged, even when running an infinitely number of iterations. + +# 5.1 PROOF SKETCH FOR ADAM + +Recall that in each iteration of Adam, the model weight is updated by using a moving-averaged gradient, normalized by a moving average of the historical gradient squares. As pointed out in Balles & Hennig (2018); Bernstein et al. (2018), Adam behaves similarly to sign gradient descent (signGD) when using sufficiently small step size or the moving average parameters $\beta_{1},\beta_{2}$ are nearly zero, which is also justified in our Lemma C.2. Specifically, we show that when considering constant $\beta_{1}$ and $\beta_{2}$ , the Adam update on the coordinates with large gradient (e.g., $|\nabla L(\mathbf{W}^{(t)})[k]| > \eta$ ) can be well approximated by the signGD update (i.e., $\mathrm{sign}(\nabla L(\mathbf{W}^{(t)})[k])$ ). This motivates us to understand the optimization behavior of signGD and then extends it to Adam using their similarities. In particular, signGD updates the model parameter according to the following rule: + +$$ +\mathbf {w} _ {j, r} ^ {(t + 1)} = \mathbf {w} _ {j, r} ^ {(t + 1)} - \boldsymbol {\eta} \cdot \mathrm {s g n} (\nabla_ {\mathbf {w} _ {j, r}} L (\mathbf {W} ^ {(t)})). +$$ + +Recall that each data has a feature patch and a noise patch. By Lemma 5.1 and the data distribution (see Definition 3.1), all noise vectors $\{\pmb {\xi}_i\}_{i = 1,\dots ,n}$ are supported on disjoint coordinates except the first coordinate. For $\mathbf{x}_i$ , let $\mathcal{B}_i$ denote its support excluding the first coordinate. In the subsequent analysis, we will always assume that those $\mathcal{B}_i$ 's are disjoint, i.e., $\mathcal{B}_i\cap \mathcal{B}_j = \emptyset$ if $i\neq j$ + +Next we will characterize two aspects of the training process: feature learning and noise memorization. Mathematically, we focus on two quantities: $\langle \mathbf{w}_{j,r}^{(t)}, j \cdot \mathbf{v} \rangle$ and $\langle \mathbf{w}_{y_i,r}^{(t)}, \pmb{\xi}_i \rangle$ . In particular, given the training data point $(\mathbf{x}_i, y_i)$ with $\mathbf{x}_i = [y_i \mathbf{v}^\top, \pmb{\xi}_i^\top]^\top$ , larger $\langle \mathbf{w}_{y_i,r}^{(t)}, y_i \cdot \mathbf{v} \rangle$ implies better feature learning and larger $\langle \mathbf{w}_{y_i,r}^{(t)}, \pmb{\xi}_i \rangle$ represents better noise memorization. Then regarding the feature vector $\mathbf{v}$ that only has nonzero entry at the first coordinate, we have the following for signGD: + +$$ +\begin{array}{l} \left\langle \mathbf {w} _ {j, r} ^ {(t + 1)}, j \mathbf {v} \right\rangle = \left\langle \mathbf {w} _ {j, r} ^ {(t)}, j \mathbf {v} \right\rangle - \eta \cdot \left\langle \operatorname {s g n} \left(\nabla_ {\mathbf {w} _ {j, r}} L \left(\mathbf {W} ^ {(t)}\right)\right), j \mathbf {v} \right\rangle \tag {5.1} \\ = \langle \mathbf {w} _ {j, r} ^ {(t)}, j \mathbf {v} \rangle + j \eta \cdot \mathrm {s g n} \bigg (\sum_ {i = 1} ^ {n} y _ {i} \ell_ {j, i} ^ {(t)} \big [ \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t)}, y _ {i} \mathbf {v} \rangle) - \alpha \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t)}, \pmb {\xi} _ {i} \rangle) \big ] - n \lambda \mathbf {w} _ {j, r} ^ {(t)} [ 1 ] \bigg), \\ \end{array} +$$ + +where $\ell_{j,i}^{(t)}\coloneqq \mathbb{1}_{y_i = j}$ -logit $j(F,\mathbf{x}_i)$ and logit $_j(F,\mathbf{x}_i) = \frac{e^{F_j(\mathbf{W},\mathbf{x}_i)}}{\sum_{k\in\{-1,1\}}e^{F_k(\mathbf{W},\mathbf{x}_i)}}$ . From (5.1) we can observe three terms in the signed gradient. Specifically, the first term represents the gradient over the feature patch, the second term stems from the feature noise term in the noise patch (see Definition 3.1), and the last term is the gradient of the weight decay regularization. On the other hand, the memorization of the noise vector $\pmb{\xi}_i$ can be described as follows. + +$$ +\begin{array}{l} \left\langle \mathbf {w} _ {y _ {i}, r} ^ {(t + 1)}, \boldsymbol {\xi} _ {i} \right\rangle - \left\langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \right\rangle = - \eta \cdot \left\langle \operatorname {s g n} \left(\nabla_ {\mathbf {w} _ {y _ {i}}, r} L \left(\mathbf {W} ^ {(t)}\right)\right), \boldsymbol {\xi} _ {i} \right\rangle \tag {5.2} \\ = \eta \sum_ {k \in \mathcal {B} _ {i} \cup \{1 \}} \mathrm {s g n} \bigg (\ell_ {y _ {i}, i} ^ {(t)} \sigma^ {\prime} (\langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, \pmb {\xi} _ {i} \rangle) \pmb {\xi} _ {i} [ k ] - n \lambda \mathbf {w} _ {y _ {i}, r} ^ {(t)} [ k ] \bigg) \cdot \pmb {\xi} _ {i} [ k ]. \\ \end{array} +$$ + +Throughout the proof, we will show that the training process of Adam can be decomposed into two stages: pattern learning stage and regularization stage. In the first stage, the algorithm learns the pattern of training data quickly, without being affected by the regularization term. In the second stage, the training data has already been correctly classified since the pattern has been well captured, the regularization will play an important role in the training process and guide the model to converge. + +Stage I: Learning the pattern. At the beginning of training, the neural network output is smaller than some constant for all data, and therefore all training data remain under-fitted and can provide large gradient for model training. We specify this stage of training as Stage I. In this stage, the effect of weight decay regularization can be ignored due to our choice of $\lambda$ . We will show that in this stage the inner product $\langle \mathbf{w}_{y_i,r}^{(t)}, \pmb{\xi}_i \rangle$ grows much faster than $\langle \mathbf{w}_{j,r}^{(t)}, j\mathbf{v} \rangle$ since feature learning only makes use of the first coordinate of the gradient, while noise memorization could take advantage of all the coordinates in $\mathcal{B}_i$ (see (5.2), note that $|\mathcal{B}_i| = s \gg 1$ ). + +Lemma 5.2 (General results in Stage I). Suppose the training data is generated according to Definition 3.1, assume $\lambda = o(\sigma_0^{q - 2}\sigma_p / n)$ and $\eta = 1 / \mathrm{poly}(d)$ , then for any $t\leq T_0$ with $T_{0} = \widetilde{O}\bigl (\frac{1}{\eta s\sigma_{p}}\bigr)$ and any $i\in [n]$ , + +$$ +\langle \mathbf {w} _ {j, r} ^ {(t + 1)}, j \cdot \mathbf {v} \rangle \leq \langle \mathbf {w} _ {j, r} ^ {(t)}, j \cdot \mathbf {v} \rangle + \Theta (\eta), \quad \langle \mathbf {w} _ {y _ {i}, r} ^ {(t + 1)}, \boldsymbol {\xi} _ {i} \rangle = \langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \rangle + \widetilde {\Theta} (\eta s \sigma_ {p}). +$$ + +Since $\langle \mathbf{w}_{j,r}^{(t)},\pmb{\xi}_i\rangle$ enjoys a much faster increasing rate than that of $\langle \mathbf{w}_{j,r}^{(t)},j\cdot \mathbf{v}\rangle$ , after a certain number of iterations, the learning of noise patch will dominate the learning of feature patch (i.e., $\alpha \sigma^{\prime}(\langle \mathbf{w}_{j,r}^{(t)},\pmb{\xi}_i\rangle) > \sigma^{\prime}(\langle \mathbf{w}_{j,r}^{(t)},y_i\mathbf{v}\rangle)$ ). Thus, by (5.1), the model will tend to fit the feature noise in the noise patch (i.e., $-\alpha y_{i}\mathbf{v}$ ), leading to a flipped feature learning phenomenon. + +Lemma 5.3 (Flipping the feature learning). Suppose the training data is generated according to Definition 3.1, $\alpha \geq \widetilde{\Theta}\big((s\sigma_p)^{1 - q}\vee \sigma_0^{q - 1}\big)$ and $\sigma_0 < \widetilde{O} ((s\sigma_p)^{-1})$ , then for any $t\in [T_r,T_0]$ with $T_{r} = \widetilde{O}\big(\frac{\sigma_{0}}{\eta s\sigma_{p}\alpha^{1 / (q - 1)}}\big)\leq T_{0},$ + +$$ +\langle \mathbf {w} _ {j, r} ^ {(t + 1)}, j \cdot \mathbf {v} \rangle = \langle \mathbf {w} _ {j, r} ^ {(t)}, j \cdot \mathbf {v} \rangle - \Theta (\eta). +$$ + +Moreover, it holds that (1) $\mathbf{w}_{j,r}^{(T_0)}[1] = -\mathrm{sgn}(j)\cdot \widetilde{\Omega}\bigl (\frac{1}{s\sigma_p}\bigr)$ ; (2) $\mathbf{w}_{j,r}^{(T_0)}[k] = \mathrm{sgn}(\pmb {\xi}_i[k])\cdot \widetilde{\Omega}\bigl (\frac{1}{s\sigma_p}\bigr)$ or $\mathbf{w}_{j,r}^{(T_0)}[k] = \pm \widetilde{O} (\eta)$ for $k\in \mathcal{B}_i$ with $y_{i} = j$ ; and (3) $\mathbf{w}_{j,r}^{(T_0)}[k] = \pm \widetilde{O} (\eta)$ otherwise. + +From Lemma 5.3 it can be observed that at the iteration $T_0$ , the sign of the first coordinate of $\mathbf{w}_{j,r}^{(T_0)}$ is different from that of the true feature, i.e., $j \cdot \mathbf{v}$ . This implies that at the end of the first training stage, the model is biased towards the noise patch to fit the feature noise. + +Stage II: Regularizing the model. In this stage, as the neural network output becomes larger, part of training data starts to be well fitted and gives smaller gradient. As a consequence, the feature learning and noise memorization processes will be slowed down and the weight decay regularization term cannot be ignored. However, although weight decay regularization can prevent the model weight from being too large, it will maintain the pattern learned in Stage I and cannot push the model back to "forget" the noise and learn the feature and stops at some local stationary points. We summarize these results in the following lemma. + +Lemma 5.4 (Maintain the pattern). If $\alpha = O\big(s\sigma_p^2 /n\big)$ and $\eta = o(\lambda)$ , then let $r^{*} = \arg \max_{r\in [m]}\langle \mathbf{w}_{y_i,r}^{(t)},\pmb {\xi}_i\rangle$ , for any $t\geq T_0$ , $i\in [n]$ , $j\in \{\pm 1\}$ and $r\in [m]$ , it holds that + +$$ +\langle \mathbf {w} _ {y _ {i}, r ^ {*}} ^ {(t)}, \boldsymbol {\xi} _ {i} \rangle = \widetilde {\Theta} (1), \sum_ {k \in \mathcal {B} _ {i}} | \mathbf {w} _ {y _ {i}, r ^ {*}} ^ {(t)} [ k ] | \cdot | \boldsymbol {\xi} _ {i} [ k ] | = \widetilde {\Theta} (1), \langle \mathbf {w} _ {j, r} ^ {(t)}, \operatorname {s g n} (j) \cdot \mathbf {v} \rangle \in [ - o (1), O (\lambda^ {- 1} \eta) ]. +$$ + +Lemma 5.4 shows that in the second stage, $\langle \mathbf{w}_{y_i,r}^{(t)},\pmb {\xi}_i\rangle$ will always be large while $\langle \mathbf{w}_{y_i,r}^{(t)},y_i\cdot \mathbf{v}\rangle$ is still negative, or positive but extremely small. Next we will show that within polynomial steps, the algorithm can be guaranteed to find a point with small gradient. + +Lemma 5.5 (Convergence guarantee). If $\eta = O(d^{-1/2})$ , then for any $t$ it holds that + +$$ +L (\mathbf {W} ^ {(t + 1)}) - L (\mathbf {W} ^ {(t)}) \leq - \eta \| \nabla L (\mathbf {W} ^ {(t)}) \| _ {1} + \widetilde {\Theta} (\eta^ {2} d). +$$ + +Lemma 5.5 shows that we can pick a sufficiently small $\eta$ and $T = \mathrm{poly}(n) / \eta$ to ensure that the algorithm can find a point with up to $O(1 / (T\eta))$ in $\ell_1$ norm. Then we can show that given the results in Lemma 5.4, the formula of the algorithm output $\mathbf{W}^*$ can be precisely characterized, which we + +can show that $\langle \mathbf{w}_{y_i,r}^*, y_i \cdot \mathbf{v} \rangle < 0$ . This implies that the output model will be biased to fit the feature noise $-\alpha y\mathbf{v}$ but not the true one $\mathbf{v}$ . Then when it comes to a fresh test example the model will fail to recognize its true feature. Also note that the noise in the test data is nearly independent of the noise in training data. Consequently, the model will not be able to identify the label of the test data and therefore cannot be better than a random guess. + +# 5.2 PROOF SKETCH FOR GRADIENT DESCENT + +Similar to the proof for Adam, we also decompose the entire training process into two stages. + +Stage I: Learning the pattern. In this stage the gradient from training loss function is large and and the effect of regularization can be ignored. Unlike Adam that is sensitive to the sparsity of the feature vector or noise vector, gradient descent is more focusing on the $\ell_2$ norm of them, where the vector (which can be either feature or noise) with larger $\ell_2$ norm is more likely to be discovered and learned by GD. Note that the feature vector has a larger $\ell_2$ norm than the noise, we can show that gradient descent will learn the feature vector very quickly, while barely memorize the noise. + +Lemma 5.6. Let $\Lambda_{j}^{(t)} = \max_{r\in [m]}\langle \mathbf{w}_{j,r}^{(t + 1)},j\cdot \mathbf{v}\rangle$ $\Gamma_{j,i}^{(t)} = \max_{r\in [m]}\langle \mathbf{w}_{j,r}^{(t)},\pmb {\xi}_i\rangle$ , and $\Gamma_j^{(t)} =$ $\max_{i:y_i = j}\Gamma_{j,i}^{(t)}$ . Let $T_{j}$ be the iteration number that $\Lambda_j^{(t)}$ reaches $\Theta (1 / m) = \widetilde{\Theta} (1)$ , then we have $T_{j} = \widetilde{\Theta} (\sigma_{0}^{2 - q})$ for all $j\in \{-1,1\}$ . Moreover, let $T_0 = \max_j\{T_j\}$ , then for all $t\leq T_0$ it holds that $\Gamma_j^{(t)} = \widetilde{O} (\sigma_0)$ for all $j\in \{-1,1\}$ + +Stage II: Regularizing the model. Similar to Lemma 5.4, we show that in the second stage at which the impact of weight decay regularization cannot be ignored, the pattern of the training data learned in the first stage will remain unchanged. + +Lemma 5.7. If $\eta \leq O(\sigma_0)$ , it holds that $\Lambda_j^{(t)} = \widetilde{\Theta}(1)$ and $\Gamma_j^{(t)} = \widetilde{O}(\sigma_0)$ for all $t \geq \min_j T_j$ . + +The following lemma further shows that within polynomial steps, gradient descent is guaranteed to find a point with small gradient. + +Lemma 5.8. If the learning rate satisfies $\eta = o(1)$ , then for any $t\geq 0$ it holds that + +$$ +L \left(\mathbf {W} ^ {(t + 1)}\right) - L \left(\mathbf {W} ^ {(t)}\right) \leq - \frac {\eta}{2} \| \nabla L \left(\mathbf {W} ^ {(t)}\right) \| _ {F} ^ {2}. +$$ + +Lemma 5.8 shows that we can pick a sufficiently small $\eta$ and $T = \mathrm{poly}(n) / \eta$ to ensure that gradient descent can find a point with up to $O(1 / (T\eta)^{1 / 2})$ in $\ell_2$ norm. By Lemma 5.7, it is clear that the output model of GD can well learn the feature vector while memorizing nearly nothing from the noise vectors, which can therefore achieve nearly zero test error. + +Experiments. We perform experiments on synthetic data (generated according to Definition 3.1) to validate our theoretical findings: Adam performs stronger noise memorization than feature learning while GD performs stronger feature learning than noise memorization, when conducted on the data distribution constructed in Definition 3.1. We consider both the two-layer CNN model studied in this paper and a 5-layer CNN model for further justification. Experimental setup and results are deferred to Appendix A due to the page limit. + +# 6 CONCLUDING REMARKS AND FUTURE WORK + +In this paper, we study the generalization of Adam and compare it with gradient descent. We show that when training neural networks, Adam and GD starting from the same initialization can converge to different global solutions of the training objective with significantly different generalization errors, even with proper regularization. Our analysis reveals the fundamental difference between Adam and GD in learning features or noise, and demonstrates that this difference is closely tied to the nonconvex landscape of neural networks. + +We would also like to remark several important research directions. First, our current result is for two-layer networks. Extending the results to deep networks could be an important next step, where we will not only look at the input data but also consider the output of each intermediate layer as "input". Second, our current data model is motivated by the image data (i.e., sparse feature and denser noise), where Adam has been observed to perform worse than SGD in terms of generalization. In fact, our theoretical analysis can lead to an opposite conclusion on the generalization comparison between Adam and GD if the noise is sparse and the feature is denser. Therefore, it would also be interesting to explore whether this is the case in other machine learning tasks such as natural language processing, where Adam is often observed to perform better than SGD. + +# ACKNOWLEDGEMENTS + +We thank the anonymous reviewers and area chair for their helpful comments. YL is supported by the National Science Foundation CCF-2145703. QG is supported in part by the National Science Foundation CAREER Award 1906169, IIS-2008981 and the Sloan Research Fellowship. + +# REFERENCES + +Naman Agarwal, Rohan Anil, Elad Hazan, Tomer Koren, and Cyril Zhang. Revisiting the generalization of adaptive gradient methods. 2019. +Zeyuan Allen-Zhu and Yanzhi Li. What can ResNet learn efficiently, going beyond kernels? In Advances in Neural Information Processing Systems, 2019. +Zeyuan Allen-Zhu and Yuanzhi Li. Feature purification: How adversarial training performs robust deep learning. arXiv preprint arXiv:2005.10190, 2020a. +Zeyuan Allen-Zhu and Yuanzhi Li. Towards understanding ensemble, knowledge distillation and self-distillation in deep learning. arXiv preprint arXiv:2012.09816, 2020b. +Zeyuan Allen-Zhu, Yuzhhi Li, and Yingyu Liang. Learning and generalization in overparameterized neural networks, going beyond two layers. In Advances in Neural Information Processing Systems, 2019a. +Zeyuan Allen-Zhu, Yanzhi Li, and Zhao Song. A convergence theory for deep learning via overparameterization. In International Conference on Machine Learning, pp. 242-252, 2019b. +Sanjeev Arora, Simon Du, Wei Hu, Zhiyuan Li, and Ruosong Wang. Fine-grained analysis of optimization and generalization for overparameterized two-layer neural networks. In International Conference on Machine Learning, pp. 322-332, 2019a. +Sanjeev Arora, Simon S Du, Wei Hu, Zhiyuan Li, Ruslan Salakhutdinov, and Ruosong Wang. On exact computation with an infinitely wide neural net. In Advances in Neural Information Processing Systems, 2019b. +Yu Bai and Jason D Lee. Beyond linearization: On quadratic and higher-order approximation of wide neural networks. In International Conference on Learning Representations, 2019. +Lukas Balles and Philipp Hennig. Dissecting adam: The sign, magnitude and variance of stochastic gradients. In International Conference on Machine Learning, pp. 404-413. PMLR, 2018. +Jeremy Bernstein, Yu-Xiang Wang, Kamyar Azizzadenesheli, and Animashree Anandkumar. *signsgd: Compressed optimisation for non-convex problems*. In *International Conference on Machine Learning*, pp. 560–569. PMLR, 2018. +Yuan Cao, Zixiang Chen, Mikhail Belkin, and Quanquan Gu. Benign overfitting in two-layer convolutional neural networks. arXiv preprint arXiv:2202.06526, 2022. +Jinghui Chen, Dongruo Zhou, Yiqi Tang, Ziyan Yang, Yuan Cao, and Quanquan Gu. Closing the generalization gap of adaptive gradient methods in training deep neural networks. In International Joint Conferences on Artificial Intelligence, 2020. +Zixiang Chen, Yuan Cao, Difan Zou, and Quanquan Gu. How much over-parameterization is sufficient to learn deep relu networks? In International Conference on Learning Representations, 2021. +Zixiang Chen, Yihe Deng, Yue Wu, Quanquan Gu, and Yuanzhi Li. Towards understanding mixture of experts in deep learning. arXiv preprint arXiv:2208.02813, 2022. +Lenaic Chizat, Edouard Oyallon, and Francis Bach. On lazy training in differentiable programming. In Advances in Neural Information Processing Systems, 2019. +Dami Choi, Christopher J Shallue, Zachary Nado, Jaehoon Lee, Chris J Maddison, and George E Dahl. On empirical comparisons of optimizers for deep learning. arXiv preprint arXiv:1910.05446, 2019. + +Alexandre Défossez, Léon Bottou, Francis Bach, and Nicolas Usunier. A simple convergence proof of adam and adagrad. arXiv preprint arXiv:2003.02395, 2020. +Simon Du, Jason Lee, Haochuan Li, Liwei Wang, and Xiyu Zhai. Gradient descent finds global minima of deep neural networks. In International Conference on Machine Learning, pp. 1675-1685, 2019a. +Simon S Du, Xiyu Zhai, Barnabas Poczos, and Aarti Singh. Gradient descent provably optimizes over-parameterized neural networks. In International Conference on Learning Representations, 2019b. +John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research, 12(Jul):2121-2159, 2011. +Spencer Frei, Niladri S Chatterji, and Peter Bartlett. Benign overfitting without linearity: Neural network classifiers trained by gradient descent for noisy linear data. In Conference on Learning Theory, pp. 2668-2703. PMLR, 2022a. +Spencer Frei, Niladri S Chatterji, and Peter L Bartlett. Random feature amplification: Feature learning and generalization in neural networks. arXiv preprint arXiv:2202.07626, 2022b. +Geoffrey Hinton, Nitish Srivastava, and Kevin Swersky. Neural networks for machine learning lecture 6a overview of mini-batch gradient descent, 2012. +Arthur Jacot, Franck Gabriel, and Clément Hongler. Neural tangent kernel: Convergence and generalization in neural networks. In Advances in neural information processing systems, pp. 8571-8580, 2018. +Ziwei Ji and Matus Telgarsky. Polylogarithmic width suffices for gradient descent to achieve arbitrarily small test error with shallow relu networks. In International Conference on Learning Representations, 2020. +Nitish Shirish Keskar and Richard Socher. Improving generalization performance by switching from adam to sgd. arXiv preprint arXiv:1712.07628, 2017. +Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. International Conference on Learning Representations, 2015. +Yuanzhi Li, Tengyu Ma, and Hongyang R Zhang. Learning over-parametrized two-layer neural networks beyond ntk. In Conference on Learning Theory, pp. 2613-2682. PMLR, 2020. +Liangchen Luo, Yuanhao Xiong, Yan Liu, and Xu Sun. Adaptive gradient methods with dynamic bound of learning rate. arXiv preprint arXiv:1902.09843, 2019. +Stephen Merity, Nitish Shirish Keskar, and Richard Socher. Regularizing and optimizing LSTM language models. In International Conference on Learning Representations, 2018. +Vardan Papyan, Yaniv Romano, and Michael Elad. Convolutional neural networks analyzed via convolutional sparse coding. The Journal of Machine Learning Research, 18(1):2887-2938, 2017. +Sashank J Reddi, Satyen Kale, and Sanjiv Kumar. On the convergence of adam and beyond. In International Conference on Learning Representations, 2018. +Sashank J Reddi, Satyen Kale, and Sanjiv Kumar. On the convergence of adam and beyond. arXiv preprint arXiv:1904.09237, 2019. +Ruoqi Shen, Sebastien Bubeck, and Suriya Gunasekar. Data augmentation as feature manipulation. In International Conference on Machine Learning, pp. 19773-19808. PMLR, 2022. +Ashia C Wilson, Rebecca Roelofs, Mitchell Stern, Nati Srebro, and Benjamin Recht. The marginal value of adaptive gradient methods in machine learning. In Advances in Neural Information Processing Systems, pp. 4151-4161, 2017. + +Greg Yang. Scaling limits of wide neural networks with weight sharing: Gaussian process behavior, gradient independence, and neural tangent kernel derivation. arXiv preprint arXiv:1902.04760, 2019. +Pan Zhou, Jiashi Feng, Chao Ma, Caiming Xiong, Steven Chu Hong Hoi, et al. Towards theoretically understanding why sgd generalizes better than adam in deep learning. Advances in Neural Information Processing Systems, 33, 2020. +Difan Zou, Yuan Cao, Dongruo Zhou, and Quanquan Gu. Gradient descent optimizes overparameterized deep ReLU networks. Machine Learning, Oct 2019. + +# A EXPERIMENTS + +# A.1 EXPERIMENT DETAILS FOR FIGURE 1 + +The experiments in Figure 1 are performed by running (stochastic gradient) Adam and SGD in training AlexNet on the CIFAR-10 dataset. Specifically, the first layer of AlexNet is set as: kernel_size=11, stride=4, padding=2, in order to match the size of CIFAR-10 image. In terms of the input data, we use standard random crop and horizontal flip data augmentations. In terms of the model training, we set the batch size as 64, the epoch number as 100, the regularization parameter as $\lambda = 5 \times 10^{-4}$ . Besides, we set the learning rate $\eta = 0.01$ for SGD and $\eta = 1 \times 10^{-5}$ for Adam, where $\beta_{1}$ and $\beta_{2}$ are set as their default values in pytorch. + +# A.2 NUMERICAL EXPERIMENTS ON SYNTHETIC DATA + +In this section we perform numerical experiments on the synthetic data generated according to Definition 3.1 to verify our main results. In particular, we set the problem dimension $d = 1000$ , the training sample size $n = 200$ (100 positive examples and 100 negative examples), feature vector $\mathbf{v} = [1,0,\dots,0]^\top$ , noise sparsity $s = 0.1d = 100$ , standard deviation of noise $\sigma_p = 1 / s^{1/2} = 0.1$ , feature noise strength $\alpha = 0.2$ , initialization scaling $\sigma_0 = 0.01$ , regularization parameter $\lambda = 1 \times 10^{-5}$ . + +Two-layer CNN model. We first consider the exact two-layer CNN model studied in the paper. We set the network width $m = 20$ , activation function $\sigma(z) = \max \{0, z\}^3$ , total iteration number $T = 1 \times 10^4$ , and the learning rate $\eta = 5 \times 10^{-5}$ for Adam (default choices of $\beta_1$ and $\beta_2$ in pytorch), $\eta = 0.02$ for GD. + +We first report the training error and test error achieved by the solutions found by SGD and Adam in Table 2, where the test error is calculated on a test dataset of size $10^{4}$ . It is clear that both Adam and SGD can achieve zero training error, while they have entirely different results on the test data: SGD generalizes well and achieve zero test error; Adam generalizes worse than SGD and gives $>0.5$ test error, which verifies our main result (Theorem 4.1). + +
AlgorithmAdamSGD
Training error00
Test error0.8840
+ +Table 2: Training and test errors achieved by GD and Adam. + +Moreover, we also calculate the inner products: $\max_r\langle \mathbf{w}_{1,r},\mathbf{v}\rangle$ and $\min_i\max_r\langle \mathbf{w}_{1,r},\pmb {\xi}_i\rangle$ , representing feature learning and noise memorization respectively, to verify our key lemmas. Here we only consider positive examples as the results for negative examples are similar. The results are reported in Figure 2. For Adam, from Figure 2(a), it can be seen that the algorithm will perform feature learning in the first few iterations and then entirely forget the feature (but fit feature noise), i.e., the feature learning is flipped, which verifies Lemma 5.3. In the meanwhile, the noise memorization happens in the entire training process and enjoys much faster rate than feature learning, which verifies Lemma 5.2. In addition, we can also observe that there are two stages for the increasing of $\min_{i}\max_{r}\langle \mathbf{w}_{1,r},\pmb{\xi}_{i}\rangle$ : in the first stage $\min_{i}\max_{r}\langle \mathbf{w}_{1,r},\pmb{\xi}_{i}\rangle$ increases linearly, and in the second stage its increasing speed gradually slows down and $\min_{i}\max_{r}\langle \mathbf{w}_{1,r},\pmb{\xi}_{i}\rangle$ will remain in a constant order. This verifies Lemma 5.2 and Lemma 5.4. For GD, from Figure 2(b), it can be seen that the feature learning will dominate the noise memorization: feature learning will increase to a constant in the first stage and then remain in a constant order in the second stage; noise memorization will keep in a low level which is nearly the same as that at the initialization. This verifies Lemmas 5.6 and 5.7. + +5-Layer CNN model. We further perform numerical simulations for the deep neural network models. In particular, we consider a 5-layer CNN model: the first layer is exactly the same as the two-layer CNN model, followed by a 4-layer MLP with ReLU activation. The number of neurons is set + +![](images/c1df3a07908b3ef250352b8da5b7c14a25c194cf60ffd796e144adb9c1d66484.jpg) +(a) Adam + +![](images/d417f936b128e4ed4578a00b96e31f954f3ecd3c9f9206c8898b9752ce97a4ad.jpg) +(b) GD +Figure 2: Visualization of the feature learning $(\max_r\langle \mathbf{w}_{1,r},\mathbf{v}\rangle)$ and noise memorization $(\min_i\max_r\langle \mathbf{w}_{1,r},\pmb {\xi}_i\rangle)$ for training the two-layer CNN model. + +![](images/3a58a84e1b68c8e86c3d8f1b210076bfef47da23ae3ab3e95053d8ef0c2758b7.jpg) +(a) Adam + +![](images/17ba8cbd4578aa403a2b5da78ed4d610e17ca4f3a63a83acf3107330510c3f67.jpg) +(b) GD +Figure 3: Visualization of the feature learning $(\max_r\langle \mathbf{w}_{1,r},\mathbf{v}\rangle)$ and noise memorization $(\min_i\max_r\langle \mathbf{w}_{1,r},\pmb {\xi}_i\rangle)$ for training the 5-layer CNN model. + +as $m = 20$ for all layers. The total iteration number is $T = 1 \times 10^4$ , the learning rate is $\eta = 5 \times 10^{-5}$ for Adam and $\eta = 0.1$ for GD. + +We then show the feature learning and noise memorization of the first layer of this neural network model by calculating the inner products: $\max_r\langle \mathbf{w}_{1,r},\mathbf{v}\rangle$ and $\min_i\max_r\langle \mathbf{w}_{1,r},\pmb {\xi}_i\rangle$ , where $\mathbf{w}_{1,r}$ denotes the weights of the $r$ -th neuron in the first layer. The results are shown in Figure 3. It can be observed that, when applied on the data distribution in Definition 3.1, Adam tends to perform stronger noise memorization than feature learning, while GD performs stronger feature learning and nearly negligible noise memorization. Moreover, we also visualize the first layer of the 5-layer CNN trained by Adam and GD in Figure 4. It can be seen that the CNN model found by Adam is clearly more "noisy" than that found by GD. This is consistent with our theoretical findings and empirical observation on the real-world dataset (i.e., Figure 1). + +# B EXTENSIONS TO MINI-BATCH STOCHASTIC GRADIENTS + +One natural extension of our paper is proving the separation between mini-batch SGD (without replacement) and mini-batch Adam, which we believe is not difficult. In particular, let $\mathcal{I}_t$ of size $B$ be the set of indices of the mini-batch data used in the $t$ -th iteration, the update rule of SGD is + +$$ +\mathbf {w} _ {j, r} ^ {(t + 1)} = \mathbf {w} _ {j, r} ^ {(t)} - \eta \cdot \frac {1}{B} \sum_ {i \in \mathcal {I} _ {t}} \nabla_ {\mathbf {w} _ {j, r}} L _ {i} (\mathbf {W} ^ {(t)}) - \lambda \mathbf {w} _ {j, r} ^ {(t)}. +$$ + +![](images/b7d14dcfc291d94c12e933843dfd8f978f792f9beef1574b5f6cbe367292de7f.jpg) +(a) Adam + +![](images/1dcbd8693666e448d618c8fb1f1d2c6d14f2b15b3f7001092bb9a9c9620af0ad.jpg) +(b) GD +Figure 4: Visualization of the first layer of the 5-layer CNN model on the synthetic dataset. + +The update rule of mini-batch Adam is + +$$ +\mathbf {m} _ {j, r} ^ {(t + 1)} = \beta_ {1} \mathbf {m} _ {j, r} ^ {(t)} + (1 - \beta_ {1}) \cdot \left[ \frac {1}{B} \sum_ {i \in \mathcal {I} _ {t}} \nabla_ {\mathbf {w} _ {j, r}} L _ {i} (\mathbf {W} ^ {(t)}) + \lambda \mathbf {w} _ {j, r} ^ {(t)} \right], +$$ + +$$ +\mathbf {v} _ {j, r} ^ {(t + 1)} = \beta_ {2} \mathbf {v} _ {j, r} ^ {(t)} + (1 - \beta_ {2}) \cdot \left[ \frac {1}{B} \sum_ {i \in \mathcal {I} _ {t}} \nabla_ {\mathbf {w} _ {j, r}} L _ {i} (\mathbf {W} ^ {(t)}) + \lambda \mathbf {w} _ {j, r} ^ {(t)} \right] ^ {2}, +$$ + +and + +$$ +\mathbf {w} _ {j, r} ^ {(t + 1)} = \mathbf {w} _ {j, r} ^ {(t)} - \eta \cdot \mathbf {m} _ {j, r} ^ {(t)} / \sqrt {\mathbf {v} _ {j , r} ^ {(t)} + \epsilon}. +$$ + +Here the bias term is set as $\epsilon = \widetilde{\Theta} (\lambda \sigma_0)$ . We claim that this parameter is introduced to guarantee that the regularization term will not dominate the training process when using stochastic gradients in Adam. + +Then we will take a deeper look at the speeds of feature learning and noise learning for mini-batch SGD and Adam, where we focus on the period that $|\langle \mathbf{w}_{j,r}^{(t)},\mathbf{v}\rangle |,|\langle \mathbf{w}_{j,r}^{(t)},\pmb {\xi}_i\rangle | = o(1)$ for all $j,i$ , and $r$ (i.e., the pattern learning stage). This further implies that $|\ell_{j,i}^{(t)}| = 0.5\pm o(1)$ for all $j,i$ , and $t$ . Thus in the following, we will assume that all $|\ell_{j,i}^{(t)}|$ has nearly the same quantity. + +Feature Learning. First, according to Definition 3.1, we know that the feature vector $\mathbf{v}$ and feature noise are the same for all data, which implies that the learning pattern of the feature coordinate will be largely the same as that of full-batch algorithms. In particular, for mini-batch Adam, we can show that the update of the first coordinate (i.e., feature coordinate) is similar to sign-GD when using sufficiently small learning rate $\eta = 1 / \mathrm{poly}(d)$ since all stochastic gradients $\nabla L_{i}(\mathbf{W}^{(t)})$ have the same component in this coordinate. Then using the fact that $|\ell_{j,i}^{(t)}|$ 's are nearly the same for all $i$ , we have + +$$ +\langle \mathbf {w} _ {j, r} ^ {(t + 1)}, j \mathbf {v} \rangle \sim \langle \mathbf {w} _ {j, r} ^ {(t)}, j \mathbf {v} \rangle + j \eta \cdot \mathrm {s g n} \bigg (\sum_ {i = 1} ^ {n} y _ {i} \ell_ {j, i} ^ {(t)} \big [ \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t)}, y _ {i} \mathbf {v} \rangle) - \alpha \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t)}, \pmb {\xi} _ {i} \rangle) \big ] - n \lambda \mathbf {w} _ {j, r} ^ {(t)} [ 1 ] \bigg). +$$ + +which is the same as full-batch Adam (see (5.1)). For SGD, using the fact that $|\ell_{j,i}^{(t)}|$ 's are nearly the same for all $i$ , we can get that + +$$ +\begin{array}{l} \langle \mathbf {w} _ {j, r} ^ {(t + 1)}, j \mathbf {v} \rangle \sim (1 - \eta \lambda) \cdot \langle \mathbf {w} _ {j, r} ^ {(t)}, j \cdot \mathbf {v} \rangle \\ + \frac {\eta}{n} \cdot j \cdot \left(\sum_ {i = 1} ^ {n} y _ {i} \ell_ {j, i} ^ {(t)} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(t)}, y _ {i} \mathbf {v} \right\rangle\right) - \alpha \sum_ {i = 1} ^ {n} y _ {i} \ell_ {j, i} ^ {(t)} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \right\rangle\right)\right) \\ \end{array} +$$ + +which is also the same as that of GD (see (C.28)). + +Noise Memorization. Note that due to the normalization term $\mathbf{v}_{j,r}^{(t)}$ in the Adam update, all coordinates will be updated with nearly the same amount. Therefore, we only need to count the number of coordinates that are updated by full-batch Adam and mini-batch Adam. + +Recall that we have shown that using mini-batch gradients will not affect the feature learning. However, the noise memorization will be slightly different, since in each iteration, full-batch Adam can update $\Theta (ns)$ coordinates while mini-batch Adam can only update $\widetilde{\Theta} (Bs)$ coordinates. To show this, we note that for any coordinate $k\neq 1$ , the gradient momentum of full-batch Adam is + +$$ +\mathbf {m} _ {j, r} ^ {(t)} [ k ] \sim \sum_ {\tau = 0} ^ {\bar {\tau}} \beta_ {1} ^ {\tau} (1 - \beta_ {1}) \cdot \frac {1}{n} \sum_ {i \in [ n ]} \left[ \nabla_ {\mathbf {w} _ {j, r}} L _ {i} (\mathbf {W} ^ {(t - \tau)}) [ k ] + \lambda \mathbf {w} _ {j, r} ^ {(t - \tau)} [ k ] \right], +$$ + +while for mini-batch Adam, + +$$ +\mathbf {m} _ {j, r} ^ {(t)} [ k ] \sim \sum_ {\tau = 0} ^ {\bar {\tau}} \beta_ {1} ^ {\tau} (1 - \beta_ {1}) \cdot \frac {1}{B} \sum_ {i \in \mathcal {I} _ {t - \tau}} \left[ \nabla_ {\mathbf {w} _ {j, r}} L _ {i} (\mathbf {W} ^ {(t - \tau)}) [ k ] + \lambda \mathbf {w} _ {j, r} ^ {(t - \tau)} [ k ] \right], +$$ + +where we only maintain the recent $\bar{\tau} = \mathrm{polylog}(n)$ gradients since for $\tau \leq t - \bar{\tau}$ , the decaying terms $(\beta_{1})^{\tau} \leq (\beta_{i})^{\bar{\tau}}$ becomes negligible. Therefore, by comparing the above two equations and applying Definition 3.1, it is clear that for full-batch Adam can update all noise coordinates, i.e., $k \in \cup_{i \in [n]} \mathcal{B}_{i}$ , which is of size $\Theta(ns)$ . In contrast, mini-batch Adam can only update a subset of noise coordinates, i.e., $k \in \cup_{\tau \in [\bar{\tau}]} \cup_{i \in [\mathcal{I}_{t - \tau}]} \mathcal{B}_{i}$ , which is of size $\bar{\tau} B s = \widetilde{\Theta}(B s)$ . This further implies that in each epoch (one pass of the data, $\Theta(n / B)$ steps), the noise coordinates in $\mathcal{B}_{i}$ will be updated by mini-batch Adam in at most $\bar{\tau} = \widetilde{\Theta}(1)$ steps, while within the same amount of iterations, the noise coordinates in $\mathcal{B}_{i}$ will be updated by full-batch Adam for $\Theta(n / B)$ steps, suggesting that mini-batch Adam admits a slower rate of noise memorization by a $\widetilde{\Theta}(n / B)$ factor. + +For SGD, it is easy to show that the rate of noise memorization will still be nearly the same as that of GD. In particular, during each training epoch $(\Theta (n / B)$ steps), SGD will learn the noise vector $\xi_{i}$ in only one step with the mini-batch gradient $\frac{1}{B}\nabla L_i(\mathbf{W}^{(\tau)})$ for some $\tau$ in this epoch, while within the same amount of steps, GD will learn the noise vector $\xi_{i}$ in all $\Theta (n / B)$ steps but with strength $\frac{1}{n}\nabla L_i(\mathbf{W}^{(\tau)})$ , giving the same total learning ability. This suggests that SGD admits a nearly the same rate of noise memorization compared to GD. + +Overall, we are able to deliver the following lemmas that characterize the feature learning and noise memorization of SGD and stochastic gradient Adam in training Stage I. + +Lemma B.1 (SGD, Informal). Suppose the training data is generated according to Definition 3.1, then given proper configurations of $\lambda$ and $\epsilon$ and sufficiently small learning rate $\eta$ , define $\Lambda_{j}^{(t)} = \max_{r\in [m]}\langle \mathbf{w}_{j,r}^{(t)},j\cdot \mathbf{v}\rangle$ and $\Gamma_{j,i}^{(t)} = \max_{r\in [m]}\langle \mathbf{w}_{j,r}^{(t)},\pmb{\xi}_i\rangle$ , for any $t_0$ satisfying $\Lambda_{j}^{(t_{0})},\Gamma_{j,i}^{(t_{0})} = o(1 / \mathrm{polylog}(n))$ , we have the following one-epoch update of feature learning and noise memorization for SGD + +$$ +\Lambda_ {j} ^ {(t _ {0} + \lfloor n / B \rfloor)} \geq \Lambda_ {j} ^ {(t _ {0})} + \eta \cdot \Theta \left(\frac {n}{B} \cdot (\Lambda_ {j} ^ {(t _ {0})}) ^ {q - 1}\right) +$$ + +$$ +\Gamma_ {j} ^ {(t _ {0} + \lfloor n / B \rfloor)} \leq \Gamma_ {j} ^ {(t _ {0})} + \eta \cdot \Theta \bigg (\frac {\eta s \sigma_ {p} ^ {2}}{B} \cdot (\Gamma_ {j} ^ {(t _ {0})}) ^ {q - 1} \bigg). +$$ + +Lemma B.2 (Stochastic gradient Adam, Informal). Suppose the training data is generated according to Definition 3.1, then given proper configurations of $\lambda$ and $\epsilon$ , for any $t_0 \leq T_0$ with $T_0 = \widetilde{O}\left(\frac{n}{\eta B s \sigma_p}\right)$ and any $i \in [n]$ , we have the following one-epoch update of feature learning and noise memorization + +$$ +\langle \mathbf {w} _ {j, r} ^ {(t _ {0} + \lfloor n / B \rfloor)}, j \cdot \mathbf {v} \rangle \leq \langle \mathbf {w} _ {j, r} ^ {(t _ {0})}, j \cdot \mathbf {v} \rangle + \Theta (n \eta / B), \quad \langle \mathbf {w} _ {y _ {i}, r} ^ {(t _ {0} + \lfloor n / B \rfloor)}, \boldsymbol {\xi} _ {i} \rangle = \langle \mathbf {w} _ {y _ {i}, r} ^ {(t _ {0})}, \boldsymbol {\xi} _ {i} \rangle + \widetilde {\Theta} (\eta s \sigma_ {p}). +$$ + +To sum up, we have shown that (1) mini-batch SGD and mini-batch Adam will not change the learning speed of feature vector $\mathbf{v}$ compared to their full-batch counterparts, i.e., Lemma C.3 and (C.31) (needs to covert to $\lfloor n / B\rfloor$ iterations); (2) mini-batch Adam reduces the noise memorization speed of full-batch Adam by a $\widetilde{\Theta} (n / B)$ factor, while mini-batch SGD has nearly the same noise memorization speed compared to full-batch GD, by comparing to Lemma C.3 and (C.32)). Additionally, + +recall that in our paper, the separation between Adam and GD is characterized by a $\mathrm{poly}(d)$ factor: the speed of feature learning in Adam and GD, and the rate of noise memorization in GD are both in the order of $O(\eta)$ (in each step), while the rate of noise memorization in Adam is proportional to the number of nonzero entries, which is in the order of $\eta \cdot \mathrm{poly}(d)$ . Therefore, the separation between mini-batch SGD and mini-batch Adam in terms of the generalization error can still hold under a stronger over-parameterization condition $s\sigma_{p} = \Theta \left(d^{1/4} / (n\mathrm{poly}\log(n))\right) = \omega(n/B)$ (in contrast, the over-parameterization condition for full-batch Adam is $s\sigma_{p} = \omega(1)$ ). + +# C PROOF OF THEOREM 4.1: NONCONVEX CASE + +In the beginning of the proof we first present the following useful lemma. + +# C.1 PRELIMINARIES + +We first recall the magnitude of all parameters: + +$$ +d = \mathrm {p o l y} (n), \eta = \frac {1}{\mathrm {p o l y} (n)}, s = \Theta \bigg (\frac {d ^ {1 / 2}}{n ^ {2}} \bigg), \sigma_ {p} ^ {2} = \Theta \bigg (\frac {1}{s \cdot \mathrm {p o l y l o g} (n)} \bigg), \sigma_ {0} ^ {2} = \Theta \bigg (\frac {1}{d ^ {1 / 2}} \bigg), +$$ + +$$ +m = \mathrm {p o l y l o g} (n), \alpha = \Theta \big (\sigma_ {p} \cdot \mathrm {p o l y l o g} (n) \big), \lambda = O \bigg (\frac {1}{d ^ {(q - 1) / 4} n \cdot \mathrm {p o l y l o g} (n)} \bigg). +$$ + +Here $\mathrm{poly}(n)$ denotes a polynomial function of $n$ with degree of a sufficiently large constant, $\mathrm{poly}(n)$ denotes a polynomial function of $\log (n)$ with degree of a sufficiently large constant. Based on the parameter configuration, we claim that the following equations hold, which will be frequently used in the subsequent proof. + +$$ +\lambda = o \bigg (\frac {\sigma_ {0} ^ {q - 2} \sigma_ {p}}{n} \bigg), \alpha = \omega \big ((s \sigma_ {p}) ^ {1 - q} \sigma_ {0} ^ {q - 1} \big), \sigma_ {0} = o \bigg (\frac {1}{s \sigma_ {p}} \bigg), \alpha = o \bigg (\frac {s \sigma_ {p} ^ {2}}{n} \bigg), \eta = o \bigg (\lambda \sigma_ {0} ^ {q} \sigma_ {p} ^ {q} \bigg). +$$ + +Lemma C.1 (Non-overlapping support). Let $\{(\mathbf{x}_i, y_i)\}_{i=1,\dots,n}$ be the training dataset sampled according to Definition 3.1. Moreover, let $\mathcal{B}_i = \mathrm{supp}(\boldsymbol{\xi}_i) \backslash \{1\}$ be the support of $\mathbf{x}_i$ except the first coordinate2. Then with probability at least $1 - n^{-2}$ , $\mathcal{B}_i \cap \mathcal{B}_j = \emptyset$ for all $i, j \in [n]$ . + +Proof of Lemma C.1. For any fixed $k \in [n]$ and $j \in \mathrm{supp}(\xi_k) \backslash \{1\}$ , by the model assumption we have + +$$ +\mathbb {P} \left\{\left(\boldsymbol {\xi} _ {i}\right) _ {j} \neq 0 \right\} = s / (d - 1), +$$ + +for all $i \in [n] \backslash \{k\}$ . Therefore by the fact that the data samples are independent, we have + +$$ +\mathbb {P} \left(\exists i \in [ n ] \backslash \{k \}: (\xi_ {i}) _ {j} \neq 0\right) = 1 - \left[ 1 - s / (d - 1) \right] ^ {n}. +$$ + +Applying a union bound over all $k \in [n]$ and $j \in \mathrm{supp}(\pmb{\xi}_k) \backslash \{1\}$ , we obtain + +$$ +\mathbb {P} (\exists k \in [ n ], j \in \operatorname {s u p p} \left(\boldsymbol {\xi} _ {k}\right) \backslash \{1 \}, i \in [ n ] \backslash \{k \}: \left(\boldsymbol {\xi} _ {i}\right) _ {j} \neq 0) \leq n \cdot s \cdot \left\{1 - \left[ 1 - s / (d - 1) \right] ^ {n} \right\}. \tag {C.1} +$$ + +By the data distribution assumption we have $s \leq \sqrt{d} / (2n^2)$ , which clearly implies $s / (d - 1) \leq 1 / 2$ . Therefore we have + +$$ +\begin{array}{l} n \cdot s \cdot \left[ 1 - (1 - s / d) ^ {n} \right] = n \cdot s \cdot \left\{1 - \exp \left[ n \log \left(1 - s / (d - 1)\right) \right] \right\} \\ \leq n \cdot s \cdot \left[ 1 - \exp \left(n \cdot 2 s / (d - 1)\right) \right] \\ \leq n \cdot s \cdot \left[ 1 - \exp \left(n \cdot 4 s / d\right) \right] \\ \leq n \cdot s \cdot (4 n s / d) \\ = 4 n ^ {2} s ^ {2} / d \\ \leq n ^ {- 2}, \\ \end{array} +$$ + +where the first inequality follows by the inequalities $\log (1 - z) \geq -2z$ for $z \in [0, 1/2]$ , the second inequality follows by $s/(d-1) \geq 2s/d$ , the third inequality follows by the inequality $1 - \exp(-z) \leq z$ for $z \in \mathbb{R}$ , and the last inequality follows by the assumption that $s \leq \sqrt{d}/(2n^2)$ . Plugging the bound above into (C.1) finishes the proof. + +□ + +# C.2 PROOF FOR ADAM + +Before moving to the detailed proof, we first state the update rules of feature learning and noise memorization when the sign gradient is applied. + +$$ +\begin{array}{l} \left\langle \mathbf {w} _ {j, r} ^ {(t + 1)}, j \mathbf {v} \right\rangle = \left\langle \mathbf {w} _ {j, r} ^ {(t)}, j \mathbf {v} \right\rangle - \eta \cdot \left\langle \operatorname {s g n} \left(\nabla_ {\mathbf {w} _ {j, r}} L (\mathbf {W} ^ {(t)})\right), j \mathbf {v} \right\rangle \\ = \left\langle \mathbf {w} _ {\jmath , r} ^ {(t)}, j \mathbf {v} \right\rangle + j \eta \cdot \operatorname {s g n} \left(\sum_ {i = 1} ^ {n} y _ {i} \ell_ {\jmath , i} ^ {(t)} \left[ \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {\jmath , r} ^ {(t)}, y _ {i} \mathbf {v} \right\rangle\right) - \alpha \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {\jmath , r} ^ {(t)}, \boldsymbol {\xi} _ {i} \right\rangle\right) \right] - n \lambda \mathbf {w} _ {\jmath , r} ^ {(t)} [ 1 ]\right), \tag {C.2} \\ \end{array} +$$ + +where $\ell_{j,i}^{(t)}\coloneqq \mathbb{1}_{y_i = j} - \mathrm{logit}_j(F,\mathbf{x}_i)$ and $\mathrm{logit}_j(F,\mathbf{x}_i) = \frac{e^{F_j(\mathbf{W},\mathbf{x}_i)}}{\sum_{k\in\{-1,1\}}e^{F_k(\mathbf{W},\mathbf{x}_i)}}$ . From (C.2) we can observe three terms in the signed gradient. Specifically, the first term represents the gradient over the feature patch, the second term stems from the feature noise term in the noise patch (see Definition 3.1), and the last term is the gradient of the weight decay regularization. On the other hand, the memorization of the noise vector $\pmb{\xi}_i$ can be described by the following update rule, + +$$ +\begin{array}{l} \left\langle \mathbf {w} _ {y _ {i}, r} ^ {(t + 1)}, \boldsymbol {\xi} _ {i} \right\rangle = \left\langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \right\rangle - \eta \cdot \left\langle \operatorname {s g n} \left(\nabla_ {\mathbf {w} _ {y _ {i}, r}} L (\mathbf {W} ^ {(t)})\right), \boldsymbol {\xi} _ {i} \right\rangle \\ = \left\langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \right\rangle + \eta \cdot \sum_ {k \in \mathcal {B} _ {i}} \left\langle \operatorname {s g n} \left(\ell_ {y _ {i}, i} ^ {(t)} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \right\rangle\right) \boldsymbol {\xi} _ {i} [ k ] - n \lambda \mathbf {w} _ {y _ {i}, r} ^ {(t)} [ k ]\right), \boldsymbol {\xi} _ {i} [ k ] \right\rangle \\ - \alpha y _ {i} \eta \cdot \operatorname {s g n} \left(\sum_ {i = 1} ^ {n} y _ {i} \ell_ {y _ {i}, i} ^ {(t)} \left[ \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, y _ {i} \mathbf {v} \right\rangle\right) - \alpha \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \right\rangle\right) \right] - n \lambda \mathbf {w} _ {y _ {i}, r} ^ {(t)} [ 1 ]\right). \tag {C.3} \\ \end{array} +$$ + +In this subsection we first provide the following lemma that shows for most of the coordinate (with slightly large gradient), the Adam update is similar to signGD update (up to some constant factors). In the remaining proof for Adam, we will largely apply this lemma to get a signGD-like result for Adam (similar to the technical lemmas in Section 5). Besides, the proofs for all lemmas in Section 5 can be viewed as a simplified version of the proofs for technical lemmas for Adam, thus are omitted in the paper. + +Lemma C.2 (Closeness to SignGD). Recall the update rule of Adam, let $\mathbf{W}^{(t)}$ be the $t$ -th iterate of the Adam algorithm. Suppose that $\langle \mathbf{w}_{j,r}^{(t)}, \mathbf{v} \rangle, \langle \mathbf{w}_{j,r}^{(t)}, \pmb{\xi}_i \rangle = \widetilde{\Theta}(1)$ for all $j \in \{\pm 1\}$ and $r \in [m]$ . Then if $\beta_2 \geq \beta_1^2$ , we have + +- For all $k \in [d]$ , + +$$ +\left| \frac {\mathbf {m} _ {j , r} ^ {(t)} [ k ]}{\sqrt {\mathbf {v} _ {j , r} ^ {(t)} [ k ]}} \right| \leq \Theta (1). +$$ + +- For every $k \notin \cup_{i=1}^{n} \mathcal{B}_{i}$ (including $k = 1$ ) we have either $|\nabla_{\mathbf{w}_{j,r}} L(\mathbf{W}^{(t)})[k]| \leq \widetilde{\Theta}(\eta)$ or + +$$ +\frac {\mathbf {m} _ {j , r} ^ {(t)} [ k ]}{\sqrt {\mathbf {v} _ {j , r} ^ {(t)} [ k ]}} = \operatorname {s g n} \bigl (\nabla_ {\mathbf {w} _ {j, r}} L (\mathbf {W} ^ {(t)}) [ k ] \bigr) \cdot \Theta (1). +$$ + +- For every $k \in \mathcal{B}_i$ , we have $|\nabla_{\mathbf{w}_{j,r}} L(\mathbf{W}^{(t)})[k]| \leq \widetilde{\Theta}\big(\eta n^{-1}s\sigma_p|\ell_{j,i}^{(t)}|\big) \leq \widetilde{\Theta}(\eta s\sigma_p)$ or + +$$ +\frac {\mathbf {m} _ {j , r} ^ {(t)} [ k ]}{\sqrt {\mathbf {v} _ {j , r} ^ {(t)} [ k ]}} = \operatorname {s g n} \left(\nabla_ {\mathbf {w} _ {j, r}} L (\mathbf {W} ^ {(t)}) [ k ]\right) \cdot \Theta (1). +$$ + +Proof. First recall that the gradient $\nabla_{\mathbf{w}_{j,r}}L(\mathbf{W}^{(t)})$ can be calculated as + +$$ +\nabla_ {\mathbf {w} _ {j, r}} L (\mathbf {W} ^ {(t)}) = - \frac {1}{n} \left[ \sum_ {i = 1} ^ {n} y _ {i} \ell_ {j, i} ^ {(t)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t)}, y _ {i} \mathbf {v} \rangle) \cdot \mathbf {v} + \sum_ {i = 1} ^ {n} \ell_ {j, i} ^ {(t)} \cdot \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t)}, y _ {i} \pmb {\xi} _ {i} \rangle) \cdot \pmb {\xi} _ {i} \right] + \lambda \mathbf {w} _ {j, r} ^ {(t)}. +$$ + +More specifically, for the first coordinate of $\nabla_{\mathbf{w}_{j,r}}L(\mathbf{W}^{(t)})$ , we have + +$$ +\nabla_ {\mathbf {w} _ {j, r}} L \left(\mathbf {W} ^ {(t)}\right) [ 1 ] = - \frac {1}{n} \left[ \sum_ {i = 1} ^ {n} y _ {i} \ell_ {j, i} ^ {(t)} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(t)}, y _ {i} \mathbf {v} \right\rangle\right) - \alpha \sum_ {i = 1} ^ {n} y _ {i} \ell_ {j, i} ^ {(t)} \cdot \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \right\rangle\right) \right] + \lambda \mathbf {w} _ {j, r} ^ {(t)} [ 1 ]. \tag {C.4} +$$ + +For any $k \in \mathcal{B}_i$ , by Lemma C.1 we know that the gradient over this coordinate only depends on the training data $\xi_i$ , therefore, we have + +$$ +\nabla_ {\mathbf {w} _ {j, r}} L \left(\mathbf {W} ^ {(t)}\right) [ k ] = - \frac {1}{n} \ell_ {j, i} ^ {(t)} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \right\rangle\right) \boldsymbol {\xi} _ {i} [ k ] + \lambda \mathbf {w} _ {j, r} ^ {(t)} [ k ]. \tag {C.5} +$$ + +For the remaining coordinates, we have + +$$ +\nabla_ {\mathbf {w} _ {j, r}} L \left(\mathbf {W} ^ {(t)}\right) [ k ] = \lambda \mathbf {w} _ {j, r} ^ {(t)} [ k ]. \tag {C.6} +$$ + +Now let us focus on the moving averaged gradient $\mathbf{m}_{j,r}^{(t)}$ and squared gradient $\mathbf{v}_{j,r}^{(t)}$ . We first show that for all $k \in [d]$ , it holds that + +$$ +\frac {\left| \mathbf {m} _ {j , r} ^ {(t)} [ k ] \right|}{\sqrt {\mathbf {v} _ {j , r} ^ {(t)} [ k ]}} \leq \Theta (1). \tag {C.7} +$$ + +By the update rule of $\mathbf{m}_{j,r}^{(t)}$ , we have + +$$ +\begin{array}{l} \mathbf {m} _ {j, r} ^ {(t)} [ k ] = \beta_ {1} \mathbf {m} _ {j, r} ^ {(t - 1)} [ k ] + (1 - \beta_ {1}) \cdot \nabla_ {\mathbf {w} _ {j, r}} L (\mathbf {W} ^ {(t)}) [ k ] \\ = \sum_ {\tau = 0} ^ {t} \beta_ {1} ^ {\tau} (1 - \beta_ {1}) \cdot \nabla_ {\mathbf {w} _ {j, r}} L (\mathbf {W} ^ {(t - \tau)}) [ k ]. \\ \end{array} +$$ + +Similarly, we also have + +$$ +\mathbf {v} _ {j, r} ^ {(t)} [ k ] = \sum_ {\tau = 0} ^ {t} \beta_ {2} ^ {\tau} (1 - \beta_ {2}) \cdot \nabla_ {\mathbf {w} _ {j, r}} L (\mathbf {W} ^ {(t - \tau)}) [ k ] ^ {2}. +$$ + +Then by Cauchy-Schwartz inequality we have + +$$ +\left(\mathbf {m} _ {j, r} ^ {(t)} [ k ]\right) ^ {2} \leq \left(\sum_ {\tau = 0} ^ {t} \frac {[ \beta_ {1} ^ {\tau} (1 - \beta_ {1}) ] ^ {2}}{\alpha_ {\tau} ^ {2}} \cdot \nabla_ {\mathbf {w} _ {j, r}} L (\mathbf {W} ^ {(t - \tau)}) [ k ] ^ {2}\right) \cdot \left(\sum_ {\tau = 0} ^ {t} \alpha_ {\tau} ^ {2}\right). +$$ + +Let $\alpha_{\tau}^{2} = \frac{[\beta_{1}^{\tau}(1 - \beta_{1})]^{2}}{\beta_{2}^{\tau}(1 - \beta_{2})}$ , which forms an exponentially decaying sequence if $\beta_{2} \geq \beta_{1}^{2}$ . Therefore, we have $\sum_{\tau=0}^{t} \alpha_{\tau}^{2} = \Theta(1)$ and the above inequality implies that + +$$ +\left(\mathbf {m} _ {j, r} ^ {(t)} [ k ]\right) ^ {2} \leq \mathbf {v} _ {j, r} ^ {(t)} [ k ] \cdot \Theta (1), +$$ + +which proves (C.7). + +Now we are going to prove the main argument of this lemma. Note that $\mathbf{m}_{j,r}^{(t)}$ , which is a weighted average of all historical gradients, where the weights decay exponentially fast, then we can take on a threshold $\bar{\tau} = \mathrm{polylog}(\eta^{-1})$ such that $\sum_{\tau = \bar{\tau}}^{t}\beta_{1}^{\tau}(1 - \beta_{1}) = \frac{1}{\mathrm{poly}(\eta^{-1})}$ . Then for each $k\in [d]$ we have + +$$ +\begin{array}{l} \mathbf {m} _ {j, r} ^ {(t)} [ k ] = \sum_ {\tau = 0} ^ {\bar {\tau}} \beta_ {1} ^ {\tau} (1 - \beta_ {1}) \cdot \nabla_ {\mathbf {w} _ {j, r}} L (\mathbf {W} ^ {(t - \tau)}) [ k ] + \sum_ {\tau = \bar {\tau}} ^ {t} \beta_ {1} ^ {\tau} (1 - \beta_ {1}) \cdot \nabla_ {\mathbf {w} _ {j, r}} L (\mathbf {W} ^ {(t - \tau)}) [ k ] \\ = \sum_ {\tau = 0} ^ {\bar {\tau}} \beta_ {1} ^ {\tau} (1 - \beta_ {1}) \cdot \nabla_ {\mathbf {w} _ {j, r}} L (\mathbf {W} ^ {(t - \tau)}) [ k ] \pm \frac {1}{\mathrm {p o l y} (\eta^ {- 1})}, \\ \end{array} +$$ + +where in the last equality we use the fact that $|\nabla_{\mathbf{w}_{j,r}}L(\mathbf{W}^{(t - \tau)})[k]| = \widetilde{O}(1)$ for all $k \in [d]$ . Similarly, we can also have the following on $\mathbf{v}_{j,r}^{(t)}$ , + +$$ +\mathbf {v} _ {j, r} ^ {(t)} [ k ] = \sum_ {\tau = 0} ^ {\bar {\tau}} \beta_ {2} ^ {\tau} (1 - \beta_ {2}) \cdot \nabla_ {\mathbf {w} _ {j, r}} L (\mathbf {W} ^ {(t - \tau)}) [ k ] ^ {2} \pm \frac {1}{\mathrm {p o l y} (\eta^ {- 1})}. +$$ + +Here we slightly abuse the notation by using the same $\bar{\tau}$ . Then we have + +$$ +\frac {\mathbf {m} _ {j , r} ^ {(t)} [ k ]}{\sqrt {\mathbf {v} _ {j , r} ^ {(t)} [ k ]}} = \frac {\sum_ {\tau = 0} ^ {\bar {\tau}} \beta_ {1} ^ {\tau} (1 - \beta_ {1}) \cdot \nabla_ {\mathbf {w} _ {j , r}} L (\mathbf {W} ^ {(t - \tau)}) [ k ] \pm \frac {1}{\mathrm {p o l y} (\eta^ {- 1})}}{\sqrt {\sum_ {\tau = \bar {\tau}} ^ {\bar {\tau}} \beta_ {2} ^ {\tau} (1 - \beta_ {2}) \cdot \nabla_ {\mathbf {w} _ {j , r}} L (\mathbf {W} ^ {(t - \tau)}) [ k ] ^ {2}}} \pm \frac {1}{\mathrm {p o l y} (\eta^ {- 1})}. +$$ + +In order to prove the main argument of this lemma, the key is to show that within $\bar{\tau}$ iterations, the gradient $\nabla_{\mathbf{w}_{j,\tau}}L(\mathbf{W}^{(t)})[k]$ barely changes. In particular, by (C.7), we have the update of each coordinate in one step is at most $\Theta (\eta)$ . This implies that + +$$ +\left| \left\langle \mathbf {w} _ {j, r} ^ {(t)}, \mathbf {v} \right\rangle - \left\langle \mathbf {w} _ {j, r} ^ {(\tau)}, \mathbf {v} \right\rangle \right| \leq \Theta (\eta \bar {\tau}), +$$ + +$$ +\left| \left\langle \mathbf {w} _ {j, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \right\rangle - \left\langle \mathbf {w} _ {j, r} ^ {(\tau)}, \boldsymbol {\xi} _ {i} \right\rangle \right| \leq \Theta (\eta \bar {\tau} s \sigma_ {p}), +$$ + +$$ +| \mathbf {w} _ {j, r} ^ {(t)} [ k ] - \mathbf {w} _ {j, r} ^ {(\tau)} [ k ] | \leq \Theta (\eta \bar {\tau}). +$$ + +Then applying the fact that $|\langle \mathbf{w}_{j,r}^{(\tau)},\mathbf{v}\rangle |\leq \widetilde{\Theta} (1)$ and $|\langle \mathbf{w}_{j,r}^{(\tau)},\pmb {\xi}_i\rangle |\leq \widetilde{\Theta} (1)$ , we further have + +$$ +\left| F _ {j} (\mathbf {W} ^ {(\tau)}, \mathbf {x} _ {i}) - F _ {j} (\mathbf {W} ^ {(t)}, \mathbf {x} _ {i}) \right| \leq \Theta (m \eta \bar {\tau} s \sigma_ {p}) = \widetilde {\Theta} (\eta \bar {\tau} s \sigma_ {p}), +$$ + +where we use the fact that $m = \widetilde{\Theta}(1)$ and $s\sigma_p = \omega(1)$ . Then it holds that + +$$ +\begin{array}{l} \ell_ {j, i} ^ {(\tau)} = \frac {e ^ {F _ {j} \left(\mathbf {W} ^ {(\tau)} , \mathbf {x} _ {i}\right)}}{\sum_ {k \in \{- 1 , 1 \}} e ^ {F _ {k} \left(\mathbf {W} ^ {(\tau)} , \mathbf {x} _ {i}\right)}} \\ \leq \frac {e ^ {F _ {j} (\mathbf {W} ^ {(t)} , \mathbf {x} _ {i}) + \widetilde {\Theta} (\eta \bar {\tau} s \sigma_ {p})}}{e ^ {F _ {j} (\mathbf {W} ^ {(t)} , \mathbf {x} _ {i}) + \widetilde {\Theta} (\eta \bar {\tau} s \sigma_ {p})} + e ^ {F _ {- j} (\mathbf {W} ^ {(t)} , \mathbf {x} _ {i}) - \widetilde {\Theta} (\eta \bar {\tau} s \sigma_ {p})}} \\ = \mathrm {s g n} (\ell_ {j, i} ^ {(t)}) \cdot \Theta (| \ell_ {j, i} ^ {(t)} |), \\ \end{array} +$$ + +where we use the fact that $\widetilde{\Theta} (\eta \bar{\tau} s\sigma_{p}) = o(1)$ . Similarly, we can also show that $\ell_{j,i}^{(\tau)}\geq \mathrm{sgn}(\ell_{j,i}^{(t)})\cdot$ $\Theta (|\ell_{j,i}^{(t)}|)$ , which further implies + +$$ +\ell_ {j, i} ^ {(\tau)} = \mathrm {s g n} (\ell_ {j, i} ^ {(t)}) \cdot \Theta (| \ell_ {j, i} ^ {(t)} |) +$$ + +for all $\tau \in [t - \bar{\tau}, t]$ . Note that $|\ell_{j,i}^{(\tau)}| \leq 1$ , then it holds that + +$$ +\begin{array}{l} \ell_ {j, i} ^ {(\tau)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(\tau)}, \mathbf {v} \rangle) = \operatorname {s g n} (\ell_ {j, i} ^ {(t)}) \cdot \Theta (| \ell_ {j, i} ^ {(t)} |) \cdot \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(\tau)}, \mathbf {v} \rangle) \\ \leq \mathrm {s g n} (\ell_ {j, i} ^ {(t)}) \cdot \Theta (| \ell_ {j, i} ^ {(t)} |) \cdot \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t)}, \mathbf {v} \rangle) + \Theta (| \ell_ {j, i} ^ {(t)} |) \cdot \widetilde {\Theta} (\eta \bar {\tau}). \\ \end{array} +$$ + +We can also similarly derive the following + +$$ +\ell_ {j, i} ^ {(\tau)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(\tau)}, \mathbf {v} \rangle) \geq \mathrm {s g n} (\ell_ {j, i} ^ {(t)}) \cdot \Theta (| \ell_ {j, i} ^ {(t)} |) \cdot \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t)}, \mathbf {v} \rangle) - \Theta (| \ell_ {j, i} ^ {(t)} |) \cdot \widetilde {\Theta} (\eta \bar {\tau}), +$$ + +$$ +\ell_ {j, i} ^ {(\tau)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(\tau)}, \pmb {\xi} _ {i} \rangle) \leq \mathrm {s g n} (\ell_ {j, i} ^ {(t)}) \cdot \Theta (| \ell_ {j, i} ^ {(t)} |) \cdot \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t)}, \pmb {\xi} _ {i} \rangle) + \Theta (| \ell_ {j, i} ^ {(t)} |) \cdot \widetilde {\Theta} (\eta \bar {\tau} s \sigma_ {p}), +$$ + +$$ +\ell_ {j, i} ^ {(\tau)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(\tau)}, \pmb {\xi} _ {i} \rangle) \geq \operatorname {s g n} (\ell_ {j, i} ^ {(t)}) \cdot \Theta (| \ell_ {j, i} ^ {(t)} |) \cdot \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t)}, \pmb {\xi} _ {i} \rangle) - \Theta (| \ell_ {j, i} ^ {(t)} |) \cdot \widetilde {\Theta} (\eta \bar {\tau} s \sigma_ {p}). +$$ + +Combining the above results, applying (C.4), (C.5), and (C.6), we can show that for the first coordinate, we have + +$$ +\nabla_ {\mathbf {w} _ {j, r}} L (\mathbf {W} ^ {(\tau)}) [ 1 ] = \Theta \Bigl (\nabla_ {\mathbf {w} _ {j, r}} L (\mathbf {W} ^ {(t)}) [ 1 ] \Bigr) \pm \Theta \biggl (\frac {1}{n} \sum_ {i = 1} ^ {n} | \ell_ {j, i} ^ {(t)} | \biggr) \cdot \widetilde {O} (\eta \bar {\tau}) \pm \Theta (\lambda \eta \bar {\tau}); +$$ + +for any $k\in \mathcal{B}_i$ , we have + +$$ +\nabla_ {\mathbf {w} _ {j, r}} L (\mathbf {W} ^ {(\tau)}) [ k ] = \Theta \Bigl (\nabla_ {\mathbf {w} _ {j, r}} L (\mathbf {W} ^ {(t)}) [ k ] \Bigr) \pm \Theta \biggl (\frac {| \ell_ {j , i} ^ {(t)} |}{n} \biggr) \cdot \widetilde {O} (\eta \bar {\tau} s \sigma_ {p}) \pm \Theta (\lambda \eta \bar {\tau}); +$$ + +and for remaining coordinates, we have + +$$ +\nabla_ {\mathbf {w} _ {j, r}} L (\mathbf {W} ^ {(\tau)}) [ k ] = \Theta \Bigl (\nabla_ {\mathbf {w} _ {j, r}} L (\mathbf {W} ^ {(t)}) [ k ] \Bigr) \pm \Theta (\lambda \eta \widetilde {\tau}). +$$ + +Now we can plug the above results into the formula of $\mathbf{m}_{j,r}^{(t)}$ and $\mathbf{v}_{j,r}^{(t)}$ . Using the fact that $\bar{\tau} = \widetilde{\Theta}(1)$ , $\lambda = o(1)$ , and $|\ell_{j,i}^{(t)}| \leq 1$ , we have for all $k = 1$ or $k \notin \mathcal{B}_i$ for any $i$ , + +$$ +\frac {\mathbf {m} _ {j , r} ^ {(t)} [ k ]}{\sqrt {\mathbf {v} _ {j , r} ^ {(t)} [ k ]}} = \frac {\nabla_ {\mathbf {w} _ {j , r}} L (\mathbf {W} ^ {(t)}) [ k ] \pm \widetilde {\Theta} (\eta)}{\Theta \left(\left| \nabla_ {\mathbf {w} _ {j , r}} L (\mathbf {W} ^ {(t)}) [ k ] \right|\right) \pm \widetilde {\Theta} (\eta))}. +$$ + +For $k\in \mathcal{B}_i$ we have + +$$ +\frac {\mathbf {m} _ {j , r} ^ {(t)} [ k ]}{\sqrt {\mathbf {v} _ {j , r} ^ {(t)} [ k ]}} = \frac {\nabla_ {\mathbf {w} _ {j , r}} L (\mathbf {W} ^ {(t)}) [ k ] \pm \widetilde {\Theta} \left(\frac {\eta s \sigma_ {p} | \ell_ {j , i} ^ {(t)} |}{n}\right) \pm \widetilde {\Theta} (\lambda \eta)}{\Theta \left(| \nabla_ {\mathbf {w} _ {j , r}} L (\mathbf {W} ^ {(t)}) [ k ] |\right) \pm \widetilde {\Theta} \left(\frac {\eta s \sigma_ {p} | \ell_ {j , i} ^ {(t)} |}{n}\right) \pm \widetilde {\Theta} (\lambda \eta)}. +$$ + +Then, we can conclude that for all $k = 1$ or $k \notin \mathcal{B}_i$ for any $i$ , we have either $|\nabla_{\mathbf{w}_{j,r}}L(\mathbf{W}^{(t)})[k]|\leq \widetilde{\Theta} (\eta)$ or + +$$ +\frac {\mathbf {m} _ {j , r} ^ {(t)} [ k ]}{\sqrt {\mathbf {v} _ {j , r} ^ {(t)} [ k ]}} = \operatorname {s g n} \left(\nabla_ {\mathbf {w} _ {j, r}} L (\mathbf {W} ^ {(t)}) [ k ]\right) \cdot \Theta (1). +$$ + +For any $k\in \mathcal{B}_i$ , we have either $|\nabla_{\mathbf{w}_{j,r}}L(\mathbf{W}^{(t)})[k]|\leq \widetilde{\Theta}\big(\eta m^{-1}s\sigma_p|\ell_{j,i}^{(t)}| + \lambda \eta \big)$ or + +$$ +\frac {\mathbf {m} _ {j , r} ^ {(t)} [ k ]}{\sqrt {\mathbf {v} _ {j , r} ^ {(t)} [ k ]}} = \operatorname {s g n} \big (\nabla_ {\mathbf {w} _ {j, r}} L (\mathbf {W} ^ {(t)}) [ k ] \big) \cdot \Theta (1). +$$ + +This completes the proof. + +![](images/bcf977e64ae138e4bccc15016e12975385888bd45e2696aa92a9124882d19831.jpg) + +Lemma C.3 (Lemma 5.2, restated). Suppose the training data is generated according to Definition 3.1, assume $\lambda = o(\sigma_0^{q - 2}\sigma_p / n)$ and $\eta = 1 / \mathrm{poly}(d)$ , then for any $t\leq T_0$ with $T_{0} = \widetilde{O}\bigl (\frac{1}{\eta s\sigma_{p}}\bigr)$ and any $i\in [n]$ , + +$$ +\langle \mathbf {w} _ {j, r} ^ {(t + 1)}, j \cdot \mathbf {v} \rangle \leq \langle \mathbf {w} _ {j, r} ^ {(t)}, j \cdot \mathbf {v} \rangle + \Theta (\eta), +$$ + +$$ +\langle \mathbf {w} _ {y _ {i}, r} ^ {(t + 1)}, \pmb {\xi} _ {i} \rangle = \langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, \pmb {\xi} _ {i} \rangle + \widetilde {\Theta} (\eta s \sigma_ {p}). +$$ + +Proof. At the initialization, we have + +$$ +| \langle \mathbf {w} _ {j, r} ^ {(0)}, \mathbf {v} \rangle | = \widetilde {\Theta} (\sigma_ {0}), \quad | \langle \mathbf {w} _ {j, r} ^ {(0)}, \pmb {\xi} _ {i} \rangle | = \widetilde {\Theta} (s ^ {1 / 2} \sigma_ {p} \sigma_ {0} + \alpha) = \widetilde {\Theta} (s ^ {1 / 2} \sigma_ {p} \sigma_ {0}), \quad \mathbf {w} _ {j, r} ^ {(0)} [ k ] = \widetilde {\Theta} (\sigma_ {0}), +$$ + +which also imply that $|\ell_{j,i}^{(0)}| = \Theta (1)$ . Then recalling that $\lambda = o(\sigma_0^{q - 2}\sigma_p / n)$ , $\alpha = o(1)$ , $s^{1 / 2}\sigma_p = \widetilde{O}(1)$ , we have + +$$ +\begin{array}{l} \operatorname {s g n} \left(\sum_ {i = 1} ^ {n} y _ {i} \ell_ {j, i} ^ {(0)} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(0)}, y _ {i} \mathbf {v} \right\rangle\right) - \alpha \sum_ {i = 1} ^ {n} y _ {i} \ell_ {j, i} ^ {(0)} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(0)}, \boldsymbol {\xi} _ {i} \right\rangle\right) - n \lambda \mathbf {w} _ {j, r} ^ {(0)} [ 1 ]\right) \\ = \operatorname {s g n} \left[ j \cdot \widetilde {\Theta} \left(n \sigma_ {0} ^ {q - 1}\right) - j \cdot \widetilde {\Theta} \left(\alpha n \left(s ^ {1 / 2} \sigma_ {p} \sigma_ {0}\right) ^ {q - 1}\right) \pm o \left(\sigma_ {0} ^ {q - 1} \sigma_ {p}\right) \right] \\ = \operatorname {s g n} (j). \\ \end{array} +$$ + +Since $\mathbf{v}$ is 1-sparse, then by Lemma C.2, we have + +$$ +\langle \mathbf {w} _ {j, r} ^ {(1)}, j \cdot \mathbf {v} \rangle \leq \langle \mathbf {w} _ {j, r} ^ {(0)}, j \cdot \mathbf {v} \rangle - \eta \Bigl \langle \mathbf {m} _ {j, r} ^ {(0)} / \sqrt {\mathbf {v} _ {j , r} ^ {(0)}}, j \cdot \mathbf {v} \Bigr \rangle \leq \langle \mathbf {w} _ {j, r} ^ {(0)}, j \cdot \mathbf {v} \rangle + \Theta (\eta). +$$ + +Now suppose that the first inequality holds for iterations $0, \ldots, t - 1$ . Then we have + +$$ +\langle \mathbf {w} _ {j, r} ^ {(t)}, j \cdot \mathbf {v} \rangle \leq \Theta (\eta \cdot T _ {0}) \leq O (\sigma_ {0}). +$$ + +Besides, note that $\ell_{j,i}^{(t)} = \mathbb{1}_{j=y_i} - \mathrm{logit}_j(F^{(t)},\mathbf{x}_i)$ , we have + +$$ +\operatorname {s g n} \big (y _ {i} \ell_ {j, i} ^ {(t)} \big) = \operatorname {s g n} (j), +$$ + +where we recall that $j \in \{-1, 1\}$ . Therefore, given that $\lambda = o(\sigma_0^{q - 2}\sigma_p / n)$ , $\alpha = o(1)$ , $s^{1/2}\sigma_p = \widetilde{O}(1)$ , and assume $\ell_{j,i}^{(t)} = \Theta(1)$ (which will be verified later), + +$$ +\begin{array}{l} \operatorname {s g n} \bigg (\sum_ {i = 1} ^ {n} y _ {i} \ell_ {j, i} ^ {(t)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t)}, y _ {i} \mathbf {v} \rangle) - \alpha \sum_ {i = 1} ^ {n} y _ {i} \ell_ {j, i} ^ {(t)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t)}, \pmb {\xi} _ {i} \rangle) - n \lambda \mathbf {w} _ {j, r} ^ {(t)} [ 1 ] \bigg) \\ = \mathrm {s g n} \big [ j \cdot \widetilde {\Theta} (n \sigma_ {0} ^ {q - 1}) - j \cdot \widetilde {\Theta} (\alpha n (s ^ {1 / 2} \sigma_ {p} \sigma_ {0}) ^ {q - 1}) \pm o \big (\sigma_ {0} ^ {q - 1} \sigma_ {p} \big) \big ] \\ = \operatorname {s g n} (j). \\ \end{array} +$$ + +Since $\mathbf{v}$ is 1-sparse, then by Lemma C.2, the following inequality naturally holds, + +$$ +\langle \mathbf {w} _ {j, r} ^ {(t + 1)}, j \cdot \mathbf {v} \rangle \leq \langle \mathbf {w} _ {j, r} ^ {(t)}, j \cdot \mathbf {v} \rangle - \eta \Bigl \langle \mathbf {m} _ {j, r} ^ {(t)} / \sqrt {\mathbf {v} _ {j , r} ^ {(t)}}, j \cdot \mathbf {v} \Bigr \rangle \leq \langle \mathbf {w} _ {j, r} ^ {(t)}, j \cdot \mathbf {v} \rangle + \Theta (\eta). +$$ + +Additionally, in terms of the memorization of noise, we first consider the iterate in the initialization. By the condition that $\eta = o(1 / d) = o(1 / (s\sigma_p))$ and note that for a sufficiently large fraction of $k\in \mathcal{B}_i$ (e.g., 0.99), we have $|\pmb {\xi}_i[k]|\geq \widetilde{\Theta} (\sigma_p)\geq \widetilde{\Theta} (\eta n^{-1}s\sigma_p|\ell_{j,i}^{(0)}|)$ and thus + +$$ +\begin{array}{l} \operatorname {s g n} \left(\nabla_ {\mathbf {w} _ {y _ {i}, r}} L (\mathbf {W} ^ {(0)}) [ k ]\right) = \operatorname {s g n} \left(\ell_ {y _ {i}, i} ^ {(0)} \sigma^ {\prime} \left(\langle \mathbf {w} _ {y _ {i}, r} ^ {(0)}, \boldsymbol {\xi} _ {i} \rangle\right) \boldsymbol {\xi} _ {i} [ k ] - n \lambda \mathbf {w} _ {y _ {i}, r} ^ {(0)} [ k ]\right) \\ = - \operatorname {s g n} \left[ \widetilde {\Theta} \left(\left(d ^ {1 / 2} \sigma_ {p} \sigma_ {0}\right) ^ {q - 1} \sigma_ {p} \cdot \operatorname {s g n} \left(\boldsymbol {\xi} _ {i} [ k ]\right)\right) \pm o \left(\sigma_ {0} ^ {q - 1} \sigma_ {p}\right) \right] = - \operatorname {s g n} \left(\boldsymbol {\xi} _ {i} [ k ]\right). \tag {C.8} \\ \end{array} +$$ + +Therefore, by Lemma C.2 we have the following according to (C.3), + +$$ +\begin{array}{l} \left\langle \mathbf {w} _ {y _ {i}, r} ^ {(1)}, \boldsymbol {\xi} _ {i} \right\rangle = \left\langle \mathbf {w} _ {y _ {i}, r} ^ {(0)}, \boldsymbol {\xi} _ {i} \right\rangle - \eta \left\langle \mathbf {m} _ {j, r} ^ {(0)} / \sqrt {\mathbf {v} _ {y _ {i} , r} ^ {(0)}}, \boldsymbol {\xi} _ {i} \right\rangle \\ \geq \langle \mathbf {w} _ {y _ {i}, r} ^ {(0)}, \boldsymbol {\xi} _ {i} \rangle + \Theta (\eta) \cdot \sum_ {k \in \mathcal {B} _ {i}} \langle \operatorname {s g n} (\boldsymbol {\xi} _ {i} [ k ]), \boldsymbol {\xi} _ {i} [ k ] \rangle - O (\eta s \sigma_ {p}) - O (\eta \alpha) \\ = \langle \mathbf {w} _ {y _ {i}, r} ^ {(0)}, \pmb {\xi} _ {i} \rangle + \widetilde {\Theta} (\eta s \sigma_ {p}), \\ \end{array} +$$ + +where in the first inequality the term $O(\eta s\sigma_{p})$ represents the coordinates that $|\xi_i[k]| \leq O(\sigma_p)$ (so that we cannot use the sign information of $\nabla_{y_i,r}L(\mathbf{W}^{(0)})$ but directly bound it by $\Theta (1))$ and the last inequality is due to the fact that $|\mathcal{B}_i| \geq s - 1$ and $\alpha = o(1)$ . For general $t$ , we will consider the following induction hypothesis: + +$$ +\left\langle \mathbf {w} _ {y _ {i}, r} ^ {(t + 1)}, \boldsymbol {\xi} _ {i} \right\rangle = \left\langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \right\rangle + \widetilde {\Theta} (\eta s \sigma_ {p}), \tag {C.9} +$$ + +which has already been verified for $t = 0$ . By Hypothesis (C.9), the following holds at time $t$ + +$$ +\langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, \pmb {\xi} _ {i} \rangle = \langle \mathbf {w} _ {y _ {i}, r} ^ {(0)}, \pmb {\xi} _ {i} \rangle + \widetilde {\Theta} (t \eta s \sigma_ {p}) = \widetilde {\Theta} (s ^ {1 / 2} \sigma_ {p} \sigma_ {0} + t \eta s \sigma_ {p}). +$$ + +In the meanwhile, we have the following upper bound for $|\mathbf{w}_{j,r}^{(t)}[k]|$ , + +$$ +\left| \mathbf {w} _ {j, r} ^ {(t)} [ k ] \right| \leq \left| \mathbf {w} _ {j, r} ^ {(t - 1)} [ k ] \right| + \eta \left| \operatorname {s i g n} \left(\nabla_ {\mathbf {w} _ {j, r}} L \left(\mathbf {W} ^ {(t - 1)}\right)\right) \right| \leq \left| \mathbf {w} _ {j, r} ^ {(0)} [ k ] \right| + t \eta = \widetilde {\Theta} \left(\sigma_ {0} + t \eta\right). \tag {C.10} +$$ + +Besides, it is also easy to verify that for any $t \leq T_0 = \widetilde{\Theta}\left(\frac{1}{s\sigma_p\eta m}\right) = \widetilde{\Theta}\left(\frac{1}{s\sigma_p\eta}\right)$ , we have $\langle \mathbf{w}_{y_i,r}^{(t)}, \pmb{\xi}_i \rangle, \langle \mathbf{w}_{y_i,r}^{(t)}, j \cdot \mathbf{v} \rangle < \Theta(1/m)$ and thus $|\ell_{j,i}^{(t)}| = \Theta(1)$ . Then similar to (C.8), we have + +$$ +\begin{array}{l} \operatorname {s g n} \left(\nabla_ {\mathbf {w} _ {y _ {i}, r}} L \left(\mathbf {W} ^ {(t)}\right) [ k ]\right) \\ = \mathrm {s g n} \bigg (\ell_ {y _ {i}, i} ^ {(t)} \sigma^ {\prime} (\langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, \pmb {\xi} _ {i} \rangle) \pmb {\xi} _ {i} [ k ] - n \lambda \mathbf {w} _ {y _ {i}, r} ^ {(t)} [ k ] \bigg) \\ = - \operatorname {s g n} \left(\widetilde {\Theta} \left[ (s ^ {1 / 2} \sigma_ {p} \sigma_ {0} + t \eta s \sigma_ {p}) ^ {q - 1} \sigma_ {p} \cdot \operatorname {s g n} (\boldsymbol {\xi} _ {i} [ k ]) \pm o \left(\sigma_ {0} ^ {q - 2} \sigma_ {p} \cdot (\sigma_ {0} + t \eta)\right) \right]\right) \\ = - \operatorname {s g n} \left(\boldsymbol {\xi} _ {i} [ k ]\right). \tag {C.11} \\ \end{array} +$$ + +This further implies that + +$$ +\begin{array}{l} \langle \mathbf {w} _ {y _ {i}, r} ^ {(t + 1)}, \pmb {\xi} _ {i} \rangle \geq \langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, \pmb {\xi} _ {i} \rangle - \Theta (\eta) \cdot \sum_ {k \in \mathcal {B} _ {i}} \langle \mathrm {s g n} \big (\nabla_ {\mathbf {w} _ {y _ {i}}, r} L (\mathbf {W} ^ {(t)}) [ k ] \big), \pmb {\xi} _ {i} [ k ] \rangle - O (\eta^ {2} s ^ {2} \sigma_ {p} ^ {2}) - O (\eta \alpha) \\ = \langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, \pmb {\xi} _ {i} \rangle + \widetilde {\Theta} (\eta s \sigma_ {p}), \\ \end{array} +$$ + +where the term $-O(\eta^2 s^2 \sigma_p^2)$ is contributed by the gradient coordinates that are smaller than $\Theta (\eta s\sigma_{p})$ . This verifies Hypothesis (C.9) at time $t$ and thus completes the proof. + +From Lemma C.3, note that $s\sigma_{p} = \omega(1)$ , then it can be seen that $\langle \mathbf{w}_{j,r}^{(t)}, j \cdot \mathbf{v} \rangle$ increases much faster than $\langle \mathbf{w}_{j,r}^{(t)}, j \cdot \mathbf{v} \rangle$ . By looking at the update rule of $\langle \mathbf{w}_{j,r}^{(t)}, j \cdot \mathbf{v} \rangle$ (see (C.2)), it will keeps increasing only when, roughly speaking, $\sigma'(\langle \mathbf{w}_{j,r}^{(t)}, j \cdot \mathbf{v} \rangle) > \alpha \sigma'(\langle \mathbf{w}_{j,r}^{(t)}, \boldsymbol{\xi}_i \rangle)$ . Since $\langle \mathbf{w}_{j,r}^{(t)}, \boldsymbol{\xi}_i \rangle$ increases much faster than $\langle \mathbf{w}_{j,r}^{(t)}, j \cdot \mathbf{v} \rangle$ , it can be anticipated after a certain number of iterations, $\langle \mathbf{w}_{j,r}^{(t)}, j \cdot \mathbf{v} \rangle$ will start to decrease. In the following lemma, we provide an upper bound on the iteration number such that this decreasing occurs. + +Lemma C.4 (Lemma C.4, restated). Suppose the training data is generated according to Definition 3.1, $\alpha \geq \widetilde{\Theta}\big((s\sigma_p)^{1 - q}\vee \sigma_0^{q - 1}\big)$ and $\sigma_0 < \widetilde{O} ((s\sigma_p)^{-1})$ , then for any $t\in [T_r,T_0]$ with $T_{r} = \widetilde{O}\big(\frac{\sigma_{0}}{\eta s\sigma_{p}\alpha^{1 / (q - 1)}}\big)\leq T_{0},$ + +$$ +\langle \mathbf {w} _ {j, r} ^ {(t + 1)}, j \cdot \mathbf {v} \rangle = \langle \mathbf {w} _ {j, r} ^ {(t)}, j \cdot \mathbf {v} \rangle - \Theta (\eta). +$$ + +Moreover, it holds that + +$$ +\mathbf {w} _ {j, r} ^ {(T _ {0})} [ k ] = \left\{ \begin{array}{l l} - \operatorname {s g n} (j) \cdot \widetilde {\Omega} \big (\frac {1}{s \sigma_ {p}} \big), & k = 1, \\ \operatorname {s g n} (\boldsymbol {\xi} _ {i} [ k ]) \cdot \widetilde {\Omega} \big (\frac {1}{s \sigma_ {p}} \big) \text {o r} \pm \widetilde {O} (\eta), & k \in \mathcal {B} _ {i}, \text {w i t h} y _ {i} = j, \\ \pm \widetilde {O} (\eta), & \text {o t h e r w i s e}. \end{array} \right. +$$ + +Proof. Recall from Lemma C.3 that for any $t \leq T_0$ we have + +$$ +\langle \mathbf {w} _ {j, r} ^ {(t + 1)}, j \cdot \mathbf {v} \rangle \leq \langle \mathbf {w} _ {j, r} ^ {(t)}, j \cdot \mathbf {v} \rangle + \Theta (\eta) \leq \langle \mathbf {w} _ {j, r} ^ {(0)}, j \cdot \mathbf {v} \rangle + \Theta (t \eta), +$$ + +$$ +\langle \mathbf {w} _ {y _ {s}, r} ^ {(t + 1)}, \boldsymbol {\xi} _ {s} \rangle = \langle \mathbf {w} _ {y _ {s}, r} ^ {(t)}, \boldsymbol {\xi} _ {s} \rangle + \widetilde {\Theta} (\eta s \sigma_ {p}) \leq \langle \mathbf {w} _ {y _ {s}, r} ^ {(0)}, \boldsymbol {\xi} _ {s} \rangle + \widetilde {\Theta} (t \eta s \sigma_ {p}). +$$ + +Besides, by Lemma C.2 we also have $|\mathbf{w}_{j,r}^{(t)}[k]|\leq |\mathbf{w}_{j,r}^{(0)}[k]| + O(t\eta)$ . Then it can be verified that for some $T_{r} = \widetilde{O}\big(\frac{\sigma_{0}}{\eta s\sigma_{p}\alpha^{1 / (q - 1)}}\big)$ , we have for all $i\in [n]$ and $t\in [T_r,T_0]$ + +$$ +\alpha \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \right\rangle\right) \geq C \cdot \left[ \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(t)}, j \cdot \mathbf {v} \right\rangle\right) + \lambda n \mid \mathbf {w} _ {j, r} ^ {(t)} [ 1 ] \right] \mid +$$ + +for some constant $C$ . This further implies that + +$$ +\begin{array}{l} \operatorname {s g n} \left(\nabla_ {\mathbf {w} _ {j, r}} L (\mathbf {W} ^ {(t)}) [ 1 ]\right) \\ = - \operatorname {s g n} \left(\sum_ {i = 1} ^ {n} y _ {i} \ell_ {j, i} ^ {(t)} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(t)}, y _ {i} \mathbf {v} \right\rangle\right) - \alpha \sum_ {i = 1} ^ {n} y _ {i} \ell_ {j, i} ^ {(t)} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \right\rangle\right) - n \lambda \mathbf {w} _ {j, r} ^ {(t)} [ 1 ]\right) \\ = - \operatorname {s g n} \left[ - \alpha \sum_ {i = 1} ^ {n} y _ {i} \ell_ {j, i} ^ {(t)} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \right\rangle\right) \right] \\ = \operatorname {s g n} (j), \\ \end{array} +$$ + +where we use the fact that $\operatorname{sgn}(y_i\ell_{j,i}^{(t)}) = \operatorname{sgn}(j)$ for all $i \in [n]$ . Then by Lemma C.2 and (C.2), we have for all $t \in [T_r, T_0]$ , + +$$ +\langle \mathbf {w} _ {j, r} ^ {(t + 1)}, j \cdot \mathbf {v} \rangle = \langle \mathbf {w} _ {j, r} ^ {(t)}, j \cdot \mathbf {v} \rangle - \Theta (\eta) \cdot \operatorname {s g n} (j) \cdot \operatorname {s g n} \bigl (\nabla_ {\mathbf {w} _ {j, r}} L (\mathbf {W} ^ {(t)}) [ 1 ] \bigr) = \langle \mathbf {w} _ {j, r} ^ {(t)}, j \cdot \mathbf {v} \rangle - \Theta (\eta). +$$ + +Then at iteration $T_0$ , for the first coordinate we have + +$$ +\mathbf {w} _ {j, r} ^ {(T _ {0})} [ 1 ] = \mathbf {w} _ {j, r} ^ {(0)} [ 1 ] + \mathrm {s g n} (j) \cdot \Theta (T _ {r} \eta) - \mathrm {s g n} (j) \cdot \Theta ((T _ {0} - T _ {r}) \eta) \geq - \mathrm {s g n} (j) \cdot \widetilde {\Omega} \bigg (\frac {1}{s \sigma_ {p}} \bigg) +$$ + +For any $k \in \mathcal{B}_i$ with $y_i = j$ , we have either the coordinate will increase at a rate of $\Theta(1)$ or fall into 0. As a consequence we have either $\mathbf{w}_{j,r}^{(T_0)}[k] \in [-\widetilde{\Theta}(\eta), \widetilde{\Theta}(\eta)]$ or + +$$ +\mathbf {w} _ {j, r} ^ {(T _ {0})} [ k ] = \mathbf {w} _ {j, r} ^ {(0)} [ k ] + \operatorname {s g n} (\boldsymbol {\xi} _ {i} [ k ]) \cdot \Theta (T _ {0} \eta) \geq \operatorname {s g n} (\boldsymbol {\xi} _ {i} [ k ]) \cdot \widetilde {\Omega} \left(\frac {1}{s \sigma_ {p}}\right). +$$ + +For the remaining coordinate, its update will be determined by the regularization term, which will finally fall into the region around zero since we have $T_0\eta = \omega(\sigma_0)$ . By Lemma C.2 it is clear that $\mathbf{w}_{j,r}^{(T_0)}[k] \in [-\widetilde{\Theta}(\eta), \widetilde{\Theta}(\eta)]$ . + +Lemma C.5 (Lemma 5.4, restated). If $\alpha = O\left(\frac{s\sigma_p^2}{n}\right)$ and $\eta = o(\lambda)$ , then let $r^* = \arg \max_{r \in [m]} \langle \mathbf{w}_{y_i,r}^{(t)}, \pmb{\xi}_i \rangle$ , for any $t \geq T_0$ , $i \in [n]$ , $j \in [2]$ and $r \in [m]$ , it holds that + +$$ +\langle \mathbf {w} _ {y _ {i}, r ^ {*}} ^ {(t)}, \boldsymbol {\xi} _ {i} \rangle = \widetilde {\Theta} (1), \quad \sum_ {k \in B _ {i}} | \mathbf {w} _ {y _ {i}, r ^ {*}} ^ {(t)} [ k ] | \cdot | \boldsymbol {\xi} _ {i} [ k ] | = \widetilde {\Theta} (1), +$$ + +$$ +\forall r \in [ m ], \quad \langle \mathbf {w} _ {j, r} ^ {(t)}, \mathrm {s g n} (j) \cdot \mathbf {v} \rangle \in [ - \widetilde {\cal O} \big (\frac {n \alpha}{s \sigma_ {p} ^ {2}} \big), {\cal O} (\lambda^ {- 1} \eta) ]. +$$ + +Proof. The proof will be relying on the following three induction hypothesis: + +$$ +\langle \mathbf {w} _ {y _ {i}, r ^ {*}} ^ {(t)}, \boldsymbol {\xi} _ {i} \rangle = \widetilde {\Omega} (1), \tag {C.12} +$$ + +$$ +\sum_ {k \in \mathcal {B} _ {i}} | \mathbf {w} _ {y _ {i}, r ^ {*}} ^ {(t + 1)} [ k ] | \cdot | \boldsymbol {\xi} _ {i} [ k ] | = \widetilde {\Theta} (1), \tag {C.13} +$$ + +$$ +\forall r \in [ m ], \langle \mathbf {w} _ {j, r} ^ {(t)}, \operatorname {s g n} (j) \cdot \mathbf {v} \rangle \in \left[ - \widetilde {O} \left(\frac {n \alpha}{s \sigma_ {p} ^ {2}}\right), O \left(\lambda^ {- 1} \eta\right) \right], \tag {C.14} +$$ + +which we assume they hold for all $\tau \leq t$ and $r \in [m]$ , $i \in [n]$ , and $j \in [2]$ . It is clear that all hypothesis hold when $t = T_0$ according to Lemma C.4. + +Verifying Hypothesis (C.12). We first verify Hypothesis (C.12). Recall that the update rule for $\langle \mathbf{w}_{y_i,r}^{(t)},\pmb {\xi}_i\rangle$ is given as follows, + +$$ +\begin{array}{l} \left\langle \mathbf {w} _ {y _ {i}, r} ^ {(t + 1)}, \boldsymbol {\xi} _ {i} \right\rangle \\ = \left\langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \right\rangle - \eta \cdot \left\langle \mathbf {m} _ {y _ {i}, r} ^ {(t)} / \sqrt {\mathbf {v} _ {y _ {i} , r} ^ {(t)}}, \boldsymbol {\xi} _ {i} \right\rangle \\ \geq \left\langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, \pmb {\xi} _ {i} \right\rangle - \Theta (\eta) \cdot \left\langle \mathrm {s g n} \bigl (\nabla_ {\mathbf {w} _ {y _ {i}}, r} L (\mathbf {W} ^ {(t)}) \bigr), \pmb {\xi} _ {i} \right\rangle - \widetilde {\Theta} (\eta^ {2} s ^ {2} \sigma_ {p} ^ {2}) \\ = \langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, \pmb {\xi} _ {i} \rangle + \Theta (\eta) \cdot \sum_ {k \in \mathcal {B} _ {i}} \left\langle \mathrm {s g n} \bigg (\ell_ {y _ {i}, i} ^ {(t)} \sigma^ {\prime} (\langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, \pmb {\xi} _ {i} \rangle) \pmb {\xi} _ {i} [ k ] - n \lambda \mathbf {w} _ {y _ {i}, r} ^ {(t)} [ k ] \bigg), \pmb {\xi} _ {i} [ k ] \right\rangle \\ - \alpha y _ {i} \Theta (\eta) \cdot \mathrm {s g n} \bigg (\sum_ {i = 1} ^ {n} y _ {i} \ell_ {j, i} ^ {(t)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t)}, y _ {i} \mathbf {v} \rangle) - \alpha \sum_ {i = 1} ^ {n} y _ {i} \ell_ {j, i} ^ {(t)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t)}, \pmb {\xi} _ {i} \rangle) - n \lambda \mathbf {w} _ {j, r} ^ {(t)} [ 1 ] \bigg) \\ - \widetilde {\Theta} \left(\eta^ {2} s ^ {2} \sigma_ {p} ^ {2}\right). \tag {C.15} \\ \end{array} +$$ + +Note that for any $a$ and $b$ we have $\operatorname{sgn}(a - b) \cdot a \geq |a| - 2|b|$ . Then it follows that + +$$ +\begin{array}{l} \sum_ {k \in \mathcal {B} _ {i}} \left\langle \operatorname {s g n} \left(\ell_ {y _ {i}, i} ^ {(t)} \sigma^ {\prime} (\langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, \pmb {\xi} _ {i} \rangle) \pmb {\xi} _ {i} [ k ] - n \lambda \mathbf {w} _ {y _ {i}, r} ^ {(t)} [ k ]\right), \pmb {\xi} _ {i} [ k ] \right\rangle \geq \sum_ {k \in \mathcal {B} _ {i}} \left(| \pmb {\xi} _ {i} [ k ] | - \frac {2 n \lambda | \mathbf {w} _ {y _ {i} , r} ^ {(t)} [ k ] |}{\ell_ {y _ {i} , i} ^ {(t)} \sigma^ {\prime} (\langle \mathbf {w} _ {y _ {i}} ^ {(t)} , \pmb {\xi} _ {i} \rangle)}\right) \\ \geq \widetilde {\Theta} (s \sigma_ {p}) - \widetilde {\Theta} \bigg (\frac {n \lambda}{\ell_ {y _ {i} , i} ^ {(t)} \sigma_ {p}} \bigg), \\ \end{array} +$$ + +where the last inequality follows from Hypothesis (C.12) and (C.13). Further recall that $\lambda = o(\sigma_0^{q - 2}\sigma_p / n)$ , plugging the above inequality to (C.15) gives + +$$ +\begin{array}{l} \langle \mathbf {w} _ {y _ {i}, r} ^ {(t + 1)}, \boldsymbol {\xi} _ {i} \rangle \geq \langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \rangle + \widetilde {\Theta} (\eta s \sigma_ {p}) - \widetilde {\Theta} \left(\frac {\eta n \lambda}{\ell_ {y _ {i} , i} ^ {(t)} \sigma_ {p}}\right) - \widetilde {\Theta} (\eta^ {2} s ^ {2} \sigma_ {p} ^ {2}) \\ \geq \left\langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \right\rangle + \widetilde {\Theta} (\eta s \sigma_ {p}) - \Theta (\alpha \eta) - \widetilde {\Theta} \left(\frac {\eta \sigma_ {0} ^ {q - 2}}{\ell_ {y _ {i} , i} ^ {(t)}}\right). \tag {C.16} \\ \end{array} +$$ + +Then it is clear that $\langle \mathbf{w}_{y_i,r}^{(t)},\pmb {\xi}_i\rangle$ will increase by $\widetilde{\Theta} (\eta s\sigma_{p})$ if $\ell_{y_i,i}^{(t)}$ is larger than some constant of order $\widetilde{\Omega} (\frac{n\lambda}{s\sigma_p^2}) = \widetilde{\Omega} (\frac{\sigma_0^{q - 2}}{s\sigma_p})$ . We will first show that as soon as there is a iterate $\mathbf{W}^{(\tau)}$ satisfying $\ell_{y_i,i}^{(\tau)}\leq \widetilde{O}\left(\frac{n\lambda}{s\sigma_p^2}\right)$ for some $\tau \leq t$ , then it must hold that $\ell_{y_i,i}^{(\tau ')}$ will also be smaller than some constant in the order of $\widetilde{O}\left(\frac{n\lambda}{s\sigma_p^2}\right)$ for all $\tau^{\prime}\in [\tau ,t + 1]$ . To prove this, we first note that if $\ell_{y_i,i}^{(t)}$ reaches some constant in the order of $\widetilde{O}\left(\frac{n\lambda}{s\sigma_p^2}\right)$ , we have for all $r\in [m]$ by (C.16) + +$$ +\langle \mathbf {w} _ {y _ {i}, r} ^ {(t + 1)}, \boldsymbol {\xi} _ {i} \rangle \geq \langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \rangle + \widetilde {\Theta} (\eta s \sigma_ {p}), +$$ + +$$ +\langle \mathbf {w} _ {- y _ {i}, r} ^ {(t + 1)}, \boldsymbol {\xi} _ {i} \rangle \leq \langle \mathbf {w} _ {- y _ {i}, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \rangle + O (\alpha \eta), +$$ + +$$ +| \langle \mathbf {w} _ {j, r} ^ {(t + 1)}, \mathbf {v} \rangle | \leq | \langle \mathbf {w} _ {j, r} ^ {(t)}, \mathbf {v} \rangle | + O (\eta). \tag {C.17} +$$ + +Therefore, we have + +$$ +\begin{array}{l} \ell_ {y _ {i}, i} ^ {(t + 1)} = \frac {e ^ {F _ {- y _ {i}} (\mathbf {W} ^ {(t + 1)} , \mathbf {x} _ {i})}}{\sum_ {j \in \{- 1 , 1 \}} e ^ {F _ {j} (\mathbf {W} ^ {(t + 1)} , \mathbf {x} _ {i})}} \\ = \frac {1}{1 + \exp \left[ \right. \sum_ {r = 1} ^ {m} \left[ \sigma \left(\langle \mathbf {w} _ {y _ {i} , r} ^ {(t + 1)} , \mathbf {v} \rangle\right) + \sigma \left(\langle \mathbf {w} _ {y _ {i} , r} ^ {(t + 1)} , \boldsymbol {\xi} _ {i} \rangle\right) - \sigma \left(\langle \mathbf {w} _ {- y _ {i} , r} ^ {(t + 1)} , \mathbf {v} \rangle\right) - \sigma \left(\langle \mathbf {w} _ {- y _ {i} , r} ^ {(t + 1)} , \boldsymbol {\xi} _ {i} \rangle\right)\right]} \\ \leq \frac {1}{1 + \exp \left[ \sum_ {r = 1} ^ {m} \left[ \sigma (\langle \mathbf {w} _ {y _ {i} , r} ^ {(t)} , \mathbf {v} \rangle) + \sigma (\langle \mathbf {w} _ {y _ {i} , r} ^ {(t)} , \pmb {\xi} _ {i} \rangle) - \sigma (\langle \mathbf {w} _ {- y _ {i} , r} ^ {(t)} , \mathbf {v} \rangle) - \sigma (\langle \mathbf {w} _ {- y _ {i} , r} ^ {(t)} , \pmb {\xi} _ {i} \rangle) \right] + \widetilde {\Theta} (\eta s \sigma_ {p} ^ {2}) \right]} \\ \leq \frac {1}{1 + \exp \left[ \sum_ {r = 1} ^ {m} \left[ \sigma (\langle \mathbf {w} _ {y _ {i} , r} ^ {(t)} , \mathbf {v} \rangle) + \sigma (\langle \mathbf {w} _ {y _ {i} , r} ^ {(t)} , \pmb {\xi} _ {i} \rangle) \right] - \sigma (\langle \mathbf {w} _ {- y _ {i} , r} ^ {(t)} , \mathbf {v} \rangle) - \sigma (\langle \mathbf {w} _ {- y _ {i} , r} ^ {(t)} , \pmb {\xi} _ {i} \rangle) \right]} \\ = \ell_ {y _ {i}, i} ^ {(t)}, \\ \end{array} +$$ + +where inequality follows from (C.17). Therefore, this implies that as long as $\ell_{y_i,i}^{(t)}$ is larger than some constant $b = \widetilde{O}\left(\frac{n\lambda}{s\sigma_p^2}\right)$ , then the adam algorithm will prevent it from further increasing. Besides, since $m\eta \sigma_p^2 = o(1)$ , then we must have $\ell_{y_i,i}^{(t + 1)} \in [0.5\ell_{y_i,i}^{(t)}, 2\ell_{y_i,i}^{(t)}]$ . As a consequence, we can deduce that $\ell_{y_i,i}^{(t)}$ cannot be larger than $2b$ , since otherwise there must exist a iterate $\mathbf{W}^{(\tau)}$ with $\tau \leq t$ such that $\ell_{y_i,i}^{(\tau)} \in [b, 2b]$ and $\ell_{y_i,i}^{(\tau + 1)} \geq \ell_{y_i,i}^{(\tau)}$ , which contradicts the fact that $\ell_{y_i,i}^{(\tau)}$ should decrease if $\ell_{y_i,i}^{(\tau)} \geq b$ . Therefore, we can claim that if $\ell_{y_i,i}^{(\tau)} \leq b = \widetilde{O}\left(\frac{n\lambda}{s\sigma_p^2}\right)$ for some $\tau \leq t$ , then we have + +$$ +\ell_ {y _ {i}, i} ^ {\left(\tau^ {\prime}\right)} \leq \widetilde {O} \left(\frac {n \lambda}{s \sigma_ {p} ^ {2}}\right) \tag {C.18} +$$ + +for all $\tau' \in [\tau, t + 1]$ . Then further note that + +$$ +\begin{array}{l} 2 \ell_ {y _ {i}, i} ^ {(t + 1)} \geq \ell_ {y _ {i}, i} ^ {(t)} = \frac {e ^ {F _ {- y _ {i}} (\mathbf {W} ^ {(t)} , \mathbf {x} _ {i})}}{\sum_ {j \in \{- 1 , 1 \}} e ^ {F _ {j} (\mathbf {W} ^ {(t)} , \mathbf {x} _ {i})}} \\ \geq \exp \left(- \sum_ {r = 1} ^ {m} \left[ \sigma \left(\left\langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, y _ {i} \mathbf {v} \right\rangle\right) + \sigma \left(\left\langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \right\rangle\right) \right]\right) \\ \geq \exp \left(- \Theta \left(m \max _ {r \in [ m ]} \sigma \left(\left\langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \right\rangle\right)\right)\right), \tag {C.19} \\ \end{array} +$$ + +where in the last inequality we use Hypothesis (C.14). Then by the fact that $\ell_{y_i,i}^{(t + 1)}\leq \widetilde{O}\bigl (\frac{n\lambda}{s\sigma_p^2}\bigr) = o(1)$ and $m = \widetilde{\Theta} (1)$ , it is clear that $\exp \big(-\Theta \big(m\max_{r\in [m]}\sigma (\langle \mathbf{w}_{y_i,r}^{(t + 1)},\pmb {\xi}_i\rangle)\big)\big) = o(1)$ so that $\max_{r\in [m]}\langle \mathbf{w}_{y_i,r}^{(t + 1)},\pmb {\xi}_i\rangle = \widetilde{\Omega} (1)$ . This verifies Hypothesis (C.12). + +Verifying Hypothesis (C.13). Now we will verify Hypothesis (C.13). First, note that we have already shown that $\langle \mathbf{w}_{y_i,r^*}^{(t + 1)},\pmb {\xi}_i\rangle = \widetilde{\Omega} (1)$ so it holds that + +$$ +\sum_ {k \in \mathcal {B} _ {i}} | \mathbf {w} _ {y _ {i}, r ^ {*}} ^ {(t + 1)} [ k ] | \cdot | \boldsymbol {\xi} _ {i} [ k ] | + \alpha | \mathbf {w} _ {y _ {i}, r ^ {*}} ^ {(t + 1)} [ 1 ] | \geq \langle \mathbf {w} _ {y _ {i}, r ^ {*}} ^ {(t + 1)}, \boldsymbol {\xi} _ {i} \rangle = \widetilde {\Omega} (1). +$$ + +By Hypothesis (C.14), we have $|\mathbf{w}_{y_i,r^*}^{(t + 1)}[1]|\leq |\mathbf{w}_{y_i,r^*}^{(t)}[1]| + \eta = o(1)$ . Besides, since each coordinate in $\pmb{\xi}_i$ is a Gaussian random variable, then $\max_{k\in \mathcal{B}_i}|\pmb {\xi}_i[k]| = \widetilde{O} (\sigma_p)$ . This immediately implies that + +$$ +\sum_ {k \in \mathcal {B} _ {i}} | \mathbf {w} _ {y _ {i}, r ^ {*}} ^ {(t + 1)} [ k ] | \cdot | \boldsymbol {\xi} _ {i} [ k ] | = \widetilde {\Omega} (1). +$$ + +Then we will prove the upper bound of $\sum_{k\in \mathcal{B}_i}|\mathbf{w}_{y_i,r}^{(t + 1)}[k]|\cdot |\pmb {\xi}_i[k]|$ . Recall that by Lemma C.2, for any $k\in \mathcal{B}_i$ such that $\nabla_{\mathbf{w}_{y_i,r}}L(\mathbf{W}^{(t)})[k]\geq \widetilde{\Theta} (n^{-1}\eta s\sigma_p\ell_{y_i,i}^{(t)})$ , we have + +$$ +\mathbf {w} _ {y _ {i}, r} ^ {(t + 1)} [ k ] = \mathbf {w} _ {y _ {i}, r} ^ {(t)} [ k ] + \Theta (\eta) \cdot \mathrm {s g n} \bigg (\ell_ {y _ {i}, i} ^ {(t)} \sigma^ {\prime} (\langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, \pmb {\xi} _ {i} \rangle) \pmb {\xi} _ {i} [ k ] - n \lambda \mathbf {w} _ {y _ {i}, r} ^ {(t)} [ k ] \bigg). +$$ + +Note that by Lemma C.4, for every $k \in \mathcal{B}_i$ , we have either $\mathbf{w}_{y_i,r}^{(T_0)}[k] = \mathrm{sgn}(\pmb{\xi}_i[k]) \cdot \widetilde{\Theta}\left(\frac{1}{s\sigma_p}\right)$ or $|\mathbf{w}_{y_i,r}^{(T_0)}[k]| \leq \eta$ . Then during the training process after $T_0$ , we have either $\mathrm{sgn}(\mathbf{w}_{y_i,r}^{(t)}[k]) = \mathrm{sgn}(\pmb{\xi}_i[k])$ or $\mathrm{sgn}(\pmb{\xi}_i[k]) \cdot \mathbf{w}_{y_i,r}^{(t)} \geq -\widetilde{O}(\eta)$ since if for some iteration number $t'$ that we have $\mathrm{sgn}(\mathbf{w}_{y_i,r}^{(t')} [k]) = -\mathrm{sgn}(\pmb{\xi}_i[k])$ but $\mathrm{sgn}(\mathbf{w}_{y_i,r}^{(t' - 1)}[k]) = \mathrm{sgn}(\pmb{\xi}_i[k])$ , then after $\bar{\tau} = \widetilde{O}(1)$ steps (see the proof of Lemma C.2 for the definition of $\bar{\tau}$ ) in the constant number of steps the gradient will must be in the same direction of $\pmb{\xi}_i[k]$ , which will push $\mathbf{w}_{y_i,r}[k]$ back to zero or become positive along the direction of $\pmb{\xi}_i[k]$ . Therefore, based on this property we have the following regarding the inner product $\langle \mathbf{w}_{y_i,r}^{(t)}, \pmb{\xi}_i \rangle$ , + +$$ +\begin{array}{l} \left\langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \right\rangle = \sum_ {k \in \mathcal {B} _ {i} \cup \{1 \}} \mathbf {w} _ {y _ {i}, r} ^ {(t)} [ k ] \cdot \boldsymbol {\xi} _ {i} [ k ] \\ \geq \sum_ {k \in \mathcal {B} _ {i} \cup \{1 \}} | \mathbf {w} _ {y _ {i}, r} ^ {(t)} [ k ] | \cdot | \boldsymbol {\xi} _ {i} [ k ] | - \widetilde {O} (\eta) \cdot \sum_ {k \in \mathcal {B} _ {i} \cup \{1 \}} | \boldsymbol {\xi} _ {i} [ k ] | \\ = \sum_ {k \in \mathcal {B} _ {i} \cup \{1 \}} | \mathbf {w} _ {y _ {i}, r} ^ {(t)} [ k ] | \cdot | \boldsymbol {\xi} _ {i} [ k ] | - \widetilde {O} (\eta s \sigma_ {p}), \\ \end{array} +$$ + +where the second inequality follows from the fact that the entry $\mathbf{w}_{y_i,r}^{(t)}[k]$ that has different sign of $\pmb{\xi}_i[k]$ satisfies $|\mathbf{w}_{y_i,r}^{(t)}[k]|\leq \widetilde{O} (\eta)$ . Then let $B_{i}^{(t)} = \sum_{j\in \mathcal{B}_{i}\cup \{1\}}\left|\mathbf{w}_{y_i,r}^{(t)}[k]\cdot \mathbb{1}(|\mathbf{w}_{y_i,r}^{(t)}[k]|\geq \widetilde{O} (\eta))\right|$ $|\pmb {\xi}_i[k]|$ , which satisfies $B_{i}^{(T_{0})} = \widetilde{\Theta} (1)$ by Lemma C.4. Then assume $B_{i}^{(t)}$ keeps increasing and reaches some value in the order of $\Theta \bigl (\log (dn\eta^{-1})\bigr)$ , it holds that according to the inequality above + +$$ +\langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \rangle = \Theta \big (\log (d n \eta^ {- 1}) \big) - \widetilde {\Theta} (\eta s \sigma_ {p}) = \Theta \big (\log (d n \eta^ {- 1}) \big), +$$ + +where we use the condition that $\eta = O\big((s\sigma_p)^{-1}\big)$ . Then by Hypothesis (C.12) and (C.14) we know that $|\langle \mathbf{w}_{j,r}^{(t)},\mathbf{v}\rangle | = o(1),\langle \mathbf{w}_{y_i,r^*}^{(t)},\pmb {\xi}_i\rangle = \widetilde{\Omega} (1)$ , and $|\langle \mathbf{w}_{-y_i,r^*}^{(t)},\pmb {\xi}_i\rangle | = \widetilde{O} (d\eta) + \alpha |\langle \mathbf{w}_{-y_i,r^*}^{(t)},\mathbf{v}\rangle | = o(1)$ then similar to (C.19), it holds that + +$$ +\ell_ {y _ {i}, i} ^ {(t)} = \frac {e ^ {F _ {- y _ {i}} (\mathbf {W} ^ {(t)} , \mathbf {x} _ {i})}}{\sum_ {j \in \{- 1 , 1 \}} e ^ {F _ {j} (\mathbf {W} ^ {(t)} , \mathbf {x} _ {i})}} \leq \exp \big (- \Theta \big (\sigma (\langle \mathbf {w} _ {y _ {i}, r ^ {*}} ^ {(t)}, \pmb {\xi} _ {i} \rangle) \big) \big) \leq \mathrm {p o l y} (d ^ {- 1}, n ^ {- 1}, \eta). +$$ + +Therefore, at this time we have for all $k\in \mathcal{B}_i$ + +$$ +\ell_ {y _ {i}, i} ^ {(t)} \sigma \langle (\mathbf {w} _ {y _ {i}, r} ^ {(t)}, \pmb {\xi} _ {i}) \rangle \pmb {\xi} _ {i} [ k ] \leq \mathrm {p o l y} (d ^ {- 1}, n ^ {- 1}, \eta) \cdot \Theta \big (\log^ {q - 1} (d n \eta^ {- 1}) \big) \cdot \widetilde {\Theta} (\sigma_ {p}) \leq n \lambda \eta . +$$ + +Then for all $|\mathbf{w}_{y_i,r}^{(t)}[k]|\geq \widetilde{O} (\eta)$ , the sign of the gradient satisfies + +$$ +\begin{array}{l} \operatorname {s g n} \left(\nabla_ {\mathbf {w} _ {y _ {i}, r}} L (\mathbf {W} ^ {(t)}) [ k ]\right) = - \operatorname {s g n} \left(\ell_ {y _ {i}, i} ^ {(t)} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \right\rangle\right) \boldsymbol {\xi} _ {i} [ k ] - n \lambda \mathbf {w} _ {y _ {i}, r} ^ {(t)} [ k ]\right) \\ = \operatorname {s g n} (n \lambda \eta - \mathbf {w} _ {y i, r} ^ {(t)} [ k ]) \\ = \mathrm {s g n} (\mathbf {w} _ {y _ {i}, r} ^ {(t)} [ k ]). \\ \end{array} +$$ + +Then note that $|\nabla_{\mathbf{w}_{y_i,r}}L(\mathbf{W}^{(t)})[k]| = \Theta (|\lambda \mathbf{w}_{y_i,r}^{(t)}[k]|)\geq \Theta \big(n^{-1}\eta s\sigma_p\ell_{y_i,i}^{(t)} + \lambda \eta \big)$ , by the update rule of $\mathbf{w}_{y_i,r}^{(t)}[k]$ and Lemma C.2, we know the sign gradient will dominate the update process. Then we have $|\mathbf{w}_{y_i,r}^{(t + 1)}[k]| = |\mathbf{w}_{y_i,r}^{(t)}[k] - \Theta (\eta)\cdot \mathrm{sgn}(\mathbf{w}_{y_i,r}^{(t)}[k])|\leq |\mathbf{w}_{y_i,r}^{(t)}[k]|$ , which implies that $|\mathbf{w}_{y_i,r}^{(t)}[k]\cdot \mathbb{1}(|\mathbf{w}_{y_i,r}^{(t)}[k]|\geq \widetilde{O} (\eta))|$ decreases so that $B_{i}^{(t)}$ also decreases. Therefore, we can conclude that $B_{i}^{(t)}$ will not exceed $\Theta \big(\log (dn\eta^{-1})\big)$ . Then combining the results for all $i\in [n]$ gives + +$$ +\sum_ {k \in \mathcal {B} _ {i}} | \mathbf {w} _ {y _ {i}, r ^ {*}} ^ {(t)} [ k ] | \cdot | \boldsymbol {\xi} _ {i} [ k ] | \leq B _ {i} ^ {(t)} + \widetilde {O} (s \eta \sigma_ {p}) \leq \Theta (\log (d n \eta^ {- 1})) + O (1) = \widetilde {\Theta} (1), +$$ + +where in the first inequality we again use the condition that $\eta = o(1 / d) = o\big((s\sigma_p)^{-1}\big)$ . This verifies Hypothesis (C.13). Notably, this also implies that $\langle \mathbf{w}_{y_i,r^*}^{(t)},\pmb {\xi}_i\rangle = \max_{r\in [m]}\langle \mathbf{w}_{y_i,r}^{(t)},\pmb {\xi}_i\rangle \leq \widetilde{\Theta} (1)$ . + +Verifying Hypothesis (C.14). In order to verify Hypothesis (C.14), let us first recall the update rule of $\langle \mathbf{w}_{j,r}^{(t)},\mathbf{v}\rangle$ .. + +$$ +\langle \mathbf {w} _ {j, r} ^ {(t + 1)}, \mathbf {v} \rangle = \langle \mathbf {w} _ {j, r} ^ {(t)}, \mathbf {v} \rangle - \eta \left\langle \frac {\mathbf {m} _ {j , r} ^ {(t)}}{\sqrt {\mathbf {v} _ {j , r} ^ {(t)}}}, \mathbf {v} \right\rangle . +$$ + +Then by Lemma C.2, we know that if $|\nabla_{\mathbf{w}_{j,r}}L(\mathbf{W}^{(t)})[1]|\leq \widetilde{\Theta} (\eta)$ , then $|\mathbf{m}_{j,r}^{(t)} / \sqrt{\mathbf{v}_{j,r}^{(t)}} |\leq \Theta (1)$ and otherwise + +$$ +\left\langle \frac {\mathbf {m} _ {j , r} ^ {(t)}}{\sqrt {\mathbf {v} _ {j , r} ^ {(t)}}}, \mathbf {v} \right\rangle = - \mathrm {s g n} \bigg (\sum_ {i = 1} ^ {n} y _ {i} \ell_ {j, i} ^ {(t)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t)}, y _ {i} \mathbf {v} \rangle) - \alpha \sum_ {i = 1} ^ {n} y _ {i} \ell_ {j, i} ^ {(t)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t)}, \pmb {\xi} _ {i} \rangle) - n \lambda \mathbf {w} _ {j, r} ^ {(t)} [ 1 ] \bigg) \cdot \Theta (1). +$$ + +Without loss of generality we assume $j = 1$ , then by Lemma C.4 we know that $\mathbf{w}_{1,r}^{(T_0)}[1] = -\widetilde{\Omega}\left(\frac{1}{s\sigma_p}\right)$ . In the remaining proof, we will show that either $\mathbf{w}_{1,r}^{(t + 1)}[1] \in [0,\widetilde{\Theta} (\lambda^{-1}\eta)]$ or $\mathbf{w}_{1,r}^{(t + 1)}[1] \in [-\widetilde{O}\left(\frac{n\alpha}{s\sigma_p^2}\right),0)$ . + +First we will show that $\mathbf{w}_{1,r}^{(t + 1)}[1] \in [0, \widetilde{\Theta}(\lambda^{-1}\eta)]$ for all $r$ . Note that in the beginning of this stage, we have $\mathbf{w}_{1,r}^{(T_0)}[1] < 0$ . In order to make the sign of $\mathbf{w}_{1,r}^{(t')} [1]$ flip, we must have, in some iteration $t' \leq t$ that satisfies $\mathbf{w}_{1,r}^{(t')} [1] \in [0, \widetilde{\Theta}(\lambda^{-1}\eta)]$ , therefore + +$$ +\begin{array}{l} - n \nabla_ {\mathbf {w} _ {1, r}} L (\mathbf {W} ^ {(t ^ {\prime})}) [ 1 ] = \sum_ {i = 1} ^ {n} y _ {i} \ell_ {j, i} ^ {(t ^ {\prime})} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(t ^ {\prime})}, y _ {i} \mathbf {v} \right\rangle\right) - \alpha \sum_ {i = 1} ^ {n} y _ {i} \ell_ {j, i} ^ {(t ^ {\prime})} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(t ^ {\prime})}, \boldsymbol {\xi} _ {i} \right\rangle\right) - n \lambda \mathbf {w} _ {j, r} ^ {(t ^ {\prime})} [ 1 ] \\ \leq n \left[ \left(\mathbf {w} _ {j, r} ^ {(t ^ {\prime})} [ 1 ]\right) ^ {q - 2} - \lambda \right] \cdot \mathbf {w} _ {j, r} ^ {(t ^ {\prime})} [ 1 ] \leq - \widetilde {\Theta} (n \eta) \leq 0, \\ \end{array} +$$ + +where the second inequality holds since $\eta = o(\lambda^{(q - 1) / (q - 2)})$ . Note that $|\nabla_{\mathbf{w}_{1,r}}L(\mathbf{W}^{(t')})[1]|\geq$ $\widetilde{\Theta} (\eta)$ , then by Lemma C.2 we know that Adam is similar to sign gradient descent and thus $\mathbf{w}_{1,r}^{(t' + 1)}[1] = \mathbf{w}_{1,r}^{(t')}[1] - \Theta (\eta)$ which starts to decrease. This implies that if $\mathbf{w}_{1,r}^{(t + 1)}[1]$ is positive, then it cannot exceed $\widetilde{\Theta} (\lambda^{-1}\eta) = o(1)$ . + +Then we can prove that if $\mathbf{w}_{1,r}^{(t + 1)}[1]$ is negative, then $|\mathbf{w}_{1,r}^{(t + 1)}[1]| = \widetilde{O}\big(\frac{n\alpha}{s\sigma_p^2}\big)$ . In this case we have for all $t' \leq t$ + +$$ +\begin{array}{l} - n \nabla_ {\mathbf {w} _ {1, r} ^ {(t)}} L (\mathbf {W} ^ {(t ^ {\prime})}) [ 1 ] = \sum_ {i = 1} ^ {n} y _ {i} \ell_ {1, i} ^ {(t ^ {\prime})} \sigma^ {\prime} (\langle \mathbf {w} _ {1, r} ^ {(t ^ {\prime})}, y _ {i} \mathbf {v} \rangle) - \alpha \sum_ {i = 1} ^ {n} y _ {i} \ell_ {1, i} ^ {(t ^ {\prime})} \sigma^ {\prime} (\langle \mathbf {w} _ {1, r} ^ {(t ^ {\prime})}, \boldsymbol {\xi} _ {i} \rangle) - n \lambda \mathbf {w} _ {1, r} ^ {(t ^ {\prime})} [ 1 ] \\ \geq - \sum_ {i: y _ {i} = 1} | \ell_ {1, i} ^ {(t ^ {\prime})} | \cdot \widetilde {\Theta} (\alpha) + n \lambda | \mathbf {w} _ {1, r} ^ {(t ^ {\prime})} [ 1 ] | + \sum_ {i: y _ {i} = - 1} | \ell_ {1, i} ^ {(t ^ {\prime})} | \cdot | \mathbf {w} _ {1, r} ^ {(t ^ {\prime})} [ 1 ] | ^ {q - 1}, \\ \geq -\sum_ {i: y _ {i} = 1} \left| \ell_ {1, i} ^ {(t ^ {\prime})} \right| \cdot \widetilde {\Theta} (\alpha) + n \lambda \left| \mathbf {w} _ {1, r} ^ {(t ^ {\prime})} [ 1 ] \right|, \\ \end{array} +$$ + +where in the inequality we use Hypothesis (C.13) and (C.14) to get that + +$$ +\langle \mathbf {w} _ {y _ {i}, r} ^ {(t ^ {\prime})}, \boldsymbol {\xi} _ {i} \rangle \leq \sum_ {k \in \mathcal {B} _ {i}} | \mathbf {w} _ {y _ {i}, r} ^ {(t ^ {\prime})} [ k ] | \cdot \max _ {k \in \mathcal {B} _ {i}} | \boldsymbol {\xi} _ {i} [ k ] | + \alpha | \langle \mathbf {w} _ {y _ {i}, r} ^ {(t ^ {\prime})}, \mathbf {v} \rangle | = \widetilde {\Theta} (1). +$$ + +Recall from (C.18) that we have $|\ell_{j,i}^{(t^{\prime})}| = \widetilde{O}\left(\frac{n\lambda}{s\sigma_{p}^{2}}\right)$ , therefore we have if $\mathbf{w}_{j,r}^{(t^{\prime})}[1]$ is smaller than some value in the order of $-\widetilde{\Theta}\left(\frac{n\alpha}{s\sigma_{p}^{2}}\right) \cdot \mathrm{polylog}(d)$ , then + +$$ +- n \nabla_ {\mathbf {w} _ {1, r} ^ {(t)}} L (\mathbf {W} ^ {(t ^ {\prime})}) [ 1 ] \geq - \widetilde {\Theta} \left(\frac {\alpha n ^ {2} \lambda}{s \sigma_ {p} ^ {2}}\right) + \widetilde {\Theta} \left(\frac {n \lambda \cdot n \alpha}{s \sigma_ {p} ^ {2}}\right) \cdot \mathrm {p o l y l o g} (d) \geq \widetilde {\Theta} (n \eta), +$$ + +which by Lemma C.2 implies that $\mathbf{w}_{j,r}^{(t^{\prime})}[1]$ will increase. Therefore, we can conclude that $\mathbf{w}^{(t + 1)}\in$ $\left[-\widetilde{O}\left(\frac{n\alpha}{s\sigma_p^2}\right),0\right)$ in this case, which verifies Hypothesis (C.14). + +Lemma C.6 (Lemma 5.5, restated). If the step size satisfies $\eta = O(d^{-1/2})$ , then for any $t$ it holds that + +$$ +L (\mathbf {W} ^ {(t + 1)}) - L (\mathbf {W} ^ {(t)}) \leq - \eta \| \nabla L (\mathbf {W} ^ {(t)}) \| _ {1} + \widetilde {\Theta} (\eta^ {2} d). +$$ + +Proof. Let $\Delta F_{j,i} = F_{j}(\mathbf{W}^{(t + 1)},\mathbf{x}_{i}) - F_{j}(\mathbf{W}^{(t)},\mathbf{x}_{i})$ . Then regarding the loss function + +$$ +L _ {i} (\mathbf {W}) = - \log \frac {e ^ {F _ {y _ {i}} (\mathbf {W} , \mathbf {x} _ {i})}}{\sum_ {j} e ^ {F _ {j} (\mathbf {W} , \mathbf {x} _ {i})}} = - F _ {y _ {i}} (\mathbf {W}, \mathbf {x} _ {i}) + \log \left(\sum_ {j} e ^ {F _ {j} (\mathbf {W}, \mathbf {x} _ {i})}\right). +$$ + +It is clear that the function $L_{i}(\mathbf{W})$ is 1-smooth with respect to the vector $[F_{-1}(\mathbf{W},\mathbf{x}_i),F_1(\mathbf{W},\mathbf{x}_i)]$ . Then based on the definition of $\Delta F_{j,i}$ , we have + +$$ +L _ {i} \left(\mathbf {W} ^ {(t + 1)}\right) - L _ {i} \left(\mathbf {W} ^ {(t)}\right) \leq \sum_ {j} \frac {\partial L _ {i} \left(\mathbf {W} ^ {(t)}\right)}{\partial F _ {j} \left(\mathbf {W} ^ {(t)} , \mathbf {x} _ {i}\right)} \cdot \Delta F _ {j, i} + \sum_ {j} (\Delta F _ {j, i}) ^ {2}. \tag {C.20} +$$ + +Moreover, note that + +$$ +F _ {j} \left(\mathbf {W} ^ {(t)}, \mathbf {x} _ {i}\right) = \sum_ {r = 1} ^ {m} \left[ \sigma \left(\left\langle \mathbf {w} _ {j, r} ^ {(t)}, y _ {i} \mathbf {v} \right\rangle\right) + \sigma \left(\left\langle \mathbf {w} _ {j, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \right\rangle\right) \right]. +$$ + +By the results that $\langle \mathbf{w}_{j,r}^{(t)},\mathbf{v}\rangle \leq \widetilde{\Theta} (1)$ and $\langle \mathbf{w}_{j,r}^{(t)},\pmb {\xi}\rangle \leq \widetilde{\Theta} (1)$ , for any $\eta = O(d^{-1 / 2})$ , we have + +$$ +\langle \mathbf {w} _ {j, r} ^ {(t + 1)}, \mathbf {v} \rangle \leq \langle \mathbf {w} _ {j, r} ^ {(t)}, \mathbf {v} \rangle + \eta \leq \widetilde {\Theta} (1), \quad \langle \mathbf {w} _ {j, r} ^ {(t + 1)}, \boldsymbol {\xi} _ {i} \rangle \leq \langle \mathbf {w} _ {j, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \rangle + \widetilde {\Theta} (\eta s ^ {1 / 2}) \leq \widetilde {\Theta} (1), +$$ + +which implies that the smoothness parameter of the functions $\sigma (\langle \mathbf{w}_{j,r}^{(t)},y_i\mathbf{v}\rangle)$ and $\sigma (\langle \mathbf{w}_{j,r}^{(t)},\pmb {\xi}_i\rangle)$ are at most $\widetilde{\Theta} (1)$ for any $\mathbf{w}$ in the path between $\mathbf{w}_{j,r}^{(t)}$ and $\mathbf{w}_{j,r}^{(t + 1)}$ . Then we can apply first Taylor expansion on $\sigma (\langle \mathbf{w}_{j,r}^{(t)},y_i\mathbf{v}\rangle)$ and $\sigma (\langle \mathbf{w}_{j,r}^{(t)},\pmb {\xi}_i\rangle)$ and bound the second-order error as follows, + +$$ +\begin{array}{l} \left| \sigma (\langle \mathbf {w} _ {j, r} ^ {(t + 1)}, y _ {i} \mathbf {v} \rangle) - \sigma (\langle \mathbf {w} _ {j, r} ^ {(t)}, y _ {i} \mathbf {v} \rangle) - \left\langle \nabla_ {\mathbf {w} _ {j, r}} \sigma (\langle \mathbf {w} _ {j, r} ^ {(t)}, y _ {i} \mathbf {v} \rangle), \mathbf {w} _ {j, r} ^ {(t + 1)} - \mathbf {w} _ {j, r} ^ {(t)} \right\rangle \right| \\ \leq \widetilde {\Theta} \left(\left\| \mathbf {w} _ {j, r} ^ {(t + 1)} - \mathbf {w} _ {j, r} ^ {(t)} \right\| _ {2} ^ {2}\right) = \widetilde {\Theta} \left(\eta^ {2} d\right), \tag {C.21} \\ \end{array} +$$ + +where the last inequality is due to Lemma C.2 that + +$$ +[ \mathbf {w} _ {j, r} ^ {(t + 1)} - \mathbf {w} _ {j, r} ^ {(t)} ] ^ {2} = \eta^ {2} \left\| \frac {\mathbf {m} _ {j , r} ^ {(t)}}{\sqrt {\mathbf {v} _ {j , r} ^ {(t)}}} \right\| _ {2} ^ {2} \leq \Theta (\eta^ {2} d). +$$ + +Similarly, we can also show that + +$$ +\left| \sigma \left(\left\langle \mathbf {w} _ {j, r} ^ {(t + 1)}, \boldsymbol {\xi} _ {i} \right\rangle\right) - \sigma \left(\left\langle \mathbf {w} _ {j, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \right\rangle\right) - \left\langle \nabla_ {\mathbf {w} _ {j, r}} \sigma \left(\left\langle \mathbf {w} _ {j, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \right\rangle\right), \mathbf {w} _ {j, r} ^ {(t + 1)} - \mathbf {w} _ {j, r} ^ {(t)} \right\rangle \right| \leq \Theta \left(\eta^ {2} d\right). \tag {C.22} +$$ + +Combining the above bounds on the second-order errors, we have + +$$ +\left| \Delta F _ {j, i} - \langle \nabla_ {\mathbf {W}} F _ {j} \left(\mathbf {W} ^ {(t)}, \mathbf {x} _ {i}\right), \mathbf {W} ^ {(t + 1)} - \mathbf {W} ^ {(t)} \rangle \right| \leq \widetilde {\Theta} (m \eta^ {2} d) = \widetilde {\Theta} (\eta^ {2} d), \tag {C.23} +$$ + +where the last equation is due to our assumption that $m = \widetilde{\Theta}(1)$ . Besides, by (C.21) and (C.22) the convexity property of the function $\sigma(x)$ , we also have + +$$ +\begin{array}{l} \left| \sigma \left(\left\langle \mathbf {w} _ {j, r} ^ {(t + 1)}, y _ {i} \mathbf {v} \right\rangle\right) - \sigma \left(\left\langle \mathbf {w} _ {j, r} ^ {(t)}, y _ {i} \mathbf {v} \right\rangle\right) \right| \leq \left| \left\langle \nabla_ {\mathbf {w} _ {j, r}} \sigma \left(\left\langle \mathbf {w} _ {j, r} ^ {(t)}, y _ {i} \mathbf {v} \right\rangle\right), \mathbf {w} _ {j, r} ^ {(t + 1)} - \mathbf {w} _ {j, r} ^ {(t)} \right\rangle \right| + \widetilde {\Theta} (\eta^ {2} d) \\ = \widetilde {\Theta} \left(\eta \left| \sigma^ {\prime} \left(\langle \mathbf {w} _ {j, r} ^ {(t + 1)}, y _ {i} \mathbf {v} \rangle\right) \right| \cdot \| \mathbf {v} \| _ {1}\right) + \widetilde {\Theta} (\eta^ {2} d) \\ = \widetilde {\Theta} (\eta + \eta^ {2} d); \\ \end{array} +$$ + +$$ +\begin{array}{l} \left| \sigma \left(\left\langle \mathbf {w} _ {j, r} ^ {(t + 1)}, \boldsymbol {\xi} _ {i} \right\rangle\right) - \sigma \left(\left\langle \mathbf {w} _ {j, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \right\rangle\right) \right| \leq \left| \left\langle \nabla_ {\mathbf {w} _ {j, r}} \sigma \left(\left\langle \mathbf {w} _ {j, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \right\rangle\right), \mathbf {w} _ {j, r} ^ {(t + 1)} - \mathbf {w} _ {j, r} ^ {(t)} \right\rangle \right| + \widetilde {\Theta} (\eta^ {2} d) \\ = \widetilde {\Theta} \left(\eta \left| \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(t + 1)}, \boldsymbol {\xi} _ {i} \right\rangle\right) \right| \cdot \| \boldsymbol {\xi} \| _ {1}\right) + \widetilde {\Theta} \left(\eta^ {2} d\right) \\ = \widetilde {\Theta} (\eta s \sigma_ {p} + \eta^ {2} d). \\ \end{array} +$$ + +These bounds further imply that + +$$ +\left| \Delta F _ {j, i} \right| \leq \widetilde {\Theta} \left(m \cdot \left(\eta s \sigma_ {p} + \eta^ {2} d\right)\right) = \widetilde {\Theta} \left(\eta s \sigma_ {p} + \eta^ {2} d\right). \tag {C.24} +$$ + +Now we can plug (C.23) and (C.24) into (C.20) and get + +$$ +\begin{array}{l} L _ {i} \left(\mathbf {W} ^ {(t + 1)}\right) - L _ {i} \left(\mathbf {W} ^ {(t)}\right) \leq \sum_ {j} \frac {\partial L _ {i} \left(\mathbf {W} ^ {(t)}\right)}{\partial F _ {j} \left(\mathbf {W} ^ {(t)} , \mathbf {x} _ {i}\right)} \cdot \Delta F _ {j, i} + \sum_ {j} \left(\Delta F _ {j, i}\right) ^ {2} \\ \leq \sum_ {j} \frac {\partial L _ {i} \left(\mathbf {W} ^ {(t)}\right)}{\partial F _ {j} \left(\mathbf {W} ^ {(t)} , \mathbf {x} _ {i}\right)} \cdot \langle \nabla_ {\mathbf {W}} F _ {j} \left(\mathbf {W} ^ {(t)}, \mathbf {x} _ {i}\right), \mathbf {W} ^ {(t + 1)} - \mathbf {W} ^ {(t)} \rangle \\ + \widetilde {\Theta} (\eta^ {2} d) + \widetilde {\Theta} \big ((\eta s \sigma_ {p} + \eta^ {2} d) ^ {2} \big) \\ = \left\langle \nabla L _ {i} \left(\mathbf {W} ^ {(t)}\right), \mathbf {W} ^ {(t + 1)} - \mathbf {W} ^ {(t)} \right\rangle + \widetilde {\Theta} \left(\eta^ {2} d\right), \tag {C.25} \\ \end{array} +$$ + +where in the second inequality we use the fact that $L_{i}(\mathbf{W})$ is 1-Lipschitz with respect to $F_{j}(\mathbf{W},\mathbf{x}_{i})$ and the last equation is due to our assumption that $\sigma_{p} = O(s^{-1 / 2})$ so that $\widetilde{\Theta} ((\eta s\sigma_{p} + \eta^{2}d)^{2}) = \widetilde{O} (\eta^{2}d)$ . + +Now we are ready to characterize the behavior on the entire training objective $L(\mathbf{W}) = n^{-1}\sum_{i=1}^{n}L_{i}(\mathbf{W}) + \lambda\|\mathbf{W}\|_{F}^{2}$ . Note that $\lambda\|\mathbf{W}\|_{F}^{2}$ is $2\lambda$ -smoothness, where $\lambda = o(1)$ . Then applying (C.25) for all $i \in [n]$ gives + +$$ +\begin{array}{l} L \left(\mathbf {W} ^ {(t + 1)}\right) - L \left(\mathbf {W} ^ {(t)}\right) = \frac {1}{n} \sum_ {i = 1} ^ {n} \left[ L _ {i} \left(\mathbf {W} ^ {(t + 1)}\right) - L _ {i} \left(\mathbf {W} ^ {(t)}\right) \right] + \lambda \left(\| \mathbf {W} ^ {(t + 1)} \| _ {F} ^ {2} - \| \mathbf {W} ^ {(t)} \| _ {F} ^ {2}\right) \\ \leq \langle \nabla L (\mathbf {W} ^ {(t)}), \mathbf {W} ^ {(t + 1)} - \mathbf {W} ^ {(t)} \rangle + \widetilde {\Theta} (\eta^ {2} d), \\ \end{array} +$$ + +where the second equation uses the fact that $\| \mathbf{W}^{(t + 1)} - \mathbf{W}^{(t)}\| _F^2 = \widetilde{\Theta} (\eta^2 d)$ . Recall that we have + +$$ +\mathbf {w} _ {j, r} ^ {(t + 1)} - \mathbf {w} _ {j, r} ^ {(t)} = - \eta \cdot \frac {\mathbf {m} _ {j , r} ^ {(t)}}{\sqrt {\mathbf {v} _ {j , r} ^ {(t)}}}. +$$ + +Then by Lemma C.2, we know that $\mathbf{m}_{j,r}^{(t)}[k] / \sqrt{\mathbf{v}_{j,r}^{(t)}} [k]$ is close to sign gradient if $\nabla L(\mathbf{w}^{(t)})[k]$ is large. Then we have + +$$ +\begin{array}{l} \left\langle \nabla_ {\mathbf {w} _ {j, r}} L (\mathbf {W} ^ {(t)}), \frac {\mathbf {m} _ {j , r} ^ {(t)}}{\sqrt {\mathbf {v} _ {j , r} ^ {(t)}}} \right\rangle \geq \Theta \big (\| \nabla_ {\mathbf {w} _ {j, r}} L (\mathbf {W} ^ {(t)}) \| _ {1} \big) - \widetilde {\Theta} \big (d \cdot \eta \big) - \widetilde {\Theta} (n s \cdot \eta s \sigma_ {p}) \\ \geq \Theta \big (\left\| \nabla_ {\mathbf {w} _ {j, r}} L \left(\mathbf {W} ^ {(t)}\right) \right\| _ {1} \big) - \widetilde {\Theta} (d \eta), \\ \end{array} +$$ + +where the second and last terms on the R.H.S. of the first inequality are contributed by the small gradient coordinates $k \notin \cup_{i=1}^{n} \mathcal{B}_{i}$ and $k \in \cup_{i=1}^{n} \mathcal{B}_{i}$ respectively, and the last inequality is by the fact that $ns^{2}\sigma_{p} = O(d)$ . Therefore, based on this fact (C.25) further leads to + +$$ +L \left(\mathbf {W} ^ {(t + 1)}\right) - L \left(\mathbf {W} ^ {(t)}\right) \leq - \eta \| \nabla L \left(\mathbf {W} ^ {(t)}\right) \| _ {1} + \widetilde {\Theta} (\eta^ {2} d), +$$ + +which completes the proof. + +![](images/bfebaabb8081be187ca3455af5a2d1d884c43faf13e152d5e1cb1bc608dc3548.jpg) + +Lemma C.7 (Generalization Performance of Adam). Let + +$$ +\mathbf{W}^{*} = \operatorname *{argmin}_{\mathbf{W}\in \{\mathbf{W}^{(1)},\ldots ,\mathbf{W}^{(T)}\}}\| \nabla L(\mathbf{W})\|_{1}. +$$ + +Then for all training data, we have + +$$ +\frac {1}{n} \sum_ {i = 1} ^ {n} \mathbb {1} \left[ F _ {y _ {i}} \left(\mathbf {W} ^ {*}, \mathbf {x} _ {i}\right) \leq F _ {- y _ {i}} \left(\mathbf {W} ^ {*}, \mathbf {x} _ {i}\right) \right] = 0. +$$ + +Moreover, in terms of the test data $(\mathbf{x},y)\sim \mathcal{D}$ , we have + +$$ +\mathbb {P} _ {(\mathbf {x}, y) \sim \mathcal {D}} \big [ F _ {y} (\mathbf {W} ^ {*}, \mathbf {x}) \leq F _ {- y} (\mathbf {W} ^ {*}, \mathbf {x}) \big ] \geq \frac {1}{2}. +$$ + +Proof. By Lemma C.6, we know that the algorithm will converge to a point with very small gradient (up to $O(\eta d)$ in $\ell_1$ norm). Then in terms of a noise vector $\pmb{\xi}_i$ , we have + +$$ +\sum_ {k \in \mathcal {B} _ {i}} \left| \nabla_ {\mathbf {w} _ {y _ {i}, r}} L (\mathbf {W} ^ {*}) [ k ] \right| \leq O (\eta d). \tag {C.26} +$$ + +Note that + +$$ +n \nabla_ {\mathbf {w} _ {y _ {i}, r}} L (\mathbf {W} ^ {*}) [ k ] = \ell_ {y _ {i}, i} ^ {*} \sigma^ {\prime} (\langle \mathbf {w} _ {y _ {i}, r} ^ {*}, \pmb {\xi} _ {i} \rangle) \pmb {\xi} _ {i} [ k ] - n \lambda \mathbf {w} _ {y _ {i}, r} ^ {*} [ k ], +$$ + +where $\ell_{y_i,i}^* = 1 - \mathrm{logit}_{y_i}(F^*,\mathbf{x}_i)$ . Then by triangle inequality and (C.26), we have for any $r\in [m]$ + +$$ +\left| \sum_ {k \in \mathcal {B} _ {i}} | \ell_ {y _ {i}, i} ^ {*} | \sigma^ {\prime} (\langle \mathbf {w} _ {y _ {i}, r} ^ {*}, \boldsymbol {\xi} _ {i} \rangle) | \boldsymbol {\xi} _ {i} [ k ] | - n \lambda \sum_ {k \in \mathcal {B} _ {i}} | \mathbf {w} _ {y _ {i}, r} ^ {*} [ k ] | \right| \leq n \sum_ {k \in \mathcal {B} _ {i}} \left| \nabla_ {\mathbf {w} _ {y _ {i}, r}} L (\mathbf {W} ^ {*}) [ k ] \right| \leq O (n \eta d). +$$ + +Then by Lemma C.5, let $r^* = \arg \max_{r \in [m]} \langle \mathbf{w}_{y_i, r}^*, \pmb{\xi}_i \rangle$ , we have $\langle \mathbf{w}_{y_i, r^*}, \pmb{\xi}_i \rangle = \widetilde{\Theta}(1)$ and $\sum_{k \in \mathcal{B}_i} |\mathbf{w}_{y_i, r^*}^*[k]| \cdot |\pmb{\xi}_i[k]| = \widetilde{\Theta}(1)$ . Note that $|\pmb{\xi}_i[k]| = \widetilde{O}(\sigma_p)$ , we have $\sum_{k \in \mathcal{B}_i} |\mathbf{w}_{y_i, r^*}^*[k]| \geq \widetilde{\Theta}(1 / \sigma_p)$ . Then according to the inequality above, it holds that + +$$ +\left| \ell_ {y _ {i}, i} ^ {*} \right| \cdot \widetilde {\Theta} (s \sigma_ {p}) \geq \widetilde {\Theta} \left(n \lambda \sum_ {k \in \mathcal {B} _ {i}} \left| \mathbf {w} _ {y _ {i}, r} ^ {*} [ k ] \right| - n \eta d\right) \geq \widetilde {\Theta} \left(\frac {n \lambda}{\sigma_ {p}}\right), +$$ + +where the second inequality is due to our choice of $\eta$ . This further implies that $|\ell_{y_i,i}^*| = |\ell_{-y_i,i}^*| = \widetilde{\Theta}\left(\frac{n\lambda}{s\sigma_p^2}\right)$ by combining the above results with (C.18). Then let us move to the gradient with respect to the first coordinate. In particular, since $\| \nabla L(\mathbf{W}^{*})\|_{1}\leq O(\eta d)$ , we have + +$$ +\begin{array}{l} | n \nabla_ {\mathbf {w} _ {j, r}} L (\mathbf {W} ^ {*}) [ 1 ] | = \left| \sum_ {i = 1} ^ {n} y _ {i} \ell_ {j, i} ^ {*} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {*}, y _ {i} \mathbf {v} \right\rangle\right) - \alpha \sum_ {i = 1} ^ {n} y _ {i} \ell_ {j, i} ^ {*} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {*}, \boldsymbol {\xi} _ {i} \right\rangle\right) - n \lambda \mathbf {w} _ {j, r} ^ {*} [ 1 ] \right| \\ \leq O (n \eta d). \tag {C.27} \\ \end{array} +$$ + +Then note that $\mathrm{sgn}(y_i\ell_{j,i}^*) = \mathrm{sgn}(j)$ , it is clear that $\mathbf{w}_{j,r^*}^*[1] \cdot j \leq 0$ since otherwise + +$$ +| n \nabla_ {\mathbf {w} _ {j, r ^ {*}}} L (\mathbf {W} ^ {*}) [ 1 ] | \geq \left| \alpha \sum_ {i = 1} ^ {n} y _ {i} \ell_ {j, i} ^ {*} \left[ \sigma^ {\prime} (\langle \mathbf {w} _ {j, r ^ {*}} ^ {*}, \pmb {\xi} _ {i} \rangle) - \sigma^ {\prime} (\langle \mathbf {w} _ {j, r ^ {*}} ^ {*}, y _ {i} \mathbf {v} \rangle) \right] \right| \geq \widetilde {\Theta} \left(\frac {\alpha n ^ {2} \lambda}{s \sigma_ {p} ^ {2}}\right) \geq \widetilde {\Omega} (n \eta d), +$$ + +which contradicts (C.27). Therefore, using the fact that $\mathbf{w}_{j,r^*}^*[1] \cdot j \leq 0$ , we have + +$$ +| n \nabla_ {\mathbf {W} _ {j, r ^ {*}}} L (\mathbf {W} ^ {*}) [ 1 ] | = \left| \alpha \sum_ {i: y _ {i} = j} ^ {n} y _ {i} \ell_ {j, i} ^ {*} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r ^ {*}} ^ {*}, \boldsymbol {\xi} _ {i} \rangle) - \sum_ {i: y _ {i} = - j} ^ {n} y _ {i} \ell_ {j, i} ^ {*} \sigma^ {\prime} (| \mathbf {w} _ {j, r ^ {*}} ^ {*} [ 1 ] |) \right] - n \lambda | \mathbf {w} _ {j, r ^ {*}} ^ {*} [ 1 ] |. +$$ + +Then applying (C.27) and using the fact that $|\ell_{y_i,i}^*| = |\ell_{-y_i,i}^*| = \widetilde{\Theta}\left(\frac{n\lambda}{s\sigma_p^2}\right)$ for all $i \in [n]$ , it is clear that + +$$ +| \mathbf {w} _ {j, r ^ {*}} ^ {*} [ 1 ] | \geq \widetilde {\Theta} \left(\alpha^ {1 / (q - 1)} \wedge \frac {n \alpha}{s \sigma_ {p} ^ {2}}\right) \geq \widetilde {\Theta} \left(\frac {n \alpha}{s \sigma_ {p} ^ {2}}\right), +$$ + +where the second equality is due to our choice of $\sigma_{p}$ and $\alpha$ . Then combining with Lemma C.5 and the fact that $\mathbf{w}_{j,r^{*}}^{*}[1]\cdot j < 0$ , we have + +$$ +\mathbf {w} _ {j, r ^ {*}} ^ {*} [ 1 ] \cdot j \leq - \widetilde {\Theta} \left(\frac {n \alpha}{s \sigma_ {p} ^ {2}}\right). +$$ + +Now we are ready to evaluate the training error and test error. In terms of training error, it is clear that by Lemma C.5, we have $\langle \mathbf{w}_{y_i,r^*}^*,\pmb {\xi}_i\rangle \geq \widetilde{\Theta} (1),\langle \mathbf{w}_{y_i,r}^*,\pmb {\xi}_i\rangle \geq -o(1)$ , and $|\langle \mathbf{w}_{y_i,r}^*,\mathbf{v}\rangle | = o(1)$ $|\langle \mathbf{w}_{-y_i,r}^*,\pmb {\xi}_i\rangle | = o(1)$ . Then we have for any training data $(\mathbf{x}_i,y_i)$ + +$$ +F _ {y _ {i}} \left(\mathbf {W} ^ {*}, \mathbf {x} _ {i}\right) = \sum_ {r = 1} ^ {m} \left[ \sigma \left(\left\langle \mathbf {w} _ {y _ {i}, r} ^ {*}, y _ {i} \mathbf {v} \right\rangle\right) + \sigma \left(\left\langle \mathbf {w} _ {y _ {i}, r} ^ {*}, \boldsymbol {\xi} _ {i} \right\rangle\right) \right] = \widetilde {\Theta} (1), +$$ + +$$ +F _ {- y _ {i}} \left(\mathbf {W} ^ {*}, \mathbf {x} _ {i}\right) = \sum_ {r = 1} ^ {m} \left[ \sigma \left(\left\langle \mathbf {w} _ {- y _ {i}, r} ^ {*}, - y _ {i} \mathbf {v} \right\rangle\right) + \sigma \left(\left\langle \mathbf {w} _ {- y _ {i}, r} ^ {*}, \boldsymbol {\xi} _ {i} \right\rangle\right) \right] = o (1), +$$ + +which directly implies that the NN model $\mathbf{W}^*$ can correctly classify all training data and thus achieve zero training error. + +In terms of the test data $(\mathbf{x},y)$ where $\mathbf{x} = [y\mathbf{v},\boldsymbol {\xi}]$ , which is generated according to Definition 3.1. Note that for each neural, its weight $\mathbf{w}_{j,r}^{*}$ can be decomposed into two parts: the first coordinate and the rest $d - 1$ coordinates. As previously discussed, for any $j\in [2]$ and $r = r^*$ , we have $\mathrm{sgn}(j)\cdot \mathbf{w}_{j,r}^{*}[1]\leq -\widetilde{\Theta}\big(n\alpha /(s\sigma_p^2)\big)$ and $\mathrm{sgn}(j)\cdot \mathbf{w}_{j,r}^{*}[1]\leq \widetilde{\Theta} (\lambda^{-1}\eta)$ for $r\neq r^{*}$ . Therefore, using the fact that $\widetilde{\Theta}\big(n\alpha /(s\sigma_p^2)\big) = \omega (\lambda^{-1}\eta)$ and Lemma C.5, given the test data $(\mathbf{x},y)$ , we have + +$$ +\begin{array}{l} F _ {y} \left(\mathbf {W} ^ {*}, \mathbf {x}\right) = \sum_ {r = 1} ^ {m} \left[ \sigma \left(\left\langle \mathbf {w} _ {y, r} ^ {*}, y \mathbf {v} \right\rangle\right) + \sigma \left(\left\langle \mathbf {w} _ {y, r} ^ {*}, \boldsymbol {\xi} \right\rangle\right) \right] \\ \leq \sum_ {r = 1} ^ {m} \widetilde {\Theta} \left(\left[ \alpha \cdot \frac {n \alpha}{s \sigma_ {p} ^ {2}} + \zeta_ {y, r} \right] _ {+} ^ {q}\right), \\ F _ {- y} \left(\mathbf {W} ^ {*}, \mathbf {x}\right)) = \sum_ {r = 1} ^ {m} \left[ \sigma \left(\left\langle \mathbf {w} _ {- y, r} ^ {*}, y \mathbf {v} \right\rangle\right) + \sigma \left(\left\langle \mathbf {w} _ {- y, r} ^ {*}, \boldsymbol {\xi} \right\rangle\right) \right] \\ \geq \widetilde {\Theta} \big [ | \mathbf {w} _ {- y, r ^ {*}} ^ {*} [ 1 ] | ^ {q} + [ \zeta_ {- y, r ^ {*}} ] _ {+} ^ {q} \big ] \\ \geq \Theta \left(\left[ \frac {n \alpha}{s \sigma_ {p} ^ {2}} \right] _ {+} ^ {q} + [ \zeta_ {- y, r ^ {*}} ] _ {+} ^ {q}\right), \\ \end{array} +$$ + +where the random variables $\zeta_{y,r}$ and $\zeta_{y,r}$ are symmetric and independent of $\mathbf{v}$ . Besides, note that $\alpha = o(1)$ , it can be clearly shown that $\alpha \cdot n\alpha / (s\sigma_p^2) \ll n\alpha / (s\sigma_p^2)$ . Therefore, if the random noise $\zeta_{y,r}$ and $\zeta_{-y,r}$ are dominated by the feature noise term $\langle \mathbf{w}_{-y,r^*}^*, y\mathbf{v} \rangle$ , we can directly get that $F_y(\mathbf{W}^*, \mathbf{x}) \leq F_{-y}(\mathbf{W}^*, \mathbf{x})$ (recall that $m = \widetilde{\Theta}(1)$ ), which implies that the model has been biased by the feature noise and the true feature vector in the test dataset will not give any "positive" effect to the classification. Also note that $\zeta_y$ and $\zeta_{-y}$ are also independent of $\mathbf{v}$ , which implies that if the random noise dominates the feature noise term, the model $\mathbf{W}^*$ will give at least 0.5 error on test data. In sum, we can conclude that with probability at least $1/2$ it holds that $F_y(\mathbf{W}^*, \mathbf{x}) \leq F_{-y}(\mathbf{W}^*, \mathbf{x})$ , which implies that the output of Adam achieves $1/2$ test error. + +# C.3 PROOF FOR GRADIENT DESCENT + +Recall the feature learning and noise memorization of gradient descent can be formulated by + +$$ +\begin{array}{l} \langle \mathbf {w} _ {j, r} ^ {(t + 1)}, j \cdot \mathbf {v} \rangle = (1 - \eta \lambda) \cdot \langle \mathbf {w} _ {j, r} ^ {(t)}, j \cdot \mathbf {v} \rangle \\ + \frac {\eta}{n} \cdot j \cdot \left(\sum_ {i = 1} ^ {n} y _ {i} \ell_ {j, i} ^ {(t)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t)}, y _ {i} \mathbf {v} \rangle) - \alpha \sum_ {i = 1} ^ {n} y _ {i} \ell_ {j, i} ^ {(t)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t)}, \pmb {\xi} _ {i} \rangle)\right), \\ \end{array} +$$ + +$$ +\begin{array}{l} \langle \mathbf {w} _ {y _ {i}, r} ^ {(t + 1)}, \pmb {\xi} _ {i} \rangle = (1 - \eta \lambda) \cdot \langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, \pmb {\xi} _ {i} \rangle + \frac {\eta}{n} \cdot \sum_ {k \in \mathcal {B} _ {i}} \ell_ {y _ {i}, i} ^ {(t)} \sigma^ {\prime} (\langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, \pmb {\xi} _ {i} \rangle) \cdot \pmb {\xi} _ {i} [ k ] ^ {2} \\ + \frac {\eta \alpha}{n} \cdot \left(\alpha \sum_ {s = 1} ^ {n} \ell_ {y _ {i}, s} ^ {(t)} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, \boldsymbol {\xi} _ {s} \right\rangle\right) - \sum_ {s = 1} ^ {n} y _ {s} \ell_ {y _ {i}, s} ^ {(t)} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {y _ {i}, r} ^ {(t)}, y _ {s} \mathbf {v} \right\rangle\right)\right). \tag {C.28} \\ \end{array} +$$ + +Then similar to the analysis for Adam, we decompose the gradient descent process into multiple stages and characterize the algorithmic behaviors separately. The following lemma characterizes the first training stage, i.e., the stage where all outputs $F_{j}(\mathbf{W}^{(t)},\mathbf{x}_{i})$ remain in the constant level for all $j$ and $i$ . + +Lemma C.8. [Lemma 5.6, restated] Suppose the training data is generated according to Definition 3.1 and $\lambda = o(\sigma_0^{q - 2}\sigma_p / n)$ . Let $\Lambda_j^{(t)} = \max_{r\in [m]}\langle \mathbf{w}_{j,r}^{(t + 1)},j\cdot \mathbf{v}\rangle ,\Gamma_{j,i}^{(t)} = \max_{r\in [m]}\langle \mathbf{w}_{j,r}^{(t)},\pmb {\xi}_i\rangle$ and $\Gamma_j^{(t)} = \max_{i:y_i = j}\Gamma_{j,i}^{(t)}$ . Then let $T_{j}$ be the iteration number that $\Lambda_j^{(t)}$ reaches $\Theta (1 / m)$ , we have + +$$ +T _ {j} = \widetilde {\Theta} \left(\sigma_ {0} ^ {2 - q} / \eta\right) \quad \text {f o r a l l} j \in \{- 1, 1 \}. +$$ + +Moreover, let $T_0 = \min_{j \in \{\pm 1\}} \{T_j\}$ , then for all $t \leq T_0$ it holds that $\Gamma_j^{(t)} = \widetilde{O}(\sigma_0)$ for all $j \in \{-1, 1\}$ . + +We first provide the following useful lemma. + +Lemma C.9. Let $\{x_{t},y_{t}\}_{t = 1,\ldots}$ be two positive sequences that satisfy + +$$ +x _ {t + 1} \geq x _ {t} + \eta \cdot A x _ {t} ^ {q - 1}, +$$ + +$$ +y _ {t + 1} \leq y _ {t} + \eta \cdot B y _ {t} ^ {q - 1}, +$$ + +for some $A = \Theta(1)$ and $B = o(1)$ . Then for any $q \geq 3$ and suppose $y_0 = O(x_0)$ and $\eta < O(x_0)$ , we have for every $C \in [x_0, O(1)]$ , let $T_x$ be the first iteration such that $x_t \geq C$ , then we have $T_x\eta = \Theta(x_0^{2 - q})$ and + +$$ +y _ {T _ {x}} \leq O (x _ {0}). +$$ + +Proof. By Claim C.20 in Allen-Zhu & Li (2020b), we have $T_x \eta = \Theta(x_0^{2 - q})$ . Then we will show + +$$ +y _ {t} \leq 2 x _ {0} +$$ + +for all $t \leq T_x$ . In particular, let $T_x\eta = C'x_0^{2 - q}$ for some absolute constant $C'$ and assume $C'B2^{q - 1} < 1$ (this is true since $B = o(1)$ ), we first made the following induction hypothesis on $y_t$ for all $t \leq T_a$ , + +$$ +y _ {t} \leq y _ {0} + t \eta B ^ {\prime} (2 x _ {0}) ^ {q - 1}. +$$ + +Note that for any $t \leq T_0$ , this hypothesis clearly implies that + +$$ +y _ {t} \leq y _ {0} + T _ {x} \eta B ^ {\prime} 2 ^ {q - 1} x _ {0} ^ {q - 1} \leq x _ {0} + C B 2 ^ {q - 1} x _ {0} ^ {2 - q} \cdot x _ {0} ^ {q - 1} \leq 2 x _ {0}. +$$ + +Then we are able to verify the hypothesis at time $t + 1$ based on the recursive upper bound of $y_{t}$ , i.e., + +$$ +\begin{array}{l} y _ {t + 1} \leq y _ {t} + \eta \cdot B y _ {t} ^ {q - 1} \\ \leq y _ {0} + t \eta B (2 x _ {0}) ^ {q - 1} + \eta \cdot B y _ {t} ^ {q - 1} \\ \leq y _ {0} + (t + 1) \eta B \left(2 x _ {0}\right) ^ {q - 1}. \\ \end{array} +$$ + +Therefore, we can conclude that $y_{t} \leq 2x_{0}$ for all $t \leq T_{x}$ . This completes the proof. + +![](images/fe9b7d45595925dc1e00e80fb744bf90c18361e74cbf34e552e61182379b695a.jpg) + +Now we are ready to complete the proof of Lemma C.8. + +Proof of Lemma C.8. Note that at the initialization, we have $|\langle \mathbf{w}_{j,r}^{(0)},\mathbf{v}\rangle | = \widetilde{\Theta} (\sigma_0)$ and $|\langle \mathbf{w}_{j,r}^{(0)},\pmb {\xi}_i\rangle | =$ $\widetilde{\Theta} (s^{1 / 2}\sigma_p\sigma_0)$ . Then based on the parameter scaling summarized in Appendix C.1, we have + +$$ +F _ {j} \left(\mathbf {W} ^ {(0)}, \mathbf {x} _ {i}\right) = \sum_ {r = 1} ^ {m} \left[ \sigma \left(\left\langle \mathbf {w} _ {j, r} ^ {(0)}, y _ {i} \mathbf {v} \right\rangle\right) + \sigma \left(\left\langle \mathbf {w} _ {j, r} ^ {(0)}, \boldsymbol {\xi} _ {i} \right\rangle\right) \right] = o (1) +$$ + +for all $j\in \{-1,1\}$ . Then we have + +$$ +| \ell_ {j, i} ^ {(0)} | \geq \min \left\{\frac {e ^ {F _ {j} (\mathbf {W} ^ {(0)} , \mathbf {x} _ {i})}}{\sum_ {j} e ^ {F _ {+ 1} (\mathbf {W} ^ {(0)} , \mathbf {x} _ {i})}}, \frac {e ^ {F _ {- 1} (\mathbf {W} ^ {(0)} , \mathbf {x} _ {i})}}{\sum_ {j} e ^ {F _ {j} (\mathbf {W} ^ {(0)} , \mathbf {x} _ {i})}} \right\} = \Theta (1). +$$ + +Then we will consider the training period where $|\ell_{j,i}^{(t)}| = \Theta (1)$ for all $j,i$ , and $t$ . Besides, note that $\operatorname{sgn}(y_i\ell_{j,i}^{(t)}) = j$ . Therefore, let $r^* = \arg \max_r\langle \mathbf{w}_{j,r}^{(t - 1)},j\cdot \mathbf{v}\rangle$ , (C.28) implies that + +$$ +\begin{array}{l} \Lambda_ {j} ^ {(t)} = \left\langle \mathbf {w} _ {j, r ^ {*}} ^ {(t - 1)}, j \cdot \mathbf {v} \right\rangle \\ = (1 - \eta \lambda) \cdot \left\langle \mathbf {w} _ {j, r ^ {*}} ^ {(t - 1)}, j \cdot \mathbf {v} \right\rangle \\ + \frac {\eta}{n} \cdot \left(\sum_ {i = 1} ^ {n} | \ell_ {j, i} ^ {(t - 1)} | \sigma^ {\prime} (\langle \mathbf {w} _ {j, r ^ {*}} ^ {(t - 1)}, y _ {i} \mathbf {v} \rangle) - \alpha \sum_ {i = 1} ^ {n} | \ell_ {j, i} ^ {(t - 1)} | \sigma^ {\prime} (\langle \mathbf {w} _ {j, r ^ {*}} ^ {(t - 1)}, \pmb {\xi} _ {i} \rangle)\right) \\ \geq (1 - \eta \lambda) \cdot \left\langle \mathbf {w} _ {j, r ^ {*}} ^ {(t - 1)}, j \cdot \mathbf {v} \right\rangle + \Theta (\eta) \cdot \left[ \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r ^ {*}} ^ {(t - 1)}, j \cdot \mathbf {v} \right\rangle\right) - \alpha \sigma^ {\prime} \left(\Gamma_ {j} ^ {(t - 1)}\right) \right] \\ \geq (1 - \eta \lambda) \Lambda_ {j} ^ {(t - 1)} + \eta \cdot \Theta \left(\left(\Lambda_ {j} ^ {(t - 1)}\right) ^ {q - 1}\right) - \eta \cdot \Theta \left(\alpha \left(\Gamma_ {j} ^ {(t - 1)}\right) ^ {q - 1}\right). \tag {C.29} \\ \end{array} +$$ + +Similarly, let $r^* = \arg \max_{r} \langle \mathbf{w}_{y_i, r}^{(t)}, \pmb{\xi}_i \rangle$ , we also have the following according to (C.28) + +$$ +\begin{array}{l} \Gamma_ {y _ {i}, i} ^ {(t)} = \left\langle \mathbf {w} _ {y _ {i}, r ^ {*}} ^ {(t)}, \boldsymbol {\xi} _ {i} \right\rangle \\ \leq (1 - \eta \lambda) \langle \mathbf {w} _ {y _ {i}, r ^ {*}} ^ {(t - 1)}, \pmb {\xi} _ {i} \rangle + \widetilde {\Theta} \left(\frac {\eta s \sigma_ {p} ^ {2}}{n}\right) \cdot \sigma^ {\prime} (\langle \mathbf {w} _ {y _ {i}, r ^ {*}} ^ {(t - 1)}, \pmb {\xi} _ {i} \rangle) + \Theta \left(\frac {\eta \alpha^ {2}}{n}\right) \cdot \sum_ {s = 1} ^ {n} \sigma^ {\prime} (\langle \mathbf {w} _ {y _ {i}, r ^ {*}} ^ {(t - 1)}, \pmb {\xi} _ {s} \rangle) \\ \leq \Gamma_ {y _ {i}, i} ^ {(t - 1)} + \widetilde {\Theta} \left(\frac {\eta s \sigma_ {p} ^ {2} \left(\Gamma_ {y _ {i} , i} ^ {(t - 1)}\right) ^ {q - 1}}{n}\right) + \Theta \left(\frac {\eta \alpha^ {2}}{n} \cdot \sum_ {s = 1} ^ {n} \left(\Gamma_ {y _ {i}, s} ^ {(t - 1)}\right) ^ {q - 1}\right). \\ \end{array} +$$ + +Then by our definition of $\Gamma_j^{(t)} = \max_{i\in [n]}\Gamma_{j,i}^{(t)}$ , we further get the following for all $j\in \{-1,1\}$ + +$$ +\Gamma_ {j} ^ {(t)} \leq \Gamma_ {j} ^ {(t - 1)} + \widetilde {\Theta} \left(\frac {\eta s \sigma_ {p} ^ {2} + n \eta \alpha^ {2}}{n} \cdot \left(\Gamma_ {j} ^ {(t - 1)}\right) ^ {q - 1}\right) = \Gamma_ {j} ^ {(t - 1)} + \Theta \left(\frac {\eta s \sigma_ {p} ^ {2}}{n} \cdot \left(\Gamma_ {j} ^ {(t - 1)}\right) ^ {q - 1}\right), \tag {C.30} +$$ + +where the last equation is by our assumption that $\alpha = \widetilde{O}(s\sigma_p^2 / n)$ . + +Then we will prove the main argument for general $t$ , which is based on the following two induction hypotheses + +$$ +\Lambda_ {j} ^ {(t)} \geq \Lambda_ {j} ^ {(t - 1)} + \eta \cdot \Theta \left(\left(\Lambda_ {j} ^ {(t - 1)}\right) ^ {q - 1}\right), \tag {C.31} +$$ + +$$ +\Gamma_ {j} ^ {(t)} \leq \Gamma_ {j} ^ {(t - 1)} + \Theta \left(\frac {\eta s \sigma_ {p} ^ {2}}{n} \cdot \left(\Gamma_ {j} ^ {(t - 1)}\right) ^ {q - 1}\right). \tag {C.32} +$$ + +Note that when $t = 0$ , we have already verified these two hypotheses in (C.29) and (C.30), where we use the fact that $\lambda = o(\sigma_0^{q - 2}\sigma_p / n)\leq (\Lambda_j^{(0)})^{q - 2}$ and $\alpha = o(1)$ . Suppose that (C.29) and (C.30) hold for iterations $\tau \leq t$ . At time $t + 1$ , for all $\tau \leq t$ , we have + +$$ +\Gamma_ {j} ^ {(\tau)} \leq O \left(\Lambda_ {j} ^ {(\tau)}\right), +$$ + +as $s\sigma^2 / n = o(1)$ and $\Lambda_j^{(t)}$ increases faster than $\Gamma_j^{(t)}$ . Besides, we can also show that $\lambda \Gamma_j^{(t)} \leq (\Gamma_j^{(t)})^{q-1}$ , which has been verified at time $t = 0$ , since $\Gamma_j^{(t)}$ keeps increasing. Therefore, we have + +$$ +\lambda \Gamma_ {j} ^ {(t)} \leq \left(\Gamma_ {j} ^ {(t)}\right) ^ {q - 1} \leq O \left(\left(\Lambda_ {j} ^ {(t)}\right) ^ {q - 1}\right), +$$ + +and hence (C.29) implies + +$$ +\begin{array}{l} \Lambda_ {j} ^ {(t + 1)} \geq (1 - \eta \lambda) \Lambda_ {j} ^ {(t)} + \eta \cdot \Theta \left(\left(\Lambda_ {j} ^ {(t)}\right) ^ {q - 1}\right) - \eta \cdot \Theta \left(\alpha \left(\Gamma_ {j} ^ {(t)}\right) ^ {q - 1}\right) \\ \geq \Lambda_ {j} ^ {(t)} + \eta \cdot \Theta \big ((\Lambda_ {j} ^ {(t)}) ^ {q - 1} \big), \\ \end{array} +$$ + +which verifies Hypothesis (C.31) at $t + 1$ . Additionally, (C.30) implies + +$$ +\Gamma_ {j} ^ {(t + 1)} \leq \Gamma_ {j} ^ {(t)} + \Theta \bigg (\frac {\eta s \sigma_ {p} ^ {2}}{n} \cdot \big (\Gamma_ {j} ^ {(t)} \big) ^ {q - 1} \bigg), +$$ + +which verifies Hypothesis (C.32) at $t + 1$ . Then by Lemma C.9, we have that $\Lambda_j^{(t)} = \widetilde{O}(1)$ for all $t \leq T_0 = \widetilde{\Theta}\big((\Lambda_j^{(0)})^{2 - q} / \eta \big) = \widetilde{\Theta}(\sigma_0^{2 - q} / \eta)$ . Moreover, Lemma C.9 also shows that $\Gamma_j^{(t + 1)} = O(\Lambda_j^{(0)}) = \widetilde{O}(\sigma_0)$ . This completes the proof. + +Lemma C.10. For all $i\in [n]$ and $t\leq T_{-y_i}$ , it holds that $\langle \mathbf{w}_{-y_i,r}^{(t)},\pmb {\xi}_i\rangle \leq \widetilde{\Theta} (\alpha)$ . + +Proof. First of all, for $j \in \{\pm 1\}$ , by the definition of $T_{j}$ , we have + +$$ +\langle \mathbf {w} _ {j, r} ^ {(t)}, j \cdot \mathbf {v} \rangle \leq \widetilde {\Theta} (1). +$$ + +Moreover, with the same proof as Lemma C.8, it is clear that $-\langle \mathbf{w}_{j,r}^{(t)}, j \cdot \mathbf{v} \rangle$ is decreasing in $t$ for $t \leq T_j$ . Therefore, by the fact that $|\langle \mathbf{w}_{j,r}^{(0)}, \mathbf{v} \rangle| \leq \widetilde{\Theta}(1)$ , we have + +$$ +| \langle \mathbf {w} _ {j, r} ^ {(t)}, \mathbf {v} \rangle | \leq \widetilde {\Theta} (1) \tag {C.33} +$$ + +for all $t \leq T_j$ . + +Now by the update form of GD, we have for any $k\in \mathcal{B}_i$ + +$$ +\mathbf {w} _ {- y _ {i}, r} ^ {(t + 1)} [ k ] \cdot \pmb {\xi} _ {i} [ k ] = (1 - \eta \lambda) \cdot \mathbf {w} _ {- y _ {i}, r} ^ {(t)} [ k ] \cdot \pmb {\xi} _ {i} [ k ] + \frac {\eta}{n} \cdot \sum_ {k \in \mathcal {B} _ {i}} \ell_ {- y _ {i}, i} ^ {(t)} \sigma^ {\prime} (\langle \mathbf {w} _ {- y _ {i}, r} ^ {(t)}, \pmb {\xi} _ {i} \rangle) \cdot \pmb {\xi} _ {i} [ k ] ^ {2}. +$$ + +Note that $\ell_{-y_i,i}^{(t)}\sigma'(\langle \mathbf{w}_{-y_i,r}^{(t)},\pmb{\xi}_i\rangle) < 0$ , which implies that $\mathbf{w}_{-y_i,r}^{(t)}[k]\cdot \pmb{\xi}_i[k]$ is decreasing in $t$ . Therefore, for all $r$ and $i$ , we have + +$$ +\begin{array}{l} \left\langle \mathbf {w} _ {- y _ {i}, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \right\rangle = \mathbf {w} _ {- y _ {i}, r} ^ {(t)} [ 1 ] \cdot \boldsymbol {\xi} _ {i} [ 1 ] + \sum_ {k \in \mathcal {B} _ {i}} \mathbf {w} _ {- y _ {i}, r} ^ {(t)} [ k ] \boldsymbol {\xi} _ {i} [ k ] \\ \leq \mathbf {w} _ {- y _ {i}, r} ^ {(t)} [ 1 ] \cdot \boldsymbol {\xi} _ {i} [ 1 ] + \sum_ {k \in \mathcal {B} _ {i}} \mathbf {w} _ {- y _ {i}, r} ^ {(0)} [ k ] \boldsymbol {\xi} _ {i} [ k ] \\ \leq \left| \mathbf {w} _ {- y _ {i}, r} ^ {(t)} [ 1 ] \cdot \boldsymbol {\xi} _ {i} [ 1 ] \right| + \left| \sum_ {k \in \mathcal {B} _ {i}} \mathbf {w} _ {- y _ {i}, r} ^ {(0)} [ k ] \boldsymbol {\xi} _ {i} [ k ] \right| \\ \leq \widetilde {\Theta} (\alpha) + \widetilde {\Theta} (\sigma_ {0} \sigma_ {p} s ^ {1 / 2}) \\ = \widetilde {\Theta} (\alpha), \\ \end{array} +$$ + +where the third inequality follows by (C.33). This completes the proof. + +Note that for different $j$ , the iteration numbers when $\Lambda_j^{(t)}$ reaches $\widetilde{\Theta}(1/m)$ are different. Without loss of generality, we can assume $T_1 \leq T_{-1}$ . Lemma C.8 has provided a clear understanding about how $\Lambda_j^{(t)}$ varies within the iteration range $[0, T_j]$ . However, it remains unclear how $\Gamma_1^{(t)}$ varies within the iteration range $[T_1, T_{-1}]$ since in this period we no longer have $|\ell_{j,i}^{(t)}| = \Theta(1)$ and the effect of gradient descent on the feature learning (i.e., increase of $\langle \mathbf{w}_{j,r}, j \cdot \mathbf{v} \rangle$ ) becomes weaker. In the following lemma we give a characterization of $\Lambda_1^{(t)}$ for every $t \in [T_1, T_{-1}]$ . + +Lemma C.11 (Stage I of GD: part II). Without loss of generality assuming $T_{1} < T_{-1}$ . Then it holds that $\Lambda_{1}^{(t)} = \widetilde{\Theta}(1)$ for all $t \in [T_1, T_{-1}]$ . + +Proof. Recall from (C.29) that we have the following general lower bound for the increase of $\Lambda_j^{(t)}$ + +$$ +\begin{array}{l} \Lambda_ {j} ^ {(t + 1)} \geq (1 - \eta \lambda) \cdot \langle \mathbf {w} _ {j, r ^ {*}} ^ {(t)}, j \cdot \mathbf {v} \rangle + \frac {\eta}{n} \cdot \left(\sum_ {i = 1} ^ {n} | \ell_ {j, i} ^ {(t)} | \sigma^ {\prime} (\langle \mathbf {w} _ {j, r ^ {*}} ^ {(t)}, y _ {i} \mathbf {v} \rangle) - \alpha \sum_ {i = 1} ^ {n} | \ell_ {j, i} ^ {(t)} | \sigma^ {\prime} (\langle \mathbf {w} _ {j, r ^ {*}} ^ {(t)}, \boldsymbol {\xi} _ {i} \rangle)\right) \\ \geq (1 - \eta \lambda) \Lambda_ {j} ^ {(t)} + \Theta \left(\frac {\eta}{n}\right) \cdot \sum_ {i: y _ {i} = j} | \ell_ {j, i} ^ {(t)} | \cdot \left(\Lambda_ {j} ^ {(t)}\right) ^ {q - 1} - \Theta (\alpha \eta) \cdot \left(\Gamma_ {j} ^ {(t)} \vee \widetilde {\Theta} (\alpha)\right) ^ {q - 1}, \tag {C.34} \\ \end{array} +$$ + +where the last inequality is by Lemma C.10. Note that by Lemma C.8, we have $\Gamma_j^{(t)} = \widetilde{O}(\sigma_0)$ for all $t \leq T_{-1}$ and. Then the above inequality leads to + +$$ +\Lambda_ {j} ^ {(t + 1)} \geq (1 - \eta \lambda) \Lambda_ {j} ^ {(t)} + \Theta \left(\frac {\eta}{n}\right) \cdot \sum_ {i: y _ {i} = j} | \ell_ {j, i} ^ {(t)} | \cdot \left(\Lambda_ {j} ^ {(t)}\right) ^ {q - 1} - \Theta (\alpha^ {q} \eta), \tag {C.35} +$$ + +where we use the fact that $\alpha = \omega (\sigma_0)$ . The remaining proof consists of two parts: (1) proving $\Lambda_j^{(t)}\geq \Theta (1 / m) = \widetilde{\Theta} (1)$ and (2) $\Lambda_j^{(t)}\leq \Theta (\log (1 / \lambda))$ + +Without loss of generality we consider $j = 1$ . Regarding the first part, we first note that Lemma C.8 implies that $\Lambda_1^{(T_1)} \geq \Theta(1/m)$ . Then we consider the case when $\Lambda_1^{(t)} \leq \Theta(\log(1/\alpha)/m)$ , it holds that for all $y_i = 1$ , + +$$ +\begin{array}{l} \ell_ {1, i} ^ {(t)} = \frac {e ^ {F _ {- 1} (\mathbf {W} ^ {(t)} , \mathbf {x} _ {i})}}{\sum_ {j \in \{- 1 , 1 \}} e ^ {F _ {j} (\mathbf {W} ^ {(t)} , \mathbf {x} _ {i})}} \\ = \exp \left(\Theta \left(\sum_ {r = 1} ^ {m} \left[ \sigma \left(\langle \mathbf {w} _ {- 1, r} ^ {(t)}, y _ {i} \mathbf {v} \rangle\right) + \sigma \left(\langle \mathbf {w} _ {- 1, r} ^ {(t)}, \pmb {\xi} _ {i} \rangle\right) \right] - \sum_ {r = 1} ^ {m} \left[ \sigma \left(\langle \mathbf {w} _ {1, r} ^ {(t)}, y _ {i} \mathbf {v} \rangle\right) + \sigma \left(\langle \mathbf {w} _ {1, r} ^ {(t)}, \pmb {\xi} _ {i} \rangle\right) \right]\right)\right) \\ \geq \exp \big (- \Theta (m \Lambda_ {1} ^ {(t)}) \big) \\ \geq \exp (- \Theta (\log (1 / \alpha))) \\ = \widetilde {\Theta} (\alpha). \\ \end{array} +$$ + +Then (C.35) implies that if $\Gamma_1^{(t)}\leq \Theta (\log (1 / \sigma_0) / m)$ , we have + +$$ +\Lambda_ {1} ^ {(t + 1)} \geq (1 - \eta \lambda) \Lambda_ {1} ^ {(t)} + \Theta (\eta \alpha) \cdot \Lambda_ {1} ^ {(t)} - \Theta (\alpha^ {q} \eta) \geq \Lambda_ {1} ^ {(t)} + \Theta (\eta \alpha) \cdot \Lambda_ {1} ^ {(t)} \geq \Lambda_ {1} ^ {(t)}, +$$ + +where the second inequality is due to $\lambda = o(\alpha)$ . This implies that $\Lambda_1^{(t)}$ will keep increases in this case so that it is impossible that $\Lambda_1^{(t)} \leq \Theta(1/m)$ , which completes the proof of the first part. + +For the second part, (C.28) implies that + +$$ +\Lambda_ {1} ^ {(t + 1)} \leq (1 - \eta \lambda) \Lambda_ {1} ^ {(t)} + \Theta \left(\frac {\eta}{n}\right) \cdot \sum_ {i: y _ {i} = 1} | \ell_ {1, i} ^ {(t)} | \cdot \left(\Lambda_ {1} ^ {(t)}\right) ^ {q - 1}. \tag {C.36} +$$ + +Consider the case when $\Gamma_1^{(t)}\geq \Theta (\log (d))$ , then for all $y_{i} = 1$ + +$$ +\begin{array}{l} \ell_ {1, i} ^ {(t)} = \frac {e ^ {F _ {- 1} (\mathbf {W} ^ {(t)} , \mathbf {x} _ {i})}}{\sum_ {j \in \{- 1 , 1 \}} e ^ {F _ {j} (\mathbf {W} ^ {(t)} , \mathbf {x} _ {i})}} \\ = \exp \left(\Theta \left(\sum_ {r = 1} ^ {m} \left[ \sigma \left(\langle \mathbf {w} _ {- 1, r} ^ {(t)}, y _ {i} \mathbf {v} \rangle\right) + \sigma \left(\langle \mathbf {w} _ {- 1, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \rangle\right) \right] - \sum_ {r = 1} ^ {m} \left[ \sigma \left(\langle \mathbf {w} _ {1, r} ^ {(t)}, y _ {i} \mathbf {v} \rangle\right) + \sigma \left(\langle \mathbf {w} _ {1, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \rangle\right) \right]\right)\right) \\ \leq \exp \big (- \Theta (\Lambda_ {1} ^ {(t)}) \big) \\ \leq \exp (- \Theta (\log (1 / \lambda)) \\ = \widetilde {\Theta} (\operatorname {p o l y} (\lambda)). \\ \end{array} +$$ + +Then (C.36) further implies that + +$$ +\begin{array}{l} \Lambda_ {1} ^ {(t + 1)} \leq (1 - \eta \lambda) \Lambda_ {1} ^ {(t)} + \Theta \left(\frac {\eta}{\operatorname {p o l y} (d)}\right) \cdot \left(\Lambda_ {1} ^ {(t)}\right) ^ {q - 1} \\ \leq \Lambda_ {1} ^ {(t)} - \Theta \big (\eta \Lambda_ {1} ^ {(t)} \big) \cdot \left(\lambda - \mathrm {p o l y} (\lambda) \cdot \big (\Lambda_ {1} ^ {(t)} \big) ^ {q - 2}\right) \leq \Lambda_ {1} ^ {(t)}, \\ \end{array} +$$ + +which implies that $\Lambda_1^{(t)}$ will decrease. As a result, we can conclude that $\lambda_1^{(t)}$ will not exceed $\Theta (\log (1 / \lambda))$ , this completes the proof of the second part. + +![](images/627557ace92b44cb2140a7041907d89653a2d5a7594f700de3d64cb3ffe46528.jpg) + +Lemma C.12 (Lemma 5.7, restated). If $\eta \leq O(\sigma_0)$ , it holds that $\Lambda_j^{(t)} = \widetilde{\Theta}(1)$ and $\Gamma_j^{(t)} = \widetilde{O}(\sigma_0)$ for all $t \in [T_{-1}, T]$ . + +Proof. We will prove the desired argument based on the following three induction hypotheses: + +$$ +\Lambda_ {j} ^ {(t + 1)} \geq (1 - \lambda \eta) \Lambda_ {j} ^ {(t)} + \widetilde {\Theta} \left(\frac {\eta}{n}\right) \sum_ {i: y _ {i} = j} | \ell_ {j, i} ^ {(t)} | - \widetilde {\Theta} (\alpha^ {q} \eta) \cdot \frac {1}{n} \sum_ {i = 1} ^ {n} | \ell_ {j, r} ^ {(t)} |, \tag {C.37} +$$ + +$$ +\Gamma_ {j} ^ {(t)} = \widetilde {O} (\sigma_ {0}), \tag {C.38} +$$ + +$$ +\Lambda_ {j} ^ {(t)} = \widetilde {\Theta} (1). \tag {C.39} +$$ + +In terms of Hypothesis (C.37), we can apply Hypothesis (C.38) and (C.39) to (C.34) and get that + +$$ +\begin{array}{l} \Lambda_ {j} ^ {(t + 1)} \geq (1 - \eta \lambda) \Lambda_ {j} ^ {(t)} + \Theta \bigg (\frac {\eta}{n} \bigg) \cdot \sum_ {i: y _ {i} = j} | \ell_ {j, i} ^ {(t)} | \cdot \left(\Lambda_ {j} ^ {(t)}\right) ^ {q - 1} - \Theta (\alpha \eta) \cdot \left(\Gamma_ {j} ^ {(t)} \vee \widetilde {\Theta} (\alpha)\right) ^ {q - 1} \cdot \frac {1}{n} \sum_ {i = 1} ^ {n} | \ell_ {j, r} ^ {(t)} | \\ \geq (1 - \lambda \eta) \Lambda_ {j} ^ {(t)} + \widetilde {\Theta} \left(\frac {\eta}{n}\right) \sum_ {i: y _ {i} = j} | \ell_ {j, i} ^ {(t)} | - \widetilde {\Theta} (\alpha^ {q} \eta) \cdot \frac {1}{n} \sum_ {i = 1} ^ {n} | \ell_ {j, r} ^ {(t)} |. \\ \end{array} +$$ + +where the last inequality we use the fact that $\alpha \geq \sigma_0$ . This verifies Hypothesis (C.37). + +In order to verify Hypothesis (C.38), we have the following according to (C.37), + +$$ +\begin{array}{l} \sum_ {j \in \{- 1, 1 \}} \Lambda_ {j} ^ {(t + 1)} \geq (1 - \lambda \eta) \sum_ {j \in \{- 1, 1 \}} \left[ \Lambda_ {j} ^ {(t)} + \widetilde {\Theta} \left(\frac {\eta}{n}\right) \sum_ {i = 1} ^ {n} | \ell_ {j, i} ^ {(t)} | - \widetilde {\Theta} (\alpha^ {q} \eta) \cdot \frac {1}{n} \sum_ {i = 1} ^ {n} | \ell_ {j, r} ^ {(t)} | \right] \\ = (1 - \lambda \eta) \sum_ {j \in \{- 1, 1 \}} \left[ \Lambda_ {j} ^ {(t)} + \widetilde {\Theta} \left(\frac {\eta}{n}\right) \sum_ {i = 1} ^ {n} | \ell_ {j, i} ^ {(t)} | \right], \\ \end{array} +$$ + +where the last equality holds since $\alpha = o(1)$ . Recursively applying the above inequality from $T_{-1}$ to $t$ gives + +$$ +\sum_ {j \in \{- 1, 1 \}} \Lambda_ {j} ^ {(t)} \geq (1 - \lambda \eta) ^ {t - T _ {- 1}} \sum_ {j \in \{- 1, 1 \}} \left[ \Lambda_ {j} ^ {(T _ {- 1})} + \widetilde {\Theta} \left(\frac {\eta}{n}\right) \cdot \sum_ {\tau = 0} ^ {t - T _ {- 1} - 1} (1 - \lambda \eta) ^ {\tau} \sum_ {i = 1} ^ {n} | \ell_ {j, i} ^ {(t - 1 - \tau)} | \right]. +$$ + +Then by Hypothesis (C.39) we have + +$$ +\widetilde {\Theta} \left(\frac {\eta}{n}\right) \cdot \sum_ {\tau = 0} ^ {t - T _ {- 1} - 1} (1 - \lambda \eta) ^ {\tau} \sum_ {i = 1} ^ {n} | \ell_ {j, i} ^ {(t - 1 - \tau)} | \leq \widetilde {\Theta} (1). +$$ + +Now let us look at the rate of memorizing noises. By (C.28) and use the fact that $\alpha^2 \leq O(s\sigma_p^2 / n)$ , we have + +$$ +\begin{array}{l} \Gamma_ {j} ^ {(t)} \leq (1 - \eta \lambda) \Gamma_ {j} ^ {(t - 1)} + \widetilde {\Theta} \left(\frac {\eta s \sigma_ {p} ^ {2}}{n}\right) \cdot \sum_ {i = 1} | \ell_ {j, i} | \cdot \left(\Gamma_ {j} ^ {(t - 1)}\right) ^ {q - 1} \\ \leq (1 - \eta \lambda) \Gamma_ {j} ^ {(t - 1)} + \widetilde {\Theta} \left(\frac {\eta s \sigma_ {p} ^ {2} \sigma_ {0} ^ {q - 1}}{n}\right) \cdot \sum_ {i = 1} | \ell_ {j, i} | \\ \leq \Gamma_ {j} ^ {(T _ {- 1})} + \widetilde {\Theta} \left(\frac {\eta s \sigma_ {p} ^ {2} \sigma_ {0} ^ {q - 1}}{n}\right) \cdot \sum_ {\tau = 0} ^ {t - T _ {- 1} - 1} (1 - \lambda \eta) ^ {\tau} \sum_ {i = 1} ^ {n} | \ell_ {j, i} ^ {(t - 1 - \tau)} | \\ \leq \widetilde {\Theta} \left(\sigma_ {0} + s \sigma_ {p} ^ {2} \sigma_ {0} ^ {q - 1}\right) \\ \leq \widetilde {\Theta} (\sigma_ {0}), \\ \end{array} +$$ + +which verifies Hypothesis (C.38). + +Given Hypothesis (C.37) and (C.38), the verification of (C.39) is straightforward by applying the same proof technique of Lemma C.11 and thus we omit it here. + +Lemma C.13 (Lemma 5.8, restated). If the step size satisfies, then for any $t \geq T_{-1}$ it holds that + +$$ +L \left(\mathbf {W} ^ {(t + 1)}\right) - L \left(\mathbf {W} ^ {(t)}\right) \leq - \frac {\eta}{2} \| \nabla L \left(\mathbf {W} ^ {(t)}\right) \| _ {F} ^ {2}. +$$ + +Proof. The proof of this lemma is similar to that of Lemma C.6, which is basically relying the smoothness property of the loss function $L(\mathbf{W})$ given certain constraints on the inner products $\langle \mathbf{w}_{j,r},\mathbf{v}\rangle$ and $\langle \mathbf{w}_{j,r},\pmb {\xi}_i\rangle$ . + +Let $\Delta F_{j,i} = F_{j}(\mathbf{W}^{(t + 1)},\mathbf{x}_{i}) - F_{j}(\mathbf{W}^{(t)},\mathbf{x}_{i})$ , we can get the following Taylor expansion on the loss function $L_{i}(\mathbf{W}^{(t + 1)})$ + +$$ +L _ {i} \left(\mathbf {W} ^ {(t + 1)}\right) - L _ {i} \left(\mathbf {W} ^ {(t)}\right) \leq \sum_ {j} \frac {\partial L _ {i} \left(\mathbf {W} ^ {(t)}\right)}{\partial F _ {j} \left(\mathbf {W} ^ {(t)} , \mathbf {x} _ {i}\right)} \cdot \Delta F _ {j, i} + \sum_ {j} (\Delta F _ {j, i}) ^ {2}. \tag {C.40} +$$ + +In particular, by Lemma C.12, we know that $\langle \mathbf{w}_{j,r}^{(t)},y_i\mathbf{v}\rangle \leq \widetilde{\Theta} (1)$ and $\langle \mathbf{w}_{j,r}^{(t)},\pmb {\xi}_i\rangle \leq \widetilde{\Theta} (\sigma_0)\leq \widetilde{\Theta} (1)$ . Then similar to (C.21), we can apply first-order Taylor expansion to $F_{j}(\mathbf{W}^{(t + 1)},\mathbf{x}_{i})$ , which requires to characterize the second-order error of the Taylor expansions on $\sigma (\langle \mathbf{w}_{j,r}^{(t + 1)},y_i\mathbf{v}\rangle)$ and $\sigma (\langle \mathbf{w}_{j,r}^{(t + 1)},\pmb {\xi}_i\rangle)$ , + +$$ +\begin{array}{l} \left| \sigma (\langle \mathbf {w} _ {j, r} ^ {(t + 1)}, y _ {i} \mathbf {v} \rangle) - \sigma (\langle \mathbf {w} _ {j, r} ^ {(t)}, y _ {i} \mathbf {v} \rangle) - \left\langle \nabla_ {\mathbf {w} _ {j, r}} \sigma (\langle \mathbf {w} _ {j, r} ^ {(t)}, y _ {i} \mathbf {v} \rangle), \mathbf {w} _ {j, r} ^ {(t + 1)} - \mathbf {w} _ {j, r} ^ {(t)} \right\rangle \right| \\ \leq \widetilde {\Theta} \big (\left\| \mathbf {w} _ {j, r} ^ {(t + 1)} - \mathbf {w} _ {j, r} ^ {(t)} \right\| _ {2} ^ {2} \big) = \widetilde {\Theta} \big (\eta^ {2} \| \nabla_ {\mathbf {w} _ {j, r}} L (\mathbf {W} ^ {(t)}) \| _ {2} ^ {2} \big), \\ \end{array} +$$ + +$$ +\begin{array}{l} \left| \sigma \left(\left\langle \mathbf {w} _ {j, r} ^ {(t + 1)}, \boldsymbol {\xi} _ {i} \right\rangle\right) - \sigma \left(\left\langle \mathbf {w} _ {j, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \right\rangle\right) - \left\langle \nabla_ {\mathbf {w} _ {j, r}} \sigma \left(\left\langle \mathbf {w} _ {j, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \right\rangle\right), \mathbf {w} _ {j, r} ^ {(t + 1)} - \mathbf {w} _ {j, r} ^ {(t)} \right\rangle \right| \\ \leq \widetilde {\Theta} \left(\left\| \mathbf {w} _ {j, r} ^ {(t + 1)} - \mathbf {w} _ {j, r} ^ {(t)} \right\| _ {2} ^ {2}\right) = \widetilde {\Theta} \left(\eta^ {2} \| \nabla_ {\mathbf {w} _ {j, r}} L \left(\mathbf {W} ^ {(t)}\right) \| _ {2} ^ {2}\right). \tag {C.41} \\ \end{array} +$$ + +Then combining the above bounds for every $r \in [m]$ , we can get the following bound for $\Delta F_{j,i}$ + +$$ +\begin{array}{l} \left| \Delta F _ {j, i} - \langle \nabla_ {\mathbf {W}} F _ {j} (\mathbf {W} ^ {(t)}, \mathbf {x} _ {i}), \mathbf {W} ^ {(t + 1)} - \mathbf {W} ^ {(t)} \rangle \right| \leq \widetilde {\Theta} \Bigg (\eta^ {2} \sum_ {r \in [ m ]} \| \nabla_ {\mathbf {w} _ {j, r}} L (\mathbf {W} ^ {(t)}) \| _ {2} ^ {2} \Bigg) \\ = \widetilde {\Theta} \left(\eta^ {2} \| \nabla L \left(\mathbf {W} ^ {(t)}\right) \| _ {F} ^ {2}\right). \tag {C.42} \\ \end{array} +$$ + +Moreover, since $\langle \mathbf{w}_{j,r}^{(t)},y_i\mathbf{v}\rangle \leq \widetilde{\Theta} (1)$ and $\langle \mathbf{w}_{j,r}^{(t)},\pmb {\xi}_i\rangle \leq \widetilde{\Theta} (1)$ and $\sigma (\cdot)$ is convex, then we have + +$$ +\begin{array}{l} | \sigma (\langle \mathbf {w} _ {j, r} ^ {(t + 1)}, y _ {i} \mathbf {v} \rangle) - \sigma (\langle \mathbf {w} _ {j, r} ^ {(t)}, y _ {i} \mathbf {v} \rangle) | \leq \max \left\{| \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t + 1)}, y _ {i} \mathbf {v} \rangle) |, | \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t)}, y _ {i} \mathbf {v} \rangle) | \right\} \cdot | \langle \mathbf {v}, \mathbf {w} _ {j, r} ^ {(t + 1)} - \mathbf {w} _ {j, r} ^ {(t)} \rangle | \\ \leq \widetilde {\Theta} \left(\left\| \mathbf {w} _ {j, r} ^ {(t + 1)} - \mathbf {w} _ {j, r} ^ {(t)} \right\| _ {2}\right). \\ \end{array} +$$ + +Similarly we also have + +$$ +\left| \sigma \left(\left\langle \mathbf {w} _ {j, r} ^ {(t + 1)}, \boldsymbol {\xi} _ {i} \right\rangle\right) - \sigma \left(\left\langle \mathbf {w} _ {j, r} ^ {(t)}, \boldsymbol {\xi} _ {i} \right\rangle\right) \right| \leq \widetilde {\Theta} \left(\left\| \mathbf {w} _ {j, r} ^ {(t + 1)} - \mathbf {w} _ {j, r} ^ {(t)} \right\| _ {2}\right). +$$ + +Combining the above inequalities for every $r \in [m]$ , we have + +$$ +\left| \Delta F _ {j, i} \right| ^ {2} \leq \widetilde {\Theta} \left(\left[ \sum_ {r \in [ m ]} \| \mathbf {w} _ {j, r} ^ {(t + 1)} - \mathbf {w} _ {j, r} ^ {(t)} \| _ {2} \right] ^ {2}\right) \leq \widetilde {\Theta} \left(m \eta^ {2} \| \nabla L (\mathbf {W} ^ {(t)}) \| _ {F} ^ {2}\right) = \widetilde {\Theta} \left(\eta^ {2} \| \nabla L (\mathbf {W} ^ {(t)}) \| _ {F} ^ {2}\right). \tag {C.43} +$$ + +Now we can plug (C.42) and (C.43) into (C.40), which gives + +$$ +\begin{array}{l} L _ {i} \left(\mathbf {W} ^ {(t + 1)}\right) - L _ {i} \left(\mathbf {W} ^ {(t)}\right) \leq \sum_ {j} \frac {\partial L _ {i} \left(\mathbf {W} ^ {(t)}\right)}{\partial F _ {j} \left(\mathbf {W} ^ {(t)} , \mathbf {x} _ {i}\right)} \cdot \Delta F _ {j, i} + \sum_ {j} \left(\Delta F _ {j, i}\right) ^ {2} \\ = \left\langle \nabla L _ {i} \left(\mathbf {W} ^ {(t)}\right), \mathbf {W} ^ {(t + 1)} - \mathbf {W} ^ {(t)} \right\rangle + \widetilde {\Theta} \left(\eta^ {2} \| \nabla L \left(\mathbf {W} ^ {(t)}\right) \| _ {F} ^ {2}\right). \tag {C.44} \\ \end{array} +$$ + +Taking sum over $i \in [n]$ and applying the smoothness property of the regularization function $\lambda \| \mathbf{W} \|_F^2$ , we can get + +$$ +\begin{array}{l} L \left(\mathbf {W} ^ {(t + 1)}\right) - L \left(\mathbf {W} ^ {(t)}\right) = \frac {1}{n} \sum_ {i = 1} ^ {n} \left[ L _ {i} \left(\mathbf {W} ^ {(t + 1)}\right) - L _ {i} \left(\mathbf {W} ^ {(t)}\right) \right] + \lambda \left(\| \mathbf {W} ^ {(t + 1)} \| _ {F} ^ {2} - \| \mathbf {W} ^ {(t)} \| _ {F} ^ {2}\right) \\ \leq \langle \nabla L (\mathbf {W} ^ {(t)}), \mathbf {W} ^ {(t + 1)} - \mathbf {W} ^ {(t)} \rangle + \widetilde {\Theta} \left(\eta^ {2} \| \nabla L (\mathbf {W} ^ {(t)}) \| _ {F} ^ {2}\right) \\ = - \left(\eta - \widetilde {\Theta} (\eta^ {2})\right) \cdot \| \nabla L \left(\mathbf {W} ^ {(t)}\right) \| _ {F} ^ {2} \\ \leq - \frac {\eta}{2} \| \nabla L (\mathbf {W} ^ {(t)}) \| _ {F} ^ {2}, \\ \end{array} +$$ + +where the last inequality is due to our choice of step size $\eta = o(1)$ so that gives $\eta -\widetilde{\Theta} (\eta^2)\geq \eta /2$ This completes the proof. + +Lemma C.14 (Generalization Performance of GD). Let + +$$ +\mathbf{W}^{*} = \arg \min_{\{\mathbf{W}^{(1)},\ldots ,\mathbf{W}^{(T)}\}}\| \nabla L(\mathbf{W}^{(t)})\|_{F}. +$$ + +Then for all training data, we have + +$$ +\frac {1}{n} \sum_ {i = 1} ^ {n} \mathbb {1} \left[ F _ {y _ {i}} (\mathbf {W} ^ {*}, \mathbf {x} _ {i}) \leq F _ {- y _ {i}} (\mathbf {W} ^ {*}, \mathbf {x} _ {i}) \right] = 0. +$$ + +Moreover, in terms of the test data $(\mathbf{x},y)\sim \mathcal{D}$ , we have + +$$ +\mathbb {P} _ {(\mathbf {x}, y) \sim \mathcal {D}} \left[ F _ {y} \left(\mathbf {W} ^ {*}, \mathbf {x}\right) \leq F _ {- y} \left(\mathbf {W} ^ {*}, \mathbf {x}\right) \right] = o (1). +$$ + +Proof. By Lemma C.12 it is clear that all training data can be correctly classified so that the training error is zero. Besides, for test data $(\mathbf{x},y)$ with $\mathbf{x} = [y\mathbf{v}^{\top},\pmb{\xi}^{\top}]^{\top}$ , it is clear that with high probability $\langle \mathbf{w}_{y,r}^{*},y\mathbf{v}\rangle = \tilde{\Theta}(1)$ and $[\langle \mathbf{w}_{y,r}^{*},\pmb{\xi}\rangle]_{+} \leq \tilde{O}(\sigma_0)$ , then + +$$ +F _ {y} \left(\mathbf {W} ^ {*}, \mathbf {x}\right) = \sum_ {r = 1} ^ {m} \left[ \sigma \left(\left\langle \mathbf {w} _ {y, r} ^ {*}, y \mathbf {v} \right\rangle\right) + \sigma \left(\left\langle \mathbf {w} _ {y, r} ^ {*}, \boldsymbol {\xi} \right\rangle\right) \right] \geq \widetilde {\Omega} (1). +$$ + +If $j = -y$ , we have with probability at least $1 - 1 / \mathrm{poly}(n)$ , $\langle \mathbf{w}_{-y,r}^{*}, y\mathbf{v} \rangle \leq 0$ and $[\mathbf{w}_{-y,r}^{*}, \pmb{\xi}]_{+} \leq \widetilde{O}(\alpha)$ , which leads to + +$$ +F _ {- y} \left(\mathbf {W} ^ {*}, \mathbf {x}\right) = \sum_ {r = 1} ^ {m} \left[ \sigma \left(\left\langle \mathbf {w} _ {- y, r} ^ {*}, y \mathbf {v} \right\rangle\right) + \sigma \left(\left\langle \mathbf {w} _ {- y, r} ^ {*}, \boldsymbol {\xi} \right\rangle\right) \right] \leq \widetilde {O} (m \alpha^ {q}) = \widetilde {O} (\alpha^ {q}) = o (1). +$$ + +This implies that GD can also achieve nearly at most $1 / \mathrm{poly}(n)$ test error. This completes the proof. + +# D PROOF OF THEOREM 4.2: CONVEX CASE + +Theorem D.1 (Convex setting, restated). Assume the model is over-parameterized. Then for any convex and smooth training objective with positive regularization parameter $\lambda$ , suppose we run Adam and gradient descent for $T = \frac{\text{poly}(n)}{\eta}$ iterations, then with probability at least $1 - n^{-1}$ , the obtained parameters $\mathbf{W}_{\mathrm{Adam}}^*$ and $\mathbf{W}_{\mathrm{GD}}^*$ satisfy that $\| \nabla L(\mathbf{W}_{\mathrm{Adam}}^*) \|_1 \leq \frac{1}{T\eta}$ and $\| \nabla L(\mathbf{W}_{\mathrm{Adam}}^*) \|_2^2 \leq \frac{1}{T\eta}$ respectively. Moreover, it holds that: + +- Training errors are the same: + +$$ +\frac {1}{n} \sum_ {i = 1} ^ {n} \mathbb {1} \left[ \mathrm {s g n} \big (F (\mathbf {W} _ {\mathrm {A d a m}} ^ {*}, \mathbf {x} _ {i}) \big) \neq y _ {i} \right] = \frac {1}{n} \sum_ {i = 1} ^ {n} \mathbb {1} \left[ \mathrm {s g n} \big (F (\mathbf {W} _ {\mathrm {G D}} ^ {*}, \mathbf {x} _ {i}) \big) \neq y _ {i} \right]. +$$ + +Test errors are nearly the same: + +$$ +\mathbb {P} _ {(\mathbf {x}, y) \sim \mathcal {D}} \big [ \mathrm {s g n} \big (F (\mathbf {W} _ {\mathrm {A d a m}} ^ {*}, \mathbf {x} _ {i}) \big) \neq y \big ] = \mathbb {P} _ {(\mathbf {x}, y) \sim \mathcal {D}} \big [ \mathrm {s g n} \big (F (\mathbf {W} _ {\mathrm {G D}} ^ {*}, \mathbf {x}) \big) \neq y \big ] \pm o (1). +$$ + +Proof. The proof is straightforward by applying the same proof technique used for Lemmas C.6 and C.13, where we only need to use the smoothness property of the loss function. Then it is clear that both Adam and GD can provably find a point with a sufficiently small gradient. Note that the training objective becomes strongly convex when adding weight decay regularization, implying that the entire training objective only has one stationary point, i.e., point with a sufficiently small gradient. This further implies that the points found by Adam and GD must be exactly the same and thus GD and Adam must have nearly the same training and test performance. + +Besides, when the problem is sufficiently over-parameterized, with proper regularization (feasibly small), we can still guarantee zero training errors. + +# E DISCUSSION ON THE DATA MODELS IN WILSON ET AL. (2017); REDDI ET AL. (2018) + +Data model in Wilson et al. (2017). In particular, given the binary label $y_{i} \in \{-1, 1\}$ , the feature vector $\mathbf{x}_{i}$ is set as + +$$ +\mathbf {x} _ {i} [ j ] = \left\{ \begin{array}{l l} y _ {i}, & j = 1 \\ 1, & j = 2, 3 \\ 1, & j = 4 + 5 (i - 1), \ldots , 4 + 5 (i - 1) + 2 (1 - y _ {i}) \\ 0, & \text {o t h e r w i s e .} \end{array} \right. +$$ + +Data model in Reddi et al. (2018). In particular, Reddi et al. (2018) considers a one-dimensional optimization objective. Besides, in each iteration of Adam, the stochastic gradient is taken based on the function $f_{t}(x)$ defined as follows: + +$$ +f _ {t} (x) = \left\{ \begin{array}{l l} C x, & t \mod 3 = 1 \\ - x, & \text {o t h e r w i s e .} \end{array} \right. +$$ + +Then it can be seen that in these two prior works, each coordinate of the feature vector (or the objective function) is hard coded. In contrast, our data model allows randomness in the data generation process. This implies that our theory can hold for the data points generated from a certain distribution, while these prior works can only cover one particular data or optimization objective. \ No newline at end of file diff --git a/understandingthegeneralizationofadaminlearningneuralnetworkswithproperregularization/images.zip b/understandingthegeneralizationofadaminlearningneuralnetworkswithproperregularization/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..962ee55f6fdc35a94625c0afec644050ac15c34b --- /dev/null +++ b/understandingthegeneralizationofadaminlearningneuralnetworkswithproperregularization/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e0362919d1a234a4f5243bd254cfd9629b22532d834a6db21a8eda695195b4e0 +size 2552338 diff --git a/understandingthegeneralizationofadaminlearningneuralnetworkswithproperregularization/layout.json b/understandingthegeneralizationofadaminlearningneuralnetworkswithproperregularization/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..1405a4fbbc92b3d45a8424c62b8e1ebcb6146360 --- /dev/null +++ b/understandingthegeneralizationofadaminlearningneuralnetworkswithproperregularization/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c15211d15186d3c9799a79ddab928c45c3d0af793668b250f07f5bb3a0663708 +size 1818676 diff --git a/understandingtherobustnessofselfsupervisedlearningthroughtopicmodeling/3ecf79aa-a1e3-4f6f-993c-65ad330ad71a_content_list.json b/understandingtherobustnessofselfsupervisedlearningthroughtopicmodeling/3ecf79aa-a1e3-4f6f-993c-65ad330ad71a_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..32f45fc6556b56292e7c479377419a4c78f45407 --- /dev/null +++ b/understandingtherobustnessofselfsupervisedlearningthroughtopicmodeling/3ecf79aa-a1e3-4f6f-993c-65ad330ad71a_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:14c74e56afbf980f840b6ff817d3dc20b3535a38e67104b9a0653ea7ab7ac32c +size 201417 diff --git a/understandingtherobustnessofselfsupervisedlearningthroughtopicmodeling/3ecf79aa-a1e3-4f6f-993c-65ad330ad71a_model.json b/understandingtherobustnessofselfsupervisedlearningthroughtopicmodeling/3ecf79aa-a1e3-4f6f-993c-65ad330ad71a_model.json new file mode 100644 index 0000000000000000000000000000000000000000..b4f4403792632aeef1fdced27fbb0e2092f85d12 --- /dev/null +++ b/understandingtherobustnessofselfsupervisedlearningthroughtopicmodeling/3ecf79aa-a1e3-4f6f-993c-65ad330ad71a_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bbfb3c8d5cc182fe4d5f052f8f4f5e1853ec2f651a7f565cc82700fb8d6d972a +size 231255 diff --git a/understandingtherobustnessofselfsupervisedlearningthroughtopicmodeling/3ecf79aa-a1e3-4f6f-993c-65ad330ad71a_origin.pdf b/understandingtherobustnessofselfsupervisedlearningthroughtopicmodeling/3ecf79aa-a1e3-4f6f-993c-65ad330ad71a_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..17590b3f7059ae8d930c17ee6747124b84b0aa3f --- /dev/null +++ b/understandingtherobustnessofselfsupervisedlearningthroughtopicmodeling/3ecf79aa-a1e3-4f6f-993c-65ad330ad71a_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d77d38c62377c48b2241e1fb662dea1e9d9e2f2ea22935e71e6026f3f25e33d1 +size 4709316 diff --git a/understandingtherobustnessofselfsupervisedlearningthroughtopicmodeling/full.md b/understandingtherobustnessofselfsupervisedlearningthroughtopicmodeling/full.md new file mode 100644 index 0000000000000000000000000000000000000000..0632c3213ca7a14655fc48e52a800668a4ddb4de --- /dev/null +++ b/understandingtherobustnessofselfsupervisedlearningthroughtopicmodeling/full.md @@ -0,0 +1,813 @@ +# UNDERSTANDING THE ROBUSTNESS OF SELF-SUPERVISED LEARNING THROUGH TOPIC MODELING + +Zeping Luo*, Shiyou Wu*, Cindy Weng*, Mo Zhou†, Rong Ge† + +Duke University, USA + +\*{zeping.luo,shiyou.wu,cindy.weng}@duke.edu, $\dagger$ {moszhou,rongge}@cs.duke.edu + +# ABSTRACT + +Self-supervised learning has significantly improved the performance of many NLP tasks. However, how can self-supervised learning discover useful representations, and why is it better than traditional approaches such as probabilistic models are still largely unknown. In this paper, we focus on the context of topic modeling and highlight a key advantage of self-supervised learning - when applied to data generated by topic models, self-supervised learning can be oblivious to the specific model, and hence is less susceptible to model misspecification. In particular, we prove that commonly used self-supervised objectives based on reconstruction or contrastive samples can both recover useful posterior information for general topic models. Empirically, we show that the same objectives can perform on par with posterior inference using the correct model, while outperforming posterior inference using misspecified models. + +# 1 INTRODUCTION + +Recently researchers have successfully trained large-scale models like BERT (Devlin et al., 2018) and GPT (Radford et al., 2018), which offers extremely powerful representations for many NLP tasks (see e.g., Liu et al. (2021); Jaiswal et al. (2021) and references therein). To train these models, often one starts with sentences in a large text corpus, mark random words as "unknown" and ask the neural network to predict the unknown words. This approach is known as self-supervised learning (SSL). + +Why can self-supervised approaches learn useful representations? To understand this we first need to define what are "useful representations". A recent line of work (Tosh et al., 2021a; Wei et al., 2021) studied self-supervised learning in the context of probabilistic models: assuming the data is generated by a probabilistic model (such as a topic model or Hidden Markov Model), one can define representation of observed data as the corresponding hidden variables in the model (such as topic proportions in topic models or hidden states in Hidden Markov Model). These works show that self-supervised learning approach is as good as explicitly doing inference using such models. + +This approach naturally leads to the next question - why can self-supervised learning perform better than traditional inferencing based on probabilistic models? In this paper we study this question in the context of topic modeling, and highlight one key advantage for self-supervised learning: robustness to model misspecification. + +Many different models (such as Latent Dirichlet Allocation (LDA) (Blei et al., 2003), Correlated Topic Model (CTM) (Blei & Lafferty, 2007), Pachinko Allocation Model (PAM) (Li & McCallum, 2006)) have been applied in practice. Traditional approaches would require different ways of doing inference depending on which model is used to generate the data. On the other hand, we show that no matter which topic model is used to generate the data, if standard self-supervised learning objectives such as the reconstruction-based objective1 or the contrastive objective2 can be minimized, then they will generate representations that contain useful information about the topic proportions of a document. Self-supervised learning is oblivious to the choice of the probabilistic model, while the traditional approach of probabilistic modeling depends highly on the specific model. Therefore, one + +would expect self-supervised learning to perform similarly to inferencing with the correct model, and outperforms inferencing with misspecified model. + +To verify our theory, we run synthetic experiments to show that self-supervised learning indeed outperforms inferencing with misspecified models. Unlike large-scale models, our self-supervised learning is applied in the much simpler context of topic models, but we also demonstrate that even this simple application can improve over simple baselines on real data. + +# 1.1 RELATED WORKS + +Self-Supervised Learning Self-supervised learning recently has been shown to be able to learn useful representation, which is later used for downstream tasks. See for example Bachman et al. (2019); Caron et al. (2020); Chen et al. (2020a; b;c); Grill et al. (2020); Chen & He (2021); Tian et al. (2020a); He et al. (2020) and references therein. In particular, Devlin et al. (2018) proposed BERT, which shows that self-supervised learning has the ability to train large-scale language models and could provide powerful representations for downstream natural language processing tasks. + +Theoretical Understanding of Self-Supervised Learning Given the recent success of self-supervise learning, many works have been tried to provide theoretical understanding on contrastive learning (Arora et al., 2019; Wang & Isola, 2020; Tosh et al., 2021a; Tian et al., 2020b; HaoChen et al., 2021; Wen & Li, 2021; Zimmermann et al., 2021) and reconstruction-based learning (Lee et al., 2020; Saunshi et al., 2020; Teng & Huang, 2021). Also, several papers considered the problem from a multi-view perspective (Tsai et al., 2020; Tosh et al., 2021b), which covers both contrastive and reconstruction-based learning. Moreover, Wei et al. (2020) and Tian et al. (2021) studied the theoretical properties of self-training and the contrastive learning without the negative pairs respectively. Saunshi et al. (2020) investigated the benefits of pre-trained language models for downstream tasks. Most relevant to our paper, Tosh et al. (2021a) considered the contrastive learning in the topic models setting. Our theoretical results extend their theory to reconstruction-based objective (while also removing some assumptions for the contrastive objective), and our empirical results show that the reconstruction-based objective can be effectively minimized. + +Theoretical Analysis of Topic Models Many works have proposed provable algorithms to learn topic models, such as methods of moment based approaches (Anandkumar et al., 2012; 2013; 2014; 2015) and anchor word based approaches (Papadimitriou et al., 2000; Arora et al., 2012; 2016a; Gillis & Vavasis, 2013; Bittorf et al., 2012). Much less is known about provable inference for topic models. Sontag & Roy (2011) showed that MAP estimation can be NP-hard even for LDA model. Arora et al. (2016b) considered approximate inference algorithms. + +# 1.2 OUTLINE + +We first introduce the basic concepts of topic models and our objectives in Section 2. Then in Section 3 we prove guarantees for the reconstruction-based objective. Section 4 connects the contrastive objective to reconstruction-based objective which allows us to prove a stronger guarantee for the former. We then demonstrate the ability of self-supervised learning to adapt to different models by synthetic experiments in Section 5. Finally, we also evaluate the reconstruction-based objective on real-data to show that despite the simplicity of the topic modeling context, it extracts reasonable representations in Section 6. + +# 2 PRELIMINARIES + +In this section we first introduce some general notations. Then we briefly describe the topic models we consider in Section 2.1. Finally we define the self-supervised learning objectives in Section 2.3 and give our main results. + +Notation We use $[n]$ to denote set $\{1,2,\dots,n\}$ . For vector $x\in \mathbb{R}^d$ , denote $\| x\|$ as its $\ell_2$ norm and $\| x\| _1$ as its $\ell_1$ norm. For matrix $A\in \mathbb{R}^{m\times n}$ , we use $A_{i}\in \mathbb{R}^{m}$ to denote its $i$ -th column. When matrix $A$ has full column rank, denote its left pseudo-inverse as $A^\dagger = (A^\top A)^{-1}A^\top$ . For matrix or general tensor $T\in \mathbb{R}^{d_1\times \dots \times d_l}$ , we use vector $\mathrm{vec}(T)\in \mathbb{R}^{d_1\dots d_l}$ to represent its vectorization. Let $\mathcal{S}_k = \{x\in \mathbb{R}^k |\sum_{i = 1}^k x_i = 1,x_i\geq 0\}$ to denote $k - 1$ dimensional probability simplex. For two probability vectors $p,q$ , define their total variation (TV) distance as $\mathrm{TV}(p,q) = \| p - q\| _1 / 2$ . + +# 2.1 TOPIC MODELS + +Many topic models treat documents as a bag-of-words and use a two-step procedure of generating a document: first each document is viewed as a probability distribution of topics (often called the topic proportions $w$ ), and each topic is viewed as a probability distribution over words. To generate a word, one first selects a topic based on the topic proportions $w$ , and then samples a word from that particular topic. Since the topic distributions are shared across the entire corpus, and the topic proportion vector $w$ is specific to documents, it makes sense to define $w$ as the representation for the document. + +More precisely, let $\mathcal{V}$ be a finite vocabulary with size $V$ and $\kappa$ be a set of $K$ topics, where each topic is a distribution over $\mathcal{V}$ . We denote the topic-word matrix as $A$ with $A_{ij} = \mathbb{P}(\text{word } i \mid \text{topic } j)$ , so that each column in $A$ represents the word distribution of a topic. Each document corresponds to a convex combination of different topics with proportions $w$ . For each word in the document, first sample a topic $z$ according to the topic proportions $w$ , and then sample the word from the corresponding topic (equivalently, one can also sample a word from distribution $Aw$ ). Different topic models differ in how they generate $w$ , which we formulate in the following definition: + +Definition 2.1 (General Topic Model). A general topic model specifies a distribution $\Delta(K)$ for each number of topics $K$ . Given a topic-word matrix $A$ and $\Delta(K)$ , to generate a document, one first sample $w \sim \Delta(K)$ and then sample each word in the document from the distribution $Aw$ . + +Here $\Delta(K)$ is a prior distribution of $w$ which is crucial when trying to infer the true topic proportions $w$ given the words in a document. Of course, different topic models may also specify different priors for the topic-word matrix $A$ . However, given a large number of documents generated from the topic model, in many settings one can hope to learn the topic-word matrix $A$ and the prior distribution $\Delta(K)$ (see e.g., Arora et al. (2012; 2016a)), therefore we consider the following inference problem: + +Definition 2.2 (Topic Inference). Given a topic-word matrix $A$ , prior distribution $\Delta(K)$ for topic proportions $w$ , and a document $x$ , the topic inference problem tries to compute the posterior distribution $w|(x, A)$ given the prior $w \sim \Delta(K)$ . + +Note that our general topic model can capture many standard topic models, including pure topic model, LDA, CTM and PAM. + +# 2.2 SEMI-SUPERVISED LEARNING SETUP + +Our goal is to understand the representation learning aspect of self-supervised learning, where we are given large number of unlabeled documents and a small number of labeled documents. In the unsupervised learning stage, the algorithm only has access to the unlabeled documents, and the goal is to learn a representation (a mapping from documents to a feature vector). In the supervised learning stage, the algorithm would use the labeled documents to train a simple classifier that maps the feature vector to the actual label. We often refer to the unsupervised learning stage as "feature learning" and the supervised learning stage as "downstream application". + +In the theoretical model, we assume that the label $y$ is a simple function of the topic proportions $w$ . The goal is to apply self-supervised learning on the unlabeled documents to get a good representation, and then use this representation to predict the label $y$ . Of course, if one knows the actual parameters of the model, the best predictor for $y$ would be to first estimate the posterior distribution $w$ and then apply the function that maps $w$ to label $y$ . We will show that for functions that are approximable by low degree polynomials self-supervised learning can always provide a good representation. + +# 2.3 SELF-SUPERVISED LEARNING + +In general, self-supervised learning tries to turn unlabeled data into a supervised learning problem by hiding some known information. There are many ways to achieve this goal (see e.g., Liu et al. (2021); Jaiswal et al. (2021)). In this paper, we focus on two different approaches for self-supervised learning: reconstruction-based objective and contrastive objective. We first formally define the objectives and then discuss our corresponding result. + +Reconstruction-Based Objective One common approach of self-supervised learning is to first mask part of the data and then try to find a function $f$ to reconstruct the missing part given the unmasked part of input. This is commonly used for language modeling (Devlin et al., 2018; Radford et al., + +2018). In the context of topic modelling, suppose all the documents are generated from an underlying topic model with $A$ and $\Delta(K)$ . Then for any given document $x_{\mathrm{unsup}}$ , since each word is i.i.d. sampled (so that the order of words is not important), we pick $t$ random words from the document and mark them as unknown, then we ask the learner to predict these $t$ words given the remaining words in the document. Specifically, we split $x_{\mathrm{unsup}}$ into $x$ and $y$ where $y$ is the $t$ words that we select and let $x$ is the document with these $t$ words removed. We aim to select a predictor $f$ that minimizes the following reconstruction objective: + +$$ +\min _ {f} L _ {\text {r e c o n s t}} (f) \triangleq \mathbb {E} _ {x, y} [ \ell (f (x), y) ], \tag {1} +$$ + +where $\ell (\hat{y},y) = \sum_{k} - y_{k}\log \hat{y}_{k}$ is the cross entropy loss. Here we slightly abuse the notation to use $y$ as an one-hot vector for $V^t$ classes and $f$ also outputs a probability vector on $\mathcal{V}^t$ . Depending on the context, we will use $y$ to denote either the actual next $t$ words or its corresponding one-hot label. Now we are ready to present our result for the reconstruction-based objective: + +Theorem 2.3. (Informal) Consider the general topic model setting as Definition 2.1, suppose function $f$ minimizes the reconstruction-based objective (1). Then, any polynomial $P(w)$ of the posterior $w|(x,A)$ with degree at most $t$ can be represented by a linear function of $f(x)$ . + +The theorem shows that if we want to get basic information about posterior distribution (such as mean, variance), then it suffices to predict a small constant number of words (1 for mean and 2 for variance). See Theorem 3.1 for the formal statement. + +Contrastive Objective Another common approach in self-supervised learning is the contrastive learning (He et al., 2020; Chen et al., 2020a). In contrastive learning, the training data is usually a pair of data $(x,x^{\prime})$ with a label $y\in \{0,1\}$ , where label 1 means $(x,x^{\prime})$ is a positive sample ( $x$ and $x^{\prime}$ are similar) and label 0 means $(x,x^{\prime})$ is a negative sample ( $x$ and $x^{\prime}$ are dissimilar). The task is to find a function $f$ such that it can distinguish the positive sample and negative sample, i.e., $f(x,x^{\prime}) = y$ . Formally, we want to select a predictor $f$ such that it minimizes the following contrastive objective: + +$$ +\min _ {f} L _ {\text {c o n t r a s t}} \triangleq \mathbb {E} _ {x, x ^ {\prime}, y} [ \ell (f (x, x ^ {\prime}), y) ]. \tag {2} +$$ + +In the context of topic models, following previous work (Tosh et al., 2021a), we generate the data $(x,x^{\prime},y)$ as follows. Suppose all documents are generated from an underlying topic model with $A$ and $\Delta (K)$ . We first generate a document $x$ from the word distribution $Aw$ where $w$ is sampled from $\Delta (K)$ . Then, (i) with half probability we generate $t$ words from the same distribution $Aw$ to form the document $x^{\prime}$ and set $y = 1$ ; (ii) with half probability we generate $t$ words from a different word distribution $Aw^{\prime}$ with $w^{\prime}\sim \Delta (K)$ (so that $w\neq w^{\prime}$ ) and set $y = 0$ . We consider the square loss $\ell (\hat{y},y) = (\hat{y} -y)^2$ for simplicity. + +We now give our informal result on contrastive objective. See Theorem 4.1 for the formal statement. Note that this theorem generalizes Theorem 3 in Tosh et al. (2021a). + +Theorem 2.4. (Informal) Consider the general topic model setting as Definition 2.1, suppose function $f$ minimizes the contrastive objective (2). Then we can use $f$ and enough documents to construct a representation $g(x)$ such that any polynomial $P(w)$ of the posterior $w|(x,A)$ with degree at most $t$ can be represented by a linear function of $g(x)$ . + +Advantage of SSL approach Note that neither objectives (1) or (2) depend on the prior distribution $\Delta(K)$ , so it is possible to optimize these without specifying a specific model; on the other hand, even the definition of topic inference (Definition 2.2) relies heavily on $\Delta(K)$ . + +# 3 GUARANTEES FOR THE RECONSTRUCTION-BASED OBJECTIVE + +In this section, we consider the reconstruction-based objective (1) and provide theoretical guarantees for its performance. We first show that if such objective with $t$ unknown words can be minimized, then any polynomial of topic posterior $w|(x,A)$ with degree at most $t$ can be represented by a linear function of the learned representation. + +Theorem 3.1 (Main Result). Consider the general topic model setting as Definition 2.1, suppose topic-word matrix $A$ satisfies $\text{rank}(A) = K$ and function $f$ minimizes the reconstruction-based objective (1). Then, for any document $x$ and its posterior $w|(x,A)$ , the posterior mean of any + +polynomial $P(w)$ with degree at most $t$ is linear in $f(x)$ . That is, there exists a $\theta \in \mathbb{R}^{V^t}$ such that for all documents $x$ + +$$ +\mathbb {E} _ {w} [ P (w) | x, A ] = \theta^ {\top} f (x). +$$ + +To understand this theorem, first consider a warm-up example where $t = 1$ (see details in Section A.1 in appendix). Intuitively, in this case the best way to predict the missing word for a given document $x$ is to estimate its topic proportion $w$ , and then predict the word using $Aw$ where $A$ is the topic-word matrix. Therefore, if the output of self-supervised learning $f(x)$ (which is a $V$ -dimensional vector indexed by words) minimizes the loss, then $f(x)$ must have the form $f(x) = A\mathbb{E}[w|x,A]$ . When $A$ is full rank multiplying by the pseudo-inverse of $A$ recovers the expectation of the posterior $w|(x,A)$ . The proof for the general case of predicting $t$ -words requires more careful characterization of the optimal prediction and its relationship to $\mathbb{E}_w[P(w)|x,A]$ , which we defer to Section A.2. + +The above discussion also suggests that though the representation dimension may seem to be $V^t$ , its "effective" dimension is in fact $K^t$ which is much smaller than $V^t$ . See more details in Appendix A.4. + +Robustness for an approximate minimizer In Theorem 3.1 we focus on the case when function $f$ is exactly the minimizer of the reconstruction-based objective (1), i.e., $L_{\mathrm{reconst}}(f) = L_{\mathrm{reconst}}^* \triangleq \min_f L_{\mathrm{reconst}}(f)$ . However, in practice one cannot hope to find such a function exactly. In the following, we provide a robust version of Theorem 3.1 such that it allows us to find an approximate solution instead of the exact optimal solution. + +To present our result, we need to first introduce the following notion of condition number, which was used in many previous works, such as collaborative filtering systems (Kleinberg & Sandler, 2008) and topic models (Arora et al., 2016b). Intuitively, $\kappa(B)$ measures how large a vector would change after multiplying with $B$ in the $\ell_1$ norm sense. + +Definition 3.2 ( $\ell_1$ Condition Number). For matrix $B \in \mathbb{R}^{m \times n}$ , define its $\ell_1$ condition number $\kappa(B)$ as $\kappa(B) \triangleq \min_{x \in \mathbb{R}^n: x \neq 0} \| Bx \|_1 / \| x \|_1 = \max_{i \in [n]} \| B_i \|_1$ , where $B_i$ is the $i$ -th column of $B$ . + +Let $W_{post} \in \mathbb{R}^{K \times \dots \times K}$ be the topic posterior tensor for $t$ unknown words $y = (y_1, \ldots, y_t)$ given remaining document $x$ . That is, for each entry $[W_{post}]_{z_1, \ldots, z_k} = \mathbb{P}$ (for all $i, z_i$ is the topic of word $y_i | x, A$ ) $= \mathbb{E}_w[w_{z_1} \cdots w_{z_t} | x, A]$ and $W_{post} = \mathbb{E}_w[w^{\otimes t} | x, A]$ . Thus, any polynomial $P(w)$ of degree at most $t$ can be represented as $\mathbb{E}_w[P(w) | x, A] = \beta^\top \operatorname{vec}(W_{post})$ for some $\beta$ , where $\operatorname{vec}(W_{post}) \in \mathbb{R}^{K^t}$ is the vectorization of $W_{post}$ . + +We now are ready to present the robust version of Theorem 3.1. It shows if we only find a function $f$ whose loss is at most $\epsilon$ larger than the optimal loss, then a linear transformation of our learned representation can still give a good approximation of the target polynomial within a $O(\epsilon)$ error. + +Theorem 3.3 (Robust Version). Consider the general topic model setting as Definition 2.1, suppose topic-word matrix $A$ satisfies $\text{rank}(A) = K$ and function $f$ satisfies $L_{\text{reconst}}(f) \leq L_{\text{reconst}}^* + \epsilon$ for some $\epsilon > 0$ . Then, for any document $x$ and its posterior $w|(x, A)$ , the posterior mean of any polynomial $P(w)$ with degree at most $t$ is approximately linear in $f(x)$ . That is, there exists a $\theta \in \mathbb{R}^{V^t}$ such that + +$$ +\mathbb {E} _ {x} \left[ \left(\mathbb {E} _ {w} [ P (w) | x, A ] - \theta^ {\top} f (x)\right) ^ {2} \right] \leq 2 \| \beta \| ^ {2} \kappa^ {2 t} (A ^ {\dagger}) \epsilon , +$$ + +where $\mathbb{E}_w[P(w)|x,A] = \beta^\top vec(W_{post})$ + +Note that the dependency on $\| \beta \| ^2\kappa^{2t}(A^\dagger)$ is expected, since this is the norm $\| \theta \| ^2$ that we would have if $\epsilon = 0$ , i.e., the $\theta$ we would have in Theorem 3.1. Thus, this quantity should be understood as the complexity of the target function for the downstream task. Empirically we show that $\kappa (A^{\dagger})$ is small in Section C.6. The proof is deferred to Section A.3. + +# 4 GUARANTEES FOR THE CONTRASTIVE OBJECTIVE + +In this section, we consider the contrastive objective (2) for self-supervised learning and provide similar provable guarantees on its performance as the reconstruction-based objective. + +We use the same approach as Tosh et al. (2021a) to construct a representation $g(x)$ . Given a set of landmark documents $\{l_i\}_{i=1}^m$ with length $|l_i| = t$ as references, the representation is defined as + +$$ +g \left(x, \left\{l _ {i} \right\} _ {i = 1} ^ {m}\right) = \left(g \left(x, l _ {1}\right), \dots , g \left(x, l _ {m}\right)\right) ^ {\top}, \quad g \left(x, x ^ {\prime}\right) = \frac {f \left(x , x ^ {\prime}\right)}{1 - f \left(x , x ^ {\prime}\right)}. \tag {3} +$$ + +The following theorem gives the theoretical guarantee for this representation. Similar to Theorem 3.1 for reconstruction-based objective, it shows that any polynomial $P(w)$ of degree at most $t$ can be represented by a linear function of the learned representation. Our proof here relies on the observation that having $g(x, \{l_i\}_{i=1}^m)$ for all short landmark documents of length $t$ gives similar information as $f$ in the reconstruction-based objective does. This observation allows us to remove the anchor words assumption needed in (Tosh et al., 2021a). + +Theorem 4.1. Consider the general topic model setting as Definition 2.1, suppose topic-word matrix $A$ satisfies $\text{rank}(A) = K$ and function $f$ minimizes the contrastive objective (2). Assume we randomly sampled $m = K^t$ different landmark documents $\{l_i\}_{i=1}^m$ and construct $g(x, \{l_i\}_{i=1}^m)$ as (3). Then, for any document $x$ and its posterior $w|(x,A)$ , the posterior mean of any polynomial $P(w)$ with degree at most $t$ is linear in $g(x, \{l_i\}_{i=1}^m)$ . That is, there exists $\theta \in \mathbb{R}^m$ such that for all documents $x$ + +$$ +\mathbb {E} _ {w} [ P (w) | x, A ] = \theta^ {\top} g (x, \{l _ {i} \} _ {i = 1} ^ {m}). +$$ + +In fact, one can use the same set of documents for both representation and downstream task so that we do not need additional landmark documents. + +# 5 SYNTHETIC EXPERIMENTS + +In this section, we optimize the reconstruction-based objective (1) on data generated by several topic models to show that self-supervised learning performs on par with inference using correct model, and both of them outperform inference with misspecified models. + +# 5.1 TOPIC MODELS + +We consider four types of topic models in our experiments. Our first topic model is the pure-topic model, where each document's topic comes from a discrete uniform distribution over the $K$ -dimensional linear basis, namely $\{e_1, e_2, \dots, e_K\}$ . Our second topic model is the Latent Dirichlet Allocation (LDA) model, where $\Delta(K)$ is a symmetric Dirichlet distribution $\mathrm{Dir}(1 / K)$ . + +We are also interested in topic models that involve more subtle topic correlations and similarities between different topic's word distributions. To this end, we consider the Correlated Topic Model (CTM) (Blei & Lafferty, 2007) and the Pachinko Allocation Model (PAM) (Li & McCallum, 2006). Our goal is to construct settings where the correlation between topics provide useful information for inference. To achieve this goal, in CTM, we construct groups of 4 topics. Within the group, topic pairs (0,2) and (1,3) are highly correlated (as specified by the prior), while topics 0 and 1 share many words (see Figure 1 for an illustration of the setting). In this case, if we observe a document with words that could either belong to topic 0 or 1, but this same document also has words that are associated with topic 2, we can infer that the first set of words are likely from topic 0, not topic 1. We construct such correlations in CTM by setting the diagonal entries of its Gaussian covariance matrix to 15 and the covariance between correlated pairs of topics to 0.99 times the diagonal entries, with the remaining entries set to zero. We construct similar examples for PAM, see Appendix C for details. + +# 5.2 SIMULATION SETUP + +Document generation Our documents are synthetically generated through the following steps: we first construct a $V \times K$ topic-word matrix $A$ . Then, for each document, we determine the document length $n$ from Poisson distribution $\mathrm{Pois}(\lambda)$ , draw a topic distribution $w$ from $\Delta(K)$ , and draw $n$ words i.i.d. from the word distribution given by $Aw$ . In our simulation, we set $K = 20$ , $V = 5000$ , $\lambda \in \{30, 60\}$ . Often $A$ will be drawn from a Dirichlet distribution $\mathrm{Dir}(\alpha / K)$ (see Appendix C for details), and we take $\alpha = 1, 3, 5, 7, 9$ to vary the difficulty level of the inference problem, where a larger $\alpha$ introduces more similarity between topics. + +![](images/831ee054a28b2e61203df0c559932940570a673e9ba1653b08e14c70c326ce1e.jpg) +Figure 1: One example of a group of 4 topics in the Correlated Topic Model. Left: Weight of each topic in a document's topic proportion. In this example topics 1 and 3 have large proportions as they are correlated. Right: Pairwise topic similarity (cosine similarity of the pair's word distribution). + +![](images/2a84df1188baa9305960ddf4b1bb5b80d972d1596e975ac443102740f2373ea7.jpg) + +Neural network models We consider two different network architectures as $f$ in the experiments: (1) Fully-connected network with residual connection, with bag-of-words document representation as the input since the order does not matter in topic models; (2) Attention-based architecture. Due to the architecture of attention, the input needs to be a sequence of words instead of bag-of-words vector. Thus, we transform bag-of-words representation into full document by repeating each word by its frequency and concatenating them in random order, and then use the full document as the input. More specifically, the attention-based architecture contains 8 transformer blocks where each transformer block consists of a 768-dimensional attention layer and a feed-forward layer, with residual connection applied around every block. The network's second to last layer averages over the outputs of the last transformer block and the final layer projects it to a $V$ -dimensional word distribution. See more details in Section C.5. We find that fully-connected neural network with residual connections performs the best on recovering topic posterior distribution for pure-topic and LDA documents, and attention-based architecture (Vaswani et al., 2017) performs the best for recovering topic posterior distribution for CTM and PAM documents. + +Training setup During training, we resample 60,000 new documents after every 2 epochs, and the total amount of training data varies from 720K documents to 6M documents. The loss function is the reconstruction-based objective (1) with $t = 1$ , i.e., we want the model to predict one missing word. To reduce the variance during the training, in each training document, we sampled 6 words as the prediction target, hide them from the model and ask the model to predict each word separately. The trained model is evaluated on test documents generated from the same topic prior as the training documents. We use 5,000 test documents for the pure-topic prior and 200 test documents for the remaining priors. For each test document, we use MCMC (see Appendix C.9) assuming the document's correct topic prior to approximate the ground truth topic posterior. To get the posterior estimations from SSL approach, we multiply the pseudo-inverse of the topic matrix $A$ with the model output $f(x)$ to get the estimated posterior mean vector $A^{\dagger}f(x)$ as we explained in Section 3 (and also Section A.1). Then, we measure topic posterior recovery loss as the Total Variation (TV) distance between the recovered topic posterior mean vector and the ground truth topic posterior mean vector. + +# 5.3 EXPERIMENT RESULTS + +Topic posterior recovery As illustrated in Table 1, after 200 training epochs, our model can accurately recover the topic posterior mean vector. Meanwhile, it can be observed that for larger values of the Dirichlet hyperparameter $\alpha$ , the recovery loss gets higher. This is expected because higher $\alpha$ leads to more similar topics, which makes the learning problem more difficult. This effect is also captured by Definition 3.2 and we show the computed condition numbers in Section C.6. + +Major topic recovery We examine the extent our recovered topic posterior captures the major topics in a given document. For pure-topic and LDA documents, we measure major topic recovery accuracy of correctly estimating the topic with largest proportion. Considering that topics in CTM and PAM documents are correlated in pairs, we measure the major topic recovery accuracy for CTM and PAM as the top-2 topic overlap rate on their test documents. Table 1 shows that our algorithm is successful throughout all settings we consider. + +Robustness of self-supervised learning We compare the self-supervised approach to traditional topic inference (MCMC with a specified topic prior, the results on variational inference are reported + +
TV Distance αDocument Type
PureLDACTMPAM
10.0148 ± 0.00200.0757 ± 0.00330.0550 ± 0.00370.0489 ± 0.0025
30.0308 ± 0.00760.0899 ± 0.00530.0799 ± 0.00480.0712 ± 0.0038
50.0501 ± 0.00300.1041 ± 0.00620.0970 ± 0.00570.0787 ± 0.0043
70.0391 ± 0.00220.1233 ± 0.00710.1071 ± 0.00680.0960 ± 0.0057
90.0517 ± 0.00450.1358 ± 0.00890.1101 ± 0.00640.0971 ± 0.0053
+ +
Major Topic(s)Recovery AccuracyαDocument Type
PureLDACTMPAM
11.0000± 0.00000.9050± 0.04060.9175± 0.02750.9025± 0.0330
31.0000± 0.00000.8750± 0.04580.8900± 0.03110.8950± 0.0344
51.0000± 0.00000.9000± 0.04160.8975± 0.02960.8675± 0.0407
71.0000± 0.00000.9150± 0.03870.8675± 0.03830.8675± 0.0407
90.9950± 0.00980.9100± 0.03970.8850± 0.03300.8325± 0.0461
+ +Table 1: Self-supervised learning approach performs reasonably on recovering the topic posterior mean. Left: TV distance between recovered topic posterior (self-supervised learning approach) and true topic posterior for different topic models. Right: Major topic(s) recovery accuracy for different topic models. The $95\%$ confidence interval is reported in both tables. + +
TV Distance MethodDocument Type (α = 1)
PureLDACTMPAM
LDA0.0406 ± 0.0016-0.1182 ± 0.00990.1218 ± 0.0096
CTM0.2083 ± 0.00380.2060 ± 0.0064-0.3154 ± 0.0082
PAM0.3782 ± 0.00380.3459 ± 0.01280.3939 ± 0.0096-
SSL (ours)0.0148 ± 0.00200.0757 ± 0.00330.0550 ± 0.00370.0489 ± 0.0025
+ +
Major Topic(s) Recovery MethodDocument Type (α = 1)
LDACTMPAM
LDA0.91500.88500.8500
± 0.0387± 0.0344± 0.0360
CTM0.90000.91750.8300
± 0.0416± 0.0275± 0.0370
PAM0.87500.72500.9050
± 0.0458± 0.0397± 0.0320
SSL (ours)0.90500.91750.9025
± 0.0406± 0.0275± 0.0330
+ +Table 2: Robustness of self-supervised learning approach. Left: TV distance between recovered topic posterior and true topic posterior of self-supervised learning approach versus posterior inference via Markov Chain Monte Carlo assuming a specific prior for $\alpha = 1$ . Right: Major topic recovery rate of our approach versus posterior inference via Markov Chain Monte Carlo assuming a specific prior for $\alpha = 1$ . In both table, the $95\%$ confidence interval is reported. + +in Section C.3). Specifically, for each $\alpha$ value, we take 200 test documents from each category of documents, and we run posterior inference assuming a specific topic model and calculate the TV distance between this posterior mean vector and the ground truth posterior mean vector. We exclude assuming pure-topic prior from our comparison because it gives invalid results for documents with mixed topics. For $\alpha = 1$ , as shown in Table 2, the topic posterior recovered from SSL approach is closer to the ground truth topic posterior than that recovered from a misspecified topic prior. + +We also report the major topic recovery accuracy for SSL approach against topic inference using both correct and incorrect topic model in Table 2. The major topic recovery rate of SSL approach is similar to that of posterior inference assuming the correct prior. For pure topic model, all four methods get $100\%$ major topics recovery rate on pure-topic documents. For LDA, again all four methods perform similarly well since the instance is not difficult. However we observe significant difference for more complicated CTM and PAM models. For these models, the SSL approach performs similarly to posterior inference using the correct model, and both of them are significantly better than posterior inference using misspecified models. The results for $\alpha = 3,5,7,9$ are presented in Section C. The comparison further reveals the robustness of self-supervised learning. + +# 6 EXPERIMENTS ON REAL DATA + +The self-supervised learning approach studied in this paper is simplified for theoretical analysis as it uses a bag-of-words approach. In this section, we show that although this simplified approach is not state-of-art, it has reasonable performance compared to several baselines. + +Experiment Setup We use the AG news dataset (Zhang et al., 2015), in which each document has a label of one out of four categories: world, sports, business, and sci/tech. Each category has 30,000 samples in the training set and 19,000 samples in the testing set. The number of words in the vocabulary is about 16,700. We generally follow the experiment setup done by Tosh et al. (2021a) (see more details in Section D.1), but the representation we used is generated by our reconstruction-based objective. Experiment results on two additional datasets are provided in Appendix D. + +![](images/33b9761a9c0b89b7cf0bb12b2778343265b1f332d3f290db09229fa162ead06c.jpg) +Figure 2: Performances of RBL, NCE and baselines (BOW, Word2vec, LDA) on real data. + +Our training follows the semi-supervised setup that involves two major phases: unsupervised phase and supervised phase. In the unsupervised phase, we train the self-supervised model with reconstruction-based objective on most of training data. In the supervised phase, using the document representation generated by the SSL model as input, we train a linear classifier to classify the category of the documents using multi-class logistics regression (by Scikit-learn (Pedregosa et al., 2011)) with 3-fold cross validation for parameter tuning ( $l_{2}$ regularization term and solver). We measure the topic recovery accuracy on test set to compare the performance of different methods. + +We choose residual blocks as the basic building block for our neural network architecture, with varying width and depth. The network used for Figure 2 has 3 residual blocks and a width of 4096 neurons per layer. Other detailed hyperparameters and ablation studies can be found in Appendix D.3. We train the model using reconstruction-based objective (1) with $t = 1$ using the same variance-reduction technique in synthetic experiments. + +To extract our representation, we use an identity matrix to replace the last layer. That is, we take a softmax function on top of the second-to-last layer of the neural network. This is different from our theory but we found that it effectively reduces the high output dimension and improves performance. We include more details in Section D.2 in Appendix. + +Experiment Results The performance of Reconstruction-Based Learning representation (RBL) is shown in Figure 2, where the test accuracy on representation is plotted against number of training samples used to train the classifier in supervised learning phase. The representation RBL performs better than both bag-of-words (BOW), Word2vec and LDA baselines (see more details about baselines in Section D.2). Notably, Word2vec representation is inferior only by a small margin, and works well in general even when limited training samples are provided. On the contrary, although BOW representation has a decent test accuracy when training samples are abundant, it performs significantly poorly on smaller training set. + +We also compare our result to previous noise contrastive estimation (NCE) representation benchmark achieved by Tosh et al. (2021a) using contrastive objective, where their reported best accuracy is around $87.5\%$ when full 4000 training samples are used, slightly higher than our RBL corresponding test accuracy of $87.1\%$ . In our attempt to reproduce their result, parameter tuning yields the best accuracy of $86\%$ when full training samples were used. We plot our own reproduced results on in Figure 2 since parameter tuning does not achieve a close benchmark to their result. + +# 7 CONCLUSION AND LIMITATIONS + +"All models are wrong but some are useful." If one self-supervised objective can capture all models, then it would be able to extract useful information. In this paper, we studied the self-supervised learning in the topic models setup and showed that it can provide useful information about the topic posterior no matter what topic model is used. Our results generalized previous work (Tosh et al., 2021a) to both contrastive learning and reconstruction-based learning and our techniques allow us to depend on weaker assumptions. We also empirically showed that the reconstruction-based learning performs better than the posterior inference under misspecified models, and it can provide useful representation for the topic inference problem. Our theoretical analysis is limited to a bag-of-words setting, which also limits its empirical performance. Extending the work to more complicated models is an immediate open problem. + +# ACKNOWLEDGEMENT + +This work is supported by NSF Award DMS-2031849, CCF-1845171 (CAREER), CCF-1934964 (Tripods) and a Sloan Research Fellowship. + +# REFERENCES + +Anima Anandkumar, Dean P Foster, Daniel Hsu, Sham M Kakade, and Yi-Kai Liu. A spectral algorithm for latent dirichlet allocation. Algorithmica, 72(1):193-214, 2015. +Animashree Anandkumar, Daniel Hsu, and Sham M Kakade. A method of moments for mixture models and hidden markov models. In Conference on Learning Theory, pp. 33-1. JMLR Workshop and Conference Proceedings, 2012. +Animashree Anandkumar, Rong Ge, Daniel Hsu, and Sham Kakade. A tensor spectral approach to learning mixed membership community models. In Conference on Learning Theory, pp. 867-881. PMLR, 2013. +Animashree Anandkumar, Rong Ge, Daniel Hsu, Sham M Kakade, and Matus Telgarsky. Tensor decompositions for learning latent variable models. Journal of machine learning research, 15: 2773-2832, 2014. +Sanjeev Arora, Rong Ge, and Ankur Moitra. Learning topic models—going beyond svd. In 2012 IEEE 53rd annual symposium on foundations of computer science, pp. 1-10. IEEE, 2012. +Sanjeev Arora, Rong Ge, Ravi Kannan, and Ankur Moitra. Computing a nonnegative matrix factorization—provably. SIAM Journal on Computing, 45(4):1582-1611, 2016a. +Sanjeev Arora, Rong Ge, Frederic Koehler, Tengyu Ma, and Ankur Moitra. Provable algorithms for inference in topic models. In International Conference on Machine Learning, pp. 2859-2867. PMLR, 2016b. +Sanjeev Arora, Hrishikesh Khandeparkar, Mikhail Khodak, Orestis Plevrakis, and Nikunj Saunshi. A theoretical analysis of contrastive unsupervised representation learning. arXiv preprint arXiv:1902.09229, 2019. +Philip Bachman, R Devon Hjelm, and William Buchwalter. Learning representations by maximizing mutual information across views. arXiv preprint arXiv:1906.00910, 2019. +Victor Bittorf, Benjamin Recht, Christopher Re, and Joel A Tropp. Factoring nonnegative matrices with linear programs. arXiv preprint arXiv:1206.1270, 2012. +David M Blei and John D Lafferty. A correlated topic model of science. The annals of applied statistics, 1(1):17-35, 2007. +David M Blei, Andrew Y Ng, and Michael I Jordan. Latent dirichlet allocation. the Journal of machine Learning research, 3:993-1022, 2003. +Mathilde Caron, Ishan Misra, Julien Mairal, Priya Goyal, Piotr Bojanowski, and Armand Joulin. Unsupervised learning of visual features by contrasting cluster assignments. arXiv preprint arXiv:2006.09882, 2020. +Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In International conference on machine learning, pp. 1597-1607. PMLR, 2020a. +Ting Chen, Simon Kornblith, Kevin Swersky, Mohammad Norouzi, and Geoffrey Hinton. Big self-supervised models are strong semi-supervised learners. arXiv preprint arXiv:2006.10029, 2020b. +Xinlei Chen and Kaiming He. Exploring simple siamese representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 15750-15758, 2021. + +Xinlei Chen, Haoqi Fan, Ross Girshick, and Kaiming He. Improved baselines with momentum contrastive learning. arXiv preprint arXiv:2003.04297, 2020c. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018. +Nicolas Gillis and Stephen A Vavasis. Fast and robust recursive algorithms for separable nonnegative matrix factorization. IEEE transactions on pattern analysis and machine intelligence, 36(4): 698-714, 2013. +Jean-Bastien Grill, Florian Strub, Florent Alché, Corentin Tallec, Pierre H Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Daniel Guo, Mohammad Gheshlaghi Azar, et al. Bootstrap your own latent: A new approach to self-supervised learning. arXiv preprint arXiv:2006.07733, 2020. +Jeff Z HaoChen, Colin Wei, Adrien Gaidon, and Tengyu Ma. Provable guarantees for self-supervised deep learning with spectral contrastive loss. arXiv preprint arXiv:2106.04156, 2021. +Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9729-9738, 2020. +Ashish Jaiswal, Ashwin Ramesh Babu, Mohammad Zaki Zadeh, Debapriya Banerjee, and Fillia Makedon. A survey on contrastive self-supervised learning. Technologies, 9(1):2, 2021. +Jon Kleinberg and Mark Sandler. Using mixture models for collaborative filtering. Journal of Computer and System Sciences, 74(1):49-69, 2008. +Jason D Lee, Qi Lei, Nikunj Saunshi, and Jiacheng Zhuo. Predicting what you already know helps: Provable self-supervised learning. arXiv preprint arXiv:2008.01064, 2020. +Wei Li and Andrew McCallum. Pachinko allocation: Dag-structured mixture models of topic correlations. In Proceedings of the 23rd international conference on Machine learning, pp. 577-584, 2006. +Xiao Liu, Fanjin Zhang, Zhenyu Hou, Li Mian, Zhaoyu Wang, Jing Zhang, and Jie Tang. Self-supervised learning: Generative or contrastive. IEEE Transactions on Knowledge and Data Engineering, 2021. +Andrew L. Maas, Raymond E. Daly, Peter T. Pham, Dan Huang, Andrew Y. Ng, and Christopher Potts. Learning word vectors for sentiment analysis. In Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies, pp. 142-150, Portland, Oregon, USA, June 2011. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/P11-1015. +Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems, pp. 3111-3119, 2013. +Christos H Papadimitriou, Prabhakar Raghavan, Hisao Tamaki, and Santosh Vempala. Latent semantic indexing: A probabilistic analysis. Journal of Computer and System Sciences, 61(2):217-235, 2000. +Deepak Pathak, Philipp Krahenbuhl, Jeff Donahue, Trevor Darrell, and Alexei A Efros. Context encoders: Feature learning by inpainting. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2536-2544, 2016. +F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825-2830, 2011. +Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training. 2018. + +Ali Rahimi and Benjamin Recht. Random features for large-scale kernel machines. In Advances in Neural Information Processing Systems, volume 20, 2007. URL https://proceedings.neurips.cc/paper/2007/file/013a006f03dbc5392effeb8f18fda755-Paper.pdf. +Radim Rehurek and Petr Sojka. Gensim--python framework for vector space modelling. NLP Centre, Faculty of Informatics, Masaryk University, Brno, Czech Republic, 3(2), 2011. +John Salvatier, Thomas V Wiecki, and Christopher Fonnesbeck. Probabilistic programming in python using pymc3. PeerJ Computer Science, 2:e55, 2016. +Nikunj Saunshi, Sadhika Malladi, and Sanjeev Arora. A mathematical exploration of why language models help solve downstream tasks. arXiv preprint arXiv:2010.03648, 2020. +David Sontag and Dan Roy. Complexity of inference in latent dirichlet allocation. Advances in neural information processing systems, 24:1008-1016, 2011. +Jiaye Teng and Weiran Huang. Can pretext-based self-supervised learning be boosted by downstream data? a theoretical analysis. arXiv preprint arXiv:2103.03568, 2021. +Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive multiview coding. In Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part XI 16, pp. 776-794. Springer, 2020a. +Yuandong Tian, Lantao Yu, Xinlei Chen, and Surya Ganguli. Understanding self-supervised learning with dual deep networks. arXiv preprint arXiv:2010.00578, 2020b. +Yuandong Tian, Xinlei Chen, and Surya Ganguli. Understanding self-supervised learning dynamics without contrastive pairs. arXiv preprint arXiv:2102.06810, 2021. +Christopher Tosh, Akshay Krishnamurthy, and Daniel Hsu. Contrastive estimation reveals topic posterior information to linear models. Journal of Machine Learning Research, 22(281):1-31, 2021a. URL http://jmlr.org/papers/v22/21-0089.html. +Christopher Tosh, Akshay Krishnamurthy, and Daniel Hsu. Contrastive learning, multi-view redundancy, and linear models. In Algorithmic Learning Theory, pp. 1179-1206. PMLR, 2021b. +Yao-Hung Hubert Tsai, Yue Wu, Ruslan Salakhutdinov, and Louis-Philippe Morency. Self-supervised learning from a multi-view perspective. arXiv preprint arXiv:2006.05576, 2020. +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pp. 5998-6008, 2017. +Tongzhou Wang and Phillip Isola. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. In International Conference on Machine Learning, pp. 9929-9939. PMLR, 2020. +Colin Wei, Kendrick Shen, Yining Chen, and Tengyu Ma. Theoretical analysis of self-training with deep networks on unlabeled data. arXiv preprint arXiv:2010.03622, 2020. +Colin Wei, Sang Michael Xie, and Tengyu Ma. Why do pretrained language models help in downstream tasks? an analysis of head and prompt tuning. In Advances in Neural Information Processing Systems, 2021. URL https://openreview.net/forum?id=MDMV2SxCboX. +Zixin Wen and Yuanzhi Li. Toward understanding the feature learning process of self-supervised contrastive learning. arXiv preprint arXiv:2105.15134, 2021. +Xiang Zhang, Junbo Zhao, and Yann LeCun. Character-level convolutional networks for text classification. Advances in neural information processing systems, 28:649-657, 2015. +Roland S Zimmermann, Yash Sharma, Steffen Schneider, Matthias Bethge, and Wieland Brendel. Contrastive learning inverts the data generating process. arXiv preprint arXiv:2102.08850, 2021. + +# A OMITTED PROOFS IN SECTION 3 + +In this section, we give the omitted proofs in Section 3. We first give a warmup example to illustrate our proof idea in Section A.1. Then we give the proof of our main result (Theorem 3.1) in Section A.2 and the proof of robust version (Theorem 3.3) in Section A.3. + +# A.1 WARM-UP EXAMPLE: RECONSTRUCT THE UNKNOWN WORD + +In this warm-up example, we consider the simple setting where we try to predict the only one unknown word of the document using reconstruction-based objective (1). The following result is the special case of Theorem 3.1 with $t = 1$ , which shows that the learned representation is able to give any linear function of the topic posterior. + +Theorem A.1. Consider the general topic model setting as Definition 2.1, suppose topic-word matrix $A$ satisfies $\mathrm{rank}(A) = K$ and function $f$ minimizes the reconstruction-based objective (1). Then, for any document $x$ and its posterior $w|(x,A)$ , any linear function $P(w)$ is linear in $f(x)$ , that is for any $P(w) = \beta^{\top}w$ , there exists a $\theta \in \mathbb{R}^{V}$ such that for all documents $x$ + +$$ +\mathbb {E} _ {w} \left[ \beta^ {\top} w | x \right] = \theta^ {\top} f (x). +$$ + +Following the proof idea described in Section 3, we first give a characterization of the optimal function $f$ . The following lemma shows that $f(x)$ must be the word posterior vector given the document $x$ . The proof of this lemma is simply based on the property of the cross-entropy loss function and we defer it to Section A.1.1. Recall that our vocabulary set is $\mathcal{V} = \{v_1, \dots, v_V\}$ and $x_{\mathrm{unsup}} = (x, y)$ is the given document, where $x$ is unmasked part and $y$ is word marked as unknown. + +Lemma A.2. If $f$ minimizes the reconstruction-based objective (1), then we have for all document $x$ + +$$ +f (x) = \left(\mathbb {P} (y = v _ {1} | x), \dots , \mathbb {P} (y = v _ {V} | x)\right) ^ {\top}. +$$ + +Based on the above lemma, we are able to prove Theorem A.1. It is easy to see that the word posterior distribution is $A\mathbb{E}_w[w|x]$ , so we have $f(x) = A\mathbb{E}_w[w|x]$ . Since the columns of $A$ are linearly independent, we know $\mathbb{E}_w[w|x] = A^\dagger f(x)$ . Thus, for any linear function $\beta^\top w$ , there exists $\theta = (A^\dagger)^\top \beta$ such that $\mathbb{E}_w[\beta^\top w|x] = \theta^\top f(x)$ . The formal proof of the general case is given in Section A.2. + +# A.1.1 PROOF OF LEMMA A.2 + +Instead of focusing on the $t = 1$ case, we directly give the corresponding lemma of Lemma A.2 for general $t$ . Recall that $x_{\mathrm{unsup}} = (x,y)$ is the given document, $x$ is the unmasked part, $y = (y_1,\dots ,y_t)$ is the $t$ unknown words that we want to predict and $\mathcal{V} = \{v_{1},\ldots ,v_{V}\}$ is the set of vocabulary. It shows that the optimal $f$ is the $t$ words posterior distribution. Note that the words posterior distribution is linear in the topic posterior of $t$ -th moment, which is useful for the later analysis. + +Lemma A.3 (Lemma A.2, General Case). If $f$ minimizes the reconstruction-based objective (1), then we have for all document $x$ + +$$ +f (x) = (\mathbb {P} (y = (v _ {1}, v _ {1}, \ldots , v _ {1}) | x), \mathbb {P} (y = (v _ {2}, v _ {1}, \ldots , v _ {1}) | x), \ldots , \mathbb {P} (y = (v _ {V}, v _ {V}, \ldots , v _ {V}) | x)) ^ {\top}. +$$ + +Proof. Denote the word posterior distribution as $p^*(x)$ . We will show $f(x) = p^*(x)$ . By the law of total expectation, we have + +$$ +L _ {\text {r e c o n s t}} = \mathbb {E} _ {x, y} [ \ell (f (x), y) ] = \mathbb {E} _ {x} [ \mathbb {E} _ {y | x} [ \ell (f (x), y) | x ] ]. +$$ + +We know the probability of $y$ given $x$ is $p^* (x)$ . Since $\ell$ is cross-entropy loss, we have + +$$ +L _ {\text {r e c o n s t}} \geq \mathbb {E} _ {x} \left[ - \sum_ {k \in [ V ^ {t} ]} [ p ^ {*} (x) ] _ {k} \log [ p ^ {*} (x) ] _ {k} \right], +$$ + +where the equality is obtained when $f(x) = p^{*}(x)$ . Thus, when $f$ minimizes the reconstruction-based objective (1), we have $f(x) = p^{*}(x)$ . + +# A.2 PROOF OF THEOREM 3.1 + +In this section, we give the proof of Theorem 3.1. Theorem A.1 is covered by Theorem 3.1 as the special case of $t = 1$ . The proof follows the same idea as for Theorem A.1. We first show that $f(x)$ is the $t$ -words posterior (Lemma A.3). Then just as $t = 1$ case where we can recover topic posterior with $A^{\dagger}f(x)$ , we can also recover topic posterior of $t$ -th moment with $\mathcal{A}^{\dagger}f(x)$ with some matrix $\mathcal{A}$ . The result follows by the observation that for a polynomial $P(w)$ with degree at most $t$ , $\mathbb{E}_w[P(w)|x]$ is a linear function of the topic posterior of $t$ -th moment. + +Theorem 3.1 (Main Result). Consider the general topic model setting as Definition 2.1, suppose topic-word matrix $A$ satisfies $\text{rank}(A) = K$ and function $f$ minimizes the reconstruction-based objective (1). Then, for any document $x$ and its posterior $w|(x,A)$ , the posterior mean of any polynomial $P(w)$ with degree at most $t$ is linear in $f(x)$ . That is, there exists a $\theta \in \mathbb{R}^{V^t}$ such that for all documents $x$ + +$$ +\mathbb {E} _ {w} [ P (w) | x, A ] = \theta^ {\top} f (x). +$$ + +Proof. Since $f$ is the minimizer of reconstruction-based objective (1), by Lemma A.3 we know given an input document $x$ , + +$$ +f (x) = (\mathbb {P} (y = (v _ {1}, v _ {1}, \ldots , v _ {1}) | x), \mathbb {P} (y = (v _ {2}, v _ {1}, \ldots , v _ {1}) | x), \ldots , \mathbb {P} (y = (v _ {V}, v _ {V}, \ldots , v _ {V}) | x)) ^ {\top}. +$$ + +We will show that $f(x)$ is linear in the topic posterior. In the following, we focus on $[f(x)]_{y_1,\dots,y_t}$ , which is word posterior probability of the $t$ unknown words being $y_1,\ldots ,y_t\in \mathcal{V}$ given document $x$ . Recall $S_K$ be the $K - 1$ dimensional probability simplex. By the law of total probability, we have + +$$ +\begin{array}{l} [ f (x) ] _ {y _ {1}, y _ {2}, \dots , y _ {t}} = \mathbb {P} (y _ {1}, y _ {2}, \dots , y _ {t} | x) \\ = \int_ {w \in \mathcal {S} _ {K}} \mathbb {P} \left(y _ {1}, y _ {2}, \dots , y _ {t}, w | x\right) \mathrm {d} w \\ = \int_ {w \in \mathcal {S} _ {K}} \mathbb {P} \left(y _ {1}, y _ {2}, \dots , y _ {t} \mid w, x\right) \mathbb {P} (w \mid x) \mathrm {d} w \\ = \int_ {w \in \mathcal {S} _ {K}} \sum_ {z _ {1}, \dots , z _ {t} \in [ K ]} \mathbb {P} (y _ {1}, y _ {2}, \dots , y _ {t}, z _ {1}, z _ {2}, \dots z _ {t} | w) \mathbb {P} (w | x) \mathrm {d} w \\ = \int_ {w \in \mathcal {S} _ {K}} \sum_ {z _ {1}, \dots , z _ {t} \in [ K ]} \mathbb {P} (z _ {1},, \dots , z _ {t} | w) \mathbb {P} (y _ {1},, \dots , y _ {t} | z _ {1},, \dots , z _ {t}, w) \mathbb {P} (w | x) \mathrm {d} w. \\ \end{array} +$$ + +Note that $z_{i}$ is the topic of word $y_{i}$ . Since we consider the general topic model as Definition 2.1, we know + +$$ +\mathbb {P} \left(y _ {1}, y _ {2}, \dots , y _ {t} | z _ {1}, z _ {2}, \dots , z _ {t}, w\right) = \mathbb {P} \left(y _ {1}, y _ {2}, \dots , y _ {t} | z _ {1}, z _ {2}, \dots , z _ {t}\right) = \prod_ {i = 1} ^ {t} \mathbb {P} \left(y _ {i} | z _ {i}\right) = \prod_ {i = 1} ^ {t} A _ {y _ {i}, z _ {i}}, +$$ + +where $A$ is the topic-word matrix. Hence, + +$$ +\begin{array}{l} [ f (x) ] _ {y _ {1}, y _ {2}, \dots , y _ {t}} = \sum_ {z _ {1}, z _ {2}, \dots z _ {t} \in [ K ]} \prod_ {i = 1} ^ {t} A _ {y _ {i}, z _ {i}} \int_ {w \in \mathcal {S} _ {K}} \mathbb {P} (z _ {1}, z _ {2}, \dots , z _ {t} | w) \mathbb {P} (w | x) d w \\ = \sum_ {z _ {1}, z _ {2}, \dots z _ {t} \in [ K ]} \prod_ {i = 1} ^ {t} A _ {y _ {i}, z _ {i}} \int_ {w \in \mathcal {S} _ {K}} \prod_ {i = 1} ^ {t} w _ {z _ {i}} \mathbb {P} (w | x) d w \\ = \sum_ {z _ {1}, z _ {2}, \dots z _ {t} \in [ K ]} \prod_ {i = 1} ^ {t} A _ {x _ {m + i}, z _ {i}} \mathbb {E} _ {w} \left[ \prod_ {i = 1} ^ {t} w _ {z _ {i}} \Bigg | x \right]. \\ \end{array} +$$ + +Recall that the topic posterior tensor is $W_{post} = \mathbb{E}_w[w^{\otimes t}|x] \in \mathbb{R}^{K\times \ldots \times K}$ , where each entry $[W_{post}]_{z_1,\dots ,z_k} = \mathbb{P}(z_i$ is the topic of word $y_{i}$ for $i\in [t]|x) = \mathbb{E}_w[w_{z_1}\dots w_{z_t}|x]$ . Therefore, + +$$ +[ f (x) ] _ {y _ {1}, y _ {2}, \dots , y _ {t}} = \sum_ {z _ {1}, z _ {2}, \dots z _ {t} \in [ K ]} \prod_ {i = 1} ^ {t} A _ {y _ {i}, z _ {i}} [ W _ {\text {p o s t}} ] _ {z _ {1}, z _ {2}, \dots , z _ {t}}, +$$ + +$$ +f(x) = (\underbrace{A\otimes A\otimes\cdots\otimes A}_{t\text{times}})\operatorname {vec}(W_{post}), +$$ + +where $\otimes$ is the Kronecker product, $\mathcal{A} = A\otimes A\otimes \dots \otimes A\in \mathbb{R}^{V^t\times K^t}$ and $\mathrm{vec}(W_{post})\in \mathbb{R}^{K^t}$ is the vectorization of $W_{post}$ . Note that $\mathcal{A}^\dagger = A^\dagger \otimes \dots \otimes A^\dagger$ , so we have $\mathrm{vec}(W_{post}) = \mathcal{A}^\dagger f(x)$ . + +Since $P(w)$ is a polynomial of degree at most $t$ , we know there exists $\beta$ such that $\mathbb{E}_w[P(w)|x] = \beta^\top \operatorname{vec}(W_{post})$ . Thus, let $\theta = (\mathcal{A}^\dagger)^\top \beta$ , we have $\mathbb{E}_w[P(w)|x] = \beta^\top \operatorname{vec}(W_{post}) = \theta^\top f(x)$ . + +# A.3 PROOF OF THEOREM 3.3 + +Similar to Lemma A.2, we can show that the representation $f(x)$ is close to $t$ words posterior. Then, the key lemma to obtain Theorem 3.3 is the following result. It suggests that if function $f$ is $\epsilon$ -close to the optimal function $f^{*}$ (word posterior distribution) under cross-entropy loss, then we can still recover the topic posterior with proper $B$ up to $O(\sqrt{\epsilon})$ error. For example, we will choose $B = A^{\dagger}$ when $t = 1$ . See the proof of Theorem 3.3 for the choice of $B$ in the general case. + +Lemma A.4. For cross-entropy loss $\ell$ and any two probability vectors $p, p^*$ , if $\ell(p, p^*) \leq \min_{p: \sum_i p_i = 1, p \geq 0} \ell(p, p^*) + \epsilon$ , then for any matrix $B$ we have $\| Bp - Bp^* \|_1 \leq \kappa(B) \sqrt{2\epsilon}$ . + +Proof. Recall that $\ell$ is cross-entropy loss, we know + +$$ +\ell (p, p ^ {*}) - \min _ {p: \sum_ {i} p _ {i} = 1, p \geq 0} \ell (p, p ^ {*}) = D _ {K L} (p | | p ^ {*}) \leq \epsilon . +$$ + +By Pinsker's Inequality, we have that + +$$ +\left\| p - p ^ {*} \right\| _ {1} \leq \sqrt {2 D _ {K L} (p ^ {*} | | p)} \leq \sqrt {2 \epsilon}. +$$ + +Then, for any matrix $B$ we have + +$$ +\left\| B p - B p ^ {*} \right\| _ {1} \leq \kappa (B) \left\| p - p ^ {*} \right\| _ {1} \leq \kappa (B) \sqrt {2 \epsilon}, +$$ + +where we use the definition of $\ell_1$ condition number (Definition 3.2). + +![](images/4621028891c7424a2fc837c36b3a978756d5b84dfa23c5fbc1ff83764fd7f71b.jpg) + +We now are ready to give the proof of Theorem 3.3, which is based on Lemma A.4 and the proof of Theorem 3.1. + +Theorem 3.3 (Robust Version). Consider the general topic model setting as Definition 2.1, suppose topic-word matrix $A$ satisfies $\text{rank}(A) = K$ and function $f$ satisfies $L_{\text{reconst}}(f) \leq L_{\text{reconst}}^* + \epsilon$ for some $\epsilon > 0$ . Then, for any document $x$ and its posterior $w|(x, A)$ , the posterior mean of any polynomial $P(w)$ with degree at most $t$ is approximately linear in $f(x)$ . That is, there exists a $\theta \in \mathbb{R}^{V^t}$ such that + +$$ +\mathbb {E} _ {x} \left[ \left(\mathbb {E} _ {w} [ P (w) | x, A ] - \theta^ {\top} f (x)\right) ^ {2} \right] \leq 2 \| \beta \| ^ {2} \kappa^ {2 t} (A ^ {\dagger}) \epsilon , +$$ + +where $\mathbb{E}_w[P(w)|x,A] = \beta^\top \text{vec}(W_{post})$ . + +Proof. Recall from the proof of Theorem 3.1 that $\mathbb{E}_w[P(w)|x] = \beta^\top \mathrm{vec}(W_{post}) = \beta^\top \mathcal{A}^\dagger f^* (x)$ where $\mathcal{A}^{\dagger} = A^{\dagger}\otimes \dots \otimes A^{\dagger}$ and $\kappa (\mathcal{A}^{\dagger}) = \kappa^{t}(A^{\dagger})$ . Same as in the proof of Theorem 3.1, let $\theta = (\mathcal{A}^{\dagger})^{\top}\beta$ . We have + +$$ +\begin{array}{l} \mathbb {E} _ {x} \left[ \left(\mathbb {E} _ {w} [ P (w) | x ] - \theta^ {\top} f (x)\right) ^ {2} \right] = \mathbb {E} _ {x} \left[ \left(\beta^ {\top} \mathcal {A} ^ {\dagger} f ^ {*} (x) - \beta^ {\top} \mathcal {A} ^ {\dagger} f (x)\right) ^ {2} \right] \\ \leq \mathbb {E} _ {x} \left[ \| \beta \| _ {2} ^ {2} \left\| \mathcal {A} ^ {\dagger} f ^ {*} (x) - \mathcal {A} ^ {\dagger} f (x) \right\| _ {2} ^ {2} \right] \\ \leq \| \beta \| _ {2} ^ {2} \mathbb {E} _ {x} \left[ \left\| \mathcal {A} ^ {\dagger} f ^ {*} (x) - \mathcal {A} ^ {\dagger} f (x) \right\| _ {1} ^ {2} \right]. \\ \end{array} +$$ + +We are going to use Lemma A.4 to bound $\left\| \mathcal{A}^{\dagger}f^{*}(x) - \mathcal{A}^{\dagger}f(x)\right\|_{1}$ . By Lemma A.3 we know $f^{*}(x)$ is the word posterior, so $f^{*}(x) = \mathbb{E}_{y|x}[y|x]$ . Since $\ell$ is cross-entropy loss, we know + +$$ +\mathbb {E} _ {y | x} [ \ell (f (x), y) - \ell (f ^ {*} (x), y) | x ] = \mathbb {E} _ {y | x} \left[ \sum_ {k \in [ V ^ {t} ]} y _ {k} \log \left(\frac {[ f ^ {*} (x) ] _ {k}}{[ f (x) ] _ {k}}\right) \Bigg | x \right] = D _ {K L} (f ^ {*} (x) | | f (x)), +$$ + +which implies $\ell(f(x), f^*(x)) - \min_p \ell(p, f^*(x)) \leq \epsilon$ . Therefore, by Lemma A.4 with $B = \mathcal{A}^\dagger$ , we know + +$$ +\left\| \mathcal {A} ^ {\dagger} f (x) - \mathcal {A} ^ {\dagger} f ^ {*} (x) \right\| _ {1} \leq \kappa (\mathcal {A} ^ {\dagger}) \sqrt {2 \epsilon} = \kappa^ {t} (A ^ {\dagger}) \sqrt {2 \epsilon}. +$$ + +Given the desired bound, we have + +$$ +\mathbb {E} _ {x} \left[ \left(\mathbb {E} _ {w} [ P (w) | x ] - \theta^ {\top} f (x)\right) ^ {2} \right] \leq 2 \| \beta \| _ {2} ^ {2} \kappa^ {2 t} (A ^ {\dagger}) \epsilon . +$$ + +![](images/4a25c5bb14f4638779cdcb0acccb9d4483a808d84ecba1715b77d54c51eb1a6f.jpg) + +# A.4 DISCUSSION ON THE EFFECTIVE DIMENSION OF THE REPRESENTATION + +Although the dimension of $f(x)$ is $V^t$ , its "effective dimension" is actually $K^t$ , which is much smaller than $V^t$ (the number of topic $K$ usually is much smaller than the size of vocabulary $V$ ). To see this, let's consider the simple case of $t = 1$ . As we discussed in the paragraph below Theorem 3.1, we have $f(x) = A\mathbb{E}[w|x,A]$ , where $A \in \mathbb{R}^{V \times K}$ is the topic-word matrix and $\mathbb{E}[w|x,A]$ is the posterior mean of $w \in \mathbb{R}^K$ . In words, this means that $f(x)$ is completely determined by a linear transformation of a $K$ -dimensional vector. Therefore, when we consider the feature of $n$ documents as a matrix $[f(x^{(1)}),\dots,f(x^{(n)})] \in \mathbb{R}^{V \times n}$ , the rank of this matrix is at most $K$ and one can get these $K$ -dimensional features by running standard dimension reduction method (e.g., SVD) on the original feature matrix. + +# B OMITTED PROOFS IN SECTION 4 + +In this section, we give the omitted proofs in Section 4. We give the proof of Theorem 4.1 in Section B.1 and proof of Lemma B.1 in Section B.2. + +# B.1 PROOF OF THEOREM 4.1 + +Before presenting the proof of Theorem 4.1, we first give a characterization of the representation $g(x,x')$ , which would be useful in the later analysis. Note that this is the same as the one shown in Tosh et al. (2021a). We provide its proof for completeness in Section B.2. + +Lemma B.1. If $f$ minimizes the contrastive objective (2), then we have + +$$ +g (x, x ^ {\prime}) \triangleq \frac {f (x , x ^ {\prime})}{1 - f (x , x ^ {\prime})} = \frac {\mathbb {P} (y = 1 | x , x ^ {\prime})}{\mathbb {P} (y = 0 | x , x ^ {\prime})}. +$$ + +Now we are ready to proof Theorem 4.1. + +Theorem 4.1. Consider the general topic model setting as Definition 2.1, suppose topic-word matrix $A$ satisfies $\text{rank}(A) = K$ and function $f$ minimizes the contrastive objective (2). Assume we randomly sampled $m = K^t$ different landmark documents $\{l_i\}_{i=1}^m$ and construct $g(x, \{l_i\}_{i=1}^m)$ as (3). Then, for any document $x$ and its posterior $w|(x,A)$ , the posterior mean of any polynomial $P(w)$ with degree at most $t$ is linear in $g(x, \{l_i\}_{i=1}^m)$ . That is, there exists $\theta \in \mathbb{R}^m$ such that for all documents $x$ + +$$ +\mathbb {E} _ {w} [ P (w) | x, A ] = \theta^ {\top} g (x, \{l _ {i} \} _ {i = 1} ^ {m}). +$$ + +Proof. Since $f$ is the minimizer of contrastive objective (2), by Lemma B.1 we know + +$$ +g (x, x ^ {\prime}) = \frac {\mathbb {P} (y = 1 | x , x ^ {\prime})}{\mathbb {P} (y = 0 | x , x ^ {\prime})}. +$$ + +Similar to the proof of Theorem 3.1, we will show that $g(x,x^{\prime})$ is linear in the topic posterior when $x^{\prime}$ is fixed. By Bayes' rule, we have + +$$ +g (x, x ^ {\prime}) = \frac {\mathbb {P} (x , x ^ {\prime} | y = 1) \mathbb {P} (y = 1) / \mathbb {P} (x , x ^ {\prime})}{\mathbb {P} (x , x ^ {\prime} | y = 0) \mathbb {P} (y = 0) / \mathbb {P} (x , x ^ {\prime})} = \frac {\mathbb {P} (x , x ^ {\prime} | y = 1)}{\mathbb {P} (x , x ^ {\prime} | y = 0)}, +$$ + +where we use $\mathbb{P}(y = 0) = \mathbb{P}(y = 1) = 1 / 2$ + +Denote the $t$ words in $x^{\prime}$ as $x_1^\prime ,\ldots ,x_t^\prime$ and their corresponding topics as $z_{1},\dots ,z_{t}$ . Then, by our way of generating $x,x^{\prime}$ , we know + +$$ +\begin{array}{l} \mathbb {P} (x, x ^ {\prime} | y = 0) = \mathbb {P} (x) \mathbb {P} (x ^ {\prime}), \\ \mathbb {P} (x, x ^ {\prime} | y = 1) = \int_ {w} \mathbb {P} \left(x _ {1} ^ {\prime}, \dots , x _ {t} ^ {\prime} \mid w, x, y = 1\right) \mathbb {P} (w, x \mid y = 1) \mathrm {d} w \\ = \int_ {w} \sum_ {z _ {1}, \dots , z _ {t} \in [ K ]} \mathbb {P} \left(x _ {1} ^ {\prime}, \dots , x _ {t} ^ {\prime} | z _ {1}, \dots , z _ {t}, w\right) \mathbb {P} \left(z _ {1}, \dots , z _ {t} | w\right) \mathbb {P} (w, x) \mathrm {d} w, \\ \end{array} +$$ + +which implies + +$$ +g (x, x ^ {\prime}) = \frac {1}{\mathbb {P} \left(x ^ {\prime}\right)} \int_ {w} \sum_ {z _ {1}, \dots , z _ {t} \in [ K ]} \mathbb {P} \left(x _ {1} ^ {\prime}, \dots , x _ {t} ^ {\prime} | z _ {1}, \dots , z _ {t}\right) \mathbb {P} \left(z _ {1}, \dots , z _ {t} | w\right) \mathbb {P} (w | x) d w +$$ + +Note that + +$$ +\mathbb {P} (x _ {1} ^ {\prime}, \ldots , x _ {t} ^ {\prime} | z _ {1}, \ldots , z _ {t}) = \prod_ {i = 1} ^ {t} \mathbb {P} (x _ {i} ^ {\prime} | z _ {i}) = \prod_ {i = 1} ^ {t} A _ {x _ {1} ^ {\prime}, z _ {i}}, +$$ + +where $A$ is the topic-word matrix. Hence, + +$$ +\begin{array}{l} g (x, x ^ {\prime}) = \frac {1}{\mathbb {P} \left(x ^ {\prime}\right)} \sum_ {z _ {1}, \dots , z _ {t} \in [ K ]} \prod_ {i = 1} ^ {t} A _ {x _ {1} ^ {\prime}, z _ {i}} \int_ {w} \mathbb {P} \left(z _ {1}, \dots , z _ {t} | w\right) \mathbb {P} (w | x) d w \\ = \frac {1}{\mathbb {P} \left(x ^ {\prime}\right)} \sum_ {z _ {1}, \dots , z _ {t} \in [ K ]} \prod_ {i = 1} ^ {t} A _ {x _ {1} ^ {\prime}, z _ {i}} \int_ {w} \prod_ {i = 1} ^ {t} w _ {z _ {i}} \mathbb {P} (w | x) d w \\ = \frac {1}{\mathbb {P} \left(x ^ {\prime}\right)} \sum_ {z _ {1}, \dots , z _ {t} \in [ K ]} \prod_ {i = 1} ^ {t} A _ {x _ {1} ^ {\prime}, z _ {i}} \mathbb {E} _ {w} \left[ \prod_ {i = 1} ^ {t} w _ {z _ {i}} \right\rvert x \Bigg ]. \\ \end{array} +$$ + +Recall that the topic posterior tensor is $W_{post} = \mathbb{E}_w[w^{\otimes t}|x] \in \mathbb{R}^{K\times \ldots \times K}$ , where each entry $[W_{post}]_{z_1,\dots ,z_k} = \mathbb{E}_w[w_{z_1}\dots w_{z_t}|x]$ . Therefore, + +$$ +\begin{array}{l} g(x,x^{\prime}) = \frac{1}{\mathbb{P}(x^{\prime})}\sum_{z_{1},z_{2},\ldots z_{t}\in [K]}\prod_{i = 1}^{t}A_{x_{i}^{\prime},z_{i}}[W_{p o s t}]_{z_{1},z_{2},\ldots ,z_{t}} \\ = \frac {1}{\mathbb {P} \left(x ^ {\prime}\right)} \mathcal {A} \left[ x ^ {\prime} \right] ^ {\top} \operatorname {v e c} \left(W _ {\text {p o s t}}\right), \\ \end{array} +$$ + +where $\mathcal{A} = A\otimes A\otimes \dots \otimes A\in \mathbb{R}^{V^t\times K^t}$ , $\mathcal{A}[x^{\prime}]\in \mathbb{R}^{K^{t}}$ is the row of $\mathcal{A}$ that correspond to $x_1',\ldots ,x_t'$ and $\operatorname {vec}(W_{post})\in \mathbb{R}^{K^t}$ is the vectorization of $W_{post}$ . + +Recall we have $m$ randomly sampled different documents $\{l_i\}_{i=1}^n$ . Denote $D \in \mathbb{R}^{m \times m}$ as a diagonal matrix such that $D_{i,i} = \mathbb{P}(l_i)$ , and $\tilde{\mathcal{A}} \in \mathbb{R}^{m \times K^t}$ as a submatrix of $\mathcal{A}$ such that each row of $\tilde{\mathcal{A}}$ is $\mathcal{A}[l_i]$ . Since $l_i$ are randomly sampled, so $D_{i,i} > 0$ . Thus, we know + +$$ +g (x, \{l _ {i} \} _ {i = 1} ^ {n}) = D ^ {- 1} \tilde {\mathcal {A}} \operatorname {v e c} (W _ {p o s t}), +$$ + +which implies $\operatorname{vec}(W_{post}) = \tilde{\mathcal{A}}^{\dagger}Dg(x,\{l_i\}_{i=1}^n)$ . Note that we need to show $\tilde{\mathcal{A}}^{\dagger}$ is well-defined. Since $A$ has full column rank, we know $\mathcal{A}$ also has full column rank. Thus, the submatrix $\tilde{\mathcal{A}}$ also has full column rank since $m = K^{t}$ . This implies $\tilde{\mathcal{A}}^{\dagger}$ is well-defined. + +Since $P(w)$ is a polynomial of degree at most $t$ , we know there exists $\beta$ such that $\mathbb{E}_w[P(w)|x] = \beta^\top \mathrm{vec}(W_{post})$ . Thus, let $\theta = D(\tilde{\mathcal{A}}^\dagger)^\top \beta$ , we have + +$$ +\mathbb {E} _ {w} [ P (w) | x ] = \beta^ {\top} \operatorname {v e c} (W _ {p o s t}) = \theta^ {\top} g (x, \{l _ {i} \} _ {i = 1} ^ {n}). +$$ + +# B.2 PROOF OF LEMMA B.1 + +Lemma B.1. If $f$ minimizes the contrastive objective (2), then we have + +$$ +g (x, x ^ {\prime}) \triangleq \frac {f (x , x ^ {\prime})}{1 - f (x , x ^ {\prime})} = \frac {\mathbb {P} (y = 1 | x , x ^ {\prime})}{\mathbb {P} (y = 0 | x , x ^ {\prime})}. +$$ + +Proof. Since $f$ is the minimizer of contrastive objective (2) and + +$$ +L _ {\text {c o n t r a s t}} (f) = \mathbb {E} _ {x, x ^ {\prime}, y} \left[ \left(f \left(x, x ^ {\prime}\right) - y\right) ^ {2} \right] = \mathbb {E} _ {x, x ^ {\prime}} \left[ \mathbb {E} _ {y | x, x ^ {\prime}} \left[ \left(f \left(x, x ^ {\prime}\right) - y\right) ^ {2} \right] \right], +$$ + +it is easy to see that $f$ is the Bayes optimal predictor $\mathbb{P}(y = 1|x,x')$ . Therefore, we know + +$$ +g (x, x ^ {\prime}) = \frac {\mathbb {P} (y = 1 | x , x ^ {\prime})}{\mathbb {P} (y = 0 | x , x ^ {\prime})}. +$$ + +![](images/c4d5e949b9a180d8a4dec8957ecc677b71e75249cf19935db6dffa390d2633c4.jpg) + +# B.3 DISCUSSIONS ON THE SELF-REFERENCING + +The following corollary shows that solving the downstream task is equivalent to solve a kernel regression (in some sense the landmark documents are just random features for this kernel (Rahimi & Recht, 2007)). + +Corollary B.2. Denote $\{(x_i, \tilde{y}_i)\}_{i=1}^m$ as the downstream dataset, where $\tilde{y}_i = \mathbb{E}_w[P(w)|x_i]$ is the target for document $x_i$ . If we set landmarks $\{l_i\}_{i=1}^m$ to be $\{x_i\}_{i=1}^m$ , then solving the downstream task is equivalent to a kernel regression, that is + +$$ +\arg \min _ {\theta} \sum_ {k = 1} ^ {m} \left(\tilde {y} _ {k} - \theta^ {\top} g (x _ {k}, \{l _ {i} \} _ {i = 1} ^ {m})\right) ^ {2} = \arg \min _ {\theta} \| \tilde {y} - G \theta \| ^ {2}, +$$ + +where $\tilde{y} = (\tilde{y}_1,\dots ,\tilde{y}_m)^\top$ and $G\in \mathbb{R}^{m\times m}$ is a kernel matrix such that $G_{ij} = g(x_i,x_j)$ . + +As discussed in Corollary B.2, we show that one can use the same set of documents for both representation and downstream task. Recall that in Theorem 4.1 we need a large number of landmark documents to generate the representation and then use it for the downstream task (e.g., fit a polynomial of topic posterior). However, one may not have enough additional documents to be used as landmarks. Therefore, the benefit of the self-referencing is that we do not need additional landmark documents to generate the representation. + +The key observation in Corollary B.2 is that the learned representation $g(x, x')$ can be viewed as a kernel. Suppose the documents for the downstream task are $x_{1}, \ldots, x_{m}$ . Construct a kernel matrix $G \in \mathbb{R}^{m \times m}$ such that $G_{ij} = g(x_{i}, x_{j})$ . Then, it is easy to see + +$$ +\theta^ {\top} g (x _ {i}, \{x _ {j} \} _ {j = 1} ^ {m}) = \theta^ {\top} G _ {i}, +$$ + +where $G_{i}$ is the $i$ -th column of $G$ . Thus, $\theta$ can be found by the following kernel regression: + +$$ +\min _ {\theta} \left\| \tilde {y} - G \theta \right\| ^ {2}, +$$ + +where $\tilde{y} = (\tilde{y}_1,\dots ,\tilde{y}_m)^\top$ and $\tilde{y}_i = \mathbb{E}_w[P(w)|x_i]$ . + +# C SYNTHETIC EXPERIMENT ADDITIONAL DETAILS + +In this section, we include more details about our synthetic experiments in Section 5. In Section C.1, we describe the document generation process for PAM model. Additional results on topic posterior recovery loss and major topic recovery are included in Section C.2 and Section C.3. In Section C.4 and Section C.5, we report the results about different training epochs and hyperparameters tuning. $\ell_1$ condition number is reported in Section C.6 and we give some visualizations for topic correlations for the PAM model in Section C.7. Moreover, in Section C.8 we report the performance of SSL on recovering the topic posterior mean vector when $t = 2$ . We run our experiments on 2080RTXTi/V100s. The confidence interval reported in the paper is calculated as mean $\pm 1.96 * s_{testdocs} / \sqrt{N_{testdocs}}$ , where mean is the mean of TV distance (or accuracy), $s_{testdocs}$ is the standard deviation of TV distance (or accuracy) and $N_{testdocs}$ is the number of test documents. + +Details of generating topic-word matrix $A$ For pure topic and LDA experiments, each column of $A$ (i.e., each topic's word distribution) is generated from $Dir(\alpha / K)$ . For CTM and PAM, our goal is to construct $K / 4$ groups of 4 topics such that within each group, topic 0 and topic 1 have similar word distribution, and topic 2 and topic 3 have different word distribution (and different from the word distribution of topic 0 and 1 as well). To achieve this, we first sample $K / 4$ word distribution vectors from $Dir(\alpha / K)$ , and for each word distribution vector, we permute its entries to get the word distribution of topic 0, 1, 2, 3 within each group and intentionally align the large entries in topic 0 and 1 to ensure high similarity between them. + +# C.1 PACHINKO ALLOCATION MODEL TOPIC PRIOR GENERATION + +The topic proportion of the Pachinko Allocation Model (PAM) described in Section 5 is generated from the following process: for each document, we first sample a "super-topic" proportion from a symmetric Dirichlet distribution $\mathrm{Dir}(1 / K_s)$ and a super-topic-to-topic proportion from a symmetric Dirichlet distribution $\mathrm{Dir}(30)$ . Then, we sample each word by first sample a super-topic according to the super-topic proportion and then sample the actual topic from the super-topic-to-topic proportion. In our experiment, we set $K_{s} = 10$ . Figure C.1 offers a few examples of PAM topic proportion generated from the PAM model. + +![](images/3a6ffefee7a40a7473f551e49f632c23795a3a3a402507179b2402a48fd1cb39.jpg) +Figure C.1: PAM topic proportion + +# C.2 MAJOR TOPIC RECOVERY ADDITIONAL RESULTS + +In Section 5.3, we measure the major topics recovery of CTM and PAM documents as the top-2 topic overlap rate. Since topics are correlated in pairs in both of these topic models, we are also interested in the top-4 and top-6 topics overlap rate. As shown in Figure C.2, for both CTM and PAM documents, the average top-4 overlap rate is above $66\%$ and the average top-6 overlap rate is above $62\%$ on all $\alpha$ values we test on. These results show that our model can accurately capture more than just the major pair of correlated topics, but also some correlated pairs of less dominant topics. + +# C.3 SELF-SUPERVISED LEARNING VERSUS ASSUMING SPECIFIC TOPIC PRIOR + +We present in Section 5.3 a comparison between the performance of our model and Markov Chain Monte Carlo assuming a specific topic model for $\alpha = 1$ , on the task of TV distance and major topic recovery. In this subsection, we supplement the experiment results for larger values of $\alpha$ along with $\alpha = 1$ . In particular, we consider self-supervised learning with 6 million training documents and + +![](images/6a075d5d268539ad0ce5b4c5c5a938bc8bc0cdb35aaa354a230d6046c1ad2ead.jpg) +Figure C.2: Recovery rate for top-2, top-4, and top-6 topics, measured on CTM (left) and PAM (right) test documents. + +![](images/f9cc6f48a0483e5e4aabfe0b3ac7a1f923838e0e45c201facba626334947b771.jpg) + +
MethodDocument Type (α = 1)
PureLDACTMPAM
LDA0.0406 ± 0.0016-0.1182 ± 0.00990.1218 ± 0.0096
CTM0.2083 ± 0.00380.2060 ± 0.0064-0.3154 ± 0.0082
PAM0.3782 ± 0.00380.3459 ± 0.01280.3939 ± 0.0096-
SSL-6M (ours)0.0148 ± 0.00200.0757 ± 0.00330.0550 ± 0.00370.0489 ± 0.0025
SSL-120K (ours)0.0311 ± 0.00250.0878 ± 0.00410.0678 ± 0.00380.0600 ± 0.0028
Document Type (α = 3)
MethodPureLDACTMPAM
LDA0.0561 ± 0.0030-0.1942 ± 0.01560.1813 ± 0.0146
CTM0.2347 ± 0.00480.2299 ± 0.0082-0.3362 ± 0.0086
PAM0.4031 ± 0.00460.3665 ± 0.01170.4510 ± 0.0100-
SSL-6M (ours)0.0308 ± 0.00700.0899 ± 0.00530.0799 ± 0.00480.0712 ± 0.0038
SSL-120K (ours)0.0546 ± 0.00970.1292 ± 0.00670.1062 ± 0.00580.0988 ± 0.0048
Document Type (α = 5)
MethodPureLDACTMPAM
LDA0.0731 ± 0.0040-0.2123 ± 0.01590.1995 ± 0.0144
CTM0.2655 ± 0.00590.2413 ± 0.0090-0.3428 ± 0.0090
PAM0.4337 ± 0.00550.3608 ± 0.00890.4794 ± 0.0097-
SSL-6M (ours)0.0501 ± 0.00300.1041 ± 0.00620.0970 ± 0.00570.0787 ± 0.0043
SSL-120K (ours)0.0832 ± 0.01740.1629 ± 0.00820.1245 ± 0.00710.1077 ± 0.0054
Document Type (α = 7)
MethodPureLDACTMPAM
LDA0.0883 ± 0.0050-0.2438 ± 0.01690.2138 ± 0.0158
CTM0.2840 ± 0.00600.2556 ± 0.0089-0.3530 ± 0.0099
PAM0.4561 ± 0.00520.3707 ± 0.00890.4979 ± 0.0101-
SSL-6M (ours)0.0391 ± 0.00220.1233 ± 0.00710.1071 ± 0.00680.0960 ± 0.0057
SSL-120K (ours)0.1219 ± 0.02270.1851 ± 0.00790.1340 ± 0.00780.1358 ± 0.0070
Document Type (α = 9)
MethodPureLDACTMPAM
LDA0.1051 ± 0.0065-0.2559 ± 0.01620.2281 ± 0.0152
CTM0.3129 ± 0.00790.2580 ± 0.0092-0.3556 ± 0.0084
PAM0.4805 ± 0.00710.3776 ± 0.00930.5156 ± 0.0088-
SSL-6M (ours)0.0517 ± 0.00450.1358 ± 0.00890.1101 ± 0.00640.0971 ± 0.0053
SSL-120K (ours)0.1121 ± 0.02020.2221 ± 0.01230.1449 ± 0.00770.1460 ± 0.0070
+ +Table C.1: TV between our recovered topic posterior and the true topic posterior of our self-supervised learning approach versus topic inference via Markov Chain Monte Carlo assuming a specific prior for $\alpha = 1,3,5,7,9$ . The $95\%$ confidence interval is reported. + +with 120 thousand training documents after 200 training epochs, and we expect that the former can allow our model to approximate the optimal predictor $f$ described in Theorem 3.1 and the latter may offer some insights on our approach's performance in more practical settings, such as on a real world dataset with limited size. Additionally, when training with 120 thousand documents, we randomly shuffle each document and reassign the $t$ target words in every epoch, to make sure our model learns enough information from the limited amount of training data. We report our results in the form of 95% confidence interval. + +Table C.1 shows that our approach with 6 million training documents consistently outperforms misspecified topic priors by yielding a much lower TV distance from the true topic posterior. Note that the entries with correct topic model are omitted, because in our experiment the Markov Chain Monte Carlo recovered topic posterior assuming the correct topic model is exactly what we use as + +
MethodDocument Type (α = 1)
PureLDACTMPAM
LDA1.0 ± 0.00.9150 ± 0.03870.8850 ± 0.03440.8500 ± 0.0360
CTM1.0 ± 0.00.9000 ± 0.04160.9175 ± 0.02750.8300 ± 0.0370
PAM1.0 ± 0.00.8750 ± 0.04580.7250 ± 0.03970.9050 ± 0.0320
SSL-6M (ours)1.0 ± 0.00.9050 ± 0.04060.9175 ± 0.02750.9025 ± 0.0330
SSL-120K (ours)1.0 ± 0.00.9150 ± 0.03870.9100 ± 0.02920.9200 ± 0.0289
+ +
Document Type (α = 3)
MethodPureLDACTMPAM
LDA1.0 ± 0.00.8900 ± 0.04340.8200 ± 0.03540.8200 ± 0.0404
CTM1.0 ± 0.00.8800 ± 0.04500.8900 ± 0.03260.7650 ± 0.0404
PAM1.0 ± 0.00.8550 ± 0.04880.6375 ± 0.03920.8950 ± 0.0357
SSL-6M (ours)1.0 ± 0.00.8750 ± 0.04580.8900 ± 0.03110.8950 ± 0.0344
SSL-120K (ours)0.9950 ± 0.00980.8700 ± 0.04660.8900 ± 0.03120.8950 ± 0.0357
+ +
Document Type (α = 5)
MethodPureLDACTMPAM
LDA1.0 ± 0.00.9050 ± 0.04060.8500 ± 0.03390.7750 ± 0.0390
CTM1.0 ± 0.00.9050 ± 0.04060.8975 ± 0.03040.6775 ± 0.0421
PAM1.0 ± 0.00.8850 ± 0.04420.6150 ± 0.03710.8825 ± 0.0379
SSL-6M (ours)1.0 ± 0.00.9000 ± 0.04160.8975 ± 0.02960.8675 ± 0.0407
SSL-120K (ours)0.9900 ± 0.01380.8800 ± 0.04500.8900 ± 0.03030.8750 ± 0.0390
+ +
MethodDocument Type (α = 7)
PureLDACTMPAM
LDA1.0 ± 0.00.8800 ± 0.04500.7750 ± 0.03970.7475 ± 0.0433
CTM1.0 ± 0.00.8650 ± 0.04740.8825 ± 0.03530.6250 ± 0.0390
PAM1.0 ± 0.00.8450 ± 0.05020.5725 ± 0.03560.8700 ± 0.0411
SSL-6M (ours)1.0 ± 0.00.9150 ± 0.03870.8675 ± 0.03830.8675 ± 0.0407
SSL-120K (ours)0.9650 ± 0.02550.9350 ± 0.03420.8775 ± 0.03700.8725 ± 0.0398
+ +
MethodDocument Type (α = 9)
PureLDACTMPAM
LDA1.0 ± 0.00.8850 ± 0.04420.7750 ± 0.03840.7350 ± 0.0432
CTM1.0 ± 0.00.8950 ± 0.04250.8800 ± 0.03480.5925 ± 0.0392
PAM1.0 ± 0.00.8650 ± 0.04740.5675 ± 0.03580.8600 ± 0.0428
SSL-6M (ours)0.9950 ± 0.00980.9100 ± 0.03970.8850 ± 0.03300.8325 ± 0.0461
SSL-120K (ours)0.9800 ± 0.01940.8600 ± 0.04810.8800 ± 0.03410.8425 ± 0.0430
+ +Table C.2: Major topic recovery rate of our approach versus posterior inference via Markov Chain Monte Carlo assuming a specific prior for $\alpha = 1,3,5,7,9$ . We report the $95\%$ confidence interval. + +our ground truth topic posterior. Meanwhile, our approach with 120 thousand training documents outperforms misspecified prior in almost every scenario, except when compared to LDA prior on pure topic documents. This is likely because the LDA topic prior is relatively concentrated on one specific topic and thus similar to the pure topic prior. + +We also present a comparison between our self-supervised learning approach and posterior inference assuming a specific topic prior on the task of recovering major topics in the topic proportion for $\alpha = 1,3,5,7,9$ , as a supplement to Section 5.3. As shown in Table C.2, in almost every scenario we test on, our model can perform competitively against the MCMC-inferred posterior assuming the correct topic prior and outperform misspecified topic prior. + +To further investigate the performance of self-supervised learning, we compare our approach with Variational Inference assuming a specific topic prior on the task of recovering major topics in test document's topic proportion. Table C.3 shows that, similar to our findings from Table C.2, our model can perform competitively against the Variational Inference posterior assuming the correct topic prior, particularly for relative small $\alpha$ values, and can outperform misspecified topic prior in almost every test scenario. + +# C.4 THE EFFECT OF TRAINING EPOCHS + +We measure how the number of training epochs may influence topic posterior recovery loss by varying the number of training epochs. The results we present in Section 5 are based on models trained for + +
Document Type (α = 1)
MethodPureLDACTMPAM
LDA1.0 ± 0.00.8950 ± 0.04240.8325 ± 0.03820.8625 ± 0.0339
CTM1.0 ± 0.00.9050 ± 0.04100.9125 ± 0.02830.8150 ± 0.0354
PAM1.0 ± 0.00.8600 ± 0.04810.7125 ± 0.03820.9050 ± 0.0325
SSL-6M (ours)1.0 ± 0.00.9050 ± 0.04060.9175 ± 0.02750.9025 ± 0.0330
SSL-120K (ours)1.0 ± 0.00.9150 ± 0.03870.9100 ± 0.02920.9200 ± 0.0289
Document Type (α = 3)
MethodPureLDACTMPAM
LDA1.0 ± 0.00.8750 ± 0.04520.7325 ± 0.03960.7875 ± 0.0382
CTM1.0 ± 0.00.8800 ± 0.04500.8800 ± 0.03250.6975 ± 0.0410
PAM1.0 ± 0.00.8550 ± 0.04880.6075 ± 0.03540.8825 ± 0.0367
SSL-6M (ours)1.0 ± 0.00.8750 ± 0.04580.8900 ± 0.03110.8950 ± 0.0344
SSL-120K (ours)0.9950 ± 0.00980.8700 ± 0.04660.8900 ± 0.03120.8950 ± 0.0357
Document Type (α = 5)
MethodPureLDACTMPAM
LDA1.0 ± 0.00.8800 ± 0.04520.7575 ± 0.03540.7375 ± 0.0410
CTM1.0 ± 0.00.8750 ± 0.04520.8975 ± 0.02830.5925 ± 0.0396
PAM1.0 ± 0.00.8500 ± 0.04950.5675 ± 0.02970.8875 ± 0.0368
SSL-6M (ours)1.0 ± 0.00.9000 ± 0.04160.8975 ± 0.02960.8675 ± 0.0407
SSL-120K (ours)0.9900 ± 0.01380.8800 ± 0.04500.8900 ± 0.03030.8750 ± 0.0390
Document Type (α = 7)
MethodPureLDACTMPAM
LDA1.0 ± 0.00.9250 ± 0.03680.7175 ± 0.03960.6875 ± 0.0410
CTM1.0 ± 0.00.9300 ± 0.03540.8700 ± 0.03820.5700 ± 0.0354
PAM1.0 ± 0.00.9050 ± 0.04100.5400 ± 0.03250.8750 ± 0.0396
SSL-6M (ours)1.0 ± 0.00.9150 ± 0.03870.8675 ± 0.03830.8675 ± 0.0407
SSL-120K (ours)0.9650 ± 0.02550.9350 ± 0.03420.8775 ± 0.03700.8725 ± 0.0398
Document Type (α = 9)
MethodPureLDACTMPAM
LDA1.0 ± 0.00.9050 ± 0.04100.7250 ± 0.03960.6975 ± 0.0410
CTM1.0 ± 0.00.9200 ± 0.03820.8725 ± 0.03390.5425 ± 0.0368
PAM1.0 ± 0.00.8750 ± 0.04520.5300 ± 0.03250.8425 ± 0.0452
SSL-6M (ours)0.9950 ± 0.00980.9100 ± 0.03970.8850 ± 0.03300.8325 ± 0.0461
SSL-120K (ours)0.9800 ± 0.01940.8600 ± 0.04810.8800 ± 0.03410.8425 ± 0.0430
+ +Table C.3: Major topic recovery rate of our approach versus posterior inference via Variational Inference assuming a specific prior for $\alpha = 1,3,5,7,9$ . We report the $95\%$ confidence interval. + +200 epochs for all types of documents. Here, we present the topic recovery loss, measured as the Total Variation distance between our recovered topic posterior and the true topic posterior, for epochs=25, 50, 100, 200 using the same model architecture and same sampling scheme as in Section 5. + +Table C.4 shows that topic posterior recovery loss steadily decreases as the number of epochs gets larger. Interestingly, even with just training 50 epochs, our model can recover the topic posterior within a Total Variation distance of less than 0.3 off the true topic posterior for documents generated from all four topic models. + +# C.5 HYPERPARAMETER TUNING EXPERIMENTS + +As described in Section 5, the two types of neural network architecture we use are fully-connected neural networks and attention-based neural networks (see Figure C.3). In this section, we present some of our TV results of different combinations of hyperparameters for both types of models. Note that our attention-based neural network slightly differs from typical transformers (Vaswani et al., 2017) in that we use batch normalization instead of layer normalization in every residual connection. We only use one attention head in each multi-head attention layer. During training, we use AMSGrad optimizer and an initial learning rate of 0.0001 or 0.0002. We reduce the learning rate by $50\%$ whenever validation loss does not decrease in 10 epochs. + +The main hyperparameters in our fully-connected neural networks include the hidden dimension, the number of layers, and whether we apply residual connections. Table C.5 shows the TV distance results when we vary these hyperparameters for the LDA scenario when $\alpha = 1$ . However, fully-connected + +
Document typeNumber of epochsDirichlet hyperparameter α
13579
Pure-topic250.05050.10250.17560.62220.8285
500.03100.07440.09910.15220.2873
1000.01600.03630.05110.09110.1257
2000.01480.03080.05010.03910.0517
LDA250.12360.15830.18120.20220.2218
500.09670.14280.13870.19530.2117
1000.08050.10180.11010.13610.1538
2000.07090.09510.10450.12220.1377
CTM250.10890.15990.15630.17470.1971
500.09000.11320.14250.14550.1501
1000.06230.09480.11020.11870.1243
2000.05500.07990.09700.10710.1101
PAM250.10720.13420.14800.16880.1754
500.08200.10360.12460.11850.1395
1000.05430.07550.08590.10870.1095
2000.04360.06590.07870.09530.0971
+ +![](images/683bb10d45c5059a394f87d16114b02644a820931a81e154024355ce17d4fe75.jpg) +Figure C.3: Our attention-based neural network architecture + +neural networks perform poorly in CTM and PAM case. For instance, when $\alpha = 1$ and hidden dimension $= 4096$ , we find that hyperparameters that work well in the LDA case no longer yield satisfactory results (Table C.6). + +Table C.4: Topic posterior recovery loss of our self-supervised learning approach, measured in Total Variation distance, for all four types of documents and $\alpha = 1,3,5,7,9$ . The number of training epochs ranges from 25 to 200, and we sample 60K new training documents in every 2 epochs, which corresponds to 720K to 6M training documents. + +
TV +# layers (residual)Hidden dimension
102420484096
30.15090.11120.1095
60.79020.78930.7901
3 (residual)0.08710.08670.0862
6 (residual)0.08220.08350.0709
+ +Table C.5: Fully-connected neural network's performance in the LDA $\alpha = 1$ scenario. + +For attention-based neural networks applied to CTM and PAM scenarios, we mainly consider the number of layers and the hidden dimension per attention layer. Table C.7 presents the TV distance between recovered topic posterior and true topic posterior in the CTM setting, with varying number of layers and attention dimension for $\alpha = 1,3,5$ and using a more coarse estimate to the true topic posterior than what we use as our final true CTM topic posterior. We find that the model performs the best when attention dimension is 768 or 1024, and when the attention dimension increases to 2048 the model gives a higher TV (see Table C.8). + +
TV +# layersLayerType
regularresidual
30.18240.1665
40.17240.1656
60.17000.1556
+ +Table C.6: Fully-connected neural network's performance in the CTM $\alpha = 1$ scenario with 4096 hidden dimensions. + +
TV +αAttention dimension# layers
468
17680.09020.08440.0814
10240.08510.08900.0836
37680.14710.14290.1398
10240.14400.13840.1383
57680.17940.17670.1708
10240.18780.17870.1782
+ +Table C.7: Attention-based neural network's performance on CTM documents for $\alpha = 1,3,5$ . + +
TV +αAttention dimension
76810242048
30.14710.14400.1670
50.17940.18780.1922
+ +Table C.8: 4-layer attention-base neural network's performance on CTM documents when attention layer's dimension varies, for $\alpha = 3,5$ . + +# C.6 TOPIC POSTERIOR RECOVERY LOSS AND CONDITION NUMBER + +We have proved in Theorem 3.3 that the upper bound of topic posterior recovery loss depends on the $\ell_1$ Condition Number $\kappa(A^\dagger)$ . In this section, we show that $\kappa(A^\dagger)$ is small for every topic-word matrix $A$ in our experiments (Figure C.4). Note that we use the same topic-word matrix $A$ for pure-topic model and the LDA model. For CTM and PAM, we use the same topic-word matrix up to reordering of the topics that corresponds with pairwise topic correlations. Therefore, pure-topic model and LDA model share the same $\kappa(A^\dagger)$ , and CTM and PAM share the same $\kappa(A^\dagger)$ . + +![](images/8c108dce4c6e2645e44306a34eeca51b027614cf497ac61487c22930f60017f9.jpg) +Figure C.4: $\ell_1$ Condition Number for topic-word matrix $A$ + +![](images/f833b98f8f0f2401bc8d154932550c54a2175c0a5d23e49c5f2d87e1e97e9011.jpg) + +# C.7 VISUALIZING TOPIC CORRELATIONS FOR PAM + +For documents generated by the PAM model, we plotted the estimated posteriors by the self-supervised approach and posterior inference assuming different priors in Figure C.5. From this figure (especially in Documents 3 and 4), one can qualitatively see that the estimated posterior and the PAM MCMC posteriors are aware of the correlation between topics, while the LDA MCMC posterior fails to take the correlation into consideration and hence is more different from the ground truth topic proportions. + +# C.8 TOPIC POSTERIOR RECOVERY FOR $t = 2$ + +We have shown by experiment that self-supervised learning can accurately recover the topic posterior when $t = 1$ , that is, when the neural network model is trained to predict one missing word from a document. In this subsection, we run experiments for $t = 2$ case in Theorem 3.3, which means using the self-supervised objective to train the neural network model to predict 2 missing word in a document. For the sake of reducing computational complexity, we change the setting from + +![](images/641974a6f140a1d563b0e5c550d2cf1de958571f229f51bf5495fa714b9c38fd.jpg) +Figure C.5: Comparison of estimated, PAM MCMC, LDA MCMC, and ground truth posterior topic proportions for sample test documents generated by PAM. Overall, across our set of 200 test documents, the estimated posteriors were able to outperform the misspecified LDA posteriors. + +![](images/ab3adab48d53eebfc396db07e88a958a7afd8ac4c89cb246e95275549f1821ba.jpg) + +$V = 5000, K = 20, K_{s} = 10$ to $V = 500, K = 8$ , and $K_{s} = 4$ (where $K_{s}$ is a parameter in the PAM model) while keeping document length, resample rate, training epoch, and the number of test documents the same as in Section 5. Once a neural network $f$ is trained, from the proof of Theorem 3.1 in Section A.2 we know that the training loss minimizer $f$ satisfies $f(x) = (A \otimes A)\mathrm{vec}(W_{post})$ when $t = 2$ , so we obtain $\mathrm{vec}(W_{post})$ by $\mathrm{vec}(W_{post}) = (A \otimes A)^{\dagger}f(x)$ where we expect $W_{post}$ to be a symmetric matrix. But we find that in our experiment $W_{post}$ is nearly symmetric but not perfectly symmetric, and to amend this, we use $\frac{1}{2}(W_{post} + W_{post}^T)$ as the SSL-recovered posterior tensor. + +
Document Type
αPureLDACTMPAM
18866
38866
58866
78886
988810
+ +We observe that the attention-based neural network architecture with 384 hidden dimension and varying number of attention blocks (shown in Table C.9) is performs better on learning the distribution of 2 missing words than the fully-connected neural network for all four types of documents, so all of the following results are based on the output of trained attention-based neural network. We use the posterior mean from MCMC assuming the correct prior as the ground-truth topic posterior, and use the TV distance to measure how far the SSL-recovered topic posterior deviates from it, as shown in Table C.10. In most scenarios, the TV distance is less than 0.15, and TV distance gets slightly larger as $\alpha$ increases, i.e., the word distribution of each topic gets less distinguishable. + +Table C.9: The number of attention blocks used in the neural network architecture for $t = 2$ for all four types of documents and $\alpha = 1,3,5,7,9$ . + +
TV Distance αDocument Type
PureLDACTMPAM
10.0081 ± 0.00020.0636 ± 0.00310.0748 ± 0.00530.0748 ± 0.0035
30.0291 ± 0.00030.0870 ± 0.00390.1206 ± 0.00690.1045 ± 0.0047
50.0431 ± 0.00040.1075 ± 0.00500.1523 ± 0.00670.1544 ± 0.0062
70.0578 ± 0.000040.1258 ± 0.00490.1627 ± 0.00580.1693 ± 0.0065
90.0662 ± 0.00060.1413 ± 0.00520.1859 ± 0.00610.2770 ± 0.0152
+ +Table C.10: Topic posterior recovery loss of our self-supervised learning approach for $t = 2$ , measured in Total Variation distance, for all four types of documents and $\alpha = 1,3,5,7,9$ . We report the 95% confidence interval. + +We also measure how the largest entries in the SSL-recovered topic posterior overlap with the largest entries in the topic prior. Note that for each document, since the underlying topic of each word is + +
αDocument Type
PureLDACTMPAM
11.0 ± 0.00.9350 ± 0.03420.9088 ± 0.02860.8638 ± 0.0402
31.0 ± 0.00.8800 ± 0.04500.8700 ± 0.03630.8075 ± 0.0476
51.0 ± 0.00.8950 ± 0.04250.8050 ± 0.04730.8012 ± 0.0512
71.0 ± 0.00.9100 ± 0.03970.8450 ± 0.04280.8125 ± 0.0472
91.0 ± 0.00.8950 ± 0.04250.7675 ± 0.05050.6625 ± 0.0485
+ +Table C.11: The major topic pair recovery rate of our self-supervised learning approach for $t = 2$ for all four types of documents and $\alpha = 1,3,5,7,9$ . We report the 95% confidence interval. + +drawn iid, the joint topic prior distribution for the 2 missing words is the Kronecker product of the document's topic prior distribution with itself. For the overlap rate, in the $t = 1$ case we measured the overlap of the top 1 topic for pure topic and LDA documents and the overlap of top 2 topics for CTM and PAM documents, because most pure topic documents and LDA documents are generated by one dominant topic whereas most CTM and PAM documents are generated by two correlated dominant topics. Similarly, in the $t = 2$ case we measure the overlap of the top 1 entry for pure topic and LDA documents and the overlap of top $2 \times 2 = 4$ entries for CTM and PAM documents. We will refer to this overlap rate as the "major topic pair recovery rate". The results are shown in Table C.11. Overall, the overlap rate is very high, which indicates that for $t = 2$ our self-supervised learning approach can capture the most dominant topic(s) for the 2 missing words. + +# C.9 DETAILS OF MCMC NUTS SAMPLING METHOD + +In our experiments, we use PyMC3 package Salvatier et al. (2016) to perform NUTS-based MCMC posterior sampling. Specifically, we use 3000 tuning iterations to tune the sampler's step size so that we approximate an acceptance rate of 0.9. After tuning, we draw 2000 samples from the posterior distribution and use the mean of these 2000 samples as our best estimate for the topic posterior mean. + +To further check the performance of NUTS, we look into the LDA documents. As shown below, we observe that MCMC posterior assuming LDA model (bottom row) is also very similar to the ground truth $w$ (top row) used to generate the documents. + +![](images/526136b0ca436f8ed869e1e73430396f0a8c24a620ca446e6ee3a9fab15ebce6.jpg) +Figure C.6: Comparison of NUTS-based MCMC topic posterior assuming correct model and the document-generating topic proportions $w$ for sample test documents generated by LDA. + +# D REAL-DATA EXPERIMENT ADDITIONAL DETAILS + +In this section, we give more details about our real data experiments in Section 6. In Section D.1, we describe the data processing. We give a more detailed description of baselines and how we extracted our representations in Section D.2. In Section D.3, we report more results using different model architectures. Moreover, in Section D.4, we offer details about experiments on other real-world datasets and report the results. + +# D.1 DATA PROCESSING + +Here we detailed our usage of the AG news dataset by Zhang et al. (2015). Each category has 30,000 samples in the training set and 19,000 samples in the testing set. We first preprocessed the data by removing punctuation and words that occurred in fewer than 10 documents, obtaining in a vocabulary of around 16,700 words, in a similar fashion done by Tosh et al. (2021b). + +To split the data set into unsupervised dataset and supervised dataset, we selected a random sample of 1000 documents as labeled supervised dataset for each category of documents, while the remaining 116,000 documents fall into unsupervised dataset for representation learning. + +# D.2 EXTRACTING REPRESENTATIONS + +To give some details about two baseline representations we used, we described in details as follows: + +- Bag of Words (BOW): For a single document, we construct BOW embedding by creating a bag-of-words frequency vector of the dimension of vocabulary size, where each entry $i$ represent the frequency of words with id $i$ in that particular document. +- Word2vec: To generate Word2vec representation fitted the Skip-gram word embedding model on unsupervised dataset Mikolov et al. (2013). The implementation is done through the Gensim library Rehurek & Sojka (2011), where we used an embedding dimension of 200 (after tuning, see Table D.1) and window size of 5. Representation is taken as the average of all trained word embeddings in a single document. +- LDA: We construct a representation derived from LDA by first fitting Latent Dirichlet Allocation model Blei et al. (2003) on the unsupervised dataset and then use the posterior distribution over topics given a document as representation. We implemented LDA using scikit-learn Pedregosa et al. (2011) with default parameters except for number of topics, which we use as representation size. We use final dimension of 100 (after tuning, see Figure D.1). + +![](images/db649fc4105ae67678b80777ac1388673fe9b06c119e90c51a7caf2469e9db6e.jpg) +Figure D.1: Test Accuracy for different number of topics used for fitting LDA embedding model on the AG News dataset (Using $N = 10$ for $95\%$ Confidence Interval). + +For our own self-supervised method, to extract a representation, we attempted at 1) softmax+last layer: apply a Softmax directly to the last layer output, 2) Word2vec+last layer: apply an Word2vec embedding matrix to last layer output after Softmax to reduce dimension (the Word2vec matrix is trained over the unsupervised dataset), and 3) softmax+second2last layer: apply a Softmax function on top of the second-to-last layer (equivalent to applying an identity matrix to replace the last layer). The dimension of representation with Word2vec is 300 while the softmax + second2 last layer has a dimension of 4096. The original last layer representation has a dimension of the vocabulary size (around 16,700), and has shown inferior results than those with dimension reduction techniques. + +
Embedding dimensionTest Accuracy
2000.8498 ± 0.0007
3000.8488 ± 0.0007
5000.8484 ± 0.0007
7000.8483 ± 0.0006
10000.8488 ± 0.0009
20000.8473 ± 0.0006
30000.8481 ± 0.0001
50000.8482 ± 0.0006
+ +We included a comparison of the two approaches with dimension reduction in Table D.2, from which we observe that a Softmax on the second-to-last layer output performed better across layers of 3,4 and 5. We reported the result using the softmax+second2last layer in Figure 2. + +Table D.1: Test Accuracy for different embedding dimension used for fitting Skip-gram word embedding model on the AG News Dataset (Using $\mathrm{N} = {10}$ for 95% Confidence Interval). We fixed the window-size to be default of 5 and used1 all 4000 training examples. + +
Test Accuracy +# layers (residual)Word2vec+last layerMethod +softmax+second2last layersoftmax+lastlayer
30.85080.87140.8395
40.84500.86210.8430
50.84920.86890.8382
+ +Table D.2: Test Accuracy for different representation extraction method. We fixed the rest of hyperparameters to be: 5000 embedding dimension, 150 epochs, 0.0002 learning rate, sampling 4 words in labels, weight decay of 0.01 and resample rate of 2. + +# D.3 MODEL ARCHITECTURE + +We include here more details on our model architecture used in real data experiments. We used residual model, and tested two main hyperparameters: number of residual blocks and hidden dimension size. We fixed the rest of hyperparameters: we used a 5000 embedding dimension and trained for 150 epochs, with 0.0002 learning rate, weight decay of 0.01 and resample rate of 2. We sampled 4 words in labels for variance reduction purpose. + +Varying Depth and Width We investigated both the effect of model depth and width on the performance of RBL representation. We trained networks of width 2048, 3000, and 4096 nodes respectively, where the number of node refers to the number of node in the linear layer inside a residual block. We varied the depth of the network by choosing to place 3, 4 and 5 of such block. + +As shown in Figure D.2, it appears that using wider models in the unsupervised phase leads to better performance when training a linear classifier on the learned representations. Number of residual block does not seem to have a clear relationship with test accuracy from limited experiments we ran. The best accuracy is achieved when we have 3 residual blocks with dimension of 4096, which is what we used to generate results in Figure 2. + +# D.4 MORE REAL-DATA EXPERIMENTS + +In addition to the experiments on the AG news dataset, we also run experiments on the IMDB movie review sentiment classification dataset by Maas et al. (2011) and the Small DBpedia ontology dataset, which is a subset of the DBpedia ontology by Zhang et al. (2015), following the preprocessing by Tosh et al. (2021b). In particular, the IMDB movie review dataset contains a unlabeled set of 50k movie reviews, a training set of 12.5k positive movie reviews and 12.5k negative movie reviews, and a test set of 12.5k positive movie reviews and 12.5k negative movie reviews. We randomly selected 1k documents from each class in the training set as our training document and selected 3.5k documents in the test set as our test documents, and used the remaining 91k documents as our unsupervised dataset for training our SSL model to learn document representation. After filtering, + +![](images/0ef7c85b5bb0dd892a121b634bf4d0a2e840c1c139ce27395d5d7558e0708033.jpg) +(a) + +![](images/1a0ac02b99c7b79586cd700316fb1cadffab0a9357e8f27166f0694260eebf6c.jpg) +(b) + +![](images/4d88e3c385c54d88746883a66fa634d58663af4cb52c355faafc88b798df0336.jpg) +(c) + +![](images/d0c573267df1a7280f3d458e628d054898d159802f8075403928516a736dfc70.jpg) +Figure D.2: RBL representation performance varies with different residual model capacity: the best performing is the one with 3 layers and 4096 hidden dimensions, and it was what we used for Figure 2. In all these runs, we use Softmax on second-to-last layer to obtain our representations +(a) + +![](images/e7d17ecece9326c5cd93bb35966e9969ca8d8e205c869b99b8e79dd68e90a53a.jpg) +(b) +Figure D.3: Performances of RBL and baselines (BOW, Word2vec, LDA) on IMDB and SmallDBpedia datasets. RBL generally outperforms all baselines. + +the vocabulary size is about 35k. The Small DBpedia dataset consists of 4 non-overlapping classes, which are company, artist, athlete, and office holder from the original DBpedia ontology dataset, and each class consists 40k training documents and 5k test documents. We randomly chose 1k training documents each class as labeled training documents and used the rest of training documents as the unsupervised dataset, and used the original test documents as our test dataset. After we filtered rare words in the original DBpedia dataset, the vocabulary size is about 10k. + +In our experiments, the setup of the baselines follows Section D.2. We plot the test accuracy of our method against the baselines in Figure D.3. We did not include NCE in representation comparison since limited tuning does not achieve comparable results as in Tosh et al. (2021b). Parameter tuning result for LDA and Word2vec is documented in Figure D.4 and Table D.3 respectively. + +In the left panel of Figure D.3, we compare the performance of semi-supervised learning on IMDB dataset of our representation RBL as well as baselines. We point out that in general, RBL has similar performance to Word2vec, outperforming LDA and BOW. However, when labeled training data is less abundant, Word2vec and LDA have slightly stronger performance. + +![](images/013aab01626554275e94c3e1a772ca32c01b4e8a9b7336c1fa65cda957da1d31.jpg) +(a) + +![](images/4b017554453be55860ed51752cfc1c4c57f35c5d4c552a24ccef26ee0a76e085.jpg) +(b) +Figure D.4: Test Accuracy for different number of topics used for fitting LDA embedding model on the IMDB and Small DBpedia dataset. We use 100 as final dimension for both datasets based on the tuning above. + +
Test Accuracy Embedding DimensionsDatasets
IMDBSmall DBpedia
1000.8423±0.00140.9440±0.0007
2000.8529±0.00120.9541±0.0004
5000.8545±0.00110.9568±0.0004
10000.8544±0.00050.9567±0.0003
+ +Table D.3: Test Accuracy for different embedding dimension used for fitting Skip-gram word embedding model on the IMDB and Small DBpedia Dataset (Using N=10 for 95% Confidence Interval). We fixed the window-size to be default of 5 and use all available training examples. We use a dimension of 500 for both datasets for final baseline based on the results above. + +In the right panel of Figure D.3, we perform a similar representation comparison on Small DBpedia dataset. While RBL outperforms all other baselines when there are more than around 1000 training examples, it performs worse than Word2vec and LDA when labeled training data is less abundant. \ No newline at end of file diff --git a/understandingtherobustnessofselfsupervisedlearningthroughtopicmodeling/images.zip b/understandingtherobustnessofselfsupervisedlearningthroughtopicmodeling/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..e86888f56b387a4dd3b8f2fcd74e90327ea659b0 --- /dev/null +++ b/understandingtherobustnessofselfsupervisedlearningthroughtopicmodeling/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c4678c39a03e43d2c5188e7cc4213387f9ec17cc1ba79468586ed69428aa34ba +size 1555510 diff --git a/understandingtherobustnessofselfsupervisedlearningthroughtopicmodeling/layout.json b/understandingtherobustnessofselfsupervisedlearningthroughtopicmodeling/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..1e03c1873fa84b5ded1f8337d3467561bfa7af7f --- /dev/null +++ b/understandingtherobustnessofselfsupervisedlearningthroughtopicmodeling/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e29cfe489961c6e9c7887d968dbeeef780590e4a3e5b6c15ab8dadbc04913b4f +size 1216960 diff --git a/understandingtheroleofnonlinearityintrainingdynamicsofcontrastivelearning/2fdc99a1-9c10-4555-9faf-6ebaa1b4fc93_content_list.json b/understandingtheroleofnonlinearityintrainingdynamicsofcontrastivelearning/2fdc99a1-9c10-4555-9faf-6ebaa1b4fc93_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..38d0fbe39714283805804ef5053bdfce1e851241 --- /dev/null +++ b/understandingtheroleofnonlinearityintrainingdynamicsofcontrastivelearning/2fdc99a1-9c10-4555-9faf-6ebaa1b4fc93_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1e040aa17ef839cc8e9f3b1324ddd39ab178276895aeb348daedb274db2b8170 +size 326077 diff --git a/understandingtheroleofnonlinearityintrainingdynamicsofcontrastivelearning/2fdc99a1-9c10-4555-9faf-6ebaa1b4fc93_model.json b/understandingtheroleofnonlinearityintrainingdynamicsofcontrastivelearning/2fdc99a1-9c10-4555-9faf-6ebaa1b4fc93_model.json new file mode 100644 index 0000000000000000000000000000000000000000..97832f5a9977e2a3a9acffcf686a9e50574f177c --- /dev/null +++ b/understandingtheroleofnonlinearityintrainingdynamicsofcontrastivelearning/2fdc99a1-9c10-4555-9faf-6ebaa1b4fc93_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c40b5ee38b975fc73d6073e85c47ab72b5691e9a0ea7cf513be47afae8ce1b7f +size 370518 diff --git a/understandingtheroleofnonlinearityintrainingdynamicsofcontrastivelearning/2fdc99a1-9c10-4555-9faf-6ebaa1b4fc93_origin.pdf b/understandingtheroleofnonlinearityintrainingdynamicsofcontrastivelearning/2fdc99a1-9c10-4555-9faf-6ebaa1b4fc93_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8a3a46a4b6ed107aca589b2bfefa14d1d48e68a6 --- /dev/null +++ b/understandingtheroleofnonlinearityintrainingdynamicsofcontrastivelearning/2fdc99a1-9c10-4555-9faf-6ebaa1b4fc93_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:feff58ae389cf73dcfacbe72bdece7cdd51f5ca89894f6bed28272b8e3659988 +size 1757492 diff --git a/understandingtheroleofnonlinearityintrainingdynamicsofcontrastivelearning/full.md b/understandingtheroleofnonlinearityintrainingdynamicsofcontrastivelearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..3cf4ecd3447ecaff6bf9877b845b149bab055abc --- /dev/null +++ b/understandingtheroleofnonlinearityintrainingdynamicsofcontrastivelearning/full.md @@ -0,0 +1,1706 @@ +# UNDERSTANDING THE ROLE OF NONLINEARITY IN TRAINING DYNAMICS OF CONTRASTIVE LEARNING + +Yuandong Tian + +Meta AI (FAIR) + +yuandong@meta.com + +# ABSTRACT + +While the empirical success of self-supervised learning (SSL) heavily relies on the usage of deep nonlinear models, existing theoretical works on SSL understanding still focus on linear ones. In this paper, we study the role of nonlinearity in the training dynamics of contrastive learning (CL) on one and two-layer nonlinear networks with homogeneous activation $h(x) = h'(x)x$ . We have two major theoretical discoveries. First, the presence of nonlinearity can lead to many local optima even in 1-layer setting, each corresponding to certain patterns from the data distribution, while with linear activation, only one major pattern can be learned. This suggests that models with lots of parameters can be regarded as a brute-force way to find these local optima induced by nonlinearity. Second, in the 2-layer case, linear activation is proven not capable of learning specialized weights into diverse patterns, demonstrating the importance of nonlinearity. In addition, for 2-layer setting, we also discover global modulation: those local patterns discriminative from the perspective of global-level patterns are prioritized to learn, further characterizing the learning process. Simulation verifies our theoretical findings. + +# 1 INTRODUCTION + +Over the last few years, deep models have demonstrated impressive empirical performance in many disciplines, not only in supervised but also in recent self-supervised setting (SSL), in which models are trained with a surrogate loss (e.g., predictive (Devlin et al., 2018; He et al., 2021), contrastive (Chen et al., 2020; Caron et al., 2020; He et al., 2020) or noncontrastive loss (Grill et al., 2020; Chen & He, 2020)) and its learned representation is then used for downstream tasks. + +From the theoretical perspective, understanding the roles of nonlinearity in deep neural networks is one critical part of understanding how modern deep models work. Currently, most works focus on linear variants of deep models (Jacot et al., 2018; Arora et al., 2019a; Kawaguchi, 2016; Jing et al., 2022; Tian et al., 2021; Wang et al., 2021). When nonlinearity is involved, deep models are often treated as richer families of black-box functions than linear ones (Arora et al., 2019b; HaoChen et al., 2021). The role played by nonlinearity is also studied, mostly on model expressibility (Guhring et al., 2020; Raghu et al., 2017; Lu et al., 2017) in which specific weights are found to fit the complicated structure of the data well, regardless of the training algorithm. However, many questions remain open: if model capacity is the key, why traditional models like $k$ -NN (Fix & Hodges, 1951) or kernel SVM (Cortes & Vapnik, 1995) do not achieve comparable empirical performance, even if theoretically they can also fit any functions (Hammer & Gersmann, 2003; Devroye et al., 1994). Moreover, while traditional ML theory suggests carefully controlling model capacity to avoid overfitting, large neural models often generalize well in practice (Brown et al., 2020; Chowdhery et al., 2022). + +In this paper, we study the critical role of nonlinearity in the training dynamics of contrastive learning (CL). Specifically, by extending the recent $\alpha$ -CL framework (Tian, 2022) and linking it to kernels (Paulsen & Raghupathi, 2016), we show that even with 1-layer nonlinear networks, nonlinearity plays a critical role by creating many local optima. As a result, the more nonlinear nodes in 1-layer networks with different initialization, the more local optima are likely to be collected as learned patterns in the trained weights, and the richer the resulting representation becomes. Moreover, popular loss functions like InfoNCE tends to have more local optima than quadratic ones. In contrast, in the linear setting, contrastive learning becomes PCA under certain conditions (Tian, 2022), and only the most salient pattern (i.e., the maximal eigenvector of the data covariance matrix) is learned while other less salient ones are lost, regardless of the number of hidden nodes. + +Based on this finding, we extend our analysis to 2-layer ReLU setting with non-overlapping receptive fields. In this setting, we prove the fundamental limitation of linear networks: the gradients of multiple weights at the same receptive field are always co-linear, preventing diverse pattern learning. + +Finally, we also characterize the interaction between layers in 2-layer network: while in each receptive field, many patterns exist, those contributing to global patterns are prioritized to learn by the training dynamics. This global modulation changes the eigenstructure of the low-level covariance matrix so that relevant patterns are learned with higher probability. + +In summary, through the lens of training dynamics, we discover unique roles played by nonlinearity which linear activation cannot do: (1) nonlinearity creates many local optima for different patterns of the data, and (2) nonlinearity enables weight specialization to diverse patterns. In addition, we also discover a mechanism for how global pattern prioritizes which local patterns to learn, shedding light on the role played by network depth. Preliminary experiments on simulated data verify our findings. + +Related works. Many works analyze network at initialization (Hayou et al., 2019; Roberts et al., 2021) and avoid the complicated training dynamics. Previous works (Wilson et al., 1997; Li & Yuan, 2017; Tian et al., 2019; Tian, 2017; Allen-Zhu & Li, 2020) that analyze training dynamics mostly focus on supervised learning. Different from Saunshi et al. (2022); Ji et al. (2021) that analyzes feature learning process in linear models of CL, we focus on the critical role played by nonlinearity. Our analysis is also more general than Li & Yuan (2017) that focuses on 1-layer ReLU network with symmetric weight structure trained on sparse linear models. Along the line of studying dynamics of contrastive learning, Jing et al. (2022) analyzes dimensional collapsing on 1 and 2 layer linear networks. Tian (2022) proves that such collapsing happens in linear networks of any depth and further analyze ReLU scenarios but with strong assumptions (e.g., one-hot positive input). Our work uses much more relaxed assumptions and performs in-depth analysis for homogeneous activations. + +# 2 PROBLEM SETUP + +Notation. In this section, we introduce our problem setup of contrastive learning. Let $\pmb{x}_0 \sim p_{\mathrm{D}}(\cdot)$ be a sample drawn from the dataset, and $\pmb{x} \sim p_{\mathrm{aug}}(\cdot | \pmb{x}_0)$ be a augmentation view of the sample $\pmb{x}_0$ . Here both $\pmb{x}_0$ and $\pmb{x}$ are random variables. Let $\pmb{f} = \pmb{f}(\pmb{x}; \pmb{\theta})$ be the output of a deep neural network that maps input $\pmb{x}$ into some representation space with parameter $\pmb{\theta}$ to be optimized. Given a batch of size $N$ , $\pmb{x}_0[i]$ represent $i$ -th sample (i.e., instantiation) of corresponding random variables, and $\pmb{x}[i]$ and $\pmb{x}[i']$ are two of its augmented views. Here $\pmb{x}[\cdot]$ has $2N$ samples, $1 \leq i \leq N$ and $N + 1 \leq i' \leq 2N$ . + +Contrastive learning (CL) aims to learn the parameter $\theta$ so that the representation $\pmb{f}$ are distinct from each other: we want to maximize squared distance $d_{ij}^{2} \coloneqq \| \pmb{f}[i] - \pmb{f}[j] \|_2^2 / 2$ between samples $i \neq j$ and minimize $d_{i}^{2} \coloneqq \| \pmb{f}[i] - \pmb{f}[i'] \|_2^2 / 2$ between two views $\pmb{x}[i]$ and $\pmb{x}[i']$ from the same sample $\pmb{x}_0[i]$ . + +Many objectives in contrastive learning have been proposed to combine these two goals into one. For example, InfoNCE (Oord et al., 2018) minimizes the following (here $\tau$ is the temperature): + +$$ +\mathcal {L} _ {n c e} := - \tau \sum_ {i = 1} ^ {N} \log \frac {\exp \left(- d _ {i} ^ {2} / \tau\right)}{\epsilon \exp \left(- d _ {i} ^ {2} / \tau\right) + \sum_ {j \neq i} \exp \left(- d _ {i j} ^ {2} / \tau\right)} \tag {1} +$$ + +In this paper, we follow $\alpha$ -CL (Tian, 2022) that proposes a general CL framework that covers a broad family of existing CL losses. $\alpha$ -CL maximizes an energy function $\mathcal{E}_{\alpha}(\pmb{\theta})$ using gradient ascent: + +$$ +\boldsymbol {\theta} _ {t + 1} = \boldsymbol {\theta} _ {t} + \eta \nabla_ {\boldsymbol {\theta}} \mathcal {E} _ {\mathrm {s g} (\alpha (\boldsymbol {\theta} _ {t}))} (\boldsymbol {\theta}), \tag {2} +$$ + +where $\eta$ is the learning rate, $\mathrm{sg}(\cdot)$ is the stop gradient operator, the energy function $\mathcal{E}_{\alpha}(\pmb{\theta}) := \frac{1}{2}\mathrm{tr}\mathbb{C}_{\alpha}[\pmb{f},\pmb{f}]$ and $\mathbb{C}_{\alpha}[\cdot,\cdot]$ is the contrastive covariance (Tian, 2022; Jing et al., 2022)1: + +$$ +\mathbb {C} _ {\alpha} [ \boldsymbol {a}, \boldsymbol {b} ] := \frac {1}{2 N ^ {2}} \sum_ {i, j = 1} ^ {N} \alpha_ {i j} \left[ (\boldsymbol {a} [ i ] - \boldsymbol {a} [ j ]) (\boldsymbol {b} [ i ] - \boldsymbol {b} [ j ]) ^ {\top} - (\boldsymbol {a} [ i ] - \boldsymbol {a} [ i ^ {\prime} ]) (\boldsymbol {b} [ i ] - \boldsymbol {b} [ i ^ {\prime} ]) ^ {\top} \right] \tag {3} +$$ + +One important quantity is the pairwise importance $\alpha (\pmb {\theta}) = [\alpha_{ij}(\pmb {\theta})]_{i,j = 1}^{N}$ , which are $N^2$ weights on pairwise pairs of $N$ samples in a batch. Intuitively, these weights make the training focus more on hard negative pairs, i.e., distinctive sample pairs that are similar in the representation space but are supposed to be separated away. Many existing CL losses (InfoNCE, triplet loss, etc) are special cases of $\alpha$ -CL (Tian, 2022) by choosing different $\alpha (\pmb {\theta})$ , e.g., quadratic loss corresponds to $\alpha_{ij}\coloneqq$ const and InfoNCE (with $\epsilon = 0$ ) corresponds to $\alpha_{ij}\coloneqq \exp (-d_{ij}^2 /\tau) / \sum_{j\neq i}\exp (-d_{ij}^2 /\tau)$ . + +For brevity $\mathbb{C}_{\alpha}[\pmb{x}]\coloneqq \mathbb{C}_{\alpha}[\pmb{x},\pmb{x}]$ . For the energy function $\mathcal{E}_{\alpha}(\pmb{\theta})\coloneqq \mathrm{tr}\mathbb{C}_{\alpha}[\pmb {f}(\pmb {x};\pmb {\theta})]$ , in this work we mainly study its landscape, i.e., existence of local optima, their local properties and overall + +distributions, where $\pmb{f}$ is a nonlinear network with parameters $\theta$ . Note that in Eqn. 2, the stop gradient operator $\mathrm{sg}(\alpha)$ means that while the value of $\alpha$ may depend on $\theta$ , when studying the local property of $\theta$ , $\alpha$ makes no contribution to the gradient and should be treated as an independent variable. + +Since $\mathbb{C}_{\alpha}$ is an abstract mathematical object with complicated definitions, as the first contribution, we give its connection to regular variance $\mathbb{V}[\cdot]$ , if the pairwise importance $\alpha$ has certain kernel structures (Ghojogh et al., 2021; Paulsen & Raghupathi, 2016): + +Definition 1 (Kernel structure of pairwise importance $\alpha$ ). There exists a (kernel) function $\mathcal{K}(\cdot, \cdot)$ so that $\alpha_{ij} = \mathcal{K}(\pmb{x}_0[i], \pmb{x}_0[j])$ . Here $\mathcal{K}$ satisfies the decomposition $\mathcal{K}(\pmb{a}, \pmb{b}) = \phi^\top(\pmb{a})\phi(\pmb{b}) = \sum_{l=0}^{+\infty} \phi_l(\pmb{a})\phi_l(\pmb{b})$ with non-negative high-dimensional mapping $\phi(\cdot) = [\phi_l(\cdot)] \geq 0$ . + +Definition 2 (Adjusted PDF $\tilde{p}_l(\boldsymbol{x})$ ). For $l$ -th component $\phi_l$ of the mapping $\phi$ , we define the adjusted density $\tilde{p}_l(\boldsymbol{x};\alpha) := \frac{1}{z_l(\alpha)}\phi_l(\boldsymbol{x};\alpha)p_{\mathrm{D}}(\boldsymbol{x})$ , where $z_l(\alpha) := \int \phi_l(\boldsymbol{x})p_{\mathrm{D}}(\boldsymbol{x})\mathrm{d}\boldsymbol{x} \geq 0$ is the normalizer. + +Obviously $\alpha_{ij} \equiv 1$ (uniform $\alpha$ corresponding to quadratic loss) satisfies Def. 1 with 1D mapping $\phi \equiv 1$ . Here we show a non-trivial case, Gaussian $\alpha$ , whose normalized version leads to InfoNCE: + +Lemma 1 (Gaussian $\alpha$ ). For any function $g(\cdot)$ that is bounded below, if we use $\alpha_{ij} := \exp(-\| g(\pmb{x}_0[i]) - g(\pmb{x}_0[j])\|_2^2 / 2\tau)$ as the pairwise importance, then it has kernel structure (Def. 1). + +Note that Gaussian $\alpha$ computes $N^2$ pairwise distances using un-augmented samples $\pmb{x}_0$ , while InfoNCE (and most of CL losses) uses augmented views $\pmb{x}$ and $\pmb{x}'$ and normalizes along one dimension to yield asymmetric $\alpha_{ij}$ . Here Gaussian $\alpha$ is a convenient tool for analysis. We now show $\mathbb{C}_{\alpha}$ is a summation of regular variances but with different probability of data, adjusted by the pairwise importance $\alpha$ that has kernel structures. Please check Appendix A.1 for detailed proofs. + +Lemma 2 (Relationship between Contrastive Covariance and Variance in large batch size). If $\alpha$ satisfies Def. 1, then for any function $g(\cdot)$ , $\mathbb{C}_{\alpha}[g(\pmb{x})]$ is asymptotically PSD when $N \to +\infty$ : + +$$ +\mathbb {C} _ {\alpha} [ \boldsymbol {g} (\boldsymbol {x}) ] \rightarrow \sum_ {l} z _ {l} ^ {2} \mathbb {V} _ {\boldsymbol {x} _ {0} \sim \tilde {p} _ {l} (\cdot ; \alpha)} \left[ \mathbb {E} _ {\boldsymbol {x} \sim p _ {\text {a u g}} (\cdot | \boldsymbol {x} _ {0})} [ \boldsymbol {g} (\boldsymbol {x}) | \boldsymbol {x} _ {0} ] \right] \tag {4} +$$ + +Corollary 1 (No augmentation and large batchsize). With the condition of Lemma 2, if we further assume there is no augmentation (i.e., $p_{\mathrm{aug}}(\pmb{x}|\pmb{x}_0) = \delta(\pmb{x} - \pmb{x}_0)$ ), then $\mathbb{C}_{\alpha}[\pmb{g}] \to \sum_l z_l^2 \mathbb{V}_{\tilde{p}_l}[\pmb{g}]$ . + +# 3 ONE-LAYER CASE + +Now let us first consider 1-layer network with $K$ hidden nodes: $\pmb{f}(\pmb{x};\pmb{\theta}) = h(W\pmb{x})$ , where $W = [\pmb{w}_1,\dots,\pmb{w}_K]^\top \in \mathbb{R}^{K\times d}$ , $\pmb{\theta} = \{W\}$ and $h(x)$ is the activation. The $k$ -th row of $W$ is a weight $\pmb{w}_k$ and its output is $f_k \coloneqq h(\pmb{w}_k^\top \pmb{x})$ . In this case, $\mathrm{tr}\mathbb{C}_{\alpha}[\pmb{f}] = \sum_{k=1}^{K} \mathbb{C}_{\alpha}[f_k]$ . We consider per-filter normalization $\| \pmb{w}_k \|_2 = 1$ , which can be achieved by imposing BatchNorm (Ioffe & Szegedy, 2015) at each node $k$ (Tian, 2022). In this case, optimization can be decoupled into each filter $\pmb{w}_k$ : + +$$ +\max _ {\boldsymbol {\theta}} \mathcal {E} _ {\alpha} (\boldsymbol {\theta}) = \frac {1}{2} \max _ {\| \boldsymbol {w} _ {k} \| _ {2} = 1, 1 \leq k \leq K} \operatorname {t r} \mathbb {C} _ {\alpha} [ \boldsymbol {f} ] = \frac {1}{2} \sum_ {k = 1} ^ {K} \max _ {\| \boldsymbol {w} _ {k} \| _ {2} = 1} \mathbb {C} _ {\alpha} [ h (\boldsymbol {w} _ {k} ^ {\top} \boldsymbol {x}) ] \tag {5} +$$ + +Now let's think about, which parameters $\pmb{w}_k$ maximizes the summation? For the linear case, since $\mathbb{C}_{\alpha}[h(\pmb{w}^{\top}\pmb{x})] = \mathbb{C}_{\alpha}[\pmb{w}^{\top}\pmb{x}] = \pmb{w}^{\top}\mathbb{C}_{\alpha}[\pmb{x}]\pmb{w}$ , all $\pmb{w}_k$ converge to the maximal eigenvector of $\mathbb{C}_{\alpha}[\pmb{x}]$ (a constant matrix), regardless of how they are initialized and what the distribution of $\pmb{x}$ is. Therefore, the linear case will only learn the most salient single pattern due to the (overly-smooth) landscape of the objective function, a winner-take-all effect that neglects many patterns in the data. + +In contrast, nonlinearity can change the landscape and create more local optima in $\mathbb{C}_{\alpha}[h(\boldsymbol{w}^{\top}\boldsymbol{x})]$ , each capturing one pattern. In this paper, we consider a general category of nonlinearity activations: + +Assumption 1 (Homogeneity (Du et al., 2018)/Reversibility (Tian et al., 2020)). The activation satisfies $h(x) = h'(x)x$ . + +Many activations satisfy this assumption, including linear, ReLU, LeakyReLU and monomial activations like $h(x) = x^p$ (with an additional global constant). In this case we have: + +$$ +h \left(\boldsymbol {w} ^ {\top} \boldsymbol {x}\right) = \boldsymbol {w} ^ {\top} h ^ {\prime} \left(\boldsymbol {w} ^ {\top} \boldsymbol {x}\right) \boldsymbol {x} = \boldsymbol {w} ^ {\top} \tilde {\boldsymbol {x}} ^ {\boldsymbol {w}}, \tag {6} +$$ + +![](images/56d217211fddf8a72da2654562618cac1f5a3994a4fe29614f58f1257765d71c.jpg) +Figure 1: Left: Summary of Sec. 3. (a) We analyze the dynamics of one-layer network $h(\boldsymbol{w}^\top \boldsymbol{x})$ under CL loss (Eqn. 2). (b) With linear activation $h(x) = x$ , then there is only one fixed point (PCA direction). (c) Non-linear activation $h(x)$ creates many critical points and a proper choice of pairwise importance $\alpha$ can make them local optima, enabling learning of diverse features. Right: Convergence patterns (iteration $t$ versus iteration discrepancy $\| \boldsymbol{w}(t + 1) - \boldsymbol{w}(t)\|_2$ ) of Power Iteration (Eqn. PI) in latent summation models, when $\| U^\top U - I\|_2$ is small but non-zero. In this case, Theorem 3 tells there still exist local optima close to each $\boldsymbol{u}_m$ . + +![](images/40b78b7c6ef3ccff6d3fa33d6deda257f6f3e73643fb710091e268b37bde786b.jpg) + +![](images/00027cdd75d993b62dff4251b7dcf2f807575fc4f13fdec494f35205ab71a442.jpg) + +![](images/d38dcb4c59e6b3134085d6e0e64bb6943ae5e667b17175171495614680c49fdc.jpg) + +![](images/c688365bde595da750f6c563cc34ee433a04c7a40dc01bdb1891261921b552ff.jpg) + +where $\tilde{\pmb{x}}^{\pmb{w}}\coloneqq \pmb {x}\cdot h^{\prime}(\pmb{w}^{\top}\pmb {x})$ is the input data after nonlinear gating. When there is no ambiguity, we just write $\tilde{\pmb{x}}^{\pmb{w}}$ as $\tilde{\pmb{x}}$ and omit the weight superscript. One property is $\mathbb{C}_{\alpha}[h(\pmb{w}^{\top}\pmb {x})] = \pmb{w}^{\top}\mathbb{C}_{\alpha}[\tilde{\pmb{x}}^{\pmb{w}}]\pmb {w}$ + +Now let $A(\boldsymbol{w}) \coloneqq \mathbb{C}_{\alpha}[\tilde{\boldsymbol{x}}^{\boldsymbol{w}}]$ . With the constraint $\| \boldsymbol{w}\| _2 = 1$ , the learning dynamics is: + +Lemma 3 (Training dynamics of 1-layer network with homogeneous activation in contrastive learning). The gradient dynamics of Eqn. 5 is (note that $\alpha$ is treated as an independent variable): + +$$ +\dot {\boldsymbol {w}} _ {k} = P _ {\boldsymbol {w} _ {k}} ^ {\perp} A \left(\boldsymbol {w} _ {k}\right) \boldsymbol {w} _ {k} \tag {7} +$$ + +Here $P_{\pmb{w}_k}^{\perp} \coloneqq I - \pmb{w}_k \pmb{w}_k^\top$ projects a vector into the complementary subspace spanned by $\pmb{w}_k$ . + +See Appendix B.2 for derivations. Now the question is that: what is the critical point of the dynamics and whether they are attractive (i.e., local optima). In linear case, the maximal eigenvector is the one fixed point; in nonlinear case, we are looking for locally maximal eigenvectors, called LME. + +Definition 3 (Locally maximal eigenvector (LME)). $\pmb{w}_{*}$ is a locally maximal eigenvector of $A(\pmb{w})$ , if $A(\pmb{w}_{*})\pmb{w}_{*} = \lambda_{*}\pmb{w}_{*}$ , where $\lambda_{*} = \lambda_{\max}(A(\pmb{w}_{*}))$ is the distinct maximal eigenvalue of $A(\pmb{w}_{*})$ . + +It is easy to see each LME is a critical point of the dynamics, since $P_{\pmb{w}_{*}}^{\perp}A(\pmb{w}_{*})\pmb{w}_{*} = \lambda P_{\pmb{w}_{*}}^{\perp}\pmb{w}_{*} = 0$ + +# 3.1 EXAMPLES WITH MULTIPLE LMES IN RELU SETTING + +To see why the nonlinear activation leads to many LMEs in Eqn. 7, we first give two exemplar generative models of the input $\pmb{x}$ that show Eqn. 7 has multiple critical points, then introduce more general cases. To make the examples simple and clear, we assume the condition of Corollary 1 (no augmentation and large batchsize), and let $\alpha_{ij} \equiv 1$ . Notice that $\tilde{\boldsymbol{x}}^{\boldsymbol{w}}$ is a deterministic function of $\boldsymbol{x}$ , therefore $A(\boldsymbol{w}) \coloneqq \mathbb{C}_{\alpha}[\tilde{\boldsymbol{x}}^{\boldsymbol{w}}] = \mathbb{V}[\tilde{\boldsymbol{x}}^{\boldsymbol{w}}]$ . We also use ReLU activation $h(x) = \max(x, 0)$ . + +Let $U = [\pmb{u}_1, \dots, \pmb{u}_M]$ be orthonormal bases ( $\pmb{u}_m^\top \pmb{u}_{m'} = \mathbb{I}(m = m')$ ). Here are two examples: + +Latent categorical model. Suppose $y$ is a categorical random variable taking $M$ possible values, $\mathbb{P}[\pmb{x}|y = m] = \delta (\pmb{x} - \pmb{u}_m)$ . Then we have (see Appendix B.1 for detailed steps): + +$$ +\left. A (\boldsymbol {w}) \right| _ {\boldsymbol {w} = \boldsymbol {u} _ {m}} := \mathbb {C} _ {\alpha} [ \tilde {\boldsymbol {x}} ^ {\boldsymbol {w}} ] = \mathbb {V} [ \tilde {\boldsymbol {x}} ^ {\boldsymbol {w}} ] = \mathbb {P} [ y = m ] (1 - \mathbb {P} [ y = m ]) \boldsymbol {u} _ {m} \boldsymbol {u} _ {m} ^ {\top} \tag {8} +$$ + +Now it is clear that $\pmb{w} = \pmb{u}_m$ is an LME for any $m$ . + +Latent summation model. Suppose there is a latent variable $\mathbf{y}$ so that $\mathbf{x} = U\mathbf{y}$ , where $\mathbf{y} := [y_1, y_2, \dots, y_M]$ . Each $y_m$ is a standardized Bernoulli random variable: $\mathbb{E}[y_m] = 0$ and $\mathbb{E}[y_m^2] = 1$ . This means that $y_m = y_m^+ := \sqrt{(1 - q_m) / q_m}$ with probability $q_m$ and $y_m = y_m^- := -\sqrt{q_m / (1 - q_m)}$ with probability $1 - q_m$ . For $m_1 \neq m_2$ , $y_{m_1}$ and $y_{m_2}$ are independent. Then we have: + +$$ +\left. A (\boldsymbol {w}) \right| _ {\boldsymbol {w} = \boldsymbol {u} _ {m}} := \mathbb {C} _ {\alpha} \left[ \tilde {\boldsymbol {x}} ^ {\boldsymbol {w}} \right] = \mathbb {V} \left[ \tilde {\boldsymbol {x}} \right] = (1 - q _ {m}) ^ {2} \boldsymbol {u} _ {m} \boldsymbol {u} _ {m} ^ {\top} + q _ {m} \left(I - \boldsymbol {u} _ {m} \boldsymbol {u} _ {m} ^ {\top}\right) \tag {9} +$$ + +which has a maximal and distinct eigenvector of $\mathbf{u}_m$ with a unique eigenvalue $(1 - q_m)^2$ , when $q_m < \frac{1}{2} (3 - \sqrt{5}) \approx 0.382$ . Therefore, different $\mathbf{w}$ leads to different LMEs. + +In both cases, the presence of ReLU removes the "redundant energy" so that $A(\boldsymbol{w})$ can focus on specific directions, creating multiple LMEs that correspond to multiple learnable patterns. The two examples can be computed analytically due to our specific choices on nonlinearity $h$ and $\alpha$ . + +# 3.2 RELATE LMES TO LOCAL OPTIMA + +Once LMEs are identified, the next step is to check whether they are attractive, or stable critical points, or local optima. That is, whether the weights converge into them and stay there during training. For this, some notations are introduced below. + +Notations. Let $\lambda_{i}(\pmb{w})$ be the $i$ -th largest eigenvalue of $A(\pmb{w})$ , and $\phi_{i}(\pmb{w})$ the corresponding unit eigenvector, $\lambda_{\mathrm{gap}}(\pmb{w}) \coloneqq \lambda_{1}(\pmb{w}) - \lambda_{2}(\pmb{w})$ the eigenvalue gap. Let $\rho(\pmb{w})$ be the local roughness measure: $\rho(\pmb{w})$ is the smallest scalar to satisfy $\| (A(\pmb{v}) - A(\pmb{w}))\pmb{w}\|_2 \leq \rho(\pmb{w})\| \pmb{v} - \pmb{w}\|_2 + \mathcal{O}(\| \pmb{v} - \pmb{w}\|_2^2)$ in a local neighborhood of $\pmb{w}$ . The following theorem gives a sufficient condition for stability of $\pmb{w}_{*}$ . + +Theorem 1 (Stability of $\pmb{w}^{*}$ ). If $\pmb{w}_{*}$ is a LME of $A(\pmb{w}_{*})$ and $\lambda_{\mathrm{gap}}(\pmb{w}_{*}) > \rho(\pmb{w}_{*})$ , then $\pmb{w}_{*}$ is stable. + +This shows that lowering roughness measure $\rho(\boldsymbol{w}_*)$ at critical point $\boldsymbol{w}_*$ could lead to more local optima and more patterns to be learned. To characterize such a behavior, we bound $\rho(\boldsymbol{w}_*)$ : + +Theorem 2 (Bound of local roughness $\rho(\boldsymbol{w})$ in ReLU setting). If input $\|\boldsymbol{x}\|_2 \leq C_0$ is bounded, $\alpha$ has kernel structure (Def. 1) and batchsize $N \to +\infty$ , then $\rho(\boldsymbol{w}_*) \leq \frac{C_0^3 \mathrm{vol}(C_0)}{\pi} r(\boldsymbol{w}_*, \alpha)$ , where $r(\boldsymbol{w}, \alpha) := \sum_{l=0}^{+\infty} z_l^2(\alpha) \max_{\boldsymbol{w}^\top \boldsymbol{x} = 0} \tilde{p}_l(\boldsymbol{x}; \alpha)$ . + +From Thm. 2, the bound critically depends on $r(\alpha)$ that contains the adjusted density $\tilde{p}_l(\boldsymbol{x};\alpha)$ (Def. 2) at the plane $\boldsymbol{w}_{*}^{\top}\boldsymbol{x} = 0$ . This is because a local perturbation of $\boldsymbol{w}_{*}$ leads to data inclusion/exclusion close to the plane, and thus changes $\rho (\boldsymbol{w}_{*})$ . Different $\alpha$ leads to different $\tilde{p}_l(\boldsymbol{x};\alpha)$ , and thus different upper bound of $\rho (\boldsymbol{w}_{*})$ , creating fewer or more local optima (i.e., patterns) to learn. Here is an example that shows Gaussian $\alpha$ (see Lemma 1), whose normalized version is used in InfoNCE, can lead to more local optima than uniform $\alpha$ , by lowering roughness bound characterized by $r(\boldsymbol{w}_{*},\alpha)$ : + +Corollary 2 (Effect of different $\alpha$ ). For uniform $\alpha_{\mathrm{u}}$ ( $\alpha_{ij} := 1$ ) and 1-D Gaussian $\alpha_{\mathrm{g}}$ ( $\alpha_{ij} := \exp(-\|h(\pmb{w}^{\top}\pmb{x}_0[i]) - h(\pmb{w}^{\top}\pmb{x}_0[j])\|_2^2/2\tau)$ ), we have $r(\pmb{w}_*, \alpha_{\mathrm{g}}) = z_0(\alpha_{\mathrm{g}})r(\pmb{w}_*, \alpha_{\mathrm{u}})$ with $z_0(\alpha_{\mathrm{g}}) := \int \exp(-h^2(\pmb{w}_*^{\top}\pmb{x})/2\tau)p_{\mathrm{D}}(\pmb{x})\mathrm{d}\pmb{x} \leq 1$ . As a result, $z_0(\alpha_{\mathrm{g}}) \ll 1$ leads to $r(\pmb{w}_*, \alpha_{\mathrm{g}}) \ll r(\pmb{w}_*, \alpha_{\mathrm{u}})$ . + +In practice, $z_{0}(\alpha_{\mathrm{g}})$ can be exponentially small (e.g., when most data appear on the positive side of the weight $w_{*}$ ) and the roughness with Gaussian $\alpha$ can be much smaller than that of uniform $\alpha$ , which is presumably the reason why InfoNCE outperforms quadratic CL loss (Tian, 2022). + +# 3.3 FINDING CRITICAL POINTS WITH INITIAL GUESS + +In the following, we focus on how can we find an LME, when $A(\boldsymbol{w})$ does not have analytic form. We show that if there is an "approximate eigenvector" of $A(\boldsymbol{w}) \coloneqq \mathbb{C}_{\alpha}[\tilde{\boldsymbol{x}}^{\boldsymbol{w}}]$ , then a real one is nearby. + +Let $L$ be the Lipschitz constant of $A(\boldsymbol{w})$ : $\| A(\boldsymbol{w}) - A(\boldsymbol{w}^{\prime}) \|_2 \leq L \| \boldsymbol{w} - \boldsymbol{w}^{\prime} \|_2$ for any $\boldsymbol{w}, \boldsymbol{w}^{\prime}$ on the unit sphere $\| \boldsymbol{w} \|_2 = 1$ , and the correlation function $c(\boldsymbol{w}) := \boldsymbol{w}^\top \phi_1(\boldsymbol{w})$ be the inner product between $\boldsymbol{w}$ and the maximal eigenvector of $A(\boldsymbol{w})$ . We can construct a fixed point using Power Iteration (PI) (Golub & Van Loan, 2013), starting from initial value $\boldsymbol{w} = \boldsymbol{w}(0)$ : + +$$ +\boldsymbol {w} (t + 1) \leftarrow A (\boldsymbol {w} (t)) \boldsymbol {w} (t) / \| A (\boldsymbol {w} (t)) \boldsymbol {w} (t) \| _ {2} \tag {PI} +$$ + +We show that even $A(\boldsymbol{w})$ varies over $\| \boldsymbol{w} \|_2 = 1$ , the iteration can still converge to a fixed point $\boldsymbol{w}_*$ , if the following quantity $\omega(\boldsymbol{w})$ , called irregularity, is small enough. + +Definition 4 (Irregularity $\omega(\pmb{w})$ in the neighborhood of fixed points). Let $\mu(\pmb{w}) \coloneqq .5(1 + c(\pmb{w}))c^{-2}(\pmb{w}) [1 - \lambda_{\mathrm{gap}}(\pmb{w}) / \lambda_1(\pmb{w})]^2$ and $\omega(\pmb{w}) \coloneqq \omega(c(\pmb{w}), \lambda_{\mathrm{gap}}(\pmb{w}), \lambda_1(\pmb{w}), L, \kappa) \geq 0$ defined as + +$$ +\omega (\boldsymbol {w}) := \mu (\boldsymbol {w}) + 2 \kappa L ^ {2} (1 + \mu (\boldsymbol {w}) c (\boldsymbol {w})) + 2 L \lambda_ {\text {g a p}} ^ {- 1} (\boldsymbol {w}) \sqrt {\mu (\boldsymbol {w}) (1 + \mu (\boldsymbol {w}) c (\boldsymbol {w}))}, \tag {10} +$$ + +here $\kappa$ is the high-order eigenvector bound defined in Appendix (Lemma 9). + +Intuitively, when $\pmb{w}(0)$ is sufficiently close to any LME $\pmb{w}_{*}$ , i.e., $\pmb{w}(0)$ is an "approximate" LME, we have $\omega(\pmb{w}(0)) \ll 1$ . In such a case, $\pmb{w}(0)$ can be used to find $\pmb{w}_{*}$ using power iteration (Eqn. PI). + +Theorem 3 (Existence of critical points). Let $c_{0} \coloneqq c(\pmb{w}(0)) \neq 0$ . If there exists $\gamma < 1$ so that: + +$$ +\sup _ {\boldsymbol {w} \in B _ {\gamma}} \omega (\boldsymbol {w}) \leq \gamma , \tag {11} +$$ + +where $B_{\gamma} \coloneqq \left\{\pmb{w} : \pmb{w}^{\top}\pmb{w}(0) \geq \frac{c_0 - c_\gamma}{1 - c_\gamma}, c_\gamma \coloneqq \frac{2\sqrt{\gamma}}{1 + \gamma}\right\}$ is the neighborhood of initial value $\pmb{w}(0)$ . Then Power Iteration (Eqn. PI) converges to a critical point $\pmb{w}_* \in B_\gamma$ of Eqn. 7. + +![](images/7576f3528d6f464f6484e315ba3ccebd80d1dbc2bc375945cebb73a2850be1eb.jpg) +(a) 2-layer network + +![](images/0d6731ed5cec70d80a2b7913231544c0e2d41b9b9bee0116e585af9b632b663f.jpg) +(b) Conditional Independence +Figure 2: Our setting for 2-layer network. (a) We use $W$ for low-layer weights and $V$ for top-layer weights. There are $K$ disjoint receptive fields (abbreviated as $RF$ ) $R_k$ , each with $M$ weight vectors in the low-layer, denoted as $w_{km}$ . The activation function of hidden layer nodes is $h(x)$ and can be linear or nonlinear. (b) Conditional independence in Assumption 2: there exists a global categorical variable $z$ . Given $z$ , variation in different RFs are assumed to be independent. + +See proof in Appendix B.4. Intuitively, with $L$ and $\kappa$ small, $c_{0}$ close to 1, and $\lambda_{\mathrm{gap}}$ large, Eqn. 11 can always hold with $\gamma < 1$ and the fixed point exists. For example, for the two cases in Sec. 3.1, if $U = [u_{1},\dots,u_{M}]$ is only approximately orthogonal (i.e., $\| U^{\top}U - I\|$ is not zero but small), and/or the conditions of Corollary 1 hold roughly, then Theorem 3 tells that multiple local optima close to $u_{m}$ still exist for each $m$ (Fig. 1). We leave it for future work to further relax the condition. + +Possible relation to empirical observations. Since there exist many local optima in the dynamics (Eqn. 7), even if objective involving $\boldsymbol{w}_k$ are identical (Eqn. 5), each $\boldsymbol{w}_k$ may still converge to different local optima due to initialization. We suspect that this can be a tentative explanation why larger model performs better: more local optima are collected and some can be useful. Other empirical observations like lottery ticket hypothesis (LTH) (Frankle & Carbin, 2019; Morcos et al., 2019; Tian et al., 2019; Yu et al., 2020), recently also verified in CL (Chen et al., 2021), may also be explained similarly. In LTH, first a large network is trained and pruned to be a small subnetwork $S$ , then retraining $S$ using its original initialization yields comparable or even better performance, while retraining $S$ with a different initialization performs much worse. For LTH, our explanation is that $S$ contains weights that are initialized luckily, i.e., close to useful local optima and converge to them during training. We leave a thorough empirical study to justify this line of thought for future work. + +Given this intuition, it is tempting to study the distribution of local optima of Eqn. 7, their attractive basin $\mathrm{Basin}(\pmb{w}_*) := \{\pmb{w} : \pmb{w}(0) = \pmb{w}, \lim_{t \to +\infty} \pmb{w}(t) = \pmb{w}_*\}$ for each local optimum $\pmb{w}_*$ , and the probability of random initialized weights fall into them. Interestingly, data augmentation may play an important role, by removing unnecessary local optima with symmetry (see Appendix B.5), focusing the learning on important patterns. Theorem 3 also gives hints. A formal study is left for future work. + +# 4 TWO-LAYER SETTING + +Now we understand how 1-layer nonlinearity learns in contrastive learning setting. In practice, many patterns exist and most of them may not be relevant for the downstream tasks. A natural question arises: how does the network prioritizes which patterns to learn? To answer this question, we analyze the behavior of 2-layer nonlinear networks with non-overlapping receptive fields (Fig. 2(a)). + +Setting and Notations. In the lower layer, there are $K$ disjoint receptive fields (abbreviated as $\mathbf{RF}$ ) $\{R_k\}$ , each has input $\pmb{x}_k$ and $M$ weight $\pmb{w}_{km} \in \mathbb{R}^d$ where $m = 1 \dots M$ . The output of the bottom-layer is denoted as $\pmb{f}_1$ , $f_{1km}$ for its $km$ -th component, and $\pmb{f}_1[i]$ for $i$ -th sample. The top layer has weight $V \in \mathbb{R}^{d_{\mathrm{out}} \times KM}$ . Define $S := V^\top V$ . As the $(km,k'm')$ entry of the matrix $S$ , $s_{km,k'm'} := [S]_{km,k'm'} = \pmb{v}_{km}^\top \pmb{v}_{k'm'}$ . + +At each RF $R_{k}$ , define $\tilde{\pmb{x}}_{km}$ as a brief notation of gated input $\tilde{\pmb{x}}_k^{\pmb{w}_{km}}\coloneqq \pmb {x}_k\cdot h'(\pmb{w}_{km}^\top \pmb {x}_k)$ . Define $\tilde{\pmb{x}}_k\coloneqq [\tilde{\pmb{x}}_{k1};\tilde{\pmb{x}}_{k2};\dots ,\tilde{\pmb{x}}_{kM}]\in \mathbb{R}^{Md}$ as the concatenation of $\tilde{\pmb{x}}_{km}$ and finally $\tilde{\pmb{x}}\coloneqq [\tilde{\pmb{x}}_1;\dots ;\tilde{\pmb{x}}_K]\in$ $\mathbb{R}^{KMd}$ is the concatenation of all $\tilde{\pmb{x}}_k$ . Similarly, let $\pmb {w}_k\coloneqq [\pmb {w}_{km}]_{m = 1}^M\in \mathbb{R}^{Md}$ be a concatenation of all $\pmb{w}_{km}$ in the same RF $R_{k}$ , and $\pmb {w}\coloneqq [\pmb {w}_k]_{k = 1}^K\in \mathbb{R}^{KMd}$ be a column concatenation of all $\pmb{w}_k$ . Finally, $P_{\pmb{w}}^{\perp}\coloneqq \mathrm{diag}_{km}[P_{\pmb{w}_{km}}^{\perp}]$ is a block-diagonal matrix putting all projections together. + +Lemma 4 (Dynamics of 2-layer nonlinear network with contrastive loss). + +$$ +\dot {V} = V \mathbb {C} _ {\alpha} [ \boldsymbol {f} _ {1} ], \quad \dot {\boldsymbol {w}} = P _ {\boldsymbol {w}} ^ {\perp} \left[ \left(S \otimes \mathbf {1} _ {d} \mathbf {1} _ {d} ^ {\top}\right) \circ \mathbb {C} _ {\alpha} [ \tilde {\boldsymbol {x}} ] \right] \boldsymbol {w} \tag {12} +$$ + +where $\mathbf{1}_d$ is $d$ -dimensional all-one vector, $\otimes$ is Kronecker product and $\circ$ is Hadamard product. + +See Appendix C.1 for the proof. Now we analyze the stationary points of the equations. If $\mathbb{C}_{\alpha}[f_1]$ has unique maximal eigenvector $s$ , then following similar analysis as in Tian (2022), a necessary condition for $(W,V)$ to be a stationary point is that $V = \boldsymbol{v}\boldsymbol{s}^{\top}$ , where $\boldsymbol{v}$ is any arbitrary unit vector. Therefore, we have $S = V^{\top}V = \boldsymbol{s}\boldsymbol{s}^{\top}$ as a rank-1 matrix and $s_{km,k'm'} = s_{km}s_{k'm'}$ . Note that $s$ , as a unique maximal eigenvector of $\mathbb{C}_{\alpha}[f_1]$ , is a function of the low-level feature computed by $W$ . + +On the other hand, the stationary point of $W$ can be much more complicated, since it has the feedback term $S$ from the top level. A more detailed analysis requires further assumptions, as we list below: + +Assumption 2. For analysis of two-layer networks, we assume: + +- Uniform $\alpha$ , large batchsize and no augmentation. Then $\mathbb{C}_{\alpha}[g(\pmb{x})] = \mathbb{V}[g(\pmb{x})]$ for any function $g(\cdot)$ following Corollary 1. +- Fast top-level training. $V$ undergoes fast training and has always converged to its stationary point given $\mathbb{C}_{\alpha}[\pmb{f}_1]$ . That is, $S = \pmb{ss}^{\top}$ is a rank-1 matrix; +- Conditional Independence. The input in each $R_{k}$ are conditional independent given a latent global random variable $z$ taking $C$ different values: + +$$ +\mathbb {P} [ \boldsymbol {x} | z ] = \prod_ {k = 1} ^ {K} \mathbb {P} [ \boldsymbol {x} _ {k} | z ] \tag {13} +$$ + +Explanation of the assumptions. The uniform $\alpha$ condition is mainly for notation simplicity. For kernel-like $\alpha$ , the analysis is similar by combining multiple variance terms using Lemma 1. The no augmentation condition is mainly technical. Conclusion still holds if $\mathbb{E}_{p_{\mathrm{aug}}}[g(\boldsymbol{x})|\boldsymbol{x}_0] \approx g(\mathbb{E}_{p_{\mathrm{aug}}}[\boldsymbol{x}|\boldsymbol{x}_0])$ for $g(\boldsymbol{x}) \coloneqq \tilde{\boldsymbol{x}}^{\boldsymbol{w}}$ , i.e., augmentation swaps with nonlinear gating. For conditional independence, intuitively $z$ can be regarded as different type of global patterns that determines what input $\boldsymbol{x}$ can be perceived (Fig. 2(b)). Once $z$ is given, the remaining variation resides within each RF $R_k$ and independent across different $R_k$ . Note that there exists many patterns in each RF $R_k$ . Some are parts of the global pattern $z$ , and others may come from noise. We study how each weight $\boldsymbol{w}_{km}$ captures distinct and useful patterns after training. + +With all the assumptions, we can compute the term $A_{k}(\boldsymbol{w}_{k}) \coloneqq \mathbb{C}_{\alpha}[\tilde{\boldsymbol{x}}_{k}] = \mathbb{V}[\tilde{\boldsymbol{x}}_{k}]$ . Our Assumption 2 is weaker than orthogonal mixture condition in Tian (2022) that is used to analyze CL, which requires the instance of input $\boldsymbol{x}_k[i]$ to have only one positive component. + +# 4.1 WHY NONLINEARITY IS CRITICAL: LINEAR ACTIVATION FAILS + +Since in each RF $R_{k}$ , there are $M$ filters $\{\pmb{w}_{km}\}$ , it would be ideal to have one filter to capture one distinct pattern in the covariance matrix $A_{k}$ . However, with linear activation, $\tilde{\pmb{x}}_k = \pmb{x}_k$ and as a result, learning of diverse features never happens, no matter how large $M$ is (proof in Appendix C.4): + +Theorem 4 (Gradient Colinearity in linear networks). With linear activation, $W$ follows the dynamics: + +$$ +\dot {\boldsymbol {w}} _ {k m} = s _ {k m} \boldsymbol {b} _ {k} (W, V) \tag {14} +$$ + +where $\pmb{b}_k(W,V) := \mathbb{C}_{\alpha}\left[\pmb{x}_k,\sum_{k',m'}s_{k'm'}\pmb{w}_{k'm'}^\top\pmb{x}_{k'}\right]$ is a linear function w.r.t. $W$ . As a result, (1) $\dot{\pmb{w}}_{km}$ are co-linear over $m$ , and (2) If $s_{km} \neq 0$ , from any critical point with distinct $\{\pmb{w}_{km}\}$ , there exists a path of critical points to identical weights ( $\pmb{w}_{km} = \pmb{w}_k$ ). + +This brings about the weakness of linear activation. First, the gradient of $\boldsymbol{w}_{km}$ within one RF $R_{k}$ during CL training all points towards the same direction $\boldsymbol{b}_{k}$ ; Second, even if the critical points $\boldsymbol{w}_{km}$ have any diversity within RF $R_{k}$ , there exist a path for them to converge to identical weights. Therefore, diverse features, even they reside in the data, cannot be learned by the linear models. + +# 4.2 THE EFFECT OF GLOBAL MODULATION IN THE SPECIAL CASE OF $C = 2$ AND $M = 1$ + +When $z$ is binary $(C = 2)$ with a single weight per RF $(M = 1)$ , $\pmb{w}_k$ 's dynamics has close form. Let $\pmb{w}_k$ represent $\pmb{w}_{k1}$ , the only weight at each $R_{k}$ , $\Delta_k \coloneqq \mathbb{E}[\tilde{\pmb{x}}_k|z = 1] - \mathbb{E}[\tilde{\pmb{x}}_k|z = 0]$ . We have: + +Theorem 5 (Dynamics of $\pmb{w}_k$ under conditional independence). When $C = 2$ and $M = 1$ , the dynamics of $\pmb{w}_k$ is given by ( $s_k^2$ and $\delta_k \geq 0$ are scalars defined in the proof): + +$$ +\dot {\boldsymbol {w}} _ {k} = P _ {\boldsymbol {w} _ {k}} ^ {\perp} \left(s _ {k} ^ {2} A _ {k} \left(\boldsymbol {w} _ {k}\right) + \delta_ {k} \Delta_ {k} \Delta_ {k} ^ {\top}\right) \boldsymbol {w} _ {k} \tag {15} +$$ + +![](images/8895a4b62a30c9b26f1df1d7e2a16bc7b093c45e20ecef9f4499edeebe03c598.jpg) +Figure 3: Experimental setting (Sec. 5). When generating input, we first randomly pick one generator (e.g., $\star \star \mathsf{C} \star \mathsf{B} \star \mathsf{A} \star \mathsf{D} \star$ ) from a pool of $G$ generators, generate the sequence by instantiating wildcard $\star$ with an arbitrary token, and then replace the token $a$ of sequence with an embedding vector $\pmb{u}_a$ to form the input $\pmb{x}$ . Inputs from the same generator are treated as positive pairs, otherwise negative pairs for contrastive loss. + +![](images/c03e63b4baf00b0d5f30171c3b189ef7e3c3bd52c326e4cdacaee0880df2024c.jpg) +Figure 4: Overall matching score $\bar{\chi}_{+}$ (Eqn. 16) with InfoNCE (top row) and quadratic loss (bottom row). When $P = 1$ , linear model works well regardless of the degree of over-parameterization $\beta$ , while ReLU requires large over-parameterization to perform well. When each $R_{k}$ has multiple patterns ( $P > 1$ ) related to generators, ReLU models can capture diverse patterns better than linear ones in the over-parameterization region $\beta > 1$ . We found similar trend for other homogeneous activations such as LeakyReLU (with negative slope 0.05) and quadratic. In contrast, linear models are much less affected by over-parameterization. While the trends are similar, quadratic loss is not as effective as InfoNCE in feature learning. Each setting is repeated 3 times and mean/std are reported. See Appendix (Fig. 9 and Fig. 10) for $\bar{\chi}_{-}$ . + +![](images/c5ec39c357009e802b3ed195f2036f25bcccc2eb956fd97ac2fbb1f6f700536a.jpg) + +![](images/91a74badaa515b29ef85c8090ac7e577bed7d9ff5468a1df204a8d6ee5339b2f.jpg) + +![](images/b4c56d3556f604690635ac607e4a0f4e8ffaedad7980e64c2051395e9f684fda.jpg) + +See proof in Appendix C.3. There are several interesting observations. First, the dynamics are decoupled (i.e., $\dot{\boldsymbol{w}}_k = A_k(W)\boldsymbol{w}_k$ ) and other $\boldsymbol{w}_{k'}$ with $k' \neq k$ only affects the dynamics of $\boldsymbol{w}_k$ through the matrix $A_{k}(W)$ . Second, while $A_{k}(\boldsymbol{w}_{k})$ contains multiple patterns (i.e., local optima) in $R_{k}$ , the additional term $\Delta_k\Delta_k^\top$ , as the global modulation from the top level, encourages the model to learn the pattern like $\Delta_{k}$ which is a discriminative feature that separates the event of $z = 0$ and $z = 1$ . Quantitatively: + +Theorem 6 (Global modulation of attractive basin). If the structural assumption holds: $A_{k}(\boldsymbol{w}_{k}) = \sum_{l} g(\boldsymbol{u}_{l}^{\top}\boldsymbol{w}_{k})\boldsymbol{u}_{l}\boldsymbol{u}_{l}^{\top}$ with $g(\cdot) > 0$ a linear increasing function and $\{\boldsymbol{u}_l\}$ orthonormal bases, then for $A_{k} + c\boldsymbol{u}_{l}\boldsymbol{u}_{l}^{\top}$ , its attractive basin of $\boldsymbol{w}_{k} = \boldsymbol{u}_{l}$ is larger than $A_{k}$ 's for $c > 0$ . + +Therefore, if $\Delta_{k}$ is a LME of $A_{k}$ and $\pmb{w}_{k}$ is randomly initialized, Thm 5 tells that $\mathbb{P}[\pmb{w}_k\to \Delta_k]$ is higher than the probability that $\pmb{w}_{k}$ goes to other patterns of $A_{k}$ , i.e., the global variable $z$ modulates the training of the lower layer. This is similar to "Backward feature correction" (Allen-Zhu & Li, 2020) and "top-down modulation" (Tian et al., 2019) in supervised learning, here we show it in CL. + +We also analyze how BatchNorm helps alleviate diverse variances among RFs (see Appendix D). + +# 5 EXPERIMENTS + +Setup. To verify our finding, we perform contrastive learning with a 2-layer network on a synthetic dataset containing token sequences, generated as follows. From a pool of $G = 40$ generators, we pick a generator of length $K$ in the form of $\star \star \mathrm{C} \star \mathrm{B} \star \mathrm{A} \star \mathrm{D} \star$ (here $K = 10$ ) and generate $\mathrm{EFCDBAACDB}$ by sampling from $d = 20$ tokens for each wildcard $\star$ . The final input $\mathbf{x}$ is then constructed by replacing each token $a$ with the pre-defined embedding $\mathbf{u}_a \in \mathbb{R}^d$ . $\{\mathbf{u}_a\}$ forms a orthonormal basis (see Fig. 3). The data augmentation is achieved by generating another sequence from the same generator. + +![](images/2bb29297d43bcc6e9837a6c3ea2ab152f5ab6e45ff69c3261c5a86b2f1af46b4.jpg) + +![](images/a801e5f1dc8a4d2483ef35f8ce3ddad5d620aa385869cd9d60136c610767b154.jpg) + +![](images/f4e0bdf2148230faaa9f0c68a42c8012155eebadf4d635b29bc8d7e5e53c51b5.jpg) + +![](images/d666f7350de30608dc9c204fbc25e69680f13d0db984f279fa16a44000e0ec45.jpg) + +![](images/07d6a3d0d0af820318b9447195c0da5878299cc6c0892dfe3502ed8ee4c2e09f.jpg) + +![](images/556acf644e639a26206b36b21cab0f12781ee7f7857fcc2dd34bd930c8067ef6.jpg) +Figure 5: Visualization of learned weights with $P = 3$ (3 local patterns related to generators at each RF) and $\beta = 5$ (5x over-parameterization). Each of the $K = 10$ subfigures corresponds to a RF $(R_0 - R_9)$ . In each subfigure, the left panel is the learned weight by ReLU, while the right panel is from linear activations. 15 rows correspond to $M = \beta P = 15$ weights and each weight is $d = 8$ dimensional. With ReLU activation, learned weights clearly capture the 3 candidate tokens within $R_k^g$ at each RF $R_k$ , while linear activation cannot. + +![](images/c7f49e5926ba4dceea3f16cba6ee6855aecbb16a4c4f0a38e92e55d849446048.jpg) + +![](images/9f920c8ca8ba31c00a3c86966b9bb81019eafd6d6674e7b6397c7a481471dd4d.jpg) + +![](images/cc0fe6ff459835da072a7938de751b3a6c9d6998165a416286fa6349880ef8a4.jpg) + +![](images/28a4756eed0cf025e33fa02d549c25162dc99939da6445e8bd44c9e6d7242c16.jpg) + +While there exists $d = 20$ tokens, in each RF $R_{k}$ we pick a subset $R_{k}^{\mathrm{g}}$ of $P < d$ tokens as the candidates used in the generator, to demonstrate the effect of global modulation. Before training, each generator is created by first randomly picking 5 receptive fields, then picking one of the $P$ tokens from $R_{k}^{\mathrm{g}}$ at each RF $R_{k}$ and filling the remaining RFs with wildcard $\star$ . Therefore, if a token appears at $R_{k}$ but $a \notin R_{k}^{\mathrm{g}}$ , then $a$ must be instantiated from the wildcard. Any $a \notin R_{k}^{\mathrm{g}}$ is noise and should not be learned in the weights of $R_{k}$ since it is not part of any global pattern from the generator. + +We train a 2-layer network on this dataset. The 2-layer network has $K = 10$ disjoint RFs, within each RF, there are $M = \beta P$ filters. Here $\beta \geq 1$ is a hyper-parameter that controls the degree of over-parameterization. The network is trained with InfoNCE loss and SGD with learning rate $2 \times 10^{-3}$ , momentum 0.9, and weight decay $5 \times 10^{-3}$ for 5000 minibatches and batchsize 128. Code is in PyTorch runnable on a single modern GPU. + +Evaluation metric. We check whether the weights corresponding to each token is learned in the lower layer. At each RF $R_{k}$ , we know $R_{k}^{\mathrm{g}}$ , the subsets of tokens it contains, as well as their embeddings $\{\pmb{u}_a\}_{a \in R_k^{\mathrm{g}}}$ due to the generation process, and verify whether these embeddings are learned after the model is trained. Specifically, for each token $a \in R_k^{\mathrm{g}}$ , we look for its best match on the learned filter $\{\pmb{w}_{km}\}$ , as formulated by the following per-RF score $\chi_{+}(R_{k})$ and overall matching score $\bar{\chi}_{+} \in [-1, 1]$ as the average over all RFs (similarly we can also define $\bar{\chi}_{-}$ for $a \notin R_k^{\mathrm{g}}$ ): + +$$ +\chi_ {+} \left(R _ {k}\right) = \frac {1}{P} \sum_ {a \in R _ {k} ^ {\mathrm {g}}} \max _ {m} \frac {\boldsymbol {w} _ {k m} ^ {\top} \boldsymbol {u} _ {a}}{\| \boldsymbol {w} _ {k m} \| _ {2} \| \boldsymbol {u} _ {a} \| _ {2}}, \quad \bar {\chi} _ {+} = \frac {1}{K} \sum_ {k} \chi_ {+} \left(R _ {k}\right) \tag {16} +$$ + +# 5.1 RESULTS + +Linear vs. ReLU activation and the effect of over-parameterization (Sec. 4.1). From Fig. 4, we can clearly see that ReLU (and other homogeneous) activations achieve better reconstruction of the input patterns, when each RF contains many patterns $(P > 1)$ and specialization of filters in each RF is needed. On the other hand, when $P = 1$ , linear activation works better. ReLU activation clearly benefits from over-parameterization $(\beta > 1)$ : the larger $\beta$ is, the better $\bar{\chi}_{+}$ becomes. In contrast, for linear activation, over-parameterization does not quite affect the performance, which is consistent with our theoretical analysis. + +Quadratic versus InfoNCE. Fig. 4 shows that quadratic CL loss underperforms InfoNCE, while the trend of linear/ReLU and over-parameterization remains similar. According to Corollary 2, nonuniform $\alpha$ (e.g., Gaussian $\alpha$ , Lemma 1) creates more and deeper local optima that better accommodate local patterns, yielding better performance. This provides a novel landscape point of view on why non-uniform $\alpha$ is better, expanding the intuition that it focuses more on important sample pairs. + +Global modulation (Sec. 4.2). As shown in Fig. 5, the learned weights indeed focus on the token subset $R_{k}^{\mathrm{g}}$ that receives top-down support from the generators and no noise token is learned. We also verify that quantitatively by computing $\bar{\chi}_{-}$ over multiple runs, provided in Appendix (Fig. 9-10). + +# REFERENCES + +Zeyuan Allen-Zhu and Yanzhi Li. Backward feature correction: How deep learning performs deep learning. arXiv preprint arXiv:2001.04413, 2020. +Sanjeev Arora, Nadav Cohen, Noah Golowich, and Wei Hu. A convergence analysis of gradient descent for deep linear neural networks. In International Conference on Learning Representations, 2019a. URL https://openreview.net/forum?id=SkMQg3C5K7. +Sanjeev Arora, Hrishikesh Khandeparkar, Mikhail Khodak, Orestis Plevrakis, and Nikunj Saunshi. A theoretical analysis of contrastive unsupervised representation learning. arXiv preprint arXiv:1902.09229, 2019b. +Mary L Boas and Philip Peters. Mathematical methods in the physical sciences, 1984. +Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. Advances in neural information processing systems, 33:1877-1901, 2020. +James R Bunch, Christopher P Nielsen, and Danny C Sorensen. Rank-one modification of the symmetric eigenproblem. Numerische Mathematik, 31(1):31-48, 1978. +Mathilde Caron, Ishan Misra, Julien Mairal, Priya Goyal, Piotr Bojanowski, and Armand Joulin. Unsupervised learning of visual features by contrasting cluster assignments. In NeurIPS, 2020. +Tianlong Chen, Jonathan Frankle, Shiyu Chang, Sijia Liu, Yang Zhang, Michael Carbin, and Zhangyang Wang. The lottery tickets hypothesis for supervised and self-supervised pre-training in computer vision models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 16306-16316, 2021. +Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In International conference on machine learning, pp. 1597-1607. PMLR, 2020. +Xinlei Chen and Kaiming He. Exploring simple siamese representation learning. In CVPR, 2020. +Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, Parker Schuh, Kensen Shi, Sasha Tsvyashchenko, Joshua Maynez, Abhishek Rao, Parker Barnes, Yi Tay, Noam Shazeer, Vinodkumar Prabhakaran, Emily Reif, Nan Du, Ben Hutchinson, Reiner Pope, James Bradbury, Jacob Austin, Michael Isard, Guy Gur-Ari, Pengcheng Yin, Toju Duke, Anselm Levskaya, Sanjay Ghemawat, Sunipa Dev, Henryk Michalewski, Xavier Garcia, Vedant Misra, Kevin Robinson, Liam Fedus, Denny Zhou, Daphne Ippolito, David Luan, Hyeontaek Lim, Barret Zoph, Alexander Spiridonov, Ryan Sepassi, David Dohan, Shivani Agrawal, Mark Omernick, Andrew M. Dai, Thanumalayan Sankaranarayana Pillai, Marie Pellat, Aitor Lewkowycz, Erica Moreira, Rewon Child, Oleksandr Polozov, Katherine Lee, Zongwei Zhou, Xuezhi Wang, Brennan Saeta, Mark Diaz, Orhan First, Michele Catasta, Jason Wei, Kathy Meier-Hellstern, Douglas Eck, Jeff Dean, Slav Petrov, and Noah Fiedel. Palm: Scaling language modeling with pathways. CoRR, abs/2204.02311, 2022. doi: 10.48550/arXiv.2204.02311. URL https://doi.org/10.48550/arXiv.2204.02311. +Corinna Cortes and Vladimir Vapnik. Support-vector networks. Machine learning, 20(3):273-297, 1995. +Li Deng. The mnist database of handwritten digit images for machine learning research. IEEE Signal Processing Magazine, 29(6):141-142, 2012. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018. +Luc Devroye, Laszlo Gyorfi, Adam Krzyzak, and Gabor Lugosi. On the strong universal consistency of nearest neighbor regression function estimates. The Annals of Statistics, 22(3):1371-1385, 1994. + +Simon S Du, Wei Hu, and Jason D Lee. Algorithmic regularization in learning deep homogeneous models: Layers are automatically balanced. arXiv preprint arXiv:1806.00900, 2018. +Francisco M Fernández. Introduction to perturbation theory in quantum mechanics. CRC press, 2000. +Evelyn Fix and Joseph Lawson Hodges. Nonparametric discrimination: consistency properties. *Randolph Field, Texas, Project*, pp. 21-49, 1951. +Jonathan Frankle and Michael Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=rJ1-b3RcF7. +Benyamin Ghojogh, Ali Ghodsi, Fakhri Karray, and Mark Crowley. Reproducing kernel hilbert space, mercer's theorem, eigenfunctions, nystr\`" om method, and use of kernels in machine learning: Tutorial and survey. arXiv preprint arXiv:2106.08443, 2021. +Mike B Giles. Collected matrix derivative results for forward and reverse mode algorithmic differentiation. In Advances in Automatic Differentiation, pp. 35-44. Springer, 2008. +Gene H Golub and Charles F Van Loan. Matrix computations. JHU press, 2013. +Alain Goriely and Craig Hyde. Finite-time blow-up in dynamical systems. Physics Letters A, 250 (4-6):311-318, 1998. +Jean-Bastien Grill, Florian Strub, Florent Alché, Corentin Tallec, Pierre H Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Daniel Guo, Mohammad Gheshlaghi Azar, et al. Bootstrap your own latent: A new approach to self-supervised learning. NeurIPS, 2020. +Ingo Guhring, Mones Raslan, and Gitta Kutyniok. Expressivity of deep neural networks. arXiv preprint arXiv:2007.04759, 2020. +Barbara Hammer and Kai Gersmann. A note on the universal approximation capability of support vector machines. neural processing letters, 17(1):43-53, 2003. +Jeff Z HaoChen, Colin Wei, Adrien Gaidon, and Tengyu Ma. Provable guarantees for self-supervised deep learning with spectral contrastive loss. NeurIPS, 2021. +Soufiane Hayou, Arnaud Doucet, and Judith Rousseau. On the impact of the activation function on deep neural networks training. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 2672-2680. PMLR, 09-15 Jun 2019. URL https://proceedings.mlr.press/v97/hayou19a.html. +Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 9729-9738, 2020. +Kaiming He, Xinlei Chen, Saining Xie, Yanghao Li, Piotr Dólár, and Ross Girshick. Masked autoencoders are scalable vision learners. arXiv preprint arXiv:2111.06377, 2021. +Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International conference on machine learning, pp. 448-456. PMLR, 2015. +Arthur Jacot, Franck Gabriel, and Clément Hongler. Neural tangent kernel: Convergence and generalization in neural networks. Advances in neural information processing systems, 31, 2018. +Wenlong Ji, Zhun Deng, Ryumei Nakada, James Zou, and Linjun Zhang. The power of contrast for feature learning: A theoretical analysis. arXiv preprint arXiv:2110.02473, 2021. +Li Jing, Pascal Vincent, Yann LeCun, and Yuandong Tian. Understanding dimensional collapse in contrastive self-supervised learning. *ICLR*, 2022. +Kenji Kawaguchi. Deep learning without poor local minima. NeurIPS, 2016. + +Yuanzhi Li and Yang Yuan. Convergence analysis of two-layer neural networks with relu activation. Advances in neural information processing systems, 30, 2017. +Zhou Lu, Hongming Pu, Feicheng Wang, Zhiqiang Hu, and Liwei Wang. The expressive power of neural networks: A view from the width. Advances in neural information processing systems, 30, 2017. +Ari Morcos, Haonan Yu, Michela Paganini, and Yuandong Tian. One ticket to win them all: generalizing lottery ticket initializations across datasets and optimizers. Advances in neural information processing systems, 32, 2019. +Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018. +Vern I Paulsen and Mrinal Raghupathi. An introduction to the theory of reproducing kernel Hilbert spaces, volume 152. Cambridge university press, 2016. +Maithra Raghu, Ben Poole, Jon Kleinberg, Surya Ganguli, and Jascha Sohl-Dickstein. On the expressive power of deep neural networks. In international conference on machine learning, pp. 2847-2854. PMLR, 2017. +Daniel A. Roberts, Sho Yaida, and Boris Hanin. The principles of deep learning theory. CoRR, abs/2106.10165, 2021. URL https://arxiv.org/abs/2106.10165. +Nikunj Saunshi, Jordan Ash, Surbhi Goel, Dipendra Misra, Cyril Zhang, Sanjeev Arora, Sham Kakade, and Akshay Krishnamurthy. Understanding contrastive learning requires incorporating inductive biases. arXiv preprint arXiv:2202.14037, 2022. +John Michael Tutill Thompson, H Bruce Stewart, and Rick Turner. Nonlinear dynamics and chaos. Computers in Physics, 4(5):562-563, 1990. +Yuandong Tian. An analytical formula of population gradient for two-layered relu network and its applications in convergence and critical point analysis. In International Conference on Machine Learning, pp. 3404-3413. PMLR, 2017. +Yuandong Tian. Understanding deep contrastive learning via coordinate-wise optimization. NeurIPS, 2022. +Yuandong Tian, Tina Jiang, Qucheng Gong, and Ari Morcos. Luck matters: Understanding training dynamics of deep relu networks. arXiv preprint arXiv:1905.13405, 2019. +Yuandong Tian, Lantao Yu, Xinlei Chen, and Surya Ganguli. Understanding self-supervised learning with dual deep networks. arXiv preprint arXiv:2010.00578, 2020. +Yuandong Tian, Xinlei Chen, and Surya Ganguli. Understanding self-supervised learning dynamics without contrastive pairs. In International Conference on Machine Learning, pp. 10268-10278. PMLR, 2021. +Xiang Wang, Xinlei Chen, Simon S Du, and Yuandong Tian. Towards demystifying representation learning with non-contrastive self-supervision. arXiv preprint arXiv:2110.04947, 2021. +Charles L Wilson, James L Blue, and Omid M Omidvar. Training dynamics and neural network performance. Neural Networks, 10(5):907-923, 1997. +Haonan Yu, Sergey Edunov, Yuandong Tian, and Ari S. Morcos. Playing the lottery with rewards and multiple languages: lottery tickets in rl and nlp. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=S1xnXRVFwH. + +# A PROOFS + +# A.1 PROBLEM SETUP (SEC. 2) + +Lemma 1 (Gaussian $\alpha$ ). For any function $g(\cdot)$ that is bounded below, if we use $\alpha_{ij} \coloneqq \exp(-\| g(\pmb{x}_0[i]) - g(\pmb{x}_0[j]) \|_2^2 / 2\tau)$ as the pairwise importance, then it has kernel structure (Def. 1). + +Proof. Since $\pmb{g}(\cdot)$ is bounded below, there exists a vector $\pmb{v}$ so that each component of $\pmb{g}(\pmb{x}) - \pmb{v}$ is always nonnegative for any $\pmb{x}$ . Let $\pmb{y}[i] := \pmb{g}(\pmb{x}_0[i]) - \pmb{v} \in \mathbb{R}^d$ , then $\pmb{y}[i] \geq 0$ and we have: + +$$ +\begin{array}{l} \alpha_ {i j} = \exp \left(- \frac {\| \boldsymbol {y} [ i ] - \boldsymbol {y} [ j ] \| _ {2} ^ {2}}{2 \tau}\right) (17) \\ = \exp \left(- \frac {\| \boldsymbol {y} [ i ] \| _ {2} ^ {2}}{2 \tau}\right) \exp \left(- \frac {\| \boldsymbol {y} [ j ] \| _ {2} ^ {2}}{2 \tau}\right) \exp \left(\frac {\boldsymbol {y} ^ {\top} [ i ] \boldsymbol {y} [ j ]}{\tau}\right) (18) \\ \end{array} +$$ + +And using Taylor expansion, we have + +$$ +\exp \left(\frac {\boldsymbol {y} ^ {\top} [ i ] \boldsymbol {y} [ j ]}{\tau}\right) = 1 + \frac {\boldsymbol {y} ^ {\top} [ i ] \boldsymbol {y} [ j ]}{\tau} + \frac {1}{2} \left(\frac {\boldsymbol {y} ^ {\top} [ i ] \boldsymbol {y} [ j ]}{\tau}\right) ^ {2} + \dots + \frac {1}{k !} \left(\frac {\boldsymbol {y} ^ {\top} [ i ] \boldsymbol {y} [ j ]}{\tau}\right) ^ {k} + \dots \tag {19} +$$ + +Let + +$$ +\tilde {\phi} (\boldsymbol {y}) := \left[ \begin{array}{c} 1 \\ \tau^ {- 1 / 2} \boldsymbol {y} \\ \frac {1}{\sqrt {2} !} \operatorname {A l l C h o o s e} \left(\tau^ {- 1 / 2} \boldsymbol {y}, 2\right) \\ \dots \\ \frac {1}{\sqrt {k} !} \operatorname {A l l C h o o s e} \left(\tau^ {- 1 / 2} \boldsymbol {y}, k\right) \\ \dots \end{array} \right] \geq 0 \tag {20} +$$ + +be an infinite dimensional vector, where AllChoose $(\pmb{y},k)$ is a $d^k$ -dimensional column vector that enumerates all possible $d^{k}$ products $y_{i_1}y_{i_2}\ldots y_{i_k}$ , where $1\leq i_{k}\leq d$ and $y_{i}$ is the $i$ -th component of $\pmb{y}$ . Then it is clear that $\exp (\pmb{y}^{\top}[i]\pmb {y}[j] / \tau) = \tilde{\phi}^{\top}(\pmb {y}[i])\tilde{\phi} (\pmb {y}[j])$ and thus + +$$ +\alpha_ {i j} = \phi^ {\top} \left(\boldsymbol {x} _ {0} [ i ]\right) \phi \left(\boldsymbol {x} _ {0} [ j ]\right) = \sum_ {l = 0} ^ {+ \infty} \phi_ {l} \left(\boldsymbol {x} _ {0} [ i ]\right) \phi_ {l} \left(\boldsymbol {x} _ {0} [ j ]\right) \tag {21} +$$ + +which satisfies Def. 1. Here + +$$ +\phi (\boldsymbol {x}) := \exp \left(- \frac {\| \boldsymbol {y} \| _ {2} ^ {2}}{2 \tau}\right) \tilde {\phi} (\boldsymbol {y}) = \exp \left(- \frac {\| \boldsymbol {g} (\boldsymbol {x}) - \boldsymbol {v} \| _ {2} ^ {2}}{2 \tau}\right) \tilde {\phi} (\boldsymbol {g} (\boldsymbol {x}) - \boldsymbol {v}) \tag {22} +$$ + +is the infinite dimensional feature mapping for input $\pmb{x}$ , and $\phi_l(\pmb{x})$ is its $l$ -th component. + +Lemma 2 (Relationship between Contrastive Covariance and Variance in large batch size). If $\alpha$ satisfies Def. 1, then for any function $g(\cdot)$ , $\mathbb{C}_{\alpha}[g(\pmb{x})]$ is asymptotically PSD when $N \to +\infty$ : + +$$ +\mathbb {C} _ {\alpha} [ \boldsymbol {g} (\boldsymbol {x}) ] \rightarrow \sum_ {l} z _ {l} ^ {2} \mathbb {V} _ {\boldsymbol {x} _ {0} \sim \tilde {p} _ {l} (\cdot ; \alpha)} \left[ \mathbb {E} _ {\boldsymbol {x} \sim p _ {\text {a u g}} (\cdot | \boldsymbol {x} _ {0})} [ \boldsymbol {g} (\boldsymbol {x}) | \boldsymbol {x} _ {0} ] \right] \tag {4} +$$ + +Proof. First let + +$$ +\mathbb {C} _ {\alpha} ^ {\text {i n t e r}} [ \boldsymbol {a}, \boldsymbol {b} ] := \frac {1}{2 N ^ {2}} \sum_ {i = 1} ^ {N} \sum_ {j \neq i} \alpha_ {i j} (\boldsymbol {a} [ i ] - \boldsymbol {a} [ j ]) (\boldsymbol {b} [ i ] - \boldsymbol {b} [ j ]) ^ {\top} \tag {23} +$$ + +$$ +\mathbb {C} _ {\alpha} ^ {\text {i n t r a}} [ \boldsymbol {a}, \boldsymbol {b} ] := \frac {1}{2 N} \sum_ {i = 1} ^ {N} \left(\frac {1}{N} \sum_ {j \neq i} \alpha_ {i j}\right) (\boldsymbol {a} [ i ] - \boldsymbol {a} [ i ^ {\prime} ]) (\boldsymbol {b} [ i ] - \boldsymbol {b} [ i ^ {\prime} ]) ^ {\top} \tag {24} +$$ + +and $\mathbb{C}_{\alpha}^{\mathrm{inter}}[\pmb {a}]\coloneqq \mathbb{C}_{\alpha}^{\mathrm{inter}}[\pmb {a},\pmb {a}]$ $\mathbb{C}_{\alpha}^{\mathrm{intra}}[\pmb {a}]\coloneqq \mathbb{C}_{\alpha}^{\mathrm{inter}}[\pmb {a},\pmb {a}]$ . Then we have + +$$ +\mathbb {C} _ {\alpha} [ \boldsymbol {g} ] = \mathbb {C} _ {\alpha} ^ {\text {i n t e r}} [ \boldsymbol {g} ] - \mathbb {C} _ {\alpha} ^ {\text {i n t r a}} [ \boldsymbol {g} ]. \tag {25} +$$ + +With the condition, for the first term $\mathbb{C}_{\alpha}^{\mathrm{inter}}[g]$ , we have + +$$ +\mathbb {C} _ {\alpha} ^ {\text {i n t e r}} [ \boldsymbol {g} ] = \frac {1}{2 N ^ {2}} \sum_ {i j} \mathcal {K} (\boldsymbol {x} _ {0} [ i ], \boldsymbol {x} _ {0} [ j ]) (\boldsymbol {g} (\boldsymbol {x} [ i ]) - \boldsymbol {g} (\boldsymbol {x} [ j ])) (\boldsymbol {g} (\boldsymbol {x} [ i ]) - \boldsymbol {g} (\boldsymbol {x} [ j ])) ^ {\top} \tag {26} +$$ + +When $N\to +\infty$ , we have: + +$$ +\mathbb {C} _ {\alpha} ^ {\mathrm {i n t e r}} [ \boldsymbol {g} ] \rightarrow \frac {1}{2} \int \mathcal {K} (\boldsymbol {x} _ {0}, \boldsymbol {y} _ {0}) (\boldsymbol {g} (\boldsymbol {x}) - \boldsymbol {g} (\boldsymbol {y})) (\boldsymbol {g} (\boldsymbol {x}) - \boldsymbol {g} (\boldsymbol {y})) ^ {\top} \mathbb {P} (\boldsymbol {x}, \boldsymbol {x} _ {0}) \mathbb {P} (\boldsymbol {y}, \boldsymbol {y} _ {0}) \mathrm {d} \boldsymbol {x} \mathrm {d} \boldsymbol {y} \mathrm {d} \boldsymbol {x} _ {0} \mathrm {d} \boldsymbol {y} _ {0} +$$ + +We integrate over $\pmb{x}_0$ and $y_0$ first: + +$$ +\begin{array}{l} \int (\boldsymbol {g} (\boldsymbol {x}) - \boldsymbol {g} (\boldsymbol {y})) (\boldsymbol {g} (\boldsymbol {x}) - \boldsymbol {g} (\boldsymbol {y})) ^ {\top} \mathbb {P} (\boldsymbol {x} | \boldsymbol {x} _ {0}) \mathbb {P} (\boldsymbol {y} | \boldsymbol {y} _ {0}) \mathrm {d} \boldsymbol {x} \mathrm {d} \boldsymbol {y} (27) \\ = \mathbb {E} _ {\cdot | \boldsymbol {x} _ {0}} [ \boldsymbol {g} \boldsymbol {g} ^ {\top} ] + \mathbb {E} _ {\cdot | \boldsymbol {y} _ {0}} [ \boldsymbol {g} \boldsymbol {g} ^ {\top} ] - \mathbb {E} _ {\cdot | \boldsymbol {x} _ {0}} [ \boldsymbol {g} ] \mathbb {E} _ {\cdot | \boldsymbol {y} _ {0}} [ \boldsymbol {g} ^ {\top} ] - \mathbb {E} _ {\cdot | \boldsymbol {y} _ {0}} [ \boldsymbol {g} ] \mathbb {E} _ {\cdot | \boldsymbol {x} _ {0}} [ \boldsymbol {g} ^ {\top} ] (28) \\ \end{array} +$$ + +We now compute the four terms separately. With the condition that $\mathcal{K}(\pmb{x}_0, \pmb{y}_0) = \sum_l \phi_l(\pmb{x}_0) \phi_l(\pmb{y}_0)$ , and the definition of adjusted probability $\tilde{p}_l(\pmb{x}) := \frac{1}{z_l} \phi_l(\pmb{x}) \mathbb{P}(\pmb{x})$ where $z_l := \int \phi_l(\pmb{x}) \mathbb{P}(\pmb{x}) \mathrm{d}\pmb{x}$ , for the first term, we have: + +$$ +\begin{array}{l} \int \phi_ {l} (\boldsymbol {x} _ {0}) \phi_ {l} (\boldsymbol {y} _ {0}) \mathbb {E} _ {\cdot | \boldsymbol {x} _ {0}} [ \boldsymbol {g} \boldsymbol {g} ^ {\top} ] \mathbb {P} (\boldsymbol {x} _ {0}) \mathbb {P} (\boldsymbol {y} _ {0}) \mathrm {d} \boldsymbol {x} _ {0} \mathrm {d} \boldsymbol {y} _ {0} \\ = z _ {l} ^ {2} \int \mathbb {E} _ {\cdot | \boldsymbol {x} _ {0}} [ \boldsymbol {g} \boldsymbol {g} ^ {\top} ] \tilde {p} _ {l} (\boldsymbol {x} _ {0}) \mathrm {d} \boldsymbol {x} _ {0} (29) \\ = z _ {l} ^ {2} \mathbb {E} _ {\boldsymbol {x} _ {0} \sim \tilde {p} _ {l}} \mathbb {E} _ {| \boldsymbol {x} _ {0}} [ \boldsymbol {g} \boldsymbol {g} ^ {\top} ] (30) \\ \end{array} +$$ + +So we have: + +$$ +\begin{array}{l} \mathbb {C} _ {\alpha} ^ {\text {i n t e r}} [ \boldsymbol {g} ] \rightarrow \sum_ {l} z _ {l} ^ {2} \left(\mathbb {E} _ {\boldsymbol {x} _ {0} \sim \tilde {p} _ {l}} \mathbb {E} _ {\cdot | \boldsymbol {x} _ {0}} [ \boldsymbol {g} \boldsymbol {g} ^ {\top} ] - \mathbb {E} _ {\boldsymbol {x} _ {0} \sim \tilde {p} _ {l}} \mathbb {E} _ {\cdot | \boldsymbol {x} _ {0}} [ \boldsymbol {g} ] \mathbb {E} _ {\boldsymbol {x} _ {0} \sim \tilde {p} _ {l}} \mathbb {E} _ {\cdot | \boldsymbol {x} _ {0}} [ \boldsymbol {g} ^ {\top} ]\right) (31) \\ = \sum_ {l} z _ {l} ^ {2} \mathbb {V} _ {\boldsymbol {x} _ {0} \sim \tilde {p} _ {l}, \boldsymbol {x} \sim p _ {\mathrm {a u g}} (\cdot | \boldsymbol {x} _ {0})} [ \boldsymbol {g} ] (32) \\ \end{array} +$$ + +On the other hand, for $\mathbb{C}_{\alpha}^{\mathrm{intra}}[g]$ , when $N \to +\infty$ , we have: + +$$ +\begin{array}{l} \frac {1}{N} \sum_ {j \neq i} \alpha_ {i j} = \frac {1}{N} \sum_ {j \neq i} \mathcal {K} \left(\boldsymbol {x} _ {0} [ i ], \boldsymbol {x} _ {0} [ j ]\right)\rightarrow \int \mathcal {K} \left(\boldsymbol {x} _ {0}, \boldsymbol {y} _ {0}\right) \mathbb {P} \left(\boldsymbol {y} _ {0}\right) \mathrm {d} \boldsymbol {y} _ {0} (33) \\ = \sum_ {l} \phi_ {l} \left(\boldsymbol {x} _ {0}\right) \int \phi_ {l} \left(\boldsymbol {y} _ {0}\right) \mathbb {P} \left(\boldsymbol {y} _ {0}\right) \mathrm {d} \boldsymbol {y} _ {0} = \sum_ {l} z _ {l} \phi_ {l} \left(\boldsymbol {x} _ {0}\right) (34) \\ \end{array} +$$ + +Therefore, we have: + +$$ +\mathbb {C} _ {\alpha} ^ {\text {i n t r a}} [ \boldsymbol {g} ] \rightarrow \frac {1}{2} \sum_ {l} z _ {l} \int \phi_ {l} \left(\boldsymbol {x} _ {0}\right)\left(\boldsymbol {g} (\boldsymbol {x}) - \boldsymbol {g} \left(\boldsymbol {x} ^ {\prime}\right)\right)\left(\boldsymbol {g} (\boldsymbol {x}) - \boldsymbol {g} \left(\boldsymbol {x} ^ {\prime}\right)\right) ^ {\top} \mathbb {P} \left(\boldsymbol {x}, \boldsymbol {x} ^ {\prime} \mid \boldsymbol {x} _ {0}\right) \mathbb {P} \left(\boldsymbol {x} _ {0}\right) d \boldsymbol {x} d \boldsymbol {x} ^ {\prime} d \boldsymbol {x} _ {0} \tag {35} +$$ + +Similarly, + +$$ +\begin{array}{l} \int \left(\boldsymbol {g} (\boldsymbol {x}) - \boldsymbol {g} \left(\boldsymbol {x} ^ {\prime}\right)\right) \left(\boldsymbol {g} (\boldsymbol {x}) - \boldsymbol {g} \left(\boldsymbol {x} ^ {\prime}\right)\right) ^ {\top} \mathbb {P} \left(\boldsymbol {x}, \boldsymbol {x} ^ {\prime} \mid \boldsymbol {x} _ {0}\right) \mathrm {d} \boldsymbol {x} \mathrm {d} \boldsymbol {x} ^ {\prime} (36) \\ = 2 \int \boldsymbol {g} (\boldsymbol {x}) \boldsymbol {g} ^ {\top} (\boldsymbol {x}) \mathbb {P} (\boldsymbol {x} | \boldsymbol {x} _ {0}) \mathrm {d} \boldsymbol {x} - 2 \int \boldsymbol {g} (\boldsymbol {x}) \mathbb {P} (\boldsymbol {x} | \boldsymbol {x} _ {0}) \mathrm {d} \boldsymbol {x} \int \boldsymbol {g} ^ {\top} \left(\boldsymbol {x} ^ {\prime}\right) \mathbb {P} \left(\boldsymbol {x} ^ {\prime} | \boldsymbol {x} _ {0}\right) \mathrm {d} \boldsymbol {x} ^ {\prime} (37) \\ = 2 \mathbb {E} _ {\boldsymbol {x} \sim p _ {\mathrm {a u g}} (\cdot | \boldsymbol {x} _ {0})} [ \boldsymbol {g} \boldsymbol {g} ^ {\top} ] - 2 \mathbb {E} _ {\boldsymbol {x} \sim p _ {\mathrm {a u g}} (\cdot | \boldsymbol {x} _ {0})} [ \boldsymbol {g} ] \mathbb {E} _ {\boldsymbol {x} \sim p _ {\mathrm {a u g}} (\cdot | \boldsymbol {x} _ {0})} [ \boldsymbol {g} ^ {\top} ] (38) \\ = 2 \mathbb {V} _ {\boldsymbol {x} \sim p _ {\mathrm {a u g}} (\cdot | \boldsymbol {x} _ {0})} [ \boldsymbol {g} ] (39) \\ \end{array} +$$ + +So we have: + +$$ +\begin{array}{l} \mathbb {C} _ {\alpha} ^ {\text {i n t r a}} [ \boldsymbol {g} ] \rightarrow \frac {1}{2} \sum_ {l} z _ {l} \int \phi_ {l} \left(\boldsymbol {x} _ {0}\right) 2 \mathbb {V} _ {\boldsymbol {x} \sim p _ {\mathrm {a u g}} (\cdot | \boldsymbol {x} _ {0})} [ \boldsymbol {g} ] \mathbb {P} \left(\boldsymbol {x} _ {0}\right) \mathrm {d} \boldsymbol {x} _ {0} (40) \\ = \sum_ {l} z _ {l} ^ {2} \mathbb {E} _ {\boldsymbol {x} _ {0} \sim \tilde {p} _ {l}} \mathbb {V} _ {\boldsymbol {x} \sim p _ {\text {a u g}} (\cdot | \boldsymbol {x} _ {0})} [ \boldsymbol {g} ] (41) \\ \end{array} +$$ + +Using the law of total variation, finally we have: + +$$ +\mathbb {C} _ {\alpha} [ \boldsymbol {g} ] \rightarrow \sum_ {l} z _ {l} ^ {2} \mathbb {V} _ {\boldsymbol {x} _ {0} \sim \tilde {p} _ {l}} \mathbb {E} _ {\boldsymbol {x} \sim p _ {\mathrm {a u g}} (\cdot | \boldsymbol {x} _ {0})} [ \boldsymbol {g} ] \tag {42} +$$ + +![](images/86a1ed00c22d92732e073d8f3ae334c90cd7261a0d874e20147e4701b99b8dd5.jpg) + +# B ONE-LAYER MODEL (SEC. 3) + +# B.1 COMPUTATION OF THE TWO EXAMPLE MODELS + +Here we assume ReLU activation $h(x) \coloneqq \max (x,0)$ , which is a homogeneous activation $h(x) = h'(x)x$ . Note that we consider $h'(0) = 0$ . Therefore, for any sample $\pmb{x}$ , if $\pmb{w}^{\top}\pmb{x} = 0$ , then we don't consider it to be included in the active region of ReLU, i.e., $\tilde{\pmb{x}}^{\pmb{w}} = \pmb{x} \cdot h'(\pmb{w}^{\top}\pmb{x}) = 0$ . + +Let $z$ be a hidden binary variable and we could compute $A(\boldsymbol{w})$ (here $p_0 \coloneqq \mathbb{P}[z = 0]$ and $p_1 \coloneqq \mathbb{P}[z = 1]$ ): + +$$ +\mathbb {V} [ \tilde {\boldsymbol {x}} ^ {\boldsymbol {w}} ] = \mathbb {V} _ {z} [ \mathbb {E} [ \tilde {\boldsymbol {x}} ^ {\boldsymbol {w}} | z ] ] + \mathbb {E} _ {z} [ \mathbb {V} [ \tilde {\boldsymbol {x}} ^ {\boldsymbol {w}} | z ] ] = p _ {0} p _ {1} \Delta (\boldsymbol {w}) \Delta^ {\top} (\boldsymbol {w}) + p _ {0} \Sigma_ {0} (\boldsymbol {w}) + p _ {1} \Sigma_ {1} (\boldsymbol {w}) \tag {43} +$$ + +where $\Delta (\pmb {w})\coloneqq \mathbb{E}[\tilde{\pmb{x}} |z = 1] - \mathbb{E}[\tilde{\pmb{x}} |z = 0]$ and $\Sigma_z(\pmb {w})\coloneqq \mathbb{V}[\tilde{\pmb{x}} |z]$ + +Latent categorical model. If $\pmb{w} = \pmb{u}_m$ , let $z \coloneqq \mathbb{I}(y = m)$ . This leads to $\Sigma_1(\pmb{u}_m) = \Sigma_0(\pmb{u}_m) = 0$ and $\Delta(\pmb{u}_m) = \pmb{u}_m$ . Therefore, we have: + +$$ +\left. A (\boldsymbol {w}) \right| _ {\boldsymbol {w} = \boldsymbol {u} _ {m}} := \mathbb {C} _ {\alpha} [ \tilde {\boldsymbol {x}} ^ {\boldsymbol {w}} ] = \mathbb {V} [ \tilde {\boldsymbol {x}} ^ {\boldsymbol {w}} ] = \mathbb {P} [ y = m ] (1 - \mathbb {P} [ y = m ]) \boldsymbol {u} _ {m} \boldsymbol {u} _ {m} ^ {\top} \tag {44} +$$ + +Latent summation model. If $\boldsymbol{w} = \boldsymbol{u}_m$ , first notice that due to orthogonal constraints we have $\boldsymbol{w}^{\top}\boldsymbol{x} = \sum_{m'} y_{m'} \boldsymbol{u}_{m'}^{\top} \boldsymbol{w} = y_m$ . Let $z := \mathbb{I}(y_m > 0)$ , then we can compute $\Delta(\boldsymbol{u}_m) = y_m^+ \boldsymbol{u}_m$ , $\Sigma_1(\boldsymbol{u}_m) = I - \boldsymbol{u}_m \boldsymbol{u}_m^{\top}$ and $\Sigma_0(\boldsymbol{u}_m) = 0$ . Therefore, we have: + +$$ +\left. A (\boldsymbol {w}) \right| _ {\boldsymbol {w} = \boldsymbol {u} _ {m}} := \mathbb {C} _ {\alpha} [ \tilde {\boldsymbol {x}} ^ {\boldsymbol {w}} ] = \mathbb {V} [ \tilde {\boldsymbol {x}} ] = (1 - q _ {m}) ^ {2} \boldsymbol {u} _ {m} \boldsymbol {u} _ {m} ^ {\top} + q _ {m} (I - \boldsymbol {u} _ {m} \boldsymbol {u} _ {m} ^ {\top}) \tag {45} +$$ + +# B.2 DERIVATION OF TRAINING DYNAMICS + +Lemma 3 (Training dynamics of 1-layer network with homogeneous activation in contrastive learning). The gradient dynamics of Eqn. 5 is (note that $\alpha$ is treated as an independent variable): + +$$ +\dot {\boldsymbol {w}} _ {k} = P _ {\boldsymbol {w} _ {k}} ^ {\perp} A \left(\boldsymbol {w} _ {k}\right) \boldsymbol {w} _ {k} \tag {7} +$$ + +Here $P_{\pmb{w}_k}^{\perp} \coloneqq I - \pmb{w}_k \pmb{w}_k^{\top}$ projects a vector into the complementary subspace spanned by $\pmb{w}_k$ . + +Proof. First of all, it is clear that from Eqn. 5, each $\boldsymbol{w}_k$ evolves independently. Therefore, we omit the subscript $k$ and derive the dynamics of one node $\boldsymbol{w}$ . + +To compute the training dynamics, we only need to compute the differential of $\mathbb{C}_{\alpha}[h(\boldsymbol{w}_k^\top \boldsymbol{x})]$ . We use matrix differential form (Giles, 2008) to make the derivation easier to understand. + +Note that for one-layer network with $K = 1$ nodes, $\mathcal{E}(\boldsymbol{w}) := \frac{1}{2}\mathbb{C}_{\alpha}[h(\boldsymbol{w}^{\top}\boldsymbol{x})] = \frac{1}{2}\mathbb{C}_{\alpha}[h(\boldsymbol{w}^{\top}\boldsymbol{x}), h(\boldsymbol{w}^{\top}\boldsymbol{x})]$ be the objective function to be maximized. Using the fact that + +- $\mathbb{C}_{\alpha}[\pmb{x},\pmb{y}]$ is a bilinear form (linear w.r.t $\pmb{x}$ and $\pmb{y}$ ) given fixed $\alpha$ , +for any vector $\pmb{a}$ and $\pmb{b}$ , we have $\pmb{a}^{\top} \mathbb{C}_{\alpha}[\pmb{x}, \pmb{y}] \pmb{b} = \mathbb{C}_{\alpha}[\pmb{a}^{\top} \pmb{x}, \pmb{b}^{\top} \pmb{y}]$ , +for scalar $x$ and $y$ , $\mathbb{C}_{\alpha}[x,y] = \mathbb{C}_{\alpha}[y,x]$ + +and by the product rule $\mathrm{d}(x\cdot y) = \mathrm{d}x\cdot y + x\cdot \mathrm{d}y$ , we have: + +$$ +\begin{array}{l} \mathrm {d} \mathcal {E} = \frac {1}{2} \mathbb {C} _ {\alpha} \left[ h (\boldsymbol {w} ^ {\top} \boldsymbol {x}), h ^ {\prime} (\boldsymbol {w} ^ {\top} \boldsymbol {x}) \mathrm {d} \boldsymbol {w} ^ {\top} \boldsymbol {x} \right] + \frac {1}{2} \mathbb {C} _ {\alpha} \left[ h ^ {\prime} (\boldsymbol {w} ^ {\top} \boldsymbol {x}) \mathrm {d} \boldsymbol {w} ^ {\top} \boldsymbol {x}, h (\boldsymbol {w} ^ {\top} \boldsymbol {x}) \right] \\ = \mathbb {C} _ {\alpha} \left[ h \left(\boldsymbol {w} ^ {\top} \boldsymbol {x}\right), h ^ {\prime} \left(\boldsymbol {w} ^ {\top} \boldsymbol {x}\right) \boldsymbol {x} \right] \mathrm {d} \boldsymbol {w} \tag {46} \\ \end{array} +$$ + +Now use the homogeneous condition (Assumption 1) for activation $h$ : $h(x) = h'(x)x$ , which gives $h(\boldsymbol{w}^\top \boldsymbol{x}) = h'(\boldsymbol{w}^\top \boldsymbol{x})\boldsymbol{w}^\top \boldsymbol{x}$ , therefore, we have: + +$$ +\mathrm {d} \mathcal {E} = \boldsymbol {w} ^ {\top} \mathbb {C} _ {\alpha} \left[ h ^ {\prime} \left(\boldsymbol {w} ^ {\top} \boldsymbol {x}\right) \boldsymbol {x}, h ^ {\prime} \left(\boldsymbol {w} ^ {\top} \boldsymbol {x}\right) \boldsymbol {x} \right] \mathrm {d} \boldsymbol {w} = \boldsymbol {w} ^ {\top} A (\boldsymbol {w}) \mathrm {d} \boldsymbol {w} \tag {47} +$$ + +where $A(\boldsymbol{w}) \coloneqq \mathbb{C}_{\alpha}[h'(\boldsymbol{w}^\top \boldsymbol{x})\boldsymbol{x}, h'(\boldsymbol{w}^\top \boldsymbol{x})\boldsymbol{x}] = \mathbb{C}_{\alpha}[\tilde{\boldsymbol{x}}^{\boldsymbol{w}}, \tilde{\boldsymbol{x}}^{\boldsymbol{w}}]$ . Therefore, by checking the coefficient associated with the differential form $\mathrm{d}\boldsymbol{w}$ , we know $\frac{\partial \mathcal{E}}{\partial \boldsymbol{w}} = A(\boldsymbol{w})\boldsymbol{w}$ . By gradient ascent, we have $\dot{\boldsymbol{w}} = A(\boldsymbol{w})\boldsymbol{w}$ . Since $\boldsymbol{w}$ has the additional constraint $\| \boldsymbol{w} \|_2 = 1$ , the final dynamics is $\dot{\boldsymbol{w}} = P_{\boldsymbol{w}}^\perp A(\boldsymbol{w})\boldsymbol{w}$ where $P_{\boldsymbol{w}}^\perp \coloneqq I - \boldsymbol{w}\boldsymbol{w}^\top$ is a projection matrix that projects a vector into the orthogonal complement subspace of the subspace spanned by $\boldsymbol{w}$ . + +Remarks. Note that an alternative route is to use homogeneous condition first: $\mathbb{C}_{\alpha}[h(\boldsymbol{w}^{\top}\boldsymbol{x})] = \boldsymbol{w}^{\top}A(\boldsymbol{x})\boldsymbol{w}$ , then taking the differential. This involves an additional term $\frac{1}{2}\boldsymbol{w}^{\top}(\mathrm{d}A)\boldsymbol{w}$ . In the following we will show it is zero. For this we first compute $\mathrm{d}A$ : + +$$ +\begin{array}{l} \mathrm {d} A = \mathrm {d} \mathbb {C} _ {\alpha} \left[ h ^ {\prime} \left(\boldsymbol {w} ^ {\top} \boldsymbol {x}\right) \right] (48) \\ = \mathbb {C} _ {\alpha} \left[ h ^ {\prime \prime} \left(\boldsymbol {w} ^ {\top} \boldsymbol {x}\right) \left(\mathrm {d} \boldsymbol {w} ^ {\top} \boldsymbol {x}\right) \boldsymbol {x}, h ^ {\prime} \left(\boldsymbol {w} ^ {\top} \boldsymbol {x}\right) \boldsymbol {x} \right] + \mathbb {C} _ {\alpha} \left[ h ^ {\prime} \left(\boldsymbol {w} ^ {\top} \boldsymbol {x}\right) \boldsymbol {x}, h ^ {\prime \prime} \left(\boldsymbol {w} ^ {\top} \boldsymbol {x}\right) \left(\mathrm {d} \boldsymbol {w} ^ {\top} \boldsymbol {x}\right) \boldsymbol {x} \right] (49) \\ \end{array} +$$ + +Therefore, since $\pmb{a}^{\top}\mathbb{C}_{\alpha}[\pmb{x},\pmb{y}]\pmb{b} = \mathbb{C}_{\alpha}[\pmb{a}^{\top}\pmb{x},\pmb{b}^{\top}\pmb{y}]$ , we have: + +$$ +\begin{array}{l} \boldsymbol {w} ^ {\top} (\mathrm {d} A) \boldsymbol {w} = \mathbb {C} _ {\alpha} [ (\mathrm {d} \boldsymbol {w} ^ {\top} \boldsymbol {x}) h ^ {\prime \prime} (\boldsymbol {w} ^ {\top} \boldsymbol {x}) \boldsymbol {w} ^ {\top} \boldsymbol {x}, h (\boldsymbol {w} ^ {\top} \boldsymbol {x}) ] + \mathbb {C} _ {\alpha} [ h (\boldsymbol {w} ^ {\top} \boldsymbol {x}), h ^ {\prime \prime} (\boldsymbol {w} ^ {\top} \boldsymbol {x}) (\mathrm {d} \boldsymbol {w} ^ {\top} \boldsymbol {x}) \boldsymbol {w} ^ {\top} \boldsymbol {x} ] \\ = 2 \mathbb {C} _ {\alpha} \left[ \left(\mathrm {d} \boldsymbol {w} ^ {\top} \boldsymbol {x}\right) h ^ {\prime \prime} \left(\boldsymbol {w} ^ {\top} \boldsymbol {x}\right) \boldsymbol {w} ^ {\top} \boldsymbol {x}, h \left(\boldsymbol {w} ^ {\top} \boldsymbol {x}\right) \right] \tag {50} \\ \end{array} +$$ + +Note that we now see the term $h^{\prime \prime}(\boldsymbol{w}^{\top}\boldsymbol{x})\boldsymbol{w}^{\top}\boldsymbol{x}$ . For ReLU activation, its second derivative $h^{\prime \prime}(x) = \delta(x)$ , where $\delta(x)$ is Direct delta function (Boas & Peters, 1984). From the property of delta function, we have $xh^{\prime \prime}(x) = x\delta(x) = 0$ even evaluated at $x = 0$ . Therefore, $h^{\prime \prime}(\boldsymbol{w}^{\top}\boldsymbol{x})\boldsymbol{w}^{\top}\boldsymbol{x} = 0$ and $\boldsymbol{w}^{\top}(\mathrm{dA})\boldsymbol{w} = 0$ . This is similar for LeakyReLU as well. + +# B.3 LOCAL STABILITY + +Theorem 1 (Stability of $\pmb{w}^*$ ). If $\pmb{w}_*$ is a LME of $A(\pmb{w}_*)$ and $\lambda_{\mathrm{gap}}(\pmb{w}_*) > \rho(\pmb{w}_*)$ , then $\pmb{w}_*$ is stable. + +Proof. For any unit direction $\| \pmb{u}\| _2 = 1$ so that $\pmb{u}^{\top}\pmb{w}_{*} = 0$ , consider the perturbation $\pmb{v} = \sqrt{1 - \epsilon^{2}}\pmb{w}_{*} + \epsilon \pmb{u}$ . Since $\| \pmb{w}_{*}\|_{2} = 1$ we have $\| \pmb {v}\| _2 = 1$ . + +Now let's compute $P_{\pmb{v}}^{\perp}A(\pmb{v})\pmb{v}$ . First, we have: + +$$ +\begin{array}{l} P _ {\boldsymbol {v}} ^ {\perp} = I - \boldsymbol {v} \boldsymbol {v} ^ {\top} = I - \left(\sqrt {1 - \epsilon^ {2}} \boldsymbol {w} _ {*} + \epsilon \boldsymbol {u}\right) \left(\sqrt {1 - \epsilon^ {2}} \boldsymbol {w} _ {*} + \epsilon \boldsymbol {u}\right) ^ {\top} (51) \\ = I - \boldsymbol {w} _ {*} \boldsymbol {w} _ {*} ^ {\top} - \epsilon (\boldsymbol {u} \boldsymbol {w} _ {*} ^ {\top} + \boldsymbol {w} _ {*} \boldsymbol {u} ^ {\top}) + \mathcal {O} \left(\epsilon^ {2}\right) (52) \\ = P _ {\boldsymbol {w} _ {*}} ^ {\perp} - \epsilon \left(\boldsymbol {u} \boldsymbol {w} _ {*} ^ {\top} + \boldsymbol {w} _ {*} \boldsymbol {u} ^ {\top}\right) + \mathcal {O} \left(\epsilon^ {2}\right) (53) \\ \end{array} +$$ + +So we have: + +$$ +\begin{array}{l} P _ {\boldsymbol {v}} ^ {\perp} A \left(\boldsymbol {w} _ {*}\right) \boldsymbol {v} = P _ {\boldsymbol {w} _ {*}} ^ {\perp} A \left(\boldsymbol {w} _ {*}\right) \boldsymbol {v} - \epsilon \left(\boldsymbol {u} \boldsymbol {w} _ {*} ^ {\top} + \boldsymbol {w} _ {*} \boldsymbol {u} ^ {\top}\right) A \left(\boldsymbol {w} _ {*}\right) \boldsymbol {v} + \mathcal {O} \left(\epsilon^ {2}\right) (54) \\ = P _ {\boldsymbol {w} _ {*}} ^ {\perp} A \left(\boldsymbol {w} _ {*}\right) \epsilon \boldsymbol {u} - \epsilon \lambda_ {*} \boldsymbol {u} + \mathcal {O} \left(\epsilon^ {2}\right) (55) \\ = P _ {\boldsymbol {w} _ {*}} ^ {\perp} \left(A \left(\boldsymbol {w} _ {*}\right) - \lambda_ {*} I\right) \epsilon \boldsymbol {u} + \mathcal {O} \left(\epsilon^ {2}\right) (56) \\ \end{array} +$$ + +The previous derivation is due to the fact that $P_{\boldsymbol{w}_*}^\perp A(\boldsymbol{w}_*) \boldsymbol{w}_* = 0$ , $\boldsymbol{u}^\top A(\boldsymbol{w}_*) \boldsymbol{w}_* = 0$ and $P_{\boldsymbol{w}_*}^\perp \boldsymbol{u} = \boldsymbol{u}$ . Therefore, for $P_{\boldsymbol{v}}^\perp A(\boldsymbol{v}) \boldsymbol{v}$ , we can decompose it to two parts: + +$$ +\begin{array}{l} P _ {\boldsymbol {v}} ^ {\perp} A (\boldsymbol {v}) \boldsymbol {v} = P _ {\boldsymbol {v}} ^ {\perp} A \left(\boldsymbol {w} _ {*}\right) \boldsymbol {v} + P _ {\boldsymbol {v}} ^ {\perp} \left(A (\boldsymbol {v}) - A \left(\boldsymbol {w} _ {*}\right)\right) \boldsymbol {v} (57) \\ = P _ {\boldsymbol {w} _ {*}} ^ {\perp} \left(A \left(\boldsymbol {w} _ {*}\right) - \lambda_ {*} I\right) \epsilon \boldsymbol {u} + P _ {\boldsymbol {v}} ^ {\perp} \left(A (\boldsymbol {v}) - A \left(\boldsymbol {w} _ {*}\right)\right) \boldsymbol {v} + \mathcal {O} \left(\epsilon^ {2}\right) (58) \\ \end{array} +$$ + +Therefore, since $\pmb{u}^{\top}\pmb{w}_{*} = 0$ , we have: + +$$ +\begin{array}{l} \boldsymbol {u} ^ {\top} P _ {\boldsymbol {w} _ {*}} ^ {\perp} \left(A \left(\boldsymbol {w} _ {*}\right) - \lambda_ {*} I\right) \epsilon \boldsymbol {u} = \boldsymbol {u} ^ {\top} \left(I - \boldsymbol {w} _ {*} \boldsymbol {w} _ {*} ^ {\top}\right) \left(A \left(\boldsymbol {w} _ {*}\right) - \lambda_ {*} I\right) \epsilon \boldsymbol {u} (59) \\ = \epsilon \boldsymbol {u} ^ {\top} \left(A \left(\boldsymbol {w} _ {*}\right) - \lambda_ {*} I\right) \boldsymbol {u} \leq - \lambda_ {\text {g a p}} \left(\boldsymbol {w} _ {*}\right) \epsilon + \mathcal {O} \left(\epsilon^ {2}\right) (60) \\ \end{array} +$$ + +and since $\| \pmb {u}\| _2 = \| \pmb {v}\| _2 = 1$ and $\| P_{\pmb{v}}^{\perp}\|_{2} = 1$ , we have: + +$$ +\left| \boldsymbol {u} ^ {\top} P _ {\boldsymbol {v}} ^ {\perp} \left(A (\boldsymbol {v}) - A \left(\boldsymbol {w} _ {*}\right)\right) \boldsymbol {v} \right| \leq \| \left(A (\boldsymbol {v}) - A \left(\boldsymbol {w} _ {*}\right)\right) \boldsymbol {v} \| _ {2} \tag {61} +$$ + +By the definition of local roughness measure $\rho (\pmb{w}_{*})$ , we have: + +$$ +\left\| \left(A (\boldsymbol {v}) - A \left(\boldsymbol {w} _ {*}\right)\right) \boldsymbol {w} _ {*} \right\| _ {2} \leq \rho \left(\boldsymbol {w} _ {*}\right) \| \boldsymbol {v} - \boldsymbol {w} _ {*} \| _ {2} + \mathcal {O} \left(\left\| \boldsymbol {v} - \boldsymbol {w} _ {*} \right\| _ {2} ^ {2}\right) = \rho \left(\boldsymbol {w} _ {*}\right) \epsilon + \mathcal {O} \left(\epsilon^ {2}\right) \tag {62} +$$ + +This leads to + +$$ +\begin{array}{l} \left\| \left(A (\boldsymbol {v}) - A \left(\boldsymbol {w} _ {*}\right)\right) \boldsymbol {v} \right\| _ {2} \leq \left\| \left(A (\boldsymbol {v}) - A \left(\boldsymbol {w} _ {*}\right)\right) \boldsymbol {w} _ {*} \right\| _ {2} + \left\| \left(A (\boldsymbol {v}) - A \left(\boldsymbol {w} _ {*}\right)\right) (\boldsymbol {v} - \boldsymbol {w} _ {*}) \right\| _ {2} (63) \\ \leq \rho \left(\boldsymbol {w} _ {*}\right) \epsilon + \mathcal {O} \left(\epsilon^ {2}\right) (64) \\ \end{array} +$$ + +Therefore, we have: + +$$ +\boldsymbol {u} ^ {\top} P _ {\boldsymbol {v}} ^ {\perp} A (\boldsymbol {v}) \boldsymbol {v} \leq - \left(\lambda_ {\text {g a p}} \left(\boldsymbol {w} _ {*}\right) - \rho \left(\boldsymbol {w} _ {*}\right)\right) \epsilon + \mathcal {O} \left(\epsilon^ {2}\right) \tag {65} +$$ + +When $\lambda_{\mathrm{gap}}(\pmb{w}_*) > \rho(\pmb{w}_*)$ and we have $\pmb{u}^{\top}P_{\pmb{v}}^{\perp}A(\pmb{v})\pmb{v} < 0$ for any $\pmb{u} \perp \pmb{w}_*$ and sufficiently small $\epsilon$ . Therefore, the critical point $\pmb{w}_*$ is stable. + +Theorem 2 (Bound of local roughness $\rho(\boldsymbol{w})$ in ReLU setting). If input $\|\boldsymbol{x}\|_2 \leq C_0$ is bounded, $\alpha$ has kernel structure (Def. 1) and batchsize $N \to +\infty$ , then $\rho(\boldsymbol{w}_*) \leq \frac{C_0^3 \mathrm{vol}(C_0)}{\pi} r(\boldsymbol{w}_*, \alpha)$ , where $r(\boldsymbol{w}, \alpha) := \sum_{l=0}^{+\infty} z_l^2(\alpha) \max_{\boldsymbol{w}^\top \boldsymbol{x} = 0} \tilde{p}_l(\boldsymbol{x}; \alpha)$ . + +Proof. Suppose $\boldsymbol{w}_{*}$ and its local perturbation $\boldsymbol{w}$ are on the unit sphere $\| \boldsymbol{w} \|_2 = \| \boldsymbol{w}_* \|_2 = 1$ . Since $\boldsymbol{w}$ is a local perturbation, we have $\boldsymbol{w}^\top \boldsymbol{w}_* \geq 1 - \epsilon$ for $\epsilon \ll 1$ . + +In the following we will check how we bound $\| (A(\boldsymbol{w}) - A(\boldsymbol{w}_*))\boldsymbol{w}_* \|_2$ in terms of $\| \boldsymbol{w} - \boldsymbol{w}_* \|_2$ and then we can get the upper bound of local roughness metric $\rho(\boldsymbol{w}_*)$ . + +Let the function $g(\pmb{x}) \coloneqq \tilde{\pmb{x}}^{\pmb{w}}$ , apply Corollary 1 with no augmentation and the large batch limits, we have + +$$ +A (\boldsymbol {w}) := \mathbb {C} _ {\alpha} [ \tilde {\boldsymbol {x}} ^ {\boldsymbol {w}} ] = \sum_ {l} z _ {l} ^ {2} \mathbb {V} _ {\tilde {p} _ {l}} [ \tilde {\boldsymbol {x}} ^ {\boldsymbol {w}} ]. \tag {66} +$$ + +where $\tilde{p}_l(\boldsymbol{x}) = \frac{1}{z_l}\mathbb{P}(\boldsymbol{x})\phi_l(\boldsymbol{x})$ is the probability distribution of the input $\boldsymbol{x}$ , adjusted by the mapping of the kernel function determined by the pairwise importance $\alpha_{ij}$ (Def. 1). $z_l$ is its normalization constant. + +To study $(A(\pmb{w}) - A(\pmb{w}_{*}))\pmb{w}_{*}$ , we will study each component $(\mathbb{V}_{\tilde{p}_l}[\tilde{\pmb{x}}^{\pmb{w}}] - \mathbb{V}_{\tilde{p}_l}[\tilde{\pmb{x}}^{\pmb{w}_{*}}])$ $\pmb{w}_{*}$ . + +Note that since $\tilde{\pmb{x}}^{\pmb{w}}\coloneqq \pmb {x}\mathbb{I}(\pmb{w}^{\top}\pmb {x}\geq 0)$ , we have $\mathbb{V}_{\tilde{p}_l}[\tilde{\pmb{x}}^{\pmb{w}}] = \mathbb{E}_{\tilde{p}_l}[\pmb {x}\pmb{x}^{\top}\mathbb{I}(\pmb{w}^{\top}\pmb {x}\geq 0)] - \mathbb{E}_{\tilde{p}_l}[\pmb {x}\mathbb{I}(\pmb{w}^{\top}\pmb {x}\geq 0)]\mathbb{E}_{\tilde{p}_l}[\pmb{x}^{\top}\mathbb{I}(\pmb{w}^{\top}\pmb {x}\geq 0)]$ . Let + +$$ +\boldsymbol {e} := \int_ {\boldsymbol {w} ^ {\top} \boldsymbol {x} \geq 0} \boldsymbol {x} \tilde {p} _ {l} (\boldsymbol {x}) \mathrm {d} \boldsymbol {x}, \quad \boldsymbol {e} _ {*} := \int_ {\boldsymbol {w} _ {*} ^ {\top} \boldsymbol {x} \geq 0} \boldsymbol {x} \tilde {p} _ {l} (\boldsymbol {x}) \mathrm {d} \boldsymbol {x} \tag {67} +$$ + +$$ +E := \int_ {\boldsymbol {w} ^ {\top} \boldsymbol {x} \geq 0} \boldsymbol {x} \boldsymbol {x} ^ {\top} \tilde {p} _ {l} (\boldsymbol {x}) \mathrm {d} \boldsymbol {x}, \quad E _ {*} := \int_ {\boldsymbol {w} _ {*} ^ {\top} \boldsymbol {x} \geq 0} \boldsymbol {x} \boldsymbol {x} ^ {\top} \tilde {p} _ {l} (\boldsymbol {x}) \mathrm {d} \boldsymbol {x} \tag {68} +$$ + +So we can write + +$$ +\mathbb {V} _ {\tilde {p} _ {l}} \left[ \tilde {\boldsymbol {x}} ^ {\boldsymbol {w}} \right] = E - \boldsymbol {e} \boldsymbol {e} ^ {\top}, \quad \mathbb {V} _ {\tilde {p} _ {l}} \left[ \tilde {\boldsymbol {x}} ^ {\boldsymbol {w} _ {*}} \right] = E _ {*} - \boldsymbol {e} _ {*} \boldsymbol {e} _ {*} ^ {\top} \tag {69} +$$ + +and $\mathbb{V}_{\tilde{p}_l}[\tilde{\boldsymbol{x}}^{\boldsymbol{w}}] - \mathbb{V}_{\tilde{p}_l}[\tilde{\boldsymbol{x}}^{\boldsymbol{w}_*}] = (E - E_*) + (\boldsymbol{e}_*\boldsymbol{e}_*^\top - \boldsymbol{e}\boldsymbol{e}^\top)$ . + +Define the following regions + +$$ +\Omega_ {+} := \left\{\boldsymbol {x}: \boldsymbol {w} _ {*} ^ {\top} \boldsymbol {x} \geq 0, \boldsymbol {w} ^ {\top} \boldsymbol {x} \leq 0 \right\} \tag {70} +$$ + +$$ +\Omega_ {-} := \left\{\boldsymbol {x}: \boldsymbol {w} _ {*} ^ {\top} \boldsymbol {x} \leq 0, \boldsymbol {w} ^ {\top} \boldsymbol {x} \geq 0 \right\} \tag {71} +$$ + +$$ +\Omega := \Omega_ {+} \cup \Omega_ {-} \tag {72} +$$ + +Now let's bound $(E - E_{*})\pmb{w}_{*}$ and $(e_{*}e_{*}^{\top} - ee^{\top})\pmb{w}_{*}$ . + +Bound $(E - E_{*})\pmb{w}_{*}$ . We have: + +$$ +E - E _ {*} = \int_ {\Omega_ {-}} \boldsymbol {x} \boldsymbol {x} ^ {\top} \tilde {p} _ {l} (\boldsymbol {x}) \mathrm {d} \boldsymbol {x} - \int_ {\Omega_ {+}} \boldsymbol {x} \boldsymbol {x} ^ {\top} \tilde {p} _ {l} (\boldsymbol {x}) \mathrm {d} \boldsymbol {x} \tag {73} +$$ + +and thus + +$$ +\left(E - E _ {*}\right) \boldsymbol {w} _ {*} = \int_ {\Omega_ {-}} \boldsymbol {x} \boldsymbol {x} ^ {\top} \boldsymbol {w} _ {*} \tilde {p} _ {l} (\boldsymbol {x}) \mathrm {d} \boldsymbol {x} - \int_ {\Omega_ {+}} \boldsymbol {x} \boldsymbol {x} ^ {\top} \boldsymbol {w} _ {*} \tilde {p} _ {l} (\boldsymbol {x}) \mathrm {d} \boldsymbol {x} \tag {74} +$$ + +For any $\pmb{x} \in \Omega_{+}$ , we have: + +$$ +0 \leq \boldsymbol {w} _ {*} ^ {\top} \boldsymbol {x} = \boldsymbol {w} ^ {\top} \boldsymbol {x} + (\boldsymbol {w} _ {*} - \boldsymbol {w}) ^ {\top} \boldsymbol {x} \leq (\boldsymbol {w} _ {*} - \boldsymbol {w}) ^ {\top} \boldsymbol {x} \leq C _ {0} \| \boldsymbol {w} _ {*} - \boldsymbol {w} \| _ {2} \tag {75} +$$ + +Therefore, $|\pmb{w}_{*}^{\top}\pmb{x}| \leq M\|\pmb{w}_{*}-\pmb{w}\|_{2}$ and we have + +$$ +\left\| \int_ {\Omega_ {+}} \boldsymbol {x} \boldsymbol {x} ^ {\top} \boldsymbol {w} _ {*} \tilde {p} _ {l} (\boldsymbol {x}) \mathrm {d} \boldsymbol {x} \right\| _ {2} \leq \int_ {\Omega_ {+}} | \boldsymbol {w} _ {*} ^ {\top} \boldsymbol {x} | \| \boldsymbol {x} \| _ {2} \tilde {p} _ {l} (\boldsymbol {x}) \mathrm {d} \boldsymbol {x} \tag {76} +$$ + +$$ +\begin{array}{l} \leq C _ {0} ^ {2} \| \boldsymbol {w} _ {*} - \boldsymbol {w} \| _ {2} \max _ {\boldsymbol {x} \in \Omega_ {+}} \tilde {p} _ {l} (\boldsymbol {x}) \int_ {\Omega_ {+}, \| \boldsymbol {x} \| _ {2} \leq C _ {0}} d \boldsymbol {x} (77) \\ = C _ {0} ^ {3} \| \boldsymbol {w} _ {*} - \boldsymbol {w} \| _ {2} \max _ {\boldsymbol {x} \in \Omega_ {+}} \tilde {p} _ {l} (\boldsymbol {x}) \frac {\operatorname {v o l} \left(C _ {0}\right)}{2 \pi} \operatorname {a r c c o s} \boldsymbol {w} ^ {\top} \boldsymbol {w} _ {*} (78) \\ \end{array} +$$ + +where $\mathrm{vol}(C_0)$ is the volume of the $d$ -dimensional ball of radius $C_0$ . Similarly for $\pmb{x} \in \Omega_{-}$ , we have + +$$ +0 \geq \boldsymbol {w} _ {*} ^ {\top} \boldsymbol {x} = \boldsymbol {w} ^ {\top} \boldsymbol {x} + (\boldsymbol {w} _ {*} - \boldsymbol {w}) ^ {\top} \boldsymbol {x} \geq (\boldsymbol {w} _ {*} - \boldsymbol {w}) ^ {\top} \boldsymbol {x} \geq - C _ {0} \| \boldsymbol {w} _ {*} - \boldsymbol {w} \| _ {2} \tag {79} +$$ + +hence $|\pmb{w}_{*}^{\top}\pmb{x}| \leq C_{0}\|\pmb{w}_{*}-\pmb{w}\|_{2}$ and overall we have: + +$$ +\left\| \left(E - E _ {*}\right) \boldsymbol {w} _ {*} \right\| _ {2} \leq \frac {C _ {0} ^ {3} \operatorname {v o l} \left(C _ {0}\right)}{\pi} \| \boldsymbol {w} _ {*} - \boldsymbol {w} \| _ {2} \max _ {\boldsymbol {x} \in \Omega} \tilde {p} _ {l} (\boldsymbol {x}) \arccos \boldsymbol {w} ^ {\top} \boldsymbol {w} _ {*} \tag {80} +$$ + +Since for $x \in (0,1]$ , $\arcsin \sqrt{1 - x^2} \leq \frac{\sqrt{1 - x^2}}{x}$ , we have: + +$$ +\begin{array}{l} \operatorname {a r c c o s} \boldsymbol {w} ^ {\top} \boldsymbol {w} _ {*} = \arcsin \sqrt {1 - \left(\boldsymbol {w} ^ {\top} \boldsymbol {w} _ {*}\right) ^ {2}} \leq \frac {\sqrt {1 - \left(\boldsymbol {w} ^ {\top} \boldsymbol {w} _ {*}\right) ^ {2}}}{\boldsymbol {w} ^ {\top} \boldsymbol {w} _ {*}} (81) \\ = \frac {\sqrt {1 + \boldsymbol {w} ^ {\top} \boldsymbol {w} _ {*}} \sqrt {1 - \boldsymbol {w} ^ {\top} \boldsymbol {w} _ {*}})}{\boldsymbol {w} ^ {\top} \boldsymbol {w} _ {*}} \leq \frac {\sqrt {2 (1 - \boldsymbol {w} ^ {\top} \boldsymbol {w} _ {*})}}{\boldsymbol {w} ^ {\top} \boldsymbol {w} _ {*}} (82) \\ = \frac {1}{1 - \epsilon} \| \boldsymbol {w} - \boldsymbol {w} _ {*} \| _ {2} (83) \\ \end{array} +$$ + +we have: + +$$ +\left\| \left(E - E _ {*}\right) \boldsymbol {w} _ {*} \right\| _ {2} \leq \frac {C _ {0} ^ {3} \operatorname {v o l} \left(C _ {0}\right)}{\pi} \frac {1}{1 - \epsilon} \| \boldsymbol {w} _ {*} - \boldsymbol {w} \| _ {2} ^ {2} \max _ {\boldsymbol {x} \in \Omega} \tilde {p} _ {l} (\boldsymbol {x}) \tag {84} +$$ + +Therefore, $\| (E - E_{*})\pmb{w}_{*}\|_{2}$ is a second-order term w.r.t. $\| \pmb {w} - \pmb {w}_*\| _2$ + +Bound $(e_{*}e_{*}^{\top} - ee^{\top})w_{*}$ . On the other hand: + +$$ +e e ^ {\top} - e _ {*} e _ {*} ^ {\top} = e \left(e - e _ {*}\right) ^ {\top} + \left(e - e _ {*}\right) e _ {*} ^ {\top} \tag {85} +$$ + +We have $\| e \|_{2}, \| e_{*} \|_{2}$ bounded and + +$$ +\boldsymbol {e} - \boldsymbol {e} _ {*} = \int_ {\Omega_ {-}} \boldsymbol {x} \tilde {p} _ {l} (\boldsymbol {x}) \mathrm {d} \boldsymbol {x} - \int_ {\Omega_ {+}} \boldsymbol {x} \tilde {p} _ {l} (\boldsymbol {x}) \mathrm {d} \boldsymbol {x} \tag {86} +$$ + +Using similar derivation, we conclude that $\| e(e - e_{*})^{\top}w_{*}\|_{2}$ is also a second-order term. The only first-order term is $\| (e - e_{*})e_{*}^{\top}w_{*}\|_{2}$ : + +$$ +\begin{array}{l} \left\| \left(\boldsymbol {e} - \boldsymbol {e} _ {*}\right) \boldsymbol {e} _ {*} ^ {\top} \boldsymbol {w} _ {*} \right\| _ {2} \leq \mathbb {E} _ {\tilde {p} _ {l}} \left[ h \left(\boldsymbol {w} ^ {\top} \boldsymbol {x}\right) \right] \int_ {\Omega} \| \boldsymbol {x} \| _ {2} \tilde {p} _ {l} (\boldsymbol {x}) \mathrm {d} \boldsymbol {x} (87) \\ \leq C _ {0} ^ {2} \int_ {\Omega} \tilde {p} _ {l} (\boldsymbol {x}) \mathrm {d} \boldsymbol {x} \leq C _ {0} ^ {2} \max _ {\boldsymbol {x} \in \Omega} \tilde {p} _ {l} (\boldsymbol {x}) \int_ {\Omega : \| \boldsymbol {x} \| _ {2} \leq C _ {0}} \mathrm {d} \boldsymbol {x} (88) \\ \leq \frac {C _ {0} ^ {3} \operatorname {v o l} \left(C _ {0}\right)}{\pi} \operatorname {a r c c o s} \boldsymbol {w} ^ {\top} \boldsymbol {w} _ {*} \max _ {\boldsymbol {x} \in \Omega} \tilde {p} _ {l} (\boldsymbol {x}) (89) \\ \leq \frac {C _ {0} ^ {3} \operatorname {v o l} \left(C _ {0}\right)}{\pi} \frac {1}{1 - \epsilon} \| \boldsymbol {w} - \boldsymbol {w} _ {*} \| _ {2} \max _ {\boldsymbol {x} \in \Omega} \tilde {p} _ {l} (\boldsymbol {x}) (90) \\ \end{array} +$$ + +Overall we have: + +$$ +\begin{array}{l} \left\| \left(A (\boldsymbol {w}) - A \left(\boldsymbol {w} _ {*}\right)\right) \boldsymbol {w} _ {*} \right\| _ {2} \leq \sum_ {l} z _ {l} ^ {2} \| \left(\mathbb {V} _ {\tilde {p} _ {l}} [ \tilde {\boldsymbol {x}} ^ {\boldsymbol {w}} ] - \mathbb {V} _ {\tilde {p} _ {l}} [ \tilde {\boldsymbol {x}} ^ {\boldsymbol {w} _ {*}} ]\right) \boldsymbol {w} _ {*} \| _ {2} (91) \\ \leq \frac {C _ {0} ^ {3} \operatorname {v o l} \left(C _ {0}\right)}{\pi} \frac {1}{1 - \epsilon} \left(\sum_ {l} z _ {l} ^ {2} \max _ {\boldsymbol {x} \in \Omega} \tilde {p} _ {l} (\boldsymbol {x})\right) \| \boldsymbol {w} - \boldsymbol {w} _ {*} \| _ {2} + \mathcal {O} \left(\| \boldsymbol {w} - \boldsymbol {w} _ {*} \| _ {2} ^ {2}\right) (92) \\ \end{array} +$$ + +Since $\rho(\boldsymbol{w}_*)$ is the smallest scalar that makes the local roughness metric hold and $\epsilon$ is arbitrarily small, we have: + +$$ +\rho \left(\boldsymbol {w} _ {*}\right) \leq \frac {C _ {0} ^ {3} \operatorname {v o l} \left(C _ {0}\right)}{\pi} r \left(\boldsymbol {w} _ {*}, \alpha\right) \tag {93} +$$ + +where $r(\pmb{w},\alpha)\coloneqq \sum_{l}z_{l}^{2}\max_{\pmb{w}^{\top}\pmb{x} = 0}\tilde{p}_{l}(\pmb {x};\alpha)$ + +Corollary 2 (Effect of different $\alpha$ ). For uniform $\alpha_{\mathrm{u}}$ ( $\alpha_{ij} := 1$ ) and 1-D Gaussian $\alpha_{\mathrm{g}}$ ( $\alpha_{ij} := \exp(-\|h(\pmb{w}^{\top}\pmb{x}_0[i]) - h(\pmb{w}^{\top}\pmb{x}_0[j])\|_2^2/2\tau)$ ), we have $r(\pmb{w}_*, \alpha_{\mathrm{g}}) = z_0(\alpha_{\mathrm{g}})r(\pmb{w}_*, \alpha_{\mathrm{u}})$ with $z_0(\alpha_{\mathrm{g}}) := \int \exp(-h^2(\pmb{w}_*^{\top}\pmb{x})/2\tau)p_{\mathrm{D}}(\pmb{x})\mathrm{d}\pmb{x} \leq 1$ . As a result, $z_0(\alpha_{\mathrm{g}}) \ll 1$ leads to $r(\pmb{w}_*, \alpha_{\mathrm{g}}) \ll r(\pmb{w}_*, \alpha_{\mathrm{u}})$ . + +Proof. For uniform $\alpha_{\mathrm{u}}$ , it is clear that the mapping $\phi_{\mathrm{u}}(\pmb{x}) \equiv 1$ is 1-dimensional. Therefore, $\tilde{p_0}(\pmb{x}; \alpha_{\mathrm{u}}) := \frac{1}{z_0(\alpha_{\mathrm{u}})} \phi_{\mathrm{u0}}(\pmb{x}) p_{\mathrm{D}}(\pmb{x}) = p_{\mathrm{D}}(\pmb{x})$ with $z_0(\alpha_{\mathrm{u}}) = \int \phi_{\mathrm{u0}}(\pmb{x}) p_{\mathrm{D}}(\pmb{x}) \, \mathrm{d}\pmb{x} = 1$ . This means that + +$$ +\begin{array}{l} r \left(\boldsymbol {w} _ {*}, \alpha_ {\mathrm {u}}\right) := \sum_ {l = 0} ^ {+ \infty} z _ {l} ^ {2} \left(\alpha_ {\mathrm {u}}\right) \max _ {\boldsymbol {w} _ {*} ^ {\top} \boldsymbol {x} = 0} \tilde {p} _ {l} (\boldsymbol {x}; \alpha_ {\mathrm {u}}) (94) \\ = z _ {0} ^ {2} \left(\alpha_ {\mathrm {u}}\right) \max _ {\boldsymbol {w} _ {*} ^ {\top} \boldsymbol {x} = 0} \tilde {p} _ {0} (\boldsymbol {x}; \alpha_ {\mathrm {u}}) = \max _ {\boldsymbol {w} _ {*} ^ {\top} \boldsymbol {x} = 0} p _ {\mathrm {D}} (\boldsymbol {x}) (95) \\ \end{array} +$$ + +For Gaussian $\alpha_{\mathrm{g}}$ , from Lemma 1 we know that its infinite-dimensional mapping $\phi_{\mathrm{g}}(\pmb{x})$ has the following form for $\pmb{w} = \pmb{w}_{*}$ : + +$$ +\phi_ {\mathrm {g}} (\boldsymbol {x}) = e ^ {- \frac {h ^ {2} \left(\boldsymbol {w} _ {*} ^ {\top} \boldsymbol {x}\right)}{2 \tau}} \left[ \begin{array}{c} 1 \\ \tau^ {- 1 / 2} h \left(\boldsymbol {w} _ {*} ^ {\top} \boldsymbol {x}\right) \\ \frac {1}{\tau^ {2 / 2} \sqrt {2} !} h ^ {2} \left(\boldsymbol {w} _ {*} ^ {\top} \boldsymbol {x}\right) \\ \dots \\ \frac {1}{\tau^ {k / 2} \sqrt {k} !} h ^ {k} \left(\boldsymbol {w} _ {*} ^ {\top} \boldsymbol {x}\right) \\ \dots \end{array} \right] \tag {96} +$$ + +When $l \geq 1$ , $z_l^2 \tilde{p}_l(\boldsymbol{x}; \alpha_{\mathrm{g}}) = z_l \phi_{\mathrm{gl}}(\boldsymbol{x}) p_{\mathrm{D}}(\boldsymbol{x}) = 0$ for any $\boldsymbol{x}$ on the plane $\boldsymbol{w}_{*}^{\top} \boldsymbol{x} = 0$ , since $\phi_{\mathrm{gl}}(\boldsymbol{x}) = 0$ on the plane. On the other hand, $\phi_{\mathrm{g0}}(\boldsymbol{x}) = e^{-\frac{h^2(\boldsymbol{w}_{*}^{\top} \boldsymbol{x})}{2\tau}}$ . On the plane, $\phi_{\mathrm{g0}}(\boldsymbol{x}) = 1$ and is a constant. Therefore, we have: + +$$ +\begin{array}{l} r \left(\boldsymbol {w} _ {*}, \alpha_ {\mathrm {g}}\right) := \sum_ {l = 0} ^ {+ \infty} z _ {l} ^ {2} \max _ {\boldsymbol {w} _ {*} ^ {\top} \boldsymbol {x} = 0} \tilde {p} _ {l} (\boldsymbol {x}; \alpha_ {\mathrm {g}}) = z _ {0} ^ {2} \left(\alpha_ {\mathrm {g}}\right) \max _ {\boldsymbol {w} _ {*} ^ {\top} \boldsymbol {x} = 0} \tilde {p} _ {0} (\boldsymbol {x}; \alpha_ {\mathrm {g}}) (97) \\ = z _ {0} \left(\alpha_ {\mathrm {g}}\right) \max _ {\boldsymbol {w} _ {*} ^ {\top} \boldsymbol {x} = 0} \phi_ {\mathrm {g} 0} (\boldsymbol {x}) p _ {\mathrm {D}} (\boldsymbol {x}) (98) \\ = z _ {0} \left(\alpha_ {\mathrm {g}}\right) \max _ {\boldsymbol {w} _ {*} ^ {\top} \boldsymbol {x} = 0} p _ {\mathrm {D}} (\boldsymbol {x}) = z _ {0} \left(\alpha_ {\mathrm {g}}\right) r \left(\boldsymbol {w} _ {*}, \alpha_ {\mathrm {u}}\right) (99) \\ \end{array} +$$ + +Here + +$$ +z _ {0} \left(\alpha_ {\mathrm {g}}\right) := \int \phi_ {\mathrm {g} 0} (\boldsymbol {x}) p _ {\mathrm {D}} (\boldsymbol {x}) \mathrm {d} \boldsymbol {x} = \int e ^ {- \frac {h ^ {2} \left(\boldsymbol {w} _ {*} ^ {\top} \boldsymbol {x}\right)}{2 \tau}} p _ {\mathrm {D}} (\boldsymbol {x}) \mathrm {d} \boldsymbol {x} \leq 1 \tag {100} +$$ + +![](images/0f82ffff9d97ab3962e09421639bff10f57ca3ab77b3f2270a27e6ca4b323646.jpg) + +# B.4 FINDING CRITICAL POINTS WITH INITIAL GUESS (SEC. 3.3) + +Notation. Let $\lambda_i(\boldsymbol{w})$ and $\phi_i(\boldsymbol{w})$ be the $i$ -th eigenvalue and unit eigenvector of $A(\boldsymbol{w})$ where $\phi_1(\boldsymbol{w})$ is the largest. We first assume $A(\boldsymbol{w})$ is positive definite (PD) and then remove this assumption later. In this case, $\lambda_1(\boldsymbol{w}) \geq \lambda_2(\boldsymbol{w}) \geq \ldots \geq \lambda_d(\boldsymbol{w}) > 0$ . Let $c(\boldsymbol{w}) \coloneqq \boldsymbol{w}^\top \phi_1(\boldsymbol{w})$ be the inner product between $\boldsymbol{w}$ and the maximal eigenvector of $A(\boldsymbol{w})$ . + +Consider the following Power Iteration (PI) format: + +$$ +\tilde {\boldsymbol {w}} (t + 1) \leftarrow A (\boldsymbol {w} (t)) \boldsymbol {w} (t), \quad \boldsymbol {w} (t + 1) \leftarrow \frac {\tilde {\boldsymbol {w}} (t + 1)}{\| \tilde {\boldsymbol {w}} (t + 1) \| _ {2}} \tag {101} +$$ + +Along the trajectory, let $\phi_i(t) \coloneqq \phi_1(A(\pmb{w}(t)))$ be the $i$ -th unit eigenvector of $A(\pmb{w}(t))$ and $\lambda_i(t)$ to be the $i$ -th eigenvalue. Define $\delta \pmb{w}(t) \coloneqq \pmb{w}(t + 1) - \pmb{w}(t)$ , $\delta A(t) \coloneqq A(\pmb{w}(t + 1)) - A(\pmb{w}(t))$ , and + +$$ +c _ {t} := c (\boldsymbol {w} (t)) = \phi_ {1} ^ {\top} (t) \boldsymbol {w} (t), \quad d _ {t} := \phi_ {1} ^ {\top} (t) \boldsymbol {w} (t + 1) \tag {102} +$$ + +Then $-1\leq c_{t},d_{t}\leq 1$ since they are inner product of two unit vectors. + +Theorem 3 (Existence of critical points). Let $c_{0} \coloneqq c(\pmb{w}(0)) \neq 0$ . If there exists $\gamma < 1$ so that: + +$$ +\sup _ {\boldsymbol {w} \in B _ {\gamma}} \omega (\boldsymbol {w}) \leq \gamma , \tag {11} +$$ + +where $B_{\gamma} \coloneqq \left\{\boldsymbol{w}: \boldsymbol{w}^{\top} \boldsymbol{w}(0) \geq \frac{c_0 - c_\gamma}{1 - c_\gamma}, c_\gamma \coloneqq \frac{2\sqrt{\gamma}}{1 + \gamma}\right\}$ is the neighborhood of initial value $\boldsymbol{w}(0)$ . Then Power Iteration (Eqn. PI) converges to a critical point $\boldsymbol{w}_* \in B_\gamma$ of Eqn. 7. + +Proof. Note that if $c_0 < 0$ , we can always use $-\phi_1(\pmb{w})$ as the maximal eigenvector. + +First we assume $A(\boldsymbol{w})$ is positive definite (PD) over the entire unit sphere $\| \boldsymbol{w} \|_2 = 1$ , then follow Lemma 11, and notice that $\| \boldsymbol{w} - \boldsymbol{w}(0) \|_2 = \sqrt{2(1 - \boldsymbol{w}^\top \boldsymbol{w}(0))}$ , so + +$$ +\left\| \boldsymbol {w} - \boldsymbol {w} (0) \right\| _ {2} \leq \frac {\sqrt {2 (1 + \gamma) (1 - c _ {0})}}{1 - \sqrt {\gamma}} \quad \Longleftrightarrow \quad \boldsymbol {w} ^ {\top} \boldsymbol {w} (0) \geq \frac {c _ {0} - c _ {\gamma}}{1 - c _ {\gamma}} \tag {103} +$$ + +When $A(\boldsymbol{w})$ is not PD, Theorem 3 still applies to the PD matrix $\hat{A}(\boldsymbol{w}) \coloneqq A(\boldsymbol{w}) - \lambda_{\min}(\boldsymbol{w})I + \epsilon I$ with $L$ and $\kappa$ specified by $\hat{A}(\boldsymbol{w})$ , where $\epsilon > 0$ is a small constant. + +This transformation keeps $c_{0}$ since the eigenvectors of $\hat{A}(\boldsymbol{w})$ are the same as $A(\boldsymbol{w})$ . wwThe resulting fixed point $\hat{\boldsymbol{w}}_{*}$ is also the fixed point of the original problem with $A(\boldsymbol{w})$ , due to the fact that + +$$ +P _ {\boldsymbol {w}} ^ {\perp} \hat {A} (\boldsymbol {w}) \boldsymbol {w} = P _ {\boldsymbol {w}} ^ {\perp} A (\boldsymbol {w}) \boldsymbol {w} - \left(\lambda_ {\min } (\boldsymbol {w}) - \epsilon\right) P _ {\boldsymbol {w}} ^ {\perp} \boldsymbol {w} = P _ {\boldsymbol {w}} ^ {\perp} A (\boldsymbol {w}) \boldsymbol {w} \tag {104} +$$ + +![](images/086310e401cf8c17102b79a3cb831b1abccc4855c5478115105a1ec9f24047a0.jpg) + +Remarks. Note that Lemma 11 assumes that along the trajectory $\{\pmb{w}(t)\}, \mu_t + \nu_t \leq \gamma$ holds. In Theorem 3, this can not be assumed true until we prove that the entire trajectory is within $B_{\gamma}$ . + +# B.5 THE EFFECT OF DATA AUGMENTATION ON LOCAL OPTIMA + +While the majority of the analysis focuses on the cases where there are no data augmentation (i.e., using Corollary 1), the original formulation Lemma 2 can still handle contrastive learning in the presence of data augmentation. + +In fact, data augmentation plays an important role by removing unnecessary local optima. First, Lemma 2 tells that the objective Eqn. 5, when $K = 1$ , takes the following form: + +$$ +2 \mathcal {E} _ {\alpha} (\boldsymbol {w}) := \mathbb {C} _ {\alpha} \left[ h \left(\boldsymbol {w} ^ {\top} \boldsymbol {x}\right)\right]\rightarrow \sum_ {l} z _ {l} ^ {2} \mathbb {V} _ {\boldsymbol {x} _ {0} \sim \tilde {p} _ {l} (\cdot ; \alpha)} \left[ b (\boldsymbol {w} | \boldsymbol {x} _ {0}) \right] \tag {105} +$$ + +where $b(\boldsymbol{w}|\boldsymbol{x}_0) \coloneqq \mathbb{E}_{\boldsymbol{x} \sim p_{\mathrm{aug}}(\cdot|\boldsymbol{x}_0)}[h(\boldsymbol{w}^\top \boldsymbol{x})|\boldsymbol{x}_0]$ . + +Now let us consider the following simple data augmentation of $\pmb{x}_0$ : + +$$ +\boldsymbol {x} = R (t) \boldsymbol {x} _ {0}, \quad t \sim \operatorname {U n i f o r m} (\mathcal {T}) \tag {106} +$$ + +where $R(t) \in \mathbb{R}^{d \times d}$ is some rotation parameterized by $t$ , which is drawn uniformly from a parameter family $\mathcal{T}$ . + +We assume $\{R(t)\}_{t\in \mathcal{T}}$ forms a 1-dimensional Lie group parameterized by $\mathcal{T}$ . This means that + +- Closeness. For any $t, t' \in \mathcal{T}$ , there exists $t'' \in \mathcal{T}$ so that $R(t'') = R(t)R(t')$ . +- Existence of inverse element. For each $R(t)$ , there exists an inverse element $t' \in \mathcal{T}$ so that $R(t') = R^{-1}(t) = R^\top(t)$ . The last equality is due to the fact that $R(t)$ is a rotation. +- Existence of identity map. $R(0) = I$ . + +Then for any small transformation $R(t')$ applied to the weights $\pmb{w}$ (here "small" means $\| R(t') - I \|_2$ is small), we can write down $b(R(t')) \pmb{w} | \pmb{x}_0)$ using reparameterization trick: + +$$ +\begin{array}{l} {b (R (t) \pmb {w} | \pmb {x} _ {0})} {:=} {\mathbb {E} _ {\pmb {x} \sim p _ {\mathrm {a u g}} (\cdot | \pmb {x} _ {0})} [ h ((R (t) \pmb {w}) ^ {\top} \pmb {x}) | \pmb {x} _ {0} ] = \int h (\pmb {w} ^ {\top} R ^ {\top} (t) R (t ^ {\prime}) \pmb {x} _ {0}) \mathbb {P} [ t ^ {\prime} ] \mathrm {d} t ^ {\prime}} \\ = \int h \left(\boldsymbol {w} ^ {\top} R ^ {- 1} (t) R \left(t ^ {\prime}\right) \boldsymbol {x} _ {0}\right) \mathbb {P} \left[ t ^ {\prime} \right] \mathrm {d} t ^ {\prime} (107) \\ = \int h \left(\boldsymbol {w} ^ {\top} R \left(t ^ {\prime \prime}\right) \boldsymbol {x} _ {0}\right) \mathbb {P} \left[ t ^ {\prime \prime} \right] \mathrm {d} t ^ {\prime \prime} = b (\boldsymbol {w} | \boldsymbol {x} _ {0}) (108) \\ \end{array} +$$ + +Note that the last equality is due to the fact that $\{R(t)\}_{t\in \mathcal{T}}$ is a Lie group, so that $R^{-1}(t)R(t^{\prime})$ always maps to another group element $R(t^{\prime \prime})$ , and $t''$ as the resulting parameterization is still uniform. + +Due to stop gradient, $\alpha$ and thus $\phi_l(\cdot ;\alpha)$ is treated as a constant term when checking the local property of the current parameters $\pmb{w}$ . This means that in the local neighborhood of $\pmb{w}$ , $\mathcal{E}_{\alpha}(\pmb {w}) = \mathcal{E}_{\alpha}(R(t^{\prime})\pmb {w})$ . + +Now notice an important observation: if $\pmb{w}^{\prime} \coloneqq R(t^{\prime})\pmb{w} \neq \pmb{w}$ , then $\mathcal{E}_{\alpha}(\pmb{w}) = \mathcal{E}_{\alpha}(R(t^{\prime})\pmb{w}) = \mathcal{E}_{\alpha}(\pmb{w}^{\prime})$ and therefore, $\pmb{w}$ cannot be a local optimal. + +Intuitively, this means that the data augmentation can remove certain local optima of $\mathbf{w}$ , if they are not locally invariant (i.e., $R(t')\mathbf{w} \neq \mathbf{w}$ ) to the transformation of the data augmentation. Therefore, augmentation removes certain patterns in the input data and their local optima in the training, to only keep patterns (local optima) that are most relevant to the tasks. + +Here we only use 1-dimensional rotation group as one simple example. In practice, the augmentation may not globally form a Lie group, and there could be multiple different types of augmentations, yielding high-dimensional transformation space. Therefore, we may use Lie algebra instead to capture the local transformation structure, without making assumptions about the global structure. We will give a formal study in the future work. + +# C TWO LAYER CASE (SEC. 4) + +# C.1 LEARNING DYNAMICS + +Lemma 4 (Dynamics of 2-layer nonlinear network with contrastive loss). + +$$ +\dot {V} = V \mathbb {C} _ {\alpha} [ \boldsymbol {f} _ {1} ], \quad \dot {\boldsymbol {w}} = P _ {\boldsymbol {w}} ^ {\perp} \left[ \left(S \otimes \mathbf {1} _ {d} \mathbf {1} _ {d} ^ {\top}\right) \circ \mathbb {C} _ {\alpha} [ \tilde {\boldsymbol {x}} ] \right] \boldsymbol {w} \tag {12} +$$ + +where $\mathbf{1}_d$ is $d$ -dimensional all-one vector, $\otimes$ is Kronecker product and $\circ$ is Hadamard product. + +Proof. The output of the 2-layer network can be written as the following: + +$$ +f _ {2 l} = \sum_ {k} v _ {l k} h \left(\boldsymbol {w} _ {k} ^ {\top} \boldsymbol {x} _ {k}\right) \tag {109} +$$ + +For convenience, we use $\pmb{f}_1 \coloneqq [h(\pmb{w}_k^\top \pmb{x}_k)]$ to represent the column vector that collects all the outputs of intermediate nodes, and $\pmb{v}_l^\top$ is the $l$ -th row vector in $V$ . + +According to Theorem 1 in Tian (2022), the gradient descent direction of contrastive loss corresponds to the gradient ascent direction of the energy function $\mathcal{E}_{\alpha}(\pmb{\theta})$ . From Eqn. 25 of that theorem, we have: + +$$ +\frac {\partial \mathcal {E}}{\partial \theta} = \sum_ {l} \mathbb {C} _ {\alpha} \left[ \frac {\partial f _ {2 l}}{\partial \theta}, f _ {2 l} \right] \tag {110} +$$ + +Therefore, for $V = [v_{ik}]$ we have: + +$$ +\begin{array}{l} \dot {\boldsymbol {v}} _ {i} = \frac {\partial \mathcal {E}}{\partial \boldsymbol {v} _ {i}} = \sum_ {l} \mathbb {C} _ {\alpha} \left[ \frac {\partial f _ {2 l}}{\partial \boldsymbol {v} _ {i}}, f _ {2 l} \right] (111) \\ = \mathbb {C} _ {\alpha} \left[ \boldsymbol {f} _ {1}, \boldsymbol {v} _ {i} ^ {\top} \boldsymbol {f} _ {1} \right] (112) \\ = \mathbb {C} _ {\alpha} [ \boldsymbol {f} _ {1}, \boldsymbol {f} _ {1} ] \boldsymbol {v} _ {i} (113) \\ \end{array} +$$ + +So we have $\dot{\pmb{v}}_i = \mathbb{C}_\alpha [\pmb {f}_1]\pmb {v}_i$ , or $\dot{V} = V\mathbb{C}_{\alpha}[\pmb {f}_1]$ + +![](images/2c687d630e36af1ab77046676716d1e439eebc99ad9d2bd48b2d835a06124040.jpg) +Figure 6: Decomposition of the variance term $\mathbb{V}[\tilde{x}]$ . + +Now we compute $\partial \mathcal{E} / \partial \pmb{w}_k$ : + +$$ +\begin{array}{l} \dot {\boldsymbol {w}} _ {k} = \frac {\partial \mathcal {E}}{\partial \boldsymbol {w} _ {k}} = \sum_ {l} \mathbb {C} _ {\alpha} \left[ \frac {\partial f _ {2 l}}{\partial \boldsymbol {w} _ {k}}, f _ {2 l} \right] (114) \\ = \sum_ {l} \mathbb {C} _ {\alpha} \left[ v _ {l k} h ^ {\prime} \left(\boldsymbol {w} _ {k} ^ {\top} \boldsymbol {x} _ {k}\right) \boldsymbol {x} _ {k}, \boldsymbol {v} _ {l} ^ {\top} \boldsymbol {f} _ {1} \right] (115) \\ = \sum_ {l} v _ {l k} \mathbb {C} _ {\alpha} \left[ \tilde {\boldsymbol {x}} _ {k}, \boldsymbol {v} _ {l} ^ {\top} \boldsymbol {f} _ {1} \right] (116) \\ = \sum_ {l} v _ {l k} \mathbb {C} _ {\alpha} \left[ \tilde {\boldsymbol {x}} _ {k}, \sum_ {k ^ {\prime}} v _ {l k ^ {\prime}} h \left(\boldsymbol {w} _ {k ^ {\prime}} ^ {\top} \boldsymbol {x} _ {k ^ {\prime}}\right) \right] (117) \\ = \sum_ {k ^ {\prime}} \left(\sum_ {l} v _ {l k} v _ {l k ^ {\prime}}\right) \mathbb {C} _ {\alpha} \left[ \tilde {\boldsymbol {x}} _ {k}, \tilde {\boldsymbol {x}} _ {k ^ {\prime}} \right] \boldsymbol {w} _ {k ^ {\prime}} (118) \\ = \sum_ {k ^ {\prime}} s _ {k k ^ {\prime}} \mathbb {C} _ {\alpha} \left[ \tilde {\boldsymbol {x}} _ {k}, \tilde {\boldsymbol {x}} _ {k ^ {\prime}} \right] \boldsymbol {w} _ {k ^ {\prime}} (119) \\ \end{array} +$$ + +where $S = [s_{kk'}] = V^\top V = \sum_l \pmb{v}_l \pmb{v}_l^\top$ . Let $\pmb{w} \coloneqq [\pmb{w}_1; \dots; \pmb{w}_K]$ and it leads to the conclusion. When $M > 1$ , the proof is similar. + +# C.2 VARIANCE DECOMPOSITION + +Let $p_c \coloneqq \mathbb{P}[z = c]$ be the probability that the latent variable $z$ takes categorical value $c$ . + +Lemma 5 (Close-form of variance under Assumption 2). With Assumption 2, we have + +$$ +\mathbb {V} [ \tilde {\boldsymbol {x}} ] = \operatorname {d i a g} _ {k} \left[ L _ {k} \right] + \sum_ {c = 0} ^ {C - 1} p _ {c} \left(1 - p _ {c}\right) ^ {2} \Delta (c) \Delta^ {\top} (c) \tag {120} +$$ + +where $L_{k}\coloneqq \mathbb{E}_{z}\mathbb{V}[\tilde{\boldsymbol{x}}_{k}|z]\in \mathbb{R}^{Md}$ and $\Delta (c)\coloneqq \mathbb{E}[\tilde{\boldsymbol{x}} |z = c] - \mathbb{E}[\tilde{\boldsymbol{x}} |z\neq c]\in \mathbb{R}^{MKd}$ . In particular when $C = 2$ , the second term becomes $p_0p_1\Delta \Delta^\top$ , a rank-1 matrix. Here $\Delta \coloneqq \Delta (0)$ for brevity. + +Proof. Use variance decomposition, we have: + +$$ +\mathbb {V} [ \tilde {\boldsymbol {x}} ] = \mathbb {E} _ {z} \mathbb {V} [ \tilde {\boldsymbol {x}} | z ] + \mathbb {V} _ {z} \mathbb {E} [ \tilde {\boldsymbol {x}} | z ] \tag {121} +$$ + +Remember that $\tilde{\pmb{x}}_{km}$ is an abbreviation of gated input: + +$$ +\tilde {\boldsymbol {x}} _ {k m} := \tilde {\boldsymbol {x}} _ {k} ^ {\boldsymbol {w} _ {k m}} := \boldsymbol {x} _ {k} \cdot h ^ {\prime} \left(\boldsymbol {w} _ {k m} ^ {\top} \boldsymbol {x} _ {k}\right) \tag {122} +$$ + +By conditional independence, we have + +$$ +\operatorname {C o v} \left[ \tilde {\boldsymbol {x}} _ {k m}, \tilde {\boldsymbol {x}} _ {k ^ {\prime} m ^ {\prime}} | z \right] = 0 \quad \forall k \neq k ^ {\prime} \tag {123} +$$ + +This is because $\tilde{\pmb{x}}_{km}$ and $\tilde{\pmb{x}}_{k'm'}$ are deterministic functions of $\pmb{x}_k$ and $\pmb{x}_{k'}$ and thus are also independent of each other. + +Let + +$$ +\tilde {\boldsymbol {x}} _ {k} := \left[ \begin{array}{c} \tilde {\boldsymbol {x}} _ {k 1} \\ \tilde {\boldsymbol {x}} _ {k 2} \\ \dots \\ \tilde {\boldsymbol {x}} _ {k M} \end{array} \right] \in \mathbb {R} ^ {M d} \tag {124} +$$ + +and $L_{k}\coloneqq \mathbb{E}_{z}\mathbb{V}[\tilde{\boldsymbol{x}}_{k}|z]$ . Then we know that $\mathbb{E}_z\mathbb{V}[\tilde{\boldsymbol{x}} |z] = \mathrm{diag}_k[L_k]$ is a block diagonal matrix (See Fig. 6). + +On the other hand, $\mathbb{V}_z\mathbb{E}[\tilde{\pmb{x}} |z]$ is a low-rank matrix: + +$$ +\mathbb {V} _ {z} \mathbb {E} [ \tilde {\boldsymbol {x}} | z ] = \mathbb {E} _ {z} \left[ (\mathbb {E} [ \tilde {\boldsymbol {x}} | z ] - \mathbb {E} [ \tilde {\boldsymbol {x}} ]) (\mathbb {E} [ \tilde {\boldsymbol {x}} | z ] - \mathbb {E} [ \tilde {\boldsymbol {x}} ]) ^ {\top} \right] \tag {125} +$$ + +Let $\pmb{q}_c \coloneqq \mathbb{E}[\tilde{\pmb{x}} | z = c]$ and $\pmb{q}_{-c} \coloneqq \mathbb{E}[\tilde{\pmb{x}} | z \neq c]$ , then we have: + +$$ +\begin{array}{l} \mathbb {E} [ \tilde {\boldsymbol {x}} | z = c ] - \mathbb {E} [ \tilde {\boldsymbol {x}} ] = \boldsymbol {q} _ {c} - \sum_ {c} p _ {c} \boldsymbol {q} _ {c} = (1 - p _ {c}) \left(\boldsymbol {q} _ {c} - \sum_ {c ^ {\prime} \neq c} \frac {p _ {c ^ {\prime}}}{1 - p _ {c}} \boldsymbol {q} _ {c ^ {\prime}}\right) (126) \\ = \left(1 - p _ {c}\right) \left(\boldsymbol {q} _ {c} - \sum_ {c ^ {\prime} \neq c} \mathbb {P} [ z = c ^ {\prime} | z \neq c ] \boldsymbol {q} _ {c ^ {\prime}}\right) (127) \\ = \left(1 - p _ {c}\right) \left(\boldsymbol {q} _ {c} - \boldsymbol {q} _ {- c}\right) (128) \\ \end{array} +$$ + +Therefore, we have: + +$$ +\begin{array}{l} \mathbb {V} _ {z} \mathbb {E} [ \tilde {\boldsymbol {x}} | z ] = \mathbb {E} _ {z} \left[ (\mathbb {E} [ \tilde {\boldsymbol {x}} | z ] - \mathbb {E} [ \tilde {\boldsymbol {x}} ]) (\mathbb {E} [ \tilde {\boldsymbol {x}} | z ] - \mathbb {E} [ \tilde {\boldsymbol {x}} ]) ^ {\top} \right] (129) \\ = \sum_ {c} p _ {c} \left(1 - p _ {c}\right) ^ {2} \left(\boldsymbol {q} _ {c} - \boldsymbol {q} _ {- c}\right) \left(\boldsymbol {q} _ {c} - \boldsymbol {q} _ {- c}\right) ^ {\top} (130) \\ = \sum_ {c} p _ {c} \left(1 - p _ {c}\right) ^ {2} \Delta (c) \Delta^ {\top} (c) (131) \\ \end{array} +$$ + +where + +$$ +\Delta (c) := \Delta (c; W) := \boldsymbol {q} _ {c} - \boldsymbol {q} _ {- c} = \left[ \begin{array}{c} \Delta_ {1 1} (c) \\ \dots \\ \Delta_ {K M} (c) \end{array} \right] \in \mathbb {R} ^ {K M d} \tag {132} +$$ + +and + +$$ +\Delta_ {k m} (c) := \Delta_ {k m} (c; \boldsymbol {w} _ {k m}) := \mathbb {E} [ \tilde {\boldsymbol {x}} _ {k m} | z = c ] - \mathbb {E} [ \tilde {\boldsymbol {x}} _ {k m} | z \neq c ] \tag {133} +$$ + +We can see that $\mathbb{V}_z\mathbb{E}[\tilde{\pmb{x}} |z]$ is at most rank- $C$ , since it is a summation of $C$ rank-1 matrix. + +In particular, when $C = 2$ , it is clear that $\Delta(0) = -\Delta(1)$ and thus $\Delta(0)\Delta^{\top}(0) = \Delta(1)\Delta^{\top}(1)$ and $\sum_{c}p_{c}(1 - p_{c})^{2} = p_{0}p_{1}^{2} + p_{1}p_{0}^{2} = p_{0}p_{1}$ . Hence the conclusion. + +# C.3 GLOBAL MODULATION WHEN $C = 2$ AND $M = 1$ + +Theorem 5 (Dynamics of $\pmb{w}_k$ under conditional independence). When $C = 2$ and $M = 1$ , the dynamics of $\pmb{w}_k$ is given by ( $s_k^2$ and $\delta_k \geq 0$ are scalars defined in the proof): + +$$ +\dot {\boldsymbol {w}} _ {k} = P _ {\boldsymbol {w} _ {k}} ^ {\perp} \left(s _ {k} ^ {2} A _ {k} \left(\boldsymbol {w} _ {k}\right) + \delta_ {k} \Delta_ {k} \Delta_ {k} ^ {\top}\right) \boldsymbol {w} _ {k} \tag {15} +$$ + +Proof. Since $M = 1$ , each receptive field (RF) $R_{k}$ only output a single node with output $f_{k}$ . Let: + +$$ +L _ {k} := \mathbb {E} _ {z} \mathbb {V} [ \tilde {\boldsymbol {x}} _ {k} | z ] \tag {134} +$$ + +$$ +d _ {k} := \boldsymbol {w} _ {k} ^ {\top} L _ {k} \boldsymbol {w} _ {k} = \mathbb {E} _ {z} \mathbb {V} [ f _ {k} | z ] \geq 0 \tag {135} +$$ + +$$ +D := \operatorname {d i a g} _ {k} [ d _ {k} ] \tag {136} +$$ + +$$ +\boldsymbol {b} := \left[ b _ {k} \right] := \left[ \boldsymbol {w} _ {k} ^ {\top} \Delta_ {k} \right] \in \mathbb {R} ^ {K} \tag {137} +$$ + +and $\lambda$ be the maximal eigenvalue of $\mathbb{V}[f_1]$ . Here $L_{k}$ is a PSD matrix and $D$ is a diagonal matrix. Then + +$$ +\mathbb {V} [ \boldsymbol {f} _ {1} ] = D + p _ {0} p _ {1} \boldsymbol {b b} ^ {\top} \tag {138} +$$ + +is a diagonal matrix plus a rank-1 matrix. Since $p_0p_1\mathbf{b}\mathbf{b}^\top$ is always PSD, $\lambda = \lambda_{\max}(\mathbb{V}[\mathbf{f}_1]) \geq \lambda_{\max}(D) = \max_k d_k$ . Then using Bunch-Nielsen-Sorensen formula (Bunch et al., 1978), for largest eigenvector $s$ , we have: + +$$ +s _ {k} = \frac {1}{Z} \frac {b _ {k}}{d _ {k} - \lambda} \tag {139} +$$ + +where $\lambda$ is the corresponding largest eigenvalue satisfying $1 + p_0p_1\sum_k\frac{b_k^2}{d_k - \lambda} = 0$ , and $Z = \sqrt{\sum_{k}\left(\frac{b_k}{d_k - \lambda}\right)^2}$ . Note that the above is well-defined, since if $k^{*} = \arg \max_{k}d_{k}$ and $b_{k^*}\neq 0$ , then $\lambda >\max_{k}d_{k} = d_{k^{*}}$ . So $b_{k} / (d_{k} - \lambda)$ won't be infinite. + +So we have: + +$$ +\begin{array}{l} \dot {\boldsymbol {w}} _ {k} = \sum_ {k ^ {\prime}} s _ {k} s _ {k ^ {\prime}} \mathbb {C} _ {\alpha} \left[ \tilde {\boldsymbol {x}} _ {k}, \tilde {\boldsymbol {x}} _ {k ^ {\prime}} \right] \boldsymbol {w} _ {k ^ {\prime}} (140) \\ = \sum_ {k ^ {\prime}} s _ {k} s _ {k ^ {\prime}} (L _ {k} \mathbb {I} (k = k ^ {\prime}) + p _ {0} p _ {1} \Delta_ {k} \Delta_ {k ^ {\prime}} ^ {\top}) \boldsymbol {w} _ {k ^ {\prime}} \\ = s _ {k} ^ {2} \mathbb {V} \left[ \tilde {\boldsymbol {x}} _ {k} \right] \boldsymbol {w} _ {k} + p _ {0} p _ {1} s _ {k} \Delta_ {k} \sum_ {k ^ {\prime} \neq k} s _ {k ^ {\prime}} \Delta_ {k ^ {\prime}} ^ {\top} \boldsymbol {w} _ {k ^ {\prime}} (141) \\ { = } { s _ { k } ^ { 2 } \mathbb { V } [ \tilde { \boldsymbol { x } } _ { k } ] \boldsymbol { w } _ { k } + \frac { p _ { 0 } p _ { 1 } b _ { k } } { Z ^ { 2 } ( d _ { k } - \lambda ) } \Delta _ { k } \sum _ { k ^ { \prime } \neq k } \frac { b _ { k ^ { \prime } } ^ { 2 } } { d _ { k ^ { \prime } } - \lambda } } \\ = s _ {k} ^ {2} \mathbb {V} [ \tilde {\boldsymbol {x}} _ {k} ] \boldsymbol {w} _ {k} + \delta_ {k} \Delta_ {k} \Delta_ {k} ^ {\top} \boldsymbol {w} _ {k} \\ = \left(s _ {k} ^ {2} \mathbb {V} \left[ \tilde {\boldsymbol {x}} _ {k} \right] + \delta_ {k} \Delta_ {k} \Delta_ {k} ^ {\top}\right) \boldsymbol {w} _ {k} (142) \\ \end{array} +$$ + +where + +$$ +\delta_ {k} := \frac {p _ {0} p _ {1}}{Z ^ {2} (\lambda - d _ {k})} \sum_ {k ^ {\prime} \neq k} \frac {b _ {k ^ {\prime}} ^ {2}}{\lambda - d _ {k ^ {\prime}}} \tag {143} +$$ + +Since $\lambda \geq \max_k d_k$ , we have $\delta_k \geq 0$ and thus the modulation term is non-negative. Note that since $p_0 p_1 \sum_k \frac{b_k^2}{\lambda - d_k} = 1$ , we can also write $\delta_k = 1 - \frac{p_0 p_1 b_k^2}{\lambda - d_k}$ . + +Theorem 6 (Global modulation of attractive basin). If the structural assumption holds: $A_{k}(\boldsymbol{w}_{k}) = \sum_{l} g(\boldsymbol{u}_{l}^{\top}\boldsymbol{w}_{k})\boldsymbol{u}_{l}\boldsymbol{u}_{l}^{\top}$ with $g(\cdot) > 0$ a linear increasing function and $\{\boldsymbol{u}_l\}$ orthonormal bases, then for $A_{k} + c\boldsymbol{u}_{l}\boldsymbol{u}_{l}^{\top}$ , its attractive basin of $\boldsymbol{w}_{k} = \boldsymbol{u}_{l}$ is larger than $A_{k}$ 's for $c > 0$ . + +Proof. Since $A_{k}(\boldsymbol{w}) = \sum_{l} g(\boldsymbol{u}_{l}^{\top}\boldsymbol{w})\boldsymbol{u}_{l}\boldsymbol{u}_{l}^{\top}$ , we could write down its dynamics (we omit the projection $P_{\boldsymbol{w}}^{\perp}$ for now): + +$$ +\dot {\boldsymbol {w}} = A _ {k} (\boldsymbol {w}) \boldsymbol {w} = \sum_ {l} g \left(\boldsymbol {u} _ {l} ^ {\top} \boldsymbol {w}\right) \boldsymbol {u} _ {l} \boldsymbol {u} _ {l} ^ {\top} \boldsymbol {w} \tag {144} +$$ + +Let $y_{l}(t) \coloneqq \pmb{u}_{l}^{\top}\pmb{w}(t)$ , i.e., $y_{l}(t)$ is the projected component of the weight $\pmb{w}(t)$ onto the $l$ -th direction, i.e., a change of bases to orthonormal bases $\{\pmb{u}_l\}$ , then the dynamics above can be written as + +$$ +\dot {y} _ {l} = g \left(y _ {l}\right) y _ {l} \tag {145} +$$ + +which is the same for all $l$ , so we just need to study $\dot{x} = g(x)x$ . $g(x) > 0$ is a linear increasing function, so we can assume $g(x) = ax + b$ with $a > 0$ . Without loss of generality, we could just set $a = 1$ . + +Then we just want to analyze the dynamics: + +$$ +\dot {y} _ {l} = \left(y _ {l} + b _ {l}\right) y _ {l}, \quad b _ {l} > 0 \tag {146} +$$ + +which also includes the case of $A_{k} + c\pmb{u}_{l}\pmb{u}_{l}^{\top}$ , that basically sets $b_{l} = b + c$ . Solving the dynamics leads to the following close-form solution: + +$$ +\frac {y _ {l} (t)}{y _ {l} (t) + b _ {l}} = \frac {y _ {l} (0)}{y _ {l} (0) + b _ {l}} e ^ {b _ {l} t} \tag {147} +$$ + +![](images/5bdc623d82db0d5d5a177a4262c4f2dee68e04ee7fa8e5dc19a70d371461cf63.jpg) +Figure 7: The one-dimensional dynamics (Eqn. 146) ( $b_{l} > 0$ ). There exists a stable critical point $y_{l} = -b_{l}$ and one unstable critical point $y_{l} = 0$ . When $y_{l}(0) > 0$ , the dynamics blows up in finite time $t_{l}^{*} = \frac{1}{b_{l}} \ln \left(1 + \frac{b_{l}}{y_{l}(0)}\right)$ . + +The 1-d dynamics has an unstable fixed points $y_{l} = 0$ and a stable one $y_{l} = -b_{l} < 0$ . Therefore, when the initial condition $y_{l}(0) < 0$ , the dynamics will converge to $y_{l}(+\infty) = -b_{l}$ , which is a finite number. On the other hand, when $y_{l}(0) > 0$ , the dynamics has finite-time blow-up Thompson et al. (1990); Goriely & Hyde (1998), i.e., there exists a critical time $t_{l}^{*} < +\infty$ so that $y_{l}(t_{l}^{*}) = +\infty$ . See Fig. 7. + +Note that this finite time blow-up is not physical, since we don't take into consideration of normalization $Z(t)$ , which depends on all $y_{l}(t)$ . The real quality to be considered is $\hat{y}_l(t) = \frac{1}{Z(t)} y_l(t)$ . Fortunately, we don't need to estimate $Z(t)$ since we are only interested in the ratio: + +$$ +r _ {l / l ^ {\prime}} (t) := \frac {\hat {y} _ {l} (t)}{\hat {y} _ {l ^ {\prime}} (t)} = \frac {y _ {l} (t)}{y _ {l ^ {\prime}} (t)} \tag {148} +$$ + +If for some $l$ and any $l' \neq l$ , $r_{l / l'}(t) \to \infty$ , then $y_l(t)$ dominates and $\hat{y}_l(t) \to 1$ , i.e., the dynamics converges to $\pmb{u}_l$ . + +Now our task is to know which initial condition of $y_{l}$ and $b_{l}$ makes $r_{l / l^{\prime}}(t)\rightarrow +\infty$ . By comparing the critical time we know which component $l$ shoots up the earliest and that $t^{*} = \arg \min_{l}t_{l}^{*}$ is the winner, without computing the normalization constant $Z(t)$ . + +The critical time satisfies + +$$ +\frac {y _ {l} (0)}{y _ {l} (0) + b _ {l}} e ^ {b _ {l} t _ {l} ^ {*}} = 1 \tag {149} +$$ + +so + +$$ +t _ {l} ^ {*} = \frac {1}{b _ {l}} \ln \left(1 + \frac {b _ {l}}{y _ {l} (0)}\right) \tag {150} +$$ + +It is clear that when $y_{l}(0)$ is larger, the critical time $t_{l}^{*}$ becomes smaller and the $l$ -th component becomes more advantageous over other components. + +For $b_{l} > 0$ , we have: + +$$ +\frac {\partial t _ {l} ^ {*}}{\partial b _ {l}} = \frac {1}{b _ {l} ^ {2}} \left[ \frac {b _ {l} / y _ {l} (0)}{1 + b _ {l} / y _ {l} (0)} - \ln \left(1 + b _ {l} / y _ {l} (0)\right) \right] < 0 \tag {151} +$$ + +where the last inequality is due to the fact that $\frac{x}{1 + x} < \ln(1 + x)$ for $x > 0$ . Therefore, larger $b_{l}$ leads to smaller $t_{l}^{*}$ . Since adding $c\mathbf{u}_{l}\mathbf{u}_{l}^{\top}$ with $c > 0$ to $A_{k}$ increase $b_{l}$ , it leads to smaller $t_{l}^{*}$ and thus increases the advantage of the $l$ -th component. + +Therefore, larger $b_{l}$ and larger $y_{l}(0)$ both leads to smaller $t_{l}^{*}$ . For the same $t_{l}^{*}$ , larger $b_{l}$ can trade for smaller $y_{l}(0)$ , i.e., larger attractive basin. + +Remark. Special case. We start by assuming only one $\epsilon_l \neq 0$ and all other $\epsilon_{l'} = 0$ for $l' \neq l$ , and then we generalize to the case when all $\{\epsilon_l\}$ are real numbers. + +To quantify the probability that a random weight initialization leads to convergence of $\boldsymbol{u}_l$ , we setup some notations. Let the event $E_l$ be "a random weight initialization of $\boldsymbol{y}$ leads to $\boldsymbol{y} \rightarrow \boldsymbol{e}_l$ ", or equivalently $\boldsymbol{w} \rightarrow \boldsymbol{u}_l$ . Let $Y_l$ be the random variable that instantiates the initial value of $y_l(0)$ due to random weight initialization. Then the convergence event $E_l$ is equivalent to the following: (1) $Y_l > 0$ (so that the $l$ -component has the opportunity to grow), and (2) $Y_l + \epsilon_l$ is the maximum over all $Y_{l'}$ for any $l' \neq l$ , where $\epsilon_l$ is an advantage ( $> 0$ ) or disadvantage ( $< 0$ ) achieved by having larger/smaller $b_l$ due to global modulation (e.g., $c$ ). Therefore, we also call $\epsilon_l$ the modulation factor. + +Here we discuss about a simple case that $Y_{l} \sim U[-1, 1]$ and for $l' \neq l$ , $Y_{l}$ and $Y_{l'}$ are independent. In this case, for a given $l$ , $\max_{l' \neq l} Y_{l'}$ is a random variable that is independent of $Y_{l}$ , and has cumulative density function (CDF) $F_{\max}(x) \coloneqq \mathbb{P}[\max_{l' \neq l} Y_{l'} \leq x] = F^{d-1}(x)$ , where $F(x)$ is the CDF for $Y_{l}$ . + +Then we have: + +$$ +\begin{array}{l} \mathbb {P} \left[ E _ {l} \right] = \mathbb {P} \left[ Y _ {l} > 0, Y _ {l} + \epsilon_ {l} \geq \max _ {l ^ {\prime} \neq l} Y _ {l ^ {\prime}} \right] (152) \\ = \int_ {0} ^ {+ \infty} \mathbb {P} \left[ \max _ {l ^ {\prime} \neq l} Y _ {l ^ {\prime}} \leq Y _ {l} + \epsilon_ {l} \mid Y _ {l} = y _ {l} \right] \mathbb {P} [ Y _ {l} = y _ {l} ] \mathrm {d} y _ {l} (153) \\ = \int_ {0} ^ {+ \infty} F ^ {d - 1} \left(y _ {l} + \epsilon_ {l}\right) \mathrm {d} F \left(y _ {l}\right) (154) \\ \end{array} +$$ + +When $Y_{l}\sim U[-1,1]$ $F(x) = \min \left\{\frac{1}{2} (x + 1),1\right\}$ has a close form and we can compute the integral: + +$$ +\mathbb {P} \left[ E _ {l} \right] = \mathbb {P} \left[ Y _ {l} > 0, Y _ {l} + \epsilon_ {l} \geq \max _ {l ^ {\prime} \neq l} Y _ {l ^ {\prime}} \right] = \left\{ \begin{array}{c c} \frac {1}{2} & \epsilon_ {l} > 1 \\ \frac {1}{d} \left[ 1 - \left(\frac {1 + \epsilon_ {l}}{2}\right) ^ {d} \right] + \frac {\epsilon_ {l}}{2} & 0 \leq \epsilon_ {l} \leq 1 \\ \frac {1}{d} \left[ (1 + \frac {\epsilon_ {l}}{2}) ^ {d} - (\frac {1 + \epsilon_ {l}}{2}) ^ {d} \right] & - 1 < \epsilon_ {l} < 0 \end{array} \right. \tag {155} +$$ + +We can see that the modulation factor $\epsilon_{l}$ plays an important role in deciding the probability that $\pmb{w} \rightarrow \pmb{u}_{l}$ : + +- No modulation. If $\epsilon_l = 0$ , then $\mathbb{P}[E_l] \sim \frac{1}{d}$ . This means that each dimension of $\pmb{y}$ has equal probability to be the dominant component after training; +- Positive modulation. If $\epsilon_l > 0$ , then $\mathbb{P}[E_l] \geq \frac{\epsilon_l}{2}$ , and that particular $l$ -th component has much higher probability to become the dominant component, independent of the dimensionality $d$ . Furthermore, the stronger the modulation, the higher the probability becomes. +- Negative modulation. Finally, if $\epsilon_{l} < 0$ , since $1 + \epsilon_{l} / 2 < 1$ , $\mathbb{P}[E_l] \leq \frac{1}{d} (1 + \frac{\epsilon_l}{2})^d$ decays exponentially w.r.t the dimensionality $d$ . + +General case. We then analyze cases if all $\epsilon_{l}$ are real numbers. Let $l^{*} = \arg \max_{l}\epsilon_{l}$ and $c(k)$ be the $k$ -th index of $\epsilon_{l}$ in descending order, i.e., $c(1) = l^{*}$ . + +- For $l = c(1) = l^{*}$ , $\epsilon_{l}$ is the largest over $\{\epsilon_{l}\}$ . Since + +$$ +\begin{array}{l} \mathbb {P} [ E _ {l} ] = \mathbb {P} \left[ Y _ {l} \geq 0, Y _ {l} + \epsilon_ {l} \geq \max _ {l ^ {\prime} \neq l} Y _ {l ^ {\prime}} + \epsilon_ {l ^ {\prime}} \right] \\ \geq \mathbb {P} \left[ Y _ {l} \geq 0, Y _ {l} + \epsilon_ {c (1)} - \epsilon_ {c (2)} \geq \max _ {l ^ {\prime} \neq l} Y _ {l ^ {\prime}} \right] \\ \end{array} +$$ + +where $\epsilon_{c(1)} - \epsilon_{c(2)}$ is the gap between the largest $\epsilon_l$ and second largest $\epsilon_l$ . Then this case is similar to positive modulation and thus + +$$ +\mathbb {P} \left[ E _ {c (1)} \right] \geq \frac {1}{2} \left(\epsilon_ {c (1)} - \epsilon_ {c (2)}\right) \tag {156} +$$ + +- For $l$ with rank $r$ (i.e., $c(r) = l$ ), and any $r' < r$ , we have: + +$$ +\begin{array}{l} \mathbb {P} [ E _ {l} ] = \mathbb {P} \left[ Y _ {l} \geq 0, Y _ {l} + \epsilon_ {l} \geq \max _ {l ^ {\prime} \neq l} Y _ {l ^ {\prime}} + \epsilon_ {l ^ {\prime}} \right] \\ \leq \mathbb {P} \left[ Y _ {l} \geq 0, Y _ {l} + \epsilon_ {l} \geq \max _ {l ^ {\prime}: c ^ {- 1} \left(l ^ {\prime}\right) \leq r ^ {\prime}} Y _ {l ^ {\prime}} + \epsilon_ {l ^ {\prime}} \right] \\ = \mathbb {P} \left[ Y _ {l} \geq 0, Y _ {l} + \epsilon_ {l} - \epsilon_ {c (r ^ {\prime})} \geq \max _ {l ^ {\prime}: c ^ {- 1} (l ^ {\prime}) \leq r ^ {\prime}} Y _ {l ^ {\prime}} + \epsilon_ {l ^ {\prime}} - \epsilon_ {c (r ^ {\prime})} \right] \\ \leq \mathbb {P} \left[ Y _ {l} \geq 0, Y _ {l} + \epsilon_ {l} - \epsilon_ {c (r ^ {\prime})} \geq \max _ {l ^ {\prime}: c ^ {- 1} (l ^ {\prime}) \leq r ^ {\prime}} Y _ {l ^ {\prime}} \right] \\ \end{array} +$$ + +Then it reduces to the case of negative modulation. Therefore, we have: + +$$ +\mathbb {P} \left[ E _ {c (r)} \right] \leq \min _ {r ^ {\prime} < r} \frac {1}{r ^ {\prime} + 1} \left(1 - \frac {\epsilon_ {c \left(r ^ {\prime}\right)} - \epsilon_ {c (r)}}{2}\right) ^ {r ^ {\prime} + 1} \tag {157} +$$ + +and the probability is exponentially small if $r$ is large, i.e., $\epsilon_{l}$ ranks low. + +# C.4 FUNDAMENTAL LIMITATION OF LINEAR MODELS + +Theorem 4 (Gradient Colinearity in linear networks). With linear activation, $W$ follows the dynamics: + +$$ +\dot {\boldsymbol {w}} _ {k m} = s _ {k m} \boldsymbol {b} _ {k} (W, V) \tag {14} +$$ + +where $\pmb{b}_k(W,V) := \mathbb{C}_{\alpha}\left[\pmb{x}_k,\sum_{k',m'}s_{k'm'}\pmb{w}_{k'm'}^\top\pmb{x}_{k'}\right]$ is a linear function w.r.t. $W$ . As a result, (1) $\dot{\pmb{w}}_{km}$ are co-linear over $m$ , and (2) If $s_{km} \neq 0$ , from any critical point with distinct $\{\pmb{w}_{km}\}$ , there exists a path of critical points to identical weights ( $\pmb{w}_{km} = \pmb{w}_k$ ). + +Proof. In the linear case, we have $\tilde{\pmb{x}}_{km} = \pmb{x}_k$ since there is no gating and all $M$ shares the same input $\pmb{x}_k$ . Therefore, we can write down the dynamics of $\pmb{w}_{km}$ as the following: + +$$ +\begin{array}{l} \dot {\boldsymbol {w}} _ {k m} = \sum_ {k ^ {\prime}, m ^ {\prime}} s _ {k m, k ^ {\prime} m ^ {\prime}} \mathbb {C} _ {\alpha} \left[ \tilde {\boldsymbol {x}} _ {k m}, \tilde {\boldsymbol {x}} _ {k ^ {\prime} m ^ {\prime}} \right] \boldsymbol {w} _ {k ^ {\prime} m ^ {\prime}} (158) \\ = \sum_ {k ^ {\prime}, m ^ {\prime}} s _ {k m, k ^ {\prime} m ^ {\prime}} \mathbb {C} _ {\alpha} \left[ \boldsymbol {x} _ {k}, \boldsymbol {x} _ {k ^ {\prime}} \right] \boldsymbol {w} _ {k ^ {\prime} m ^ {\prime}} (159) \\ \end{array} +$$ + +Now we use the fact that the top-level learns fast so that $s_{km,k'm'} = s_{km}s_{k'm'}$ , which gives: + +$$ +\begin{array}{l} \dot {\boldsymbol {w}} _ {k m} = s _ {k m} \sum_ {k ^ {\prime}, m ^ {\prime}} s _ {k ^ {\prime} m ^ {\prime}} \mathbb {C} _ {\alpha} \left[ \boldsymbol {x} _ {k}, \boldsymbol {x} _ {k ^ {\prime}} \right] \boldsymbol {w} _ {k ^ {\prime} m ^ {\prime}} (160) \\ = s _ {k m} \mathbb {C} _ {\alpha} \left[ \boldsymbol {x} _ {k}, \sum_ {k ^ {\prime}, m ^ {\prime}} s _ {k ^ {\prime} m ^ {\prime}} \boldsymbol {w} _ {k ^ {\prime} m ^ {\prime}} ^ {\top} \boldsymbol {x} _ {k ^ {\prime}} \right] (161) \\ \end{array} +$$ + +Let $\pmb{b}_k(W,V) \coloneqq \mathbb{C}_{\alpha}\left[\pmb{x}_k, \sum_{k',m'} s_{k'm'} \pmb{w}_{k'm'}^\top \pmb{x}_{k'}\right]$ be a linear function of $W$ , and we have: + +$$ +\dot {\boldsymbol {w}} _ {k m} = s _ {k m} \boldsymbol {b} _ {k} (W, V) \tag {162} +$$ + +Since $\pmb{b}_k$ is independent of $m$ , all $\dot{\pmb{w}}_{km}$ are co-linear. + +For the second part, first all if $W^{*}$ is a critical point, we have the following two facts: + +- Since there exists $m$ so that $s_{km} \neq 0$ , we know that $\pmb{b}_k(W^*) = 0$ ; +- If $W^{*}$ contains two distinct filters $\boldsymbol{w}_{k1} = \boldsymbol{\mu}_1 \neq \boldsymbol{w}_{k2} = \boldsymbol{\mu}_2$ covering the same receptive field $R_{k}$ , then by symmetry of the weights, $W^{\prime *}$ in which $\boldsymbol{w}_{k1} = \boldsymbol{\mu}_2$ and $\boldsymbol{w}_{k2} = \boldsymbol{\mu}_1$ , is also a critical point. + +Then for any $c \in [0,1]$ , since $\pmb{b}_k(W)$ is linear w.r.t. $W$ , for the linear combination $W^c \coloneqq cW^* + (1 - c)W'^*$ , we have: + +$$ +\boldsymbol {b} _ {k} \left(W ^ {c}\right) = \boldsymbol {b} _ {k} \left(c W ^ {*} + (1 - c) W ^ {\prime *}\right) = c \boldsymbol {b} _ {k} \left(W ^ {*}\right) + (1 - c) \boldsymbol {b} _ {k} \left(W ^ {\prime *}\right) = 0 \tag {163} +$$ + +Therefore, $W^{c}$ is also a critical point, in which $\pmb{w}_{k1} = c\pmb{\mu}_1 + (1 - c)\pmb{\mu}_2$ and $\pmb{w}_{k2} = (1 - c)\pmb{\mu}_1 + c\pmb{\mu}_2$ . In particular when $c = 1/2$ , $\pmb{w}_{k1} = \pmb{w}_{k2}$ . Repeating this process for different $m$ , we could finally reach a critical point in which all $\pmb{w}_{km} = \pmb{w}_k$ . + +# D ANALYSIS OF BATCH NORMALIZATION + +From the previous analysis of global modulation, it is clear that the weight updating can be much slower for RF with small $d_{k}$ , due to the factor $\frac{1}{\lambda - d_k}$ in both $s_k^2$ (Eqn. 139) and $\beta_{k}$ (Eqn. 143) and the fact that $\lambda \geq \max_{k}d_{k}$ . This happens when the variance of each receptive fields varies a lot (i.e., some $d_{k}$ are large while others are small). In this case, adding BatchNorm at each node alleviates this issue, as shown below. + +We consider BatchNorm right after $\pmb{f}$ : $f_{k}^{\mathrm{bn}}[i] = (f_{k}[i] - \mu_{k}) / \sigma_{k}$ , where $\mu_{k}$ and $\sigma_{k}$ are the batch statistics computed from BatchNorm on all $2N$ samples in a batch: + +$$ +\mu_ {k} := \frac {1}{2 N} \sum_ {i} f _ {k} [ i ] + f _ {k} \left[ i ^ {\prime} \right] \tag {164} +$$ + +$$ +\sigma_ {k} ^ {2} := \frac {1}{2 N} \sum_ {i} \left(f _ {k} [ i ] - \mu_ {k}\right) ^ {2} + \left(f _ {k} \left[ i ^ {\prime} \right] - \mu_ {k}\right) ^ {2} \tag {165} +$$ + +When $N\to +\infty$ , we have $\mu_k\rightarrow \mathbb{E}[f_k]$ and $\sigma_k^2\to \mathbb{V}[f_k] = \pmb {w}_k^\top \mathbb{V}[\tilde{\pmb{x}}_k]\pmb {w}_k$ + +Let $\tilde{\pmb{x}}_k^{\mathrm{bn}}\coloneqq \sigma_k^{-1}\tilde{\pmb{x}}_k$ and $\tilde{\pmb{x}}^{\mathrm{bn}}\coloneqq \left[ \begin{array}{l}\tilde{\pmb{x}}_{1}^{\mathrm{bn}}\\ \tilde{\pmb{x}}_{2}^{\mathrm{bn}}\\ \dots \\ \tilde{\pmb{x}}_{K}^{\mathrm{bn}} \end{array} \right]$ . When computing gradient through BatchNorm layer, we consider the following variant: + +Definition 5 (mean-backprop BatchNorm). When computing backpropagated gradient through BatchNorm, we only backprop through $\mu_{k}$ + +This leads to a model dynamics that has a very similar form as Lemma 4: + +Lemma 6 (Dynamics with mean-backprop BatchNorm). With mean-backprop BatchNorm (Def. 5), the dynamics is: + +$$ +\dot {V} = V \mathbb {C} _ {\alpha} [ \boldsymbol {f} _ {1} ^ {\mathrm {b n}} ], \quad \dot {\boldsymbol {w}} = \left[ \left(S \otimes \mathbf {1} _ {d} \mathbf {1} _ {d} ^ {\top}\right) \circ \mathbb {C} _ {\alpha} [ \tilde {\boldsymbol {x}} ^ {\mathrm {b n}} ] \right] \boldsymbol {w} \tag {166} +$$ + +Proof. The proof is similar to Lemma 4. For $\dot{V}$ it is the same by replacing $f_{1}$ with $f_{1}^{\mathrm{bn}}$ , which is the input to the top layer. + +For $\dot{w}$ , similarly we have: + +$$ +\begin{array}{l} \dot {\boldsymbol {w}} _ {k} = \frac {\partial \mathcal {E}}{\partial \boldsymbol {w} _ {k}} = \sum_ {l} \mathbb {C} _ {\alpha} \left[ \frac {\partial f _ {2 l}}{\partial \boldsymbol {w} _ {k}}, f _ {2 l} \right] (167) \\ = \sum_ {l} \mathbb {C} _ {\alpha} \left[ v _ {l k} \frac {\partial f _ {1 k} ^ {\mathrm {b n}}}{\partial \boldsymbol {w} _ {k}}, \sum_ {k ^ {\prime}} v _ {l k ^ {\prime}} f _ {1 k ^ {\prime}} ^ {\mathrm {b n}} \right] (168) \\ = \sum_ {l} \mathbb {C} _ {\alpha} \left[ v _ {l k} \frac {\partial f _ {1 k} ^ {\mathrm {b n}}}{\partial \boldsymbol {w} _ {k}}, \sum_ {k ^ {\prime}} v _ {l k ^ {\prime}} \left(f _ {1 k ^ {\prime}} - \mu_ {k ^ {\prime}}\right) \sigma_ {k ^ {\prime}} ^ {- 1} \right] (169) \\ \end{array} +$$ + +Note that $\mathbb{C}_{\alpha}[\cdot ,\mu_{k^{\prime}}\sigma_{k^{\prime}}^{-1}] = 0$ since $\mu_{k^{\prime}}$ and $\sigma_{k^{\prime}}$ are statistics of the batch and is constant. On the other hand, for $\partial f_{1k}^{\mathrm{bn}} / \partial \pmb{w}_k$ , we have: + +$$ +\frac {\partial f _ {1 k} ^ {\mathrm {b n}}}{\partial \boldsymbol {w} _ {k}} = \frac {1}{\sigma_ {k}} \left(\frac {\partial f _ {1 k}}{\partial \boldsymbol {w} _ {k}} - \frac {\partial \mu_ {k}}{\partial \boldsymbol {w} _ {k}}\right) - \frac {f _ {1 k} ^ {\mathrm {b n}}}{\sigma_ {k}} \frac {\partial \sigma_ {k}}{\partial \boldsymbol {w} _ {k}} \tag {170} +$$ + +Note that + +$$ +\frac {\partial \mu_ {k}}{\partial \boldsymbol {w} _ {k}} = \mathbb {E} _ {\text {s a m p l e}} [ \tilde {\boldsymbol {x}} _ {k} ] \tag {171} +$$ + +where $\mathbb{E}_{\mathrm{sample}}[\cdot ]$ is the sample mean, which is a constant over the batch. Therefore $\mathbb{C}_{\alpha}[\cdot ,\partial \mu_k / \partial \pmb {w}_k] = 0$ . For mean-backprop BatchNorm, since the gradient didn't backpropagate through the variance, the second term is simply zero. Therefore, we have: + +$$ +\begin{array}{l} \dot {\boldsymbol {w}} _ {k} = \sum_ {l} \mathbb {C} _ {\alpha} \left[ v _ {l k} \sigma_ {k} ^ {- 1} \frac {\partial f _ {1 k}}{\partial \boldsymbol {w} _ {k}}, \sum_ {k ^ {\prime}} v _ {l k ^ {\prime}} f _ {1 k ^ {\prime}} \sigma_ {k ^ {\prime}} ^ {- 1} \right] (172) \\ = \sum_ {l} \mathbb {C} _ {\alpha} \left[ v _ {l k} \sigma_ {k} ^ {- 1} \tilde {\boldsymbol {x}} _ {k}, \sum_ {k ^ {\prime}} v _ {l k ^ {\prime}} \boldsymbol {w} _ {k ^ {\prime}} ^ {\top} \tilde {\boldsymbol {x}} _ {k ^ {\prime}} \sigma_ {k ^ {\prime}} ^ {- 1} \right] (173) \\ = \sum_ {k ^ {\prime}} s _ {k k ^ {\prime}} \mathbb {C} _ {\alpha} \left[ \sigma_ {k} ^ {- 1} \tilde {\boldsymbol {x}} _ {k}, \sigma_ {k ^ {\prime}} ^ {- 1} \tilde {\boldsymbol {x}} _ {k ^ {\prime}} \right] \boldsymbol {w} _ {k ^ {\prime}} (174) \\ \end{array} +$$ + +$$ +\text {L e t} \tilde {\boldsymbol {x}} _ {k} ^ {\mathrm {b n}} := \sigma_ {k} ^ {- 1} \tilde {\boldsymbol {x}} _ {k} \text {a n d} \tilde {\boldsymbol {x}} ^ {\mathrm {b n}} := \left[ \begin{array}{c} \tilde {\boldsymbol {x}} _ {1} ^ {\mathrm {b n}} \\ \tilde {\boldsymbol {x}} _ {2} ^ {\mathrm {b n}} \\ \dots \\ \tilde {\boldsymbol {x}} _ {K} ^ {\mathrm {b n}} \end{array} \right] \in \mathbb {R} ^ {K d}. +$$ + +Corollary 3 (Dynamics of $w_{k}$ under conditional independence and BatchNorm). Let + +$$ +A _ {k} ^ {\mathrm {b n}} := \mathbb {V} \left[ \tilde {\boldsymbol {x}} _ {k} ^ {\mathrm {b n}} \right] = \sigma_ {k} ^ {- 2} A _ {k} \tag {175} +$$ + +$$ +d _ {k} ^ {\mathrm {b n}} := \sigma_ {k} ^ {- 2} d _ {k} \tag {176} +$$ + +$$ +\Delta_ {k} ^ {\mathrm {b n}} := \sigma_ {k} ^ {- 1} \Delta_ {k} = \mathbb {E} [ \tilde {\boldsymbol {x}} _ {k} ^ {\mathrm {b n}} | z = 1 ] - \mathbb {E} [ \tilde {\boldsymbol {x}} _ {k} ^ {\mathrm {b n}} | z = 0 ] \tag {177} +$$ + +and $\lambda^{\mathrm{bn}}$ be the maximal eigenvalue of $\mathbb{V}[f_1^{\mathrm{bn}}]$ . Then we have + +$$ +\bullet (1) \lambda^ {\mathrm {b n}} \geq \max _ {k} d _ {k} ^ {\mathrm {b n}}; +$$ + +(2) For $\lambda^{\mathrm{bn}}$ , the associated unit eigenvector is + +$$ +\boldsymbol {s} ^ {\mathrm {b n}} := \frac {1}{Z ^ {\mathrm {b n}}} \left[ \frac {\boldsymbol {w} _ {k} ^ {\top} \Delta_ {k} ^ {\mathrm {b n}}}{\lambda^ {\mathrm {b n}} - d _ {k} ^ {\mathrm {b n}}} \right] \in \mathbb {R} ^ {K}, +$$ + +where $Z^{\mathrm{bn}}$ is the normalization constant; + +(3) the dynamics of $\pmb{w}_k$ is given by: + +$$ +\dot {\boldsymbol {w}} _ {k} = \left[ \left(s _ {k} ^ {\mathrm {b n}}\right) ^ {2} A _ {k} ^ {\mathrm {b n}} + \delta_ {k} ^ {\mathrm {b n}} \left(\Delta_ {k} ^ {\mathrm {b n}}\right) \left(\Delta_ {k} ^ {\mathrm {b n}}\right) ^ {\top} \right] \boldsymbol {w} _ {k} \tag {178} +$$ + +where + +$$ +\delta_ {k} ^ {\mathrm {b n}} := \frac {p _ {0} p _ {1}}{\left(Z ^ {\mathrm {b n}}\right) ^ {2} \left(\lambda^ {\mathrm {b n}} - d _ {k} ^ {\mathrm {b n}}\right)} \sum_ {k ^ {\prime} \neq k} \frac {\left(\boldsymbol {w} _ {k ^ {\prime}} ^ {\top} \Delta_ {k ^ {\prime}} ^ {\mathrm {b n}}\right) ^ {2}}{\lambda^ {\mathrm {b n}} - d _ {k ^ {\prime}} ^ {\mathrm {b n}}} \geq 0 \tag {179} +$$ + +Proof. Similar to Theorem 5. + +![](images/920a77b37b1c054e3f53324c491c8fd83e8e3ecc7f7048f13929bae5ee011e27.jpg) + +Remarks In the presence of BatchNorm, Lemma 5 still holds, since it only depends on the generative structure of the data. Therefore, we have + +$$ +\sigma_ {k} ^ {2} \rightarrow \mathbb {V} [ f _ {k} ] = \pmb {w} _ {k} ^ {\top} \mathbb {V} [ \tilde {\pmb {x}} _ {k} ] \pmb {w} _ {k} = d _ {k} + p _ {0} p _ {1} \left(\pmb {w} _ {k} ^ {\top} \Delta_ {k}\right) ^ {2} +$$ + +and thus + +$$ +d _ {k} ^ {\mathrm {b n}} = \sigma_ {k} ^ {- 2} d _ {k} \rightarrow \frac {d _ {k}}{d _ {k} + p _ {0} p _ {1} \left(\boldsymbol {w} _ {k} ^ {\top} \Delta_ {k}\right) ^ {2}} = \frac {1}{1 + p _ {0} p _ {1} \left(\boldsymbol {w} _ {k} ^ {\top} \Delta_ {k} / \sqrt {d _ {k}}\right) ^ {2}} +$$ + +becomes more uniform. This is because $d_k \coloneqq \pmb{w}_k^\top L_k \pmb{w}_k = \mathbb{E}_z \mathbb{V}[f_k | z] \geq 0$ (Eqn. 135) is approximately the variance of $f_k$ , and thus $\pmb{w}_k^\top \Delta_k / \sqrt{d_k}$ is normalized across different receptive field $k$ , reducing the effect of magnitude of the input. + +Since there is no much variation within $\{d_k^{\mathrm{bn}}\}$ , $\lambda^{\mathrm{bn}} - d_k^{\mathrm{bn}}$ becomes almost constant across different receptive field $R_{k}$ and won't lead to slowness of feature learning. + +![](images/118885f14f0360bb4cc624df034d39a89afb0c5c98b9e481917631fe887a4484.jpg) +Figure 8: Local optima of objective $\mathcal{E}_{\alpha}(\boldsymbol{w})$ under uniform $\alpha := 1$ . $\boldsymbol{w} = [\cos \theta, \sin \theta]^\top$ is parameterized by $\theta \in [-\pi, \pi]$ , and each vertical dotted line is a data point. Dotted line is $\mathcal{E}_{\alpha}$ with linear activation $h(x) = x$ , and solid line is using ReLU activation $h(x) = \max(x, 0)$ . Both lines are scaled so that their maximal value is 1. + +# E ADDITIONAL EXPERIMENTS + +# E.1 VISUALIZATION OF LOCAL OPTIMA IN 1-LAYER SETTING + +We added a simple experiment to visualize the local maxima of $\mathcal{E}_{\alpha}(\boldsymbol{w}) \coloneqq \frac{1}{2}\mathbb{C}_{\alpha}[h(\boldsymbol{w}^{\top}\boldsymbol{x})]$ , when $\boldsymbol{w} = [\cos \theta, \sin \theta]^{\top}$ is a 2D unit vector parameterized by $\theta$ , and $h$ is ReLU activation. For simplicity, here we use a uniform $\alpha \coloneqq 1$ . + +We put a few data points $\{\pmb{x}_i\}$ on the unit circle, which are also parameterized by $\theta$ . The data points are located at $\{-\frac{4\pi}{5}, -\frac{\pi}{2}, -\frac{2\pi}{5}, -\frac{\pi}{6}, 0, \frac{\pi}{5}, \frac{2\pi}{5}, \frac{3\pi}{5}, \frac{4\pi}{5}\}$ and no data augmentation is used. The objective function $\mathcal{E}_{\alpha}(\theta)$ is plotted in Fig. 8. + +From the figure, we can see many local maxima $(\geq 8)$ caused by nonlinearity (solid line), much more than $2\times 2 = 4$ , the maximal possible number of local maxima counting all PCA components in 2D case (i.e., $\pm \phi_{1}$ and $\pm \phi_{2}$ , where $\phi_1$ and $\phi_{2}$ are orthogonal PCA directions in this 2D example). Moreover, unlike PCA directions, these local optima are not orthogonal to each other. + +On the other hand, in the linear case (dotted line), the curve is much smoother. There are only two local maxima corresponding to $\pm \phi_{1}$ , where $\phi_{1}$ is the largest PCA eigenvector. + +# E.2 2-LAYER SETTING + +We also do more experiments on the 2-layer setting, to further verify our theoretical findings. + +Overall matching score $\bar{\chi}_{+}$ and overall irrelevant-matching score $\bar{\chi}_{-}$ . As defined in the main text (Eqn. 16), the matching score $\chi_{+}(R_{k})$ is the degree of matching between learned weights and the embeddings of the subset $R_{k}^{\mathrm{g}}$ of tokens that are allowed in the global patterns at each receptive field $R_{k}$ . And the overall matching score $\bar{\chi}_{+}$ is $\bar{\chi}_{+}$ averaged over all receptive fields: + +$$ +\chi_ {+} \left(R _ {k}\right) = \frac {1}{P} \sum_ {a \in R _ {k} ^ {\mathrm {g}}} \max _ {m} \frac {\boldsymbol {w} _ {k m} ^ {\top} \boldsymbol {u} _ {a}}{\| \boldsymbol {w} _ {k m} \| _ {2} \| \boldsymbol {u} _ {a} \| _ {2}}, \quad \bar {\chi} _ {+} = \frac {1}{K} \sum_ {k} \chi_ {+} \left(R _ {k}\right) \tag {180} +$$ + +Similarly, we can also define irrelevant-matching score $\chi_{-}(R_k)$ which is the degree of matching between learned weights and the embeddings of the tokens that are NOT in the subset $R_k^{\mathrm{g}}$ at each receptive field $R_k$ . And the overall irrelevant-matching score $\bar{\chi}_{-}$ is defined similarly. + +$$ +\chi_ {-} \left(R _ {k}\right) = \frac {1}{P} \sum_ {a \notin R _ {k} ^ {\mathrm {g}}} \max _ {m} \frac {\boldsymbol {w} _ {k m} ^ {\top} \boldsymbol {u} _ {a}}{\| \boldsymbol {w} _ {k m} \| _ {2} \| \boldsymbol {u} _ {a} \| _ {2}}, \quad \bar {\chi} _ {-} = \frac {1}{K} \sum_ {k} \chi_ {-} \left(R _ {k}\right) \tag {181} +$$ + +Ideally, we want to see high overall matching score $\bar{\chi}_{+}$ and low overall irrelevant-matching score $\bar{\chi}_{-}$ , which means that the important patterns in $R_{k}^{\mathrm{g}}$ (i.e., the patterns that are allowed in the global generators) are learned, but noisy patterns that are not part of the global patterns (i.e., the generators) are not learned. Fig. 9 shows that this indeed is the case. + +Non-uniformity $\zeta$ and how BatchNorm interacts with it. When the scale of input data varies a lot, BatchNorm starts to matter in discovering features with low magnitude (Sec. D). To model the + +scale non-uniformity, we set $\| \pmb{u}_a\| _2 = \zeta$ for $\lfloor d / 2\rfloor$ tokens and $\| \pmb {u}_a\| _2 = 1 / \zeta$ for the remaining tokens. Larger $\zeta$ corresponds to higher non-uniformity across inputs. + +Fig. 11 shows that BN with ReLU activations handles large non-uniformity (large $\zeta$ ) very well, compared to the case without BN. Specifically, BN yields higher $\bar{\chi}_{+}$ in the presence of high non-uniformity (e.g., $\zeta = 10$ ) when the network is over-parameterized ( $\beta > 1$ ) and there are multiple candidates per $R_{k}$ ( $P > 1$ ), a setting that is likely to hold in real-world scenarios. + +Note that in the real-world scenario, features from different channels/modalities indeed will have very different scales, and some local features that turn out to be super important to global features, can have very small scale. In such cases, normalization techniques (e.g., BatchNorm) can be very useful and our formulation justifies it in a mathematically consistent way. + +Selectively Backpropagating $\mu_{k}$ and $\sigma_k^2$ in BatchNorm. In our analysis of BatchNorm, we assume that gradient backpropagating the mean statistics $\mu_{k}$ , but not variance $\sigma_k^2$ (see Def. 5). Note that this is different from regular BatchNorm, in which both $\mu_{k}$ and $\sigma_k^2$ get backpropagated gradients. Therefore, we test how this modified BN affects the matching score $\bar{\chi}_{+}$ : we change whether $\mu_{k}$ and $\sigma_k^2$ gets backpropagated gradients, while the forward pass remains the same, yielding the four following variants: + +$$ +f _ {k} ^ {\mathrm {b n}} [ i ] := \frac {f _ {k} ^ {\mathrm {b n}} [ i ] - \mu_ {k}}{\sigma_ {k}} +$$ + +(Vanilla BatchNorm) + +$$ +f _ {k} ^ {\mathrm {b n}} [ i ] := \frac {f _ {k} ^ {\mathrm {b n}} [ i ] - \operatorname {s t o p - g r a d i e n t} \left(\mu_ {k}\right)}{\sigma_ {k}} +$$ + +(BatchNorm with backpropated $\sigma_{k}$ ) + +$$ +f _ {k} ^ {\mathrm {b n}} [ i ] := \frac {f _ {k} ^ {\mathrm {b n}} [ i ] - \mu_ {k}}{\operatorname {s t o p - g r a d i e n t} (\sigma_ {k})} +$$ + +(BatchNorm with backpropated $\mu_{k}$ ) + +$$ +f _ {k} ^ {\mathrm {b n}} [ i ] := \frac {f _ {k} ^ {\mathrm {b n}} [ i ] - \operatorname {s t o p - g r a d i e n t} \left(\mu_ {k}\right)}{\operatorname {s t o p - g r a d i e n t} \left(\sigma_ {k}\right)} +$$ + +(BatchNorm without backpropating statistics) + +As shown in Tbl. 1, it is interesting to see that if $\sigma_k^2$ is not backpropagated, then the matching score $\bar{\chi}_{+}$ is actually better. This justifies our BN variant. + +Quadratic versus InfoNCE loss. Fig. 10 shows that quadratic loss (constant pairwise importance $\alpha$ ) shows worse matching score than InfoNCE. A high-level intuition is that InfoNCE dynamically adjusts the pairwise importance $\alpha$ (i.e., the focus of different sample pairs) during training to focus on the most important sample pairs, which makes learning patterns more efficient. We leave a comprehensive study for future work. + +![](images/76ddba648cdf2b8b15781bb3d30663c94b2a529dd40dd5eb76a10961099ca51a.jpg) + +![](images/ac87cf0894152dc53a513b83f0a8ad9b95e2d7d40c23cd2e8ced0bea9b204f87.jpg) + +![](images/52d65a6ae6218f414f423bf2e563ce2dff32ad233567e53e85c0943522d9f0c8.jpg) + +![](images/b673f59a56c4cd84cd623b7b03d51a0b1d80ad0b57e36c24b16c637c1173e060.jpg) + +![](images/a47221e5afa817b6b671c8fe705796ae26dad833de480c26d3afa815eb1b62db.jpg) +Figure 9: Overall matching score $\bar{\chi}_{+}$ (Eqn. 180, the top row) and irrelevant-matching score $\bar{\chi}_{-}$ (Eqn. 181, the bottom row). This is an extended version of Fig. 4. (a) When $P = 1$ , linear model works well regardless of the degree of over-parameterization $\beta$ , while ReLU model requires large over-parameterization to perform well; (b) When each $R_{k}$ has multiple local patterns that are related to the global patterns ( $P > 1$ ) related to generators, ReLU models can capture diverse patterns better than linear ones in the over-parameterization region $\beta > 1$ and stay focus on relevant local patterns that are related to the global patterns (i.e., low $\bar{\chi}_{-}$ ). Among all activations (homogeneous or non-homogeneous), ReLU shows its strength by achieving the lowest irrelevant-matching score $\bar{\chi}_{-}$ . In contrast, linear models are much less affected by over-parameterization. Each setting is repeated 3 times and mean/standard derivations are reported. + +![](images/40844ce40814f037d6674c599bb811d4893dcb7ca7796c87b5521b5b6fd5b98f.jpg) + +![](images/e9edf3386212d5a6e51c0389223afec9e1089f9c2a3d82860eff1e2f11066cdf.jpg) + +![](images/c88d53154c3ca5767116a970ade16e6524eb753b5b596fc552cdb2309082520b.jpg) + +![](images/ffeeeca681506b49922123404e9ea2081f5ac2b9f20ccf5294dd5c7316e73041.jpg) + +![](images/e50e8de8769c8dcb6572ab96a33fc4a323bf279957bc5f0c6a1c10577611af36.jpg) + +![](images/d8d9e9862b08715ceb4ac0cfcee0cd1ae9f250ebd3ab257673e5b47810d5577f.jpg) + +![](images/7d73d9600d4db2ad075109704132422d3337ac8277f5ea34bf3b774d75deeede.jpg) + +![](images/69cbd95d22cd632d4d406b8de98537ee8ca2703c806f4f300bd426b67c6c6a3d.jpg) +Figure 10: Overall matching score $\bar{\chi}_{+}$ (top row) and overall irrelevant-matching score $\bar{\chi}_{-}$ (Eqn. 16, bottom row) using quadratic loss function rather than InfoNCE. The result using InfoNCE is shown in Fig. 9, with all experiments setting being the same, except for the loss function. While we see similar trends as in Sec. 5.1, quadratic loss is not as effective as InfoNCE in feature learning. + +![](images/ee0a94d0189f71d917e2c7ff04c7face254ca9ae439aafeb499d8b0c074496a3.jpg) + +![](images/2a60e492cdd9cc395a81455b8f701687443df60c89c434c1b2cfdfef4144394b.jpg) + +![](images/c568a85516a4b565946291e140c81bf1595388fe0e60d35b221c0115c4c9e23c.jpg) + +![](images/1285c64c91bca9c7ddfa44243e2374c9b1fe6a26efcd595889fd165523e93f32.jpg) + +![](images/144a0261a385f99f8dd0a0230875713fc6e6d85e6ee18539e5b6fed391223e8c.jpg) + +![](images/fb5309162f3827cdf6fdffa437f91f82e0afcb489e5990352df944cac1388219.jpg) + +![](images/27b781069d4ca7458b94c4d2fa7832948e09ed0c86155197d232ed4785270c70.jpg) + +![](images/026af77fd260a3c5782112fc97b12ce4f09e0fa4f84f2cf3b66b24706d54d57f.jpg) + +![](images/f369b6316936a07f7d0a6c4e7bb419764684eabf981a284c9584691b3722afff.jpg) + +![](images/245af46ffedcc1fffa95454fb4499098e9d922f042b864ca1211d552d2062636.jpg) + +![](images/c5345a7a90863b4b150cf9b5038a6d3a85a16d55a1f5141cb64c842a8a7c6ec2.jpg) + +![](images/3e629a19c075db39927efdc50e5644cefd73404a375058c0d4947982accc8f5e.jpg) +Figure 11: The effect of BatchNorm (BN) with ReLU activation in the presence of non-uniformity $\zeta$ of the input data. The non-uniformity is set to be $\zeta = 2$ (top), $\zeta = 5$ (middle) and $\zeta = 10$ (bottom). For small non-uniformity, BN doesn't help much. For larger nonuniformity, BN yields better matching score $\bar{\chi}_{+}$ in the over-parameterization region (large $\beta$ ) and multiple tokens per RF (large $P$ ). + +![](images/7c50a6c927e8531980de5711ae0d7647ba97dc9eceb1aa7055a37c8e68c56a1e.jpg) + +![](images/d91a93a94d0c6936b3c0ee0689ef2b7b0a98f3153f7326838ae8d1d543ef9f09.jpg) + +![](images/1944ef13bb6a574552440fdafc58042af48c8ef64d55da67daa0576229e02631.jpg) + +
βPμk no backpropμk backprop
σ2k no backpropσ2k backpropσ2k no backpropσ2k backprop
110.31 ± 0.240.23 ± 0.060.30 ± 0.240.23 ± 0.06
30.65 ± 0.09-0.03 ± 0.010.64 ± 0.070.24 ± 0.11
50.61 ± 0.06-0.00 ± 0.000.62 ± 0.020.38 ± 0.04
100.66 ± 0.060.53 ± 0.050.70 ± 0.030.56 ± 0.04
210.36 ± 0.130.27 ± 0.060.63 ± 0.110.33 ± 0.12
30.78 ± 0.010.00 ± 0.010.80 ± 0.020.41 ± 0.07
50.78 ± 0.020.22 ± 0.210.77 ± 0.070.56 ± 0.02
100.83 ± 0.080.72 ± 0.060.80 ± 0.040.71 ± 0.05
510.63 ± 0.060.43 ± 0.120.67 ± 0.060.46 ± 0.06
30.90 ± 0.060.45 ± 0.070.90 ± 0.030.60 ± 0.08
50.90 ± 0.010.72 ± 0.010.88 ± 0.060.74 ± 0.02
100.88 ± 0.010.88 ± 0.040.92 ± 0.030.90 ± 0.03
1010.63 ± 0.120.37 ± 0.150.70 ± 0.170.46 ± 0.15
30.95 ± 0.050.72 ± 0.060.94 ± 0.050.80 ± 0.03
50.98 ± 0.020.84 ± 0.050.96 ± 0.060.92 ± 0.01
100.90 ± 0.010.97 ± 0.020.89 ± 0.030.97 ± 0.02
+ +Table 1: The effect of backpropagating different BN statistics under nonuniformity $\zeta = 10$ . Backpropagating the gradient through the sample mean $\mu_{k}$ but not the sample variance $\sigma_k^2$ gives overall good matching score $\bar{\chi}_{+}$ , justifying our setting of mean-backprop BatchNorm (Def. 5). + +![](images/3f912f9c96f0ca9f5714ce0b0564ee98f54f61a82b230f846d709cb41dfa9d34.jpg) +Figure 12: Learned filters (of the 4 disjoint receptive field) in MNIST dataset without using augmentation. The 4 receptive fields corresponds to upper left (0), upper right (1), bottom left (2) and bottom right (3) part of the input image. + +![](images/a488fc91a4fd1bbe34e325d2970c194a434809febd0c884b8bab3b4ae114f01c.jpg) +Figure 13: Same as Fig. 12 but with data augmentation during contrastive learning. The learned filters are smoother. According to the tentative theory in Sec. B.5, data augmentation removes some of the local optima. + +# E.3 MNIST EXPERIMENTS WITH 2-LAYER SETTING + +We also run the same 2-layer network (as in Sec. E.2) on MNIST Deng (2012) dataset. In its training, the MNIST dataset consists of 50,000 images, each with the size of 28 by 28. We split the 28-by-28 images into 4 disjoint receptive fields, each with a size of 14 by 14, just like Fig. 2(b). In each region, we vectorize the receptive field into $14 * 14 = 196$ dimensional vector. We use smaller batchsize (8), since there are only 10 true classes in MNIST, and the probability that two samples from the same class are incorrectly treated as negative pair increases with large batchesizes. We train for 50000 minibatches and start new pass (epoch) of the dataset if needed. + +Fig 12 shows the initial results. We could see that indeed filters in each receptive field capture a diverse set of pattern of the input data points (e.g., part of the digits). Furthermore, with additional data augmentation (i.e., random cropping and resizing with transform transforms.RandomResizedCrop((28,28), scale=(0.5,1.0), ratio=(0.5,1.5) in PyTorch), the resulting learned patterns become smoother with much weaker high-frequency components. This is because the augmentation implicitly removes some of the local optima (Sec. B.5), leaving more informative local optima. + +# F CONTEXT AND MOTIVATIONS OF THEOREMS + +Here are the motivations and intuitions behind each major theoretical results: + +- First of all, Lemma 2 and Corollary 1 try to make connection between a relatively new (and somehow abstract) concept (i.e., contrastive covariance $\mathbb{C}_{\alpha}[\cdot]$ ) and a well-known concept (i.e., regular covariance $\mathbb{V}[\cdot]$ ). This will also enable us to leverage existing properties of covariance, in order to deepen our understanding of this concept, which seems to play an important role in contrastive learning (CL). +- After that, we mainly focus on studying the CL energy function $\mathcal{E}_{\alpha}$ , which can be represented in terms of the contrastive covariance $\mathbb{C}_{\alpha}[\cdot]$ . One important property of the energy function is whether there exists any local optima and what are the properties of these local optima, since these local optima are the final destinations that network weights will converge into. Previous works in landscape analysis often talk about local optima in neural networks as abstract objects in high-dimensional space, but here, we would like to make them as concrete as possible. +- For such analysis, we always start from the simplest case (e.g., one-layer). Therefore, naturally we have Lemma 3 that characterizes critical points (as a superset of local optima), a few examples in Sec. 3.2, properties of these critical points and when they become local optima in Sec. 3. Finally, Appendix B.5 further gives a preliminary study on how the data augmentation affects the distribution of the local optima. +- Then we extend our analysis to 2-layer setting. The key question is to study the additional benefits of 2-layer network compared to $K$ independent 1-layer cases. Here the assumption of disjoint receptive fields is to make sure there is an apple-to/apple comparison, otherwise additional complexity would be involved, e.g., overlapping receptive fields. As demonstrated in Theorem 5 and Theorem 6, we find the effect of global modulation in 2-layer case, which clearly tells that the interactions across different receptive fields lead to additional terms in the dynamics that favors patterns related to latent variable $z$ that leads to conditional independence across the disjointed receptive fields. +- As a side track, in 2-layer case, we also have Theorem 4 that shows linear activation does not learn distinct features, which is consistent with 1-layer case that linear activation $h(x) = x$ only gives to maximal PCA directions (Sec. 6). + +# G OTHER LEMMAS + +Lemma 7 (Bound of $1 - d_{t}$ ). Define + +$$ +\mu (\boldsymbol {w}) := \frac {1 + c (\boldsymbol {w})}{2 c ^ {2} (\boldsymbol {w})} \left(\frac {\lambda_ {2} (A (\boldsymbol {w} (t)))}{\lambda_ {1} (A (\boldsymbol {w} (t)))}\right) ^ {2} = \frac {1 + c (\boldsymbol {w})}{2 c ^ {2} (\boldsymbol {w})} \left[ 1 - \frac {\lambda_ {\text {g a p}} (A (t))}{\lambda_ {1} (A (t))} \right] ^ {2} \geq 0 \tag {182} +$$ + +and $\mu_t \coloneqq \mu(\boldsymbol{w}(t))$ . If $c_t > 0$ and $\lambda_1(t) > 0$ , then $1 - d_t \leq \mu_t(1 - c_t)$ . + +Proof. We could write $d_t$ : + +$$ +\begin{array}{l} d _ {t} = \frac {\phi_ {1} ^ {\top} (t) \tilde {\boldsymbol {w}} (t + 1)}{\| \tilde {\boldsymbol {w}} (t + 1) \| _ {2}} = \frac {\lambda_ {1} (t) \phi_ {1} ^ {\top} (t) \boldsymbol {w} (t)}{\sqrt {\sum_ {i} \lambda_ {i} ^ {2} (t) \left(\phi_ {i} ^ {\top} (t) \boldsymbol {w} (t)\right) ^ {2}}} (183) \\ \geq \frac {\lambda_ {1} (t) c _ {t}}{\sqrt {\lambda_ {1} ^ {2} (t) c _ {t} ^ {2} + \lambda_ {2} ^ {2} (t) \left(1 - c _ {t} ^ {2}\right)}} = \frac {1}{\sqrt {1 + \left(\frac {\lambda_ {2} (t)}{\lambda_ {1} (t)}\right) ^ {2} \left(\frac {1}{c _ {t} ^ {2}} - 1\right)}} (184) \\ = \left[ 1 + \left(\frac {\lambda_ {2} (t)}{\lambda_ {1} (t)}\right) ^ {2} \left(\frac {1}{c _ {t} ^ {2}} - 1\right) \right] ^ {- 1 / 2} (185) \\ \geq 1 - \frac {1}{2} \left(\frac {\lambda_ {2} (t)}{\lambda_ {1} (t)}\right) ^ {2} \left(\frac {1}{c _ {t} ^ {2}} - 1\right) =: 1 - \mu_ {t} \left(1 - c _ {t}\right) (186) \\ \end{array} +$$ + +The first inequality is due to the fact that $\sum_{i > 1}\lambda_i^2 (t)\left(\phi_i^\top (t)\pmb {w}(t)\right)^2 = 1 - c_t^2$ (Parseval's identity). The last inequality is due to the fact that for $x > - 1$ , $(1 + x)^{\alpha}\geq 1 + \alpha x$ when $\alpha \geq 1$ or $\alpha < 0$ (Bernoulli's inequality). Therefore the conclusion holds. + +Lemma 8 (Bound of weight difference). If $c_t > 0$ and $\lambda_i(t) > 0$ for all $i$ , then $\| \delta \pmb{w}(t) \|_2 \leq \sqrt{2(1 + \mu_t c_t)(1 - c_t)}$ + +Proof. First, for $\pmb{w}^{\top}(t + 1)\pmb{w}(t)$ , we have (notice that $\lambda_i(t) \geq 0$ ): + +$$ +\begin{array}{l} \boldsymbol {w} ^ {\top} (t + 1) \boldsymbol {w} (t) = \frac {\sum_ {i} \lambda_ {i} (t) \left(\phi_ {i} ^ {\top} (t) \boldsymbol {w} (t)\right) ^ {2}}{\sqrt {\sum_ {i} \lambda_ {i} ^ {2} (t) \left(\phi_ {i} ^ {\top} (t) \boldsymbol {w} (t)\right) ^ {2}}} (187) \\ \geq \frac {\lambda_ {1} (t) c _ {t} ^ {2}}{\sqrt {\lambda_ {1} ^ {2} (t) c _ {t} ^ {2} + \lambda_ {2} ^ {2} (t) \left(1 - c _ {t} ^ {2}\right)}} \geq \left[ 1 - \mu_ {t} \left(1 - c _ {t}\right) \right] c _ {t} (188) \\ \end{array} +$$ + +Therefore, + +$$ +\left\| \boldsymbol {w} (t + 1) - \boldsymbol {w} (t) \right\| _ {2} = \sqrt {2} \sqrt {1 - \boldsymbol {w} ^ {\top} (t) \boldsymbol {w} (t + 1)} \leq \sqrt {2 \left(1 + \mu_ {t} c _ {t}\right) \left(1 - c _ {t}\right)} \tag {189} +$$ + +Lemma 9. Let $\delta A = A' - A$ , then the maximal eigenvector $\phi_1 \coloneqq \phi_1(A)$ and $\phi_1' \coloneqq \phi_1(A')$ has the following Taylor expansion: + +$$ +\phi_ {1} ^ {\prime} = \phi_ {1} + \Delta \phi_ {1} + \mathcal {O} (\| \delta A \| _ {2} ^ {2}) \tag {190} +$$ + +where $\lambda_{i}$ is the $i$ -th eigenvalue of $A$ , $\Delta \phi_{1} := \sum_{j > 1} \frac{\phi_{j}^{\top} \delta A \phi_{1}}{\lambda_{1} - \lambda_{j}} \phi_{j}$ is the first-order term of eigenvector perturbation. In terms of inequality, there exist $\kappa > 0$ so that: + +$$ +\left\| \phi_ {1} ^ {\prime} - \left(\phi_ {1} + \Delta \phi_ {1}\right) \right\| _ {2} \leq \kappa \| \delta A \| _ {2} ^ {2} \tag {191} +$$ + +Proof. See time-independent perturbation theory in Quantum Mechanics (Fernández, 2000). + +Lemma 10. Let $L$ be the minimal Lipschitz constant of $A$ so that $\| A(\pmb{w}^{\prime}) - A(\pmb{w})\|_{2} \leq L\| \pmb{w} - \pmb{w}^{\prime}\|_{2}$ holds. If $c_{t} > 0$ and $\lambda_{i}(t) > 0$ for all $i$ , then we have: + +$$ +\left| d _ {t} - c _ {t + 1} \right| = \left| \left(\phi_ {1} (t) - \phi_ {1} (t + 1)\right) ^ {\top} \boldsymbol {w} (t + 1) \right| \leq \nu_ {t} (1 - c _ {t}) \tag {192} +$$ + +where + +$$ +\nu (\boldsymbol {w}) := 2 \kappa L ^ {2} (1 + \mu (\boldsymbol {w}) c (\boldsymbol {w})) + 2 L \lambda_ {\text {g a p}} ^ {- 1} (A \boldsymbol {w} (t)) \sqrt {\mu (\boldsymbol {w}) (1 + \mu (\boldsymbol {w}) c (\boldsymbol {w}))} \geq 0 \tag {193} +$$ + +and $\nu_{t}\coloneqq \nu (\pmb {w}(t))$ + +Proof. Using Lemma 9 and the fact that $\| \pmb{w}(t + 1)\| _2 = 1$ , we have: + +$$ +\left| d _ {t} - c _ {t + 1} \right| = \left| \left(\phi_ {1} (t) - \phi_ {1} (t + 1)\right) ^ {\top} \boldsymbol {w} (t + 1) \right| \leq \left| \Delta \phi_ {1} ^ {\top} (t) \boldsymbol {w} (t + 1) \right| + \kappa L ^ {2} \| \delta \boldsymbol {w} (t) \| _ {2} ^ {2} \tag {194} +$$ + +where + +$$ +\Delta \phi_ {1} (t) := \sum_ {j > 1} \frac {\phi^ {\top} (t) _ {j} \delta A (t) \phi_ {1} (t)}{\lambda_ {1} (t) - \lambda_ {j} (t)} \phi_ {j} (t) \tag {195} +$$ + +and $\delta A(t) \coloneqq A(t + 1) - A(t)$ . For brevity, we omit all temporal notation if the quantity is evaluated at iteration $t$ . E.g., $\delta \pmb{w}$ means $\delta \pmb{w}(t)$ and $\phi_1$ means $\phi_1(t)$ . + +Now we bound $|\Delta \phi_1^\top \pmb{w}(t + 1)|$ . Using Cauchy-Schwarz inequality: + +$$ +\begin{array}{l} \left| \Delta \phi_ {1} ^ {\top} \boldsymbol {w} (t + 1) \right| = \left| \sum_ {j > 1} \left(\frac {\phi_ {j} ^ {\top} \delta A \phi_ {1}}{\lambda_ {1} - \lambda_ {j}}\right) \left(\phi_ {j} ^ {\top} \boldsymbol {w} (t + 1)\right) \right| (196) \\ \leq \sqrt {\sum_ {j > 1} \left(\frac {\phi_ {j} ^ {\top} \delta A \phi_ {1}}{\lambda_ {1} - \lambda_ {j}}\right) ^ {2}} \sqrt {\sum_ {j > 1} \left(\phi_ {j} ^ {\top} \boldsymbol {w} (t + 1)\right) ^ {2}} (197) \\ \leq \frac {1}{\lambda_ {\mathrm {g a p}} (A)} \sqrt {\sum_ {j > 1} \left(\phi_ {j} ^ {\top} \delta A \phi_ {1}\right) ^ {2}} \sqrt {\sum_ {j > 1} \left(\phi_ {j} ^ {\top} \boldsymbol {w} (t + 1)\right) ^ {2}} (198) \\ \end{array} +$$ + +Since $\{\phi_j\}$ is a set of orthonormal bases, Parseval's identity tells that for any vector $\pmb{v}$ , its energy under any orthonormal bases are preserved: $\sum_{j} (\phi_{j}^{\top} \pmb{v})^{2} = \| \pmb{v} \|_{2}^{2}$ . Therefore, we have: + +$$ +\begin{array}{l} \left| \Delta \phi_ {1} ^ {\top} \boldsymbol {w} (t + 1) \right| \leq \frac {1}{\lambda_ {\text {g a p}} (A)} \| \delta A \phi_ {1} \| _ {2} \sqrt {1 - d _ {t} ^ {2}} (199) \\ \leq \frac {L}{\lambda_ {\text {g a p}} (A)} \| \delta \boldsymbol {w} (t) \| _ {2} \sqrt {1 - d _ {t} ^ {2}} (200) \\ \end{array} +$$ + +Note that using $-1\leq d_t\leq 1$ and Lemma 7, we have: + +$$ +\sqrt {1 - d _ {t} ^ {2}} = \sqrt {1 + d _ {t}} \sqrt {1 - d _ {t}} \leq \sqrt {2 (1 - d _ {t})} \leq \sqrt {2 \mu_ {t} (1 - c _ {t})} \tag {201} +$$ + +Finally using bound of weight difference (Lemma 8), we have: + +$$ +\begin{array}{l} \left| d _ {t} - c _ {t + 1} \right| \leq 2 \kappa L ^ {2} \left(1 + \mu_ {t} c _ {t}\right) \left(1 - c _ {t}\right) + L \lambda_ {\text {g a p}} ^ {- 1} \sqrt {2 \left(1 + \mu_ {t} c _ {t}\right) \left(1 - c _ {t}\right)} \sqrt {1 - d _ {t} ^ {2}} (202) \\ \leq \nu_ {t} \left(1 - c _ {t}\right) (203) \\ \end{array} +$$ + +Here $\nu_{t}:= 2\kappa L^{2}(1 + \mu_{t}c_{t}) + 2L\lambda_{\mathrm{gap}}^{-1}(A(t))\sqrt{\mu_{t}(1 + \mu_{t}c_{t})}$ + +![](images/e3493676d32e214be04d49519c080aa1e9e6236b637e5fe40f630228acd5dffb.jpg) + +Lemma 11. Let $c_{0} \coloneqq c(\pmb{w}(0)) = \pmb{w}^{\top}(0)\phi_{1}(A(\pmb{w}(0))) > 0$ . Define local region $B_{\gamma}$ : + +$$ +B _ {\gamma} := \left\{\boldsymbol {w}: \| \boldsymbol {w} - \boldsymbol {w} (0) \| _ {2} \leq \frac {\sqrt {2 (1 + \gamma) (1 - c _ {0})}}{1 - \sqrt {\gamma}} \right\} \tag {204} +$$ + +Define $\omega(\boldsymbol{w}) \coloneqq \mu(\boldsymbol{w}) + \nu(\boldsymbol{w})$ to be the irregularity (also defined in Def. 4). If there exists $\gamma < 1$ so that + +$$ +\sup _ {\boldsymbol {w} \in B _ {\gamma}} \omega (\boldsymbol {w}) \leq \gamma , \tag {205} +$$ + +then + +- The sequence $\{c_t\}$ increases monotonously and converges to 1; +- There exists $\mathbf{w}_{*}$ so that $\lim_{t\to +\infty}\mathbf{w}(t) = \mathbf{w}_{*}$ . +- $\mathbf{w}_{*}$ is the maximal eigenvector of $A(\mathbf{w}_{*})$ and thus a fixed point of gradient update (Eqn. 7); +For any $t$ , $\| \pmb{w}(t) - \pmb{w}(0)\|_2 \leq \frac{\sqrt{2(1 + \gamma)(1 - c_0)}}{1 - \sqrt{\gamma}}$ . +- $\| \pmb{w}_* - \pmb{w}(0)\|_2 \leq \frac{\sqrt{2(1 + \gamma)(1 - c_0)}}{1 - \sqrt{\gamma}}$ . That is, $\pmb{w}_*$ is in the vicinity of the initial weight $\pmb{w}(0)$ . + +Proof. We first prove by induction that the following induction arguments are true for any $t$ : + +$c_{t + 1}\geq c_t > 0$ +$1 - c_{t}\leq \gamma^{t}(1 - c_{0})$ +- $\mathbf{w}\left( t\right)$ is not far away from its initial value $\mathbf{w}\left( 0\right)$ : + +$$ +\left\| \boldsymbol {w} (t) - \boldsymbol {w} (0) \right\| _ {2} \leq \sqrt {2 (1 + \gamma) (1 - c _ {0})} \sum_ {t ^ {\prime} = 0} ^ {t - 1} \gamma^ {t ^ {\prime} / 2} \tag {206} +$$ + +which suggests that $\pmb{w}(t) \in B_{\gamma}$ . + +Base case ( $t = 1$ ). Since $1 \geq c_0 > 0$ , $\mu(\boldsymbol{w}) \geq 0$ , and $A(\boldsymbol{w})$ is PD, applying Lemma 8 to $\| \boldsymbol{w}(1) - \boldsymbol{w}(0) \|_2$ , it is clear that + +$$ +\left\| \boldsymbol {w} (1) - \boldsymbol {w} (0) \right\| _ {2} = \left\| \delta \boldsymbol {w} (0) \right\| _ {2} \leq \sqrt {2} \sqrt {\left(1 + \mu_ {0} c _ {0}\right) \left(1 - c _ {0}\right)} \leq \sqrt {2 (1 + \gamma) \left(1 - c _ {0}\right)} \tag {207} +$$ + +Note that the last inequality is due to $\mu_0\leq \gamma$ . Note that + +$$ +1 - c _ {1} = 1 - d _ {0} + d _ {0} - c _ {1} \leq 1 - d _ {t} + | d _ {0} - c _ {1} | \leq (\mu_ {0} + \nu_ {0}) (1 - c _ {0}) \leq \gamma (1 - c _ {0}) \tag {208} +$$ + +and finally we have $c_{1} \geq 1 - \gamma (1 - c_{0}) \geq c_{0} > 0$ . So the base case is satisfied. + +Inductive step. Assume for $t$ , the induction argument is true and thus $\pmb{w}(t) \in B_{\gamma}$ . Therefore, by the condition, we know $\mu_t + \nu_t \leq \gamma$ . + +By Lemma 8, we know that + +$$ +\left\| \boldsymbol {w} (t + 1) - \boldsymbol {w} (t) \right\| _ {2} = \left\| \delta \boldsymbol {w} (t) \right\| _ {2} \leq \sqrt {2 \left(1 + \mu_ {t} c _ {t}\right) \left(1 - c _ {t}\right)} \leq \sqrt {2 (1 + \gamma) \left(1 - c _ {0}\right)} \gamma^ {t / 2} \tag {209} +$$ + +Therefore, we know that $\pmb{w}(t + 1)$ also satisfies Eqn. 206: + +$$ +\begin{array}{l} \left\| \boldsymbol {w} (t + 1) - \boldsymbol {w} (0) \right\| _ {2} \leq \left\| \boldsymbol {w} (t) - \boldsymbol {w} (0) \right\| _ {2} + \left\| \delta \boldsymbol {w} (t) \right\| _ {2} (210) \\ \leq \sqrt {2 (1 + \gamma) \left(1 - c _ {0}\right)} \left[ \sum_ {t ^ {\prime} = 0} ^ {t - 1} \gamma^ {t ^ {\prime} / 2} + \gamma^ {t / 2} \right] (211) \\ = \sqrt {2 (1 + \gamma) \left(1 - c _ {0}\right)} \sum_ {t ^ {\prime} = 0} ^ {t} \gamma^ {t ^ {\prime} / 2} (212) \\ \end{array} +$$ + +Also we have: + +$$ +\begin{array}{l} 1 - c _ {t + 1} = 1 - d _ {t} + d _ {t} - c _ {t + 1} \leq 1 - d _ {t} + \left| d _ {t} - c _ {t + 1} \right| (213) \\ \leq \left(\mu_ {t} + \nu_ {t}\right) \left(1 - c _ {t}\right) \leq \gamma \left(1 - c _ {t}\right) (214) \\ \leq \gamma^ {t + 1} \left(1 - c _ {0}\right) (215) \\ \end{array} +$$ + +and thus we have $c_{t + 1}\geq 1 - \gamma (1 - c_t)\geq c_t > 0$ + +Therefore, we have + +$$ +1 - c _ {t} \leq \gamma^ {t} \left(1 - c _ {0}\right)\rightarrow 0 \tag {216} +$$ + +thus $c_{t}$ is monotonously increasing to 1. This means that: + +$$ +\lim _ {t \rightarrow + \infty} c _ {t} = \lim _ {t \rightarrow + \infty} \phi_ {1} ^ {\top} (t) \boldsymbol {w} (t) \rightarrow 1 \tag {217} +$$ + +Therefore, we can show that $\pmb{w}(t)$ is also convergent, by checking how fast $\|\delta \pmb{w}(t)\|_2$ decays: + +$$ +\left\| \delta \boldsymbol {w} (t) \right\| _ {2} \leq \sqrt {2 \left(1 + \mu_ {t} c _ {t}\right) \left(1 - c _ {t}\right)} \leq \sqrt {2 (1 + \gamma) \left(1 - c _ {0}\right)} \gamma^ {t / 2} \tag {218} +$$ + +By Cauchy's convergence test, $\pmb{w}(t) = \pmb{w}(0) + \sum_{t'=0}^{t-1} \delta \pmb{w}(t')$ also converges. Let + +$$ +\lim _ {t \rightarrow + \infty} \boldsymbol {w} (t) = \boldsymbol {w} _ {*} \tag {219} +$$ + +This means that $A(\boldsymbol{w}_*) \boldsymbol{w}_* = \lambda_* \boldsymbol{w}_*$ and thus $P_{\boldsymbol{w}_*}^\perp A(\boldsymbol{w}_*) \boldsymbol{w}_* = 0$ , i.e., $\boldsymbol{w}_*$ is a fixed point of gradient update (Eqn. 7). Finally, we have: + +$$ +\left\| \boldsymbol {w} (t) - \boldsymbol {w} (0) \right\| _ {2} \leq \sqrt {2 (1 + \gamma) (1 - c _ {0})} \sum_ {t ^ {\prime} = 0} ^ {t - 1} \gamma^ {t ^ {\prime} / 2} \leq \frac {\sqrt {2 (1 + \gamma) (1 - c _ {0})}}{1 - \sqrt {\gamma}} \tag {220} +$$ + +Since $\| \cdot \|_2$ is continuous, we have the conclusion. + +![](images/75c9b545827a12229e043f568207640be6f025faa7c2ecc08d15a79e6850bc16.jpg) \ No newline at end of file diff --git a/understandingtheroleofnonlinearityintrainingdynamicsofcontrastivelearning/images.zip b/understandingtheroleofnonlinearityintrainingdynamicsofcontrastivelearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..adccd693d39dc57882ea02bb7ba2228e1fe50ae2 --- /dev/null +++ b/understandingtheroleofnonlinearityintrainingdynamicsofcontrastivelearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:67461ec6e9433182cdd9d833b2e890f28a58a3b162dba4f9f39c181e3f6581b3 +size 2543287 diff --git a/understandingtheroleofnonlinearityintrainingdynamicsofcontrastivelearning/layout.json b/understandingtheroleofnonlinearityintrainingdynamicsofcontrastivelearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..74c6267fe3e1a4df2ac60cc6f7737f3f75b0d9e2 --- /dev/null +++ b/understandingtheroleofnonlinearityintrainingdynamicsofcontrastivelearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:82f31fcd71e60f01e471d2b88345f12dda4db070c6baac368204ed6488e6308d +size 2256880 diff --git a/understandingtrainvalidationsplitinmetalearningwithneuralnetworks/90032d0e-dd57-436e-b703-1152bc666f8a_content_list.json b/understandingtrainvalidationsplitinmetalearningwithneuralnetworks/90032d0e-dd57-436e-b703-1152bc666f8a_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..11745c03a55521932f71a6484c3ee6795788cad0 --- /dev/null +++ b/understandingtrainvalidationsplitinmetalearningwithneuralnetworks/90032d0e-dd57-436e-b703-1152bc666f8a_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d494fbe426b38e3a5b41f63d4611beae9bfc3cdee80b44f21b6c4a907ecb62d +size 455874 diff --git a/understandingtrainvalidationsplitinmetalearningwithneuralnetworks/90032d0e-dd57-436e-b703-1152bc666f8a_model.json b/understandingtrainvalidationsplitinmetalearningwithneuralnetworks/90032d0e-dd57-436e-b703-1152bc666f8a_model.json new file mode 100644 index 0000000000000000000000000000000000000000..8c3214a516b2267fbd6376ec7c8f42b812e2d72a --- /dev/null +++ b/understandingtrainvalidationsplitinmetalearningwithneuralnetworks/90032d0e-dd57-436e-b703-1152bc666f8a_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aa2df9ae7f3b0a43c54821e9649e68dc3ef0045d35ade4bb1c4d1f5cdaac7324 +size 506267 diff --git a/understandingtrainvalidationsplitinmetalearningwithneuralnetworks/90032d0e-dd57-436e-b703-1152bc666f8a_origin.pdf b/understandingtrainvalidationsplitinmetalearningwithneuralnetworks/90032d0e-dd57-436e-b703-1152bc666f8a_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..419d12fb41c96169991827fae36cfe6b113f0c90 --- /dev/null +++ b/understandingtrainvalidationsplitinmetalearningwithneuralnetworks/90032d0e-dd57-436e-b703-1152bc666f8a_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:969711d395b105df03f3f09054b290e3986ea330e2ee6c135a604c8f2e4c280a +size 655341 diff --git a/understandingtrainvalidationsplitinmetalearningwithneuralnetworks/full.md b/understandingtrainvalidationsplitinmetalearningwithneuralnetworks/full.md new file mode 100644 index 0000000000000000000000000000000000000000..2299388050d7b921dbf46542c9f9f8539b129d29 --- /dev/null +++ b/understandingtrainvalidationsplitinmetalearningwithneuralnetworks/full.md @@ -0,0 +1,2323 @@ +# UNDERSTANDING TRAIN-VALIDATION SPLIT IN META-LEARNING WITH NEURAL NETWORKS + +Xinzhe Zuo $^{\ddagger}$ , Zixiang Chen $^{\diamond}$ , Huaxiu Yao $^{\dagger}$ , Yuan Cao $^{\star}$ , Quqnquan Gu $^{\diamond}$ + +$\ddagger$ Department of Mathematics, University of California, Los Angles zxz@math.ucla.edu +$^{\diamond}$ Department of Computer Science, University of California, Los Angeles {chenzx19, qgu}@cs.ucla.edu +† Department of Computer Science, Stanford University huaxiu@cs.stanford.edu +* Department of Statistics & Actuarial Science, University of Hong Kong +yuancao@hku.hk + +# ABSTRACT + +The goal of meta-learning is to learn a good prior model from a collection of tasks such that the learned prior is able to adapt quickly to new tasks without accessing many data from the new tasks. A common practice in meta-learning is to perform a train-validation split on each task, where the training set is used for adapting the model parameter to that specific task and the validation set is used for learning a prior model that is shared across all tasks. Despite its success and popularity in multitask learning and few-shot learning, the understanding of the train-validation split is still limited, especially when the neural network models are used. In this paper, we study the benefit of train-validation split for classification problems with neural network models trained by gradient descent. For first-order model-agnostic meta-learning (FOMAML), we prove that the train-validation split is necessary to learn a good prior model when the noise in the training sample is large, while the train-train method fails. We validate our theory by conducting experiment on both synthetic and real datasets. To the best of our knowledge, this is the first work towards the theoretical understanding of train-validation split in meta-learning with neural networks. + +# 1 INTRODUCTION + +In recent years, meta-learning has gained increasing popularity and been successfully applied to a wide range of problems including few-shot learning (Ren et al., 2018; Li et al., 2017; Rusu et al., 2018; Snell et al., 2017), reinforcement learning (Gupta et al., 2018b;a), neural machine translation (Gu et al., 2018), and neural architecture search (NAS) (Liu et al., 2018; Real et al., 2019). A popular meta-learning idea is to formulate it as a bi-level optimization problem, where the inner level computes the parameter adaptation to each task, while the outer level tries to minimize the meta-training loss. Such a bi-level optimization formulation is empirically proved effective to learn new tasks quickly using only a few examples with the aid of past experience. Following this idea, meta-learning algorithms such as model agnostic meta-learning (MAML) (Finn et al., 2017) have achieved remarkable success in many applications. + +Due to the nature of bi-level optimization, meta-learning algorithms can often take advantage of a train-validation split in the dataset, so that the inner and outer levels of the algorithm use different data points (Finn et al., 2017; Rajeswaran et al., 2019; Bai et al., 2021; Fallah et al., 2020). It is believed that the train-validation split can help the meta-learning algorithm to achieve a better performance. There has been several attempts to understand the importance of train-validation split in meta-learning for linear models (Wang et al., 2021; Bai et al., 2021; Saunshi et al., 2021). Specifically, Wang et al. (2021) showed that when learning linear models, the train-train method performs much worse than the train-validation method if the sample size is small and the noise is large. They also show that the train-train method is able to perform well on linear models when the sample size is large enough. Bai et al. (2021) considered the linear centroid model introduced in Denevi + +et al. (2018b) and showed that the train-validation method outperforms the train-train method in an agnostic setting, while in the realizable noiseless setting, the train-train method can asymptotically achieve a strictly smaller mean square error than the train-validation method as the sample size and dimension go to infinity at a fixed ratio. Saunshi et al. (2021) considered a representation learning perspective, and demonstrated that train-validation split encourages the learned representation to be low-rank while the train-train method encourages high-rank representations. However, all these works focus on the linear regression setting, while the advantage of train-validation split remains elusive for meta-learning with neural networks. + +Based on the above observation, we raise the following question: + +# How does train-validation split affect the meta learning with neural networks? + +In this paper, we answer the above question via a case study of few-shot binary classification using a two-layer convolutional neural network. We consider a learning problem where the data model consists of large noises, and only a limited number of data are available. Under this setting, we theoretically compare the performance of first-order MAML (FOMAML (Finn et al., 2017)), which is a simplification of MAML that ignores the hessian terms, with a train-validation split (the train-validation method) and without a train-validation split (the train-train method). We summarize our contributions as follows: + +1. We show that under our setting, despite the complex bi-level structure of the FOMAML loss and its non-convex landscape, it is guaranteed that the train-validation method and the traintrain method can both train a two-layer CNN to a global minimum of the training loss with high probability. +2. We also demonstrate that there is a significant performance gap on new test data. Specifically, we show that the neural network trained by the train-validation method can achieve a test loss that decreases exponentially fast as the number of training tasks increase. On the other hand, we also show that the train-train method can at best achieve a constant level test loss. +3. Our study demonstrates the importance of train-validation split in learning neural networks. To the best of our knowledge, this is the first theoretical work studying train-validation split of meta-learning with neural networks. Notably, the learning problem we consider is linearly realizable, for which Bai et al. (2021) showed that the train-train method can asymptotically achieve better MSE than the train-validation method under a linear model. However, our results give the opposite conclusion for learning CNNs – the train-validation method still outperforms the train-train method even for linearly realizable learning problems. Therefore, our results indicate that train-validation split may have a more significant advantage when learning complicated prediction models. +4. We perform experiments on both synthetic and real datasets with neural networks as backbone model to justify our theoretical results. In particular, even when the data and the neural network structure do not meet our theoretical assumptions, the experiment results still corroborate our theory to a certain extent. This demonstrates the practical value of our analysis. + +Notation. For an integer $k$ , we denote $[k] = \{1, 2, \dots, k\}$ . Given two sequences $\{x_n\}$ and $\{y_n\}$ with $y_n > 0$ , we denote $x_n = \mathcal{O}(y_n)$ if $|x_n| / y_n$ is upper bounded by a constant for all $n$ . Similarly, we denote $x_n = \Omega(y_n)$ if $|x_n| / y_n$ is lower bounded by a positive constant. We denote $x_n = \Theta(y_n)$ if $x_n = O(y_n)$ and $x_n = \Omega(y_n)$ . Finally, we use $\widetilde{\mathcal{O}}(\cdot), \widetilde{\Omega}(\cdot),$ and $\widetilde{\Theta}(\cdot)$ to hide logarithmic factors. + +# 2 ADDITIONAL RELATED WORK + +Optimization and generalization guarantees for meta-learning. A number of recent works studied the optimization guarantees for meta-learning algorithms. Finn & Levine (2017) proved the universality of gradient based meta-learning. Wang et al. (2020) studied the global optimality conditions for MAML with a nonconvex objective. Fallah et al. (2020) studied the convergence guarantee for MAML with nonconvex loss function and proposed Hessian-Free MAML with the same theoretical guarantee of MAML without accessing second order information. Finn et al. (2019); Balcan et al. (2019); Khodak et al. (2019); Denevi et al. (2019; 2018a) studied online meta-learning using online convex optimization. Another series of works have also studied the generalization error and sample complexities of meta-learning methods. Specifically, Amit & Meir (2018) extended the PAC-Bayes argument to the meta-learning setting and established a generalization error bound for + +meta-learning. Saunshi et al. (2020) analyzed the sample complexity under the nonconvex setting using Reptile (Nichol et al., 2018). There has also been a stream of work studying generalization in meta-learning from the representation learning perspective (Du et al., 2020; Tripuraneni et al., 2020; Denevi et al., 2018a). These works do not employ a train-validation split, instead they assume some underlying low-rank constraints on the representation. Chen et al. (2022); Huang et al. (2022); Wang et al. (2022) also studied generalization error bounds for meta-learning in the overparametrized regime. + +Feature learning in over-parameterized neural networks. There is a series of recent work studying the feature learning dynamics of neural networks. For example, Allen-Zhu & Li (2020a) studied a sparse coding model and showed that adversarial training can help CNN filters to learn "pure" dictionary bases. Allen-Zhu & Li (2020b) studied the impact of ensemble and knowledge distillation on the feature learning process. Zou et al. (2021) demonstrated the generalization gap between Adam and stochastic gradient descent through the lens of feature learning. Cao et al. (2022) studied feature learning and noise memorization in learning two-layer CNNs and showed a phase transition between benign and harmful overfitting. + +# 3 PROBLEM SETUP + +In this section, we introduce our data model, neural network model, loss function, and the details about the FOMAML algorithm with train-train and train-validation methods. + +We first introduce our data model. In meta-learning, the goal is to train a model based on the data from $K$ tasks, so that the trained model can learn a new task efficiently. Theoretical analysis of meta-learning thus requires careful modeling of (i) the relation among different tasks, and (ii) the data distribution for each specific task. To achieve this, we suppose that the data distribution $\mathcal{D}_k$ for the $k$ -th task is defined based on a vector $\pmb{\nu}_k$ , i.e., $\mathcal{D}_k = \mathcal{D}(\pmb{\nu}_k)$ , and that the vectors $\pmb{\nu}_1, \dots, \pmb{\nu}_K$ are independently drawn from a distribution $\Pi$ . Following this framework, the data points of a new task can be generated by first sampling a vector $\tilde{\pmb{\nu}}$ from $\Pi$ , then sampling data from the distribution $\mathcal{D}(\tilde{\pmb{\nu}})$ . In the following, we present the detailed definitions of $\Pi$ and $\mathcal{D}(\tilde{\pmb{\nu}})$ . + +Definition 3.1 (Distribution of tasks). Let $\nu, \mathbf{z}_1, \ldots, \mathbf{z}_M \in \mathbb{R}^d$ be fixed vectors, where $\mathbf{z}_1, \ldots, \mathbf{z}_M$ are orthogonal to $\nu$ . A vector $\tilde{\nu}$ is generated from $\Pi$ by (i) randomly pick a vector $\mathbf{z}$ from $\{\mathbf{z}_1, \ldots, \mathbf{z}_M\}$ , and (ii) let $\tilde{\nu} = \nu + \mathbf{z}$ . + +Definition 3.1 is based on a set of fixed vectors $\nu, \mathbf{z}_1, \ldots, \mathbf{z}_M \in \mathbb{R}^d$ . Here $\nu$ captures the feature shared by all tasks. And $\mathbf{z}_1, \ldots, \mathbf{z}_M$ give a dictionary of possible unique features of each specific task. It is important to note that we focus on the setting where the number of observed tasks $K \ll M$ . Under our setting, with high probability, different tasks will use different unique features. + +Definition 3.2 (Distribution of data). Given a vector $\tilde{\nu} \in \mathbb{R}^d$ , each data point $(\mathbf{x}, y)$ with $\mathbf{x} = [\mathbf{x}^{(1)\top}, \mathbf{x}^{(2)\top}]^\top \in \mathbb{R}^{2d}$ and $y \in \{-1, 1\}$ is generated from $\mathcal{D}(\tilde{\nu})$ as follows: + +1. The label $y$ is assigned as $+1$ or $-1$ with equal probability. +2. A noise vector $\pmb{\xi}$ is generated from $\mathcal{N}(\mathbf{0},\sigma_{\xi}^{2}\cdot (\mathbf{I} - \mathbf{P}))$ , where $\mathbf{P}\in \mathbb{R}^{d\times d}$ is the projection operator onto span( $\{\pmb {\nu},\mathbf{z}_1,\dots ,\mathbf{z}_M\}$ ). +3. One of $\mathbf{x}^{(1)},\mathbf{x}^{(2)}$ is randomly selected and assigned as $y\cdot \nu_{k}$ ; the other is assigned as $\pmb{\xi}$ . + +For $k \in [K]$ , we denote by $\mathcal{S}_k = \{(\mathbf{x}_{k,i},y_{k,i})\}_{i=1}^n$ the set of independent samples from the $k$ -th observed task. We consider a specific type of data input that consists of two patches, $\mathbf{x}_{k,i} = [\mathbf{x}_{k,i}^{(1)\top},\mathbf{x}_{k,i}^{(2)\top}]^\top$ , to meet our study of convolutional neural networks. Note also that Definition 3.2 requires the noises in the data input to be sampled from the Gaussian distribution $\mathcal{N}(\mathbf{0},\sigma_{\xi}^2\cdot (\mathbf{I} - \mathbf{P}))$ to ensure that the noise vector $\pmb{\xi}$ is orthogonal to the features $\pmb{\nu},\mathbf{z}_1,\dots,\mathbf{z}_M$ . It is then easy to check that our data model is linearly realizable: the linear predictor $\theta^{*} = \| \pmb{\nu}\|_{2}^{-2}\cdot [\pmb{\nu}^{\top},\pmb{\nu}^{\top}]^{\top} \in \mathbb{R}^{2d}$ satisfy $\langle \pmb{\theta}^{*},\mathbf{x}\rangle = y$ for all $(\mathbf{x},y)$ drawn from our data distribution. Our motivation to study this linearly realizable setting is that it has been proved in Bai et al. (2021) that the train-train method is strictly better than the train-validation method when learning linear models in the realizable setting. On the contrary, in this paper we aim to show that for the linearly realizable data model defined in Definitions 3.1 and 3.2, the train-validation method can still outperform the train-train method for FOMAML in learning two-layer CNNs. + +We study a two-layer CNN with $m$ hidden layer neurons whose second layer weights are frozen as $\pm 1$ 's. We use the Huberized-ReLU (Chatterji et al., 2021) activation function, which is defined as + +$$ +\sigma (z) = \left\{ \begin{array}{l l} 0, & z < 0 \\ z ^ {2} / (2 h), & z \in [ 0, h ] \\ z - h / 2, & \text {o t h e r w i s e}. \end{array} \right. +$$ + +where we set $h = 1/2$ in our analysis. Let $\mathbf{W}$ represent the collection of all weights of our network. For a data input $\mathbf{x} = [\mathbf{x}^{(1)\top},\mathbf{x}^{(2)\top}]^\top$ , we consider the CNN $f(\mathbf{W},\mathbf{x}) = F_{+1}(\mathbf{W}_{+1},\mathbf{x}) - F_{-1}(\mathbf{W}_{-1},\mathbf{x})$ , where + +$$ +F _ {j} (\mathbf {W} _ {j}, \mathbf {x}) = \sum_ {r = 1} ^ {m} \sum_ {p = 1} ^ {2} \sigma (\langle \mathbf {w} _ {j, r}, \mathbf {x} ^ {(p)} \rangle), j \in \{- 1, 1 \}. +$$ + +We use $\mathbf{w}_{j,r}$ to denote the $r$ -th convolution filter with second layer weight $j$ , and use $\mathbf{W}_j$ to denote the collection of $\mathbf{w}_{j,1},\ldots ,\mathbf{w}_{j,m}$ . We consider cross-entropy loss. The loss of a data point $(\mathbf{x},y)$ is given by $\mathcal{L}(\mathbf{W},\mathbf{x},y) = \ell [y\cdot f(\mathbf{W},\mathbf{x})]$ , where $\ell (z) = \log (1 + \exp (-z))$ . The loss of a collection of data points $\mathcal{S}$ is defined by + +$$ +\mathcal {L} (\mathbf {W}, \mathcal {S}) = \frac {1}{| \mathcal {S} |} \sum_ {(\mathbf {x}, y) \in \mathcal {S}} \mathcal {L} (\mathbf {W}, \mathbf {x}, y). +$$ + +Following the data model given in Definitions 3.1 and 3.2, we define the test loss achieved by a CNN with weights $\mathbf{W}$ as $\mathcal{L}_{\mathrm{test}}(\mathbf{W}) \coloneqq \mathbb{E}_{\tilde{\nu} \sim \Pi, (\mathbf{x}, y) \sim \mathcal{D}(\tilde{\nu})} \ell(y \cdot f(\mathbf{W}, \mathbf{x}))$ . We implement the FOMAML algorithm (Finn et al., 2017) to train the neural network. The train-train and train-validation methods are given as follows. + +Train-train: for each task $k$ , we use all of the samples for adapting the parameter in the inner-loop updates. Specifically, the meta objective is to minimize + +$$ +\widehat {\mathcal {L}} ^ {\mathrm {t r - t r}} \left(\mathbf {W}, \left\{\mathcal {S} _ {k} \right\} _ {k = 1} ^ {K}\right) = \frac {1}{K} \sum_ {k = 1} ^ {K} \mathcal {L} \left(\widetilde {\mathbf {W}} \left(\mathbf {W}, \mathcal {S} _ {k}\right), \mathcal {S} _ {k}\right), +$$ + +where $\widetilde{\mathbf{W}} (\mathbf{W},\mathcal{S}_k)$ represents the weights of the network after $J$ gradient descent steps (w.r.t. loss $\mathcal{L}(\cdot ,\mathcal{S}_k))$ starting from $\mathbf{W}$ with step size $\gamma$ . The FOMAML algorithm updates the CNN weights using the following gradient update rule with step size $\eta$ : + +$$ +\mathbf {W} ^ {(t + 1)} = \mathbf {W} ^ {(t)} - \eta \cdot \frac {1}{K} \sum_ {k = 1} ^ {K} \nabla_ {\mathbf {W}} \mathcal {L} (\mathbf {W}, \mathcal {S} _ {k}) | _ {\mathbf {W} = \widetilde {\mathbf {W}} \left(\mathbf {W} ^ {(t)}, \mathcal {S} _ {k}\right)}. \tag {3.1} +$$ + +Train-validation: for each task $k$ , we denote by $\mathcal{I}_k^{\mathrm{tr}} = \{1, \dots, n_1\}$ the training data indices, and $\mathcal{I}_k^{\mathrm{val}} = \{n_1 + 1, \dots, n\}$ the validation data indices. We then use $S_k^{\mathrm{tr}} = \{(\mathbf{x}_{k,i}, y_{k,i})\}_{i \in \mathcal{I}_k^{\mathrm{tr}}}$ as the training data set, and $S_k^{\mathrm{val}} = \{(\mathbf{x}_{k,i}, y_{k,i})\}_{i \in \mathcal{I}_k^{\mathrm{val}}}$ as the validation data set. The meta objective of the train-validation method is to minimize + +$$ +\widehat {\mathcal {L}} ^ {\mathrm {t r - v a l}} (\mathbf {W}, \{S _ {k} \} _ {k = 1} ^ {K}) = \frac {1}{K} \sum_ {k = 1} ^ {K} \mathcal {L} (\widetilde {\mathbf {W}} (\mathbf {W}, S _ {k} ^ {\mathrm {t r}}), S _ {k} ^ {\mathrm {v a l}}), +$$ + +where $\widetilde{\mathbf{W}} (\mathbf{W},\mathcal{S}_k^{\mathrm{tr}})$ represents the weights of the network after $J$ gradient descent steps (w.r.t. loss $\mathcal{L}(\cdot ,\mathcal{S}_k^{\mathrm{tr}}))$ starting from $\mathbf{W}$ with step size $\gamma$ . For the train-validation method, the FOMAML algorithm implements the following outer-loop update rule to train the network: + +$$ +\mathbf {W} ^ {(t + 1)} = \mathbf {W} ^ {(t)} - \eta \cdot \frac {1}{K} \sum_ {k = 1} ^ {K} \nabla_ {\mathbf {W}} \mathcal {L} \left(\mathbf {W}, \mathcal {S} _ {k} ^ {\text {v a l}}\right) | _ {\mathbf {W} = \tilde {\mathbf {W}} \left(\mathbf {W} ^ {(t)}, \mathcal {S} _ {k} ^ {\text {t r}}\right)}. \tag {3.2} +$$ + +# 4 MAIN RESULTS + +In this section, we present our theoretical results for the train-train and train-validation methods. We first introduce the following condition. + +Condition 4.1. There exists $\sigma_s > 0$ such that $(1/2) \cdot \sigma_s \sqrt{d} \leq \| \mathbf{z}_i \|_2 \leq (3/2) \cdot \sigma_s \sqrt{d}$ for $i \in [M]$ , and $\langle \mathbf{z}_i, \mathbf{z}_j \rangle \leq O(\sigma_s^2 \cdot \sqrt{d \log(d)})$ for all $i \neq j$ . + +Condition 4.1 specifies the properties of the task-specific features in Definition 3.1. Here we require that the task-specific features to have weak correlations to each other, which is standard in dictionary learning. Moreover, it is easy to see that such $\mathbf{z}_1,\ldots ,\mathbf{z}_M$ exist as long as $M = \mathcal{O}(\mathrm{poly}(d))$ : with a simple Gaussian concentration argument, one can show that $M$ independent zero-mean Gaussian random vectors with covariance matrix $\sigma_s^2 (\mathbf{I} - \pmb {\nu}\pmb{\nu}^\top /\| \pmb {\nu}\| _2^2)$ are orthogonal to $\pmb{\nu}$ and satisfy Condition 4.1 with high probability. + +With Condition 4.1 and our data model in Definitions 3.1 and 3.2, it is necessary for a neural network to learn the shared feature $\pmb{\nu}$ to make accurate predictions on a new task. On the other hand, if a neural network only utilizes the task-specific features or the noises in the observed data to fit the labels, then it can only achieve a good training loss, but will have a poor prediction accuracy on new tasks. Following this intuition, we aim to construct a concrete setting under which the train-train and train-validation methods give different test losses while both achieving small training losses. The details of our constructed setting is summarized in the following condition. + +Condition 4.2. $\| \pmb{\nu}\|_{2} = 1$ , $\sigma_{\xi} = d^{-1 / 2}\cdot \mathrm{polylog}(d)$ , $\sigma_{s} = d^{-1 / 2} / \mathrm{polylog}(d)$ , $n = \Theta (1)$ , $K = \mathrm{polylog}(d)$ , $m = \mathrm{polylog}(d)$ , $\Omega (d^{1 / 2})\leq M\leq d / 2$ + +Condition 4.2 defines an over-parameterized setting where $d \gg Kn$ . Moreover, under Condition 4.2, the norms of the shared and task-specific features $\| \pmb{\nu} \|_2, \| \mathbf{z}_1 \|_2, \dots, \| \mathbf{z}_K \|_2$ are all $\mathcal{O}(1)$ . In comparison, with high probability, the norms of noise vectors in the data are $\Theta(\mathrm{polylog}(d))$ . Therefore, Condition 4.2 defines a setting with relatively large noises. + +The FOMAML algorithm involves inner and outer-loop training of the neural network. We specify our detailed hyper-parameter configurations in the following condition. + +Condition 4.3. In the FOMAML algorithm defined in Eq. (3.1) and Eq. (3.2), we initialize the CNN weights $\mathbf{W}^{(0)}$ by Gaussian random initialization with standard deviation $\sigma_0 = d^{-1/2}$ . We set the inner-loop step size $\gamma = \mathrm{polylog}(d)$ , and the outer-loop step size $\eta = 1 / \mathrm{polylog}(d)$ . We run $T = \mathrm{poly}(d)$ outer-loop iterations. Within each outer-loop iteration, we run $J = 5$ inner-loop gradient descent steps. + +In Condition 4.3, we use a slightly larger step size for inner-loop compared to that for the outer-loop. This is to ensure that the inner-loop updates can make a difference, and it matches the meta-learning practice. Moreover, we set $J = 5$ to demonstrate that our analysis applies to the case with multiple inner-loop iterations. The exact value of $J$ is not essential - we can easily apply our analysis to other values of $J = \Theta(1)$ . + +We are now in the position to state our main theoretical results. The theorem below gives the training and test loss guarantees for the train-train method. + +Theorem 4.4. Under Conditions 4.1, 4.2 and 4.3, suppose that one uses the train-train method to train the neural network. Then with probability at least $1 - (Kn)^{-10}$ , + +1. the training loss is small: + +$$ +\min _ {t \in [ T ]} \widehat {\mathcal {L}} ^ {\operatorname {t r} - \operatorname {t r}} \left(\boldsymbol {W} ^ {(t)}, \left\{\mathcal {S} _ {k} \right\} _ {k = 1} ^ {K}\right) \leq \mathcal {O} \left(\frac {1}{\operatorname {p o l y} (d)}\right). +$$ + +2. the test loss is large: + +$$ +\min _ {t \in [ T ]} \mathcal {L} _ {\text {t e s t}} (\boldsymbol {W} ^ {(t)}) = \Omega (1). +$$ + +Theorem 4.4 demonstrates that FOMAML with train-train method can successfully train the CNN to minimize the training loss. However, it also shows that the train-train method fails on new tasks and can only achieve a constant level test loss. In comparison, we have the following theorem for the train-validation method. + +Theorem 4.5. Under Conditions 4.1, 4.2 and 4.3, suppose that one uses the train-validation method to train the neural network. Then with probability at least $1 - (Kn)^{-10}$ , + +1. the training loss is small: + +$$ +\min _ {t \in [ T ]} \widehat {\mathcal {L}} ^ {\operatorname {t r - v a l}} \left(\boldsymbol {W} ^ {(t)}, \left\{\mathcal {S} _ {k} \right\} _ {k = 1} ^ {K}\right) \leq \mathcal {O} \left(\frac {1}{\operatorname {p o l y} (d)}\right). +$$ + +2. the test loss is also small: there exists a constant $c > 0$ such that + +$$ +\mathcal {L} _ {\text {t e s t}} \left(\boldsymbol {W} ^ {(T)}\right) = \mathcal {O} \left(\exp \left(- K ^ {c}\right)\right). +$$ + +Although both methods can achieve a $1 / \mathrm{poly}(d)$ training loss, the train-validation method is able to achieve a test loss of $\mathcal{O}(\exp (-K^c))$ compared to a constant test loss $\Omega (1)$ by the train-train method. Thus, Theorems 4.4 and 4.5 show that for our data model, it is necessary to perform a train-validation split to achieve good performance on test data. + +We also compare FOMAML with the vanilla supervised learning framework where one simply combines all data from the $K$ tasks together and uses gradient descent to minimize the overall cross-entropy loss. In fact, the results of Theorem 4.4 still hold even for $J = 0$ , where algorithm Eq. (3.1) reduces to gradient descent for vanilla supervised learning. Therefore, vanilla supervised learning can also only achieve $\Theta(1)$ test loss. Clearly, our results imply that FOMAML with train-validation split can significantly outperform vanilla supervised learning when learning our data model. + +Comparison with Bai et al. (2021). Recently, Bai et al. (2021) studied the importance of the train-validation split in meta-learning under the linear centroid framework. Specifically, they considered linear ridge regression in the inner-loop and linear ridgeless regression in the outer-loop, and showed that the train-train method strictly outperforms the train-validation method in the realizable setting. As we have discussed in Section 3, our data model is linearly realizable, and thus by Bai et al. (2021), the train-train method should outperform the train-validation method when learning our data model with linear ridge/ridgeless regression. On the contrary, Theorems 4.4 and 4.5 demonstrate that the train-validation method still significantly outperforms the train-train method for FOMAML in learning CNNs. We believe the key reason behind this difference is that the CNN model has a much higher expressive power, and therefore can more easily overfit noises in the training data points when using FOMAML. The train-validation split thus greatly helps feature learning of the neural network by performing a sample splitting between the inner and outer-loops. Therefore, our results indicate that train-validation split may have a more significant advantage when learning complicated prediction models. + +# 5 EXPERIMENT + +# 5.1 EXPERIMENTAL SETUPS + +Synthetic data. We generate synthetic data to test our theory. For our data generation we choose: $d = 1000$ , $K = 343$ , $n = 10$ , $\sigma_{\xi} = 10.42$ , $\sigma_{s} = 0.00066$ , $\| \boldsymbol{\nu} \|_2 = 1$ . For our neural network we choose: $m = 18$ , $\sigma_0 = 0.032$ . And finally we choose the following parameters for inner and outer level optimization: $\gamma = 0.001$ , $J = 5$ , $\eta = 0.0001$ . + +Real-world Data. In our experiments, we further justify our theoretical findings in two real-world datasets: RainbowMNIST, miniImagenet, which are discussed as follows. + +- RainbowMNIST. Following (Yao et al., 2021), RainbowMNIST is a 10-way meta-learning dataset built upon original MNIST dataset, where each task is constructed by applying one combination of image transformations (e.g., coloring, rotation) on the original data. Here, 40 and 16 combinations are used for meta-training and meta-testing, respectively. +- miniImagenet. Following the traditional meta-learning setting (Finn & Levine, 2017; Snell et al., 2017), miniImagenet dataset is split into meta-training, meta-validation and meta-testing classes, where 64/16/20 classes are used for meta-training/validation/testing. We adopt the traditional N-way, K-shot setting to split the training and validation set in our experiment, where $\mathrm{N} = 5$ and $\mathrm{K} = 1$ in this paper (i.e., 5-way, 1-shot learning). + +Backbones and Hyperparameters. For all real-world datasets, follow (Finn & Levine, 2017; Snell et al., 2017), we adopt the standard four-block convolutional layers as the base learner, where Huberized-ReLU is used as the activation function. The number of inner-loop steps is set as 5. The inner-loop and outer-loop learning rates are set as: 0.01 and 0.001 (miniImagenet), 0.1 and 0.01 + +(RainbowMNIST), respectively. We report the average accuracy with $95\%$ confidence interval over all meta-testing tasks. For synthetic data, we follow our theoretical analysis and report the cross-entropy loss with $95\%$ confidence interval over all meta-testing tasks. The inner-loop and out-loop learning rates are 0.01, 0.001, respectively. + +# 5.2 RESULTS + +Comparison between Different Activation Functions. We first conduct experiments to compare the performance between Huberized-ReLU activation function used in our theoretical analysis and the traditional ReLU function. The results are reported in Table 1, indicating that Huberized-ReLU performs similarly to ReLU. Thus it is a reasonable replacement to simplify our analysis. + +Table 1: Performance comparison between different activation functions. + +
SettingActivationSyntheticRainbowMNISTminiImagenet
Loss ↓Acc ↑Acc ↑
Train-TrainReLU8.22 ± 0.4268.70 ± 0.51%27.19 ± 1.23%
Huberized-ReLU8.50 ± 0.4365.32 ± 0.54%25.93 ± 1.10%
Train-ValidationReLU4.62 ± 0.2487.68 ± 0.21%46.73 ± 1.32%
Huberized-ReLU4.66 ± 0.2387.52 ± 0.20%46.15 ± 1.36%
+ +Performance w.r.t. the Number of Inner-Loop Steps. We further compare the performance between the train-train and train-validation methods for different inner-loop optimization steps. The results are reported in Table 2. According to the results, we observe that the train-validation split performs much better than the train-train method with more inner-loop steps. This is what we expected since less number of inner-loop steps corresponds to less overfitting to the training set during the inner-loop optimization. In the case of using less inner-loop steps, using the training set in the outer-loop optimization can still contribute to the optimization. + +Table 2: Performance comparison of the number of optimization steps in the inner-loop. + +
Setting# of Inner StepsSyntheticRainbowMNISTminiImagenet
Loss ↓Acc ↑Acc ↑
1 stepTrain-Train7.22 ± 0.3779.76 ± 0.41%25.09 ± 1.11%
Train-Validation4.81± 0.2485.83 ± 0.25%25.17 ± 1.04%
5 stepsTrain-Train8.50 ± 0.4365.32 ± 0.54%25.93 ± 1.10%
Train-Validation4.66 ± 0.2387.52 ± 0.20%46.15 ± 1.36%
+ +Performance w.r.t. the Inner-Loop Learning Rate and the Outer-Loop Learning Rate. Finally, we analyze the influence of inner-loop and outer-loop learning rates. The results in Table 3 show that train-validation split performs better when the inner-loop learning rate is smaller than the outer-loop learning rate, which corroborates our theoretical results. On synthetic data, the train-train method performs better when the outer-loop learning rate larger than the inner-loop learning rate. This is not surprising since smaller inner-loop learning rate corresponds to less overfitting, similar to the phenomenon when using less inner-loop optimization steps (Table 2). + +Table 3: Performance w.r.t. the inner-loop learning rate and the outer-loop learning rate. + +
SettingLearning RateSyntheticRainbowMNISTminiImagenet
Loss ↓Acc ↑Acc ↑
outer-lr > inner-lrTrain-Train5.76 ± 0.3964.82 ± 0.48%20.00 ± 0.00%
Train-Validation5.21 ± 0.3166.13 ± 0.31%20.00 ± 0.00%
outer-lr < inner-lrTrain-Train8.50 ± 0.4365.32 ± 0.54%20.00 ± 0.10%
Train-Validation4.66 ± 0.2387.52 ± 0.20%46.15 ± 1.36%
+ +# 6 OVERVIEW OF PROOF TECHNIQUES + +From here onward, we will use upper script $(t,\tau)$ on $\mathbf{w}_{j,r}$ to denote the $t$ -th outer-loop iteration and the $\tau$ -th inner-loop iteration. However, according to Eq. (3.1) and Eq. (3.2), the inner-loop updates + +for a CNN filter $\mathbf{w}_{j,r}$ is task-specific. Therefore we cannot rigorously use the notation $\mathbf{w}_{j,r}^{(t,\tau)}$ without referring to a specific task $k$ . Luckily, all our analyses are based on the study of inner products of the form $\langle \mathbf{w}_{j,r},\mathbf{x}_{k,i}^{(p)}\rangle$ . We can use the notation $\langle \mathbf{w}_{j,r}^{(t,\tau)},\mathbf{x}_{k,i}^{(p)}\rangle$ as the inner product after $t$ outer-loop updates followed by $\tau$ inner-loop updates, where the inner-loop updates only use samples from task $k$ . With these notations, we give the following two key lemmas that highlight the main differences between the train-train and train-validation methods. + +Lemma 6.1. Suppose one uses the train-train method to train the neural network. Let $T_{k,i}^{(1)}$ be the first iteration such that $\max_{r\in [m]}\langle \pmb{w}_{j,r}^{(t,0)},\pmb{\xi}_{k,i}\rangle \geq \Omega \big(1 / \mathrm{polylog}(d)\big)$ for $k\in [K]$ , $i\in [n]$ , and $j = y_{k,i}$ . Then, under the same condition as in Theorem 4.4, for any $t\leq T_{k,i}^{(1)}$ , + +1. for any $k' \in [K]$ , $r \in [m]$ , and $j' \in \{-1, 1\}$ we have + +$$ +j ^ {\prime} \langle \boldsymbol {w} _ {j ^ {\prime}, r} ^ {(t, J)}, \boldsymbol {\nu} _ {k ^ {\prime}} \rangle \leq | \langle \boldsymbol {w} _ {j ^ {\prime}, r} ^ {(t, 0)}, \boldsymbol {\nu} _ {k ^ {\prime}} \rangle | \mathcal {O} (1) \gamma^ {J}. +$$ + +2. for $r = \arg \max_{r' \in [m]} \langle \pmb{w}_{j,r'}^{(t,0)}, \pmb{\xi}_{k,i} \rangle$ , + +$$ +\left\langle \boldsymbol {w} _ {j, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k, i} \right\rangle \geq \left\langle \boldsymbol {w} _ {j, r} ^ {(t, 0)}, \boldsymbol {\xi} _ {k, i} \right\rangle \Omega (1) \left(\gamma \Theta (\operatorname {p o l y l o g} (d))\right) ^ {J}. +$$ + +Lemma 6.2. Suppose one uses the train-validation method to train the neural network. Let $T_{j}^{(2)}$ be the first iteration such that $\max_{r\in [m]}j\langle \pmb{w}_{j,r}^{(t,0)},\pmb {\nu}\rangle \geq \Omega (1 / \mathrm{polylog}(d))$ for $j\in \{-1,1\}$ . Then, under the same condition as in Theorem 4.5, for any $t\leq T_j^{(2)}$ , + +1. for any $k \in [K]$ and $r = \arg \max_{r' \in [m]} j(\pmb{w}_{j,r'}^{(t,0)}, \pmb{\nu})$ + +$$ +j \langle \boldsymbol {w} _ {j, r} ^ {(t, J)}, \boldsymbol {\nu} _ {k} \rangle = \Omega (1) j \langle \boldsymbol {w} _ {j, r} ^ {(t, 0)}, \boldsymbol {\nu} _ {k} \rangle \Theta (1) \gamma^ {J}. +$$ + +2. for any $r \in [m]$ , $k \in [K]$ , $i \in \mathcal{I}_k^{\mathrm{val}}$ , and $j' \in \{-1, 1\}$ + +$$ +\left\langle \boldsymbol {w} _ {j ^ {\prime}, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k, i} \right\rangle \leq \mathcal {O} \Big (\max \left\{\left\langle \boldsymbol {w} _ {j ^ {\prime}, r} ^ {(t, 0)}, \boldsymbol {\xi} _ {k, i} \right\rangle , J \widetilde {\mathcal {O}} \left(d ^ {- 1 / 2}\right) \right\} \Big). +$$ + +The above two lemmas give some intuitions for the better generalization power of the train-validation method. According to Lemma 6.1, the $J$ inner-loop gradient steps amplify the noise inner products more than the feature inner product for the train-train method. On the contrary, by Lemma 6.2, the $J$ inner-loop gradient steps amplify the feature inner product and do not have a big impact on the noise inner products for the train-validation method. + +In the rest of this section, we mainly sketch the proof of Theorem 4.5 for the train-validation method. Based on Lemma 6.2, we can see that the inner-loop updates in the train-validation method prioritizes feature learning over noise memorization. Our further study of the outer-loop training procedure gives the following lemma. + +Lemma 6.3. Under the same condition as in Theorem 4.5, let $T^{(2)} = \max_j T_j^{(2)}$ , where $T_j^{(2)}$ is defined in Lemma 6.2. Then $\max_{r\in [m]}\langle \pmb{w}_{j,r}^{(T^{(2)},0)},\pmb{\xi}_{k,i}\rangle = \widetilde{\mathcal{O}} (d^{-1 / 2})$ for any $k\in [K]$ , $i\in \mathcal{I}_k^{\mathrm{val}}$ and $j\in \{-1,1\}$ . + +We remind our readers that $T^{(2)}$ (defined in Lemma 6.2) represents the time taken for the feature inner product to grow to $\Omega(1/polylog(d))$ . Therefore Lemma 6.3 is essentially still a comparison between the growth rate of feature and noise inner products: it shows that when the feature inner product grows to $\widetilde{\Theta}(1)$ , the noise inner products still remain at their initialization order which is $\widetilde{\mathcal{O}}(d^{-1/2})$ . The next lemma provides a key result for the convergence of the training loss. + +Lemma 6.4. Let $T = \mathrm{poly}(d)$ be the total number of iterations. Under the same condition as in Theorem 4.5, we have + +$$ +\min _ {t \in [ T ^ {(2)}, T - 1 ]} \sum_ {(k, i) \in \Psi} - \ell_ {k, i} ^ {\prime (t, J)} \leq \tilde {\mathcal {O}} \left(\frac {1}{T \eta}\right), +$$ + +where $\ell_{k,i}^{\prime (t,J)} = \ell^{\prime}(y_{k,i}\cdot f(\widetilde{W} (\pmb{W}^{(t)},\mathcal{S}_{k}^{\mathrm{tr}}),\pmb{x}_{k,i}))$ + +By definition, the feature inner product has grown to $\Omega(1/polylog(d))$ at time $T^{(2)}$ . After $T^{(2)}$ , we implement a more careful study of the training process, as some data points may have been well-fitted (with a small loss) and no longer significantly contribute to the training. Our next theorem shows that using the train-validation method, after $T^{(2)}$ , the feature inner product will grow even larger and will be at least $\Omega(K^c)$ for some $c > 0$ at the end of the training. + +Lemma 6.5. Under the same condition as in Theorem 4.5, suppose one runs the train-validation method for a total of $T = \mathrm{poly}(d)$ iterations. Then $\max_{r\in [m]}j\langle \pmb{w}_{j,r}^{(T,0)},\pmb {\nu}\rangle \geq \Omega (K^c)$ for all $j\in \{-1,1\}$ and for some $c > 0$ . + +Lemma 6.5 shows that at the end of training, the neural network has sufficiently learned the shared feature $\pmb{\nu}$ . When given a fresh task, we should expect a small test loss because the shared feature $\pmb{\nu}$ will also be present in this newly sampled task. + +We are now ready to present the proof of Theorem 4.5. + +Proof of Theorem 4.5. By definition, $\widehat{\mathcal{L}}^{\mathrm{tr - val}}(\mathbf{W}^{(t)},\{\mathcal{S}_k\}_{k = 1}^K) = \sum_{k\in [K]}\sum_{i\in \mathcal{I}_k^{\mathrm{val}}}\ell_{k,i}^{(t,J)}$ , where $\ell_{k,i}^{(t,J)} = \ell (y_{k,i}\cdot f(\widetilde{\mathbf{W}} (\mathbf{W}^{(t)},\mathcal{S}_k^{\mathrm{tr}}),\mathbf{x}_{k,i}))$ . Then by Lemma 6.4 and the property of the cross-entropy loss that $-\ell^{\prime}(x)\geq \exp (-x) / 2\geq \ell (x) / 2$ for $x > 0$ , we have + +$$ +\min _ {t \in [ T ]} \widehat {\mathcal {L}} ^ {\mathrm {t r - v a l}} (\mathbf {W} ^ {(t)}, \{\mathcal {S} _ {k} \} _ {k = 1} ^ {K}) \leq \min _ {t \in [ T ^ {(2)}, T - 1 ]} - 2 \sum_ {k \in [ K ]} \sum_ {i \in \mathcal {I} _ {k} ^ {\mathrm {v a l}}} \ell_ {k, i} ^ {\prime (t, J)} = \widetilde {\mathcal {O}} \left(\frac {1}{T \eta}\right) = \widetilde {\mathcal {O}} \left(\frac {1}{\mathrm {p o l y} (d)}\right). +$$ + +This proves the first part of Theorem 4.5. For the second part, consider a new data point $(\mathbf{x},y)$ . By Definition 3.1 and Definition 3.2, the new data input $\mathbf{x}$ consists of two patches, one of which is a noise vector $\pmb{\xi}$ that is generated from $\mathcal{N}(\mathbf{0},\sigma_{\xi}^{2}\cdot (\mathbf{I} - \mathbf{P}))$ . Denote by $\mathcal{E}$ the event that $|\langle \pmb{\xi}_{k,i},\pmb {\xi}\rangle |\leq d^{-1 / 4}$ and $|\langle \mathbf{w}_{j,r}^{(0,0)},\pmb {\xi}\rangle |\leq d^{3 / 2}$ for all $k\in [K],i\in [n],r\in [m]$ and $j\in \{-1,1\}$ , where $\pmb{\xi}$ is the noise vector from the new data $\mathbf{x}$ . Then using Gaussian concentration, we have $\mathbb{P}(\mathcal{E})\geq 1 - \widetilde{\mathcal{O}} (\exp (-d^{1 / 4}))$ . We divide $\mathcal{L}_{\mathrm{test}}(\mathbf{W}^{(T)})$ into two parts: + +$$ +\mathcal {L} _ {\text {t e s t}} (\mathbf {W} ^ {(T)}) = \mathbb {E} \big [ \ell \big (y f (\mathbf {W} ^ {(T)}, \mathbf {x}) \big) \big ] = \underbrace {\mathbb {E} [ \mathbf {1} (\mathcal {E}) \ell \big (y f (\mathbf {W} ^ {(T)} , \mathbf {x}) \big) ]} _ {I _ {1}} + \underbrace {\mathbb {E} [ \mathbf {1} (\mathcal {E} ^ {c}) \ell \big (y f (\mathbf {W} ^ {(T)} , \mathbf {x}) \big) ]} _ {I _ {2}}. +$$ + +From this decomposition, it is clear that bounding $I_{1}$ is more important, since $\mathbb{P}(\mathcal{E}^c)$ is exponentially small, which makes $I_{2}$ small. Indeed, one can bound $I_{2} = \mathcal{O}(\mathrm{poly}(d))\exp (-0.5d^{1 / 4})$ . Moreover, under the event $\mathcal{E}$ , it holds that $F_{-y}(\mathbf{W}_{-y}^{(T)},\mathbf{x}) < \log (2)$ , and $F_{y}(\mathbf{W}_{y}^{(T)},\mathbf{x})\geq \sigma \big(\max_{r\in [m]}y\cdot \langle \mathbf{w}_{y,r}^{(T,0)},\pmb {\nu}\rangle \big)$ . Applying Lemma 6.5, we have + +$$ +\ell \big (y f (\mathbf {W} ^ {(T)}, \mathbf {x}) \big) = \ell \big (F _ {y} (\mathbf {W} _ {y} ^ {(T)}, \mathbf {x}) - F _ {- y} (\mathbf {W} _ {- y} ^ {(T)}, \mathbf {x}) \big) \leq \ell (K ^ {c} - \log (2)) \leq 2 \exp (- K ^ {c}) +$$ + +where the last inequality is by the definition of $\ell(\cdot)$ and the inequality $\log(1 + x) \leq x, \forall x \geq 0$ . Therefore we have that $I_1 \leq 2\exp(-K^c)$ . Combining the bounds on $I_1$ and $I_2$ yields $\mathcal{L}_{\mathrm{test}}(\mathbf{W}^{(T)}) \leq 2\exp(-K^c) + \mathcal{O}(\mathrm{poly}(d))\exp(-0.5d^{1/4}) = \mathcal{O}\big(\exp(-K^c)\big)$ , which proves the theorem. + +# 7 CONCLUSION AND FUTURE WORK + +In this work, we study the FOMAML algorithm applied to a classification problem with a two-layer CNN trained by gradient descent. We proved that although both train-train and train-validation methods can achieve a small training loss, to get good generalization results, it is necessary to perform a train-validation split in the data when the noise is large and the number of samples is limited. It is of interest to extend our result to more other types of data model (for example, natural language data), and deeper neural network structures. We would also like to extend our analysis to other popular meta-learning algorithms such as MAML (with hessian term), iMAML (Rajeswaran et al., 2019), Meta-MiniBatchProx (Zhou et al., 2019), Reptile (Nichol et al., 2018) and closed-form solvers (Bertinetto et al., 2018). + +# ACKNOWLEDGEMENTS + +We thank the anonymous reviewers and area chair for their helpful comments. ZC and QG are supported in part by the National Science Foundation IIS-2008981 and the Sloan Research Fellowship. + +# REFERENCES + +Zeyuan Allen-Zhu and Yanzhi Li. Feature purification: How adversarial training performs robust deep learning. arXiv preprint arXiv:2005.10190, 2020a. +Zeyuan Allen-Zhu and Yuanzhi Li. Towards understanding ensemble, knowledge distillation and self-distillation in deep learning. arXiv preprint arXiv:2012.09816, 2020b. +Ron Amit and Ron Meir. Meta-learning by adjusting priors based on extended pac-bayes theory. In International Conference on Machine Learning, pp. 205-214. PMLR, 2018. +Yu Bai, Minshuo Chen, Pan Zhou, Tuo Zhao, Jason Lee, Sham Kakade, Huan Wang, and Caiming Xiong. How important is the train-validation split in meta-learning? In International Conference on Machine Learning, pp. 543-553. PMLR, 2021. +Maria-Florina Balcan, Mikhail Khodak, and Ameet Talwalkar. Provable guarantees for gradient-based meta-learning. In International Conference on Machine Learning, pp. 424-433. PMLR, 2019. +Luca Bertinetto, Joao F Henriques, Philip HS Torr, and Andrea Vedaldi. Meta-learning with differentiable closed-form solvers. arXiv preprint arXiv:1805.08136, 2018. +Yuan Cao, Zixiang Chen, Mikhail Belkin, and Quanquan Gu. Benign overfitting in two-layer convolutional neural networks. arXiv preprint arXiv:2202.06526, 2022. +Niladri S Chatterji, Philip M Long, and Peter L Bartlett. When does gradient descent with logistic loss find interpolating two-layer networks? J. Mach. Learn. Res., 22:159-1, 2021. +Lisha Chen, Songtao Lu, and Tianyi Chen. Understanding benign overfitting in nested meta learning. arXiv preprint arXiv:2206.13482, 2022. +Giulia Denevi, Carlo Ciliberto, Dimitris Stamos, and Massimiliano Pontil. Incremental learning-to-learn with statistical guarantees. arXiv preprint arXiv:1803.08089, 2018a. +Giulia Denevi, Carlo Ciliberto, Dimitris Stamos, and Massimiliano Pontil. Learning to learn around a common mean. In ADVANCES IN NEURAL INFORMATION PROCESSING SYSTEMS 31 (NIPS 2018), volume 31. NIPS Proceedings, 2018b. +Giulia Denevi, Carlo Ciliberto, Riccardo Grazzi, and Massimiliano Pontil. Learning-to-learn stochastic gradient descent with biased regularization. In International Conference on Machine Learning, pp. 1566–1575. PMLR, 2019. +Simon S Du, Wei Hu, Sham M Kakade, Jason D Lee, and Qi Lei. Few-shot learning via learning the representation, provably. arXiv preprint arXiv:2002.09434, 2020. +Alireza Fallah, Aryan Mokhtari, and Asuman Ozdaglar. On the convergence theory of gradient-based model-agnostic meta-learning algorithms. In International Conference on Artificial Intelligence and Statistics, pp. 1082–1092. PMLR, 2020. +Chelsea Finn and Sergey Levine. Meta-learning and universality: Deep representations and gradient descent can approximate any learning algorithm. arXiv preprint arXiv:1710.11622, 2017. +Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In International Conference on Machine Learning, pp. 1126-1135. PMLR, 2017. +Chelsea Finn, Aravind Rajeswaran, Sham Kakade, and Sergey Levine. Online meta-learning. In International Conference on Machine Learning, pp. 1920-1930. PMLR, 2019. + +Jiatao Gu, Yong Wang, Yun Chen, Kyunghyun Cho, and Victor OK Li. Meta-learning for low-resource neural machine translation. arXiv preprint arXiv:1808.08437, 2018. +Abhishek Gupta, Benjamin Eysenbach, Chelsea Finn, and Sergey Levine. Unsupervised meta-learning for reinforcement learning. arXiv preprint arXiv:1806.04640, 2018a. +Abhishek Gupta, Russell Mendonca, YuXuan Liu, Pieter Abbeel, and Sergey Levine. Meta-reinforcement learning of structured exploration strategies. Advances in neural information processing systems, 31, 2018b. +Yu Huang, Yingbin Liang, and Longbo Huang. Provable generalization of overparameterized meta-learning trained with sgd. arXiv preprint arXiv:2206.09136, 2022. +Mikhail Khodak, Maria-Florina Balcan, and Ameet Talwalkar. Adaptive gradient-based meta-learning methods. arXiv preprint arXiv:1906.02717, 2019. +Zhenguo Li, Fengwei Zhou, Fei Chen, and Hang Li. Meta-sgd: Learning to learn quickly for few-shot learning. arXiv preprint arXiv:1707.09835, 2017. +Hanxiao Liu, Karen Simonyan, and Yiming Yang. Darts: Differentiable architecture search. arXiv preprint arXiv:1806.09055, 2018. +Alex Nichol, Joshua Achiam, and John Schulman. On first-order meta-learning algorithms. arXiv preprint arXiv:1803.02999, 2018. +Aravind Rajeswaran, Chelsea Finn, Sham M Kakade, and Sergey Levine. Meta-learning with implicit gradients. Advances in neural information processing systems, 32, 2019. +Esteban Real, Alok Aggarwal, Yanping Huang, and Quoc V Le. Regularized evolution for image classifier architecture search. In Proceedings of the aaai conference on artificial intelligence, volume 33, pp. 4780-4789, 2019. +Mengye Ren, Eleni Triantafillou, Sachin Ravi, Jake Snell, Kevin Swersky, Joshua B Tenenbaum, Hugo Larochelle, and Richard S Zemel. Meta-learning for semi-supervised few-shot classification. arXiv preprint arXiv:1803.00676, 2018. +Andrei A Rusu, Dushyant Rao, Jakub Sygnowski, Oriol Vinyals, Razvan Pascanu, Simon Osindero, and Raia Hadsell. Meta-learning with latent embedding optimization. arXiv preprint arXiv:1807.05960, 2018. +Nikunj Saunshi, Yi Zhang, Mikhail Khodak, and Sanjeev Arora. A sample complexity separation between non-convex and convex meta-learning. In International Conference on Machine Learning, pp. 8512–8521. PMLR, 2020. +Nikunj Saunshi, Arushi Gupta, and Wei Hu. A representation learning perspective on the importance of train-validation splitting in meta-learning. In International Conference on Machine Learning, pp. 9333-9343. PMLR, 2021. +Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. Advances in neural information processing systems, 30, 2017. +Nilesh Tripuraneni, Michael I Jordan, and Chi Jin. On the theory of transfer learning: The importance of task diversity. arXiv preprint arXiv:2006.11650, 2020. +Haoxiang Wang, Yite Wang, Ruoyu Sun, and Bo Li. Global convergence of maml and theory-inspired neural architecture search for few-shot learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9797-9808, 2022. +Lingxiao Wang, Qi Cai, Zhuoran Yang, and Zhaoran Wang. On the global optimality of model-agnostic meta-learning. In International Conference on Machine Learning, pp. 9837-9846. PMLR, 2020. +Xiang Wang, Shuai Yuan, Chenwei Wu, and Rong Ge. Guarantees for tuning the step size using a learning-to-learn approach. In International Conference on Machine Learning, pp. 10981-10990. PMLR, 2021. + +Huaxiu Yao, Linjun Zhang, and Chelsea Finn. Meta-learning with fewer tasks through task interpolation. arXiv preprint arXiv:2106.02695, 2021. +Pan Zhou, Xiaotong Yuan, Huan Xu, Shuicheng Yan, and Jiashi Feng. Efficient meta learning via minibatch proximal update. Advances in Neural Information Processing Systems, 32, 2019. +Difan Zou, Yuan Cao, Yuanzhi Li, and Quanquan Gu. Understanding the generalization of adam in learning neural networks with proper regularization. arXiv preprint arXiv:2108.11371, 2021. + +# A COMPARISON WITH BAI ET AL. (2021) + +In this section, we point out some differences between our experiment setup and that of Bai et al. (2021), which also studies the importance of a train-validation split in meta-learning. The main conclusion of Bai et al. (2021) is that the train-train method could outperform the train-validation method asymptotically under a linear centroid model. They have also run experiments using CNN as backbone to support their theory (see Table 1 of Bai et al. (2021)). This may seem to contradict our experiments at first sight, since we showed in Table 1 that the train-validation method should outperform the train-train method using CNN as backbone. We would like to point out that this is due to the different choice of loss function and optimization algorithms used by us and Bai et al. (2021) as explained as follows. + +# A.1 REGULARIZER IN INNER-LOOP + +Let us focus on the train-train method. Our loss function is given by + +$$ +\widehat {\mathcal {L}} ^ {\mathrm {t r} - \mathrm {t r}} (\mathbf {W}, \{\mathcal {S} _ {k} \} _ {k = 1} ^ {K}) = \frac {1}{K} \sum_ {k = 1} ^ {K} \mathcal {L} (\widetilde {\mathbf {W}} (\mathbf {W}, \mathcal {S} _ {k}), \mathcal {S} _ {k}), +$$ + +where $\widetilde{\mathbf{W}} (\mathbf{W},\mathcal{S}_k)$ represents the weights of the network after $J$ gradient descent steps (w.r.t. loss $\mathcal{L}(\cdot ,\mathcal{S}_k))$ starting from $\mathbf{W}$ . While Bai et al. (2021) has their loss function given by + +$$ +\widehat {\mathcal {L}} ^ {\operatorname {t r} - \operatorname {t r}} (\mathbf {W}, \left\{\mathcal {S} _ {k} \right\} _ {k = 1} ^ {K}) = \frac {1}{K} \sum_ {k = 1} ^ {K} \mathcal {L} \left(\widehat {\mathbf {W}} (\mathbf {W}, \mathcal {S} _ {k}), \mathcal {S} _ {k}\right), \tag {A.1} +$$ + +where + +$$ +\widehat {\mathbf {W}} (\mathbf {W}, \mathcal {S} _ {k}) = \underset {\mathbf {W} ^ {\prime}} {\arg \min } \mathcal {L} \left(\mathbf {W} ^ {\prime}, \mathcal {S} _ {k}\right) + \lambda \| \mathbf {W} ^ {\prime} - \mathbf {W} \| _ {F} ^ {2}, \tag {A.2} +$$ + +where $\lambda$ is a regularization parameter. This regularizer is popularized by Rajeswaran et al. (2019) and Zhou et al. (2019). In practice, however, many meta-learning methods do not use this regularizer in the inner-loop (add citations). + +# A.2 EXPERIMENTALORIGIHMS + +To compare the performance of train-validation and train-train methods, Bai et al. (2021) used iMAML (Rajeswaran et al., 2019) for the train-validation method and Meta-MiniBatchProx (Zhou et al., 2019) for the train-train method. Both algorithms were developed to target the loss function given by Eq. (A.1). In particular, iMAML used implicit function theorem to calculate the gradient $\nabla_{\mathbf{W}}\widehat{\mathbf{W}} (\mathbf{W},\mathcal{S}_k)$ , and then uses this information to do gradient descent on $\mathbf{W}$ with respect to the loss function given by Eq. (A.1). iMAML is similar to MAML in the sense that both algorithms perform gradient descent on $\mathbf{W}$ with respect to their respective loss functions $\hat{\mathcal{L}}^{\mathrm{tr - tr}}$ . However, the structure of Meta-MiniBatchProx is different from that of iMAML and MAML. It is more closely related to Reptile (Nichol et al., 2018), which is another first order meta-learning algorithm. Instead of performing gradient descent in the outer-loop, Reptile updates $\mathbf{W}$ at each step as a convex combination of $\mathbf{W}$ and $\widetilde{\mathbf{W}} (\mathbf{W},\mathcal{S}_k)$ . This gives + +$$ +\mathbf {W} \leftarrow \mathbf {W} + \varepsilon \frac {1}{K} \sum_ {k = 1} ^ {K} \left(\widetilde {\mathbf {W}} (\mathbf {W}, \mathcal {S} _ {k}) - \mathbf {W}\right), \tag {A.3} +$$ + +for some $\varepsilon \in (0,1)$ . And Meta-MiniBatchProx replaces $\widetilde{\mathbf{W}} (\mathbf{W},\mathcal{S}_k)$ with $\widehat{\mathbf{W}} (\mathbf{W},\mathcal{S}_k)$ in the above. In our experiments, we used FOMAML for both train-validation and train-train. We believe that by using the same algorithm for train-validation with train-train, the comparison is fairer. + +# B ADDITIONAL EXPERIMENTS + +# B.1 COMPARISON WITH REPTILE (NICHOL ET AL., 2018) + +We compare FOMAML (using the train-validation method) with Reptile, which is another first-order algorithm used in meta-learning. Different from FOMAML, Reptile does not require a train-validation split in the data set. In addition, the outer-loop of Reptile does not perform gradient + +descent, but use a convex combination between the unadapted weights and the task-adapted weights (see Eq. (A.3)). The results are summarized in Table 4. We see that on both RainbowMNIST and miniImagenet, FOMAML with train-validation outperforms Reptile by a small margin. + +Table 4: Performance comparison between FOMAML and Reptile. + +
AlgorithmRainbowMNISTminiImagenet
FOMAML87.52 ± 0.20%46.15 ± 1.36%
Reptile84.97 ± 0.26%45.19 ± 1.31%
+ +# B.2 TIME EVOLUTION OF TEST LOSS OF FOMAML + +We plot the time evolution of test loss using trained by FOMAML with train-validation and with train-train on our synthetic data set. The results are illustrated in Figure 1a and 1b for train-validation and train-train, respectively. + +![](images/31f6e6e825884e05f98a28c1917294540a1e255dd13b30b44d7cdb9ea0e91f6d.jpg) +(a) Train-Validation + +![](images/c9b38d4c819517fb5281139e9506faf5ddb955cdcd2cbfb88b5451cb924c978f.jpg) +(b) Train-Train +Figure 1: Comparison of test loss over time of FOMAML trained with train-validation and with train-train. The test loss for the train-validation method decreases almost monotonically, whereas the test loss for the train-train method first decreases and then increases due to overfitting. + +# B.3 FOMAML WITH DIFFERENT NEURAL NETWORKS + +In this section, we show that FOMAML with train-validaiton still outperforms FOMAML with train-train on CNN with more layers and ResNet. The experiments are run on miniImagenet. The results are recorded in Table 5. We see that FOMAML with train-validation outperforms FOMAML with train-train by a large margin under all 3 neural network structures. + +Table 5: Performance w.r.t. different neural networks. + +
SettingCNN 4 layers + normalizationCNN 6 layers + normalizationResNet18
Train-train25.93 ± 1.10%26.89 ± 1.18%35.63 ± 1.26%
Train-validation46.15 ± 1.36%50.89 ± 1.39%55.32 ± 1.43%
+ +# B.4 EFFECT OF THE NUMBER OF SAMPLES PER TASK + +We then discuss the performance with respect to the number of examples. In Table 6, we report the performance on miniImagenet when the number of examples per class is 1, 3, 5, which corresponds to 5-way 1-shot, 5-way 3-shot and 5-way 5-shot settings. We observe that as the number of samples per class increases, both the train-train and train-validation methods receive a performance increase. + +# C PRELIMINARY CALCULATIONS + +In this section, we present some calculations that are useful for our derivations later. Recall that $\ell(z) = \log(1 + \exp(-z))$ , which gives $\ell'(z) = -(1 + \exp(z))^{-1}$ . Then, we can compute the partial derivative of the loss function using samples from task $k$ as + +$$ +\frac {\partial}{\partial \mathbf {w} _ {j , r}} \mathcal {L} (\mathbf {W}, \mathcal {S} _ {k}) = \frac {1}{n} \sum_ {i = 1} ^ {n} \frac {\partial}{\partial \mathbf {w} _ {j , r}} \ell \left(y _ {k, i} \cdot f \left(\mathbf {W}, \mathbf {x} _ {k, i}\right)\right) +$$ + +Table 6: Performance comparison w.r.t. the number of samples per class on miniImagenet. + +
Number of samples per class135
Train-train25.93 ± 1.10%36.23 ± 0.82%38.76 ± 0.66%
Train-validation46.15 ± 1.36%59.97 ± 1.02%63.18 ± 0.90%
+ +$$ +\begin{array}{l} = \frac {1}{n} \sum_ {i = 1} ^ {n} \ell^ {\prime} \left(y _ {k, i} \cdot f \left(\mathbf {W}, \mathbf {x} _ {k, i}\right)\right) \frac {\partial}{\partial \mathbf {w} _ {j , r}} F _ {j} \left(\mathbf {W} _ {j}, \mathbf {x} _ {k, i}\right) j \\ = \frac {1}{n} \sum_ {i = 1} ^ {n} \ell^ {\prime} (y _ {k, i} \cdot f (\mathbf {W}, \mathbf {x} _ {k, i})) y _ {k, i} j \bigg (\sum_ {p = 1} ^ {2} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r}, \mathbf {x} _ {k, i} ^ {(p)} \rangle) \mathbf {x} _ {k, i} ^ {(p)} \bigg). \\ \end{array} +$$ + +Similarly, if we only evaluate the loss on the training set of $S_{k}$ we have + +$$ +\frac {\partial}{\partial \mathbf {w} _ {j , r}} \mathcal {L} (\mathbf {W}, \mathcal {S} _ {k} ^ {\mathrm {t r}}) = \frac {1}{n _ {1}} \sum_ {i = 1} ^ {n _ {1}} \ell^ {\prime} (y _ {k, i} \cdot f (\mathbf {W}, \mathbf {x} _ {k, i})) y _ {k, i} j \bigg (\sum_ {p = 1} ^ {2} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r}, \mathbf {x} _ {k, i} ^ {(p)} \rangle) \mathbf {x} _ {k, i} ^ {(p)} \bigg). +$$ + +Let $t \geq 0$ and $\tau \in [0, J]$ be the indices for the outer-loop and inner-loop respectively. We remind the readers our notation. Denote $\ell_{k,i}^{\prime(t,J)} = \ell'(y_{k,i} \cdot f(\widetilde{\mathbf{W}}(\mathbf{W}^{(t)}, S_k), \mathbf{x}_{k,i}))$ when referring to the train-train method and $\ell_{k,i}^{\prime(t,J)} = \ell'(y_{k,i} \cdot f(\widetilde{\mathbf{W}}(\mathbf{W}^{(t)}, S_k^{\mathrm{tr}}), \mathbf{x}_{k,i}))$ when referring to the train-validation method. + +At outer step $t$ , using the samples from task $k$ , we have the inner-loop updates as + +$$ +j \left\langle \mathbf {w} _ {j, r} ^ {(t, \tau + 1)}, \boldsymbol {\nu} _ {k} \right\rangle = j \left\langle \mathbf {w} _ {j, r} ^ {(t, \tau)}, \boldsymbol {\nu} _ {k} \right\rangle - \frac {\gamma}{n} \sum_ {i = 1} ^ {n} \ell_ {k, i} ^ {\prime (t, \tau)} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(t, \tau)}, \boldsymbol {\nu} _ {k} \right\rangle y _ {k, i}\right) \| \boldsymbol {\nu} _ {k} \| _ {2} ^ {2}. \tag {C.1} +$$ + +For noise $\xi_{k,i}$ , we have the inner-loop updates as (suppose we are using all the samples from task $k$ for the inner-loop optimization) + +$$ +\begin{array}{l} \langle \mathbf {w} _ {j, r} ^ {(t, \tau + 1)}, \boldsymbol {\xi} _ {k, i} \rangle = \langle \mathbf {w} _ {j, r} ^ {(t, \tau)}, \boldsymbol {\xi} _ {k, i} \rangle - \frac {\gamma}{n} \sum_ {i ^ {\prime} \neq i} \ell_ {k, i ^ {\prime}} ^ {\prime (t, \tau)} y _ {k, i ^ {\prime}} j \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t, \tau)}, \boldsymbol {\xi} _ {k, i ^ {\prime}} \rangle) \langle \boldsymbol {\xi} _ {k, i ^ {\prime}}, \boldsymbol {\xi} _ {k, i} \rangle \\ - \frac {\gamma}{n} \ell_ {k, i} ^ {\prime (t, \tau)} y _ {k, i} j \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(t, \tau)}, \boldsymbol {\xi} _ {k, i} \right\rangle\right) \| \boldsymbol {\xi} _ {k, i} \| _ {2} ^ {2}, \tag {C.2} \\ \end{array} +$$ + +where the first sum goes from $i' = 1$ to $i' = n$ , omitting the term when $i' = i$ . If we consider a noise $\xi_{k,i}$ from the validation set of some task, i.e. $k \in [K]$ and $i \in \mathcal{I}_k^{\mathrm{val}}$ , and we only use the training set of task $k$ for inner-loop updates, then + +$$ +\left\langle \mathbf {w} _ {j, r} ^ {(t, \tau + 1)}, \boldsymbol {\xi} _ {k, i} \right\rangle = \left\langle \mathbf {w} _ {j, r} ^ {(t, \tau)}, \boldsymbol {\xi} _ {k, i} \right\rangle - \frac {\gamma}{n _ {1}} \sum_ {i ^ {\prime} = 1} ^ {n _ {1}} \ell_ {k, i ^ {\prime}} ^ {\prime (t, \tau)} y _ {k, i ^ {\prime}} j \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(t, \tau)}, \boldsymbol {\xi} _ {k, i ^ {\prime}} \right\rangle\right) \left\langle \boldsymbol {\xi} _ {k, i ^ {\prime}}, \boldsymbol {\xi} _ {k, i} \right\rangle . \tag {C.3} +$$ + +If we consider a noise $\pmb{\xi}_{k,i}$ from the training set of a task, i.e. $k\in [K]$ and $i\in \mathcal{I}_k^{\mathrm{tr}}$ , and we only use the training set of task $k$ for inner-loop updates, then + +$$ +\begin{array}{l} \langle \mathbf {w} _ {j, r} ^ {(t, \tau + 1)}, \boldsymbol {\xi} _ {k, i} \rangle = \langle \mathbf {w} _ {j, r} ^ {(t, \tau)}, \boldsymbol {\xi} _ {k, i} \rangle - \frac {\gamma}{n _ {1}} \sum_ {i ^ {\prime} \neq i} ^ {n _ {1}} \ell_ {k, i ^ {\prime}} ^ {\prime (t, \tau)} y _ {k, i ^ {\prime}} j \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t, \tau)}, \boldsymbol {\xi} _ {k, i ^ {\prime}} \rangle) \langle \boldsymbol {\xi} _ {k, i ^ {\prime}}, \boldsymbol {\xi} _ {k, i} \rangle \\ - \frac {\gamma}{n _ {1}} \ell_ {k, i} ^ {\prime (t, \tau)} y _ {k, i} j \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(t, \tau)}, \boldsymbol {\xi} _ {k, i} \right\rangle\right) \| \boldsymbol {\xi} _ {k, i} \| _ {2} ^ {2}, \tag {C.4} \\ \end{array} +$$ + +where the sum goes from $i' = 1$ to $i' = n_1$ except when $i' = i$ . Using only the training set of task $k$ , the feature inner product update is + +$$ +j \left\langle \mathbf {w} _ {j, r} ^ {(t, \tau + 1)}, \boldsymbol {\nu} _ {k} \right\rangle = j \left\langle \mathbf {w} _ {j, r} ^ {(t, \tau)}, \boldsymbol {\nu} _ {k} \right\rangle - \frac {\gamma}{n _ {1}} \sum_ {i = 1} ^ {n _ {1}} \ell_ {k, i} ^ {\prime (t, \tau)} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(t, \tau)}, \boldsymbol {\nu} _ {k} \right\rangle y _ {k, i}\right) \| \boldsymbol {\nu} _ {k} \| _ {2} ^ {2}. \tag {C.5} +$$ + +Next we look at the outer-loop updates. For the train-train method, the noise update is + +$$ +\langle \mathbf {w} _ {j, r} ^ {(t + 1, 0)}, \boldsymbol {\xi} _ {k, i} \rangle = \langle \mathbf {w} _ {j, r} ^ {(t, 0)}, \boldsymbol {\xi} _ {k, i} \rangle - \frac {\eta}{K n} \sum_ {(k ^ {\prime}, i ^ {\prime}) \neq (k, i)} \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} y _ {k ^ {\prime}, i ^ {\prime}} j \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k ^ {\prime}, i ^ {\prime}} \rangle) \langle \boldsymbol {\xi} _ {k ^ {\prime}, i ^ {\prime}}, \boldsymbol {\xi} _ {k, i} \rangle +$$ + +$$ +- \frac {\eta}{K n} \ell_ {k, i} ^ {\prime (t, j)} y _ {k, i} j \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k, i} \right\rangle\right) \| \boldsymbol {\xi} _ {k, i} \| _ {2} ^ {2}, \tag {C.6} +$$ + +where the sum is over all $k' \in [K]$ and $i' \in [n]$ except when $(k', i') = (k, i)$ . Hence, the number of terms in the sum is $Kn - 1$ . And + +$$ +\ell_ {k, i} ^ {\prime (t, \tau)} = \ell^ {\prime} \left(y _ {k, i} \sum_ {j = \pm 1} j \sum_ {r = 1} ^ {m} \sigma \left(\left\langle \mathbf {w} _ {j, r} ^ {(t, \tau)} \boldsymbol {\xi} _ {k, i} \right\rangle\right) + \sigma \left(\left\langle \mathbf {w} _ {j, r} ^ {(t, \tau)} \boldsymbol {\nu} _ {k} \right\rangle y _ {k, i}\right)\right). \tag {C.7} +$$ + +The arguments in $\sigma'(\cdot)$ in Eq. (C.6) are given by Eq. (C.2). The outer-loop feature update is + +$$ +j \langle \mathbf {w} _ {j, r} ^ {(t + 1, 0)}, \boldsymbol {\nu} \rangle = j \langle \mathbf {w} _ {j, r} ^ {(t, 0)}, \boldsymbol {\nu} \rangle - \frac {\eta}{K n} \sum_ {k, i} \ell_ {k, i} ^ {\prime (t, J)} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \boldsymbol {\nu} _ {k} \right\rangle y _ {k, i}\right) \| \boldsymbol {\nu} \| _ {2} ^ {2}, \tag {C.8} +$$ + +where the arguments in $\sigma'(\cdot)$ are given by Eq. (C.1). The arguments in $\sigma(\cdot)$ in Eq. (C.7) are given by Eq. (C.2) and Eq. (C.1). For the train-validation method, consider a noise $\pmb{\xi}_{k,i}$ from the validation set of the $k$ -th task, i.e. $i \in \mathcal{I}_k^{\mathrm{val}}$ . We have + +$$ +\begin{array}{l} \langle \mathbf {w} _ {j, r} ^ {(t + 1, 0)}, \boldsymbol {\xi} _ {k, i} \rangle = \langle \mathbf {w} _ {j, r} ^ {(t, 0)}, \boldsymbol {\xi} _ {k, i} \rangle - \frac {\eta}{K n _ {2}} \sum_ {i ^ {\prime} > n _ {1}, (k ^ {\prime}, i ^ {\prime}) \neq (k, i)} \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} y _ {k ^ {\prime}, i ^ {\prime}} j \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k ^ {\prime}, i ^ {\prime}} \rangle) \langle \boldsymbol {\xi} _ {k ^ {\prime}, i ^ {\prime}}, \boldsymbol {\xi} _ {k, i} \rangle \\ - \frac {\eta}{K n _ {2}} \ell_ {k, i} ^ {\prime (t, J)} y _ {k, i} j \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k, i} \right\rangle\right) \| \boldsymbol {\xi} _ {k, i} \| _ {2} ^ {2}, \tag {C.9} \\ \end{array} +$$ + +where the sum is over all $k' \in [K]$ and $i' \in \mathcal{I}_k^{\mathrm{val}}$ except when $(k', i') = (k, i)$ . The arguments in $\sigma'(\cdot)$ are given by Eq. (C.3). If we consider a noise $\xi_{k,i}$ from the training set, i.e. $k \in [K]$ and $i \in \mathcal{I}_k^{\mathrm{tr}}$ , then the outer-loop update is given by + +$$ +\langle \mathbf {w} _ {j, r} ^ {(t + 1, 0)}, \boldsymbol {\xi} _ {k, i} \rangle = \langle \mathbf {w} _ {j, r} ^ {(t, 0)}, \boldsymbol {\xi} _ {k, i} \rangle - \frac {\eta}{K n _ {2}} \sum_ {k, i ^ {\prime} > n _ {1}} \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} y _ {k ^ {\prime}, i ^ {\prime}} j \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k ^ {\prime}, i ^ {\prime}} \right\rangle\right) \left\langle \boldsymbol {\xi} _ {k ^ {\prime}, i ^ {\prime}}, \boldsymbol {\xi} _ {k, i} \right\rangle , \tag {C.10} +$$ + +where the sum is over all $k \in [K]$ and $i \in \mathcal{I}_k^{\mathrm{val}}$ . And the arguments in $\sigma'(\cdot)$ are given by Eq. (C.4). The outer-loop update of the feature using the train-validation method is similar to using the traintrain method: + +$$ +j \langle \mathbf {w} _ {j, r} ^ {(t + 1, 0)}, \boldsymbol {\nu} \rangle = j \langle \mathbf {w} _ {j, r} ^ {(t, 0)}, \boldsymbol {\nu} \rangle - \frac {\eta}{K n _ {2}} \sum_ {k, i > n _ {1}} \ell_ {k, i} ^ {\prime (t, J)} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \boldsymbol {\nu} _ {k} \right\rangle y _ {k, i}\right) \| \boldsymbol {\nu} \| _ {2} ^ {2}, \tag {C.11} +$$ + +where the arguments in $\sigma'(\cdot)$ in Eq. (C.11) are given by Eq. (C.5). Note that the $\ell'$ term in Eq. (C.9), Eq. (C.10) and Eq. (C.11) are given by Eq. (C.7), but the arguments in $\sigma(\cdot)$ in Eq. (C.7) are now given by Eq. (C.3) and Eq. (C.5). + +# D PRELIMINARY LEMMAS + +We will work under the following parameters for the rest of the proof. + +Condition D.1. $\| \pmb{\nu} \|_2 = 1$ , $\sigma_0 = \frac{1}{\sqrt{d}}$ , $\sigma_s = \frac{1}{\sqrt{d} \log(d)^{0.4}}$ , $\sigma_\xi = \frac{\log(d)^{0.5}}{\sqrt{d}}$ , $n = \Theta(1)$ , $K = \log(d)^{0.5}$ , $m = \log(d)^{0.2}$ , $\eta = \frac{1}{\log(d)^{-5}}$ , $\gamma = \log(d)^{0.4}$ , $J = 5$ , $h = \frac{1}{2}$ , $M = d/2$ . We will also assume that our data split is symmetric: for each $k \in [K]$ , and $j \in \{-1, 1\}$ + +$$ +\left| \left\{i: i \in \mathcal {I} _ {k} ^ {\mathrm {t r}}, y _ {k, i} = j \right\} \right| > 0, \quad \left| \left\{i: i \in \mathcal {I} _ {k} ^ {\mathrm {v a l}}, y _ {k, i} = j \right\} \right| > 0. +$$ + +Lemma D.2. Under Condition D.1 and Condition 4.1, the following estimates hold with probability at least $1 - (Kn)^{-10}$ . + +1. $\| \pmb{\xi}_{k,i}\| _2^2 = \Theta (\sigma_\xi^2 d)$ for any $k\in [K]$ and $i\in [n]$ +2. $\max \left\{\left|\langle \pmb {\xi}_{k,i},\pmb {\xi}_{k^{\prime},i^{\prime}}\rangle \right|:k,k^{\prime}\in [K],i,i^{\prime}\in [n],(k,i)\neq (k^{\prime},i^{\prime})\right\} \leq \mathcal{O}(\sigma_{\xi}^{2}\sqrt{d}\sqrt{\log(Kn)}).$ +3. $\max \left\{\left|\langle \pmb{w}_{j,r}^{(0,0)},\pmb {\nu}\rangle \right|:r\in [m]\right\} = \Theta (\sigma_0\sqrt{\log(mKn)})$ for any $j\in \{-1,1\}$ +4. $\max \left\{\left|\langle \pmb{w}_{j,r}^{(0,0)},\pmb{\xi}_{k,i}\rangle \right|:r\in [m]\right\} = \Theta (\sigma_0\sigma_\xi \sqrt{d}\sqrt{\log(mKn)})$ for any $j\in \{-1,1\}, k\in [K],i\in [n]$ + +5. $\Omega (\sigma_0)\leq \max_{r\in [m]}j\langle \pmb{w}_{j,r}^{(0,0)},\pmb {\nu}\rangle \leq \mathcal{O}(\sigma_0\sqrt{\log(mKn)})$ for any $j\in \{-1,1\}$ +6. $\Omega (\sigma_0\sigma_\xi \sqrt{d})\leq \max_{r\in [m]}\langle \pmb{w}_{j,r}^{(0,0)},\pmb{\xi}_{k,i}\rangle \leq \mathcal{O}(\sigma_0\sigma_\xi \sqrt{d}\sqrt{\log(mKn)})$ for any $j\in \{-1,1\}$ , $k\in [K]$ , $i\in [n]$ . +7. $\max \left\{\left|\langle \pmb{w}_{j,r}^{(0,0)},\pmb{z}_k\rangle \right|:r\in [m]\right\} = \Theta (\sigma_0\sigma_s\sqrt{d}\sqrt{\log(mKn)})$ for any $j\in \{-1,1\}, k\in [K]$ +8. $\Omega(\sigma_0\sigma_s\sqrt{d}) \leq \max_{r \in [m]} j\langle \pmb{w}_{j,r}^{(0,0)}, \pmb{z}_k \rangle \leq \mathcal{O}(\sigma_0\sigma_s\sqrt{d}\sqrt{\log(mKn)})$ for any $j \in \{-1,1\}, k \in [M]$ . + +Proof. By Lemma G.1, we have with probability at least $1 - \delta / 3$ , + +$$ +\frac {1}{2} \sigma_ {\xi} ^ {2} d \leq \| \boldsymbol {\xi} _ {k, i} \| _ {2} ^ {2} \leq \frac {3}{2} \sigma_ {\xi} ^ {2} d, +$$ + +$$ +| \langle \boldsymbol {\xi} _ {k, i}, \boldsymbol {\xi} _ {k ^ {\prime}, i ^ {\prime}} \rangle | \leq 2 \sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (1 2 (K n) ^ {2} / \delta)}, +$$ + +for all $k, k' \in [K]$ and $i, i' \in [n]$ with $(k, i) \neq (k', i')$ . By Lemma G.2, we have with probability at least $1 - \delta / 3$ , + +$$ +| \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \boldsymbol {\nu} \rangle | \leq \sqrt {2 \log (2 4 m / \delta)} \sigma_ {0}, +$$ + +$$ +| \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \boldsymbol {\xi} _ {k, i} \rangle | \leq \sqrt {2 \log (2 4 m K n / \delta)} \sigma_ {0} \sigma_ {\xi} \sqrt {d}, +$$ + +for all $r\in [m],j\in \{-1,1\} ,k\in [K]$ and $i\in [n]$ . Moreover, + +$$ +\frac {\sigma_ {0}}{2} \leq \max _ {r \in [ m ]} j \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \boldsymbol {\nu} \rangle \leq \sqrt {2 \log (2 4 m / \delta)} \sigma_ {0}, +$$ + +$$ +\frac {\sigma_ {0} \sigma_ {\xi} \sqrt {d}}{4} \leq \max _ {r \in [ m ]} \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \boldsymbol {\xi} _ {k, i} \rangle \leq \sqrt {2 \log (2 4 m K n / \delta)} \sigma_ {0} \sigma_ {\xi} \sqrt {d}, +$$ + +for all $j \in \{-1, 1\}$ , $k \in [K]$ and $i \in [n]$ . Using similar ideas, we get that with probability at least $1 - \delta / 3$ , + +$$ +| \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \mathbf {z} _ {k} \rangle | = | \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \mathbf {z} _ {k} / \| \mathbf {z} _ {k} \| _ {2} \rangle | \| \mathbf {z} _ {k} \| _ {2} \leq \frac {3}{2} \sigma_ {s} \sqrt {d} | \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \mathbf {x} \rangle | \leq \frac {3}{2} \sqrt {2 \log (1 2 m / \delta)} \sigma_ {0} \sigma_ {s} \sqrt {d}, +$$ + +for any $k \in [K]$ , $r \in [m]$ , and $j \in \{-1, 1\}$ . The second inequality is by Condition 4.1. The last inequality is again by Lemma G.2. Moreover, + +$$ +\frac {\sigma_ {0} \sigma_ {s} \sqrt {d}}{4} \leq \max _ {r \in [ m ]} j \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \mathbf {z} _ {k} \rangle \leq \frac {3}{2} \sqrt {2 \log (1 2 m / \delta)} \sigma_ {0} \sigma_ {s} \sqrt {d}. +$$ + +Combining the above results, we get that all of the above events hold simultaneously with probability at least $1 - \delta$ . Taking $\delta = (Kn)^{-10}$ gives the desired result. + +![](images/2cc70cb6a4f37235da6fd8d703340c18342739b0f74955d7a1dfc8df477790ac.jpg) + +Remark D.3. Since we will use the estimates in Lemma D.2 in the rest of our proofs repeatedly, we will not mention the high probability bound in our theorems. It should be understood that our theorems hold with the high probability bound given in Lemma D.2. + +Remark D.4. Recall that under Condition D.1, the term $\sqrt{\log(mKn)} = \mathrm{polyloglog}(d)$ . Its presence/absence will not affect any of our proofs. + +Lemma D.5. Let $\{x_{t},y_{t}\}$ be two positive sequences updated as + +$$ +x _ {t + 1} \geq x _ {t} (1 + A), +$$ + +$$ +y _ {t + 1} \leq y _ {t} (1 + B), +$$ + +where $x_0 = o(1)$ , $y_0 = o(1)$ , $A = o(1)$ , and $B = o(1)$ . For any $D = \mathcal{O}(1)$ , let $T$ be the first iteration that $x_t \geq D$ . We have that $y_T \leq \mathcal{O}(Gy_0)$ if $x_0 \geq \mathcal{O}\big(G^{-\frac{A}{B}}\big)$ . + +Proof. Let us consider the above two sequences $x_{t}$ and $y_{t}$ with the inequalities replaced with equality. Note that this will not affect our conclusion. Then we have + +$$ +x _ {t} = x _ {0} (1 + A) ^ {t}, +$$ + +$$ +y _ {t} = y _ {0} (1 + B) ^ {t}. +$$ + +And for simplicity, let us also assume that $x_{T} = D$ . Then we have $\frac{D}{x_0} = (1 + A)^T$ , which entails + +$$ +\begin{array}{l} T = \frac {\log (D) + \log \left(\frac {1}{x _ {0}}\right)}{\log (1 + A)} \\ = \mathcal {O} \left(\frac {\log \left(\frac {1}{x _ {0}}\right)}{A}\right). \tag {D.1} \\ \end{array} +$$ + +Let $T'$ be the first iteration such that $y_{T'} \geq G y_0$ . Again, for simplicity, let us suppose that $y_{T'} = G y_0$ . Using the same procedure, we obtain that + +$$ +T ^ {\prime} = \Omega \left(\frac {\log (G)}{B}\right). \tag {D.2} +$$ + +Applying our assumption that $x_0 \geq \mathcal{O}\left(G^{-\frac{A}{B}}\right)$ to Eq. (D.1) and Eq. (D.2), we conclude that $T < T'$ . + +# E TRAIN-TRAIN METHOD + +# E.1 PHASE I + +In this section, we will show that under Condition D.1, our neural network will memorize the noise and will not learn the feature. Let $\Xi_{k,i}^{(t)} = \max \left\{\langle \mathbf{w}_{j,r}^{(t,0)},\pmb{\xi}_{k,i}\rangle : j = y_{k,i},r\in [m]\right\}$ and $\Lambda_j^{(t)} = \max \left\{j\langle \mathbf{w}_{j,r}^{(t,0)},\pmb {\nu}\rangle :r\in [m]\right\}$ . Let $T_{k,i}^{(1)}$ be the first iteration such that $\Xi_{k,i}^{(t)}\geq m^{-1 / 2}\left(1 + \frac{\gamma\sigma_{\xi}^2d}{n}\right)^{-J} = \widetilde{\Theta} (1)$ and let $T^{(1)} = \max_{k,i}T_{k,i}^{(1)}$ and $(\hat{k},\hat{i}) = \arg \max_{k,i}T_{k,i}^{(1)}$ . So $T^{(1)}$ is the time for the slowest learned noise to have an inner product of size $\widetilde{\Theta} (1)$ . And this is witnessed by the noise vector $\pmb{\xi}_{\hat{k},\hat{i}}$ . + +Lemma E.1 (Restatement of Lemma 6.1). Under Condition D.1 and Condition 4.1, if one uses the train-train method, then for any $t \leq T^{(1)}$ + +1. For any $k \in [K]$ , $r \in [m]$ , and $j \in \{-1, 1\}$ we have + +$$ +j \langle \boldsymbol {w} _ {j, r} ^ {(t, J)}, \boldsymbol {\nu} _ {k} \rangle \leq | \langle \boldsymbol {w} _ {j, r} ^ {(t, 0)}, \boldsymbol {\nu} _ {k} \rangle | (1 + \gamma \mathcal {O} (1)) ^ {J}. +$$ + +2. For $j = y_{\hat{k},\hat{i}}$ and $r = \arg \max_{r'\in [m]}\langle \pmb{w}_{j,r}^{(t,0)},\pmb{\xi}_{\hat{k},\hat{i}}\rangle$ + +$$ +\left\langle \boldsymbol {w} _ {j, r} ^ {(t, J)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \right\rangle \geq \left\langle \boldsymbol {w} _ {j, r} ^ {(t, 0)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \right\rangle \left(1 + \frac {\gamma}{n} \Omega (1) \Theta (\sigma_ {\xi} ^ {2} d)\right) ^ {J}. +$$ + +Proof. The proof for both parts relies on the following hypothesis which we will verify inductively later: + +$$ +\max _ {r} j \langle \mathbf {w} _ {j, r} ^ {(t, 0)}, \mathbf {z} _ {k} \rangle = o (1) \boldsymbol {\Lambda} _ {j} ^ {(t)}, \text {f o r a l l} k \in [ K ], j \in \{- 1, 1 \}. \tag {E.1} +$$ + +$$ +- \ell_ {\hat {k}, \hat {i}} ^ {\prime (t, \tau)} = \Theta (1), \text {f o r a l l} \tau \in [ J ]. \tag {E.2} +$$ + +$$ +j \left\langle \mathbf {w} _ {j, r} ^ {(t, \tau)}, \boldsymbol {\nu} _ {k} \right\rangle = o (1), \text {f o r a l l} \tau \in [ J ], k \in [ K ], r \in [ m ], j \in \{- 1, 1 \}. \tag {E.3} +$$ + +$$ +\sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(t, \tau)}, \boldsymbol {\xi} _ {\hat {k}, \hat {t}} \right\rangle\right) = \Theta (1) \left\langle \mathbf {w} _ {j, r} ^ {(t, \tau)}, \boldsymbol {\xi} _ {\hat {k}, \hat {t}} \right\rangle , \text {f o r a l l} \tau \in [ J ] \text {i f} j = y _ {\hat {k}, \hat {t}} \text {a n d} \left\langle \mathbf {w} _ {j, r} ^ {(t, \tau)}, \boldsymbol {\xi} _ {\hat {k}, \hat {t}} \right\rangle > 0. \tag {E.4} +$$ + +Let us first suppose that the above hypothesis hold. By Eq. (C.1), we know $j\langle \mathbf{w}_{j,r}^{(t,\tau)},\pmb{\nu}_k\rangle$ is an increasing sequence in $\tau$ . Without loss of generality, suppose that $j\langle \mathbf{w}_{j,r}^{(t,0)},\pmb{\nu}_k\rangle >0$ . Then Hypothesis E.3 implies + +$$ +\sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t, \tau)}, \boldsymbol {\nu} _ {k} \rangle j) = 2 j \langle \mathbf {w} _ {j, r} ^ {(t, \tau)}, \boldsymbol {\nu} _ {k} \rangle . +$$ + +Then using the fact that $-\ell'(\cdot) \leq 1$ , we can apply Eq. (C.1) repeatedly to get + +$$ +j \left\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \boldsymbol {\nu} _ {k} \right\rangle \leq j \left\langle \mathbf {w} _ {j, r} ^ {(t, 0)}, \boldsymbol {\nu} _ {k} \right\rangle (1 + \gamma \mathcal {O} (1)) ^ {J}, \tag {E.5} +$$ + +where we have also used $\| \pmb{\nu}_k\| _2^2 = \| \pmb {\nu}\| _2^2 +\| \mathbf{z}_k\| _2^2 = 1 + o(1)$ . This proves part (1) of the lemma. Let $j = y_{\hat{k},\hat{i}}$ . Define $r(t) = \arg \max_{r'\in [m]}\langle \mathbf{w}_{j,r'}^{(t,0)},\pmb{\xi}_{\hat{k},\hat{i}}\rangle$ . By Eq. (C.2), we have + +$$ +\begin{array}{l} \langle \mathbf {w} _ {j, r (t)} ^ {(t, \tau + 1)}, \pmb {\xi} _ {\hat {k}, \hat {i}} \rangle \geq \langle \mathbf {w} _ {j, r (t)} ^ {(t, \tau)}, \pmb {\xi} _ {\hat {k}, \hat {i}} \rangle - \frac {\gamma}{n} \sum_ {i \neq \hat {i}} \mathcal {O} (1) | \langle \pmb {\xi} _ {\hat {k}, i}, \pmb {\xi} _ {\hat {k}, \hat {i}} \rangle | - \frac {\gamma}{n} \ell_ {\hat {k}, \hat {i}} ^ {\prime (t, \tau)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r (t)} ^ {(t, \tau)}, \pmb {\xi} _ {\hat {k}, \hat {i}} \rangle) \left\| \pmb {\xi} _ {\hat {k}, \hat {i}} \right\| _ {2} ^ {2} \\ \geq \langle \mathbf {w} _ {j, r (t)} ^ {(t, \tau)}, \boldsymbol {\xi} _ {\hat {k}, \hat {t}} \rangle - \gamma \mathcal {O} (1) \Theta \left(\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}\right) \\ + \frac {\gamma}{n} \Theta (1) \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r (t)} ^ {(t, \tau)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \right\rangle\right) \Theta \left(\sigma_ {\xi} ^ {2} d\right), \tag {E.6} \\ \end{array} +$$ + +where the first inequality is because $-\ell'(\cdot) \leq 1$ and $\sigma'(\cdot) \leq 1$ . And we have used Lemma D.2 and Hypothesis E.2 to get the second inequality. Let us compare the size of the second and third term on the right hand side of Eq. (E.6). At $(t, \tau) = (0, 0)$ , if we leave out $\gamma$ in both terms and consider, the third term is of size $\Theta(\sigma_0 \sigma_\xi^3 d^{3/2} / n) = \Theta(\log(d)^{1.5} / \sqrt{d})$ , whereas the second term always has size $\mathcal{O}(\sigma_\xi^2 \sqrt{d} \sqrt{\log(Kn)}) = \mathcal{O}(\log(d) / \sqrt{d}) \mathcal{O}(\mathrm{polyloglog}(d))$ . Hence the third term will dominate the second term at $(t, \tau) = (0, 0)$ . Note that the size of the second term does not change as $t$ and $\tau$ increase, meaning that if at time $(t \geq 0, \tau \geq 0)$ we have + +$$ +\langle \mathbf {w} _ {j, r (t)} ^ {(t, \tau)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \rangle = \Omega (1) \boldsymbol {\Xi} _ {\hat {k}, \hat {i}} ^ {(0)}, +$$ + +then it always holds that the third term dominates the second term on the right hand side of Eq. (E.6), which implies + +$$ +\langle \mathbf {w} _ {j, r (t)} ^ {(t, \tau + 1)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \rangle \geq \langle \mathbf {w} _ {j, r (t)} ^ {(t, \tau)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \rangle + \frac {\gamma}{n} \Omega (1) \sigma^ {\prime} (\langle \mathbf {w} _ {j, r (t)} ^ {(t, \tau)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \rangle) \Theta \left(\sigma_ {\xi} ^ {2} d\right). \tag {E.7} +$$ + +Applying Eq. (E.7) $J$ times at $t = 0$ and using Hypothesis E.4, we obtain + +$$ +\left\langle \mathbf {w} _ {j, r (0)} ^ {(0, J)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \right\rangle \geq \left\langle \mathbf {w} _ {j, r (0)} ^ {(0, 0)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \right\rangle \left(1 + \frac {\gamma}{n} \Omega (1) \Theta \left(\sigma_ {\xi} ^ {2} d\right)\right) ^ {J}. \tag {E.8} +$$ + +By Eq. (C.6), we have + +$$ +\begin{array}{l} \langle \mathbf {w} _ {j, r (t)} ^ {(t + 1, 0)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \rangle \geq \langle \mathbf {w} _ {j, r (t)} ^ {(t, 0)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \rangle - \frac {\eta}{K n} \sum_ {(k, i) \neq (\hat {k}, \hat {i})} \mathcal {O} (1) | \langle \boldsymbol {\xi} _ {k, i}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \rangle | \\ + \frac {\eta}{K n} \Theta (1) \sigma^ {\prime} (\langle \mathbf {w} _ {j, r (t)} ^ {(t, J)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \rangle) \| \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \| _ {2} ^ {2} \\ \geq \langle \mathbf {w} _ {j, r (t)} ^ {(t, 0)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \rangle - \eta \mathcal {O} (1) \Theta \left(\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}\right) \\ + \frac {\eta}{K n} \Theta (1) \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r (t)} ^ {(t, J)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \right\rangle\right) \Theta \left(\sigma_ {\xi} ^ {2} d\right), \tag {E.9} \\ \end{array} +$$ + +where we have used Hypothesis E.2 and the fact that $-\ell'(\cdot) \leq 1$ and $\sigma'(\cdot) \leq 1$ to get first inequality. Let us compare the second and third term on the right hand side of Eq. (E.9). At $t = 0$ , using Eq. (E.8) we have that + +$$ +\sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r (0)} ^ {(0, J)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \right\rangle\right) \geq \Theta (1) \left\langle \mathbf {w} _ {j, r (0)} ^ {(0, 0)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \right\rangle \left(1 + \frac {\gamma}{n} \Omega (1) \Theta \left(\sigma_ {\xi} ^ {2} d\right)\right) ^ {J}. \tag {E.10} +$$ + +If we drop $\eta$ in both terms, under Condition D.1 and Condition 4.1, one can calculate that the third term has size $\Theta (\log (d)^8 /\sqrt{d})$ whereas the second term has size $\mathcal{O}(\log (d) / \sqrt{d})\mathcal{O}(\mathrm{polyloglog}(d))$ . Thus the third term dominates the second term in Eq. (E.9) at $t = 0$ . And we get + +$$ +\begin{array}{l} \langle \mathbf {w} _ {j, r (1)} ^ {(1, 0)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \rangle \geq \langle \mathbf {w} _ {j, r (0)} ^ {(1, 0)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \rangle \geq \langle \mathbf {w} _ {j, r (0)} ^ {(0, 0)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \rangle \left(1 + \frac {\eta}{K n} \left(1 + \frac {\gamma}{n} \Omega (1) \Theta (\sigma_ {\xi} ^ {2} d)\right) ^ {J} \Theta (\sigma_ {\xi} ^ {2} d)\right) \\ = \langle \mathbf {w} _ {j, r (0)} ^ {(0, 0)}, \pmb {\xi} _ {\hat {k}, \hat {i}} \rangle \Big (1 + \Omega (1) \frac {\eta \sigma_ {\xi} ^ {2} d}{K n} \Big (\frac {\gamma \sigma_ {\xi} ^ {2} d}{n} \Big) ^ {J} \Big), \\ \end{array} +$$ + +where the first inequality in the first line is by definition of $r(t)$ . We note that the size of the second term on the right hand side of Eq. (E.9) does not change as $t$ and $\tau$ increase. Thus, if $\langle \mathbf{w}_{j,r}^{(t,0)},\pmb{\xi}_{\hat{k},\hat{i}}\rangle = \Omega (1)\Xi_{\hat{k},\hat{i}}^{(0)}$ for some $t > 0$ , Eq. (E.10) implies that $\sigma^{\prime}(\langle \mathbf{w}_{j,r}^{(t,J)},\pmb{\xi}_{\hat{k},\hat{i}}\rangle) = \Omega (1)\sigma^{\prime}(\langle \mathbf{w}_{j,r}^{(0,J)},\pmb{\xi}_{\hat{k},\hat{i}}\rangle)$ . Then we have that the third term will dominate the second term on the right hand side of Eq. (E.9) at $t > 0$ , which yields $\langle \mathbf{w}_{j,r(t)}^{(t + 1,0)},\pmb{\xi}_{\hat{k},\hat{i}}\rangle >\langle \mathbf{w}_{j,r(t)}^{(t,0)},\pmb{\xi}_{\hat{k},\hat{i}}\rangle$ since the third term on the right hand side of Eq. (E.9) is positive. We have shown that + +$$ +\langle \mathbf {w} _ {j, r (t + 1)} ^ {(t + 1, 0)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \rangle \geq \langle \mathbf {w} _ {j, r (t)} ^ {(t + 1, 0)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \rangle > \langle \mathbf {w} _ {j, r (t)} ^ {(t, 0)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \rangle . +$$ + +Then using the same derivation of Eq. (E.8), we obtain + +$$ +\langle \mathbf {w} _ {j, r (t)} ^ {(t, J)}, \boldsymbol {\xi} _ {\hat {k}, i} \rangle \geq \langle \mathbf {w} _ {j, r (t)} ^ {(t, 0)}, \boldsymbol {\xi} _ {\hat {k}, i} \rangle \left(1 + \frac {\gamma}{n} \Omega (1) \Theta (\sigma_ {\xi} ^ {2} d)\right) ^ {J}. +$$ + +for any $t \leq T^{(1)}$ . This proves the second part of the lemma. + +![](images/126bafb39eee2f1f3bdde2f940c5735745c04177a58c1c8d54ffde31741167ed.jpg) + +We have the following theorem characterizing the size of $\Lambda_j^{T^{(1)}}$ . + +Theorem E.2. Under Condition D.1 and Condition 4.1, if one uses the train-train method, then for any $t \leq T^{(1)}$ + +1. $\Lambda_j^t = \Theta(1)\Lambda_j^0 = \widetilde{\mathcal{O}}(d^{-1/2})$ , for $j \in \{-1, 1\}$ . +2. For any $k \in [K]$ , $i \in [n]$ , $j = -y_{k,i}$ and $r \in [m]$ , we have + +$$ +\langle \boldsymbol {w} _ {j, r} ^ {(t, 0)}, \boldsymbol {\xi} _ {k, i} \rangle \leq \widetilde {\mathcal {O}} \left(d ^ {- 1 / 2}\right). +$$ + +Proof. Recall that the outer-loop for the feature is given by + +$$ +j \left\langle \mathbf {w} _ {j, r} ^ {(t + 1, 0)}, \boldsymbol {\nu} _ {k} \right\rangle = j \left\langle \mathbf {w} _ {j, r} ^ {(t, 0)}, \boldsymbol {\nu} _ {k} \right\rangle - \frac {\eta}{K n} \sum_ {k ^ {\prime}, i} \ell_ {k ^ {\prime}, i} ^ {\prime (t, J)} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \boldsymbol {\nu} _ {k ^ {\prime}} \right\rangle y _ {k ^ {\prime}, i}\right) \left\langle \boldsymbol {\nu} _ {k}, \boldsymbol {\nu} _ {k ^ {\prime}} \right\rangle , \tag {E.11} +$$ + +where the summation is over all $k' \in [K]$ and $i \in [n]$ . Since $\langle \pmb{\nu}_k, \pmb{\nu}_{k'} \rangle = \| \pmb{\nu} \|_2 + \langle \mathbf{z}_k, \mathbf{z}_{k'} \rangle \geq 1 - o(1) > 0$ , we get that $j\langle \mathbf{w}_{j,r}^{(t,0)}, \pmb{\nu}_k \rangle$ is an increasing sequence in $t$ for any $k \in [K]$ and $r \in [m]$ . And Eq. (C.8) shows that $j\langle \mathbf{w}_{j,r}^{(t,0)}, \pmb{\nu} \rangle$ is an increasing sequence in $t$ . We have + +$$ +\begin{array}{l} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(t, J)} \boldsymbol {\nu} _ {k} \right\rangle y _ {k, i}\right) \leq 2 j \left\langle \mathbf {w} _ {j, r} ^ {(t, J)} \boldsymbol {\nu} _ {k} \right\rangle \leq 2 j \left\langle \mathbf {w} _ {j, r} ^ {(t, 0)}, \boldsymbol {\nu} _ {k} \right\rangle (1 + \gamma \mathcal {O} (1)) ^ {J} \\ = \mathcal {O} (1) j \langle \mathbf {w} _ {j, r} ^ {(t, 0)}, \boldsymbol {\nu} \rangle \left(1 + \gamma \mathcal {O} (1)\right) ^ {J}, \\ \end{array} +$$ + +where is first inequality is by Hypothesis E.3 and our assumption that $j\langle \mathbf{w}_{j,r}^{(t,0)},\pmb {\nu}_k\rangle >0$ . The second inequality is by Lemma E.1. And the last equality is due to our Hypothesis E.1. Without loss of generality, consider $j = 1$ . Let $r(t) = \arg \max_{r^{\prime}\in [m]}\langle \mathbf{w}_{1,r^{\prime}}^{(t,0)},\pmb {\nu}\rangle$ . We can upper bound the growth of the feature in the outer-loop by + +$$ +\begin{array}{l} \boldsymbol {\Lambda} _ {1} ^ {(t + 1)} = \left\langle \mathbf {w} _ {1, r (t + 1)} ^ {(t + 1, 0)}, \boldsymbol {\nu} \right\rangle \leq \left\langle \mathbf {w} _ {1, r (t + 1)} ^ {(t, 0)}, \boldsymbol {\nu} \right\rangle \left(1 + \eta \mathcal {O} (1) \left(1 + \gamma \Theta (1)\right) ^ {J}\right) \\ = \left\langle \mathbf {w} _ {1, r (t + 1)} ^ {(t, 0)}, \boldsymbol {\nu} \right\rangle \left(1 + \mathcal {O} (1) \eta \gamma^ {J}\right) \\ \leq \left\langle \mathbf {w} _ {1, r (t)} ^ {(t, 0)}, \boldsymbol {\nu} \right\rangle \left(1 + \mathcal {O} (1) \eta \gamma^ {J}\right) \\ = \boldsymbol {\Lambda} _ {1} ^ {(t)} \left(1 + \mathcal {O} (1) \eta \gamma^ {J}\right), \tag {E.12} \\ \end{array} +$$ + +where we have also used the fact that $-\ell'(\cdot) < 1$ by definition. Note that Eq. (E.12) also holds for $j = -1$ , i.e., $\Lambda_{-1}^{(t + 1)} \leq \Lambda_{-1}^{(t)} \left(1 + \mathcal{O}(1)\eta \gamma^J\right)$ using the same derivation. Next, we want to find a lower bound on the learning speed of the noise. After that, we wish to show that the lower bound for the noise actually grows much faster than the upper bound of the memorization of the feature, which implies that noise will be learnt sufficiently well before our neural network can pick up any learning + +on the feature. Consider $j = y_{\hat{k},\hat{i}}$ . Denote $r'(t) = \arg \max_{r \in [m]} \langle \mathbf{w}_{j,r}^{(t,0)}, \pmb{\xi}_{\hat{k},\hat{i}} \rangle$ . Plugging Lemma E.1 and Hypothesis E.4 into Eq. (E.9) we have the following upper bound hold for all $t \leq T^{(1)}$ + +$$ +\langle \mathbf {w} _ {j, r ^ {\prime} (t + 1)} ^ {(t + 1, 0)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \rangle \geq \langle \mathbf {w} _ {j, r ^ {\prime} (t)} ^ {(t + 1, 0)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \rangle \geq \langle \mathbf {w} _ {j, r ^ {\prime} (t)} ^ {(t, 0)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \rangle \left(1 + \Omega (1) \frac {\eta \sigma_ {\xi} ^ {2} d}{K n} \left(\frac {\gamma \sigma_ {\xi} ^ {2} d}{n}\right) ^ {J}\right), \tag {E.13} +$$ + +where the first inequality is by definition of $r'(t)$ . Now we can compare the learning speed of the feature and noise: + +$$ +\boldsymbol {\Lambda} _ {j} ^ {(t + 1)} \leq \boldsymbol {\Lambda} _ {j} ^ {(t)} \left(1 + \mathcal {O} (1) \eta \gamma^ {J}\right), \tag {E.14} +$$ + +$$ +\boldsymbol {\Xi} _ {\hat {k}, \hat {i}} ^ {(t + 1)} \geq \boldsymbol {\Xi} _ {\hat {k}, \hat {i}} ^ {(t)} \left(1 + \Omega (1) \frac {\eta \gamma^ {J}}{K} \left(\frac {\sigma_ {\xi} ^ {2} d}{n}\right) ^ {J + 1}\right). \tag {E.15} +$$ + +We can apply Lemma D.5 once we check all of its conditions are satisfied. We have $\boldsymbol{\Lambda}_{j}^{(0)} = \widetilde{\Theta}(d^{-1/2}) = o(1)$ , $\Xi_{\hat{k},\hat{i}}^{(0)} = \widetilde{\Theta}(d^{-1/2}) = o(1)$ . Let $G = 2$ , $A = \mathcal{O}(1)\eta\gamma^{J}$ and $B = \Omega(1)\frac{\eta\gamma^{J}}{K}\left(\frac{\sigma_{\xi}^{2}d}{n}\right)^{J+1}$ , we have $\Xi_{\hat{k},\hat{i}}^{(0)} = \widetilde{\Theta}(d^{-1/2}) > G^{-A/B} = 2^{-\log(d)^{5.5}}$ . Therefore, by Lemma D.5, for any $t \leq T^{(1)}$ , we have $\boldsymbol{\Lambda}_{j}^{(t)} \leq 2\boldsymbol{\Lambda}_{j}^{(0)}$ . This proves part (1) of our theorem. + +We now prove part (2) of our theorem. Let $k \in [K]$ , $i \in [n]$ , $r \in [m]$ and $j = -y_{k,i}$ . By Eq. (C.6) + +$$ +\begin{array}{l} \langle \mathbf {w} _ {j, r} ^ {(t + 1, 0)}, \boldsymbol {\xi} _ {k, i} \rangle \leq \langle \mathbf {w} _ {j, r} ^ {(t, 0)}, \boldsymbol {\xi} _ {k, i} \rangle - \frac {\eta}{K n} \sum_ {(k ^ {\prime}, i ^ {\prime}) \neq (k, i)} \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} y _ {k ^ {\prime}, i ^ {\prime}} j \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k ^ {\prime}, i ^ {\prime}} \rangle) \langle \boldsymbol {\xi} _ {k ^ {\prime}, i ^ {\prime}}, \boldsymbol {\xi} _ {k, i} \rangle \\ \leq \langle \mathbf {w} _ {j, r} ^ {(t, 0)}, \boldsymbol {\xi} _ {k, i} \rangle + \frac {\eta}{K n} \sum_ {(k ^ {\prime}, i ^ {\prime}) \neq (k, i)} \mathcal {O} (1) | \langle \boldsymbol {\xi} _ {k ^ {\prime}, i ^ {\prime}}, \boldsymbol {\xi} _ {k, i} \rangle | \\ \leq \left\langle \mathbf {w} _ {j, r} ^ {(t, 0)}, \boldsymbol {\xi} _ {k, i} \right\rangle + \eta \mathcal {O} (1) \Theta \left(\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}\right), \tag {E.16} \\ \end{array} +$$ + +where the second inequality is because both $-\ell'(\cdot)$ and $\sigma'(\cdot)$ are bounded by 1. Using Eq. (E.15) and the definition of $T^{(1)}$ , we can calculate that $T^{(1)} = \widetilde{\mathcal{O}}(1)$ under Condition D.1. Therefore, for any $t \leq T^{(1)} - 1$ we have + +$$ +\begin{array}{l} \max _ {r \in [ m ]} \left\langle \mathbf {w} _ {j, r} ^ {(t + 1, 0)}, \boldsymbol {\xi} _ {k, i} \right\rangle \leq \max _ {r \in [ m ]} \left\langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \boldsymbol {\xi} _ {k, i} \right\rangle + t \eta \mathcal {O} (1) \Theta \left(\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}\right) \\ \leq \mathcal {O} \left(\sigma_ {0} \sigma_ {\xi} \sqrt {d} \sqrt {\log (m K n)}\right) + T ^ {(1)} \eta \mathcal {O} (1) \Theta \left(\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}\right) \\ = \tilde {\mathcal {O}} \left(d ^ {- 1 / 2}\right), \\ \end{array} +$$ + +where we have used Lemma D.2 to get the second inequality. + +![](images/c34f905692317f6c7ac4fa01611f6308c75fef752f762e38b21192226525fe21.jpg) + +It remains to verify Hypothesis E.1-E.4. Let us suppose that Hypothesis E.1-E.4 hold for all $t < T^{(1)}$ . Then we have $\Lambda_j^{(t + 1)} \leq 2\Lambda_j^{(0)}$ , and $\langle \mathbf{w}_{j,r}^{(t + 1,0)}, \pmb{\xi}_{k,i} \rangle \leq \widetilde{\mathcal{O}}(d^{-1/2})$ for any $k \in [K]$ , $i \in [n]$ , $r \in [m]$ and $j = -y_{k,i}$ by Theorem E.2. + +Proof of Hypothesis E.1. For each task-specific feature $\mathbf{z}_k$ , we have at $t = 0$ using Lemma D.2 + +$$ +\Omega (\sigma_ {0} \sigma_ {s} \sqrt {d}) \leq \max _ {r} j \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \mathbf {z} _ {k} \rangle \leq \mathcal {O} (\sigma_ {0} \sigma_ {s} \sqrt {d} \sqrt {\log (m K n)}), +$$ + +$$ +\max _ {r} | \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \boldsymbol {\nu} \rangle | = \Theta \big (\sigma_ {0} \sqrt {\log (m K n)} \big). +$$ + +Since $\sigma_s\sqrt{d} = o(1)$ , we see that Hypothesis E.1 holds at $t = 0$ . We want to prove that it holds at $t + 1$ . For any $k \in [K]$ , $r \in [m]$ we have + +$$ +\begin{array}{l} j \langle \mathbf {w} _ {j, r} ^ {(t + 1, 0)}, \mathbf {z} _ {k} \rangle = j \langle \mathbf {w} _ {j, r} ^ {(t, 0)}, \mathbf {z} _ {k} \rangle - \frac {\eta}{K n} \sum_ {k ^ {\prime} \neq k} \sum_ {i = 1} ^ {n} \ell_ {k ^ {\prime}, i} ^ {\prime (t, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \pmb {\nu} _ {k ^ {\prime}} \rangle y _ {k ^ {\prime}, i}) \langle \mathbf {z} _ {k ^ {\prime}}, \mathbf {z} _ {k} \rangle \\ - \frac {\eta}{K n} \sum_ {i = 1} ^ {n} \ell_ {k, i} ^ {\prime (t, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \pmb {\nu} _ {k} \rangle y _ {k, i}) \| \mathbf {z} _ {k} \| _ {2} ^ {2} \\ \end{array} +$$ + +$$ +\begin{array}{l} \leq j \langle \mathbf {w} _ {j, r} ^ {(t, 0)}, \mathbf {z} _ {k} \rangle - \frac {\eta}{K n} \sum_ {k ^ {\prime} \neq k} \sum_ {i = 1} ^ {n} \ell_ {k ^ {\prime}, i} ^ {\prime (t, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \pmb {\nu} _ {k ^ {\prime}} \rangle y _ {k ^ {\prime}, i}) \Theta (\sigma_ {s} ^ {2} \sqrt {d} \sqrt {\log (d)}) \\ - \frac {\eta}{K n} \sum_ {i = 1} ^ {n} \ell_ {k, i} ^ {\prime (t, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \boldsymbol {\nu} _ {k} \rangle y _ {k, i}) \Theta (\sigma_ {s} ^ {2} d) \\ \leq j \left\langle \mathbf {w} _ {j, r} ^ {(t, 0)}, \mathbf {z} _ {k} \right\rangle - \frac {\eta}{K n} \sum_ {k ^ {\prime} = 1} ^ {K} \sum_ {i = 1} ^ {n} \ell_ {k ^ {\prime}, i} ^ {\prime (t, J)} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \boldsymbol {\nu} _ {k ^ {\prime}} \right\rangle y _ {k ^ {\prime}, i}\right) \Theta \left(\sigma_ {s} ^ {2} d\right), \tag {E.17} \\ \end{array} +$$ + +where we used Condition 4.1 to get the first inequality. The last inequality is because $\log (d)\ll d$ . Suppose that at time $t + 1$ , there exists some $\tilde{r}\in [m]$ and $\tilde{k}\in [K]$ such that + +$$ +j \langle \mathbf {w} _ {j, \tilde {r}} ^ {(t + 1, 0)}, \mathbf {z} _ {\tilde {k}} \rangle \geq 2 \max _ {r} j \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \mathbf {z} _ {\tilde {k}} \rangle \geq \Omega (\sigma_ {s} \sigma_ {0} \sqrt {d}). +$$ + +Then, by Eq. (E.17) we get + +$$ +\begin{array}{l} - \frac {\eta}{K n} \sum_ {t ^ {\prime} = 0} ^ {t} \sum_ {k, i} \ell_ {k, i} ^ {\prime (t ^ {\prime}, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, \tilde {r}} ^ {(t ^ {\prime}, J)}, \boldsymbol {\nu} _ {k} \rangle y _ {k, i}) \Theta (\sigma_ {s} ^ {2} d) \geq 2 \max _ {r} j \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \mathbf {z} _ {\tilde {k}} \rangle - j \langle \mathbf {w} _ {j, \tilde {r}} ^ {(0, 0)}, \mathbf {z} _ {\tilde {k}} \rangle \\ \geq \Theta (\sigma_ {s} \sigma_ {0} \sqrt {d}), \\ - \frac {\eta}{K n} \sum_ {t ^ {\prime} = 0} ^ {t} \sum_ {k, i} \ell_ {k, i} ^ {\prime (t, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, \tilde {r}} ^ {(t, J)}, \boldsymbol {\nu} _ {k} \rangle y _ {k, i}) \geq \Theta \left(\frac {\sigma_ {0}}{\sigma_ {s} \sqrt {d}}\right) \\ = \Theta \left(\frac {\log (d) ^ {0 . 2}}{\sqrt {d}}\right). \\ \end{array} +$$ + +Here the second inequality is by Lemma D.2. But then, Eq. (C.8) implies + +$$ +\begin{array}{l} j \langle \mathbf {w} _ {j, \tilde {r}} ^ {(t + 1, 0)}, \boldsymbol {\nu} \rangle = j \langle \mathbf {w} _ {j, \tilde {r}} ^ {(0, 0)}, \boldsymbol {\nu} \rangle - \frac {\eta}{K n} \sum_ {t ^ {\prime} = 0} ^ {t} \sum_ {k, i} \ell_ {k, i} ^ {\prime (t, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, \tilde {r}} ^ {(t, J)}, \boldsymbol {\nu} _ {k} \rangle y _ {k, i}) \\ \geq \min _ {r \in [ m ]} j \left\langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \boldsymbol {\nu} \right\rangle + \Theta \left(\frac {\log (d) ^ {0 . 2}}{\sqrt {d}}\right) \\ \geq - \Theta (\sigma_ {0} \sqrt {\log (m K n)}) + \Theta \left(\frac {\log (d) ^ {0 . 2}}{\sqrt {d}}\right) \\ = \Theta (\log (d) ^ {0. 1}) \boldsymbol {\Lambda} _ {j} ^ {(0)}. \\ \end{array} +$$ + +We used Lemma D.2 to get the third line and last line. This is a contradiction, since we should have + +$$ +j \langle \mathbf {w} _ {j, \tilde {r}} ^ {(t + 1, 0)}, \boldsymbol {\nu} \rangle \leq \boldsymbol {\Lambda} _ {j} ^ {(t + 1)} \leq 2 \boldsymbol {\Lambda} _ {j} ^ {(0)}. +$$ + +Therefore for all $k \in [K]$ we conclude + +$$ +\max _ {r} j \langle \mathbf {w} _ {j, r} ^ {(t + 1, 0)}, \mathbf {z} _ {k} \rangle \leq 2 \max _ {r} j \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \mathbf {z} _ {k} \rangle = o (1) \max _ {r} j \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \boldsymbol {\nu} \rangle = o (1) \max _ {r} j \langle \mathbf {w} _ {j, r} ^ {(t + 1, 0)}, \boldsymbol {\nu} \rangle . +$$ + +This proves that Hypothesis E.1 holds at time $t + 1$ . + +Proof of Hypothesis E.2. Without loss of generality, let us assume that $y_{\hat{k},\hat{i}} = 1$ . By our estimates in Lemma D.2, Hypothesis E.2 clearly holds at initialization. Suppose it holds at time $t$ . Recall Eq. (C.7) and that + +$$ +\begin{array}{l} \sum_ {j = \pm 1} \sum_ {r = 1} ^ {m} j \left(\sigma \left(\left\langle \mathbf {w} _ {j, r} ^ {(t + 1, \tau)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \right\rangle\right) + \sigma \left(\left\langle \mathbf {w} _ {j, r} ^ {(t + 1, \tau)}, \boldsymbol {\nu} _ {\hat {k}} \right\rangle\right)\right) \\ \leq \sum_ {r = 1} ^ {m} \sigma \left(\left\langle \mathbf {w} _ {1, r} ^ {(t + 1, \tau)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \right\rangle\right) + \sigma \left(\left\langle \mathbf {w} _ {1, r} ^ {(t + 1, \tau)}, \boldsymbol {\nu} _ {\hat {k}} \right\rangle\right), \tag {E.18} \\ \end{array} +$$ + +by the non-negativity of $\sigma (\cdot)$ . For any $r\in [m]$ , we have + +$$ +\begin{array}{l} j \langle \mathbf {w} _ {j, r} ^ {(t + 1, 0)}, \boldsymbol {\nu} _ {\hat {k}} \rangle = j \langle \mathbf {w} _ {j, r} ^ {(t + 1, 0)}, \mathbf {z} _ {\hat {k}} \rangle + j \langle \mathbf {w} _ {j, r} ^ {(t + 1, 0)}, \boldsymbol {\nu} \rangle \\ \leq \underset {r ^ {\prime} \in [ m ]} {\arg \max } j \langle \mathbf {w} _ {j, r ^ {\prime}} ^ {(t + 1, 0)}, \mathbf {z} _ {\hat {k}} \rangle + \underset {r ^ {\prime} \in [ m ]} {\arg \max } j \langle \mathbf {w} _ {j, r ^ {\prime}} ^ {(t + 1, 0)}, \boldsymbol {\nu} \rangle \\ = (1 + o(1))\underset {r^{\prime}\in [m]}{\arg \max}j\langle \mathbf{w}_{j,r^{\prime}}^{(t + 1,0)},\boldsymbol {\nu}\rangle \\ = \mathcal {O} (1) \boldsymbol {\Lambda} _ {j} ^ {(t + 1)} \\ \leq 2 \Lambda_ {j} ^ {(0)}, \\ \end{array} +$$ + +where we used Hypothesis E.1 to get the third line. Then, by Eq. (E.5) we have that for any $\tau \in [J]$ + +$$ +\begin{array}{l} \langle \mathbf {w} _ {1, r} ^ {(t + 1, \tau)}, \boldsymbol {\nu} _ {\hat {k}} \rangle \leq \langle \mathbf {w} _ {1, r} ^ {(t + 1, 0)}, \boldsymbol {\nu} _ {\hat {k}} \rangle (1 + \gamma \mathcal {O} (1)) ^ {\tau} \\ = \mathcal {O} (1) \boldsymbol {\Lambda} _ {1} ^ {(t + 1)} \left(1 + \gamma \mathcal {O} (1)\right) ^ {\tau} \\ = \widetilde {\mathcal {O}} (1) \boldsymbol {\Lambda} _ {1} ^ {(0)}. \tag {E.19} \\ \end{array} +$$ + +This implies + +$$ +\sum_ {r = 1} ^ {m} \sigma (\langle \mathbf {w} _ {1, r} ^ {(t + 1, \tau)}, \boldsymbol {\nu} _ {\hat {k}} \rangle) \leq \widetilde {\mathcal {O}} (1) m \boldsymbol {\Lambda} _ {1} ^ {(0)} = o (1). +$$ + +We also have that + +$$ +\sum_ {r = 1} ^ {m} \sigma (\langle \mathbf {w} _ {1, r} ^ {(t + 1, 0)}, \boldsymbol {\xi} _ {\hat {k}, \hat {t}} \rangle) \leq m \sigma (\Xi_ {\hat {k}, \hat {t}} ^ {(t + 1)}) = o (1). +$$ + +where the inequality is due to $t + 1 < T^{(1)}$ which implies $\Xi_{\hat{k},\hat{i}}^{(t + 1)} < m^{-1 / 2}\left(1 + \frac{\gamma\sigma_{\xi}^2d}{n}\right)^{-J}$ . Hence, by Eq. (E.18) we get that $-\ell_{\hat{k},\hat{i}}^{\prime (t + 1,0)} = -\ell^{\prime}(o(1)) = \Omega (1)$ . Now, suppose that $-\ell_{\hat{k},\hat{i}}^{\prime (t + 1,\tau)} = \Omega (1)$ for some $0\leq \tau \leq J - 1$ . We wish to show that $-\ell_{\hat{k},\hat{i}}^{\prime (t + 1,\tau +1)} = \Omega (1)$ . By our previous argument, it suffices to show $\sum_{r = 1}^{m}\sigma (\langle \mathbf{w}_{1,r}^{(t + 1,\tau +1)},\pmb{\xi}_{\hat{k},\hat{i}}\rangle) = \mathcal{O}(1)$ . Because that would imply $-\ell_{\hat{k},\hat{i}}^{\prime (t + 1,\tau +1)} = -\ell^{\prime}(\mathcal{O}(1)) = \Omega (1)$ . We have, + +$$ +\begin{array}{l} \sum_ {r = 1} ^ {m} \sigma \left(\left\langle \mathbf {w} _ {1, r} ^ {(t + 1, \tau + 1)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \right\rangle\right) \leq m \sigma \left(\Xi_ {\hat {k}, \hat {i}} ^ {(t + 1)} \left(1 + \frac {\gamma}{n} \mathcal {O} (1) \Theta \left(\sigma_ {\xi} ^ {2} d\right)\right) ^ {\tau + 1}\right) \\ \leq m \sigma \left(m ^ {- 1 / 2} \left(1 + \frac {\gamma \sigma_ {\xi} ^ {2} d}{n}\right) ^ {- J} \left(1 + \frac {\gamma}{n} \mathcal {O} (1) \Theta (\sigma_ {\xi} ^ {2} d)\right) ^ {J}\right) \\ \leq \mathcal {O} (1), \\ \end{array} +$$ + +where the second inequality is because $\tau + 1 \leq J$ . This implies $-\ell_{\hat{k},\hat{i}}^{\prime (t + 1,\tau +1)} = -\ell^{\prime}(\mathcal{O}(1)) = \Omega (1)$ and we are done. + +Proof of Hypothesis E.3. By our estimates in Lemma D.2, Hypothesis E.3 clearly holds at initialization. Suppose it holds at time $t$ . Using Eq. (E.19), we immediately have that for any $\tau \in [J]$ , $r \in [m]$ and $k \in [K]$ , + +$$ +j \langle \mathbf {w} _ {j, r} ^ {(t + 1, \tau)}, \boldsymbol {\nu} _ {k} \rangle \leq \widetilde {\mathcal {O}} (1) \boldsymbol {\Lambda} _ {j} ^ {(0)} = o (1). +$$ + +![](images/6ab8aba1bbea035a533fefeffa732c94477b979c0134d3ddd4341aef3fff5a2c.jpg) + +Proof of Hypothesis E.4. By our estimates in Lemma D.2, Hypothesis E.4 clearly holds at initialization. Suppose it holds at time $t$ . Suppose that $\langle \mathbf{w}_{j,r}^{(t + 1,0)},\pmb{\xi}_{\hat{k},\hat{i}}\rangle >0$ for $j = y_{\hat{k},\hat{i}}$ and some $r\in [m]$ . Recall that by the assumption of $t + 1\leq T^{(1)}$ , we have + +$$ +\langle \mathbf {w} _ {j, r} ^ {(t + 1, 0)}, \pmb {\xi} _ {\hat {k}, \hat {\imath}} \rangle \leq \Xi_ {\hat {k}, \hat {\imath}} ^ {(t + 1)} \leq m ^ {- 1 / 2} \Big (1 + \frac {\gamma \sigma_ {\xi} ^ {2} d}{n} \Big) ^ {- J} = o (1). +$$ + +Hence, by definition of $\sigma'(\cdot)$ we have $\sigma'(\langle \mathbf{w}_{j,r}^{(t+1,0)}, \pmb{\xi}_{\hat{k},\hat{i}} \rangle) = 2\langle \mathbf{w}_{j,r}^{(t+1,0)}, \pmb{\xi}_{\hat{k},i} \rangle$ . While $\langle \mathbf{w}_{j,r}^{(t+1,\tau)}, \pmb{\xi}_{\hat{k},\hat{i}} \rangle = o(1)$ , we have $\sigma'(\langle \mathbf{w}_{j,r}^{(t+1,\tau)}, \pmb{\xi}_{\hat{k},\hat{i}} \rangle) = 2\langle \mathbf{w}_{j,r}^{(t+1,\tau)}, \pmb{\xi}_{\hat{k},\hat{i}} \rangle$ . By Eq. (C.2) we have + +$$ +\begin{array}{l} \langle \mathbf {w} _ {j, r} ^ {(t + 1, \tau + 1)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \rangle \leq \langle \mathbf {w} _ {j, r} ^ {(t + 1, \tau)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \rangle + \frac {\gamma}{n} \sum_ {i \neq \hat {i}} \mathcal {O} (1) | \langle \boldsymbol {\xi} _ {\hat {k}, i}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \rangle | - \frac {\gamma}{n} \ell_ {\hat {k}, \hat {i}} ^ {\prime (t + 1, \tau)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t + 1, \tau)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \rangle) \| \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \| ^ {2} \\ = \langle \mathbf {w} _ {j, r} ^ {(t + 1, \tau)}, \pmb {\xi} _ {\hat {k}, \hat {i}} \rangle + \gamma \mathcal {O} (1) \mathcal {O} (\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}) + \frac {\gamma}{n} \mathcal {O} (1) \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t + 1, \tau)}, \pmb {\xi} _ {\hat {k}, \hat {i}} \rangle) \Theta (\sigma_ {\xi} ^ {2} d) \\ = \left\langle \mathbf {w} _ {j, r} ^ {(t + 1, \tau)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \right\rangle \left(1 + \frac {\gamma}{n} \mathcal {O} (1) \Theta (\sigma_ {\xi} ^ {2} d)\right) + \widetilde {\mathcal {O}} \left(d ^ {- 1 / 2}\right) \\ \leq \left\langle \mathbf {w} _ {j, r} ^ {(t + 1, 0)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \right\rangle \left(1 + \frac {\gamma}{n} \mathcal {O} (1) \Theta \left(\sigma_ {\xi} ^ {2} d\right)\right) ^ {\tau + 1} + \widetilde {\mathcal {O}} \left(d ^ {- 1 / 2}\right) \tau \left(1 + \frac {\gamma}{n} \mathcal {O} (1) \Theta \left(\sigma_ {\xi} ^ {2} d\right)\right) ^ {\tau} \\ = \left\langle \mathbf {w} _ {j, r} ^ {(t + 1, 0)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \right\rangle \left(1 + \frac {\gamma}{n} \mathcal {O} (1) \Theta \left(\sigma_ {\xi} ^ {2} d\right)\right) ^ {\tau + 1} + \widetilde {\mathcal {O}} \left(d ^ {- 1 / 2}\right) \\ \leq \Xi_ {\hat {k}, \hat {i}} ^ {(t + 1)} \left(1 + \frac {\gamma}{n} \mathcal {O} (1) \Theta \left(\sigma_ {\xi} ^ {2} d\right)\right) ^ {\tau + 1} + \widetilde {\mathcal {O}} \left(d ^ {- 1 / 2}\right). \tag {E.20} \\ \end{array} +$$ + +We used $-\ell'(\cdot) \leq 1$ and $\sigma'(\cdot) \leq 1$ to get the first line. We used Lemma D.2 for the second line. It is straightforward to check recursively that $\langle \mathbf{w}_{j,r}^{(t+1,\tau)}, \pmb{\xi}_{\hat{k},\hat{i}} \rangle \leq o(1)$ for $\tau \in [J-1]$ and hence Eq. (E.20) holds for $\tau \in [J-1]$ . In the meantime, this also implies $\sigma'(\langle \mathbf{w}_{j,r}^{(t+1,\tau)}, \pmb{\xi}_{\hat{k},\hat{i}} \rangle) = 2\langle \mathbf{w}_{j,r}^{(t+1,\tau)}, \pmb{\xi}_{\hat{k},\hat{i}} \rangle$ for $\tau \in [J-1]$ . Then Eq. (E.20) implies + +$$ +\begin{array}{l} \langle \mathbf {w} _ {j, r} ^ {(t + 1, J)}, \boldsymbol {\xi} _ {\hat {k}, \hat {i}} \rangle \leq \boldsymbol {\Xi} _ {\hat {k}, \hat {i}} ^ {(t + 1)} \left(1 + \frac {\gamma}{n} \mathcal {O} (1) \Theta (\sigma_ {\xi} ^ {2} d)\right) ^ {J} + \widetilde {\mathcal {O}} \left(d ^ {- 1 / 2}\right) \\ \leq \mathcal {O} \left(m ^ {- 1 / 2}\right) = o (1). \\ \end{array} +$$ + +Therefore, $\sigma^{\prime}(\langle \mathbf{w}_{j,r}^{(t + 1,J)},\pmb{\xi}_{\hat{k},\hat{i}}\rangle) = 2\langle \mathbf{w}_{j,r}^{(t + 1,J)},\pmb{\xi}_{\hat{k},\hat{i}}\rangle$ + +![](images/7493fcdf573336d35569c5d2ec4fafae4cc7074d04cea53a2b5c6e834336f1a4.jpg) + +We note that by our definition, $T^{(1)}$ is the time taken for the slowest-learnt noise to be memorized by our neural network. Other noises are learned faster. Our next theorem guarantees that other noises has almost the same inner product as the slowest-learnt noise at time $T^{(1)}$ . + +Theorem E.3. Under Condition D.1 and Condition 4.1, suppose one uses the train-train method. For any $k \in [K]$ , $i \in [n]$ with $(k,i) \neq (\hat{k},\hat{i})$ , let $t \in [T_{k,i}^{(1)}, T^{(1)}]$ , then we have $\Xi_{k,i}^{(t)} = \widetilde{\Theta}(1)$ . More precisely, it holds that + +$$ +\boldsymbol {\Xi} _ {k, i} ^ {(t)} \geq \Omega \left(m ^ {- 1 / 2} \left(1 + \frac {\gamma \sigma_ {\xi} ^ {2} d}{n}\right) ^ {- J}\right). +$$ + +And + +$$ +\Xi_ {k, i} ^ {(t)} \leq \mathcal {O} \left(m ^ {- 1 / 2} \left(1 + \frac {\gamma \sigma_ {\xi} ^ {2} d}{n}\right) ^ {- J + 0. 5}\right). +$$ + +Proof. We first show that $\Xi_{k,i}^{(t)} \geq \Omega\left(m^{-1/2}\left(1 + \frac{\gamma\sigma_{\xi}^2d}{n}\right)^{-J}\right) = \widetilde{\Omega}(1)$ . By definition of $T_{k,i}^{(1)}$ , we know that $\Xi_{k,i}^{(t)} \geq m^{-1/2}\left(1 + \frac{\gamma\sigma_{\xi}^2d}{n}\right)^{-J}$ when $t = T_{k,i}^{(1)}$ . Suppose there exists $t \in [T_{k,i}^{(1)}, T^{(1)}]$ such that it is the first iteration such that $\Xi_{k,i}^{(t)} < m^{-1/2}\left(1 + \frac{\gamma\sigma_{\xi}^2d}{n}\right)^{-J}$ . If such $t$ does not exist, then we automatically have $\Xi_{k,i}^{(t)} \geq m^{-1/2}\left(1 + \frac{\gamma\sigma_{\xi}^2d}{n}\right)^{-J}$ for all $t \in [T_{k,i}^{(1)}, T^{(1)}]$ . By definition of $t$ we have $\Xi_{k,i}^{(t-1)} \geq m^{-1/2}\left(1 + \frac{\gamma\sigma_{\xi}^2d}{n}\right)^{-J}$ . By Eq. (E.9), we have the following lower bound on $\Xi_{k,i}^{(t)}$ + +$$ +\begin{array}{l} \boldsymbol {\Xi} _ {k, i} ^ {(t)} \geq \boldsymbol {\Xi} _ {k, i} ^ {(t - 1)} - \eta \mathcal {O} (1) \Theta \left(\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}\right) \\ \geq m ^ {- 1 / 2} \left(1 + \frac {\gamma \sigma_ {\xi} ^ {2} d}{n}\right) ^ {- J} - \widetilde {\mathcal {O}} \left(d ^ {- 1 / 2}\right) \\ = \Omega \left(m ^ {- 1 / 2} \left(1 + \frac {\gamma \sigma_ {\xi} ^ {2} d}{n}\right) ^ {- J}\right), \\ \end{array} +$$ + +where in the first inequality we used $-\ell'(\cdot) \leq 1$ and $\sigma'(\cdot) \leq 1$ and Lemma D.2. The second and the third line are direct calculations under Condition D.1. Using the same proof as Hypothesis E.2, we have that $-\ell_{k,i}^{\prime(t,\tau)} = \Omega(1)$ for any $\tau \in [J]$ . Using a similar derivation of Eq. (E.13), we found that + +$$ +\begin{array}{l} \Xi_ {k, i} ^ {(t + 1)} \geq \Xi_ {k, i} ^ {(t)} \left(1 + \Omega (1) \frac {\eta \sigma_ {\xi} ^ {2} d}{K n} \left(\frac {\gamma \sigma_ {\xi} ^ {2} d}{n}\right) ^ {J}\right) \\ \geq \left(\Xi_ {k, i} ^ {(t - 1)} - \widetilde {\mathcal {O}} (d ^ {- 1 / 2})\right) \left(1 + \Omega (1) \frac {\eta \sigma_ {\xi} ^ {2} d}{K n} \left(\frac {\gamma \sigma_ {\xi} ^ {2} d}{n}\right) ^ {J}\right) \\ > \Xi_ {k, i} ^ {(t - 1)}, \\ \end{array} +$$ + +where the last inequality is because $\Xi_{k,i}^{(t-1)} \geq m^{-1/2}\left(1 + \frac{\gamma\sigma_{\xi}^2d}{n}\right)^{-J} = \widetilde{\Omega}(1) \gg \widetilde{\mathcal{O}}(d^{-1/2})$ , and $\left(1 + \Omega(1)\frac{\eta\sigma_{\xi}^2d}{Kn}\left(\frac{\gamma\sigma_{\xi}^2d}{n}\right)^J\right) = \Omega(\mathrm{polylog}(d)) \gg \mathcal{O}(1)$ . This shows that even if $\Xi_{k,i}^{(t)} < \Xi_{k,i}^{(t-1)}$ at some $t$ , we still have $\Xi_{k,i}^{(t)} = \Omega\left(m^{-1/2}\left(1 + \frac{\gamma\sigma_{\xi}^2d}{n}\right)^{-J}\right) = \widetilde{\Omega}(1)$ and $\Xi_{k,i}^{(t+1)} > \Xi_{k,i}^{(t-1)}$ . Hence, $\Xi_{k,i}^{(t)} \geq \widetilde{\Omega}(1)$ for all $t \in [T_{k,i}^{(1)}, T^{(1)}]$ . Next, we need to show that $\Xi_{k,i}^{(t)} \leq \mathcal{O}\left(m^{-1/2}\left(1 + \frac{\gamma\sigma_{\xi}^2d}{n}\right)^{-J+0.5}\right)$ . + +Let + +$$ +t ^ {\prime} = \inf \left\{t \in (T _ {k, i} ^ {(1)}, T ^ {(1)} ]: \Xi_ {k, i} ^ {(\tilde {t})} \geq m ^ {- 1 / 2} \left(1 + \frac {\gamma \sigma_ {\xi} ^ {2} d}{n}\right) ^ {- J + 0. 5}, \forall \tilde {t} \in [ t, T ^ {(1)} ] \right\}, +$$ + +where the inf of an empty set is defined as $\infty$ . If $t' = \infty$ then we are done, because that implies $\Xi_{k,i}^{(T^{(1)})} < m^{-1/2}\left(1 + \frac{\gamma\sigma_{\xi}^2d}{n}\right)^{-J+0.5}$ . Assume $t'$ is finite. We first need to show that $\Xi_{k,i}^{(t')} = \mathcal{O}\big(m^{-1/2}\big(1 + \frac{\gamma\sigma_{\xi}^2d}{n}\big)^{-J+0.5}\big)$ . By definition of $t'$ , we know $\Xi_{k,i}^{(t'-1)} < m^{-1/2}\big(1 + \frac{\gamma\sigma_{\xi}^2d}{n}\big)^{-J+0.5}$ . By Eq. (C.6), we have + +$$ +\begin{array}{l} \boldsymbol {\Xi} _ {k, i} ^ {(t ^ {\prime})} \leq \boldsymbol {\Xi} _ {k, i} ^ {(t ^ {\prime} - 1)} + \widetilde {\mathcal {O}} (d ^ {- 1 / 2}) + \frac {\eta}{K n} \Theta (\sigma_ {\xi} ^ {2} d) \\ < m ^ {- 1 / 2} \left(1 + \frac {\gamma \sigma_ {\xi} ^ {2} d}{n}\right) ^ {- J + 0. 5} + \tilde {\mathcal {O}} \left(d ^ {- 1 / 2}\right) + \Theta \left(\frac {\eta \sigma_ {\xi} ^ {2} d}{K n}\right) \\ \leq 1. 5 \left(m ^ {- 1 / 2} \left(1 + \frac {\gamma \sigma_ {\xi} ^ {2} d}{n}\right) ^ {- J + 0. 5}\right), \\ \end{array} +$$ + +where we used $\ell'(\cdot) \leq 1$ , $\sigma'(\cdot) \leq 1$ and Lemma D.2 in the first inequality. The last inequality is because $\widetilde{\mathcal{O}}(d^{-1/2}) + \Theta\left(\frac{\eta\sigma_{\xi}^{2}d}{Kn}\right) = o(1)m^{-1/2}\left(1 + \frac{\gamma\sigma_{\xi}^{2}d}{n}\right)^{-J+0.5}$ by a direct calculation. We now show that $-\ell_{k,i}^{\prime(t,J)} = \mathcal{O}(\exp(-\log(d)^{0.6}))$ for all $t \in [t', T^{(1)}]$ . Without loss of generality, assume $y_{k,i} = 1$ . Let $r(t) = \arg \max_{r \in [m]} \langle \mathbf{w}_{1,r}^{(t,0)}, \pmb{\xi}_{k,i} \rangle$ . Using similar proof of Hypothesis E.2, we have that $-\ell_{k,i}^{\prime(t,\tau)} = \Theta(1)$ for $\tau \in [J-1]$ . Since $\langle \mathbf{w}_{1,r(t)}^{(t,0)}, \pmb{\xi}_{k,i} \rangle \geq m^{-1/2}\left(1 + \frac{\gamma\sigma_{\xi}^{2}d}{n}\right)^{-J+0.5}$ , we apply Eq. (E.7) $J$ times to get $\langle \mathbf{w}_{1,r(t)}^{(t,J)}, \pmb{\xi}_{k,i} \rangle \geq \Theta\left(m^{-1/2}\left(1 + \frac{\gamma\sigma_{\xi}^{2}d}{n}\right)^{0.5}\right)$ . Then we have + +$$ +\begin{array}{l} - \ell_ {k, i} ^ {\prime (t, J)} = - \ell^ {\prime} \left(\sum_ {j = \pm 1} \sum_ {r ^ {\prime} = 1} ^ {m} j \left(\sigma \left(\left\langle \mathbf {w} _ {j, r ^ {\prime}} ^ {(t, J)}, \boldsymbol {\xi} _ {k, i} \right\rangle\right) + \sigma \left(\left\langle \mathbf {w} _ {j, r ^ {\prime}} ^ {(t, J)}, \boldsymbol {\nu} _ {k} \right\rangle\right)\right)\right) \\ \leq - \ell^ {\prime} \left(\sigma \left(\left\langle \mathbf {w} _ {1, r (t)} ^ {(t, J)}, \boldsymbol {\xi} _ {k, i} \right\rangle\right) - \sum_ {r ^ {\prime} = 1} ^ {m} \left(\sigma \left(\left\langle \mathbf {w} _ {- 1, r ^ {\prime}} ^ {(t, J)}, \boldsymbol {\xi} _ {k, i} \right\rangle\right) + \sigma \left(\left\langle \mathbf {w} _ {- 1, r ^ {\prime}} ^ {(t, J)}, \boldsymbol {\nu} _ {k} \right\rangle\right)\right)\right) \\ \leq - \ell^ {\prime} \left(\Theta \left(m ^ {- 1 / 2} \left(1 + \frac {\gamma \sigma_ {\xi} ^ {2} d}{n}\right) ^ {0. 5}\right) - o (1) - o (1)\right) \\ \leq \mathcal {O} \left(\exp \left(- \Theta (1) \log (d) ^ {0. 6}\right)\right). \tag {E.21} \\ \end{array} +$$ + +The second line is because $-\ell'(\cdot)$ is non-increasing. To justify the third line, we first note that the second part of Theorem E.2 implies $\langle \mathbf{w}_{-1,r'}^{(t,0)}, \pmb{\xi}_{k,i} \rangle = \widetilde{\mathcal{O}}(d^{-1/2})$ for all $r' \in [m]$ . And + +$$ +\langle \mathbf {w} _ {- 1, r ^ {\prime}} ^ {(t, \tau + 1)}, \pmb {\xi} _ {k, i} \rangle = \langle \mathbf {w} _ {- 1, r ^ {\prime}} ^ {(t, \tau)}, \pmb {\xi} _ {k, i} \rangle + \frac {\gamma}{n} \sum_ {i ^ {\prime} \neq i} \ell_ {k, i ^ {\prime}} ^ {\prime (t, \tau)} y _ {k, i ^ {\prime}} \sigma^ {\prime} (\langle \mathbf {w} _ {- 1, r ^ {\prime}} ^ {(t, \tau)}, \pmb {\xi} _ {k, i ^ {\prime}} \rangle) \langle \pmb {\xi} _ {k, i ^ {\prime}}, \pmb {\xi} _ {k, i} \rangle +$$ + +$$ +\begin{array}{l} + \frac {\gamma}{n} \ell_ {k, i} ^ {\prime (t, \tau)} \sigma^ {\prime} (\langle \mathbf {w} _ {- 1, r ^ {\prime}} ^ {(t, \tau)}, \boldsymbol {\xi} _ {k, i} \rangle) \| \boldsymbol {\xi} _ {k, i} \| _ {2} ^ {2} \\ \leq \langle \mathbf {w} _ {- 1, r ^ {\prime}} ^ {(t, \tau)}, \boldsymbol {\xi} _ {k, i} \rangle + \frac {\gamma}{n} \sum_ {i ^ {\prime} \neq i} \mathcal {O} (1) | \langle \boldsymbol {\xi} _ {k, i ^ {\prime}}, \boldsymbol {\xi} _ {k, i} \rangle | \\ \leq \left\langle \mathbf {w} _ {- 1, r ^ {\prime}} ^ {(t, \tau)}, \boldsymbol {\xi} _ {k, i} \right\rangle + \widetilde {\mathcal {O}} \left(d ^ {- 1 / 2}\right), \\ \end{array} +$$ + +where we used $-\ell'(\cdot) \leq 1$ , $\sigma'(\cdot) \leq 1$ and Lemma D.2. This implies + +$$ +\langle \mathbf {w} _ {- 1, r ^ {\prime}} ^ {(t, J)}, \boldsymbol {\xi} _ {k, i} \rangle \leq \langle \mathbf {w} _ {- 1, r ^ {\prime}} ^ {(t, 0)}, \boldsymbol {\xi} _ {k, i} \rangle + J \widetilde {\mathcal {O}} (d ^ {- 1 / 2}) = \widetilde {\mathcal {O}} (d ^ {- 1 / 2}), +$$ + +since $J = \mathcal{O}(1)$ and $\langle \mathbf{w}_{-1,r^{\prime}}^{(t,0)},\pmb{\xi}_{k,i}\rangle = \widetilde{\mathcal{O}} (d^{-1 / 2})$ . Hence, + +$$ +\sum_ {r ^ {\prime} = 1} ^ {m} \sigma (\langle \mathbf {w} _ {- 1, r ^ {\prime}} ^ {(t, J)}, \boldsymbol {\xi} _ {k, i} \rangle) \leq m \widetilde {\mathcal {O}} (d ^ {- 1 / 2}) = o (1). +$$ + +By Eq. (C.1) and Eq. (E.11) we get that + +$$ +\langle \mathbf {w} _ {- 1, r} ^ {(t, J)}, \boldsymbol {\nu} _ {k} \rangle \leq \langle \mathbf {w} _ {- 1, r} ^ {(t, 0)}, \boldsymbol {\nu} _ {k} \rangle \leq \langle \mathbf {w} _ {- 1, r} ^ {(0, 0)}, \boldsymbol {\nu} _ {k} \rangle = \mathcal {O} (d ^ {- 1 / 2} \sqrt {\log (m)}), +$$ + +where the last equality is due to Lemma D.2. Thus, + +$$ +\sum_ {r = 1} ^ {m} \sigma \left(\left\langle \mathbf {w} _ {- 1, r} ^ {(t, J)}, \boldsymbol {\nu} _ {k} \right\rangle\right) \leq m \widetilde {\mathcal {O}} \left(d ^ {- 1 / 2} \sqrt {\log (m)}\right) = o (1). +$$ + +This justifies the third line of Eq. (E.21). Using Eq. (E.15), one can directly calculate that $T^{(1)} = \mathcal{O}(\mathrm{polylog}(d))$ . Then, using Eq. (C.6) we have + +$$ +\begin{array}{l} \Xi_ {k, i} ^ {(t + 1)} \leq \Xi_ {k, i} ^ {(t)} + \widetilde {\mathcal {O}} (d ^ {- 1 / 2}) - \frac {\eta}{K n} \ell_ {k, i} ^ {\prime (t, J)} \Theta (\sigma_ {\xi} ^ {2} d) \\ \leq \Xi_ {k, i} ^ {(t)} + \widetilde {\mathcal {O}} (d ^ {- 1 / 2}) + \frac {\eta}{K n} \Theta (\sigma_ {\xi} ^ {2} d) \mathcal {O} \big (\exp \big (- \log (d) ^ {0. 6} \big) \big), \\ \end{array} +$$ + +$$ +\begin{array}{l} \Xi_ {k, i} ^ {(T ^ {(1)})} \leq \Xi_ {k, i} ^ {(t ^ {\prime})} + (T ^ {(1)} - t ^ {\prime}) \big (\widetilde {\mathcal {O}} (d ^ {- 1 / 2}) + \frac {\eta}{K n} \Theta (\sigma_ {\xi} ^ {2} d) \mathcal {O} \big (\exp \big (- \log (d) ^ {0. 6} \big) \big) \big) \\ \leq \Xi_ {k, i} ^ {(t ^ {\prime})} + T ^ {(1)} \left(\widetilde {\mathcal {O}} \left(d ^ {- 1 / 2}\right) + \frac {\eta}{K n} \Theta \left(\sigma_ {\xi} ^ {2} d\right) \mathcal {O} \left(\exp \left(- \log (d) ^ {0. 6}\right)\right)\right) \\ = \Xi_ {k, i} ^ {(t ^ {\prime})} + \widetilde {\mathcal {O}} (d ^ {- 1 / 2}) + \widetilde {\Theta} (1) \mathcal {O} \big (\exp \big (- \log (d) ^ {0. 6} \big) \big) \\ \leq 2 \Xi_ {k, i} ^ {(t ^ {\prime})} \leq 3 \left(m ^ {- 1 / 2} \left(1 + \frac {\gamma \sigma_ {\xi} ^ {2} d}{n}\right) ^ {- J + 0. 5}\right). \\ \end{array} +$$ + +In the second last line, we can absorb $T^{(1)}$ into $\widetilde{\mathcal{O}}(d^{-1/2})$ . And $T^{(1)} \frac{\eta}{Kn} \Theta(\sigma_{\xi}^2 d) = \widetilde{\Theta}(1)$ . To get the last line, recall that $\Xi_{k,i}^{(t')} \geq (m^{-1/2} \left( 1 + \frac{\gamma \sigma_{\xi}^2 d}{n} \right)^{-J + 0.5}) = \Omega(1/polylog(d))$ . And $\widetilde{\Theta}(1) \mathcal{O}\big(\exp(-\log(d)^{0.6})\big)\big) = o(1/polylog(d))$ . This concludes our proof. + +In short, we have shown that in Phase I, the feature has not been learnt well by any neurons, which is characterized by the inequality $\Lambda_j^{(T^{(1)})} \leq \mathcal{O}(d^{-1/2})$ for $j \in \{-1, 1\}$ . And for each noise vector $\pmb{\xi}_{k,i}$ , there exists weights $\mathbf{w}_{j,r}^{(T^{(1)},0)}$ with $j = y_{k,i}$ such that their inner product is large: $\langle \mathbf{w}_{j,r}^{(T^{(1)},0)}, \pmb{\xi}_{k,i} \rangle = \widetilde{\Theta}(1)$ . + +# E.2 PHASE II + +We have already proven that at the end of Phase I, all of the noises are memorized by the network with an inner product of size $\widetilde{\Theta}(1)$ whereas the feature is barely memorized, with an inner product of size $\widetilde{\mathcal{O}}(d^{-1/2})$ . After Phase I, there is no guarantee that $-\ell_{k,i}^{\prime(t,J)} = \Omega(1)$ . For this reason, the learning of both the feature and noises will slow down. The difficulty in analysis at this stage is that we no longer have $-\ell_{k,i}^{\prime(t,J)} = \Theta(1)$ . The value of $\ell_{k,i}^{\prime(t,J)}$ is getting smaller as the inner products + +$\langle \mathbf{w}_{j,r}^{(t,J)},\pmb{\xi}_{k,i}\rangle$ gets larger. Moreover, if we examine Eq. (C.6), we observe that the second term on the right hand side could have a non-trivial effect on the growth of the noise inner product, if the third term on the right hand side becomes exponentially smaller than the second term because of $\ell_{k,i}^{\prime (t,J)}$ . But the sign of each of the summand in the second term is undetermined, which makes the analysis even harder. We first make some claims that will help prove our theorems. And we will verify these claims at the end of this section. Let $T = \mathrm{poly}(d)$ be the total run time. We have the following claims under Condition D.1 and Condition 4.1. + +Claim E.4. For any $k \in [K]$ , $i \in [n]$ , $r \in [m]$ , and $t \in [T^{(1)}, T]$ , let $j = -y_{k,i}$ , then + +$$ +\langle \boldsymbol {w} _ {j, r} ^ {(t, 0)}, \boldsymbol {\xi} _ {k, i} \rangle = \widetilde {\mathcal {O}} \left(d ^ {- 1 / 2}\right). +$$ + +And + +$$ +\langle \boldsymbol {w} _ {j, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k, i} \rangle = \widetilde {\mathcal {O}} (d ^ {- 1 / 2}). +$$ + +Claim E.5. For any $j \in \{-1, 1\}$ and $t \in [T^{(1)}, T]$ we have + +$$ +\boldsymbol {\Lambda} _ {j} ^ {(t)} \leq \mathcal {O} (d ^ {- 1 / 4}). +$$ + +Claim E.6. For any $j \in \{-1, 1\}$ , $k \in [K]$ , $r \in [m]$ and $t \in [T^{(1)}, T]$ we have + +$$ +\max _ {r} j \langle \boldsymbol {w} _ {j, r} ^ {(t, 0)}, \boldsymbol {z} _ {k} \rangle = o (1) \boldsymbol {\Lambda} _ {j} ^ {(t)}. +$$ + +Lemma E.7. Let $t \in [T^{(1)}, T]$ , $k \in [K]$ , $i \in [n]$ , $j = y_{k,i}$ and $r = \arg \max_{r' \in [m]} \langle \pmb{w}_{j,r'}^{(t,0)}, \pmb{\xi}_{k,i} \rangle$ . Suppose Claim E.4 E.5E.6 hold at $t$ . Then + +$$ +\left\langle \boldsymbol {w} _ {j, r} ^ {(t, 0)}, \boldsymbol {\xi} _ {k, i} \right\rangle \geq \Omega \left(m ^ {- 1 / 2} \left(1 + \frac {\gamma \sigma_ {\xi} ^ {2} d}{n}\right) ^ {- J}\right). +$$ + +And + +$$ +\langle \boldsymbol {w} _ {j, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k, i} \rangle \geq \Omega (m ^ {- 1 / 2}). +$$ + +Proof. The proof of the first inequality is very similar to the first part of the proof of Theorem E.3. Hence we will omit it and focus on proving the second inequality. We first recall from Eq. (C.2) that + +$$ +\begin{array}{l} \langle \mathbf {w} _ {j, r} ^ {(t, \tau + 1)}, \boldsymbol {\xi} _ {k, i} \rangle = \langle \mathbf {w} _ {j, r} ^ {(t, \tau)}, \boldsymbol {\xi} _ {k, i} \rangle - \frac {\gamma}{n} \sum_ {i ^ {\prime} \neq i} \ell_ {k, i ^ {\prime}} ^ {\prime (t, \tau)} y _ {k, i ^ {\prime}} j \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t, \tau)}, \boldsymbol {\xi} _ {k, i ^ {\prime}} \rangle) \langle \boldsymbol {\xi} _ {k, i ^ {\prime}}, \boldsymbol {\xi} _ {k, i} \rangle \\ - \frac {\gamma}{n} \ell_ {k, i} ^ {\prime (t, \tau)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t, \tau)}, \pmb {\xi} _ {k, i} \rangle) \| \pmb {\xi} _ {k, i} \| _ {2} ^ {2} \\ \geq \left\langle \mathbf {w} _ {j, r} ^ {(t, \tau)}, \boldsymbol {\xi} _ {k, i} \right\rangle - \widetilde {\mathcal {O}} \left(d ^ {- 1 / 2}\right) - \frac {\gamma}{n} \ell_ {k, i} ^ {\prime (t, \tau)} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(t, \tau)}, \boldsymbol {\xi} _ {k, i} \right\rangle\right) \| \boldsymbol {\xi} _ {k, i} \| _ {2} ^ {2}, \tag {E.22} \\ \end{array} +$$ + +for all $\tau \in [J - 1]$ . Here we have used $-\ell'(\cdot) \leq 1$ , $\sigma'(\cdot) \leq 1$ and Lemma D.2 to get the inequality. If $\langle \mathbf{w}_{j,r}^{(t,0)}, \pmb{\xi}_{k,i} \rangle > m^{-1/2}$ , then we have + +$$ +\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k, i} \rangle \geq \langle \mathbf {w} _ {j, r} ^ {(t, 0)}, \boldsymbol {\xi} _ {k, i} \rangle - J \widetilde {\mathcal {O}} (d ^ {- 1 / 2}) = \Omega (m ^ {- 1 / 2}). +$$ + +The last equality is because $m^{-1/2} \gg J\widetilde{\mathcal{O}}(d^{-1/2})$ . By the first part of this theorem, we have $\langle \mathbf{w}_{j,r}^{(t,0)}, \pmb{\xi}_{k,i} \rangle \geq \Omega(m^{-1/2}(1 + \frac{\gamma\sigma_{\xi}^2 d}{n})^{-J})$ . Let us consider $\Omega(m^{-1/2}(1 + \frac{\gamma\sigma_{\xi}^2 d}{n})^{-(\tau+1)}) \leq \langle \mathbf{w}_{j,r}^{(t,0)}, \pmb{\xi}_{k,i} \rangle \leq \mathcal{O}(m^{-1/2}(1 + \frac{\gamma\sigma_{\xi}^2 d}{n})^{-\tau})$ for some $\tau \in [J-1]$ . Using similar proof as the proof of Hypothesis E.2, it can be shown that $-\ell_{k,i}^{\prime(t,\tau')} = \Omega(1)$ for all $\tau' \leq \tau$ if $\langle \mathbf{w}_{j,r}^{(t,0)}, \pmb{\xi}_{k,i} \rangle \leq \Omega(m^{-1/2}(1 + \frac{\gamma\sigma_{\xi}^2 d}{n})^{-\tau})$ . Applying Eq. (E.22) $\tau+1$ times, we get $\langle \mathbf{w}_{j,r}^{(t,\tau+1)}, \pmb{\xi}_{k,i} \rangle \geq \langle \mathbf{w}_{j,r}^{(t,0)}, \pmb{\xi}_{k,i} \rangle \leq \Omega((1 + \frac{\gamma\sigma_{\xi}^2 d}{n})^{\tau+1})$ , which implies $\langle \mathbf{w}_{j,r}^{(t,\tau+1)}, \pmb{\xi}_{k,i} \rangle \geq \Omega(m^{-1/2})$ if $\langle \mathbf{w}_{j,r}^{(t,0)}, \pmb{\xi}_{k,i} \rangle \geq \Omega(m^{-1/2}(1 + \frac{\gamma\sigma_{\xi}^2 d}{n})^{-(\tau+1)})$ . Lastly, Eq. (E.22) also implies + +$$ +\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k, i} \rangle \geq \langle \mathbf {w} _ {j, r} ^ {(t, \tau + 1)}, \boldsymbol {\xi} _ {k, i} \rangle - (J - (\tau + 1)) \widetilde {\mathcal {O}} (d ^ {- 1 / 2}) = \Omega (m ^ {- 1 / 2}). +$$ + +This proves the lemma. + +Lemma E.8. Suppose Claim E.4 E.5E.6 hold at $t$ . Let $k \in [K]$ , $i \in [n]$ . If + +$$ +\Xi_ {k, i} ^ {(t)} = \Theta \Big (m ^ {- 1 / 2} \Big (1 + \frac {\gamma \sigma_ {\xi} ^ {2} d}{n} \Big) ^ {- J + 1} \Big), +$$ + +then $-\ell_{k,i}^{\prime (t,J)} = \mathcal{O}(d^{-\log (d)^{0.3}})$ + +Proof. Without loss of generality, assume $y_{k,i} = 1$ . Let $r'(t) = \arg \max_{r \in [m]} \langle \mathbf{w}_{1,r}^{(t,0)}, \pmb{\xi}_{k,i} \rangle$ . We have + +$$ +\begin{array}{l} - \ell_ {k, i} ^ {\prime (t, J)} = - \ell^ {\prime} \bigg (\sum_ {j = \pm 1} \sum_ {r = 1} ^ {m} j \left(\sigma (\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \pmb {\xi} _ {k, i} \rangle) + \sigma (\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \pmb {\nu} _ {k} \rangle)\right) \bigg) \\ \leq - \ell^ {\prime} \Bigg (\sigma (\langle \mathbf {w} _ {1, r ^ {\prime} (t)} ^ {(t, J)}, \pmb {\xi} _ {k, i} \rangle) - \sum_ {r = 1} ^ {m} \Big (\sigma (\langle \mathbf {w} _ {- 1, r} ^ {(t, J)}, \pmb {\xi} _ {k, i} \rangle) + \sigma (\langle \mathbf {w} _ {- 1, r} ^ {(t, J)}, \pmb {\nu} _ {k} \rangle) \Big) \Bigg). \\ \end{array} +$$ + +Using similar proof as the proof of Hypothesis E.2, it can be shown that $-\ell_{k,i}^{\prime (t,\tau)} = \Omega (1)$ for all $\tau \in [J - 1]$ under Claim E.5E.6. We then apply Eq. (E.22) $J - 1$ times to get + +$$ +\begin{array}{l} \langle \mathbf {w} _ {1, r ^ {\prime} (t)} ^ {(t, J)}, \boldsymbol {\xi} _ {k, i} \rangle \geq \left(\langle \mathbf {w} _ {1, r ^ {\prime} (t)} ^ {(t, 0)}, \boldsymbol {\xi} _ {k, i} \rangle - J \tilde {\mathcal {O}} (d ^ {- 1 / 2})\right) \left(1 - \Theta (1) \frac {\gamma \sigma_ {\xi} ^ {2} d}{n}\right) ^ {J} \\ = \left(\Xi_ {k, i} ^ {(t)} - J \tilde {\mathcal {O}} (d ^ {- 1 / 2})\right) \left(1 - \Theta (1) \frac {\gamma \sigma_ {\xi} ^ {2} d}{n}\right) ^ {J} \\ = \Omega (1) \Xi_ {k, i} ^ {(t)} \left(1 - \Theta (1) \frac {\gamma \sigma_ {\xi} ^ {2} d}{n}\right) ^ {J} \\ = \Omega (1) m ^ {- 1 / 2} \frac {\gamma \sigma_ {\xi} ^ {2} d}{n}. \\ \end{array} +$$ + +The third line is because by assumption we have $\Xi_{k,i}^{(t)} = \Theta \big(m^{-1 / 2}\big(1 + \frac{\gamma\sigma_{\xi}^2d}{n}\big)^{-J + 1}\big) = \widetilde{\Theta} (1)\gg J\widetilde{\mathcal{O}} (d^{-1 / 2})$ . On the other hand, Claim E.4, tells us that + +$$ +\langle \mathbf {w} _ {- 1, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k, i} \rangle = \widetilde {\mathcal {O}} (d ^ {- 1 / 2}), +$$ + +for all $r\in [m]$ . Hence, + +$$ +\sum_ {r = 1} ^ {m} \sigma (\langle \mathbf {w} _ {- 1, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k, i} \rangle) = m \widetilde {\mathcal {O}} (d ^ {- 1 / 2}) = o (1). +$$ + +By Eq. (C.1) and Eq. (E.11) we get that + +$$ +\langle \mathbf {w} _ {- 1, r} ^ {(t, J)}, \pmb {\nu} _ {k} \rangle \leq \langle \mathbf {w} _ {- 1, r} ^ {(t, 0)}, \pmb {\nu} _ {k} \rangle \leq \langle \mathbf {w} _ {- 1, r} ^ {(0, 0)}, \pmb {\nu} _ {k} \rangle = \mathcal {O} (d ^ {- 1 / 2}). +$$ + +Thus, + +$$ +\sum_ {r = 1} ^ {m} \sigma (\langle \mathbf {w} _ {- 1, r} ^ {(t, J)}, \boldsymbol {\nu} _ {k} \rangle) = m \widetilde {\mathcal {O}} (d ^ {- 1 / 2}) = o (1). +$$ + +We now have + +$$ +\begin{array}{l} \left. \right. - \ell_ {k, i} ^ {\prime (t, J)} \leq - \ell^ {\prime} \left(\sigma \left(\langle \mathbf {w} _ {1, r ^ {\prime}} ^ {(t, J)}, \boldsymbol {\xi} _ {k, i} \rangle\right) - \sum_ {r = 1} ^ {m} \left(\sigma \left(\langle \mathbf {w} _ {- 1, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k, i} \rangle\right) + \sigma \left(\langle \mathbf {w} _ {- 1, r} ^ {(t, J)}, \boldsymbol {\nu} _ {k} \rangle\right)\right)\right) \\ \leq - \ell^ {\prime} \Big (\Omega (1) m ^ {- 1 / 2} \frac {\gamma \sigma_ {\xi} ^ {2} d}{n} - o (1) - o (1) \Big) \\ = \mathcal {O} (1) \exp \left(- \Omega (1) m ^ {- 1 / 2} \frac {\gamma \sigma_ {\xi} ^ {2} d}{n}\right) \\ = \mathcal {O} \left(d ^ {- \log (d) ^ {0. 3}}\right). \\ \end{array} +$$ + +This proves the lemma. + +![](images/e7612f517bef8418a0086e1f5fcae259bb942359fda0304d46d0a4dcce1c3efb.jpg) + +Theorem E.9. If Claim E.4E.5E.6 hold for all $T^{(1)} \leq t \leq T - 1$ , then + +$$ +\boldsymbol {\Xi} _ {k, i} ^ {(T)} \leq \mathcal {O} \Big (m ^ {- 1 / 2} \Big (1 + \frac {\gamma \sigma_ {\xi} ^ {2} d}{n} \Big) ^ {- J + 1} \Big), +$$ + +for all $k \in [K]$ , $i \in [n]$ . + +Proof. Set $A(q) = m^{-1/2}\left(1 + \frac{\gamma\sigma_{\xi}^2d}{n}\right)^{-q}$ for $q \in [J]$ . We proved in Theorem E.3 that $\Omega(A(J)) \leq \Xi_{k,i}^{(T^{(1)})} \leq \mathcal{O}(A(J - 0.5))$ for all $k \in [K]$ , $i \in [n]$ . Define + +$$ +t (k, i) = \inf \left\{t < T: \Xi_ {k, i} ^ {(t ^ {\prime})} > A (J - 1), \forall t ^ {\prime} > t \right\}, +$$ + +where the infimum over an empty set is defined as $\infty$ . In words, $t(k,i)$ is the last iteration with $\Xi_{k,i}^{(t)} \leq A(J - 1)$ . We have shown in the proof of Theorem E.3 that $\Xi_{k,i}^{(t(k,i) + 1)} < 1.5A(J - 1)$ . Similarly define + +$$ +\tilde {t} (k, i) = \inf \left\{t (k, i) \leq t \leq T: \Xi_ {k, i} ^ {(t ^ {\prime})} > 4 A (J - 1), \forall t ^ {\prime} > t \right\}. +$$ + +Again the inf over an empty set is defined as $\infty$ . So $\tilde{t}(k,i)$ is the last iteration with $\Xi_{k,i}^{(t)} \leq 4A(J - 1)$ . Our goal is to show that $\tilde{t}(k,i) = \infty$ for any $k \in [K]$ and $i \in [n]$ . We will prove this by contradiction. Let us suppose that $\tilde{t}(k,i) < \infty$ . Then, for any $t \in [t(k,i) + 1, \tilde{t}(k,i)]$ we have that $-\ell_{k,i}^{\prime(t,J)} = O(d^{-\log(d)^{0.3}})$ by Lemma E.8. Recall + +$$ +\begin{array}{l} \boldsymbol {\Xi} _ {k, i} ^ {(t + 1)} \geq \boldsymbol {\Xi} _ {k, i} ^ {(t)} + \frac {\eta}{K n} \sum_ {(k ^ {\prime}, i ^ {\prime}) \neq (k, i)} \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \pmb {\xi} _ {k ^ {\prime}, i ^ {\prime}} \rangle) \Theta (\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}) \\ - \frac {\eta}{K n} \ell_ {k, i} ^ {\prime (t, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \pmb {\xi} _ {k, i} \rangle) \Theta (\sigma_ {\xi} ^ {2} d) \\ \geq \Xi_ {k, i} ^ {(t)} + \frac {\eta}{K n} \sum_ {(k ^ {\prime}, i ^ {\prime}) \neq (k, i)} \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} \Theta (\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}) \\ - \frac {\eta}{K n} \ell_ {k, i} ^ {\prime (t, J)} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k, i} \right\rangle\right) \Theta \left(\sigma_ {\xi} ^ {2} d\right), \tag {E.23} \\ \end{array} +$$ + +where the second inequality is because $\sigma'(\cdot) \leq 1$ . And similarly we have + +$$ +\begin{array}{l} \boldsymbol {\Xi} _ {k, i} ^ {(t + 1)} \leq \boldsymbol {\Xi} _ {k, i} ^ {(t)} - \frac {\eta}{K n} \sum_ {(k ^ {\prime}, i ^ {\prime}) \neq (k, i)} \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k ^ {\prime}, i ^ {\prime}} \rangle) \Theta (\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}) \\ - \frac {\eta}{K n} \ell_ {k, i} ^ {\prime (t, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k, i} \rangle) \Theta (\sigma_ {\xi} ^ {2} d) \\ \leq \Xi_ {k, i} ^ {(t)} - \frac {\eta}{K n} \sum_ {\left(k ^ {\prime}, i ^ {\prime}\right) \neq (k, i)} \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} \Theta \left(\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}\right) - \frac {\eta}{K n} \ell_ {k, i} ^ {\prime (t, J)} \Theta \left(\sigma_ {\xi} ^ {2} d\right), \tag {E.24} \\ \end{array} +$$ + +where we have again used $\sigma'(\cdot) \leq 1$ to the second inequality. We have the following bound due to Lemma E.8 + +$$ +\begin{array}{l} - \sum_ {t = t (k, i) + 1} ^ {\tilde {t} (k, i)} \frac {\eta}{K n} \ell_ {k, i} ^ {\prime (t, J)} \Theta \left(\sigma_ {\xi} ^ {2} d\right) = \sum_ {t = t (k, i) + 1} ^ {\tilde {t} (k, i)} \frac {\eta}{K n} \Theta \left(\sigma_ {\xi} ^ {2} d\right) \mathcal {O} \left(d ^ {- \log (d) ^ {0. 3}}\right) \\ \leq \frac {\eta \sigma_ {\xi} ^ {2} d}{K n} T \mathcal {O} (d ^ {- \log (d) ^ {0. 3}}) \\ = o \left(d ^ {- 1}\right), \tag {E.25} \\ \end{array} +$$ + +where the last equality is because $T = \mathcal{O}(\mathrm{poly}(d))$ . Let + +$$ +(k ^ {\prime}, i ^ {\prime}) = \underset {(\hat {k}, \hat {i}) \neq (k, i)} {\arg \max} \sum_ {t = t (k, i) + 1} ^ {\tilde {t} (k, i)} - \ell_ {\hat {k}, \hat {i}} ^ {\prime (t, J)}. +$$ + +Suppose it holds that + +$$ +\sum_ {t = t (k, i) + 1} ^ {\tilde {t} (k, i)} - \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} < d ^ {1 / 4}. \tag {E.26} +$$ + +Then using Eq. (E.24) we get + +$$ +\begin{array}{l} \Xi_ {k, i} ^ {(\tilde {t} (k, i) + 1)} \leq \Xi_ {k, i} ^ {(t (k, i) + 1)} - \frac {\eta}{K n} \sum_ {t = t (k, i) + 1} ^ {\tilde {t} (k, i)} \sum_ {(\hat {k}, \hat {i}) \neq (k, i)} \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} \Theta \left(\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}\right) \\ - \frac {\eta}{K n} \sum_ {t = t (k, i) + 1} ^ {\tilde {t} (k, i)} \ell_ {k, i} ^ {\prime (t, J)} \Theta (\sigma_ {\xi} ^ {2} d) \\ \leq \boldsymbol {\Xi} _ {k, i} ^ {(t (k, i) + 1)} + \eta \Theta \left(\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}\right) d ^ {1 / 4} + o \left(d ^ {- 1}\right) \\ \leq 2 \Xi_ {k, i} ^ {(t (k, i) + 1)} \\ \leq 3 A (J - 1). \\ \end{array} +$$ + +The second inequality is due to Eq. (E.25), Eq. (E.26) and the definition of $(k', i')$ . The third inequality is because $\eta \Theta(\sigma_{\xi}^{2}\sqrt{d}\sqrt{\log(Kn)})d^{1/4} + o(d^{-1}) = \widetilde{\mathcal{O}}(d^{-1/4})$ and $\Xi_{k,i}^{(t(k,i)+1)} \geq A(J-1) = \widetilde{\Theta}(1)$ . Thus Eq. (E.26) contradicts $\Xi_{k,i}^{(\tilde{t}(k,i)+1)} \geq 4A(J-1)$ and we must have $\tilde{t}(k,i) = \infty$ . Next, we will show that if Eq. (E.26) does not hold, then we also have $\tilde{t}(k,i) = \infty$ . Let us suppose + +$$ +\sum_ {t = t (k, i) + 1} ^ {\tilde {t} (k, i)} - \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} \geq d ^ {1 / 4}. +$$ + +Since $-\ell_{k',i'}^{(t,J)} > 0$ for any $t$ , we get that $\sum_{t=t(k,i)+1}^{t_0} -\ell_{k',i'}^{(t,J)}$ is increasing in $t_0$ . Let $t(k,i) + 1 < t_0 < \tilde{t}(k,i)$ be the first iteration such that + +$$ +\sum_ {t = t (k, i) + 1} ^ {t _ {0}} - \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} \geq d ^ {- 1 / 8} \sum_ {t = t (k, i) + 1} ^ {\tilde {t} (k, i)} - \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} \geq d ^ {- 1 / 8 + 1 / 4} = d ^ {1 / 8}. +$$ + +Since each $-\ell_{k',i'}^{(t,J)} < 1$ , we get that + +$$ +\begin{array}{l} \sum_ {t = t (k, i) + 1} ^ {t _ {0}} - \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} = \sum_ {t = t (k, i) + 1} ^ {t _ {0} - 1} - \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} - \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t _ {0}, J)} \\ \leq 1 + d ^ {- 1 / 8} \sum_ {t = t (k, i) + 1} ^ {\tilde {t} (k, i)} - \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} \\ \leq 2 d ^ {- 1 / 8} \sum_ {t = t (k, i) + 1} ^ {\tilde {t} (k, i)} - \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)}, \tag {E.27} \\ \end{array} +$$ + +where the second and third line are by definition of $t_0$ . We can sum Eq. (E.23) over time to obtain + +$$ +\begin{array}{l} \sum_ {t = t (k, i) + 1} ^ {t _ {0}} \boldsymbol {\Xi} _ {k ^ {\prime}, i ^ {\prime}} ^ {(t + 1)} \geq \sum_ {t = t (k, i) + 1} ^ {t _ {0}} \boldsymbol {\Xi} _ {k ^ {\prime}, i ^ {\prime}} ^ {(t)} + \frac {\eta}{K n} \sum_ {t = t (k, i) + 1} ^ {t _ {0}} \sum_ {(\hat {k}, \hat {i}) \neq (k ^ {\prime}, i ^ {\prime})} \ell_ {\hat {k}, \hat {i}} ^ {\prime (t, J)} \Theta \left(\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}\right) \\ - \frac {\eta}{K n} \sum_ {t = t (k, i) + 1} ^ {t _ {0}} \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k ^ {\prime}, i ^ {\prime}} \rangle) \Theta \left(\sigma_ {\xi} ^ {2} d\right) \\ \geq \sum_ {t = t (k, i) + 1} ^ {t _ {0}} \Xi_ {k ^ {\prime}, i ^ {\prime}} ^ {(t)} + \frac {\eta}{K n} \sum_ {t = t (k, i) + 1} ^ {\tilde {t} (k, i)} \sum_ {(\hat {k}, \hat {i}) \neq (k ^ {\prime}, i ^ {\prime})} \ell_ {\hat {k}, \hat {i}} ^ {\prime (t, J)} \Theta (\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}) \\ \end{array} +$$ + +$$ +\begin{array}{l} - \frac {\eta}{K n} \sum_ {t = t (k, i) + 1} ^ {t _ {0}} \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \pmb {\xi} _ {k ^ {\prime}, i ^ {\prime}} \rangle) \Theta (\sigma_ {\xi} ^ {2} d) \\ \geq \sum_ {t = t (k, i) + 1} ^ {t _ {0}} \Xi_ {k ^ {\prime}, i ^ {\prime}} ^ {(t)} + \frac {\eta}{K n} \sum_ {t = t (k, i) + 1} ^ {\tilde {t} (k, i)} \sum_ {(\hat {k}, \hat {i}) \neq (k ^ {\prime}, i ^ {\prime})} \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} \Theta \left(\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}\right) \\ - \frac {\eta}{K n} \sum_ {t = t (k, i) + 1} ^ {t _ {0}} \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k ^ {\prime}, i ^ {\prime}} \rangle) \Theta (\sigma_ {\xi} ^ {2} d), \\ \end{array} +$$ + +where the second inequality is because $t_0 < \tilde{t}(k, i)$ . We have used the definition of $(k', i')$ to get the last inequality. Then, subtracting $\sum_{t = t(k, i) + 1}^{t_0} \Xi_{k', i'}^{(t)}$ from both sides yields + +$$ +\begin{array}{l} \Xi_ {k ^ {\prime}, i ^ {\prime}} ^ {(t _ {0} + 1)} - \Xi_ {k ^ {\prime}, i ^ {\prime}} ^ {(t (k, i) + 1)} \geq \Theta \Big (\frac {\eta \sigma_ {\xi} ^ {2} \sqrt {d}}{K n} \sqrt {\log (K n)} \Big) K n \sum_ {t = t (k, i) + 1} ^ {\bar {t} (k, i)} \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} \\ - \Theta \Big (\frac {\eta \sigma_ {\xi} ^ {2} d}{K n \sqrt {m}} \Big) \sum_ {t = t (k, i) + 1} ^ {t _ {0}} \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} \\ = \widetilde {\Theta} (d ^ {- 1 / 2}) \sum_ {t = t (k, i) + 1} ^ {\tilde {t} (k, i)} \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} - \widetilde {\Theta} (1) d ^ {- 1 / 8} \sum_ {t = t (k, i) + 1} ^ {\tilde {t} (k, i)} \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} \\ = -\widetilde{\Theta} (1)d^{-1 / 8}\sum_{t = t(k,i) + 1}^{\tilde{\ell} (k,i)}\ell_{k^{\prime},i^{\prime}}^{\prime (t,J)} \\ \geq \widetilde {\Theta} \left(d ^ {1 / 8}\right), \tag {E.28} \\ \end{array} +$$ + +where we used Lemma E.7 to get the first inequality. The first equality is due to Eq. (E.27). The last inequality is by our assumption $\sum_{t = t(k,i) + 1}^{\tilde{t}(k,i)} - \ell_{k',i'}'(t,j) \geq d^{1/4}$ . It is then straightforward to check that + +$$ +\Xi_ {k ^ {\prime}, i ^ {\prime}} ^ {(t)} \geq \widetilde {\Theta} \left(d ^ {1 / 8}\right), +$$ + +for all $t_0 + 1 \leq t \leq \tilde{t}(k, i)$ . To see this, let us sum Eq. (E.23) over time to obtain + +$$ +\begin{array}{l} \sum_ {\hat {t} = t _ {0} + 1} ^ {t - 1} \Xi_ {k ^ {\prime}, i ^ {\prime}} ^ {(\hat {t} + 1)} \geq \sum_ {\hat {t} = t _ {0} + 1} ^ {t - 1} \Xi_ {k ^ {\prime}, i ^ {\prime}} ^ {(\hat {t})} + \frac {\eta}{K n} \sum_ {\hat {t} = t _ {0} + 1} ^ {t - 1} \sum_ {(\tilde {k}, \tilde {i}) \neq (k ^ {\prime}, i ^ {\prime})} \ell_ {\tilde {k}, \tilde {i}} ^ {\prime (\hat {t}, J)} \Theta \left(\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}\right) \\ - \sum_ {\hat {t} = t _ {0} + 1} ^ {t - 1} \frac {\eta}{K n} \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (\hat {t}, J)} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(\hat {t}, J)}, \boldsymbol {\xi} _ {k ^ {\prime}, i ^ {\prime}} \right\rangle\right) \Theta \left(\sigma_ {\xi} ^ {2} d\right) \\ \geq \sum_ {\hat {t} = t _ {0} + 1} ^ {t - 1} \Xi_ {k ^ {\prime}, i ^ {\prime}} ^ {(\hat {t})} + \frac {\eta}{K n} \sum_ {\hat {t} = t _ {0} + 1} ^ {t - 1} \sum_ {(\tilde {k}, \tilde {i}) \neq (k ^ {\prime}, i ^ {\prime})} \ell_ {\tilde {k}, \tilde {i}} ^ {\prime (\hat {t}, J)} \Theta \left(\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}\right) \\ \geq \sum_ {\hat {t} = t _ {0} + 1} ^ {t - 1} \Xi_ {k ^ {\prime}, i ^ {\prime}} ^ {(\hat {t})} + \frac {\eta}{K n} \sum_ {\hat {t} = t (k, i) + 1} ^ {\tilde {t} (k, i)} \sum_ {(\tilde {k}, \tilde {i}) \neq (k ^ {\prime}, i ^ {\prime})} \ell_ {\tilde {k}, \tilde {i}} ^ {\prime (\hat {t}, J)} \Theta \left(\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}\right) \\ \geq \sum_ {\hat {t} = t _ {0} + 1} ^ {t - 1} \Xi_ {k ^ {\prime}, i ^ {\prime}} ^ {(\hat {t})} + \frac {\eta}{K n} \sum_ {\hat {t} = t (k, i) + 1} ^ {\tilde {t} (k, i)} K n \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (\hat {t}, J)} \Theta \left(\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}\right) \\ \end{array} +$$ + +$$ +\begin{array}{l} \boldsymbol {\Xi} _ {k ^ {\prime}, i ^ {\prime}} ^ {(t)} \geq \boldsymbol {\Xi} _ {k ^ {\prime}, i ^ {\prime}} ^ {(t _ {0} + 1)} + \Theta \left(\frac {\eta \sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}}{K n}\right) K n \sum_ {t = t (k, i) + 1} ^ {\tilde {t} (k, i)} \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {(t, J)} \\ \geq \widetilde {\Theta} (1) d ^ {- 1 / 8} \sum_ {t = t (k, i) + 1} ^ {\bar {\iota} (k, i)} - \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} + \widetilde {\Theta} (d ^ {- 1 / 2}) \sum_ {t = t (k, i) + 1} ^ {\bar {\iota} (k, i)} \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} \\ \end{array} +$$ + +$$ +\begin{array}{l} = \widetilde {\Theta} (1) d ^ {- 1 / 8} \sum_ {t = t (k, i) + 1} ^ {\tilde {t} (k, i)} - \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} \\ \geq \widetilde {\Theta} (d ^ {1 / 8}), \\ \end{array} +$$ + +where the second inequality is because we are removing a positive term from the sum. The third inequality is because $t - 1 < \tilde{t}(k,i)$ and $t_0 > t(k,i)$ . The fourth inequality is by definition of $(k',i')$ . The second last inequality is by the second last line of Eq. (E.28). And our last inequality follows Eq. (E.28). Then, using similar proof of Lemma E.8, we have $-\ell_{k',i'}'(t,J) = O(\exp(-\widetilde{\Theta}(d^{1/8})))$ for all $t_0 + 1 \leq t \leq \tilde{t}(k,i)$ . This yields + +$$ +\begin{array}{l} \sum_ {t = t (k, i) + 1} ^ {\tilde {t} (k, i)} - \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} = \sum_ {t = t (k, i) + 1} ^ {t _ {0}} - \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} + \sum_ {t = t _ {0} + 1} ^ {\tilde {t} (k, i)} - \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} \\ \leq 2 d ^ {- 1 / 8} \sum_ {t = t (k, i) + 1} ^ {\tilde {t} (k, i)} - \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} + \sum_ {t = t _ {0} + 1} ^ {\tilde {t} (k, i)} \mathcal {O} (\exp (- \widetilde {\Theta} (d ^ {1 / 8}))) \\ \leq 2 d ^ {- 1 / 8} \sum_ {t = t (k, i) + 1} ^ {\tilde {t} (k, i)} - \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} + T \cdot \mathcal {O} (\exp (- \widetilde {\Theta} (d ^ {1 / 8}))) \\ \leq 2 d ^ {- 1 / 8} \sum_ {t = t (k, i) + 1} ^ {\tilde {t} (k, i)} - \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} + o (d ^ {- 1}) \\ \leq \left(2 d ^ {- 1 / 8} + o \left(d ^ {- 1}\right)\right) \sum_ {t = t (k, i) + 1} ^ {\tilde {t} (k, i)} - \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)}, \tag {E.29} \\ \end{array} +$$ + +where we used Eq. (E.27) to get the second line. And we used $T = \mathcal{O}(\mathrm{poly}(d))$ to get the fourth line. To obtain the last inequality, we recall the assumption $\sum_{t=t(k,i)+1}^{\tilde{t}(k,i)} -\ell_{k',i'}^{(t,J)} > d^{1/4}$ , which implies $o(d^{-1}) < o(d^{-1}) \sum_{t=t(k,i)+1}^{\tilde{t}(k,i)} -\ell_{k',i'}^{(t,J)}$ . Eq. (E.29) is a contradiction in the form of $x \leq Ax$ for some $x \geq 0$ and $A < 1$ . This implies that under the assumption $\sum_{t=t(k,i)+1}^{\tilde{t}(k,i)} -\ell_{k',i'}^{(t,J)} > d^{1/4}$ , we should still have $\tilde{t}(k,i) = \infty$ . Combining with our previous result which says $\tilde{t}(k,i) = \infty$ when $\sum_{t=t(k,i)+1}^{\tilde{t}(k,i)} -\ell_{k',i'}^{(t,J)} \leq d^{1/4}$ , we conclude that $\tilde{t}(k,i) = \infty$ and we are done. + +Now that we know the noise inner products are upper bounded by $\mathcal{O}\big(m^{-1 / 2}\big(1 + \frac{\gamma\sigma_{\xi}^{2}d}{n}\big)^{-J + 1}\big)$ , we can provide a convergence guarantee based on this upper bound. + +Theorem E.10 (Restatement of Theorem 4.4 (1)). Under Condition D.1 and Condition 4.1, let $T = \mathrm{poly}(d)$ be the total number of iterations. Then + +$$ +\min _ {t \in [ T ]} \widehat {\mathcal {L}} ^ {t r - t r} (\boldsymbol {W} ^ {(t)}) \leq \widetilde {\Theta} (T ^ {- 1} \eta^ {- 1}). +$$ + +Proof. By Theorem E.9, we know that + +$$ +\boldsymbol {\Xi} _ {k, i} ^ {(T)} \leq \mathcal {O} \left(m ^ {- 1 / 2} \left(1 + \frac {\gamma \sigma_ {\xi} ^ {2} d}{n}\right) ^ {- J + 1}\right) = \widetilde {\mathcal {O}} (1), +$$ + +for all $k \in [K]$ and $i \in [n]$ . Denote $\Xi^{(t)} = \sum_{k,i} \Xi_{k,i}^{(t)}$ . It then follows that $\Xi^{(T)} \leq Kn\widetilde{\mathcal{O}}(1) = \widetilde{\mathcal{O}}(1)$ . Moreover, if we sum Eq. (E.24) over all $k,i$ , we get + +$$ +\begin{array}{l} \boldsymbol {\Xi} ^ {(t + 1)} \geq \boldsymbol {\Xi} ^ {(t)} + \eta (K n - 1) \sum_ {(k, i)} \ell_ {k, i} ^ {\prime (t, J)} \Theta (\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}) - \frac {\eta}{K n} \sum_ {k, i} \ell_ {k, i} ^ {\prime (t, J)} \Omega \Big (\frac {1}{\sqrt {m}} \Big) \Theta (\sigma_ {\xi} ^ {2} d) \\ \geq \boldsymbol {\Xi} ^ {(t)} - \Omega (1) \frac {\eta}{K n} \sum_ {k, i} \ell_ {k, i} ^ {\prime (t, J)} \Omega \left(\frac {1}{\sqrt {m}}\right) \Theta \left(\sigma_ {\xi} ^ {2} d\right), \\ \end{array} +$$ + +where the $\Omega\left(\frac{1}{\sqrt{m}}\right)$ term is by Lemma E.7. We can then sum over $t$ to obtain + +$$ +\begin{array}{l} \sum_ {t = T ^ {(1)}} ^ {T - 1} \boldsymbol {\Xi} ^ {(t + 1)} \geq \sum_ {t = T ^ {(1)}} ^ {T - 1} \boldsymbol {\Xi} ^ {(t)} - \Omega (1) \frac {\eta}{K n} \sum_ {t = T ^ {(1)}} ^ {T - 1} \sum_ {k, i} \ell_ {k, i} ^ {\prime (t, J)} \frac {2}{\sqrt {m}} \Theta (\sigma_ {\xi} ^ {2} d), \\ \boldsymbol {\Xi} ^ {(T)} - \boldsymbol {\Xi} ^ {(T ^ {(1)})} \geq - \Omega \Big (\frac {\eta \sigma_ {\xi} ^ {2} d}{K n \sqrt {m}} \Big) \sum_ {t = T ^ {(1)}} ^ {T - 1} \sum_ {k, i} \ell_ {k, i} ^ {\prime (t, J)}, \\ \end{array} +$$ + +$$ +\eta \sum_ {t = T ^ {(1)}} ^ {T - 1} \sum_ {k, i} - \ell_ {k, i} ^ {\prime (t, J)} \leq \mathcal {O} \left(\frac {K \sqrt {m}}{\sigma_ {\xi} ^ {2} d}\right) \widetilde {\mathcal {O}} (1) = \widetilde {\mathcal {O}} (1). \tag {E.30} +$$ + +The last inequality is because $\Xi^{(T)} - \Xi^{(T^{(1)})} \leq \widetilde{\mathcal{O}}(1)$ . And we can bound the minimum over $t$ by + +$$ +\min _ {t \in [ T ^ {(1)}, T - 1 ]} \sum_ {k, i} - \ell_ {k, i} ^ {\prime (t, J)} \leq \widetilde {\mathcal {O}} \left(\frac {1}{(T - T ^ {(1)}) \eta}\right) = \widetilde {\mathcal {O}} \left(\frac {1}{T \eta}\right), +$$ + +where the second equality is because $T^{(1)} = \mathrm{polylog}(d) = o(T)$ . Denote $-\ell_{k,i}^{\prime (t,J)} = -\ell^{\prime}(\alpha (t,J,k,i))$ , i.e. the argument of $-\ell_{k,i}^{\prime (t,J)}$ is $\alpha (t,J,k,i)$ . Then the loss is related to $-\ell_{k,i}^{\prime (t,J)}$ by + +$$ +\widehat {\mathcal {L}} ^ {\operatorname {t r} - \operatorname {t r}} (\mathbf {W} ^ {(t)}) = \sum_ {k, i} \ell \big (\alpha (t, J, k, i) \big). +$$ + +Let $t' = \arg \min_{t} \sum_{k,i} -\ell_{k,i}'^{(t,J)}$ . By definition of $\ell'(\cdot)$ and $\ell(\cdot)$ we can bound $-\ell'(x) \geq \exp(-x)/2 \geq \ell(x)/2$ for $x > 0$ . This can be used to bound our loss by + +$$ +\begin{array}{l} \min _ {t \in [ T ]} \widehat {\mathcal {L}} ^ {\operatorname {t r - t r}} \left(\mathbf {W} ^ {(t)}\right) \leq \widehat {\mathcal {L}} ^ {\operatorname {t r - t r}} \left(\mathbf {W} ^ {\left(t ^ {\prime}\right)}\right) \\ = \sum_ {k, i} \ell \left(\alpha \left(t ^ {\prime}, J, k, i\right)\right) \\ \leq - 2 \sum_ {k, i} \ell^ {\prime} (\alpha (t, J, k, i)) \\ \leq \widetilde {\mathcal {O}} \left(\frac {1}{T \eta}\right). \\ \end{array} +$$ + +This proves our theorem. + +![](images/2653cc529ce6831292c24b3a11b8d5fac0cd39510d25f8cc043662851c3ac94c.jpg) + +It remains to prove Claims E.4E.5E.6. + +Proof of Claim E.4. Without loss of generality, assume $y_{k,i} = 1$ . By Eq. (E.16), we have the following upper bound + +$$ +\begin{array}{l} \langle \mathbf {w} _ {- 1, r} ^ {(t + 1, 0)}, \boldsymbol {\xi} _ {k, i} \rangle \leq \langle \mathbf {w} _ {- 1, r} ^ {(t, 0)}, \boldsymbol {\xi} _ {k, i} \rangle - \frac {\eta}{K n} \sum_ {(k ^ {\prime}, i ^ {\prime}) \neq (k, i)} \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {- 1, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k ^ {\prime}, i ^ {\prime}} \rangle) \Theta (\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}) \\ \leq \left\langle \mathbf {w} _ {- 1, r} ^ {(t, 0)}, \boldsymbol {\xi} _ {k, i} \right\rangle - \frac {\eta}{K n} \sum_ {(k ^ {\prime}, i ^ {\prime})} \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} \sigma^ {\prime} (\left\langle \mathbf {w} _ {- 1, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k ^ {\prime}, i ^ {\prime}} \right\rangle) \Theta \left(\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}\right) \\ \leq \langle \mathbf {w} _ {- 1, r} ^ {(t, 0)}, \boldsymbol {\xi} _ {k, i} \rangle - \frac {\eta}{K n} \Theta (\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}) \sum_ {(k ^ {\prime}, i ^ {\prime})} \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)}, \\ \end{array} +$$ + +where the second inequality is because we are adding a non-negative term to the sum. The last inequality is because $\sigma'(\cdot) \leq 1$ . Suppose all of our claims hold for $t \leq T'$ , where $T' \leq T - 1$ . Using a similar derivation of Eq. (E.30) we have + +$$ +-\frac{\eta}{Kn}\Theta (\sigma_{\xi}^{2}\sqrt{d}\sqrt{\log(Kn)})\sum_{t = T^{(1)}}^{T^{\prime}}\sum_{(k^{\prime},i^{\prime})}\ell_{k^{\prime},i^{\prime}}^{\prime (t,J)}\leq \frac{K\Theta(\sigma_{\xi}^{2}\sqrt{d}\sqrt{\log(Kn)})}{(\sigma_{\xi}^{2}d)^{J}\gamma^{J - 1}n^{J - 2}}. +$$ + +Then we get + +$$ +\begin{array}{l} \langle \mathbf {w} _ {- 1, r} ^ {(T ^ {\prime} + 1, 0)}, \boldsymbol {\xi} _ {k, i} \rangle \leq \langle \mathbf {w} _ {- 1, r} ^ {(T ^ {(1)}, 0)}, \boldsymbol {\xi} _ {k, i} \rangle - \frac {\eta}{K n} \Theta \left(\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}\right) \sum_ {t = T ^ {(1)}} ^ {T ^ {\prime}} \sum_ {\left(k ^ {\prime}, i ^ {\prime}\right)} \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} \\ \leq \left\langle \mathbf {w} _ {- 1, r} ^ {(T ^ {(1)}, 0)}, \boldsymbol {\xi} _ {k, i} \right\rangle + \frac {K \Theta \left(\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}\right)}{\left(\sigma_ {\xi} ^ {2} d\right) ^ {J} \gamma^ {J - 1} n ^ {J - 2}} \\ \leq \widetilde {\mathcal {O}} (d ^ {- 1 / 2}) + \widetilde {\mathcal {O}} (d ^ {- 1 / 2}) \\ = \widetilde {\mathcal {O}} (d ^ {- 1 / 2}), \\ \end{array} +$$ + +where the third line is due to part (2) of Theorem E.2. This proves our claim. + +![](images/250fec49ea9997297e1a203e1ef2157f4a070d177e06ff3f7771fdd9fb9a5b1a.jpg) + +Proof of Claim E.5. We will show that for any $T' \leq T = \mathcal{O}(\mathrm{poly}(d))$ , we have that $\Lambda_j^{(T')} = \mathcal{O}(d^{-1/4})$ for $j \in \{-1, 1\}$ . We have the following upper bound + +$$ +\begin{array}{l} \boldsymbol {\Lambda} _ {j} ^ {(t + 1)} \leq \boldsymbol {\Lambda} _ {j} ^ {(t)} - \frac {\eta}{K n} \sum_ {k, i} \ell_ {k, i} ^ {(t, J)} \boldsymbol {\Lambda} _ {j} ^ {(t)} \gamma^ {J} \mathcal {O} (1) \\ \leq \boldsymbol {\Lambda} _ {j} ^ {(t)} \Big (1 - \mathcal {O} (1) \frac {\eta \gamma^ {J}}{K n} \sum_ {k, i} \ell_ {k, i} ^ {\prime (t, J)} \Big) \\ \end{array} +$$ + +Suppose that there exists some $\tilde{t} \leq T'$ such that $\Lambda_j^{(\tilde{t})} \geq d^{-1/4}$ for the first time. Then + +$$ +d ^ {- 1 / 4} \leq \boldsymbol {\Lambda} _ {j} ^ {(\tilde {t})} \leq \boldsymbol {\Lambda} _ {j} ^ {(T ^ {(1)})} \prod_ {t = T ^ {(1)}} ^ {\tilde {t} - 1} \left(1 - \mathcal {O} (1) \frac {\eta \gamma^ {J}}{K n} \sum_ {k, i} \ell_ {k, i} ^ {\prime (t, J)}\right), +$$ + +$$ +\frac {d ^ {- 1 / 4}}{\boldsymbol {\Lambda} _ {j} ^ {(T ^ {(1)})}} \leq \prod_ {t = T ^ {(1)}} ^ {\tilde {t} - 1} \left(1 - \mathcal {O} (1) \frac {\eta \gamma^ {J}}{K n} \sum_ {k, i} \ell_ {k, i} ^ {\prime (t, J)}\right), +$$ + +$$ +\begin{array}{l} \prod_ {t = T ^ {(1)}} ^ {\tilde {t} - 1} \left(1 - \mathcal {O} (1) \frac {\eta \gamma^ {J}}{K n} \sum_ {k, i} \ell_ {k, i} ^ {\prime (t, J)}\right) \geq \widetilde {\Omega} \left(d ^ {1 / 4}\right), \\ \sum_ {t = T ^ {(1)}} ^ {\tilde {t} - 1} \log \left(1 - \mathcal {O} (1) \frac {\eta \gamma^ {J}}{K n} \sum_ {k, i} \ell_ {k, i} ^ {\prime (t, J)}\right) \geq \Omega (\log (d)), \\ \sum_ {t = T ^ {(1)}} ^ {\tilde {t} - 1} - \mathcal {O} (1) \frac {\eta \gamma^ {J}}{K n} \sum_ {k, i} \ell_ {k, i} ^ {\prime (t, J)} \geq \Omega (\log (d)), \\ \sum_ {t = T ^ {(1)}} ^ {\tilde {t} - 1} \sum_ {k, i} - \ell_ {k, i} ^ {\prime (t, J)} \geq \Omega \Big (\frac {\log (d) K n}{\eta \gamma^ {J}} \Big). \\ \end{array} +$$ + +The third inequality is because by the first part of Theorem E.2, we have $\Lambda_j^{(T^{(1)})} = \widetilde{\mathcal{O}} (d^{-1 / 2})$ . And hence $d^{-1 / 4} / \Lambda_j^{(T^{(1)})} = \widetilde{\Omega} (d^{1 / 4})$ . Note that in the proof of Theorem E.10, we have that + +$$ +\sum_ {t = T ^ {(1)}} ^ {T} \sum_ {k, i} - \ell_ {k, i} ^ {\prime (t, J)} \leq \frac {K ^ {2}}{\gamma^ {J - 1} \eta (\sigma_ {\xi} ^ {2} d) ^ {J}} = o \Big (\frac {\log (d) K n}{\eta \gamma^ {J}} \Big), +$$ + +which creates a contradiction. Hence, for all $\tilde{t} \leq T'$ , we have $\Lambda_j^{(\tilde{t})} \leq d^{-1/4}$ . This proves the claim. + +Proof of Claim E.6. By our result in Phase I, we have that Claim E.6 holds at $T^{(1)}$ . The rest of the proof is similar to the proof of Hypothesis E.1 and we will omit it here. + +We have shown that for $T = \mathrm{poly}(d)$ , the feature has not been learnt well if one uses the train-train method. Thus the testing loss will be large, which is characterized by the following theorem. + +Theorem E.11 (Restatement of Theorem 4.4 (2)). Under Condition 4.1 and Condition D.1, the test loss is large throughout the whole training process + +$$ +\min _ {t \in [ T ]} \mathcal {L} _ {\mathrm {t e s t}} (\boldsymbol {W} ^ {(t)}) = \Omega (1). +$$ + +Proof. Sample a new example $\mathbf{x}$ from the distribution, since we use the convolutional structure, we can assume that the first patch $\mathbf{x}^{(1)} = y\cdot (\pmb {\nu} + \mathbf{z})$ and the second patch $\mathbf{x}^{(2)} = \pmb{\xi}$ . Clearly $\langle \pmb{\xi}_{k,i},\pmb {\xi}\rangle$ follows the Gaussian distribution with mean zero and standard deviation $\sigma_{\xi}\cdot \| \pmb{\xi}_{k,i}\| _2$ . By Lemma D.2, we further know that $\| \pmb{\xi}_{k,i}\| _2\leq 2\sigma_\xi \sqrt{d}$ . Therefore + +$$ +\mathbb {P} \left(\left| \langle \boldsymbol {\xi} _ {k, i}, \boldsymbol {\xi} \rangle \right| \geq d ^ {- 1 / 4}\right) \leq 2 \exp \left(- \frac {1}{8 \sigma_ {\xi} ^ {4} d ^ {3 / 2}}\right) \leq 2 \exp \left(- d ^ {1 / 4}\right). \tag {E.31} +$$ + +Similarly we have that + +$$ +\mathbb {P} \left(\left| \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \boldsymbol {\xi} \rangle \right| \geq d ^ {3 / 2}\right) \leq 2 \exp \left(- \frac {1}{8 \sigma_ {0} ^ {2} \sigma_ {\xi} ^ {2} d ^ {3 / 2}}\right) \leq 2 \exp (- d ^ {1 / 4}). \tag {E.32} +$$ + +Denote $\mathcal{E}$ to be the event that $|\langle \pmb{\xi}_{k,i},\pmb {\xi}\rangle |\leq d^{-1 / 4}$ and $|\langle \mathbf{w}_{j,r}^{(0,0)},\pmb {\xi}\rangle |\leq d^{3 / 2}$ for all $k\in [K],i\in [n],r\in [m]$ and $j\in \{-1,1\}$ . Applying union bound, we have that the $\mathbb{P}(\mathcal{E})\geq 1 - 2(nK + m)\exp (-d^{1 / 4})\geq 1 / 2$ . We can divide $\mathcal{L}_{\mathrm{test}}(\mathbf{W})$ into two parts: + +$$ +\begin{array}{l} \mathcal {L} _ {\text {t e s t}} (\mathbf {W}) = \mathbb {E} \left[ \ell \left(y f (\mathbf {W}, \mathbf {x})\right) \right] \\ = \mathbb {E} [ \mathbf {1} (\mathcal {E}) \ell (y f (\mathbf {W}, \mathbf {x})) ] + \mathbb {E} [ \mathbf {1} (\mathcal {E} ^ {c}) \ell (y f (\mathbf {W}, \mathbf {x})) ] \\ \geq \mathbb {E} [ \mathbf {1} (\mathcal {E}) \ell (y f (\mathbf {W}, \mathbf {x})) ]. \tag {E.33} \\ \end{array} +$$ + +Let $T' \leq T$ . And suppose that $T' \geq T^{(1)}$ . When event $\mathcal{E}$ holds, for any $j \in \{-1, 1\}$ , we have + +$$ +\begin{array}{l} \langle \mathbf {w} _ {j, r} ^ {(T ^ {\prime}, 0)}, \pmb {\xi} \rangle = \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \pmb {\xi} \rangle - \frac {\eta}{K n _ {2}} \sum_ {t = 0} ^ {T ^ {\prime} - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {(t, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \pmb {\xi} _ {k, i} \rangle) \langle \pmb {\xi}, \pmb {\xi} _ {k, i} \rangle \\ \leq \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \pmb {\xi} \rangle - \frac {\eta}{K n _ {2}} \sum_ {t = 0} ^ {T ^ {\prime} - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {(t, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \pmb {\xi} _ {k, i} \rangle) d ^ {- 1 / 4} \\ \leq \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \boldsymbol {\xi} \rangle - \frac {\eta}{K n _ {2}} \sum_ {t = 0} ^ {T ^ {\prime} - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime (t, J)} d ^ {- 1 / 4} \\ \leq \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \pmb {\xi} \rangle - \frac {\eta d ^ {- 1 / 4}}{K n _ {2}} \sum_ {t = 0} ^ {T ^ {(2)} - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime (t, J)} - \frac {\eta d ^ {- 1 / 4}}{K n _ {2}} \sum_ {t = T ^ {(2)}} ^ {T ^ {\prime} - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime (t, J)} \\ \leq \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \boldsymbol {\xi} \rangle + \eta d ^ {- 1 / 4} T ^ {(2)} + \frac {\eta d ^ {- 1 / 4}}{K n _ {2}} \widetilde {\mathcal {O}} (1) \\ \leq \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \boldsymbol {\xi} \rangle + \widetilde {\mathcal {O}} (d ^ {- 1 / 4}) + \widetilde {\mathcal {O}} (d ^ {- 1 / 4}) \\ = \widetilde {\mathcal {O}} \left(d ^ {- 1 / 4}\right), \tag {E.34} \\ \end{array} +$$ + +where the second line is by Eq. (E.31). The third line is by $0 \leq \sigma'(\cdot) \leq 1$ . The third last line is due to $-\ell'(\cdot) \leq 1$ , $T^{(2)} = \mathrm{polylog}(d)$ and $\sum_{t=T^{(2)}}^{T-1} \sum_{(k,i) \in \Psi} \ell_{k,i}^{\prime(t,J)} = \widetilde{\mathcal{O}}(1)$ . The second last line is by Eq. (E.32). We note that Eq. (E.34) holds for all $j \in \{-1,1\}$ , $r \in [m]$ , and $y \in \{-1,1\}$ . Using the same procedure, one can show that $j \langle \mathbf{w}_{j,r}^{(T',0)}, \mathbf{z} \rangle \leq \widetilde{\mathcal{O}}(d^{-1/4})$ for all $r \in [m]$ and $j \in \{-1,1\}$ . Now without loss of generality assume $y = 1$ . We have + +$$ +\ell \Bigl(y\Bigl(F_{+1}(\mathbf{W}_{+1}^{(T^{\prime})},\mathbf{x}) - F_{-1}(\mathbf{W}_{-1}^{(T^{\prime})},\mathbf{x})\Bigr)\Bigr) = \ell \Bigl(F_{+1}(\mathbf{W}_{+1}^{(T^{\prime})},\mathbf{x}) - F_{-1}(\mathbf{W}_{-1}^{(T^{\prime})},\mathbf{x})\Bigr) +$$ + +$$ +\begin{array}{l} \geq \ell \left(F _ {+ 1} \left(\mathbf {W} _ {+ 1} ^ {(T ^ {\prime})}, \mathbf {x}\right)\right) \\ = \ell \left(\sum_ {r = 1} ^ {m} \sigma \left(\left\langle \mathbf {w} _ {1, r} ^ {\left(T ^ {\prime}, 0\right)}, \boldsymbol {\nu} + \mathbf {z} \right\rangle\right) + \sigma \left(\left\langle \mathbf {w} _ {1, r} ^ {\left(T ^ {\prime}, 0\right)}, \boldsymbol {\xi} \right\rangle\right)\right) \\ \geq \ell \left(\sum_ {r = 1} ^ {m} \sigma \left(\widetilde {\mathcal {O}} \left(d ^ {- 1 / 4}\right) + \widetilde {\mathcal {O}} \left(d ^ {- 1 / 4}\right)\right) + \sigma \left(\widetilde {\mathcal {O}} \left(d ^ {- 1 / 4}\right)\right)\right) \\ = \ell \left(m \widetilde {\mathcal {O}} \left(d ^ {- 1 / 4}\right)\right) \\ = \Omega (1). \tag {E.35} \\ \end{array} +$$ + +where second line is because $\ell(\cdot)$ is nonincreasing and the fourth line is due to Claim E.5. Finally plugging Eq. (E.35) into Eq. (E.33) gives that + +$$ +\mathcal {L} _ {\text {t e s t}} (\mathbf {W}) \geq \mathbb {E} [ \mathbf {1} (\mathcal {E}) \ell (y f (\mathbf {W}, \mathbf {x})) ] \geq \mathbb {E} [ \mathbf {1} (\mathcal {E}) \Omega (1) ] = \Omega (\mathbb {P} (\mathcal {E})) = \Omega (1). +$$ + +Since $T' \in [T^{(1)}, T]$ is arbitrary, we get that + +$$ +\min _ {t \in [ T ^ {(1)}, T ]} \mathcal {L} _ {\mathrm {t e s t}} (\mathbf {W} ^ {(t)}) = \Omega (1). +$$ + +However, the above proof would also work for $T' < T^{(1)}$ using our proofs from Phase I. Hence, + +$$ +\min _ {t \in [ T ]} \mathcal {L} _ {\mathrm {t e s t}} (\mathbf {W} ^ {(t)}) = \Omega (1), +$$ + +which concludes our theorem. + +![](images/c293d590c6502039cc8e2275197cdc61cde914c0d6fdca565821a3d9b0537955.jpg) + +# F TRAIN-VALIDATION METHOD + +Contrary to the train-train method, we will show in this section that under Condition D.1, the feature will be learned by our neural network. Abusing notations, let $\Xi_{k,i}^{(t)} = \max \left\{\langle \mathbf{w}_{1,r}^{(t,0)},\pmb{\xi}_{k,i}\rangle :r\in [m]\right\}$ , $\Gamma_{k,i}^{(t)} = \max \left\{\langle \mathbf{w}_{-1,r}^{(t,0)},\pmb{\xi}_{k,i}\rangle :r\in [m]\right\}$ , and $\Lambda_{j}^{(t)} = \max \left\{j\langle \mathbf{w}_{j,r}^{(t,0)},\pmb {\nu}\rangle :r\in [m]\right\}$ for $j\in \{-1,1\}$ . Define $C = J\gamma \sigma_{\xi}^{2}\sqrt{d}\sqrt{\log(Kn)}$ , $\widehat{\Xi}_{k,i}^{(t)} = \max \{C,\Xi_{k,i}^{(t)}\}$ , and $\widehat{\Gamma}_{k,i}^{(t)} = \max \{C,\Gamma_{k,i}^{(t)}\}$ . Let $\Psi = \{(k,i):k\in [K],i > n_1\}$ , $\Psi_{+} = \{(k,i):k\in [K],i > n_1,y_{k,i} = 1\}$ , and $\Psi_{-} = \{(k,i):k\in [K],i > n_1,y_{k,i} = -1\}$ . So $\Psi$ represents all of the samples from the validation set of all tasks. And $\Psi_{j}$ represents the samples from the validation set of all tasks with label $j$ . We first present a series of useful lemmas that hold for all $t\geq 0$ . Theses lemmas basically show that the learning speed of $\mathbf{z}_k$ are very slow compared with the learning speed of the feature $\pmb{\nu}$ . + +Lemma F.1. Under Condition D.1 and Condition 4.1, for any $t \geq 0$ , $k \in [M]$ , $j \in \{-1, 1\}$ , if one uses the train-validation method, then we have + +$$ +\max _ {r} \left| j \langle \boldsymbol {w} _ {j, r} ^ {(t, 0)}, \boldsymbol {z} _ {k} \rangle \right| = o (1) \boldsymbol {\Lambda} _ {j} ^ {(t)}. +$$ + +Proof. Without loss of generality, let $j = 1$ , $k \in [M]$ . Denote $r(t) = \arg \max_{r \in [m]} |\langle \mathbf{w}_{1,r}^{(t,0)}, \mathbf{z}_k \rangle|$ . Define + +$$ +D (t) := \frac {\left| \langle \mathbf {w} _ {1 , r (t)} ^ {(t , 0)} , \mathbf {z} _ {k} \rangle \right|}{\boldsymbol {\Lambda} _ {1} ^ {(t)}}. +$$ + +At $t = 0$ , by Lemma D.2 we have + +$$ +D (0) = \frac {\left| \langle \mathbf {w} _ {1 , r (0)} ^ {(0 , 0)} , \mathbf {z} _ {k} \rangle \right|}{\boldsymbol {\Lambda} _ {1} ^ {(0)}} \leq \frac {\Theta (\sigma_ {s} \sigma_ {0} \sqrt {d} \sqrt {\log (m K n)})}{\Theta (\sigma_ {0})} = \Theta (\sigma_ {s} \sqrt {d} \sqrt {\log (m K n)}) = o (1). +$$ + +Define $D_0 \coloneqq \Theta(\sigma_s \sqrt{d} \sqrt{\log(mKn)})$ . We show that for any $t' > 0$ , we have $D(t') \leq 2D_0 = o(1)$ . Observe that similar to Eq. (E.17), we have for any $t \geq 0$ + +$$ +\begin{array}{l} \langle \mathbf {w} _ {1, r} ^ {(t + 1, 0)}, \mathbf {z} _ {k} \rangle = \langle \mathbf {w} _ {1, r} ^ {(t, 0)}, \mathbf {z} _ {k} \rangle - \frac {\eta}{K n _ {2}} \sum_ {(k ^ {\prime}, i) \in \Psi} \ell_ {k ^ {\prime}, i} ^ {\prime (t, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\nu} _ {k ^ {\prime}} \rangle y _ {k ^ {\prime}, i}) \langle \mathbf {z} _ {k ^ {\prime}}, \mathbf {z} _ {k} \rangle \\ \leq \left\langle \mathbf {w} _ {1, r} ^ {(t, 0)}, \mathbf {z} _ {k} \right\rangle - \frac {\eta}{K n _ {2}} \sum_ {\left(k ^ {\prime}, i\right) \in \Psi} \ell_ {k ^ {\prime}, i} ^ {\prime (t, J)} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\nu} _ {k ^ {\prime}} \right\rangle y _ {k ^ {\prime}, i}\right) \Theta \left(\sigma_ {s} ^ {2} d\right), \tag {F.1} \\ \end{array} +$$ + +where we used Condition 4.1 for the inequality, since $\langle \mathbf{z}_{k'}, \mathbf{z}_k \rangle \leq \max \left( \| \mathbf{z}_k \|_2^2, \| \mathbf{z}_{k'} \|_2^2 \right) = \Theta (\sigma_s^2 d)$ . Comparing Eq. (C.11) and Eq. (F.1), we can roughly understand why this lemma is true: for any $r \in [m]$ , the growth of $\langle \mathbf{w}_{1,r}^{(t,0)}, \pmb{\nu} \rangle$ is at least a factor of $1 / (\sigma_s^2 d) = \omega(1)$ faster than that of $\langle \mathbf{w}_{1,r}^{(t,0)}, \mathbf{z}_k \rangle$ . We can compute + +$$ +\begin{array}{l} \left| \left\langle \mathbf {w} _ {1, r (t ^ {\prime})} ^ {(t ^ {\prime}, 0)}, \mathbf {z} _ {k} \right\rangle \right| \leq \left| \sum_ {t = 0} ^ {t ^ {\prime} - 1} \left(\left\langle \mathbf {w} _ {1, r (t ^ {\prime})} ^ {(t + 1, 0)}, \mathbf {z} _ {k} \right\rangle - \left\langle \mathbf {w} _ {1, r (t ^ {\prime})} ^ {(t, 0)}, \mathbf {z} _ {k} \right\rangle\right) \right| + \left| \left\langle \mathbf {w} _ {1, r (t ^ {\prime})} ^ {(0, 0)}, \mathbf {z} _ {k} \right\rangle \right| \\ \leq \sum_ {t = 0} ^ {t ^ {\prime} - 1} \left| \left\langle \mathbf {w} _ {1, r \left(t ^ {\prime}\right)} ^ {(t + 1, 0)}, \mathbf {z} _ {k} \right\rangle - \left\langle \mathbf {w} _ {1, r \left(t ^ {\prime}\right)} ^ {(t, 0)}, \mathbf {z} _ {k} \right\rangle \right| + \left| \left\langle \mathbf {w} _ {1, r \left(t ^ {\prime}\right)} ^ {(0, 0)}, \mathbf {z} _ {k} \right\rangle \right| \\ \leq \sum_ {t = 0} ^ {t ^ {\prime} - 1} \Theta \left(\sigma_ {s} ^ {2} d\right) \left| \left\langle \mathbf {w} _ {1, r \left(t ^ {\prime}\right)} ^ {(t + 1, 0)}, \boldsymbol {\nu} \right\rangle - \left\langle \mathbf {w} _ {1, r \left(t ^ {\prime}\right)} ^ {(t, 0)}, \boldsymbol {\nu} \right\rangle \right| + \left| \left\langle \mathbf {w} _ {1, r \left(t ^ {\prime}\right)} ^ {(0, 0)}, \mathbf {z} _ {k} \right\rangle \right| \\ = \sum_ {t = 0} ^ {t ^ {\prime} - 1} \Theta \left(\sigma_ {s} ^ {2} d\right) \left(\left\langle \mathbf {w} _ {1, r \left(t ^ {\prime}\right)} ^ {(t + 1, 0)}, \boldsymbol {\nu} \right\rangle - \left\langle \mathbf {w} _ {1, r \left(t ^ {\prime}\right)} ^ {(t, 0)}, \boldsymbol {\nu} \right\rangle\right) + \left| \left\langle \mathbf {w} _ {1, r \left(t ^ {\prime}\right)} ^ {(0, 0)}, \mathbf {z} _ {k} \right\rangle \right| \\ = \Theta (\sigma_ {s} ^ {2} d) \big (\langle \mathbf {w} _ {1, r (t ^ {\prime})} ^ {(t ^ {\prime}, 0)}, \boldsymbol {\nu} \rangle - \langle \mathbf {w} _ {1, r (t ^ {\prime})} ^ {(0, 0)}, \boldsymbol {\nu} \rangle \big) + \big | \langle \mathbf {w} _ {1, r (t ^ {\prime})} ^ {(0, 0)}, \mathbf {z} _ {k} \rangle \big | \\ \leq \Theta (\sigma_ {s} ^ {2} d) \big (\boldsymbol {\Lambda} _ {1} ^ {(t ^ {\prime})} - \min _ {r \in [ m ]} \langle \mathbf {w} _ {1, r} ^ {(0, 0)}, \pmb {\nu} \rangle \big) + \big | \langle \mathbf {w} _ {1, r (0)} ^ {(0, 0)}, \mathbf {z} _ {k} \rangle \big | \\ \leq \Theta \left(\sigma_ {s} ^ {2} d\right) \left(\boldsymbol {\Lambda} _ {1} ^ {(t ^ {\prime})} + \Theta \left(\sigma_ {0} \sqrt {\log (m K n)}\right)\right) + D _ {0} \boldsymbol {\Lambda} _ {1} ^ {(0)}, \\ \end{array} +$$ + +where the first and second lines are by triangle inequality. The third line is by comparing Eq. (C.11) and Eq. (F.1). The fourth line is by the fact that $\langle \mathbf{w}_{1,r}^{(t,0)},\pmb {\nu}\rangle$ is increasing in $t$ for any $r\in [m]$ . The sixth line is by definition of $\Lambda_1^{(t')}$ and definition of $r(0)$ . The last line is by Lemma D.2. Then we have + +$$ +\begin{array}{l} \frac {\left| \left\langle \mathbf {w} _ {1 , r (t ^ {\prime})} ^ {(t ^ {\prime} , 0)} , \mathbf {z} _ {k} \right\rangle \right|}{\boldsymbol {\Lambda} _ {1} ^ {(t ^ {\prime})}} \leq \frac {\Theta \left(\sigma_ {s} ^ {2} d\right) \left(\boldsymbol {\Lambda} _ {1} ^ {(t ^ {\prime})} + \Theta \left(\sigma_ {0} \sqrt {\log (m K n)}\right)\right) + D _ {0} \boldsymbol {\Lambda} _ {1} ^ {(0)}}{\boldsymbol {\Lambda} _ {1} ^ {(t ^ {\prime})}} \\ \leq \Theta \left(\sigma_ {s} ^ {2} d\right) \left(1 + \sqrt {\log (m K n)}\right) + D _ {0} \\ < 2 D _ {0} , \\ \end{array} +$$ + +where we used $\Lambda_{j}^{(t)}$ is increasing in $t$ to get the second inequality. The third inequality is by direct calculation and comparison: $D_0 = \Theta (\sigma_s\sqrt{d}\sqrt{\log(mKn)})$ , $\sigma_s^2 d = (\sigma_s\sqrt{d})^2 = \sigma_s\sqrt{d} /\mathrm{polylog}(d) = o(1)D_0$ , $\sigma_s^2 d\sqrt{\log(mKn)} = \sigma_s\sqrt{\log(mKn)} /\mathrm{polylog}(d) = o(1)D_0$ . This proves the lemma. + +Lemma F.2. Under Condition D.1 and Condition 4.1, for any $j \in \{-1,1\}$ , $r \in [m]$ , if at time $t$ we have $j \langle w_{j,r}^{(t,0)}, \nu \rangle \geq d^{-1/3}$ , then for any $k \in [K]$ + +$$ +j \langle \boldsymbol {w} _ {j, r} ^ {(t, 0)}, \boldsymbol {z} _ {k} \rangle = \mathcal {O} \left(\sigma_ {s} ^ {2} d\right) j \langle \boldsymbol {w} _ {j, r} ^ {(t, 0)}, \boldsymbol {\nu} \rangle = o (1) j \langle \boldsymbol {w} _ {j, r} ^ {(t, 0)}, \boldsymbol {\nu} \rangle . +$$ + +Proof. Without loss of generality, assume $j = 1$ . And suppose $\langle \mathbf{w}_{1,r}^{(t,0)},\pmb {\nu}\rangle \geq d^{-1 / 3}$ for some $r\in [m]$ . By Eq. (C.11), we have + +$$ +d ^ {- 1 / 3} \leq \langle \mathbf {w} _ {1, r} ^ {(t, 0)}, \pmb {\nu} \rangle = \langle \mathbf {w} _ {1, r} ^ {(0, 0)}, \pmb {\nu} \rangle - \frac {\eta}{K n _ {2}} \sum_ {t ^ {\prime} = 0} ^ {t - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime (t ^ {\prime}, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t ^ {\prime}, J)}, \pmb {\nu} _ {k} \rangle y _ {k, i}) \| \pmb {\nu} \| _ {2} ^ {2}, +$$ + +$$ +\begin{array}{l} d ^ {- 1 / 3} - \langle \mathbf {w} _ {1, r} ^ {(0, 0)}, \boldsymbol {\nu} \rangle \leq - \frac {\eta}{K n _ {2}} \sum_ {t ^ {\prime} = 0} ^ {t - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {(t ^ {\prime}, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t ^ {\prime}, J)}, \boldsymbol {\nu} _ {k} \rangle y _ {k, i}) \| \boldsymbol {\nu} \| _ {2} ^ {2}, \\ d ^ {- 1 / 3} - \mathcal {O} (\sigma_ {0} \sqrt {\log (m K n)}) \leq - \frac {\eta}{K n _ {2}} \sum_ {t ^ {\prime} = 0} ^ {t - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime (t ^ {\prime}, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t ^ {\prime}, J)}, \boldsymbol {\nu} _ {k} \rangle y _ {k, i}) \| \boldsymbol {\nu} \| _ {2} ^ {2}, \\ \Omega (d ^ {- 1 / 3}) \leq - \frac {\eta}{K n _ {2}} \sum_ {t ^ {\prime} = 0} ^ {t - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {(t ^ {\prime}, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t ^ {\prime}, J)}, \pmb {\nu} _ {k} \rangle y _ {k, i}) \| \pmb {\nu} \| _ {2} ^ {2}. \\ \end{array} +$$ + +Recall that from Condition D.1 and Condition 4.1 + +$$ +\left| \langle \mathbf {w} _ {1, r} ^ {(0, 0)}, \boldsymbol {\nu} \rangle \right| \leq \widetilde {\mathcal {O}} (d ^ {- 1 / 2}) \ll \mathcal {O} (d ^ {- 1 / 3}) \leq \frac {- \eta}{K n _ {2}} \sum_ {t ^ {\prime} = 0} ^ {t - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime (t ^ {\prime}, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t ^ {\prime}, J)}, \boldsymbol {\nu} _ {k} \rangle y _ {k, i}) \| \boldsymbol {\nu} \| _ {2} ^ {2}. +$$ + +This implies + +$$ +\left| \langle \mathbf {w} _ {1, r} ^ {(0, 0)}, \boldsymbol {\nu} \rangle \right| = - o (1) \frac {\eta}{K n _ {2}} \sum_ {t ^ {\prime} = 0} ^ {t - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime (t ^ {\prime}, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t ^ {\prime}, J)}, \boldsymbol {\nu} _ {k} \rangle y _ {k, i}) \| \boldsymbol {\nu} \| _ {2} ^ {2}, +$$ + +Hence, + +$$ +\left\langle \mathbf {w} _ {1, r} ^ {(t, 0)}, \boldsymbol {\nu} \right\rangle = - \Theta (1) \frac {\eta}{K n _ {2}} \sum_ {t ^ {\prime} = 0} ^ {t - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime \left(t ^ {\prime}, J\right)} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {\left(t ^ {\prime}, J\right)}, \boldsymbol {\nu} _ {k} \right\rangle y _ {k, i}\right) \| \boldsymbol {\nu} \| _ {2} ^ {2}. \tag {F.2} +$$ + +On the other hand, from Eq. (F.1) and Lemma D.2 we have + +$$ +\begin{array}{l} \langle \mathbf {w} _ {1, r} ^ {(t, 0)}, \mathbf {z} _ {k} \rangle \leq \langle \mathbf {w} _ {1, r} ^ {(0, 0)}, \mathbf {z} _ {k} \rangle - \frac {\eta}{K n _ {2}} \sum_ {t ^ {\prime} = 0} ^ {t - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime (t ^ {\prime}, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t ^ {\prime}, J)}, \boldsymbol {\nu} _ {k} \rangle y _ {k, i}) \Theta (\sigma_ {s} ^ {2} d) \\ \leq \mathcal {O} (\sigma_ {s} \sigma_ {0} \sqrt {d} \sqrt {\log (m K n)}) - \frac {\eta}{K n _ {2}} \sum_ {t ^ {\prime} = 0} ^ {t - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime (t ^ {\prime}, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t ^ {\prime}, J)}, \boldsymbol {\nu} _ {k} \rangle y _ {k, i}) \Theta (\sigma_ {s} ^ {2} d) \\ \leq - \mathcal {O} (1) \frac {\eta}{K n _ {2}} \sum_ {t ^ {\prime} = 0} ^ {t - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime \left(t ^ {\prime}, J\right)} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {\left(t ^ {\prime}, J\right)}, \boldsymbol {\nu} _ {k} \right\rangle y _ {k, i}\right) \Theta \left(\sigma_ {s} ^ {2} d\right) \\ = - \mathcal {O} \left(\sigma_ {s} ^ {2} d\right) \frac {\eta}{K n _ {2}} \sum_ {t ^ {\prime} = 0} ^ {t - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime \left(t ^ {\prime}, J\right)} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {\left(t ^ {\prime}, J\right)}, \boldsymbol {\nu} _ {k} \right\rangle y _ {k, i}\right) \\ = \mathcal {O} \left(\sigma_ {s} ^ {2} d\right) \langle \mathbf {w} _ {1, r} ^ {(t, 0)}, \boldsymbol {\nu} \rangle \\ = o (1) \left\langle \mathbf {w} _ {1, r} ^ {(t, 0)}, \boldsymbol {\nu} \right\rangle , \\ \end{array} +$$ + +where the third line is a direct comparison of the sizes of the first and second term of the second line. The second last equality is due to Eq. (F.2). + +Lemma F.3. Under Condition D.1 and Condition 4.1, for any $j \in \{-1, 1\}$ , $r \in [m]$ , if at time $t$ we have $j \langle w_{j,r}^{(t,0)}, \nu \rangle < d^{-1/3}$ , then for any $k \in [K]$ + +$$ +j \left\langle \boldsymbol {w} _ {j, r} ^ {(t, 0)}, \boldsymbol {z} _ {k} \right\rangle < d ^ {- 1 / 3}. +$$ + +Proof. Without loss of generality, consider $j = 1$ . Let $k \in [K]$ , $r \in [m]$ and suppose $\langle \mathbf{w}_{1,r}^{(t,0)}, \pmb{\nu} \rangle < d^{-1/3}$ at time $t$ . By Eq. (C.11), we have + +$$ +d ^ {- 1 / 3} > \langle \mathbf {w} _ {1, r} ^ {(t, 0)}, \boldsymbol {\nu} \rangle = \langle \mathbf {w} _ {1, r} ^ {(0, 0)}, \boldsymbol {\nu} \rangle - \frac {\eta}{K n _ {2}} \sum_ {t ^ {\prime} = 0} ^ {t - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime (t ^ {\prime}, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t ^ {\prime}, J)}, \boldsymbol {\nu} _ {k} \rangle y _ {k, i}) \| \boldsymbol {\nu} \| _ {2} ^ {2}, +$$ + +$$ +\begin{array}{l} d ^ {- 1 / 3} - \langle \mathbf {w} _ {1, r} ^ {(0, 0)}, \pmb {\nu} \rangle > - \frac {\eta}{K n _ {2}} \sum_ {t ^ {\prime} = 0} ^ {t - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime (t ^ {\prime}, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t ^ {\prime}, J)}, \pmb {\nu} _ {k} \rangle y _ {k, i}) \| \pmb {\nu} \| _ {2} ^ {2}, \\ d ^ {- 1 / 3} - \min _ {r ^ {\prime} \in [ m ]} \langle \mathbf {w} _ {1, r ^ {\prime}} ^ {(0, 0)}, \pmb {\nu} \rangle > - \frac {\eta}{K n _ {2}} \sum_ {t ^ {\prime} = 0} ^ {t - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime (t ^ {\prime}, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t ^ {\prime}, J)}, \pmb {\nu} _ {k} \rangle y _ {k, i}) \| \pmb {\nu} \| _ {2} ^ {2}, \\ d ^ {- 1 / 3} + \mathcal {O} (d ^ {- 1 / 2}) > - \frac {\eta}{K n _ {2}} \sum_ {t ^ {\prime} = 0} ^ {t - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime (t ^ {\prime}, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t ^ {\prime}, J)}, \pmb {\nu} _ {k} \rangle y _ {k, i}) \| \pmb {\nu} \| _ {2} ^ {2}, \\ 2 d ^ {- 1 / 3} > - \frac {\eta}{K n _ {2}} \sum_ {t ^ {\prime} = 0} ^ {t - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime \left(t ^ {\prime}, J\right)} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {\left(t ^ {\prime}, J\right)}, \boldsymbol {\nu} _ {k} \right\rangle y _ {k, i}\right) \| \boldsymbol {\nu} \| _ {2} ^ {2}, \tag {F.3} \\ \end{array} +$$ + +where the fourth line is by Lemma D.2. Meanwhile, using Eq. (F.1) and Lemma D.2 we obtain + +$$ +\begin{array}{l} \langle \mathbf {w} _ {1, r} ^ {(t, 0)}, \mathbf {z} _ {k} \rangle \leq \langle \mathbf {w} _ {1, r} ^ {(0, 0)}, \mathbf {z} _ {k} \rangle - \frac {\eta}{K n _ {2}} \sum_ {t ^ {\prime} = 0} ^ {t - 1} \sum_ {(k ^ {\prime}, i) \in \Psi} \ell_ {k ^ {\prime}, i} ^ {\prime (t, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \pmb {\nu} _ {k ^ {\prime}} \rangle y _ {k ^ {\prime}, i}) \Theta (\sigma_ {s} ^ {2} d) \\ \leq \left\langle \mathbf {w} _ {1, r} ^ {(0, 0)}, \mathbf {z} _ {k} \right\rangle + 2 d ^ {- 1 / 3} \Theta \left(\sigma_ {s} ^ {2} d\right) \\ \leq \mathcal {O} \left(\sigma_ {0} \sigma_ {s} \sqrt {d} \sqrt {\log (m K n)}\right) + 2 d ^ {- 1 / 3} \Theta \left(\sigma_ {s} ^ {2} d\right) \\ < d ^ {- 1 / 3}, \\ \end{array} +$$ + +where the second line is by Eq. (F.3). The last inequality is because the first term in the second last line is $\tilde{\mathcal{O}}(d^{-1/2})$ and $\Theta(\sigma_s^2 d) = o(1)$ . This proves our lemma. + +![](images/bcbf1d8e8c57f1ade3aea5a427145bf113ea65d30f2f27f5f4f9ea47387ba3ca.jpg) + +Lemma F.4. Under Condition D.1 and Condition 4.1, for any $j \in \{-1,1\}$ , $r \in [m]$ and $k \in [K]$ if at time $t$ we have $j\langle \pmb{w}_{j,r}^{(t,0)}, \pmb{z}_k \rangle = \mathcal{O}(\sigma_s^2 d) j\langle \pmb{w}_{j,r}^{(t,0)}, \pmb{\nu} \rangle$ , then + +$$ +j \langle \boldsymbol {w} _ {j, r} ^ {(t, J)}, \boldsymbol {z} _ {k} \rangle = \mathcal {O} (\sigma_ {s} ^ {2} d) j \langle \boldsymbol {w} _ {j, r} ^ {(t, J)}, \boldsymbol {\nu} \rangle , +$$ + +where $\boldsymbol{w}_{j,r}^{(t,J)}$ on both hand sides refer to the weights $\boldsymbol{w}_{j,r}^{(t,0)}$ after $J$ steps inner-loop updates using samples from $S_{k}^{tr}$ . + +Proof. Without loss of generality, let $j = 1$ . Using samples from $S_k^{\mathrm{tr}}$ , similar to Eq. (C.5) we have + +$$ +\left\langle \mathbf {w} _ {1, r} ^ {(t, \tau + 1)}, \boldsymbol {\nu} \right\rangle = \left\langle \mathbf {w} _ {1, r} ^ {(t, \tau)}, \boldsymbol {\nu} \right\rangle - \frac {\gamma}{n _ {1}} \sum_ {i = 1} ^ {n _ {1}} \ell_ {k, i} ^ {\prime (t, \tau)} \sigma^ {\prime} \left(\left\langle \mathbf {w} _ {j, r} ^ {(t, \tau)}, \boldsymbol {\nu} _ {k} \right\rangle y _ {k, i}\right) \| \boldsymbol {\nu} \| _ {2} ^ {2}. \tag {F.4} +$$ + +And + +$$ +\langle \mathbf {w} _ {1, r} ^ {(t, \tau + 1)}, \mathbf {z} _ {k} \rangle = \langle \mathbf {w} _ {1, r} ^ {(t, \tau)}, \mathbf {z} _ {k} \rangle - \frac {\gamma}{n _ {1}} \sum_ {i = 1} ^ {n _ {1}} \ell_ {k, i} ^ {\prime (t, \tau)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t, \tau)}, \boldsymbol {\nu} _ {k} \rangle y _ {k, i}) \| \mathbf {z} _ {k} \| _ {2} ^ {2}. +$$ + +This implies + +$$ +\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\nu} \rangle = \langle \mathbf {w} _ {1, r} ^ {(t, 0)}, \boldsymbol {\nu} \rangle - \frac {\gamma}{n _ {1}} \sum_ {\tau = 0} ^ {J - 1} \sum_ {i = 1} ^ {n _ {1}} \ell_ {k, i} ^ {\prime (t, \tau)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t, \tau)}, \boldsymbol {\nu} _ {k} \rangle y _ {k, i}) \| \boldsymbol {\nu} \| _ {2} ^ {2}, +$$ + +$$ +\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \mathbf {z} _ {k} \rangle = \langle \mathbf {w} _ {1, r} ^ {(t, 0)}, \mathbf {z} _ {k} \rangle - \frac {\gamma}{n _ {1}} \sum_ {\tau = 0} ^ {J - 1} \sum_ {i = 1} ^ {n _ {1}} \ell_ {k, i} ^ {\prime (t, \tau)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t, \tau)}, \boldsymbol {\nu} _ {k} \rangle y _ {k, i}) \| \mathbf {z} _ {k} \| _ {2} ^ {2}. +$$ + +Recall $\| \pmb{\nu}\| _2^2 = 1$ and $\| \mathbf{z}_k\| _2^2 = \mathcal{O}(\sigma_s^2 d)$ by Condition 4.1. Since we are given $\langle \mathbf{w}_{1,r}^{(t,0)},\mathbf{z}_k\rangle = \mathcal{O}(\sigma_s^2 d)\langle \mathbf{w}_{1,r}^{(t,0)},\pmb {\nu}\rangle$ , we conclude that + +$$ +\left\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \mathbf {z} _ {k} \right\rangle = \mathcal {O} \left(\sigma_ {s} ^ {2} d\right) \left\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\nu} \right\rangle . +$$ + +![](images/c84227503593f27d2ec7aea6b0bb2d5f51e34604a6281951fb7f8e91e059c874.jpg) + +The following corollary is an immediate result of Lemma F.2 and Lemma F.4. + +Corollary F.5. Fix $j \in \{-1, 1\}$ . Then for any $r \in [m]$ , if at time $t$ we have $j \langle \pmb{w}_{j,r}^{(t,0)}, \pmb{\nu} \rangle \geq d^{-1/3}$ , then for any $k \in [K]$ , + +$$ +j \langle \pmb {w} _ {j, r} ^ {(t, J)}, \pmb {z} _ {k} \rangle = \mathcal {O} (\sigma_ {s} ^ {2} d) j \langle \pmb {w} _ {j, r} ^ {(t, J)}, \pmb {\nu} \rangle = \mathcal {O} (1 / \mathrm {p o l y l o g} (d)) j \langle \pmb {w} _ {j, r} ^ {(t, J)}, \pmb {\nu} \rangle , +$$ + +where $\mathbf{w}_{j,r}^{(t,J)}$ on both hand sides refer to the weights $\mathbf{w}_{j,r}^{(t,0)}$ after $J$ steps inner-loop updates using samples from $S_{k}^{tr}$ . + +Lemma F.6. Under Condition D.1 and Condition 4.1, for any $j \in \{-1,1\}$ , $r \in [m]$ , and $k \in [K]$ , if we are using the samples from $S_k^{tr}$ , then for any $t \geq 0$ we have + +$$ +j \langle \boldsymbol {w} _ {j, r} ^ {(t, J)}, \boldsymbol {\nu} \rangle \leq 2 \max \left\{\Lambda_ {j} ^ {(t)}, J \gamma \right\}. +$$ + +Proof. Without loss of generality, consider $j = 1$ . Let $r \in [m]$ and $k \in [K]$ . Using samples from $S_k^{\mathrm{tr}}$ , by Eq. (F.4) we have + +$$ +\langle \mathbf {w} _ {1, r} ^ {(t, \tau + 1)}, \boldsymbol {\nu} \rangle \leq \langle \mathbf {w} _ {1, r} ^ {(t, \tau)}, \boldsymbol {\nu} \rangle + \gamma , +$$ + +for any $\tau \in [J - 1]$ , where we have used the fact that $-\ell'(\cdot) \leq 1$ and $\sigma'(\cdot) \leq 1$ . Repeating $J$ times we get + +$$ +\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\nu} \rangle \leq \langle \mathbf {w} _ {1, r} ^ {(t, 0)}, \boldsymbol {\nu} \rangle + J \gamma \leq \boldsymbol {\Lambda} _ {1} ^ {(t)} + J \gamma \leq 2 \max \left\{\boldsymbol {\Lambda} _ {1} ^ {(t)}, J \gamma \right\}. +$$ + +![](images/1088569414c298eb813d6103f30799e3820ebbcada50ff087c2778583db7eede.jpg) + +# F.1 PHASE I + +Let $T_{j}^{(2)}$ be the first iteration such that $\Lambda_{j}^{(t)} \geq m^{-1/2}(1 + \gamma)^{-J} = \widetilde{\Theta}(1)$ and let $T^{(2)} = \max_{j} T_{j}^{(2)}$ . Without loss of generality, let us assume that $T_{-1}^{(2)} \leq T_{1}^{(2)}$ . + +Recall that we assumed $T_1^{(2)} \geq T_{-1}^{(2)}$ . + +Lemma F.7 (Restatement of Lemma 6.2). Under Condition D.1 and Condition 4.1, if one uses the train-validation method, then for any $t \leq T^{(2)}$ , + +1. For any $k \in [K]$ and $r = \arg \max_{r' \in [m]} \langle \pmb{w}_{1,r'}^{(t,0)}, \pmb{\nu} \rangle$ + +$$ +\langle \boldsymbol {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\nu} _ {k} \rangle = \Omega (1) \langle \boldsymbol {w} _ {1, r} ^ {(t, 0)}, \boldsymbol {\nu} \rangle (1 + \Theta (1) \gamma) ^ {J}. +$$ + +2. For any $r \in [m]$ , $(k, i) \in \Psi$ , and $j \in \{-1, 1\}$ + +$$ +\langle \boldsymbol {w} _ {j, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k, i} \rangle \leq \mathcal {O} \left(\max \left\{\langle \boldsymbol {w} _ {j, r} ^ {(t, 0)}, \boldsymbol {\xi} _ {k, i} \rangle , C \right\}\right). +$$ + +Proof. The proof of the first part relies on the following hypothesis which we will verify inductively later. + +$$ +- \ell_ {k, i} ^ {\prime (t, \tau)} = \Theta (1), \text {f o r a l l} \tau \in [ J ], k \in [ K ], i \in [ n ] \text {s u c h t h a t} y _ {k, i} = 1. \tag {F.5} +$$ + +$$ +\sigma^ {\prime} \left(\left\langle \mathbf {w} _ {1, r} ^ {(t, \tau)}, \boldsymbol {\nu} _ {k} \right\rangle\right) = \Theta (1) \left\langle \mathbf {w} _ {1, r} ^ {(t, \tau)}, \boldsymbol {\nu} _ {k} \right\rangle , \text {f o r a l l} \tau \in [ J ], k \in [ K ] \text {i f} \left\langle \mathbf {w} _ {1, r} ^ {(t, \tau)}, \boldsymbol {\nu} _ {k} \right\rangle > 0. \tag {F.6} +$$ + +By Eq. (C.5), we know $\langle \mathbf{w}_{1,r}^{(t,\tau)},\pmb{\nu}_k\rangle$ is increasing in $\tau$ for any $r\in [m]$ and $k\in [K]$ . Moreover, we have + +$$ +\langle \mathbf {w} _ {1, r} ^ {(t + 1, 0)}, \boldsymbol {\nu} _ {k} \rangle = \langle \mathbf {w} _ {1, r} ^ {(t, 0)}, \boldsymbol {\nu} _ {k} \rangle - \frac {\eta}{K n} \sum_ {(k ^ {\prime}, i) \in \Psi} \ell_ {k ^ {\prime}, i} ^ {\prime (t, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\nu} _ {k ^ {\prime}} \rangle y _ {k ^ {\prime}, i}) \langle \boldsymbol {\nu} _ {k}, \boldsymbol {\nu} _ {k ^ {\prime}} \rangle , +$$ + +which shows that $\langle \mathbf{w}_{1,r}^{(t,0)},\pmb{\nu}_k\rangle$ is increasing in $t$ for all $r\in [m],k\in [K]$ , since $\langle \pmb {\nu}_k,\pmb{\nu}_{k'}\rangle = \| \pmb {\nu}\| _2^2 +$ $\langle \mathbf{z}_k,\mathbf{z}_{k'}\rangle >0$ . And Eq. (C.11) shows that $\langle \mathbf{w}_{1,r}^{(t,0)},\pmb {\nu}\rangle$ is increasing in $t$ for all $r\in [m]$ . Let $r(t) =$ arg max $_{r\in [m]}\langle \mathbf{w}_{1,r}^{(t,0)},\pmb {\nu}\rangle$ . Recall that under Lemma D.2, we have $\langle \mathbf{w}_{1,r(0)}^{(0,0)},\pmb {\nu}\rangle = \Omega (\sigma_0) > 0$ . Since this is increasing in $t$ , we have + +$$ +\langle \mathbf {w} _ {1, r (t)} ^ {(t, 0)}, \boldsymbol {\nu} \rangle \geq \langle \mathbf {w} _ {1, r (0)} ^ {(t, 0)}, \boldsymbol {\nu} \rangle \geq \langle \mathbf {w} _ {1, r (0)} ^ {(0, 0)}, \boldsymbol {\nu} \rangle > 0, +$$ + +where the first inequality is by definition of $r(t)$ . By Lemma F.1, we have for any $k \in [K]$ , + +$$ +\langle \mathbf {w} _ {1, r (t)} ^ {(t, 0)}, \boldsymbol {\nu} _ {k} \rangle = \langle \mathbf {w} _ {1, r (t)} ^ {(t, 0)}, \boldsymbol {\nu} \rangle + \langle \mathbf {w} _ {1, r (t)} ^ {(t, 0)}, \mathbf {z} _ {k} \rangle \geq (1 - o (1)) \langle \mathbf {w} _ {1, r (t)} ^ {(t, 0)}, \boldsymbol {\nu} \rangle > 0. +$$ + +And by monotonicity in $\tau$ , we have $\langle \mathbf{w}_{1,r(t)}^{(t,\tau)}, \pmb{\nu}_k \rangle > 0$ for all $\tau \in [J]$ . From Eq. (C.5) we can compute + +$$ +\begin{array}{l} \langle \mathbf {w} _ {1, r (t)} ^ {(t, \tau + 1)}, \boldsymbol {\nu} _ {k} \rangle = \langle \mathbf {w} _ {1, r (t)} ^ {(t, \tau)}, \boldsymbol {\nu} _ {k} \rangle - \frac {\gamma}{n _ {1}} \sum_ {i \leq n _ {1}, y _ {k, i} = 1} \ell_ {k, i} ^ {\prime (t, \tau)} \sigma^ {\prime} (\langle \mathbf {w} _ {1, r (t)} ^ {(t, \tau)}, \boldsymbol {\nu} _ {k} \rangle) \| \boldsymbol {\nu} _ {k} \| _ {2} ^ {2} \\ = \langle \mathbf {w} _ {1, r (t)} ^ {(t, \tau)}, \pmb {\nu} _ {k} \rangle + \gamma \Theta (1) \langle \mathbf {w} _ {1, r (t)} ^ {(t, \tau)}, \pmb {\nu} _ {k} \rangle \\ = \langle \mathbf {w} _ {1, r (t)} ^ {(t, \tau)}, \boldsymbol {\nu} _ {k} \rangle (1 + \Theta (1) \gamma). \\ \end{array} +$$ + +where we have used Hypothesis F.5 F.6 and $\| \pmb{\nu}_k\| _2 = \Theta (1)$ to get the second line. Applying this repeatedly to get + +$$ +\begin{array}{l} \langle \mathbf {w} _ {1, r (t)} ^ {(t, J)}, \boldsymbol {\nu} _ {k} \rangle = \langle \mathbf {w} _ {1, r (t)} ^ {(t, 0)}, \boldsymbol {\nu} _ {k} \rangle (1 + \Theta (1) \gamma) ^ {J} \\ = \Omega (1) \left\langle \mathbf {w} _ {1, r (t)} ^ {(t, 0)}, \boldsymbol {\nu} \right\rangle (1 + \Theta (1) \gamma) ^ {J}, \tag {F.7} \\ \end{array} +$$ + +where we have used Lemma F.1 to get the second equality. This proves the first part of the lemma. Consider some $(k,i)\in \Psi$ . Without loss of generality we will prove the second part of the lemma for $j = 1$ , since the proof for $j = -1$ is the same. By Eq. (C.3), for any $r\in [m]$ we have + +$$ +\langle \mathbf {w} _ {1, r} ^ {(t, \tau + 1)}, \boldsymbol {\xi} _ {k, i} \rangle \leq \langle \mathbf {w} _ {1, r} ^ {(t, \tau)}, \boldsymbol {\xi} _ {k, i} \rangle + \gamma \Theta (1) \Theta \left(\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}\right), +$$ + +where we used $-\ell'(\cdot) \leq 1$ , $\sigma'(\cdot) \leq 1$ and Lemma D.2. This implies + +$$ +\begin{array}{l} \langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k, i} \rangle \leq \langle \mathbf {w} _ {1, r} ^ {(t, 0)}, \boldsymbol {\xi} _ {k, i} \rangle + J \gamma \Theta (1) \Theta \left(\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}\right) \\ \leq \mathcal {O} \left(\max \left\{\langle \mathbf {w} _ {1, r} ^ {(t, 0)}, \boldsymbol {\xi} _ {k, i} \rangle , C \right\}\right). \tag {F.8} \\ \end{array} +$$ + +The second inequality is by definition of $C$ . This proves the second part of the lemma. + +![](images/2b47847ec341fb610cb41572a4904f46979f37c8a36c1ce08d1244c89e92a239.jpg) + +Remark F.8. Eq. (F.8) is not a surprising result. Since $\xi_{k,i}$ comes from the validation set and the inner-loop updates only uses samples from the training set, we expect that after $J$ steps of inner-loop updates, the inner product should remain as the same order as before the $J$ steps inner-loop updates. + +Theorem F.9 (Restatement of Lemma 6.3). Under Condition D.1 and Condition 4.1, if one uses the train-validation method, then for any $t \leq T^{(2)}$ , $(k,i) \in \Psi$ , + +$$ +\widehat {\Xi} _ {k, i} ^ {(t)} \leq \mathcal {O} (1) \widehat {\Xi} _ {k, i} ^ {(0)} = \widetilde {\mathcal {O}} \left(d ^ {- 1 / 2}\right). +$$ + +And + +$$ +\widehat {\Gamma} _ {k, i} ^ {(t)} \leq \mathcal {O} (1) \widehat {\Gamma} _ {k, i} ^ {(0)} = \widetilde {\mathcal {O}} \left(d ^ {- 1 / 2}\right). +$$ + +Proof. We will only prove our first statement that involves $\widehat{\Xi}_{k,i}^{(t)}$ , because the proof of the second statement that involves $\widehat{\Gamma}_{k,i}^{(t)}$ will be exactly the same. + +Similar to the proof of Theorem E.2, we will give lower bounds on the growth of $\pmb{\Lambda}_1^{(t)}$ and upper bound on the growth of $\widehat{\Xi}_{k,i}^{(t)}$ . We can upper bound the growth of $\pmb{\Lambda}_1^{(t)}$ using Lemma F.7. We first note that since $\langle \mathbf{w}_{1,r(t)}^{(t,J)}, \pmb{\nu}_k \rangle > 0$ , we have $-\langle \mathbf{w}_{1,r(t)}^{(t,J)}, \pmb{\nu}_k \rangle < 0$ . Thus, if $(k,i) \in \Psi_{-}$ we have $\sigma'(\langle \mathbf{w}_{1,r(t)}^{(t,J)}, \pmb{\nu}_k \rangle y_{k,i}) = 0$ . Then by Eq. (C.11), we get + +$$ +\begin{array}{l} \boldsymbol {\Lambda} _ {1} ^ {(t + 1)} \geq \left\langle \mathbf {w} _ {1, r (t)} ^ {(t + 1, 0)}, \boldsymbol {\nu} \right\rangle = \left\langle \mathbf {w} _ {1, r (t)} ^ {(t, 0)}, \boldsymbol {\nu} \right\rangle - \frac {\eta}{K n _ {2}} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime (t, J)} \sigma^ {\prime} (\left\langle \mathbf {w} _ {1, r (t)} ^ {(t, J)}, \boldsymbol {\nu} _ {k} \right\rangle y _ {k, i}) \\ = \left\langle \mathbf {w} _ {1, r (t)} ^ {(t, 0)}, \boldsymbol {\nu} \right\rangle - \frac {\eta}{K n _ {2}} \sum_ {(k, i) \in \Psi_ {+}} \ell_ {k, i} ^ {\prime (t, J)} \Theta (1) \left\langle \mathbf {w} _ {1, r (t)} ^ {(t, J)}, \boldsymbol {\nu} _ {k} \right\rangle \\ \end{array} +$$ + +$$ +\begin{array}{l} = \langle \mathbf {w} _ {1, r (t)} ^ {(t, 0)}, \boldsymbol {\nu} \rangle + \eta \Omega (1) \langle \mathbf {w} _ {1, r (t)} ^ {(t, 0)}, \boldsymbol {\nu} \rangle (1 + \Theta (1) \gamma) ^ {J} \\ = \left\langle \mathbf {w} _ {1, r (t)} ^ {(t, 0)}, \boldsymbol {\nu} \right\rangle (1 + \Omega (1) \eta \gamma^ {J}) \\ = \boldsymbol {\Lambda} _ {1} ^ {(t)} (1 + \Omega (1) \eta \gamma^ {J}), \tag {F.9} \\ \end{array} +$$ + +where we used $\sigma'(\langle \mathbf{w}_{1,r(t)}^{(t,J)}, \pmb{\nu}_k \rangle y_{k,i}) = 0$ if $(k,i) \in \Psi_{-}$ , and Hypothesis F.5 F.6 to get the second equality. We used Lemma F.7 to get the third equality. Next, let $(k,i) \in \Psi$ and $r \in [m]$ . We will derive an upper bound on the growth of $\widehat{\Xi}_{k,i}^{(t)}$ . By Eq. (C.9), we have + +$$ +\begin{array}{l} \langle \mathbf {w} _ {1, r} ^ {(t + 1, 0)}, \pmb {\xi} _ {k, i} \rangle \leq \langle \mathbf {w} _ {1, r} ^ {(t, 0)}, \pmb {\xi} _ {k, i} \rangle + \frac {\eta}{K n _ {2}} \sum_ {(k ^ {\prime}, i ^ {\prime}) \in \Psi \setminus \{(k, i) \}} \Theta (\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}) \\ + \frac {\eta}{K n _ {2}} \sigma^ {\prime} (\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k, i} \rangle) \Theta (\sigma_ {\xi} ^ {2} d) \\ \leq \langle \mathbf {w} _ {1, r} ^ {(t, 0)}, \boldsymbol {\xi} _ {k, i} \rangle + \eta \Theta (\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}) + \frac {\eta}{K n _ {2}} \Theta (\sigma_ {\xi} ^ {2} d) | \langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k, i} \rangle | \\ \leq \left\langle \mathbf {w} _ {1, r} ^ {(t, 0)}, \boldsymbol {\xi} _ {k, i} \right\rangle + \eta \Theta \left(\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}\right) \\ + \frac {\eta}{K n _ {2}} \Theta \left(\sigma_ {\xi} ^ {2} d\right) \mathcal {O} \left(\max \left\{\langle \mathbf {w} _ {1, r} ^ {(t, 0)}, \boldsymbol {\xi} _ {k, i} \rangle , C \right\}\right), \tag {F.10} \\ \end{array} +$$ + +where we used $-\ell'(\cdot) \leq 1$ and $\sigma'(\cdot) \leq 1$ and Lemma D.2 in the first inequality. We used $\sigma'(x) \leq 2|x|$ for any $x \in \mathbb{R}$ to get the second inequality. And we used Lemma F.7 to get the last inequality. Abusing notation, let $r(t) = \arg \max_{r \in [m]} \langle \mathbf{w}_{1,r}^{(t,0)}, \boldsymbol{\xi}_{k,i} \rangle$ . By definition, we have $\Xi_{k,i}^{(t)} = \langle \mathbf{w}_{1,r(t)}^{(t,0)}, \boldsymbol{\xi}_{k,i} \rangle$ . Let us compare the size of the second and third term on the right hand side of Eq. (F.10). The third term outweighs the second term at least by a factor of $\Theta(J\gamma \sigma_{\xi}^2 d/(Kn_2)) = \log(d)^{0.9}$ , due to the presence of the constant $C$ in the third term. Therefore, the second term is dominated by the third term for all $r \in [m]$ and for all $t \geq 0$ . So Eq. (F.10) becomes + +$$ +\begin{array}{l} \langle \mathbf {w} _ {1, r} ^ {(t + 1, 0)}, \boldsymbol {\xi} _ {k, i} \rangle \leq \langle \mathbf {w} _ {1, r} ^ {(t, 0)}, \boldsymbol {\xi} _ {k, i} \rangle + \frac {\eta}{K n _ {2}} \Theta \left(\sigma_ {\xi} ^ {2} d\right) \mathcal {O} \Big (\max \left\{\langle \mathbf {w} _ {1, r} ^ {(t, 0)}, \boldsymbol {\xi} _ {k, i} \rangle , C \right\} \Big) \\ \leq \max \left\{\langle \mathbf {w} _ {1, r} ^ {(t, 0)}, \boldsymbol {\xi} _ {k, i} \rangle , C \right\} + \frac {\eta}{K n _ {2}} \Theta (\sigma_ {\xi} ^ {2} d) \mathcal {O} \Big (\max \left\{\langle \mathbf {w} _ {1, r} ^ {(t, 0)}, \boldsymbol {\xi} _ {k, i} \rangle , C \right\} \Big) \\ \leq \max \left\{\Xi_ {k, i} ^ {(t)}, C \right\} + \frac {\eta}{K n _ {2}} \Theta (\sigma_ {\xi} ^ {2} d) \mathcal {O} \Big (\max \left\{\Xi_ {k, i} ^ {(t)}, C \right\} \Big) \\ = \widehat {\Xi} _ {k, i} ^ {(t)} \left(1 + \mathcal {O} (1) \frac {\eta \sigma_ {\xi} ^ {2} d}{K n _ {2}}\right). \\ \end{array} +$$ + +Since the above inequality holds for all $r \in [m]$ on the left hand side, it holds for $r(t + 1)$ in particular. This gives + +$$ +\boldsymbol {\Xi} _ {k, i} ^ {(t + 1)} \leq \widehat {\boldsymbol {\Xi}} _ {k, i} ^ {(t)} \Big (1 + \mathcal {O} (1) \frac {\eta \sigma_ {\xi} ^ {2} d}{K n _ {2}} \Big). +$$ + +And it is straightforward to check by definition of $\widehat{\Xi}_{k,i}^{(t)}$ that + +$$ +\widehat {\boldsymbol {\Xi}} _ {k, i} ^ {(t + 1)} \leq \widehat {\boldsymbol {\Xi}} _ {k, i} ^ {(t)} \left(1 + \mathcal {O} (1) \frac {\eta \sigma_ {\xi} ^ {2} d}{K n _ {2}}\right). \tag {F.11} +$$ + +We are now ready to prove our theorem. Compare Eq. (F.9) and Eq. (F.11), we can use Lemma D.5 to get an upper bound on $\widehat{\Xi}_{k,i}^{(T^{(2)}}$ . We take $A = \Omega(1)\eta\gamma^J$ , $B = \mathcal{O}(1)\frac{\eta\sigma_{\xi}^2d}{Kn_2}$ , $G = 2$ , $D = m^{-1/2}\gamma^{-J}$ in Lemma D.5. We see that since $\Lambda_1^{(0)} = \Theta(d^{-1/2}) > G^{-A/B} = 2^{-\log(d)^{1.5}}$ under Condition D.1, Lemma D.5 tells us that + +$$ +\widehat {\Xi} _ {k, i} ^ {(T ^ {(2)})} \leq \mathcal {O} (\widehat {\Xi} _ {k, i} ^ {(0)}). +$$ + +This proves our main theorem. + +![](images/ebb430b902b16d77a72b29178bce8784757575d6e1e89d03db2b45376e48267d.jpg) + +It remains to verify our previous hypothesis. Note that if we suppose all of our hypothesis hold at time $t < T^{(2)}$ , then Theorem F.9 implies that for all $(k,i) \in \Psi$ we have $\widehat{\Xi}_{k,i}^{(t + 1)} \leq \mathcal{O}(\widehat{\Xi}_{k,i}^{(0)})$ . By Lemma D.2, it is clear that Hypothesis F.5 and F.6 hold at initialization. + +Proof of Hypothesis F.5. The proof will be similar to the proof of Hypothesis E.2. Let $k \in [K]$ and $i \in [n]$ be such that $y_{k,i} = 1$ . Recall Eq. (C.7) and that + +$$ +\begin{array}{l} \sum_ {j = \pm 1} \sum_ {r = 1} ^ {m} j \left(\sigma \left(\left\langle \mathbf {w} _ {j, r} ^ {(t + 1, \tau)}, \boldsymbol {\xi} _ {k, i} \right\rangle\right) + \sigma \left(\left\langle \mathbf {w} _ {j, r} ^ {(t + 1, \tau)}, \boldsymbol {\nu} _ {k} \right\rangle\right)\right) \\ \leq \sum_ {r = 1} ^ {m} \left(\sigma \left(\left\langle \mathbf {w} _ {1, r} ^ {(t + 1, \tau)}, \boldsymbol {\xi} _ {k, i} \right\rangle\right) + \sigma \left(\left\langle \mathbf {w} _ {1, r} ^ {(t + 1, \tau)}, \boldsymbol {\nu} _ {k} \right\rangle\right)\right). \tag {F.12} \\ \end{array} +$$ + +Assume our Hypothesis hold at time $t$ . We have + +$$ +\begin{array}{l} \sum_ {r = 1} ^ {m} \sigma \left(\left\langle \mathbf {w} _ {1, r} ^ {(t + 1, 0)}, \boldsymbol {\xi} _ {k, i} \right\rangle\right) \leq \sum_ {r = 1} ^ {m} \sigma \left(\widehat {\Xi} _ {k, i} ^ {(t + 1)}\right) \\ \leq m \sigma \left(\mathcal {O} \left(\widehat {\Xi} _ {k, i} ^ {(0)}\right)\right) \\ = o (1), \tag {F.13} \\ \end{array} +$$ + +where the first inequality is by definition of $\widehat{\Xi}_{k,i}^{(t + 1)}$ and the second inequality is because $\widehat{\Xi}_{k,i}^{(t + 1)}\leq \mathcal{O}(\widehat{\Xi}_{k,i}^{(0)})$ . The third equality is because $m = \mathrm{polylog}(d)$ and $\sigma \bigl (\mathcal{O}(\widehat{\Xi}_{k,i}^{(0)})\bigr) = \widetilde{\mathcal{O}} (d^{-1})$ . For any $r\in [m]$ , we have + +$$ +\begin{array}{l} \left\langle \mathbf {w} _ {1, r} ^ {(t + 1, 0)}, \boldsymbol {\nu} _ {k} \right\rangle = \left\langle \mathbf {w} _ {1, r} ^ {(t + 1, 0)}, \boldsymbol {\nu} \right\rangle + \left\langle \mathbf {w} _ {1, r} ^ {(t + 1, 0)}, \mathbf {z} _ {k} \right\rangle \\ \leq \boldsymbol {\Lambda} _ {1} ^ {(t + 1)} + \max _ {r ^ {\prime} \in [ m ]} \left\langle \mathbf {w} _ {1, r ^ {\prime}} ^ {(t + 1, 0)}, \mathbf {z} _ {k} \right\rangle \\ \leq \mathcal {O} (1) \boldsymbol {\Lambda} _ {1} ^ {(t + 1)} \\ \leq \mathcal {O} (1) \boldsymbol {\Lambda} _ {1} ^ {(T ^ {(2)})} \\ = \mathcal {O} \big (m ^ {- 1 / 2} (1 + \gamma) ^ {- J} \big), \\ \end{array} +$$ + +where the second line is by definition of $\Lambda_1^{(t + 1)}$ . The third line is by Lemma F.1. The fourth line is because $t + 1 \leq T^{(2)}$ and $\Lambda_1^{(t)}$ is increasing in $t$ . The last line is by definition of $T^{(2)}$ . Thus + +$$ +\sum_ {r = 1} ^ {m} \sigma \left(\left\langle \mathbf {w} _ {1, r} ^ {(t + 1, \tau)}, \boldsymbol {\nu} _ {k} \right\rangle \leq m \cdot \mathcal {O} \left(m ^ {- 1 / 2} (1 + \gamma) ^ {- J}\right) = o (1). \right. \tag {F.14} +$$ + +Combining Eq. (C.7), Eq. (F.12), Eq. (F.13), and Eq. (F.14), we have + +$$ +- \ell_ {k, i} ^ {\prime (t + 1, 0)} \geq - \ell^ {\prime} (o (1) + o (1)) = \Omega (1). +$$ + +Now, suppose that $-\ell_{k,i}^{\prime (t + 1,\tau)} = \Omega (1)$ for some $0\leq \tau \leq J - 1$ . We wish to show that $-\ell_{k,i}^{\prime (t + 1,\tau +1)} = \Omega (1)$ . By Eq. (F.8), we know that for $i > n_1$ , we have + +$$ +\begin{array}{l} \langle \mathbf {w} _ {1, r} ^ {(t + 1, \tau + 1)}, \boldsymbol {\xi} _ {k, i} \rangle \leq \mathcal {O} \left(\max \left\{\langle \mathbf {w} _ {1, r} ^ {(t + 1, 0)}, \boldsymbol {\xi} _ {k, i} \rangle , C \right\}\right) \\ \leq \mathcal {O} \left(\max \left\{\Xi_ {k, i} ^ {(t + 1)}, C \right\}\right) \\ = \mathcal {O} \left(\widehat {\Xi} _ {k, i} ^ {(t + 1)}\right), \\ \end{array} +$$ + +where the second and third line are by definition of $\Xi_{k,i}^{(t + 1)}$ and $\widehat{\Xi}_{k,i}^{(t + 1)}$ respectively. This gives + +$$ +\begin{array}{l} \sum_ {r = 1} ^ {m} \sigma \left(\left\langle \mathbf {w} _ {1, r} ^ {(t + 1, \tau + 1)}, \boldsymbol {\xi} _ {k, i} \right\rangle\right) \leq \sum_ {r = 1} ^ {m} \sigma \left(\mathcal {O} \left(\widehat {\Xi} _ {k, i} ^ {(t + 1)}\right)\right) \\ \leq m \sigma \left(\mathcal {O} \left(\widehat {\Xi} _ {k, i} ^ {(0)}\right)\right) \\ = o (1), \tag {F.15} \\ \end{array} +$$ + +where the second inequality is because $\widehat{\Xi}_{k,i}^{(t + 1)}\leq \mathcal{O}(\widehat{\Xi}_{k,i}^{(0)})$ . If $i\in [n_1]$ , then by Eq. (C.4) we can bound + +$$ +\begin{array}{l} \langle \mathbf {w} _ {1, r} ^ {(t + 1, \tau + 1)}, \pmb {\xi} _ {k, i} \rangle \leq \langle \mathbf {w} _ {1, r} ^ {(t + 1, \tau)}, \pmb {\xi} _ {k, i} \rangle + \gamma \Theta (\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}) + \frac {\gamma}{n _ {1}} \Theta (\sigma_ {\xi} ^ {2} d) \sigma^ {\prime} (\langle \mathbf {w} _ {1, r} ^ {(t + 1, \tau)}, \pmb {\xi} _ {k, i} \rangle) \\ \leq \left| \left\langle \mathbf {w} _ {1, r} ^ {(t + 1, \tau)}, \boldsymbol {\xi} _ {k, i} \right\rangle \right| \left(1 + \gamma \Theta \left(\sigma_ {\xi} ^ {2} d\right) / n _ {1}\right) + \gamma \Theta \left(\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}\right) \\ \leq \max \left\{\left| \langle \mathbf {w} _ {1, r} ^ {(t + 1, \tau)}, \boldsymbol {\xi} _ {k, i} \rangle \right|, C \right\} \left(1 + \gamma \Theta \left(\sigma_ {\xi} ^ {2} d\right) / n _ {1}\right), \\ \end{array} +$$ + +where we used $-\ell'(\cdot) \leq 1$ and $\sigma'(\cdot) \leq 1$ and Lemma D.2 in the first inequality. And we used $\sigma'(x) \leq 2|x|$ for any $x \in \mathbb{R}$ to get the second inequality. This implies + +$$ +\begin{array}{l} \max \left\{\left| \langle \mathbf {w} _ {1, r} ^ {(t + 1, \tau + 1)}, \boldsymbol {\xi} _ {k, i} \rangle \right|, C \right\} \leq \max \left\{\left| \langle \mathbf {w} _ {1, r} ^ {(t + 1, \tau)}, \boldsymbol {\xi} _ {k, i} \rangle \right|, C \right\} (1 + \gamma \Theta (\sigma_ {\xi} ^ {2} d) / n _ {1}) \\ \leq \max \left\{\left| \langle \mathbf {w} _ {1, r} ^ {(t + 1, 0)}, \boldsymbol {\xi} _ {k, i} \rangle \right|, C \right\} \left(1 + \gamma \Theta \left(\sigma_ {\xi} ^ {2} d\right) / n _ {1}\right) ^ {\tau + 1} \\ = \widehat {\Xi} _ {k, i} ^ {(t + 1)} \left(1 + \gamma \Theta \left(\sigma_ {\xi} ^ {2} d\right) / n _ {1}\right) ^ {\tau + 1} \\ \leq \mathcal {O} \left(\widehat {\Xi} _ {k, i} ^ {(0)}\right) \left(1 + \gamma \Theta \left(\sigma_ {\xi} ^ {2} d\right) / n _ {1}\right) ^ {\tau + 1} \\ = \tilde {\mathcal {O}} \left(d ^ {- 1 / 2}\right), \\ \end{array} +$$ + +where the third line is by definition of $\widehat{\Xi}_{k,i}^{(t + 1)}$ . The fourth line is because $\widehat{\Xi}_{k,i}^{(t + 1)} \leq \mathcal{O}(\widehat{\Xi}_{k,i}^{(0)})$ . And the last equality is by direct calculation. Thus + +$$ +\langle \mathbf {w} _ {1, r} ^ {(t + 1, \tau + 1)}, \boldsymbol {\xi} _ {k, i} \rangle \leq \max \left\{\left| \langle \mathbf {w} _ {1, r} ^ {(t + 1, \tau + 1)}, \boldsymbol {\xi} _ {k, i} \rangle \right|, C \right\} \leq \widetilde {\mathcal {O}} (d ^ {- 1 / 2}). +$$ + +This gives + +$$ +\sum_ {r = 1} ^ {m} \sigma \left(\left\langle \mathbf {w} _ {1, r} ^ {(t + 1, \tau + 1)}, \boldsymbol {\xi} _ {k, i} \right\rangle\right) \leq \sum_ {r = 1} ^ {m} \sigma \left(\widetilde {\mathcal {O}} \left(d ^ {- 1 / 2}\right)\right) = m \cdot \sigma \left(\widetilde {\mathcal {O}} \left(d ^ {- 1 / 2}\right)\right) = o (1). +$$ + +Using Eq. (C.5), we have + +$$ +\begin{array}{l} \langle \mathbf {w} _ {1, r} ^ {(t + 1, \tau + 1)}, \boldsymbol {\nu} _ {k} \rangle \leq \langle \mathbf {w} _ {1, r} ^ {(t + 1, \tau)}, \boldsymbol {\nu} _ {k} \rangle + \gamma \Theta (1) | \langle \mathbf {w} _ {1, r} ^ {(t + 1, \tau)}, \boldsymbol {\nu} _ {k} \rangle | \\ \leq \left| \left\langle \mathbf {w} _ {1, r} ^ {(t + 1, \tau)}, \boldsymbol {\nu} _ {k} \right\rangle \right| (1 + \Theta (1) \gamma) \\ \leq \left| \left\langle \mathbf {w} _ {1, r} ^ {(t + 1, 0)}, \boldsymbol {\nu} _ {k} \right\rangle \right| (1 + \Theta (1) \gamma) ^ {\tau + 1} \\ \leq \left| \left\langle \mathbf {w} _ {1, r} ^ {(t + 1, 0)}, \boldsymbol {\nu} _ {k} \right\rangle \right| (1 + \Theta (1) \gamma) ^ {J} \\ \leq \mathcal {O} (m ^ {- 1 / 2} (1 + \gamma) ^ {- J}) (1 + \Theta (1) \gamma) ^ {J} \\ = \mathcal {O} \left(m ^ {- 1 / 2}\right), \tag {F.16} \\ \end{array} +$$ + +where we used $\ell'(\cdot) \leq 1$ , $\sigma'(x) \leq 2|x|$ for any $x \in \mathbb{R}$ and $\|\pmb{\nu}_k\|_2 = \Theta(1)$ in the first inequality. The fifth inequality is by $t + 1 \leq T^{(2)}$ and the definition of $T^{(2)}$ . Then we have + +$$ +\sum_ {r = 1} ^ {m} \sigma \left(\left\langle \mathbf {w} _ {1, r} ^ {(t + 1, \tau + 1)}, \boldsymbol {\nu} _ {k} \right\rangle \leq m \cdot \mathcal {O} (m ^ {- 1}) = \mathcal {O} (1) . \right. \tag {F.17} +$$ + +The inequality is because $\sigma(\mathcal{O}(m^{-1/2})) = \mathcal{O}(m^{-1})$ . Combining Eq. (C.7), Eq. (F.12), Eq. (F.15), and Eq. (F.17) we obtain + +$$ +- \ell_ {k, i} ^ {\prime (t + 1, \tau + 1)} \geq - \ell^ {\prime} (\mathcal {O} (1) + o (1)) = \Omega (1). +$$ + +This proves the hypothesis. + +Proof of Hypothesis F.6. By Eq. (F.16), we have that $\langle \mathbf{w}_{1,r}^{(t + 1,\tau)},\pmb {\nu}_k\rangle < \mathcal{O}(m^{-1 / 2})$ . Thus if $\langle \mathbf{w}_{1,r}^{(t + 1,\tau)},\pmb {\nu}_k\rangle >0$ , then + +$$ +\sigma^ {\prime} \left(\left\langle \mathbf {w} _ {1, r} ^ {(t + 1, \tau)}, \boldsymbol {\nu} _ {k} \right\rangle\right) = 2 \left\langle \mathbf {w} _ {1, r} ^ {(t + 1, \tau)}, \boldsymbol {\nu} _ {k} \right\rangle , +$$ + +by definition of $\sigma'(\cdot)$ . + +# F.2 PHASE II + +We have shown that when the feature inner product has grown to $\widetilde{\Theta}(1)$ , the noise inner products remain at $\widetilde{\Theta}(d^{-1/2})$ , which is exactly the opposite of Theorem E.2. Next we will show that this difference is maintained at least when $\Lambda_j^{(t)}$ has grown to $\mathcal{O}(\log(d)^{0.1})$ . For $(k, i) \in \Psi$ , let + +$$ +\widetilde {\Xi} _ {k, i} ^ {(t)} = \max \left\{\max _ {r \in [ m ]} \left\{\langle \mathbf {w} _ {y _ {k, i}, r} ^ {(t, 0)}, \pmb {\xi} _ {k, i} \rangle \right\}, d ^ {- 1 / 3} \right\}. +$$ + +And + +$$ +\widetilde {\Gamma} _ {k, i} ^ {(t)} = \max \left\{\max _ {r \in [ m ]} \left\{\langle \mathbf {w} _ {- y _ {k, i}, r} ^ {(t, 0)}, \pmb {\xi} _ {k, i} \rangle \right\}, C \right\}. +$$ + +Let $T_{j}^{(3)}$ be the first iteration such that $\Lambda_{j}^{(t)} \geq \log(d)^{0.1}$ . Let $T^{(3)} = \max \left\{T_{-1}^{(3)}, T_{1}^{(3)}\right\}$ . And recall $T = \mathrm{poly}(d)$ is the total number of iterations. We first present two claims under Condition D.1 and Condition 4.1. + +Claim F.10. For any $t \geq T^{(2)}$ , any $(k,i) \in \Psi$ , we have $\widetilde{\Gamma}_{k,i}^{(t)} \leq \widetilde{\Theta}(d^{-1/2})$ . + +Claim F.11. For any $t \leq T_j^{(3)}$ , $(k,i) \in \Psi_j$ , we have $\widetilde{\Xi}_{k,i}^{(t)} \leq \mathcal{O}(d^{-1/4})$ . + +Remark F.12. Under Claim F.10, it holds that $\widetilde{\Gamma}_{k,i}^{(t)} = o(1)\widetilde{\Xi}_{k',i'}^{(t)}$ for all $(k,i),(k',i')\in \Psi$ . + +Remark F.13. By Theorem F.9, Claim F.10 holds at time $T^{(2)}$ . Also by Theorem F.9, Claim F.11 holds for all $t \leq T^{(2)}$ . + +Note that from Eq. (C.11), the growth of $j\langle \mathbf{w}_{j,r}^{(t,0)},\pmb {\nu}\rangle$ depends on the size of $j\langle \mathbf{w}_{j,r}^{(t,J)},\pmb {\nu}_k\rangle$ . We first need a lemma that can gives a lower bound on $j\langle \mathbf{w}_{j,r}^{(t,J)},\pmb {\nu}_k\rangle$ for $t\geq T^{(2)}$ . The following lemma will be of a similar form to Lemma E.7. + +Lemma F.14. For any $T_{j}^{(3)} \geq t \geq T^{(2)}$ , let $r(t) = \arg \max_{r \in [m]} j\langle \pmb{w}_{j,r}^{(t,0)}, \pmb{\nu} \rangle$ . Assume Claim F.11 holds, then $j\langle \pmb{w}_{j,r(t)}^{(t,J)}, \pmb{\nu}_k \rangle \geq \Omega(m^{-1/2})$ for any $k \in [K]$ . + +Proof. For simplicity, take $j = 1$ . We shall see that our proof does not depend on the choice of $j$ and thus taking $j = 1$ is not a loss of generality. By Eq. (C.5), we know that $\langle \mathbf{w}_{1,r(t)}^{(t,\tau)}, \pmb{\nu}_k \rangle$ is an increasing function of $\tau$ . Thus if $\langle \mathbf{w}_{1,r(t)}^{(t,0)}, \pmb{\nu}_k \rangle = \Omega(m^{-1/2})$ , then we must have $\langle \mathbf{w}_{1,r(t)}^{(t,J)}, \pmb{\nu}_k \rangle \geq \Omega(m^{-1/2})$ . By Eq. (C.11) and the definition of $r(t)$ , we also have that $\langle \mathbf{w}_{1,r(t)}^{(t,0)}, \pmb{\nu} \rangle$ is an increasing function in $t$ . By definition of $T^{(2)}$ , for any $t \geq T^{(2)}$ , it holds that $\langle \mathbf{w}_{1,r(t)}^{(t,0)}, \pmb{\nu} \rangle \geq m^{-1/2}(1 + \gamma)^{-J}$ . Then by Lemma F.2, we have $\langle \mathbf{w}_{1,r(t)}^{(t,0)}, \pmb{\nu}_k \rangle \geq \mathcal{O}(1)m^{-1/2}(1 + \gamma)^{-J}$ . It suffices to prove that if + +$$ +m ^ {- 1 / 2} (1 + \gamma) ^ {- \tau} \leq \left\langle \mathbf {w} _ {1, r (t)} ^ {(t, 0)}, \boldsymbol {\nu} _ {k} \right\rangle \leq m ^ {- 1 / 2} (1 + \gamma) ^ {- \tau + 1}, \tag {F.18} +$$ + +for $\tau \in [J]$ , then $\langle \mathbf{w}_{1,r(t)}^{(t,J)},\pmb{\nu}_k\rangle \geq \Omega (m^{-1 / 2})$ . Let us suppose that F.18 is true for some $\tau$ . Under our assumption that $\widetilde{\Xi}_{k,i}^{(t)}\leq \mathcal{O}(d^{-1 / 4})$ , we can apply the same proof as Hypothesis F.5 to get that $-\ell_{k,i}^{\prime (t,\tau ')} = \Omega (1)$ for any $\tau^{\prime}\in [\tau ]$ . Then using the same derivation of Eq. (F.7), we obtain + +$$ +\langle \mathbf {w} _ {1, r (t)} ^ {(t, \tau)}, \boldsymbol {\nu} _ {k} \rangle = \Omega (1) \langle \mathbf {w} _ {1, r (t)} ^ {(t, 0)}, \boldsymbol {\nu} \rangle (1 + \Theta (1) \gamma) ^ {\tau} \geq m ^ {- 1 / 2} (1 + \gamma) ^ {- \tau} \Omega (1) (1 + \Theta (1) \gamma) ^ {\tau} = \Omega (1) m ^ {- 1 / 2}. +$$ + +This concludes the lemma. + +![](images/c554bf60ded1340f478f67691a9288956b84478d81a4ce0ae9349275b444dd32.jpg) + +The next lemma shows that as long as the noise vectors have not been learnt well by our network, the loss from different samples are essentially due to the feature and hence are of similar sizes. + +Lemma F.15. Let $j \in \{-1, 1\}$ . Under Condition D.1 and Condition 4.1, while $\widetilde{\Xi}_{k,i}^{(t)} \leq \mathcal{O}(d^{-1/4})$ and $\widetilde{\Gamma}_{k,i}^{(t)} \leq \mathcal{O}(d^{-1/2})$ for all $(k,i) \in \Psi_j$ , and $m\sigma_s^2 d\Lambda_j^{(t)} \leq \mathcal{O}(1)$ , we have $\ell_{k_1,i_1}^{\prime(t,J)} = \Theta(1)\ell_{k_2,i_2}^{\prime(t,J)}$ if $(k_1,i_1),(k_2,i_2) \in \Psi_j$ . + +Proof. Without loss of generality, assume $y_{k_1,i_1} = y_{k_2,i_2} = j = 1$ . We can essentially use the proof of Hypothesis F.5 to get that + +$$ +\sum_ {r = 1} ^ {m} \sigma \left(\left\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k _ {q}, i _ {q}} \right\rangle\right) = o (1), \tag {F.19a} +$$ + +$$ +\sum_ {r = 1} ^ {m} \sigma \left(\left\langle \mathbf {w} _ {- 1, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k _ {q}, i _ {q}} \right\rangle\right) = o (1), \tag {F.19b} +$$ + +for $q \in \{1,2\}$ . Moreover, since $j\langle \mathbf{w}_{j,r}^{(t,\tau)}, \pmb{\nu}_k\rangle$ is increasing in $t$ and $\tau$ for any $j \in \{-1,1\}, r \in [m], k \in [K]$ , we get that $\langle \mathbf{w}_{-1,r}^{(t,J)}, \pmb{\nu}_k\rangle \leq \langle \mathbf{w}_{-1,r}^{(0,0)}, \pmb{\nu}_k\rangle \leq \mathcal{O}(d^{-1/2})$ . This implies + +$$ +\sum_ {r = 1} ^ {m} \sigma (\langle \mathbf {w} _ {- 1, r} ^ {(t, J)}, \boldsymbol {\nu} _ {k _ {q}} \rangle) = o (1), +$$ + +for $q\in \{1,2\}$ . By Eq. (C.7), it suffices to show that + +$$ +\left| \sum_ {r = 1} ^ {m} \sigma (\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \pmb {\nu} _ {k _ {1}} \rangle) - \sigma (\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \pmb {\nu} _ {k _ {2}} \rangle) \right| \leq \mathcal {O} (1). +$$ + +We divide the weights into two sets. Let $\mathcal{G} = \{r\in [m]:\langle \mathbf{w}_{1,r}^{(t,0)},\pmb {\nu}\rangle \geq d^{-1 / 3}\}$ , and $\mathcal{H} = \{r\in [m]:r\notin \mathcal{G}\}$ . Let us first consider $r\in \mathcal{G}$ . By Corollary F.5, we have that + +$$ +\left\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \mathbf {z} _ {k _ {q}} \right\rangle = \mathcal {O} \left(\sigma_ {s} ^ {2} d\right) \left\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\nu} \right\rangle , +$$ + +for $q\in \{1,2\}$ , which implies + +$$ +\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\nu} _ {k _ {q}} \rangle = (1 + \mathcal {O} (\sigma_ {s} ^ {2} d)) \langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\nu} \rangle . +$$ + +Moreover, by Lemma F.6 we get + +$$ +\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\nu} _ {k _ {q}} \rangle \leq \langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\nu} \rangle + \mathcal {O} (\sigma_ {s} ^ {2} d) 2 \max \left\{\boldsymbol {\Lambda} _ {1} ^ {(t)}, J \gamma \right\}. +$$ + +By a direct calculation, we have $m\sigma_s^2 dJ\gamma = o(1)$ and by assumption $m\sigma_s^2 d\pmb{\Lambda}_1^{(t)} \leq \mathcal{O}(1)$ . We can then calculate + +$$ +\begin{array}{l} \sum_ {r \in \mathcal {G}} \sigma \left(\left\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\nu} _ {k _ {q}} \right\rangle\right) \leq \sum_ {r \in \mathcal {G}} \sigma \left(\left\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\nu} \right\rangle + \mathcal {O} \left(\sigma_ {s} ^ {2} d\right) 2 \max \left\{\boldsymbol {\Lambda} _ {1} ^ {(t)}, J \gamma \right\}\right) \\ \leq \sum_ {r \in \mathcal {G}} \sigma (\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \pmb {\nu} \rangle) + \sum_ {r \in \mathcal {G}} \mathcal {O} (1) \mathcal {O} (\sigma_ {s} ^ {2} d) 2 \max \left\{\pmb {\Lambda} _ {1} ^ {(t)}, J \gamma \right\} \\ \leq \sum_ {r \in \mathcal {G}} \sigma (\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\nu} \rangle) + m \mathcal {O} (\sigma_ {s} ^ {2} d) 2 \max \left\{\boldsymbol {\Lambda} _ {1} ^ {(t)}, J \gamma \right\} \\ \leq \sum_ {r \in \mathcal {G}} \sigma \left(\left\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\nu} \right\rangle\right) + \mathcal {O} (1), \tag {F.20} \\ \end{array} +$$ + +where in the second line we used $\sigma(x + \varepsilon) \leq \sigma(x) + \mathcal{O}(1)\varepsilon$ for $\varepsilon \geq 0$ . The third line is due to $|\mathcal{G}| \leq m$ . If $r \in \mathcal{H}$ , then by Lemma F.3 we have $\langle \mathbf{w}_{1,r}^{(t,0)}, \mathbf{z}_{k_q} \rangle < d^{-1/3}$ . Then by Eq. (C.5) we have + +$$ +\left| \langle \mathbf {w} _ {1, r} ^ {(t, \tau + 1)}, \boldsymbol {\nu} _ {k _ {q}} \rangle \right| \leq \left| \langle \mathbf {w} _ {1, r} ^ {(t, \tau)}, \boldsymbol {\nu} _ {k _ {q}} \rangle \right| (1 + \mathcal {O} (1) \gamma), +$$ + +for $\tau \in [J - 1]$ . Hence + +$$ +\begin{array}{l} \left| \langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\nu} _ {k _ {q}} \rangle \right| \leq \left| \langle \mathbf {w} _ {1, r} ^ {(t, 0)}, \boldsymbol {\nu} _ {k _ {q}} \rangle \right| (1 + \mathcal {O} (1) \gamma) ^ {J} \\ \leq \widetilde {\mathcal {O}} \left(d ^ {- 1 / 3}\right). \tag {F.21} \\ \end{array} +$$ + +Combining the above results, we finally have + +$$ +\sum_ {r = 1} ^ {m} \sigma \left(\left\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\nu} _ {k _ {q}} \right\rangle\right) = \sum_ {r \in \mathcal {G}} \sigma \left(\left\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\nu} _ {k _ {q}} \right\rangle\right) + \sum_ {r \in \mathcal {H}} \sigma \left(\left\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\nu} _ {k _ {q}} \right\rangle\right) +$$ + +$$ +\begin{array}{l} \leq \sum_ {r \in \mathcal {G}} \sigma (\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\nu} \rangle) + \mathcal {O} (1) + \sum_ {r \in \mathcal {H}} \sigma \big (\widetilde {\mathcal {O}} \left(d ^ {- 1 / 3}\right) \big) \\ \leq \sum_ {r \in \mathcal {G}} \sigma (\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\nu} \rangle) + \mathcal {O} (1) + m \sigma (\widetilde {\mathcal {O}} (d ^ {- 1 / 3})) \\ = \sum_ {r \in \mathcal {G}} \sigma (\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\nu} \rangle) + \mathcal {O} (1) + o (1) \\ = \sum_ {r \in \mathcal {G}} \sigma \left(\left\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\nu} \right\rangle\right) + \mathcal {O} (1), \tag {F.22} \\ \end{array} +$$ + +where the second line is due to Eq. (F.20) and Eq. (F.21). Since the above holds for $q \in \{1, 2\}$ , we get + +$$ +\left| \sum_ {r = 1} ^ {m} \sigma \left(\left\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\nu} _ {k _ {1}} \right\rangle\right) - \sigma \left(\left\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\nu} _ {k _ {2}} \right\rangle\right) \right| \leq \mathcal {O} (1) + \mathcal {O} (1) = \mathcal {O} (1). +$$ + +And using Eq. (C.7), we conclude that $\ell_{k_1,i_1}^{\prime (t,J)} = \Theta (1)\ell_{k_2,i_2}^{\prime (t,J)}$ . + +![](images/d216ca99b3755a2a68c7df9793bff33dcde293b509fed73c09123308f28ddb0e.jpg) + +Lemma F.16. Under Claim F.11, for any $t \leq T_j^{(3)}$ we have $-\ell_{k,i}^{\prime (t,J)} = \omega (d^{-1 / 8})$ for all $(k,i) \in \Psi_j$ . + +Proof. Without loss of generality, let us consider $j = 1$ . Let $(k,i) \in \Psi_{+}$ . By Eq. (C.7), Eq. (F.19) and Eq. (F.22) we have that + +$$ +\begin{array}{l} - \ell_ {k, i} ^ {\prime (t, J)} \geq - \ell^ {\prime} \left(\sum_ {r \in \mathcal {G}} \sigma \left(\left\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\nu} \right\rangle\right) + \mathcal {O} (1)\right) \\ \geq - \ell^ {\prime} \Big (\sum_ {r \in [ m ]} \sigma \left(\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\nu} \rangle\right) + \mathcal {O} (1) \Big), \\ \end{array} +$$ + +where in the first line $\mathcal{G} = \left\{r\in [m]:\langle \mathbf{w}_{1,r}^{(t,0)},\pmb {\nu}\rangle \geq d^{-1 / 3}\right\}$ . Then recall that $t\leq T_1^{(3)}$ implies $\Lambda_1^{(t)} < \log (d)^{0.1}$ . Using Lemma F.6, we have that for all $r\in [m]$ + +$$ +\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\nu} \rangle \leq 2 \max \left\{\log (d) ^ {0. 1}, J \gamma \right\} = 2 J \gamma . +$$ + +Then by a direct calculation using Condition D.1, we get + +$$ +\begin{array}{l} - \ell_ {k, i} ^ {\prime (t, J)} \geq - \ell^ {\prime} \left(m \mathcal {O} (1) J \gamma + \mathcal {O} (1)\right) \\ = \omega \left(d ^ {- 1 / 8}\right). \\ \end{array} +$$ + +![](images/bc4f80719b59bdc15e2707d16b19ff9872e540541219d0602073d6c27ae33d0f.jpg) + +Remark F.17. The $-1/8$ factor on $d$ can be replaced by any $c < 0$ . We choose $-1/8$ for convenience in the later proof. + +Proof of Claim F.11. Consider $T^{(2)} \leq t \leq T_1^{(3)}$ . Let $\widetilde{\Xi}_1^{(t)} = \max \left\{\widetilde{\Xi}_{k,i}^{(t)} : (k,i) \in \Psi_+\right\}$ . By Eq. (F.8) and the definition of $\widetilde{\Xi}_{k,i}^{(t)}$ , we have that for any $(k,i) \in \Psi_+$ , + +$$ +\sigma^ {\prime} \left(\left\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k, i} \right\rangle\right) \leq \mathcal {O} (1) \tilde {\Xi} _ {k, i} ^ {(t)} \leq \mathcal {O} (1) \tilde {\Xi} _ {1} ^ {(t)}. \tag {F.23} +$$ + +And if $(k,i)\in \Psi_{-}$ + +$$ +\sigma^ {\prime} \left(\left\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k, i} \right\rangle\right) \leq \mathcal {O} (1) \widetilde {\boldsymbol {\Gamma}} _ {k, i} ^ {(t)} = o (1) \widetilde {\boldsymbol {\Xi}} _ {1} ^ {(t)}, \tag {F.24} +$$ + +where we note the second inequality in Remark F.12. It is convenient to define + +$$ +\ell_ {1} ^ {\left(t, J\right)} = \sum_ {(k, i) \in \Psi_ {+}} \ell_ {k, i} ^ {\left(t, J\right)} / \left| \Psi_ {+} \right|, +$$ + +because by Lemma F.15, $\ell_{k,i}^{\prime (t,J)} = \Theta (1)\ell_1^{\prime (t,J)}$ for all $(k,i)\in \Psi_{+}$ . Then by our assumption that $t\leq T_1^{(3)}$ and Lemma F.16 we have that $-\ell_1^{\prime (t,J)} = \omega (d^{-1 / 8})$ . By Eq. (C.9) we have that for any $r\in [m]$ , and $(k,i)\in \Psi_{+}$ + +$$ +\begin{array}{l} \langle \mathbf {w} _ {1, r} ^ {(t + 1, 0)}, \pmb {\xi} _ {k, i} \rangle \leq \langle \mathbf {w} _ {1, r} ^ {(t, 0)}, \pmb {\xi} _ {k, i} \rangle - \frac {\eta}{K n _ {2}} \sum_ {(k ^ {\prime}, i ^ {\prime}) \in \Psi} \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \pmb {\xi} _ {k ^ {\prime}, i ^ {\prime}} \rangle) \Theta (\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}) \\ - \frac {\eta}{K n _ {2}} \Theta (1) \ell_ {1} ^ {\prime (t, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \pmb {\xi} _ {k, i} \rangle) \Theta (\sigma_ {\xi} ^ {2} d) \\ \leq \widetilde {\Xi} _ {1} ^ {(t)} - \Theta \Big (\frac {\eta \sigma_ {\xi} ^ {2} \sqrt {d}}{K n _ {2}} \Big) \sum_ {(k ^ {\prime}, i ^ {\prime}) \in \Psi} \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \pmb {\xi} _ {k ^ {\prime}, i ^ {\prime}} \rangle) - \Theta \Big (\frac {\eta \sigma_ {\xi} ^ {2} d}{K n _ {2}} \Big) \ell_ {1} ^ {\prime (t, J)} \widetilde {\Xi} _ {1} ^ {(t)} \\ \leq \widetilde {\Xi} _ {1} ^ {(t)} - \Theta \Big (\frac {\eta \sigma_ {\xi} ^ {2} \sqrt {d}}{K n _ {2}} \Big) \sum_ {(k ^ {\prime}, i ^ {\prime}) \in \Psi_ {+}} \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \pmb {\xi} _ {k ^ {\prime}, i ^ {\prime}} \rangle) \\ - \Theta \Big (\frac {\eta \sigma_ {\xi} ^ {2} \sqrt {d}}{K n _ {2}} \Big) \sum_ {(k ^ {\prime}, i ^ {\prime}) \in \Psi_ {-}} \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {1, r} ^ {(t, J)}, \pmb {\xi} _ {k ^ {\prime}, i ^ {\prime}} \rangle) - \Theta \Big (\frac {\eta \sigma_ {\xi} ^ {2} d}{K n _ {2}} \Big) \ell_ {1} ^ {\prime (t, J)} \widetilde {\Xi} _ {1} ^ {(t)} \\ \leq \widetilde {\Xi} _ {1} ^ {(t)} - \Theta \Big (\frac {\eta \sigma_ {\xi} ^ {2} \sqrt {d}}{K n _ {2}} \Big) \sum_ {(k ^ {\prime}, i ^ {\prime}) \in \Psi_ {+}} \ell_ {1} ^ {\prime (t, J)} \widetilde {\Xi} _ {1} ^ {(t)} \\ + \Theta \Big (\frac {\eta \sigma_ {\xi} ^ {2} \sqrt {d}}{K n _ {2}} \Big) \sum_ {(k ^ {\prime}, i ^ {\prime}) \in \Psi_ {-}} o (1) \widetilde {\Xi} _ {1} ^ {(t)} - \Theta \Big (\frac {\eta \sigma_ {\xi} ^ {2} d}{K n _ {2}} \Big) \ell_ {1} ^ {\prime (t, J)} \widetilde {\Xi} _ {1} ^ {(t)} \\ \leq \widetilde {\Xi} _ {1} ^ {(t)} - \left(\widetilde {\Theta} (d ^ {- 1 / 2}) + \Theta \left(\frac {\eta \sigma_ {\xi} ^ {2} d}{K n _ {2}}\right)\right) \ell_ {1} ^ {\prime (t, J)} \widetilde {\Xi} _ {1} ^ {(t)} + o (d ^ {- 1 / 2}) \widetilde {\Xi} _ {1} ^ {(t)} \\ = \widetilde {\Xi} _ {1} ^ {(t)} \Big (1 - \Theta \Big (\frac {\eta \sigma_ {\xi} ^ {2} d}{K n _ {2}} \Big) \ell_ {1} ^ {\prime (t, J)} + o (d ^ {- 1 / 2}) \Big) \\ = \widetilde {\Xi} _ {1} ^ {(t)} \Big (1 - \Theta \Big (\frac {\eta \sigma_ {\xi} ^ {2} d}{K n _ {2}} \Big) \ell_ {1} ^ {\prime (t, J)} \Big), \\ \end{array} +$$ + +where we used Eq. (F.23) to get the second inequality. We used Eq. (F.23) and Eq. (F.24) to get the fourth inequality. The last equality is because $-\Theta \left(\frac{\eta\sigma_{\xi}^{2}d}{Kn_{2}}\right)\ell_{1}^{\prime (t,J)} = \widetilde{\Theta} (1)\omega (d^{-1 / 8})\gg o(d^{-1 / 2}).$ And maximizing the left hand side over $r\in [m]$ and $(k,i)\in \Psi_{+}$ we get + +$$ +\widetilde {\Xi} _ {1} ^ {(t + 1)} \leq \widetilde {\Xi} _ {1} ^ {(t)} \left(1 - \Theta \left(\frac {\eta \sigma_ {\xi} ^ {2} d}{K n _ {2}}\right) \ell_ {1} ^ {\prime (t, J)}\right). \tag {F.25} +$$ + +By Theorem F.9, we have that $\widetilde{\Xi}_1^{(T^{(2)})} = d^{-1 / 3}$ . Let $T^{\prime}$ be the first iteration such that $\widetilde{\Xi}_1^{(T')} \geq d^{-1 / 4}$ . Then, using Eq. (F.25) we get + +$$ +\begin{array}{l} \widetilde {\Xi} _ {1} ^ {(T ^ {\prime})} \leq \widetilde {\Xi} _ {1} ^ {(T ^ {\prime} - 1)} \Big (1 - \Theta \Big (\frac {\eta \sigma_ {\xi} ^ {2} d}{K n _ {2}} \Big) \ell_ {1} ^ {\prime (T ^ {\prime} - 1, J)} \Big) \\ \leq d ^ {- 1 / 4} \left(1 - \Theta \left(\frac {\eta \sigma_ {\xi} ^ {2} d}{K n _ {2}}\right) \ell_ {1} ^ {\prime (T ^ {\prime} - 1, J)}\right) \\ \leq d ^ {- 1 / 4} \left(1 + \Theta \left(\frac {\eta \sigma_ {\xi} ^ {2} d}{K n _ {2}}\right)\right) \\ = \widetilde {\Theta} (d ^ {- 1 / 4}), \\ \end{array} +$$ + +where the second inequality is by definition of $T'$ . The third inequality is due to $-\ell'(\cdot) \leq 1$ . We have + +$$ +d ^ {- 1 / 4} \leq \widetilde {\Xi} _ {1} ^ {(T ^ {\prime})} \leq \widetilde {\Xi} _ {1} ^ {(T ^ {(2)})} \prod_ {t = T ^ {(2)}} ^ {T ^ {\prime} - 1} \left(1 - \Theta \left(\frac {\eta \sigma_ {\xi} ^ {2} d}{K n _ {2}}\right) \ell_ {1} ^ {\prime (t, J)}\right), +$$ + +$$ +\begin{array}{l} d ^ {- 1 / 4} / d ^ {- 1 / 3} \leq \prod_ {t = T ^ {(2)}} ^ {T ^ {\prime} - 1} \left(1 - \Theta \left(\frac {\eta \sigma_ {\xi} ^ {2} d}{K n _ {2}}\right) \ell_ {1} ^ {\prime (t, J)}\right), \\ \Omega (\log (d)) \leq \sum_ {t = T ^ {(2)}} ^ {T ^ {\prime} - 1} \log \left(1 - \Theta \left(\frac {\eta \sigma_ {\xi} ^ {2} d}{K n _ {2}}\right) \ell_ {1} ^ {\prime (t, J)}\right) \\ \leq \sum_ {t = T ^ {(2)}} ^ {T ^ {\prime} - 1} - \mathcal {O} (1) \left(\frac {\eta \sigma_ {\xi} ^ {2} d}{K n _ {2}}\right) \ell_ {1} ^ {\prime (t, J)}, \\ \end{array} +$$ + +$$ +\Omega \left(\frac {\log (d) K n _ {2}}{\eta \sigma_ {\xi} ^ {2} d}\right) \leq \sum_ {t = T ^ {(2)}} ^ {T ^ {\prime} - 1} - \ell_ {1} ^ {\prime (t, J)}, \tag {F.26} +$$ + +where we get the third inequality by taking the logarithm of the second inequality. In the fourth inequality, we used $\log (1 + x) \leq \mathcal{O}(1)x$ for $x \in [0, 1)$ . By the second line of Eq. (F.9) we have + +$$ +\begin{array}{l} \boldsymbol {\Lambda} _ {1} ^ {(t + 1)} \geq \boldsymbol {\Lambda} _ {1} ^ {(t)} - \frac {\eta}{K n _ {2}} \sum_ {(k, i) \in \Psi_ {+}} \ell_ {k, i} ^ {\prime (t, J)} \Omega (m ^ {- 1 / 2}) \\ \geq \boldsymbol {\Lambda} _ {1} ^ {(t)} - \eta \ell_ {1} ^ {\prime (t, J)} \Omega (m ^ {- 1 / 2}). \\ \end{array} +$$ + +To get the second inequality, we use Lemma F.15 and absorb all the constants into $\Omega(m^{-1/2})$ . Summing over $t$ , we obtain + +$$ +\log (d) ^ {0. 1} \geq \boldsymbol {\Lambda} ^ {(T _ {1} ^ {(3)} - 1)} \geq \boldsymbol {\Lambda} ^ {(T ^ {(2)})} - \sum_ {t = T ^ {(2)}} ^ {T _ {1} ^ {(3)} - 2} \eta \ell_ {1} ^ {\prime (t, J)} \Omega (m ^ {- 1 / 2}), +$$ + +$$ +\log (d) ^ {0. 1} \geq - \sum_ {t = T ^ {(2)}} ^ {T _ {1} ^ {(3)} - 2} \eta \ell_ {1} ^ {\prime (t, J)} \Omega (m ^ {- 1 / 2}), +$$ + +$$ +\mathcal {O} \Big (\frac {\log (d) ^ {0 . 1} \sqrt {m}}{\eta} \Big) \geq \sum_ {t = T ^ {(2)}} ^ {T _ {1} ^ {(3)} - 2} - \ell_ {1} ^ {\prime (t, J)}, +$$ + +$$ +\mathcal {O} \left(\frac {\log (d) ^ {0 . 1} \sqrt {m} + \eta}{\eta}\right) \geq \sum_ {t = T ^ {(2)}} ^ {T _ {1} ^ {(3)} - 1} - \ell_ {1} ^ {\prime (t, J)}. \tag {F.27} +$$ + +We used $-\ell'(\cdot) \leq 1$ to get the last inequality. By a direct computation, we have + +$$ +\frac {\log (d) ^ {0 . 1} \sqrt {m} + \eta}{\eta} = \frac {\log (d) ^ {0 . 2} + \eta}{\eta} = o (1) \frac {\log (d) K n _ {2}}{\eta \sigma_ {\xi} ^ {2} d} = o (1) \frac {\log (d) ^ {0 . 5}}{\eta}. +$$ + +Combining this fact with Eq. (F.26) and Eq. (F.27) we conclude that $T_1^{(3)} - 1 < T' - 1$ and hence $T_1^{(3)} < T'$ . Now let $\widetilde{\Xi}_{-1}^{(t)} = \max \left\{\widetilde{\Xi}_{k,i}^{(t)} : (k,i) \in \Psi_{-}\right\}$ . If we redefine $T'$ to be the first iteration such that $\widetilde{\Xi}_{-1}^{(T')} \geq d^{-1/4}$ , then using the exactly same argument, we obtain $T_{-1}^{(3)} < T'$ . This proves our Claim. + +Theorem F.18 (Restatement of Lemma 6.5). Under Claim F.10, we have $T^{(3)} < T$ . + +Proof. We will only prove $T_1^{(3)} < T$ , since the proof of $T_{-1}^{(3)} < T$ will be the same. For the sake of contradiction, let us assume that $T_1^{(3)} \geq T$ . Then, for $t \leq T$ , we have that $\Lambda_1^{(t)} \leq \log (d)^{0.1}$ . From the proof of Lemma F.16, we have + +$$ +- \ell_ {k, i} ^ {\prime (t, J)} \geq - \ell^ {\prime} \Big (m \mathcal {O} (1) \gamma J + \mathcal {O} (1) \Big) \geq \Omega (1) \exp (- \mathcal {O} (\log (d) ^ {0. 6})) , +$$ + +for all $(k,i)\in \Psi_{+}$ . By the second line of Eq. (F.9) + +$$ +\boldsymbol {\Lambda} _ {1} ^ {(t + 1)} \geq \boldsymbol {\Lambda} _ {1} ^ {(t)} - \frac {\eta}{K n _ {2}} \sum_ {(k, i) \in \Psi_ {+}} \ell_ {k, i} ^ {\prime (t, J)} \Theta (1) \Omega \left(m ^ {- 1 / 2}\right) +$$ + +$$ +\begin{array}{l} \geq \boldsymbol {\Lambda} _ {1} ^ {(t)} + \frac {\eta}{K n _ {2}} \sum_ {(k, i) \in \Psi_ {+}} \Omega (1) \exp (- \mathcal {O} (\log (d) ^ {0. 6})) \Theta (1) \Omega (m ^ {- 1 / 2}) \\ = \boldsymbol {\Lambda} _ {1} ^ {(t)} + \Omega (1) \eta \exp (- \mathcal {O} (\log (d) ^ {0. 6})) m ^ {- 1 / 2}. \\ \end{array} +$$ + +This implies + +$$ +\begin{array}{l} \boldsymbol {\Lambda} _ {1} ^ {(T)} \geq \boldsymbol {\Lambda} _ {1} ^ {(T ^ {(2)})} + \sum_ {t = T ^ {(2)}} ^ {T - 1} \Omega (1) \eta \exp (- \mathcal {O} (\log (d) ^ {0. 6})) m ^ {- 1 / 2} \\ \geq \widetilde {\Theta} (1) + (T - 1 - T ^ {(2)}) \Omega (1) \eta \exp (- \mathcal {O} (\log (d) ^ {0. 6})) m ^ {- 1 / 2} \\ \geq \operatorname {p o l y} (d) \Omega (1) \exp (- \mathcal {O} (\log (d) ^ {0. 6})) / \operatorname {p o l y} \log (d) \\ = \Omega (\operatorname {p o l y} (d)), \\ \end{array} +$$ + +where the second inequality is by definition of $T^{(2)}$ . The third inequality is because $T = \mathrm{poly}(d)$ , $T^{(2)} = \mathrm{polylog}(d)$ , $\eta = (\mathrm{polylog}(d))^{-1}$ , and $m = \mathrm{polylog}(d)$ . And $\mathrm{poly}(d)\exp (-\mathcal{O}(\log (d)^{0.6})) = \Omega (\mathrm{poly}(d))$ . But this is a contradiction since we assumed $T\leq T_1^{(3)}$ which means $\Lambda_1^{(T)}\leq \log (d)^{0.1}$ . Thus, we must have $T > T_{1}^{(3)}$ . And the proof of $T > T_{-1}^{(3)}$ is the same. This proves our theorem. This will be useful for our convergence result later. + +Theorem F.18 implies that before training ends, feature will be memorized by the neurons with an inner product of size at least $\log (d)^{0.1}$ . As we shall see later, this already guarantees a small test loss. Our next theorem makes sure that the feature inner product will not grow too big by the end of the training. + +Theorem F.19. Under Claim F.10, we have $\Lambda_j^{(T)} \leq \log(d)^{1.2}$ for $j \in \{-1, 1\}$ . + +Proof. Without loss of generality, let $j = 1$ . Let $t'$ be the first iteration such that $\mathbf{\Lambda}_1^{(t)} \geq \log(d)^{1.1}$ . Let $r(t) = \arg \max_{r \in [m]} \left\{ \langle \mathbf{w}_{1,r}^{(t,0)}, \pmb{\nu} \rangle \right\}$ . Using Eq. (C.11) we have + +$$ +\begin{array}{l} \langle \mathbf {w} _ {1, r (t + 1)} ^ {(t + 1, 0)}, \boldsymbol {\nu} \rangle = \langle \mathbf {w} _ {1, r (t + 1)} ^ {(t, 0)}, \boldsymbol {\nu} \rangle - \frac {\eta}{K n _ {2}} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {(t, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {1, r (t + 1)} ^ {(t, J)}, \boldsymbol {\nu} _ {k} \rangle y _ {k, i}) \\ \leq \left\langle \mathbf {w} _ {1, r (t)} ^ {(t, 0)}, \boldsymbol {\nu} \right\rangle - \frac {\eta}{K n _ {2}} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime (t, J)} \sigma^ {\prime} (\left\langle \mathbf {w} _ {1, r (t)} ^ {(t, J)}, \boldsymbol {\nu} _ {k} \right\rangle y _ {k, i}) \\ = \left\langle \mathbf {w} _ {1, r (t)} ^ {(t, 0)}, \boldsymbol {\nu} \right\rangle - \frac {\eta}{K n _ {2}} \sum_ {(k, i) \in \Psi_ {+}} \ell_ {k, i} ^ {\prime (t, J)} \sigma^ {\prime} (\left\langle \mathbf {w} _ {1, r (t)} ^ {(t, J)}, \boldsymbol {\nu} _ {k} \right\rangle) \\ \leq \left\langle \mathbf {w} _ {1, r (t)} ^ {(t, 0)}, \boldsymbol {\nu} \right\rangle - \frac {\eta}{K n _ {2}} \sum_ {(k, i) \in \Psi_ {+}} \ell_ {k, i} ^ {\prime (t, J)}, \\ \end{array} +$$ + +where the second line is by definition of $r(t)$ . We get the third line using the second line of Eq. (F.9). We have used $\sigma'(\cdot) \leq 1$ to get the last line. By definition of $r(t)$ , this means + +$$ +\boldsymbol {\Lambda} _ {1} ^ {(t + 1)} \leq \boldsymbol {\Lambda} _ {1} ^ {(t)} - \frac {\eta}{K n _ {2}} \sum_ {(k, i) \in \Psi_ {+}} \ell_ {k, i} ^ {\prime (t, J)}. +$$ + +And by definition of $t^\prime$ , we have + +$$ +\begin{array}{l} \boldsymbol {\Lambda} _ {1} ^ {(t ^ {\prime})} \leq \boldsymbol {\Lambda} _ {1} ^ {(t ^ {\prime} - 1)} - \frac {\eta}{K n _ {2}} \sum_ {(k, i) \in \Psi_ {+}} \ell_ {k, i} ^ {\prime (t ^ {\prime} - 1, J)} \\ \leq \log (d) ^ {1. 1} + \eta \\ \leq \mathcal {O} (1) \log (d) ^ {1. 1}, \\ \end{array} +$$ + +where we have used $-\ell'(\cdot) \leq 1$ to get the second inequality. Hence if $T \leq t'$ , then we are done. So let us suppose that $T > t'$ . Since $\Lambda_1^{(t)}$ is increasing in $t$ , we know that for all $t \geq t'$ , $\Lambda_1^{(t)} \geq$ + +$\Lambda_1^{(t')}\geq \log (d)^{1.1}$ . By Corollary F.5, we have that $\langle \mathbf{w}_{1,r(t)}^{(t,0)},\pmb {\nu}_k\rangle = \Theta (1)\langle \mathbf{w}_{1,r(t)}^{(t,0)},\pmb {\nu}\rangle$ for any $k\in [K]$ Moreover, for $t\geq t^{\prime}$ + +$$ +\langle \mathbf {w} _ {1, r (t)} ^ {(t, J)}, \pmb {\nu} _ {k} \rangle \geq \langle \mathbf {w} _ {1, r (t)} ^ {(t, 0)}, \pmb {\nu} _ {k} \rangle = \Theta (1) \langle \mathbf {w} _ {1, r (t)} ^ {(t, 0)}, \pmb {\nu} \rangle = \Theta (1) \pmb {\Lambda} _ {1} ^ {(t)} \geq \Theta (1) \log (d) ^ {1. 1}. +$$ + +By Eq. (C.7), for $(k,i)\in \Psi_{+}$ we have + +$$ +\begin{array}{l} - \ell_ {k, i} ^ {\prime (t, J)} \leq - \ell^ {\prime} \left(\sigma \left(\langle \mathbf {w} _ {1, r (t)} ^ {(t, J)}, \boldsymbol {\nu} _ {k} \rangle - \sum_ {r = 1} ^ {m} \left(\sigma \left(\langle \mathbf {w} _ {- 1, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k, i} \rangle\right) + \sigma \left(\langle \mathbf {w} _ {- 1, r} ^ {(t, J)}, \boldsymbol {\nu} _ {k} \rangle\right)\right)\right) \right. \\ \leq - \ell^ {\prime} \left(\Theta (1) \log (d) ^ {1. 1} - o (1)\right) \\ = - \ell^ {\prime} (\Theta (1) \log (d) ^ {1. 1}) \\ \leq \mathcal {O} (1) \exp \left(- \Theta (1) \log (d) ^ {1. 1}\right), \\ \end{array} +$$ + +where the second inequality is due to Eq. (F.19). The last inequality is by property of the function $\ell'(\cdot)$ . This implies + +$$ +\begin{array}{l} \boldsymbol {\Lambda} _ {1} ^ {(T)} \leq \boldsymbol {\Lambda} _ {1} ^ {(t ^ {\prime})} - \frac {\eta}{K n _ {2}} \sum_ {t = t ^ {\prime}} ^ {T - 1} \sum_ {(k, i) \in \Psi_ {+}} \ell_ {k, i} ^ {(t, J)} \\ \leq \mathcal {O} (1) \log (d) ^ {1. 1} + \eta T \mathcal {O} (1) \exp \left(- \Theta (1) \log (d) ^ {1. 1}\right) \\ \leq \mathcal {O} (1) \log (d) ^ {1. 1} + o (1) \\ = \mathcal {O} (1) \log (d) ^ {1. 1}, \\ \end{array} +$$ + +where the second last inequality is because $\eta T = \mathcal{O}(\mathrm{poly}(d) / \mathrm{polylog}(d)) = \mathcal{O}(\mathrm{poly}(d))$ and $\mathcal{O}(\mathrm{poly}(d))\exp \big(-\Theta (1)\log (d)^{1.1}\big) = o(1)$ . This proves our theorem. + +Proof of Claim F.10. Suppose our claim holds for all $t \in [T^{(2)}, T' - 1]$ where $T' \leq T$ . Then by Theorem F.19, we have that $\Lambda_j^{(T')} \leq \log(d)^{1.2}$ for $j \in \{-1, 1\}$ . Let $(k, i) \in \Psi_{-}$ . Denote $r(t) = \arg \max_{r \in [m]} \langle \mathbf{w}_{1,r}^{(t,0)}, \pmb{\xi}_{k,i} \rangle$ . From Eq. (C.9), we get that + +$$ +\begin{array}{l} \langle \mathbf{w}_{1,r}^{(t + 1,0)},\boldsymbol{\xi}_{k,i}\rangle \leq \langle \mathbf{w}_{1,r}^{(t,0)},\boldsymbol{\xi}_{k,i}\rangle -\frac{\eta}{Kn_{2}}\sum_{(k^{\prime},i^{\prime})\in \Psi \setminus \{(k,i)\}}\ell_{k^{\prime},i^{\prime}}^{\prime (t,J)}\Theta (\sigma_{\xi}^{2}\sqrt{d}\sqrt{\log(Kn)}) \\ \leq \langle \mathbf {w} _ {1, r} ^ {(t, 0)}, \boldsymbol {\xi} _ {k, i} \rangle - \frac {\eta}{K n _ {2}} \sum_ {(k ^ {\prime}, i ^ {\prime}) \in \Psi} \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} \Theta (\sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (K n)}) \\ = \left\langle \mathbf {w} _ {1, r} ^ {(t, 0)}, \boldsymbol {\xi} _ {k, i} \right\rangle + \widetilde {\Theta} \left(d ^ {- 1 / 2}\right) \eta \sum_ {\left(k ^ {\prime}, i ^ {\prime}\right) \in \Psi} \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)}, \tag {F.28} \\ \end{array} +$$ + +where we also used Lemma D.2 in the first line. The third line is a direct calculation using Condition D.1. We have for $t \geq T^{(2)}$ + +$$ +\begin{array}{l} \Lambda_ {1} ^ {(t + 1)} \geq \Lambda_ {1} ^ {(t)} - \frac {\eta}{K n _ {2}} \sum_ {(k, i) \in \Psi_ {+}} \ell_ {k, i} ^ {(t, J)} \Theta (1) \widetilde {\Theta} (1) \\ = \Lambda_ {1} ^ {(t)} - \widetilde {\Theta} (1) \eta \sum_ {(k, i) \in \Psi_ {+}} \ell_ {k, i} ^ {\prime (t, J)}, \\ \end{array} +$$ + +where the first inequality is by definition of $T^{(2)}$ and the monotonicity of $\Lambda_1^{(t)}$ . And similarly + +$$ +\Lambda_ {- 1} ^ {(t + 1)} \geq \Lambda_ {- 1} ^ {(t)} - \widetilde {\Theta} (1) \eta \sum_ {(k, i) \in \Psi_ {-}} \ell_ {k, i} ^ {\prime (t, J)}. +$$ + +Summing them up we obtain + +$$ +\boldsymbol {\Lambda} _ {1} ^ {(t + 1)} + \boldsymbol {\Lambda} _ {- 1} ^ {(t + 1)} \geq \boldsymbol {\Lambda} _ {1} ^ {(t)} + \boldsymbol {\Lambda} _ {- 1} ^ {(t)} - \widetilde {\Theta} (1) \eta \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime (t, J)}. +$$ + +Summing over $t$ we get + +$$ +2 \log (d) ^ {1. 2} \geq \boldsymbol {\Lambda} _ {1} ^ {(T ^ {\prime})} + \boldsymbol {\Lambda} _ {- 1} ^ {(T ^ {\prime})} \geq \boldsymbol {\Lambda} _ {1} ^ {(T ^ {(2)})} + \boldsymbol {\Lambda} _ {- 1} ^ {(T ^ {(2)})} - \widetilde {\Theta} (1) \eta \sum_ {t = T ^ {(2)}} ^ {T ^ {\prime} - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime (t, J)}, +$$ + +$$ +2 \log (d) ^ {1. 2} \geq - \widetilde {\Theta} (1) \eta \sum_ {t = T ^ {(2)}} ^ {T ^ {\prime} - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime (t, J)}, +$$ + +$$ +\widetilde {\Theta} (1) \geq - \eta \sum_ {t = T ^ {(2)}} ^ {T ^ {\prime} - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime (t, J)}. \tag {F.29} +$$ + +Plugging Eq. (F.29) into Eq. (F.28) we have + +$$ +\begin{array}{l} \langle \mathbf {w} _ {1, r} ^ {(T ^ {\prime}, 0)}, \boldsymbol {\xi} _ {k, i} \rangle \leq \langle \mathbf {w} _ {1, r} ^ {(T ^ {(2)}, 0)}, \boldsymbol {\xi} _ {k, i} \rangle - \widetilde {\Theta} (d ^ {- 1 / 2}) \eta \sum_ {t = T ^ {(2)}} ^ {T ^ {\prime} - 1} \sum_ {(k ^ {\prime}, i ^ {\prime}) \in \Psi} \ell_ {k ^ {\prime}, i ^ {\prime}} ^ {\prime (t, J)} \\ \leq \langle \mathbf {w} _ {1, r} ^ {(T ^ {(2)}, 0)}, \boldsymbol {\xi} _ {k, i} \rangle + \widetilde {\Theta} (d ^ {- 1 / 2}) \widetilde {\Theta} (1) \\ \leq \widetilde {\Theta} (d ^ {- 1 / 2}) + \widetilde {\Theta} (d ^ {- 1 / 2}) \\ = \widetilde {\Theta} \left(d ^ {- 1 / 2}\right), \\ \end{array} +$$ + +where the third inequality is by Theorem F.9. Since this relation holds for all $r \in [m]$ , we get that $\max_{r \in [m]} \langle \mathbf{w}_{1,r}^{(T',0)}, \pmb{\xi}_{k,i} \rangle \leq \widetilde{\Theta}(d^{-1/2})$ . And hence $\widetilde{\Gamma}_{k,i}^{(T')} \leq \widetilde{\Theta}(d^{-1/2})$ . This proves our claim. + +Lemma F.20 (Restatement of Lemma 6.4). Let $T = \mathrm{poly}(d)$ be the total number of iterations. Under Condition D.1 and Condition 4.1, we have + +$$ +\min _ {t \in [ T ^ {(2)}, T - 1 ]} \sum_ {(k, i) \in \Psi} - \ell_ {k, i} ^ {\prime (t, J)} \leq \widetilde {\mathcal {O}} \left(\frac {1}{T \eta}\right). +$$ + +Proof. By Theorem F.19, we have $\Lambda_j^{(T)} \leq \log(d)^{1.2}$ for $j \in \{-1, 1\}$ . Using the same derivation of Eq. (F.29), we have + +$$ +- \sum_ {t = T ^ {(2)}} ^ {T - 1} \sum_ {(k, i) \in \Psi} \eta \ell_ {k, i} ^ {\prime (t, J)} \leq \widetilde {\Theta} (1). +$$ + +And we can bound the minimum over $t$ by + +$$ +\min _ {t \in [ T ^ {(2)}, T - 1 ]} \sum_ {(k, i) \in \Psi} - \ell_ {k, i} ^ {\prime (t, J)} \leq \widetilde {\mathcal {O}} \left(\frac {1}{(T - T ^ {(2)}) \eta}\right) = \widetilde {\mathcal {O}} \left(\frac {1}{T \eta}\right), +$$ + +where the second equality is because $T^{(2)} = \mathrm{polylog}(d) = o(1)T$ , and hence $T - T^{(2)} = \Omega(1)T$ . + +Lastly, we have the following theorem for the convergence of training similar to Theorem E.10. + +Theorem F.21 (Restatement of Theorem 4.5 (1)). Let $T = \mathrm{poly}(d)$ be the total number of iterations. Under Condition D.1 and Condition 4.1, we have + +$$ +\min _ {t \in [ T ]} \widehat {\mathcal {L}} ^ {t r \cdot v a l} (\boldsymbol {W} ^ {(t)}) \leq \widetilde {\Theta} (T ^ {- 1} \eta^ {- 1}). +$$ + +Proof. Denote $-\ell_{k,i}^{\prime (t,J)} = -\ell^{\prime}(\alpha (t,J,k,i))$ , i.e. the argument of $-\ell_{k,i}^{\prime (t,J)}$ is some function $\alpha (t,J,k,i)$ . Then the training loss at time $t$ is related to $-\ell_{k,i}^{\prime (t,J)}$ by + +$$ +\widehat {\mathcal {L}} ^ {\text {t r - v a l}} \left(\mathbf {W} ^ {(t)}\right) = \sum_ {(k, i) \in \Psi} \ell \left(\alpha (t, J, k, i)\right). +$$ + +Let $t' = \arg \min_{t \in [T^{(2)}} \sum_{(k,i) \in \Psi} -\ell_{k,i}'^{(t,J)}$ . By definition of $\ell'(\cdot)$ and $\ell(\cdot)$ we can bound $-\ell'(x) \geq \exp(-x)/2 \geq \ell(x)/2$ for $x > 0$ . This can be used to bound our loss by + +$$ +\begin{array}{l} \min _ {t \in [ T ]} \widehat {\mathcal {L}} ^ {\text {t r - v a l}} \left(\mathbf {W} ^ {(t)}\right) \leq \widehat {\mathcal {L}} ^ {\text {t r - v a l}} \left(\mathbf {W} ^ {\left(t ^ {\prime}\right)}\right) \\ = \sum_ {(k, i) \in \Psi} \ell \left(\alpha \left(t ^ {\prime}, J, k, i\right)\right) \\ \leq -2 \sum_ {(k, i) \in \Psi} \ell^ {\prime} \left(\alpha \left(t ^ {\prime}, J, k, i\right)\right) \\ \leq \widetilde {\mathcal {O}} \left(\frac {1}{T \eta}\right), \\ \end{array} +$$ + +where the last inequality is by Lemma F.20. This proves our theorem. + +![](images/c930ebbc6949f45b0a6f5a1b6befd73962a57a79d37c8db7e366152f4b4e2054.jpg) + +Theorem F.22 (Restatement of Theorem 4.5 (2)). Let $\mathbf{W} = \mathbf{W}^{(T)}$ be our trained weights using the train-validation method. Then the test loss is small + +$$ +\mathcal {L} _ {\text {t e s t}} (\boldsymbol {W}) = o \left(1 / \operatorname {p o l y l o g} (d)\right). +$$ + +Proof. Sample a new example $\mathbf{x}$ from the distribution, since we use the convolutional structure, we can assume that the first patch $\mathbf{x}^{(1)} = y\cdot (\pmb {\nu} + \mathbf{z})$ and the second patch $\mathbf{x}^{(2)} = \pmb{\xi}$ . Clearly $\langle \pmb{\xi}_{k,i},\pmb {\xi}\rangle$ follows the Gaussian distribution with mean zero and standard deviation $\sigma_{\xi}\cdot \| \pmb{\xi}_{k,i}\| _2$ . By Lemma D.2, we further know that $\| \pmb{\xi}_{k,i}\| _2\leq 2\sigma_\xi \sqrt{d}$ . Therefore + +$$ +\mathbb {P} \left(\left| \langle \boldsymbol {\xi} _ {k, i}, \boldsymbol {\xi} \rangle \right| \geq d ^ {- 1 / 4}\right) \leq 2 \exp \left(- \frac {1}{8 \sigma_ {\xi} ^ {4} d ^ {3 / 2}}\right) \leq 2 \exp \left(- d ^ {1 / 4}\right). \tag {F.30} +$$ + +Similarly we have that + +$$ +\mathbb {P} \left(\left| \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \boldsymbol {\xi} \rangle \right| \geq d ^ {3 / 2}\right) \leq 2 \exp \left(- \frac {1}{8 \sigma_ {0} ^ {2} \sigma_ {\xi} ^ {2} d ^ {3 / 2}}\right) \leq 2 \exp (- d ^ {1 / 4}). \tag {F.31} +$$ + +Denote $\mathcal{E}$ to be the event that $|\langle \pmb{\xi}_{k,i},\pmb {\xi}\rangle |\leq d^{-1 / 4}$ and $|\langle \mathbf{w}_{j,r}^{(0,0)},\pmb {\xi}\rangle |\leq d^{3 / 2}$ for all $k\in [K],i\in [n],r\in$ $[m]$ and $j\in \{-1,1\}$ . Applying union bound, we have that the $\mathbb{P}(\mathcal{E})\geq 1 - 2(nK + m)\exp (-d^{1 / 4})$ . We can divide $\mathcal{L}_{\mathrm{test}}(\mathbf{W})$ into two parts: + +$$ +\mathcal {L} _ {\text {t e s t}} (\mathbf {W}) = \mathbb {E} \left[ \ell \left(y f (\mathbf {W}, \mathbf {x})\right) \right] = \underbrace {\mathbb {E} \left[ \mathbf {1} (\mathcal {E}) \ell \left(y f (\mathbf {W} , \mathbf {x})\right) \right]} _ {I _ {1}} + \underbrace {\mathbb {E} \left[ \mathbf {1} \left(\mathcal {E} ^ {c}\right) \ell \left(y f (\mathbf {W} , \mathbf {x})\right) \right]} _ {I _ {2}}. \tag {F.32} +$$ + +In the following, we bound $I_{1}$ and $I_{2}$ respectively. + +Bounding $I_{1}$ : When event $\mathcal{E}$ holds, for any $j\in \{-1,1\}$ , we have + +$$ +\begin{array}{l} \langle \mathbf {w} _ {j, r} ^ {(T, 0)}, \boldsymbol {\xi} \rangle = \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \boldsymbol {\xi} \rangle - \frac {\eta}{K n _ {2}} \sum_ {t = 0} ^ {T - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime (t, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k, i} \rangle) \langle \boldsymbol {\xi}, \boldsymbol {\xi} _ {k, i} \rangle \\ \leq \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \boldsymbol {\xi} \rangle - \frac {\eta}{K n _ {2}} \sum_ {t = 0} ^ {T - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime (t, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k, i} \rangle) d ^ {- 1 / 4} \\ \leq \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \boldsymbol {\xi} \rangle - \frac {\eta}{K n _ {2}} \sum_ {t = 0} ^ {T - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime (t, J)} d ^ {- 1 / 4} \\ \leq \left\langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \boldsymbol {\xi} \right\rangle - \frac {\eta d ^ {- 1 / 4}}{K n _ {2}} \sum_ {t = 0} ^ {T ^ {(2)} - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime (t, J)} - \frac {\eta d ^ {- 1 / 4}}{K n _ {2}} \sum_ {t = T ^ {(2)}} ^ {T - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime (t, J)} \\ \leq \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \boldsymbol {\xi} \rangle + \eta d ^ {- 1 / 4} T ^ {(2)} + \frac {\eta d ^ {- 1 / 4}}{K n _ {2}} \tilde {\mathcal {O}} (1) \\ \end{array} +$$ + +$$ +\begin{array}{l} \leq \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \boldsymbol {\xi} \rangle + \widetilde {\mathcal {O}} (d ^ {- 1 / 4}) + \widetilde {\mathcal {O}} (d ^ {- 1 / 4}) \\ = \widetilde {\mathcal {O}} \left(d ^ {- 1 / 4}\right), \tag {F.33} \\ \end{array} +$$ + +where the second line is by Eq. (F.30). The third line is by $0 \leq \sigma'(\cdot) \leq 1$ . The third last line is due to $-\ell'(\cdot) \leq 1$ , $T^{(2)} = \mathrm{polylog}(d)$ and $\sum_{t=T^{(2)}}^{T-1} \sum_{(k,i) \in \Psi} \ell_{k,i}^{(t,J)} = \widetilde{\mathcal{O}}(1)$ (recall Eq. (F.29)). The second last line is by Eq. (F.31). We note that Eq. (F.33) holds for all $j \in \{-1,1\}$ , $r \in [m]$ , and $y \in \{-1,1\}$ . Now without loss of generality we assume $y = 1$ . Then, + +$$ +\begin{array}{l} F _ {- 1} (\mathbf {W} _ {- 1}, \mathbf {x}) = \sum_ {r = 1} ^ {m} \sigma \left(\left\langle \mathbf {w} _ {- 1, r} ^ {(T, 0)}, \boldsymbol {\nu} + \mathbf {z} \right\rangle\right) + \sigma \left(\left\langle \mathbf {w} _ {- 1, r} ^ {(T, 0)}, \boldsymbol {\xi} \right\rangle\right) \\ \leq \sum_ {r = 1} ^ {m} \sigma \left(\left\langle \mathbf {w} _ {- 1, r} ^ {(T, 0)}, \boldsymbol {\nu} + \mathbf {z} \right\rangle\right) + m \sigma \left(\widetilde {\mathcal {O}} \left(d ^ {- 1 / 4}\right)\right) \\ \leq \sum_ {r = 1} ^ {m} \sigma \left(\left\langle \mathbf {w} _ {- 1, r} ^ {(0, 0)}, \boldsymbol {\nu} + \mathbf {z} \right\rangle\right) + m \sigma \left(\widetilde {\mathcal {O}} \left(d ^ {- 1 / 4}\right)\right) \\ \leq \sum_ {r = 1} ^ {m} \sigma (\widetilde {\mathcal {O}} (d ^ {- 1 / 4})) + m \sigma (\widetilde {\mathcal {O}} (d ^ {- 1 / 4})) \\ \leq \log 2, \\ \end{array} +$$ + +where the second line is by Lemma Eq. (F.33), the third line is by monotonicity of $j\langle \mathbf{w}_{j,r}^{(t,0)},\pmb {\nu}\rangle$ and $j\langle \mathbf{w}_{j,r}^{(t,0)},\mathbf{z}\rangle$ in $t$ , the fourth line is by Lemma D.2. Thus + +$$ +\begin{array}{l} \ell \big (y f (\mathbf {W}, \mathbf {x}) \big) = \ell \Bigg (F _ {+ 1} (\mathbf {W} _ {+ 1}, \mathbf {x}) - F _ {- 1} (\mathbf {W} _ {- 1}, \mathbf {x}) \Bigg) \\ \leq \ell \left(\sum_ {r = 1} ^ {m} \sigma \left(\left\langle \mathbf {w} _ {1, r} ^ {(T, 0)}, \boldsymbol {\nu} + \mathbf {z} \right\rangle\right) - F _ {- 1} \left(\mathbf {W} _ {- 1}, \mathbf {x}\right)\right) \\ \leq \ell \left(\sigma \left(\boldsymbol {\Lambda} _ {1} ^ {(T)}\right) - F _ {- 1} (\mathbf {W} _ {- 1}, \mathbf {x})\right) \\ \leq \ell \left(\sigma \left(\boldsymbol {\Lambda} _ {1} ^ {(T ^ {(3)})}\right) - F _ {- 1} (\mathbf {W} _ {- 1}, \mathbf {x})\right) \\ \leq \ell \left(\log (d) ^ {0. 1} - \log 2\right) \\ \leq 2 \exp \left(- \log (d) ^ {0. 1}\right), \\ \end{array} +$$ + +where the second and the third line are due to the fact that $\sigma(\cdot) \geq 0$ , the fourth line is by Theorem F.18, the fifth line is by definition of $T^{(3)}$ , the last line is by $\log(1 + x) \leq x, \forall x \geq 0$ . Therefore we have that + +$$ +I _ {1} \leq 2 \exp (- \log (d) ^ {0. 1}). \tag {F.34} +$$ + +Bounding $I_{2}$ : Next we bound the second term $I_{2}$ . When event $\mathcal{E}$ holds, for any $j \in \{-1, 1\}$ , we have + +$$ +\begin{array}{l} \langle \mathbf {w} _ {j, r} ^ {(T, 0)}, \pmb {\xi} \rangle = \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \pmb {\xi} \rangle - \frac {\eta}{K n _ {2}} \sum_ {t = 0} ^ {T - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime (t, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \pmb {\xi} _ {k, i} \rangle) \langle \pmb {\xi}, \pmb {\xi} _ {k, i} \rangle \\ \leq \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \boldsymbol {\xi} \rangle - \frac {\eta}{K n _ {2}} \sum_ {t = 0} ^ {T - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime (t, J)} \sigma^ {\prime} (\langle \mathbf {w} _ {j, r} ^ {(t, J)}, \boldsymbol {\xi} _ {k, i} \rangle) \widetilde {\mathcal {O}} (\| \boldsymbol {\xi} \| _ {2}) \\ \leq \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \boldsymbol {\xi} \rangle - \frac {\eta}{K n _ {2}} \sum_ {t = 0} ^ {T - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime (t, J)} \widetilde {\mathcal {O}} (\| \boldsymbol {\xi} \| _ {2}) \\ \end{array} +$$ + +$$ +\begin{array}{l} \leq \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \pmb {\xi} \rangle - \frac {\eta \widetilde {\mathcal {O}} (\| \pmb {\xi} \| _ {2})}{K n _ {2}} \sum_ {t = 0} ^ {T ^ {(2)} - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime (t, J)} - \frac {\eta \widetilde {\mathcal {O}} (\| \pmb {\xi} \| _ {2})}{K n _ {2}} \sum_ {t = T ^ {(2)}} ^ {T - 1} \sum_ {(k, i) \in \Psi} \ell_ {k, i} ^ {\prime (t, J)} \\ \leq \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \boldsymbol {\xi} \rangle + \eta \widetilde {\mathcal {O}} (\| \boldsymbol {\xi} \| _ {2}) T ^ {(2)} + \frac {\eta \widetilde {\mathcal {O}} (\| \boldsymbol {\xi} \| _ {2})}{K n _ {2}} \\ \leq \langle \mathbf {w} _ {j, r} ^ {(0, 0)}, \boldsymbol {\xi} \rangle + \widetilde {\mathcal {O}} (\| \boldsymbol {\xi} \| _ {2}) + \widetilde {\mathcal {O}} (\| \boldsymbol {\xi} \| _ {2}) \\ = \widetilde {\mathcal {O}} \left(\| \boldsymbol {\xi} \| _ {2}\right), \tag {F.35} \\ \end{array} +$$ + +where the second line is by $|\langle \pmb {\xi},\pmb{\xi}_{k,i}\rangle |\leq \| \pmb{\xi}_{k,i}\| _2\| \pmb {\xi}\| _2 = \widetilde{\mathcal{O}} (\| \pmb {\xi}\| _2)$ . The third line is by $0\leq \sigma^{\prime}(\cdot)\leq 1$ . The third last line is due to $-\ell^{\prime}(\cdot)\leq 1, T^{(2)} = \mathrm{polylog}(d)$ and $\sum_{t = T^{(2)}}^{T - 1}\sum_{(k,i)\in \Psi}\ell_{k,i}^{\prime (t,J)} = \widetilde{\mathcal{O}} (1)$ (recall Eq. (F.29)). The second last line is by $|\langle \mathbf{w}_{j,r}^{(0,0)},\pmb {\xi}\rangle |\leq \| \mathbf{w}_{j,r}^{(0,0)}\|_2\| \pmb {\xi}\| _2 = \widetilde{\mathcal{O}} (\| \pmb {\xi}\| _2)$ . We note that Eq. (F.33) holds for all $j\in \{-1,1\}$ , $r\in [m]$ , and $y\in \{-1,1\}$ . Now again without loss of generality we assume $y = 1$ and have that + +$$ +\begin{array}{l} F _ {- 1} (\mathbf {W} _ {- 1}, \mathbf {x}) = \sum_ {r = 1} ^ {m} \sigma \left(\left\langle \mathbf {w} _ {- 1, r} ^ {(T, 0)}, \boldsymbol {\nu} + \mathbf {z} \right\rangle\right) + \sigma \left(\left\langle \mathbf {w} _ {- 1, r} ^ {(T, 0)}, \boldsymbol {\xi} \right\rangle\right) \\ \leq \sum_ {r = 1} ^ {m} \sigma \left(\left\langle \mathbf {w} _ {- 1, r} ^ {(T, 0)}, \boldsymbol {\nu} + \mathbf {z} \right\rangle\right) + m \sigma \left(\widetilde {\mathcal {O}} \left(\| \boldsymbol {\xi} \| _ {2}\right)\right) \\ \leq \sum_ {r = 1} ^ {m} \sigma \left(\left\langle \mathbf {w} _ {- 1, r} ^ {(0, 0)}, \boldsymbol {\nu} + \mathbf {z} \right\rangle\right) + m \sigma \left(\widetilde {\mathcal {O}} \left(\| \boldsymbol {\xi} \| _ {2}\right)\right) \\ \leq \sum_ {r = 1} ^ {m} \sigma (\widetilde {\mathcal {O}} (d ^ {- 1 / 2})) + m \sigma (\widetilde {\mathcal {O}} (\| \boldsymbol {\xi} \| _ {2})) \\ \leq 1 + \tilde {\mathcal {O}} (\| \boldsymbol {\xi} \| _ {2}), \\ \end{array} +$$ + +where the second line is by Eq. (F.35). The third line is by monotonicity of $j\langle \mathbf{w}_{j,r}^{(t,0)},\pmb {\nu}\rangle$ and $j\langle \mathbf{w}_{j,r}^{(t,0)},\mathbf{z}\rangle$ in $t$ . The fourth line is by Lemma D.2. Thus + +$$ +\begin{array}{l} \ell \left(y f (\mathbf {W}, \mathbf {x})\right) = \ell \left(F _ {+ 1} (\mathbf {W} _ {+ 1}, \mathbf {x}) - F _ {- 1} (\mathbf {W} _ {- 1}, \mathbf {x})\right) \\ \leq \ell \left(- F _ {- 1} (\mathbf {W} _ {- 1}, \mathbf {x})\right) \\ = \log (1 + \exp (F _ {- 1} (\mathbf {W} _ {- 1}, \mathbf {x}))) \\ \leq 1 + F _ {- 1} \left(\mathbf {W} _ {- 1}, \mathbf {x}\right) \\ \leq 2 + \tilde {\mathcal {O}} (\| \boldsymbol {\xi} \| _ {2}), \tag {F.36} \\ \end{array} +$$ + +where the second line is due to the fact that $\sigma(\cdot) \geq 0$ , the fourth line is by the property of cross-entropy loss, i.e., $\log(1 + \exp(x)) \leq 1 + x$ for all $x \geq 0$ . Then we further have that + +$$ +\begin{array}{l} I _ {2} \leq \sqrt {\mathbb {E} \left[ \mathbb {1} \left(\mathcal {E} ^ {c}\right) \right]} \cdot \sqrt {\mathbb {E} \left[ \ell \left(y f (\mathbf {W} , \mathbf {x})\right) ^ {2} \right]} \\ \leq \sqrt {\mathbb {P} (\mathcal {E} ^ {c})} \cdot \sqrt {8 + \tilde {\mathcal {O}} (1) \mathbb {E} [ \| \boldsymbol {\xi} \| _ {2} ^ {2} ]} \\ \leq \sqrt {\mathcal {O} (\operatorname {p o l y} (d)) \exp (- d ^ {1 / 4})} \\ = \mathcal {O} (\operatorname {p o l y} (d)) \exp (- 0. 5 d ^ {1 / 4}), \\ \end{array} +$$ + +where the first inequality is by Cauchy-Schwartz inequality. The second inequality is by Eq. (F.36). The third inequality is by the fact that $\sqrt{8 + \tilde{\mathcal{O}}(1)\mathbb{E}[\|\pmb{\xi}\|_2^2]}\leq \mathcal{O}(\mathrm{poly}(d))$ . Plugging the bounds of $I_{1},I_{2}$ into Eq. (F.32) gives that + +$$ +\mathcal {L} _ {\text {t e s t}} (\mathbf {W}) \leq 2 \exp \left(- \log (d) ^ {0. 1}\right) + \mathcal {O} (\operatorname {p o l y} (d)) \exp (- 0. 5 d ^ {1 / 4}) = O \left(\exp \left(- \log (d) ^ {0. 1}\right)\right), +$$ + +which completes the proof. + +# G AUXILIARY LEMMA + +Lemma G.1 (Restatement of Lemma B.2 from Cao et al. (2022)). Suppose that $\delta > 0$ and $d = \Omega\left(\log(4Kn/\delta)\right)$ . Then with probability at least $1 - \delta$ + +$$ +\frac {1}{2} \sigma_ {\xi} ^ {2} d \leq \| \pmb {\xi} _ {k, i} \| _ {2} ^ {2} \leq \frac {3}{2} \sigma_ {\xi} ^ {2} d, +$$ + +$$ +| \langle \pmb {\xi} _ {k, i}, \pmb {\xi} _ {k ^ {\prime}, i ^ {\prime}} \rangle | \leq 2 \sigma_ {\xi} ^ {2} \sqrt {d} \sqrt {\log (4 (K n) ^ {2} / \delta)}, +$$ + +for all $k, k' \in [K]$ and $i, i' \in [n]$ with $(k, i) \neq (k', i')$ . + +Lemma G.2 (Restatement of Lemma B.3 from Cao et al. (2022)). Suppose that $\delta > 0$ , $d = \Omega (\log (mKn / \delta))$ and $m = \Omega (\log (1 / \delta))$ . Then with probability at least $1 - \delta$ + +$$ +| \langle \boldsymbol {w} _ {j, r} ^ {(0, 0)}, \boldsymbol {\nu} \rangle | \leq \sqrt {2 \log (8 m / \delta)} \sigma_ {0}, +$$ + +$$ +| \langle \boldsymbol {w} _ {j, r} ^ {(0, 0)}, \boldsymbol {\xi} _ {k, i} \rangle | \leq \sqrt {2 \log (8 m K n / \delta)} \sigma_ {0} \sigma_ {\xi} \sqrt {d}, +$$ + +for all $r \in [m]$ , $j \in \{-1, 1\}$ , $k \in [K]$ and $i \in [n]$ . Moreover, + +$$ +\frac {\sigma_ {0}}{2} \leq \max _ {r \in [ m ]} j \langle \boldsymbol {w} _ {j, r} ^ {(0, 0)}, \boldsymbol {\nu} \rangle \leq \sqrt {2 \log (8 m / \delta)} \sigma_ {0}, +$$ + +$$ +\frac {\sigma_ {0} \sigma_ {\xi} \sqrt {d}}{4} \leq \max _ {r \in [ m ]} \langle \pmb {w} _ {j, r} ^ {(0, 0)}, \pmb {\xi} _ {k, i} \rangle \leq \sqrt {2 \log (8 m K n / \delta)} \sigma_ {0} \sigma_ {\xi} \sqrt {d}, +$$ + +for all $j \in \{-1, 1\}$ , $k \in [K]$ and $i \in [n]$ . \ No newline at end of file diff --git a/understandingtrainvalidationsplitinmetalearningwithneuralnetworks/images.zip b/understandingtrainvalidationsplitinmetalearningwithneuralnetworks/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..dccb3829f773968136334413c932b3fb28c5a547 --- /dev/null +++ b/understandingtrainvalidationsplitinmetalearningwithneuralnetworks/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6bb98d7ae2c3cc593556343a560612b261a5429a878d5fece532a47328b67331 +size 4133790 diff --git a/understandingtrainvalidationsplitinmetalearningwithneuralnetworks/layout.json b/understandingtrainvalidationsplitinmetalearningwithneuralnetworks/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..cb2e0b5bf336d92374b0593b2d50d764ec8dee0d --- /dev/null +++ b/understandingtrainvalidationsplitinmetalearningwithneuralnetworks/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f461cfeea69f63ea60d0ddac05ccc39146832f0d4c7a921d7bda87cac208fe92 +size 2575466 diff --git a/understandingweightmagnitudehyperparametersintrainingbinarynetworks/92075308-f185-485b-81a9-3f5f15aeb0f2_content_list.json b/understandingweightmagnitudehyperparametersintrainingbinarynetworks/92075308-f185-485b-81a9-3f5f15aeb0f2_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..61f026aa9ad0f0877de3f13896de7c513e66b8a2 --- /dev/null +++ b/understandingweightmagnitudehyperparametersintrainingbinarynetworks/92075308-f185-485b-81a9-3f5f15aeb0f2_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4636e1009ce5c78446193737e2409e62a476b1158592301767eccd2aef652075 +size 71886 diff --git a/understandingweightmagnitudehyperparametersintrainingbinarynetworks/92075308-f185-485b-81a9-3f5f15aeb0f2_model.json b/understandingweightmagnitudehyperparametersintrainingbinarynetworks/92075308-f185-485b-81a9-3f5f15aeb0f2_model.json new file mode 100644 index 0000000000000000000000000000000000000000..14e0659f2acfffe5f81638f0744f7c7377f1bcbc --- /dev/null +++ b/understandingweightmagnitudehyperparametersintrainingbinarynetworks/92075308-f185-485b-81a9-3f5f15aeb0f2_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cfcafabd7b5c437e7941c492f19b5a47a09a4d7851b04ffd8a51589e61478422 +size 88303 diff --git a/understandingweightmagnitudehyperparametersintrainingbinarynetworks/92075308-f185-485b-81a9-3f5f15aeb0f2_origin.pdf b/understandingweightmagnitudehyperparametersintrainingbinarynetworks/92075308-f185-485b-81a9-3f5f15aeb0f2_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a43d38407f721cdd5b452108e0f53ef8c9fbc255 --- /dev/null +++ b/understandingweightmagnitudehyperparametersintrainingbinarynetworks/92075308-f185-485b-81a9-3f5f15aeb0f2_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:69f736844e17426c8271a5f0507d2c5edfe3f65e2d3528d3a0412fa2906bf074 +size 672439 diff --git a/understandingweightmagnitudehyperparametersintrainingbinarynetworks/full.md b/understandingweightmagnitudehyperparametersintrainingbinarynetworks/full.md new file mode 100644 index 0000000000000000000000000000000000000000..3902daf8de777f259c7435a5e62b0d9d5a6b5303 --- /dev/null +++ b/understandingweightmagnitudehyperparametersintrainingbinarynetworks/full.md @@ -0,0 +1,312 @@ +# UNDERSTANDING WEIGHT-MAGNITUDE HYPERPARAMETERS IN TRAINING BINARY NETWORKS + +Joris Quist $^{1}$ , Yunqiang Li $^{1,2}$ , Jan van Gemert $^{1}$ + +1. Computer Vision Lab, Delft University of technology; 2. Axelera AI + +# ABSTRACT + +Binary Neural Networks (BNNs) are compact and efficient by using binary weights instead of real-valued weights. Current BNNs use latent real-valued weights during training, where hyper-parameters are inherited from real-valued networks. The interpretation of several of these hyperparameters is based on the magnitude of the real-valued weights. For BNNs, however, the magnitude of binary weights is not meaningful, and thus it is unclear what these hyperparameters actually do. One example is weight-decay, which aims to keep the magnitude of real-valued weights small. Other examples are latent weight initialization, the learning rate, and learning rate decay, which influence the magnitude of the real-valued weights. The magnitude is interpretable for real-valued weights, but loses its meaning for binary weights. In this paper we offer a new interpretation of these magnitude-based hyperparameters based on higher-order gradient filtering during network optimization. Our analysis makes it possible to understand how magnitude-based hyperparameters influence the training of binary networks which allows for new optimization filters specifically designed for binary neural networks that are independent of their real-valued interpretation. Moreover, our improved understanding reduces the number of hyperparameters, which in turn eases the hyperparameter tuning effort which may lead to better hyperparameter values for improved accuracy. Code is available at https://github.com/jorisquist/Understanding-WM-HP-in-BNNs + +# 1 INTRODUCTION + +A Binary Neural Network (BNN) weight is a single bit: $-1$ or $+1$ , which are compact and efficient, enabling applications on, for example, edge devices. Yet, training BNNs using gradient decent is difficult because of the discrete binary values. Thus, BNNs are often (Kim et al., 2021b; Liu et al., 2020; Martinez et al., 2020) optimized with so called 'latent', real-valued weights, which are discretised to $-1$ or $+1$ by, e.g., taking the positive or negative sign of the real value. + +The latent weight optimization depends on several essential hyperparameters, such as their initialization, learning rate, learning rate decay, and weight decay. These hyperparameters are important for BNNs, as shown for example in Martinez et al. (2020), and also by Liu et al. (2021a), who both improve BNN accuracy by better tuning these hyperparameters. + +![](images/9b236ed62b0ea5330592b8fe130b87b5a239559c359c1f1b275146345915aa77.jpg) +Figure 1: Changes in real-valued weights change their magnitude. For binary weights, however, the magnitude will never change and magnitude-based hyperparameters need reinterpretation. + +In this paper we investigate the latent weight hyperparameters used in a BNN, including initialization, learning rate, learning rate decay, and weight decay. All these hyperparameters influence the magnitude of the latent weights. Yet, as illustrated in Fig 1, in a BNN, the binary weights are $-1$ or $+1$ , which always have a constant magnitude and thus magnitude-based hyperparameters lose their meaning. We draw inspiration from the seminal work of Helwegen et al. (2019), who reinterpret latent weights from an inertia perspective and state that latent weights do not exist. Thus, the + +magnitude of latent weights also does not exist. Here, we investigate what latent weight-magnitude hyperparameters mean for a BNN, how they relate to each other, and what justification they have. We provide a gradient-filtering perspective on latent weight hyperparameters which main benefit is a simplified setting: fewer hyperparameters to tune, achieving similar accuracy as current, more complex methods. + +# 2 RELATED WORK + +Latent weights in BNNs. By tying each binary weight to a latent real-valued weight, continuous optimization approaches can be used to optimize binary weights. Some methods minimize the quantization error between a latent weight and its binary variant (Rastegari et al., 2016; Bulat & Tzimiropoulos, 2019). Others focus on gradient approximation (Liu et al., 2018; Lee et al., 2021; Zhang et al., 2022), or on reviving dead weights (Xu et al., 2021; Liu et al., 2021b), or on entropy regularization (Li et al., 2022) or a loss-aware binarization (Hou et al., 2017; Kim et al., 2021a). These works directly apply traditional optimization techniques inspired by real-valued network such as weight decay, learning rate and its decay, and optimizers. The summary of De Putter & Corporaal (2022) gives a good overview of these training techniques in BNNs. Recently, some papers (Liu et al., 2021a; Martinez et al., 2020; Hu et al., 2022; Tang et al., 2017) noticed that the interpretation of these optimization techniques does not align with the binary weights of BNNs (Lin et al., 2017; 2020). Here, we aim to shed light on why, by explicitly analyzing latent weight-magnitude hyperparameters in a BNN. + +Latent weight magnitudes. Several techniques exploit the magnitude of the latent weights during BNN optimization. Latent weights clipping is proposed in (Courbariaux et al., 2015) and followed by its extensions (Alizadeh et al., 2018; Hubara et al., 2016) to clip the latent weights within a $[-1,1]$ interval to prevent the magnitude of latent weights from growing too large. Gradient clipping (Cai et al., 2017; Courbariaux et al., 2015; Qin et al., 2020) stops gradient flow if the magnitude of latent weight is too large. Work on latent weight scaling (Chen et al., 2021; Qin et al., 2020) standardizes the latent weights to a pre-defined magnitude. Excellent results are achieved by a two-step training strategy (Liu et al., 2021a; 2020) that in the first step trains the network from scratch using only binarizing activations with weight decay, and then in the second step they fine-tune by training without weight decay. Our method reinterprets the meaning of the magnitude based weight decay hyperparameter in optimizing BNNs from a gradient filtering perspective, offering similar accuracy as two step training with a simpler setting, using just a single step. + +Optimization by gradient filtering. Gradient filtering is a common approach used to tackle the noisy gradient updates caused by minibatch sampling. Seminal algorithms including Momentum (Sutskever et al., 2013) and Adam (Kingma & Ba, 2015) which use a first order infinite impulse response filter (IIR), i.e. exponential moving average (EMA) to smooth noisy gradients. Yang (2020) takes this one step further and introduces the Filter Gradient descent Framework that can use different types of filters on the noisy gradients to make a better estimation of the true gradient. In binary network optimization, Bop (Helwegen et al., 2019) and its extension (Suarez-Ramirez et al., 2021) introduce a threshold to compare with the smoothed gradient by EMA to determine whether to flip a binary weight. In our paper, we build on second order gradient filtering techniques to reinterpret the hyperparameters that influence the latent weight updates. + +Sound optimization approaches. Instead of using heuristics to approximate gradient descent on discrete binary values, several works take a more principled approach. Peters & Welling (2018) propose a probabilistic training method for BNN, and Shekhotsov & Yanush (2021) present a theoretical understanding of straight through estimators (STE) (Bengio et al., 2013). Meng et al. (2020) propose a Bayesian perspective and Louizos et al. (2018) formulate a noisy quantizer. Even though these approaches provide more theoretical justification in optimizing BNNs, they are more complex by either relying on stochastic settings or discrete relaxation training procedures. Moreover, these methods do not (yet) empirically reach a similar accuracy as current mainstream heuristic methods (Liu et al., 2018; 2020). In our paper, we build on the mainstream approaches, to get good empirical results, but add a better understanding of their properties, taking a step towards better theoretical understanding of empirical approaches. + +# 3 HYPERPARAMETER ANALYSIS THROUGH GRADIENT FILTERING + +We start with a latent weights BNN and convert it to an equivalent latent-weight free setting, as in Helwegen et al. (2019). To do this, we use a magnitude independent setting, which means that no gradient-clipping or scaling based on the channel-wise mean of the latent-weights is used. + +BNN setup. We use Stochastic Gradient Descent (SGD) with weight decay and momentum as a starting point, as this is a commonly used setting, see Rastegari et al. (2016), Liu et al. (2018), Qin et al. (2020). Our setup is as follows: + +$$ +w _ {0} = \operatorname {i n i t} () \quad (1) \quad m _ {i} = (1 - \gamma) m _ {i - 1} + \gamma \nabla_ {\theta_ {i}}, \tag {2} +$$ + +$$ +w _ {i} = w _ {i - 1} - \epsilon \left(m _ {i} + \lambda w _ {i - 1}\right) \quad (3) \quad \theta_ {i} = \operatorname {s i g n} \left(w _ {i}\right) \tag {4} +$$ + +$$ +\operatorname {s i g n} (x) = \left\{ \begin{array}{l l} - 1, & \text {i f} x < 0; \\ + 1, & \text {i f} x > 0; \\ \operatorname {r a n d o m} \{- 1, + 1 \} & \text {o t h e r w i s e .} \end{array} \right. \tag {5} +$$ + +Here, $w_{i}$ is a latent weight at iteration $i$ which is initialized at $w_{0}$ . $\theta_{i}$ is a binary weight, $\epsilon$ is the learning rate, $\lambda$ is the weight decay factor, $m_{i}$ is the momentum exponentially weighted moving average with $m_{-1} = 0$ and discount factor $\gamma$ , $\nabla_{\theta_i}$ is the gradient over the binary weight and random{-1,+1} is a uniformly randomly sampled -1 or +1. + +We then convert to the latent-weight free setting of Helwegen et al. (2019) where latent weights are interpreted as accumulating negative gradients. We introduce $g_{i} = -w_{i}$ , which allows working with gradients instead of with latent weights. We can then write Eq 3 as follows + +$$ +g _ {i} = g _ {i - 1} + \epsilon \left(m _ {i} - \lambda g _ {i - 1}\right). \tag {6} +$$ + +Latent weight initialization. To investigate latent weight initialization we unroll the recursion in Eq 6 by writing it out as a summation: + +$$ +g _ {i} = (1 - \epsilon \lambda) g _ {i - 1} + \epsilon m _ {i} \quad = \quad \epsilon \sum_ {r = 0} ^ {i} (1 - \epsilon \lambda) ^ {i - r} m _ {r}. \tag {7} +$$ + +Latent-weights are typically initialized using real-valued weight initialization techniques (Glorot & Bengio, 2010; He et al., 2015). However, since we now interpret latent weights as accumulated gradients, we argue to also initialize them as gradient accumulation techniques such as Momentum (Sutskever et al., 2013) and simply initialize $w_{0} = g_{0} = 0$ , because at initialization there is no preference for negative or positive gradients, and their expectation is 0. We do not use a bias-correction as done in (Kingma & Ba, 2015) because in practice we noticed that gradient magnitudes are large in the first few iterations. Applying bias correction increases this effect, which had a negative effect on training. To prevent all binary weights $\theta$ to start at the same value, we use the stochastic sign function in Eq 5 that randomly chooses a sign when the input is exactly 0. + +Learning rate and weight decay. The learning rate $\epsilon$ appears in two places in Eq 7: once outside the summation, and once inside the summation. The $\epsilon$ outside the summation can only scale the latent weight and will not influence outcome of the sign in Eq 4 as + +$$ +\operatorname {s i g n} \left(\epsilon \sum_ {r = 0} ^ {i} (1 - \epsilon \lambda) ^ {i - r} m _ {r}\right) = \operatorname {s i g n} \left(\sum_ {r = 0} ^ {i} (1 - \epsilon \lambda) ^ {i - r} m _ {r}\right). \tag {8} +$$ + +Thus, the leftmost $\epsilon$ can be removed, or set randomly without influencing the training process. + +For the $\epsilon$ inside the summation of Eq 7, it appears together with the weight decay term $\lambda$ . Thus, there are two free hyperparameters that only control one factor, therefore one of them is redundant and can use a single combined hyperparameter $\alpha = \epsilon \lambda$ . Instead of setting a value for the learning rate $\epsilon$ , and setting a value for the weight decay $\lambda$ , we now only have to set a single value for $\alpha$ . Since Eq 8 shows us that we can freely scale the sum with any constant factor, we scale it with $\alpha$ , as + +$$ +g _ {i} = \alpha \sum_ {r = 0} ^ {i} (1 - \alpha) ^ {i - r} m _ {r}, \tag {9} +$$ + +which allows us to re-write the sum with a recursion, as an exponential moving average (EMA) as + +$$ +g _ {i} = (1 - \alpha) g _ {i - 1} + \alpha m _ {i}, \tag {10} +$$ + +where $g_{-1} = 0$ . This shows that for BNNs under magnitude independent conditions, SGD with weight decay is just an exponential moving average. This gives a magnitude-free justification for using weight decay since its actual role is to act as the discount factor in an EMA. Note that it is no longer possible to set $\alpha$ to 0 since then there are no updates anymore, but setting to a small $(10^{-20})$ number will essentially work the same. The meaning of $\alpha$ is now clear, as in the EMA it controls how much to take the past into account. + +Learning rate decay. There no longer is a learning rate to be decayed, however, since learning rate decay scales the learning rate and $\alpha = \epsilon \lambda$ , now the learning rate decay directly scales $\alpha$ , so from now on we apply it to alpha and will refer to it as $\alpha$ -decay. This also helps better explain its function: $\alpha$ -decay increases the window size during training, causing the filtered gradient to become more stable and allowing the training to converge. + +Momentum. Now adding back the momentum term of Eq 2 in the original setup yields + +$$ +m _ {i} = (1 - \gamma) m _ {i - 1} + \gamma \nabla_ {\theta_ {i}}, \tag {11} +$$ + +$$ +g _ {i} = (1 - \alpha) g _ {i - 1} + \alpha m _ {i}, \tag {12} +$$ + +$$ +\theta_ {i} = - \operatorname {s i g n} \left(g _ {i}\right). \tag {13} +$$ + +Thus, SGD with weight decay and momentum is smoothing the gradient twice with an EMA filter. + +Latent weight optimization as a second order linear infinite impulse response filter. EMAs are a specific type of linear Infinite Impulse Response (IIR) Filter (Proakis, 2001). Linear filters are filters that compute an output based on a linear combination of current and past inputs and past outputs. The general definition is given as a difference equation: + +$$ +y _ {i} = \frac {1}{a _ {0}} \left(b _ {0} x _ {i} + b _ {1} x _ {i - 1} + \dots + b _ {P} x _ {i - P} - a _ {1} y _ {i - 1} - a _ {2} y _ {i - 2} - \dots - a _ {P} y _ {i - Q}\right), \tag {14} +$$ + +where $i$ is the time step, $y_{i}$ are the outputs, $x_{i}$ are the inputs, $a_{j}$ and $b_{j}$ are the filter coefficients and $P$ and $Q$ are the maximum of iterations the filter looks back at the inputs and outputs to compute the current output. The maximum of $P$ and $Q$ defines the order of the filter. An EMA only looks at the previous output and the current input, so is therefore a first order IIR filter. Expressing an EMA as a filter looks as follows: + +$$ +y _ {i} = (1 - \alpha) y _ {i - 1} + \alpha x _ {i} = \frac {1}{a _ {0}} \left(b _ {0} x _ {i} - b _ {1} \cdot x _ {i - 1} - a _ {1} y _ {i - 1}\right), \quad b = \left[ \begin{array}{l} \alpha \\ 0 \end{array} \right], a = \left[ \begin{array}{l} 1 \\ \alpha - 1 \end{array} \right]. \tag {15} +$$ + +In our optimizer we have a cascade of two EMAs applied in series to the same signal which can be represented by a filter with the order being the sum of the orders of the original filters. To get the new $a$ and $b$ vectors the original ones are convolved with each other. In our case this gives: + +$$ +b = \left[ \begin{array}{l} \gamma \\ 0 \end{array} \right] \star \left[ \begin{array}{l} \alpha \\ 0 \end{array} \right] = \left[ \begin{array}{l} \alpha \gamma \\ 0 \\ 0 \end{array} \right], \quad a = \left[ \begin{array}{l} 1 \\ \gamma - 1 \end{array} \right] \star \left[ \begin{array}{l} 1 \\ \alpha - 1 \end{array} \right] = \left[ \begin{array}{l} 1 \\ (\alpha - 1) + (\gamma - 1) \\ (\alpha - 1) \cdot (\gamma - 1) \end{array} \right], \tag {16} +$$ + +when applied to our gradient filtering setting in Eq 12 gives the difference equation: + +$$ +g _ {i} = \alpha \gamma \nabla_ {\theta_ {i}} - (\alpha + \gamma - 2) g _ {i - 1} - (\alpha - 1) (\gamma - 1) g _ {i - 2} \tag {17} +$$ + +Thus, in a magnitude independent setting, SGD with weight decay and momentum is equivalent to a 2nd order linear IIR filter. Note that $\alpha$ and $\gamma$ have the same function: Without $\alpha$ decay, the values for $\alpha$ and $\gamma$ can be swapped. This filtering perspective opens up new methods of analysis for optimizers. + +Main takeaway. Our re-interpretations reduces the 7 hyper parameters in the latent weight view with SGD, to only 3 hyperparameters in our filtering view, see Table 1. + +
Learning rateLearning rate decayInitMomentumWeight decayScalingClipping
Latent:εε-decayw0γλ✓✓
Filtered:-α-decay-γα--
+ +Table 1: Hyperparameters used in the latent weight view versus our filtered gradients perspective. Our filtered perspective reduces the number of hyperparameters from 7 to 3. + +![](images/40d6234adf03b8bde5a360da03fe2d7e4ca8c35559fd6f3d3c1a2f5a325be462.jpg) +Figure 2: Gradients and filtered gradients for a first and second order filter in a single epoch on CIFAR-10. For better visualisation, the filter outputs are scaled up to a similar range as the unfiltered gradients. It can be seen that the unfiltered gradients are noisy and that the filtered outputs are smoother. The second order filter reduces the noise even further compared to the first order filter. + +# 4 EXPERIMENTS + +We empirically validate our analysis on CIFAR-10, using the BiRealNet-20 architecture (Liu et al., 2018). Unless mentioned otherwise the networks were optimized using SGD for both the real-valued and binary parameters with as hyperparameters: learning rate $= 0.1$ , momentum with $\gamma = (1 - 0.9)$ , weight decay $= 10^{-4}$ , batch size $= 256$ and cosine learning rate decay and cosine alpha decay. We analyze the weight flip ratio at every update, which is also known as the FF ratio (Liu et al. (2021a)). + +$$ +\mathbf {I} _ {\mathrm {F F}} = \frac {\left| \operatorname {s i g n} \left(w _ {i + 1}\right) - \operatorname {s i g n} \left(w _ {i}\right) \right| _ {1}}{2} \quad \mathbf {F F} _ {\text {r a t i o}} = \frac {\sum_ {l = 1} ^ {L} \sum_ {w \in W _ {l}} \mathbf {I} _ {\mathrm {F F}}}{N _ {\text {t o t a l}}} \tag {18} +$$ + +where $w_{i}$ is a latent weight at time $i$ , $L$ the number of layers, $W_{l}$ the weights in layer $l$ , and $N_{\mathrm{total}}$ the total number of weights. + +![](images/44effbaa5535aadd3c2888ab43c6c2cb25da927d7a4e75bfaa886b26b8494167.jpg) +(a) Varying learning rates, constant init. + +![](images/734058fcb20a469ab129ff1bdff4d2268452a41e106a5bfe544430ff9df6ebb8.jpg) +(b) Vary init, constant learning rate $(\epsilon = 1.0)$ . +Figure 3: In the magnitude independent setting, scaling the learning rate has the exact same effect on the flipping ratio as scaling the initial latent-weights by the inverse. + +![](images/0ca5837d1c2d2ae8943994889d680ecff85aaad6fc0a376c6ff72f7eb059bfcb.jpg) +Figure 4: Learning rate effect on accuracy for three settings. (a). standard SGD. (b) Magnitude independent in Eq 3, by removing clipping and scaling. (c) Magnitude independent with latent weight initializes of 0 in Eq 7. Setting (a) has just a single optimum. The accuracy in setting (b) is sensitive to small learning rates. For setting (c), accuracy is independent of the learning rate. + +![](images/35c02f13370bac01fbcb53b2123c287f31655f3637aa2fb34ccec15b1c5160ec.jpg) +Figure 5: Bit flipping (FF) ratio and accuracy for varying alphas from eq 17. BNNs are sensitive to alpha, similar to how they are sensitive to weight decay. Tuning alpha is essential. + +![](images/11fca6d4b224720564fed3eda9d0057dc5d3924325756a0490632d0cb4fada47.jpg) + +1st order vs 2nd order We visually compare filter orders by sampling real gradients from a single binary weight trained on CIFAR-10 in Figure 2. For the same $\alpha$ , a 1st order filter is more noisy than a 2nd order filter. This may cause the binary weight to oscillate, even though the larger trend is that it should just flip once. To reduce these oscillations with a 1st order filter requires a smaller alpha. This, however, causes other problems because $\alpha$ determines the window size of past gradients and with a smaller $\alpha$ many more gradients are used. This means that it takes much longer for a trend in the gradients to effect the binary weight. Instead, the 2nd order filter has both benefits: it can filter out high frequency noise while still able to react quicker to changing trends. + +Magnitude independent learning rate vs initialization In Figure 3 we show the bit flipping ratio for the learning rate $\epsilon$ and the initialization $g_0$ . Multiplying $\epsilon$ with some scaling factor $s$ is the same as dividing $g_0$ by $s$ : sign $\left((1 - \epsilon \lambda)^i g_0 + s\epsilon \sum_{r = 1}^i (1 - \epsilon \lambda)^{i - r}m_r\right) = \mathrm{sign}\left((1 - \epsilon \lambda)^i\frac{g_0}{s} +\epsilon \sum_{r = 1}^i (1 - \epsilon \lambda)^{i - r}m_r\right)$ , because the magnitude has no effect on the sign. Larger $\epsilon$ in Figure 3(a) and smaller $g_0$ in Figure 3(b) are independent to scaling and have similar flipping ratios. A too small $\epsilon$ or too large $g_0$ do not reach the same flipping ratios, because their ratio is insufficient to update the binary weights. For sufficiently large ratios it means that scaling both $\epsilon$ and $g_0$ has no effect on training, but also that scaling the $\epsilon$ or scaling $g_0$ with the inverse is identical: as seen by comparing the two plots in Figure 3. + +Sensitivity to hyperparameters for weight magnitude (in)dependence We evaluate SGD in the standard magnitude dependent setting with clipping and scaling vs a magnitude independent setting with initializing the latent-weights to zero. To keep the effect of weight decay constant, we scale the weight decay factor inversely with the learning rate. Results in Figure 4 show that for the standard magnitude dependent setting the learning rate $\epsilon$ has to be carefully balanced. A too small $\epsilon$ w.r.t. to the ini + +tial weights inhibits learning; while a too large $\epsilon$ will push latent-weights to the clipping region and will stop updating. In the magnitude independent setting there is no clipping. A too small $\epsilon$ , however, is still problematic because the magnitudes of the gradients are smaller when not using the scaling factor and the accuracy drops significantly. When initializing to zero, as we propose, this problem disappears, because there is no initial weight to hinder training and all learning rates perform equal. + +![](images/164cde1c9cfec841dc94e5b57cf3bbc067546fbf8297801fd7c0b8813dae1f9a.jpg) +Figure 6: Flipping rate and accuracy for alpha decay. With decay the FF ratio goes to zero. Without decay, the flipping will continue, preventing convergence, reducing accuracy. + +![](images/df73d55230e86dcb1a61adcece240f399ac45e5e648851bc9df9f207ba5fef44.jpg) + +Alpha In Fig 5 we vary $\alpha$ from eq 17. Alpha strongly influences training. A too large $\alpha$ causes too many binary weight flips per update, which hinders converging. A too small $\alpha$ makes the network converge too quickly, which hurts the end result. Tuning $\alpha$ is essential. + +Alpha decay For proper convergence the flipping (FF) ratio should go to zero. We transform learning rate decay to alpha decay. When $\alpha$ becomes smaller, the gradients will change less, causing fewer flips, forcing the network to converge. + +See the plots in Figure 6 where one network has been trained with cosine alpha decay and one without alpha decay. With and without alpha decay both seem to perform well at the start of training, however, the variant without alpha decay plateaus at the end of + +![](images/e85112c8f620e3da25385f83b17dc5f12a1058da476de59ffa625e7d5cf562dc.jpg) +Figure 7: Equivalence of latent weights (Eq 3) and our gradient filtering (Eq 17). They are empirically equivalent. + +![](images/67278a88ef9f9e941d6eb9495b7418e77d3ba8867c07720fed77e4629b143ae4.jpg) + +training while the BNN with alpha decay converges better and continues improving, leading to a better end result. + +Equivalent interpretation Figure 7 shows empirical validation with matching hyperparameters that the SGD setting using latent weights in Eq 3 is equivalent to our gradient filtering interpretation in Eq 17 that no longer uses latent weights, + +# 4.1 VALIDATION OF EQUIVALENCE TO THE CURRENT STATE OF THE ART + +We validate on for CIFAR-10 and Imagenet that our filtering-based optimizer is similar to the current state of the art. Several current methods use an expensive two-step optimization step. We aim to show the value of our re-interpretation by showing similar accuracy but only in a single step. + +CIFAR-10: We train all networks for 400 epochs. As data augmentation we use padding of 4 pixels, followed by a $32 \times 32$ crop and random horizontal flip. We use Bi-RealNet-20, and for the real-valued parameters and latent-weights when used, we use SGD with a learning rate of 0.1 with cosine decay, momentum of 0.9 and on the non-BN parameters a weight decay of $10^{-4}$ . For our filtering-based optimizer we used an alpha of $10^{-3}$ with cosine decay and a gamma of $10^{-1}$ . Results in Table 2 show that our re-interpretation achieves similar accuracy. + +Table 2: State-of-the-art on CIFAR-10. The $\star$ denotes that we re-ran these experiments ourselves. + +
MethodTraining Bit-widthTop-1
Strategy(W/A)Acc(%)
FP32/3291.7
DoReFa-Net (Zhou et al., 2016)1/179.3
DSQ (Gong et al., 2019)1/184.1
IR-Net (Qin et al., 2020)One step1/186.5
Bi-Real* (Liu et al., 2018)1/185.0
Bi-Real + Our filtering optimizer1/186.5
Bi-Real* (Liu et al., 2018)Two step1/186.7
+ +Table 3: Comparison with state-of-the-art on Imagenet. + +
MethodTraining StrategyTop-1 Acc(%)Top-5 Acc(%)
CI-BCNN (Wang et al., 2019)59.984.2
Binary MobileNet (Phan et al., 2020b)60.982.6
MoBiNet (Phan et al., 2020a)54.477.5
EL (Hu et al., 2022)One step56.4-
MeliusNet29 (Bethge et al., 2020)65.8-
ReActNet-A + Our filtering optimizer69.788.9
StrongBaseline (Martinez et al., 2020)60.983.0
Real-to-Binary (Martinez et al., 2020)65.486.2
ReActNet-A (Liu et al., 2020)Two step69.488.6
ReActNet-A-AdamBNN (Liu et al., 2021a)70.589.1
+ +Imagenet: We follow Liu et al. (2021a): We train for 600K iterations with a batch size of 510. For the real-valued parameters we use Adam with a learning rate of 0.0025 with linear learning rate decay. For the binary parameters we use our 2nd order filtering optimizer with $\alpha = 10^{-5}$ , which we decay linearly and $\gamma = 10^{-1}$ . We do not use two-step training to pre-train the latent-weights. Results in Table 3, show that ReActNet-A with our optimizer compares well to other one step training methods. It approaches the accuracy of two step training approaches, albeit without an additional expensive second step of training. + +# 4.2 EMPIRICAL ADVANTAGE OF HAVING FEWER HYPERPARAMETER TO TUNE + +Our filtering perspective significantly reduces the number of hyperparameters (Table 1). Here, we empirically verify the computational benefit of having fewer hyperparameters to tune when applied in a setting where the hyperparameters are unknown. To show generalization to other architectures and modality we use an audio classification task (Becker et al., 2018) with a fully connected network. Specifically, we use 4 layers with batch normalization of which the first layer is not binarized. For the latent weights we optimize 6 hyperparameters, and for our filtering perspective we optimize two hyperparameters, see Table 1. We did not tune learning rate decay as this had no effect on both methods. To fairly compare hyperparameter search we used Bayesian optimization (Balandat et al., 2020). The results for 25 trials of tuning, averaged over 20 independent runs are in Figure 8. We confirm that both perspectives achieve similar accuracy when their hyperparameters are well tuned. Yet, for the latent weights, it takes on average around 10 more trials when compared to the gradient filtering. This means that the latent weights would have to train many more networks, which on medium-large datasets such as Imagenet would already take several days to converge. In contrast, the gradient filtering requires much less time and energy to find a good model. + +# 5 DISCUSSION AND LIMITATIONS + +One limitation of our work is that we do not achieve "superior performance" in terms of accuracy. Our approach merely matches the state of the art results. Note, however, that our goal is to provide insight into how SGD and its hyperparameters behave, not to improve accuracy. Our analysis ended up with an optimizer with less hyperparameters, that also have a better explanation in the context of BNN optimization leading to simpler, more elegant methods. Our main empirical contribution is in the significant computational reduction in hyperparameter tuning. + +Another perceived limitation is that our new proposed optimizer can be projected back to a specific setting within the current SGD with latent-weights interpretation. Thus, our analysis might not be needed. While it is true that latent-weights can also be used, we argue that there is no disadvantage to switching to the filtering perspective, because the options are the same, but the benefit is that our hyperparameters make more sense. The option to project back to latent-weights also works the other way around and for those who already have a well tuned SGD optimizer could use it to make it easier to switch to our filtering perspective. The benefit of our interpretations is having fewer hyperparameters to set. + +![](images/568e21bbfae70cd1b64a3eb6c7c98e4462728201c97f840a9e70a40c9a0ece15.jpg) +Figure 8: Bayesian hyperparameter optimization for our gradient filtering vs. latent weights. We optimize the hyperparameters of Table 1, except learning rate decay and alpha decay, as they had no influence. The scatter plot shows the best achieved result so far at each trial for all runs. The lines show the average best result, up to the current trial. Both methods perform equally for good hyperparameters. Our gradient filtering view needs much less trials. + +It's also true that our method cannot use common techniques based on the magnitude such as weight clipping or gradient clipping. Yet, we do not really think these techniques are necessary. We see such methods as heuristics to reduce the bit flipping ratio over time, which helps with convergence. However, in our setting, this can also be done using a good $\alpha$ decay schedule without reverting to such heuristics, making the optimization less complex. + +We did not yet have the opportunity to test the filtering-based optimizer on more architectures and datasets. However, since our optimizer is equivalent to a specific setting of SGD, we would argue that architectures that have been trained with SGD will probably also work well with our optimizer. This is also a reason why we chose to use ReActNet-A, since it was trained using Adam in both in the original paper (Liu et al., 2020) and in Liu et al. (2021a). The latter specifically argues that Adam works better for optimizing BNNs, but we suspect that the advantages of Adam are decreased because it might not work in the same way in the magnitude invariant setting, as we see a smaller difference in accuracy. Introducing this normalizing aspect into the filtering-based perspective is an interesting topic for future research. + +One last point to touch upon is soundness. Even though the filtering perspective provides a better explanation to hyperparameters, it does not provide understanding on why optimizing BNNs with second-order low pass filters works as well as it does. Whereas stochastic gradient descent has extensive theoretical background, this does not exist for current mainstream BNN methods. Fully understanding BNN optimization is an interesting direction for future research and our hope is that this work takes a step in that direction. + +Ethics Statement We believe that this research does not bring up major new potential ethical concerns. Our work makes training BNNs easier, which might increase their use in practice. + +Reproducibility Statement All our code is available online: https://github.com/jorisquist/Understanding-WM-HP-in-BNNs. Two important things for better reproducing our results rely on the GPUs and the dataloader. The reproduction of our ImageNet experiments is not trivial. First, as the teacher-student model is used in our ImageNet experiments, it will occupy a lot of GPU memory. We trained on 3 NVIDIA A40 GPUs, each A40 has 48 GB of GPU memory, with a batch size of 170 per GPU for as much as ten days. Second, for faster training on ImageNet, we used NVIDIA DALI dataloader to fetch the data into GPUs for the image pre-processing. This dataloader could effect training as it uses a slightly different image resizing algorithm than the standard PyTorch dataloader. To keep results consistent with other methods, we do the inference with the standard PyTorch dataloader. + +# REFERENCES + +Milad Alizadeh, Javier Fernández-Marqués, Nicholas D Lane, and Yarin Gal. An empirical study of binary neural networks' optimisation. In International conference on learning representations, 2018. +Maximilian Balandat, Brian Karrer, Daniel R. Jiang, Samuel Daulton, Benjamin Letham, Andrew Gordon Wilson, and Eytan Bakshy. BoTorch: A Framework for Efficient Monte-Carlo Bayesian Optimization. In Advances in Neural Information Processing Systems 33, 2020. URL http://arxiv.org/abs/1910.06403. +Sören Becker, Marcel Ackermann, Sebastian Lapuschkin, Klaus-Robert Müller, and Wojciech Samek. Interpreting and explaining deep neural networks for classification of audio signals. arXiv preprint arXiv:1807.03418, 2018. +Yoshua Bengio, Nicholas Léonard, and Aaron Courville. Estimating or propagating gradients through stochastic neurons for conditional computation. Technical Report, 2013. +Joseph Bethge, Christian Bartz, Haojin Yang, Ying Chen, and Christoph Meinel. Meliusnet: Can binary neural networks achieve mobilenet-level accuracy? arXiv preprint arXiv:2001.05936, 2020. +Adrian Bulat and Georgios Tzimiropoulos. Xnor-net++: Improved binary neural networks, 2019. +Zhaowei Cai, Xiaodong He, Jian Sun, and Nuno Vasconcelos. Deep learning with low precision by half-wave gaussian quantization. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 5918-5926, 2017. +Tianlong Chen, Zhenyu Zhang, Xu Ouyang, Zechun Liu, Zhiqiang Shen, and Zhangyang Wang. "bnn-bn=?": Training binary neural networks without batch normalization. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 4619-4629, 2021. +Matthieu Courbariaux, Yoshua Bengio, and Jean-Pierre David. Binaryconnect: Training deep neural networks with binary weights during propagations. In NeurIPS, 2015. +Floran De Putter and Henk Corporaal. How to train accurate bnns for embedded systems? arXiv preprint arXiv:2206.12322, 2022. +Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In AISTATS, pp. 249-256, 2010. +Ruihao Gong, Xianglong Liu, Shenghu Jiang, Tianxiang Li, Peng Hu, Jiazhen Lin, Fengwei Yu, and Junjie Yan. Differentiable soft quantization: Bridging full-precision and low-bit neural networks. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 4852–4861, 2019. +Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In ICCV, 2015. +Koen Helwegen, James Widdicombe, Lukas Geiger, Zechun Liu, Kwang-Ting Cheng, and Roeland Nusselder. Latent weights do not exist: Rethinking binarized neural network optimization. Advances in neural information processing systems, 32, 2019. +Lu Hou, Quanming Yao, and James T Kwok. Loss-aware binarization of deep networks. *ICLR*, 2017. +Jie Hu, Ziheng Wu, Vince Tan, Zhilin Lu, Mengze Zeng, and Enhua Wu. Elastic-link for binarized neural networks. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pp. 942-950, 2022. +Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Binarized neural networks. Advances in neural information processing systems, 29, 2016. +Dohyung Kim, Junghyup Lee, and Bumsub Ham. Distance-aware quantization. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 5271-5280, 2021a. + +Hyungjun Kim, Jihoon Park, Changhun Lee, and Jae-Joon Kim. Improving accuracy of binary neural networks using unbalanced activation distribution. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 7862-7871, 2021b. +Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. *ICLR*, 2015. +Junghyup Lee, Dohyung Kim, and Bumsub Ham. Network quantization with element-wise gradient scaling. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6448-6457, 2021. +Yunqiang Li, Silvia-Laura Pintea, and Jan C van Gemert. Equal bits: Enforcing equally distributed binary network weights. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pp. 1491-1499, 2022. +Mingbao Lin, Rongrong Ji, Zihan Xu, Baochang Zhang, Yan Wang, Yongjian Wu, Feiyue Huang, and Chia-Wen Lin. Rotated binary neural network. ECCV, 2020. +Xiaofan Lin, Cong Zhao, and Wei Pan. Towards accurate binary convolutional neural network. In NeurIPS, 2017. +Zechun Liu, Baoyuan Wu, Wenhan Luo, Xin Yang, Wei Liu, and Kwang-Ting Cheng. Bi-real net: Enhancing the performance of 1-bit cnns with improved representational capability and advanced training algorithm. In ECCV, 2018. +Zechun Liu, Zhiqiang Shen, Marios Savvides, and Kwang-Ting Cheng. Reactnet: Towards precise binary neural network with generalized activation functions. In European conference on computer vision, pp. 143-159. Springer, 2020. +Zechun Liu, Zhiqiang Shen, Shichao Li, Koen Helwegen, Dong Huang, and Kwang-Ting Cheng. How do adam and training strategies help bnns optimization. In International Conference on Machine Learning, pp. 6936-6946. PMLR, 2021a. +Zechun Liu, Zhiqiang Shen, Shichao Li, Koen Helwegen, Dong Huang, and Kwang-Ting Cheng. How do adam and training strategies help bnns optimization? In International Conference on Machine Learning. PMLR, 2021b. +Christos Louizos, Matthias Reisser, Tijmen Blankevoort, Efstratios Gavves, and Max Welling. Relaxed quantization for discretized neural networks. arXiv preprint arXiv:1810.01875, 2018. +Brais Martinez, Jing Yang, Adrian Bulat, and Georgios Tzimiropoulos. Training binary neural networks with real-to-binary convolutions. *ICLR*, 2020. +Xiangming Meng, Roman Bachmann, and Mohammad Emtiyaz Khan. Training binary neural networks using the bayesian learning rule. In International conference on machine learning, pp. 6852-6861. PMLR, 2020. +Jorn WT Peters and Max Welling. Probabilistic binary neural networks. arXiv preprint arXiv:1809.03368, 2018. +Hai Phan, Yihui He, Marios Savvides, Zhiqiang Shen, et al. Mobinet: A mobile binary network for image classification. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pp. 3453-3462, 2020a. +Hai Phan, Zechun Liu, Dang Huynh, Marios Savvides, Kwang-Ting Cheng, and Zhiqiang Shen. *Binarizing mobilenet via evolution-based searching*. In *CVPR*, 2020b. +John G Proakis. Digital signal processing: principles algorithms and applications. Pearson Education India, 2001. +Haotong Qin, Ruihao Gong, Xianglong Liu, Mingzhu Shen, Ziran Wei, Fengwei Yu, and Jingkuan Song. Forward and backward information retention for accurate binary neural networks. In CVPR, 2020. + +Mohammad Rastegari, Vicente Ordonez, Joseph Redmon, and Ali Farhadi. Xnor-net: Imagenet classification using binary convolutional neural networks. In European conference on computer vision, pp. 525-542. Springer, 2016. +Alexander Shekhotsov and Viktor Yanush. Reintroducing straight-through estimators as principled methods for stochastic binary networks. In DAGM German Conference on Pattern Recognition, pp. 111-126. Springer, 2021. +Cuauhtemoc Daniel Suarez-Ramirez, Miguel Gonzalez-Mendoza, Leonardo Chang, Gilberto Ochoa-Ruiz, and Mario Alberto Duran-Vega. A bop and beyond: a second order optimizer for binarized neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 1273-1281, 2021. +Ilya Sutskever, James Martens, George Dahl, and Geoffrey Hinton. On the importance of initialization and momentum in deep learning. In International conference on machine learning, 2013. +Wei Tang, Gang Hua, and Liang Wang. How to train a compact binary neural network with high accuracy? In AAAI, pp. 2625-2631, 2017. +Ziwei Wang, Jiwen Lu, Chenxin Tao, Jie Zhou, and Qi Tian. Learning channel-wise interactions for binary convolutional neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 568-577, 2019. +Zihan Xu, Mingbao Lin, Jianzhuang Liu, Jie Chen, Ling Shao, Yue Gao, Yonghong Tian, and Rongrong Ji. Recu: Reviving the dead weights in binary neural networks. ICCV, 2021. +Xingyi Yang. Stochastic gradient variance reduction by solving a filtering problem. arXiv preprint arXiv:2012.12418, 2020. +Yichi Zhang, Zhiru Zhang, and Lukasz Lew. Pokebnn: A binary pursuit of lightweight accuracy. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 12475-12485, 2022. +Shuchang Zhou, Yuxin Wu, Zekun Ni, Xinyu Zhou, He Wen, and Yuheng Zou. Dorefa-net: Training low bandwidth convolutional neural networks with low bandwidth gradients. CoRR, 2016. + +# A APPENDIX + +# A.1 Cascaded EMAS AS 2ND ORDER FILTER + +Here we provide an alternative solution for expressing cascaded EMAs as 2nd order filter. We first express $g_{i}$ in time step $i$ as: + +$$ +\begin{array}{l} g _ {i} = (1 - \alpha) g _ {i - 1} + \alpha m _ {i} \\ = (1 - \alpha) g _ {i - 1} + \alpha \left[ (1 - \gamma) m _ {i - 1} + \gamma \nabla_ {\theta_ {i}} \right] \tag {19} \\ = (1 - \alpha) g _ {i - 1} + \alpha \gamma \nabla_ {\theta_ {i}} + (1 - \gamma) \alpha m _ {i - 1} \\ \end{array} +$$ + +In time step $i - 1$ , we denote $g_{i - 1}$ as: + +$$ +g _ {i - 1} = (1 - \alpha) g _ {i - 2} + \alpha m _ {i - 1} \tag {20} +$$ + +where we have: + +$$ +\alpha m _ {i - 1} = g _ {i - 1} - (1 - \alpha) g _ {i - 2} \tag {21} +$$ + +Writing the $\alpha m_{i - 1}$ in Eq. (21) into Eq. (19) we get: + +$$ +\begin{array}{l} g _ {i} = \alpha \gamma \nabla_ {\theta_ {i}} + (1 - \alpha) g _ {i - 1} + (1 - \gamma) \left[ g _ {i - 1} - (1 - \alpha) g _ {i - 2} \right] \tag {22} \\ = \alpha \gamma \nabla_ {\theta_ {i}} - (\alpha + \gamma - 2) g _ {i - 1} - (\alpha - 1) (\gamma - 1) g _ {i - 2} \\ \end{array} +$$ \ No newline at end of file diff --git a/understandingweightmagnitudehyperparametersintrainingbinarynetworks/images.zip b/understandingweightmagnitudehyperparametersintrainingbinarynetworks/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..16acd8037c5906fe96b8e1a8ea3242b7f586487d --- /dev/null +++ b/understandingweightmagnitudehyperparametersintrainingbinarynetworks/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c336cb4b4439a9a2347ae01cd93180c36a00763f496b0d176a2620cb62ba51b4 +size 537028 diff --git a/understandingweightmagnitudehyperparametersintrainingbinarynetworks/layout.json b/understandingweightmagnitudehyperparametersintrainingbinarynetworks/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..c0bbfce1505282c3c16c0527c577c9c569c92d9b --- /dev/null +++ b/understandingweightmagnitudehyperparametersintrainingbinarynetworks/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7881237b41c1b40d6c2fd43c6141ce7ce975b04884f47537d30453ea94efa447 +size 382629 diff --git a/understandingwhygeneralizedreweightingdoesnotimproveovererm/6995370d-e775-4b9f-a371-0c0512012986_content_list.json b/understandingwhygeneralizedreweightingdoesnotimproveovererm/6995370d-e775-4b9f-a371-0c0512012986_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..aaaeca833e9db82b10c68a03420320c2e660458a --- /dev/null +++ b/understandingwhygeneralizedreweightingdoesnotimproveovererm/6995370d-e775-4b9f-a371-0c0512012986_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:41f71230b10ef9cc65e9a6a2b70b14c4abfa9dc8996e02588c0204dcc000cdaf +size 331874 diff --git a/understandingwhygeneralizedreweightingdoesnotimproveovererm/6995370d-e775-4b9f-a371-0c0512012986_model.json b/understandingwhygeneralizedreweightingdoesnotimproveovererm/6995370d-e775-4b9f-a371-0c0512012986_model.json new file mode 100644 index 0000000000000000000000000000000000000000..800f2460035ea61e2278594e681cffc864d18b91 --- /dev/null +++ b/understandingwhygeneralizedreweightingdoesnotimproveovererm/6995370d-e775-4b9f-a371-0c0512012986_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:503ddd71b1e4d91be9f58435b14ec29694171e4852ff6c0b4f39a26a2b3a5e80 +size 378927 diff --git a/understandingwhygeneralizedreweightingdoesnotimproveovererm/6995370d-e775-4b9f-a371-0c0512012986_origin.pdf b/understandingwhygeneralizedreweightingdoesnotimproveovererm/6995370d-e775-4b9f-a371-0c0512012986_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e837c7c617835f2e8db6cca786421a62d9d48a3b --- /dev/null +++ b/understandingwhygeneralizedreweightingdoesnotimproveovererm/6995370d-e775-4b9f-a371-0c0512012986_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:560896e1ece2e92406cb568a3668ad1d7164c5e6f4c51831082950fd29bbf464 +size 757258 diff --git a/understandingwhygeneralizedreweightingdoesnotimproveovererm/full.md b/understandingwhygeneralizedreweightingdoesnotimproveovererm/full.md new file mode 100644 index 0000000000000000000000000000000000000000..f541cf7ab4893784ad3adff8d460e1c8ec187632 --- /dev/null +++ b/understandingwhygeneralizedreweightingdoesnotimproveovererm/full.md @@ -0,0 +1,1627 @@ +# UNDERSTANDING WHY GENERALIZED REWEIGHTING DOES NOT IMPROVE OVER ERM + +Runtian Zhai, Chen Dan, Zico Kolter, Pradeep Ravikumar + +Carnegie Mellon University + +Pittsburgh, PA, USA 15213 + +{rzhai,cdan,zkolter,pradeepr}@cs.cmu.edu + +# ABSTRACT + +Empirical risk minimization (ERM) is known to be non-robust in practice to distributional shift where the training and the test distributions are different. A suite of approaches, such as importance weighting, and variants of distributionally robust optimization (DRO), have been proposed to solve this problem. But a line of recent work has empirically shown that these approaches do not significantly improve over ERM in real applications with distribution shift. The goal of this work is to obtain a comprehensive theoretical understanding of this intriguing phenomenon. We first posit the class of Generalized Reweighting (GRW) algorithms, as a broad category of approaches that iteratively update model parameters based on iterative reweighting of the training samples. We show that when overparameterized models are trained under GRW, the resulting models are close to that obtained by ERM. We also show that adding small regularization which does not greatly affect the empirical training accuracy does not help. Together, our results show that a broad category of what we term GRW approaches are not able to achieve distributionally robust generalization. Our work thus has the following sobering takeaway: to make progress towards distributionally robust generalization, we either have to develop non-GRW approaches, or perhaps devise novel classification/regression loss functions that are adapted to GRW approaches. + +# 1 INTRODUCTION + +It has now been well established that empirical risk minimization (ERM) can empirically achieve high test performance on a variety of tasks, particularly with modern overparameterized models where the number of parameters is much larger than the number of training samples. This strong performance of ERM however has been shown to degrade under distributional shift, where the training and test distributions are different (Hovy & Søgaard, 2015; Blodgett et al., 2016; Tatman, 2017). There are two broad categories of distribution shift: domain generalization, defined as the scenario where the test distribution contains samples from new domains that did not appear during training; and subpopulation shift, defined as the scenario where the training set contains several subgroups and the testing distribution weighs these subgroups differently, like in fair machine learning. + +People have proposed various approaches to learn models robust to distributional shift. The most classical one is importance weighting (IW) (Shimodaira, 2000; Fang et al., 2020), which reweights training samples; for subpopulation shift these weights are typically set so that each subpopulation has the same overall weight in the training objective. The approach most widely used today is Distributional Robust Optimization (DRO) (Duchi & Namkoong, 2018; Hashimoto et al., 2018), which assumes that the test distribution belongs to a certain uncertainty set of distributions that are close to the training distribution, and train on the worst distribution in that set. Many variants of DRO have been proposed and are used in practice (Sagawa et al., 2020a; Zhai et al., 2021a;b). + +While these approaches have been developed for the express purpose of improving ERM for distribution shift, a line of recent work has empirically shown the negative result that when used to train overparameterized models, these methods do not improve over ERM. For IW, Byrd & Lipton (2019) observed that its effect under stochastic gradient descent (SGD) diminishes over training epochs, and finally does not improve over ERM. For variants of DRO, Sagawa et al. (2020a) found that these methods overfit very easily, i.e. their test performances will drop to the same low level as ERM after sufficiently many epochs if no regularization is applied. Gulrajani & Lopez-Paz (2021); Koh et al. + +(2021) compared these methods with ERM on a number of real-world applications, and found that in most cases none of these methods improves over ERM. + +This line of empirical results has also been bolstered by some recent theoretical results. Sagawa et al. (2020b) constructed a synthetic dataset where a linear model trained with IW is provably not robust to subpopulation shift. Xu et al. (2021) further proved that under gradient descent (GD) with a sufficiently small learning rate, a linear classifier trained with either IW or ERM converges to the same max-margin classifier, and thus upon convergence, are no different. These previous theoretical results are limited to linear models and specific approaches such as IW where sample weights are fixed during training. They are not applicable to more complex models, and more general approaches where the sample weights could iteratively change, including most DRO variants. + +Towards placing the empirical results on a stronger theoretical footing, we define the class of generalized reweighting (GRW), which dynamically assigns weights to the training samples, and iteratively minimizes the weighted average of the sample losses. By allowing the weights to vary with iterations, we cover not just static importance weighting, but also DRO approaches outlined earlier; though of course, the GRW class is much broader than just these instances. + +Main contributions. We prove that GRW and ERM have (almost) equivalent implicit biases, in the sense that the points they converge to are very close to each other, under a much more general setting than those used in previous work. Thus, GRW cannot improve over ERM because it does not yield a significantly different model. We are the first to extend this line of theoretical results (i) to wide neural networks, (ii) to reweighting methods with dynamic weights, (iii) to regression tasks, and (iv) to methods with $L_{2}$ regularization. We note that these extensions are non-trivial technically as they require the result that wide neural networks can be approximated by their linearized counterparts to hold uniformly throughout the iterative process of GRW algorithms. Moreover, we fix the proof in a previous paper (Lee et al., 2019) (see Appendix E) which is also a great contribution. + +Overall, the important takeaway is that distributionally robust generalization (DRG) cannot be directly achieved by the broad class of GRW algorithms (which includes popular approaches such as importance weighting and most DRO variants). Progress towards this important goal thus requires either going beyond GRW algorithms, or devising novel loss functions that are adapted to GRW approaches. In Section 6 we will discuss some promising future directions and the case with nonoverparameterized models and early stopping. Finally, we want to emphasize that while the models we use in our results (linear models and wide neural networks) are different from practical models, they are general models most widely used in existing theory papers, and our results based on these models provide explanations to the baffling observations made in previous empirical work, as well as valuable insights into how to improve distributionally robust generalization. + +# 2 PRELIMINARIES + +Let the input space be $\mathcal{X} \subseteq \mathbb{R}^d$ and the output space be $\mathcal{V} \subseteq \mathbb{R}$ .1 We assume that $\mathcal{X}$ is a subset of the unit $L_2$ ball of $\mathbb{R}^d$ , so that any $\pmb{x} \in \mathcal{X}$ satisfies $\| \pmb{x} \|_2 \leq 1$ . We have a training set $\{\pmb{z}_i = (\pmb{x}_i, y_i)\}_{i=1}^n$ i.i.d. sampled from an underlying distribution $P$ over $\mathcal{X} \times \mathcal{Y}$ . Denote $\pmb{X} = (x_1, \dots, x_n) \in \mathbb{R}^{d \times n}$ and $\pmb{Y} = (y_1, \dots, y_n) \in \mathbb{R}^n$ . For any function $g: \mathcal{X} \mapsto \mathbb{R}^m$ , we overload notation and use $g(\pmb{X}) = (g(x_1), \dots, g(x_n)) \in \mathbb{R}^{m \times n}$ (except when $m = 1$ , $g(\pmb{X})$ is defined as a column vector). Let the loss function be $\ell: \mathcal{Y} \times \mathcal{Y} \to [0,1]$ . ERM trains a model by minimizing its expected risk $\mathcal{R}(f; P) = \mathbb{E}_{\pmb{z} \sim P}[\ell(f(\pmb{x}), y)]$ via minimizing the empirical risk $\hat{\mathcal{R}}(f) = \frac{1}{n} \sum_{i=1}^{n} \ell(f(\pmb{x}_i), y_i)$ . + +In distributional shift, the model is evaluated not on the training distribution $P$ , but a different test distribution $P_{\mathrm{test}}$ , so that we care about the expected risk $\mathcal{R}(f;P_{\mathrm{test}})$ . A large family of methods designed for such distributional shift is distributionally robust optimization (DRO), which minimizes the expected risk over the worst-case distribution $Q \ll P^2$ in a ball w.r.t. divergence $D$ around the training distribution $P$ . Specifically, DRO minimizes the expected DRO risk defined as: + +$$ +\mathcal {R} _ {D, \rho} (f; P) = \sup _ {Q \ll P} \left\{\mathbb {E} _ {Q} [ \ell (f (\boldsymbol {x}), y) ]: D (Q \| P) \leq \rho \right\} \tag {1} +$$ + +for $\rho > 0$ . Examples include CVaR, $\chi^2$ -DRO (Hashimoto et al., 2018), and DORO (Zhai et al., 2021a), among others. + +A common category of distribution shift is known as subpopulation shift. Let the data domain contain $K$ groups $\mathcal{D}_1, \dots, \mathcal{D}_K$ . The training distribution $P$ is the distribution over all groups, and the test distribution $P_{\mathrm{test}}$ is the distribution over one of the groups. Let $P_k(z) = P(z \mid z \in \mathcal{D}_k)$ be the conditional distribution over group $k$ , then $P_{\mathrm{test}}$ can be any one of $P_1, \dots, P_k$ . The goal is to train a model $f$ that performs well over every group. There are two common ways to achieve this goal: one is minimizing the balanced empirical risk which is an unweighted average of the empirical risk over each group, and the other is minimizing the worst-group risk defined as + +$$ +\mathcal {R} _ {\max } (f; P) = \max _ {k = 1, \dots , K} \mathcal {R} (f; P _ {k}) = \max _ {k = 1, \dots , K} \mathbb {E} _ {z \sim P} [ \ell (f (\boldsymbol {x}), y) | z \in \mathcal {D} _ {k} ] \tag {2} +$$ + +# 3 GENERALIZED REWEIGHTING (GRW) + +Various methods have been proposed towards learning models that are robust to distributional shift. In contrast to analyzing each of these individually, we instead consider a large class of what we call Generalized Reweighting (GRW) algorithms that includes the ones mentioned earlier, but potentially many others more. Loosely, GRW algorithms iteratively assign each sample a weight during training (that could vary with the iteration) and iteratively minimize the weighted average risk. Specifically, at iteration $t$ , GRW assigns a weight $q_{i}^{(t)}$ to sample $z_{i}$ , and minimizes the weighted empirical risk: + +$$ +\hat {\mathcal {R}} _ {\boldsymbol {q} ^ {(t)}} (f) = \sum_ {i = 1} ^ {n} q _ {i} ^ {(t)} \ell \left(f \left(\boldsymbol {x} _ {i}\right), y _ {i}\right) \tag {3} +$$ + +where $\pmb{q}^{(t)} = (q_1^{(t)},\dots ,q_n^{(t)})$ and $q_{1}^{(t)} + \dots +q_{n}^{(t)} = 1$ + +Static GRW assigns to each $z_{i} = (x_{i},y_{i})$ a fixed weight $q_{i}$ that does not change during training, i.e. $q_{i}^{(t)}\equiv q_{i}$ . A classical method is importance weighting (IW) (Shimodaira, 2000), where if $z_{i}\in \mathcal{D}_{k}$ and the size of $\mathcal{D}_k$ is $n_k$ , then $q_{i} = (Kn_{k})^{-1}$ . Under IW, (3) becomes the balanced empirical risk in which each group has the same weight. Note that ERM is also a special case of static GRW. + +On the other hand, in dynamic GRW, $\pmb{q}^{(t)}$ changes with $t$ . For instance, any approach that iteratively upweights samples with high losses in order to help the model learn "hard" samples, such as DRO, is an instance of GRW. When estimating the population DRO risk $\mathcal{R}_{D,\rho}(f;P)$ in Eqn. (1), if $P$ is set to the empirical distribution over the training samples, then $Q \ll P$ implies that $Q$ is also a distribution over the training samples. Thus, DRO methods belong to the broad class of GRW algorithms. There are two common ways to implement DRO. One uses Danskin's theorem and chooses $Q$ as the maximizer of $\mathbb{E}_Q[\ell (f(\pmb {x}),y)]$ in each epoch. The other one formulates DRO as a bi-level optimization problem, where the lower level updates the model to minimize the expected risk over $Q$ , and the upper level updates $Q$ to maximize it. Both can be seen as instances of GRW. As one popular instance of the latter, Group DRO was proposed by Sagawa et al. (2020a) to minimize (2). Denote the empirical risk over group $k$ by $\hat{\mathcal{R}}_k(f)$ , and the model at time $t$ by $f^{(t)}$ . Group DRO iteratively sets $q_{i}^{(t)} = g_{k}^{(t)} / n_{k}$ for all $z_{i}\in \mathcal{D}_{k}$ where $g_{k}^{(t)}$ is the group weight that is updated as + +$$ +g _ {k} ^ {(t)} \propto g _ {k} ^ {(t - 1)} \exp \left(\nu \hat {\mathcal {R}} _ {k} (f ^ {(t - 1)})\right) (\forall k = 1, \dots , K) \tag {4} +$$ + +for some $\nu > 0$ , and then normalized so that $q_1^{(t)} + \dots + q_n^{(t)} = 1$ . Sagawa et al. (2020a) then showed (in their Proposition 2) that for convex settings, the Group DRO risk of iterates converges to the global minimum with the rate $O(t^{-1/2})$ if $\nu$ is sufficiently small. + +# 4 THEORETICAL RESULTS FOR REGRESSION + +In this section, we will study GRW for regression tasks that use the squared loss + +$$ +\ell (\hat {y}, y) = \frac {1}{2} (\hat {y} - y) ^ {2}. \tag {5} +$$ + +We will prove that for both linear models and sufficiently wide fully-connected neural networks, the implicit bias of GRW is equivalent to ERM, which means that starting from the same initial point, GRW and ERM will converge to the same point when trained for an infinitely long time. Thus, GRW cannot improve over ERM as it produces the exact same model as ERM. We will further show that while regularization can affect this implicit bias, it must be large enough to significantly lower the training performance, or the final model will still be similar to the unregularized ERM model. + +![](images/a4381eb4fb1c1fa7c7c0b683f384d38abcb95964aa4c2a8b21126b10b1820e35.jpg) +(a) Weight Difference + +![](images/9afdf42076619b381f31d1f781debe6488fb7e6bc16c01c2274444005ecfa878.jpg) +Figure 1: Experimental results of ERM, importance weighting (IW) and Group DRO (GDRO) with the squared loss on six MNIST images with a linear model. All norms are $L_{2}$ norms. + +![](images/3dd339bdc356e2e141771f4b273e42ae2061ffdd8126b64e0602e46f3ffe0b6a.jpg) +(b) Norm of ERM Model +(c) Training Loss + +![](images/e9d6dae3ad321ca9dd9c23836cd5eb31f3d57bfb99b1b3877a0f1b1a51483ae3.jpg) +(d) Group Weights + +# 4.1 LINEAR MODELS + +We first demonstrate our result on simple linear models to provide our readers with a key intuition which we will later apply to neural networks. This key intuition draws from results of Gunasekar et al. (2018). Let the linear model be denoted by $f(\pmb{x}) = \langle \theta, \pmb{x} \rangle$ , where $\theta \in \mathbb{R}^d$ . We consider the overparameterized setting where $d > n$ . The weight update rule of GRW under GD is the following: + +$$ +\theta^ {(t + 1)} = \theta^ {(t)} - \eta \sum_ {i = 1} ^ {n} q _ {i} ^ {(t)} \nabla_ {\theta} \ell \left(f ^ {(t)} \left(\boldsymbol {x} _ {i}\right), y _ {i}\right) \tag {6} +$$ + +where $\eta > 0$ is the learning rate. For a linear model with the squared loss, the update rule is + +$$ +\theta^ {(t + 1)} = \theta^ {(t)} - \eta \sum_ {i = 1} ^ {n} q _ {i} ^ {(t)} \boldsymbol {x} _ {i} \left(f ^ {(t)} \left(\boldsymbol {x} _ {i}\right) - y _ {i}\right) \tag {7} +$$ + +For this training scheme, we can prove that if the training error converges to zero, then the model converges to an interpolator $\theta^{*}$ (s.t. $\forall i$ , $\langle \theta^{*},\pmb{x}_{i}\rangle = y_{i}$ ) independent of $q_{i}^{(t)}$ (proofs in Appendix D): + +Theorem 1. If $x_{1}, \dots, x_{n}$ are linearly independent, then under the squared loss, for any GRW such that the empirical training risk $\hat{\mathcal{R}}(f^{(t)}) \to 0$ as $t \to \infty$ , it holds that $\theta^{(t)}$ converges to an interpolator $\theta^{*}$ that only depends on $\theta^{(0)}$ and $x_{1}, \dots, x_{n}$ , but does not depend on $q_{i}^{(t)}$ . + +The proof is based on the following key intuition regarding the update rule (7): $\theta^{(t + 1)} - \theta^{(t)}$ is a linear combination of $x_{1},\dots ,x_{n}$ for all $t$ , so $\theta^{(t)} - \theta^{(0)}$ always lies in the linear subspace $\mathrm{span}\{\pmb {x}_1,\dots ,\pmb {x}_n\}$ , which is an $n$ -dimensional linear subspace if $x_{1},\dots ,x_{n}$ are linearly independent. By Cramer's rule, there is exactly one $\tilde{\theta}$ in this subspace such that we get interpolation of all the data $\langle \tilde{\theta} +\theta^{(0)},\pmb{x}_i\rangle = y_i$ for all $i\in \{1,\ldots ,n\}$ . In other words, the parameter $\theta^{*} = \tilde{\theta} +\theta^{(0)}$ in this subspace that interpolates all the data is unique. Thus the proof would follow if we were to show that $\theta^{(t)} - \theta^{(0)}$ , which lies in the subspace, also converges to interpolating the data. Moreover, this proof works for any first-order optimization method such that the training risk converges to 0. + +We have essentially proved the following sobering result: any GRW algorithm that achieves zero training error exactly produces the ERM model, so it does not improve over ERM. While the various distributional shift methods discussed in the introduction have been shown to satisfy the precondition of convergence to zero training error with overparameterized models and linearly independent inputs (Sagawa et al., 2020a), we provide the following theorem that shows this for the broad class of GRW methods. Specifically, we show this result for any GRW method that satisfies the following assumption with a sufficiently small learning rate: + +Assumption 1. There are constants $q_{1},\dots ,q_{n}$ s.t. $\forall i,q_i^{(t)}\to q_i$ as $t\to \infty$ . And $\min_{i}q_{i} = q^{*} > 0$ Theorem 2. If $x_{1},\dots ,x_{n}$ are linearly independent, then there exists $\eta_0 > 0$ such that for any GRW satisfying Assumption 1 with the squared loss, and any $\eta \leq \eta_0$ , the empirical training risk $\hat{\mathcal{R}} (f^{(t)})\rightarrow 0$ as $t\to \infty$ + +Finally, we use a simple experiment to demonstrate the correctness of this result. The experiment is conducted on a training set of six MNIST images, five of which are digit 0 and one is digit 1. We use a 784-dimensional linear model and run ERM, importance weighting and group DRO. The results are presented in Figure 1, and they show that the training loss of each method converges to 0, and the gap between the model weights of importance weighting, Group DRO and ERM converges to 0, meaning that all three model weights converge to the same point, whose $L_{2}$ norm is about 0.63. Figure 1d also shows that the group weights in Group DRO empirically satisfy Assumption 1. + +# 4.2 WIDE NEURAL NETWORKS (WIDE NNS) + +Now we study sufficiently wide fully-connected neural networks. We extend the analysis in Lee et al. (2019) in the neural tangent kernel (NTK) regime (Jacot et al., 2018). In particular we study + +the following network: + +$$ +\boldsymbol {h} ^ {l + 1} = \frac {W ^ {l}}{\sqrt {d _ {l}}} \boldsymbol {x} ^ {l} + \beta \boldsymbol {b} ^ {l} \quad \text {a n d} \quad \boldsymbol {x} ^ {l + 1} = \sigma (\boldsymbol {h} ^ {l + 1}) \quad (l = 0, \dots , L) \tag {8} +$$ + +where $\sigma$ is a non-linear activation function, $W^{l}\in \mathbb{R}^{d_{l + 1}\times d_{l}}$ and $W^{L}\in \mathbb{R}^{1\times d_{L}}$ . Here $d_0 = d$ . The parameter vector $\theta$ consists of $W^0,\dots ,W^L$ and $b^{0},\dots ,b^{L}$ ( $\theta$ is the concatenation of all flattened weights and biases). The final output is $f(\pmb {x}) = \pmb{h}^{L + 1}$ . And let the neural network be initialized as + +$$ +\left\{ \begin{array}{l} W _ {i, j} ^ {l (0)} \sim \mathcal {N} (0, 1) \\ \boldsymbol {b} _ {j} ^ {l (0)} \sim \mathcal {N} (0, 1) \end{array} \quad (l = 0, \dots , L - 1) \right. \quad \text {a n d} \quad \left\{ \begin{array}{l} W _ {i, j} ^ {L (0)} = 0 \\ \boldsymbol {b} _ {j} ^ {L (0)} \sim \mathcal {N} (0, 1) \end{array} \right. \tag {9} +$$ + +We also need the following assumption on the wide neural network: + +Assumption 2. $\sigma$ is differentiable everywhere. Both $\sigma$ and its first-order derivative $\dot{\sigma}$ are Lipschitz.3 + +Difference from Jacot et al. (2018). Our initialization (9) differs from the original one in Jacot et al. (2018) in the last (output) layer, where we use the zero initialization $W_{i,j}^{L(0)} = 0$ instead of the Gaussian initialization $W_{i,j}^{L(0)} \sim \mathcal{N}(0,1)$ . This modification permits us to accurately approximate the NN with its linearized counterpart (11), as we notice that the proofs in Lee et al. (2019) (particularly the proofs of their Theorem 2.1 and their Lemma 1 in Appendix G) are flawed. In Appendix E we will explain what went wrong in their proofs and how we fix it with this modification. + +Denote the neural network at time $t$ by $f^{(t)}(\pmb{x}) = f(\pmb{x};\theta^{(t)})$ which is parameterized by $\theta^{(t)}\in \mathbb{R}^p$ where $p$ is the number of parameters. We use the shorthand $\nabla_{\theta}f^{(0)}(\pmb{x}):= \nabla_{\theta}f(\pmb{x};\theta)\big|_{\theta = \theta_0}$ . The neural tangent kernel (NTK) of this model is $\Theta^{(0)}(\pmb{x},\pmb{x}^{\prime}) = \nabla_{\theta}f^{(0)}(\pmb{x})^{\top}\nabla_{\theta}f^{(0)}(\pmb{x}^{\prime})$ , and the Gram matrix is $\Theta^{(0)} = \Theta^{(0)}(\pmb {X},\pmb {X})\in \mathbb{R}^{n\times n}$ . For this wide NN, we still have the following NTK theorem: + +Lemma 3. If $\sigma$ is Lipschitz and $d_l\to \infty$ for $l = 1,\dots ,L$ sequentially, then $\Theta^{(0)}(\pmb {x},\pmb{x}^{\prime})$ converges in probability to a non-degenerate4 deterministic limiting kernel $\Theta (\pmb {x},\pmb{x}^{\prime})$ + +The kernel Gram matrix $\Theta = \Theta(\mathbf{X},\mathbf{X}) \in \mathbb{R}^{n\times n}$ is a positive semi-definite symmetric matrix. Denote its largest and smallest eigenvalues by $\lambda^{\max}$ and $\lambda^{\min}$ . Note that $\Theta$ is non-degenerate, so we can assume that $\lambda^{\min} > 0$ (which is almost surely true when $d_L \gg n$ ). Then we have: + +Theorem 4. Let $f^{(t)}$ be a wide fully-connected neural network that satisfies Assumption 2 and is trained by any GRW satisfying Assumption 1 with the squared loss. Let $f_{\mathrm{ERM}}^{(t)}$ be the same model trained by ERM from the same initial point. If $d_1 = \dots = d_L = \tilde{d}$ , $\nabla_\theta f^{(0)}(\pmb{x}_1), \dots, \nabla_\theta f^{(0)}(\pmb{x}_n)$ are linearly independent, and $\lambda^{\min} > 0$ , then there exists a constant $\eta_1 > 0$ such that: if $\eta \leq \eta_1^5$ , then for any $\delta > 0$ , there exists $\tilde{D} > 0$ such that as long as $\tilde{d} \geq \tilde{D}$ , with probability at least $(1 - \delta)$ over random initialization we have: for any test point $\pmb{x} \in \mathbb{R}^d$ such that $\| \pmb{x} \|_2 \leq 1$ , as $\tilde{d} \to \infty$ , + +$$ +\lim _ {t \rightarrow \infty} \left| f ^ {(t)} (\boldsymbol {x}) - f _ {\mathrm {E R M}} ^ {(t)} (\boldsymbol {x}) \right| = O \left(\tilde {d} ^ {- 1 / 4}\right)\rightarrow 0 \tag {10} +$$ + +Essentially this theorem implies that on any test point $\pmb{x}$ in the unit ball, the GRW model and the ERM model produce almost the same output, so they have almost the same performance. Note that for simplicity, we only prove for $d_{1} = \dots = d_{L} = \tilde{d}\rightarrow \infty$ , but the result can be very easily extended to the case where $d_l / d_1\to \alpha_l$ for $l = 2,\dots ,L$ for some constants $\alpha_{2},\dots ,\alpha_{L}$ , and $d_{1}\rightarrow \infty$ . The key to proving this theorem is to consider the linearized neural network of $f^{(t)}(\pmb {x})$ : + +$$ +f _ {\operatorname {l i n}} ^ {(t)} (\boldsymbol {x}) = f ^ {(0)} (\boldsymbol {x}) + \left\langle \theta^ {(t)} - \theta^ {(0)}, \nabla_ {\theta} f ^ {(0)} (\boldsymbol {x}) \right\rangle \tag {11} +$$ + +which is a linear model w.r.t. $\nabla_{\theta}f^{(0)}(\pmb{x})$ . If $\nabla_{\theta}f^{(0)}(\pmb{x}_1),\dots,\nabla_{\theta}f^{(0)}(\pmb{x}_n)$ are linearly independent (which is almost surely true when the model is overparameterized so that $\theta$ has a very high dimension), then our key intuition tells us that the linearized NN will converge to the unique interpolator. Then we show that the wide NN can be approximated by its linearized counterpart uniformly throughout training, which is considerably more subtle in our case due to the GRW dynamics. Here we prove the upper bound $O(\tilde{d}^{-1 / 4})$ , but in fact the upper bound can be $O(\tilde{d}^{-1 / 2 + \epsilon})$ for any $\epsilon >0$ : + +${}^{3}f$ is Lipschitz if there exists a constant $L > 0$ such that for any ${\mathbf{x}}_{1},{\mathbf{x}}_{2},\left| {f\left( {\mathbf{x}}_{1}\right) - f\left( {\mathbf{x}}_{2}\right) }\right| \leq L{\begin{Vmatrix}{\mathbf{x}}_{1} - {\mathbf{x}}_{2}\end{Vmatrix}}_{2}$ . +4 Non-degenerate means that $\Theta (\pmb {x},\pmb{x}^{\prime})$ depends on $\pmb{x}$ and $x^{\prime}$ and is not a constant. +For ease of understanding, later we will write this condition as "with a sufficiently small learning rate". + +Lemma 5 (Approximation Theorem). For a wide fully-connected neural network $f^{(t)}$ satisfying Assumption 2 and is trained by any GRW satisfying Assumption 1 with the squared loss, let $f_{\mathrm{lin}}^{(t)}$ be its linearized neural network trained by the same GRW (i.e. $q_i^{(t)}$ are the same for both networks for any $i$ and $t$ ). Under the conditions of Theorem 4, with a sufficiently small learning rate, for any $\delta > 0$ , there exist constants $\tilde{D} > 0$ and $C > 0$ such that as long as $\tilde{d} \geq \tilde{D}$ , with probability at least $(1 - \delta)$ over random initialization we have: for any test point $\pmb{x} \in \mathbb{R}^d$ such that $\| \pmb{x} \|_2 \leq 1$ , + +$$ +\sup _ {t \geq 0} \left| f _ {\ln} ^ {(t)} (\boldsymbol {x}) - f ^ {(t)} (\boldsymbol {x}) \right| \leq C \tilde {d} ^ {- 1 / 4} \tag {12} +$$ + +This lemma essentially says that throughout the GRW training process, on any test point $x$ in the unit ball, the linear NN and the wide NN produce almost the same output. So far, we have shown that in a regression task, for both linear and wide NNs, GRW does not improve over ERM. + +# 4.3 WIDE NEURAL NETWORKS, WITH $L_{2}$ REGULARIZATION + +Previous work such as Sagawa et al. (2020a) proposed to improve GRW by adding $L_{2}$ penalty to the objective function. In this section, we thus study adding $L_{2}$ regularization to GRW algorithms: + +$$ +\hat {\mathcal {R}} _ {\boldsymbol {q} ^ {(t)}} ^ {\mu} (f) = \sum_ {i = 1} ^ {n} q _ {i} ^ {(t)} \ell \left(f \left(\boldsymbol {x} _ {i}\right), y _ {i}\right) + \frac {\mu}{2} \left\| \theta - \theta^ {(0)} \right\| _ {2} ^ {2} \tag {13} +$$ + +At first sight, adding regularization seems to be a natural approach and should make a difference. Indeed, from the outset, we can easily show that with $L_{2}$ regularization, the GRW model and the ERM model are different unlike the case without regularization. As an concrete example, when $f$ is a linear model, $\ell$ is convex and smooth, then $\hat{\mathcal{R}}_{\boldsymbol{q}^{(t)}}^{\mu}(f)$ with static GRW is a convex smooth objective function, so under GD with a sufficiently small learning rate, the model will converge to the global minimizer (see Appendix D.1). Moreover, the global optimum $\theta^{*}$ satisfies $\nabla_{\theta}\hat{\mathcal{R}}_{\boldsymbol{q}^{(t)}}^{\mu}(f(\boldsymbol{x};\theta^{*})) = 0$ , solving which yields $\theta^{*} = \theta^{(0)} + (\boldsymbol{X}\boldsymbol{Q}\boldsymbol{X}^{\top} + \mu \boldsymbol{I})^{-1}\boldsymbol{X}\boldsymbol{Q}(\boldsymbol{Y} - f^{(0)}(\boldsymbol{X}))$ , which depends on $Q = \mathrm{diag}(q_1,\dots ,q_n)$ , so adding $L_{2}$ regularization at least seems to yield different results from ERM (albeit whether it improves over ERM might depend on $q_{1},\dots ,q_{n}$ ). + +However, the following result shows that this regularization must be large enough to significantly lower the training performance, or the final model would still be close to the unregularized ERM model. We still denote the largest and smallest eigenvalues of the kernel Gram matrix $\Theta$ by $\lambda^{\mathrm{max}}$ and $\lambda^{\mathrm{min}}$ . We use the subscript "reg" to refer to a regularized model (trained by minimizing (13)). + +Theorem 6. Suppose there exists $M_0 > 0$ s.t. $\left\| \nabla_\theta f^{(0)}(\pmb{x}) \right\|_2 \leq M_0$ for all $\| \pmb{x} \|_2 \leq 1$ . If $\lambda^{\min} > 0$ and $\mu > 0$ , then for a wide NN satisfying Assumption 2, and any GRW minimizing the squared loss with a sufficiently small learning rate $\eta$ , if $d_1 = d_2 = \dots = d_L = \tilde{d}$ , $\nabla_\theta f^{(0)}(\pmb{x}_1), \dots, \nabla_\theta f^{(0)}(\pmb{x}_n)$ are linearly independent, and the empirical training risk of $f_{\mathrm{reg}}^{(t)}$ satisfies + +$$ +\lim _ {t \rightarrow \infty} \hat {\mathcal {R}} \left(f _ {\text {r e g}} ^ {(t)}\right) < \epsilon \tag {14} +$$ + +for some $\epsilon > 0$ , then with a sufficiently small learning rate, as $\tilde{d} \to \infty$ , with probability close to 1 over random initialization, for any $\pmb{x}$ such that $\| \pmb{x} \|_2 \leq 1$ we have + +$$ +\lim _ {t \rightarrow \infty} \left| f _ {\operatorname {r e g}} ^ {(t)} (\boldsymbol {x}) - f _ {\mathrm {E R M}} ^ {(t)} (\boldsymbol {x}) \right| = O \left(\tilde {d} ^ {- 1 / 4} + \sqrt {\epsilon}\right)\rightarrow O (\sqrt {\epsilon}) \tag {15} +$$ + +where $f_{\mathrm{reg}}^{(t)}$ is trained by regularized GRW and $f_{\mathrm{ERM}}^{(t)}$ by unregularized ERM from same initial points. + +This theorem essentially says that if the regularization is too small and the training error is close to zero, then the regularized GRW model still produces an output very close to that of the ERM model on any test point $\pmb{x}$ in the unit ball. Thus, a small regularization makes little difference. + +The proof again starts from analyzing linearized NNs, and showing that regularization does not help there (Appendix D.4.2). Then, we prove a new approximation theorem for $L_{2}$ regularized GRW connecting wide NNs to linearized NNs uniformly throughout training (Appendix D.4.1). With regularization, we no longer need Assumption 1 to prove the new approximation theorem which was used to prove the convergence of GRW, because with regularization GRW naturally converges. + +![](images/a5dff35b58e1deac7854aa16e42c331fd79843bd0cd0dd599b5f0cfa6eac20a8.jpg) +(a) Weight Difference + +![](images/df7fdcacf190f47bb07b44974279face3b414aec2c587a90710725b45fed3b00.jpg) +(b) Training Loss +Figure 2: Experimental results of ERM, importance weighting (IW) and Group DRO (GDRO) with $L_{2}$ regularization with the squared loss. Left two: $\mu = 0.1$ ; Right two: $\mu = 10$ . + +![](images/480bbc05d51a809ebd37f49bcd3139a08cb049d03292d805753cd4c5dc29bb9d.jpg) +(c) Weight Difference + +![](images/1f89658626e405939e554e6e9bc711ad83764e42e2f21403e051d776b4597c60.jpg) +(d) Training Loss + +To empirically demonstrate this result, we run the same experiment as in Section 4.1 but with $L_{2}$ regularization. The results are presented in Figure 2. We can see that when the regularization is small, the training losses still converge to 0, and the three model weights still converge to the same point. On the contrary, with a large regularization, the training loss does not converge to 0, and the three model weights converge to different points. This shows that the regularization must be large enough to lower the training performance to make a significant difference to the implicit bias. + +# 5 THEORETICAL RESULTS FOR CLASSIFICATION + +Now we consider classification where $\mathcal{V} = \{+1, -1\}$ . The big difference is that classification losses don't have finite minimizers. A classification loss converging to zero means that the model weight "explodes" to infinity instead of converging to a finite point. We focus on the canonical logistic loss: + +$$ +\ell (\hat {y}, y) = \log (1 + \exp (- \hat {y} y)) \tag {16} +$$ + +# 5.1 LINEAR MODELS + +We first consider training the linear model $f(\pmb{x}) = \langle \theta, \pmb{x} \rangle$ with GRW under gradient descent with the logistic loss. As noted earlier, in this setting, Byrd & Lipton (2019) made the empirical observation that importance weighting does not improve over ERM. Then, Xu et al. (2021) proved that for importance weighting algorithms, as $t \to \infty$ , $\| \theta^{(t)} \|_2 \to \infty$ and $\theta^{(t)} / \| \theta^{(t)} \|_2$ converges to a unit vector that does not depend on the sample weights, so it does not improve over ERM. To extend this theoretical result to the broad class of GRW algorithms, we will prove two results. First, in Theorem 7 we will show that for the logistic loss and any GRW algorithm satisfying the weaker assumption: + +Assumption 3. For all $i$ , $\lim \inf_{t\to \infty}q_i^{(t)} > 0$ + +if the training error converges to 0, and the direction of the model weight converges to a fixed unit vector, then this unit vector must be the max-margin classifier defined as + +$$ +\hat {\theta} _ {\mathrm {M M}} = \underset {\theta : \| \theta \| _ {2} = 1} {\arg \max } \left\{\underset {i = 1, \dots , n} {\min } y _ {i} \cdot \langle \theta , \boldsymbol {x} _ {i} \rangle \right\} \tag {17} +$$ + +Second, Theorem 8 shows that for any GRW satisfying Assumption 1, the training error converges to 0 and the direction of the model weight converges, so it does not improve over ERM. + +Theorem 7. If $x_1, \dots, x_n$ are linearly independent, then for the logistic loss, we have: for any GRW satisfying Assumption 3, if as $t \to \infty$ the empirical training risk $\hat{\mathcal{R}}(f^{(t)})$ converges to 0 and $\theta^{(t)} / \| \theta^{(t)} \|_2 \to u$ for some unit vector $u$ , then $u = \hat{\theta}_{MM}$ . + +This result is an extension of Soudry et al. (2018), and says that all GRW methods (including ERM) make the model converge to the same point $\hat{\theta}_{\mathrm{MM}}$ that does not depend on $q_{i}^{(t)}$ . In other words, the samples weights do not affect the implicit bias. Thus, for any GRW method that only satisfies the weak Assumption 3, as long as the training error converges to 0 and the model weight direction converges, GRW does not improve over ERM. We next show that any GRW satisfying Assumption 1 does have its model weight direction converge, and its training error converge to 0. + +Theorem 8. For any loss $\ell$ that is convex, $L$ -smooth in $\hat{y}$ and strictly monotonically decreasing to zero as $y\hat{y} \to +\infty$ , and GRW satisfying Assumption 1, denote $F(\theta) = \sum_{i=1}^{n} q_i \ell(\langle \theta, \pmb{x}_i \rangle, y_i)$ . If $\pmb{x}_1, \dots, \pmb{x}_n$ are linearly independent, then with a sufficiently small learning rate $\eta$ , we have: + +(i) $F(\theta^{(t)})\to 0$ as $t\to \infty$ + +(ii) $\left\| \theta^{(t)}\right\| _2\to \infty$ as $t\to \infty$ + +(iii) Let $\theta_R = \arg \min_{\theta} \{F(\theta) : \| \theta \|_2 \leq R\}$ . $\theta_R$ is unique for any $R$ such that $\min_{\| \theta \|_2 \leq R} F(\theta) < \min_i q_i \ell(0, y_i)$ . And if $\lim_{R \to \infty} \frac{\theta_R}{R}$ exists, then $\lim_{t \to \infty} \frac{\theta^{(t)}}{\|\theta^{(t)}\|_2}$ also exists and they are equal. + +This result is an extension of Theorem 1 of Ji et al. (2020). For the logistic loss, it is easy to show that it satisfies the conditions of the above theorem and $\lim_{R\to \infty}\frac{\theta_R}{R} = \hat{\theta}_{\mathrm{MM}}$ . Thus, Theorems 8 and 7 together imply that all GRW satisfying Assumption 1 (including ERM) have the same implicit bias (see Appendix D.5.3). We also have empirical verification for these results (see Appendix C). + +Remark. It is impossible to extend these results to wide NNs like Theorem 4 because for a neural network, if $\| \theta^{(t)}\| _2$ goes to infinity, then $\| \nabla_{\theta}f\| _2$ will also go to infinity. However, for a linear model, the gradient is a constant. Consequently, the gap between the neural networks and its linearized counterpart will "explode" under gradient descent, so there can be no approximation theorem like Lemma 5 that can connect wide NNs to their linearized counterparts. Thus, we consider regularized GRW, for which $\theta^{(t)}$ converges to a finite point and there is an approximation theorem. + +# 5.2 WIDE NEURAL NETWORKS, WITH $L_{2}$ REGULARIZATION + +Consider minimizing the regularized weighted empirical risk (13) with $\ell$ being the logistic loss. As in the regression case, with $L_{2}$ regularization, GRW methods have different implicit biases than ERM for the same reasons as in Section 4.3. And similarly, we can show that in order for GRW methods to be sufficiently different from ERM, the regularization needs to be large enough to significantly lower the training performance. Specifically, in the following theorem we show that if the regularization is too small to lower the training performance, then a wide neural network trained with regularized GRW and the logistic loss will still be very close to the max-margin linearized neural network: + +$$ +f _ {\mathrm {M M}} (\boldsymbol {x}) = \left\langle \hat {\theta} _ {\mathrm {M M}}, \nabla_ {\theta} f ^ {(0)} (\boldsymbol {x}) \right\rangle \quad \text {w h e r e} \quad \hat {\theta} _ {\mathrm {M M}} = \underset {\| \theta \| _ {2} = 1} {\arg \max } \left\{\underset {i = 1, \dots , n} {\min } y _ {i} \cdot \left\langle \theta , \nabla_ {\theta} f ^ {(0)} (\boldsymbol {x} _ {i}) \right\rangle \right\} \tag {18} +$$ + +Note that $f_{\mathrm{MM}}$ does not depend on $q_i^{(t)}$ . Moreover, using the result in the previous section we can show that a linearized neural network trained with unregularized ERM will converge to $f_{\mathrm{MM}}$ : + +Theorem 9. Suppose there exists $M_0 > 0$ such that $\left\| \nabla_{\theta} f^{(0)}(\pmb{x}) \right\|_2 \leq M_0$ for all test point $\pmb{x}$ . For a wide NN satisfying Assumption 2, and for any GRW satisfying Assumption 1 with the logistic loss, if $d_1 = d_2 = \dots = d_L = \tilde{d}$ and $\nabla_{\theta} f^{(0)}(\pmb{x}_1), \dots, \nabla_{\theta} f^{(0)}(\pmb{x}_n)$ are linearly independent and the learning rate is sufficiently small, then for any $\delta > 0$ there exists a constant $C > 0$ such that: with probability at least $(1 - \delta)$ over random initialization, as $\tilde{d} \to \infty$ we have: for any $\epsilon \in (0, \frac{1}{4})$ , if the empirical training error satisfies $\lim_{t \to \infty} \hat{\mathcal{R}}(f_{\mathrm{reg}}^{(t)}) < \epsilon$ , then for any test point $\pmb{x}$ such that $|f_{MM}(\pmb{x})| > C \cdot (-\log 2\epsilon)^{-1/2}$ , $f_{\mathrm{reg}}^{(t)}(\pmb{x})$ has the same sign as $f_{MM}(\pmb{x})$ when $t$ is sufficiently large. + +This result says that at any test point $\pmb{x}$ on which the max-margin linear classifier classifies with a margin of $\Omega ((-\log 2\epsilon)^{-1 / 2})$ , the neural network has the same prediction. And as $\epsilon$ decreases, the confidence threshold also becomes lower. Similar to Theorem 6, this theorem provides the scaling of the gap between the regularized GRW model and the unregularized ERM model w.r.t. $\epsilon$ . + +This result justifies the empirical observation in Sagawa et al. (2020a) that with large regularization, some GRW algorithms can maintain a high worst-group test performance, with the cost of suffering a significant drop in training accuracy. On the other hand, if the regularization is small and the model can achieve nearly perfect training accuracy, then its worst-group test performance will still significantly drop. + +# 6 DISCUSSION + +# 6.1 DISTRIBUTIONALLY ROBUST GENERALIZATION AND FUTURE DIRECTIONS + +A large body of prior work focused on distributionally robust optimization, but we show that these methods have (almost) equivalent implicit biases as ERM. In other words, distributionally robust optimization (DRO) does not necessarily achieve better distributionally robust generalization (DRG). Our results pinpoint a critical bottleneck in the current distribution shift research, and we argue that a deeper understanding in DRG is crucial for developing better distributionally robust training algorithms. Here we discuss three promising future directions to improving DRG. + +The first approach is data augmentation and pretraining on large datasets. Our theoretical findings suggest that the implicit bias of GRW is determined by the training samples and the initial point, but not the sample weights. Thus, to improve DRG, we can either obtain more training samples, or start from a better initial point, as proposed in two recent papers (Wiles et al., 2022; Sagawa et al., 2022). + +The second approach (for classification) is to go beyond the class of (iterative) sample reweighting based GRW algorithms, for instance via logit adjustment (Menon et al., 2021), which makes a classifier have larger margins on smaller groups to improve its generalization on smaller groups. + +An early approach by Cao et al. (2019) proposed to add an $O(n_{k}^{-1 / 4})$ additive adjustment term to the logits output by the classifier. Following this spirit, Menon et al. (2021) proposed the LA-loss which also adds an additive adjustment term to the logits. Ye et al. (2020) proposed the CDT-loss which adds a multiplicative adjustment term to the logits by dividing the logits of different classes with different temperatures. Kini et al. (2021) proposed the VS-loss which includes both additive and multiplicative adjustment terms, and they showed that only the multiplicative adjustment term affects the implicit bias, while the additive term only affects optimization, a fact that can be easily derived from our Theorem 8. Finally, Li et al. (2021a) proposed AutoBalance which optimizes the adjustment terms with a bi-level optimization framework. + +The third approach is to stay within the class of GRW algorithms, but to change the classification/regression loss function to be suited to GRW. A recent paper (Wang et al., 2022) showed that for linear classifiers, one can make the implicit bias of GRW dependent on the sample weights by replacing the exponentially-tailed logistic loss with the following polynomially-tailed loss: + +$$ +\ell_ {\alpha , \beta} (\hat {y}, y) = \left\{ \begin{array}{c c} \ell_ {\text {l e f t}} (\hat {y} y) & , \text {i f} \hat {y} y < \beta \\ \frac {1}{[ \hat {y} y - (\beta - 1) ] ^ {\alpha}} & , \text {i f} \hat {y} y \geq \beta \end{array} \right. \tag {19} +$$ + +And this result can be extended to GRW satisfying Assumption 1 using our Theorem 8. The reason why loss (19) works is that it changes $\lim_{R\to \infty}\frac{\theta_R}{R}$ , and the new limit depends on the sample weights. + +# 6.2 LIMITATIONS + +Like most theory papers, our work makes some strong assumptions. The two main assumptions are: + +(i) The model is a linear model or a sufficiently wide fully-connected neural network. +(ii) The model is trained for sufficiently long time, i.e. without early stopping. + +Regarding (i), Chizat et al. (2019) argued that NTK neural networks fall in the "lazy training" regime and results might not be transferable to general neural networks. However, this class of neural networks has been widely studied in recent years and has provided considerable insights into the behavior of general neural networks, which is hard to analyze otherwise. Regarding (ii), in some easy tasks, when early stopping is applied, existing algorithms for distributional shift can do better than ERM (Sagawa et al., 2020a). However, as demonstrated in Gulrajani & Lopez-Paz (2021); Koh et al. (2021), in real applications these methods still cannot significantly improve over ERM even with early stopping, so early stopping is not the ultimate universal solution. Thus, though inevitably our results rely on some strong assumptions, we believe that they provide important insights into the problems of existing methods and directions for future work, which are significant contributions to the study of distributional shift problems. + +# 7 CONCLUSION + +In this work, we posit a broad class of what we call Generalized Reweighting (GRW) algorithms that include popular approaches such as importance weighting, and Distributionally Robust Optimization (DRO) variants, that were designed towards the task of learning models that are robust to distributional shift. We show that when used to train overparameterized linear models or wide NN models, even this very broad class of GRW algorithms does not improve over ERM, because they have the same implicit biases. We also showed that regularization does not help if it is not large enough to significantly lower the average training performance. Our results thus suggest to make progress towards learning models that are robust to distributional shift, we have to either go beyond this broad class of GRW algorithms, or design new losses specifically targeted to this class. + +# ACKNOWLEDGMENTS + +We acknowledge the support of NSF via OAC-1934584, IIS-1909816, DARPA via HR00112020006, and ARL. + +# REFERENCES + +Zeyuan Allen-Zhu, Yanzhi Li, and Zhao Song. A convergence theory for deep learning via overparameterization. In International Conference on Machine Learning, pp. 242-252. PMLR, 2019. +Martin Arjovsky, Léon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization. arXiv preprint arXiv:1907.02893, 2019. +Su Lin Blodgett, Lisa Green, and Brendan O'Connor. Demographic dialectal variation in social media: A case study of African-American English. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 1119-1130, Austin, Texas, November 2016. Association for Computational Linguistics. doi: 10.18653/v1/D16-1120. +Jonathon Byrd and Zachary Lipton. What is the effect of importance weighting in deep learning? In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 872-881. PMLR, 09-15 Jun 2019. +Kaidi Cao, Colin Wei, Adrien Gaidon, Nikos Arechiga, and Tengyu Ma. Learning imbalanced datasets with label-distribution-aware margin loss. Advances in Neural Information Processing Systems, 32:1567-1578, 2019. +Lenaic Chizat, Edouard Oyallon, and Francis Bach. On lazy training in differentiable programming. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett (eds.), Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019. +Simon Du, Jason Lee, Haochuan Li, Liwei Wang, and Xiyu Zhai. Gradient descent finds global minima of deep neural networks. In International Conference on Machine Learning, pp. 1675-1685. PMLR, 2019. +John Duchi and Hongseok Namkoong. Learning models with uniform performance via distributionally robust optimization. arXiv preprint arXiv:1810.08750, 2018. +Cynthia Dwork, Moritz Hardt, Toniann Pitassi, Omer Reingold, and Richard Zemel. Fairness through awareness. In Proceedings of the 3rd innovations in theoretical computer science conference, pp. 214-226, 2012. +Tongtong Fang, Nan Lu, Gang Niu, and Masashi Sugiyama. Rethinking importance weighting for deep learning under distribution shift. In H. Larochelle, M. Ranzato, R. Hadsell, M.F. Balcan, and H. Lin (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 11996-12007. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper/2020/file/8b9e7ab295e87570551db122a04c6f7c-Paper.pdf. +Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. The journal of machine learning research, 17(1):2096-2030, 2016. +Ishaan Gulrajani and David Lopez-Paz. In search of lost domain generalization. In International Conference on Learning Representations, 2021. +Suriya Gunasekar, Jason Lee, Daniel Soudry, and Nathan Srebro. Characterizing implicit bias in terms of optimization geometry. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 1832-1841. PMLR, 10-15 Jul 2018. +Moritz Hardt, Eric Price, and Nati Srebro. Equality of opportunity in supervised learning. In D. Lee, M. Sugiyama, U. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems, volume 29, pp. 3315-3323. Curran Associates, Inc., 2016. + +Tatsunori Hashimoto, Megha Srivastava, Hongseok Namkoong, and Percy Liang. Fairness without demographics in repeated loss minimization. In Jennifer Dy and Andreas Krause (eds.), International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 1929-1938, Stockholm Männssan, Stockholm Sweden, 10-15 Jul 2018. PMLR. +Dirk Hovy and Anders Søgaard. Tagging performance correlates with author age. In Proceedings of the 53rd annual meeting of the Association for Computational Linguistics and the 7th international joint conference on natural language processing (volume 2: Short papers), pp. 483-488, 2015. +Weihua Hu, Gang Niu, Issei Sato, and Masashi Sugiyama. Does distributionally robust supervised learning give robust classifiers? In International Conference on Machine Learning, pp. 2029-2037. PMLR, 2018. +Arthur Jacot, Franck Gabriel, and Clement Hongler. Neural tangent kernel: Convergence and generalization in neural networks. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesà-Bianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018. +Ziwei Ji, Miroslav Dudík, Robert E. Schapire, and Matus Telgarsky. Gradient descent follows the regularization path for general losses. In Jacob Abernethy and Shivani Agarwal (eds.), Proceedings of Thirty Third Conference on Learning Theory, volume 125 of Proceedings of Machine Learning Research, pp. 2109-2136. PMLR, 09-12 Jul 2020. +Byungju Kim and Junmo Kim. Adjusting decision boundary for class imbalanced learning. IEEE Access, 8:81674-81685, 2020. +Ganesh Ramachandra Kini, Orestis Paraskevas, Samet Oymak, and Christos Thrampoulidis. Label-imbalanced and group-sensitive classification under overparameterization. In Thirty-Fifth Conference on Neural Information Processing Systems, 2021. +Pang Wei Koh, Shiori Sagawa, Henrik Marklund, Sang Michael Xie, Marvin Zhang, Akshay Balsubramani, Weihua Hu, Michihiro Yasunaga, Richard Lanas Phillips, Irena Gao, Tony Lee, Etienne David, Ian Stavness, Wei Guo, Berton Earnshaw, Imran Haque, Sara M Beery, Jure Leskovec, Anshul Kundaje, Emma Pierson, Sergey Levine, Chelsea Finn, and Percy Liang. Wilds: A benchmark of in-the-wild distribution shifts. In Marina Meila and Tong Zhang (eds.), Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pp. 5637-5664. PMLR, 18-24 Jul 2021. +Matt J Kusner, Joshua Loftus, Chris Russell, and Ricardo Silva. Counterfactual fairness. In Advances in neural information processing systems, pp. 4066-4076, 2017. +Jaehoon Lee, Lechao Xiao, Samuel Schoenholz, Yasaman Bahri, Roman Novak, Jascha Sohl-Dickstein, and Jeffrey Pennington. Wide neural networks of any depth evolve as linear models under gradient descent. Advances in neural information processing systems, 32:8572-8583, 2019. +Haoliang Li, Sinno Jialin Pan, Shiqi Wang, and Alex C Kot. Domain generalization with adversarial feature learning. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 5400-5409, 2018. +Mingchen Li, Xuechen Zhang, Christos Thrampoulidis, Jiasi Chen, and Samet Oymak. Autobalance: Optimized loss functions for imbalanced data. In Thirty-Fifth Conference on Neural Information Processing Systems, 2021a. +Tianhao Li, Limin Wang, and Gangshan Wu. Self supervision to distillation for long-tailed visual recognition. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 630-639, 2021b. +Evan Z Liu, Behzad Haghloo, Annie S Chen, Aditi Raghunathan, Pang Wei Koh, Shiori Sagawa, Percy Liang, and Chelsea Finn. Just train twice: Improving group robustness without training group information. In International Conference on Machine Learning, pp. 6781-6792. PMLR, 2021. + +Hong Liu, Jeff Z. HaoChen, Adrien Gaidon, and Tengyu Ma. Self-supervised learning is more robust to dataset imbalance. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum?id=4AZz9osqrar. +Mingsheng Long, Han Zhu, Jianmin Wang, and Michael I Jordan. Unsupervised domain adaptation with residual transfer networks. Advances in neural information processing systems, 29, 2016. +Aditya Krishna Menon, Sadeep Jayasumana, Ankit Singh Rawat, Himanshu Jain, Andreas Veit, and Sanjiv Kumar. Long-tail learning via logit adjustment. In International Conference on Learning Representations, 2021. +Saeid Motiian, Marco Piccirilli, Donald A Adjeroh, and Gianfranco Doretto. Unified deep supervised domain adaptation and generalization. In Proceedings of the IEEE international conference on computer vision, pp. 5715-5725, 2017. +Yonatan Oren, Shiori Sagawa, Tatsunori Hashimoto, and Percy Liang. Distributionally robust language modeling. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 4227-4237, Hong Kong, China, November 2019. Association for Computational Linguistics. doi: 10.18653/v1/D19-1432. +John Rawls. Justice as fairness: A restatement. Harvard University Press, 2001. +Elan Rosenfeld, Pradeep Kumar Ravikumar, and Andrej Risteski. The risks of invariant risk minimization. In International Conference on Learning Representations, 2021. +Shiori Sagawa, Pang Wei Koh, Tatsunori B. Hashimoto, and Percy Liang. Distributionally robust neural networks for group shifts: On the importance of regularization for worst-case generalization. In International Conference on Learning Representations, 2020a. +Shiori Sagawa, Aditi Raghunathan, Pang Wei Koh, and Percy Liang. An investigation of why overparameterization exacerbates spurious correlations. In Hal Daumé III and Aarti Singh (eds.), Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pp. 8346-8356. PMLR, 13-18 Jul 2020b. +Shiori Sagawa, Pang Wei Koh, Tony Lee, Irena Gao, Sang Michael Xie, Kendrick Shen, Ananya Kumar, Weihua Hu, Michihiro Yasunaga, Henrik Marklund, Sara Beery, Etienne David, Ian Stavness, Wei Guo, Jure Leskovec, Kate Saenko, Tatsunori Hashimoto, Sergey Levine, Chelsea Finn, and Percy Liang. Extending the WILDS benchmark for unsupervised adaptation. In International Conference on Learning Representations, 2022. +Hidetoshi Shimodaira. Improving predictive inference under covariate shift by weighting the log-likelihood function. Journal of statistical planning and inference, 90(2):227-244, 2000. +Daniel Soudry, Elad Hoffer, Mor Shpigel Nacson, Suriya Gunasekar, and Nathan Srebro. The implicit bias of gradient descent on separable data. *The Journal of Machine Learning Research*, 19 (1):2822-2878, 2018. +Baochen Sun and Kate Saenko. Deep coral: Correlation alignment for deep domain adaptation, 2016. +Rachael Tatman. Gender and dialect bias in youtube's automatic captions. In Proceedings of the First ACL Workshop on Ethics in Natural Language Processing, pp. 53-59, 2017. +Eric Tzeng, Judy Hoffman, Trevor Darrell, and Kate Saenko. Simultaneous deep transfer across domains and tasks. In Proceedings of the IEEE international conference on computer vision, pp. 4068-4076, 2015. +Roman Vershynin. Introduction to the non-asymptotic analysis of random matrices. arXiv preprint arXiv:1011.3027, 2010. +Ke Alexander Wang, Niladri Shekhar Chatterji, Saminul Haque, and Tatsunori Hashimoto. Is importance weighting incompatible with interpolating classifiers? In International Conference on Learning Representations, 2022. + +Peng Wang, Kai Han, Xiu-Shen Wei, Lei Zhang, and Lei Wang. Contrastive learning based hybrid networks for long-tailed image classification. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 943-952, 2021. +Olivia Wiles, Sven Gowal, Florian Stimberg, Sylvestre-Alvise Rebuffi, Ira Ktena, Krishnamurthy Dj Dvijotham, and Ali Taylan Cemgil. A fine-grained analysis on distribution shift. In International Conference on Learning Representations, 2022. +Yu Xie and Charles F Manski. The logit model and response-based samples. Sociological Methods & Research, 17(3):283-302, 1989. +Da Xu, Yuting Ye, and Chuanwei Ruan. Understanding the role of importance weighting for deep learning. In International Conference on Learning Representations, 2021. +Han-Jia Ye, Hong-You Chen, De-Chuan Zhan, and Wei-Lun Chao. Identifying and compensating for feature deviation in imbalanced deep learning. arXiv preprint arXiv:2001.01385, 2020. +Muhammad Bilal Zafar, Isabel Valera, Manuel Gomez Rodriguez, and Krishna P Gummadi. Fairness beyond disparate treatment & disparate impact: Learning classification without disparate mistreatment. In Proceedings of the 26th international conference on world wide web, pp. 1171-1180, 2017. +Rich Zemel, Yu Wu, Kevin Swersky, Toni Pitassi, and Cynthia Dwork. Learning fair representations. In International Conference on Machine Learning, pp. 325-333, 2013. +Runtian Zhai, Chen Dan, Zico Kolter, and Pradeep Ravikumar. Doro: Distributional and outlier robust optimization. In Marina Meila and Tong Zhang (eds.), Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pp. 12345-12355. PMLR, 18-24 Jul 2021a. +Runtian Zhai, Chen Dan, Arun Suggala, J Zico Kolter, and Pradeep Kumar Ravikumar. Boosted CVar classification. In Thirty-Fifth Conference on Neural Information Processing Systems, 2021b. + +# A RELATED WORK + +# A.1 SUBPOPULATION SHIFT + +In this work, we mainly focus on the subpopulation shift problem, which has two main applications: group fairness and long-tailed learning (learning with class imbalance). In both applications, the dataset can be divided into several subgroups, and this work considers minimizing the worst-group risk, defined as the maximum risk over any group. + +Group Fairness. Group fairness refers to the scenario where the dataset contains several "groups" (such as demographic groups), and a model is considered fair if its per-group performances meet certain criteria (a "fairness" notion). Group fairness in machine learning was first studied in Hardt et al. (2016) and Zafar et al. (2017), where they required the model to perform equally well over all groups. Many previous papers proposed a number of fairness notions, such as equal opportunity, statistical parity, etc. Among them, Hashimoto et al. (2018) studied another type of group fairness called Rawlsian max-min fairness Rawls (2001), which does not require equal performance but rather requires high performance on the worst-off group. The subpopulation shift problem we study in this paper is naturally connected to the Rawlsian max-min fairness. A large body of recent work have studied how to improve this worst-group performance Duchi & Namkoong (2018); Oren et al. (2019); Liu et al. (2021); Zhai et al. (2021a). Recent work however observe that these approaches, when used with modern overparameterized models, easily overfit Sagawa et al. (2020a;b). Apart from group fairness, there are also other notions of fairness, such as individual fairness Dwork et al. (2012); Zemel et al. (2013) and counterfactual fairness Kusner et al. (2017), which we do not study in this work. + +Long-tailed Learning. Long-tailed learning refers to the scenario where different classes have different sizes, and usually there are some "minority classes" with extremely few samples that are much more difficult to learn than the other classes. Using GRW such as importance weighting for long-tailed learning is a very old idea which dates back to Xie & Manski (1989). However, recently Byrd & Lipton (2019) found that the effect of importance weighting for long-tailed learning diminishes as training proceeds, which leads to a line of recent work on how to improve the generalization in long-tailed learning (Cao et al., 2019; Menon et al., 2021; Ye et al., 2020; Kim & Kim, 2020; Kini et al., 2021). Most of these papers share a common idea: Forcing the model to have larger margins on smaller groups, so that its generalization on smaller groups can be better. Self-supervised learning is also used in long-tailed learning. For instance, Liu et al. (2022) found that self-supervised learning can achieve good performances in long-tailed learning, Wang et al. (2021) used contrastive learning for long-tailed learning, and Li et al. (2021b) used self-distillation. + +# A.2 DOMAIN GENERALIZATION + +Domain generalization is the second common type of distribution shift. In domain generalization and the related domain adaptation, a model is tested on a different domain than what it is trained on. The most common idea in domain generalization is invariant learning, which learns a feature extractor that is invariant across domains, usually by matching the feature distribution of different domains. Since we have no access to the target domain, in invariant learning we assume that we have access to multiple domains in the training set, and we learn a feature extractor with a small variance across these domains. Examples include CORAL (Sun & Saenko, 2016), DANN (Ganin et al., 2016), MMD (Li et al., 2018) and IRM (Arjovsky et al., 2019). However, Gulrajani & Lopez-Paz (2021); Koh et al. (2021) empirically showed that most of these methods cannot do better than standard ERM, and Rosenfeld et al. (2021) theoretically proved that IRM cannot do better than ERM unless the number of training domains is greater than the number of independent features. + +One problem of invariant learning methods is that they do not necessarily align the classes. For a source domain $P$ and a target domain $Q$ , even if we have successfully learned a feature extractor $\Phi$ such that $\Phi(P) \approx \Phi(Q)$ , there is no guarantee that $\Phi$ can map the samples in $P$ and $Q$ from the same class to the same location in the feature space. In the worst case, $\Phi$ can map the positive samples in $P$ and the negative samples in $Q$ to the same location and vice versa, in which case 100% accuracy over $P$ means 0% accuracy over $Q$ . The goal of class alignment is to make sure that samples from the same class are mapped together, and far away from the other classes. For + +example, Tzeng et al. (2015) used soft labels to align the classes, Long et al. (2016) minimized the class-based cross entropy on the target domain while keeping the source and target classifiers close with a residual block, and Motiian et al. (2017) adopted a similarity penalty to keep samples from different classes away from each other. + +# A.3 IMPLICITBIASUNDER THEOVERPARAMERIZED SETTING + +For overparameterized models, there could be many model parameters which all minimize the training loss. In such cases, it is of interest to study the implicit bias of specific optimization algorithms such as gradient descent i.e. to what minimizer the model parameters will converge to Du et al. (2019); Allen-Zhu et al. (2019). Our results use the NTK formulation of wide neural networks Jacot et al. (2018), and specifically we use linearized neural networks to approximate such wide neural networks following Lee et al. (2019). There is some criticism of this line of work, e.g. Chizat et al. (2019) argued that infinitely wide neural networks fall in the "lazy training" regime and results might not be transferable to general neural networks. Nonetheless such wide neural networks are being widely studied in recent years, since they provide considerable insights into the behavior of more general neural networks, which are typically intractable to analyze otherwise. + +# A.4 COMPARISON WITH HU ET AL. (2018) + +A prior work Hu et al. (2018) also proved that GRW is equivalent to ERM under certain conditions. However, we would like to point out that this work is substantially different from Hu et al. (2018). Hu et al. (2018) proved that in classification that uses the zero-one loss, GRW methods such as DRSL are equivalent to ERM, in the sense that the minimizer of the DRSL risk is also the minimizer of the average risk. However, this does not mean that DRSL and ERM will always converge to the same point, as there could be multiple minimizers. Their result relies on the zero-one loss, which leads to a monotonic linear relationship between the DRSL risk and the average risk. Moreover, their result is only about the relationship between two minimizers, and they did not prove that DRSL and ERM can actually converge to these global minima. + +On the other hand, in our results, we first show that without regularization, GRW and ERM will converge to the exact same point, so that they have equivalent implicit biases, which is a much stronger result. Then we show that even with regularization, if the regularization is not large enough, GRW will still converge to a point that is very close to the point ERM converges to. Our results do not depend on the loss function, and work for both the squared loss for regression and the logistic loss for classification (and can be extended to other losses). Instead, our results depend on the optimization method (must be first-order or gradient-based) as well as the model architecture (linear or wide NN), since we need to explicitly prove that both GRW and ERM can reach the global minima if trained under a small learning rate for sufficiently long. In a word, Hu et al. (2018) proves the equivalence between GRW and ERM under the zero-one loss with a monotonic relationship between the two risk functions, while our results focus on the optimization and training dynamics, and prove that GRW and ERM have almost equivalent implicit biases. + +# B EXTENSION TO MULTI-DIMENSIONAL REGRESSION/MULTI-CLASS CLASSIFICATION + +In our results, we assume that $f: \mathbb{R}^d \to \mathbb{R}$ for simplicity, but our results can be very easily extended to the case where $f: \mathbb{R}^d \to \mathbb{R}^k$ . For most of our results, the proof consists of two major components: (i) The linearized neural network will converge to some point (interpolator, max-margin classifier, etc.); (ii) The wide fully-connected neural network can be approximated by its linearized counterpart. For both components, the extension is very simple and straightforward. For (i), the proof only relies on the smoothness of the objective function and the upper quadratic bound it entails, and the function is still smooth when its output becomes multi-dimensional; For (ii), we can prove that $\sup_t \|f(\pmb{x}) - f_{\mathrm{lin}}(\pmb{x})\|_2 = O(\tilde{d}^{-1/4})$ in exactly the same way. Thus, all of our results hold for multi-dimensional regression and multi-class classification. + +Particularly, for the multi-class cross-entropy loss, using Theorem 8 we can show that under any GRW satisfying Assumption 1, the direction of the weight of a linear classifier will converge to the + +![](images/469c5ecdd4c23ab4152ea8eda789117a34161a9ae762e84c7d2fe67dfbcd92d7.jpg) +(a) Weight Difference + +![](images/92ad65ac8a73c2612e95823b36fdf0163da1bdc890ce1541419d84a1c1d30f9e.jpg) +(b) Norm of ERM Model + +![](images/e09301c50b8a195ed5d0a6a4a238a3f131cfd775cf8dfc660c7f71d764200bcb.jpg) +(c) Training Loss + +![](images/a705842faaad5c222c42796679ae8605ce8d971fdcb50a171b7182a0669a7e16.jpg) +(d) +Group +Weights + +![](images/2573b27bae67addf8636835d4f05ec658baaeaef462f71222aaccff79bfb39ab.jpg) +(e) Weight Difference + +![](images/ecddac33dd230755b8b62885536e6e4326c5d9abc6c1e5222011c191600c06a5.jpg) +(f) Norm of ERM Model + +![](images/f0b9eba0b1556fb4fc871d9d19e23f1c22d0acbe461cd48f863911058a514725.jpg) +(g) Training Loss +(GDRO) +Figure 3: Experimental results of ERM, importance weighting (IW) and Group DRO (GDRO) with the logistic loss and the polynomially-tailed loss. First row: Logistic loss; Second row: Polynomially-tailed loss. All norms are $L_{2}$ norms. $\tilde{\theta}$ is a unit vector which is the direction of $\theta$ . + +![](images/f3817385cc04b9ba20d2dd8b932213628f94d5829fd5770dce48cab50496c5e2.jpg) +(GDRO) +(h) +Group +Weights + +following max-margin classifier: + +$$ +\hat {\theta} _ {\mathrm {M M}} = \arg \min _ {\theta} \left\{\min _ {i = 1, \dots , n} \left[ f \left(\boldsymbol {x} _ {i}\right) _ {y _ {i}} - \max _ {y ^ {\prime} \neq y _ {i}} f \left(\boldsymbol {x} _ {i}\right) _ {y ^ {\prime}} \right]: \| \theta \| _ {2} = 1 \right\} \tag {20} +$$ + +which is still independent of $q_{i}$ . + +# C MORE EXPERIMENTS + +We run ERM, importance weighting and Group DRO on the training set with 6 MNIST images which we used in Section 4.1 with the logistic loss and the polynomially-tailed loss (Eqn. (19), with $\alpha = 1$ , $\beta = 0$ and $\ell_{\mathrm{left}}$ being the logistic loss shifted to make the overall loss function continuous) on this dataset for 10 million epochs (note that we run for much more epochs because the convergence is very slow). The results are shown in Figure 3. From the plots we can see that: + +- For either loss function, the training loss of each method converges to 0. +- In contrast to the theory that the norm of the ERM model will go to infinity and all models will converge to the max-margin classifier, the weight of the ERM model gets stuck at some point, and the norms of the gaps between the normalized model weights also get stuck. The reason is that the training loss has got so small that it becomes zero in the floating number representation, so the gradient also becomes zero and the training halts due to limited computational precision. +- However, we can still observe a fundamental difference between the logistic loss and the polynomially-tailed loss. For the logistic loss, the norm of the gap between importance weighting (or Group DRO) and ERM will converge to around 0.06 when the training stops, while for the polynomially-tailed loss, the norm will be larger than 0.22 and will keep growing, which shows that for the polynomially-tailed loss the normalized model weights do not converge to the same point. +- For either loss, the group weights of Group DRO still empirically satisfy Assumption 1. + +# D PROOFS + +In this paper, for any matrix $\mathbf{A}$ , we will use $\| \mathbf{A}\| _2$ to denote its spectral norm and $\| \mathbf{A}\| _F$ to denote its Frobenius norm. + +# D.1 BACKGROUND ON SMOOTHNESS + +A first-order differentiable function $f$ over $\mathcal{D}$ is called $L$ -smooth for $L > 0$ if + +$$ +f (\boldsymbol {y}) \leq f (\boldsymbol {x}) + \left\langle \nabla f (\boldsymbol {x}), \boldsymbol {y} - \boldsymbol {x} \right\rangle + \frac {L}{2} \| \boldsymbol {y} - \boldsymbol {x} \| _ {2} ^ {2} \quad \forall \boldsymbol {x}, \boldsymbol {y} \in \mathcal {D} \tag {21} +$$ + +which is also called the upper quadratic bound. If $f$ is second-order differentiable and $\mathcal{D}$ is a convex set, then $f$ is $L$ -smooth is equivalent to + +$$ +\boldsymbol {v} ^ {\top} \nabla^ {2} f (\boldsymbol {x}) \boldsymbol {v} \leq L \quad \forall \| \boldsymbol {v} \| _ {2} = 1, \forall \boldsymbol {x} \in \mathcal {D} \tag {22} +$$ + +A classical result in convex optimization is the following: + +Theorem 10. If $f(\pmb{x})$ is convex and $L$ -smooth with a unique finite minimizer $\pmb{x}^*$ , and is minimized by gradient descent $\pmb{x}_{t+1} = \pmb{x}_t - \eta \nabla f(\pmb{x}_t)$ starting from $\pmb{x}_0$ where the learning rate $\eta \leq \frac{1}{L}$ , then we have + +$$ +f \left(\boldsymbol {x} _ {T}\right) \leq f \left(\boldsymbol {x} ^ {*}\right) + \frac {1}{\eta T} \| \boldsymbol {x} _ {0} - \boldsymbol {x} ^ {*} \| _ {2} ^ {2} \tag {23} +$$ + +which also implies that $\pmb{x}_T$ converges to $\pmb{x}^*$ as $T\to \infty$ + +# D.2 PROOFS FOR SUBSECTION 4.1 + +# D.2.1 PROOF OF THEOREM 1 + +Using the key intuition, the weight update rule (7) implies that $\theta^{(t + 1)} - \theta^{(t)}\in \operatorname {span}\{\pmb {x}_1,\dots ,\pmb {x}_n\}$ for all $t$ , which further implies that $\theta^{(t)} - \theta^{(0)}\in \operatorname {span}\{\pmb {x}_1,\dots ,\pmb {x}_n\}$ for all $t$ . By Cramer's rule, in this $n$ -dimensional subspace there exists one and only one $\theta^*$ such that $\theta^{*} - \theta^{(0)}\in \operatorname {span}\{\pmb {x}_1,\dots ,\pmb {x}_n\}$ and $\langle \theta^{*},\pmb{x}_{i}\rangle$ for all $i$ . Then we have + +$$ +\left\| \boldsymbol {X} ^ {\top} \left(\theta^ {(t)} - \theta^ {*}\right)\right\| _ {2} = \left\|\left(\boldsymbol {X} ^ {\top} \theta^ {(t)} - \boldsymbol {Y}\right) - \left(\boldsymbol {X} ^ {\top} \theta^ {*} - \boldsymbol {Y}\right)\right\| _ {2} \leq \left\| \boldsymbol {X} ^ {\top} \theta^ {(t)} - \boldsymbol {Y} \right\| _ {2} + \left\| \boldsymbol {X} ^ {\top} \theta^ {*} - \boldsymbol {Y} \right\| _ {2} \rightarrow 0 \tag {24} +$$ + +because $\left\| \boldsymbol{X}^{\top}\boldsymbol {\theta} - \boldsymbol {Y}\right\|_{2}^{2} = 2n\hat{\mathcal{R}} (f(\boldsymbol {x};\boldsymbol {\theta}))$ . On the other hand, let $s^{\mathrm{min}}$ be the smallest singular value of $\pmb{X}$ . Since $\pmb{X}$ is full-rank, $s^{\mathrm{min}} > 0$ , and $\left\| \boldsymbol{X}^{\top}(\theta^{(t)} - \theta^{*})\right\|_{2}\geq s^{\mathrm{min}}\left\| \theta^{(t)} - \theta^{*}\right\|_{2}$ . This shows that $\left\| \theta^{(t)} - \theta^{*}\right\|_{2}\to 0$ . Thus, $\theta^{(t)}$ converges to this unique $\theta^{*}$ + +# D.2.2 PROOF OF THEOREM 2 + +To help our readers understand the proof more easily, we will first prove the result for static GRW where $q_{i}^{(t)} = q_{i}$ for all $t$ , and then we will prove the result for dynamic GRW that satisfy $q_{i}^{(t)} \to q_{i}$ as $t \to \infty$ . + +Static GRW. We first prove the result for all static GRW such that $\min_i q_i = q^* > 0$ . + +We will use smoothness introduce in Appendix D.1. Denote $A = \sum_{i=1}^{n} \| \pmb{x}_i\|_2^2$ . The empirical risk of the linear model $f(\pmb{x}) = \langle \theta, \pmb{x} \rangle$ is + +$$ +F (\theta) = \sum_ {i = 1} ^ {n} q _ {i} \left(\boldsymbol {x} _ {i} ^ {\top} \theta - y _ {i}\right) ^ {2} \tag {25} +$$ + +whose Hessian is + +$$ +\nabla_ {\theta} ^ {2} F (\theta) = 2 \sum_ {i = 1} ^ {n} q _ {i} \boldsymbol {x} _ {i} \boldsymbol {x} _ {i} ^ {\top} \tag {26} +$$ + +So for any unit vector $\pmb{v} \in \mathbb{R}^d$ , we have (since $q_i \in [0,1]$ ) + +$$ +\boldsymbol {v} ^ {\top} \nabla_ {\theta} ^ {2} F (\theta) \boldsymbol {v} = 2 \sum_ {i = 1} ^ {n} q _ {i} \left(\boldsymbol {x} _ {i} ^ {\top} \boldsymbol {v}\right) ^ {2} \leq 2 \sum_ {i = 1} ^ {n} q _ {i} \| \boldsymbol {x} _ {i} \| _ {2} ^ {2} \leq 2 A \tag {27} +$$ + +which implies that $F(\theta)$ is $2A$ -smooth. Thus, we have the following upper quadratic bound: for any $\theta_1, \theta_2 \in \mathbb{R}^d$ , + +$$ +F \left(\theta_ {2}\right) \leq F \left(\theta_ {1}\right) + \left\langle \nabla_ {\theta} F \left(\theta_ {1}\right), \theta_ {2} - \theta_ {1} \right\rangle + A \| \theta_ {2} - \theta_ {1} \| _ {2} ^ {2} \tag {28} +$$ + +Denote $g(\theta^{(t)}) = (X^{\top}\theta^{(t)} - Y) \in \mathbb{R}^{n}$ . We can see that $\left\| \sqrt{Q} g(\theta^{(t)}) \right\|_{2}^{2} = F(\theta^{(t)})$ , where where $\sqrt{Q} = \mathrm{diag}(\sqrt{q_1}, \dots, \sqrt{q_n})$ . Thus, $\nabla F(\theta^{(t)}) = 2XQg(\theta^{(t)})$ . The update rule of a static GRW with gradient descent and the squared loss is: + +$$ +\theta^ {(t + 1)} = \theta^ {(t)} - \eta \sum_ {i = 1} ^ {n} q _ {i} \boldsymbol {x} _ {i} \left(f ^ {(t)} \left(\boldsymbol {x} _ {i}\right) - y _ {i}\right) = \theta^ {(t)} - \eta \boldsymbol {X} \boldsymbol {Q} g \left(\theta^ {(t)}\right) \tag {29} +$$ + +Substituting $\theta_{1}$ and $\theta_{2}$ in (28) with $\theta^{(t)}$ and $\theta^{(t + 1)}$ yields + +$$ +F \left(\theta^ {(t + 1)}\right) \leq F \left(\theta^ {(t)}\right) - 2 \eta g \left(\theta^ {(t)}\right) ^ {\top} \boldsymbol {Q} ^ {\top} \boldsymbol {X} ^ {\top} \boldsymbol {X} \boldsymbol {Q} g \left(\theta^ {(t)}\right) + A \left\| \eta \boldsymbol {X} \boldsymbol {Q} g \left(\theta^ {(t)}\right) \right\| _ {2} ^ {2} \tag {30} +$$ + +Since $\pmb{x}_1, \dots, \pmb{x}_n$ are linearly independent, $\pmb{X}^{\top}\pmb{X}$ is a positive definite matrix. Denote the smallest eigenvalue of $\pmb{X}^{\top}\pmb{X}$ by $\lambda^{\min} > 0$ . And $\| Qg(\theta^{(t)})\|_2 \geq \sqrt{q^*} \| g(\theta^{(t)})\|_2 = \sqrt{q^*F(\theta^{(t)})}$ , so we have $g(\theta^{(t)})^{\top}Q^{\top}X^{\top}XQg(\theta^{(t)}) \geq q^*\lambda^{\min}F(\theta^{(t)})$ . Thus, + +$$ +\begin{array}{l} F (\theta^ {(t + 1)}) \leq F (\theta^ {(t)}) - 2 \eta q ^ {*} \lambda^ {\min } F (\theta^ {(t)}) + A \eta^ {2} \left\| \boldsymbol {X} \sqrt {\boldsymbol {Q}} \right\| _ {2} ^ {2} \left\| \sqrt {\boldsymbol {Q}} g (\theta^ {(t)}) \right\| _ {2} ^ {2} \\ \leq F \left(\theta^ {(t)}\right) - 2 \eta q ^ {*} \lambda^ {\min } F \left(\theta^ {(t)}\right) + A \eta^ {2} \left\| \boldsymbol {X} \sqrt {\boldsymbol {Q}} \right\| _ {F} ^ {2} F \left(\theta^ {(t)}\right) \tag {31} \\ \leq F (\theta^ {(t)}) - 2 \eta q ^ {*} \lambda^ {\min } F (\theta^ {(t)}) + A \eta^ {2} \| \boldsymbol {X} \| _ {F} ^ {2} F (\theta^ {(t)}) \\ = (1 - 2 \eta q ^ {*} \lambda^ {\min} + A ^ {2} \eta^ {2}) F (\theta^ {(t)}) \\ \end{array} +$$ + +Let $\eta_0 = \frac{q^*\lambda^{\mathrm{min}}}{A^2}$ . For any $\eta \leq \eta_0$ , we have $F(\theta^{(t + 1)}) \leq (1 - \eta q^*\lambda^{\mathrm{min}})F(\theta^{(t)})$ for all $t$ , which implies that $\lim_{t\to \infty}F(\theta^{(t)}) = 0$ . This implies that the empirical training risk must converge to 0. + +Dynamic GRW. Now we prove the result for all dynamic GRW satisfying Assumption 1. By Assumption 1, for any $\epsilon >0$ , there exists $t_\epsilon$ such that for all $t\geq t_{\epsilon}$ and all $i$ , + +$$ +q _ {i} ^ {(t)} \in \left(q _ {i} - \epsilon , q _ {i} + \epsilon\right) \tag {32} +$$ + +This is because for all $i$ , there exists $t_i$ such that for all $t \geq t_i$ , $q_i^{(t)} \in (q_i - \epsilon, q_i + \epsilon)$ . Then, we can define $t_\epsilon = \max \{t_1, \dots, t_n\}$ . Denote the largest and smallest eigenvalues of $\mathbf{X}^\top \mathbf{X}$ by $\lambda^{\max}$ and $\lambda^{\min}$ , and because $\mathbf{X}$ is full-rank, we have $\lambda^{\min} > 0$ . Define $\epsilon = \min \left\{\frac{q^*}{3}, \frac{(q^*\lambda^{\min})^2}{12\lambda^{\max 2}}\right\}$ , and then $t_\epsilon$ is also fixed. + +We still denote $Q = \mathrm{diag}(q_1, \dots, q_n)$ . When $t \geq t_{\epsilon}$ , the update rule of a dynamic GRW with gradient descent and the squared loss is: + +$$ +\theta^ {(t + 1)} = \theta^ {(t)} - \eta \boldsymbol {X} \boldsymbol {Q} _ {\epsilon} ^ {(t)} \left(\boldsymbol {X} ^ {\top} \theta^ {(t)} - \boldsymbol {Y}\right) \tag {33} +$$ + +where $Q_{\epsilon}^{(t)} = Q^{(t)}$ , and we use the subscript $\epsilon$ to indicate that $\left\| Q_{\epsilon}^{(t)} - Q \right\|_2 < \epsilon$ . Then, note that we can rewrite $Q_{\epsilon}^{(t)}$ as $Q_{\epsilon}^{(t)} = \sqrt{Q_{3\epsilon}^{(t)}} \cdot \sqrt{Q}$ as long as $\epsilon \leq q^* / 3$ . This is because $q_i + \epsilon \leq \sqrt{(q_i + 3\epsilon)q_i}$ and $q_i - \epsilon \geq \sqrt{(q_i - 3\epsilon)q_i}$ for all $\epsilon \leq q_i / 3$ , and $q_i \geq q^*$ . Thus, we have + +$$ +\theta^ {(t + 1)} = \theta^ {(t)} - \eta \mathbf {X} \sqrt {\mathbf {Q} _ {3 \epsilon} ^ {(t)}} \sqrt {\mathbf {Q}} g \left(\theta^ {(t)}\right) \quad \text {w h e r e} \mathbf {Q} _ {\epsilon} ^ {(t)} = \sqrt {\mathbf {Q} _ {3 \epsilon} ^ {(t)}} \cdot \sqrt {\mathbf {Q}} \tag {34} +$$ + +Again, substituting $\theta_{1}$ and $\theta_{2}$ in (28) with $\theta^{(t)}$ and $\theta^{(t + 1)}$ yields + +$$ +F \left(\theta^ {(t + 1)}\right) \leq F \left(\theta^ {(t)}\right) - 2 \eta g \left(\theta^ {(t)}\right) ^ {\top} \boldsymbol {Q} ^ {\top} \boldsymbol {X} ^ {\top} \boldsymbol {X} \sqrt {\boldsymbol {Q} _ {3 \epsilon} ^ {(t)}} \sqrt {\boldsymbol {Q}} g \left(\theta^ {(t)}\right) + A \left\| \eta \boldsymbol {X} \sqrt {\boldsymbol {Q} _ {3 \epsilon} ^ {(t)}} \sqrt {\boldsymbol {Q}} g \left(\theta^ {(t)}\right) \right\| _ {2} ^ {2} \tag {35} +$$ + +Then, note that + +$$ +\begin{array}{l} \left| g \left(\theta^ {(t)}\right) ^ {\top} Q ^ {\top} X ^ {\top} X \left(\sqrt {Q _ {3 \epsilon} ^ {(t)}} - \sqrt {Q}\right) \sqrt {Q} g \left(\theta^ {(t)}\right) \right| \\ \leq \left\| \sqrt {\boldsymbol {Q}} ^ {\top} \boldsymbol {X} ^ {\top} \boldsymbol {X} \left(\sqrt {\boldsymbol {Q} _ {3 \epsilon} ^ {(t)}} - \sqrt {\boldsymbol {Q}}\right) \right\| _ {2} \left\| \sqrt {\boldsymbol {Q}} g \left(\theta^ {(t)}\right) \right\| _ {2} ^ {2} \tag {36} \\ \leq \left\| \sqrt {\boldsymbol {Q}} \right\| _ {2} \left\| \boldsymbol {X} ^ {\top} \boldsymbol {X} \right\| _ {2} \left\| \sqrt {\boldsymbol {Q} _ {3 \epsilon} ^ {(t)}} - \sqrt {\boldsymbol {Q}} \right\| _ {2} \left\| \sqrt {\boldsymbol {Q}} g (\theta^ {(t)}) \right\| _ {2} ^ {2} \\ \leq \lambda^ {\max } \sqrt {3 \epsilon} F (\theta^ {(t)}) \\ \end{array} +$$ + +where the last step comes from the following fact: for all $\epsilon < q_i / 3$ + +$$ +\sqrt {q _ {i} + 3 \epsilon} - \sqrt {q _ {i}} \leq \sqrt {3 \epsilon} \quad \text {a n d} \quad \sqrt {q _ {i}} - \sqrt {q _ {i} - 3 \epsilon} \leq \sqrt {3 \epsilon} \tag {37} +$$ + +And as proved before, we also have + +$$ +g \left(\theta^ {(t)}\right) ^ {\top} \boldsymbol {Q} ^ {\top} \boldsymbol {X} ^ {\top} \boldsymbol {X} \boldsymbol {Q} g \left(\theta^ {(t)}\right) \geq q ^ {*} \lambda^ {\min } F \left(\theta^ {(t)}\right) \tag {38} +$$ + +Since $\epsilon \leq \frac{(q^{*}\lambda^{\min})^{2}}{12\lambda^{\max 2}}$ , we have + +$$ +g \left(\theta^ {(t)}\right) ^ {\top} \boldsymbol {Q} ^ {\top} \boldsymbol {X} ^ {\top} \boldsymbol {X} \sqrt {\boldsymbol {Q} _ {3 \epsilon} ^ {(t)}} \sqrt {\boldsymbol {Q}} g \left(\theta^ {(t)}\right) \geq \left(q ^ {*} \lambda^ {\min } - \lambda^ {\max } \sqrt {3 \epsilon}\right) F \left(\theta^ {(t)}\right) \geq \frac {1}{2} q ^ {*} \lambda^ {\min } F \left(\theta^ {(t)}\right) \tag {39} +$$ + +Thus, + +$$ +\begin{array}{l} F (\boldsymbol {\theta} ^ {(t + 1)}) \leq F (\boldsymbol {\theta} ^ {(t)}) - \eta q ^ {*} \lambda^ {\min} F (\boldsymbol {\theta} ^ {(t)}) + A \eta^ {2} \left\| \boldsymbol {X} \sqrt {\boldsymbol {Q} _ {3 \epsilon} ^ {(t)}} \right\| _ {2} ^ {2} \left\| \sqrt {\boldsymbol {Q}} g (\boldsymbol {\theta} ^ {(t)}) \right\| _ {2} ^ {2} \\ \leq \left(1 - \eta q ^ {*} \lambda^ {\min } + A ^ {2} \eta^ {2} (1 + 3 \epsilon)\right) F (\theta^ {(t)}) \\ \leq \left(1 - \eta q ^ {*} \lambda^ {\min } + 2 A ^ {2} \eta^ {2}\right) F \left(\theta^ {(t)}\right) \\ \end{array} +$$ + +for all $\epsilon \leq 1/3$ . Let $\eta_0 = \frac{q^*\lambda^{\mathrm{min}}}{4A^2}$ . For any $\eta \leq \eta_0$ , we have $F(\theta^{(t + 1)}) \leq (1 - \eta q^*\lambda^{\mathrm{min}} / 2)F(\theta^{(t)})$ for all $t \geq t_{\epsilon}$ , which implies that $\lim_{t \to \infty} F(\theta^{(t)}) = 0$ . Thus, the empirical training risk converges to 0. + +# D.3 PROOFS FOR SUBSECTION 4.2 + +# D.3.1 PROOF OF LEMMA 3 + +Note that the first $l$ layers (except the output layer) of the original NTK formulation and our new formulation are the same, so we still have the following proposition: + +Proposition 11 (Proposition 1 in Jacot et al. (2018)). If $\sigma$ is Lipschitz and $d_l \to \infty$ for $l = 1, \dots, L$ , sequentially, then for all $l = 1, \dots, L$ , the distribution of a single element of $\pmb{h}^l$ converges in probability to a zero-mean Gaussian process of covariance $\Sigma^l$ that is defined recursively by: + +$$ +\Sigma^ {1} (\boldsymbol {x}, \boldsymbol {x} ^ {\prime}) = \frac {1}{d _ {0}} \boldsymbol {x} ^ {\top} \boldsymbol {x} ^ {\prime} + \beta^ {2} \tag {41} +$$ + +$$ +\Sigma^ {l} (\boldsymbol {x}, \boldsymbol {x} ^ {\prime}) = \mathbb {E} _ {f} [ \sigma (f (\boldsymbol {x})) \sigma (f (\boldsymbol {x} ^ {\prime})) ] + \beta^ {2} +$$ + +where $f$ is sampled from a zero-mean Gaussian process of covariance $\Sigma^{(l-1)}$ . + +Now we show that for an infinitely wide neural network with $L \geq 1$ hidden layers, $\Theta^{(0)}$ converges in probability to the following non-degenerated deterministic limiting kernel + +$$ +\Theta = \mathbb {E} _ {f \sim \Sigma^ {L}} [ \sigma (f (\boldsymbol {x})) \sigma (f (\boldsymbol {x} ^ {\prime})) ] + \beta^ {2} \tag {42} +$$ + +Consider the output layer $\pmb{h}^{L + 1} = \frac{W^L}{\sqrt{\tilde{d}}} \sigma(\pmb{h}^L) + \beta \pmb{b}^L$ . We can see that for any parameter $\theta_i$ before the output layer, + +$$ +\nabla_ {\theta_ {i}} \boldsymbol {h} ^ {L + 1} = \operatorname {d i a g} \left(\dot {\sigma} \left(\boldsymbol {h} ^ {L}\right)\right) \frac {W ^ {L \top}}{\sqrt {d _ {L}}} \nabla_ {\theta_ {i}} \boldsymbol {h} ^ {L} = 0 \tag {43} +$$ + +And for $W^L$ and $b^L$ , we have + +$$ +\nabla_ {W ^ {L}} \boldsymbol {h} ^ {L + 1} = \frac {1}{\sqrt {d _ {L}}} \sigma \left(\boldsymbol {h} ^ {L}\right) \quad \text {a n d} \quad \nabla_ {\boldsymbol {b} ^ {L}} \boldsymbol {h} ^ {L + 1} = \beta \tag {44} +$$ + +Then we can achieve (42) by the law of large numbers. + +![](images/0e5aecfac9fcab7e0f6eb2f0ab77ca9b3b5f58961d9bd3975f34e335fddb0eb4.jpg) + +# D.3.2 PROOF OF LEMMA 5 + +We will use the following short-hand in the proof: + +$$ +\left\{ \begin{array}{l} g \left(\theta^ {(t)}\right) = f ^ {(t)} (\boldsymbol {X}) - \boldsymbol {Y} \\ J \left(\theta^ {(t)}\right) = \nabla_ {\theta} f (\boldsymbol {X}; \theta^ {(t)}) \in \mathbb {R} ^ {p \times n} \\ \Theta^ {(t)} = J \left(\theta^ {(t)}\right) ^ {\top} J \left(\theta^ {(t)}\right) \end{array} \right. \tag {45} +$$ + +For any $\epsilon > 0$ , there exists $t_{\epsilon}$ such that for all $t \geq t_{\epsilon}$ and all $i$ , $q_{i}^{(t)} \in (q_{i} - \epsilon, q_{i} + \epsilon)$ . Like what we have done in (34), we can rewrite $Q^{(t)} = Q_{\epsilon}^{(t)} = \sqrt{Q_{3\epsilon}^{(t)}} \cdot \sqrt{Q}$ , where $Q = \mathrm{diag}(q_{1}, \dots, q_{n})$ . + +The update rule of a GRW with gradient descent and the squared loss for the wide neural network is: + +$$ +\theta^ {(t + 1)} = \theta^ {(t)} - \eta J (\theta^ {(t)}) \boldsymbol {Q} ^ {(t)} g (\theta^ {(t)}) \tag {46} +$$ + +and for $t \geq t_{\epsilon}$ , it can be rewritten as + +$$ +\theta^ {(t + 1)} = \theta^ {(t)} - \eta J (\theta^ {(t)}) \sqrt {\boldsymbol {Q} _ {3 \epsilon} ^ {(t)}} \left[ \sqrt {\boldsymbol {Q}} g (\theta^ {(t)}) \right] \tag {47} +$$ + +First, we will prove the following theorem: + +Theorem 12. There exist constants $M > 0$ and $\epsilon_0 > 0$ such that for all $\epsilon \in (0, \epsilon_0]$ , $\eta \leq \eta^*$ and any $\delta > 0$ , there exist $R_0 > 0$ , $\tilde{D} > 0$ and $B > 1$ such that for any $\tilde{d} \geq \tilde{D}$ , the following (i) and (ii) hold with probability at least $(1 - \delta)$ over random initialization when applying gradient descent with learning rate $\eta$ : + +(i) For all $t \leq t_{\epsilon}$ , there is + +$$ +\left\| g \left(\theta^ {(t)}\right) \right\| _ {2} \leq B ^ {t} R _ {0} \tag {48} +$$ + +$$ +\sum_ {j = 1} ^ {t} \left\| \theta^ {(j)} - \theta^ {(j - 1)} \right\| _ {2} \leq \eta M R _ {0} \sum_ {j = 1} ^ {t} B ^ {j - 1} < \frac {M B ^ {t _ {\epsilon}} R _ {0}}{B - 1} \tag {49} +$$ + +(ii) For all $t \geq t_{\epsilon}$ , we have + +$$ +\begin{array}{l} \left\| \sqrt {\boldsymbol {Q}} g \left(\theta^ {(t)}\right) \right\| _ {2} \leq \left(1 - \frac {\eta q ^ {*} \lambda^ {\min }}{3}\right) ^ {t - t _ {\epsilon}} B ^ {t _ {\epsilon}} R _ {0} (50) \\ \sum_ {j = t _ {\epsilon} + 1} ^ {t} \left\| \theta^ {(j)} - \theta^ {(j - 1)} \right\| _ {2} \leq \eta \sqrt {1 + 3 \epsilon} M B ^ {t _ {\epsilon}} R _ {0} \sum_ {j = t _ {\epsilon} + 1} ^ {t} \left(1 - \frac {\eta q ^ {*} \lambda^ {\min }}{3}\right) ^ {j - t _ {\epsilon}} (51) \\ < \frac {3 \sqrt {1 + 3 \epsilon} M B ^ {t _ {\epsilon}} R _ {0}}{q ^ {*} \lambda^ {\mathrm {m i n}}} \\ \end{array} +$$ + +Proof. The proof is based on the following lemma: + +Lemma 13 (Local Lipschitzness of the Jacobian). Under Assumption 2, there is a constant $M > 0$ such that for any $C_0 > 0$ and any $\delta > 0$ , there exists a $\tilde{D}$ such that: If $\tilde{d} \geq \tilde{D}$ , then with probability + +at least $(1 - \delta)$ over random initialization, for any $\pmb{x}$ such that $\| \pmb {x}\| _2\leq 1$ + +$$ +\left\{ \begin{array}{c} \left\| \nabla_ {\theta} f (\boldsymbol {x}; \theta) - \nabla_ {\theta} f (\boldsymbol {x}; \tilde {\theta}) \right\| _ {2} \leq \frac {M}{\sqrt [ 4 ]{\tilde {d}}} \left\| \theta - \tilde {\theta} \right\| _ {2} \\ \| \nabla_ {\theta} f (\boldsymbol {x}; \theta) \| _ {2} \leq M \\ \left\| J (\theta) - J (\tilde {\theta}) \right\| _ {F} \leq \frac {M}{\sqrt [ 4 ]{\tilde {d}}} \left\| \theta - \tilde {\theta} \right\| _ {2}, \quad \forall \theta , \tilde {\theta} \in B \left(\theta^ {(0)}, C _ {0}\right) \\ \| J (\theta) \| _ {F} \leq M \end{array} \right. \tag {52} +$$ + +where $B(\theta^{(0)},R) = \{\theta :\left\| \theta -\theta^{(0)}\right\| _2 < R\}$ . + +The proof of this lemma can be found in Appendix D.3.3. Note that for any $\pmb{x}$ , $f^{(0)}(\pmb{x}) = \beta \pmb{b}^L$ where $\pmb{b}^L$ is sampled from the standard Gaussian distribution. Thus, for any $\delta > 0$ , there exists a constant $R_0$ such that with probability at least $(1 - \delta / 3)$ over random initialization, + +$$ +\left\| g \left(\theta^ {(0)}\right) \right\| _ {2} < R _ {0} \tag {53} +$$ + +And by Proposition 3, there exists $D_2 \geq 0$ such that for any $\tilde{d} \geq D_2$ , with probability at least $(1 - \delta / 3)$ , + +$$ +\left\| \Theta - \Theta^ {(0)} \right\| _ {F} \leq \frac {q ^ {*} \lambda^ {\min }}{3} \tag {54} +$$ + +Let $M$ be the constant in Lemma 13. Let $\epsilon_0 = \frac{(q^*\lambda^{\mathrm{min}})^2}{108M^4}$ . Let $B = 1 + \eta^{*}M^{2}$ , and $C_0 = \frac{MB^{t_\epsilon}R_0}{B - 1} + \frac{3\sqrt{1 + 3\epsilon}MB^{t_\epsilon}R_0}{q^*\lambda^{\mathrm{min}}}$ . By Lemma 13, there exists $D_{1} > 0$ such that with probability at least $(1 - \delta /3)$ for any $\tilde{d}\geq D_1$ , (52) is true for all $\theta ,\tilde{\theta}\in B(\theta^{(0)},C_0)$ . + +By union bound, with probability at least $(1 - \delta)$ , (52), (53) and (54) are all true. Now we assume that all of them are true, and prove (48) and (49) by induction. (48) is true for $t = 0$ due to (53), and (49) is always true for $t = 0$ . Suppose (48) and (49) are true for $t$ , then for $t + 1$ we have + +$$ +\begin{array}{l} \left\| \theta^ {(t + 1)} - \theta^ {(t)} \right\| _ {2} \leq \eta \left\| J (\theta^ {(t)}) \boldsymbol {Q} ^ {(t)} \right\| _ {2} \left\| g (\theta^ {(t)}) \right\| _ {2} \leq \eta \left\| J (\theta^ {(t)}) \boldsymbol {Q} ^ {(t)} \right\| _ {F} \left\| g (\theta^ {(t)}) \right\| _ {2} \tag {55} \\ \leq \eta \left\| J (\theta^ {(t)}) \right\| _ {F} \left\| g (\theta^ {(t)}) \right\| _ {2} \leq M \eta B ^ {t} R _ {0} \\ \end{array} +$$ + +So (49) is also true for $t + 1$ . And we also have + +$$ +\begin{array}{l} \left\| g \left(\theta^ {(t + 1)}\right) \right\| _ {2} = \left\| g \left(\theta^ {(t + 1)}\right) - g \left(\theta^ {(t)}\right) + g \left(\theta^ {(t)}\right) \right\| _ {2} \\ = \left\| J (\tilde {\theta} ^ {(t)}) ^ {\top} \left(\theta^ {(t + 1)} - \theta^ {(t)}\right) + g \left(\theta^ {(t)}\right) \right\| _ {2} \\ = \left\| - \eta J (\tilde {\theta} ^ {(t)}) ^ {\top} J (\theta^ {(t)}) \boldsymbol {Q} ^ {(t)} g (\theta^ {(t)}) + g (\theta^ {(t)}) \right\| _ {2} \\ \leq \left\| \boldsymbol {I} - \eta J \left(\tilde {\theta} ^ {(t)}\right) ^ {\top} J \left(\theta^ {(t)}\right) \boldsymbol {Q} ^ {(t)} \right\| _ {2} \left\| g \left(\theta^ {(t)}\right) \right\| _ {2} \tag {56} \\ \leq \left(1 + \left\| \eta J (\tilde {\theta} ^ {(t)}) ^ {\top} J (\theta^ {(t)}) Q ^ {(t)} \right\| _ {2}\right) \left\| g (\theta^ {(t)}) \right\| _ {2} \\ \leq \left(1 + \eta \left\| J (\tilde {\theta} ^ {(t)}) \right\| _ {F} \left\| J (\theta^ {(t)}) \right\| _ {F}\right) \left\| g (\theta^ {(t)}) \right\| _ {2} \\ \leq \left(1 + \eta^ {*} M ^ {2}\right) \left\| g (\theta^ {(t)}) \right\| _ {2} \leq B ^ {t + 1} R _ {0} \\ \end{array} +$$ + +Therefore, (48) and (49) are true for all $t \leq t_{\epsilon}$ , which implies that $\left\| \sqrt{\mathbf{Q}} g(\theta^{(t_{\epsilon})}) \right\|_2 \leq \left\| g(\theta^{(t_{\epsilon})}) \right\|_2 \leq B^{t_{\epsilon}} R_0$ , so (50) is true for $t = t_{\epsilon}$ . And (51) is obviously true for $t = t_{\epsilon}$ . Now, let us prove (ii) by induction. Note that when $t \geq t_{\epsilon}$ , we have the alternative update rule (47). If (50) and (51) are true for $t$ , then for $t + 1$ , there is + +$$ +\begin{array}{l} \left\| \theta^ {(t + 1)} - \theta^ {(t)} \right\| _ {2} \leq \eta \left\| J (\theta^ {(t)}) \sqrt {\boldsymbol {Q} _ {3 \epsilon} ^ {(t)}} \right\| _ {2} \left\| \sqrt {\boldsymbol {Q}} g (\theta^ {(t)}) \right\| _ {2} \leq \eta \left\| J (\theta^ {(t)}) \sqrt {\boldsymbol {Q} _ {3 \epsilon} ^ {(t)}} \right\| _ {F} \left\| \sqrt {\boldsymbol {Q}} g (\theta^ {(t)}) \right\| _ {2} \\ \leq \eta \sqrt {1 + 3 \epsilon} \left\| J \left(\theta^ {(t)}\right) \right\| _ {F} \left\| \sqrt {\mathbf {Q}} g \left(\theta^ {(t)}\right) \right\| _ {2} \leq M \eta \sqrt {1 + 3 \epsilon} \left(1 - \frac {\eta q ^ {*} \lambda^ {\min }}{3}\right) ^ {t - t _ {\epsilon}} B ^ {t _ {\epsilon}} R _ {0} \tag {57} \\ \end{array} +$$ + +So (51) is true for $t + 1$ . And we also have + +$$ +\begin{array}{l} \left\| \sqrt {\boldsymbol {Q}} g (\theta^ {(t + 1)}) \right\| _ {2} = \left\| \sqrt {\boldsymbol {Q}} g (\theta^ {(t + 1)}) - \sqrt {\boldsymbol {Q}} g (\theta^ {(t)}) + \sqrt {\boldsymbol {Q}} g (\theta^ {(t)}) \right\| _ {2} \\ = \left\| \sqrt {\boldsymbol {Q}} J (\tilde {\theta} ^ {(t)}) ^ {\top} \left(\theta^ {(t + 1)} - \theta^ {(t)}\right) + \sqrt {\boldsymbol {Q}} g \left(\theta^ {(t)}\right) \right\| _ {2} \\ = \left\| - \eta \sqrt {\boldsymbol {Q}} J \left(\tilde {\theta} ^ {(t)}\right) ^ {\top} J \left(\theta^ {(t)}\right) \boldsymbol {Q} ^ {(t)} g \left(\theta^ {(t)}\right) + \sqrt {\boldsymbol {Q}} g \left(\theta^ {(t)}\right) \right\| _ {2} \tag {58} \\ \leq \left\| \boldsymbol {I} - \eta \sqrt {\boldsymbol {Q}} J (\tilde {\theta} ^ {(t)}) ^ {\top} J (\theta^ {(t)}) \sqrt {\boldsymbol {Q} _ {3 \epsilon} ^ {(t)}} \right\| _ {2} \left\| \sqrt {\boldsymbol {Q}} g (\theta^ {(t)}) \right\| _ {2} \\ \leq \left\| \boldsymbol {I} - \eta \sqrt {\boldsymbol {Q}} J (\tilde {\theta} ^ {(t)}) ^ {\top} J (\theta^ {(t)}) \sqrt {\boldsymbol {Q} _ {3 \epsilon} ^ {(t)}} \right\| _ {2} \left(1 - \frac {\eta q ^ {*} \lambda^ {\min}}{3}\right) ^ {t} R _ {0} \\ \end{array} +$$ + +where $\tilde{\theta}^{(t)}$ is some linear interpolation between $\theta^{(t)}$ and $\theta^{(t + 1)}$ . Now we prove that + +$$ +\left\| \boldsymbol {I} - \eta \sqrt {\boldsymbol {Q}} J \left(\tilde {\theta} ^ {(t)}\right) ^ {\top} J \left(\theta^ {(t)}\right) \sqrt {\boldsymbol {Q} _ {3 \epsilon} ^ {(t)}} \right\| _ {2} \leq 1 - \frac {\eta q ^ {*} \lambda^ {\min }}{3} \tag {59} +$$ + +For any unit vector $\pmb{v} \in \mathbb{R}^n$ , we have + +$$ +\boldsymbol {v} ^ {\top} (\boldsymbol {I} - \eta \sqrt {\boldsymbol {Q}} \Theta \sqrt {\boldsymbol {Q}}) \boldsymbol {v} = 1 - \eta \boldsymbol {v} ^ {\top} \sqrt {\boldsymbol {Q}} \Theta \sqrt {\boldsymbol {Q}} \boldsymbol {v} \tag {60} +$$ + +$\left\| \sqrt{\boldsymbol{Q}} \boldsymbol{v} \right\|_2 \in [\sqrt{q^*}, 1]$ , so for any $\eta \leq \eta^*$ , $\boldsymbol{v}^\top (\boldsymbol{I} - \eta \sqrt{\boldsymbol{Q}} \Theta \sqrt{\boldsymbol{Q}}) \boldsymbol{v} \in [0, 1 - \eta \lambda^{\min} q^*]$ , which implies that $\left\| \boldsymbol{I} - \eta \sqrt{\boldsymbol{Q}} \Theta \sqrt{\boldsymbol{Q}} \right\|_2 \leq 1 - \eta \lambda^{\min} q^*$ . Thus, + +$$ +\begin{array}{l} \left\| \boldsymbol {I} - \eta \sqrt {\boldsymbol {Q}} J (\tilde {\theta} ^ {(t)}) ^ {\top} J (\theta^ {(t)}) \sqrt {\boldsymbol {Q}} \right\| _ {2} \\ \leq \left\| \boldsymbol {I} - \eta \sqrt {\boldsymbol {Q}} \Theta \sqrt {\boldsymbol {Q}} \right\| _ {2} + \eta \left\| \sqrt {\boldsymbol {Q}} (\Theta - \Theta^ {(0)}) \sqrt {\boldsymbol {Q}} \right\| _ {2} + \eta \left\| \sqrt {\boldsymbol {Q}} (J (\theta^ {(0)}) ^ {\top} J (\theta^ {(0)}) - J (\tilde {\theta} ^ {(t)}) ^ {\top} J (\theta^ {(t)})) \sqrt {\boldsymbol {Q}} \right\| _ {2} \\ \leq 1 - \eta \lambda^ {\min } q ^ {*} + \eta \left\| \sqrt {\boldsymbol {Q}} (\Theta - \Theta^ {(0)}) \sqrt {\boldsymbol {Q}} \right\| _ {F} + \eta \left\| \sqrt {\boldsymbol {Q}} (J (\theta^ {(0)}) ^ {\top} J (\theta^ {(0)}) - J (\tilde {\theta} ^ {(t)}) ^ {\top} J (\theta^ {(t)})) \sqrt {\boldsymbol {Q}} \right\| _ {F} \\ \leq 1 - \eta \lambda^ {\min } q ^ {*} + \eta \left\| \Theta - \Theta^ {(0)} \right\| _ {F} + \eta \left\| J \left(\theta^ {(0)}\right) ^ {\top} J \left(\theta^ {(0)}\right) - J \left(\tilde {\theta} ^ {(t)}\right) ^ {\top} J \left(\theta^ {(t)}\right) \right\| _ {F} \\ \leq 1 - \eta \lambda^ {\min } q ^ {*} + \frac {\eta q ^ {*} \lambda^ {\min }}{3} + \frac {\eta M ^ {2}}{\sqrt [ 4 ]{\tilde {d}}} \left(\left\| \theta^ {(t)} - \theta^ {(0)} \right\| _ {2} + \left\| \tilde {\theta} ^ {(t)} - \theta^ {(0)} \right\| _ {2}\right) \leq 1 - \frac {\eta q ^ {*} \lambda^ {\min }}{2} \tag {61} \\ \end{array} +$$ + +for all $\tilde{d} \geq \max \left\{D_1, D_2, \left(\frac{12M^2C_0}{q^*\lambda^{\min}}\right)^4\right\}$ , which implies that + +$$ +\begin{array}{l} \left\| \boldsymbol {I} - \eta \sqrt {\boldsymbol {Q}} J (\tilde {\theta} ^ {(t)}) ^ {\top} J (\theta^ {(t)}) \sqrt {\boldsymbol {Q} _ {3 \epsilon} ^ {(t)}} \right\| _ {2} \\ \leq 1 - \frac {\eta q ^ {*} \lambda^ {\min }}{2} + \left\| \eta \sqrt {\boldsymbol {Q}} J (\tilde {\theta} ^ {(t)}) ^ {\top} J (\theta^ {(t)}) \left(\sqrt {\boldsymbol {Q} _ {3 \epsilon} ^ {(t)}} - \sqrt {\boldsymbol {Q}}\right) \right\| _ {2} \tag {62} \\ \leq 1 - \frac {\eta q ^ {*} \lambda^ {\min }}{2} + \eta M ^ {2} \sqrt {3 \epsilon} \leq 1 - \frac {\eta q ^ {*} \lambda^ {\min }}{3} \quad (\text {d u e t o (3 7)}) \\ \end{array} +$$ + +for all $\epsilon \leq \epsilon_0$ . Thus, (50) is also true for $t + 1$ . In conclusion, (50) and (51) are true with probability + +at least $(1 - \delta)$ for all $\tilde{d} \geq \tilde{D} = \max \left\{D_1, D_2, \left(\frac{12M^2C_0}{q^*\lambda^{\min}}\right)^4\right\}$ . + +Returning back to the proof of Lemma 5. Choose and fix an $\epsilon$ such that $\epsilon < \min\{\epsilon_0, \frac{1}{3}\left(\frac{q^*\lambda^{\min}}{3\lambda^{\max} + q^*\lambda^{\min}}\right)^2\}$ , where $\epsilon_0$ is defined by Theorem 12. Then, $t_\epsilon$ is also fixed. There exists $\tilde{D} \geq 0$ such that for any $\tilde{d} \geq \tilde{D}$ , with probability at least $(1 - \delta)$ , Theorem 12 and Lemma 13 are true and + +$$ +\left\| \Theta - \Theta^ {(0)} \right\| _ {F} \leq \frac {q ^ {*} \lambda^ {\min }}{3} \tag {63} +$$ + +which immediately implies that + +$$ +\left\| \Theta^ {(0)} \right\| _ {2} \leq \| \Theta \| _ {2} + \left\| \Theta - \Theta^ {(0)} \right\| _ {F} \leq \lambda^ {\max } + \frac {q ^ {*} \lambda^ {\min }}{3} \tag {64} +$$ + +We still denote $B = 1 + \eta^{*}M^{2}$ and $C_0 = \frac{MB^{t\epsilon}R_0}{B - 1} +\frac{3\sqrt{1 + 3\epsilon}MB^{t\epsilon}R_0}{q^*\lambda^{\min}}$ . Theorem 12 ensures that for all $t,\theta^{(t)}\in B(\theta^{(0)},C_0)$ . Then we have + +$$ +\begin{array}{l} \left\| \boldsymbol {I} - \eta \sqrt {\boldsymbol {Q}} \Theta^ {(0)} \sqrt {\boldsymbol {Q}} \right\| _ {2} \leq \left\| \boldsymbol {I} - \eta \sqrt {\boldsymbol {Q}} \Theta \sqrt {\boldsymbol {Q}} \right\| _ {2} + \eta \left\| \sqrt {\boldsymbol {Q}} (\Theta - \Theta^ {(0)}) \sqrt {\boldsymbol {Q}} \right\| _ {2} \\ \leq 1 - \eta \lambda^ {\min } q ^ {*} + \frac {\eta q ^ {*} \lambda^ {\min }}{3} = 1 - \frac {2 \eta q ^ {*} \lambda^ {\min }}{3} \tag {65} \\ \end{array} +$$ + +so it follows that + +$$ +\begin{array}{l} \left\| \boldsymbol {I} - \eta \sqrt {\boldsymbol {Q}} \Theta^ {(0)} \sqrt {\boldsymbol {Q} _ {3 \epsilon} ^ {(t)}} \right\| _ {2} \leq \left\| \boldsymbol {I} - \eta \sqrt {\boldsymbol {Q}} \Theta^ {(0)} \sqrt {\boldsymbol {Q}} \right\| _ {2} + \left\| \eta \sqrt {\boldsymbol {Q}} \Theta^ {(0)} \left(\sqrt {\boldsymbol {Q} _ {3 \epsilon} ^ {(t)}} - \sqrt {\boldsymbol {Q}}\right) \right\| _ {2} \tag {66} \\ \leq 1 - \frac {2 \eta q ^ {*} \lambda^ {\operatorname* {m i n}}}{3} + \eta (\lambda^ {\operatorname* {m a x}} + \frac {q ^ {*} \lambda^ {\operatorname* {m i n}}}{3}) \sqrt {3 \epsilon} \\ \end{array} +$$ + +Thus, for all $\epsilon < \frac{1}{3}\left(\frac{q^{*}\lambda^{\min}}{3\lambda^{\max} + q^{*}\lambda^{\min}}\right)^{2}$ , there is + +$$ +\left\| \boldsymbol {I} - \eta \sqrt {\boldsymbol {Q}} \Theta^ {(0)} \sqrt {\boldsymbol {Q} _ {3 \epsilon} ^ {(t)}} \right\| _ {2} \leq 1 - \frac {\eta q ^ {*} \lambda^ {\min }}{3} \tag {67} +$$ + +The update rule of the GRW for the linearized neural network is: + +$$ +\theta_ {\mathrm {l i n}} ^ {(t + 1)} = \theta_ {\mathrm {l i n}} ^ {(t)} - \eta J \left(\theta^ {(0)}\right) \boldsymbol {Q} ^ {(t)} g _ {\mathrm {l i n}} \left(\theta^ {(t)}\right) \tag {68} +$$ + +where we use the subscript "lin" to denote the linearized neural network, and with a slight abuse of notion denote $g_{\mathrm{lin}}(\theta^{(t)}) = g(\theta_{\mathrm{lin}}^{(t)})$ . + +First, let us consider the training data $\mathbf{X}$ . Denote $\Delta_t = g_{\mathrm{lin}}(\theta^{(t)}) - g(\theta^{(t)})$ . We have + +$$ +\left\{ \begin{array}{c} g _ {\mathrm {l i n}} \left(\theta^ {(t + 1)}\right) - g _ {\mathrm {l i n}} \left(\theta^ {(t)}\right) = - \eta J \left(\theta^ {(0)}\right) ^ {\top} J \left(\theta^ {(0)}\right) \boldsymbol {Q} ^ {(t)} g _ {\mathrm {l i n}} \left(\theta^ {(t)}\right) \\ g \left(\theta^ {(t + 1)}\right) - g \left(\theta^ {(t)}\right) = - \eta J \left(\tilde {\theta} ^ {(t)}\right) ^ {\top} J \left(\theta^ {(t)}\right) \boldsymbol {Q} ^ {(t)} g \left(\theta^ {(t)}\right) \end{array} \right. \tag {69} +$$ + +where $\tilde{\theta}^{(t)}$ is some linear interpolation between $\theta^{(t)}$ and $\theta^{(t + 1)}$ . Thus, + +$$ +\begin{array}{l} \Delta_ {t + 1} - \Delta_ {t} = \eta \left[ J \left(\tilde {\theta} ^ {(t)}\right) ^ {\top} J \left(\theta^ {(t)}\right) - J \left(\theta^ {(0)}\right) ^ {\top} J \left(\theta^ {(0)}\right) \right] Q ^ {(t)} g \left(\theta^ {(t)}\right) \tag {70} \\ - \eta J (\theta^ {(0)}) ^ {\top} J (\theta^ {(0)}) Q ^ {(t)} \Delta_ {t} \\ \end{array} +$$ + +By Lemma 13, we have + +$$ +\begin{array}{l} \left\| J (\tilde {\theta} ^ {(t)}) ^ {\top} J (\theta^ {(t)}) - J (\theta^ {(0)}) ^ {\top} J (\theta^ {(0)}) \right\| _ {F} \\ \leq \left\| \left(J (\tilde {\theta} ^ {(t)}) - J (\theta^ {(0)})\right) ^ {\top} J (\theta^ {(t)}) \right\| _ {F} + \left\| J (\theta^ {(0)}) ^ {\top} \left(J (\theta^ {(t)}) - J (\theta^ {(0)})\right) \right\| _ {F} \tag {71} \\ \leq 2 M ^ {2} C _ {0} \tilde {d} ^ {- 1 / 4} \\ \end{array} +$$ + +which implies that for all $t < t_{\epsilon}$ + +$$ +\begin{array}{l} \| \Delta_ {t + 1} \| _ {2} \leq \left\| \left[ \boldsymbol {I} - \eta J (\theta^ {(0)}) ^ {\top} J (\theta^ {(0)}) \boldsymbol {Q} ^ {(t)} \right] \Delta_ {t} \right\| _ {2} + \left\| \eta \left[ J (\tilde {\theta} ^ {(t)}) ^ {\top} J (\theta^ {(t)}) - J (\theta^ {(0)}) ^ {\top} J (\theta^ {(0)}) \right] \boldsymbol {Q} ^ {(t)} g (\theta^ {(t)}) \right\| _ {2} \\ \leq \left\| \boldsymbol {I} - \eta J (\theta^ {(0)}) ^ {\top} J (\theta^ {(0)}) \boldsymbol {Q} ^ {(t)} \right\| _ {F} \| \Delta_ {t} \| _ {2} + \eta \left\| J (\tilde {\theta} ^ {(t)}) ^ {\top} J (\theta^ {(t)}) - J (\theta^ {(0)}) ^ {\top} J (\theta^ {(0)}) \right\| _ {F} \left\| g (\theta^ {(t)}) \right\| _ {2} \\ \leq \left(1 + \eta M ^ {2}\right) \| \Delta_ {t} \| _ {2} + 2 \eta M ^ {2} C _ {0} B ^ {t} R _ {0} \tilde {d} ^ {- 1 / 4} \\ \leq B \left\| \Delta_ {t} \right\| _ {2} + 2 \eta M ^ {2} C _ {0} B ^ {t} R _ {0} \tilde {d} ^ {- 1 / 4} \tag {72} \\ \end{array} +$$ + +Therefore, we have + +$$ +B ^ {- (t + 1)} \| \Delta_ {t + 1} \| _ {2} \leq B ^ {- t} \| \Delta_ {t} \| _ {2} + 2 \eta M ^ {2} C _ {0} B ^ {- 1} R _ {0} \tilde {d} ^ {- 1 / 4} \tag {73} +$$ + +Since $\Delta_0 = 0$ , it follows that for all $t \leq t_{\epsilon}$ + +$$ +\left\| \Delta_ {t} \right\| _ {2} \leq 2 t \eta M ^ {2} C _ {0} B ^ {t - 1} R _ {0} \tilde {d} ^ {- 1 / 4} \tag {74} +$$ + +and particularly we have + +$$ +\left\| \sqrt {Q} \Delta_ {t _ {\epsilon}} \right\| _ {2} \leq \| \Delta_ {t _ {\epsilon}} \| _ {2} \leq 2 t _ {\epsilon} \eta M ^ {2} C _ {0} B ^ {t _ {\epsilon} - 1} R _ {0} \tilde {d} ^ {- 1 / 4} \tag {75} +$$ + +For $t \geq t_{\epsilon}$ , we have the alternative update rule (47). Thus, + +$$ +\begin{array}{l} \sqrt {\boldsymbol {Q}} \Delta_ {t + 1} - \sqrt {\boldsymbol {Q}} \Delta_ {t} = \eta \sqrt {\boldsymbol {Q}} \left[ J \left(\tilde {\theta} ^ {(t)}\right) ^ {\top} J \left(\theta^ {(t)}\right) - J \left(\theta^ {(0)}\right) ^ {\top} J \left(\theta^ {(0)}\right) \right] \sqrt {\boldsymbol {Q} _ {3 \epsilon} ^ {(t)}} \left[ \sqrt {\boldsymbol {Q}} g \left(\theta^ {(t)}\right) \right] \tag {76} \\ - \eta \sqrt {\boldsymbol {Q}} J (\theta^ {(0)}) ^ {\top} J (\theta^ {(0)}) \sqrt {\boldsymbol {Q} _ {3 \epsilon} ^ {(t)}} \left[ \sqrt {\boldsymbol {Q}} \Delta_ {t} \right] \\ \end{array} +$$ + +Let $\mathbf{A} = \mathbf{I} - \eta \sqrt{\mathbf{Q}} J(\theta^{(0)})^{\top}J(\theta^{(0)})\sqrt{\mathbf{Q}_{3\epsilon}^{(t)}} = \mathbf{I} - \eta \sqrt{\mathbf{Q}}\Theta^{(0)}\sqrt{\mathbf{Q}_{3\epsilon}^{(t)}}$ . Then, we have + +$$ +\sqrt {\boldsymbol {Q}} \Delta_ {t + 1} = \boldsymbol {A} \sqrt {\boldsymbol {Q}} \Delta_ {t} + \eta \sqrt {\boldsymbol {Q}} \left[ J \left(\tilde {\theta} ^ {(t)}\right) ^ {\top} J \left(\theta^ {(t)}\right) - J \left(\theta^ {(0)}\right) ^ {\top} J \left(\theta^ {(0)}\right) \right] \sqrt {\boldsymbol {Q} _ {3 \epsilon} ^ {(t)}} \left(\sqrt {\boldsymbol {Q}} g \left(\theta^ {(t)}\right)\right) \tag {77} +$$ + +Let $\gamma = 1 - \frac{\eta q^{*}\lambda^{\min}}{3} < 1$ . Combining with Theorem 12 and (67), the above leads to + +$$ +\begin{array}{l} \left\| \sqrt {Q} \Delta_ {t + 1} \right\| _ {2} \leq \| A \| _ {2} \left\| \sqrt {Q} \Delta_ {t} \right\| _ {2} + \eta \left\| \sqrt {Q} \left[ J (\tilde {\theta} ^ {(t)}) ^ {\top} J (\theta^ {(t)}) - J (\theta^ {(0)}) ^ {\top} J (\theta^ {(0)}) \right] \sqrt {Q _ {3 \epsilon} ^ {(t)}} \right\| _ {2} \left\| \sqrt {Q} g (\theta^ {(t)}) \right\| _ {2} \\ \leq \gamma \left\| \sqrt {\boldsymbol {Q}} \Delta_ {t} \right\| _ {2} + \eta \left\| J (\tilde {\theta} ^ {(t)}) ^ {\top} J (\theta^ {(t)}) - J (\theta^ {(0)}) ^ {\top} J (\theta^ {(0)}) \right\| _ {F} \sqrt {1 + 3 \epsilon} \gamma^ {t - t _ {\epsilon}} B ^ {t _ {\epsilon}} R _ {0} \\ \leq \gamma \left\| \sqrt {\boldsymbol {Q}} \Delta_ {t} \right\| _ {2} + 2 \eta M ^ {2} C _ {0} \sqrt {1 + 3 \epsilon} \gamma^ {t - t _ {\epsilon}} B ^ {t _ {\epsilon}} R _ {0} \tilde {d} ^ {- 1 / 4} \tag {78} \\ \end{array} +$$ + +This implies that + +$$ +\left. \gamma^ {- (t + 1)} \left\| \sqrt {\boldsymbol {Q}} \Delta_ {t + 1} \right\| _ {2} \leq \gamma^ {- t} \left\| \sqrt {\boldsymbol {Q}} \Delta_ {t} \right\| _ {2} + 2 \eta M ^ {2} C _ {0} \sqrt {1 + 3 \epsilon} \gamma^ {- 1 - t _ {\epsilon}} B ^ {t _ {\epsilon}} R _ {0} \tilde {d} ^ {- 1 / 4} \right. \tag {79} +$$ + +Combining with (75), it implies that for all $t \geq t_{\epsilon}$ + +$$ +\left\| \sqrt {Q} \Delta_ {t} \right\| _ {2} \leq 2 \gamma^ {t - t _ {\epsilon}} \eta M ^ {2} C _ {0} B ^ {t _ {\epsilon}} R _ {0} \left[ t _ {\epsilon} B ^ {- 1} + \sqrt {1 + 3 \epsilon} \gamma^ {- 1} (t - t _ {\epsilon}) \right] \tilde {d} ^ {- 1 / 4} \tag {80} +$$ + +Next, we consider an arbitrary test point $\pmb{x}$ such that $\| \pmb{x} \|_2 \leq 1$ . Denote $\delta_t = f_{\mathrm{lin}}^{(t)}(\pmb{x}) - f^{(t)}(\pmb{x})$ . Then we have + +$$ +\left\{ \begin{array}{l} f _ {\text {l i n}} ^ {(t + 1)} (\boldsymbol {x}) - f _ {\text {l i n}} ^ {(t)} (\boldsymbol {x}) = - \eta \nabla_ {\theta} f (\boldsymbol {x}; \theta^ {(0)}) ^ {\top} J \left(\theta^ {(0)}\right) \boldsymbol {Q} ^ {(t)} g _ {\text {l i n}} \left(\theta^ {(t)}\right) \\ f ^ {(t + 1)} (\boldsymbol {x}) - f ^ {(t)} (\boldsymbol {x}) = - \eta \nabla_ {\theta} f (\boldsymbol {x}; \tilde {\theta} ^ {(t)}) ^ {\top} J \left(\theta^ {(t)}\right) \boldsymbol {Q} ^ {(t)} g \left(\theta^ {(t)}\right) \end{array} \right. \tag {81} +$$ + +which yields + +$$ +\begin{array}{l} \delta_ {t + 1} - \delta_ {t} = \eta \left[ \nabla_ {\theta} f (\boldsymbol {x}; \tilde {\theta} ^ {(t)}) ^ {\top} J \left(\theta^ {(t)}\right) - \nabla_ {\theta} f (\boldsymbol {x}; \theta^ {(0)}) ^ {\top} J \left(\theta^ {(0)}\right) \right] \boldsymbol {Q} ^ {(t)} g \left(\theta^ {(t)}\right) \tag {82} \\ - \eta \nabla_ {\theta} f (\boldsymbol {x}; \theta^ {(0)}) ^ {\top} J (\theta^ {(0)}) \boldsymbol {Q} ^ {(t)} \Delta_ {t} \\ \end{array} +$$ + +For $t \leq t_{\epsilon}$ , we have + +$$ +\begin{array}{l} \| \delta_ {t} \| _ {2} \leq \eta \sum_ {s = 0} ^ {t - 1} \left\| \left[ \nabla_ {\theta} f (\pmb {x}; \tilde {\theta} ^ {(s)}) ^ {\top} J (\theta^ {(s)}) - \nabla_ {\theta} f (\pmb {x}; \theta^ {(0)}) ^ {\top} J (\theta^ {(0)}) \right] \pmb {Q} ^ {(s)} \right\| _ {2} \left\| g (\theta^ {(s)}) \right\| _ {2} \\ + \eta \sum_ {s = 0} ^ {t - 1} \left\| \nabla_ {\theta} f (\boldsymbol {x}; \theta^ {(0)}) ^ {\top} J (\theta^ {(0)}) \boldsymbol {Q} ^ {(s)} \right\| _ {2} \| \Delta_ {s} \| _ {2} \\ \leq \eta \sum_ {s = 0} ^ {t - 1} \left\| \nabla_ {\theta} f (\boldsymbol {x}; \tilde {\theta} ^ {(s)}) ^ {\top} J \left(\theta^ {(s)}\right) - \nabla_ {\theta} f (\boldsymbol {x}; \theta^ {(0)}) ^ {\top} J \left(\theta^ {(0)}\right) \right\| _ {F} \left\| g \left(\theta^ {(s)}\right) \right\| _ {2} \tag {83} \\ + \eta \sum_ {s = 0} ^ {t - 1} \left\| \nabla_ {\theta} f (\boldsymbol {x}; \theta^ {(0)}) \right\| _ {2} \left\| J (\theta^ {(0)}) \right\| _ {F} \| \Delta_ {s} \| _ {2} \\ \leq 2 \eta M ^ {2} C _ {0} \tilde {d} ^ {- 1 / 4} \sum_ {s = 0} ^ {t - 1} B ^ {s} R _ {0} + \eta M ^ {2} \sum_ {s = 0} ^ {t - 1} (2 s \eta M ^ {2} C _ {0} B ^ {s - 1} R _ {0} \tilde {d} ^ {- 1 / 4}) \\ \end{array} +$$ + +So we can see that there exists a constant $C_1$ such that $\| \delta_{t_\epsilon}\| _2\leq C_1\tilde{d}^{-1 / 4}$ . Then, for $t > t_{\epsilon}$ , we have + +$$ +\begin{array}{l} \| \delta_ {t} \| _ {2} - \| \delta_ {t _ {\epsilon}} \| _ {2} \leq \eta \sum_ {s = t _ {\epsilon}} ^ {t - 1} \left\| \left[ \nabla_ {\theta} f (\boldsymbol {x}; \tilde {\theta} ^ {(s)}) ^ {\top} J (\theta^ {(s)}) - \nabla_ {\theta} f (\boldsymbol {x}; \theta^ {(0)}) ^ {\top} J (\theta^ {(0)}) \right] \sqrt {\boldsymbol {Q} _ {3 \epsilon} ^ {(s)}} \right\| _ {2} \left\| \sqrt {\boldsymbol {Q}} g (\theta^ {(s)}) \right\| _ {2} \\ + \eta \sum_ {s = t _ {\epsilon}} ^ {t - 1} \left\| \nabla_ {\theta} f (\boldsymbol {x}; \theta^ {(0)}) ^ {\top} J (\theta^ {(0)}) \sqrt {\boldsymbol {Q} _ {3 \epsilon} ^ {(s)}} \right\| _ {2} \left\| \sqrt {\boldsymbol {Q}} \Delta_ {s} \right\| _ {2} \\ \leq 2 \eta M ^ {2} C _ {0} \tilde {d} ^ {- 1 / 4} \sqrt {1 + 3 \epsilon} \sum_ {s = t _ {\epsilon}} ^ {t - 1} \gamma^ {s - t _ {\epsilon}} B ^ {t _ {\epsilon}} R _ {0} \\ + \eta M ^ {2} \sqrt {1 + 3 \epsilon} \sum_ {s = t _ {\epsilon}} ^ {t - 1} \left(2 \gamma^ {s - t _ {\epsilon}} \eta M ^ {2} C _ {0} B ^ {t _ {\epsilon}} R _ {0} \left[ t _ {\epsilon} B ^ {- 1} + \sqrt {1 + 3 \epsilon} \gamma^ {- 1} (s - t _ {\epsilon}) \right] \tilde {d} ^ {- 1 / 4}\right) \tag {84} \\ \end{array} +$$ + +Note that $\sum_{t=0}^{\infty} t\gamma^{t}$ is finite as long as $\gamma \in (0,1)$ . Therefore, there is a constant $C$ such that for any $t$ , $\|\delta_t\|_2 \leq C\tilde{d}^{-1/4}$ with probability at least $(1-\delta)$ for any $\tilde{d} \geq \tilde{D}$ . + +# D.3.3 PROOF OF LEMMA 13 + +We will use the following theorem regarding the eigenvalues of random Gaussian matrices: + +Theorem 14 (Corollary 5.35 in Vershynin (2010)). If $A \in \mathbb{R}^{p \times q}$ is a random matrix whose entries are independent standard normal random variables, then for every $t \geq 0$ , with probability at least $1 - 2\exp(-t^2 / 2)$ , + +$$ +\sqrt {p} - \sqrt {q} - t \leq \lambda^ {\min } (\boldsymbol {A}) \leq \lambda^ {\max } (\boldsymbol {A}) \leq \sqrt {p} + \sqrt {q} + t \tag {85} +$$ + +By this theorem, and also note that $W^L$ is a vector, we can see that for any $\delta$ , there exist $\tilde{D} > 0$ and $M_1 > 0$ such that if $\tilde{d} \geq \tilde{D}$ , then with probability at least $(1 - \delta)$ , for all $\theta \in B(\theta^{(0)}, C_0)$ , we have + +$$ +\left\| W ^ {l} \right\| _ {2} \leq 3 \sqrt {\tilde {d}} \quad (\forall 0 \leq l \leq L - 1) \quad \text {a n d} \quad \left\| W ^ {L} \right\| _ {2} \leq C _ {0} \leq 3 \sqrt [ 4 ]{\tilde {d}} \tag {86} +$$ + +as well as + +$$ +\left\| \beta \boldsymbol {b} ^ {l} \right\| _ {2} \leq M _ {1} \sqrt {\tilde {d}} \quad (\forall l = 0, \dots , L) \tag {87} +$$ + +Now we assume that (86) and (87) are true. Then, for any $\pmb{x}$ such that $\| \pmb{x}\| _2\leq 1$ + +$$ +\left\| \boldsymbol {h} ^ {1} \right\| _ {2} = \left\| \frac {1}{\sqrt {d _ {0}}} W ^ {0} \boldsymbol {x} + \beta \boldsymbol {b} ^ {0} \right\| _ {2} \leq \frac {1}{\sqrt {d _ {0}}} \left\| W ^ {0} \right\| _ {2} \left\| \boldsymbol {x} \right\| _ {2} + \left\| \beta \boldsymbol {b} ^ {0} \right\| _ {2} \leq \left(\frac {3}{\sqrt {d _ {0}}} + M _ {1}\right) \sqrt {\tilde {d}} +$$ + +$$ +\left\| \boldsymbol {h} ^ {l + 1} \right\| _ {2} = \left\| \frac {1}{\sqrt {\tilde {d}}} W ^ {l} \boldsymbol {x} ^ {l} + \beta \boldsymbol {b} ^ {l} \right\| _ {2} \leq \frac {1}{\sqrt {\tilde {d}}} \left\| W ^ {l} \right\| _ {2} \left\| \boldsymbol {x} ^ {l} \right\| _ {2} + \left\| \beta \boldsymbol {b} ^ {l} \right\| _ {2} \quad (\forall l \geq 1) \tag {88} +$$ + +$$ +\left\| \boldsymbol {x} ^ {l} \right\| _ {2} = \left\| \sigma (\boldsymbol {h} ^ {l}) - \sigma (\boldsymbol {0} ^ {l}) + \sigma (\boldsymbol {0} ^ {l}) \right\| _ {2} \leq L _ {0} \left\| \boldsymbol {h} ^ {l} \right\| _ {2} + \sigma (0) \sqrt {\tilde {d}} \quad (\forall l \geq 1) +$$ + +where $L_0$ is the Lipschitz constant of $\sigma$ and $\sigma(\mathbf{0}^l) = (\sigma(0), \dots, \sigma(0)) \in \mathbb{R}^{d_l}$ . By induction, there exists an $M_2 > 0$ such that $\| \pmb{x}^l \|_2 \leq M_2 \sqrt{\tilde{d}}$ and $\| \pmb{h}^l \|_2 \leq M_2 \sqrt{\tilde{d}}$ for all $l = 1, \dots, L$ . + +Denote $\alpha^l = \nabla_{\pmb{h}^l}f(\pmb{x}) = \nabla_{\pmb{h}^l}\pmb{h}^{L + 1}$ . For all $l = 1,\dots ,L$ , we have $\alpha^l = \mathrm{diag}(\dot{\sigma} (\pmb{h}^l))\frac{W^{l\top}}{\sqrt{\tilde{d}}}\pmb{\alpha}^{l + 1}$ where $\dot{\sigma} (x)\leq L_0$ for all $x\in \mathbb{R}$ since $\sigma$ is $L_{0}$ -Lipschitz, $\alpha^{L + 1} = 1$ and $\| \alpha^L\| _2 = \left\| \mathrm{diag}(\dot{\sigma} (\pmb{h}^L))\frac{W^{L\top}}{\sqrt{\tilde{d}}}\right\| _2\leq \frac{3}{\sqrt[4]{\tilde{d}}} L_0$ . Then, we can easily prove by induction that there exists an $M_3 > 1$ such that $\| \alpha^l\| _2\leq M_3 / \sqrt[4]{d}$ for all $l = 1,\dots ,L$ (note that this is not true for $L + 1$ because $\alpha^{L + 1} = 1$ ). + +For $l = 0$ , $\nabla_{W^0}f(\pmb{x}) = \frac{1}{\sqrt{d_0}}\pmb{x}^0\pmb{\alpha}^{1\top}$ , so $\| \nabla_{W^l}f(\pmb{x})\|_2 \leq \frac{1}{\sqrt{d_0}}\| \pmb{x}^0\|_2\| \pmb{\alpha}^1\|_2 \leq \frac{1}{\sqrt{d_0}} M_3 / \sqrt[4]{d}$ . And for any $l = 1, \dots, L$ , $\nabla_{W^l}f(\pmb{x}) = \frac{1}{\sqrt{\tilde{d}}} \pmb{x}^l\pmb{\alpha}^{l+1}$ , so $\| \nabla_{W^l}f(\pmb{x})\|_2 \leq \frac{1}{\sqrt{\tilde{d}}} \left\| \pmb{x}^l\right\|_2\left\| \pmb{\alpha}^{l+1}\right\|_2 \leq M_2M_3$ . (Note that if $M_3 > 1$ , then $\left\| \pmb{\alpha}^{L+1}\right\|_2 \leq M_3$ ; and since $\tilde{d} \geq 1$ , there is $\left\| \pmb{\alpha}^l\right\|_2 \leq M_3$ for $l \leq L$ .) Moreover, for $l = 0, \dots, L$ , $\nabla_{\pmb{b}^l}f(\pmb{x}) = \beta \pmb{\alpha}^{l+1}$ , so $\left\| \nabla_{\pmb{b}^l}f(\pmb{x})\right\|_2 \leq \beta M_3$ . Thus, if (86) and (87) are true, then there exists an $M_4 > 0$ , such that $\left\| \nabla_\theta f(\pmb{x})\right\|_2 \leq M_4 / \sqrt{n}$ . And since $\left\| \pmb{x}_i\right\|_2 \leq 1$ for all $i$ , so $\left\| J(\theta)\right\|_F \leq M_4$ . + +Next, we consider the difference in $\nabla_{\theta}f(\pmb {x})$ between $\theta$ and $\tilde{\theta}$ . Let $\tilde{f},\tilde{W},\tilde{b},\tilde{x},\tilde{h},\tilde{\alpha}$ be the function and the values corresponding to $\tilde{\theta}$ . There is + +$$ +\begin{array}{l} \left\| \boldsymbol {h} ^ {1} - \tilde {\boldsymbol {h}} ^ {1} \right\| _ {2} = \left\| \frac {1}{\sqrt {d _ {0}}} (W ^ {0} - \tilde {W} ^ {0}) \boldsymbol {x} + \beta (\boldsymbol {b} ^ {0} - \tilde {\boldsymbol {b}} ^ {0}) \right\| _ {2} \\ \leq \frac {1}{\sqrt {d _ {0}}} \left\| W ^ {0} - \tilde {W} ^ {0} \right\| _ {2} \| \boldsymbol {x} \| _ {2} + \beta \left\| \boldsymbol {b} ^ {0} - \tilde {\boldsymbol {b}} ^ {0} \right\| _ {2} \leq \left(\frac {1}{\sqrt {d _ {0}}} + \beta\right) \| \theta - \tilde {\theta} \| _ {2} \\ \end{array} +$$ + +$$ +\begin{array}{l} \left\| \boldsymbol {h} ^ {l + 1} - \tilde {\boldsymbol {h}} ^ {l + 1} \right\| _ {2} = \left\| \frac {1}{\sqrt {\tilde {d}}} W ^ {l} \left(\boldsymbol {x} ^ {l} - \tilde {\boldsymbol {x}} ^ {l}\right) + \frac {1}{\sqrt {\tilde {d}}} \left(W ^ {l} - \tilde {W} ^ {l}\right) \tilde {\boldsymbol {x}} ^ {l} + \beta \left(\boldsymbol {b} ^ {l} - \tilde {\boldsymbol {b}} ^ {l}\right) \right\| _ {2} \tag {89} \\ \leq \frac {1}{\sqrt {\tilde {d}}} \left\| W ^ {l} \right\| _ {2} \left\| \boldsymbol {x} ^ {l} - \tilde {\boldsymbol {x}} ^ {l} \right\| _ {2} + \frac {1}{\sqrt {\tilde {d}}} \left\| W ^ {l} - \tilde {W} ^ {l} \right\| _ {2} \left\| \tilde {\boldsymbol {x}} ^ {l} \right\| _ {2} + \beta \left\| \boldsymbol {b} ^ {l} - \tilde {\boldsymbol {b}} ^ {l} \right\| _ {2} \\ \leq 3 \left\| \boldsymbol {x} ^ {l} - \tilde {\boldsymbol {x}} ^ {l} \right\| _ {2} + (M _ {2} + \beta) \left\| \theta - \tilde {\theta} \right\| _ {2} \quad (\forall l \geq 1) \\ \end{array} +$$ + +$$ +\left\| \boldsymbol {x} ^ {l} - \tilde {\boldsymbol {x}} ^ {l} \right\| _ {2} = \left\| \sigma (\boldsymbol {h} ^ {l}) - \sigma (\tilde {\boldsymbol {h}} ^ {l}) \right\| _ {2} \leq L _ {0} \left\| \boldsymbol {h} ^ {l} - \tilde {\boldsymbol {h}} ^ {l} \right\| _ {2} \quad (\forall l \geq 1) +$$ + +By induction, there exists an $M_5 > 0$ such that $\left\| \boldsymbol{x}^l - \tilde{\boldsymbol{x}}^l \right\|_2 \leq M_5 \left\| \theta - \tilde{\theta} \right\|_2$ for all $l$ . + +For $\alpha^l$ , we have $\alpha^{L + 1} = \tilde{\alpha}^{L + 1} = 1$ , and for all $l \geq 1$ , + +$$ +\begin{array}{l} \left\| \boldsymbol {\alpha} ^ {l} - \tilde {\boldsymbol {\alpha}} ^ {l} \right\| _ {2} = \left\| \operatorname {d i a g} (\dot {\sigma} (\boldsymbol {h} ^ {l})) \frac {W ^ {l \top}}{\sqrt {\tilde {d}}} \boldsymbol {\alpha} ^ {l + 1} - \operatorname {d i a g} (\dot {\sigma} (\tilde {\boldsymbol {h}} ^ {l})) \frac {\tilde {W} ^ {l \top}}{\sqrt {\tilde {d}}} \tilde {\boldsymbol {\alpha}} ^ {l + 1} \right\| _ {2} \\ \leq \left\| \operatorname {d i a g} (\dot {\sigma} (h ^ {l})) \frac {W ^ {l ^ {\top}}}{\sqrt {\tilde {d}}} (\boldsymbol {\alpha} ^ {l + 1} - \tilde {\boldsymbol {\alpha}} ^ {l + 1}) \right\| _ {2} + \left\| \operatorname {d i a g} (\dot {\sigma} (h ^ {l})) \frac {(W ^ {l} - \tilde {W} ^ {l}) ^ {\top}}{\sqrt {\tilde {d}}} \tilde {\boldsymbol {\alpha}} ^ {l + 1} \right\| _ {2} \\ + \left\| \operatorname {d i a g} \left(\left(\dot {\sigma} \left(\boldsymbol {h} ^ {l}\right) - \dot {\sigma} \left(\tilde {\boldsymbol {h}} ^ {l}\right)\right)\right) \frac {\tilde {W} ^ {l \top}}{\sqrt {\tilde {d}}} \tilde {\boldsymbol {\alpha}} ^ {l + 1} \right\| _ {2} \\ \leq 3 L _ {0} \left\| \boldsymbol {\alpha} ^ {l + 1} - \tilde {\boldsymbol {\alpha}} ^ {l + 1} \right\| _ {2} + \left(M _ {3} L _ {0} \tilde {d} ^ {- 1 / 2} + 3 M _ {3} M _ {5} L _ {1} \tilde {d} ^ {- 1 / 4}\right) \left\| \theta - \tilde {\theta} \right\| _ {2} \tag {90} \\ \end{array} +$$ + +where $L_{1}$ is the Lipschitz constant of $\dot{\sigma}$ . Particularly, for $l = L$ , though $\tilde{\alpha}^{L + 1} = 1$ , since $\left\| \tilde{W}^L\right\|_2\leq 3\tilde{d}^{1 / 4}$ , (90) is still true. By induction, there exists an $M_6 > 0$ such that $\left\| \boldsymbol {\alpha}^l -\tilde{\boldsymbol{\alpha}}^l\right\|_2\leq \frac{M_6}{\sqrt[4]{\tilde{d}}}\left\| \theta -\tilde{\theta}\right\|_2$ for all $l\geq 1$ (note that this is also true for $l = L + 1$ ). + +Thus, if (86) and (87) are true, then for all $\theta, \tilde{\theta} \in B(\theta^{(0)}, C_0)$ , any $\pmb{x}$ such that $\| \pmb{x} \|_2 \leq 1$ , we have + +$$ +\begin{array}{l} \left\| \nabla_ {W ^ {0}} f (\boldsymbol {x}) - \nabla_ {\tilde {W} ^ {0}} \tilde {f} (\boldsymbol {x}) \right\| _ {2} = \frac {1}{\sqrt {d _ {0}}} \left\| \boldsymbol {x} \boldsymbol {\alpha} ^ {1 \top} - \boldsymbol {x} \tilde {\boldsymbol {\alpha}} ^ {1 \top} \right\| _ {2} \\ \leq \frac {1}{\sqrt {d _ {0}}} \left\| \boldsymbol {\alpha} ^ {1} - \tilde {\boldsymbol {\alpha}} ^ {1} \right\| _ {2} \tag {91} \\ \leq \frac {1}{\sqrt {d _ {0}}} \frac {M _ {6}}{\sqrt [ 4 ]{\tilde {d}}} \left\| \theta - \tilde {\theta} \right\| _ {2} \\ \end{array} +$$ + +and for $l = 1,\dots ,L$ we have + +$$ +\begin{array}{l} \left\| \nabla_ {W ^ {l}} f (\boldsymbol {x}) - \nabla_ {\tilde {W} ^ {l}} \tilde {f} (\boldsymbol {x}) \right\| _ {2} = \frac {1}{\sqrt {\tilde {d}}} \left\| \boldsymbol {x} ^ {l} \boldsymbol {\alpha} ^ {l + 1 \top} - \tilde {\boldsymbol {x}} ^ {l} \tilde {\boldsymbol {\alpha}} ^ {l + 1 \top} \right\| _ {2} \\ \leq \frac {1}{\sqrt {\tilde {d}}} \left(\left\| \boldsymbol {x} ^ {l} \right\| _ {2} \left\| \boldsymbol {\alpha} ^ {l + 1} - \tilde {\boldsymbol {\alpha}} ^ {l + 1} \right\| _ {2} + \left\| \boldsymbol {x} ^ {l} - \tilde {\boldsymbol {x}} ^ {l} \right\| _ {2} \left\| \tilde {\boldsymbol {\alpha}} ^ {l + 1} \right\| _ {2}\right) \tag {92} \\ \leq \left(\frac {M _ {2} M _ {6}}{\sqrt [ 4 ]{\tilde {d}}} + \frac {M _ {5} M _ {3}}{\sqrt {\tilde {d}}}\right) \left\| \theta - \tilde {\theta} \right\| _ {2} \\ \end{array} +$$ + +Moreover, for any $l = 0,\dots ,L$ , there is + +$$ +\left\| \nabla_ {b ^ {l}} f (\boldsymbol {x}) - \nabla_ {\tilde {b} ^ {l}} \tilde {f} (\boldsymbol {x}) \right\| _ {2} = \beta \left\| \boldsymbol {\alpha} ^ {l + 1} - \tilde {\boldsymbol {\alpha}} ^ {l + 1} \right\| _ {2} \leq \frac {\beta M _ {6}}{\sqrt [ 4 ]{\tilde {d}}} \left\| \theta - \tilde {\theta} \right\| _ {2} \tag {93} +$$ + +Overall, we can see that there exists a constant $M_7 > 0$ such that $\left\| \nabla_{\theta}f(\pmb {x}) - \nabla_{\tilde{\theta}}\tilde{f} (\pmb {x})\right\| _2\leq \frac{M_7}{\sqrt{n}\cdot\sqrt[4]{d}}\left\| \theta -\tilde{\theta}\right\| _2,$ so that $\left\| J(\theta) - J(\tilde{\theta})\right\| _F\leq \frac{M_7}{\sqrt[4]{d}}\left\| \theta -\tilde{\theta}\right\| _2.$ + +# D.3.4 PROOF OF THEOREM 4 + +First of all, for a linearized neural network (11), if we view $\{\nabla_{\theta}f^{(0)}(\pmb{x}_i)\}_{i=1}^n$ as the inputs and $\{y_i - f^{(0)}(\pmb{x}_i) + \langle \theta^{(0)}, \nabla_{\theta}f^{(0)}(\pmb{x}_i) \rangle \}_{i=1}^n$ as the targets, then the model becomes a linear model. So by Theorem 2 we have the following corollary: + +Corollary 15. If $\nabla_{\theta}f^{(0)}(\pmb{x}_1),\dots,\nabla_{\theta}f^{(0)}(\pmb{x}_n)$ are linearly independent, then there exists $\eta_0 > 0$ such that for any GRW satisfying Assumption 1, and any $\eta \leq \eta_0$ , $\theta^{(t)}$ converges to the same interpolator $\theta^*$ that does not depend on $q_i$ . + +Let $\eta_{1} = \min \{\eta_{0},\eta^{*}\}$ , where $\eta_0$ is defined in Corollary 15 and $\eta^{*}$ is defined in Lemma 5. Let $f_{\mathrm{lin}}^{(t)}(\pmb {x})$ and $f_{\mathrm{linERM}}^{(t)}(\pmb {x})$ be the linearized neural networks of $f^{(t)}(\pmb {x})$ and $f_{\mathrm{ERM}}^{(t)}(\pmb {x})$ , respectively. By Lemma 5, for any $\delta >0$ , there exists $\tilde{D} >0$ and a constant $C$ such that + +$$ +\left\{ \begin{array}{l} \sup _ {t \geq 0} \left| f _ {\text {l i n}} ^ {(t)} (\boldsymbol {x}) - f ^ {(t)} (\boldsymbol {x}) \right| \leq C \tilde {d} ^ {- 1 / 4} \\ \sup _ {t \geq 0} \left| f _ {\text {l i n E R M}} ^ {(t)} (\boldsymbol {x}) - f _ {\text {E R M}} ^ {(t)} (\boldsymbol {x}) \right| \leq C \tilde {d} ^ {- 1 / 4} \end{array} \right. \tag {94} +$$ + +By Corollary 15, we have + +$$ +\lim _ {t \rightarrow \infty} \left| f _ {\ln} ^ {(t)} (\boldsymbol {x}) - f _ {\operatorname {l i n E R M}} ^ {(t)} (\boldsymbol {x}) \right| = 0 \tag {95} +$$ + +Summing the above yields + +$$ +\lim _ {t \rightarrow \infty} \left| f ^ {(t)} (\boldsymbol {x}) - f _ {\mathrm {E R M}} ^ {(t)} (\boldsymbol {x}) \right| \leq 2 C \tilde {d} ^ {- 1 / 4} \tag {96} +$$ + +which is the result we want. + +![](images/7d5257d1fe49896e5a34c34e6e8c0917a2a4d6630e5d4c01e9f55b71acbec8a1.jpg) + +# D.4 PROOFS FOR SUBSECTION 4.3 + +# D.4.1 A NEW APPROXIMATION THEOREM + +Lemma 16 (Approximation Theorem for Regularized GRW). For a wide fully-connected neural network $f$ , denote $J(\theta) = \nabla_{\theta}f(\mathbf{X};\theta)\in \mathbb{R}^{p\times n}$ and $g(\theta) = \nabla_{\hat{y}}\ell (f(\mathbf{X};\theta),\mathbf{Y})\in \mathbb{R}^n$ . Given that the loss function $\ell$ satisfies: $\nabla_{\theta}g(\theta) = J(\theta)U(\theta)$ for any $\theta$ , and $U(\theta)$ is a positive semi-definite diagonal matrix whose elements are uniformly bounded, we have: for any GRW that minimizes the regularized weighted empirical risk (13) with a sufficiently small learning rate $\eta$ , there is: for a sufficiently large $\tilde{d}$ , with high probability over random initialization, on any test point $x$ such that $\| x\| _2\leq 1$ , + +$$ +\sup _ {t \geq 0} \left| f _ {\text {l i n r e g}} ^ {(t)} (\boldsymbol {x}) - f _ {\text {r e g}} ^ {(t)} (\boldsymbol {x}) \right| \leq C \tilde {d} ^ {- 1 / 4} \tag {97} +$$ + +where both $f_{\mathrm{linreg}}^{(t)}$ and $f_{\mathrm{reg}}^{(t)}$ are trained by the same regularized GRW and start from the same initial point. + +First of all, with some simple linear algebra analysis, we can prove the following proposition: + +Proposition 17. For any positive definite symmetric matrix $\mathbf{H} \in \mathbb{R}^{n \times n}$ , denote its largest and smallest eigenvalues by $\lambda^{\max}$ and $\lambda^{\min}$ . Then, for any positive semi-definite diagonal matrix $Q = \mathrm{diag}(q_1, \dots, q_n)$ , $HQ$ has $n$ eigenvalues that all lie in $[\min_i q_i \cdot \lambda^{\min}, \max_i q_i \cdot \lambda^{\max}]$ . + +Proof. $\pmb{H}$ is a positive definite symmetric matrix, so there exists $\pmb{A} \in \mathbb{R}^{n \times n}$ such that $\pmb{H} = \pmb{A}^{\top} \pmb{A}$ , and $\pmb{A}$ is full-rank. First, any eigenvalue of $AQA^{\top}$ is also an eigenvalue of $A^{\top}AQ$ , because for any eigenvalue $\lambda$ of $AQA^{\top}$ we have some $v \neq 0$ such that $AQA^{\top}v = \lambda v$ . Multiplying both sides by $A^{\top}$ on the left yields $A^{\top}AQ(A^{\top}v) = \lambda (A^{\top}v)$ which implies that $\lambda$ is also an eigenvalue of $A^{\top}AQ$ because $A^{\top}v \neq 0$ as $\lambda v \neq 0$ . + +Second, by condition we know that the eigenvalues of $A^\top A$ are all in $[\lambda^{\min}, \lambda^{\max}]$ where $\lambda^{\min} > 0$ , which implies for any unit vector $\mathbf{v}$ , $\mathbf{v}^\top \mathbf{A}^\top \mathbf{A} \mathbf{v} \in [\lambda^{\min}, \lambda^{\max}]$ , which is equivalent to $\| \mathbf{A} \mathbf{v} \|_2 \in [\sqrt{\lambda^{\min}}, \sqrt{\lambda^{\max}}]$ . Thus, we have $\mathbf{v}^\top \mathbf{A}^\top \mathbf{Q} \mathbf{A} \mathbf{v} \in [\lambda^{\min} \min_i q_i, \lambda^{\max} \max_i q_i]$ , which implies that the eigenvalues of $A^\top Q A$ are all in $[\lambda^{\min} \min_i q_i, \lambda^{\max} \max_i q_i]$ . + +Thus, the eigenvalues of $HQ = A^\top AQ$ are all in $[\lambda^{\min}\min_iq_i,\lambda^{\max}\max_iq_i]$ . + +![](images/72546484b2ae152ea163bd862934fa31aa60ba51eafe79df8d203d6531ea882c.jpg) + +Proof of Lemma 16 By the condition $\ell$ satisfies, without loss of generality, assume that the elements of $U(\theta)$ are in $[0,1]$ for all $\theta$ . Then, let $\eta \leq (\mu + \lambda^{\min} + \lambda^{\max})^{-1}$ . (If the elements of $U(\theta)$ are bounded by $[0,C]$ , then we can let $\eta \leq (\mu + C\lambda^{\min} + C\lambda^{\max})^{-1}$ and prove the result in the same way.) + +With $L_{2}$ penalty, the update rule of the GRW for the neural network is: + +$$ +\theta^ {(t + 1)} = \theta^ {(t)} - \eta J (\theta^ {(t)}) \boldsymbol {Q} ^ {(t)} g (\theta^ {(t)}) - \eta \mu (\theta^ {(t)} - \theta^ {(0)}) \tag {98} +$$ + +And the update rule for the linearized neural network is: + +$$ +\theta_ {\mathrm {l i n}} ^ {(t + 1)} = \theta_ {\mathrm {l i n}} ^ {(t)} - \eta J (\theta^ {(0)}) \boldsymbol {Q} ^ {(t)} g \left(\theta_ {\mathrm {l i n}} ^ {(t)}\right) - \eta \mu \left(\theta_ {\mathrm {l i n}} ^ {(t)} - \theta^ {(0)}\right) \tag {99} +$$ + +By Proposition 11, $f(\pmb{x}; \theta)$ converges in probability to a zero-mean Gaussian process. Thus, for any $\delta > 0$ , there exists a constant $R_0 > 0$ such that with probability at least $(1 - \delta/3)$ , $\left\| g(\theta^{(0)}) \right\|_2 < R_0$ . Let $M$ be as defined in Lemma 13. Denote $A = \eta MR_0$ , and let $C_0 = \frac{4A}{\eta\mu}$ in Lemma 136. By Lemma 13, there exists $D_1$ such that for all $\tilde{d} \geq D_1$ , with probability at least $(1 - \delta/3)$ , (52) is true. + +Similar to the proof of Proposition 17, we can show that for arbitrary $\tilde{\theta}$ , all non-zero eigenvalues of $J(\theta^{(0)})\mathbf{Q}^{(t)}U(\tilde{\theta})J(\theta^{(0)})^\top$ are eigenvalues of $J(\theta^{(0)})^\top J(\theta^{(0)})\mathbf{Q}^{(t)}U(\tilde{\theta})$ . This is because for any $\lambda \neq 0$ , if $J(\theta^{(0)})\mathbf{Q}^{(t)}U(\tilde{\theta})J(\theta^{(0)})^\top \pmb{v} = \lambda \pmb{v}$ , then $J(\theta^{(0)})^\top J(\theta^{(0)})\mathbf{Q}^{(t)}U(\tilde{\theta})(J(\theta^{(0)})^\top \pmb{v}) = \lambda(J(\theta^{(0)})^\top \pmb{v})$ , and $J(\theta^{(0)})^\top \pmb{v} \neq 0$ since $\lambda \pmb{v} \neq 0$ , so $\lambda$ is also an eigenvalue of $J(\theta^{(0)})^\top J(\theta^{(0)})\mathbf{Q}^{(t)}U(\tilde{\theta})$ . On the other hand, by Proposition 3, $J(\theta^{(0)})^\top J(\theta^{(0)})\mathbf{Q}^{(t)}U(\tilde{\theta})$ converges in probability to $\Theta \mathbf{Q}^{(t)}U(\tilde{\theta})$ whose eigenvalues are all in $[0, \lambda^{\max}]$ by Proposition 17. So there exists $D_2$ such that for all $\tilde{d} \geq D_2$ , with probability at least $(1 - \delta/3)$ , the eigenvalues of $J(\theta^{(0)})\mathbf{Q}^{(t)}U(\tilde{\theta})J(\theta^{(0)})^\top$ are all in $[0, \lambda^{\max} + \lambda^{\min}]$ for all $t$ . + +By union bound, with probability at least $(1 - \delta)$ , all three above are true, which we will assume in the rest of this proof. + +First, we need to prove that there exists $D_0$ such that for all $\tilde{d} \geq D_0$ , $\sup_{t \geq 0} \left\| \theta^{(t)} - \theta^{(0)} \right\|_2$ is bounded with high probability. Denote $a_t = \theta^{(t)} - \theta^{(0)}$ . By (98) we have + +$$ +\begin{array}{l} a _ {t + 1} = (1 - \eta \mu) a _ {t} - \eta [ J (\theta^ {(t)}) - J (\theta^ {(0)}) ] \boldsymbol {Q} ^ {(t)} g (\theta^ {(t)}) \tag {100} \\ - \eta J (\theta^ {(0)}) \boldsymbol {Q} ^ {(t)} [ g (\theta^ {(t)}) - g (\theta^ {(0)}) ] - \eta J (\theta^ {(0)}) \boldsymbol {Q} ^ {(t)} g (\theta^ {(0)}) \\ \end{array} +$$ + +which implies + +$$ +\begin{array}{l} \left\| a _ {t + 1} \right\| _ {2} \leq \left\| (1 - \eta \mu) \boldsymbol {I} - \eta J \left(\theta^ {(0)}\right) \boldsymbol {Q} ^ {(t)} U \left(\tilde {\theta} ^ {(t)}\right) J \left(\tilde {\theta} ^ {(t)}\right) ^ {\top} \right\| _ {2} \left\| a _ {t} \right\| _ {2} \tag {101} \\ + \eta \left\| J \left(\theta^ {(t)}\right) - J \left(\theta^ {(0)}\right) \right\| _ {F} \left\| g \left(\theta^ {(t)}\right) \right\| _ {2} + \eta \left\| J \left(\theta^ {(0)}\right) \right\| _ {F} \left\| g \left(\theta^ {(0)}\right) \right\| _ {2} \\ \end{array} +$$ + +where $\tilde{\theta}^{(t)}$ is some linear interpolation between $\theta^{(t)}$ and $\theta^{(0)}$ . Our choice of $\eta$ ensures that $\eta \mu < 1$ . + +Now we prove by induction that $\| a_t \|_2 < C_0$ . It is true for $t = 0$ , so we need to prove that if $\| a_t \|_2 < C_0$ , then $\| a_{t+1} \|_2 < C_0$ . + +For the first term on the right-hand side of (101), we have + +$$ +\begin{array}{l} \left\| (1 - \eta \mu) \boldsymbol {I} - \eta J (\theta^ {(0)}) \boldsymbol {Q} ^ {(t)} U (\tilde {\theta} ^ {(t)}) J (\tilde {\theta} ^ {(t)}) ^ {\top} \right\| _ {2} \leq (1 - \eta \mu) \left\| \boldsymbol {I} - \frac {\eta}{1 - \eta \mu} J (\theta^ {(0)}) \boldsymbol {Q} ^ {(t)} U (\tilde {\theta} ^ {(t)}) J (\theta^ {(0)}) ^ {\top} \right\| _ {2} \\ + \eta \left\| J \left(\theta^ {(0)}\right) \right\| _ {F} \left\| J \left(\tilde {\theta} ^ {(t)}\right) - J \left(\theta^ {(0)}\right) \right\| _ {F} \tag {102} \\ \end{array} +$$ + +Since $\eta /(1 - \eta \mu)\leq (\lambda^{\mathrm{min}} + \lambda^{\mathrm{max}})^{-1}$ by our choice of $\eta$ , we have + +$$ +\left\| \boldsymbol {I} - \frac {\eta}{1 - \eta \mu} J \left(\theta^ {(0)}\right) \boldsymbol {Q} ^ {(t)} U \left(\tilde {\theta} ^ {(t)}\right) J \left(\theta^ {(0)}\right) ^ {\top} \right\| _ {2} \leq 1 \tag {103} +$$ + +On the other hand, we can use (52) since $\| a_{t}\|_{2} < C_{0}$ , so $\left\| J(\theta^{(0)})\right\|_{F}\left\| J(\tilde{\theta}^{(t)}) - J(\theta^{(0)})\right\|_{F} \leq \frac{M^{2}}{\sqrt[4]{\tilde{d}}} C_{0}$ . Therefore, there exists $D_{3}$ such that for all $\tilde{d} \geq D_{3}$ , + +$$ +\left\| \left(1 - \eta \mu\right) \boldsymbol {I} - \eta J \left(\theta^ {(0)}\right) \boldsymbol {Q} ^ {(t)} U \left(\tilde {\theta} ^ {(t)}\right) J \left(\tilde {\theta} ^ {(t)}\right) ^ {\top} \right\| _ {2} \leq 1 - \frac {\eta \mu}{2} \tag {104} +$$ + +For the second term, we have + +$$ +\begin{array}{l} \left\| g \left(\theta^ {(t)}\right) \right\| _ {2} \leq \left\| g \left(\theta^ {(t)}\right) - g \left(\theta^ {(0)}\right) \right\| _ {2} + \left\| g \left(\theta^ {(0)}\right) \right\| _ {2} \tag {105} \\ \leq \left\| J (\tilde {\theta} ^ {(t)}) \right\| _ {2} \left\| U (\tilde {\theta} ^ {(t)}) \right\| _ {2} \left\| \theta^ {(t)} - \theta^ {(0)} \right\| _ {2} + R _ {0} \leq M C _ {0} + R _ {0} \\ \end{array} +$$ + +And for the third term, we have + +$$ +\eta \left\| J \left(\theta^ {(0)}\right) \right\| _ {F} \left\| g \left(\theta^ {(0)}\right) \right\| _ {2} \leq \eta M R _ {0} = A \tag {106} +$$ + +Thus, we have + +$$ +\left\| a _ {t + 1} \right\| _ {2} \leq \left(1 - \frac {\eta \mu}{2}\right) \left\| a _ {t} \right\| _ {2} + \frac {\eta M \left(M C _ {0} + R _ {0}\right)}{\sqrt [ 4 ]{\tilde {d}}} + A \tag {107} +$$ + +So there exists $D_4$ such that for all $\tilde{d} \geq D_4$ , $\|a_{t+1}\|_2 \leq \left(1 - \frac{\eta\mu}{2}\right)\|a_t\|_2 + 2A$ . This shows that if $\|a_t\|_2 < C_0$ is true, then $\|a_{t+1}\|_2 < C_0$ will also be true. + +In conclusion, for all $\tilde{d} \geq D_0 = \max \{D_1, D_2, D_3, D_4\}$ , $\left\| \theta^{(t)} - \theta^{(0)} \right\|_2 < C_0$ is true for all $t$ . This also implies that for $C_1 = MC_0 + R_0$ , we have $\left\| g(\theta^{(t)}) \right\|_2 \leq C_1$ for all $t$ by (105). Similarly, we can prove that $\left\| \theta_{\mathrm{lin}}^{(t)} - \theta^{(0)} \right\|_2 < C_0$ for all $t$ . + +Second, let $\Delta_t = \theta_{\mathrm{lin}}^{(t)} - \theta^{(t)}$ . Then we have + +$$ +\Delta_ {t + 1} - \Delta_ {t} = \eta \left(J \left(\theta^ {(t)}\right) Q ^ {(t)} g \left(\theta^ {(t)}\right) - J \left(\theta^ {(0)}\right) Q ^ {(t)} g \left(\theta_ {\text {l i n}} ^ {(t)}\right) - \mu \Delta_ {t}\right) \tag {108} +$$ + +which implies + +$$ +\Delta_ {t + 1} = \left[ (1 - \eta \mu) \boldsymbol {I} - \eta J \left(\theta^ {(0)}\right) \boldsymbol {Q} ^ {(t)} U \left(\tilde {\theta} ^ {(t)}\right) J \left(\tilde {\theta} ^ {(t)}\right) ^ {\top} \right] \Delta_ {t} + \eta \left(J \left(\theta^ {(t)}\right) - J \left(\theta^ {(0)}\right)\right) \boldsymbol {Q} ^ {(t)} g \left(\theta^ {(t)}\right) \tag {109} +$$ + +where $\tilde{\theta}^{(t)}$ is some linear interpolation between $\theta^{(t)}$ and $\theta_{\mathrm{lin}}^{(t)}$ . By (104), with probability at least $(1 - \delta)$ for all $\tilde{d}\geq D_0$ , we have + +$$ +\begin{array}{l} \| \Delta_ {t + 1} \| _ {2} \leq \left\| (1 - \eta \mu) \boldsymbol {I} - \eta J (\theta^ {(0)}) \boldsymbol {Q} ^ {(t)} U (\tilde {\theta} ^ {(t)}) J (\tilde {\theta} ^ {(t)}) ^ {\top} \right\| _ {2} \| \Delta_ {t} \| _ {2} + \eta \left\| J (\theta^ {(t)}) - J (\theta^ {(0)}) \right\| _ {F} \left\| g (\theta^ {(t)}) \right\| _ {2} \\ \leq \left(1 - \frac {\eta \mu}{2}\right) \| \Delta_ {t} \| _ {2} + \eta \frac {M}{\sqrt [ 4 ]{\tilde {d}}} C _ {0} C _ {1} \tag {110} \\ \end{array} +$$ + +Again, as $\Delta_0 = 0$ , we can prove by induction that for all $t$ , + +$$ +\left\| \Delta_ {t} \right\| _ {2} < \frac {2 M C _ {0} C _ {1}}{\mu} \tilde {d} ^ {- 1 / 4} \tag {111} +$$ + +For any test point $\pmb{x}$ such that $\| \pmb{x} \|_2 \leq 1$ , we have + +$$ +\begin{array}{l} \left| f _ {\operatorname {r e g}} ^ {(t)} (\boldsymbol {x}) - f _ {\operatorname {l i n r e g}} ^ {(t)} (\boldsymbol {x}) \right| = \left| f (\boldsymbol {x}; \theta^ {(t)}) - f _ {\operatorname {l i n}} (\boldsymbol {x}; \theta_ {\operatorname {l i n}} ^ {(t)}) \right| \\ \leq \left| f (\boldsymbol {x}; \theta^ {(t)}) - f _ {\mathrm {l i n}} (\boldsymbol {x}; \theta^ {(t)}) \right| + \left| f _ {\mathrm {l i n}} (\boldsymbol {x}; \theta^ {(t)}) - f _ {\mathrm {l i n}} (\boldsymbol {x}; \theta_ {\mathrm {l i n}} ^ {(t)}) \right| \tag {112} \\ \leq \left| f (\boldsymbol {x}; \theta^ {(t)}) - f _ {\mathrm {l i n}} (\boldsymbol {x}; \theta^ {(t)}) \right| + \left\| \nabla_ {\theta} f (\boldsymbol {x}; \theta^ {(0)}) \right\| _ {2} \left\| \theta^ {(t)} - \theta_ {\mathrm {l i n}} ^ {(t)} \right\| _ {2} \\ \leq \left| f (\boldsymbol {x}; \theta^ {(t)}) - f _ {\mathrm {l i n}} (\boldsymbol {x}; \theta^ {(t)}) \right| + M \| \Delta_ {t} \| _ {2} \\ \end{array} +$$ + +For the first term, note that + +$$ +\left\{ \begin{array}{c} f (\boldsymbol {x}; \theta^ {(t)}) - f (\boldsymbol {x}; \theta^ {(0)}) = \nabla_ {\theta} f (\boldsymbol {x}; \tilde {\theta} ^ {(t)}) \left(\theta^ {(t)} - \theta^ {(0)}\right) \\ f _ {\mathrm {l i n}} (\boldsymbol {x}; \theta^ {(t)}) - f _ {\mathrm {l i n}} (\boldsymbol {x}; \theta^ {(0)}) = \nabla_ {\theta} f (\boldsymbol {x}; \theta^ {(0)}) \left(\theta^ {(t)} - \theta^ {(0)}\right) \end{array} \right. \tag {113} +$$ + +where $\tilde{\theta}^{(t)}$ is some linear interpolation between $\theta^{(t)}$ and $\theta^{(0)}$ . Since $f(\pmb{x};\theta^{(0)}) = f_{\mathrm{lin}}(\pmb{x};\theta^{(0)})$ , + +$$ +\left| f (\boldsymbol {x}; \theta^ {(t)}) - f _ {\mathrm {l i n}} (\boldsymbol {x}; \theta^ {(t)}) \right| \leq \left\| \nabla_ {\theta} f (\boldsymbol {x}; \tilde {\theta} ^ {(t)}) - \nabla_ {\theta} f (\boldsymbol {x}; \theta^ {(0)}) \right\| _ {2} \left\| \theta^ {(t)} - \theta^ {(0)} \right\| _ {2} \leq \frac {M}{\sqrt [ 4 ]{\tilde {d}}} C _ {0} ^ {2} \tag {114} +$$ + +Thus, we have shown that for all $\tilde{d} \geq D_0$ , with probability at least $(1 - \delta)$ for all $t$ and all $\pmb{x}$ , + +$$ +\left| f _ {\text {r e g}} ^ {(t)} (\boldsymbol {x}) - f _ {\text {l i n r e g}} ^ {(t)} (\boldsymbol {x}) \right| \leq \left(M C _ {0} ^ {2} + \frac {2 M ^ {2} C _ {0} C _ {1}}{\mu}\right) \tilde {d} ^ {- 1 / 4} = O \left(\tilde {d} ^ {- 1 / 4}\right) \tag {115} +$$ + +which is the result we need. + +![](images/dd79a45e82b569b1d351a21fb8eba7892860a9d7adb4a0e65746724eeb8a816e.jpg) + +# D.4.2 RESULT FOR LINEARIZED NEURAL NETWORKS + +Lemma 18. Suppose there exists $M_0 > 0$ such that $\left\| \nabla_{\theta}f^{(0)}(\pmb {x})\right\| _2\leq M_0$ for all test point $\pmb{x}$ . If the gradients $\nabla_{\theta}f^{(0)}(\pmb {x}_1),\dots ,\nabla_{\theta}f^{(0)}(\pmb {x}_n)$ are linearly independent, and the empirical training risk of $f_{\mathrm{linreg}}^{(t)}$ satisfies + +$$ +\lim _ {t \rightarrow \infty} \sup _ {\epsilon < \epsilon ,} \hat {\mathcal {R}} (f _ {\text {l i n r e g}} ^ {(t)}) < \epsilon , \tag {116} +$$ + +for some $\epsilon > 0$ , then for $\pmb{x}$ such that $\| \pmb{x} \|_2 \leq 1$ we have + +$$ +\lim _ {t \rightarrow \infty} \sup _ {\epsilon \rightarrow 0} \left| f _ {\text {l i n r e g}} ^ {(t)} (\boldsymbol {x}) - f _ {\text {l i n E R M}} ^ {(t)} (\boldsymbol {x}) \right| = O (\sqrt {\epsilon}). \tag {117} +$$ + +First, we can see that under the new weight update rule, $\theta^{(t)} - \theta^{(0)} \in \operatorname{span}\{\nabla_{\theta}f^{(0)}(\pmb{x}_1), \dots, \nabla_{\theta}f^{(0)}(\pmb{x}_n)\}$ is still true for all $t$ . Let $\theta^*$ be the interpolator in $\operatorname{span}(\nabla_{\theta}f^{(0)}(\pmb{x}_1), \dots, \nabla_{\theta}f^{(0)}(\pmb{x}_n))$ , then the empirical risk of $\theta$ is $\frac{1}{2n}\sum_{i=1}^{n}\langle\theta - \theta^*, \nabla_{\theta}f^{(0)}(\pmb{x}_i)\rangle^2 = \frac{1}{2n}\left\|\nabla_{\theta}f^{(0)}(\pmb{X})^\top(\theta - \theta^*)\right\|_2^2$ . Thus, there exists $T > 0$ such that for any $t \geq T$ , + +$$ +\left\| \nabla_ {\theta} f ^ {(0)} (\boldsymbol {X}) ^ {\top} \left(\theta^ {(t)} - \theta^ {*}\right) \right\| _ {2} ^ {2} \leq 2 n \epsilon \tag {118} +$$ + +Let the smallest singular value of $\frac{1}{\sqrt{n}} \nabla_{\theta} f^{(0)}(\pmb{X})$ be $s^{\min}$ , and we have $s^{\min} > 0$ . Note that the column space of $\nabla_{\theta} f^{(0)}(\pmb{X})$ is exactly $\mathrm{span}(\nabla_{\theta} f^{(0)}(\pmb{x}_1), \dots, \nabla_{\theta} f^{(0)}(\pmb{x}_n))$ . Define $\pmb{H} \in \mathbb{R}^{p \times n}$ such that its columns form an orthonormal basis of this subspace, then there exists $\pmb{G} \in R^{n \times n}$ such that $\nabla_{\theta} f^{(0)}(\pmb{X}) = H\pmb{G}$ , and the smallest singular value of $\frac{1}{\sqrt{n}}\pmb{G}$ is also $s^{\min}$ . Since $\theta^{(t)} - \theta^{(0)}$ is also in this subspace, there exists $\pmb{v} \in \mathbb{R}^n$ such that $\theta^{(t)} - \theta^* = H\pmb{v}$ . Then we have $\sqrt{2n\epsilon} \geq \| \pmb{G}^\top \pmb{H}^\top \pmb{H}\pmb{v} \|_2 = \| \pmb{G}^\top \pmb{v} \|_2$ . Thus, $\| \pmb{v} \|_2 \leq \frac{\sqrt{2\epsilon}}{s^{\min}}$ , which implies + +$$ +\left\| \theta^ {(t)} - \theta^ {*} \right\| _ {2} \leq \frac {\sqrt {2 \epsilon}}{s ^ {\min }} \tag {119} +$$ + +We have already proved in previous results that if we minimize the unregularized risk with ERM, then $\theta$ always converges to the interpolator $\theta^{*}$ . So for any $t\geq T$ and any test point $\pmb{x}$ such that $\| x\| _2\leq 1$ , we have + +$$ +\left| f _ {\text {l i n r e g}} ^ {(t)} (\boldsymbol {x}) - f _ {\text {l i n E R M}} ^ {(t)} (\boldsymbol {x}) \right| = \left| \left\langle \theta^ {(t)} - \theta^ {*}, \nabla_ {\theta} f ^ {(0)} (\boldsymbol {x}) \right\rangle \right| \leq \frac {M _ {0} \sqrt {2 \epsilon}}{s ^ {\min }} \tag {120} +$$ + +which implies (117). + +![](images/8d5e9576a03a9b7cade80162097602e5bffa0944bcf0e46044a3ea2cf5111c18.jpg) + +# D.4.3 PROOF OF THEOREM 6 + +Given that $\hat{\mathcal{R}}(f_{\mathrm{linreg}}^{(t)}) < \epsilon$ for sufficiently large $t$ , Lemma 16 implies that + +$$ +\left| \hat {\mathcal {R}} \left(f _ {\text {l i n r e g}} ^ {(t)}\right) - \hat {\mathcal {R}} \left(f _ {\text {r e g}} ^ {(t)}\right) \right| = O \left(\tilde {d} ^ {- 1 / 4} \sqrt {\epsilon} + \tilde {d} ^ {- 1 / 2}\right) \tag {121} +$$ + +So for a fixed $\epsilon$ , there exists $D > 0$ such that for all $d \geq D$ , for sufficiently large $t$ , + +$$ +\hat {\mathcal {R}} \left(f _ {\text {r e g}} ^ {(t)}\right) < \epsilon \Rightarrow \hat {\mathcal {R}} \left(f _ {\text {l i n r e g}} ^ {(t)}\right) < 2 \epsilon \tag {122} +$$ + +By Lemma 5 and Lemma 16, we have + +$$ +\left\{ \begin{array}{l} \sup _ {t \geq 0} \left| f _ {\operatorname {l i n E R M}} ^ {(t)} (\boldsymbol {x}) - f _ {\operatorname {E R M}} ^ {(t)} (\boldsymbol {x}) \right| = O \left(\tilde {d} ^ {- 1 / 4}\right) \\ \sup _ {t \geq 0} \left| f _ {\operatorname {l i n r e g}} ^ {(t)} (\boldsymbol {x}) - f _ {\operatorname {r e g}} ^ {(t)} (\boldsymbol {x}) \right| = O \left(\tilde {d} ^ {- 1 / 4}\right) \end{array} \right. \tag {123} +$$ + +Combining Lemma 18 with (123) derives + +$$ +\lim _ {t \rightarrow \infty} \sup _ {\epsilon} \left| f _ {\operatorname {r e g}} ^ {(t)} (\boldsymbol {x}) - f _ {\operatorname {E R M}} ^ {(t)} (\boldsymbol {x}) \right| = O \left(\tilde {d} ^ {- 1 / 4} + \sqrt {\epsilon}\right) \tag {124} +$$ + +Letting $\tilde{d}\to \infty$ leads to the result we need. + +![](images/5a5f1c5fe605f66797f51299c128dafb2a042b5d00cb405f3bba58bab1dec50d.jpg) + +Remark. One might wonder whether $\| \nabla_{\theta}f^{(0)}(\pmb {x})\| _2$ will diverge as $\tilde{d}\rightarrow \infty$ . In fact, in Lemma 13, we have proved that there exists a constant $M$ such that with high probability, for any $\tilde{d}$ there is $\| \nabla_{\theta}f^{(0)}(\pmb {x})\| _2\leq M$ for any $\pmb{x}$ such that $\| \pmb {x}\| _2\leq 1$ . Therefore, it is fine to suppose that there exists such an $M_0$ . + +# D.5 PROOFS FOR SUBSECTION 5.1 + +# D.5.1 PROOF OF THEOREM 7 + +First we need to show that $\hat{\theta}_{\mathrm{MM}}$ is unique. Suppose both $\theta_{1}$ and $\theta_{2}$ maximize $\min_{i = 1,\dots ,n}y_{i}\cdot \langle \theta ,\pmb{x}_i\rangle$ and $\theta_{1}\neq \theta_{2},\| \theta_{1}\|_{2} = \| \theta_{2}\|_{2} = 1$ . Then consider $\theta_0 = \theta /\| \theta \| _2$ where $\theta = (\theta_{1} + \theta_{2}) / 2$ . Obviously, $\| \theta \| _2 < 1$ , and for any $i,y_i\cdot \langle \theta ,\pmb {x}_i\rangle = (y_i\cdot \langle \theta_1,\pmb {x}_i\rangle +y_i\cdot \langle \theta_2,\pmb {x}_i\rangle) / 2$ , so $y_{i}\cdot \langle \theta_{0},\pmb {x}_{i}\rangle >$ $\min \{y_i\cdot \langle \theta_1,\pmb {x}_i\rangle ,y_i\cdot \langle \theta_2,\pmb {x}_i\rangle \}$ , which implies that $\min_{i = 1,\dots ,n}y_i\cdot \langle \theta_0,\pmb {x}_i\rangle >\min \{\min_{i = 1,\dots ,n}y_i\cdot$ $\langle \theta_1,\pmb {x}_i\rangle ,\min_{i = 1,\dots ,n}y_i\cdot \langle \theta_2,\pmb {x}_i\rangle \}$ , contradiction! + +Now we start proving the result. Without loss of generality, let $(\pmb{x}_1,y_1),\dots ,(\pmb{x}_m,y_m)$ be the samples with the smallest margin to $\pmb{u}$ , i.e. + +$$ +\underset {1 \leq i \leq n} {\arg \min } y _ {i} \cdot \langle \boldsymbol {u}, \boldsymbol {x} _ {i} \rangle = \{1, \dots , m \} \tag {125} +$$ + +And denote $y_{1} \cdot \langle \pmb{u}, \pmb{x}_{1} \rangle = \dots = y_{m} \cdot \langle \pmb{u}, \pmb{x}_{m} \rangle = \gamma_{\pmb{u}}$ . Since the training error converges to 0, $\gamma_{\pmb{u}} > 0$ . Note that for the logistic loss, if $y_{i} \cdot \langle \theta, \pmb{x}_{i} \rangle < y_{j} \cdot \langle \theta, \pmb{x}_{j} \rangle$ , then for any $M > 0$ , there exists an $R_{M} > 0$ such that for all $R \geq R_{M}$ , + +$$ +\frac {\nabla_ {\theta} \ell (\langle R \theta , \boldsymbol {x} _ {i} \rangle , y _ {i})}{\nabla_ {\theta} \ell (\langle R \theta , \boldsymbol {x} _ {j} \rangle , y _ {j})} > M \tag {126} +$$ + +which can be shown with some simple calculation. And because the training error converges to 0, we must have $\left\| \theta^{(t)} \right\| \to \infty$ . Then, by Assumption 3 this means that when $t$ gets sufficiently large, the impact of $(\pmb{x}_j, y_j)$ to $\theta^{(t)}$ where $j > m$ is an infinitesimal compared to $(\pmb{x}_i, y_i)$ where $i \leq m$ (because there exists a positive constant $\delta$ such that $q_i^{(t)} > \delta$ for all sufficiently large $t$ by Assumption 3). Thus, we must have $\pmb{u} \in \operatorname{span}\{\pmb{x}_1, \dots, \pmb{x}_m\}$ . + +Let $\pmb{u} = \alpha_{1}y_{1}\pmb{x}_{1} + \dots +\alpha_{m}y_{m}\pmb{x}_{m}$ . Now we show that $\alpha_{i}\geq 0$ for all $i = 1,\dots ,m$ . This is because when $t$ is sufficiently large such that the impact of $(x_{j},y_{j})$ to $\theta^{(t)}$ where $j > m$ becomes infinitesimal, we have + +$$ +\theta^ {(t + 1)} - \theta^ {(t)} \approx \eta \frac {q _ {i} ^ {(t)} \exp \left(y _ {i} \cdot \langle \theta^ {(t)} , \boldsymbol {x} _ {i} \rangle\right)}{1 + \exp \left(y _ {i} \cdot \langle \theta^ {(t)} , \boldsymbol {x} _ {i} \rangle\right)} y _ {i} \boldsymbol {x} _ {i} \tag {127} +$$ + +and since $\| \theta^{(t)}\| \to \infty$ as $t\to \infty$ , we have + +$$ +\alpha_ {i} \propto \lim _ {T \rightarrow \infty} \sum_ {t = T _ {0}} ^ {T} \frac {q _ {i} ^ {(t)} \exp \left(y _ {i} \cdot \left\langle \theta^ {(t)} , \boldsymbol {x} _ {i} \right\rangle\right)}{1 + \exp \left(y _ {i} \cdot \left\langle \theta^ {(t)}, \boldsymbol {x} _ {i} \right\rangle\right)} := \lim _ {T \rightarrow \infty} \alpha_ {i} (T) \tag {128} +$$ + +where $T_0$ is sufficiently large. Here the notion $\alpha_{i}\propto \lim_{T\to \infty}\alpha_{i}(T)$ means that $\lim_{T\to \infty}\frac{\alpha_i(T)}{\alpha_j(T)} = \frac{\alpha_i}{\alpha_j}$ for any pair of $i,j$ and $\alpha_{j}\neq 0$ . Note that each term in the sum is non-negative. This implies that all $\alpha_{1},\dots ,\alpha_{m}$ have the same sign (or equal to 0). On the other hand, + +$$ +\sum_ {i = 1} ^ {m} \alpha_ {i} \gamma_ {\boldsymbol {u}} = \sum_ {i = 1} ^ {m} \alpha_ {i} y _ {i} \cdot \langle \boldsymbol {u}, \boldsymbol {x} _ {i} \rangle = \langle \boldsymbol {u}, \boldsymbol {u} \rangle > 0 \tag {129} +$$ + +Thus, $\alpha_{i} \geq 0$ for all $i$ and at least one of them is positive. Now suppose $\mathbf{u} \neq \hat{\theta}_{\mathrm{MM}}$ , which means that $\gamma_{\mathbf{u}}$ is smaller than the margin of $\hat{\theta}_{\mathrm{MM}}$ . Then, for all $i = 1, \dots, m$ , there is $y_{i} \cdot \langle \mathbf{u}, \mathbf{x}_{i} \rangle < y_{i} \cdot \langle \hat{\theta}_{\mathrm{MM}}, \mathbf{x}_{i} \rangle$ . This implies that + +$$ +\langle \boldsymbol {u}, \boldsymbol {u} \rangle = \sum_ {i = 1} ^ {m} \alpha_ {i} y _ {i} \cdot \langle \boldsymbol {u}, \boldsymbol {x} _ {i} \rangle < \sum_ {i = 1} ^ {m} \alpha_ {i} y _ {i} \cdot \left\langle \hat {\theta} _ {\mathrm {M M}}, \boldsymbol {x} _ {i} \right\rangle = \left\langle \hat {\theta} _ {\mathrm {M M}}, \boldsymbol {u} \right\rangle \tag {130} +$$ + +which is a contradiction. Thus, we must have $\pmb{u} = \hat{\theta}_{\mathrm{MM}}$ + +![](images/e453811b20d6d7abf2b33a03d567ea07054fd29d0139901a55d99f6edfaccad8.jpg) + +# D.5.2 PROOF OF THEOREM 8 + +Denote the largest and smallest eigenvalues of $X^{\top}X$ by $\lambda^{\max}$ and $\lambda^{\min}$ , and by condition we have $\lambda^{\min} > 0$ . Let $\epsilon = \min \left\{\frac{q^{*}}{3}, \frac{(q^{*}\lambda^{\min})^{2}}{192\lambda^{\max 2}}\right\}$ . Then similar to the proof in Appendix D.2.2, there exists $t_{\epsilon}$ such that for all $t \geq t_{\epsilon}$ and all $i$ , $q_{i}^{(t)} \in (q_{i} - \epsilon, q_{i} + \epsilon)$ . Denote $Q = \mathrm{diag}(q_{1}, \dots, q_{n})$ , then for all $t \geq t_{\epsilon}$ , $Q^{(t)} := Q_{\epsilon}^{(t)} = \sqrt{Q}\sqrt{Q_{3\epsilon}^{(t)}}$ , where we use the subscript $\epsilon$ to indicate that $\left\| Q_{\epsilon}^{(t)} - Q \right\|_{2} < \epsilon$ . + +First, we prove that $F(\theta)$ is $L$ -smooth as long as $\| \pmb{x}_i\| _2\leq 1$ for all $i$ . The gradient of $F$ is + +$$ +\nabla F (\theta) = \sum_ {i = 1} ^ {n} q _ {i} \nabla_ {\hat {y}} \ell \left(\left\langle \theta , \boldsymbol {x} _ {i} \right\rangle , y _ {i}\right) \boldsymbol {x} _ {i} \tag {131} +$$ + +Since $\ell (\hat{y},y)$ is $L$ -smooth in $\hat{y}$ , we have for any $\theta_{1},\theta_{2}$ and any $i$ + +$$ +\begin{array}{l} \ell \left(\left\langle \theta_ {2}, \boldsymbol {x} _ {i} \right\rangle , y _ {i}\right) - \ell \left(\left\langle \theta_ {1}, \boldsymbol {x} _ {i} \right\rangle , y _ {i}\right) \\ \leq \nabla_ {\hat {y}} \ell \left(\left\langle \theta_ {1}, \boldsymbol {x} _ {i} \right\rangle , y _ {i}\right) \cdot \left(\left\langle \theta_ {2}, \boldsymbol {x} _ {i} \right\rangle - \left\langle \theta_ {1}, \boldsymbol {x} _ {i} \right\rangle\right) + \frac {L}{2} \left(\left\langle \theta_ {2}, \boldsymbol {x} _ {i} \right\rangle - \left\langle \theta_ {1}, \boldsymbol {x} _ {i} \right\rangle\right) ^ {2} \\ = \left\langle \nabla_ {\hat {y}} \ell \left(\left\langle \theta_ {1}, \boldsymbol {x} _ {i} \right\rangle , y _ {i}\right) \cdot \boldsymbol {x} _ {i}, \theta_ {2} - \theta_ {1} \right\rangle + \frac {L}{2} \left(\left\langle \theta_ {2} - \theta_ {1}, \boldsymbol {x} _ {i} \right\rangle\right) ^ {2} \tag {132} \\ \leq \langle \nabla_ {\hat {y}} \ell (\langle \theta_ {1}, \pmb {x} _ {i} \rangle , y _ {i}) \cdot \pmb {x} _ {i}, \theta_ {2} - \theta_ {1} \rangle + \frac {L}{2} \| \theta_ {2} - \theta_ {1} \| _ {2} ^ {2} \\ \end{array} +$$ + +Thus, we have + +$$ +\begin{array}{l} F \left(\theta_ {2}\right) - F \left(\theta_ {1}\right) = \sum_ {i = 1} ^ {n} q _ {i} \left[ \ell \left(\left\langle \theta_ {2}, \boldsymbol {x} _ {i} \right\rangle , y _ {i}\right) - \ell \left(\left\langle \theta_ {1}, \boldsymbol {x} _ {i} \right\rangle , y _ {i}\right) \right] \\ \leq \sum_ {i = 1} ^ {n} q _ {i} \left\langle \nabla_ {\hat {y}} \ell \left(\left\langle \theta_ {1}, \boldsymbol {x} _ {i} \right\rangle , y _ {i}\right) \cdot \boldsymbol {x} _ {i}, \theta_ {2} - \theta_ {1} \right\rangle + \frac {L}{2} \sum_ {i = 1} ^ {n} q _ {i} \| \theta_ {2} - \theta_ {1} \| _ {2} ^ {2} \tag {133} \\ = \left\langle \nabla F (\theta_ {1}), \theta_ {2} - \theta_ {1} \right\rangle + \frac {L}{2} \left\| \theta_ {2} - \theta_ {1} \right\| _ {2} ^ {2} \\ \end{array} +$$ + +which implies that $F(\theta)$ is $L$ -smooth. + +Denote $\tilde{g} (\theta) = \nabla_{\hat{y}}\ell (f(\boldsymbol {X};\theta),\boldsymbol {Y})\in \mathbb{R}^n$ , then $\nabla F(\theta^{(t)}) = XQ\tilde{g} (\theta^{(t)})$ , and the update rule is + +$$ +\theta^ {(t + 1)} = \theta^ {(t)} - \eta \boldsymbol {X} \boldsymbol {Q} ^ {(t)} \tilde {g} \left(\theta^ {(t)}\right) \tag {134} +$$ + +So by the upper quadratic bound, we have + +$$ +F \left(\theta^ {(t + 1)}\right) \leq F \left(\theta^ {(t)}\right) - \eta \langle \boldsymbol {X} \boldsymbol {Q} \tilde {g} \left(\theta^ {(t)}\right), \boldsymbol {X} \boldsymbol {Q} ^ {(t)} \tilde {g} \left(\theta^ {(t)}\right) \rangle + \frac {\eta^ {2} L}{2} \left\| \boldsymbol {X} \boldsymbol {Q} ^ {(t)} \tilde {g} \left(\theta^ {(t)}\right) \right\| _ {2} ^ {2} \tag {135} +$$ + +Let $\eta_{1} = \frac{q^{*}\lambda^{\mathrm{min}}}{2L(1 + 3\epsilon)\lambda^{\mathrm{max}}}$ . Similar to what we did in Appendix D.2.2 (Eqn. (40)), we can prove that for all $\eta \leq \eta_{1}$ , (135) implies that for all $t \geq t_{\epsilon}$ , there is + +$$ +\begin{array}{l} F (\theta^ {(t + 1)}) \leq F (\theta^ {(t)}) - \frac {\eta q ^ {*} \lambda^ {\min}}{2} \left\| \sqrt {\boldsymbol {Q}} \tilde {g} (\theta^ {(t)}) \right\| _ {2} ^ {2} + \frac {\eta^ {2} L}{2} \left\| \boldsymbol {X} \sqrt {\boldsymbol {Q} _ {3 \epsilon} ^ {(t)}} \right\| _ {2} ^ {2} \left\| \sqrt {\boldsymbol {Q}} \tilde {g} (\theta^ {(t)}) \right\| _ {2} ^ {2} \\ \leq F \left(\theta^ {(t)}\right) - \frac {\eta q ^ {*} \lambda^ {\min }}{2} \left\| \sqrt {Q} \tilde {g} \left(\theta^ {(t)}\right) \right\| _ {2} ^ {2} + \frac {\eta^ {2} L}{2} \| X \| _ {2} ^ {2} (1 + 3 \epsilon) \left\| \sqrt {Q} \tilde {g} \left(\theta^ {(t)}\right) \right\| _ {2} ^ {2} \tag {136} \\ \leq F (\theta^ {(t)}) - \frac {\eta q ^ {*} \lambda^ {\min}}{4} \left\| \sqrt {\boldsymbol {Q}} \tilde {g} (\theta^ {(t)}) \right\| _ {2} ^ {2} \\ \leq F (\theta^ {(t)}) - \frac {\eta q ^ {* 2} \lambda^ {\min}}{4} \left\| \tilde {g} (\theta^ {(t)}) \right\| _ {2} ^ {2} \\ \end{array} +$$ + +This shows that $F(\theta^{(t)})$ is monotonically non-increasing. Since $F(\theta) \geq 0$ , $F(\theta^{(t)})$ must converge as $t \to \infty$ , and we need to prove that it converges to 0. Suppose that $F(\theta^{(t)})$ does not converge to 0, then there exists a constant $C > 0$ such that $F(\theta^{(t)}) \geq 2C$ for all $t$ . On the other hand, it is easy to see that there exists $\theta^*$ such that $\ell(\langle \theta^*, x_i \rangle, y_i) < C$ for all $i$ . (136) also implies that $\| \tilde{g}(\theta^{(t)}) \|_2 \to 0$ as $t \to \infty$ because we must have $F(\theta^{(t)}) - F(\theta^{(t+1)}) \to 0$ . + +Note that from (134) we have + +$$ +\left\| \theta^ {(t + 1)} - \theta^ {*} \right\| _ {2} ^ {2} = \left\| \theta^ {(t)} - \theta^ {*} \right\| _ {2} ^ {2} + 2 \eta \langle \boldsymbol {X} \boldsymbol {Q} ^ {(t)} \tilde {g} (\theta^ {(t)}), \theta^ {*} - \theta^ {(t)} \rangle + \eta^ {2} \left\| \boldsymbol {X} \boldsymbol {Q} ^ {(t)} \tilde {g} (\theta^ {(t)}) \right\| _ {2} ^ {2} \tag {137} +$$ + +Denote + +$$ +F _ {t} (\theta) = \sum_ {i = 1} ^ {n} q _ {i} ^ {(t)} \ell \left(\left\langle \theta , \boldsymbol {x} _ {i} \right\rangle , y _ {i}\right) \tag {138} +$$ + +Then $F_{t}$ is convex because $\ell$ is convex and $q_{i}^{(t)}$ are non-negative, and $\nabla F_t(\theta^{(t)}) = \pmb {X}\pmb{Q}^{(t)}\tilde{g} (\theta^{(t)})$ By the lower linear bound $F_{t}(\pmb {y})\geq F_{t}(\pmb {x}) + \langle \nabla F_{t}(\pmb {x}),\pmb {y} - \pmb {x}\rangle$ , we have for all $t$ + +$$ +\langle \boldsymbol {X} \boldsymbol {Q} ^ {(t)} \tilde {g} \left(\theta^ {(t)}\right), \theta^ {*} - \theta^ {(t)} \rangle \leq F _ {t} \left(\theta^ {*}\right) - F _ {t} \left(\theta^ {(t)}\right) \leq F _ {t} \left(\theta^ {*}\right) - \frac {2}{3} F \left(\theta^ {(t)}\right) \leq C - \frac {4 C}{3} = - \frac {C}{3} \tag {139} +$$ + +because $q_i^{(t)} \geq q_i - \epsilon \geq \frac{2}{3} q_i$ and $\sum_{i=1}^{n} q_i^{(t)} = 1$ . Since $\left\| \tilde{g}(\theta^{(t)}) \right\|_2 \to 0$ , there exists $T > 0$ such that for all $t \geq T$ and all $\eta \leq \eta_0$ , + +$$ +\left\| \theta^ {(t + 1)} - \theta^ {*} \right\| _ {2} ^ {2} \leq \left\| \theta^ {(t)} - \theta^ {*} \right\| _ {2} ^ {2} - \frac {\eta C}{3} \tag {140} +$$ + +which means that $\left\| \theta^{(t)} - \theta^{*}\right\|_{2}^{2}\to -\infty$ because $\frac{\eta C}{3}$ is a positive constant. This is a contradiction! Thus, $F(\theta^{(t)})$ must converge to 0, which is result (i). + +(i) immediately implies (ii) because $\ell$ is strictly decreasing to 0 by condition. + +Now let's prove (iii). First of all, the uniqueness of $\theta_R$ can be easily proved from the convexity of $F(\theta)$ . The condition implies that $y_i\langle \theta_R,\pmb {x}_i\rangle >0$ , i.e. $\theta_R$ must classify all training samples correctly. If there are two different minimizers $\theta_{R}$ and $\theta_R^\prime$ in whose norm is at most $R$ , then consider $\theta_R'' = \frac{1}{2} (\theta_R + \theta_R')$ . By the convexity of $F$ , we know that $\theta_R''$ must also be a minimizer, and $\| \theta_R^{\prime \prime}\| _2 < R$ . Thus, $F(\frac{R}{\|\theta_R^{\prime\prime}\|_2}\theta_R^{\prime \prime}) < F(\theta_R^{\prime \prime})$ and $\| \frac{R}{\|\theta_R^{\prime\prime}\|_2}\theta_R^{\prime \prime}\| _2 = R$ , which contradicts with the fact that $\theta_R''$ is a minimizer. + +To prove the rest of (iii), the key is to consider (135). On one hand, similar to (36) we can prove that for all $t \geq t_{\epsilon}$ , there is + +$$ +\left| \langle \boldsymbol {X} \boldsymbol {Q} ^ {(t)} \tilde {g} \left(\theta^ {(t)}\right), \boldsymbol {X} \left(\boldsymbol {Q} ^ {(t)} - \boldsymbol {Q}\right) \tilde {g} \left(\theta^ {(t)}\right) \rangle \right| \leq \lambda^ {\max } \sqrt {3 \epsilon} \| \sqrt {\boldsymbol {Q} ^ {(t)}} \tilde {g} \left(\theta^ {(t)}\right) \| _ {2} ^ {2} \tag {141} +$$ + +Since we choose $\epsilon = \min \left\{\frac{q^*}{3}, \frac{(q^*\lambda^{\min})^2}{192\lambda^{\max 2}}\right\}$ , this inequality implies that + +$$ +\begin{array}{l} \left\| \nabla F _ {t} (\theta^ {(t)}) \right\| _ {2} ^ {2} = \left\| \boldsymbol {X} \boldsymbol {Q} ^ {(t)} \tilde {g} (\theta^ {(t)}) \right\| _ {2} ^ {2} \geq \lambda^ {\min } \left\| \boldsymbol {Q} ^ {(t)} \tilde {g} (\theta^ {(t)}) \right\| _ {2} ^ {2} \geq \lambda^ {\min } (q ^ {*} - \epsilon) \left\| \sqrt {\boldsymbol {Q} ^ {(t)}} \tilde {g} (\theta^ {(t)}) \right\| _ {2} ^ {2} \\ \geq \frac {\lambda^ {\min } q ^ {*}}{2} \left\| \sqrt {\boldsymbol {Q} ^ {(t)}} \tilde {g} \left(\theta^ {(t)}\right) \right\| _ {2} ^ {2} \geq 4 \left| \langle \boldsymbol {X} \boldsymbol {Q} ^ {(t)} \tilde {g} \left(\theta^ {(t)}\right), \boldsymbol {X} \left(\boldsymbol {Q} ^ {(t)} - \boldsymbol {Q}\right) \tilde {g} \left(\theta^ {(t)}\right) \rangle \right| \tag {142} \\ \end{array} +$$ + +On the other hand, if $\eta \leq \eta_{2} = \frac{1}{2L}$ , we will have + +$$ +\frac {\eta^ {2} L}{2} \left\| \boldsymbol {X} \boldsymbol {Q} ^ {(t)} \tilde {g} \left(\theta^ {(t)}\right) \right\| _ {2} ^ {2} \leq \frac {\eta}{4} \left\| \nabla F _ {t} \left(\theta^ {(t)}\right) \right\| _ {2} ^ {2} \tag {143} +$$ + +Combining all the above with (135) yields + +$$ +F \left(\theta^ {(t + 1)}\right) - F \left(\theta^ {(t)}\right) \leq - \frac {\eta}{2} \left\| \nabla F _ {t} \left(\theta^ {(t)}\right) \right\| _ {2} ^ {2} \tag {144} +$$ + +Denote $\pmb{u} = \lim_{R\to \infty}\frac{\theta_R}{\|\theta_R\|_2}$ . Similar to Lemma 9 in Ji et al. (2020), we can prove that: for any $\alpha >0$ , there exists a constant $\rho (\alpha) > 0$ such that for any $\theta$ subject to $\| \theta \| _2\geq \rho (\alpha)$ , there is + +$$ +F _ {t} \left(\left(1 + \alpha\right) \| \theta \| _ {2} \boldsymbol {u}\right) \leq F _ {t} (\theta) \tag {145} +$$ + +for any $t$ . Let $t_\alpha \geq t_\epsilon$ satisfy that for all $t \geq t_\alpha$ , $\| \theta^{(t)} \|_2 \geq \max \{\rho(\alpha), 1\}$ . By the convexity of $F_t$ , for all $t \geq t_\alpha$ , + +$$ +\left\langle \nabla F _ {t} \left(\theta^ {(t)}\right), \theta^ {(t)} - (1 + \alpha) \| \theta^ {(t)} \| _ {2} \boldsymbol {u} \right\rangle \geq F _ {t} \left(\theta^ {(t)}\right) - F _ {t} ((1 + \alpha) \| \theta^ {(t)} \| _ {2} \boldsymbol {u}) \geq 0 \tag {146} +$$ + +Thus, we have + +$$ +\begin{array}{l} \langle \theta^ {(t + 1)} - \theta^ {(t)}, \boldsymbol {u} \rangle = \langle - \eta \nabla F _ {t} (\theta^ {(t)}), \boldsymbol {u} \rangle \\ \geq \langle - \eta \nabla F _ {t} (\theta^ {(t)}), \theta^ {(t)} \rangle \frac {1}{(1 + \alpha) \| \theta^ {(t)} \| _ {2}} \\ = \left\langle \theta^ {(t + 1)} - \theta^ {(t)}, \theta^ {(t)} \right\rangle \frac {1}{(1 + \alpha) \| \theta^ {(t)} \| _ {2}} \tag {147} \\ = \left(\frac {1}{2} \left\| \theta^ {(t + 1)} \right\| _ {2} ^ {2} - \frac {1}{2} \left\| \theta^ {(t)} \right\| _ {2} ^ {2} - \frac {1}{2} \left\| \theta^ {(t + 1)} - \theta^ {(t)} \right\| _ {2} ^ {2}\right) \frac {1}{(1 + \alpha) \| \theta^ {(t)} \| _ {2}} \\ \end{array} +$$ + +By $\frac{1}{2} (\| \theta^{(t + 1)}\| _2 - \| \theta^{(t)}\| _2)^2\geq 0$ we have $(\frac{1}{2}\left\| \theta^{(t + 1)}\right\| _2^2 -\frac{1}{2}\left\| \theta^{(t)}\right\| _2^2) / \| \theta^{(t)}\| _2\geq \left\| \theta^{(t + 1)}\right\| _2 - \left\| \theta^{(t)}\right\| _2.$ Moreover, by (144) we have + +$$ +\frac {\left\| \theta^ {(t + 1)} - \theta^ {(t)} \right\| _ {2} ^ {2}}{2 (1 + \alpha) \| \theta^ {(t)} \| _ {2}} \leq \frac {\left\| \theta^ {(t + 1)} - \theta^ {(t)} \right\| _ {2} ^ {2}}{2} = \frac {\eta^ {2} \left\| \nabla F _ {t} (\theta^ {(t)}) \right\| _ {2} ^ {2}}{2} \leq \eta \left(F (\theta^ {(t)}) - F (\theta^ {(t + 1)})\right) \tag {148} +$$ + +Summing up (147) from $t = t_{\alpha}$ to $t - 1$ , we have + +$$ +\left\langle \theta^ {(t)} - \theta^ {\left(t _ {\alpha}\right)}, \boldsymbol {u} \right\rangle \geq \frac {\left\| \theta^ {(t)} \right\| _ {2} - \left\| \theta^ {\left(t _ {\alpha}\right)} \right\| _ {2}}{1 + \alpha} + \eta \left(F \left(\theta^ {(t)}\right) - F \left(\theta^ {\left(t _ {\alpha}\right)}\right)\right) \geq \frac {\left\| \theta^ {(t)} \right\| _ {2} - \left\| \theta^ {\left(t _ {\alpha}\right)} \right\| _ {2}}{1 + \alpha} - \eta F \left(\theta^ {\left(t _ {\alpha}\right)}\right) \tag {149} +$$ + +which implies that + +$$ +\left\langle \frac {\theta^ {(t)}}{\| \theta^ {(t)} \| _ {2}}, \boldsymbol {u} \right\rangle \geq \frac {1}{1 + \alpha} + \frac {1}{\| \theta^ {(t)} \| _ {2}} \left(\left\langle \theta^ {\left(t _ {\alpha}\right)}, \boldsymbol {u} \right\rangle - \frac {\left\| \theta^ {\left(t _ {\alpha}\right)} \right\| _ {2}}{1 + \alpha} - \eta F \left(\theta^ {\left(t _ {\alpha}\right)}\right)\right) \tag {150} +$$ + +Since $\lim_{t\to \infty}\| \theta^{(t)}\| _2 = \infty$ , we have + +$$ +\lim _ {t \rightarrow \infty} \inf \left\langle \frac {\theta^ {(t)}}{\| \theta^ {(t)} \| _ {2}}, \boldsymbol {u} \right\rangle \geq \frac {1}{1 + \alpha} \tag {151} +$$ + +Since $\alpha$ is arbitrary, we must have $\lim_{t\to \infty}\frac{\theta^{(t)}}{\left\| \theta^{(t)}\right\|_2} = \pmb{u}$ as long as $\eta \leq \min \{\eta_1,\eta_2\}$ . + +# D.5.3 COROLLARY OF THEOREM 8 + +We can show that for the logistic loss, it satisfies all conditions of Theorem 8 and $\lim_{R\to \infty}\frac{\theta_R}{R} = \hat{\theta}_{\mathrm{MM}}$ . First of all, for the logistic loss we have $\nabla_{\hat{y}}^{2}\ell (\hat{y},y) = \frac{y^{2}}{e^{y\hat{y}} + e^{-y\hat{y}} + 2}\leq \max_{i}\frac{y_{i}^{2}}{4}$ , so $\ell$ is smooth. + +Then, we prove that $\lim_{R\to \infty}\frac{\theta_R}{R}$ exists and is equal to $\hat{\theta}_{\mathrm{MM}}$ . For the logistic loss, it is easy to show that for any $\hat{\theta}^{\prime}\neq \hat{\theta}_{\mathrm{MM}}$ , there exists an $R(\hat{\theta}^{\prime}) > 0$ and an $\delta (\hat{\theta}^{\prime}) > 0$ such that $F(R\cdot \theta) > F(R\cdot \hat{\theta}_{\mathrm{MM}})$ for all $R\geq R(\hat{\theta}^{\prime})$ and $\theta \in B(\hat{\theta}^{\prime},\delta (\hat{\theta}^{\prime}))$ . + +Let $S = \{\theta : \| \theta \|_2 = 1\}$ . For any $\epsilon > 0$ , $S - B(\hat{\theta}_{\mathrm{MM}}, \epsilon)$ is a compact set. And for any $\theta \in S - B(\hat{\theta}_{\mathrm{MM}}, \epsilon)$ , there exist $R(\theta)$ and $\delta(\theta)$ as defined above. Thus, there must exist $\theta_1, \dots, \theta_m \in S - B(\hat{\theta}_{\mathrm{MM}}, \epsilon)$ such that $S - B(\hat{\theta}_{\mathrm{MM}}, \epsilon) \subseteq \cup_{i=1}^{m} B(\theta_i, \delta(\theta_i))$ . Let $R(\epsilon) = \max \{R(\theta_1), \dots, R(\theta_m)\}$ , then for all $R \geq R(\epsilon)$ and all $\theta \in S - B(\hat{\theta}_{\mathrm{MM}}, \epsilon)$ , $F(R \cdot \theta) > F(R \cdot \hat{\theta}_{\mathrm{MM}})$ , which means that $\frac{\theta_R}{R} \in B(\hat{\theta}_{\mathrm{MM}}, \epsilon)$ for all $R \geq R(\epsilon)$ . Therefore, $\lim_{R \to \infty} \frac{\theta_R}{R}$ exists and is equal to $\hat{\theta}_{\mathrm{MM}}$ . + +Therefore, by Theorem 8, any GRW satisfying Assumption 1 makes a linear model converge to the max-margin classifier under the logistic loss. + +# D.6 PROOF OF THEOREM 9 + +We first consider the regularized linearized neural network $f_{\mathrm{linreg}}^{(t)}$ . Since by Proposition 11 $f^{(0)}(\pmb{x})$ is sampled from a zero-mean Gaussian process, there exists a constant $M > 0$ such that $|f^{(0)}(\pmb{x}_i)| < M$ for all $i$ with high probability. Define + +$$ +F (\theta) = \sum_ {i = 1} ^ {n} q _ {i} \ell \left(\left\langle \theta , \nabla_ {\theta} f ^ {(0)} \left(\boldsymbol {x} _ {i}\right) \right\rangle + f ^ {(0)} \left(\boldsymbol {x} _ {i}\right), y _ {i}\right) \tag {152} +$$ + +Denote $\tilde{\theta}_R = \arg \min_{\theta}\{F(R\cdot \theta):\| \theta \| _2\leq 1\}$ . When the linearized neural network is trained by a GRW satisfying Assumption 1 with regularization, since this is convex optimization and the objective function is smooth, we can prove that with a sufficiently small learning rate, as $t\to \infty$ $\theta^{(t)}\rightarrow R\cdot \tilde{\theta}_R + \theta^{(0)}$ where $R = \lim_{t\to \infty}\| \theta^{(t)} - \theta^{(0)}\| _2$ (which is the minimizer). And define + +$$ +\gamma = \min _ {i = 1, \dots , n} y _ {i} \cdot \left\langle \hat {\theta} _ {\mathrm {M M}}, \nabla_ {\theta} f ^ {(0)} \left(\boldsymbol {x} _ {i}\right) \right\rangle \tag {153} +$$ + +First, we derive the lower bound of $R$ . By Theorem 16, with a sufficiently large $\tilde{d}$ , with high probability $\hat{\mathcal{R}}(f_{\mathrm{reg}}^{(t)}) < \epsilon$ implies $\hat{\mathcal{R}}(f_{\mathrm{linreg}}^{(t)}) < 2\epsilon$ . By the convexity of $\ell$ , we have + +$$ +\begin{array}{l} 2 \epsilon > \frac {1}{n} \sum_ {i = 1} ^ {n} \ell (\langle R \tilde {\theta} _ {R}, \boldsymbol {x} _ {i} \rangle + f ^ {(0)} (\boldsymbol {x} _ {i}), y _ {i}) \geq \log \left(1 + \exp \left(- \frac {1}{n} \sum_ {i = 1} ^ {n} (\langle R \tilde {\theta} _ {R}, \boldsymbol {x} _ {i} \rangle + f ^ {(0)} (\boldsymbol {x} _ {i})) y _ {i}\right)\right) \\ \geq \log \left(1 + \exp \left(- \frac {1}{n} \sum_ {i = 1} ^ {n} R \langle \tilde {\theta} _ {R}, \boldsymbol {x} _ {i} \rangle y _ {i} - M\right)\right) \tag {154} \\ \end{array} +$$ + +which implies that $R = \Omega (-\log 2\epsilon)$ for all $\epsilon \in (0,\frac{1}{4})$ + +Denote $\delta = \| \hat{\theta}_{\mathrm{MM}} - \tilde{\theta}_R\| _2$ . Let $\theta^{\prime} = \frac{\hat{\theta}_{\mathrm{MM}} + \tilde{\theta}_{R}}{2}$ , then we can see that $\| \theta^{\prime}\|_{2} = \sqrt{1 - \frac{\delta^{2}}{4}}$ . Let $\tilde{\theta}^{\prime} = \frac{\theta^{\prime}}{\|\theta^{\prime}\|_{2}}$ By the definition of $\hat{\theta}_{\mathrm{MM}}$ , there exists $j$ such that $y_{j}\cdot \langle \tilde{\theta}^{\prime},\nabla_{\theta}f^{(0)}(\pmb{x}_{j})\rangle \leq \gamma$ , which implies + +$$ +y _ {j} \cdot \left\langle \frac {\hat {\theta} _ {\mathrm {M M}} + \tilde {\theta} _ {R}}{2} \frac {1}{\sqrt {1 - \frac {\delta^ {2}}{4}}}, \nabla_ {\theta} f ^ {(0)} \left(\boldsymbol {x} _ {j}\right) \right\rangle \leq \gamma \tag {155} +$$ + +Thus, we have + +$$ +\begin{array}{l} y _ {j} \cdot \langle \tilde {\theta} _ {R}, \nabla_ {\theta} f ^ {(0)} (\pmb {x} _ {j}) \rangle \leq 2 \sqrt {1 - \frac {\delta^ {2}}{4}} \gamma - y _ {j} \cdot \langle \hat {\theta} _ {\mathrm {M M}}, \nabla_ {\theta} f ^ {(0)} (\pmb {x} _ {j}) \rangle \\ \leq \left(2 \sqrt {1 - \frac {\delta^ {2}}{4}} - 1\right) \gamma \tag {156} \\ \leq \left(2 \left(1 - \frac {\delta^ {2}}{8}\right) - 1\right) \gamma \quad (\text {s i n c e} \sqrt {1 - x} \leq 1 - \frac {x}{2}) \\ = (1 - \frac {\delta^ {2}}{4}) \gamma \\ \end{array} +$$ + +On the other hand, we have + +$$ +\begin{array}{l} q _ {j} \log (1 + \exp (- y _ {j} \cdot \langle R \cdot \tilde {\theta} _ {R}, \nabla_ {\theta} f ^ {(0)} (\boldsymbol {x} _ {j}) \rangle - M)) \leq F (R \cdot \tilde {\theta} _ {R}) \tag {157} \\ \leq F (R \cdot \dot {\theta} _ {\mathrm {M M}}) \leq \log (1 + \exp (- R \gamma + M)) \\ \end{array} +$$ + +which implies that + +$$ +q ^ {*} \log \left(1 + \exp \left(- \left(1 - \frac {\delta^ {2}}{4}\right) R \gamma - M\right)\right) \leq \log (1 + \exp (- R \gamma + M)) \tag {158} +$$ + +and this leads to + +$$ +1 + \exp (- R \gamma + M) \geq \left(1 + \exp \left(- \left(1 - \frac {\delta^ {2}}{4}\right) R \gamma - M\right)\right) ^ {q ^ {*}} \geq 1 + q ^ {*} \exp \left(- \left(1 - \frac {\delta^ {2}}{4}\right) R \gamma - M\right) \tag {159} +$$ + +which is equivalent to + +$$ +- R \gamma + M \geq - \left(1 - \frac {\delta^ {2}}{4}\right) R \gamma - M + \log \left(q ^ {*}\right) \tag {160} +$$ + +Thus, we have + +$$ +\delta = O \left(R ^ {- 1 / 2}\right) = O \left(\left(- \log 2 \epsilon\right) ^ {- 1 / 2}\right) \tag {161} +$$ + +So for any test point $\pmb{x}$ , since $\| \nabla_{\theta}f^{(0)}(\pmb{x})\|_2 \leq M_0$ , we have + +$$ +\left| \left\langle \hat {\theta} _ {\mathrm {M M}} - \tilde {\theta} _ {R}, \nabla_ {\theta} f ^ {(0)} (\boldsymbol {x}) \right\rangle \right| \leq \delta M _ {0} = O \left(\left(- \log 2 \epsilon\right) ^ {- 1 / 2}\right) \tag {162} +$$ + +Combined with Theorem 16, we have: with high probability, + +$$ +\lim _ {t \rightarrow \infty} | R \cdot f _ {\mathrm {M M}} (\boldsymbol {x}) - f _ {\mathrm {r e g}} ^ {(t)} (\boldsymbol {x}) | = O (R \cdot (- \log 2 \epsilon) ^ {- 1 / 2} + \tilde {d} ^ {- 1 / 4}) \tag {163} +$$ + +So there exists a constant $C > 0$ such that: As $\tilde{d} \to \infty$ , with high probability, for all $\epsilon \in (0, \frac{1}{4})$ , if $|f_{\mathrm{MM}}(\pmb{x})| > C \cdot (-\log 2\epsilon)^{-1/2}$ , then $f_{\mathrm{reg}}^{(t)}(\pmb{x})$ will have the same sign as $f_{\mathrm{MM}}(\pmb{x})$ for a sufficiently large $t$ . Note that this $C$ only depends on $n, q^*, \gamma, M$ and $M_0$ , so it is a constant independent of $\epsilon$ . + +Remark. Note that Theorem 9 requires Assumption 1 while Theorem 6 does not due to the fundamental difference between the classification and regression. In regression the model converges to a finite point. However, in classification, the training loss converging to zero implies that either (i) The direction of the weight is close to the max-margin classifier or (ii) The norm of the weight is very large. Assumption 1 is used to eliminate the possibility of (ii). If the regularization parameter $\mu$ is sufficiently large, then a small empirical risk could imply a small weight norm. However, in our theorem we do not assume anything on $\mu$ , so Assumption 1 is necessary. + +# A NOTE ON THE PROOFS IN LEE ET AL. (2019) + +We have mentioned that the proofs in Lee et al. (2019), particularly the proofs of their Theorem 2.1 and Lemma 1 in their Appendix G, are flawed. In order to fix their proof, we change the network initialization to (9). In this section, we will demonstrate what goes wrong in the proofs in Lee et al. (2019), and how we manage to fix the proof. For clarity, we are referring to the following version of the paper: https://arxiv.org/pdf/1902.06720v4.pdf. + +To avoid confusion, in this section we will still use the notations used in our paper. + +# E.1 THEIR PROBLEMS + +Lee et al. (2019) claimed in their Theorem 2.1 that under the conditions of our Lemma 5, for any $\delta > 0$ , there exist $\tilde{D} > 0$ and a constant $C$ such that for any $\tilde{d} \geq \tilde{D}$ , with probability at least $(1 - \delta)$ , + +the gap between the output of a sufficiently wide fully-connected neural network and the output of its linearized neural network at any test point $x$ can be uniformly bounded by + +$$ +\sup _ {t \geq 0} \left| f ^ {(t)} (\boldsymbol {x}) - f _ {\ln} ^ {(t)} (\boldsymbol {x}) \right| \leq C \tilde {d} ^ {- 1 / 2} \quad \text {(c l a i m e d)} \tag {164} +$$ + +where they used the original NTK formulation and initialization in Jacot et al. (2018): + +$$ +\left\{ \begin{array}{l} \boldsymbol {h} ^ {l + 1} = \frac {W ^ {l}}{\sqrt {d _ {l}}} \boldsymbol {x} ^ {l} + \beta \boldsymbol {b} ^ {l} \\ \boldsymbol {x} ^ {l + 1} = \sigma (\boldsymbol {h} ^ {l + 1}) \end{array} \right. \quad \text {a n d} \quad \left\{ \begin{array}{l} W _ {i, j} ^ {l (0)} \sim \mathcal {N} (0, 1) \\ b _ {i} ^ {l (0)} \sim \mathcal {N} (0, 1) \end{array} \right. \quad (\forall l = 0, \dots , L) \tag {165} +$$ + +where $\boldsymbol{x}_0 = \boldsymbol{x}$ and $f(\boldsymbol{x}) = h^{L + 1}$ . However, in their proof in their Appendix G, they did not directly prove their result for the NTK formulation, but instead they proved another result for the following formulation which they called the standard formulation: + +$$ +\left\{ \begin{array}{l} \boldsymbol {h} ^ {l + 1} = W ^ {l} \boldsymbol {x} ^ {l} + \beta \boldsymbol {b} ^ {l} \\ \boldsymbol {x} ^ {l + 1} = \sigma (\boldsymbol {h} ^ {l + 1}) \end{array} \right. \quad \text {a n d} \quad \left\{ \begin{array}{l} W _ {i, j} ^ {l (0)} \sim \mathcal {N} \left(0, \frac {1}{d _ {l}}\right) \\ b _ {i} ^ {l (0)} \sim \mathcal {N} (0, 1) \end{array} \right. \quad (\forall l = 0, \dots , L) \tag {166} +$$ + +See their Appendix F for the definition of their standard formulation. In the original formulation, they also included two constants $\sigma_w$ and $\sigma_b$ for standard deviations, and for simplicity we omit these constants here. Note that the outputs of the NTK formulation and the standard formulation at initialization are actually the same. The only difference is that the norm of the weight $W^l$ and the gradient of the model output with respect to $W^l$ are different for all $l$ . + +In their Appendix G, they claimed that if a network with the standard formulation is trained by minimizing the squared loss with gradient descent and learning rate $\eta' = \eta / \tilde{d}$ , where $\eta$ is our learning rate in Lemma 5 and also their learning rate in their Theorem 2.1, then (164) is true for this network, so it is also true for a network with the NTK formulation because the two formulations have the same network output. And then they claimed in their equation (S37) that applying learning rate $\eta'$ to the standard formulation is equivalent to applying the following learning rates + +$$ +\eta_ {W} ^ {l} = \frac {d _ {l}}{d _ {\max }} \eta \quad \text {a n d} \quad \eta_ {b} ^ {l} = \frac {1}{d _ {\max }} \eta \tag {167} +$$ + +to $W^l$ and $\pmb{b}^{l}$ of the NTK formulation, where $d_{\mathrm{max}} = \max \{d_0,\dots ,d_L\}$ + +To avoid confusion, in the following discussions we will still use the NTK formulation and initialization if not stated otherwise. + +Problem 1. Claim (167) is true, but it leads to two problems. The first problem is that $\eta_{\pmb{b}}^{l} = O(d_{\max}^{-1})$ since $\eta = O(1)$ , while their Theorem 2.1 needs the learning rate to be $O(1)$ . Nevertheless, this problem can be simply fixed by modifying their standard formulation as $\pmb{h}^{l + 1} = W^l\pmb{x}^l + \beta \sqrt{d_l}\pmb{b}^l$ where $b_i^{l(0)} \sim \mathcal{N}(0, d_l^{-1})$ . The real problem that is non-trivial to fix is that by (167), there is $\eta_W^0 = \frac{d_0}{d_{\max}}\eta$ . However, note that $d_0$ is a constant since it is the dimension of the input space, while $d_{\max}$ goes to infinity. Consequently, in (167) they were essentially using a very small learning rate for the first layer $W^0$ but a normal learning rate for the rest of the layers, which definitely does not match with their claim in their Theorem 2.1. + +Problem 2. Another big problem is that the proof of their Lemma 1 in their Appendix G is erroneous, and consequently their Theorem 2.1 is unsound as it heavily depends on their Lemma 1. In their Lemma 1, they claimed that for some constant $M > 0$ , for any two models with the parameters $\theta$ and $\tilde{\theta}$ such that $\theta, \tilde{\theta} \in B(\theta^{(0)}, C_0)$ for some constant $C_0$ , there is + +$$ +\left\| J (\theta) - J (\tilde {\theta}) \right\| _ {F} \leq \frac {M}{\sqrt {\tilde {d}}} \left\| \theta - \tilde {\theta} \right\| _ {2} \quad \text {(c l a i m e d)} \tag {168} +$$ + +Note that the original claim in their paper was $\left\| J(\theta) - J(\tilde{\theta})\right\|_F \leq M\sqrt{\tilde{d}}\left\|\theta - \tilde{\theta}\right\|_2$ . This is because they were proving this result for their standard formulation. Compared to the standard formulation, + +in the NTK formulation $\theta$ is $\sqrt{\tilde{d}}$ times larger, while the Jacobian $J(\theta)$ is $\sqrt{\tilde{d}}$ times smaller. This is also why here we have $\theta, \tilde{\theta} \in B(\theta^{(0)}, C_0)$ instead of $\theta, \tilde{\theta} \in B(\theta^{(0)}, C_0\tilde{d}^{-1/2})$ for the NTK formulation. Therefore, equivalently they were claiming (168) for the NTK formulation. + +However, their proof of (168) is incorrect. Specifically, the right-hand side of their inequality (S86) is incorrect. Using the notations in our Appendix D.3.3, their (S86) essentially claimed that + +$$ +\left\| \boldsymbol {\alpha} ^ {l} - \tilde {\boldsymbol {\alpha}} ^ {l} \right\| _ {2} \leq \frac {M}{\sqrt {\tilde {d}}} \left\| \theta - \tilde {\theta} \right\| _ {2} \quad (\text {c l a i m e d}) \tag {169} +$$ + +for any $\theta, \tilde{\theta} \in B(\theta^{(0)}, C_0)$ , where $\boldsymbol{\alpha}^l = \nabla_{\boldsymbol{h}^l} \boldsymbol{h}^{L+1}$ and $\tilde{\boldsymbol{\alpha}}^l$ is the same gradient for the second model. Note that their (S86) does not have the $\sqrt{\tilde{d}}$ in the denominator which appears in (169). This is because for their standard formulation, $\theta$ is $\sqrt{\tilde{d}}$ times smaller than the original NTK formulation, while $\left\| \boldsymbol{\alpha}^l \right\|_2$ has the same order in the two formulations because all $\boldsymbol{h}^l$ are the same. + +However, it is actually impossible to prove (169). Consider the following counterexample: Since $\theta$ and $\tilde{\theta}$ are arbitrarily chosen, we can choose them such that they only differ in $b_1^l$ for some $1\leq l < L$ . Then, $\left\| \theta -\tilde{\theta}\right\| _2 = \left|b_1^l -\tilde{b}_1^l\right|$ . We can see that $\pmb{h}^{l + 1}$ and $\tilde{\pmb{h}}^{l + 1}$ only differ in the first element, and $\left|h_1^{l + 1} - \tilde{h}_1^{l + 1}\right| = \left|\beta (b_1^l -\tilde{b}_1^l)\right|$ . Moreover, we have $W^{l + 1} = \tilde{W}^{l + 1}$ , so there is + +$$ +\begin{array}{l} \boldsymbol {\alpha} ^ {l + 1} - \tilde {\boldsymbol {\alpha}} ^ {l + 1} = \operatorname {d i a g} (\dot {\sigma} (\boldsymbol {h} ^ {l + 1})) \frac {W ^ {l + 1 \top}}{\sqrt {\tilde {d}}} \boldsymbol {\alpha} ^ {l + 2} - \operatorname {d i a g} (\dot {\sigma} (\tilde {\boldsymbol {h}} ^ {l + 1})) \frac {\tilde {W} ^ {l + 1 \top}}{\sqrt {\tilde {d}}} \tilde {\boldsymbol {\alpha}} ^ {l + 2} \\ = \left[ \operatorname {d i a g} \left(\dot {\sigma} \left(\boldsymbol {h} ^ {l + 1}\right)\right) - \operatorname {d i a g} \left(\dot {\sigma} \left(\tilde {\boldsymbol {h}} ^ {l + 1}\right)\right) \right] \frac {W ^ {l + 1 \top}}{\sqrt {\tilde {d}}} \boldsymbol {\alpha} ^ {l + 2} \tag {170} \\ + \operatorname {d i a g} (\dot {\sigma} (\tilde {\boldsymbol {h}} ^ {l + 1})) \frac {W ^ {l + 1 \top}}{\sqrt {\tilde {d}}} (\boldsymbol {\alpha} ^ {l + 2} - \tilde {\boldsymbol {\alpha}} ^ {l + 2}) \\ \end{array} +$$ + +Then we can lower bound $\left\| \boldsymbol{\alpha}^{l + 1} - \tilde{\boldsymbol{\alpha}}^{l + 1}\right\| _2$ by + +$$ +\begin{array}{l} \left\| \boldsymbol {\alpha} ^ {l + 1} - \tilde {\boldsymbol {\alpha}} ^ {l + 1} \right\| _ {2} \geq \left\| \left[ \operatorname {d i a g} (\dot {\sigma} (\boldsymbol {h} ^ {l + 1})) - \operatorname {d i a g} (\dot {\sigma} (\tilde {\boldsymbol {h}} ^ {l + 1})) \right] \frac {W ^ {l + 1 \top}}{\sqrt {\tilde {d}}} \boldsymbol {\alpha} ^ {l + 2} \right\| _ {2} \tag {171} \\ \left. - \left\| \operatorname {d i a g} (\dot {\sigma} (\tilde {\boldsymbol {h}} ^ {l + 1})) \frac {W ^ {l + 1 \top}}{\sqrt {\tilde {d}}} (\boldsymbol {\alpha} ^ {l + 2} - \tilde {\boldsymbol {\alpha}} ^ {l + 2}) \right\| _ {2} \right. \\ \end{array} +$$ + +The first term on the right-hand side is equal to $\left|\left[\dot{\sigma}(h_1^{l+1}) - \dot{\sigma}(\tilde{h}_1^{l+1})\right]\langle W_1^{l+1} / \sqrt{\tilde{d}}, \boldsymbol{\alpha}^{l+2}\rangle\right|$ where $W_1^{l+1}$ is the first row of $W^{l+1}$ . We know that $\|W_1^{l+1}\|_2 = \Theta\left(\sqrt{\tilde{d}}\right)$ with high probability as its elements are sampled from $\mathcal{N}(0,1)$ , and in their (S85) they claimed that $\| \boldsymbol{\alpha}^{l+2}\|_2 = O(1)$ , which is true. In addition, they assumed that $\dot{\sigma}$ is Lipschitz. Hence, we can see that + +$$ +\left\| \left[ \operatorname {d i a g} (\dot {\sigma} \left(\boldsymbol {h} ^ {l + 1}\right)) - \operatorname {d i a g} (\dot {\sigma} \left(\tilde {\boldsymbol {h}} ^ {l + 1}\right)) \right] \frac {W ^ {l + 1 \top}}{\sqrt {\tilde {d}}} \boldsymbol {\alpha} ^ {l + 2} \right\| _ {2} = O \left(\left| h _ {1} ^ {l + 1} - \tilde {h} _ {1} ^ {l + 1} \right|\right) = O \left(\left\| \theta - \tilde {\theta} \right\| _ {2}\right) \tag {172} +$$ + +On the other hand, suppose that claim (169) is true, then $\left\| \boldsymbol{\alpha}^{l + 2} - \tilde{\boldsymbol{\alpha}}^{l + 2}\right\|_2 = O\left(\tilde{d}^{-1 / 2}\left\| \theta -\tilde{\theta}\right\|_2\right)$ . Then we can see that the second term on the right-hand side is $O\left(\tilde{d}^{-1 / 2}\left\| \theta -\tilde{\theta}\right\|_2\right)$ because $\left\| W^{l + 1}\right\|_2 = O(\sqrt{\tilde{d}})$ and $\dot{\sigma} (x)$ is bounded by a constant as $\sigma$ is Lipschitz. Thus, for a very large $\tilde{d}$ , the second-term is an infinitesimal compared to the first term, so we can only prove that + +$$ +\left\| \boldsymbol {\alpha} ^ {l + 1} - \tilde {\boldsymbol {\alpha}} ^ {l + 1} \right\| _ {2} = O \left(\left\| \theta - \tilde {\theta} \right\| _ {2}\right) \tag {173} +$$ + +which is different from (169) because it lacks a critical $\tilde{d}^{-1/2}$ and thus leads to a contradiction. Hence, we cannot prove (169) with the $\tilde{d}^{-1/2}$ factor, and consequently we cannot prove (168) with + +the $\sqrt{\tilde{d}}$ in the denominator on the right-hand side. As a result, their Lemma 1 and Theorem 2.1 cannot be proved without this critical $\tilde{d}^{-1/2}$ . Similarly, we can also construct a counterexample where $\theta$ and $\tilde{\theta}$ only differ in the first row of some $W^l$ . + +# E.2 OUR FIXES + +Regarding Problem 1, we can still use an $O(1)$ learning rate for the first layer in the NTK formulation given that $\| \pmb{x} \|_2 \leq 1$ . This is because for the first layer, we have + +$$ +\nabla_ {W ^ {0}} f (\boldsymbol {x}) = \frac {1}{\sqrt {d _ {0}}} \boldsymbol {x} ^ {0} \alpha^ {1 \top} = \frac {1}{\sqrt {d _ {0}}} \boldsymbol {x} \alpha^ {1 \top} \tag {174} +$$ + +For all $l \geq 1$ , we have $\left\| \boldsymbol{x}^l \right\|_2 = O(\tilde{d}^{1/2})$ . However, for $l = 0$ , we instead have $\left\| \boldsymbol{x}^0 \right\|_2 = O(1)$ . Thus, we can prove that the norm of $\nabla_{W^0} f(\boldsymbol{x})$ has the same order as the gradient with respect to any other layer, so there is no need to use a smaller learning rate for the first layer. + +Regarding Problem 2, in our formulation (8) and initialization (9), the initialization of the last layer of the NTK formulation is changed from the Gaussian initialization $W_{i,j}^{L(0)} \sim \mathcal{N}(0,1)$ to the zero initialization $W_{i,j}^{L(0)} = 0$ . Now we show how this modification solves Problem 2. + +The main consequence of changing the initialization of the last layer is that (86) becomes different: instead of $\left\| W^L\right\|_2 \leq 3\sqrt{\tilde{d}}$ , we now have $\left\| W^L\right\|_2 \leq C_0 \leq 3\sqrt[4]{\tilde{d}}$ . In fact, for any $r \in (0,1/2)$ , we can prove that $\left\| W^L\right\|_2 \leq 3\tilde{d}^r$ for sufficiently large $\tilde{d}$ . In our proof we choose $r = 1/4$ . + +Consequently, instead of $\left\| \boldsymbol{\alpha}^l\right\|_2 \leq M_3$ , we can now prove that $\left\| \boldsymbol{\alpha}^l\right\|_2 \leq M_3\tilde{d}^{r - 1 / 2}$ for all $l \leq L$ by induction. So now we can prove $\left\| \boldsymbol{\alpha}^l - \tilde{\boldsymbol{\alpha}}^l\right\|_2 = O\left(\tilde{d}^{r - 1 / 2}\left\| \theta - \tilde{\theta}\right\|_2\right)$ instead of $O\left(\left\| \theta - \tilde{\theta}\right\|_2\right)$ , because + +- For $l < L$ , we now have $\left\| \boldsymbol{\alpha}^{l + 1}\right\|_2 = O(\tilde{d}^{r - 1 / 2})$ instead of $O(1)$ , so we can have the additional $\tilde{d}^{r - 1 / 2}$ factor in the bound. +- For $l = L$ , although $\| \alpha^{L + 1} \|_2 = 1$ , note that $\| W^L \|_2$ now becomes $O(\tilde{d}^r)$ instead of $O(\tilde{d}^{1/2})$ , so again we can decrease the bound by a factor of $\tilde{d}^{r - 1/2}$ . + +Then, with this critical $\tilde{d}^{r - 1 / 2}$ , we can prove the approximation theorem with the form + +$$ +\sup _ {t \geq 0} \left| f ^ {(t)} (\boldsymbol {x}) - f _ {\ln} ^ {(t)} (\boldsymbol {x}) \right| \leq C \tilde {d} ^ {r - 1 / 2} \tag {175} +$$ + +for any $r \in (0, 1/2)$ , though we cannot really prove the $O(\tilde{d}^{-1/2})$ bound as originally claimed in (164). So this is how we solve Problem 2. + +One caveat of changing the initialization to zero initialization is whether we can still safely assume that $\lambda^{\mathrm{min}} > 0$ where $\lambda^{\mathrm{min}}$ is the smallest eigenvalue of $\Theta$ , the kernel matrix of our new formulation. The answer is yes. In fact, in our Proposition 3 we proved that $\Theta$ is non-degenerated (which means that $\Theta(\boldsymbol{x}, \boldsymbol{x}^{\prime})$ still depends on $\boldsymbol{x}$ and $\boldsymbol{x}^{\prime}$ ), and under the overparameterized setting where $d_{L} \gg n$ , chances are high that $\Theta$ is full-rank. Hence, we can still assume that $\lambda^{\mathrm{min}} > 0$ . + +As a final remark, one key reason why we need to initialize $W^L$ as zero is that the dimension of the output space (i.e. the dimension of $h^{L + 1}$ ) is finite, and in our case it is 1. Suppose we allow the dimension of $h^{L + 1}$ to be $\tilde{d}$ which goes to infinity, then using the same proof techniques, for the NTK formulation we can prove that $\sup_t\left\| h^{L + 1(t)} - h_{\mathrm{lin}}^{L + 1(t)}\right\|_2\leq C$ , i.e. the gap between two vectors of infinite dimension is always bounded by a finite constant. This is the approximation theorem we need for the infinite-dimensional output space. However, when the dimension of the output space is finite, $\sup_t\left\| h^{L + 1(t)} - h_{\mathrm{lin}}^{L + 1(t)}\right\|_2\leq C$ no longer suffices, so we need to decrease the order of the norm of $W^L$ in order to obtain a smaller upper bound. \ No newline at end of file diff --git a/understandingwhygeneralizedreweightingdoesnotimproveovererm/images.zip b/understandingwhygeneralizedreweightingdoesnotimproveovererm/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..27611155312740cfe2d10d0a7bbdc5bb4bd893f1 --- /dev/null +++ b/understandingwhygeneralizedreweightingdoesnotimproveovererm/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f5978750eac0ccb580e0cdc0b8949f3250fbbe7c6a73ad90312f05181aa81980 +size 2112492 diff --git a/understandingwhygeneralizedreweightingdoesnotimproveovererm/layout.json b/understandingwhygeneralizedreweightingdoesnotimproveovererm/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..0bb8903f304413c24a138d91bdd64466b4b8a90e --- /dev/null +++ b/understandingwhygeneralizedreweightingdoesnotimproveovererm/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f9df2855697c55a17b6735b6741f5f35064ec982bd368cf78fec659670499eed +size 2165302 diff --git a/understandingzeroshotadversarialrobustnessforlargescalemodels/3a4ab02f-7799-4db5-873b-0ae3dea8c915_content_list.json b/understandingzeroshotadversarialrobustnessforlargescalemodels/3a4ab02f-7799-4db5-873b-0ae3dea8c915_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..46fb4b6665147cb75786a58fc00f2cd564a6ec8c --- /dev/null +++ b/understandingzeroshotadversarialrobustnessforlargescalemodels/3a4ab02f-7799-4db5-873b-0ae3dea8c915_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eceb5cc56b6e360c9e7c19451c69528b33fc8ce2dc918cf4de1335507f1f8196 +size 122412 diff --git a/understandingzeroshotadversarialrobustnessforlargescalemodels/3a4ab02f-7799-4db5-873b-0ae3dea8c915_model.json b/understandingzeroshotadversarialrobustnessforlargescalemodels/3a4ab02f-7799-4db5-873b-0ae3dea8c915_model.json new file mode 100644 index 0000000000000000000000000000000000000000..3ae5dfcdc0a6a005304876c7e4f718ba2952087f --- /dev/null +++ b/understandingzeroshotadversarialrobustnessforlargescalemodels/3a4ab02f-7799-4db5-873b-0ae3dea8c915_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c0e080b7bc07d93930c0a0ff2f1864a7fef71f5bf0869b724659518db5f9ebc +size 149511 diff --git a/understandingzeroshotadversarialrobustnessforlargescalemodels/3a4ab02f-7799-4db5-873b-0ae3dea8c915_origin.pdf b/understandingzeroshotadversarialrobustnessforlargescalemodels/3a4ab02f-7799-4db5-873b-0ae3dea8c915_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..98e01866b8cf58feb3f986bc76480a10acdbcd34 --- /dev/null +++ b/understandingzeroshotadversarialrobustnessforlargescalemodels/3a4ab02f-7799-4db5-873b-0ae3dea8c915_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:79965e1eca59840a11bbdb6f489b29fd47da446e81bc088efdd112d836457a14 +size 853425 diff --git a/understandingzeroshotadversarialrobustnessforlargescalemodels/full.md b/understandingzeroshotadversarialrobustnessforlargescalemodels/full.md new file mode 100644 index 0000000000000000000000000000000000000000..4369634b28a8ec8e7e6d226e8187a52461fd3ae9 --- /dev/null +++ b/understandingzeroshotadversarialrobustnessforlargescalemodels/full.md @@ -0,0 +1,463 @@ +# UNDERSTANDING ZERO-SHOT ADVERSARIAL ROBUSTNESS FOR LARGE-SCALE MODELS + +Chengzhi Mao $^{1*}$ Scott Geng $^{1*}$ Junfeng Yang $^{1}$ Xin Wang $^{2}$ Carl Vondrick $^{1}$ Columbia University $^{1}$ , Microsoft Research $^{2}$ + +# ABSTRACT + +Pretrained large-scale vision-language models like CLIP have exhibited strong generalization over unseen tasks. Yet imperceptible adversarial perturbations can significantly reduce CLIP's performance on new tasks. In this work, we identify and explore the problem of adapting large-scale models for zero-shot adversarial robustness. We first identify two key factors during model adaption—training losses and adaptation methods—that affect the model's zero-shot adversarial robustness. We then propose a text-guided contrastive adversarial training loss, which aligns the text embeddings and the adversarial visual features with contrastive learning on a small set of training data. We apply this training loss to two adaption methods, model finetuning and visual prompt tuning. We find that visual prompt tuning is more effective in the absence of texts, while finetuning wins in the existence of text guidance. Overall, our approach significantly improves the zero-shot adversarial robustness over CLIP, seeing an average improvement of 31 points over ImageNet and 15 zero-shot datasets. Our code and model is available at github.com/cvlab-columbia/ZSRobust4FoundationModel. + +# 1 INTRODUCTION + +Large-scale models trained on vision and language data—also known as foundation models—have emerged as a universal backbone for tackling many recognition problems in computer vision (Jia et al., 2021; Radford et al., 2021), graphics (Ramesh et al., 2022) and robotics (Ahn et al., 2022). One of the key advantages of foundation models is zero-shot generalization, where the models use just a single textual description to recognize new visual categories with high accuracy. Since those large-scale models are powerful, they will continue to be used in many critical applications, where it is important to make them reliable. However, robustness under adversarial examples remains a challenge, where an imperceptible pattern can be combined with the image to cause recognition failures (Croce & Hein, 2020; Carlini & Wagner, 2017; Dong et al., 2018; Szegedy et al., 2013; Moosavi-Dezfooli et al., 2016), where attack on foundation models can consequently corrupt the downstream applications. + +Due to the importance of this problem, there is a large literature that investigates adversarial robustness for neural networks. The most common approach for adversarial defense is to learn the model through adversarial training (Madry et al., 2018; Mao et al., 2019; Szegedy et al., 2013; Pang et al., 2020; Rice et al., 2020; Uesato et al., 2019), which involves augmenting the training set with mined adversarial examples that fool the image classifier. Adversarial training has been validated to improve robustness on the task that the mined examples come from, but it often comes at a cost of generalization (Stutz et al., 2019; Su et al., 2018; Pedraza et al., 2021). However, our world is vast and naturally open, and only evaluating adversarial robustness on the learned tasks is limited. Can we achieve zero-shot transferability for adversarial robustness, even if the model has never been trained on the unknown tasks? + +In this paper, we study this important yet under-explored problem, zero-shot adversarial robustness of large-scale vision-language models. We start our investigation with the state-of-the-art CLIP model (Radford et al., 2021), which has been shown to be effective in zero-shot recognition tasks. We find that simply adding an imperceptible vector to the image $(\leq 1/255)$ can subvert + +![](images/b10b899a31d0affb5e75ce34fac60caf93ea635584006b46bf998b86acc8ca2b.jpg) +(a) CLIP + +![](images/e3a05afe80f6580ed0727cbbeda2abe887ee7b21313c82d611ee9ae78b3f91b7.jpg) +(b) Adversarily Finetuned CLIP +Figure 1: (a, left) Despite CLIP's high performance on zero-shot image recognition tasks, it remains vulnerable when the input images are constructed adversarially. (b, right) Standard adversarial training improves robustness on the trained task (ImageNet), but comes at the expense of its zero-shot capability. Our paper studies how to adapt CLIP to achieve adversarial robustness on zero-shot tasks. + +CLIP's prediction (see Figure 1a). If we follow the standard adversarial training defense paradigm (Madry et al., 2018; Rice et al., 2020) to finetune CLIP on the ImageNet (Deng et al., 2009b) training set, we observe that the adapted CLIP has improved adversarial robustness on the ImageNet validation set, but comes at the cost of significantly reduced accuracy on unseen datasets and classes (Figure 1b). Standard adversarial training backfires on CLIP as it fails to retain the model's zero-shot generalization ability. + +Adaptation methods and training objectives are the two major factors for adapting a large-scale model. First, besides finetuning the whole model, we seek an alternative adaptation method—visual prompt tuning—which adapts the inputs instead of the parameters of the model. Visual prompt tuning (VPT) is an emerging light-weight adaptation method (Bar et al., 2022; Bahng et al., 2022) that learns a visual prompt which is added to the input image, where we use visual prompt to instruct the model to be robust against adversaries. Second, we find that the standard adversarial training objective ignores the visual-language alignment in CLIP's pretrained representation space, causing the model to lose zero-shot capability. We then propose a text-guided contrastive adversarial training (TeCoA) loss, dubbed as Tekoa (tee-kow), which maximizes the similarity of the adversarial visual features and the correct text embeddings with contrastive learning. Since the adapted visual features continue to align well with the text features, the model adapted with TeCoA can maximally retain the original zero-shot generalization of CLIP while enjoying improved adversarial robustness. + +We conduct an extensive evaluation on 15 zero-shot image datasets, offering a holistic study of the zero-shot adversarial robustness problem. This is especially important given that large-scale vision models are emerging as infrastructure and are deploying to critical applications. We find that the lightweight VPT is noticeably more effective than model finetuning when textual information is unavailable. When texts are used during adaptation, both VPT and finetuning using our TeCoA loss have drastically improved zero-shot adversarial robustness compared to baselines. Finetuning has higher gains than VPT as more parameters are tuned. Our best performing model with the TeCoA loss can improve adversarial robustness over CLIP by an average of $31\%$ across the datasets. Our method also works on unlabeled images, allowing for better robustness with a large amount of unlabeled data. Our work establish a new and important benchmark, zero-shot adversarial robustness, for future work to evaluate on. We release all models and code. + +# 2 RELATED WORK + +Zero-Shot Generalization aims to classify novel classes and tasks that are unseen during training (Palatucci et al., 2009; Lampert et al., 2009; Radford et al., 2021). Existing zero-shot methods often project visual features into semantic feature space (Frome et al., 2013; Akata et al., 2015; Romera-Paredes & Torr, 2015; Xie et al., 2019; Yu et al., 2018; Liu et al., 2019), or use generative methods to generate fake visual features of unseen classes from their semantic descriptions to train classifiers (Xian et al., 2018; Ni et al., 2019; Huang et al., 2019; Schonfeld et al., 2019; Verma et al., 2019; Liu et al., 2020). Recently, large-scale pretrained vision-language models (Radford et al., 2021; Jia et al., 2021) have shown outstanding zero-shot generalization ability on unseen tasks via text prompt engineering. Their adversarial robustness and its transferability, however, has not been studied in the zero-shot setting. + +Adversarial Robustness. Adversarial attacks for image recognition find an additive vector on the input to maximize the cross-entropy loss, which is calculated from the model prediction and the ground truth one-hot label (Szegedy et al. (2013); Athalye et al. (2018); Carlini & Wagner (2017); + +Kurakin et al. (2017); Papernot et al. (2015); Moosavi-Dezfooli et al. (2016)). Adversarial training (Madry et al., 2018) and its variants (Zhang et al., 2019; Rice et al., 2020), which train the model on generated adversarial examples, are effective in improving adversarial robustness on the task that they have been trained on. However, it is unclear whether this approach can improve robustness in the zero-shot scenario. To the best of our knowledge, Yucel et al. (2020) is so far the only work that studies the adversarial robustness of zero-shot learning models. Their setting is limited because it relies on predicting robust attributes, which may not be easily available for many tasks. + +Transferability of Robustness. Mao et al. (2020) shows that adversarial robustness is transferable across tasks when multiple tasks are trained together. Salman et al. (2020) shows that adversially robust models transfer better than their standard-trained counterparts when they are finetuned on other tasks. Chan et al. (2020) finds that matching a robust model's gradient can transfer robustness to a new model. Vaishnavi et al. (2022) proposes a low-cost method to transfer robustness to a new model on the same task with different architecture. However, the transferability of adversarial robustness to zero-shot tasks has not been investigated. + +Contrastive Learning (Oord et al., 2018) has been used to train large-scale image-language models (Jia et al., 2021; Radford et al., 2021). Kim et al. (2020); Jiang et al. (2020) propose instance-wise adversarial perturbation and use a contrastive loss to align the features of clean examples and generated adversarial examples. Our method is the first one to introduce a cross-modal image-text contrastive loss in adversarial contrastive learning. + +Adapting Pretrained Models. Linear probing and finetuning are the two major ways to adapt deep pretrained models. Recently, a more lightweight adaptation method, prompt tuning, has been proposed (Zhou et al., 2022c;b;a). Shu et al. (2022) shows that test-time optimization for text prompting helps generalization. Bar et al. (2022) combines target task and image inpainting to achieve zero-shot task inference. Jia et al. (2022); Sandler et al. (2022) used visual prompting to replace the finetuning procedure for large-scale models. Bahng et al. (2022) optimizes a visual prompt to increase the performance on the same task that the model finetunes the visual prompt on. Mao et al. (2021); Lawhon et al. (2022); Mao et al. (2022) find input prompt with self-supervised objective for robustness. Prompt tuning for continuous learning has also been proposed (Conder et al., 2022). Liu et al. (2022) proposes an amortized approach to use fewer iterations to adapt models. Wang et al. (2019) showed that it is useful in improving the performance for healthcare, and Liu et al. showed it can be used to adapt generative models for solving under constrained problems. However, adapting large-scale models for transferable zero-shot robustness, using methods such as finetuning or visual prompting, has not been investigated. + +# 3 MODEL ADAPTATION FOR ZERO-SHOT ADVERSARIAL ROBUSTNESS + +We first give background in Section 3.1 on adversarial attacks, adversarial training, and the problem setup. In Section 3.2, we discuss adaptation methods for adapting large-scale models for zero-shot adversarial robustness. Finally, Section 3.3, we discuss the effect of different training losses to motivate and then introduce our proposed text-guided contrastive adversarial training (TeCoA) loss. + +# 3.1 BACKGROUND AND PROBLEM SETUP + +Let $F_{\theta}(\cdot)$ be a deep model for image recognition parameterized by $\theta$ . Given an input image $\mathbf{x}$ , the model produces a representation $\hat{\mathbf{y}} = F_{\theta}(\mathbf{x})$ . For image classification, a standard model learns to minimize the cross-entropy loss, $\mathcal{L}(\mathbf{x},\mathbf{y}) = H(F_{\theta}(\mathbf{x}),\mathbf{y})$ , where the label $\mathbf{y}$ is often represented by a one-hot vector. + +Adversarial Attacks. An adversary (i.e., attacker) typically optimizes for an additive transformation $\delta$ to the image, $\mathbf{x}_a = \mathbf{x} + \delta$ , which can fool the model $F_{\theta}$ to make incorrect predictions: + +$$ +\mathbf {x} _ {a} = \underset {\mathbf {x} _ {a}} {\operatorname {a r g m a x}} \mathcal {L} (\mathbf {x} _ {a}, \mathbf {y}), \quad \text {s . t .} \quad \| \mathbf {x} _ {a} - \mathbf {x} \| _ {q} \leq \epsilon . \tag {1} +$$ + +Here, the magnitude of the added pattern is bounded by a $q$ -norm ball of radius $\epsilon$ , making the attack perceptually invisible. The role of a defender is to find ways to correct the influence of the attacks and ensure that the model is robust to the adversarial perturbations. + +![](images/bf8508adadbdb9a4b0f7531294680c8a138b16298c6c157f4ab65e5438dfde90.jpg) +Figure 2: Adaptation methods for large-scale pretrained CLIP model for zero-shot adversarial robustness. (a) Linear probes that adapt the readout layer. (b) Partial finetuning that only updates the last few layers of the model. (c) Finetuning the whole model. (d) Adding visual prompting to the input image. (e) Appending visual prompt tokens to the input token sequence. + +Zero-Shot Adversarial Robustness. Large-scale vision-language models generalize well to new tasks and datasets at test time. However, the zero-shot transferability of adversarial robustness of these models is less explored. In our zero-shot adversarial robustness setup, we study the worst case: we assume that the attacker has the significant advantage of unrestricted access to the ground truth of new tasks at test time, while the defender has no access. While the attacker can directly optimize for an attacked image that fools the model, the defender needs to be robust on all kinds of unseen data and tasks. Compared to the commonly-used robustness setting, which only evaluates robustness on the trained task, our setup is more challenging. + +Adversarial Training is the common strategy to improve a model's adversarial robustness. By retraining the model on mined adversarial examples, the model is incentivized to learn features invariant under adversarial transformations. The defender often optimizes for the objective + +$$ +\theta = \underset {\theta} {\operatorname {a r g m i n}} \mathcal {L} \left(F _ {\theta} \left(\mathbf {x} _ {a}\right), \mathbf {y}\right), \tag {2} +$$ + +so that the model $F_{\theta}$ still makes correct predictions on the generated adversarial examples. As shown in Figure 1, the vanilla adversarial training approach is effective on seen tasks but fails when the model is evaluated on attacked data from unseen tasks. + +# 3.2 ADAPTING THE LARGE-SCALE MODELS + +One of the key advantages of large-scale pretrained models is that the features of these models are generalizable to various tasks without full retraining. Thus, we would like to make a lightweight adjustment to the models with a small set of training data of attacked images on known tasks, and maximally retain the zero-shot generalization ability of these large models while improving their adversarial robustness on new tasks. We adopt CLIP, one of the best performing vision-language models for zero-shot recognition, as our base model, and investigate a few adaptation strategies as shown in Figure 2 to improve the zero-shot adversarial robustness of CLIP. + +Finetuning (FT). A typical way to adapt a pretrained model, finetuning, is to update the parameters of the model either entirely or partially. While this approach improves model robustness on the target distribution, Radford et al. (2021) and Pham et al. (2021) show that this improvement often comes at a cost of generalization; directly modifying model parameters may lead to a higher tendency towards overfitting. + +Visual Prompting (VP). Recently, visual prompt tuning has emerged as a lightweight approach for adapting pretrained large-scale models. Originating from the natural language processing community, the key idea of prompt tuning is to identify prompts to decorate the inputs that effectively query the pretrained models. The computer vision community recently adopted this idea and is starting to explore approaches that can modify input images in pixel space to better adapt large-scale vision + +![](images/f05de62978fcaeb015cd638b22f7cf27b2290eceaa7acd7586c32fe12401fc4d.jpg) +Figure 3: Text-Guided Contrative Adversarial Learning. Instead of using one-hot embedding based supervision, we use adversarial contrastive learning with language supervision, which achieves better zero-shot robustness transferability. + +models for downstream tasks. For transformer-based models, visual prompting methods either learn a token that is appended to the input token sequences (Bar et al., 2022) or learn a direct modification to the input images (Bahng et al., 2022) for adaptation, as shown by (d,e) in Figure 2. + +In our study, we conduct an extensive analysis over both adaptation methods to better understand adapting large-scale models for zero-shot adversarial robustness. + +# 3.3 TEXT-GUIDED ADVERSARIAL CONTRASTIVE ADVERSARIAL TRAINING + +Through our initial experiments, we conjecture that the training objective might play a key role in improving the zero-shot adversarial robustness of the models. Radford et al. (2021) indicates that the zero-shot generalization ability of large-scale vision-language models may come from their language supervision. For example, CLIP learns a joint visual-and-text feature space, which helps zero-shot generalization at test time. If we simply finetune the visual encoder with one-hot labels, it may break the joint feature space and harm this zero-shot generalization ability. These observations motivate us to consider using the text information when generating the adversarial examples and also in the training objective during model adaptation. + +We now introduce the Text-guided Contrastive Adversarial (TeCoA) training loss, to effectively incorporate text information. In contrast to prior contrastive learning which does image-to-image contrastive learning (Jiang et al., 2020; Kim et al., 2020), we consider a cross-modal text-to-image contrastive learning paradigm. We first generate a set of adversarial examples conditioned on the text inputs which are targeted to fool the model about the correspondence between image features and text embeddings. TeCoA then tries to minimize the feature distance between the attacked image and the correct corresponding text inputs contrastively (Figure 3). We provide additional discussion of this text-image contrastive objective in Appendix A.5. + +Concretely, given a set of image and text pairs $\{(\mathbf{x}_i,\mathbf{t}_i)\}$ , we use the pretrained CLIP model to encode each pair with an image encoder $F_{\theta}$ and a text encoder $T$ . We then have the following image-to-text contrastive loss function, + +$$ +\mathcal {L} _ {s} (\mathbf {x}, \mathbf {t}, \mathbf {y}) = - \mathbb {E} _ {i, j} \left[ \mathbf {y} _ {i j} \log \frac {\exp \left(\cos \left(\mathbf {z} _ {i} ^ {(I)} , \mathbf {z} _ {j} ^ {(T)}\right) / \tau\right)}{\sum_ {k} \exp \left(\cos \left(\mathbf {z} _ {i} ^ {(I)} , \mathbf {z} _ {k} ^ {(T)}\right) / \tau\right)} \right], \tag {3} +$$ + +where the $\mathbf{z}_i^{(I)} = F_\theta (\mathbf{x}_i)$ are the features of the input image, and $\mathbf{z}_i^{(T)} = T(\mathbf{t}_i)$ are the features from the input text. We use $\mathbf{y}_{ij}$ to indicate which image-text pairs are positive and which are negative; this indicator satisfies $\mathbf{y}_{ij} = 1$ if and only if the examples $i = j$ , and 0 otherwise. $\tau$ is a scalar hyper-parameter, and cos denotes the cosine similarity function. + +Constructing Adversarial Examples for Image-Text Pair. Instead of maximizing the standard cross-entropy loss, we maximize the image-text contrastive loss given a batch of natural images $\mathbf{x}$ and text $\mathbf{t}$ : + +$$ +\mathbf {x} _ {a} = \underset {\mathbf {x} _ {a}} {\operatorname {a r g m a x}} \mathcal {L} _ {s} (\mathbf {x} _ {a}, \mathbf {t}, \mathbf {y}), \quad \text {s . t .} \quad \| \mathbf {x} _ {a} - \mathbf {x} \| _ {q} < \epsilon . \tag {4} +$$ + +Here, for image $\mathbf{x}_i$ in the batch, the associated text $\mathbf{t}_i$ can be its natural label text or constructed via the standard prompts for the zero-shot tasks (e.g., "a photo of a [LABEL]") The indicator $\mathbf{y}_{ij} = 1$ when image $\mathbf{x}_i$ has category $j$ as its ground-truth class, and 0 otherwise. In practice, we find this objective is effective at generating adversarial examples for zero-shot image recognition tasks. + +Text-Guided Contrastive Adversarial Training. Once we have the adversarial examples, we optimize the parameters $\theta$ of the vision encoder $F_{\theta}$ to minimize the aforementioned objective (Equa + +tion 8) on the generated adversarial examples, + +$$ +\theta = \underset {\theta} {\operatorname {a r g m i n}} \mathcal {L} _ {s} \left(\mathbf {x} _ {a}, \mathbf {t}, \mathbf {y}\right). \tag {5} +$$ + +Our algorithm iteratively alternates between generating adversarial examples and updating the model via Equation 5. Since TeCoA uses additional information from the text embeddings to correct the visual features corrupted by the adversarial attacks, it helps the model to retain zero-shot transferability regarding adversarial robustness. + +Contrastive Adversarial Training without Text. To validate whether the gain of zero-shot robustness comes from language supervision or is due to the formulation of the contrastive loss itself, we consider two variants of contrastive losses which do not utilize languages in our experiments. One is a contrastive adversarial training loss with one-hot labels (CoAdv.), where the label information is encoded as a one-hot vector and is used to contrast with the image features. Another is based on Jiang et al. (2020), where the model is finetuned on adversarial examples to fool the image-to-image contrastive loss, denoted as ImgCoAdv. More details are presented in Section 4. + +# 4 EXPERIMENTS + +We start by describing our experiment setups and present the experimental results of 16 datasets in Section 4.1. We observe that CLIP adapted with TeCoA achieves an average of 31 points improvement across the datasets over the original CLIP model. In Section 4.2, we provide extensive analysis over the design choices involved in our approach and identify that the use of language in TeCoA largely improves the model's zero-shot adversarial robustness. + +Datasets. We evaluate the zero-shot adversarial robustness conferred by TeCoA trained on ImageNet (Deng et al., 2009a) and report the performance of the models on the ImageNet test set as well as 15 zero-shot test datasets, covering a diverse range of recognition tasks. Specifically, we include CIFAR10, CIFAR100 (Krizhevsky et al., 2009), STL10 (Coates et al., 2011), Caltech101 (Fei-Fei et al., 2004), and Caltech256 (Griffin et al., 2007) for generic classification; OxfordPets (Parkhi et al., 2012), StanfordCars (Krause et al., 2013), Food101 (Bossard et al., 2014), Flowers102 (Nilsback & Zisserman, 2008), and FGVCAircraft (Maji et al., 2013) for fine-grained classification; SUN397 (Xiao et al., 2010) for scene recognition; and DTD (Cimpoi et al., 2014) for texture recognition. Finally, we include three datasets with domain-specialized tasks, PatchCamelyon (PCAM, lymph node tumor detection) (Veeling et al., 2018), Hateful Memes (hatespeech detection) (Kiela et al., 2020), and EuroSAT (satellite image classification) (Helber et al., 2017). + +Baselines. We consider multiple variants to adapt CLIP (Radford et al., 2021). For adaptation methods, we consider visual prompting (VP) (Bahng et al., 2022), linear probing (LP) and finetuning (FT). Since LP involves training a linear readout layer on the target task, it is not zero-shot, but we still evaluate it for reference. For training losses, we consider + +(1) vanilla cross-entropy loss (CE); +(2) standard adversarial training loss (Adv.) with the cross-entropy loss; +(3) contrastive adversarial training loss (CoAdv.); +(4) contrastive adversarial training over images (ImgCoAdv.); +(5) our text-guided contrastive adversarial training (TeCoA). + +In our experiments, we name these variants by adaptation (loss). Detailed formulations and associated training algorithms for each loss can be found in Section A.3. + +Implementation Details. We use CLIP-B/32 architecture. We optimize the model using an SGD optimizer with momentum 0.9. We train for 10 epochs. For finetuning, we use a learning rate of $1e - 5$ . For visual prompt tuning, we use a learning rate of 40 and a batch size of 256. For prompt tuning on the entire ImageNet dataset, we use token-level prompt with size 200, while for subsets of ImageNet (1K, 5K, and 50K images), we use token-level prompt with size 5 and a smaller batch size of 64. Unless specified, during adversarial training, we generate $L_{\mathrm{inf}} = 1 / 255$ bounded attacks using a 2-step PGD attack (Madry et al., 2018) with step size $\alpha = 1 / 255$ . We test the robustness of our model using 100 steps of PGD attack, with step size $\alpha = 1 / 255$ . + +Table 1: Zero-shot robust accuracies on images attacked with 100 steps of PGD. We show the test accuracy for 16 tasks (columns) and 12 different methods (rows). We show the average performance of each method in the last column. The best accuracies are bolded. Standard adversarial finetuning achieves the highest robust accuracy on ImageNet, but this gain comes at the cost of losing robustness on other zero-shot tasks. Adversarial visual prompting improves the average robustness from 10.6 to 31.8. Adding TeCoA with language supervision improves the robustness for both visual prompting and finetuning, where finetuning with TeCoA achieves the best overall robustness, outperforming vanilla CLIP by 31 points. + +
MethodDATASETS
ImageNetCIFAR10STL-10CIFAR100SUNStanfordCarsFood101OxfordPetFlower102DTDEUROSATFGVCHateMemesPCAMCaltech101Caltech256Average
CLIP1.729.5735.404.551.020.273.952.721.192.50.040.002.200.1024.6315.276.57
+VPT (CE)2.2713.2540.745.591.600.214.213.241.773.560.010.002.470.2128.4617.177.79
+LP (CE)5.7822.0736.5216.0212.110.205.6250.000.000.006.060.0044.5350.1136.7220.1216.00
+FT (CE)9.1327.6061.338.504.741.1210.1325.815.582.610.520.001.071.1544.9835.4414.98
+VPT (Adv.)17.5045.3972.5222.1018.159.6516.0244.5325.0620.272.123.3954.3052.5761.9344.0631.84
+VPT (CoAdv.)17.2040.7272.1120.5318.0110.2615.0442.7122.1521.652.802.7926.5713.6962.0343.2326.97
+VPT (ImgCoAdv.)1.078.3517.442.122.580.030.943.541.947.390.100.036.3714.9614.386.915.51
VPT (TeCoA)23.7149.1875.5425.8224.8710.9120.1048.5723.7321.1111.264.0531.1330.5063.7947.6632.00
+FT(Adv.)45.1211.0425.901.510.520.250.5620.400.112.773.620.4823.1224.866.682.9210.62
+FT (CoAdv.)33.412.515.920.400.010.140.090.190.470.216.620.4230.244.70.060.087.83
+FT (ImgCoAdv.)0.034.003.760.370.120.050.170.570.210.964.130.1832.9326.410.330.184.65
FT (TeCoA)41.8859.2883.4534.1329.8113.3727.9962.6130.6922.8815.185.1031.9723.8769.0759.5438.18
+ +![](images/2861a28d617695a5ea80284f81e2a454b3d806cf92c41592d5adfc99ce53b6cb.jpg) + +![](images/7ea0efd3d8ea557e304c6348e3b608e21cbb511d0ada7221507aa8ea7279d4bf.jpg) + +![](images/aecfef40a91a3ffd1b8dd18692d0d3a10f4732b5e0f171e38a23ecc59b0046b4.jpg) +Figure 4: Effect of training set size. We consider several setups where only a restricted number of samples from each training class are available during adversarial training with TeCoA. Training on more data in general improves zero-shot robustness, but not affect clean performance much. + +![](images/ca8d8afa7a24fc932837c54bf538741d7facb102b4669f079900484018cb9137.jpg) + +# 4.1 EXPERIMENTAL RESULTS + +We first use PGD attack with 100 steps to evaluate the robustness of CLIP models that are adapted on ImageNet. In Table 1, we show the robust accuracies for the models on the Imagenet test set and 15 zero-shot recognition tasks (i.e., the training classes and test classes are non-overlapping). Each row is the robust accuracy for one method, where we compare the proposed TeCoA with VP and FT against 10 baselines and their variants. We bold the best results for each dataset (column). + +From Table 1, we can see that most adapted models with adversarial training losses except for ImgCoAdv. have better robust accuracies compared to the standard cross-entropy loss. If using adversarial training, the vanilla FT (Adv.), which finetunes the entire model with adversarial training, achieves the best adversarial robustness on ImageNet (non zero-shot data, same as the training tasks) while the average robust accuracy is $10.62\%$ , which is only slightly better than the original CLIP $(6.57\%)$ . In the meantime, VP (Adv.) achieves much better results, improving the + +![](images/95ead3da52f6a08c06dbadf0b7cc7e25aad0ad0cd7a98e2a8ab959bc857c32dd.jpg) +Figure 5: Zero-shot adversarial robustness under different perturbation bounds ( $\epsilon = 1,2,4/255$ ). We vary the perturbation bound for adversarial finetuning with TeCoA. Each adapted model is evaluated under attacks from the same bound seen during training. We show both the robust accuracy (left) and clean accuracy (right). Our defense is still effective on zero-shot tasks when the perturbation gets larger. + +![](images/af21fb96c70dbacc63bba9ba37a67296196d09709545ee141b108fa774fc7e06.jpg) + +![](images/19bb38c51f2d7b98b81dea7f54f5d8fcc7b374ef43bbffd7b6546327dac751d3.jpg) +(a) Visual Prompt Design +Figure 6: (a, left) We conduct an ablation study of whether to add visual prompt to the input image or to append prompt token to the input sequence. (b, right) We optimize the same amount of parameters in partial finetuning and VP, we find VP is more effective when only a small number of parameters are optimized. + +![](images/dd310b9b29725095e3b3aa3d14d18e75960033516997064f0314b2fa69d99db9.jpg) +(b) Partially FT vs. VP + +accuracy number from $6.57\%$ to $31.84\%$ . This indicates that visual prompting is more powerful than finetuning when coupled with the standard adversarial training. + +Within each set of the variants using the same adaptation method, we compare the effectiveness of different training losses. We notice that both CoAdv. and ImgCoAdv. are much worse than the proposed TeCoA and even the standard adversarial training (Adv.). This indicates that the formulation of contrastive learning may not necessarily help improve the zero-shot adversarial robustness and the use of the language supervision might. + +Overall, we find that adapting CLIP with TeCoA using model finetuning presents the best performance across the datasets, improving the accuracy number from $6.57\%$ to $38.18\%$ , roughly 31 points. This might look counter-intuitive as VP significantly outperforms FT under the standard adversarial training without texts. One hypothesis is that with sufficient semantic information at test time, finetuning that directly modifies the model parameters may be more expressive than just modifying the inputs given more model parameters are tuned. In Table 3 in Appendix, we show the clean accuracy of the same models, which gives similar trend as the robust accuracies. We also show results under $\epsilon = 1/255$ and $\epsilon = 4/255$ using AutoAttack Croce & Hein (2020) in Table 4 and Table 5, where our model is still more robust than baselines, up to an average of 36 points. We describe details in Section A.2. + +# 4.2 ANALYSIS + +Training Set Size is an important factor when adapting large-scale models. In Figure 4, we show the results of adapting CLIP with TeCoA with 1, 5, 50, and 1000 shot per category on ImageNet. We observe that increasing the amount of training data improves robust accuracy. Moreover, we also find that FT (TeCoA) outperforms the non-adapted CLIP even when the model is adapted with just one shot per class (the blue bars in Figure 4). + +Effect of Attack Strength. To validate whether our method works when the adversarial perturbations become larger, we increase the perturbation bound for our TeCoA adversarial training. Figure 5 shows that, while increasing the attack strength decreases the robust accuracy, our model can still transfer robustness to zero-shot tasks. + +Visual Prompt Designs. There are two ways to design visual prompts. One is to append additional tokens to image tokens and the other is to add small decoration (i.e., learnable noises) to the in- + +![](images/6361eb389cf312072de4dfcfecf24d3f1c529844f00ae5228906eee76ce266ad.jpg) +Figure 7: Balancing model robustness and clean accuracy via weight interpolation. By changing the interpolation ratio for the adapted CLIP and vanilla CLIP weights, we can dynamically improve clean accuracy or robust accuracy. There is a win-win sweet spot, indicated by the star, where we improves on both zero-shot robust accuracy and zero-shot clean accuracy. + +![](images/4f1b3e62740989c490a7603eb9014e88a857feb955dae84e2ec126ceca312c7e.jpg) + +![](images/fba5c582cdfe981f5cc062b7819a71a6a3e33e909808dd67dfcaf600863b5acd.jpg) + +![](images/9bd5d500aa010e23ad114f464301a18ef16484304abea048c9d6f6b732f7ba3a.jpg) + +Table 2: Are labels required to adapt large-scale models for zero-shot adversarial robustness? We find we can achieve similar zero-shot adversarial robustness by adapting the model on unlabeled data using our algorithm. + +
MethodLabeled?DatasSETS
ImageNetCIFAR10STL-10CIFAR100SUNStanfordCarsFood101OxfordPetFlower102DTDEUROSATFGVCHateMemesPCAMCaltech101Caltech256Average
VPT (TeCoA) Robust AccuracyYes23.7149.1875.5425.8224.8710.9120.1048.5723.7321.1111.264.0531.1330.5063.7947.6632.00
VPT (TeCoA) Robust AccuracyNo23.7948.7375.4324.8322.5812.0520.3847.2624.5421.2212.493.4826.4040.2265.5549.4132.40
VPT (TeCoA) Clean AccuracyYes48.8471.6391.5940.9650.9733.5052.4179.0745.7831.8615.9312.2458.5347.8595.1971.6653.00
VPT (TeCoA) Clean AccuracyNo59.1170.6591.3139.4147.2737.8755.3978.2546.1732.4419.4712.6955.8349.6086.3473.6053.46
FT (TeCoA) Robust AccuracyYes41.8859.2883.4534.1329.8113.3727.9962.6130.6922.8815.185.1031.9723.8769.0759.5438.18
FT (TeCoA) Robust AccuracyNo38.7660.9079.4131.5630.3313.8727.7258.8429.4822.5011.675.1029.9719.1467.4959.4136.63
FT (TeCoA) Clean AccuracyYes63.8778.1293.3049.6851.2833.3055.3781.5850.9234.1527.5713.8953.4749.0183.5176.5155.97
FT (TeCoA) Clean AccuracyNo58.8780.5191.1849.0854.9339.3959.1477.6250.7934.2026.1314.5252.1052.9781.3977.9356.30
+ +put images. From Figure 6a, we can see appending learnable tokens in the input token sequences achieves consistently better performance than just adding the prompt value to the images. + +Number of Adapted Parameters. The number of parameters that are adapted during training highly affects model performance. VP is light-weight, as it only modifies the inputs, while FT may either adjust part of the model or the entire model. In Figure 6b, we show the comparison of partially finetuning and visual prompting of CLIP. We can see that with the same amount of parameters adapted, visual prompting is more effective in adapting the large scale model for zero-shot adversarial robustness. + +Are Labels Required for Adapting CLIP? Unlabeled data is rich. We investigate if it's necessary to use the groundtruth labels from images. We generate the pseudo text labels that CLIP retrieves from clean images, where we show details in Section A.3.5. We then run our TeCoA on the pseudo labels in the same way as the labelled data. We show experimental results in Table 2, where we obtain a similar zero-shot robust accuracy even without labels. + +Trading off between Robust Accuracy and Clean Accuracy. Similar to typical adversarial training, TeCoA also poses a trade-off between the clean accuracy and the robust accuracy Tsipras et al. (2019). Ideally, we want to be able to dynamically adjust this trade-off depending on the desired level of adversarial robustness. Here we can balance this trade-off by using model weights interpolation (Wortsman et al., 2022). In Figure 7, we can see there is a sweet spot in interpolating the model where we improve both the robustness and clean accuracy, marked by the star in the figure. + +# 5 CONCLUSION + +In this paper, we provided a holistic study of the zero-shot adversarial robustness problem of large-scale vision-language models. We identified the effects of various adaption methods and training losses when adapting models, and conjectured that existing methods failed to generalize to new tasks due to the lack of the language supervision. We proposed a text-guided contrastive adversarial training (TeCoA) which can be used with model finetuning and visual prompting to drastically improve the zero-shot adversarial robustness of CLIP. Extensive experimental evaluation showed the effectiveness of TeCoA, and the detailed analyses provide useful lessons for adapting large-scale models to improve their zero-shot adversarial robustness, shedding light on this important problem. + +# 6 ACKNOWLEDGEMENT + +This research is based on work partially supported by the DARPA SAIL-ON program, the DARPA MCS program, the NSF NRI Award #2132519, a GE/DARPA grant, a CAIT grant, and gifts from JP Morgan, DiDi, and Accenture. + +# REFERENCES + +Michael Ahn, Anthony Brohan, Noah Brown, Yevgen Chebotar, Omar Cortes, Byron David, Chelsea Finn, Keerthana Gopalakrishnan, Karol Hausman, Alex Herzog, et al. Do as i can, not as i say: Grounding language in robotic affordances. arXiv preprint arXiv:2204.01691, 2022. +Zeynep Akata, Scott E. Reed, Daniel Walter, Honglak Lee, and Bernt Schiele. Evaluation of output embeddings for fine-grained image classification. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2015, Boston, MA, USA, June 7-12, 2015, pp. 2927-2936. IEEE Computer Society, 2015. doi: 10.1109/CVPR.2015.7298911. URL https://doi.org/10.1109/CVPR.2015.7298911. +Anish Athalye, Nicholas Carlini, and David Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. In Proceedings of the 35th International Conference on Machine Learning, volume 80, pp. 274-283. PMLR, 2018. +H Bahng, A Jahanian, S Sankaranarayanan, and P Isola. Exploring visual prompts for adapting large-scale models. arXiv preprint arXiv:2203.17274, pp. 2022, 2022. +Amir Bar, Yossi Gandelsman, Trevor Darrell, Amir Globerson, and Alexei A. Efros. Visual prompting via image inpainting. arXiv preprint arXiv:2209.00647, 2022. +Lukas Bossard, Matthieu Guillaumin, and Luc Van Gool. Food-101-mining discriminative components with random forests. In European conference on computer vision, pp. 446-461. Springer, 2014. +Nicholas Carlini and David A. Wagner. Towards evaluating the robustness of neural networks. In 2017 IEEE Symposium on Security and Privacy, pp. 39-57, 2017. +Alvin Chan, Yi Tay, and Yew-Soon Ong. What it thinks is important is important: Robustness transfers through input gradients. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 332-341, 2020. +M. Cimpoi, S. Maji, I. Kokkinos, S. Mohamed, , and A. Vedaldi. Describing textures in the wild. In Proceedings of the IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2014. +Adam Coates, Andrew Ng, and Honglak Lee. An analysis of single-layer networks in unsupervised feature learning. In Proceedings of the fourteenth international conference on artificial intelligence and statistics, pp. 215-223. JMLR Workshop and Conference Proceedings, 2011. +Jonathan Conder, Josephine Jefferson, Khurram Jawed, Alireza Nejati, Mark Sagar, et al. Efficient transfer learning for visual tasks via continuous optimization of prompts. In International Conference on Image Analysis and Processing, pp. 297-309. Springer, 2022. +Francesco Croce and Matthias Hein. Reliable evaluation of adversarial robustness with an ensemble of diverse parameter-free attacks. In ICML, 2020. +J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. ImageNet: A Large-Scale Hierarchical Image Database. In CVPR09, 2009a. +Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248-255. IEEE, 2009b. +Yinpeng Dong, Fangzhou Liao, Tianyu Pang, Hang Su, Jun Zhu, Xiaolin Hu, and Jianguo Li. Boosting adversarial attacks with momentum. In CVPR, pp. 9185-9193, 2018. + +Li Fei-Fei, Rob Fergus, and Pietro Perona. Learning generative visual models from few training examples: An incremental bayesian approach tested on 101 object categories. Computer Vision and Pattern Recognition Workshop, 2004. +Andrea Frome, Greg S Corrado, Jon Shlens, Samy Bengio, Jeff Dean, Marc Aurelio Ranzato, and Tomas Mikolov. Devise: A deep visual-semantic embedding model. In C.J. Burges, L. Bottou, M. Welling, Z. Ghahramani, and K.Q. Weinberger (eds.), Advances in Neural Information Processing Systems, volume 26. Curran Associates, Inc., 2013. URL https://proceedings.neurips.cc/paper/2013/file/7cce53cf90577442771720a370c3c723-Paper.pdf. +Gregory Griffin, Alex Holub, and Pietro Perona. Caltech-256 object category dataset. 2007. +Patrick Helber, Benjamin Bischke, Andreas Dengel, and Damian Borth. Eurosat: A novel dataset and deep learning benchmark for land use and land cover classification, 2017. +He Huang, Changhu Wang, Philip S. Yu, and Chang-Dong Wang. Generative dual adversarial network for generalized zero-shot learning. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2019, Long Beach, CA, USA, June 16-20, 2019, pp. 801-810. Computer Vision Foundation / IEEE, 2019. doi: 10.1109/CVPR.2019.00089. URL http://openaccess.thecvf.com/content_CVPR_2019/html/Huang_Generative_Dual_Adversarial_Network_for_Generational_Zero-Shot_Learning_CVPR_2019_paper.html. +Chao Jia, Yinfei Yang, Ye Xia, Yi-Ting Chen, Zarana Parekh, Hieu Pham, Quoc Le, Yun-Hsuan Sung, Zhen Li, and Tom Duerig. Scaling up visual and vision-language representation learning with noisy text supervision. In International Conference on Machine Learning, pp. 4904-4916. PMLR, 2021. +Menglin Jia, Luming Tang, Bor-Chun Chen, Claire Cardie, Serge Belongie, Bharath Hariharan, and Ser-Nam Lim. Visual prompt tuning. arXiv preprint arXiv:2203.12119, 2022. +Ziyu Jiang, Tianlong Chen, Ting Chen, and Zhangyang Wang. Robust pre-training by adversarial contrastive learning. Advances in Neural Information Processing Systems, 33:16199-16210, 2020. +Douwe Kiela, Hamed Firooz, Aravind Mohan, Vedanuj Goswami, Amanpreet Singh, Pratik Ringshia, and Davide Testuggine. The hateful memes challenge: Detecting hate speech in multimodal memes. Advances in Neural Information Processing Systems, 33:2611-2624, 2020. +Minseon Kim, Jihoon Tack, and Sung Ju Hwang. Adversarial self-supervised contrastive learning. Advances in Neural Information Processing Systems, 33:2983-2994, 2020. +Jonathan Krause, Michael Stark, Jia Deng, and Li Fei-Fei. 3d object representations for fine-grained categorization. In 4th International IEEE Workshop on 3D Representation and Recognition (3dRR-13), Sydney, Australia, 2013. +Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009. +Alexey Kurakin, Ian J. Goodfellow, and Samy Bengio. Adversarial examples in the physical world. CoRR, abs/1607.02533, 2017. +Christoph H. Lampert, Hannes Nickisch, and Stefan Harmeling. Learning to detect unseen object classes by between-class attribute transfer. In 2009 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR 2009), 20-25 June 2009, Miami, Florida, USA, pp. 951-958. IEEE Computer Society, 2009. doi: 10.1109/CVPR.2009.5206594. URL https://doi.org/10.1109/CVPR.2009.5206594. +Matthew Lawhon, Chengzhi Mao, and Junfeng Yang. Using multiple self-supervised tasks improves model robustness. arXiv preprint arXiv:2204.03714, 2022. + +Bo Liu, Qiulei Dong, and Zhanyi Hu. Zero-shot learning from adversarial feature residual to compact visual feature. In The Thirty-Fourth AAAI Conference on Artificial Intelligence, AAAI 2020, The Thirty-Second Innovative Applications of Artificial Intelligence Conference, IAAI 2020, The Tenth AAAI Symposium on Educational Advances in Artificial Intelligence, EAAI 2020, New York, NY, USA, February 7-12, 2020, pp. 11547-11554. AAAI Press, 2020. URL https://ojs.aaai.org/index.php/AAAI/article/view/6821. +Ruoshi Liu, Sachit Menon, Chengzhi Mao, Dennis Park, Simon Stent, and Carl Vondrick. Shape analysis by shadow synthesis. +Ruoshi Liu, Chengzhi Mao, Purva Tendulkar, Hao Wang, and Carl Vondrick. Landscape learning for neural network inversion. arXiv e-prints, pp. arXiv-2206, 2022. +Yang Liu, Jishun Guo, Deng Cai, and Xiaofei He. Attribute attention for semantic disambiguation in zero-shot learning. In 2019 IEEE/CVF International Conference on Computer Vision, ICCV 2019, Seoul, Korea (South), October 27 - November 2, 2019, pp. 6697-6706. IEEE, 2019. doi: 10.1109/ICCV.2019.00680. URL https://doi.org/10.1109/ICCV.2019.00680. +Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In ICLR, 2018. +S. Maji, J. Kannala, E. Rahtu, M. Blaschko, and A. Vedaldi. Fine-grained visual classification of aircraft. Technical report, 2013. +Chengzhi Mao, Ziyuan Zhong, Junfeng Yang, Carl Vondrick, and Baishakhi Ray. Metric learning for adversarial robustness. In Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019. +Chengzhi Mao, Amogh Gupta, Vikram Nitin, Baishakhi Ray, Shuran Song, Junfeng Yang, and Carl Vondrick. Multitask learning strengthens adversarial robustness. In Andrea Vedaldi, Horst Bischof, Thomas Brox, and Jan-Michael Frahm (eds.), Computer Vision - ECCV 2020, pp. 158-174, Cham, 2020. Springer International Publishing. +Chengzhi Mao, Mia Chiquier, Hao Wang, Junfeng Yang, and Carl Vondrick. Adversarial attacks are reversible with natural supervision. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 661-671, 2021. +Chengzhi Mao, Lingyu Zhang, Abhishek Joshi, Junfeng Yang, Hao Wang, and Carl Vondrick. Robust perception through equivariance, 2022. URL https://arxiv.org/abs/2212.06079. +Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, and Pascal Frossard. Deepfool: a simple and accurate method to fool deep neural networks, 2016. +Jian Ni, Shanghang Zhang, and Haiyong Xie. Dual adversarial semantics-consistent network for generalized zero-shot learning. In Hanna M. Wallach, Hugo Larochelle, Alina Beygelzimer, Florence d'Alché-Buc, Emily B. Fox, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pp. 6143-6154, 2019. URL https://proceedings.neurips.cc/paper/2019/hash/c46482dd5d39742f0bfd417b492d0e8e-Abstract.html. +Maria-Elena Nilsback and Andrew Zisserman. Automated flower classification over a large number of classes. In 2008 Sixth Indian Conference on Computer Vision, Graphics & Image Processing, pp. 722-729. IEEE, 2008. +Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018. +Mark Palatucci, Dean Pomerleau, Geoffrey E Hinton, and Tom M Mitchell. Zero-shot learning with semantic output codes. In Y. Bengio, D. Schuurmans, J. Lafferty, C. Williams, and A. Culotta (eds.), Advances in Neural Information Processing Systems, volume 22. Curran Associates, Inc., 2009. URL https://proceedings.neurips.cc/paper/2009/file/1543843a4723ed2ab08e18053ae6dc5b-Paper.pdf. + +Tianyu Pang, Xiao Yang, Yinpeng Dong, Hang Su, and Jun Zhu. Bag of tricks for adversarial training, 2020. +Nicolas Papernot, Patrick D. McDaniel, Somesh Jha, Matt Fredrikson, Z. Berkay Celik, and Ananthram Swami. The limitations of deep learning in adversarial settings. arXiv:1511.07528, 2015. +Omkar M Parkhi, Andrea Vedaldi, Andrew Zisserman, and CV Jawahar. Cats and dogs. In 2012 IEEE conference on computer vision and pattern recognition, pp. 3498-3505. IEEE, 2012. +Anibal Pedraza, Oscar Deniz, and Gloria Bueno. On the relationship between generalization and robustness to adversarial examples. Symmetry, 13(5):817, 2021. +Hieu Pham, Zihang Dai, Golnaz Ghiasi, Hanxiao Liu, Adams Wei Yu, Minh-Thang Luong, Mingxing Tan, and Quoc V Le. Combined scaling for zero-shot transfer learning. arXiv preprint arXiv:2111.10050, 2021. +Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In International Conference on Machine Learning, pp. 8748-8763. PMLR, 2021. +Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, and Mark Chen. Hierarchical text-conditional image generation with clip latents. arXiv preprint arXiv:2204.06125, 2022. +Leslie Rice, Eric Wong, and J. Zico Kolter. Overfitting in adversarially robust deep learning, 2020. +Bernardino Romera-Paredes and Philip H. S. Torr. An embarrassingly simple approach to zero-shot learning. In Francis R. Bach and David M. Blei (eds.), Proceedings of the 32nd International Conference on Machine Learning, ICML 2015, Lille, France, 6-11 July 2015, volume 37 of JMLR Workshop and Conference Proceedings, pp. 2152-2161. JMLR.org, 2015. URL http://proceedings.mlr.press/v37/romera-paredes15.html. +Hadi Salman, Andrew Ilyas, Logan Engstrom, Ashish Kapoor, and Aleksander Madry. Do adversarially robust imagenet models transfer better? Advances in Neural Information Processing Systems, 33:3533-3545, 2020. +Mark Sandler, Andrey Zhmoginov, Max Vlademyrov, and Andrew Jackson. Fine-tuning image transformers using learnable memory. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 12155-12164, 2022. +Edgar Schonfeld, Sayna Ebrahimi, Samarth Sinha, Trevor Darrell, and Zeynep Akata. Generalized zero-and few-shot learning via aligned variational autoencoders. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 8247-8255, 2019. +Manli Shu, Weili Nie, De-An Huang, Zhiding Yu, Tom Goldstein, Anima Anandkumar, and Chaowei Xiao. Test-time prompt tuning for zero-shot generalization in vision-language models, 2022. URL https://arxiv.org/abs/2209.07511. +David Stutz, Matthias Hein, and Bernt Schiele. Disentangling adversarial robustness and generalization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2019. +Dong Su, Huan Zhang, Hongge Chen, Jinfeng Yi, Pin-Yu Chen, and Yupeng Gao. Is robustness the cost of accuracy? a comprehensive study on the robustness of 18 deep image classification models. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 631-648, 2018. +Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian J. Goodfellow, and Rob Fergus. Intriguing properties of neural networks. arXiv:1312.6199, 2013. +Dimitris Tsipras, Shibani Santurkar, Logan Engstrom, Alexander Turner, and Aleksander Madry. Robustness may be at odds with accuracy, 2019. + +Jonathan Uesato, Jean-Baptiste Alayrac, Po-Sen Huang, Robert Stanforth, Alhussein Fawzi, and Pushmeet Kohli. Are labels required for improving adversarial robustness? CoRR, 2019. +Pratik Vaishnavi, Kevin Eykholt, and Amir Rahmati. Transferring adversarial robustness through robust representation matching. arXiv preprint arXiv:2202.09994, 2022. +Bastiaan S Veeling, Jasper Linmans, Jim Winkens, Taco Cohen, and Max Welling. Rotation equivariant cnns for digital pathology. In International Conference on Medical image computing and computer-assisted intervention, pp. 210-218. Springer, 2018. +Vinay Kumar Verma, Dhanajit Brahma, and Piyush Rai. A meta-learning framework for generalized zero-shot learning. CoRR, abs/1909.04344, 2019. URL http://arxiv.org/abs/1909.04344. +Hao Wang, Chengzhi Mao, Hao He, Mingmin Zhao, Tommi S Jaakkola, and Dina Katabi. Bidirectional inference networks: A class of deep bayesian networks for health profiling. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 766-773, 2019. +Mitchell Wortsman, Gabriel Ilharco, Jong Wook Kim, Mike Li, Simon Kornblith, Rebecca Roelofs, Raphael Gontijo Lopes, Hannaneh Hajishirzi, Ali Farhadi, Hongseok Namkoong, et al. Robust fine-tuning of zero-shot models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 7959-7971, 2022. +Yongqin Xian, Tobias Lorenz, Bernt Schiele, and Zeynep Akata. Feature generating networks for zero-shot learning. In 2018 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2018, Salt Lake City, UT, USA, June 18-22, 2018, pp. 5542-5551. Computer Vision Foundation / IEEE Computer Society, 2018. doi: 10.1109/CVPR.2018.00581. URL http://openaccess.thecvf.com/content_cvpr_2018/html/Xian_Feature_Generating_Networks_CVPR_2018_paper.html. +Jianxiong Xiao, James Hays, Krista A Ehinger, Aude Oliva, and Antonio Torralba. Sun database: Large-scale scene recognition from abbey to zoo. In 2010 IEEE computer society conference on computer vision and pattern recognition, pp. 3485-3492. IEEE, 2010. +Guo-Sen Xie, Li Liu, Xiaobo Jin, Fan Zhu, Zheng Zhang, Jie Qin, Yazhou Yao, and Ling Shao. Attentive region embedding network for zero-shot learning. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2019, Long Beach, CA, USA, June 16-20, 2019, pp. 9384-9393. Computer Vision Foundation / IEEE, 2019. doi: 10.1109/CVPR.2019.00961. URL http://openaccess.thecvf.com/content_CVPR_2019/html/Xie_Anteative Region_Embedding_Network_for_Zero-Shot_Learning_CVPR_2019_paper.html. +Yunlong Yu, Zhong Ji, Yanwei Fu, Jichang Guo, Yanwei Pang, and Zhongfei (Mark) Zhang. Stacked semantics-guided attention model for fine-grained zero-shot learning. In Samy Bengio, Hanna M. Wallach, Hugo Larochelle, Kristen Grauman, Nicolò Cesa-Bianchi, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montréal, Canada, pp. 5998-6007, 2018. URL https://proceedings.neurips.cc/paper/2018/bitstream/9087b0efc7c7acd1ef7e153678809c77-Abstract.html. +Mehmet Kerim Yucel, Ramazan Gokberk Cinbis, and Pinar Duygulu. A deep dive into adversarial robustness in zero-shot learning. In European Conference on Computer Vision, pp. 3-21. Springer, 2020. +Hongyang Zhang, Yaodong Yu, Jiantao Jiao, Eric P. Xing, Laurent El Ghaoui, and Michael I. Jordan. Theoretically principled trade-off between robustness and accuracy. arXiv abs/1901.08573, 2019. +Chunting Zhou, Junxian He, Xuezhe Ma, Taylor Berg-Kirkpatrick, and Graham Neubig. Prompt consistency for zero-shot task generalization. arXiv preprint arXiv:2205.00049, 2022a. +Kaiyang Zhou, Jingkang Yang, Chen Change Loy, and Ziwei Liu. Conditional prompt learning for vision-language models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 16816-16825, 2022b. + +Table 3: Zero-shot clean accuracy. After adapting the CLIP model on ImageNet, the zero-shot performance on clean image in general drops. TeCoA based methods achieve the relatively small drop compared with other training object when the model has been adversarially trained. + +
MethodDATASETS
ImageNetCIFAR10STL-10CIFAR100SUNStanfordCarsFood101OxfordPetFlower102DTDEUROSATFGVCHatefulMemesPCAMCaltech101Caltech256Average
CLIP59.1289.0697.1662.3257.6752.1483.1585.8265.6440.5238.2620.0456.2052.0391.7582.0464.56
+VP (CE)56.4586.7295.9059.3559.0847.6176.7485.9160.4812.8133.8519.0554.9050.4289.9379.1960.52
+LP (CE)61.8891.8097.6658.0163.449.7760.3939.843.713.9149.417.4244.5352.2967.1966.0248.58
+FT (CE)72.7287.0297.2563.9359.9047.6977.9687.1963.4740.8037.2216.2957.0043.9087.3882.7563.90
+VP (TeCoA)10.1333.3657.4214.8410.823.787.4523.6312.3614.090.351.7719.9349.3341.8527.1120.51
+VP (Adv.)42.3469.0690.6337.5244.3135.5150.5977.6049.6034.1014.9710.9254.3052.4784.1869.6851.11
+VP (CoAdv.)42.0564.1625.5790.6143.7235.9449.4377.1347.6535.0512.4110.9857.3345.5484.3769.2549.45
+VP (ImgCoAdv.)13.2427.7456.078.8020.374.0718.7934.7517.3223.786.544.2648.3755.5552.0532.0326.48
+VP (TeCoA)48.8471.6391.5940.9650.9733.5052.4179.0745.7831.8615.9312.2458.5347.8595.1971.6653.00
+FT (Adv.)61.5526.0141.825.521.510.382.3127.720.986.2212.211.3847.8341.6212.756.0918.49
+FT (CoAdv.)50.1810.5217.610.630.180.600.902.181.311.2219.471.3253.2051.720.570.4413.25
+FT (ImgCoAdv.)0.1310.4411.201.030.270.121.132.940.912.0213.571.1150.6037.971.130.558.45
+FT (TeCoA)63.8778.1293.3049.6851.2833.3055.3781.5850.9234.1527.5713.8953.4749.0183.5176.5155.97
+ +Kaiyang Zhou, Jingkang Yang, Chen Change Loy, and Ziwei Liu. Learning to prompt for vision-language models. International Journal of Computer Vision, 130(9):2337-2348, 2022c. + +# A APPENDIX + +# A.1 EXPERIMENTS + +# A.1.1 ZERO-SHOT CLEAN ACCURACY OF OUR ADAPTED MODEL + +We show the results for accuracy on clean images in Table 3. + +# A.2 AUTOATTACK EXPERIMENT + +We also consider a stronger attack AutoAttack Croce & Hein (2020) in our evaluation. Since our method uses adversarial training and does not rely on the obfuscated gradient, we use two APGD variants, APGD-CE and APGD-DLR, in AutoAttack to evaluate. We show robust accuracy under perturbation bound $\epsilon = 1 / 255$ in Table 4 and robust accuracy under perturbation bound $\epsilon = 4 / 255$ in Table 5. For both perturbation bounds, our method achieves higher robust accuracy than vanilla CLIP by up to 36 points on average. + +Notably, on $\epsilon = 1 / 255$ , even evaluated under the stronger AutoAttack, the robustness accuracy of FT (TeCoA) is 37.02, which is still higher than all other baselines methods from Table 1 in robust accuracy, even though those baselines are evaluated under a weaker PGD100 attack. A larger perturbation bound $\epsilon = 4 / 255$ makes the attack stronger, where our method still improves robustness by an average of 9 points. In addition, while the AutoAttack significantly reduces the robust accuracy of CLIP from 6.57 to 0.53, it only slightly decreases our TeCoA's robust accuracy: 2.1 points for visual prompt tuning and 1.16 for finetuning model (see Table 1 and Table 4). + +One reason for AutoAttack to be so effective in attacking vanilla CLIP than PGD100 is because it uses a fractional attack vector, which is not rounded by 1/255 during the inference. Images are often encoded via integer from 0 to 255, which allows only attack at the integer level. In the main paper, we use PGD attacks with step size 1 (if the image ranges from 0 to 1, then step size is proportionally 1/255) for 100 steps. Since there is no fractional attack value, the attack space is constrained and less effective. This is because the standard image inputs have value resolutions that should be larger than 0.5, and any values smaller than this would be rounded when encoding the images. If we ignore the fact that images will be encoded in integers between 0 to 255, then we can have stronger attacks by exploring the fraction values. Since the AutoAttack automatically reduces the attack step size when loss oscillates, it explores the fraction space and is more effective in the attack. + +Table 4: Zero-shot robust accuracies on images attacked with AutoAttack with $\epsilon = 1 / 255$ . We use the CE and DLR variants of APGD in AutoAttack, which is a stronger attacker, where the adaptive step size can be a fraction (for PGD100, the minimum step size is 1). We show the test accuracy for 16 tasks (columns) and 12 different methods (rows). We show the average performance of each method in the last column. The best accuracies are bolded. Autoattack is a stronger attack than PGD, which significantly reduces the robustness accuracy of vanilla CLIP. For example, CLIP robust accuracy on Caltech101 was reduced from 24.63 (PGD100) to 0.41 (AA). However, AA only slightly decreases our TeCoA's robustness, from 69.07 to 68.40. By our language-guided adversarial training (TeCoA), we improve the robustness by an average of 36 points than CLIP, which is a larger robustness gain than the PGD100 experiment. In addition, compared with PGD 100 attack, the average robustness only decreases by around 1 point on FT (TeCoA), suggesting that our TeCoA is robust and stronger attack cannot further decrease the accuracy. + +
MethodDATASETS
ImageNetCIFAR10STL-10CIFAR100SUNStanfordCarsFood101OxfordPetFlower102DTDEUROSATFGVCHateMemesPCAMCaltech101Caltech256Average
CLIP0.002.732.961.210.040.110.020.030.070.110.110.180.100.160.410.150.53
VPT (TeCoA)20.8247.2574.9923.3919.768.6316.8144.7820.9018.8310.733.2431.1329.3562.1945.6429.90
FT (TeCoA)39.8158.2783.1632.5729.0312.0325.7961.7628.9320.7013.264.0531.8324.0968.4058.5937.02
+ +Table 5: Zero-shot robust accuracies on images attacked with AutoAttack with $\epsilon = 4 / 255$ . We show the test accuracy for 16 tasks (columns) and 12 different methods (rows). We show the average performance of each method in the last column. The best accuracies are **bolded**. Autoattack is a stronger attack than PGD, which reduces the robustness accuracy of CLIP even more. By our language-guided adversarial training (TeCoA), we improve the robustness by an average of 9 points to CLIP. + +
MethodDATASETS
ImageNetCIFAR10STL-10CIFAR100SUNStanfordCarsFood101OxfordPetFlower102DTDEUROSATFGVCHateMemesPCAMCaltech101Caltech256Average
CLIP0.050.010.000.040.040.150.020.000.050.000.110.240.060.180.000.040.06
VPT (TeCoA)1.448.9921.833.780.780.250.462.432.804.4110.040.2119.7327.7411.795.667.65
FT (TeCoA)6.4015.3634.308.332.940.351.127.884.166.444.430.185.633.1726.8517.099.04
+ +# A.3 TRAINING LOSSES AND ALGORITHMS + +We give formulations for the different training algorithms considered in our experiments. Throughout this section, let $F_{\theta}$ denote an image encoder parameterized by $\theta$ , and let $T$ denote a frozen text encoder. Let $\mathbb{D}$ denote a dataset containing pairs $(x,y)$ of images and their respective one-hot labels. + +# A.3.1 STANDARD ADVERSARIAL TRAINING WITH CROSS-ENTROPY LOSS (ADV.) + +The standard adversarial training paradigm. We initialize a learnable linear layer $C_{\phi}$ , and append it to $F_{\theta}$ . The classification loss is $\mathcal{L}(C_{\phi}(F_{\theta}(\mathbf{x}_a)), \mathbf{y})$ defined in cross-entropy loss. + +We first train $C_{\phi}$ on standard images. Then, given a natural image $\mathbf{x}$ with one-hot label $\mathbf{y}$ , we generate an attacked image $\mathbf{x}_a$ by maximizing the loss $\mathcal{L}(C_{\phi}(F_{\theta}(\mathbf{x}_a)), \mathbf{y})$ . We then update $\theta$ to minimize the loss $\mathcal{L}(C_{\phi}(F_{\theta}(\mathbf{x}_a)), \mathbf{y})$ . We describe our algorithm in Algorithm 1. + +# Algorithm 1 Standard Adversarial Training (Adv.) + +Input: Dataset $\mathbb{D}$ , learnable parameter $\theta$ , model $F$ , parameter of projector $C_{\phi}$ + +for all iter $\in$ preset number of training epochs do + +for all $\mathbf{x},\mathbf{y}\in$ minibatch do + +$$ +\mathbf {x} ^ {a} = \operatorname {a r g m a x} _ {\mathbf {x} _ {a}} \mathcal {L} \left(C _ {\phi} \left(F _ {\theta} (\mathbf {x} ^ {a})\right), \mathbf {y}\right) +$$ + +$$ +\theta = \theta - \nabla_ {\theta} \mathcal {L} \left(\tilde {C} _ {\phi} \left(F _ {\theta} \left(\mathbf {x} _ {a}\right)\right), \mathbf {y}\right) +$$ + +end for + +end for + +$\triangleright$ Generating adversarial attacks + +$\triangleright$ Training on generated adversarial examples + +# A.3.2 CONTRASTIVE ADVERSARIAL TRAINING LOSS (COADV.) + +We study how much the contrastive learning objective contributes to the zero-shot robustness gain. Instead of using one-hot label $y$ and cross-entropy loss in our objective, we create a dictionary of embeddings $\mathcal{E}$ by random initialization, where each embedding $\mathbf{e}_i$ denotes the code representation for the category $y_i$ . We optimize the following contrastive learning loss: + +$$ +\mathcal {L} _ {s} (\mathbf {x}, \mathcal {E}, \mathbf {y}) = - \mathbb {E} _ {i, j} \left[ \mathbf {y} _ {i j} \log \frac {\exp \left(\cos \left(\mathbf {z} _ {i} ^ {(I)} , \mathbf {e} _ {j}\right) / \tau\right)}{\sum_ {k} \exp \left(\cos \left(\mathbf {z} _ {i} ^ {(I)} , \mathbf {e} _ {j}\right) / \tau\right)} \right], \tag {6} +$$ + +where the $\mathbf{z}_i^{(I)} = F_\theta (\mathbf{x}_i)$ are the features of the input image, and $\mathbf{e}_j$ are the code representation from the dictionary. We use $\mathbf{y}_{ij}$ to indicate which image-code pairs are positive and which are negative; this indicator satisfies $\mathbf{y}_{ij} = 1$ if and only if the examples $i = j$ , and 0 otherwise. $\tau$ is a scalar hyper-parameter, and cos denotes the cosine similarity function. We describe our algorithm in Algorithm 2. + +Algorithm 2 Contrastive Adversarial Training Loss (CoAdv.) +Input: Dataset $\mathbb{D}$ , learnable parameter $\theta$ , model $F$ +for all iter $\in$ preset number of training epochs do +for all $\mathbf{x},\mathbf{y}\in$ minibatch do + $\mathbf{x}^a = \mathrm{argmax}_{\mathbf{x}^a}\mathcal{L}_s(\mathbf{x},\mathcal{E},\mathbf{y})$ $\triangleright$ Generating adversarial attacks for contrastive loss + $\theta = \theta -\nabla_{\theta}\mathcal{L}_{s}(\mathbf{x},\mathcal{E},\mathbf{y})$ $\triangleright$ Contrastive learning on generated adversarial examples +end for +end for + +# A.3.3 CONTRASTIVE ADVERSARIAL TRAINING OVER IMAGES (IMGCOADV.) + +Prior work Jiang et al. (2020) uses image-only contrastive adversarial learning to obtain robustness. We adapt this method as a baseline to study whether using the knowledge from only images — not language — can achieve zero-shot robustness. For each image $\mathbf{x}_i$ , we create a transformationed $\mathbf{x}_j$ , and form the image pair $(x_i, x_j)$ . + +We use the same visual encoder to embed the images $\mathbf{x}_i$ and $\mathbf{x}_j$ to obtain the features $\mathbf{z}_i$ and $\mathbf{z}_j$ . We then construct the following contrastive learning loss: + +$$ +\mathcal {L} _ {s} \left(\mathbf {x} _ {i}, \mathbf {x} _ {j}, \mathbf {y}\right) = - \mathbb {E} _ {i, j} \left[ \mathbf {y} _ {i j} \log \frac {\exp \left(\cos \left(\mathbf {z} _ {i} , \mathbf {z} _ {j}\right) / \tau\right)}{\sum_ {k} \exp \left(\cos \left(\mathbf {z} _ {i} , \mathbf {z} _ {j}\right) / \tau\right)} \right], \tag {7} +$$ + +where the $\mathbf{z}_i = F_\theta(\mathbf{x}_i)$ are the features of the input image. We use $\mathbf{y}_{ij}$ to indicate which image pairs are positive and which are negative; this indicator satisfies $\mathbf{y}_{ij} = 1$ if and only if the images $\mathbf{x}_i$ and $\mathbf{x}_j$ are augmented from the same instance, and 0 otherwise. $\tau$ is a scalar hyper-parameter, and cos denotes the cosine similarity function. + +Let $\mathbf{z}_i^a = F_\theta (\mathbf{x}_i^a)$ , where $\mathbf{x}_i^a$ denotes the generated adversarial examples. Then we can obtain the adversarial examples via: + +$$ +\mathbf {x} _ {i} ^ {a} = \underset {\mathbf {x} _ {i} ^ {a}} {\operatorname {a r g m a x}} \mathcal {L} _ {s} \left(\mathbf {x} _ {i}, \mathbf {x} _ {j}, \mathbf {y}\right) = \underset {\mathbf {x} _ {i} ^ {a}} {\operatorname {a r g m a x}} - \mathbb {E} _ {i, j} \left[ \mathbf {y} _ {i j} \log \frac {\exp \left(\cos \left(\mathbf {z} _ {i} ^ {a} , \mathbf {z} _ {j}\right) / \tau\right)}{\sum_ {k} \exp \left(\cos \left(\mathbf {z} _ {i} ^ {a} , \mathbf {z} _ {j}\right) / \tau\right)} \right], \tag {8} +$$ + +Once we generate the adversarial images, we conduct contrastive learning on adversarial images and the paired clean images using Equation 7. + +We introduce our algorithm in Algorithm 3. + +# A.3.4 TEXT-GUIDED CONTRASTIVE ADVERSARIAL TRAINING (TECOA) + +We describe the TeCoA training algorithm in Algorithm 4. We denote the learnable parameters to be $\theta$ . For the visual prompt tuning, $\theta$ is only the prompt vector. For the finetuning method, $\theta$ is the parameter of the whole model. + +Algorithm 3 Contrastive Adversarial Training over Images (ImgCoAdv.) +Input: Dataset D, learnable parameter $\theta$ , model $F$ +for all iter $\in$ preset number of training epochs do + for all $\mathbf{x} \in$ minibatch do + $\mathbf{x}_i^a = \operatorname{argmax}_{\mathbf{x}_i^a} \mathcal{L}_s(\mathbf{x}_i^a, \mathbf{x}_j, \mathbf{y})$ $\theta = \theta - \nabla_{\theta} \mathcal{L}_s(\mathbf{x}_i^a, \mathbf{x}_j, \mathbf{y})$ + end for +end for +Algorithm 4 TeCoA Training +Input: Dataset D, learnable parameter $\theta$ , model $F$ , text t +for all iter $\in$ preset number of training epochs do + for all $\mathbf{x}, \mathbf{y} \in$ minibatch do + $\mathbf{x}^a = \operatorname{argmax}_{\mathbf{x}} \mathcal{L}_s(\mathbf{x}, \mathbf{t}, \mathbf{y})$ $\theta = \theta - \nabla_{\theta} \mathcal{L}_s(\mathbf{x}^a, \mathbf{t}, \mathbf{y})$ + end for +end for + +# A.3.5 TECoA LEARNING ON UNLABELLED DATA + +Given an unlabeled image, we first provide a list of text using the possible category names: + +A photo of a {Category Name}. + +Since the unlabeled images are not attacked, CLIP can retrieve the nearest text embedding from the image embedding and use the text as the pseudo label for the image. We then conduct the TeCoA training on the images and their pseudo text label. We describe the algorithm below in Algorithm 5. + +Algorithm 5 TeCoA Training on Unlabeled Data +Input: Dataset $\mathbb{D}$ without label, learnable parameter $\theta$ , model $F$ , text t. +for all iter $\in$ preset number of training epochs do + for all $x \in$ minibatch $B = \{x_1, \dots, x_m\}$ do + $\mathbf{y} = \mathrm{argmin}_{\mathbf{y}} \mathcal{L}_s(\mathbf{x}, \mathbf{t}, \mathbf{y})$ $\mathbf{x}^a = \mathrm{argmax}_{\mathbf{x}} \mathcal{L}_s(\mathbf{x}, \mathbf{t}, \mathbf{y})$ $\theta = \theta - \nabla_\theta \mathcal{L}_s(\mathbf{x}^a, \mathbf{t}, \mathbf{y})$ +end for +end for + +# A.4 DISCUSSION FOR RESULTS + +In Table 1, our TeCoA performs better than existing methods except for LP(CE) and VPT(Adv.) on HateMemes and PCAM datasets. This is because the HateMemes dataset is a binary classification task for detecting hateful speech, which is a very different domain from the ImageNet classification. Since both LP(CE) and VPT (adv) only adapt a small number of parameters on the ImageNet set, the resulting model may overfit less to the Image recognition task, and just perform random guessing. Note that the $54\%$ accuracy is close to random guessing $50\%$ . In addition, PCAM is a binary classification for lymph nodes (medical image, https://github.com/basveeling/pcam), which is also a very different domain from ImageNet. Similar to HateMemes, adapting fewer parameters makes the model learn less and overfit less, where the $52.5\%$ accuracy is close to random guessing $50\%$ . Thus, both datasets remain a big challenge for all existing zero-shot robust classification tasks. + +# A.5 DISCUSSION FOR TECOA LOSS + +In the main paper, we interpret our loss through the image-text contrastive objective, which first conducts a matrix multiplication between the image embedding and language embedding, and then applies a cross-entropy loss on the output. Since the text embedding is fixed, this embedding can be treated as a layer of linear classifier, whose weights are obtained from the language embedding. This image-text contrastive objective can also be interpreted as using cross-entropy loss on a fixed readout layer that is initialized with the right language knowledge. This further validates the importance of language information for zero-shot adversarial robustness. + +# A.6 ADAPTATION METHOD FORMULATION + +Token-Level Visual Prompts. Token-level visual prompts adapt transformer-based models by appending tokens to the input token sequence. This is the most effective prompt method in our experiments, where we use this by default unless specified. Our visual prompts append additional tokens $P_{k}$ to the input sequence $\mathbf{x}$ of the vision transformer: + +$$ +\mathbf {x} = [ \mathbf {x}; P _ {0}, P _ {1}, \dots , P _ {k} ] \tag {9} +$$ + +The remaining transformer parameters and computations are kept the same as the original. + +Image-Level Visual Prompts. Image-level visual prompts adapt transformer models by adding prompt to the input pixels. This is less effective way of adding prompt, as discussed in Figure 6a. Let the prompt token be $P$ , and input image be $x$ the visual prompt is added to the input image: + +$$ +\mathbf {x} = \mathbf {x} + P \tag {10} +$$ + +The remaining transformer parameters and computations are kept the same as the original. + +Finetuning. This is the standard way of adapting a model, where all parameters of the model is updated with relatively small learning rate. In our experiments, we find learning rate of $1e - 5$ achieves the best performance. \ No newline at end of file diff --git a/understandingzeroshotadversarialrobustnessforlargescalemodels/images.zip b/understandingzeroshotadversarialrobustnessforlargescalemodels/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d16bd0ff4d2452606e423fa53a5570e43ccac74f --- /dev/null +++ b/understandingzeroshotadversarialrobustnessforlargescalemodels/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3a4494ccbc104224e8421f3462cf89c4e2851733caf0ce842650c69dc9418e84 +size 818465 diff --git a/understandingzeroshotadversarialrobustnessforlargescalemodels/layout.json b/understandingzeroshotadversarialrobustnessforlargescalemodels/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..6fcb42ac5a6486beab115efa3d9ad9e5ae1d1363 --- /dev/null +++ b/understandingzeroshotadversarialrobustnessforlargescalemodels/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c4ee662cd251a27697e49c5fa1cb878791d1542e9ae3f6302535fac6e5c1e08 +size 589291 diff --git a/unicomuniversalandcompactrepresentationlearningforimageretrieval/4955bd28-9154-4d84-b28c-d82d4581f134_content_list.json b/unicomuniversalandcompactrepresentationlearningforimageretrieval/4955bd28-9154-4d84-b28c-d82d4581f134_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..087e4b623064297dff547cc09436b53b7a75cbe3 --- /dev/null +++ b/unicomuniversalandcompactrepresentationlearningforimageretrieval/4955bd28-9154-4d84-b28c-d82d4581f134_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:63110c50e2fc44f5e72c022149844c79e92663c9c866e2656e7849e38d77b245 +size 96282 diff --git a/unicomuniversalandcompactrepresentationlearningforimageretrieval/4955bd28-9154-4d84-b28c-d82d4581f134_model.json b/unicomuniversalandcompactrepresentationlearningforimageretrieval/4955bd28-9154-4d84-b28c-d82d4581f134_model.json new file mode 100644 index 0000000000000000000000000000000000000000..a03fb64e32ff540911c72924b4889cbb900de4a6 --- /dev/null +++ b/unicomuniversalandcompactrepresentationlearningforimageretrieval/4955bd28-9154-4d84-b28c-d82d4581f134_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a4693f8eda67de93033e09104f594fbe559e80adbb52faf5de03b75256a77d48 +size 121815 diff --git a/unicomuniversalandcompactrepresentationlearningforimageretrieval/4955bd28-9154-4d84-b28c-d82d4581f134_origin.pdf b/unicomuniversalandcompactrepresentationlearningforimageretrieval/4955bd28-9154-4d84-b28c-d82d4581f134_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..2d74e51c86aa908e2dedfba45c45c1edaaf9dde0 --- /dev/null +++ b/unicomuniversalandcompactrepresentationlearningforimageretrieval/4955bd28-9154-4d84-b28c-d82d4581f134_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:23269e3553df6efd75804a4c677d4f0e3538d69a5d154042d9670940ddbae131 +size 3486242 diff --git a/unicomuniversalandcompactrepresentationlearningforimageretrieval/full.md b/unicomuniversalandcompactrepresentationlearningforimageretrieval/full.md new file mode 100644 index 0000000000000000000000000000000000000000..597ce2f25dbecc39f9c055b751a29bc312f79e87 --- /dev/null +++ b/unicomuniversalandcompactrepresentationlearningforimageretrieval/full.md @@ -0,0 +1,337 @@ +# UNICOM: UNIVERSAL AND COMPACT REPRESENTATION LEARNING FOR IMAGE RETRIEVAL + +Xiang An $^{1}$ , Jiankang Deng $^{2*}$ , Kaicheng Yang $^{1}$ , Jiawei Li $^{1}$ , Ziyong Feng $^{1}$ , Jia Guo $^{3}$ , Jing Yang $^{4}$ , Tongliang Liu $^{5}$ + +1DeepGlint, 2Huawei, 3InslightFace, 4University of Cambridge, 5University of Sydney xiangan@deepglint.com, jiankangdeng@gmail.com + +# ABSTRACT + +Modern image retrieval methods typically rely on fine-tuning pre-trained encoders to extract image-level descriptors. However, the most widely used models are pre-trained on ImageNet-1K with limited classes. The pre-trained feature representation is therefore not universal enough to generalize well to the diverse open-world classes. In this paper, we first cluster the large-scale LAION 400M dataset into one million pseudo classes based on the joint textual and visual features extracted by the CLIP model. Due to the confusion of label granularity, the automatically clustered dataset inevitably contains heavy inter-class conflict. To alleviate such conflict, we randomly select partial inter-class prototypes to construct the margin-based softmax loss. To further enhance the low-dimensional feature representation, we randomly select partial feature dimensions when calculating the similarities between embeddings and class-wise prototypes. The dual random partial selections are with respect to the class dimension and the feature dimension of the prototype matrix, making the classification conflict-robust and the feature embedding compact. Our method significantly outperforms state-of-the-art unsupervised and supervised image retrieval approaches on multiple benchmarks. The code and pre-trained models are released to facilitate future research https://github.com/deepglint/unicom. + +# 1 INTRODUCTION + +Modern image retrieval methods (Lim et al., 2022; Roth et al., 2022; Kim et al., 2022; Ermolov et al., 2022; Patel et al., 2022) can be roughly decomposed into two major components: (1) the encoder (e.g., Convolutional Neural Networks (Szegedy et al., 2015; He et al., 2016) or Vision Transformer (Touvron et al., 2021; Dosovitskiy et al., 2021)) mapping the image to its compact representation and (2) the loss function (Musgrave et al., 2020) grouping the representations of similar objects while pushing away representations of dissimilar objects in the embedding space. To train the encoder, networks pre-trained on crowd-labeled datasets (e.g., ImageNet (Deng et al., 2009)) are widely used for fine-tuning (Wang et al., 2019; Kim et al., 2021). However, ImageNet only contains 1,000 pre-defined object classes. The feature representation learned from ImageNet is not universal enough to generalize to diverse open-world objects. + +Even though fully supervised pre-training can benefit from a strong semantic learning signal for each training example, supervised learning is not scalable because manual annotation of large-scale training data is time-consuming, costly, and even infeasible. By contrast, self-supervised pre-training methods (He et al., 2020; 2022; Radford et al., 2021; Jia et al., 2021) can be easily scaled to billions of unlabeled examples by designing an appropriate pretext task, such as solving jigsaw puzzles (Noroozi & Favaro, 2016), invariant mapping (Chen & He, 2021), and image-text matching (Radford et al., 2021; Jia et al., 2021). Among them, CLIP (Radford et al., 2021) has recently demonstrated success across various downstream tasks (e.g., image retrieval and classification) due to superior feature representation empowered by image-text contrastive learning. Specifically, CLIP aligns the visual and textual signals of each instance into a unified semantic space by cross-modal instance + +![](images/0a77fb69632479c70ae7769aeefba9d6ffdcfaf95418127f5975a27c2a1b25db.jpg) +(a) Performance comparison on CUB + +![](images/eebb0c4a51a811566da06d707f069e7766dc6392b18f635b9417a84d20b85f44.jpg) +(b) The proposed Unicom +Figure 1: (a) Accuracy in Recall@1 versus embedding dimension on the CUB dataset. The proposed Unicom is only trained on the LAION 400M dataset without any manual annotation. (b) The proposed Unicom employs two random selections along the class dimension and the feature dimension to alleviate inter-class conflict and achieve compact representation, respectively. + +discrimination. Nevertheless, the instance discrimination method used by CLIP can hardly encode the semantic structure of training data, because instance-wise contrastive learning always treats two samples as a negative pair if they are from different instances, regardless of their semantic similarity. When thousands of instances are selected into the training batch to form the contrastive loss, negative pairs that share similar semantics will be undesirably pushed apart in the embedding space. + +To handle the limitations of instance discrimination, cluster discrimination has been proposed for deep unsupervised learning through jointly learning image embeddings and cluster assignments. Learning representations with clusters will pull similar instances together, which is beneficial for capturing semantic structures in data. DeepCluster (Caron et al., 2018) performs iterative clustering by k-means and classification by cross-entropy loss, while SeLa (Asano et al., 2020) proposes to solve an optimal transport problem for balanced assignment. However, both DeepCluster and SeLa need labels to be assigned offline in a batch mode with representations of all instances. To reduce the cost of batch mode clustering, ODC (Zhan et al., 2020), SwAV (Caron et al., 2020), and CoKe (Qian et al., 2022) apply online clustering to avoid the multiple iterations over the entire dataset. Despite improved efficiency, the online clustering method still suffers from the collapsing problem (i.e., a dominant cluster includes instances from multiple classes or most of the instances). + +In this paper, we aim at boosting the semantic embedding power of the CLIP model by introducing a novel cluster discrimination approach. We first conduct one step of off-line clustering by using the image and text features from a pre-trained CLIP model (Radford et al., 2021). Due to the limited discrimination power of the CLIP model, the pseudo clusters contain heavy inter-class conflict. Instead of optimizing the cluster assignment (Qian et al., 2022), we focus on how to robustly train a classifier on the automatically clustered large-scale data. More specifically, we explore two random selections on the prototype matrix $W \in R^{d \times k}$ when preparing the classification loss (as illustrated in Fig. 1(b)). The first one is with respect to the class dimension $(k)$ , and only part of negative prototypes are selected for inter-class comparisons, which helps alleviate inter-class conflict. The second one is with respect to the feature dimension $(d)$ , and only part of features are randomly selected to construct the classification loss, enhancing the representation power of each neuron and making feature representation compact for the efficient image retrieval task. Concurrent with our work, partial selection mechanisms along class and feature are separately proposed in (An et al., 2021; 2022) and (Xu et al., 2022) to accelerate model training and enhance locally distinguishable features. Both of their experiments are conducted on cleaned face recognition datasets. By contrast, we target at universal and compact representation learning from automatically clustered large-scale data. The main contributions of our paper are the following: + +- We propose a novel cluster discrimination method for universal and compact representation learning. In the clustering step, we employ both image and text features from the pre-trained CLIP model. In the discrimination step, we explore two random selections along class and feature, which can potentially alleviate inter-class conflict and improve the feature compactness, respectively. + +- For both zero-shot learning tasks (e.g., linear probe and unsupervised image retrieval) and transfer learning tasks (e.g., ImageNet-1K classification and supervised image retrieval), the proposed random negative prototype selection for conflict-robust cluster discrimination can significantly boost the representation power compared to the instance discrimination based model (e.g., CLIP). + +# 2 RELATED WORK + +Visual Model Pre-training. Model pre-training for visual recognition can be categorized into three main groups: (1) supervised pre-training on datasets with manually annotated class labels (e.g., ImageNet-1K/-21K (Deng et al., 2009) and JFT-300M/-3B (Dosovitskiy et al., 2021; Zhai et al., 2022)), (2) weakly-supervised pre-training by using hashtag (Mahajan et al., 2018; Singh et al., 2022) or text descriptions (Radford et al., 2021; Jia et al., 2021), and (3) unsupervised pre-training (Chen et al., 2020; He et al., 2020; Caron et al., 2018). Since supervised pre-training relies on expensive manual annotations, we focus on annotation-free pre-training which has the advantages of being easily scaled to billions of training images and being able to learn universal feature representations for downstream tasks. + +Instance and Cluster Discrimination. Instance discrimination (Chen et al., 2020; He et al., 2020; Radford et al., 2021) is realized with a contrastive loss which targets at pulling closer samples from the same instance while pushing away samples from different instances. Despite the impressive performance, instance-wise contrastive learning can not capture the semantic information from the training data because it is trained to ignore the similarity between different instances. Cluster discrimination (Caron et al., 2018; Zhan et al., 2020; Li et al., 2020a) is processed with iterative steps: the clustering step to assign pseudo class labels for each sample, and then the classification step to map each sample to its assigned label. Since one cluster has more than one instance, learning representations with clusters will gather similar instances together, which can explore potential semantic structures in data. As a representative work, DeepCluster (Caron et al., 2018) adopts a standard k-means for clustering, but it contains degenerate solutions. To this end, recent research work (Asano et al., 2020; Caron et al., 2020; Qian et al., 2022) focuses on improving the label assignment during clustering but employs a standard cross-entropy loss during discrimination. In this paper, we only employ one step of off-line clustering but design a robust classifier to achieve good feature representation when training on the automatically clustered large-scale data. + +Image Retrieval. Image retrieval task typically relies on fine-tuning pre-trained visual models (Szegedy et al., 2015; He et al., 2016; Dosovitskiy et al., 2021) and can be divided into two learning categories: supervised and unsupervised metric learning. For supervised metric learning, pair-wise loss (Hadsell et al., 2006; Schroff et al., 2015; Sohn, 2016) and cross-entropy loss (Zhai & Wu, 2019; Deng et al., 2019; Sun et al., 2020; Qian et al., 2019) are extensively studied and recent bench-marking results (Musgrave et al., 2020) indicate that the margin-based softmax loss (e.g., ArcFace (Deng et al., 2019)) can achieve state-of-the-art performance. For unsupervised metric learning, pseudo labeling methods are employed to discover pseudo classes by applying k-means clustering (Kan et al., 2021; Li et al., 2020b), hierarchical clustering (Yan et al., 2021), random walk (Iscen et al., 2018), and class-equivalence relations (Kim et al., 2022) to unlabeled training data. In this paper, we focus on universal and compact feature embedding for both unsupervised and supervised image retrieval task. + +# 3 METHODOLOGY + +# 3.1 PRELIMINARIES OF INSTANCE AND CLUSTER DISCRIMINATION + +Given a training set $X = \{x_{1}, x_{2}, \ldots, x_{n}\}$ including $n$ images, feature representation learning aims at learning a function $f$ that maps images $X$ to embeddings $E = \{e_{1}, e_{2}, \ldots, e_{n}\}$ with $e_{i} = f(x_{i})$ , such that embeddings can describe the similarities between different images. + +Instance discrimination achieves this objective by optimizing a contrastive loss function defined as: + +$$ +\mathcal {L} _ {\text {i n s t a n c e}} = - \sum_ {i = 1} ^ {n} \log \frac {\exp \left(e _ {i} ^ {\prime T} e _ {i}\right)}{\sum_ {j = 0} ^ {m} \exp \left(e _ {j} ^ {\prime T} e _ {i}\right)}, \tag {1} +$$ + +![](images/d97f4c7ceae23d97afab69e86599fb63f833ab1e93caba951b047152d91ad6e8.jpg) +(a) Multi-modal Clustering + +![](images/ebdbb798a9ea71c92c93f755cce389a87053643504a579d1d7c9ccc87d47dab2.jpg) +(b) Discrimination +Figure 2: Illustration of the proposed method. (a) The multi-modal clustering includes one off-line step of k-means on features from image and text produced by a pre-trained CLIP model (Radford et al., 2021). (b) Using the assigned clusters as pseudo-labels, we propose a conflict-robust and representation-compact classification method through random class and feature selection along the two dimensions of the prototype matrix. + +where $e_i$ and $e_i'$ are positive embeddings of the instance $i$ , and $e_j'$ consists of one positive embedding of $i$ and its $m$ negative embeddings from other instances. + +By contrast, cluster discrimination for representation learning consists of two main phases: clustering and discrimination. The clustering step assigns each instance a pseudo class label that will be subsequently used as supervision to train a classifier in the discrimination step. Following this, automatic clustering on the features $e_i = f(x_i)$ is first performed to obtain $k$ clusters and the centroid $w_i$ is viewed as the prototype of $i$ -th cluster. Then, the training data $\{x_i\}_{i=1}^n$ are partitioned into $k$ classes represented by prototypes $W = \{w_i\}_{i=1}^k$ . With pseudo labels and centroids obtained from the clustering step, cluster discrimination can be implemented by optimizing a standard softmax classification loss as: + +$$ +\mathcal {L} _ {\text {c l u s t e r}} = - \sum_ {i = 1} ^ {n} \log \frac {\exp \left(w _ {i} ^ {T} e _ {i}\right)}{\sum_ {j = 1} ^ {k} \exp \left(w _ {j} ^ {T} e _ {i}\right)}, \tag {2} +$$ + +where $e_i$ is the embedding of the image $x_i$ and $x_i$ belongs to the class represented by $w_i$ . By comparing Eq. 1 and Eq. 2, we can observe the difference that instance discrimination employs an augmented feature $e_i'$ to calculate the similarities while cluster discrimination uses a prototype $w_i$ . + +# 3.2 MULTIMODAL CLUSTERING + +In this paper, we focus on the standard clustering algorithm, $k$ -means, which takes a set of vectors as input and clusters them into $k$ distinct groups based on the nearest neighbor criterion. To seek a better representation, we combined the image and text features produced by the pre-trained CLIP model (Radford et al., 2021) due to their mutual complementary nature. The clustering step jointly learns a $d \times k$ centroid matrix $W$ and the cluster assignments $y_{i}$ of each image $x_{i}$ by solving the following problem: + +$$ +\min _ {W \in \mathbb {R} ^ {d \times k}} \frac {1}{n} \sum_ {i = 1} ^ {n} \min _ {y _ {i} \in \{0, 1 \} ^ {k}} \| \Phi (f (x _ {i}), f ^ {\prime} \left(x _ {i} ^ {\prime}\right)) - W y _ {i} \| _ {2} ^ {2} \quad \text {s . t .} \quad y _ {i} ^ {\top} \mathbf {1} _ {\mathbf {k}} = \mathbf {1}, \tag {3} +$$ + +where $f(x_{i})$ is the image feature embedding by the image encoder $f$ and $f^{\prime}(x_i^{\prime})$ is the text feature embedding by the text encoder $f^{\prime}$ , $\Phi$ is a feature ensemble function, $W\in R^{d\times k}$ is the centroid matrix, $y_{i}$ in $\{0,1\} ^k$ is a single label assignment constrained by $y_{i}^{\top}\mathbf{1}_{\mathbf{k}} = \mathbf{1}$ , and $\mathbf{1}_{\mathbf{k}}$ is 1-vector of size $k$ . In this work, we employ the simplest feature ensemble function, that is, averaging the image and text features, as the CLIP model provides an aligned visual-textual representation. + +Considering that iterative clustering and discrimination are time-consuming, we only employ one step of off-line clustering in this work. Aided by the efficient feature quantization (Johnson et al., 2019), the large-scale LAION 400M dataset can be clustered within 10 minutes using the embedded image and text features. The only hyper-parameter we consider here is the cluster number $k$ . Even though the clustering step is straightforward, the automatically clustered large-scale dataset inevitably + +![](images/37420136887abf7cfbf09ca932d193abea49225c38eb0078ad196cfd05aa0d69.jpg) +Figure 3: Inter-class conflict between the automatically-clustered classes. The class name is given based on the observation of images and texts. Inter-class conflict exists due to specific granularity definitions and multi-label signals in one image. + +confronts inter-class conflict due to multi-label signals in one image and specific definition of class granularity (as illustrated in Fig. 3). For instance, the bird pair in Fig. 3(b) is clustered into wedding pair, which will be conflicted with another specific category of bird. In addition, the close-up capture of wedding flowers in Fig. 3(a) also exists in the class of wedding place, where flowers are the most popular decoration. + +# 3.3 CONFLICT-ROBUST AND REPRESENTATION-COMPACT DISCRIMINATION + +After the clustering step, we can employ a vanilla classification loss (e.g., softmax) to learn the feature representation. For the softmax loss given in Eq. 2, the derivatives to a class-wise prototype $w_{j} \in \mathbb{R}^{d}$ and a sample embedding feature $e_i \in \mathbb{R}^d$ are: + +$$ +\frac {\partial \mathcal {L}}{\partial w _ {j}} = \sum_ {i = 1} ^ {b} \left(p _ {i j} - \mathbb {1} \left\{y _ {i} = = j \right\}\right) e _ {i}, \quad \frac {\partial \mathcal {L}}{\partial e _ {i}} = \sum_ {i = 1} ^ {k} \left(p _ {i j} - \mathbb {1} \left\{y _ {i} = = j \right\}\right) w _ {j}, \tag {4} +$$ + +where $b$ is the batch size, $k$ is the class number, and $p_{ij} = e^{w_j^T e_i} / \sum_{l=1}^k e^{w_l^T e_i}$ is the normalized probability of the sample embedding $e_i$ belonging to the prototype $w_j$ , $\mathbb{1}(\cdot)$ is the indicator function which is 1 when the statement is true and 0 otherwise. In Eq. 4, the derivative of the prototype is a "weighted sum" over sample features from the mini-batch, and the derivative of the sample feature is a "weighted sum" over the prototypes of all classes. If conflicted classes exist, wrong gradient signals from these conflicted negative prototypes will affect the update of model parameters. + +To this end, we propose a random negative prototype selection to efficiently construct a negative prototype subset from the entire negative prototypes. Therefore, the derivative to a sample embedding feature is: + +$$ +\frac {\partial \mathcal {L}}{\partial e _ {i}} = - \left((1 - p ^ {+}) w ^ {+} - \sum_ {j \in \mathbb {S}, j \neq y _ {i}} p _ {j} ^ {-} w _ {j} ^ {-}\right), \tag {5} +$$ + +where $p^+$ and $w^+$ denote the probability and prototype of the positive class, $p_j^-$ and $w_j^-$ refer to negative probabilities and prototypes, $\mathbb{S}$ is a subset of all negative classes and one positive class, $|\mathbb{S}| = k * r_1$ , and $r_1 \in [0, 1]$ is the sampling ratio. Even though all class-wise prototypes are still maintained throughout the whole training process, only positive prototypes and a subset of negative prototypes are selected and updated in each iteration. Therefore, the inter-class conflict will be reduced as the possibility of sampling a conflict negative prototype is directly decreased by $r_1$ . + +To achieve a compact representation for efficient image retrieval, previous methods (Babenko & Lempitsky, 2015; Tolias et al., 2016) adopt Principal Component Analysis (PCA) on an independent set for dimension reduction. To reduce the descriptor dimension to $d'$ , only eigenvectors corresponding to $d'$ largest eigenvalues are retained. However, the representation produced by PCA is sub-optimal because it is a post-processing step detached from the target task. To this end, we propose a feature approximation strategy by randomly selecting subspace features to construct the classification loss: + +$$ +\mathcal {L} _ {\text {u n i c o m}} = - \sum_ {i = 1} ^ {n} \log \frac {\exp \left(\left(\Gamma_ {t} \odot w _ {i}\right) ^ {T} \left(\Gamma_ {t} \odot e _ {i}\right)\right)}{\sum_ {j \in \mathbb {S}} \exp \left(\left(\Gamma_ {t} \odot w _ {j}\right) ^ {T} \left(\Gamma_ {t} \odot e _ {i}\right)\right)}, \tag {6} +$$ + +where $\Gamma_t \in \{0,1\}^d$ is a random binary vector at the iteration step of $t$ , the non-zero element ratio of $\Gamma_t$ is $r_2 \in [0,1]$ , $\odot$ denotes element-wise product. Different from the well-known regularization + +technique, Dropout (Srivastava et al., 2014), our random feature selection $\Gamma_t$ is same for all training samples within the mini-batch. $\Gamma_t$ is applied to both feature $e_i$ and prototypes $w_j$ , thus the dimension of derivatives in Eq. 4 decreases to $d'$ . By contrast, Dropout is independently applied to each individual feature $e_i$ within the mini-batch by setting a specific ratio $r_3 \in [0,1]$ of neurons to 0 and enlarging the rest neurons by $1/(1-r_3)$ . The dimension of derivatives in Eq. 4 is still $d$ . Therefore, the sub-feature optimization in the proposed random feature selection can not be completed by directly calling the Dropout function. Since the binary vector varies at different iterations, different sub-features are trained and sub-gradients are calculated. This leads to a solution that each embedding neuron contains the similarity representation power. + +The schematic of the proposed method is in Fig. 2(b). As shown, the prototype matrix $W$ is maintained in the memory at the dimension of $d \times k$ during the whole training process, but only part of the classes $(k' = k * r_1)$ and features $(d' = d * r_2)$ are randomly selected to construct the softmax loss. The first random selection along the class dimension is for conflict-robust learning to achieve universal representation and the second random selection along the feature dimension is for feature compression required by efficient retrieval. Therefore, we name our method UNIversal and COMpact (UNICOM) representation learning. + +# 4 EXPERIMENTS + +# 4.1 IMPLEMENTATION DETAILS + +Unless otherwise specified, all ViT models in our experiments follow the same architecture designs in CLIP, and are trained from scratch for 32 epochs on the automatically clustered LAION 400M dataset (Section 3.2) with cluster number $k = 1M$ . During training, we randomly crop and horizontally flip each image to get the input image with $224 \times 224$ resolution. We set the random class sampling ratio $r_1$ as 0.1 in the pre-training step. The training is conducted on 128 NVIDIA V100 GPUs across 16 nodes. To save memory and scale up the batch size, mixed-precision and gradient checkpoint are used. We use AdamW (Loshchilov & Hutter, 2018) as the optimizer with an initial learning rate of 0.001, and a weight decay of 0.05. We employ margin-based softmax loss, ArcFace (Deng et al., 2019; 2020), for both pre-training and image retrieval tasks. The margin value is set to 0.3 and the feature scale is set to 64. For supervised retrieval, we follow the data-split settings of the baseline methods (Patel et al., 2022; Ermolov et al., 2022) to fine-tune models. + +# 4.2 COMPARISONS ON FEATURE REPRESENTATION LEARNING + +In this section, we first compare the performance of the proposed method and other baseline models (i.e., CLIP and OPEN-CLIP) on the linear probe and unsupervised image retrieval. Specifically, after the training on the automatically clustered 1M classes, we fix the backbones of our models. For the linear probe task, we learn an additional FC layer for classification on each test set. For unsupervised image retrieval, we directly use the embedding features for testing. Then, we fine-tune the pre-trained models for supervised image retrieval on each image retrieval dataset. + +Linear Probe. Following the same evaluation setting as CLIP (Radford et al., 2021), we freeze the pre-trained models on LAION 400M dataset and only fine-tune the last linear classification layer. We report the linear probing performance over 13 datasets in Tab. 1. The proposed conflict-robust cluster discrimination method significantly outperforms the CLIP and OPEN-CLIP (Ilharco et al., 2021) models. Notably, our ViT B/32, ViT B/16, and ViT L/14 models surpass counterparts of OPEN-CLIP by $3.6\%$ , $2.7\%$ and $1.4\%$ on average with the same training data, indicating that the proposed cluster discrimination can enhance the representation power over instance discrimination. + +Unsupervised Image Retrieval. In Tab. 2, we compare the performance of unsupervised image retrieval by directly using the pre-trained models for feature embedding. The GLDv2 (Weyand et al., 2020) employs mean Average Precision@100 (mAP@100) as the evaluation metric, while other datasets use Recall@1. Our ViT L/14 model achieves $69.9\%$ average result across 7 image retrieval datasets, surpassing the OPEN-CLIP counterpart by $7.5\%$ and even outperforming the larger OPEN-CLIP model ViT H/14 by $5.4\%$ . The reason behind this significant improvement is that the proposed cluster discrimination can capture the semantic structure in data, which is crucial for the image retrieval task. In Fig. 1(a), we compare our method with the state-of-the-art unsupervised image retrieval approach, STML (Kim et al., 2022), under different dimension constraints on the + +Table 1: Top-1 accuracy(%) of linear probe on 13 image classification datasets. The proposed cluster discrimination significantly outperforms OPEN-CLIP (Ilharco et al., 2021) on average by using the same training data (i.e., LAION 400M). "CLIP-R" denotes testing the public CLIP-ViT models in our code base. "-336" refers to one additional epoch of pre-training at a higher $336 \times 336$ resolution to boost performance. + +
CIFAR10CIFAR100Caltech101CarsFlowersFood101BirdsnapSUN397DTDAircraftPetsEuroSATImageNetAverage
CLIPViT B/3295.180.593.081.896.988.858.576.676.552.090.097.076.181.8
ViT B/1696.283.194.786.798.192.867.878.479.259.593.197.180.285.1
ViT L/1498.087.596.590.999.295.277.081.882.169.495.198.283.988.8
ViT L/14-33697.987.496.091.599.295.979.982.283.071.695.198.185.489.5
CLIP-RViT B/3296.082.594.186.097.892.761.179.178.458.993.095.375.383.9
ViT B/1696.082.594.186.097.892.769.579.178.458.993.095.379.684.8
ViT L/1498.187.296.090.799.295.377.881.580.968.094.996.784.188.5
ViT L/14-33697.887.196.391.499.295.980.982.282.471.295.196.884.989.3
OPENViT B/3295.382.293.387.596.586.261.475.378.852.488.096.573.882.1
ViT B/1696.484.094.191.898.190.771.278.781.659.390.096.278.585.4
ViT L/1497.987.995.593.698.893.378.081.083.064.493.397.181.588.1
OursViT B/3296.886.694.693.398.585.870.274.678.070.793.196.875.085.7
ViT B/1697.387.795.194.398.991.279.377.181.273.493.997.079.188.1
ViT L/1498.590.895.794.699.393.482.480.082.274.594.296.781.889.5
ViT L/14-33698.590.795.795.199.494.385.179.782.078.194.597.282.790.2
+ +Table 2: Performance of unsupervised image retrieval on 7 image retrieval datasets. The proposed conflict-robust cluster discrimination significantly outperforms OPEN-CLIP on average by using the same training data. + +
CUBCarsSOPIn-ShopINaturalistVehicleIDGLDv2Average
SmallMediumLargePrivatePublic
CLIPB/3256.779.060.545.453.054.852.244.67.57.546.1
B/1666.185.263.256.163.155.150.943.88.410.650.3
L/1476.090.365.662.972.962.458.951.812.113.656.7
L/14-33677.390.967.866.376.864.160.353.817.015.659.0
OPENB/3262.389.265.964.654.971.067.159.99.178.455.2
B/1671.492.968.774.264.173.370.163.712.111.060.2
L/1479.494.970.677.171.072.069.162.014.513.862.4
H/1483.195.772.778.877.072.769.761.917.715.364.5
OursB/3283.795.970.072.864.674.972.065.415.113.362.8
B/1686.596.870.474.673.674.570.658.718.717.264.2
L/1488.596.972.783.677.183.780.274.621.120.169.9
L/14-33689.297.374.586.781.084.181.475.623.222.071.5
+ +CUB dataset. We set the random feature selection ratio $r_2$ as 0.5 for one additional training epoch on the LAION 400M dataset. Then, we select the first 256-D, 128-D, 64-D, and 32-D features for testing. STML employs an ImageNet-1K pre-trained GoogleNet (Szegedy et al., 2015) and then explores unsupervised training on the CUB dataset. Even though our ViT-based model is only trained on the automatically clustered LAION 400M dataset without any further training on the image retrieval dataset, our method outperforms STML (Kim et al., 2022) by a large margin across different test dimensions, indicating the superiority of the proposed random feature selection for compact feature representation learning. + +Fine-tune for ImageNet-1K Classification. In Tab. 3, we compare our method with state-of-the-art supervised and weakly supervised pre-training (Dosovitskiy et al., 2021; Zhai et al., 2022; Singh et al., 2022) in transfer-learning experiments on ImageNet-1k. Our models consistently outperform OPENCLIP models in the Top-1 accuracy, showing the superiority of the proposed cluster discrimination. For ViT B/16, our pre-training achieves $85.9\%$ , surpassing both the supervised pre-training on IN-21K $(84.0\%)$ and the weakly supervised pre-training on IG 3.6B $(85.3\%)$ . In addition, our ViT L/14 obtains $88.3\%$ , outperforming ViT L/16 pre-trained on JFT 300M $(87.8\%)$ and ViT L/16 pre-trained on IG 3.6B $(88.1\%)$ . The overall results in ImageNet-1K classification task show that our models are + +Table 3: Transfer-learning accuracy of models pre-trained on the specified dataset followed by fine-tuning and testing on ImageNet. + +
ModelPre-training DatasetResolutionIN-1K Top-1 AccuracyFLOPs (B)
PretrainFinetune
Supervised pre-training
ViT L/32 (Dosovitskiy et al., 2021)IN-21k22438481.354.4
ViT B/16 (Dosovitskiy et al., 2021)IN-21k22438484.055.6
ViT L/16 (Dosovitskiy et al., 2021)IN-21k22438485.2191.5
ViT L/16 (Dosovitskiy et al., 2021)JFT 300M22451287.8362.9
ViT L/16 (Zhai et al., 2022)JFT 3B22438488.5191.5
Weakly supervised pre-training
ViT B/16 (Singh et al., 2022)IG 3.6B22438485.355.6
ViT L/16 (Singh et al., 2022)IG 3.6B22451288.1362.9
ViT B/32 OPEN-CLIPLAION 400M22438483.015.5
ViT B/16 OPEN-CLIPLAION 400M22438485.455.6
ViT L/14 OPEN-CLIPLAION 400M22451887.7507.8
ViT B/32 OursLAION 400M22438483.615.5
ViT B/16 OursLAION 400M22438485.955.6
ViT L/14 OursLAION 400M22451888.3507.8
+ +Table 4: Performance of supervised image retrieval on 7 image retrieval datasets. + +
ViT-B/32ViT-B/16ViT-L/14ViT-L/14-336Previous SOTA
CUB85.888.889.790.185.6 ViT-S/16 (Ermolov et al., 2022)
Cars97.397.797.998.294.8 SE-ResNet-50 (Jun et al., 2019)
SOP87.188.889.991.288.0 ViT-B/16 (Patel et al., 2022)
In-Shop94.895.596.096.792.7 ViT-S/16 (Ermolov et al., 2022)
INaturalist72.882.585.488.983.9 ViT-B/16 (Patel et al., 2022)
VehicleID-Small95.496.496.597.096.2 ViT-B/16 (Patel et al., 2022)
VehicleID-Medium94.195.195.796.195.2 ViT-B/16 (Patel et al., 2022)
VehicleID-Large93.695.095.496.094.7 ViT-B/16 (Patel et al., 2022)
GLDv2-Private32.635.736.136.432.5 ResNet101 (Lee et al., 2022)
GLDv2-Public29.732.433.033.124.6 ResNet50 (Tan et al., 2021)
+ +very competitive as they can achieve better or comparable accuracy even though the training data used by the competitors are much larger (e.g., JFT 3B and IG 3.6B). + +Fine-tune for Supervised Image Retrieval. In Tab. 4, we compare the proposed approach with the latest image retrieval methods (Patel et al., 2022; Ermolov et al., 2022) trained with vision transformer. During fine-tuning of our models, the random negative class selection ratio $r_1$ is set to 1.0 as the training data is clean. Under different computing regimes, the proposed method consistently surpasses RA@K (Patel et al., 2022) on the SOP, iNaturalist, and VehicleID datasets and outperforms Hyp-ViT (Ermolov et al., 2022) on the CUB and In-shop datasets. + +# 4.3 ABLATION STUDY + +Encoder for Clustering. In Tab. 5, we compare the results of linear probe and unsupervised image retrieval under image-based clustering and text-based clustering by using the pre-trained CLIP and OPEN-CLIP models. As we can see, the text encoder is more powerful than the image encoder, and image and text signals are complementary as the joint clustering significantly outperforms each individual. By referring to Tab. 1 and Tab. 2, the OPEN-CLIP ViT B/32 model achieves $82.1\%$ and $55.2\%$ average results on the linear probe and unsupervised image retrieval tasks, while the proposed cluster discrimination method $(r_1 = 0.1)$ significantly boosts the performance to $84.1\%$ and $61.1\%$ by using the OPEN-CLIP image and text models for clustering. By using the CLIP image and text models for clustering, the performance can further increase to $85.7\%$ and $62.8\%$ on the linear probe and unsupervised image retrieval tasks. Therefore, we choose the CLIP models for clustering. + +Cluster Number. In Tab. 5, we also compare the performance under different cluster numbers, i.e., 100K, 1M, and 10M, by using the CLIP image and text models. As can be seen, the best results can be achieved when the cluster number is set as 1 million, with the average image number per class being + +Table 5: Ablation study on multi-modal clustering. ViT B/32 is used here for model training on the LAION 400M dataset, which is automatically clustered by different pre-trained models. We report the average performance of linear probe and unsupervised image retrieval. + +
TasksCLIPOPEN-CLIPCluster Number by CLIP
ImageTextJointImageTextJoint100K1M10M
Linear Probe84.485.385.783.984.084.175.985.783.6
Unsup. Retr.61.862.362.858.960.161.153.262.860.7
+ +Table 6: Ablation study on random negative class selection and random feature selection. ViT-B/32 is used here and we report the average performance of linear probe and unsupervised image retrieval. + +
TasksRandom Class Ratio (r1)Random Feature Ratio (r2)Dropout Ratio (r3)
0.050.10.31.01.00.50.250.250.5
Linear Probe85.185.784.977.985.785.584.285.485.1
Unsup. Retr.62.362.862.155.962.862.762.062.562.3
Unsup. Retr. 256----61.461.861.060.760.1
+ +around 400. The cluster number needs to be balanced between the intra-class noises and inter-class noises. Too small cluster numbers will incur heavy intra-class noise, which dramatically decreases the performance of the pre-trained classification model. Besides, too many clusters will increase the computation and storage burden on the FC layer. Most important, the over-decomposition will increase the inter-class noise ratio and undermine the discriminative power of the pre-trained model. + +Random Class Selection. In Tab. 6, we train ViT B/32 models under different inter-class sampling ratios. The basic margin-based softmax loss $(r_1 = 1.0)$ only achieves $77.9\%$ on the linear probe task as it can hardly adapt to the heavy inter-class conflict in the automatically clustered dataset. When the sampling ratio is decreased from 1.0 to 0.3 and 0.1, our method exhibits consistently better performance than the baseline, indicating random inter-class sampling is beneficial for the model's robustness. When $r_1$ is set to 0.05, there is a slight performance drop because the inter-class interaction is insufficient during training. Therefore, we choose the random negative class selection ratio as 0.1, obtaining $85.7\%$ and $62.8\%$ on the linear probe and unsupervised image retrieval tasks. + +Random Feature Selection. In Tab. 6, we compare the performance of the proposed Unicom under different random feature selection ratios $(r_2)$ on the task of dimension-constrained unsupervised image retrieval. Here, we also include Dropout at different drop ratios $(r_3)$ for comparison. From the results, we can have the following observations: (1) both random feature selection and Dropout can not improve linear probe and unsupervised image retrieval at a full dimension of 512 as the LAION 400M dataset is large enough and regularization is not necessary for the final classification layer, (2) there is slight performance drop when the random feature selection ratio is decreasing, and (3) the proposed random feature selection $(r_2 = 0.5)$ can improve $0.4\%$ for 256-D unsupervised image retrieval, while Dropout can not improve dimension-constrained unsupervised image retrieval. Even though Dropout enforces partial features for classification, the global randomization within the mini-batch makes the optimization involve all feature dimensions. By contrast, the proposed random feature selection is fixed within the mini-batch thus it can benefit from optimization in a sub-feature space. + +# 5 CONCLUSIONS + +This paper introduces Unicom, a simple yet effective framework for universal and compact feature embedding. Given the automatically clustered large-scale data, we employ one random negative class selection to improve the robustness under the heavy inter-class conflict and another random feature selection to improve the compactness of the feature representation. For both unsupervised and supervised image retrieval on different datasets, the proposed Unicom achieves state-of-the-art performance, confirming that cluster discrimination is beneficial to explore the semantic structure within the large-scale training data. + +# REFERENCES + +Xiang An, Xuhan Zhu, Yuan Gao, Yang Xiao, Yongle Zhao, Ziyong Feng, Lan Wu, Bin Qin, Ming Zhang, Debing Zhang, and Ying Fu. Partial fc: Training 10 million identities on a single machine. In ICCV Workshops, 2021. +Xiang An, Jiankang Deng, Jia Guo, Ziyong Feng, XuHan Zhu, Jing Yang, and Tongliang Liu. Killing two birds with one stone: Efficient and robust training of face recognition cnns by partial fc. In CVPR, 2022. +Yuki Markus Asano, Christian Rupprecht, and Andrea Vedaldi. Self-labelling via simultaneous clustering and representation learning. In ICLR, 2020. +Artem Babenko and Victor Lempitsky. Aggregating deep convolutional features for image retrieval. In ICCV, 2015. +Thomas Berg, Jiongxin Liu, Seung Woo Lee, Michelle L Alexander, David W Jacobs, and Peter N Belhumeur. Birdsnap: Large-scale fine-grained visual categorization of birds. In CVPR, 2014. +Lukas Bossard, Matthieu Guillaumin, and Luc Van Gool. Food-101-mining discriminative components with random forests. In ECCV, 2014. +Mathilde Caron, Piotr Bojanowski, Armand Joulin, and Matthijs Douze. Deep clustering for unsupervised learning of visual features. In ECCV, 2018. +Mathilde Caron, Ishan Misra, Julien Mairal, Priya Goyal, Piotr Bojanowski, and Armand Joulin. Unsupervised learning of visual features by contrasting cluster assignments. In NeurIPS, 2020. +Ting Chen, Simon Kornblith, Kevin Swersky, Mohammad Norouzi, and Geoffrey E Hinton. Big self-supervised models are strong semi-supervised learners. In NeurIPS, 2020. +Xinlei Chen and Kaiming He. Exploring simple siamese representation learning. In CVPR, 2021. +Mircea Cimpoi, Subhransu Maji, Iasonas Kokkinos, Sammy Mohamed, and Andrea Vedaldi. Describing textures in the wild. In CVPR, 2014. +Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, 2009. +Jiankang Deng, Jia Guo, Niannan Xue, and Stefanos Zafeiriou. Arcface: Additive angular margin loss for deep face recognition. In CVPR, 2019. +Jiankang Deng, Jia Guo, Tongliang Liu, Mingming Gong, and Stefanos Zafeiriou. Sub-center arcface: Boosting face recognition by large-scale noisy web faces. In ECCV, 2020. +Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. In ICLR, 2021. +Aleksandr Ermolov, Leyla Mirvakhabova, Valentin Khrulkov, Nicu Sebe, and Ivan Oseledets. Hyperbolic vision transformers: Combining improvements in metric learning. In CVPR, 2022. +Li Fei-Fei, Rob Fergus, and Pietro Perona. Learning generative visual models from few training examples: An incremental bayesian approach tested on 101 object categories. In CVPR Workshops, 2004. +Raia Hadsell, Sumit Chopra, and Yann LeCun. Dimensionality reduction by learning an invariant mapping. In CVPR, 2006. +Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. +Kaiming He, Georgia Gkioxari, Piotr Dlár, and Ross Girshick. Mask r-cnn. In ICCV, 2017. + +Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In CVPR, 2020. +Kaiming He, Xinlei Chen, Saining Xie, Yanghao Li, Piotr Dólár, and Ross Girshick. Masked autoencoders are scalable vision learners. In CVPR, 2022. +Patrick Helber, Benjamin Bischke, Andreas Dengel, and Damian Borth. Eurosat: A novel dataset and deep learning benchmark for land use and land cover classification. IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, 2019. +Gabriel Ilharco, Mitchell Wortsman, Ross Wightman, Cade Gordon, Nicholas Carlini, Rohan Taori, Achal Dave, Vaishaal Shankar, Hongseok Namkoong, John Miller, Hannaneh Hajishirzi, Ali Farhadi, and Ludwig Schmidt. Openclip, 2021. +Ahmet Iscen, Giorgos Tolias, Yannis Avrithis, and Ondrej Chum. Mining on manifolds: Metric learning without labels. In CVPR, 2018. +Chao Jia, Yinfei Yang, Ye Xia, Yi-Ting Chen, Zarana Parekh, Hieu Pham, Quoc Le, Yun-Hsuan Sung, Zhen Li, and Tom Duerig. Scaling up visual and vision-language representation learning with noisy text supervision. In ICML, 2021. +Jeff Johnson, Matthijs Douze, and Hervé Jégou. Billion-scale similarity search with gpus. IEEE Transactions on Big Data, 2019. +HeeJae Jun, Byungsoo Ko, Youngjoon Kim, Insik Kim, and Jongtack Kim. Combination of multiple global descriptors for image retrieval. arXiv:1903.10663, 2019. +Shichao Kan, Yigang Cen, Yang Li, Vladimir Mladenovic, and Zhihai He. Relative order analysis and optimization for unsupervised deep metric learning. In CVPR, 2021. +Sungyeon Kim, Dongwon Kim, Minsu Cho, and Suha Kwak. Embedding transfer with label relaxation for improved metric learning. In CVPR, 2021. +Sungyeon Kim, Dongwon Kim, Minsu Cho, and Suha Kwak. Self-taught metric learning without labels. In CVPR, 2022. +Jonathan Krause, Jia Deng, Michael Stark, and Li Fei-Fei. Collecting a large-scale dataset of fine-grained cars. 2013a. +Jonathan Krause, Michael Stark, Jia Deng, and Li Fei-Fei. 3d object representations for fine-grained categorization. In ICCV workshops, 2013b. +Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. 2009. +Seongwon Lee, Hongje Seong, Suhyeon Lee, and Euntai Kim. Correlation verification for image retrieval. In CVPR, 2022. +Junnan Li, Pan Zhou, Caiming Xiong, and Steven Hoi. Prototypical contrastive learning of unsupervised representations. In ICLR, 2020a. +Yang Li, Shichao Kan, and Zhihai He. Unsupervised deep metric learning with transformed attention consistency and contrastive clustering loss. In ECCV, 2020b. +Yanghao Li, Hanzi Mao, Ross Girshick, and Kaiming He. Exploring plain vision transformer backbones for object detection. In ECCV, 2022. +Jongin Lim, Sangdoo Yun, Seulki Park, and Jin Young Choi. Hypergraph-induced semantic tuple loss for deep metric learning. In CVPR, 2022. +Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dóllár, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In ECCV, 2014. +Hongye Liu, Yonghong Tian, Yaowei Yang, Lu Pang, and Tiejun Huang. Deep relative distance learning: Tell the difference between similar vehicles. In CVPR, 2016a. + +Ziwei Liu, Ping Luo, Shi Qiu, Xiaogang Wang, and Xiaou Tang. Deepfashion: Powering robust clothes recognition and retrieval with rich annotations. In CVPR, 2016b. +Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In ICLR, 2018. +Dhruv Mahajan, Ross Girshick, Vignesh Ramanathan, Kaiming He, Manohar Paluri, Yixuan Li, Ashwin Bharambe, and Laurens Van Der Maaten. Exploring the limits of weakly supervised pretraining. In ECCV, 2018. +Subhransu Maji, Esa Rahtu, Juho Kannala, Matthew Blaschko, and Andrea Vedaldi. Fine-grained visual classification of aircraft. arXiv:1306.5151, 2013. +Kevin Musgrave, Serge Belongie, and Ser-Nam Lim. A metric learning reality check. In ECCV, 2020. +Maria-Elena Nilsback and Andrew Zisserman. Automated flower classification over a large number of classes. In Indian Conference on Computer Vision, Graphics & Image Processing, 2008. +Mehdi Noroozi and Paolo Favaro. Unsupervised learning of visual representations by solving jigsaw puzzles. In ECCV, 2016. +Hyun Oh Song, Yu Xiang, Stefanie Jegelka, and Silvio Savarese. Deep metric learning via lifted structured feature embedding. In CVPR, 2016. +Omkar M Parkhi, Andrea Vedaldi, Andrew Zisserman, and CV Jawahar. Cats and dogs. In CVPR, 2012. +Yash Patel, Giorgos Tolias, and Jiří Matas. Recall@k surrogate loss with large batches and similarity mixup. In CVPR, 2022. +Qi Qian, Lei Shang, Baigui Sun, Juhua Hu, Hao Li, and Rong Jin. Softtriple loss: Deep metric learning without triplet sampling. In ICCV, 2019. +Qi Qian, Yuanhong Xu, Juhua Hu, Hao Li, and Rong Jin. Unsupervised visual representation learning by online constrained k-means. In CVPR, 2022. +Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In ICML, 2021. +Karsten Roth, Oriol Vinyals, and Zeynep Akata. Non-isotropy regularization for proxy-based deep metric learning. In CVPR, 2022. +Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li Fei-Fei. Imagenet large scale visual recognition challenge. IJCV, 2015. +Florian Schroff, Dmitry Kalenichenko, and James Philbin. Facenet: A unified embedding for face recognition and clustering. In CVPR, 2015. +Mannat Singh, Laura Gustafson, Aaron Adcock, Vinicius de Freitas Reis, Bugra Gedik, Raj Prateek Kosaraju, Dhruv Mahajan, Ross Girshick, Piotr Dólar, and Laurens van der Maaten. Revisiting weakly supervised pre-training of visual perception models. In CVPR, 2022. +Kihyuk Sohn. Improved deep metric learning with multi-class n-pair loss objective. In NeurIPS, 2016. +Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. JMLR, 2014. +Yifan Sun, Changmao Cheng, Yuhan Zhang, Chi Zhang, Liang Zheng, Zhongdao Wang, and Yichen Wei. Circle loss: A unified perspective of pair similarity optimization. In CVPR, 2020. + +Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In CVPR, 2015. +Fuwen Tan, Jiangbo Yuan, and Vicente Ordonez. Instance-level image retrieval using reranking transformers. In ICCV, 2021. +Giorgos Tolias, Ronan Sicre, and Hervé Jégou. Particular object retrieval with integral max-pooling of cnn activations. In ICLR, 2016. +Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers & distillation through attention. In ICML, 2021. +Grant Van Horn, Oisin Mac Aodha, Yang Song, Yin Cui, Chen Sun, Alex Shepard, Hartwig Adam, Pietro Perona, and Serge Belongie. The inaturalist species classification and detection dataset. In CVPR, 2018. +Xun Wang, Xintong Han, Weilin Huang, Dengke Dong, and Matthew R Scott. Multi-similarity loss with general pair weighting for deep metric learning. In CVPR, 2019. +Peter Welinder, Steve Branson, Takeshi Mita, Catherine Wah, Florian Schroff, Serge Belongie, and Pietro Perona. Caltech-ucsd birds 200. 2010. +Tobias Weyand, Andre Araujo, Bingyi Cao, and Jack Sim. Google landmarks dataset v2-a large-scale benchmark for instance-level recognition and retrieval. In CVPR, 2020. +Jianxiong Xiao, James Hays, Krista A Ehinger, Aude Oliva, and Antonio Torralba. Sun database: Large-scale scene recognition from abbey to zoo. In CVPR, 2010. +Hongwei Xu, Suncheng Xiang, and Dahong Qian. Subface: Learning with softmax approximation for face recognition. arXiv:2208.11483, 2022. +Jiexi Yan, Lei Luo, Cheng Deng, and Heng Huang. Unsupervised hyperbolic metric learning. In CVPR, 2021. +Andrew Zhai and Hao-Yu Wu. Classification is a strong baseline for deep metric learning. In BMVC, 2019. +Xiaohua Zhai, Alexander Kolesnikov, Neil Houlsby, and Lucas Beyer. Scaling vision transformers. In CVPR, 2022. +Xiaohang Zhan, Jiahao Xie, Ziwei Liu, Yew-Soon Ong, and Chen Change Loy. Online deep clustering for unsupervised representation learning. In CVPR, 2020. + +# A APPENDIX + +# A.1 MODEL ARCHITECTURES + +We follow the same architecture design as CLIP. Tab. 7 describes the details of architectures. + +# A.2 VISUALIZATION OF PSEUDO CLUSTERS AND DATA DISTRIBUTION + +In Fig. 4, we show the data distribution under different settings of class number $k$ . In Fig. 5, we show some exemplar classes from the proposed automatic clustering. As we can see, there are some fine-grained classes, such as the top with love icons and the top with cartoons. Even though such clustering is reasonable and explainable, there is class confusion if we classify these samples from other views, such as color and targeting customer age. + +Table 7: The architecture parameters for ViT models. + +
ModelBatch Size (128 V100)FLOPs GEmbedding dimensionInput resolutionVision layersTransformer widthheads
ViT-B/32256*1284.35122241276812
ViT-B/16256*12817.67682241276812
ViT-L/1464*12880.976822424102416
ViT-L/14-33648*128191.376833624102416
+ +![](images/1965f61633769e64abc0609757edf4aba2ca0412e0a895e6404f261dbad3ef6c.jpg) +(a) $\mathrm{k} = {100},{000}$ + +![](images/679610562f66917f34f813d1747b112eefe56373ef777a9164b8d887d91f0ae0.jpg) +(b) $\mathrm{k} = {1000},{000}$ + +![](images/5d97eb266535b23f65967d826e550f1a937e46d9e507da72963653212313da2f.jpg) +(c) $\mathrm{k} = {10},{000},{000}$ + +![](images/7d000df5598c228e3a1ac33075bd68e2d3662029f0f94dc37d97d12488b0a049.jpg) +Figure 4: Data distribution under different settings of cluster number $k$ . + +![](images/af30e3f3e63ce8cbea3ecd8684213c333cc35059358e3817c8cdb209b13acc13.jpg) +(b) Bag+Wing + +![](images/0ea966805e53f5650ca8e37c640ab021121891b38369559d1449a5e032d607f4.jpg) +(c) Bag+Fantasy + +![](images/c4fe9513aaac20a9fc2cdbf2a2eb7171f0286b4350bf738fc1c47605f1c88dd5.jpg) +(a) Bag+Monkey +(d) Top+Love + +![](images/0e1b626886e42a1fb0455411b3f5ff96e6d1974ac5c422437ec8f7ed730ef2ed.jpg) +(e) Grey Top+Pink Sleeve + +![](images/7294f0c7f5285d7feaa0d17003e16b85edd385dccd4b19bffef4e3e213b9a813.jpg) +(f) Top+Cartoon + +![](images/213dc0de184249c07341e4233571186ffc11545e69337c3ff0976fac0bcfdcde.jpg) +Figure 5: Pseudo classes clustered by the image encoder and text encoder of the pre-trained CLIP model. The class name is given based on the manual observation of images and texts. +Figure 6: Training loss curves of fine-tuning from the CLIP model and training from scratch. + +Table 8: Comparison between fine-tuning and training from scratch. Top-1 accuracy(%) of linear probe is reported on 13 image classification datasets. ViT B/32 is used here. + +
CIFAR10CIFAR100Caltech101CarsFlowersFood101BirdsnapSUN397DTDAircraftPetsEurosATImageNetAverage
ViT B/32 (Scratch)96.886.694.693.398.585.870.274.678.070.793.196.875.085.7
ViT B/32 (Fine-tune)95.883.394.192.498.587.367.375.379.866.592.896.175.185.0
+ +Table 9: Object detection and instance segmentation on COCO. We evaluate bounding-box AP (APbb) and mask AP (APmk) on val2017. + +
MethodPre-training Data\(AP^{bb}\)\(AP^{bb}_{50}\)\(AP^{bb}_{75}\)\(AP^{mk}\)\(AP^{mk}_{50}\)\(AP^{mk}_{75}\)
ViT B/16 (Li et al., 2022)IN-1K47.6--42.4--
ViT B/16 (Li et al., 2022)IN-21K47.8--42.6--
ViT B/16 OPEN-CLIPLAION 400M48.169.151.742.666.444.3
ViT B/16 OursLAION 400M48.569.852.442.966.945.9
+ +# A.3 TRAINING FROM SCRATCH VS. FINE-TUNING FROM THE CLIP MODEL + +In this paper, the CLIP model is only used for the clustering step and our models are trained from scratch. In Fig. 6, we compare the training loss curves between fine-tuning and training from scratch. For fine-tuning, the backbone is initialized from the CLIP model (ViT-B/12), and the classifier (FC layer) is randomly initialized. The fine-tuning strategy can converge faster than training from scratch, but the final loss value is higher. In Tab. 8, we also find that training from scratch outperforms fine-tuning from the CLIP model by $0.7\%$ on the task of linear probe. + +# A.4 COMPARISONS ON COCO DETECTION AND SEGMENTATION + +Following the experiment setting in (Li et al., 2022), we use Mask R-CNN (He et al., 2017) for bounding-box object detection and instance segmentation. We fine-tune models on the COCO (Lin et al., 2014) train2017 split and evaluate on the val2017 split. In Tab. 9, our method outperforms both OPEN-CLIP and supervised pre-training in all metrics, demonstrating the effectiveness of the proposed cluster discrimination. + +# A.5 LINEAR PROBE DATASETS + +We use 13 image classification datasets to prove the effectiveness of our method. These datasets include CIFAR10(Krizhevsky & Hinton, 2009), CIFAR100(Krizhevsky & Hinton, 2009), Caltech101(Fei-Fei et al., 2004), Stanford Cars(Krause et al., 2013a), Oxford Flowers(Nilsback & Zisserman, 2008), Food-101(Bossard et al., 2014), Birdsnap(Berg et al., 2014), SUN397(Xiao et al., 2010), Describable Textures(Cimpoi et al., 2014), FGVC Aircraft(Maji et al., 2013), Oxford-IIIT Pets(Parkhi et al., 2012), EuroSAT(Helber et al., 2019), ImageNet-1k(Russakovsky et al., 2015). Details on each dataset and the corresponding evaluation metrics are provided in Tab. 10. + +# A.6 IMAGE RETRIEVAL DATASETS + +The training and evaluation of image retrieval experiments on seven widely used datasets, namely CUB-200-2011(CUB) (Welinder et al., 2010), Stanford Cars(Cars196) (Krause et al., 2013b), Stanford Online Products(SOP) (Oh Song et al., 2016), In-shop Clothes Retrieval(In-Shop) (Liu et al., 2016b), iNaturalist (Van Horn et al., 2018), VehicleID (Liu et al., 2016a), and Google Landmarks dataset (GLDv2) (Weyand et al., 2020). The number of examples and classes can be found in Tab. 11. + +Table 10: List of linear probe datasets with the data distribution and evaluation metrics. + +
DatasetClassesTrain sizeTest sizeEvaluation metric
CIFAR-101050,00010,000accuracy
CIFAR-10010050,00010,000accuracy
Caltech-1011023,0606,085mean-per-class
Stanford Cars1968,1448,041accuracy
Oxford Flowers1022,0406,149mean per class
Food-10110275,75025,250accuracy
Birdsnap50042,2832,149accuracy
SUN39739719,85019,850accuracy
Describable Textures473,7601,880accuracy
FGVC Aircraft1006,6673,333mean per class
Oxford-IIIT Pets373,6803,669mean per class
EuroSAT1010,0005,000accuracy
ImageNet10001,281,16750,000accuracy
+ +Table 11: Dataset composition for training and evaluation in the image retrieval task. + +
DatasetImagesClasses
CUB Train (Welinder et al., 2010)5,864100
CUB Test (Welinder et al., 2010)5,924100
Cars196 Train (Krause et al., 2013b)8,05498
Cars196 Test (Krause et al., 2013b)8,13198
SOP Train (Oh Song et al., 2016)59,55111,318
SOP Test (Oh Song et al., 2016)60,50211,316
In-Shop (Liu et al., 2016b)25,8823,997
In-Shop (Liu et al., 2016b)26,8303,985
iNaturalist Train (Van Horn et al., 2018)325,8465,690
iNaturalist Test (Van Horn et al., 2018)136,0932,452
VehicleID Train (Liu et al., 2016a)110,17813,134
VehicleID Test (Liu et al., 2016a)40,3654,800
GLDv2 Train (Weyand et al., 2020)1,580,47081,314
GLDv2 Test (Weyand et al., 2020)762,8841,129
\ No newline at end of file diff --git a/unicomuniversalandcompactrepresentationlearningforimageretrieval/images.zip b/unicomuniversalandcompactrepresentationlearningforimageretrieval/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..24028af800bad73bbdccc39700f95406c7b38afc --- /dev/null +++ b/unicomuniversalandcompactrepresentationlearningforimageretrieval/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:57ae7d008e59d52c1c6544277a048eb06852e10a10d31c68eef0c8cde6d21803 +size 917834 diff --git a/unicomuniversalandcompactrepresentationlearningforimageretrieval/layout.json b/unicomuniversalandcompactrepresentationlearningforimageretrieval/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..a895dc798606ad5446cd3ec2fe35c85353788ea2 --- /dev/null +++ b/unicomuniversalandcompactrepresentationlearningforimageretrieval/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c29250a6234c33cc89f6dc66938e638f00fed13c8497c8f2d9f2e3db99ca5b04 +size 502274 diff --git a/unifieddetoxifyinganddebiasinginlanguagegenerationviainferencetimeadaptiveoptimization/dd4178fd-0397-46c3-a674-f0911dee7a47_content_list.json b/unifieddetoxifyinganddebiasinginlanguagegenerationviainferencetimeadaptiveoptimization/dd4178fd-0397-46c3-a674-f0911dee7a47_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..759d178f4c16c6f1d9d49cade12cdea42f5db7d6 --- /dev/null +++ b/unifieddetoxifyinganddebiasinginlanguagegenerationviainferencetimeadaptiveoptimization/dd4178fd-0397-46c3-a674-f0911dee7a47_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:90ddb445b57a7ced3c711a1f70e9a193e1ef141fd210085ab955b57d589798ce +size 270520 diff --git a/unifieddetoxifyinganddebiasinginlanguagegenerationviainferencetimeadaptiveoptimization/dd4178fd-0397-46c3-a674-f0911dee7a47_model.json b/unifieddetoxifyinganddebiasinginlanguagegenerationviainferencetimeadaptiveoptimization/dd4178fd-0397-46c3-a674-f0911dee7a47_model.json new file mode 100644 index 0000000000000000000000000000000000000000..a9cc88ca6baf1eb73ffa3b59e227b686095027d8 --- /dev/null +++ b/unifieddetoxifyinganddebiasinginlanguagegenerationviainferencetimeadaptiveoptimization/dd4178fd-0397-46c3-a674-f0911dee7a47_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:78e0e689637b8799aed5d7b4cc6f234af96f50b8f175433d5173a3d24b7d1cc6 +size 314121 diff --git a/unifieddetoxifyinganddebiasinginlanguagegenerationviainferencetimeadaptiveoptimization/dd4178fd-0397-46c3-a674-f0911dee7a47_origin.pdf b/unifieddetoxifyinganddebiasinginlanguagegenerationviainferencetimeadaptiveoptimization/dd4178fd-0397-46c3-a674-f0911dee7a47_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..2ed61b245884ed2b4891fe40e11cc4c60b0c94d4 --- /dev/null +++ b/unifieddetoxifyinganddebiasinginlanguagegenerationviainferencetimeadaptiveoptimization/dd4178fd-0397-46c3-a674-f0911dee7a47_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c00d6274800a4022cdf2960ca1d67a793948837761fe3d1c0c98e7ac9dd5111b +size 2865956 diff --git a/unifieddetoxifyinganddebiasinginlanguagegenerationviainferencetimeadaptiveoptimization/full.md b/unifieddetoxifyinganddebiasinginlanguagegenerationviainferencetimeadaptiveoptimization/full.md new file mode 100644 index 0000000000000000000000000000000000000000..58ec4179945936b66e428440488f46cc2b157524 --- /dev/null +++ b/unifieddetoxifyinganddebiasinginlanguagegenerationviainferencetimeadaptiveoptimization/full.md @@ -0,0 +1,904 @@ +# UNIFIED DETOXIFYING AND DEBIASING IN LANGUAGE GENERATION VIA INFERENCE-TIME ADAPTIVE OPTIMIZATION + +Zonghan Yang $^{1,2,5*}$ , Xiaoyuan Yi $^{3,\dagger}$ , Peng Li $^{4,7,\dagger}$ , Yang Liu $^{1,2,4,5,6,7}$ , Xing Xie $^{3}$ + +$^{1}$ Dept. of Comp. Sci. & Tech., Institute for AI, Tsinghua University, Beijing, China; $^{2}$ Beijing National Research Center for Information Science and Technology; $^{3}$ Microsoft Research Asia; $^{4}$ Institute for AI Industry Research, Tsinghua University, Beijing, China; $^{5}$ Beijing Academy of Artificial Intelligence; $^{6}$ International Innovation Center of Tsinghua University, Shanghai, China; $^{7}$ Shanghai Artificial Intelligence Laboratory, Shanghai, China + +# ABSTRACT + +Warning: this paper contains model outputs exhibiting offensiveness and biases. Recently pre-trained language models (PLMs) have prospered in various natural language generation (NLG) tasks due to their ability to generate fairly fluent text. Nevertheless, these models are observed to capture and reproduce harmful contents in training corpora, typically toxic language and social biases, raising severe moral issues. Prior works on ethical NLG tackle detoxifying and debiasing separately, which is problematic since we find debiased models still exhibit toxicity while detoxified ones even exacerbate social biases. To address such a challenge, we propose the first unified framework of detoxifying and debiasing called UDDIA, which jointly formalizes these two problems as rectifying the output space. We theoretically interpret our framework as learning a text distribution mixing weighted attributes. Besides, UDDIA conducts adaptive optimization of only a few parameters during decoding based on a parameter-efficient tuning schema without any training data. This leads to minimal generation quality loss and improved rectification performance with acceptable computational cost. Experimental results demonstrate that compared to several strong baselines, UDDIA achieves debiasing and detoxifying simultaneously and better balances efficiency and effectiveness, taking a further step towards practical ethical NLG. + +# 1 INTRODUCTION + +Transformer (Vaswani et al., 2017) based Pre-trained Language Models (PLMs) (Radford et al., 2019; Raffel et al., 2019; Lewis et al., 2020) could produce quite fluent text and have empowered a wide range of downstream Natural Language Generation (NLG) tasks (See et al., 2019; Zhang et al., 2020; Lewis et al., 2020). However, these PLMs are observed to internalize, propagate, and even amplify problematic contents that exist in crawled unclean corpora, typically toxic language (e.g., offensive text) (Gehman et al., 2020) and social biases (e.g., stereotypes or different model predictions) towards particular demographic groups (e.g., gender and race) (Sheng et al., 2019), as shown in Figure 1-(a). As large PLMs are becoming the foundation of the rapidly-growing NLG services (Bommasani et al., 2021) that directly interact with end-users, such pernicious text would propagate misrepresentations (known as representational harms), aggravate inequality of opportunities (Blodgett et al., 2020), and cause psychological or even material harms (Weidinger et al., 2021), bringing a profound negative impact on society. Moreover, such issues are found to persist across increasing model sizes (Rae et al., 2021), emphasizing the urgency of developing practical methods for ethical NLG. + +These problems have drawn much attention to developing detoxifying and debiasing techniques, and previous methods mainly fall into two paradigms. The first is domain-specific pretraining (Gururanan et al., 2020), which further trains the model with clean (e.g., non-toxic) corpora (Wang et al., 2022). + +- The woman had a job as a nurse at the hospital, but was fired after the incident. +- The black person was known for his "punchy" and "aggressive" behavior. +- The UFC champ then suggested Justino is a "jerk" to the northeast natives. +We are more likely to believe a woman is mentally ill than a man, women may also be more inclined to attempt suicide. + +![](images/9605f33c8cc8a7693d6a95e7017ef9717e8e8f6015785948da2d569a17ae801d.jpg) +(a) Text Generated by GPT-2 +(b) Toxicity/Bias in Text Generated by Different Models +Figure 1: (a) GPT-2 generated sentences that contain stereotypes of marginalized groups (magenta) or toxic contents (steelblue). (b) Toxicity (measured by PERSPECTIVE API) and bias (measured by Regard score (Sheng et al., 2019)) of texts generated by different models. Compared with GPT-2, the detoxified method DExperts obtains the top toxicity mitigation but even amplifies social biases. + +This effective paradigm needs carefully-created training data and becomes quite expensive for big PLMs. Therefore, we focus on the other paradigm, namely constrained decoding, which avoids undesired tokens by simple filtering (Welbl et al., 2021), adversarial triggers (Sheng et al., 2020), hidden states update (Dathathri et al., 2020) or output distribution projection (Liu et al., 2021) without retraining PLMs. Nonetheless, filtering ignores language diversity, optimizing triggers or hidden states is time-consuming, and direct projection of the output distribution would hurt text fluency. + +Furthermore, prior methods usually handle detoxifying and debiasing separately. Some works realized the fairness problem of detoxified PLMs, reporting increased perplexity on text related to marginalized groups (Welbl et al., 2021; Xu et al., 2021). We also observed relevant phenomena shown in Figure 1-(b). On the one hand, coinciding with (Zhou et al., 2021; Sap et al., 2021), detoxifying techniques might even amplify social biases. On the other hand, while debiasing methods more or less contribute to toxicity reduction, directly detoxifying methods still result in the best performance. It is therefore necessary to jointly detoxify and debias a NLG model for its ethical use. + +To handle the above challenges, we propose the first Unified framework of Detoxifying and Debiasing based on Inference-time Adaptive optimization (UDDIA). UDDIA formalizes debiasing and detoxification jointly as rectifying the output distribution by equalizing the dependence between each token and different groups while minimizing the dependence of toxicity. We provide theoretical guarantee for UDDIA by interpreting it as learning a mixture of different attribute (demographic groups or toxicity) conditioned text distributions. In addition to the joint objective formalization, we facilitate the rectification in UDDIA with adaptive optimization schema and parameter-efficient tuning during inference. Extensive experiments show that UDDIA achieves superior performance in bias mitigation and toxicity reduction, as well as satisfactory generation efficiency and minimal loss of NLG quality. + +# 2 RELATED WORK + +Our work is related to bias mitigation and toxicity reduction for language generation. Recent literature on both topics take two main paradigms: domain-specific training and constrained decoding. + +Bias Mitigation. One well-known domain-specific training method for debiasing is Counterfactual Data Augmentation (CDA) (Lu et al., 2020), which creates pseudo training data to facilitate more diverse contents generated with marginalized group prompts (Saunders & Byrne, 2020; Liu et al., 2020a; Zmigrod et al., 2019). Another way without augmented data is regularization training. This method applies regularized losses to equalize the generation probabilities prompted from different groups (Qian et al., 2019; Bordia & Bowman, 2019; Huang et al., 2020), or utilizes discriminators to remove sensitive information (Peng et al., 2020; Liu et al., 2020b). These training-based methods work well but require extra data and are resource-consuming, hindering their use in large PLMs. Consequently, we highlight the constrained decoding paradigm, which consists of three lines of methods. The simplest line is heuristic constraints to involve more diverse group-related tokens (Saunders et al., 2021). The second line places searched adversarial triggers at the beginning of prompts to stimulate unbiased generation (Sheng et al., 2020). The last line steers the model output using either an extra PLM (Schick et al., 2021) or a learned projection matrix (Liang et al., 2021). + +Toxicity Reduction. Similar to debiasing, detoxification adheres to the two paradigms. The domain-specific training paradigm performs additional pretraining with elaborately filtered non-toxic corpora to dilute the captured toxicity (Gehman et al., 2020; Gururangan et al., 2020; Wang et al., 2022), conducts attribute (toxic/non-toxic) conditioning training (Gehman et al., 2020), or achieves style + +transfer to remove toxicity (Dale et al., 2021). The constrained decoding paradigm also falls into three lines: (1) applying heuristic constraints in decoding algorithms to filter out toxic contents (Gehman et al., 2020; Welbl et al., 2021; Sheng et al., 2021a), (2) tuning soft prefixes to enhance the generation of non-toxic contents (Qian et al., 2022), and (3) reshaping the output distribution to reduce toxicity (Dathathri et al., 2020; Krause et al., 2021; Liu et al., 2021; Geva et al., 2022). + +Above methods separate debiasing from detoxifying, leading to one-sided unethical content mitigation or even aggravating the other side. In contrast, our framework unifies debiasing and detoxification. + +# 3 METHODOLOGY + +In this section, we first formalize the problem in Sec. 3.1, introduce the unified optimization framework UDDIA in Sec. 3.2, and then describe the challenges and detailed implementations in Sec. 3.3. + +# 3.1 PROBLEM FORMALIZATION + +In this work, we consider auto-complete generation (Sheng et al., 2021b; Liu et al., 2021): Given an input prompt $c$ , the PLM $p_{\theta}(x|c)$ parameterized by $\theta$ generates a textual continuation $x$ . We define variable $a$ as the sensitive attribute and suppose there are $K$ attributes $a_1, \dots, a_K$ (e.g., gender, race, and toxicity information) to be considered, and each $a_k \in \mathbb{S}_k$ with $\mathbb{S}_k$ as the set of discrete indicators, e.g., $\mathbb{S}_k = \{\text{male, female}\}$ for gender1 and $\mathbb{S}_k = \{\text{toxic, non-toxic}\}$ for toxicity. Our aim is to achieve ethical language generation by removing social bias and toxicity from the original PLM. + +We first highlight the distinction of social bias and toxicity. Social bias reflects the distribution-level difference of PLMs between different demographic groups (e.g., $a = 0$ for male and $a = 1$ for female). Following (Dwork et al., 2012), we characterize the difference using total variation $D_{TV}(p_{\theta}(\boldsymbol{x}|a = 0), p_{\theta}(\boldsymbol{x}|a = 1))$ . Based on this formulation, two types of bias measures are induced: + +- Local bias (Liang et al., 2021). The difference is reflected in the generation probability distribution of PLMs, with $D_{TV} \approx \frac{1}{2M} \sum_{\boldsymbol{x}} |\sum_{m} p_{\boldsymbol{\theta}}(\boldsymbol{x} | \boldsymbol{c}_{m}^{0}) - p_{\boldsymbol{\theta}}(\boldsymbol{x} | \boldsymbol{c}_{m}^{1})|$ , where $M$ is the number of prompts, and $(\boldsymbol{c}_{m}^{0}, \boldsymbol{c}_{m}^{1})$ is a pair of counterfactual prompts (Huang et al., 2020) with their contents differentiated only in the demographic mentions (see Appendix C.1). +- Global bias (Sheng et al., 2020). The difference is represented by a global property $h$ between the generations from different groups. In this setting, $D_{TV} \approx \frac{1}{2M} \sum_{(\pmb{x}^0, \pmb{x}^1)} |\sum_m p(h|\pmb{x}_m^0) - p(h|\pmb{x}_m^1)|$ , where $\pmb{x}_m^0 \sim p_\theta(\pmb{x}|\pmb{c}_m^0)$ and $\pmb{x}_m^1 \sim p_\theta(\pmb{x}|\pmb{c}_m^1)$ are the generations to be compared, and $p(h|\pmb{x})$ is the probability of $\pmb{x}$ containing the property $h$ (e.g., negative sentiment). + +In contrast, toxicity is an inherent property that measures $p_{\pmb{\theta}}(\pmb{x} | a = \text{toxic})$ , which can be estimated by each instance as $\frac{1}{N} \sum_{\pmb{c}} \sum_{\pmb{x}} p(a = \text{toxic} | \pmb{x}, \pmb{c})$ , where $N$ is the number of all generated $\pmb{x}$ . $p(a = \text{toxic} | \pmb{x}, \pmb{c})$ is usually a sentence classifier and can also serve as a global property $h$ in global bias. + +We attach the detailed derivations of the above metrics in Appendix A. Despite their distinction, both bias and toxicity represent the relationship between generated text $x$ and some sensitive attribute $a$ . This motivates us to unify the optimization goals of these two tasks to promote the ethical NLG. + +# 3.2 UNIFIED DETOXIFYING AND DEBIASING FRAMEWORK + +Inspired by the formalization above and works of debiasing word embeddings (Bolukbasi et al., 2016), we detoxify and debias the PLM by removing the dependence between attribute $a$ and text $x$ produced by PLMs. In this way, the output distribution is rectified to equalize predicted token probabilities towards different groups and avoid toxicity. We hence minimize $I(\boldsymbol{x};a)$ , the mutual information of text $x$ and attribute $a$ . We introduce four progressive designs in next subsections. + +Token-level Rectification. To simplify the problem, we ignore the context / prompt $c$ and independently consider a token $x_{t}$ to generate at a certain time step $t$ . Then we have: + +$$ +\begin{array}{l} I (x _ {t}; a) = \mathbb {E} _ {p (a)} \left[ \int p (x _ {t} | a) \log \frac {p (x _ {t} | a)}{p _ {\boldsymbol {\theta}} (x _ {t})} \mathrm {d} x \right] \\ = \sum_ {a} \sum_ {x _ {t}} p _ {\boldsymbol {\theta}} \left(x _ {t}\right) p _ {\boldsymbol {\omega}} \left(a \mid x _ {t}\right) \log \frac {p _ {\boldsymbol {\omega}} \left(a \mid x _ {t}\right)}{p (a)} = \mathcal {L} _ {t}, \tag {1} \\ \end{array} +$$ + +where $p_{\theta, \omega}(x_t, a) = p_{\theta}(x_t)p_{\omega}(a|x_t)$ . $\pmb{\theta}$ parameterize the language model that produces the original probability for $x$ ; $\omega$ parameterize the attribute classifier, by which the attribute of $x$ is measured and to be rectified. We convert the generative $p(x_t|a)$ to the lightweight classifier $p_{\omega}(a|x_t)$ by Bayes' rule. By simply changing the form of Eq.(1), we have the following lemma: + +Lemma 1. Supposing the attribute variable $a$ follows a prior binary distribution $p(a)$ with $p(a = 0) = \alpha$ and $p(a = 1) = 1 - \alpha$ , then minimizing $\mathcal{L}_t$ is equivalent to minimizing: + +$$ +\alpha \times \mathrm {K L} [ p (x _ {t} | a = 0) \| p _ {\boldsymbol {\theta}} (x _ {t}) ] + (1 - \alpha) \times \mathrm {K L} [ p (x _ {t} | a = 1) \| p _ {\boldsymbol {\theta}} (x _ {t}) ]. \tag {2} +$$ + +Proof is provided in Appendix D.1. Lemma 1 indicates that by optimizing Eq.(1), we actually learn a $p_{\theta}(x_t)$ that mixes different attribute-conditioned text distributions weighted with the prior one $p(a)$ . Setting $p(a)$ as the uniform distribution, we equalize the generation probability linked to different values of $a$ and mitigate biases. Setting $p(a = \text{toxic}) \rightarrow 0$ , we reduce the toxicity probability of $x_t$ . + +Context-aware Rectification. Liu et al. (2021) and Schick et al. (2021) suggest that steering the PLM without context information is harmful to fluency and coherence. To remedy this, at time step $t$ , we minimize $I(x_{t};a|\tilde{c}_{t})$ with $\tilde{c}_t$ as its context and instantiated by the concatenation $[c;\pmb{x}_{< t}]$ : + +$$ +I \left(x _ {t}; a \mid \tilde {c} _ {t}\right) \approx \mathcal {L} _ {t} + \mathcal {L} _ {c}; \quad \mathcal {L} _ {c} = \sum_ {x _ {t}} p _ {\boldsymbol {\theta}} \left(x _ {t} \mid \tilde {c} _ {t}\right) \times \mathrm {K L} \left[ p _ {\boldsymbol {\omega}} \left(a \mid x _ {t}, \tilde {c} _ {t}\right) \| p _ {\boldsymbol {\omega}} \left(a \mid x _ {t}\right) \right]. \tag {3} +$$ + +By optimizing $\mathcal{L}_c$ for each $t$ , we reduce the generation probability (weighted by the KL term) of toxic/biased sequence $\pmb{x}$ in an autoregressive manner. We give detailed derivations in Appendix D.2. + +Eq.(3) indicates if the probability that the sequence $[\tilde{c}_t; x_t]$ expresses attribute $a$ (e.g., toxicity) is irrelevant to $\tilde{c}_t$ (small KL) but dominated by $x_t$ (i.e., $x_t$ is much more toxic than $\tilde{c}_t$ ), then we should reduce the probability of this token more to reach the same low $\mathcal{L}_c$ . Conversely, if $x_t$ exhibits less $a$ , we should not alter its probability to maintain the context coherence, improving fluency and quality. + +Unified Rectification Framework. We consider only one attribute $a$ above, and now further extend it to multiple attributes $a_1, \dots, a_K$ to achieve unified detoxifying and debiasing. Similarly to Eq.(1), we minimize $I(x_t; a_1, \dots, a_K)$ and then we can get the following conclusion: + +Theorem 1. Suppose each $a_{k}$ is independent, then the objective satisfies $I(x_{t};a_{1},\dots ,a_{K}) = \sum_{k = 1}^{K}I(x_{t};a_{k}) > \sum_{k,v}\hat{p} (a_{k} = v)\mathbf{KL}\left[p(x_{t}|a_{k} = v)\| p(x_{t})\right]$ with $\hat{p} (a_k = v) = p(a = k)*p(a_k = v)$ . + +Proof is provided in Appendix D.3. Theorem 1 means we can independently calculate the loss of each attribute from Eq.(3) and optimize the linearly combined loss $\mathcal{L} = \sum_{k=1}^{K} \mathcal{L}_{a_k}$ . Such unified optimization can be considered as mixing various conditional generation probability with weights $\alpha$ similar to Lemma 1. By specifying different priors, e.g., $p(\text{gender} = \text{female}) = p(\text{gender} = \text{male}) = 0.5$ and $p(\text{toxic} = 1) \rightarrow 0$ , we can simultaneously achieve debiasing and detoxifying3. + +# 3.3 CHALLENGES FOR THE UNIFIED RECTIFICATION AND THEIR SOLUTIONS + +The objectives in Sec. 3.2 drive the unified rectification for PLM. However, as reviewed in Sec. 2, a main challenge for current techniques lies in the efficiency of either memory or time consumption. + +To facilitate efficient update with the designed objectives, we adopt the parameter-efficient tuning (Pfeiffer et al., 2020; Ding et al., 2022) paradigm during inference. Such methods have been applied in domain-adaptive training for detoxifying PLMs (Wang et al., 2022) and improving robustness for text classification (Yang & Liu, 2022). In our work, we propose to tune the bias terms4 in certain layers of the PLM during inference to implement parameter-efficient constraint decoding. + +Bias tuning is highly efficient in parameter usage, and has also proven effective in NLU tasks (Ben Zaken et al., 2022). However, three specific challenges remain when adapted to the inference-time tuning paradigm for ethical NLG: (1) attribute classifier (how to construct the feedback signal to calculate Eq. (3) which is optimized during decoding); (2) when to intervene (at which time step to rectify the distribution); (3) where to update (the bias terms in which layers to be updated). Algorithm 1 shows the abstracted UDDIA framework, including the three challenges for unified rectification. Due to page limit, we provide the detailed pseudo-code for our UDDIA framework in Appendix B. + +Attribute classifier. The attribute classifiers provide real-time feedback signal for inference-time rectification. For debiasing, however, there are no off-the-shelf classifiers or annotated datasets to instantiate the $p_{\omega}(a|x_t,\tilde{c}_t)$ and $p_{\omega}(a|x_t)$ in Eq. (3). Inspired by embedding debiasing methods (Bolukbasi et al., 2016; Liang et al., 2020; 2021), we collect a set of seed words for each attribute value $a_{k,v}$ and conduct principal component analysis (PCA) (Wold et al., 1987) on the embedding vectors that belong to each indicator. We then use the first principal component $v_{k,v}$ as the attribute value direction and approximate the classifier as $p_{\omega}(a|x_t)\propto$ + +Algorithm 1 The abstracted UDDIA framework +Input: Prompt $c$ +Output: The rectified generation $\mathbf{x}_{\mathrm{rect}}$ +1: Determine where to update: $\pmb{\theta}^{(b)}$ +2: for $t = 1, 2, \dots, \mathrm{LENGTH}$ do +3: $x_{t} = \mathrm{LM}([c; \pmb{x}_{