Manuscript Offprint
arXiv:2610.11833Probability-Signature Dynamics: Unpacking Modular Addition Learning Within Two-Layer Networks
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
ABSTRACT
Neural networks trained on modular addition tasks often develop Fourier-structured representations that support exact generalization. While prior work has identified these Fourier circuits, the mechanism by which gradient-based training selects them from the data distribution remains unclear. We address this question using probability signatures, which express leading gradient interactions through conditional statistics of the training distribution. For modular addition, these signatures are cyclic shift operators and are diagonalized by the discrete Fourier transform, yielding approximately decoupled Fourier-mode dynamics. This explains the emergence of Fourier sparsity, frequency matching, and phase alignment. The same framework resolves a puzzle under label noise: corrupted examples can show faster early loss decrease than clean examples, despite lacking a coherent generalization rule. We show that noise increases conditional label collisions, strengthening early shared-coordinate reinforcement. Finally, this method can be applied to other operators. Taking XOR as an example, we observed the predicted frequency in experiments.
Keywords Two Layer Network, Modular Addition, Training Dynamics
1 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
A PREPRINT
by the emergence of a distinctive structure in the weights. Prior studies have shown that trained networks develop Fourier circuits (Nanda et al., 2023; Gromov, 2023). 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 . 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 (He et al., 2026). 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.
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 (2025), 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.
• We utilize probability signatures to directly explain the emergence of dominant Fourier modes during the learning dynamics.
• We have explained the puzzle in the early memorization regime: uniformly random label noise consistently exhibits a faster initial loss decrease than clean data. Some statistics from training distribution can measure this difference.
• The analysis framework can be extended to more tasks, such as XOR, enabling us to predict the structures that network parameters may form before training.
A PREPRINT
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 (Nanda et al., 2023). Analytic and scaling-oriented studies have further related the norms and spectral profiles of Fourier modes to the learned solution (Gromov, 2023; Michaud et al., 2023). 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 (He et al., 2026) 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 (Arpit et al., 2017; Liu et al., 2020). 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 (Doshi et al., 2024; Liu & Lu, 2026). 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.
3 Preliminaries
3.1 Settings
Let be a finite alphabet, where is a prescribed prime. We consider the prediction of a binary operation from examples to the label .
All pairs in are divided into three disjoint subsets , , of cardinalities , , and , respectively. The labels of clean and test are set to , while the labels of noise are replaced by uniform random numbers.
A PREPRINT
The training dataset consists of and . We define , where and . represents the noise ratio.
Model. Let be one-hot encodings. We study the two-layer MLP , where , , means the one-hot encodings of input , and . The output distribution is .
We use the cross-entropy loss function and employ -weight decay with coefficient . Parameters are initialized independently according to , where controls the initialization scale. Consider a continuous gradient flow model as an approximation, it is . For more details about initialization, learning rate or optimizer, please refer to the appendix A.
3.2 Probability signatures
The Probability Signature proposed in the related work (Yao & Xu, 2025) 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 , using full batch GD with cross-entropy loss and ignoring weight decay, with the activation function which is near zero. If we sample training data from , then we denote the probability that the first position is by and the random variable by the conditional expectation under the fixed first position.
Under the assumption of small initialization that , we derived that
where represent the -th column of and 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 , we define the probability signatures:
the 3-order tensor joint probability signatures:
and the trace-back probability signatures
A PREPRINT
We also denote , a column vector, and , a matrix. The same notation applies to the others. Then we can rewrite the gradient flow equation in Proposition 1 as
The above statistics , , are referred to as Probability Signatures.
4 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 -part, -part and -part based on the association with different probability signatures. Additionally, due to the weight decay, there is also a 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 and
Under small initialization that , , we have
where , . Here we define , , , and .
4.1 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 as the joint signature in this situation. Write , which is a shift-x permutation matrix. They satisfy
Here denotes the conjugate transpose and is the identity matrix. They form a commuting family of normal operators and therefore possess a common orthonormal eigenvectors over . The
A PREPRINT
basis can be obtained directly from the simplest nontrivial shift: implies for some unit root , which yields
These vectors are the normalized Fourier basis, and is the standard Fourier matrix. We use to represent the Discrete Fourier Transform (DFT) of vector .
Estimate by the main term of Theorem 1, we find that this system is separable for each hidden unit . Thus we can consider this equation on one hidden state , with system
We can expand the middle term by
At the same time, the Fourier transform of will be absorbed into the zero-frequency component, because it is independent of the index x.
Multiplying on the left by F, we have:
Similarly, we find that for each frequency ,
where means DFT and means conjugate. That is, the system is decoupled at each nonzero frequency. Each 3-variable system , , corresponding to frequency 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 . For each nonzero frequency , let , , and . Assume and that the three mode amplitudes remain nonzero up to the first singularity. Let be the blow-up time of the corresponding undamped system. If there exists some , and , then is the first frequency to blow up. Hence it makes the dominant frequency. Moreover, it is going to hold , when approaches the blow-up time.
Through the proposition, we can summarize the mechanism of weight decay filtering. The argument depends on the initial weights of a group of neurons , and weight decay provides a unified survival threshold, and the competition of patterns and the initial random asymmetry determine which frequencies cross this threshold.
A PREPRINT

