Introduction
The modular addition task is a canonical setting in which to study grokking. During the initial phase of training, an over-parameterized model can fit individual training examples yet fails to uncover an interpretable rule. After substantially prolonged training, however, its test performance may improve abruptly even though the training loss has already become very small. This delayed transition is commonly referred to as grokking . In modular addition, the onset of grokking is accompanied by the emergence of a distinctive structure in the weights. Prior studies have shown that trained networks develop Fourier circuits ([12 , 3 ] . Specifically, the input and output weights of many hidden units become concentrated at matching Fourier frequencies, and appropriate combinations of these Fourier components can compute ( a + b ) m o d P (a + b) \bmod P ( a + b ) mod P . Mechanistic interventions, including Fourier projection and ablation experiments, provide strong evidence that these components are functionally important for generalization. Their formation also reflects the transition from a memorizing solution to a generalizing one.
These results answer an important reverse question: given a trained network, which circuit does it implement, and which components of that circuit support generalization? They have not fully answered the complementary forward question: why should gradient-based training produce Fourier-structured parameters from the modular-addition data distribution in the first place? The fact that Fourier features can represent modular addition does not imply that the training dynamics must discover them. Meanwhile, current work can already account for observed phenomena in neural networks, such as frequency competition and phase alignment ([4 ] ). However, its theoretical analysis is based on a Fourier decomposition of the weights, which need to presuppose that the Fourier basis is related to modular addition.
Our focus is therefore not to show again that Fourier-structured neurons can implement modular addition, nor to re-establish that these neurons support generalization. Instead, we study the missing forward direction
training distribution ⟹ leading gradient terms ⟹ Fourier-mode selection . \text{training distribution} \Longrightarrow\text{leading gradient terms} \Longrightarrow\text{Fourier-mode selection}. training distribution ⟹ leading gradient terms ⟹ Fourier-mode selection .
More specifically, we ask the following questions. Which statistics of the training data enter the leading-order parameter dynamics? Why are Fourier modes approximately decoupled in the modular-addition problem? What determines whether a neuron is suppressed by weight decay or develops a dominant Fourier component? And, how to derive the weight structure in advance from the training distribution?
We study these questions in a two-layer embedding MLP trained on modular addition dataset with some randomly corrupted labels. Our main analytical tool is the probability signature framework introduced by Yao & Xu [16 ] , which shows the correlation between data statistics and embedding without studying either modular addition learning or the key structure of data statistics.
Our contributions are as follows.
Related Work
Grokking. Grokking, the delayed onset of generalization long after interpolation, was first reported on small algorithmic datasets, where weight decay proved essential [13 ] . Subsequent work explains the delay through properties of the optimization trajectory: effective theories of representation learning and norm growth [9 ] , loss landscapes shaped by weight decay and initialization scale [10 ] , instabilities of adaptive optimizers [14 ] , and the transition from lazy to rich training dynamics [6 ] . These characterize when and why generalization occurs, from the emergent Fourier circuits as a result of training. Based on this, we point out that weight decay determines the formation of the Fourier structure as a threshold , which establishes the connection between weight decay and Grokking.
Modular arithmetic. Prior work has established that trained networks can implement modular addition through sparse Fourier circuits, and has introduced diagnostics such as frequency matching and phase alignment to characterize these circuits [12 ] . Analytic and scaling-oriented studies have further related the norms and spectral profiles of Fourier modes to the learned solution [3 , 11 ] . These works provide important mechanistic and functional descriptions of Fourier structure in trained networks. Our analysis is based on these research results, but we present a forward perspective: starting from training distribution rather than from the Fourier circuits obtained through training. More recent work [4 ] provides a complete explanation for the frequency competition and phase alignment by decomposing neurons onto the Fourier basis. Compared with theirs, our contribution stands out in the fact that we do not require the prior knowledge of the Fourier circuit found in the modular-addition task. By studying the algebraic structure of the probability signature , we derive the Fourier basis as the common eigenvectors. We not only explain the above phenomena, but also we hope to provide a unified explanation for the puzzle of early noise and the extension to other training tasks.
Learning with corrupted labels. Neural networks can both generalize from structured examples and memorize corrupted labels. This interaction has been studied broadly through early learning and memorization dynamics [1 , 8 ] . For algorithmic and modular-arithmetic tasks, prior work has documented robust generalization in the presence of label corruption and the coexistence of generalizing and memorizing subnetworks [2 , 7 ] . Our contribution is not a general theory of learning under label noise. Instead, we isolate one early-time phenomenon: randomly corrupted examples lead to faster initial loss decrease, and we relate it to probability signature, which is computable from the training data.
Preliminaries
Settings
Let Ω = { 0 , 1 , … , P − 1 } \Omega= \{0,1,\ldots,P-1\} Ω = { 0 , 1 , … , P − 1 } be a finite alphabet, where P P P is a prescribed prime. We consider the prediction of a binary operation F : Ω × Ω → Ω F : \Omega\times\Omega\to\Omega F : Ω × Ω → Ω from examples X = ( a , b ) X = (a,b) X = ( a , b ) to the label F ( a , b ) F(a,b) F ( a , b ) .
All pairs in Ω × Ω \Omega\times\Omega Ω × Ω are divided into three disjoint subsets D c l e a n , D n o i s e , D t e s t \mathcal{D}_{\mathrm{clean}}, \mathcal{D}_{\mathrm{noise}}, \mathcal{D}_{\mathrm{test}} D clean , D noise , D test of cardinalities N c l e a n N_{\mathrm{clean}} N clean , N n o i s e N_{\mathrm{noise}} N noise , and N t e s t N_{\mathrm{test}} N test , respectively. The labels of clean and test are set to F ( a , b ) = ( a + b ) m o d P F(a,b) = (a+b) \bmod P F ( a , b ) = ( a + b ) mod P , while the labels of noise are replaced by uniform random numbers.
The training dataset consists of D c l e a n \mathcal{D}_{\mathrm{clean}} D clean and D n o i s e \mathcal{D}_{\mathrm{noise}} D noise . We define N t r a i n = N c l e a n + N n o i s e N_{\mathrm{train}} = N_{\mathrm{clean}} + N_{\mathrm{noise}} N train = N clean + N noise , where N t r a i n : N t e s t = 8 : 2 N_{\mathrm{train}} : N_{\mathrm{test}} = 8 : 2 N train : N test = 8 : 2 and N n o i s e = α N t r a i n N_{\mathrm{noise}} = \alpha N_{\mathrm{train}} N noise = α N train . α \alpha α represents the noise ratio.
Model. Let e a , e b ∈ R P e_a, e_b \in\mathbb{R}^{P} e a , e b ∈ R P be one-hot encodings. We study the two-layer MLP f ( a , b ) = W σ ( U e a + V e b ) ∈ R P f(a,b) = W\sigma(Ue_a + Ve_b) \in\mathbb{R}^{P} f ( a , b ) = W σ ( U e a + V e b ) ∈ R P , where U , V ∈ R D × P U,V \in\mathbb{R}^{D \times P} U , V ∈ R D × P , W ∈ R P × D W \in\mathbb{R}^{P \times D} W ∈ R P × D , e a , e b e_a,e_b e a , e b means the one-hot encodings of input a , b a,b a , b , and D ≫ P D \gg P D ≫ P . The output distribution is softmax ( f ( a , b ) ) \operatorname{softmax}(f(a,b)) softmax ( f ( a , b )) .
We use the cross-entropy loss function and employ L 2 L^2 L 2 -weight decay with coefficient λ \lambda λ . Parameters are initialized independently according to U i j , V i j , W i j ∼ N ( 0 , D − 2 γ ) U_{ij}, V_{ij}, W_{ij} \sim\mathcal{N}(0, D^{-2\gamma}) U ij , V ij , W ij ∼ N ( 0 , D − 2 γ ) , where γ \gamma γ controls the initialization scale. Consider a continuous gradient flow model as an approximation, it is d θ d t = − η ( ∇ θ L + λ θ ) \frac{\mathrm{d}\theta}{\mathrm{d}t} = -\eta(\nabla_\theta L + \lambda\theta) d t d θ = − η ( ∇ θ L + λ θ ) . For more details about initialization, learning rate or optimizer, please refer to the appendix A.
Probability signatures
The Probability Signature proposed in the related work [16 ] is a statistical quantity derived from sampling and not dependent on training. It can characterize the main terms of the gradient at different training stages. In order to create the application environment for Probability Signature, we first extended the fully connected network with the same embedding to our model.
Proposition 1 (Gradient flow). Assume the neural network f ( x , y ) = W σ ( U e x + V e y ) f(x,y) = W\sigma(Ue_x + Ve_y) f ( x , y ) = W σ ( U e x + V e y ) , using full batch GD with cross-entropy loss and ignoring weight decay, with the activation function σ ( h ) = 0 + c 1 h + c 2 2 h 2 + o ( h 2 ) \sigma(h) = 0 + c_1h + \frac{c_2}{2}h^2 + o(h^2) σ ( h ) = 0 + c 1 h + 2 c 2 h 2 + o ( h 2 ) which is C 3 C^3 C 3 near zero. If we sample training data from ( x , y , z ) ∼ π (x,y,z) \sim\pi ( x , y , z ) ∼ π , then we denote the probability that the first position is x x x by r x r_x r x and the random variable E π [ ⋅ ∣ x ] \mathbb{E}_{\pi}[\cdot\mid x] E π [ ⋅ ∣ x ] by the conditional expectation under the fixed first position.
Under the assumption of small initialization that ∥ U ∥ ∞ , ∥ V ∥ ∞ , ∥ W ∥ ∞ ≤ ϵ \lVert U\rVert_{\infty}, \lVert V\rVert_{\infty}, \lVert W\rVert_{\infty} \le\epsilon ∥ U ∥ ∞ , ∥ V ∥ ∞ , ∥ W ∥ ∞ ≤ ϵ , we derived that
d U x d t = r x η { c 1 W T ( I − 1 P 1 P 1 P T ) [ E π [ e z ∣ x ] − c 1 P W ( U x + E π [ V y ∣ x ] ) ] + c 2 E π [ ( ( U x + V y ) ⊙ W T ( e z − 1 P 1 P ) ) | x ] } + δ . \frac{\mathrm{d}U^x}{\mathrm{d}t}
= r_x\eta\left\{ c_1 W^{\mathsf{T}}\left(I-\frac{1}{P}\mathbf{1}_P\mathbf{1}_P^{\mathsf{T}}\right)\left[\mathbb{E}_{\pi}[e_z \mid x]-\frac{c_1}{P}W\left(U^x+\mathbb{E}_{\pi}[V^y\mid x]\right)\right]
+ c_2\mathbb{E}_{\pi}\left[\left((U^x+V^y)\odot W^{\mathsf{T}}\left(e_z-\frac{1}{P}\mathbf{1}_P\right)\right)\middle|x\right]\right\}+\delta. d t d U x = r x η { c 1 W T ( I − P 1 1 P 1 P T ) [ E π [ e z ∣ x ] − P c 1 W ( U x + E π [ V y ∣ x ] ) ] + c 2 E π [ ( ( U x + V y ) ⊙ W T ( e z − P 1 1 P ) ) x ] } + δ . where U x ∈ R d U^x \in\mathbb{R}^{d} U x ∈ R d represent the x x x -th column of U U U and ∥ δ ∥ ∞ = O ( ϵ 3 ) \lVert\delta\rVert_{\infty} = O(\epsilon^3) ∥ δ ∥ ∞ = O ( ϵ 3 ) means the higher order terms.
Proof. See Appendix E.1.
From the gradient flow equation, we can further decompose the conditional expectation. Assume sampling from the training distribution ( X , Y , Z ) ∼ π (X,Y,Z) \sim\pi ( X , Y , Z ) ∼ π , we define the probability signatures:
φ ( a ) ( x , z ) = P ( Z = z ∣ X = x ) , φ ( b ) ( x , z ) = P ( Z = z ∣ Y = x ) . \varphi^{(a)}(x,z) = \mathbb{P}(Z=z \mid X=x), \qquad\varphi^{(b)}(x,z) = \mathbb{P}(Z=z \mid Y=x). φ ( a ) ( x , z ) = P ( Z = z ∣ X = x ) , φ ( b ) ( x , z ) = P ( Z = z ∣ Y = x ) .
the 3-order tensor joint probability signatures:
Φ ( a ) ( x , y , z ) = P ( Z = z , Y = y ∣ X = x ) , Φ ( b ) ( x , y , z ) = P ( Z = z , X = y ∣ Y = x ) . \Phi^{(a)}(x,y,z) = \mathbb{P}(Z=z,Y=y \mid X=x), \qquad\Phi^{(b)}(x,y,z) = \mathbb{P}(Z=z,X=y \mid Y=x). Φ ( a ) ( x , y , z ) = P ( Z = z , Y = y ∣ X = x ) , Φ ( b ) ( x , y , z ) = P ( Z = z , X = y ∣ Y = x ) .
and the trace-back probability signatures
ψ ( a ) ( x , y ) = P ( Y = y ∣ X = x ) , ψ ( b ) ( x , y ) = P ( X = y ∣ Y = x ) . \psi^{(a)}(x,y) = \mathbb{P}(Y=y \mid X=x), \qquad\psi^{(b)}(x,y) = \mathbb{P}(X=y \mid Y=x). ψ ( a ) ( x , y ) = P ( Y = y ∣ X = x ) , ψ ( b ) ( x , y ) = P ( X = y ∣ Y = x ) .
We also denote φ x ( a ) : = ∑ z ∈ Ω P ( Z = z ∣ X = x ) e z \varphi_x^{(a)} := \sum_{z\in\Omega}\mathbb{P}(Z=z\mid X=x)e_z φ x ( a ) := ∑ z ∈ Ω P ( Z = z ∣ X = x ) e z , a column vector, and Φ x ( a ) : = ∑ y , z ∈ Ω P ( Z = z , Y = y ∣ X = x ) e y ⊗ e z \Phi_x^{(a)} := \sum_{y,z\in\Omega}\mathbb{P}(Z=z,Y=y\mid X=x)e_y\otimes e_z Φ x ( a ) := ∑ y , z ∈ Ω P ( Z = z , Y = y ∣ X = x ) e y ⊗ e z , a matrix. The same notation applies to the others. Then we can rewrite the gradient flow equation in Proposition 1 as
d U x d t = r x η { c 1 W ⊤ [ ( φ x ( a ) − 1 P 1 P ) − c 1 P ( I − 1 P 1 P 1 P ⊤ ) W ( U x + V ψ x ( a ) ) ] \frac{dU^x}{dt}=r_x\eta\left\{c_1W^\top\left[\left(\varphi_x^{(a)}-\frac{1}{P}\mathbf{1}_P\right)-\frac{c_1}{P}\left(I-\frac{1}{P}\mathbf{1}_P\mathbf{1}_P^\top\right)W\left(U^x+V\psi_x^{(a)}\right)\right]\right. d t d U x = r x η { c 1 W ⊤ [ ( φ x ( a ) − P 1 1 P ) − P c 1 ( I − P 1 1 P 1 P ⊤ ) W ( U x + V ψ x ( a ) ) ]
+ c 2 [ U x ⊙ W ⊤ φ x ( a ) − 1 P ( U x + V ψ x ( a ) ) ⊙ ( W ⊤ 1 P ) + diag ( V Φ x ( a ) W ) ] } + δ . \left.\quad+c_2\left[U^x\odot W^\top\varphi_x^{(a)}-\frac{1}{P}\left(U^x+V\psi_x^{(a)}\right)\odot\left(W^\top\mathbf{1}_P\right)+\operatorname{diag}\left(V\Phi_x^{(a)}W\right)\right]\right\}+\delta. + c 2 [ U x ⊙ W ⊤ φ x ( a ) − P 1 ( U x + V ψ x ( a ) ) ⊙ ( W ⊤ 1 P ) + diag ( V Φ x ( a ) W ) ] } + δ .
The above statistics φ \varphi φ , Φ \Phi Φ , ψ \psi ψ are referred to as Probability Signatures.
Theoretical Analysis
In this chapter, we hope to derive this frequency structure from a forward perspective. Reviewing the gradient flow equation 1, we divide it into φ \varphi φ -part, Φ \Phi Φ -part and ψ \psi ψ -part based on the association with different probability signatures. Additionally, due to the weight decay, there is also a − λ U -\lambda U − λ U term. The proof of the following theorems will be found in Appendix E.2,E.3, and E.4.
Theorem 1 characterizes the dominant part of the gradient flow equation.
Theorem 1 (Dominance of the gradient). Under the condition of 1 and non-zero weight decay, assume that η = 1 \eta=1 η = 1 and
φ x ( a ) = φ x ( b ) = ψ x ( a ) = ψ x ( b ) = 1 P 1 P , ∀ x ∈ Ω , \varphi_x^{(a)}=\varphi_x^{(b)}=\psi_x^{(a)}=\psi_x^{(b)}=\frac{1}{P}\mathbf{1}_P,\qquad\forall x\in\Omega, φ x ( a ) = φ x ( b ) = ψ x ( a ) = ψ x ( b ) = P 1 1 P , ∀ x ∈ Ω , Under small initialization that ∥ U ∥ ∞ , ∥ V ∥ ∞ , ∥ W ∥ ∞ ≤ ϵ \lVert U\rVert_\infty,\lVert V\rVert_\infty,\lVert W\rVert_\infty\le\epsilon ∥ U ∥ ∞ , ∥ V ∥ ∞ , ∥ W ∥ ∞ ≤ ϵ we have
d U x d t = − λ U x + c [ diag ( V Φ x ( a ) W ) − V ‾ ⊙ W ‾ ] + δ U , \frac{dU^x}{dt}=-\lambda U^x+c\left[\operatorname{diag}\left(V\Phi_x^{(a)}W\right)-\overline{V}\odot\overline{W}\right]+\delta_U, d t d U x = − λ U x + c [ diag ( V Φ x ( a ) W ) − V ⊙ W ] + δ U , d V x d t = − λ V x + c [ diag ( U Φ x ( b ) W ) − U ‾ ⊙ W ‾ ] + δ V , \frac{dV^x}{dt}=-\lambda V^x+c\left[\operatorname{diag}\left(U\Phi_x^{(b)}W\right)-\overline{U}\odot\overline{W}\right]+\delta_V, d t d V x = − λ V x + c [ diag ( U Φ x ( b ) W ) − U ⊙ W ] + δ V , d W z d t = − λ W z + c [ diag ( U Ψ z V ⊤ ) − U ‾ ⊙ V ‾ ] + δ W . \frac{dW_z}{dt}=-\lambda W_z+c\left[\operatorname{diag}\left(U\Psi_zV^\top\right)-\overline{U}\odot\overline{V}\right]+\delta_W. d t d W z = − λ W z + c [ diag ( U Ψ z V ⊤ ) − U ⊙ V ] + δ W . where c = c 2 r x c=c_2r_x c = c 2 r x , ∥ δ ∥ ∞ ≤ ϵ 3 \lVert\delta\rVert_\infty\le\epsilon^3 ∥ δ ∥ ∞ ≤ ϵ 3 . Here we define U ‾ : = P − 1 ∑ x U x \overline{U}:=P^{-1}\sum_xU^x U := P − 1 ∑ x U x , V ‾ : = P − 1 ∑ x V x \overline{V}:=P^{-1}\sum_xV^x V := P − 1 ∑ x V x , W ‾ : = P − 1 ∑ x ( W ⊤ ) x \overline{W}:=P^{-1}\sum_x(W^\top)^x W := P − 1 ∑ x ( W ⊤ ) x , and Ψ z : = ∑ x , y ∈ Ω P π [ X = x , Y = y ∣ Z = z ] e x ⊗ e y \Psi_z:=\sum_{x,y\in\Omega}\mathbb{P}_\pi[X=x,Y=y\mid Z=z]e_x\otimes e_y Ψ z := ∑ x , y ∈ Ω P π [ X = x , Y = y ∣ Z = z ] e x ⊗ e y .
The Fourier basis derived from the signatures
Let’s assume there is no noise and the training is conducted on the entire clean dataset. We define Φ x + : = P − 1 ∑ j ∈ Z P e j ⊗ e j + x \Phi_x^+ := P^{-1}\sum_{j\in\mathbb{Z}_P}e_j\otimes e_{j+x} Φ x + := P − 1 ∑ j ∈ Z P e j ⊗ e j + x as the joint signature in this situation. Write S x = P Φ x + S_x=P\Phi_x^+ S x = P Φ x + , which is a shift-x x x permutation matrix. They satisfy
S x S y = S x + y , S x ∗ = S − x , S x ∗ S x = I . S_xS_y=S_{x+y},\qquad S_x^*=S_{-x},\qquad S_x^*S_x=I. S x S y = S x + y , S x ∗ = S − x , S x ∗ S x = I .
Here ∗ ^* ∗ denotes the conjugate transpose and I I I is the P × P P\times P P × P identity matrix. They form a commuting family of normal operators and therefore possess a common orthonormal eigenvectors over C \mathbb{C} C . The basis can be obtained directly from the simplest nontrivial shift: S 1 q = ω q S_1q=\omega q S 1 q = ω q implies F ( y + 1 ) = ω F ( y ) F(y+1)=\omega F(y) F ( y + 1 ) = ω F ( y ) for some unit root ω P = 1 \omega^P=1 ω P = 1 , which yields
F r ( s ) = P − 1 / 2 e − 2 π i r s / P , Φ x + F r = P − 1 e 2 π i r x / P F r . (1) F_r(s)=P^{-1/2}e^{-2\pi irs/P},\qquad\Phi_x^+F_r=P^{-1}e^{2\pi irx/P}F_r. \tag*{(1)} F r ( s ) = P − 1/2 e − 2 π i r s / P , Φ x + F r = P − 1 e 2 π i r x / P F r . (1)
These vectors are the normalized Fourier basis, and F : = [ F 0 , F 1 , ⋯ , F P − 1 ] F := [F_0,F_1,\cdots,F_{P-1}] F := [ F 0 , F 1 , ⋯ , F P − 1 ] is the standard Fourier matrix. We use u ^ : = F u \hat{\mathbf{u}}:=F\mathbf{u} u ^ := F u to represent the Discrete Fourier Transform (DFT) of vector u \mathbf{u} u .
Estimate by the main term of Theorem 1, we find that this system is separable for each hidden unit d ∈ [ D ] d\in[D] d ∈ [ D ] . Thus we can consider this equation on one hidden state u , v , w ∈ R P \mathbf{u},\mathbf{v},\mathbf{w}\in\mathbb{R}^P u , v , w ∈ R P , with system
u ˙ x = c [ diag ( v T Φ x + w ) ⏟ ν x − ( P − 1 ∑ k = 0 P − 1 v k ) ( P − 1 ∑ k = 0 P − 1 w k ) ⏟ ν m e a n ] − λ u x . \dot{\mathbf{u}}_x=c\left[\underbrace{\operatorname{diag}(\mathbf{v}^{\mathsf T}\Phi_x^+\mathbf{w})}_{\nu_x}-\underbrace{\left(P^{-1}\sum_{k=0}^{P-1}v_k\right)\left(P^{-1}\sum_{k=0}^{P-1}w_k\right)}_{\nu_{\mathrm{mean}}}\right]-\lambda\mathbf{u}_x. u ˙ x = c ν x diag ( v T Φ x + w ) − ν mean ( P − 1 k = 0 ∑ P − 1 v k ) ( P − 1 k = 0 ∑ P − 1 w k ) − λ u x .
We can expand the middle term ν x \nu_x ν x by
ν x = v T ( F − 1 Λ x F ) w = ( F ∗ v ) Λ x ( F w ) = ( 1 , ω x , ⋯ , ω x ( P − 1 ) ) ( F v ‾ ⊙ F w ) , \nu_x=\mathbf{v}^{\mathsf T}(F^{-1}\Lambda^xF)\mathbf{w}=(F^*\mathbf{v})\Lambda^x(F\mathbf{w})=(1,\omega^x,\cdots,\omega^{x(P-1)})(\overline{F\mathbf{v}}\odot F\mathbf{w}), ν x = v T ( F − 1 Λ x F ) w = ( F ∗ v ) Λ x ( F w ) = ( 1 , ω x , ⋯ , ω x ( P − 1 ) ) ( F v ⊙ F w ) ,
At the same time, the Fourier transform of ν m e a n \nu_{\mathrm{mean}} ν mean will be absorbed into the zero-frequency component, because it is independent of the index x x x .
Multiplying on the left by F F F , we have:
( F u ) r = C ( F v ‾ ) r ( F w ) r − λ u r , ( r ≠ 0 ) , (F\mathbf{u})_r=C(F\overline{\mathbf{v}})_r(F\mathbf{w})_r-\lambda u_r,\qquad(r\ne0), ( F u ) r = C ( F v ) r ( F w ) r − λ u r , ( r = 0 ) ,
Similarly, we find that for each frequency r ≠ 0 r\ne0 r = 0 ,
u ^ ˙ r ≈ C w ^ ‾ r v ^ r − λ u ^ r , v ^ ˙ r ≈ C w ^ ‾ r u ^ r − λ v ^ r , w ^ ˙ r ≈ C u ^ ‾ r v ^ r − λ w ^ r . \dot{\hat{u}}_r\approx C\overline{\hat{w}}_r\hat{v}_r-\lambda\hat{u}_r,\qquad
\dot{\hat{v}}_r\approx C\overline{\hat{w}}_r\hat{u}_r-\lambda\hat{v}_r,\qquad
\dot{\hat{w}}_r\approx C\overline{\hat{u}}_r\hat{v}_r-\lambda\hat{w}_r. u ^ ˙ r ≈ C w ^ r v ^ r − λ u ^ r , v ^ ˙ r ≈ C w ^ r u ^ r − λ v ^ r , w ^ ˙ r ≈ C u ^ r v ^ r − λ w ^ r .
where v ^ \hat{v} v ^ means DFT and v ˉ \bar{v} v ˉ means conjugate. That is, the system is decoupled at each nonzero frequency . Each 3-variable system u ^ r , v ^ r , w ^ r \hat{u}_r,\hat{v}_r,\hat{w}_r u ^ r , v ^ r , w ^ r corresponding to frequency r r r will evolve independently.
The next theorem indicates that the conditions for neurons to grow depend on the initialization, and weight decay plays a filtering role. Moreover, growing neurons always develop a dominant frequency and adhere to specific phase patterns.
Proposition 2 (Dominant frequency and phase alignment). Fix a hidden unit d d d . For each nonzero frequency r r r , let U r ( t ) = U ^ d , r ( t ) U_r(t)=\hat{U}_{d,r}(t) U r ( t ) = U ^ d , r ( t ) , V r ( t ) = V ^ d , r ( t ) V_r(t)=\hat{V}_{d,r}(t) V r ( t ) = V ^ d , r ( t ) , and W r ( t ) = W r d ^ ( t ) W_r(t)=\widehat{W^d_r}(t) W r ( t ) = W r d ( t ) . Assume C > 0 C>0 C > 0 and that the three mode amplitudes remain nonzero up to the first singularity. Let s r ∗ s_r^* s r ∗ be the blow-up time of the corresponding undamped system. If there exists some r r r , s r ∗ < C / λ s_r^*<C/\lambda s r ∗ < C / λ and s r ∗ = min i ≠ 0 { s i } s_r^*=\min_{i\ne0}\{s_i\} s r ∗ = min i = 0 { s i } , then r r r is the first frequency to blow up. Hence it makes the dominant frequency. Moreover, it is going to hold arg U r ( t ) + arg V r ( t ) − arg W r ( t ) → 0 \arg U_r(t)+\arg V_r(t)-\arg W_r(t)\to0 arg U r ( t ) + arg V r ( t ) − arg W r ( t ) → 0 , when t t t approaches the blow-up time.
Through the proposition, we can summarize the mechanism of weight decay filtering. The argument s r ∗ s_r^* s r ∗ depends on the initial weights of a group of neurons u d , v d , w d \mathbf{u}_d,\mathbf{v}_d,\mathbf{w}_d u d , v d , w d , and weight decay provides a unified survival threshold, and the competition of patterns and the initial random asymmetry determine which frequencies cross this threshold.
Estimation of noise
The actual training dataset is 80% of the complete data with α \alpha α noise inside. The following theorem will provide an approximation to bridge the gap caused by sampling.
Theorem 2 (Estimation of noise). Under Proposition 1, sample D \mathcal{D} D as above experiments with training data ratio ρ \rho ρ and uniform-label noise ratio α \alpha α . Take U ⋆ x : = diag ( V Φ x + W ) − V ˉ ⊙ W ˉ U_\star^x := \operatorname{diag}(V\Phi_x^+W) - \bar{V} \odot\bar{W} U ⋆ x := diag ( V Φ x + W ) − V ˉ ⊙ W ˉ as the main term under the full-addition signature. Then we estimate
U ˙ x − η c 2 ( 1 − α ) P U ⋆ x + λ U x = E U x + δ , \dot{U}^x - \frac{\eta c_2(1-\alpha)}{P}U_\star^x + \lambda U^x = \mathcal{E}_U^x + \delta, U ˙ x − P η c 2 ( 1 − α ) U ⋆ x + λ U x = E U x + δ , where ∥ δ ∥ ∞ ≲ ϵ 3 \lVert\delta\rVert_\infty\lesssim\epsilon^3 ∥ δ ∥ ∞ ≲ ϵ 3 . The sampling error is controlled by
E D E ∙ = 0 , Var D ( E ∙ ) ≲ [ ( 1 − ρ ) + α ] η 2 ρ P 3 ( c 1 2 ϵ 2 + c 2 2 ϵ 4 ) . \mathbb{E}_{\mathcal{D}}\mathcal{E}_\bullet= 0,\qquad\operatorname{Var}_{\mathcal{D}}(\mathcal{E}_\bullet) \lesssim\frac{[(1-\rho)+\alpha]\eta^2}{\rho P^3}\left(c_1^2\epsilon^2+c_2^2\epsilon^4\right). E D E ∙ = 0 , Var D ( E ∙ ) ≲ ρ P 3 [( 1 − ρ ) + α ] η 2 ( c 1 2 ϵ 2 + c 2 2 ϵ 4 ) . Similar results also hold for V V V and W W W .
Validation on Fourier frequency
We regard all the column vectors of W W W or the row vectors of U U U and V V V as neurons , since the output of the neural network is f ( a , b ) = ∑ d = 1 D W d ( U e d a + V e d b ) f(a,b)=\sum_{d=1}^{D}W^d(U^d_ea+V^d_eb) f ( a , b ) = ∑ d = 1 D W d ( U e d a + V e d b ) . In analysis, we assume that they evolve approximately independently. We denote the concatenation of the d d d -th row of U U U , V V V , the d d d -th column of W W W by θ d = ( U d , V d , W d ) \theta_d=(U_d,V_d,W^d) θ d = ( U d , V d , W d ) and the collection of θ d \theta_d θ d by V \mathcal{V} V . We consider Fourier transform of some neuron u ∈ R P u\in\mathbb{R}^{P} u ∈ R P , it is u ^ k = ∑ x = 0 P − 1 u x e − i 2 π k x / P \hat{u}_k=\sum_{x=0}^{P-1}u_x e^{-i2\pi kx/P} u ^ k = ∑ x = 0 P − 1 u x e − i 2 π k x / P for k = 0 , … , P − 1 k=0,\ldots,P-1 k = 0 , … , P − 1 . We define the dominant frequency and sparsity by
τ ( u ) : = argmax k ≠ 0 ∣ u ^ k ∣ , ρ ( u ) = 2 ∣ u ^ τ ( u ) ∣ 2 ∑ k = 1 P − 1 ∣ u ^ k ∣ 2 ∈ [ 0 , 1 ] . \tau(u):=\operatorname*{argmax}_{k\ne0}|\hat{u}_k|,\qquad\rho(u)=\frac{2|\hat{u}_{\tau(u)}|^2}{\sum_{k=1}^{P-1}|\hat{u}_k|^2}\in[0,1]. τ ( u ) := k = 0 argmax ∣ u ^ k ∣ , ρ ( u ) = ∑ k = 1 P − 1 ∣ u ^ k ∣ 2 2∣ u ^ τ ( u ) ∣ 2 ∈ [ 0 , 1 ] .
It is noted that frequency r r r and P − r P-r P − r are regarded as the same under Fourier transform.
Experiments. We conducted experiments under different weight decay settings, with the same σ ( x ) = G E L U ( x ) \sigma(x) = \mathrm{GELU}(x) σ ( x ) = GELU ( x ) , noise ratio α = 0.1 \alpha= 0.1 α = 0.1 and initialization scale γ = 0.5 \gamma= 0.5 γ = 0.5 , in Figure 1 . Additional experiments with other activation functions are reported in Appendix § 9 ,§ 11 . It is clearly evident from Figure 1 that weight decay has a significant impact on the direction of the training process. We observe that λ = 0.0005 \lambda= 0.0005 λ = 0.0005 acts as a regularization . That is, the model generalizes well while ignoring all the noise.
Figure 1. Accuracy-Epoch curves of λ = 0 \lambda= 0 λ = 0 , 10 − 4 10^{-4} 1 0 − 4 , 5 × 10 − 4 5 \times10^{-4} 5 × 1 0 − 4 , 10 − 3 10^{-3} 1 0 − 3 . For λ = 0 \lambda= 0 λ = 0 , model reaches 100% on clean and noise, but 0 on test, overfitting. For λ = 10 − 4 \lambda= 10^{-4} λ = 1 0 − 4 , model reaches almost 100% on clean, noise and test, generalization. For λ = 5 × 10 − 4 \lambda= 5 \times10^{-4} λ = 5 × 1 0 − 4 , model forgets the noise. And for λ = 10 − 3 \lambda= 10^{-3} λ = 1 0 − 3 , model cannot converge.
We naturally derived from weight decay to consider observing the norms of each group of neurons in the network. The growth of the norms can be described as:
1 2 d d t ∥ θ d ∥ 2 = − η ⟨ θ d , ∇ d L ⟩ − λ ∥ θ d ∥ 2 \frac{1}{2}\frac{\mathrm{d}}{\mathrm{d}t}\lVert\theta_d\rVert^2 = -\eta\langle\theta_d,\nabla_d L\rangle- \lambda\lVert\theta_d\rVert^2 2 1 d t d ∥ θ d ∥ 2 = − η ⟨ θ d , ∇ d L ⟩ − λ ∥ θ d ∥ 2
In Figure 2 A, we present the evolution of the norm and frequency sparsity of the neurons. It can be observed that due to weight decay, the norm of most neurons is continuously reduced to 0, while a few neurons can grow. Meanwhile, all the new-grown neurons have relatively high sparsity.
Figure 2. (A) Scatter between Fourier sparsity and the norm of neurons at epoch 10, 500, 1000, 2000. (B) The highest and lowest sparsity 100 neurons are selected, denoted by V t V_t V t and V b V_b V b . We observe ℓ d r i v e t o p = ∑ θ ∈ V t ℓ d r i v e θ \ell^{\mathrm{top}}_{\mathrm{drive}} = \sum_{\theta\in V_t} \ell_{\mathrm{drive}}^\theta ℓ drive top = ∑ θ ∈ V t ℓ drive θ and similarly for ℓ d e c a y t o p \ell^{\mathrm{top}}_{\mathrm{decay}} ℓ decay top , ℓ d r i v e b o t \ell^{\mathrm{bot}}_{\mathrm{drive}} ℓ drive bot , ℓ d e c a y b o t \ell^{\mathrm{bot}}_{\mathrm{decay}} ℓ decay bot (C) The clean/noise dataset contributions to the drive. It is ℓ d r i v e t o p , c l e a n = ∑ θ ∈ V t ℓ d r i v e ∣ D c l e a n \ell^{\mathrm{top,clean}}_{\mathrm{drive}} = \sum_{\theta\in V_t} \ell_{\mathrm{drive}} \mid\mathcal{D}_{\mathrm{clean}} ℓ drive top , clean = ∑ θ ∈ V t ℓ drive ∣ D clean and similarly for others.
In Figure 2 B, we report that norm growth is concentrated on high-sparsity neurons, and the growth of the norm and the improvement of the accuracy occur simultaneously in terms of time, according to Figure 1 . We also compare separately on clean and noisy examples in Figure 2 C. It shows that CE–drive term of high-sparsity neurons is contributed primarily by clean data. And these driving forces are almost completely unrelated to the noise in the data.
Cosine Similarity Check. Theorem 1 and 2 provide two estimates for the real gradient flow. We conducted numerical experiments in Appendix § 10 .§ 1 , comparing the cosine similarity between the estimated gradient and the actual gradient. The results show that it can achieve cosine-similarity ≥ 0.9 \ge0.9 ≥ 0.9 with the actual gradient.
We find that the dominant frequencies of U d U_d U d , V d V_d V d , and W d W^d W d tend to agree if the neuron reaches high sparsity. If the common frequency is τ \tau τ , we extract the components at the dominant frequency by
( u d , v d , w d ) = ( ( U ^ d ) τ , ( V ^ d ) τ , ( W ^ d ) τ ) (\mathbf{u}_d,\mathbf{v}_d,\mathbf{w}_d)=((\widehat{U}_d)_\tau,(\widehat{V}_d)_\tau,(\widehat{W}_d)_\tau) ( u d , v d , w d ) = (( U d ) τ , ( V d ) τ , ( W d ) τ ) , then their phases will tend to satisfy arg ( u d ) + arg ( v d ) = arg ( w d ) ( m o d 2 π ) \arg(\mathbf{u}_d)+\arg(\mathbf{v}_d)=\arg(\mathbf{w}_d)\pmod{2\pi} arg ( u d ) + arg ( v d ) = arg ( w d ) ( mod 2 π ) . Figure 3 shows that frequency matching and phase alignment emerge together during training, which is consistent with the result of Prop 2.
Figure 3. Frequency matching and phase alignment. In the odd columns, the horizontal coordinate is the dominant nonzero Fourier frequency of w \mathbf{w} w and the vertical coordinate is its frequency sparsity; in the even columns, the coordinates are arg ( u ) + arg ( v ) m o d 2 π \arg(\mathbf{u})+\arg(\mathbf{v})\bmod2\pi arg ( u ) + arg ( v ) mod 2 π and arg ( w ) m o d 2 π \arg(\mathbf{w})\bmod2\pi arg ( w ) mod 2 π , respectively. Red points indicate exact agreement of the dominant frequencies of u d \mathbf{u}_d u d , v d \mathbf{v}_d v d , and w d \mathbf{w}_d w d , while blue points indicate a mismatch; dashed lines show phase equality.
Full-batch GD check. Using the full addition table, a GELU-activated network, and shared initialization, we compare exact CE training with the truncated model. We simulate both systems over 50 independently evolved neurons and report the dominant frequencies to which they ultimately converge, as well as the frequency sparsity. For the valid neurons, the dominant frequencies predicted by the truncated model exhibit 93% agreement with the converged dominant frequencies of the actual GELU-network. Experimental details are provided in the Appendix § 10 .§ 2 .
Application of Probability Signature
The puzzle of early noise
We identify a puzzle in the early training: uniformly random label noise consistently exhibits a faster initial loss decrease than clean data. It was also recorded by Liu & Lu [7 ] but has not been resolved. From Figure 4 , this phenomenon holds under almost any ratio of noise. Although this may appear inconsistent with the frequency principle [15 ] , which states that high-frequency data components are fitted later and low-frequency components earlier. In the discrete setting, the similar redefinition of frequency will be the probability that the predicted label will change while changing one of the input tokens. In this section, we employ probability signatures to quantify this speed difference.
Figure 4. Early (< 100 <100 < 100 epochs) clean and noise loss dynamics. α \alpha α means the noise ratio. Noise loss always decreases more rapidly.
In the small-initialization regime, the loss derivative is approximately L ˙ ∝ − ∑ i = 1 N σ ( U x i + V y i ) T ( ∑ j = 1 N 1 { z j = z i } σ ( U x j + V y j ) ) \dot{L} \propto-\sum_{i=1}^{N}\sigma(U^{x_i}+V^{y_i})^{\mathsf{T}}\left(\sum_{j=1}^{N}\mathbf{1}_{\{z_j=z_i\}}\sigma(U^{x_j}+V^{y_j})\right) L ˙ ∝ − ∑ i = 1 N σ ( U x i + V y i ) T ( ∑ j = 1 N 1 { z j = z i } σ ( U x j + V y j ) ) , with sampling ( x i , y i , z i ) (x_i,y_i,z_i) ( x i , y i , z i ) from the training distribution. We ignore weight decay because we are comparing the loss of different parts within the same training. From this, we consider counting the numbers of sample pairs that share common coordinates.
For pairs with distinct coordinates define κ ( 0 ) = E [ σ ( α + β ) T σ ( γ + δ ) ] \kappa(0)=\mathbb{E}[\sigma(\alpha+\beta)^{\mathsf{T}}\sigma(\gamma+\delta)] κ ( 0 ) = E [ σ ( α + β ) T σ ( γ + δ )] , while for pairs sharing one coordinate define κ ( 1 ) = E [ σ ( α + β ) T σ ( α + γ ) ] \kappa(1)=\mathbb{E}[\sigma(\alpha+\beta)^{\mathsf{T}}\sigma(\alpha+\gamma)] κ ( 1 ) = E [ σ ( α + β ) T σ ( α + γ )] , where α , β , γ , δ ∼ N ( 0 , 1 / D ) \alpha,\beta,\gamma,\delta\sim\mathcal{N}(0,1/D) α , β , γ , δ ∼ N ( 0 , 1/ D ) are i.i.d. vectors.
Generally, we have κ ( 1 ) > κ ( 0 ) \kappa(1)>\kappa(0) κ ( 1 ) > κ ( 0 ) (see appendix § 13 .§ 1 ). Let n z n_z n z be the number of examples labeled z z z and define K 0 = ∑ z n z 2 K_0=\sum_z n_z^2 K 0 = ∑ z n z 2 . Then the following theorem can compare the early loss for full training dataset. Note that φ ( a ) , φ ( b ) \varphi^{(a)},\varphi^{(b)} φ ( a ) , φ ( b ) here are understood as matrices.
Theorem 3 (Early loss decrease). Suppose the training dataset contains every distinct pairs ( a , b ) ∈ Ω × Ω (a,b)\in\Omega\times\Omega ( a , b ) ∈ Ω × Ω , and the model structure is the same as that mentioned before. For different label distribution, the early-time loss-slope is positively correlated with
E L ˙ C E ∝ − κ ( 0 ) K 0 − ( κ ( 1 ) − κ ( 0 ) ) K 1 , K 1 = P 2 ( ∥ φ ( a ) ∥ 2 2 + ∥ φ ( b ) ∥ 2 2 − 2 ) . \mathbb{E}\dot{L}_{CE}\propto-\kappa(0)K_0-(\kappa(1)-\kappa(0))K_1,\qquad K_1=P^2(\lVert\varphi^{(a)}\rVert_2^2+\lVert\varphi^{(b)}\rVert_2^2-2). E L ˙ C E ∝ − κ ( 0 ) K 0 − ( κ ( 1 ) − κ ( 0 )) K 1 , K 1 = P 2 (∥ φ ( a ) ∥ 2 2 + ∥ φ ( b ) ∥ 2 2 − 2 ) .
Proof. See Appendix E.5.
For modular addition, conditioning on any fixed value of a a a (or b b b ), the label is uniform on Ω \Omega Ω . Hence,
φ ( a ) = φ ( b ) = 1 P 1 P 1 P T , ( K 0 , K 1 ) = ( P 3 , 0 ) . \varphi^{(a)}=\varphi^{(b)}=\frac{1}{P}\mathbf{1}_P\mathbf{1}_P^{\mathsf{T}},\qquad(K_0,K_1)=(P^3,0). φ ( a ) = φ ( b ) = P 1 1 P 1 P T , ( K 0 , K 1 ) = ( P 3 , 0 ) .
For a fully random labeling, let Z x , y = P π ( Z = y ∣ X = x ) Z_{x,y}=\mathbb{P}_{\pi}(Z=y\mid X=x) Z x , y = P π ( Z = y ∣ X = x ) . The P P P pairs with first coordinate x x x receive independent labels, so
Z x , y ∼ P − 1 Binomial ( P , P − 1 ) . Z_{x,y}\sim P^{-1}\operatorname{Binomial}(P,P^{-1}). Z x , y ∼ P − 1 Binomial ( P , P − 1 ) .
According to the binomial distribution, we get E [ Z x , y 2 ] = 2 P − 2 − P − 3 \mathbb{E}[Z_{x,y}^2]=2P^{-2}-P^{-3} E [ Z x , y 2 ] = 2 P − 2 − P − 3 . It further gives E [ K 0 ] = P 3 + P 2 − P , E [ K 1 ] = 2 ( P 2 − P ) \mathbb{E}[K_0]=P^3+P^2-P,\mathbb{E}[K_1]=2(P^2-P) E [ K 0 ] = P 3 + P 2 − P , E [ K 1 ] = 2 ( P 2 − P ) , which are both greater than those in modular-addition case. Thus, uniform random labels can produce a faster early loss decrease than modular-addition labels.
Next we consider the mixture of clean and noise. Without loss of generality, we assume sampling in complete Ω × Ω \Omega\times\Omega Ω × Ω and dividing it into clean samples (modular addition) and noise (uniform random label). The loss for one example ( x i , y i , z i ) (x_i,y_i,z_i) ( x i , y i , z i ) can be regarded as
L ˙ i ≈ − κ ( 0 ) n z i 2 − ( κ ( 1 ) − κ ( 0 ) ) Δ i ; Δ i : = ∑ j = 1 , j ≠ i N t r a i n 1 z i = z j ( 1 x i = x j + 1 y i = y j ) . \dot{L}_i\approx-\kappa(0)n_{z_i}^2-(\kappa(1)-\kappa(0))\Delta_i;\qquad\Delta_i:=\sum_{\substack{j=1,\ j\ne i}}^{N_{\mathrm{train}}}\mathbf{1}_{z_i=z_j}(\mathbf{1}_{x_i=x_j}+\mathbf{1}_{y_i=y_j}). L ˙ i ≈ − κ ( 0 ) n z i 2 − ( κ ( 1 ) − κ ( 0 )) Δ i ; Δ i := j = 1 , j = i ∑ N train 1 z i = z j ( 1 x i = x j + 1 y i = y j ) .
Here the coefficient Δ i \Delta_i Δ i is regarded as Δ c l e a n \Delta_{\mathrm{clean}} Δ clean for a clean sample, or Δ n o i s e \Delta_{\mathrm{noise}} Δ noise for a noise. Taking expectations, the counts satisfy Δ c l e a n = 2 α ( 1 − P − 1 ) \Delta_{\mathrm{clean}}=2\alpha(1-P^{-1}) Δ clean = 2 α ( 1 − P − 1 ) , and Δ n o i s e = 2 ( 1 − P − 1 ) \Delta_{\mathrm{noise}}=2(1-P^{-1}) Δ noise = 2 ( 1 − P − 1 ) . Consequently, Δ n o i s e − Δ c l e a n = 2 ( 1 − α ) ( 1 − P − 1 ) > 0 \Delta_{\mathrm{noise}}-\Delta_{\mathrm{clean}}=2(1-\alpha)(1-P^{-1})>0 Δ noise − Δ clean = 2 ( 1 − α ) ( 1 − P − 1 ) > 0 , so the loss of noise decreases more rapidly. This prediction is consistent with the experimental observations and can also be applied to other forms of noise. In Appendix F.1 and F.2, we conducted additional experiments, thereby verifying that the theoretical predictions presented here are reliable.
Extension of the Method: XOR as an example
The Fourier structure observed in modular addition has previously been identified and functionally validated from trained networks. However, these results primarily provide a mechanistic description of the circuit after it has formed, rather than a general forward description to predict the representation basis associated with a new algebraic operation.
Our probability-signature analysis suggests such a prescription. In the small-initialization regime, the leading parameter dynamic is governed by linear operators constructed from conditional statistics of the training distribution. When these probability-signature operators admit a common eigen basis, transforming the parameters into this basis approximately decouples the leading-order dynamics into independent modes. Thus, the relevant representation basis need not be assumed to be the Fourier basis in advance, instead it can be predicted by finding the common eigenvectors of the joint signature.
This observation provides a natural route for transferring the analysis beyond modular addition. Starting from the Fourier transform, we notice that relevant probability signatures can be regarded as the operators on the Abelian group, whose common eigenvectors are given by the corresponding group characters whenever the operators are simultaneously diagonalizable.
For example, consider the task on Ω = { 0 , … , 63 } \Omega= \{0, \ldots, 63\} Ω = { 0 , … , 63 } , with F ( a , b ) = a xor b F(a,b) = a \operatorname{xor} b F ( a , b ) = a xor b . Its joint signature is
Φ x ( a ) = ∑ y ∈ Ω P ( Z = z , Y = y ∣ X = x ) e y ⊗ e z = 1 64 ∑ y ∈ Ω E ( y , x xor y ) . \Phi_x^{(a)} = \sum_{y\in\Omega} P(Z=z,Y=y \mid X=x)e_y \otimes e_z = \frac{1}{64}\sum_{y\in\Omega} E_{(y,x\operatorname{xor} y)}. Φ x ( a ) = y ∈ Ω ∑ P ( Z = z , Y = y ∣ X = x ) e y ⊗ e z = 64 1 y ∈ Ω ∑ E ( y , x xor y ) .
Hadamard basis simultaneously diagonalize these operators: there is an orthogonal basis H = [ H 0 , H 1 , … , H 63 ] H = [H_0, H_1, \ldots, H_{63}] H = [ H 0 , H 1 , … , H 63 ] such that H − 1 Φ x ( a ) H H^{-1}\Phi_x^{(a)}H H − 1 Φ x ( a ) H is diagonal for every x ∈ Ω x \in\Omega x ∈ Ω . The properties of H H H can be referred to in Appendix § 12 .§ 6 . Therefore, we claim that after training on XOR, the weights will evolve into a shape similar to the Hadamard basis.
Validation. We write u = ∑ k = 0 63 E u , k H k u = \sum_{k=0}^{63} E_{u,k}H_k u = ∑ k = 0 63 E u , k H k , and define its sparsity by
ρ u = max k ∣ E u , k ∣ 2 ∑ k ∣ E u , k ∣ 2 . \rho_u = \frac{\max_k \lvert E_{u,k}\rvert^2}{\sum_k \lvert E_{u,k}\rvert^2}. ρ u = ∑ k ∣ E u , k ∣ 2 max k ∣ E u , k ∣ 2 .
The existence of this orthogonal basis allows the above analysis to be applied to XOR. Based on the redefined frequency sparsity, in Figure 5 we present the observations regarding the frequency matching, as well as the high correlation between frequency sparsity and norm. The observed birth and growth of high-sparsity neurons supports our claim.
Figure 5. Hadamard frequency structure in the XOR experiment. For sampled neurons at epochs 0, 50, 200, the horizontal axis is ∥ θ d ∥ 2 \lVert\theta_d\rVert_2 ∥ θ d ∥ 2 and the vertical axis is the sparsity of w d w_d w d . Red points denote neurons whose three dominant frequencies agree. The right panel reports test accuracy and the number of high-sparsity, frequency-matched neurons; high-sparsity means ρ > 0.7 \rho> 0.7 ρ > 0.7 .
Conclusion and Discussion
Using the probability-signature framework, we provide a unified data-side account of three phenomena. First, for modular addition, the conditional-distribution operators induced by the training data recover the Fourier basis as their common eigenbasis and yield approximately decoupled leading-order dynamics, thereby accounting for the emergence of dominant frequencies, frequency matching, and phase alignment. Second, under uniformly random label noise, conditional label collisions among examples sharing an input coordinate explain why corrupted examples can exhibit a faster initial loss decrease than clean examples. Third, the same operator viewpoint suggests a route for predicting the special structures that neurons may develop on datasets generated by other binary operations: for XOR, the joint signature identifies the Hadamard basis as the relevant candidate coordinate system, in agreement with the weight patterns observed after training. Limitations. We approximate the empirical gradient flow using idealized dynamics derived from discrete, full-distribution probability signatures, together with finite-sample and label-noise corrections. Moreover, our dynamical analysis concerns the dominant gradient terms within a particular training regime; we do not claim that this approximation remains valid throughout the entire training process. Further discussion of the scope and empirical accuracy of this approximation is provided in Appendix § 10 .§ 1 .
Figure 6. Accuracy curves using Adam, with weight decay λ = 0 \lambda= 0 λ = 0 , 10 − 5 10^{-5} 1 0 − 5 , 5 ⋅ 10 − 4 5 \cdot10^{-4} 5 ⋅ 1 0 − 4 , 10 − 4 10^{-4} 1 0 − 4 , 10 − 3 10^{-3} 1 0 − 3 and initialization scale γ = 0.1 , 0.5 , 1.0 \gamma= 0.1, 0.5, 1.0 γ = 0.1 , 0.5 , 1.0 .
Figure 7. Loss curves using Adam.
Model and training details
The neural network structure of this article can be written as
f ( a , b ) = W σ ( U e a + V e b ) = ∑ d = 0 D − 1 W d ( U d , a + V d , b ) , f(a,b) = W\sigma(Ue_a + Ve_b) = \sum_{d=0}^{D-1} W^d(U_{d,a} + V_{d,b}), f ( a , b ) = W σ ( U e a + V e b ) = d = 0 ∑ D − 1 W d ( U d , a + V d , b ) ,
Here, U U U and V V V are input embedding matrices in R D × P \mathbb{R}^{D \times P} R D × P , and W W W is the output matrix in R P × D \mathbb{R}^{P \times D} R P × D , with D D D representing the width of the hidden layer (D = 2000 D = 2000 D = 2000 , P = 113 P = 113 P = 113 ). The output probability can be expressed as
p ( X i ) z i = exp ( f ( a , b ) z i ) ∑ k = 0 P − 1 exp ( f ( a , b ) k ) p(X_i)_{z_i} = \frac{\exp(f(a,b)_{z_i})}{\sum_{k=0}^{P-1}\exp(f(a,b)_k)} p ( X i ) z i = ∑ k = 0 P − 1 exp ( f ( a , b ) k ) exp ( f ( a , b ) z i )
The loss of the training data is given by the cross-entropy:
L C E = 1 N ∑ i = 1 N − log p ( X i ) z i L_{\mathrm{CE}} = \frac{1}{N}\sum_{i=1}^{N} -\log p(X_i)_{z_i} L CE = N 1 i = 1 ∑ N − log p ( X i ) z i
The total loss after adding weight decay is:
L = L C E + λ 2 ( ∥ U ∥ F 2 + ∥ V ∥ F 2 + ∥ W ∥ F 2 ) L = L_{\mathrm{CE}} + \frac{\lambda}{2}\left(\lVert U\rVert_F^2 + \lVert V\rVert_F^2 + \lVert W\rVert_F^2\right) L = L CE + 2 λ ( ∥ U ∥ F 2 + ∥ V ∥ F 2 + ∥ W ∥ F 2 )
The learning rate strategy we employ is warmup + cosine decay:
η t = { η ⋅ t T w a r m u p , t < T w a r m u p η ⋅ 1 2 ( 1 + η 0 + ( 1 − η 0 ) cos ( ( t − T w a r m u p ) π T o p t i m − T w a r m u p ) ) , t ≥ T w a r m u p \eta_t =
\begin{cases}
\eta\cdot\dfrac{t}{T_{\mathrm{warmup}}}, & t < T_{\mathrm{warmup}} \\
\eta\cdot\dfrac{1}{2}\left(1+\eta_0+(1-\eta_0)\cos\left(\dfrac{(t-T_{\mathrm{warmup}})\pi}{T_{\mathrm{optim}}-T_{\mathrm{warmup}}}\right)\right), & t \ge T_{\mathrm{warmup}}
\end{cases} η t = ⎩ ⎨ ⎧ η ⋅ T warmup t , η ⋅ 2 1 ( 1 + η 0 + ( 1 − η 0 ) cos ( T optim − T warmup ( t − T warmup ) π ) ) , t < T warmup t ≥ T warmup
The minimum learning rate η 0 = 10 − 5 \eta_0 = 10^{-5} η 0 = 1 0 − 5 , and the initial learning rate η = 10 − 3 \eta= 10^{-3} η = 1 0 − 3 if using the Adam/AdamW optimizer. Experiments using Adam can generally be reproduced under the AdamW optimizer with about 1000x weight decay. Figure 6,7 compares the specific accuracy or loss curves with Adam under different weight decay and initialization. If the weight decay is too small or absent, there will be no generalization. If the weight decay is too large, it may cause the training to fail to converge, and at this point, all parameters will be compressed to zero. With an appropriate weight decay, using a smaller initial value can shorten the training convergence time. Moreover, check Figure 8 ,Figure 9 for AdamW. Compared with Adam, greater weight decay needs to be used to achieve a similar effect, and we find that in this problem the Adam optimizer can provide better regularization, that is, a reduction of noise.
Figure 8. Accuracy curves using AdamW.
Figure 9. Loss curves using AdamW.
Discussion on Activation Functions
We use σ ( x ) = GELU ( x ) \sigma(x)=\operatorname{GELU}(x) σ ( x ) = GELU ( x ) as the activation function in the main text, which is smooth near zero. The analytical method in our text is based on the expansion of the activation function, hence we conducted the same experiments with other activation functions, such as σ ( x ) = x \sigma(x)=x σ ( x ) = x (linear), σ ( x ) = x 2 \sigma(x)=x^2 σ ( x ) = x 2 , σ ( x ) = tanh ( x ) \sigma(x)=\tanh(x) σ ( x ) = tanh ( x ) , and σ ( x ) = ReLU ( x ) \sigma(x)=\operatorname{ReLU}(x) σ ( x ) = ReLU ( x ) . The experimental results are presented in Figure 10 . From the figure, it can be seen that using the linear activation is almost impossible to learn well on the training set. Using tanh ( x ) \tanh(x) tanh ( x ) as the activation function results in very low test generalization. However, using the quadratic or ReLU activation function can achieve great test generalization under an appropriate weight decay.
Figure 10. (a)–(d): Final accuracy using activation functions σ ( x ) = x \sigma(x)=x σ ( x ) = x (linear), σ ( x ) = x 2 \sigma(x)=x^2 σ ( x ) = x 2 (quadratic), σ ( x ) = tanh ( x ) \sigma(x)=\tanh(x) σ ( x ) = tanh ( x ) , or σ ( x ) = max ( 0 , x ) \sigma(x)=\max(0,x) σ ( x ) = max ( 0 , x ) , under different weight decay.
Let’s review the mathematical derivation of the probability signature presented in the main text, we use the Taylor expansion of the activation function,
σ ( h ) = 0 + σ ′ ( 0 ) h + 1 2 σ ′ ′ ( 0 ) h 2 + o ( h 2 ) , \sigma(h) = 0 + \sigma'(0)h + \frac{1}{2}\sigma''(0)h^2 + o(h^2), σ ( h ) = 0 + σ ′ ( 0 ) h + 2 1 σ ′′ ( 0 ) h 2 + o ( h 2 ) ,
to derive the probability signature. We can categorize all the expanded terms into 1-order or 2-order terms, based on whether they come from the 1st-order expansion or the 2nd-order expansion. In Theorem 1, the 1-order terms are eliminated because of the assumption of uniform marginal distribution. As a result, the second-order derivative term is the key to this problem.
The theoretical explanation matches our observation of poor generalization with linear/Tanh. Because tanh ( x ) = x − x 3 / 3 + ⋯ \tanh(x) = x - x^3/3 + \cdots tanh ( x ) = x − x 3 /3 + ⋯ does not contain the second-order derivative term. Meanwhile, the quadratic activation function contains the second-order derivative term, which does well in the test case. Besides, the success of RELU is not in contradiction to the analysis, because it is not differentiable near 0. We will discuss the RELU activation function in detail in Appendix D.
Experimental Details
Gradient Flow Approximation
In this section, we present the experimental results with the aim of verifying the rationality of the approximation methods employed in Theorem 1 and Theorem 2.
By Theorem 1, we can approximate the gradient flow of U x U^x U x as U ˙ x ≈ − λ U x + c ⋅ diag ( V Φ x ( a ) W ) \dot{U}^x \approx-\lambda U^x + c \cdot\operatorname{diag}(V\Phi_x^{(a)}W) U ˙ x ≈ − λ U x + c ⋅ diag ( V Φ x ( a ) W ) , where Φ x ( a ) \Phi_x^{(a)} Φ x ( a ) is the probability signature of the actual training dataset. We extract its main term,
∇ ^ U x L 1 : = diag ( V Φ x ( a ) W ) , \widehat{\nabla}_{U^x}L_1 := \operatorname{diag}(V\Phi_x^{(a)}W), ∇ U x L 1 := diag ( V Φ x ( a ) W ) ,
as an approximation for the cross-entropy gradient. Flatten this vector, we get ∇ ^ θ L 1 \widehat{\nabla}_{\theta}L_1 ∇ θ L 1 , which is an approximation for the cross-entropy gradient ∇ θ L \nabla_{\theta}L ∇ θ L . We compare the two gradients by cosine similarity
cos ⟨ ∇ ^ θ L 1 , ∇ θ L ⟩ ∥ ∇ ^ θ L 1 ∥ 2 ⋅ ∥ ∇ θ L ∥ 2 , \cos\frac{\langle\widehat{\nabla}_{\theta}L_1,\nabla_{\theta}L\rangle}{\lVert\widehat{\nabla}_{\theta}L_1\rVert_2 \cdot\lVert\nabla_{\theta}L\rVert_2}, cos ∥ ∇ θ L 1 ∥ 2 ⋅ ∥ ∇ θ L ∥ 2 ⟨ ∇ θ L 1 , ∇ θ L ⟩ ,
as Approx 1 in Figure 11 .
Figure 11. Cosine similarity between the approximated gradients and the actual gradients. The blue curve uses the main term from Theorem 1 and the red one uses the main term from Theorem 2.
Similarly, by Theorem 2, we can approximate the gradient flow of U x U^x U x as U ˙ x ≈ − λ U x + c ⋅ diag ( V Φ x + W ) \dot{U}^x \approx-\lambda U^x + c \cdot\operatorname{diag}(V\Phi_x^{+}W) U ˙ x ≈ − λ U x + c ⋅ diag ( V Φ x + W ) , where Φ x + \Phi_x^{+} Φ x + is the probability signature of the clean modular addition, it is,
Φ x + = 1 P ( 1 1 ⋱ 1 1 ) x , \Phi_x^{+} = \frac{1}{P}
\begin{pmatrix}
1 & & & & \\
& 1 & & & \\
& & \ddots& & \\
& & & 1 & \\
1 & & & &
\end{pmatrix}^{x}, Φ x + = P 1 1 1 1 ⋱ 1 x ,
We also extract and flatten its main term as ∇ ^ θ L 2 \widehat{\nabla}_{\theta}L_2 ∇ θ L 2 , comparing which with the cross-entropy gradient ∇ θ L \nabla_{\theta}L ∇ θ L by cosine similarity, as Approx 2 in Figure 11 . The experimental results show that both the approximated gradients and the actual gradients have a high similarity of 90%. This verifies our theoretical analysis. Meanwhile, the control experiments using σ ( x ) = x 2 \sigma(x) = x^2 σ ( x ) = x 2 can serve as an ablation study, which demonstrates that using only the 2-order main terms is sufficient for achieving test generalization in the modular-addition task.
Discussion on the small initialization assumption. In the main text, the approximation of the gradient is required to be expanded within a small parameter region. At the same time, we claim that the neurons we are studying can always grow. This note will clarify that this is not in contradiction.
First of all, we acknowledge that there are higher-order terms in the gradient flow equation such as δ = O ( h 3 ) \delta= O(h^3) δ = O ( h 3 ) . Our theoretical derivation does not assume that these higher-order terms should be omitted. We focus on the dominant part. There exists a scale h 0 h_0 h 0 . When the parameter is less than h 0 h_0 h 0 , the second-order term becomes dominant, while when the parameter is greater than h 0 h_0 h 0 , the higher-order terms become dominant. It is noted that when weight decay exists, there is a non-high-order term of − λ θ -\lambda\theta − λ θ in the gradient flow equation. Therefore, an appropriate λ \lambda λ will position the decay term between the above, and when the scale of the parameters expands beyond the region dominated by the second-order, the weight decay becomes the main term, thereby preventing the scale of the parameters from continuing to grow.
Frequency Selectivity
We used complete addition tables with P = 7 P = 7 P = 7 , D = 50 D = 50 D = 50 , GELU activation, Gaussian scale D − 1 / 2 D^{-1/2} D − 1/2 . Both models started from identical initialized parameters. The exact update was
θ k + 1 = θ k + 0.2 ( − ∇ L ( θ k ) − 10 − 4 θ k ) , \theta_{k+1} = \theta_k + 0.2(-\nabla L(\theta_k) - 10^{-4}\theta_k), θ k + 1 = θ k + 0.2 ( − ∇ L ( θ k ) − 1 0 − 4 θ k ) ,
and the truncated update replaced − ∇ L -\nabla L − ∇ L by the field in Theorem 1 with c = σ ′ ′ ( 0 ) / 7 c = \sigma^{\prime\prime}(0)/7 c = σ ′′ ( 0 ) /7 and the same weight decay λ = 0.0001 \lambda= 0.0001 λ = 0.0001 .
Recording every 25 epochs, the experiment tracked the evolution of the dominant frequency of each neuron, in Figure 12 . We found that approximately 50% of the neurons developed a dominant frequency, and among this subset, a proportion of 0.93 converged to the same dominant frequency. Because shared initialization parameters were used, these neurons gave rise to the same frequency selection, which is consistent with our argument in Proposition 2.
Figure 12. Neuron-wise frequency concentration in the truncated and original GELU systems. Heatmaps show the evolution of matched-frequency sparsity for individual neurons during training. Rows correspond to neurons, and columns represent training epochs. Numbers indicate the final winning Fourier mode, whereas ’x’ marks neurons whose winner had not stabilized by the specified threshold. Higher values indicate stronger concentration onto a matched nonzero frequency.
Discussion on the ReLU activation
In this section, we will discuss the ReLU activation function in detail. The ReLU activation function is not differentiable at 0, which makes it difficult to analyze using Taylor expansion. However, we can still analyze the behavior of the network with ReLU activation by considering the piecewise linear nature of ReLU.
Fourier-mode is able to do modular addition under RELU
We give a note on how 2L-MLP with ReLU activation do well in modular addition.
Proposition 3 (A sufficient Fourier condition for modular addition). Let P P P be an odd prime, and let w d ∈ Z P ∖ { 0 } w_d \in\mathbb{Z}_P \setminus\{0\} w d ∈ Z P ∖ { 0 } , 0 ≤ d < D 0 \le d < D 0 ≤ d < D be prescribed frequencies. For each hidden unit d d d , let ϕ 1 , d , ϕ 2 , d \phi_{1,d}, \phi_{2,d} ϕ 1 , d , ϕ 2 , d be mutually independent random variables distributed uniformly on [ 0 , 2 π ) [0, 2\pi) [ 0 , 2 π ) . If the parameters are set to U d , x = cos ( 2 π w d x P + ϕ 1 , d ) U_{d,x} = \cos\left(\frac{2\pi w_d x}{P} + \phi_{1,d}\right) U d , x = cos ( P 2 π w d x + ϕ 1 , d ) , V d , x = cos ( 2 π w d x P + ϕ 2 , d ) V_{d,x} = \cos\left(\frac{2\pi w_d x}{P} + \phi_{2,d}\right) V d , x = cos ( P 2 π w d x + ϕ 2 , d ) , W c , d = cos ( 2 π w d c P + ϕ 1 , d + ϕ 2 , d ) W_{c,d} = \cos\left(\frac{2\pi w_d c}{P} + \phi_{1,d} + \phi_{2,d}\right) W c , d = cos ( P 2 π w d c + ϕ 1 , d + ϕ 2 , d ) , then the prediction of the neural network is ( a + b ) m o d P (a+b) \bmod P ( a + b ) mod P with probability tending to 1 1 1 as D → ∞ D \to\infty D → ∞ .
Proof. Fix a , b ∈ Z P a,b \in\mathbb{Z}_P a , b ∈ Z P , and write
c ⋆ = ( a + b ) m o d P . c_\star= (a+b) \bmod P. c ⋆ = ( a + b ) mod P .
For each hidden unit d d d and output coordinate c c c , define
X d , c : = W c , d max { 0 , U d , a + V d , b } . X_{d,c} := W_{c,d}\max\{0,U_{d,a}+V_{d,b}\}. X d , c := W c , d max { 0 , U d , a + V d , b } .
Then
f c ( D ) ( a , b ) = 1 D ∑ d = 1 D X d , c . f_c^{(D)}(a,b) = \frac{1}{D}\sum_{d=1}^{D}X_{d,c}. f c ( D ) ( a , b ) = D 1 d = 1 ∑ D X d , c .
Since ∣ W c , d ∣ ≤ 1 \lvert W_{c,d}\rvert\le1 ∣ W c , d ∣ ≤ 1 and
0 ≤ max { 0 , U d , a + V d , b } ≤ 2 , 0 \le\max\{0,U_{d,a}+V_{d,b}\} \le2, 0 ≤ max { 0 , U d , a + V d , b } ≤ 2 ,
we have
− 2 ≤ X d , c ≤ 2. -2 \le X_{d,c} \le2. − 2 ≤ X d , c ≤ 2.
We first compute the expectation of a single-unit contribution. Set
α d = 2 π w d a P + ϕ 1 , d , β d = 2 π w d b P + ϕ 2 , d , \alpha_d = \frac{2\pi w_d a}{P}+\phi_{1,d}, \qquad\beta_d = \frac{2\pi w_d b}{P}+\phi_{2,d}, α d = P 2 π w d a + ϕ 1 , d , β d = P 2 π w d b + ϕ 2 , d ,
and let
δ d , c = 2 π w d ( c − a − b ) P . \delta_{d,c} = \frac{2\pi w_d(c-a-b)}{P}. δ d , c = P 2 π w d ( c − a − b ) .
Because
ϕ 1 , d + ϕ 2 , d = α d + β d − 2 π w d ( a + b ) P , \phi_{1,d}+\phi_{2,d} = \alpha_d+\beta_d-\frac{2\pi w_d(a+b)}{P}, ϕ 1 , d + ϕ 2 , d = α d + β d − P 2 π w d ( a + b ) ,
we obtain
W c , d = cos ( α d + β d + δ d , c ) . W_{c,d} = \cos(\alpha_d+\beta_d+\delta_{d,c}). W c , d = cos ( α d + β d + δ d , c ) .
Thus,
E [ X d , c ] = E [ cos ( α d + β d + δ d , c ) max { 0 , cos α d + cos β d } ] . \mathbb{E}[X_{d,c}] = \mathbb{E}\left[\cos(\alpha_d+\beta_d+\delta_{d,c})\max\{0,\cos\alpha_d+\cos\beta_d\}\right]. E [ X d , c ] = E [ cos ( α d + β d + δ d , c ) max { 0 , cos α d + cos β d } ] .
Since α d \alpha_d α d and β d \beta_d β d are independent and uniformly distributed on [ 0 , 2 π ) [0,2\pi) [ 0 , 2 π ) , we may set
s = α d + β d 2 , t = α d − β d 2 . s = \frac{\alpha_d+\beta_d}{2}, \qquad t = \frac{\alpha_d-\beta_d}{2}. s = 2 α d + β d , t = 2 α d − β d .
Using
cos α d + cos β d = 2 cos s cos t , \cos\alpha_d+\cos\beta_d = 2\cos s\cos t, cos α d + cos β d = 2 cos s cos t ,
we have
E [ X d , c ] = 1 ( 2 π ) 2 ∫ 0 2 π ∫ 0 2 π cos ( 2 s + δ d , c ) [ 2 cos s cos t ] + d t d s . \mathbb{E}[X_{d,c}] = \frac{1}{(2\pi)^2}\int_{0}^{2\pi}\int_{0}^{2\pi}\cos(2s+\delta_{d,c})[2\cos s\cos t]_+\,dt\,ds. E [ X d , c ] = ( 2 π ) 2 1 ∫ 0 2 π ∫ 0 2 π cos ( 2 s + δ d , c ) [ 2 cos s cos t ] + d t d s .
For fixed s s s ,
∫ 0 2 π [ 2 cos s cos t ] + d t = 4 ∣ cos s ∣ . \int_{0}^{2\pi} [2\cos s\cos t]_{+}\,dt = 4|\cos s|. ∫ 0 2 π [ 2 cos s cos t ] + d t = 4∣ cos s ∣.
Consequently,
E [ X d , c ] = 1 π 2 ∫ 0 2 π ∣ cos s ∣ cos ( 2 s + δ d , c ) d s = cos ( δ d , c ) π 2 ∫ 0 2 π ∣ cos s ∣ cos ( 2 s ) d s = 4 3 π 2 cos ( δ d , c ) . \mathbb{E}[X_{d,c}] = \frac{1}{\pi^2}\int_{0}^{2\pi}|\cos s|\cos(2s+\delta_{d,c})\,ds
= \frac{\cos(\delta_{d,c})}{\pi^2}\int_{0}^{2\pi}|\cos s|\cos(2s)\,ds
= \frac{4}{3\pi^2}\cos(\delta_{d,c}). E [ X d , c ] = π 2 1 ∫ 0 2 π ∣ cos s ∣ cos ( 2 s + δ d , c ) d s = π 2 cos ( δ d , c ) ∫ 0 2 π ∣ cos s ∣ cos ( 2 s ) d s = 3 π 2 4 cos ( δ d , c ) .
In the second equality, the sine term vanishes by symmetry, and in the last equality we used
∫ 0 2 π ∣ cos s ∣ cos ( 2 s ) d s = 4 3 . \int_{0}^{2\pi}|\cos s|\cos(2s)\,ds = \frac{4}{3}. ∫ 0 2 π ∣ cos s ∣ cos ( 2 s ) d s = 3 4 .
Therefore,
E [ X d , c ] = 4 3 π 2 cos ( 2 π w d ( c − a − b ) P ) . \mathbb{E}[X_{d,c}] = \frac{4}{3\pi^2}\cos\left(\frac{2\pi w_d(c-a-b)}{P}\right). E [ X d , c ] = 3 π 2 4 cos ( P 2 π w d ( c − a − b ) ) .
For the target coordinate c ⋆ c_{\star} c ⋆ , we have
c ⋆ − a − b ≡ 0 ( m o d P ) , c_{\star}-a-b\equiv0 \pmod{P}, c ⋆ − a − b ≡ 0 ( mod P ) ,
and hence
E [ X d , c ⋆ ] = 4 3 π 2 . \mathbb{E}[X_{d,c_{\star}}] = \frac{4}{3\pi^2}. E [ X d , c ⋆ ] = 3 π 2 4 .
Now consider any c ≠ c ⋆ c\ne c_{\star} c = c ⋆ . Since P P P is prime,
w d ≢ 0 ( m o d P ) , c − a − b ≢ 0 ( m o d P ) w_d\not\equiv0 \pmod{P},\qquad c-a-b\not\equiv0 \pmod{P} w d ≡ 0 ( mod P ) , c − a − b ≡ 0 ( mod P )
imply
w d ( c − a − b ) ≢ 0 ( m o d P ) . w_d(c-a-b)\not\equiv0 \pmod{P}. w d ( c − a − b ) ≡ 0 ( mod P ) .
Define
ρ P : = max r ∈ Z P ∖ { 0 } cos ( 2 π r P ) . \rho_P:=\max_{r\in\mathbb{Z}_P\setminus\{0\}}\cos\left(\frac{2\pi r}{P}\right). ρ P := r ∈ Z P ∖ { 0 } max cos ( P 2 π r ) .
Because Z P ∖ { 0 } \mathbb{Z}_P\setminus\{0\} Z P ∖ { 0 } is finite and none of the corresponding angles is congruent to 0 0 0 modulo 2 π 2\pi 2 π ,
It follows that, for every d d d and every c ≠ c ⋆ c\ne c_{\star} c = c ⋆ ,
E [ X d , c ] ≤ 4 3 π 2 ρ P . \mathbb{E}[X_{d,c}]\le\frac{4}{3\pi^2}\rho_P. E [ X d , c ] ≤ 3 π 2 4 ρ P .
Hence, with
Δ P : = 4 3 π 2 ( 1 − ρ P ) > 0 , \Delta_P:=\frac{4}{3\pi^2}(1-\rho_P)>0, Δ P := 3 π 2 4 ( 1 − ρ P ) > 0 ,
we have
E [ X d , c ⋆ ] − E [ X d , c ] ≥ Δ P for all d and all c ≠ c ⋆ . \mathbb{E}[X_{d,c_\star}] - \mathbb{E}[X_{d,c}] \ge\Delta_P \qquad\text{for all } d \text{ and all } c \ne c_\star. E [ X d , c ⋆ ] − E [ X d , c ] ≥ Δ P for all d and all c = c ⋆ .
Averaging over d d d gives
E [ f c ⋆ ( D ) ( a , b ) ] − E [ f c ( D ) ( a , b ) ] ≥ Δ P for every c ≠ c ⋆ . \mathbb{E}[f_{c_\star}^{(D)}(a,b)] - \mathbb{E}[f_c^{(D)}(a,b)] \ge\Delta_P \qquad\text{for every } c \ne c_\star. E [ f c ⋆ ( D ) ( a , b )] − E [ f c ( D ) ( a , b )] ≥ Δ P for every c = c ⋆ .
It remains to control the fluctuations around these expectations. Since the random phases are mutually independent across hidden units, the variables { X d , c } d = 1 D \{X_{d,c}\}_{d=1}^{D} { X d , c } d = 1 D are independent for each fixed c c c . Moreover, X d , c ∈ [ − 2 , 2 ] X_{d,c} \in[-2,2] X d , c ∈ [ − 2 , 2 ] . Therefore, Hoeffding’s inequality yields, for every ε > 0 \varepsilon> 0 ε > 0 ,
P ( ∣ f c ( D ) ( a , b ) − E [ f c ( D ) ( a , b ) ] ∣ ≥ ε ) ≤ 2 exp ( − D ε 2 8 ) . \mathbb{P}\left(\left|f_c^{(D)}(a,b)-\mathbb{E}[f_c^{(D)}(a,b)]\right|\ge\varepsilon\right) \le2\exp\left(-\frac{D\varepsilon^2}{8}\right). P ( f c ( D ) ( a , b ) − E [ f c ( D ) ( a , b )] ≥ ε ) ≤ 2 exp ( − 8 D ε 2 ) .
Taking ε = Δ P / 3 \varepsilon=\Delta_P/3 ε = Δ P /3 and applying the union bound over the P P P output coordinates, we obtain
P ( max c ∈ Z P ∣ f c ( D ) ( a , b ) − E [ f c ( D ) ( a , b ) ] ∣ ≥ Δ P 3 ) ≤ 2 P exp ( − D Δ P 2 72 ) . \mathbb{P}\left(\max_{c\in\mathbb{Z}_P}\left|f_c^{(D)}(a,b)-\mathbb{E}[f_c^{(D)}(a,b)]\right|\ge\frac{\Delta_P}{3}\right) \le2P\exp\left(-\frac{D\Delta_P^2}{72}\right). P ( c ∈ Z P max f c ( D ) ( a , b ) − E [ f c ( D ) ( a , b )] ≥ 3 Δ P ) ≤ 2 P exp ( − 72 D Δ P 2 ) .
On the complementary event, for every c ≠ c ⋆ c\ne c_\star c = c ⋆ ,
f c ⋆ ( D ) ( a , b ) − f c ( D ) ( a , b ) ≥ ( E [ f c ⋆ ( D ) ( a , b ) ] − E [ f c ( D ) ( a , b ) ] ) − 2 Δ P 3 ≥ Δ P 3 > 0. \begin{aligned}
f_{c_\star}^{(D)}(a,b)-f_c^{(D)}(a,b) \ge\left(\mathbb{E}[f_{c_\star}^{(D)}(a,b)]-\mathbb{E}[f_c^{(D)}(a,b)]\right)-\frac{2\Delta_P}{3} \\
&\ge\frac{\Delta_P}{3}>0.
\end{aligned} f c ⋆ ( D ) ( a , b ) − f c ( D ) ( a , b ) ≥ ( E [ f c ⋆ ( D ) ( a , b )] − E [ f c ( D ) ( a , b )] ) − 3 2 Δ P ≥ 3 Δ P > 0.
Thus, on this event, c ⋆ c_\star c ⋆ is the unique maximizing output coordinate. Consequently,
P ( arg max c ∈ Z P f c ( D ) ( a , b ) = c ⋆ ) ≥ 1 − 2 P exp ( − D Δ P 2 72 ) . \mathbb{P}\left(\underset{c\in\mathbb{Z}_P}{\arg\max}\ f_c^{(D)}(a,b)=c_\star\right)\ge1-2P\exp\left(-\frac{D\Delta_P^2}{72}\right). P ( c ∈ Z P arg max f c ( D ) ( a , b ) = c ⋆ ) ≥ 1 − 2 P exp ( − 72 D Δ P 2 ) .
Since the right-hand side converges to 1 1 1 as D → ∞ D\to\infty D → ∞ , we conclude that
P ( arg max c ∈ Z P f c ( D ) ( a , b ) = ( a + b ) m o d P ) ⟶ 1. \mathbb{P}\left(\underset{c\in\mathbb{Z}_P}{\arg\max}\ f_c^{(D)}(a,b)=(a+b)\bmod P\right)\longrightarrow1. P ( c ∈ Z P arg max f c ( D ) ( a , b ) = ( a + b ) mod P ) ⟶ 1.
Experiment Details of ReLU activation
We conducted experiments using the ReLU activation function, and the results are shown in Figure 13 and Figure 14 . The experimental setup is consistent with that of the GELU activation function. The results indicate that the ReLU activation function exhibits similar behavior to GELU in terms of weight decay selectivity or frequency-phase scatter evolution. This suggests that the observed phenomena are not specific to those smooth activation function but rather reflect more general properties of neural network training dynamics.
Figure 13. Experiment of Figure 2 with ReLU.
Figure 14. Experiment of Figure 3 with ReLU.
Early Memorization
Current research Zhang et al. [17 ] ; Jacot et al. [5 ] have already provided a thorough discussion on the early memory behavior of neural networks. When use σ ( x ) = max ( 0 , x ) \sigma(x) = \max(0, x) σ ( x ) = max ( 0 , x ) , we observe clear traces of memory at ( λ , γ ) = ( 0.001 , 0.1 ) (\lambda, \gamma) = (0.001, 0.1) ( λ , γ ) = ( 0.001 , 0.1 ) . The training curve from Figure 15 shows it reaches high accuracy on both clean and noise dataset first and then decreases due to the weight decay. Here, we merely use the gradient flow to offer a more intuitive understanding.
Figure 15. Accuracy curve under RELU activation and ( λ , γ ) = ( 0.001 , 0.1 ) (\lambda, \gamma) = (0.001, 0.1) ( λ , γ ) = ( 0.001 , 0.1 ) , with 30% noise.
Consider a single example ( a , b , y ) (a, b, y) ( a , b , y ) and let h = U e a + V e b h = Ue_a + Ve_b h = U e a + V e b and p = softmax ( f ( a , b ) ) p = \operatorname{softmax}(f(a, b)) p = softmax ( f ( a , b )) . By the chain rule,
∂ L ∂ W ν , d = ( p − e y ) ν σ ( h ) d + λ W ν , d , ∂ L ∂ U d , x = 1 { x = a ∧ h d > 0 } [ W T ( p − e y ) ] d + λ U d , x . \frac{\partial L}{\partial W_{\nu,d}} = (p-e_y)_\nu\sigma(h)_d + \lambda W_{\nu,d}, \qquad
\frac{\partial L}{\partial U_{d,x}} = \mathbf{1}_{\{x=a\wedge h_d>0\}}[W^\mathsf{T}(p-e_y)]_d + \lambda U_{d,x}. ∂ W ν , d ∂ L = ( p − e y ) ν σ ( h ) d + λ W ν , d , ∂ U d , x ∂ L = 1 { x = a ∧ h d > 0 } [ W T ( p − e y ) ] d + λ U d , x .
Thus the gradient flow for the output weights is
d W ν , d d t = ( e y − p ) ν σ ( h ) d − λ W ν , d . \frac{\mathrm{d}W_{\nu,d}}{\mathrm{d}t} = (e_y-p)_\nu\sigma(h)_d - \lambda W_{\nu,d}. d t d W ν , d = ( e y − p ) ν σ ( h ) d − λ W ν , d .
Near initialization, the softmax expansion gives
softmax ( f ) = 1 P 1 P + 1 P ( f − f ˉ ) + O ( ∥ f ∥ 2 / P ) , \operatorname{softmax}(f) = \frac{1}{P}\mathbf{1}_P + \frac{1}{P}(f-\bar{f}) + O(\lVert f\rVert^2/P), softmax ( f ) = P 1 1 P + P 1 ( f − f ˉ ) + O (∥ f ∥ 2 / P ) ,
so the correct output coordinate is amplified while the others are weakly suppressed. In particular, the active coordinates satisfy d W y T d t = σ ( h ) − λ W y T \frac{\mathrm{d}W_y^\mathsf{T}}{\mathrm{d}t} = \sigma(h)-\lambda W_y^\mathsf{T} d t d W y T = σ ( h ) − λ W y T , hence the weights will increase in those dimensions where σ ( h ) > 0 \sigma(h) > 0 σ ( h ) > 0 . For the example in Figure 16 (a), σ ( x ) = max ( 0 , x ) \sigma(x) = \max(0, x) σ ( x ) = max ( 0 , x ) , only d = 3 , 5 d = 3, 5 d = 3 , 5 are active in the case, namely those satisfying h d = U d , a + V d , b > 0 h_d = U_{d,a} + V_{d,b} > 0 h d = U d , a + V d , b > 0 . This is only a toy model of 1 training sample. It behaves like an interpolation, storing the data onto these random dimensions.
Figure 16. Example-wise interpolation and the memory score. (a). For the illustrative input 3 + 1 = 4 3 + 1 = 4 3 + 1 = 4 with ( D , P ) = ( 7 , 5 ) (D, P) = (7, 5) ( D , P ) = ( 7 , 5 ) , σ ( x ) = max ( 0 , x ) \sigma(x) = \max(0, x) σ ( x ) = max ( 0 , x ) , the activation feature K = e 3 + e 5 K = e_3 + e_5 K = e 3 + e 5 represents the initially active hidden coordinates; the displayed ± 1 \pm1 ± 1 values denote random initialization signs rather than fixed parameter values. (b). Evolution of the memory score on clean and noisy training examples.
In the full-batch setting, the exact flows are
d W c , d d t = − 1 N t r a i n ∑ i [ p i , c − 1 { y i = c } ] max ( 0 , U d , a i + V d , b i ) − λ W c , d , \frac{\mathrm{d}W_{c,d}}{\mathrm{d}t} = -\frac{1}{N_{\mathrm{train}}} \sum_i [p_{i,c} - \mathbb{1}_{\{y_i=c\}}] \max(0, U_{d,a_i} + V_{d,b_i}) - \lambda W_{c,d}, d t d W c , d = − N train 1 i ∑ [ p i , c − 1 { y i = c } ] max ( 0 , U d , a i + V d , b i ) − λ W c , d ,
d U d , a d t = − 1 N t r a i n ∑ i : a i = a 1 { U d , a i + V d , b i > 0 } ∑ r [ p i , r − 1 { y i = r } ] W r , d − λ U d , a , \frac{\mathrm{d}U_{d,a}}{\mathrm{d}t} = -\frac{1}{N_{\mathrm{train}}} \sum_{i:a_i=a} \mathbb{1}_{\{U_{d,a_i}+V_{d,b_i}>0\}} \sum_r [p_{i,r} - \mathbb{1}_{\{y_i=r\}}]W_{r,d} - \lambda U_{d,a}, d t d U d , a = − N train 1 i : a i = a ∑ 1 { U d , a i + V d , b i > 0 } r ∑ [ p i , r − 1 { y i = r } ] W r , d − λ U d , a ,
d V d , b d t = − 1 N t r a i n ∑ i : b i = b ∑ a i 1 { U d , a i + V d , b i > 0 } ∑ r [ p i , r − 1 { y i = r } ] W r , d − λ V d , b . \frac{\mathrm{d}V_{d,b}}{\mathrm{d}t}=-\frac{1}{N_{\mathrm{train}}}\sum_{i:b_i=b}\sum_{a_i}\mathbf{1}_{\{U_{d,a_i}+V_{d,b_i}>0\}}\sum_r\left[p_{i,r}-\mathbf{1}_{\{y_i=r\}}\right]W_{r,d}-\lambda V_{d,b}. d t d V d , b = − N train 1 i : b i = b ∑ a i ∑ 1 { U d , a i + V d , b i > 0 } r ∑ [ p i , r − 1 { y i = r } ] W r , d − λ V d , b .
These equations show that each example ( X = ( a , b ) , y ) (X=(a,b),y) ( X = ( a , b ) , y ) strengthens its own output coordinate ( y ) (y) ( y ) on its active hidden dimensions and suppresses the other output coordinates ( c ≠ y ) (c\ne y) ( c = y ) , with the latter effect smaller by approximately a factor 1 / P 1/P 1/ P . This example-wise interpolation motivates the following memory score:
mem : = ∑ i = 1 N ∑ d = 1 D 1 { U d , a i + V d , b i > 0 } ∑ c ≠ y i ( W y i , d − W c , d ) . \operatorname{mem}:=\sum_{i=1}^{N}\sum_{d=1}^{D}\mathbf{1}_{\{U_{d,a_i}+V_{d,b_i}>0\}}\sum_{c\ne y_i}(W_{y_i,d}-W_{c,d}). mem := i = 1 ∑ N d = 1 ∑ D 1 { U d , a i + V d , b i > 0 } c = y i ∑ ( W y i , d − W c , d ) .
From figure 16(b), we can observe that the memory score undergoes a rapid accumulation process in the early stages of training. Simultaneously, due to the weight decay’s effect of reducing the norm, it gradually decreases.
Proofs and Additional Details
Calculation of the gradient flow
Proof. Let
h x , y : = U e x + V e y = U x + V y , p x , y : = softmax ( W σ ( h x , y ) ) . h_{x,y}:=Ue_x+Ve_y=U^x+V^y,\qquad p_{x,y}:=\operatorname{softmax}(W\sigma(h_{x,y})). h x , y := U e x + V e y = U x + V y , p x , y := softmax ( W σ ( h x , y )) .
Without loss of generality, assume that the learning rate η = 1 \eta=1 η = 1 . For the softmax cross-entropy loss associated with one sample ( x , y , z ) (x,y,z) ( x , y , z ) ,
ℓ ( x , y , z ) = − log ( p x , y ) z , \ell(x,y,z)=-\log(p_{x,y})_z, ℓ ( x , y , z ) = − log ( p x , y ) z ,
the derivative with respect to the logits f ( x , y ) = W σ ( h x , y ) f(x,y)=W\sigma(h_{x,y}) f ( x , y ) = W σ ( h x , y ) is
∇ f ℓ = p x , y − e z . \nabla_f\ell=p_{x,y}-e_z. ∇ f ℓ = p x , y − e z .
Therefore, by the chain rule,
∇ h x , y ℓ = Diag ( σ ′ ( h x , y ) ) W ⊤ ( p x , y − e z ) . \nabla_{h_{x,y}}\ell=\operatorname{Diag}(\sigma'(h_{x,y}))W^\top(p_{x,y}-e_z). ∇ h x , y ℓ = Diag ( σ ′ ( h x , y )) W ⊤ ( p x , y − e z ) .
Since U x U^x U x contributes to h x , y h_{x,y} h x , y only when the first position of the sample is x x x , the full-batch gradient flow gives
d U x d t = r x E π [ σ ′ ( h x , y ) ⊙ W ⊤ ( e z − p x , y ) ∣ x ] . (2) \frac{\mathrm{d}U^x}{\mathrm{d}t}=r_x\mathbb{E}_{\pi}\left[\sigma'(h_{x,y})\mathbin{\odot}W^\top(e_z-p_{x,y})\mid x\right]. \tag*{(2)} d t d U x = r x E π [ σ ′ ( h x , y ) ⊙ W ⊤ ( e z − p x , y ) ∣ x ] . (2)
Because σ \sigma σ is C 3 C^3 C 3 near zero and
σ ( h ) = c 1 h + c 2 2 h 2 + o ( h 2 ) , \sigma(h)=c_1h+\frac{c_2}{2}h^2+o(h^2), σ ( h ) = c 1 h + 2 c 2 h 2 + o ( h 2 ) ,
where the powers are understood componentwise, we have
σ ′ ( h ) = c 1 1 + c 2 h + o ( ∥ h ∥ ) . (3) \sigma'(h)=c_1\mathbf{1}+c_2h+o(\lVert h\rVert). \tag*{(3)} σ ′ ( h ) = c 1 1 + c 2 h + o (∥ h ∥) . (3)
Moreover,
σ ( h ) = c 1 h + O ( ∥ h ∥ 2 ) . (4) \sigma(h) = c_1 h + O(\lVert h\rVert^2). \tag*{(4)} σ ( h ) = c 1 h + O (∥ h ∥ 2 ) . (4)
Let
Π P : = I − 1 P 1 P 1 P T . \Pi_P := I - \frac{1}{P}\mathbf{1}_P\mathbf{1}_P^{\mathsf{T}}. Π P := I − P 1 1 P 1 P T .
The softmax function satisfies
softmax ( 0 ) = 1 P 1 P , \operatorname{softmax}(0) = \frac{1}{P}\mathbf{1}_P, softmax ( 0 ) = P 1 1 P ,
and its Jacobian at zero is
D softmax ( 0 ) = Diag ( 1 P 1 P ) − ( 1 P 1 P ) ( 1 P 1 P ) T = 1 P I − 1 P 2 1 P 1 P T = 1 P Π P . \begin{aligned}
D\operatorname{softmax}(0)
&= \operatorname{Diag}\left(\frac{1}{P}\mathbf{1}_P\right)
-\left(\frac{1}{P}\mathbf{1}_P\right)\left(\frac{1}{P}\mathbf{1}_P\right)^{\mathsf{T}} \\
&= \frac{1}{P}I-\frac{1}{P^2}\mathbf{1}_P\mathbf{1}_P^{\mathsf{T}} \\
&= \frac{1}{P}\Pi_P.
\end{aligned} D softmax ( 0 ) = Diag ( P 1 1 P ) − ( P 1 1 P ) ( P 1 1 P ) T = P 1 I − P 2 1 1 P 1 P T = P 1 Π P .
Consequently, for a logit vector g g g near zero,
softmax ( g ) = 1 P 1 P + 1 P Π P g + O ( ∥ g ∥ 2 ) . (5) \operatorname{softmax}(g) = \frac{1}{P}\mathbf{1}_P+\frac{1}{P}\Pi_Pg+O(\lVert g\rVert^2). \tag*{(5)} softmax ( g ) = P 1 1 P + P 1 Π P g + O (∥ g ∥ 2 ) . (5)
Taking g = W σ ( h x , y ) g=W\sigma(h_{x,y}) g = W σ ( h x , y ) and using (3), we obtain
g = c 1 W h x , y + O ( ∥ h x , y ∥ 2 ) . g = c_1Wh_{x,y}+O(\lVert h_{x,y}\rVert^2). g = c 1 W h x , y + O (∥ h x , y ∥ 2 ) .
Substituting this expression into (4) gives
p x , y = 1 P 1 P + c 1 P Π P W h x , y + O ( ∥ h x , y ∥ 2 ) . (6) p_{x,y} = \frac{1}{P}\mathbf{1}_P+\frac{c_1}{P}\Pi_PWh_{x,y}+O(\lVert h_{x,y}\rVert^2). \tag*{(6)} p x , y = P 1 1 P + P c 1 Π P W h x , y + O (∥ h x , y ∥ 2 ) . (6)
Thus,
W T ( e z − p x , y ) = W T e z − 1 P W T 1 P − c 1 P W T Π P W h x , y + O ( ∥ h x , y ∥ 2 ) . (7) W^{\mathsf{T}}(e_z-p_{x,y}) = W^{\mathsf{T}}e_z-\frac{1}{P}W^{\mathsf{T}}\mathbf{1}_P-\frac{c_1}{P}W^{\mathsf{T}}\Pi_PWh_{x,y}+O(\lVert h_{x,y}\rVert^2). \tag*{(7)} W T ( e z − p x , y ) = W T e z − P 1 W T 1 P − P c 1 W T Π P W h x , y + O (∥ h x , y ∥ 2 ) . (7)
Combining (2) and (6), and retaining all constant and first-order terms in h x , y h_{x,y} h x , y , yields
σ ′ ( h x , y ) ⊙ W T ( e z − p x , y ) = ( c 1 1 + c 2 h x , y + o ( ∥ h x , y ∥ ) ) ⊙ ( W T e z − 1 P W T 1 P − c 1 P W T Π P W h x , y + O ( ∥ h x , y ∥ 2 ) ) = c 1 W T e z − c 1 P W T 1 P + c 2 h x , y ⊙ ( W T e z ) − c 2 P h x , y ⊙ ( W T 1 P ) − c 1 2 P W T Π P W h x , y + δ x , y , (8) \begin{aligned}
\sigma'(h_{x,y})\odot W^{\mathsf{T}}(e_z-p_{x,y})
&= (c_1\mathbf{1}+c_2h_{x,y}+o(\lVert h_{x,y}\rVert)) \\
&\quad\odot\left(W^{\mathsf{T}}e_z-\frac{1}{P}W^{\mathsf{T}}\mathbf{1}_P-\frac{c_1}{P}W^{\mathsf{T}}\Pi_PWh_{x,y}+O(\lVert h_{x,y}\rVert^2)\right) \\
&= c_1W^{\mathsf{T}}e_z-\frac{c_1}{P}W^{\mathsf{T}}\mathbf{1}_P \\
&\quad+c_2h_{x,y}\odot(W^{\mathsf{T}}e_z)-\frac{c_2}{P}h_{x,y}\odot(W^{\mathsf{T}}\mathbf{1}_P) \\
&\quad-\frac{c_1^2}{P}W^{\mathsf{T}}\Pi_PWh_{x,y}+\delta_{x,y}, \tag*{(8)}
\end{aligned} σ ′ ( h x , y ) ⊙ W T ( e z − p x , y ) = ( c 1 1 + c 2 h x , y + o (∥ h x , y ∥)) ⊙ ( W T e z − P 1 W T 1 P − P c 1 W T Π P W h x , y + O (∥ h x , y ∥ 2 ) ) = c 1 W T e z − P c 1 W T 1 P + c 2 h x , y ⊙ ( W T e z ) − P c 2 h x , y ⊙ ( W T 1 P ) − P c 1 2 W T Π P W h x , y + δ x , y , (8)
where δ x , y \delta_{x,y} δ x , y contains all higher-order terms. In particular, the product
− c 1 c 2 P h x , y ⊙ ( W T Π P W h x , y ) -\frac{c_1c_2}{P}h_{x,y}\odot\left(W^{\mathsf{T}}\Pi_PW h_{x,y}\right) − P c 1 c 2 h x , y ⊙ ( W T Π P W h x , y )
is quadratic in h x , y h_{x,y} h x , y and is therefore included in δ x , y \delta_{x,y} δ x , y .
We now take the conditional expectation of each term in (7). First,
E π [ c 1 W T e z − c 1 P W T 1 P ∣ x ] = c 1 W T ( E π [ e z ∣ x ] − 1 P 1 P ) . (9) \begin{aligned}
\mathbb{E}_{\pi}\left[c_1W^{\mathsf{T}}e_z-\frac{c_1}{P}W^{\mathsf{T}}\mathbf{1}_P\mid x\right]
&=c_1W^{\mathsf{T}}\left(\mathbb{E}_{\pi}[e_z\mid x]-\frac{1}{P}\mathbf{1}_P\right). \tag*{(9)}
\end{aligned} E π [ c 1 W T e z − P c 1 W T 1 P ∣ x ] = c 1 W T ( E π [ e z ∣ x ] − P 1 1 P ) . (9)
Since h x , y = U x + V y h_{x,y}=U^x+V^y h x , y = U x + V y ,
h x , y ⊙ ( W T e z ) = U x ⊙ ( W T e z ) + V y ⊙ ( W T e z ) . h_{x,y}\odot(W^{\mathsf{T}}e_z)=U^x\odot(W^{\mathsf{T}}e_z)+V^y\odot(W^{\mathsf{T}}e_z). h x , y ⊙ ( W T e z ) = U x ⊙ ( W T e z ) + V y ⊙ ( W T e z ) .
Hence,
E π [ h x , y ⊙ ( W T e z ) ∣ x ] = U x ⊙ ( W T E π [ e z ∣ x ] ) + E π [ V y ⊙ ( W T e z ) ∣ x ] . (10) \begin{aligned}
\mathbb{E}_{\pi}\left[h_{x,y}\odot(W^{\mathsf{T}}e_z)\mid x\right]
&=U^x\odot\left(W^{\mathsf{T}}\mathbb{E}_{\pi}[e_z\mid x]\right)
+\mathbb{E}_{\pi}\left[V^y\odot(W^{\mathsf{T}}e_z)\mid x\right]. \tag*{(10)}
\end{aligned} E π [ h x , y ⊙ ( W T e z ) ∣ x ] = U x ⊙ ( W T E π [ e z ∣ x ] ) + E π [ V y ⊙ ( W T e z ) ∣ x ] . (10)
Furthermore,
E π [ h x , y ∣ x ] = U x + E π [ V e y ∣ x ] . (11) \mathbb{E}_{\pi}[h_{x,y}\mid x]=U^x+\mathbb{E}_{\pi}[V e_y\mid x]. \tag*{(11)} E π [ h x , y ∣ x ] = U x + E π [ V e y ∣ x ] . (11)
It follows from (10) that
E π [ h x , y ⊙ ( W T 1 P ) ∣ x ] = ( U x + E π [ V e y ∣ x ] ) ⊙ ( W T 1 P ) , (12) \begin{aligned}
\mathbb{E}_{\pi}\left[h_{x,y}\odot(W^{\mathsf{T}}\mathbf{1}_P)\mid x\right]
&=\left(U^x+\mathbb{E}_{\pi}[V e_y\mid x]\right)\odot(W^{\mathsf{T}}\mathbf{1}_P), \tag*{(12)}
\end{aligned} E π [ h x , y ⊙ ( W T 1 P ) ∣ x ] = ( U x + E π [ V e y ∣ x ] ) ⊙ ( W T 1 P ) , (12)
and
E π [ W T Π P W h x , y ∣ x ] = W T Π P W ( U x + E π [ V e y ∣ x ] ) . (13) \begin{aligned}
\mathbb{E}_{\pi}\left[W^{\mathsf{T}}\Pi_PW h_{x,y}\mid x\right]
&=W^{\mathsf{T}}\Pi_PW\left(U^x+\mathbb{E}_{\pi}[V e_y\mid x]\right). \tag*{(13)}
\end{aligned} E π [ W T Π P W h x , y ∣ x ] = W T Π P W ( U x + E π [ V e y ∣ x ] ) . (13)
Substituting (8)–(12) into the gradient-flow equation (1), we obtain
d U x d t = r x { c 1 W T ( E π [ e z ∣ x ] − 1 P 1 P ) + c 2 ( U x ⊙ ( W T E π [ e z ∣ x ] ) + E π [ V y ⊙ ( W T e z ) ∣ x ] ) − c 2 P ( U x + E π [ V e y ∣ x ] ) ⊙ ( W T 1 P ) − c 1 2 P W T ( I − 1 P 1 P 1 P T ) W ( U x + E π [ V e y ∣ x ] ) } + δ , \begin{aligned}
\frac{\mathrm{d}U^x}{\mathrm{d}t}
={}&r_x\Bigg\{
c_1W^{\mathsf{T}}\left(\mathbb{E}_{\pi}[e_z\mid x]-\frac{1}{P}\mathbf{1}_P\right)\\
&\quad+c_2\left(U^x\odot\left(W^{\mathsf{T}}\mathbb{E}_{\pi}[e_z\mid x]\right)
+\mathbb{E}_{\pi}\left[V^y\odot(W^{\mathsf{T}}e_z)\mid x\right]\right)\\
&\quad-\frac{c_2}{P}\left(U^x+\mathbb{E}_{\pi}[V e_y\mid x]\right)\odot(W^{\mathsf{T}}\mathbf{1}_P)\\
&\quad-\frac{c_1^2}{P}W^{\mathsf{T}}\left(I-\frac{1}{P}\mathbf{1}_P\mathbf{1}_P^{\mathsf{T}}\right)W
\left(U^x+\mathbb{E}_{\pi}[V e_y\mid x]\right)
\Bigg\}+\delta,
\end{aligned} d t d U x = r x { c 1 W T ( E π [ e z ∣ x ] − P 1 1 P ) + c 2 ( U x ⊙ ( W T E π [ e z ∣ x ] ) + E π [ V y ⊙ ( W T e z ) ∣ x ] ) − P c 2 ( U x + E π [ V e y ∣ x ] ) ⊙ ( W T 1 P ) − P c 1 2 W T ( I − P 1 1 P 1 P T ) W ( U x + E π [ V e y ∣ x ] ) } + δ ,
where δ = O ( ϵ 3 ) \delta=O(\epsilon^3) δ = O ( ϵ 3 ) .
The same calculation would be applied to V V V . Then we obtain the gradient flow for W W W . Denote r z r_z r z by the probability of samples labeled z z z . According to the definition, there is
d W z T d t = ( e z − p x , y ) σ ( h x , y ) , \frac{\mathrm{d}W^{\mathsf{T}}_z}{\mathrm{d}t}=(e_z-p_{x,y})\sigma(h_{x,y}), d t d W z T = ( e z − p x , y ) σ ( h x , y ) ,
Then, the gradient flow of the z z z -th row of W W W is expressed in the expected form as
d W z T d t = c 1 ( r z E π [ h x , y ∣ Z = z ] − 1 P E π [ h x , y ] ) + c 2 2 ( r z E π [ ( h x , y ⊙ h x , y ) ∣ Z = z ] − 1 P E π [ h x , y ⊙ h x , y ] ) − c 1 2 P E π [ h x , y h x , y T ] W T Π P e z + δ . \frac{\mathrm{d}W_z^{\mathsf{T}}}{\mathrm{d}t}
= c_1\left(r_z\mathbb{E}_{\pi}[h_{x,y}\mid Z=z]-\frac{1}{P}\mathbb{E}_{\pi}[h_{x,y}]\right)
+\frac{c_2}{2}\left(r_z\mathbb{E}_{\pi}[(h_{x,y}\odot h_{x,y})\mid Z=z]-\frac{1}{P}\mathbb{E}_{\pi}[h_{x,y}\odot h_{x,y}]\right)
-\frac{c_1^2}{P}\mathbb{E}_{\pi}[h_{x,y}h_{x,y}^{\mathsf{T}}]W^{\mathsf{T}}\Pi_P e_z+\delta. d t d W z T = c 1 ( r z E π [ h x , y ∣ Z = z ] − P 1 E π [ h x , y ] ) + 2 c 2 ( r z E π [( h x , y ⊙ h x , y ) ∣ Z = z ] − P 1 E π [ h x , y ⊙ h x , y ] ) − P c 1 2 E π [ h x , y h x , y T ] W T Π P e z + δ .
Substituting h x , y = U x + V y h_{x,y}=U^x+V^y h x , y = U x + V y yields a similar result.
Proof of Dominance of the gradient
Proof. We give the proof for U U U and the same calculation would be able to applied to V V V and W W W . For convenience, write
q x : = E π [ e z ∣ x ] , V ˉ x : = E π [ V e y ∣ x ] , q_x:=\mathbb{E}_{\pi}[e_z\mid x],\qquad\bar{V}_x:=\mathbb{E}_{\pi}[Ve_y\mid x], q x := E π [ e z ∣ x ] , V ˉ x := E π [ V e y ∣ x ] ,
and define
Π P : = I P − 1 P 1 P 1 P T . \Pi_P:=I_P-\frac{1}{P}\mathbf{1}_P\mathbf{1}_P^{\mathsf{T}}. Π P := I P − P 1 1 P 1 P T .
From proposition 1, we have
d U x d t = r x { c 1 W T ( q x − 1 P 1 P ) + c 2 U x ⊙ ( W T q x ) + c 2 E π [ V y ⊙ ( W T e z ) ∣ x ] − c 2 P ( U x + V ˉ x ) ⊙ ( W T 1 P ) − c 1 2 P W T Π P W ( U x + V ˉ x ) } + δ . (14) \frac{\mathrm{d}U^x}{\mathrm{d}t}
=r_x\left\{
c_1W^{\mathsf{T}}\left(q_x-\frac{1}{P}\mathbf{1}_P\right)
+c_2U^x\odot(W^{\mathsf{T}}q_x)
+c_2\mathbb{E}_{\pi}\left[V^y\odot(W^{\mathsf{T}}e_z)\mid x\right]
-\frac{c_2}{P}(U^x+\bar{V}_x)\odot(W^{\mathsf{T}}\mathbf{1}_P)
-\frac{c_1^2}{P}W^{\mathsf{T}}\Pi_P W(U^x+\bar{V}_x)
\right\}+\delta. \tag*{(14)} d t d U x = r x { c 1 W T ( q x − P 1 1 P ) + c 2 U x ⊙ ( W T q x ) + c 2 E π [ V y ⊙ ( W T e z ) ∣ x ] − P c 2 ( U x + V ˉ x ) ⊙ ( W T 1 P ) − P c 1 2 W T Π P W ( U x + V ˉ x ) } + δ . (14)
Since z ∣ x z\mid x z ∣ x is uniform on Ω \Omega Ω ,
q x = E π [ e z ∣ x ] = 1 P 1 P . (15) q_x=\mathbb{E}_{\pi}[e_z\mid x]=\frac{1}{P}\mathbf{1}_P. \tag*{(15)} q x = E π [ e z ∣ x ] = P 1 1 P . (15)
Therefore,
c 1 W T ( q x − 1 P 1 P ) = 0. (16) c_1W^{\mathsf{T}}\left(q_x-\frac{1}{P}\mathbf{1}_P\right)=0. \tag*{(16)} c 1 W T ( q x − P 1 1 P ) = 0. (16)
and
c 2 U x ⊙ W T ( q x − 1 P 1 P ) = 0. (17) c_2U^x\odot W^{\mathsf{T}}\left(q_x-\frac{1}{P}\mathbf{1}_P\right)=0. \tag*{(17)} c 2 U x ⊙ W T ( q x − P 1 1 P ) = 0. (17)
The joint product term is
W T Π P W ( U x + V ˉ x ) = O ( ϵ 3 ) . W^{\mathsf{T}}\Pi_PW\left(U^x+\bar{V}_x\right)=O(\epsilon^3). W T Π P W ( U x + V ˉ x ) = O ( ϵ 3 ) .
Substitute all these, we have
d U x d t = r x c 2 [ E π [ V y ⊙ ( W ⊤ e z ) ∣ x ] − V ‾ ⋅ W ‾ ] + δ , \frac{\mathrm{d}U^x}{\mathrm{d}t}=r_xc_2\left[\mathbb{E}_{\pi}\left[V^y\odot(W^{\top}e_z)\mid x\right]-\overline{V}\cdot\overline{W}\right]+\delta, d t d U x = r x c 2 [ E π [ V y ⊙ ( W ⊤ e z ) ∣ x ] − V ⋅ W ] + δ ,
It remains to identify the conditional expectation with the stated matrix expression. By definition,
diag ( V Φ x ( a ) W ) = ∑ y , z P ( Z = z , Y = y ∣ X = x ) diag ( V y ( e z ⊤ W ) ) = ∑ y , z P ( Z = z , Y = y ∣ X = x ) ( V y ⊙ W ⊤ e z ) = E π [ V y ⊙ ( W ⊤ e z ) ∣ x ] . \begin{aligned}
\operatorname{diag}(V\Phi_x^{(a)}W)=\sum_{y,z}\mathbb{P}(Z=z,Y=y\mid X=x)\operatorname{diag}\left(V^y(e_z^{\top}W)\right) \\
&=\sum_{y,z}\mathbb{P}(Z=z,Y=y\mid X=x)\left(V^y\odot W^{\top}e_z\right) \\
&=\mathbb{E}_{\pi}\left[V^y\odot(W^{\top}e_z)\mid x\right].
\end{aligned} diag ( V Φ x ( a ) W ) = y , z ∑ P ( Z = z , Y = y ∣ X = x ) diag ( V y ( e z ⊤ W ) ) = y , z ∑ P ( Z = z , Y = y ∣ X = x ) ( V y ⊙ W ⊤ e z ) = E π [ V y ⊙ ( W ⊤ e z ) ∣ x ] .
adding the weight decay term, we conclude that
d U x d t = − λ U x + r x c 2 [ diag ( V Φ x ( a ) W ) − V ‾ ⋅ W ‾ ] + δ . \frac{\mathrm{d}U^x}{\mathrm{d}t}=-\lambda U^x+r_xc_2\left[\operatorname{diag}\left(V\Phi_x^{(a)}W\right)-\overline{V}\cdot\overline{W}\right]+\delta. d t d U x = − λ U x + r x c 2 [ diag ( V Φ x ( a ) W ) − V ⋅ W ] + δ .
Proof of Estimation of noise
Proof. Let G D G_D G D be the empirical full-batch vector field. To avoid random conditional denominators, for every ( x , y ) ∈ Ω 2 (x,y)\in\Omega^2 ( x , y ) ∈ Ω 2 let I x y I_{xy} I x y be the indicator that the pair is included in the training set, and let Z ~ x y \widetilde{Z}_{xy} Z x y be its observed label when I x y = 1 I_{xy}=1 I x y = 1 . Uniform sampling and uniform label replacement give the exact identity
E D [ I x y m 1 { Z ~ x y = z } ] = 1 P 2 ( ( 1 − α ) 1 { z = x + y } + α P ) . (18) \mathbb{E}_D\left[\frac{I_{xy}}{m}\mathbf{1}_{\{\widetilde{Z}_{xy}=z\}}\right]=\frac{1}{P^2}\left((1-\alpha)\mathbf{1}_{\{z=x+y\}}+\frac{\alpha}{P}\right). \tag*{(18)} E D [ m I x y 1 { Z x y = z } ] = P 2 1 ( ( 1 − α ) 1 { z = x + y } + P α ) . (18)
The expectation in (1) is over the training pairs, the corrupted subset, and the replacement labels, with the parameters fixed.
We prove the assertion for U U U first. Applying the expansion in Proposition 1 to the empirical measure yields
G D , x U + λ U x = η m ∑ y ∈ Ω I x y [ c 1 W ⊤ ( e Z ~ x y − 1 P 1 P ) + c 2 ( U x + V y ) ⊙ W ⊤ ( e Z ~ x y − 1 P 1 P ) ] + Δ D , x U . (19) G_{D,x}^{U}+\lambda U^x=\frac{\eta}{m}\sum_{y\in\Omega}I_{xy}\left[c_1W^{\top}\left(e_{\widetilde{Z}_{xy}}-\frac{1}{P}\mathbf{1}_P\right)+c_2(U^x+V^y)\odot W^{\top}\left(e_{\widetilde{Z}_{xy}}-\frac{1}{P}\mathbf{1}_P\right)\right]+\Delta_{D,x}^{U}. \tag*{(19)} G D , x U + λ U x = m η y ∈ Ω ∑ I x y [ c 1 W ⊤ ( e Z x y − P 1 1 P ) + c 2 ( U x + V y ) ⊙ W ⊤ ( e Z x y − P 1 1 P ) ] + Δ D , x U . (19)
For equation (1), summed over y y y , shows that
E D [ 1 m ∑ y I x y ( e Z ~ x y − 1 P 1 P ) ] = 0. (20) \mathbb{E}_D\left[\frac{1}{m}\sum_y I_{xy}\left(e_{\widetilde{Z}_{xy}}-\frac{1}{P}\mathbf{1}_P\right)\right]=0. \tag*{(20)} E D [ m 1 y ∑ I x y ( e Z x y − P 1 1 P ) ] = 0. (20)
Consequently, both the first-order term and the part of the second-order term containing U x U^x U x have zero sampling mean. For the remaining part, (1) gives
E D [ η c 2 m ∑ y I x y V y ⊙ W ⊤ ( e ~ z x y − 1 P 1 P ) ] = η c 2 ( 1 − α ) P [ P − 1 ∑ y V y ⊙ W ⊤ e x + y − V ‾ ⊙ W ‾ ] . (21) \mathbb{E}_{D}\left[\frac{\eta c_2}{m}\sum_y I_{xy}V^y\mathbin{\odot}W^{\top}\left(\widetilde{e}_{z_{xy}}-\frac{1}{P}\mathbf{1}_P\right)\right]
=
\frac{\eta c_2(1-\alpha)}{P}\left[P^{-1}\sum_y V^y\mathbin{\odot}W^{\top}e_{x+y}-\overline{V}\mathbin{\odot}\overline{W}\right]. \tag*{(21)} E D [ m η c 2 y ∑ I x y V y ⊙ W ⊤ ( e z x y − P 1 1 P ) ] = P η c 2 ( 1 − α ) [ P − 1 y ∑ V y ⊙ W ⊤ e x + y − V ⊙ W ] . (21)
This has already yielded the main components of the theorem. Exchanging U U U and V V V for another proof.
For the x x x -th output row, set Ψ x + : = ∑ j e j e x − j ⊤ \Psi_x^+ := \sum_j e_j e_{x-j}^{\top} Ψ x + := ∑ j e j e x − j ⊤ . The same Taylor expansion gives
G D , x W + λ W x = η m ∑ a , b I a b ( 1 { z ~ a b = x } − 1 P ) [ c 1 h a b + c 2 2 ( h a b ⊙ h a b ) ] + Δ W D , x , (22) G_{D,x}^{W}+\lambda W_x
=
\frac{\eta}{m}\sum_{a,b} I_{ab}\left(\mathbf{1}\{ \widetilde{z}_{ab}=x\}-\frac{1}{P}\right)\left[c_1h_{ab}+\frac{c_2}{2}(h_{ab}\mathbin{\odot}h_{ab})\right]+\Delta W_{D,x}, \tag*{(22)} G D , x W + λ W x = m η a , b ∑ I ab ( 1 { z ab = x } − P 1 ) [ c 1 h ab + 2 c 2 ( h ab ⊙ h ab ) ] + Δ W D , x , (22)
where h a b = U a + V b h_{ab}=U^a+V^b h ab = U a + V b . The linear term in (5) has zero expectation: on every addition diagonal a + b = x a+b=x a + b = x , both ∑ a U a \sum_a U^a ∑ a U a and ∑ b V b \sum_b V^b ∑ b V b agree with their uniform-background sums. The same cancellation removes the U a ⊙ U a U^a\mathbin{\odot}U^a U a ⊙ U a and V b ⊙ V b V^b\mathbin{\odot}V^b V b ⊙ V b terms. The two equal cross terms leave
η c 2 ( 1 − α ) P [ P − 1 ∑ a U a ⊙ V x − a − U ‾ ⊙ V ‾ ] . (23) \frac{\eta c_2(1-\alpha)}{P}\left[P^{-1}\sum_a U^a\mathbin{\odot}V^{x-a}-\overline{U}\mathbin{\odot}\overline{V}\right]. \tag*{(23)} P η c 2 ( 1 − α ) [ P − 1 a ∑ U a ⊙ V x − a − U ⊙ V ] . (23)
It remains to control the finite-sample fluctuation. Define E ∙ \mathcal{E}_{\bullet} E ∙ as the centered fluctuation of the displayed first- and second-order terms, and include the high order remainder. For simple random sampling without replacement, the finite-population variance formula gives a factor ( 1 − ρ ) / ( ρ P 3 ) (1-\rho)/(\rho P^3) ( 1 − ρ ) / ( ρ P 3 ) for a fixed input or output coordinate. Randomly corrupting an α \alpha α fraction of the selected labels contributes at most an additional α / ( ρ P 3 ) \alpha/(\rho P^3) α / ( ρ P 3 ) . In (2) and (5), each coordinate of a centered first-order summand is bounded by 2 ∣ c 1 ∣ ϵ 2|c_1|\epsilon 2∣ c 1 ∣ ϵ , while each second-order summand is bounded by C ∣ c 2 ∣ ϵ 2 C|c_2|\epsilon^2 C ∣ c 2 ∣ ϵ 2 . The variance formula gives
Var D ( E ∙ ) ≤ C η 2 ρ P 3 [ ( 1 − ρ ) + α ] ( c 1 2 ϵ 2 + c 2 2 ϵ 4 ) . \operatorname{Var}_{D}(\mathcal{E}_{\bullet})\leq\frac{C\eta^2}{\rho P^3}\left[(1-\rho)+\alpha\right]\left(c_1^2\epsilon^2+c_2^2\epsilon^4\right). Var D ( E ∙ ) ≤ ρ P 3 C η 2 [ ( 1 − ρ ) + α ] ( c 1 2 ϵ 2 + c 2 2 ϵ 4 ) .
which is the claimed bound.
It is noted that the error is caused by the ρ \rho ρ and α \alpha α during the sampling. If the training set contains too few clean samples, the error between actual gradient and the predicted term will be very large, which is consistent with our intuition.
Proof of dominant frequency and phase locking
Proof. The Fourier modes obey
U ˙ r = C V ‾ r W r − λ U r , V ˙ r = C U ‾ r W r − λ V r , W ˙ r = C U r V r − λ W r . \dot{U}_r=C\overline{V}_rW_r-\lambda U_r,\qquad\dot{V}_r=C\overline{U}_rW_r-\lambda V_r,\qquad\dot{W}_r=CU_rV_r-\lambda W_r. U ˙ r = C V r W r − λ U r , V ˙ r = C U r W r − λ V r , W ˙ r = C U r V r − λ W r .
Set U r = e − λ t X r ( s ) U_r=e^{-\lambda t}X_r(s) U r = e − λ t X r ( s ) , V r = e − λ t Y r ( s ) V_r=e^{-\lambda t}Y_r(s) V r = e − λ t Y r ( s ) , and W r = e − λ t Z r ( s ) W_r=e^{-\lambda t}Z_r(s) W r = e − λ t Z r ( s ) , with
s = C λ ( 1 − e − λ t ) . s=\frac{C}{\lambda}\left(1-e^{-\lambda t}\right). s = λ C ( 1 − e − λ t ) .
Then
d X r d s = Y r ‾ Z r , d Y r d s = X r ‾ Z r , d Z r d s = X r Y r . \frac{\mathrm{d}X_r}{\mathrm{d}s}=\overline{Y_r}Z_r,\qquad\frac{\mathrm{d}Y_r}{\mathrm{d}s}=\overline{X_r}Z_r,\qquad\frac{\mathrm{d}Z_r}{\mathrm{d}s}=X_rY_r. d s d X r = Y r Z r , d s d Y r = X r Z r , d s d Z r = X r Y r .
If s r ⋆ < C / λ s_r^\star<C/\lambda s r ⋆ < C / λ is the undamped blow-up time, its damped time is
t r ⋆ = − 1 λ log ( 1 − λ s r ⋆ C ) . t_r^\star=-\frac{1}{\lambda}\log\left(1-\frac{\lambda s_r^\star}{C}\right). t r ⋆ = − λ 1 log ( 1 − C λ s r ⋆ ) .
This map is increasing, so s w ⋆ < s i ⋆ s_w^\star<s_i^\star s w ⋆ < s i ⋆ implies t w ⋆ < t i ⋆ t_w^\star<t_i^\star t w ⋆ < t i ⋆ . As t ↑ t w ⋆ t\uparrow t_w^\star t ↑ t w ⋆ , the energy of mode w w w diverges while every competing mode remains finite, and its energy fraction tends to one.
For phase locking, write U = A e i α U=Ae^{i\alpha} U = A e i α , V = B e i β V=Be^{i\beta} V = B e i β , W = G e i γ W=Ge^{i\gamma} W = G e iγ , and δ = α + β − γ \delta=\alpha+\beta-\gamma δ = α + β − γ . Direct separation of real and imaginary parts gives
δ ˙ = − C sin δ ( B G A + A G B + A B G ) . \dot{\delta}=-C\sin\delta\left(\frac{BG}{A}+\frac{AG}{B}+\frac{AB}{G}\right). δ ˙ = − C sin δ ( A B G + B A G + G A B ) .
While the amplitudes remain nonzero, the factor in parentheses is positive. Thus δ = 0 \delta=0 δ = 0 is stable and δ = π \delta=\pi δ = π is unstable. A continuous random initialization avoids the unstable equilibrium with probability one, yielding δ ( t ) → 0 \delta(t)\to0 δ ( t ) → 0 modulo 2 π 2\pi 2 π on the regular continuation interval.
Proof of the early-loss theorem
Lemma 1. Let a a a , b b b , c c c , d d d be i.i.d. random variables and let f : R → R f:\mathbb{R}\to\mathbb{R} f : R → R be such that the expectations below exist, then
E [ f ( a + b ) f ( a + c ) ] ≥ E [ f ( a + b ) f ( c + d ) ] . \mathbb{E}[f(a+b)f(a+c)]\ge\mathbb{E}[f(a+b)f(c+d)]. E [ f ( a + b ) f ( a + c )] ≥ E [ f ( a + b ) f ( c + d )] .
Proof. Define h ( a ) = E [ f ( a + b ) ∣ a ] h(a)=\mathbb{E}[f(a+b)\mid a] h ( a ) = E [ f ( a + b ) ∣ a ] , μ = E [ f ( a + b ) ] \mu=\mathbb{E}[f(a+b)] μ = E [ f ( a + b )] .
Since a + b a+b a + b and c + d c+d c + d are independent,
E [ f ( a + b ) f ( c + d ) ] = E [ f ( a + b ) ] E [ f ( c + d ) ] = μ 2 . \mathbb{E}[f(a+b)f(c+d)]=\mathbb{E}[f(a+b)]\mathbb{E}[f(c+d)]=\mu^2. E [ f ( a + b ) f ( c + d )] = E [ f ( a + b )] E [ f ( c + d )] = μ 2 .
Given a a a , the variables b b b and c c c are independent, so
E [ f ( a + b ) f ( a + c ) ∣ a ] = E [ f ( a + b ) ∣ a ] E [ f ( a + c ) ∣ a ] = h ( a ) 2 . \mathbb{E}[f(a+b)f(a+c)\mid a]=\mathbb{E}[f(a+b)\mid a]\mathbb{E}[f(a+c)\mid a]=h(a)^2. E [ f ( a + b ) f ( a + c ) ∣ a ] = E [ f ( a + b ) ∣ a ] E [ f ( a + c ) ∣ a ] = h ( a ) 2 .
Hence E [ f ( a + b ) f ( a + c ) ] = E [ h ( a ) 2 ] \mathbb{E}[f(a+b)f(a+c)]=\mathbb{E}[h(a)^2] E [ f ( a + b ) f ( a + c )] = E [ h ( a ) 2 ] .
Therefore,
E [ f ( a + b ) f ( a + c ) ] − E [ f ( a + b ) f ( c + d ) ] = E [ h ( a ) 2 ] − μ 2 . \mathbb{E}[f(a+b)f(a+c)]-\mathbb{E}[f(a+b)f(c+d)]=\mathbb{E}[h(a)^2]-\mu^2. E [ f ( a + b ) f ( a + c )] − E [ f ( a + b ) f ( c + d )] = E [ h ( a ) 2 ] − μ 2 .
But μ = E [ h ( a ) ] \mu=\mathbb{E}[h(a)] μ = E [ h ( a )] , so
E [ h ( a ) 2 ] − μ 2 = Var ( h ( a ) ) ≥ 0. \mathbb{E}[h(a)^2]-\mu^2=\operatorname{Var}(h(a))\ge0. E [ h ( a ) 2 ] − μ 2 = Var ( h ( a )) ≥ 0.
Thus E [ f ( a + b ) f ( a + c ) ] ≥ E [ f ( a + b ) f ( c + d ) ] \mathbb{E}[f(a+b)f(a+c)]\ge\mathbb{E}[f(a+b)f(c+d)] E [ f ( a + b ) f ( a + c )] ≥ E [ f ( a + b ) f ( c + d )] .
For activation functions such as GELU and RELU, the above inequality will hold strictly. It is κ ( 1 ) > κ ( 0 ) \kappa(1) > \kappa(0) κ ( 1 ) > κ ( 0 ) in the main text.
Theorem 3.
Proof. The total number of all pairs with the same label is
K 0 = ∑ z n z 2 K_0 = \sum_z n_z^2 K 0 = z ∑ n z 2
Let n x , y ( a ) n_{x,y}^{(a)} n x , y ( a ) count examples with first coordinate X = x X = x X = x and label Z = y Z = y Z = y , and define n z , y ( b ) n_{z,y}^{(b)} n z , y ( b ) analogously. In the complete table, n x , y ( a ) = P φ x , y ( a ) n_{x,y}^{(a)} = P\varphi_{x,y}^{(a)} n x , y ( a ) = P φ x , y ( a ) and n z , y ( b ) = P φ z , y ( b ) n_{z,y}^{(b)} = P\varphi_{z,y}^{(b)} n z , y ( b ) = P φ z , y ( b ) . The ordered pairs sharing the first coordinate and label number
C a = ∑ x , y n x , y ( a ) ( n x , y ( a ) − 1 ) = P 2 ∥ φ ( a ) ∥ 2 2 − P 2 , C_a = \sum_{x,y} n_{x,y}^{(a)}(n_{x,y}^{(a)} - 1) = P^2\|\varphi^{(a)}\|_2^2 - P^2, C a = x , y ∑ n x , y ( a ) ( n x , y ( a ) − 1 ) = P 2 ∥ φ ( a ) ∥ 2 2 − P 2 ,
and similarly C b = P 2 ∥ φ ( b ) ∥ 2 2 − P 2 C_b = P^2\|\varphi^{(b)}\|_2^2 - P^2 C b = P 2 ∥ φ ( b ) ∥ 2 2 − P 2 .
We define
κ ( l ) = E [ σ ( h i ) σ ( h j ) ] ⋅ D , l = 0 , 1 , 2 , \kappa(l) = \mathbb{E}[\sigma(h_i)\sigma(h_j)]\cdot D,\qquad l = 0,1,2, κ ( l ) = E [ σ ( h i ) σ ( h j )] ⋅ D , l = 0 , 1 , 2 ,
Here ( h i , h j ) (h_i,h_j) ( h i , h j ) are scalar jointly Gaussian, each of variance 2 s 2 2s^2 2 s 2 and covariance l s 2 ls^2 l s 2 . s s s denotes the initialization scale. The definition is equivalent to that in the main text.
Thus, We can count it by using the principle of inclusion-exclusion as:
− E L ˙ / η = 1 N 2 ( κ ( 0 ) K 0 + ( κ ( 1 ) − κ ( 0 ) ) ( C a + C b ) + ( κ ( 2 ) − κ ( 0 ) ) N ) , -\mathbb{E}\dot{L}/\eta= \frac{1}{N^2}\left(\kappa(0)K_0 + (\kappa(1)-\kappa(0))(C_a+C_b) + (\kappa(2)-\kappa(0))N\right), − E L ˙ / η = N 2 1 ( κ ( 0 ) K 0 + ( κ ( 1 ) − κ ( 0 )) ( C a + C b ) + ( κ ( 2 ) − κ ( 0 )) N ) ,
The last item is independent of the training distribution.
Propositions of Hadamard basis
Let
G = ( Z / 2 Z ) 6 G = (\mathbb{Z}/2\mathbb{Z})^6 G = ( Z /2 Z ) 6
and identify the group operation on G G G with bitwise XOR. For each a ∈ G a \in G a ∈ G , define the matrix Φ a ∈ R G × G \Phi_a \in\mathbb{R}^{G\times G} Φ a ∈ R G × G by
Φ a ( y , z ) = 1 64 1 { z = a + y } , y , z ∈ G . \Phi_a(y,z) = \frac{1}{64}\mathbf{1}\{z=a+y\},\qquad y,z\in G. Φ a ( y , z ) = 64 1 1 { z = a + y } , y , z ∈ G .
For u ∈ G u \in G u ∈ G , define the Walsh character
χ u ( v ) = ( − 1 ) u ⋅ v , \chi_u(v) = (-1)^{u\cdot v}, χ u ( v ) = ( − 1 ) u ⋅ v ,
where
u ⋅ v = ∑ j = 1 6 u j v j ( m o d 2 ) . u\cdot v = \sum_{j=1}^{6}u_jv_j \pmod2. u ⋅ v = j = 1 ∑ 6 u j v j ( mod 2 ) .
Let H u ∈ R G H_u \in\mathbb{R}^{G} H u ∈ R G be the normalized Walsh vector
H u ( v ) = 1 8 χ u ( v ) . H_u(v) = \frac{1}{8}\chi_u(v). H u ( v ) = 8 1 χ u ( v ) .
Then the family { Φ a : a ∈ G } \{\Phi_a : a \in G\} { Φ a : a ∈ G } is simultaneously diagonalized by the orthonormal Walsh–Hadamard basis { H u : u ∈ G } \{H_u : u \in G\} { H u : u ∈ G } . More precisely,
Φ a H u = χ u ( a ) 64 H u = ( − 1 ) u ⋅ a 64 H u . \Phi_a H_u = \frac{\chi_u(a)}{64}H_u = \frac{(-1)^{u\cdot a}}{64}H_u. Φ a H u = 64 χ u ( a ) H u = 64 ( − 1 ) u ⋅ a H u .
Consequently, if H H H is the orthogonal matrix whose columns are the vectors H u H_u H u , then
H ⊤ Φ a H = diag ( χ u ( a ) 64 ) u ∈ G . H^\top\Phi_a H = \operatorname{diag}\left(\frac{\chi_u(a)}{64}\right)_{u\in G}. H ⊤ Φ a H = diag ( 64 χ u ( a ) ) u ∈ G .
for every a ∈ G a \in G a ∈ G . Indeed, for u , u ′ ∈ G u,u' \in G u , u ′ ∈ G ,
⟨ H u , H u ′ ⟩ = 1 64 ∑ v ∈ G χ u ( v ) χ u ′ ( v ) = 1 64 ∑ v ∈ G ( − 1 ) ( u + u ′ ) ⋅ v . \langle H_u,H_{u'}\rangle= \frac{1}{64}\sum_{v\in G}\chi_u(v)\chi_{u'}(v)
= \frac{1}{64}\sum_{v\in G}(-1)^{(u+u')\cdot v}. ⟨ H u , H u ′ ⟩ = 64 1 v ∈ G ∑ χ u ( v ) χ u ′ ( v ) = 64 1 v ∈ G ∑ ( − 1 ) ( u + u ′ ) ⋅ v .
If u = u ′ u=u' u = u ′ , then the summand is identically equal to 1, and hence
⟨ H u , H u ⟩ = 1. \langle H_u,H_u\rangle= 1. ⟨ H u , H u ⟩ = 1.
If u ≠ u ′ u\ne u' u = u ′ , then u + u ′ ≠ 0 u+u'\ne0 u + u ′ = 0 . Choose an element v 0 ∈ G v_0\in G v 0 ∈ G such that
( u + u ′ ) ⋅ v 0 = 1. (u+u')\cdot v_0=1. ( u + u ′ ) ⋅ v 0 = 1.
The map v ↦ v + v 0 v\mapsto v+v_0 v ↦ v + v 0 is a bijection of G G G , and therefore
∑ v ∈ G ( − 1 ) ( u + u ′ ) ⋅ v = ∑ v ∈ G ( − 1 ) ( u + u ′ ) ⋅ ( v + v 0 ) = − ∑ v ∈ G ( − 1 ) ( u + u ′ ) ⋅ v . \sum_{v\in G}(-1)^{(u+u')\cdot v}
= \sum_{v\in G}(-1)^{(u+u')\cdot(v+v_0)}
= -\sum_{v\in G}(-1)^{(u+u')\cdot v}. v ∈ G ∑ ( − 1 ) ( u + u ′ ) ⋅ v = v ∈ G ∑ ( − 1 ) ( u + u ′ ) ⋅ ( v + v 0 ) = − v ∈ G ∑ ( − 1 ) ( u + u ′ ) ⋅ v .
Thus the sum is zero. Hence
⟨ H u , H u ′ ⟩ = 1 { u = u ′ } , \langle H_u,H_{u'}\rangle= \mathbf{1}_{\{u=u'\}}, ⟨ H u , H u ′ ⟩ = 1 { u = u ′ } ,
so { H u : u ∈ G } \{H_u : u \in G\} { H u : u ∈ G } is an orthonormal basis of R G \mathbb{R}^G R G . Now fix a , u ∈ G a,u\in G a , u ∈ G . For every y ∈ G y\in G y ∈ G , we have
( Φ a H u ) ( y ) = ∑ z ∈ G Φ a ( y , z ) H u ( z ) = 1 64 H u ( a + y ) . (\Phi_aH_u)(y)=\sum_{z\in G}\Phi_a(y,z)H_u(z)
=\frac{1}{64}H_u(a+y). ( Φ a H u ) ( y ) = z ∈ G ∑ Φ a ( y , z ) H u ( z ) = 64 1 H u ( a + y ) .
Using the character identity
χ u ( a + y ) = χ u ( a ) χ u ( y ) , \chi_u(a+y)=\chi_u(a)\chi_u(y), χ u ( a + y ) = χ u ( a ) χ u ( y ) ,
we obtain
( Φ a H u ) ( y ) = 1 64 ⋅ 1 8 χ u ( a + y ) = 1 64 ⋅ 1 8 χ u ( a ) χ u ( y ) = χ u ( a ) 64 H u ( y ) . (\Phi_aH_u)(y)=\frac{1}{64}\cdot\frac{1}{8}\chi_u(a+y)
=\frac{1}{64}\cdot\frac{1}{8}\chi_u(a)\chi_u(y)
=\frac{\chi_u(a)}{64}H_u(y). ( Φ a H u ) ( y ) = 64 1 ⋅ 8 1 χ u ( a + y ) = 64 1 ⋅ 8 1 χ u ( a ) χ u ( y ) = 64 χ u ( a ) H u ( y ) .
Since this holds for every y ∈ G y \in G y ∈ G ,
Φ a H u = χ u ( a ) 64 H u . \Phi_a H_u = \frac{\chi_u(a)}{64} H_u. Φ a H u = 64 χ u ( a ) H u .
Thus every Walsh vector H u H_u H u is a common eigenvector of every matrix Φ a \Phi_a Φ a , with eigenvalue
λ u ( a ) = χ u ( a ) 64 = ( − 1 ) u ⋅ a 64 . \lambda_u(a) = \frac{\chi_u(a)}{64} = \frac{(-1)^{u \cdot a}}{64}. λ u ( a ) = 64 χ u ( a ) = 64 ( − 1 ) u ⋅ a .
Let H H H denote the orthogonal matrix whose u u u -th column is H u H_u H u . Since the columns of H H H form a common orthonormal eigenbasis, we have
H ⊤ Φ a H = diag ( χ u ( a ) 64 ) u ∈ G . H^{\top}\Phi_a H = \operatorname{diag}\left(\frac{\chi_u(a)}{64}\right)_{u \in G}. H ⊤ Φ a H = diag ( 64 χ u ( a ) ) u ∈ G .
Therefore, the matrices { Φ a : a ∈ G } \{\Phi_a : a \in G\} { Φ a : a ∈ G } are simultaneously orthogonally diagonalized by the normalized Walsh–Hadamard matrix.
Experiment of Various Label Noise
Experiment on Modular Multiplication Task
In order to verify our theory, we designed the following experiment on the modular multiplication task. Consider N = 61 N = 61 N = 61 , Ω = { 1 , 2 , … , N } \Omega= \{1, 2, \ldots, N\} Ω = { 1 , 2 , … , N } and there are three modular-period that M 1 = 59 M_1 = 59 M 1 = 59 , M 2 = 60 M_2 = 60 M 2 = 60 , M 3 = 61 M_3 = 61 M 3 = 61 . The total pairs of Ω × Ω \Omega\times\Omega Ω × Ω are divided into three parts S 1 , S 2 , S 3 S_1, S_2, S_3 S 1 , S 2 , S 3 . The labels of data from
S i = { ( x i , y i ) } , i = 1 , 2 , 3 , S_i = \{(x_i, y_i)\}, \quad i = 1, 2, 3, S i = {( x i , y i )} , i = 1 , 2 , 3 ,
are set to
z ~ i = x i ⋅ y i ( m o d M i ) , z ~ i ∈ Ω ∪ { 0 } , \tilde{z}_i = x_i \cdot y_i \pmod{M_i}, \quad\tilde{z}_i \in\Omega\cup\{0\}, z ~ i = x i ⋅ y i ( mod M i ) , z ~ i ∈ Ω ∪ { 0 } ,
We trained it using the same neural network as before. See Figure 17 for the early-training loss curves of the three tasks. We can see that the task with M 2 = 60 M_2 = 60 M 2 = 60 showed a significantly faster decline than the others.
Figure 17. Early-training loss curves of the modular multiplication by 59, 60, 61.
Our theory can easily explain this point. For M = 60 M = 60 M = 60 , there exist a large number of pairs ( x , y ) (x,y) ( x , y ) such that x ⋅ y ≡ x ′ ⋅ y ( m o d M ) x \cdot y \equiv x' \cdot y \pmod{M} x ⋅ y ≡ x ′ ⋅ y ( mod M ) , such as
5 × 15 ≡ 13 × 15 ( m o d 60 ) , 5 \times15 \equiv13 \times15 \pmod{60}, 5 × 15 ≡ 13 × 15 ( mod 60 ) ,
which means that the label z z z is more concentrated. This leads to larger K 0 = ∑ z n z 2 K_0 = \sum_z n_z^2 K 0 = ∑ z n z 2 and larger ∥ φ ( a ) ∥ 2 2 + ∥ φ ( b ) ∥ 2 2 \lVert\varphi^{(a)}\rVert_2^2 + \lVert\varphi^{(b)}\rVert_2^2 ∥ φ ( a ) ∥ 2 2 + ∥ φ ( b ) ∥ 2 2 , thus a faster early training loss decline according to Theorem 3. In contrast, for prime numbers M 1 = 59 M_1 = 59 M 1 = 59 and M 3 = 61 M_3 = 61 M 3 = 61 , it satisfies x ⋅ y ≡ x ′ ⋅ y ( m o d M ) x \cdot y \equiv x' \cdot y \pmod{M} x ⋅ y ≡ x ′ ⋅ y ( mod M ) if and only if x ≡ x ′ ( m o d M ) x \equiv x' \pmod{M} x ≡ x ′ ( mod M ) for non-zero y y y , which means the signature of M = 59 , 61 M = 59, 61 M = 59 , 61 are more uniformly distributed. This leads to a smaller K 0 K_0 K 0 and K 1 K_1 K 1 (we think that the values of M 1 = 59 M_1 = 59 M 1 = 59 and M 3 = 61 M_3 = 61 M 3 = 61 are very close to each other). As shown in Figure 17 , the theoretical prediction is consistent with the actual observation. The early loss slope of M 2 = 60 M_2 = 60 M 2 = 60 is much greater than the others.
Experiment on the Bijective Noise
In the main text, we point out that in the scenario of uniform noise on the labels, during the early training phase, it is always observed that the loss of the noise decreases first, as in figure 4.
Here we present a specific noise construction that ensures it does not undergo such collisions. Just as our theory predicted, the phenomenon observed after replacing this kind of noise was completely different from what was observed before, as shown in Figure 18 . Specifically, we construct a binary function g ( x , y ) g(x,y) g ( x , y ) such that:
Figure 18. Early-training loss curves of the bijective noise experiment.
g ( x , ⋅ ) g(x,\cdot) g ( x , ⋅ ) is bijective for any fixed x x x and g ( ⋅ , y ) g(\cdot,y) g ( ⋅ , y ) is bijective for any fixed y y y .
g g g is not isomorphic to addition, that is,
g ( x , y ) ≠ σ 3 ( σ 1 ( x ) + σ 2 ( y ) ) , g(x,y) \ne\sigma_3(\sigma_1(x) + \sigma_2(y)), g ( x , y ) = σ 3 ( σ 1 ( x ) + σ 2 ( y )) ,
where σ i \sigma_i σ i is from the permutation group of Ω \Omega Ω .
Our final construction is
g ( x , y ) = { x , x = y , ( x + ( 4 + y − x 113 ) ⋅ ( y − x ) ) m o d 113 , x ≠ y . g(x,y) =
\begin{cases}
x, & x = y,\\
\left(x + \left(4 + \frac{y-x}{113}\right) \cdot(y-x)\right) \bmod113, & x \ne y.
\end{cases} g ( x , y ) = { x , ( x + ( 4 + 113 y − x ) ⋅ ( y − x ) ) mod 113 , x = y , x = y .
where ( ⋅ 113 ) \left(\frac{\cdot}{113}\right) ( 113 ⋅ ) is the Quadratic Residue Legendre symbol (of modular 113). It satisfies the above three properties. Next, we replace the original uniform random noise with the function g ( x , y ) g(x,y) g ( x , y ) . In this case, the loss of g g g does not always decrease first during the early training phase. By calculating the coefficient preceding κ ( 1 ) \kappa(1) κ ( 1 ) , We can give
Δ c l e a n − Δ g = 2 α − 1 , \Delta_{\mathrm{clean}}-\Delta_g=2\alpha-1, Δ clean − Δ g = 2 α − 1 ,
Inferring like that in chapter 6.1, a larger Δ \Delta Δ gives a more negative early loss derivative. This indicates that when the noise ratio α < 0.5 \alpha< 0.5 α < 0.5 , the noise data ( g ( x , y ) ) (g(x,y)) ( g ( x , y )) decrease first. In contrast, when α > 0.5 \alpha> 0.5 α > 0.5 , the opposite occurs. As shown in Figure 18 , the theoretical prediction is consistent with the actual observation.