Grokking Can Be Steered: Selecting Desirable Solutions By Choice Of Learning Rule
Authors: Pascal Sager, Benjamin Grewe, Pau Vilimelis Aceituno, Thilo Stadelmann
Organizations: Centre for Artificial Intelligence, ZHAW · Institute of Neuroinformatics ETH Zürich and University of Zürich · ETH AI Center, Zürich, Switzerland · Centre for Artificial Intelligence, ZHAW Winterthur, Switzerland · ECLT, Venice, Italy
During grokking, a network transitions from memorization to generalization, yet what shapes the neural implementation (circuit) of the generalizing solution and specifically the number of participating neurons (its size) remains unclear. We find that the learning rule, the combination of credit assignment algorithm and optimizer, controls this: On modular addition, every learning rule we study that groks recovers the same Fourier-based algorithm, yet implemented by circuits that differ in size. Why? A neuron stays in use when its credit is large relative to the non-gradient term of its own update, and this single condition unifies three routes to unused neurons: the coupled weight decay, Adam's ε and the decay of a trainable per-neuron gain. Equalizing the magnitude of credit assigned to each neuron, or scaling each neuron's weight decay by its credit, expands the effective circuit size, measured from the outgoing weights, from 60% to 99% of the layer's neurons at similar training and test accuracy. We vary which neurons share one equalization factor, from the whole layer to individual neurons, and find that the circuit stays concentrated for groups of eight or more and fully distributes only when every neuron has its own factor. Credit magnitudes are usually set by the normalization of standard optimizers: Nero, which normalizes per neuron, distributes the computation, whereas Adam and seven others, including RMSProp, Muon, and Shampoo, use other normalization schemes and retain small, concentrated circuits. Distributed circuits tolerate neuron deletion better, while concentrated circuits can be pruned further and transfer about twice as fast to a task that recombines the same features, largely by recruiting their unused neurons. Learning rule choice thus steers circuit size, trading robustness against compressibility and transfer speed without changing the learned algorithm.
Figures & tables
Figure 1: The learning rule selects whether a network groks, how many neurons implement the grokked algorithm, and the resulting robustness and adaptation. (a) All runs fit the training set, and only some then generalize to the held-out pairs. Each dot is one seed and shows the null-space weight norm q at the end of training (Section 4.3 ). (b) First hidden layer of two networks that share data and initialization. The credit of a neuron is the gradient of its incoming weights. Under backpropagation with Adam the credit is unequal (top row, relative to the layer mean and averaged over training), and neurons that receive little credit end with small outgoing weights. Credit equalization makes the magnitudes equal before the gradient enters the optimizer (Adam) and keeps every gradient’s direction (middle row, schematic). Dots show the 256 neurons in the order of the top row, with area proportional to the outgoing norm. Effective counts are for this seed, and the three-seed means are 154 and 254 . (c) Tolerance is the normalized area under the curve of test accuracy against the fraction of randomly deleted neurons. Adaptation is the number of epochs to test accuracy 0.9 on subtraction, starting from the addition network or from scratch (without pretraining). The network drawings are schematic, μ±σ are over ten seeds (Table 22 and Appendix E.1 ).
elementwise sign of a momentum signal ( Chen et al., 2023 )
Table 1: Learning rules under test, grouped by how they transform the learning signal. Rules that enter only Section 4.3 are not listed. Settings are given in Appendix A .
Figure 2: Credit allocation sets the circuit and reorganizes it after grokking (modular addition, p=31 , three seeds, bands one standard deviation). (a) Circuit participation and effective neuron count of networks trained from scratch at equalization strength β . Training cross-entropy ( 0.040 ), margin and parameter norm stay close to the reference values. (b) A network grokked with the reference rule and one grokked with credit equalization, each copied at epoch 20,000 and continued for 30,000 epochs with its own rule or with the other rule. Test accuracy remains above 0.95 throughout.
Non-gradient term
Network
Reference
Equalized
Term rescaled
Ratio held
Coupled decay
MLP, Adam with L2
0.606
0.993
0.993
0.574
Adam’s ϵ
Transformer, AdamW
0.609
0.994
0.981
0.818
Decay of the gain
MLP, layer normalization
0.366
0.996
0.997
0.343
Table 2: Rescaling only the non-gradient term of each neuron’s update reproduces credit equalization in all three cases. Equalizing the gradients while holding each neuron’s ratio of credit to that term fixed keeps the circuit concentrated for the decay and the gain and removes about half of the effect for ϵ (circuit participation, five seeds per cell). For the gain, equalization and rescaling act on the gain and the outgoing weights as well as the incoming rows; equalizing the incoming rows alone gives 0.364 . Update equations and details in Appendices C.6 , F.5 and F.7 .
Figure 3: Circuit participation under different transformations of the learning signal. (a) Circuit participation against credit participation for the reference, DFC, credit equalization at β=0.25 and β=1 , the group-size sweep on four tasks and seven optimizers. Credit participation is measured on the signal listed in Table 4 . (b) Circuit participation against the number of neurons that share one normalization factor, on modular addition at three moduli and on S5 . Error bars show one standard deviation across three seeds.
Concentrated ( β=0 )
Distributed ( β=1 )
From scratch
Random deletion tolerance
0.674
0.770
—
Norm-ranked deletion tolerance
0.332
0.581
—
Greedy deletion, neurons removed
23
61
—
Magnitude pruning, fraction removed
0.62
0.20
—
Greedy pruning, neurons removed
191
160
—
Adaptation to subtraction, epochs
640(128)
1540(180)
1410(137)
Table 3: Deletion tolerance and adaptation of the concentrated and the distributed circuit on modular addition ( p=31 ). Means over three seeds for deletion, five for pruning to test accuracy 0.9 (Appendix E.1 ), ten for subtraction and five for multiplication, with standard deviations in parentheses (Table 22 ).
Appendix figures & tables34 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 4: Training (dashed) and test (solid) accuracy for the reference and DFC on modular addition ( p=31 ), three seeds with shared initializations, evaluated every 10 epochs; bands show one standard deviation across seeds, and the DFC runs end at epoch 1000 . Both fit the training set first and generalize hundreds of epochs later.
Condition
Logged signal
Reference; LARS
raw loss gradient, before clipping and without the weight-decay term; for LARS this differs from the applied update only by the common layer factor and the weight-decay term
rescaled gradient of Equation 2 or 3 , before clipping and before Adam
DFC
local controller update of Equation 6 for the first layer, before Adam
RMSProp, LAMB, Adafactor, Lion, Muon, Shampoo
update applied to the first-layer weights: gradient plus weight-decay term, transformed with the optimizer’s running moments (Lion: sign of the momentum-interpolated gradient; LAMB: including the trust ratio)
Appendix
Table 4: Signal on which credit participation is measured, per condition. All signals are for the first hidden layer, with one row per neuron.
Rule
∥θ∥
margin γ
Reference (backpropagation with Adam)
26.10±0.15
5.02±0.02
Credit equalization ( β=1 )
26.65±0.10
5.15±0.03
DFC
13.09±0.02
0.54±0.00
Appendix
Table 5: Parameter norm and logit margin at matched weight decay (modular addition, p=31 , four seeds; means and standard deviations). All runs have test accuracy ≥0.97 . Credit equalization leaves both quantities close to the reference values while producing a circuit at least as distributed as DFC’s.
Frequencies kept or removed, k
2
4
6
8
10
12
Reference
Keep top k
0.23
0.57
0.86
0.97
1.00
1.00
Keep random k
0.10
0.21
0.40
0.58
0.76
0.90
Remove top k
0.83
0.44
0.19
0.06
0.02
0.02
Remove random k
0.94
0.83
0.62
0.44
0.27
0.13
Equalized
Keep top k
0.14
0.42
0.69
0.86
0.93
0.96
Appendix
Table 6: Test accuracy after keeping or removing k input frequencies, ranked by first-layer weight power (top) or drawn at random ( 20 draws per network), modular addition at p=31 . Means over five seeds; the complete curves are in Figure 5 .
Figure 5: Test accuracy after keeping (left) or removing (right) k input frequencies, ranked by first-layer weight power (solid) or drawn at random (dashed). Means over five seeds, bands one standard deviation across seeds.
Rule
Test
Circuit PR
Trig
Dist. irrel.
Correlation
CKA
Optimizers, 20,000 epochs
Reference
0.999
0.558
0.535
0.983
0.407
0.590
LARS
0.975
0.604
0.550
0.986
0.419
0.592
RMSProp
0.995
0.496
0.517
0.984
0.456
0.598
LAMB
0.998
0.566
0.463
0.984
0.396
0.573
Adafactor
0.998
0.489
0.553
0.983
0.432
0.580
Appendix
Table 7: Algorithm checks for the remaining grokking rules (modular addition, p=31 , three seeds, one shared data split). Trig: fraction of logit variance explained by the (a+b−c) basis. Distance irrelevance: the statistic of Zhong et al. (2023) , above 0.6 for clock networks and below 0.6 for pizza networks. Correlation and CKA: agreement with the reference trained in the same way, across initializations; the reference rows give its agreement with itself. The optimizers are trained for 20,000 epochs and the constructed rules for 15,000 , each with its own reference. The seeds share one data split, so the values differ slightly from Table 13 , whose seeds use different splits.
Condition
Test
Credit PR
Circuit PR
Random del
Norm-ranked del
Constraining the incoming weights
Reference
0.998
0.586
0.595(0.023)
0.672
0.311
Fixed incoming norm
0.954
0.611
0.661(0.015)
0.607
0.256
Imposing a credit profile
Reference
0.997
0.604
0.613(0.016)
0.673
0.298
Imposed 0.60
0.980
0.600
0.637(0.003)
0.607
0.240
Appendix
Table 8: Controls on the weights and on the credit profile ( p=31 , three seeds; standard deviations in parentheses). Upper block: constraining the incoming weight norms without rescaling the gradients leaves the circuit concentrated. Lower block: credit profiles of a chosen participation, assigned to neurons by a random permutation, produce circuit participation within 0.018 of the imposed value on average; the final row reassigns the reference’s credit magnitudes to random neurons at every step. Each block has its own reference run. Random del and norm-ranked del are deletion tolerances (Appendix E.1 ).
Setting
Circuit PR
Random del
Margin
Norm
Circuit participation
SGD with momentum, β=0
0.53
0.60
—
—
SGD with momentum, β=1
0.99
0.76
—
—
Lion, β=1
0.984(0.003)
—
—
—
Dropout 0.1
0.95
0.79
5.3
26.8
Dropout 0.5
0.99
0.82
6.8
30.2
Appendix
Table 9: Optimizer and regularizer controls ( p=31 , three seeds). Upper block: circuit participation and random-deletion tolerance under other optimizers and under dropout; margin and norm are given where measured. Lower block: participation ratio of the measured learning signal in the Adam runs, from the raw gradient and from Adam’s effective step m/v .
Learning rate
Weight decay
Test
Credit PR
Circuit PR
3×10−4
10−3
0.998
0.613
0.626(0.012)
3×10−4
3×10−3
0.983
0.560
0.571(0.027)
10−3
10−3
0.997
0.604
0.613(0.016)
10−3
3×10−3
0.993
0.523
0.530(0.008)
3×10−3
10−3
0.993
0.589
0.594(0.024)
3×10−3
3×10−3
0.988
0.546
0.553(0.022)
Appendix
Table 10: Learning-rate and weight-decay grid for the reference ( p=31 , three seeds; standard deviations in parentheses). All settings grok and retain concentrated circuits, with credit participation close to circuit participation.
Condition
Circuit PR before
Circuit PR after
Test
Rule held, 20,000 to 200,000 epochs
Reference ( β=0 )
0.60
0.605(0.012)
0.997
Credit equalization ( β=1 )
0.99
0.990(0.003)
0.975
Rule switched after phase one
β=0→β=1
0.613(0.016)
0.991(0.000)
0.997
β=1→β=0
0.990(0.003)
0.722(0.016)
0.990
Appendix
Table 11: Circuit stability under a fixed rule and reorganization after switching ( p=31 , three seeds; standard deviations in parentheses). Fixed-rule runs show participation after 20,000 and 200,000 epochs. Switched runs use 20,000 epochs in the first phase and 30,000 in the second and show participation after each phase; the reverse switch has not stabilized by the end. Same-rule continuations control for the additional training.
Gradient
Decay
Test
Circuit PR
Nearly unused
Act.
Abl.
Random
Norm-ranked
gj
λwj
0.995
0.606(0.019)
83.6
0.355
0.429
0.675
0.340
sjgj
λwj
0.976
0.993(0.001)
0
0.850
0.832
0.776
0.585
gj
λwj/sj
0.979
0.993(0.001)
0
0.981
0.924
0.782
0.611
sjgj
sjλwj
0.996
0.574(0.046)
92.4
0.283
0.378
0.664
0.316
Appendix
Table 12: Gradient and coupled decay under Adam (modular addition, p=31 , five seeds, 20,000 epochs; standard deviations in parentheses). sj is the factor of full credit equalization for neuron j , recomputed at every step; the first two rows are the reference and full credit equalization. Nearly unused neurons have an outgoing norm below a tenth of the layer mean. Act. and abl. are the activation-weighted and ablation participation of Appendix B.1 ; random and norm-ranked are deletion tolerances (Appendix E.1 ).
Optimizer
Normalizes
Test
Credit PR
Circuit PR
Reference (backpropagation, Adam)
per parameter
0.998
0.586
0.595
LARS
per layer
0.967
0.520
0.613
RMSProp
per parameter
0.992
0.791
0.470
LAMB
per parameter and per layer
0.995
0.779
0.543
Adafactor
factored, per parameter
0.991
0.839
0.518
Lion
per parameter (sign)
0.985
1.000
0.535
Appendix
Table 13: Optimizer comparison on modular addition ( p=31 , three seeds, 20,000 epochs). The upper block runs every optimizer at the learning rate 10−3 and weight decay 10−3 of the reference (LARS at fifty times the learning rate); the reference and full credit equalization are included as comparison points. The lower block reports Nero, which uses no weight decay, at its default learning rate 10−2 and at 3×10−3 . Credit participation is measured on the raw gradient for the reference and LARS, on the rescaled gradient for credit equalization, and on the applied update for the other optimizers (Appendix A ). Optimizers: LARS ( You et al., 2017 ) , RMSProp ( Tieleman & Hinton, 2012 ) , LAMB ( You et al., 2020 ) , Adafactor ( Shazeer & Stern, 2018 ) , Lion ( Chen et al., 2023 ) , Muon ( Jordan et al., 2024 ) , Shampoo ( Gupta et al., 2018 ) , Nero ( Liu et al., 2021 ) .
Concentrated ( β=0 )
Distributed ( β=1 )
Magnitude pruning, tolerance
0.949
0.718
Magnitude pruning, largest fraction with test ≥0.9
0.62(0.04)
0.20(0.00)
Greedy pruning, neurons removed with test ≥0.9
191(4)
160(18)
Greedy pruning, neurons removed with test ≥0.95
177(5)
117(37)
Appendix
Table 14: Removal in retention order (modular addition, p=31 , five seeds; standard deviations in parentheses). Magnitude pruning removes neurons in increasing order of outgoing norm, evaluated at fractions 0,0.1,…,0.8 ; greedy pruning removes the neuron whose removal raises the training cross-entropy least.
Figure 6: Neuron deletion for the reference, full credit equalization ( β=1 ) and DFC on modular addition ( p=31 , three seeds). (a) Test accuracy against the fraction of randomly deleted first-hidden-layer neurons. (b) Deletion tolerance, the normalized area under the accuracy curve over the deletion fractions, under random and norm-ranked deletion.
Deletion procedure
Reference
Credit equalization ( β=1 )
DFC
Random
0.674
0.770
0.725
Norm-ranked
0.332
0.581
0.518
Appendix
Table 15: Deletion tolerance under random and norm-ranked deletion (modular addition, p=31 , three seeds). Norm-ranked deletion removes neurons in decreasing order of outgoing norm.
Condition
Test
Circuit PR
Neurons removed
Reference
0.998
0.595(0.023)
23.3
Credit equalization, β=0.25
0.997
0.940(0.017)
43.0
Credit equalization, β=0.5
0.986
0.975(0.002)
59.0
Credit equalization, β=1
0.976
0.992(0.002)
60.7
Appendix
Table 16: Greedy neuron deletion on modular addition ( p=31 , three seeds). At each step the procedure removes the neuron whose removal lowers test accuracy the most. The last column gives the mean number of neurons removed before test accuracy falls below 0.5 . Standard deviations of circuit participation are in parentheses.
Network
Width
Circuit PR
Greedy, 0.90
Greedy, 0.95
Magnitude, 0.95
Adam with L2, reference
256
0.594
59
70[63,81]
88
Adam with L2, equalized
256
0.993
96
155[100,230]
215
Decayed per-neuron gain
256
0.096
23
24[22,25]
25
AdamW, reference
256
0.931
61
77[67,96]
142
AdamW, equalized
256
0.970
61
115[71,171]
217
Adam-mini with L2
256
0.586
61
72[55,90]
89
Appendix
Table 17: Number of neurons that pruning keeps at test accuracy 0.90 or 0.95 (modular addition, p=31 , five seeds; range over seeds in brackets).
Network
Width
Test
Greedy, −0.01
Greedy, −0.02
Fit, full
Fit, pruned
Adam with L2, reference
256
0.998
99
82
0.54
0.47
Adam with L2, equalized
256
0.980
199
146
0.47
0.44
Decayed per-neuron gain
256
0.975
25
25
0.49
0.48
AdamW, reference
256
0.992
109
95
0.36
0.42
AdamW, equalized
256
0.967
116
88
0.43
0.41
Adam-mini with L2
256
0.995
92
83
0.58
0.51
Appendix
Table 18: Pruning relative to each network’s own test accuracy (same networks as Table 17 , means over five seeds). Test is the accuracy before pruning; the next two columns give the neurons that greedy pruning keeps one and two points below it. Fit is the trigonometric fit of Appendix B.3 for the full network and for the greedy circuit at test accuracy 0.95 .
Condition
Test
Circuit PR
Random del
Adapt
Reference
0.995(0.007)
0.597(0.020)
0.669
464
Credit equalization ( β=1 )
0.976(0.015)
0.993(0.002)
0.777
1608
Outgoing-norm constraint, 0.60
0.987(0.016)
0.600(0.000)
0.647
740
Outgoing-norm constraint, 0.80
0.977(0.008)
0.800(0.000)
0.675
1228
Outgoing-norm constraint, 0.99
0.976(0.012)
0.990(0.000)
0.777
1480
Appendix
Table 19: Credit equalization compared with an outgoing-norm constraint of matched participation (modular addition, p=31 , five seeds; standard deviations in parentheses). Random del is the random-deletion tolerance; Adapt is the number of fine-tuning epochs to test accuracy 0.9 on subtraction.
Source network
Fine-tuning rule
Source test
Epochs to 0.9
Circuit PR after
Concentrated ( β=0 )
reference
0.992
580(151)
0.62
Concentrated ( β=0 )
equalization
0.992
1000(196)
0.99
Distributed ( β=1 )
reference
0.969
1496(195)
0.60
Distributed ( β=1 )
equalization
0.969
1856(95)
0.99
Appendix
Table 20: Fine-tuning from addition to subtraction with the reference rule or with full credit equalization, for a concentrated and a distributed source network (modular addition, p=31 , five seeds; standard deviations in parentheses). Adaptation time is the number of epochs to test accuracy 0.9 , evaluated every 20 epochs.
Target
Concentrated
Nearly unused removed
Distributed
From scratch
(a−b)modp
652(108)
1204(303)
1480(382)
1300(83)
(b−a)modp
528(72)
1020(296)
1440(303)
1304(46)
(a+b+7)modp
204(60)
204(69)
224(39)
1356(97)
π((a+b)modp)
560(115)
452(95)
464(83)
1308(111)
(a⋅b)modp
1940(124)
2324(224)
1988(202)
1148(52)
Appendix
Table 21: Adaptation from addition to five targets, in epochs to test accuracy 0.9 (modular addition source, p=31 , five seeds; standard deviations in parentheses). The third column is the concentrated network with its nearly unused neurons removed.
Condition
Circuit PR
Low-norm neurons
Source test
Epochs to 0.9 on
subtraction
multiplication
β=0 (reference)
0.593(0.034)
85
0.995
640(128)
1800(141)
β=0.25
0.933(0.020)
0
0.989
940(191)
1940(233)
β=0.5
0.972(0.006)
0
0.990
1200(89)
1980(248)
β=0.75
0.983(0.003)
0
0.981
1300(141)
2020(133)
β=1
0.991(0.002)
0
0.972
1540(180)
1940(136)
Appendix
Table 22: Fine-tuning from addition to a new operation, with standard deviations in parentheses. Subtraction results for β=0,0.25,1 and from scratch use ten seeds; the intermediate settings and all multiplication results use five. Adaptation time is the number of epochs to test accuracy 0.9 . Low-norm neurons have an outgoing norm below one tenth of the layer mean.
Start
3×10−4
10−3
3×10−3
β=0 (reference)
1933(525)
640(128)
267(47)
β=0.5
3067(205)
1200(89)
533(47)
β=1
3733(262)
1540(180)
667(94)
ratio β=1 to β=0
1.9
2.4
2.5
Appendix
Table 23: Adaptation time from addition to subtraction across an order of magnitude in the fine-tuning learning rate, in epochs to test accuracy 0.9 (standard deviations in parentheses). The outer columns use three seeds; the middle column repeats Table 22 (ten seeds for the endpoints, five for β=0.5 ).
Setting
Circuit measured
β=0
β=1
Details
Addition, subtraction, multiplication
first hidden layer
0.43 – 0.60
0.99
App. F.1
Sparse parity
first hidden layer
0.15
0.96
App. F.3
S5 composition
first hidden layer
0.70
0.97
App. F.4
Transformer, p=31 , wide MLP
MLP block
0.61
0.99
App. F.5
Batch normalization
first hidden layer
0.81
0.97
App. F.7
Transformer, p=113 , canonical
MLP block
0.96
0.96
App. F.5
Appendix
Table 24: Circuit participation of the reference ( β=0 ) and under full credit equalization ( β=1 ) across the tested settings. Test accuracies and seed counts are given in the cited subsections. Sparse parity and MNIST show no grokking delay. The last three settings are unchanged: two start from a distributed circuit, and with layer normalization the reference is concentrated.
Operation
Rule
Test
Circuit PR
Random del
Addition
reference
0.998(0.001)
0.60(0.02)
0.671(0.016)
equalization ( β=1 )
0.976(0.011)
0.99(0.00)
0.771(0.019)
DFC
1.000(0.000)
0.92(0.00)
0.717(0.014)
Subtraction
reference
0.999(0.001)
0.59(0.04)
0.680(0.026)
equalization ( β=1 )
0.994(0.005)
0.99(0.00)
0.785(0.014)
DFC
1.000(0.000)
0.93(0.01)
0.735(0.010)
Appendix
Table 25: Circuit participation and random-deletion tolerance on the three modular operations ( p=31 , three seeds; standard deviations in parentheses). All three operations use the same random split with 40% of the pairs held out.
Circuit PR
n⋅PR
Width
β=0
β=1
β=0
β=1
32
0.937
0.980
30
31
64
0.915
0.987
59
63
128
0.791
0.991
101
127
512
0.400
0.994
205
509
1024
0.262
0.994
268
1018
Appendix
Table 26: Width dependence of first-hidden-layer circuit participation and effective neuron count n⋅PR at β=0 and β=1 (modular addition, p=31 , three seeds, 15,000 epochs).
Train size
Rule
Test
Circuit PR
Random del
∼2000
reference
1.000(0.000)
0.15(0.06)
0.865(0.051)
equalization ( β=1 )
1.000(0.000)
0.96(0.03)
0.955(0.002)
∼300
reference
1.000(0.000)
0.08(0.02)
0.825(0.017)
equalization ( β=1 )
0.988(0.017)
0.89(0.02)
0.908(0.060)
Appendix
Table 27: Sparse parity with approximately 2000 and 300 training examples (three seeds; standard deviations in parentheses).
Rule
Test
Credit PR
Circuit PR
Random del
Norm-ranked del
Delay
Half the pairs held out, ten seeds
Reference
1.000
0.689
0.699(0.078)
0.485
0.149
500
Equalization, β=0.5
1.000
0.970
0.942(0.010)
0.585
0.322
550
Equalization, β=1
1.000
1.000
0.973(0.005)
0.633
0.468
900
60% held out, five seeds
Reference
1.000
0.657
0.662(0.038)
0.409
0.129
1350
Appendix
Table 28: Composition in S5 . The upper block uses ten seeds with half the pairs held out, the lower block five seeds with 60% held out; parentheses show standard deviations. Delay is the number of epochs between reaching training accuracy 1.0 and test accuracy 0.95 .
β
Test
MLP circuit PR
Canonical: one block, p=113 , dmodel=128 , six seeds
0.0
1.000
0.955(0.01)
0.5
1.000
0.953(0.01)
1.0
1.000
0.955(0.01)
Second modulus: p=97 , three seeds, 70,000 epochs
0.0
1.000
0.959(0.01)
Appendix
Table 29: Modular-addition transformer results: test accuracy and MLP circuit participation (standard deviations in parentheses). Credit equalization is applied to every linear map; β=0 is the reference. The wide-MLP result is described in the text.
Normalization, β
Test
Circuit PR
Nearly unused
Act.
Abl.
Random
Norm-ranked
None, 0
0.993
0.611(0.015)
81.0
0.338
0.417
0.669
0.292
None, 1
0.974
0.991(0.003)
0
0.978
0.916
0.776
0.594
Batch, 0
1.000
0.808(0.007)
42.4
0.735
0.698
0.805
0.556
Batch, 1
1.000
0.970(0.003)
0.2
0.892
0.845
0.834
0.651
Layer, 0
1.000
0.356(0.004)
164.0
0.336
0.307
0.584
0.195
Layer, 1
1.000
0.369(0.005)
161.0
0.352
0.328
0.605
0.214
Appendix
Table 30: Normalization layers after each hidden linear map (modular addition, p=31 , five seeds; standard deviations in parentheses). Columns as in Table 12 .
Condition
Seeds
Validation loss
Nearly unused
Circuit PR
Random
Adam with L2
5
1.378
0.239
0.737
0.422
Adam with L2, per-unit decay balance
5
1.367
0.013
0.988
0.489
Adam with L2, ratio held
3
1.388
0.307
0.670
—
AdamW, decay 0.1
3
1.330
0.009
0.99
0.487
Appendix
Table 31: MLP units in a 30 M-parameter language model after 393 M tokens (means over seeds). Random is the random-deletion tolerance of the MLP units.
Setting
q at epoch 300
q at epoch 750
Grokking seeds
Final test
Backpropagation with Adam, weight decay
0
35.97(0.13)
37.33
0/5
0.000
10−4
31.27(0.07)
22.91
5/5
0.995
3×10−4
24.96(0.05)
13.44
5/5
0.997
10−3
14.34(0.08)
7.57
5/5
0.991
3×10−3
8.38(0.10)
4.96
5/5
0.996
Appendix
Table 32: Null-space weight norm q within one rule (modular addition, p=31 , five seeds per setting, 15,000 epochs; standard deviations in parentheses). Grokking seeds meet the criterion of Section 3 ; final test is the mean test accuracy at the end of training.
Configuration
Epoch 300 ( 2% )
Epoch 750 ( 5% )
Outcome
Reference (backpropagation with Adam)
14.32(0.09)
7.63(0.14)
groks
Credit equalization ( β=1 )
14.46(0.08)
9.11(0.13)
groks
DFC
11.69(0.14)
6.48(0.08)
groks
Error-gated bias
21.93(0.09)
9.53(0.04)
groks
Fresh noise
15.37(0.26)
9.32(0.13)
groks
DFA
27.80(0.10)
26.05(0.36)
memorizes
Appendix
Table 33: Estimated null-space weight norm q early in training, as means (standard deviations) over three seeds. Every run fits the training set and has zero test accuracy at epoch 300 . The outcome column refers to the completed runs.
Configuration
q(θ)
Outcome
Configuration
q(θ)
Outcome
Fresh noise
5.30
groks
DFA
26.34
memorizes
Reference
5.90
groks
FA
26.55
memorizes
Error-gated bias
6.55
groks
Fixed bias
51.80
memorizes
Credit equalization ( β=1 )
7.24
groks
Sign-SGD
134.72
memorizes
DFC
8.49
groks
Appendix
Table 34: Estimated null-space weight norm q at the end of training ( 15,000 epochs of modular addition at p=31 ; means over three seeds). Every grokking configuration has a smaller q than every memorizing one. At initialization, q=29.9 .