Figure 1: Accuracy-Epoch curves of . For , model reaches 100% on clean and noise, but 0 on test, overfitting. For , model reaches almost 100% on clean, noise and test, generalization. For , model forgets the noise. And for , model cannot converge.
4.2 Estimation of noise
The actual training dataset is 80% of the complete data with 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 as above experiments with training data ratio and uniform-label noise ratio . Take as the main term under the full-addition signature. Then we estimate
where . The sampling error is controlled by
Similar results also hold for V and W.
5 Validation on Fourier frequency
We regard all the column vectors of or the row vectors of and as neurons, since the output of the neural network is . In analysis, we assume that they evolve approximately independently. We denote the concatenation of the -th row of , , the -th column of by and the collection of by . We consider Fourier transform of some neuron , it is for . We define the dominant frequency and sparsity by
It is noted that frequency r and P - r are regarded as the same under Fourier transform.
A PREPRINT

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 and . We observe and similarly for , , (C) The clean/noise dataset contributions to the drive. It is and similarly for others.
Experiments. We conducted experiments under different weight decay settings, with the same , noise ratio and initialization scale , in Figure 1. Additional experiments with other activation functions are reported in Appendix B,D. It is clearly evident from Figure 1 that weight decay has a significant impact on the direction of the training process. We observe that acts as a regularization. That is, the model generalizes well while ignoring all the noise.
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:
In Figure 2A, 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.
In Figure 2B, 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 2C. 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 C.1, comparing the cosine similarity between the estimated gradient and the actual gradient. The results show that it can achieve cosine-similarity with the actual gradient.
We find that the dominant frequencies of , , and tend to agree if the neuron reaches high sparsity. If the common frequency is , we extract the components at the dominant frequency by
A PREPRINT

Figure 3: Frequency matching and phase alignment. In the odd columns, the horizontal coordinate is the dominant nonzero Fourier frequency of w and the vertical coordinate is its frequency sparsity; in the even columns, the coordinates are and , respectively. Red points indicate exact agreement of the dominant frequencies of , , and , while blue points indicate a mismatch; dashed lines show phase equality.

Figure 4: Early(< 100 epochs) clean and noise loss dynamics. means the noise ratio. Noise loss always decreases more rapidly.
, then their phases will tend to satisfy . Figure 3 shows that frequency matching and phase alignment emerge together during training, which is consistent with the result of Prop 2.
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 C.2.
6 Application of Probability Signature
6.1 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, 2026) 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 (Xu et al., 2020), 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.
A PREPRINT
In the small-initialization regime, the loss derivative is approximately , with sampling 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 , while for pairs sharing one coordinate define , where are i.i.d. vectors. Generally, we have (see appendix F.1). Let be the number of examples labeled and define . Then the following theorem can compare the early loss for full training dataset. Note that here are understood as matrices.
Theorem 3 (Early loss decrease). Suppose the training dataset contains every distinct pairs , and the model structure is the same as that mentioned before. For different label distribution, the early-time loss-slope is positively correlated with
Proof. See Appendix E.5.
For modular addition, conditioning on any fixed value of a (or b), the label is uniform on . Hence,
For a fully random labeling, let . The pairs with first coordinate receive independent labels, so
According to the binomial distribution, we get . It further gives , , 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 and dividing it into clean samples (modular addition) and noise (uniform random label). The loss for one example can be regarded as
Here the coefficient is regarded as for a clean sample, or for a noise. Taking expectations, the counts satisfy , and . Consequently, , 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.
A PREPRINT

