Manuscript Offprint
arXiv:2610.13524Simulating Training Spikes of Deep Neural Networks by Layer-wise Random Feature Models
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Ran Tian and Courtney Paquette
Abstract. Intermittent “spikes” in loss, during the pre-training of Large Language Models (LLMs), remains a mysterious phenomenon both theoretically and empirically. In this paper, we show that simple quadratic models with heavy-tailed, power-law distributed inputs can replicate these spikes. We introduce a theoretical framework and simulation algorithm to model per-layer training dynamics of Deep Neural Networks (DNNs), using such quadratic models. In a case study on an Adam hyperparameter configuration (where is set close to 1) known to induce spikes in Transformer LMs, our simulation successfully predicts bumps indicating spiky behavior from a given checkpoint. Furthermore, we derive an appropriate schedule from observed metrics, which empirically improves performance.
Key words. Training spikes, Stochastic optimization, Random Feature models, Power law
- Introduction. “Training spikes”, the temporary, sharp surges in loss (Figure 1), are a phenomenon often observed during the pre-training of Large Language Models (LLMs) (Chowdhery et al., 2023; Molybog et al., 2023). Empirically, these spikes are considered pathological because the increase in loss may indicate training instability, the hyperparameters being sub-optimal, or the final model less predictive. The wild fluctuations in training metrics can trigger numerical issues as well, since large-scale Deep Neural Networks (DNNs) are usually trained with low-precision arithmetic. While their empirical occurrence is well documented, the underlying causes of these training spikes are not yet fully understood, partly because their occurrences can be affected by many factors, sometimes difficult to reliably reproduce in controlled settings (Nishida et al., 2024; Takase et al., 2025).
Stochastic optimizers, such as SGD and Adam (Kingma and Ba, 2015), inherently produce fluctuations due to the random sampling of training data. However, the “training spikes” discussed in this paper are distinct in their sensitivity to both data shuffling and model initialization. Typically, the trajectory of training loss fluctuations (the “up-and-downs” of the curve) remains consistent under an identical data shuffle (Figure 1b), irrespective of model initialization or minor architectural modifications. However, training spikes do not follow this pattern. As shown in Figure 1a, two training trajectories, which differ only by their random initialization seeds, can spike at different steps. This extra randomness complicates the study and mitigation of training spikes. For example, simply removing “data outliers” as a remedy to training spikes will only partially solve the problem, since one can often still observe random surges in the validation loss (Figure 1c). This suggests that training spikes are usually not caused by a specific occurrence of one single data point.
In § 3.4, we will detail our theoretical framework, which posits that normal fluctuations in loss are driven solely by data shuffling because high model dimensionality typically cancels out model-originated randomness. This concentration of measure property is conditional; it breaks down when the data distribution is heavy-tailed, resulting in training spikes. We
*Google Deepmind (tianran@google.com)
R. TIAN AND C. PAQUETTE

(a) Overall trajectories of the training loss.

(b) Training loss from 21k to 22k.

(c) Validation loss from 21k to 22k.
Figure 1: Training of a Transformer LM. Comparing a “Normal” training with two “Spiky” trainings. “Normal” and “Spiky1” differ in the hyperparameter of Adam only, while “Spiky1” and “Spiky2” differ in the random-seed of model initialization only. Training spikes can occur at different steps between “Spiky1” and “Spiky2”, while “normal fluctuations” in training loss remain consistent.
demonstrate this mechanism using Power-Law Random Feature (PLRF) models – a class of simple linear-regression models with quadratic loss. Furthermore, we introduce an algorithm that uses PLRF-like dynamics to simulate the training behavior of individual layers within a DNN.
Remarkably, even simple models like PLRF can exhibit training spikes. Figure 2 compares various PLRF training trajectories – with and without spikes – across different optimizers, learning rates, and power-law exponents. Our findings highlight that the power-law exponent , which quantifies the “heavy-tailedness” of the data distribution, is critical; a larger is a necessary condition for these spikes to occur. To our knowledge, this is the first study to explicitly link training spikes to heavy-tailed data distributions.
Our simulation framework is largely inspired by Lee et al. (2019), utilizing a Taylor expansion of the DNN at training step t to predict dynamics up to a future step . We advance this approach by incorporating stochastic optimization algorithms like SGD and Adam, which are more representative of real-world practices than full-batch gradient descent. This shift requires a 2nd-order Taylor expansion to account for stochastic gradient noise; Fortunately, recent work by Paquette et al. (2021, 2024) provides the theoretical tools to precisely solve training dynamics under this setting. The 2nd-order analysis is essential; as we show in Figure 3, empirical evidence suggests that training spikes of DNNs likely originate from 2nd-order gradient noise within some layers.
To summarize our contributions:
-
We developed a framework aligning DNN layers with simple Random Feature models to enable lightweight simulations of training dynamics ( 3.3). This approach facilitates the scientific study of elusive phenomena like training spikes in DNNs.
-
While spiky behavior is often linked to the complex, non-convex nature of feature learning in DNNs (as seen in the “Edge-of-Stability” regime, Cohen et al., 2021, 2022), it is surprising that even convex PLRF models exhibit similar training spikes ( 2).
-
We conducted a case-study where the Adam hyperparameter causes training spikes in a Transformer LM. Our simulation successfully predicts the spiky behavior for a given model checkpoint ( 4). We then analyze several training metrics in details, and offer optimization recipes such as an appropriate schedule, which can avoid spikes and empirically improve performance ( C.5).
-
Background. A Random Feature model assumes a non-trainable matrix A which maps a V-dimensional random input x to D-dimensional features. Then, the features are fed to linear regression with a quadratic loss
(2.1)
Here, w is the D-dimensional trainable model weights, the label a scalar function of x, and c a constant. The constant matrix A is usually set to random Gaussian if not else specified.
In addition, the Power-Law Random Feature model (Maloney et al., 2022; Bahri et al., 2024, PLRF) assumes that , where each is Gaussian i.i.d. drawn from , and is the power-law exponent of input data. In this work ( 3.2), we will use to approximate hidden vectors in a Deep Neural Network (DNN), so is the model dimension of the DNN, while is a very large ( ) number intended for a latent space that can linearize the sub-DNN which produces the hidden vector, as inspired by Neural Tangent Kernel (Jacot et al., 2018; Bordelon et al., 2024).
When Stochastic Gradient Descent (SGD) is applied to the optimization of model (2.1), the training dynamics can be analytically solved (Paquette et al., 2021, 2024). Moreover, since the power-law data distribution in PLRF implies neural scaling laws (Maloney et al., 2022; Bahri et al., 2024), solving the dynamics allows for numerical predictions of compute-optimal scaling (Paquette et al., 2024). In this study, we further demonstrate that a large can cause training spikes as well.
In Figure 2, we compare the training dynamics of PLRF for . We set , , , and apply SGD and Adam across different learning-rates. The batch-size . When , as the learning-rate increases, validation loss diverges without showing any spikes. In contrast, when , both optimizers exhibit training spikes before divergence. This suggests two conditions for training spikes in PLRF: (1) heavy-tailed data (large ) and (2) near divergence (large learning-rate). We provide the Python code for these experiments in supplementary materials.
The spiky behavior of PLRF is surprising for two reasons. First, while SGD-based training is a random process influenced by data shuffling, Paquette et al. (2021) proves that the validation loss of Random Feature models typically converges to a smooth, deterministic curve.
R. TIAN AND C. PAQUETTE