Figure 5: Hadamard frequency structure in the XOR experiment. For sampled neurons at epochs 0, 50, 200, the horizontal axis is and the vertical axis is the sparsity of . 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 .
6.2 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 , with . Its joint signature is
Hadamard basis simultaneously diagonalize these operators: there is an orthogonal basis such that is diagonal for every . The properties of can be referred to in Appendix E.6. Therefore, we claim that after training on XOR, the weights will evolve into a shape similar to the Hadamard basis.
Validation. We write , and define its sparsity by
A PREPRINT
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.
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 C.1.
References
Devansh Arpit, Stanislaw Jastrzkebski, Nicolas Ballas, David Krueger, Emmanuel Bengio, Max S. Kanwal, Tegan Maharaj, Asja Fischer, Aaron Courville, Yoshua Bengio, and Simon Lacoste-Julien. A closer look at memorization in deep networks. In International Conference on Machine Learning, 2017.
Darshil Doshi, Aritra Das, Tianyu He, and Andrey Gromov. To grok or not to grok: Disentangling generalization and memorization on corrupted algorithmic datasets. In International Conference on Learning Representations, 2024.
Andrey Gromov. Grokking modular arithmetic, 2023.
Jianliang He, Leda Wang, Siyu Chen, and Zhuoran Yang. On the mechanism and dynamics of modular addition: Fourier features, lottery ticket, and grokking, 2026.
Arthur Jacot, Franck Gabriel, and Clément Hongler. Neural tangent kernel: Convergence and generalization in neural networks, 2020. URL https://arxiv.org/abs/1806.07572.
Tanishq Kumar, Blake Bordelon, Samuel J. Gershman, and Cengiz Pehlevan. Grokking as the transition from lazy to rich training dynamics. In International Conference on Learning Representations, 2024.
Linyu Liu and Pinyan Lu. Unveiling memorization-generalization coexistence: A case study on arithmetic tasks with label noise, 2026. URL https://arxiv.org/abs/2605.18022.
A PREPRINT
Sheng Liu, Jonathan Niles-Weed, Narges Razavian, and Carlos Fernandez-Granda. Early-learning regularization prevents memorization of noisy labels. In Advances in Neural Information Processing Systems, 2020.
Ziming Liu, Ouail Kitouni, Niklas Nolte, Eric J. Michaud, Max Tegmark, and Mike Williams. Towards understanding grokking: An effective theory of representation learning, 2022.
Ziming Liu, Eric J. Michaud, and Max Tegmark. Omnigrok: Grokking beyond algorithmic data. In International Conference on Learning Representations, 2023.
Eric J. Michaud, Ziming Liu, Uzay Girit, and Max Tegmark. The quantization model of neural scaling. In Advances in Neural Information Processing Systems, 2023.
Neel Nanda, Lawrence Chan, Tom Lieberum, Jess Smith, and Jacob Steinhardt. Progress measures for grokking via mechanistic interpretability. In International Conference on Learning Representations, 2023.
Alethea Power, Yuri Burda, Harri Edwards, Igor Babuschkin, and Vedant Misra. Grokking: Generalization beyond overfitting on small algorithmic datasets, 2022.
Vimal Thilak, Etai Littwin, Shuangfei Zhai, Omid Saremi, Roni Paiss, and Joshua Susskind. The slingshot mechanism: An empirical study of adaptive optimizers and the grokking phenomenon, 2022.
Zhi-Qin John Xu, Yaoyu Zhang, Tao Luo, Yanyang Xiao, and Zheng Ma. Frequency principle: Fourier analysis sheds light on deep neural networks. Communications in Computational Physics, 28(5):1746–1767, 2020.
Junjie Yao and Zhi-Qin John Xu. Probability signature: Bridging data semantics and embedding structure in language models, 2025. URL https://arxiv.org/abs/2509.20124.
Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization, 2017. URL https://arxiv.org/abs/1611.03530.
A PREPRINT

Figure 6: Accuracy curves using Adam, with weight decay and initialization scale .

Figure 7: Loss curves using Adam.
A Model and training details
The neural network structure of this article can be written as
Here, and are input embedding matrices in , and is the output matrix in , with representing the width of the hidden layer (, ). The output probability can be expressed as
A PREPRINT

Figure 8: Accuracy curves using AdamW.
The loss of the training data is given by the cross-entropy:
The total loss after adding weight decay is:
The learning rate strategy we employ is warmup + cosine decay:
The minimum learning rate , and the initial learning rate 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
A PREPRINT

Figure 9: Loss curves using AdamW.

Figure 10: (a)–(d): Final accuracy using activation functions (linear), (quadratic), , or , under different weight decay.
weight decay, using a smaller initial value can shorten the training convergence time. Moreover, check Figure 8,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.
B Discussion on Activation Functions
We use 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 (linear), , , and . 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 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.
A PREPRINT
Let's review the mathematical derivation of the probability signature presented in the main text, we use the Taylor expansion of the activation function,
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 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.
C Experimental Details
C.1 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 as , where is the probability signature of the actual training dataset. We extract its main term,
as an approximation for the cross-entropy gradient. Flatten this vector, we get , which is an approximation for the cross-entropy gradient . We compare the two gradients by cosine similarity
as Approx 1 in Figure 11.
Similarly, by Theorem 2, we can approximate the gradient flow of as , where is the probability signature of the clean modular addition, it is,
We also extract and flatten its main term as , comparing which with the cross-entropy gradient by cosine similarity, as Approx 2 in Figure 11. The experimental results show that both the
A PREPRINT
Gradient Approximation Comparison

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.
approximated gradients and the actual gradients have a high similarity of 90%. This verifies our theoretical analysis. Meanwhile, the control experiments using 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 . Our theoretical derivation does not assume that these higher-order terms should be omitted. We focus on the dominant part. There exists a scale . When the parameter is less than , the second-order term becomes dominant, while when the parameter is greater than , the higher-order terms become dominant. It is noted that when weight decay exists, there is a non-high-order term of in the gradient flow equation. Therefore, an appropriate 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.
A PREPRINT


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.
C.2 Frequency Selectivity
We used complete addition tables with , , GELU activation, Gaussian scale . Both models started from identical initialized parameters. The exact update was
and the truncated update replaced by the field in Theorem 1 with and the same weight decay .
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.
D 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.
D.1 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.
A PREPRINT
Proposition 3 (A sufficient Fourier condition for modular addition). Let be an odd prime, and let , be prescribed frequencies. For each hidden unit , let be mutually independent random variables distributed uniformly on . If the parameters are set to , , . then the prediction of the neural network is with probability tending to as .
Proof. Fix , and write
For each hidden unit and output coordinate , define
Then
Since and
we have
We first compute the expectation of a single-unit contribution. Set
and let
Because
we obtain
Thus,
Since and are independent and uniformly distributed on , we may set
Using
we have
A PREPRINT
For fixed ,
Consequently,
In the second equality, the sine term vanishes by symmetry, and in the last equality we used
Therefore,
For the target coordinate , we have
and hence
Now consider any . Since is prime,
imply
Define
Because is finite and none of the corresponding angles is congruent to 0 modulo ,
It follows that, for every and every ,
Hence, with
A PREPRINT
we have
Averaging over gives
It remains to control the fluctuations around these expectations. Since the random phases are mutually independent across hidden units, the variables are independent for each fixed . Moreover, . Therefore, Hoeffding's inequality yields, for every ,
Taking and applying the union bound over the output coordinates, we obtain
On the complementary event, for every ,
Thus, on this event, is the unique maximizing output coordinate. Consequently,
Since the right-hand side converges to 1 as , we conclude that
□
D.2 Experiment Details of ReLU activation
We conducted experiments using the ReLU activation function, and the results are shown in Figures 13 and 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.
A PREPRINT