Figure 2: The validation loss of PLRF, from training step 0 to 1k. We compare , for SGD and Adam, with different learning-rates. Each plot shows 3 random seeds (to distinguish initialization and data-shuffle separately), and learning-rates are chosen such that training converges, nearly diverges, or diverges, respectively. For SGD, the required learning-rates are calculated from the threshold given in formula (2.2). For Adam, the learning-rates are found by manual grid search.
– a phenomenon known as the “Concentration of SGD” – when D and V are sufficiently large. Random training spikes of PLRF seemingly contradict this concentration effect – As it turns out, for PLRF with , while the expected validation loss remains smooth, and the scaling analysis of Paquette et al. (2024); Ferbach et al. (2025) still valid, it must be noted that these results describe average-case behavior; But one can no longer prove the convergence to expectation (see § 3.4 and § A.6). In other words, at , training can exhibit random spikes that temporarily deviate from the expectation, even at massive scales.
Second, while similar spiky behavior has been observed in DNNs under full-batch gradient descent, it was previously considered impossible for quadratic models (Cohen et al., 2021;
Damian et al., 2023; Cohen et al., 2025). This is because full-batch gradient descent on quadratic loss has straightforward dynamics: It diverges if the learning rate exceeds (where is the largest eigenvalue of the Hessian). Typically, only DNNs with 3rd-order terms exhibit spikes and the subsequent stabilization characteristic of the so-called “Edge-of-Stability” regime, when the learning rate nears this threshold.
However, this theory does not translate directly to stochastic optimization. Due to stochastic gradient noise captured by Hessian, training spikes can occur in quadratic models when the input data is heavy-tailed; 3rd-order terms are not necessary. Additionally, the learning-rate threshold of divergence is not for SGD; instead, when the batch-size B is small ( ), is determined by the following equation (see Paquette et al., 2024, C.2, or § A.5 of this paper):
(2.2)
where is the eigenvalues of the Hessian. In particular, .
- Theory. Having demonstrated the rich dynamics of PLRF including training spikes, in this section we introduce a theoretical framework that aligns each DNN layer with a Random Feature model.
3.1. Layer-wise Quadratic Loss. Let be the model parameters of a DNN. Given a loss function , where is a data point, the DNN is trained by minimizing the loss over a data distribution . We are interested in the dynamics of the validation loss , where is the model checkpoint at training step .
Definition 3.1. Instead of directly investigating , we take its Taylor expansion to the 2nd order at training step , for a fixed layer :
This is the approximate “amount of change” contributed by to the validation loss, when is trained to step while other parameters are fixed at step . One subtle detail is that evolves by the original updates calculated from the gradients of (where is drawn from the training data-shuffle), without freezing any model parameters. We only freeze model parameters when calculating the evaluation metric .
The metric is a quadratic function of , which can be written as “ ” where
(3.1)
Here, is calculated such that the gradient of L can match that of the validation loss at :
Our goal is to simulate the dynamics of L, the layer-wise quadratic loss. In this paper, we rigorously define “layers” of a DNN as below.
R. TIAN AND C. PAQUETTE
Definition 3.2. A layer is a subset of model parameters such that:
(1) acts as a matrix multiplication, i.e., it takes a vector as input, and returns as the layer output.
(2a) The forward pass to the input does not depend on . In other words, can be written as where .
(2b) The backward pass to the output gradient does not depend on . In other words, can be written as , where .
Intuitively, Definition 3.2 ensures that acts as a “standalone linear unit” in the DNN. In practice, most DNNs can be decomposed into layers under this definition . Because is generally a matrix, we flatten it to a vector in Definition 3.1.
We can calculate the per-example gradient of W from Definition 3.2:
(3.2)
In the RHS above, the only component that depends on is . Therefore, if we focus on the evolution of , everything except the linear regression can be treated as “data given”. This is the main idea for the next section.
3.2. Per-Layer Approximation by Random Feature Models. Let be a matrix. The next theorem suggests that one can approximate the per-example gradients of , as if they come from a (generalized) Random Feature Model.
Theorem 3.3. Fix a training step . There exists a map , such that for any training example and step , a V-dimensional vector satisfies the following:
(a) The D-dimensional vector can be approximated by , where is a constant matrix that does not depend on or .
(b) The C-dimensional vector (where ), can be approximated by , where is an affine function of and a matrix that does not depend on .
At first glance, the linear approximation as required by Theorem 3.3 may seem unreasonably strong, because DNNs are highly non-linear – which is why our proof (given in § A) uses a latent space of extremely high dimensionality (V ≈ # training-examples × # model-parameters) to “linearize” the DNN, as inspired by Neural Tangent Kernel. Therefore, the vector and matrices , are infeasible to calculate in practice – However, they provide the necessary framework to apply powerful assumptions (e.g. the independence of entries of under suitable change of basis) and theoretical tools (e.g. SVD decomposition of ), enabling predictions that can be empirically verified.
Under stochastic optimization, is randomly drawn from the training data, so its corresponding representation is a random vector. Although the distribution of does not depend on the training step, the construction of in Theorem 3.3 does. In other words, there
In certain model designs, “shared weights” can break the conditions. For example, some LMs reuse the input embedding layer as the output logits head, which breaks condition (2a) and (2b) because the same weights are used at different sites of the model. We will leave such cases to future work.
is generally distribution drift of across different s. However, in this work, we impose a strong assumption that the distribution drift is negligible when s is small. In fact, we assume that the distribution of is explicitly given as i.i.d. Gaussian, so that we can align with a PLRF model:
Assumption 3.4. One can replace the in Theorem 3.3 by a suitable linear transformation , where does not depend on or , and the entries of are i.i.d. Gaussian of mean 0 and variance 1.
When Assumption 3.4 is applied, we can omit the subscript of and absorb the linear transformation into and . So and , with the entries of being i.i.d. Gaussian of mean 0 and variance 1. This assumption enables explicit calculation of the covariance of the per-example gradient, , as below.
Prediction 3.5. Using Assumption 3.4, and assume that D is sufficiently large. Let be the correlation matrix of input hidden vectors, where is averaging over the training data . Let be the eigen decomposition. Then,
(3.3)
where , are the -th column vectors of the matrix . In particular, we have
(3.4)
by taking the trace of .
We theoretically prove Prediction 3.5 in § A.2 and empirically verify in § C.3. This is a non-trivial result relying on the high-dimensionality of D: Intuitively, it claims that for , one can calculate the expected gradient norm as if and are independent – Of course, and are not independent because they share a common factor – But the “dependent part” turns out to be negligible when D is large. In our case-study of a Transformer LM, we show that the empirical error of (3.4) is mostly within 5%, even though the two sides simultaneously vary multiple magnitudes across different layers and training steps.
3.3. Simulation Algorithm. From the layer-wise quadratic loss one can only obtain the average gradient (which matches the approximate average gradient of the DNN, as calculated from the layer-wise Taylor expansion to the 2nd order); But in order to simulate stochastic optimization, one has to synthesize per-example gradients, or more generally the mini-batched gradients of the DNN.
Our idea is to use Prediction 3.5, which provides the 2nd moment of per-example gradients. Roughly speaking, we can synthesize “pseudo gradients” by randomly sampling Gaussians to match the average and 2nd moment, at each step of the simulation.
For Random Feature models, the distribution of the per-example gradient is not Gaussian
R. TIAN AND C. PAQUETTE
In Prediction 3.5, one can directly measure from forward activations on a validation set (and Assumption 3.4 implies it does not change over time), but is tricky because it depends on . However, for the Random Feature model given in (2.1), where
is a scalar, one has
(3.5)
which is a multiple of the validation loss, a presumed quantity that we can handle. Essentially, this simplification (3.5) leads to the Volterra equation investigated in Paquette et al. (2021) and the analytic solution of SGD training dynamics for Random Feature models. In this paper, we further apply (3.5) to DNNs, by making the following assumption:
Assumption 3.6. can be roughly approximated by , where is the identity matrix.
This final assumption hypothesizes that most eigenvalues of are close to each other, so that one can approximately collapse it into a scalar operator (which equals the mean eigenvalue ). As a result, our simulation approximates the behavior of a D-dimensional “average slice” of the matrix , so that one can apply (3.5) and predict the dynamics.
The simulation pseudo-code is given in Algorithm 3.1. We choose the constant in the Random Feature model (2.1) such that the trace of the Hessian matches that of the DNN Hessian in the layer-wise quadratic loss (3.1). This approximation is necessary also because when the DNN is large, the full Hessian tensor of total dimensions is infeasible to calculate. Then, our algorithm tracks the D-dimensional vector , and initializes such that the norms of the initial average gradients match in every eigenmode. Finally, we synthesize per-batch gradients instead of per-example gradients, depending on the batch-size. For this purpose, we define an equivalent batch factor which is empirically measured to match the initial mean squared-norm of per-batch gradients. Under certain conditions, coincides with the actual batch-size for Random Feature models (§ A.3), and we break down the details of for DNNs in § C.4. The theoretical derivation of Algorithm 3.1 is given in § A.4. When applied to PLRF models, we empirically verify that the algorithm correctly captures training dynamics, including spikes (Figure 5).
Because our simulation does not call the backward pass of a DNN at each step – it synthesizes a random gradient instead – the algorithm is extremely lightweight. The initial inputs require , , and (the eigen decomposition of) , which cost one pass over a validation set. See Table 1 for a summary of the compute requirements.
3.4. A Sketch of why Training Spikes Occur. In this section, we briefly explain why power-law distributed inputs can lead to training spikes. For simplicity, we analyze the
– it’s a product of two Gaussian random variables. However, since the distribution is still of the exponential family, and the simulation is a long-term accumulation of gradients across multiple steps, Gaussian sampling at each step should be a good approximation for long-term, average-case analysis.
Algorithm 3.1 Simulating the approximate behavior of the layer-wise quadratic loss from step to , where a D-dimensional average slice of the matrix gets trained.
Require: and , the eigenvalues and eigenvectors of , respectively.
Require: , the average gradient of the DNN layer, at step .
Require: , the mean squared-norm of per-batch gradients.
Require: , the trace of the layer-wise Hessian.
Require: , an optimizer to map (synthetic) per-batch gradients to updates.
Ensure: , a trajectory of simulated layer-wise quadratic loss.
▷ Approximate the constant in (2.1).
▷ The equivalent batch factor.
▷ Initialize .
for do
▷ Output.
▷ Sample stochastic noise of per-batch gradient.
▷ Synthetic per-batch gradient.
▷ Call optimizer.
▷ Update.
end for
dynamics of w under SGD. (We expect optimizers with momentum and precondition, such as Adam, to follow a similar principle.) At any step t, let be the learning-rate. The update of SGD is given by
(3.6)
where is a per-example gradient. This is a random process depending on the data sample at each step; We apply the decomposition , where averages over the data distribution, and is a random vector of mean , representing the stochastic noise of training samples.
Under a quadratic loss, the average gradient is in the form , where is the Hessian. Thus, we can decompose (3.6) into , such that
(3.7)
So is the predictable full-batch gradient descent, while is a random walk with mean 0, accumulating the stochastic noise across steps. When the Central Limit Theorem applies, should approximately follow a (anisotropic) Gaussian distribution.
Intuitively, one can imagine as a high-dimension (isotropic) Gaussian with a given variance ; so for any random , we know that with high probability, while
R. TIAN AND C. PAQUETTE
| Experiment | Train | Eval | Eval | Simulation | ||
|---|---|---|---|---|---|---|
| Data size | 25.5B tokens | 336M tokens | 336M tokens | 336M tokens | 336M tokens | 1500 steps |
| Model size | 1.3B (24 blocks) | 24 ffn_0 | all layers | all layers | 6 ffn_0 | 1 layer |
| Time | 40 hrs | 1.1 hrs | 8 min | 15 min | 1.7 hrs | 5 sec |
| Machine | TPUv4×32 | TPUv4×32 | TPUv4×32 | TPUv4×32 | TPUv4×32 | CPU |
Table 1: Summary of compute resources for running experiments in this paper.
can point to any direction. The fact that holds (with high probability) is an example of the more general principle called “concentration of measure”: the value of a scalar function of “concentrates” to its expectation, because the random fluctuations of entries of can cancel out each other, much like in the Law of Large Numbers.
The validation loss is a scalar, quadratic function of . So if this quadratic function is similar to , by analogy to the above, the concentration of measure principle applies and should (with high probability) not depend on the random direction of . As a result, converges to a deterministic trajectory at the high-dimension limit .
However, in order for the “concentration of measure” to hold, the eigenvalues of the quadratic function cannot be too heavy-tailed. If there are some very large eigenvalues that cannot be counter-weighted by all the small ones, the value of will suddenly surge when randomly points toward directions of the large eigenvalues – a “spike” will occur.
We also note that, the learning-rate has to be relatively large so that can accumulate to a significant amount, for the training spikes to manifest. On the other hand, starts to grow larger and larger if the learning-rate is too high – which means the training diverges. The threshold of divergence can be accurately calculated for SGD, which is given in (2.2). One observes large training spikes when the learning-rate is slightly below . For general optimizers, one can use our simulation to find the threshold learning-rate, because Algorithm 3.1 faithfully models the accumulation of random gradient noise. For more technical details, please refer to Appendix A.5 and A.6.
- Simulation of Transformer LM Training. As a case-study, we train a vanilla Transformer decoder model of 1.3B parameters (24 Transformer blocks) on the C4 dataset, to the Chinchilla optimal number of tokens. We use the AdamW optimizer with hyperparameters inherited from previous research (Everett et al., 2024; Charles et al., 2025), which are tuned to near optimal. Then, we change of AdamW from 0.95 to 0.999 in order to produce training spikes. We obtain three training trajectories: Normal, Spiky1 and Spiky2, as illustrated in Figure 1. More details are given in § C.1.
We take the model checkpoints at step 21k, and run simulations for all three configurations. Optimizer states are initialized from model checkpoints, but we did not apply weight-decay during the simulation. Figure 3 shows the results of 6 feed-forward layers simulated (with 2 random seeds each) from step 21k to 22.5k. We see clear bumps in the simulation for both Spiky1 and Spiky2 (e.g., block_{0,4,8} at step ~22k for Spiky1, and block_{0,12} at step ~21.5k for Spiky2), while the simulation for Normal is comparatively more smooth. It suggests that our simulation has the predictive power of telling whether a training configuration can lead to spikes, from a given model checkpoint. It is noteworthy that in the actual training trajectory (Figure 1), only Spiky2 spikes between steps 21k and 22k; And the spiky positions in our simulations differ between random seeds, demonstrating the random nature of training spikes. In § C.2, we will also show that the distribution of eigenvalues of is significantly more heavy-tailed for spiky configurations.
On the other hand, we plot the 2nd-order term of (Definition 3.1), namely
from step 21k to 22k, in Figure 3 with a shifted origin but the same scale, in order to compare the largeness of fluctuations. We observe jumps in the 2nd-order terms from Spiky2 synchronized with the training spike, while the largeness of the jumps matches the fluctuation of simulations in some layers (e.g. block_{4,8,12}) if not all. One big difference between our simulation and the empirical measurement of the 2nd-order terms of , is that the 2nd-order terms of exhibit “jumps” rather than “spikes” (i.e., not resuming to the previous level after initial surge), which is also different from the behavior of the total validation loss as shown in Figure 1c. This suggests that the dynamics of the Taylor expansion may not be fully explained by layer-wise quadratic models, as it cannot fully explain the total validation loss either. One may need to consider correlations across layers, and Taylor expansions beyond 2nd order.
In addition, we plot the 1st order term of , namely
in Figure 4. We use the same scale of y-axis (from -4 to 1) across all layers, and we compare the three training configurations (Normal, Spiky1 and Spiky2).
We found that the behavior of the 1st-order terms cannot be directly explained by layer-wise quadratic models either: First, note that the scale of y-axis in Figure 4 is about the scale in Figure 3; the decrease of the 1st-order terms turns out to be much faster than one would expect from a layer-wise quadratic model – it seems that the highly non-linear nature of the DNN can somehow accelerate the feature-learning towards a loss-decreasing direction. On the other hand, the highly non-linear nature of the DNN must also produce larger noises than one would expect from a layer-wise quadratic model, because the overall validation loss of the DNN does not decrease this fast. Second, we observe that training spikes are reflected in the plots of 1st-order terms, as either “bumps” (block_12 of Spiky2), “jumps” (block_{8,16,20} of Spiky2), or “dives” (block_0 of Spiky2); but layer-wise quadratic models cannot exhibit similar behavior at this scale.
How we can explain these discrepancies, and how the correlations across layers and Taylor expansions beyond 2nd order may play a role in the mechanism, are intriguing questions for future work.
R. TIAN AND C. PAQUETTE



Figure 3: Simulation of the layer-wise quadratic approximation of validation loss at 6 layers (the feed-forward input of block_{0,4,8,12,16,20}), from training step 21k to 22.5k. We compare 3 settings of training (Normal, Spiky1 and Spiky2) as in Figure 1, and plot two simulations of different seeds, together with the actual 2nd-order term measured from corresponding training trajectories. The scale of the y-axis is kept the same for all plots, so that the fluctuations can be compared.



Figure 4: Plots of the 1st-order term of .
R. TIAN AND C. PAQUETTE
- Discussion and Related Works. Theoretical analysis of training spikes in most of previous works has focused on the concept of sharpness, defined as the largest eigenvalue of the Hessian. But the truth is, none of them has been able to create toy models with loss dynamics, that can match aesthetically the phenomenon we empirically documented as “training spikes”, such as in Figure 1a. Some works show fluctuations with a log-scale in y-axis (which will amplify the largeness of the fluctuations in appearance), and try to connect them with training spikes – I’m sorry, but they are not similar.
Thus, we first want to emphasize the significance of our examples in PLRF models, solely from an aesthetics perspective: Please note the similarity of spikes between Figure 1a and Figure 2, and the fact that neither of them has log-scales in y-axis. We provide Python code of the PLRF examples in supplementary materials, which can run on Google Colab within 2 minutes. Please just try it.
In order to analyze the behavior of PLRF models under stochastic optimization, one has to investigate the gradient noise – a factor that does not exist in full-batch training and has been largely overlooked in previous theoretical study of training spikes. In practice, although recent LMs are trained with large numbers of tokens per batch, we especially investigated the equivalent batch factor in this paper and found that the gradient noise in training a Transformer LM is comparable to a Random Feature model with batch-size ( C.4). This is because the point-wise training loss of DNNs can increase gradient noise ( A.3) – an effect specific to DNNs that can cancel the large batch-size. In short, one cannot ignore gradient noise for training a Transformer LM.
As a result, the sharpness is only distantly relevant to training dynamics of stochastic optimization. What really matters is the distribution of all eigenvalues – That said, we would like to discuss several streams of previous works next, which have contributed to our understanding of training spikes, as well as the more general topic of training process of DNNs.
Feature Learning and Sharpness. The Hessian is ever changing during the training of DNNs – a fact that cannot be captured by quadratic models like PLRF. Understanding how the Hessian evolves, which we call “feature learning”, is an important topic to understand deep learning. It is reported by Jastrzebski et al. (2019); Cohen et al. (2021, 2022) that during the training of DNNs, the sharpness is increasing until it meets the threshold (where is the learning-rate); And when decreases, increases further. This process, called “progressive sharpening”, can be affected by several optimization hyperparameters (Gilmer et al., 2022), and it is connected to training spikes through Adam preconditioner (Bai et al., 2026), the “lower-loss-as-sharper structure” and condensation of model weights (Li et al., 2026). The phase where learning-rate is set to larger than , called “catapult” (Lewkowycz et al., 2020), is directly connected to training spikes as well (Zhu et al., 2024). When the learning-rate temporarily exceeds , Damian et al. (2023); Cohen et al. (2025) show that a 3rd-order term will automatically stabilize the sharpness and prevent it from increasing further – the so-called “Edge-of-Stability”. We believe the insights regarding 3rd-order terms can be valuable in stochastic optimization as well: As we discussed in § 4 and § ??, both the simulation and empirical measurement of layer-wise quadratic loss cannot fully explain the scale of spikes observed in the total validation loss; the random fluctuations driven by gradient noises in quadratic forms may get amplified and stabilized by higher-order terms.
Spectrum Analysis of Hessian and Model Weights. Beyond the largest eigenvalue , our empirical measurement of the whole spectrum of the layer-wise Hessian (especially the trace of the Hessian) is largely inspired by Ghorbani et al. (2019). Unfortunately, the computation conducted in Ghorbani et al. (2019) becomes infeasible for the model size of recent LMs; In this work, we take a shortcut by sticking to the layer-wise Hessian instead of the Hessian of the whole model, and we make Assumption 3.6 to largely reduce the computation to Hessian trace and eigen decomposition of correlation matrices of forward activations. Nevertheless, we note that Ghorbani et al. (2019) observed heavy-tailed distribution of eigenvalues similar to what we observe in Figure 7. From another perspective, Martin and Mahoney (2021) investigated the spectrum of model weights, and recently the spectrum of gradients and moments become a topic of great interest (Fan et al., 2025; Chen et al., 2026), thanks to the popularity of Muon optimizer (Jordan et al., 2024). Our work is not directly connected to this stream because we simulate an average slice of the model weight, rather than the whole matrix. Based on the observation by Martin and Mahoney (2021) that the spectrum of model weights gets more heavy-tailed during training, we initially expected the same for Hessian; However, we found that although the Hessian trace is increasing (Figure 12 Third Row, in § C.5), the exponent of the power-law fit is actually slightly decreasing for Normal training (Figure 8, in § C.2). Still, optimization hyperparameters such as of Adam clearly affect the distribution of eigenvalues of Hessian; how to understand its mechanism remains a largely open problem.
Scaling Statistics of Language Universals. It is not a coincidence that the eigenvalues of correlation matrices of forward activations of an LM are power-law distributed, because natural language data generally follow power-law distributions like Zipf's Law (Zipf, 1949). In fact, if we view the input embedding layer of a Transformer LM as a linear map from one-hot vectors to token embeddings, the correlation matrix of the inputs is where is the unigram probability of the i-th token. So the distribution of the eigenvalues of is exactly Zipf's Law, and the power-law exponent is exactly in terms of the definition of in PLRF ( 2). Scaling statistics of language universals have long been studied (Tanaka-Ishii, 2021), and we believe they are generally behind various neural scaling laws for training LLMs (Bahri et al., 2024).
Double Descent. The idea of distinguishing data-oriented and model-oriented randomness, as we did for training spikes, has also appeared in the explanation of Double Descent by Random Feature models (Adlam and Pennington, 2020). From a very general point of view, this is not a coincidence because Double Descent can be seen as some kind of “spikes” as well. Indeed, Nakkiran et al. (2020) has coined the term “epoch-wise double descent” and used the concept to explain temporary increase of validation loss at training time.
The of Adam Optimizer. It has been widely known to practitioners that setting close to 1 can cause training spikes in Transformer LMs (e.g. Liu et al., 2019). Molybog et al. (2023) and Bai et al. (2026) specifically build their theory of training spikes upon this observation. In this paper, we also propose our recipe for choosing the appropriate schedule ( C.5), and we show it improves performance in our case. The observation that an increasing schedule of can improve performance has been reported before (e.g. Reddi et al., 2018; Shazeer and Stern, 2018; Dremov et al., 2025; Ferbach et al., 2026). In practice, however, model performance and the occurrence of training spikes are affected by a large number of other factors as well. Nevertheless, the exact mechanism of how can affect the training dynamics
R. TIAN AND C. PAQUETTE
in such a seemingly drastic way, especially how it affects the distribution of eigenvalues of the Hessian, is a curious mystery.
Optimization and Modeling Techniques to Improve Training Stability. A huge amount of modeling and optimization techniques, such as normalization (Ioffe and Szegedy, 2015; Ba et al., 2016; Xiong et al., 2020; Dehghani et al., 2023; Wortsman et al., 2024) and clipping (Pascanu et al., 2013; Wortsman et al., 2023; Zhang et al., 2020; Marshall et al., 2024), inter alia, have been proposed to improve the training stability of DNNs. From the perspective of (avoiding) training spikes, our theory suggests essential metrics, such as the power-law exponent of the distribution of eigenvalues of the correlation matrices of forward activations, to be monitored as an indicator of healthy training. Our lightweight simulation algorithm can be applied directly to testing optimization techniques as well. That said, the empirical recipes explored in this work such as schedule, are intended as “proof of concept” for the theory, rather than alternatives to replace previous methods.
Gradient Noise and Average-case Analysis. Even a simple model like PLRF can exhibit complicated dynamics such as training spikes. We urge the community to move from analyzing full-batch gradient descent and worst-case bounds, to the more realistic and challenging settings of stochastic optimization and average-case behavior of DNN training, with heavy-tailed input data and scaling-up of model sizes. Towards this direction, Mandt et al. (2016); Li et al. (2019) have developed stochastic differential equations to capture the training dynamics of SGD, which assume that the gradient noise is Gaussian (or more precisely, Brownian motion since the process is continuous), as similar to what we do for the simulation. What's different in this work is that the variance of gradient noise can be explicitly calculated for Random Feature models (i.e., Prediction 3.5), and we use that calculation instead of assuming the variance is a given constant (it's not constant, even for Random Feature models). On a different note, Agarwala and Pennington (2025) has coined the term "stochastic edge-of-stability", to emphasize the difference in learning-rate thresholds between full-batch gradient descent and SGD. In Qiu et al. (2025), it is shown that the gradient noise is a major factor controlled by learning-rate schedules, that can shape universally similar loss trajectories across model scales.
- Conclusion. We have seen PLRF models exhibiting training spikes, and presented the theory, algorithm and experiments to align PLRF models with layerwise training dynamics of DNNs. Given the apparent similarity between empirical training spikes and our simulations, we believe quadratic models at least partially reveals the essence of underlying mechanism.
AI Use Statement. We have not used generative AI tools for developing theory, formulating mathematical claims, designing experiments, or implementing methods. This is completely human work. During the writing of this paper, we have consulted AI for rephrasing some paragraphs of the draft, and summarizing some related papers; we have checked the outputs and manually rewrote the text. We take responsibility for the final content of this work, including text, claims, mathematical proofs and code.
Reproducibility Statement. Our experiments with PLRF models are easy to reproduce; we provide the Python code for training spikes and the simulation in supplementary materials. Our Transformer LM experiments are based on a decoder-only Transformer with common components. All the hyperparameters are listed in § C.1, where we also describe how they were tuned. The training dynamics we present in this paper depends on the hyperparameters, especially the learning-rate schedule and weight-decay; But the phenomena we observe should be general across different modeling choices. For mathematical details of our theory, please refer to Appendix A.
Acknowledgment. We thank Vincent Roulet for contributing to the ideas of how to calculate per-example gradient norms and Hessian trace, and providing internal reviews on drafts of this paper. We thank Asma Ghandeharioun for applying and verifying some findings of this paper to Gemma models. Asma Ghandeharioun uses generative AI tools to manage, implement and analyze her experiments, but she is not directly involved in this work. We thank Justin Gilmer for pointing us to several highly related previous works. We thank Lechao Xiao for providing the hyperparameters of Transformer LMs, including the configuration of training spikes. We thank Jeffrey Pennington for helpful discussion, and contributing to the ideas of distinguishing data-oriented and model-oriented randomness, and quantitatively measuring training spikes.
C. Paquette is a Canadian Institute for Advanced Research (CIFAR) AI chair, Quebec AI Institute (Mila) and a Sloan Research Fellow in Computer Science (2024). C. Paquette is supported by a Discovery Grant from the Natural Science and Engineering Research Council (NSERC) of Canada, NSERC CREATE grant Interdisciplinary Math and Artificial Intelligence Program (INTER-MATH-AI), Google x Mila research grant, Fonds de recherche du Quebec Nature et technologies (FRQNT) NOVA Grant (DOI: https://doi.org/10.69777/363444), and CIFAR AI Catalyst Grant. C. Paquette has 20% part-time employment at Google DeepMind.
References
Ben Adlam and Jeffrey Pennington. Understanding double descent requires a fine-grained bias-variance decomposition. In Proceedings of the 34th International Conference on Neural Information Processing Systems, NIPS '20, Red Hook, NY, USA, 2020. Curran Associates Inc. ISBN 9781713829546.
Atish Agarwala and Jeffrey Pennington. High dimensional analysis reveals conservative sharpening and a stochastic edge of stability, 2025. URL https://arxiv.org/abs/2404.19261.
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E. Hinton. Layer normalization, 2016. URL https://arxiv.org/abs/1607.06450.
Yasaman Bahri, Ethan Dyer, Jared Kaplan, Jaehoon Lee, and Utkarsh Sharma. Explaining neural scaling laws. Proceedings of the National Academy of Sciences, 121(27):e2311878121, 2024. doi: 10.1073/pnas.2311878121. URL https://www.pnas.org/doi/abs/10.1073/pnas.2311878121.
Zhiwei Bai, Zhangchen Zhou, Jiajie Zhao, Xiaolong Li, Zhiyu Li, Feiyu Xiong, Hongkang Yang, Yaoyu Zhang, and Zhi-Qin John Xu. Adaptive preconditioners trigger loss spikes in adam. In Forty-third International Conference on Machine Learning, 2026. URL https://openreview.net/forum?id=STWQoscanw.
Blake Bordelon, Alexander B. Atanasov, and Cengiz Pehlevan. A dynamical model of neural scaling laws. In Ruslan Salakhutdinov, Zico Kolter, Katherine A. Heller, Adrian Weller, Nuria Oliver, Jonathan Scarlett, and Felix Berkenkamp, editors, Forty-first International Conference on Machine Learning, ICML 2024, Vienna, Austria, July 21-27, 2024, volume 235
R. TIAN AND C. PAQUETTE
of Proceedings of Machine Learning Research, pages 4345–4382. PMLR / OpenReview.net, 2024. URL https://proceedings.mlr.press/v235/bordelon24a.html.
Zachary Charles, Gabriel Teston, Lucio M. Dery, Keith Rush, Nova Fallen, Zachary Garrett, Arthur Szlam, and Arthur Douillard. Communication-efficient language model training scales reliably and robustly: Scaling laws for diloco. CoRR, abs/2503.09799, 2025. doi:10.48550/ARXIV.2503.09799. URL https://doi.org/10.48550/arXiv.2503.09799.
Lizhang Chen, Jonathan Li, and Qiang Liu. Muon optimizes under spectral norm constraints. Transactions on Machine Learning Research, 2026. ISSN 2835-8856. URL https://openreview.net/forum?id=Blz4hjxLwU.
Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, Parker Schuh, Kensen Shi, Sasha Tsvyashchenko, Joshua Maynez, Abhishek Rao, Parker Barnes, Yi Tay, Noam Shazeer, Vinodkumar Prabhakaran, Emily Reif, Nan Du, Ben Hutchinson, Reiner Pope, James Bradbury, Jacob Austin, Michael Isard, Guy Gur-Ari, Pengcheng Yin, Toju Duke, Anselm Levskaya, Sanjay Ghemawat, Sunipa Dev, Henryk Michalewski, Xavier Garcia, Vedant Misra, Kevin Robinson, Liam Fedus, Denny Zhou, Daphne Ippolito, David Luan, Hyeontaek Lim, Barret Zoph, Alexander Spiridonov, Ryan Sepassi, David Dohan, Shivani Agrawal, Mark Omernick, Andrew M. Dai, Thanumalayan Sankaranarayana Pillai, Marie Pellat, Aitor Lewkowycz, Erica Moreira, Rewon Child, Oleksandr Polozov, Katherine Lee, Zongwei Zhou, Xuezhi Wang, Brennan Saeta, Mark Diaz, Orhan Firat, Michele Catasta, Jason Wei, Kathy Meier-Hellstern, Douglas Eck, Jeff Dean, Slav Petrov, and Noah Fiedel. Palm: Scaling language modeling with pathways. J. Mach. Learn. Res., 24:240:1–240:113, 2023. URL https://jmlr.org/papers/v24/22-1144.html.
Aaron Clauset, Cosma Rohilla Shalizi, and M. E. J. Newman. Power-law distributions in empirical data. SIAM Review, 51(4):661–703, 2009. doi: 10.1137/070710111. URL https://doi.org/10.1137/070710111.
Jeremy Cohen, Simran Kaur, Yuanzhi Li, J. Zico Kolter, and Ameet Talwalkar. Gradient descent on neural networks typically occurs at the edge of stability. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL https://openreview.net/forum?id=jh-rTtvkGeM.
Jeremy Cohen, Behrooz Ghorbani, Shankar Krishnan, Naman Agarwal, Sourabh Medapati, Michal Badura, Daniel Suo, David Cardoze, Zachary Nado, George E. Dahl, and Justin Gilmer. Adaptive gradient methods at the edge of stability. CoRR, abs/2207.14484, 2022. doi: 10.48550/ARXIV.2207.14484. URL https://doi.org/10.48550/arXiv.2207.14484.
Jeremy Cohen, Alex Damian, Ameet Talwalkar, J. Zico Kolter, and Jason D. Lee. Understanding optimization in deep learning with central flows. In The Thirteenth International Conference on Learning Representations, ICLR 2025, Singapore, April 24-28, 2025. OpenReview.net, 2025. URL https://openreview.net/forum?id=sIE2rI3ZPs.
Alex Damian, Eshaan Nichani, and Jason D. Lee. Self-stabilization: The implicit bias of gradient descent at the edge of stability. In The Eleventh International Conference on Learning Representations, ICLR 2023, Kigali, Rwanda, May 1-5, 2023. OpenReview.net, 2023. URL https://openreview.net/forum?id=nhKHA59gXz.
Mostafa Dehghani, Josip Djolonga, Basil Mustafa, Piotr Padlewski, Jonathan Heek, Justin Gilmer, Andreas Peter Steiner, Mathilde Caron, Robert Geirhos, Ibrahim Alabdulmohsin,
Rodolphe Jenatton, Lucas Beyer, Michael Tschannen, Anurag Arnab, Xiao Wang, Carlos Riquelme Ruiz, Matthias Minderer, Joan Puigcerver, Utku Evci, Manoj Kumar, Sjoerd Van Steenkiste, Gamaleldin Fathy Elsayed, Aravindh Mahendran, Fisher Yu, Avital Oliver, Fantine Huot, Jasmijn Bastings, Mark Collier, Alexey A. Gritsenko, Vighnesh Birodkar, Cristina Nader Vasconcelos, Yi Tay, Thomas Mensink, Alexander Kolesnikov, Filip Pavetic, Dustin Tran, Thomas Kipf, Mario Lucic, Xiaohua Zhai, Daniel Keysers, Jeremiah J. Harmsen, and Neil Houlsby. Scaling vision transformers to 22 billion parameters. In Andreas Krause, Emma Brunskill, Kyunghyun Cho, Barbara Engelhardt, Sivan Sabato, and Jonathan Scarlett, editors, Proceedings of the 40th International Conference on Machine Learning, volume 202 of Proceedings of Machine Learning Research, pages 7480–7512. PMLR, 23–29 Jul 2023. URL https://proceedings.mlr.press/v202/dehghani23a.html.
Aleksandr Dremov, Alexander Hägele, Atli Kosson, and Martin Jaggi. Training dynamics of the cooldown stage in warmup-stable-decay learning rate scheduler. Transactions on Machine Learning Research, 2025. ISSN 2835-8856. URL https://openreview.net/forum?id=ZnSYEcZod3.
Katie E. Everett, Lechao Xiao, Mitchell Wortsman, Alexander A. Alemi, Roman Novak, Peter J. Liu, Izzeddin Gur, Jascha Sohl-Dickstein, Leslie Pack Kaelbling, Jaehoon Lee, and Jeffrey Pennington. Scaling exponents across parameterizations and optimizers. In Ruslan Salakhutdinov, Zico Kolter, Katherine A. Heller, Adrian Weller, Nuria Oliver, Jonathan Scarlett, and Felix Berkenkamp, editors, Forty-first International Conference on Machine Learning, ICML 2024, Vienna, Austria, July 21-27, 2024, volume 235 of Proceedings of Machine Learning Research, pages 12666–12700. PMLR / OpenReview.net, 2024. URL https://proceedings.mlr.press/v235/everett24a.html.
Chen Fan, Mark Schmidt, and Christos Thrampoulidis. Implicit bias of spectral descent and muon on multiclass separable data. In The Thirty-ninth Annual Conference on Neural Information Processing Systems, 2025. URL https://openreview.net/forum?id=Zn2ajV1kTQ.
Damien Ferbach, Katie Everett, Gauthier Gidel, Elliot Paquette, and Courtney Paquette. Dimension-adapted momentum outscales SGD. In The Thirty-ninth Annual Conference on Neural Information Processing Systems, 2025. URL https://openreview.net/forum?id=t4aN2G7Ucc.
Damien Ferbach, Courtney Paquette, Gauthier Gidel, Katie Everett, and Elliot Paquette. Logarithmic-time schedules for scaling language models with momentum, 2026. URL https://arxiv.org/abs/2602.05298.
Behrooz Ghorbani, Shankar Krishnan, and Ying Xiao. An investigation into neural net optimization via hessian eigenvalue density. In Kamalika Chaudhuri and Ruslan Salakhutdinov, editors, Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pages 2232–2241. PMLR, 09–15 Jun 2019. URL https://proceedings.mlr.press/v97/ghorbani19b.html.
Justin Gilmer, Behrooz Ghorbani, Ankush Garg, Sneha Kudugunta, Behnam Neyshabur, David Cardoze, George Edward Dahl, Zachary Nado, and Orhan Firat. A loss curvature perspective on training instabilities of deep learning models. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum?id=OcKMT-36vUs.
Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, Elena Buchatskaya, Trevor Cai, Eliza Rutherford, Diego de Las Casas, Lisa Anne Hendricks, Johannes Welbl, Aidan Clark,
R. TIAN AND C. PAQUETTE
Tom Hennigan, Eric Noland, Katie Millican, George van den Driessche, Bogdan Damoc, Aurelia Guy, Simon Osindero, Karen Simonyan, Erich Elsen, Jack W. Rae, Oriol Vinyals, and Laurent Sifre. Training compute-optimal large language models, 2022. URL https://arxiv.org/abs/2203.15556.
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Francis Bach and David Blei, editors, Proceedings of the 32nd International Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pages 448–456, Lille, France, 07–09 Jul 2015. PMLR. URL https://proceedings.mlr.press/v37/ioffe15.html.
Arthur Jacot, Clément Hongler, and Franck Gabriel. Neural tangent kernel: Convergence and generalization in neural networks. In Samy Bengio, Hanna M. Wallach, Hugo Larochelle, Kristen Grauman, Nicolò Cesa-Bianchi, and Roman Garnett, editors, Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montréal, Canada, pages 8580–8589, 2018. URL https://proceedings.neurips.cc/paper/2018/hash/5a4be1fa34e62bb8a6ec6b91d2462f5a-Abstract.html.
Stanislaw Jastrzebski, Zachary Kenton, Nicolas Ballas, Asja Fischer, Yoshua Bengio, and Almost Storkey. On the relation between the sharpest directions of DNN loss and the SGD step length. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=SkgEaj05t7.
Keller Jordan, Yuchen Jin, Vlado Boza, Jiacheng You, Franz Cesista, Laker Newhouse, and Jeremy Bernstein. Muon: An optimizer for hidden layers in neural networks, 2024. URL https://kellerjordan.github.io/posts/muon/.
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015.
Jaehoon Lee, Lechao Xiao, Samuel S. Schoenholz, Yasaman Bahri, Roman Novak, Jascha Sohl-Dickstein, and Jeffrey Pennington. Wide neural networks of any depth evolve as linear models under gradient descent. In Hanna M. Wallach, Hugo Larochelle, Alina Beygelzimer, Florence d'Alché-Buc, Emily B. Fox, and Roman Garnett, editors, Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pages 8570–8581, 2019. URL https://proceedings.neurips.cc/paper/2019/hash/0d1a9651497a38d8b1c3871c84528bd4-Abstract.html.
Aitor Lewkowycz, Yasaman Bahri, Ethan Dyer, Jascha Sohl-Dickstein, and Guy Gur-Ari. The large learning rate phase of deep learning: the catapult mechanism, 2020. URL https://arxiv.org/abs/2003.02218.
Qianxiao Li, Cheng Tai, and E. Weinan. Stochastic modified equations and dynamics of stochastic gradient algorithms i: mathematical foundations. J. Mach. Learn. Res., 20(1):1474–1520, January 2019. ISSN 1532-4435.
Xiaolong Li, Zhi-Qin John Xu, and Zhongwang Zhang. Loss spike in training neural networks. Journal of Computational Mathematics, 44(2):369–393, 2026. doi: 10.4208/jcm.2412-m2024-0083. URL https://doi.org/10.4208/jcm.2412-m2024-0083.
Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. Roberta: A robustly optimized bert pretraining approach, 2019. URL https://arxiv.org/abs/1907.11692.
Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=Bkg6RiCqY7.
Alexander Maloney, Daniel A. Roberts, and James Sully. A solvable model of neural scaling laws. CoRR, abs/2210.16859, 2022. doi: 10.48550/ARXIV.2210.16859. URL https://doi.org/10.48550/arXiv.2210.16859.
Stephan Mandt, Matthew Hoffman, and David Blei. A variational analysis of stochastic gradient algorithms. In Maria Florina Balcan and Kilian Q. Weinberger, editors, Proceedings of The 33rd International Conference on Machine Learning, volume 48 of Proceedings of Machine Learning Research, pages 354–363, New York, New York, USA, 20–22 Jun 2016. PMLR. URL https://proceedings.mlr.press/v48/mandt16.html.
Noah Marshall, Ke Liang Xiao, Atish Agarwala, and Elliot Paquette. To clip or not to clip: the dynamics of sgd with gradient clipping in high-dimensions, 2024. URL https://arxiv.org/abs/2406.11733.
Charles H. Martin and Michael W. Mahoney. Implicit self-regularization in deep neural networks: Evidence from random matrix theory and implications for learning. Journal of Machine Learning Research, 22(165):1–73, 2021. URL http://jmlr.org/papers/v22/20-410.html.
Igor Molybog, Peter Albert, Moya Chen, Zachary DeVito, David Esiobu, Naman Goyal, Punit Singh Koura, Sharan Narang, Andrew Poulton, Ruan Silva, Binh Tang, Diana Liskovich, Puxin Xu, Yuchen Zhang, Melanie Kambadur, Stephen Roller, and Susan Zhang. A theory on adam instability in large-scale machine learning. CoRR, abs/2304.09871, 2023. doi: 10.48550/ARXIV.2304.09871. URL https://doi.org/10.48550/arXiv.2304.09871.
Preetum Nakkiran, Gal Kaplun, Yamini Bansal, Tristan Yang, Boaz Barak, and Ilya Sutskever. Deep double descent: Where bigger models and more data hurt. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=B1g5sA4twr.
Kosuke Nishida, Kyosuke Nishida, and Kuniko Saito. Initialization of large language models via reparameterization to mitigate loss spikes. In Yaser Al-Onaizan, Mohit Bansal, and Yun-Nung Chen, editors, Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing, pages 22699–22714, Miami, Florida, USA, November 2024. Association for Computational Linguistics. doi: 10.18653/v1/2024.emnlp-main.1264. URL https://aclanthology.org/2024.emnlp-main.1264/.
Courtney Paquette, Kiwon Lee, Fabian Pedregosa, and Elliot Paquette. SGD in the large: Average-case analysis, asymptotics, and stepsize criticality. In Mikhail Belkin and Samory Kpotufe, editors, Conference on Learning Theory, COLT 2021, 15-19 August 2021, Boulder, Colorado, USA, volume 134 of Proceedings of Machine Learning Research, pages 3548–3626. PMLR, 2021. URL http://proceedings.mlr.press/v134/paquette21a.html.
Elliot Paquette, Courtney Paquette, Lechao Xiao, and Jeffrey Pennington. 4+3 phases of compute-optimal neural scaling laws. In Amir Globersons, Lester Mackey, Danielle Belgrave, Angela Fan, Ulrich Paquet, Jakub M. Tomczak, and Cheng Zhang, editors, Advances in Neural Information Processing Systems 37: Annual Conference on Neural Information Processing Systems 2024, NeurIPS 2024, Vancouver, BC, Canada, December 10 - 15, 2024, 2024. URL http://papers.nips.cc/paper_files/paper/2024/hash/1dccfc3ee01871d05e33457c61037d59-Abstract-Conference.html.
R. TIAN AND C. PAQUETTE
Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio. On the difficulty of training recurrent neural networks. In Sanjoy Dasgupta and David McAllester, editors, Proceedings of the 30th International Conference on Machine Learning, Proceedings of Machine Learning Research, pages 1310–1318, Atlanta, Georgia, USA, 17–19 Jun 2013. PMLR. URL https://proceedings.mlr.press/v28/pascanu13.html.
Shikai Qiu, Lechao Xiao, Andrew Gordon Wilson, Jeffrey Pennington, and Atish Agarwala. Scaling collapse reveals universal dynamics in compute-optimally trained neural networks. In Forty-second International Conference on Machine Learning, 2025. URL https://openreview.net/forum?id=Fvq9ogLnLN.
Sashank J. Reddi, Satyen Kale, and Sanjiv Kumar. On the convergence of adam and beyond. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=ryQu7f-RZ.
Noam Shazeer and Mitchell Stern. Adafactor: Adaptive learning rates with sublinear memory cost. In Jennifer Dy and Andreas Krause, editors, Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pages 4596–4604. PMLR, 10–15 Jul 2018. URL https://proceedings.mlr.press/v80/shazeer18a.html.
Jianlin Su, Muradha H. M. Ahmed, Yu Lu, Shengfeng Pan, Wen Bo, and Yunfeng Liu. Roformer: Enhanced transformer with rotary position embedding. Neurocomputing, 568:127063, 2024. doi: 10.1016/J.NEUCOM.2023.127063. URL https://doi.org/10.1016/j.neucom.2023.127063.
Sho Takase, Shun Kiyono, Sosuke Kobayashi, and Jun Suzuki. Spike no more: Stabilizing the pre-training of large language models. In Second Conference on Language Modeling, 2025. URL https://openreview.net/forum?id=52YBEzcI0l.
Kumiko Tanaka-Ishii. Statistical Universals of Language: Mathematical Chance vs. Human Choice. Springer, Switzerland, 2021. ISBN 978-3-030-59376-6. doi: 10.1007/978-3-030-59377-3.
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In I. Guyon, U. Von Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017. URL https://proceedings.neurips.cc/paper_files/paper/2017/file/3f5ee243547dee91fbd053c1c4a845aa-Paper.pdf.
Mitchell Wortsman, Tim Dettmers, Luke Zettlemoyer, Ari S. Morcos, Ali Farhadi, and Ludwig Schmidt. Stable and low-precision training for large-scale vision-language models. In Thirty-seventh Conference on Neural Information Processing Systems, 2023. URL https://openreview.net/forum?id=sqqASmpA2R.
Mitchell Wortsman, Peter J Liu, Lechao Xiao, Katie E Everett, Alexander A Alemi, Ben Adlam, John D Co-Reyes, Izzeddin Gur, Abhishek Kumar, Roman Novak, Jeffrey Pennington, Jascha Sohl-Dickstein, Kelvin Xu, Jaehoon Lee, Justin Gilmer, and Simon Kornblith. Small-scale proxies for large-scale transformer training instabilities. In The Twelfth International Conference on Learning Representations, 2024. URL https://openreview.net/forum?id=d8w0pmvXbZ.
Ruibin Xiong, Yunchang Yang, Di He, Kai Zheng, Shuxin Zheng, Chen Xing, Huishuai Zhang, Yanyan Lan, Liwei Wang, and Tie-Yan Liu. On layer normalization in the transformer architecture, 2020. URL https://arxiv.org/abs/2002.04745.
Jingzhao Zhang, Tianxing He, Suvrit Sra, and Ali Jadbabaie. Why gradient clipping accelerates training: A theoretical justification for adaptivity. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=BJgnXpVYwS.
Libin Zhu, Chaoyue Liu, Adityanarayanan Radhakrishnan, and Mikhail Belkin. Catapults in sgd: spikes in the training loss and their impact on generalization through feature learning, 2024. URL https://arxiv.org/abs/2306.04815.
George Kingsley Zipf. Human Behavior and the Principle of Least Effort: An Introduction to Human Ecology. Addison-Wesley Press, Cambridge, MA, 1949.
R. TIAN AND C. PAQUETTE
where is used to denote transpose. Under this convention, the 1st-order Taylor expansion can be written as
Also in this paper, an input data point to DNNs is exclusively denoted by , and considered as having no internal structure (i.e., can be anything, not necessarily a tensor). And we assume that the training and validation datasets are both finite, and drawn from the same distribution .
A.1. Proof of Theorem 3.3. Technically, we prove Theorem 3.3 by taking Taylor expansions of the DNN. The “difficulty” is that Taylor expansions can only be taken for the point-wise loss , for a given data point ; While the Random Feature model requires a universal constant matrix . Our proof shows that this is still possible, by “concatenating” all the data points in the training set into a huge linear map, exploiting the high dimensionality V of the latent space.
Proof of Theorem 3.3. For , since the Jacobian matrix depends on but does not depend on , we can construct a matrix by concatenating the (on axis 1) for all training examples , and a vector by padding the flattened vector with zeros, to obtain
where does not depend on or . Then, we define by further concatenating with an identity matrix (on axis 1), and by concatenating with , so that has the 1st-order Taylor expansion
as required.
For (b), recall from the previous paragraph that we have , and is contained in , so we can write
where is padded with zeros (on axis 1), such that .
Without changing the calculation so far, we can further modify by concatenating . Then, since both and are matrices that depend on but do not depend on , we concatenate them (on axis 1) for all training examples and define
where is the concatenation of , and the concatenation of . The denotes concatenation of matrices on axis 0, with training-examples, and denotes the Jacobian matrix padded with zeros, for the -th training example . (Such that, for in the previous paragraph). The matrices , , and do not depend on or , while the construction of implies
Finally, we can modify by concatenating with , and define by concatenating with an identity matrix (on axis 1) to absorb the constant term, and obtain
such that the 1st-order Taylor expansion of is given by . By construction, is an affine function of .
A.2. Proof of Prediction 3.5. We have where the entries of are i.i.d. Gaussian of mean 0 and variance 1, by Assumption 3.4. So
Therefore, the eigen decomposition of comes from the singular value decomposition
where is the entry-wise square-root of , and is a matrix with orthonormal columns.
Now, is the -th column vector of the matrix
So
(A.1)
where is the -th entry of and is the -th unit vector ( ).
On the other hand, we have so
(A.2)
Thus, Prediction 3.5 follows by combining the following lemma with (A.1) and (A.2).
R. TIAN AND C. PAQUETTE
Lemma A.1. Assume V is “general enough”. Then, we have
at the limit. Here, is the Kronecker delta and is the identity matrix.
Proof. The -entry of the matrix is a linear combination of random variables of the form
where are entries of x. Now recall Wick's formula (Isserlis's theorem), which implies that in order to have
there are only three possibilities:
When restricted to Case 1, only the diagonal entries (such that ) in are nonzero, and they equal to which is because the column vectors of are orthonormal. So this case results in a term.
For both Cases 2 and 3, they result in terms of the form , which are projectors that map any V-dimensional vector into a 1-dimensional subspace (i.e., ) of the D-dimensional space spanned by the column vectors of . When is “general enough”, this is like a random orthogonal projection from a D-dimensional space onto its 1-dimensional subspace; So “on average” these terms are of the magnitude , which become negligible compared to when D is sufficiently large.
Rigorously, this “general enough” argument can be conveyed by assuming a Haar measure over the space of V and bounds the error with “overwhelming probability”, as similar to Paquette et al. (2021, Appendix C).
Although our proof of Lemma A.1 relies on specifics of the Gaussian distribution (such as Wick's formula), the conclusion on high dimension limit is likely to hold for other random vectors (asymptotically) of mean 0 and variance 1.
A.3. Equivalent Batch Factor. In this section, we discuss how to apply Prediction 3.5 to the calculation of 2nd moment of mini-batched gradients of DNNs.
For stochastic training with batch-size B, we use to denote the per-batch gradient. Then, instead of (A.1), we have
(A.3)
where is the -th column vector of the matrix , and the -th data point in a batch. Note the normalization factor which is to make . We can generalize Lemma A.1 to this mini-batched setting, as below.
Lemma A.2. Assume V is “general enough”, and . Then, we have
at the limit. Here, is the Kronecker delta and is the identity matrix.
Proof. The proof is mostly similar to Lemma A.1, except that for Case 3, we have many terms of the form , due to cross-interaction inside the batch. Therefore, an additional condition is required to ensure that the batch-size is not too large, so that Case 3 is still negligible.
Therefore, we can calculate
(A.4)
as long as the batch-size B is not too large (B ⇔ √D). This formula is compatible with the intuition that increasing the batch-size will decrease gradient noise.
Now, regarding , for Random Feature models where is a scalar we have
hence
which is a multiple of the validation loss.
However, the above simplification does not hold for DNNs in general. Even if we use Assumption 3.6 to reduce to a scalar, the point-wise loss of DNNs is of the form
(A.5)
Especially, the coefficient c in (A.5) is different across data points r.
Nevertheless, in our simulation we estimate as an average of , such that the Hessian trace of the layer-wise quadratic loss matches the empirical measurement . And we still assume that is a multiple of , as a rough approximation. But the coefficient of that multiple needs to be empirically measured, and it would be much larger than 1 (as in contrast to the case of Random Feature models) because is usually much larger than . In this work, we absorb this multiple into a “batch-size factor”, because it affects the norm of per-batch gradients as similar to a batch-size.
In practice, we do not directly measure either, because the measurement of the Hessian tensor is costly if not infeasible. Instead, we have by definition, and is directly measurable. So it is favorable if can be approximated by .
Recall that is a quadratic function of w which can be decomposed into eigenmodes. Let
R. TIAN AND C. PAQUETTE
be the eigen decomposition, where and are representations of and under the eigen basis, respectively. Then, we have
Thus, the following quantity
(A.6)
would be an easy-to-measure approximation for . This approximation should work well if either of the conditions below is satisfied:
(1) For most i, values of are approximately of the same magnitude;
(2) Or, the values of are “random enough”, the distribution of not too heavy-tailed, and D sufficiently large.
To summarize, we have assumed that is a multiple of , and propose to use (A.6) as an approximation for . Combining this with (A.4) and Prediction 3.5, we predict
(A.7)
where is empirically measured as
(A.8)
We call the equivalent batch factor, because it should coincide with the batch-size B for Random Feature models.
A.4. Detailed Derivation of Algorithm 3.1. We track the vector where , with and being the representations of and under the eigen basis, respectively. Since
the sign of each does not matter – our simulation only depends on the absolute value . Initially, is set to match the Root Mean Square (RMS) of the gradient :
• The coordinates of are changed to the eigen basis by ;
- The shape of is ; We reduce the -dimensional output axis by taking ;
• The -th entry of RMS(, axis = 0) should be the same as
in order to match the gradient at each eigenmode.
• Therefore, we set
where “/” denotes element-wise division.
At each simulation step, let be the synthetic per-batch gradient under the eigen basis. The mean is given by
(A.9)
and the 2nd moment
(A.10)
according to Prediction 3.5 and (A.7). Therefore, the variance is calculated as
(A.11)
Our algorithm simply draws as Gaussian of mean and variance as given in (A.9) and (A.11), respectively.
Once the synthetic per-batch gradient is obtained, we convert it to the superficial coordinates by . Then we apply the optimizer , and convert back to the coordinates under eigen basis again:
Our algorithm finishes this simulation step by updating accordingly.
A.5. Derivation of Learning-rate Threshold. We analyze the dynamics of validation loss for Random Feature models defined in (2.1), by taking eigen decomposition of the Hessian
Let be the mini-batched gradient of batch-size . Let , and be the projections of , and onto the -th eigenmode, respectively. The SGD update is given by
where is the learning-rate. Now, recall that ; so we have
(A.12)
and
where is the eigenvalues of . In order to derive the threshold of learning-rate between convergence and divergence, we make the intuitive assumption that when the learning-rate is
R. TIAN AND C. PAQUETTE
at the threshold, the variance of gradients is neither decreasing nor increasing, i.e., it remains a constant independent of the step t:
(A.14)
For more formal and rigorous treatment using the kernel of a Volterra equation, we refer to Paquette et al. (2024, C.2). Substituting (A.14) into (A.13), we immediately get
(A.15)
Furthermore, when is sufficiently large and , we have
(A.16)
by combining (A.4), (3.3) and (3.5). We also have under this condition, based on a similar argument as in Lemma A.2. So can be explicitly calculated, therefore (A.15) implies
(A.17)
Then, by summing across all i-th eigenmodes in (A.17), we obtain:
(A.18)
Thus the following equation regarding the threshold , by taking the limit at :
(A.19)
A.6. Concentration Effect Only Holds for . We need to analyze the random process (A.12), instead of the average-case behavior (A.13). The difference between (A.12) and (A.13) is a martingale; When one sums the martingales from all eigenmodes, the “concentration effect” states that the sum converges to 0 with “overwhelming probability”, under a suitable limit at .
We refer to Paquette et al. (2021) for the formal tools and rigorous arguments regarding convergence of martingales. In this section, we give an intuitive sketch of the essence of the idea.
Recall the arguments in § 3.4, that can be decomposed into where follows the deterministic gradient descent, while is an accumulation of random noises of mean 0. At each step, a new draw of gradient noise is added into , and on average it contributes to the -th eigenmode of by , according to (A.13).
From the calculation of (A.16), the variance is proportional to ; so we can write the random contribution of the gradient noise to the -th eigenmode of , by where is a random variable, independent and of the same variance across all -th eigenmodes.
Now, by summing across all eigenmodes, the gradient noise contributes to the random validation loss by . The concentration effect states that
with high probability, at the limit .
Note that, in order for the model to converge, the learning-rate should be less than the threshold which satisfies Equation (A.19), meaning . To make the limit properly defined, should actually scale in proportion to . Thus, we obtain the following
(A.20)
and note that scales approximately in proportion to . So (A.20) can be viewed as an average of , weighted by the probability measure .
For PLRF models with power-law exponent , the eigenvalues are asymptotically proportional to . Then, assuming are i.i.d. random variables, and has finite expectation and variance, the concentration to expectation is a standard argument by the Law of Large Numbers, that the random fluctuations of (A.20) will cancel out, if and only if
This is equivalent to .
Appendix B. PLRF Simulation Experiments. As a sanity check, we apply our simulation algorithm to PLRF models, and provide the Python code in supplementary materials. The PLRF models are defined the same as in Figure 2, while we train with SGD and Adam, at batch-sizes . Each configuration is simulated by two runs of different random seeds.
Figure 5 shows the results. We observe that the simulation correctly captures the average-case behavior of the validation loss: the underlying “flows” match each other as long as we ignore the spikes. Moreover, the simulation qualitatively captures the spiky behavior: Simulation is spiky if and only if the actual PLRF training trajectory is spiky.
However, the simulation does not always correctly predict every statistics of training spikes: It seems that the simulation tends to underestimate the “largeness” of spikes when B = 1, while significantly overestimate it when B is large.
This tendency is quantitatively documented in Table 2: For each of the three configurations in the last row of Figure 5, we pick a threshold (shown as dashed lines in the figure) and empirically measure the following statistics to reflect the nature of spikes:
R. TIAN AND C. PAQUETTE



Figure 5: Simulating PLRF by Algorithm 3.1. We apply SGD and Adam at different batch-sizes. Each plot includes one PLRF training and two simulation runs (with different random seeds).
• Quantile at 90% (Q90): The 90th percentile of loss values larger than the threshold at steps 200. This measures how large the spikes are.
• Ratio Above Threshold (RAT): The ratio of loss values larger than the threshold, for steps 200. This measures how frequently the spikes occur.
• Mean Run Length Above Threshold (MRLAT): Count the number of consecutive steps ( 200) where loss values exceed the threshold before they drop back down. Then, take the average of these lengths. This measures the average duration of a spike.
We observe that for B = 1, simulations have slightly lower Q90; while for B = 64, all statistics (Q90, RAT and MRLAT) become much larger, indicating that the simulations are overestimating spikes. We believe the reasons are due to: (1) The distribution of per-example gradients of PLRF is not Gaussian; (2) Our estimate of the 2nd moment of per-batch gradients, as used in the simulation, is only asymptotically accurate when the batch-size is small.
| B=1, LR=0.03, TH=0.3 | B=8, LR=0.1, TH=0.5 | B=64, LR=0.5, TH=1.0 | |||||||
|---|---|---|---|---|---|---|---|---|---|
| Q90 | RAT | MRLAT | Q90 | RAT | MRLAT | Q90 | RAT | MRLAT | |
| PLRF | 0.89 | 0.18 | 8.2 | 1.1 | 0.051 | 2.2 | 3.8 | 0.035 | 1.3 |
| Simulation1 | 0.59 | 0.14 | 4.9 | 1.4 | 0.096 | 2.7 | 22. | 0.38 | 4.6 |
| Simulation2 | 0.53 | 0.18 | 5.1 | 2.5 | 0.19 | 3.7 | 44. | 0.36 | 6.9 |
Table 2: Statistics of training spikes, for three configurations of batch-sizes , with respectively picked learning-rate (LR) and threshold (TH).
Appendix C. Transformer LM Experiments. In this section, we give details of our case-study of a Transformer LM training.
C.1. Model and Training Settings. The model is a vanilla decoder-only Transformer, with Self-Attention (Vaswani et al., 2017), Pre-Layernorm (Xiong et al., 2020), Rotary Position Encoding (Su et al., 2024) and QK-layernorm (Dehghani et al., 2023) for each layer. We build our experiments upon an existing series of model sizes used in previous research (Everett et al., 2024; Charles et al., 2025), where the sizes of model components are parameterized by a single factor , as below:
• Sequence length: 2048.
• Vocab size: 32000.
• Number of blocks: .
• Number of attention heads: .
• Dimension of attention heads: 64.
-
Dimension of model hidden vectors = (Attention head dimension) * (Number of attention heads) = .
-
MLP intermediate dimension = 4 * (Hidden dimension) = 4096 * k.
As detailed in Everett et al. (2024), the training hyperparameters are found by sweeping smaller models and verified by fitting a power-law curve. We take one point for our case-study.
For this point, the hyperparameters are given as below.
-
Optimizer: AdamW (Loshchilov and Hutter, 2019) with , . We do not apply any gradient clipping to the training.
-
Batch-size (number of sequences per batch): Set to 256.
-
Number of training steps: Determined by the Chinchilla rule (Hoffmann et al., 2022), i.e., (Total number of tokens trained) / (Tokens per batch) = (20 * Number of model parameters) / (256 × 2048) ≈ 48500.
-
Learning-rate schedule: We use a simple schedule with warm-up in 1000 steps, then linearly decay to 0. The peak learning-rate is 0.00082. The schedule is shown in Figure 6.
• Weight-decay: Set to 0.2.
The model is trained with cross-entropy loss normalized by the number of tokens per batch. We note this normalization factor is applied to gradient – the loss should be considered per-token cross-entropy without any normalization factor; while the per-batch gradient is
R. TIAN AND C. PAQUETTE

Figure 6: The learning-rate schedule used for our Transformer LM training.
summed across all tokens in a batch, so we normalize it by the number of tokens per batch, in order to ensure that the average gradient over a dataset does not depend on the batch-size of the calculation.
This convention of normalization becomes critical when we discuss and distinguish between the squared norms of per-example gradient and per-batch gradient . Here, denotes the squared norm of gradient over one token, and is averaged across all tokens in a dataset. In contrast, denotes the squared norm of gradient of a batch, and takes average across all batches in a dataset. There is no obvious relation between and , because the square in is taken after summing over the batch! Throughout this paper we will carefully distinguish, prove and verify relations between and .
Empirically, the calculation of can still be batched, because we have the following
(C.1)
where denotes element-wise square. Therefore, by taking squares of and first, one can obtain results of squares before summing over the batch, while still batching the whole calculation and summing across all tokens.
In order to calculate the Hessian trace , we use the fact that for any random vector , where are independent, of mean 0 and variance 1, we have
(C.2)
Therefore, instead of directly calculating the huge tensor , we only need the Hessian form of a few random vectors. In our experiments, we randomly sample 6 vectors, with each entry drawn from . Preliminary experiments suggest this setting has relative error .
The Hessian form can be calculated from Jacobian-Vector Products (a.k.a. forward-mode autodiff). With some implementation techniques, one can even calculate the layer-wise Hessian form for multiple layers in one forward pass, by concatenating intermediate results from each layer along the way of autodiff.
C.2. Power-Law Distribution of Forward Activations. Let be the input hidden vector to a layer. In order for the layer to exhibit training spikes, our theory suggests that the eigenvalues of should follow a heavy-tailed distribution. In this section, we verify that it is indeed the case for our Transformer LM training.
In Figure 7, we sort the eigenvalues of in descending order, and show the log-log plots of eigenvalues over ranks, for different layers and training steps. The Normal and Spiky1 training configurations are compared in each sub-plot.
In the log-log plots, eigenvalues indeed exhibit power-law like distributions, whereas the Spiky training generally shows steeper descending and crosses Normal. In other words, eigenvalues from Spiky are more heavy-tailed.
Quantitatively, we follow Clauset et al. (2009) to fit truncated power-law distributions to the log-log plots, which estimates the power-law exponent by maximizing the likelihood, and estimates the truncation threshold by minimizing the Kolmogorov–Smirnov (KS) statistic. The estimated power-law exponent , truncation rank r, and the KS statistic are shown in Figure 7.
For lower layers (e.g., block_0), the eigenvalues distribution of Spiky seems significantly different from Normal, and the gap remains unclosed until the end. For upper layers (e.g., block_20) the distributions are more similar, and they seem to converge to the same towards the end of training (e.g., block_{12,20}).
This tendency is documented in Figure 8, where we plot the evolution of power-law fitting statistics along the whole training process. Generally, Spiky training exhibits larger power-law exponent , larger truncation threshold for upper layers and smaller for lower layers, and larger truncated rank r especially for lower layers. The evolution of the statistics is also more unstable for Spiky.
C.3. Empirical Verification of Prediction 3.5. In Prediction 3.5, we have derived a formula to calculate the norm of per-example gradients, given as Equation (3.4). We empirically verify the formula in this section.
Recall that layer is a matrix, the input a D-dimensional, and the output gradient a C-dimensional vector. In Figure 9, we plot:
(a) , the mean square of hidden inputs.
(b) , the mean square of output gradients.
(c) , the mean square of per-example gradients of the model weight.
(d) The ratio , which should be close to 1 according to Equation (3.4).
We show different types of layers across training steps. The norm of gradients can vary multiple
R. TIAN AND C. PAQUETTE
magnitudes during training, yet the ratio plot in Figure 9 shows that the relative error of Equation (3.4) is less than 0.1, mostly within 5%.
C.4. Is the “Batch-size” Large or Small?. Specific to the training of Transformer LMs, there is the question of what should be considered as the “batch-size”. Is it the number of tokens per batch, because each token is corresponding to a summand in the training loss function? Or is it the number of sequences per batch, because tokens within a sequence can have correlations, and the unit of sequence is what is guaranteed to be independent in a batch? Since recent LMs are trained with very long sequences ( ), the answer to this question affects our understanding of whether the training of Transformer LMs should be theoretically considered as having a “large” or “small” batch-size.
The difference between “large” and “small” batch-sizes is drastic in theory: If the batch-size is small (compared to , where D is the hidden dimension of the model), the gradient noise plays an important role in stochastic optimization, of which the effect can be accurately analyzed as we demonstrated in this work; On the other hand, our theoretical calculation becomes less accurate as the batch-size increases, and when the batch-size is extremely large as close to a full-batch setting, the theory regarding full-batch gradient descent becomes more relevant.
In this section, we provide a perspective from the equivalent batch factor concept. From (A.7), equivalent batch factor directly affects the largeness of gradient noise; In Figure 10 (Right), we plot for different layers and training steps, as empirically measured according to (A.8). We observe that is small (close to 1), which means that we are in a typical stochastic optimization regime.
Furthermore, can be decomposed into three factors as below.
The first factor, , is plotted in Figure 10 (Left), which turns out to be slightly smaller than the number of tokens per batch (shown as dashed line in the figure), which is not completely a surprise in light of (A.4). For recent LMs, this is a very large number.
The second factor, , is what we have investigated in § C.3 and Figure 9, which is close to 1 as predicted.
The third factor is what makes small. It measures how far a DNN model deviates from (3.5) and (A.6), which is satisfied by Random Feature models and would make this factor . In contrast, the empirical measure in our case turns out to be very small, as shown in Figure 10 (Middle). It suggests that the point-wise loss of DNNs brings very different gradients to each training example, and constitutes the major source of gradient noise in training of DNNs.
Somehow magically, the first factor and the third factor cancel each other to make close to 1. If this is not a coincidence (since the training recipe we adopted in § C.1 has been tuned on batch-size as well), it might suggest heuristics for tuning the batch-size hyperparameter: Because the first factor depends on the batch-size while the third factor does not, one can empirically measure the third factor and tune the batch-size to make . We leave this direction to future work.
| schedule | |||
|---|---|---|---|
| 2.4421 | 2.4405 | 2.4502 | 2.4404 |
Table 3: Final validation loss for different settings.
C.5. The Appropriate . For our case-study, we know that the hyperparameter is causing training spikes. Is there a recipe to derive the appropriate , possibly from empirical metrics, so that one can avoid the risk of spiky training? In this section, we propose and verify such a recipe.
The proposal is to set
(C.3) where and .
Here, is the learning-rate schedule for Adam; We empirically measure the normalized Hessian trace and the mean square of per-batch gradients from validation data. In particular, (C.3) depends on the learning-rate schedule ; So if one applies a decaying schedule to the learning-rate, it usually suggests that should follow an increasing schedule.
The rationale for (C.3) comes from (3.8): Because the accumulated gradient noise is decayed by at each training step, the random fluctuations of the loss dynamics (i.e. the source of training spikes) has self-correlation within steps; Then, our proposal is to ensure that , the running average of gradient squares used as an optimizer state in Adam, has self-correlation within steps. Since the learning-rate in (3.8) is for SGD, we have to replace it by the adaptive learning-rate in Adam; We approximate the tensor by , and the tensor by .
In Figure 12, we first ensure that is actually a good approximation of (or vice versa): We plot the ratio in the First Row, for different layers and training steps, comparing the Normal and Spiky configurations. We found that the approximation works well for Normal training, but much worse for Spiky. This is not surprising because the large used by Spiky is likely to make any surge of gradient squares last longer in , causing it to overestimate the average.
Then, we plot , and finally in the Second, Third and Fourth Row of Figure 12, respectively. Although the plots of and can be spiky, we observe that the overall tendency of the ratio is comparatively stable and consistent across all layers, for both Normal and Spiky. In order to capture this tendency, we manually fit a schedule of the form below (shown as pink dashed curves in the Fourth Row of Figure 12).
(C.4)
with init_value = 0.018, final_value = 0.008 and exponent = 3.
We set to the schedule given in (C.4) and train a Transformer LM as in § C.1, without changing any other hyperparameters. We compare the final validation loss with the
R. TIAN AND C. PAQUETTE
original setting , and two additional settings and . The results are shown in Table 3.
We observe that the proposed schedule can indeed improve performance in terms of validation loss. Remarkably, the performance significantly differs between and , even if and only differ by 0.01. We also observe that the training of is spiky, while is not (Figure 11). The proposed schedule can even improve a bit over , with the final value of actually becoming .






Figure 7: Log-log plot with truncated power-law fit, for ranked eigenvalues of correlation matrices.
R. TIAN AND C. PAQUETTE






Figure 8: Evolution of power-law fitting statistics, across layers and training steps.




Figure 9: Empirical verification of Equation (3.4).



Figure 10: Breakdown of the equivalent batch factor.
R. TIAN AND C. PAQUETTE

Figure 11: Training loss for different settings.








Figure 12: Estimating an appropriate schedule.