Figure 13: Experiment of Figure 2 with ReLU.

Figure 14: Experiment of Figure 3 with ReLU.
D.3 Early Memorization
Current research Zhang et al. (2017); Jacot et al. (2020) have already provided a thorough discussion on the early memory behavior of neural networks. When use , we observe clear traces of memory at . 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.
Consider a single example and let and . By the chain rule,
Thus the gradient flow for the output weights is
Near initialization, the softmax expansion gives
so the correct output coordinate is amplified while the others are weakly suppressed. In particular, the active coordinates satisfy , hence the weights will increase in those
A PREPRINT

Figure 15: Accuracy curve under RELU activation and , with 30% noise.

Figure 16: Example-wise interpolation and the memory score. (a). For the illustrative input with , , the activation feature represents the initially active hidden coordinates; the displayed values denote random initialization signs rather than fixed parameter values. (b). Evolution of the memory score on clean and noisy training examples.
dimensions where . For the example in Figure 16(a), , only are active in the case, namely those satisfying . This is only a toy model of 1 training sample. It behaves like an interpolation, storing the data onto these random dimensions.
In the full-batch setting, the exact flows are
A PREPRINT
These equations show that each example strengthens its own output coordinate on its active hidden dimensions and suppresses the other output coordinates , with the latter effect smaller by approximately a factor . This example-wise interpolation motivates the following memory score:
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.
E Proofs and Additional Details
E.1 Calculation of the gradient flow
Proof. Let
Without loss of generality, assume that the learning rate . For the softmax cross-entropy loss associated with one sample ,
the derivative with respect to the logits is
Therefore, by the chain rule,
Since contributes to only when the first position of the sample is x, the full-batch gradient flow gives
Because is near zero and
where the powers are understood componentwise, we have
A PREPRINT
Moreover,
Let
The softmax function satisfies
and its Jacobian at zero is
Consequently, for a logit vector near zero,
Taking and using (3), we obtain
Substituting this expression into (4) gives
Thus,
(6)
Combining (2) and (6), and retaining all constant and first-order terms in , yields
(7)
A PREPRINT
where contains all higher-order terms. In particular, the product
is quadratic in and is therefore included in .
We now take the conditional expectation of each term in (7). First,
(8)
Since ,
Hence,
(9)
Furthermore,
It follows from (10) that
(11)
and
(12)
Substituting (8)–(12) into the gradient-flow equation (1), we obtain
where .
The same calculation would be applied to V. Then we obtain the gradient flow for W. Denote by the probability of samples labeled z. According to the definition, there is
A PREPRINT
Then, the gradient flow of the -th row of is expressed in the expected form as
Substituting yields a similar result.
E.2 Proof of Dominance of the gradient
Proof. We give the proof for and the same calculation would be able to applied to and . For convenience, write
and define
From proposition 1, we have
Since is uniform on ,
Therefore,
and
The joint product term is
A PREPRINT
Substitute all these, we have
It remains to identify the conditional expectation with the stated matrix expression. By definition,
adding the weight decay term, we conclude that
□
E.3 Proof of Estimation of noise
Proof. Let be the empirical full-batch vector field. To avoid random conditional denominators, for every let be the indicator that the pair is included in the training set, and let be its observed label when . Uniform sampling and uniform label replacement give the exact identity
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 first. Applying the expansion in Proposition 1 to the empirical measure yields
(2)
For equation (1), summed over y, shows that
A PREPRINT
Consequently, both the first-order term and the part of the second-order term containing have zero sampling mean. For the remaining part, (1) gives
(4)
This has already yielded the main components of the theorem. Exchanging and for another proof.
For the -th output row, set . The same Taylor expansion gives
where . The linear term in (5) has zero expectation: on every addition diagonal , both and agree with their uniform-background sums. The same cancellation removes the and terms. The two equal cross terms leave
It remains to control the finite-sample fluctuation. Define 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 for a fixed input or output coordinate. Randomly corrupting an fraction of the selected labels contributes at most an additional . In (2) and (5), each coordinate of a centered first-order summand is bounded by , while each second-order summand is bounded by . The variance formula gives
which is the claimed bound.
It is noted that the error is caused by the and 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.
E.4 Proof of dominant frequency and phase locking
Proof. The Fourier modes obey
A PREPRINT
Set , , and , with
Then
If is the undamped blow-up time, its damped time is
This map is increasing, so implies . As , the energy of mode diverges while every competing mode remains finite, and its energy fraction tends to one.
For phase locking, write , , , and . Direct separation of real and imaginary parts gives
While the amplitudes remain nonzero, the factor in parentheses is positive. Thus is stable and is unstable. A continuous random initialization avoids the unstable equilibrium with probability one, yielding modulo on the regular continuation interval.
E.5 Proof of the early-loss theorem
Lemma 1. Let be i.i.d. random variables and let be such that the expectations below exist, then
Proof. Define , .
Since and are independent,
Given , the variables and are independent, so
Hence .
Therefore,
But , so
Thus .
A PREPRINT
For activation functions such as GELU and RELU, the above inequality will hold strictly. It is in the main text.
Theorem 3
Proof. The total number of all pairs with the same label is
Let count examples with first coordinate and label , and define analogously. In the complete table, and . The ordered pairs sharing the first coordinate and label number
and similarly .
We define
Here are scalar jointly Gaussian, each of variance and covariance . 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:
The last item is independent of the training distribution.
E.6 Propositions of Hadamard basis
Let
and identify the group operation on with bitwise XOR. For each , define the matrix by
For , define the Walsh character
where
Let be the normalized Walsh vector
A PREPRINT
Then the family is simultaneously diagonalized by the orthonormal Walsh–Hadamard basis . More precisely,
Consequently, if is the orthogonal matrix whose columns are the vectors , then
for every . Indeed, for ,
If , then the summand is identically equal to 1, and hence
If , then . Choose an element such that
The map is a bijection of , and therefore
Thus the sum is zero. Hence
so is an orthonormal basis of . Now fix . For every , we have
Using the character identity
we obtain
A PREPRINT

Figure 17: Early-training loss curves of the modular multiplication by 59, 60, 61.
Since this holds for every ,
Thus every Walsh vector is a common eigenvector of every matrix , with eigenvalue
Let denote the orthogonal matrix whose -th column is . Since the columns of form a common orthonormal eigenbasis, we have
Therefore, the matrices are simultaneously orthogonally diagonalized by the normalized Walsh–Hadamard matrix.
F Experiment of Various Label Noise
F.1 Experiment on Modular Multiplication Task
In order to verify our theory, we designed the following experiment on the modular multiplication task. Consider , and there are three modular-period that , , . The total pairs of are divided into three parts , , . The labels of data from
are set to
A PREPRINT

Figure 18: Early-training loss curves of the bijective noise experiment.
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 showed a significantly faster decline than the others.
Our theory can easily explain this point. For , there exist a large number of pairs such that , such as
which means that the label is more concentrated. This leads to larger and larger , thus a faster early training loss decline according to Theorem 3. In contrast, for prime numbers and , it satisfies if and only if for non-zero , which means the signature of are more uniformly distributed. This leads to a smaller and (we think that the values of and 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 is much greater than the others.
F.2 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 such that:
• is bijective for any fixed and is bijective for any fixed .
• g is not isomorphic to addition, that is,
where is from the permutation group of .
• Generally, g cannot be accurately fitted by our 2L-MLP.
Our final construction is
A PREPRINT
where 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 . In this case, the loss of does not always decrease first during the early training phase. By calculating the coefficient preceding , We can give
Inferring like that in chapter 6.1, a larger gives a more negative early loss derivative. This indicates that when the noise ratio , the noise data decrease first. In contrast, when , the opposite occurs. As shown in Figure 18, the theoretical prediction is consistent with the actual observation.