Does an Operand-Size Curriculum Speed Up Modular-Addition Grokking? A Small CPU Study of Ordering, Weight Decay and Training Fraction Plover-42F Stemma seed corpus https://github.com/mihir-chauhan/research-harness-papers/tree/main/papers/tiny-transformer-modular-arithmetic-curriculum Abstract—We ask whether a one-layer transformer learns eralise, a delay known as grokking [1]. Modular addition (a + b) mod 23 faster when training pairs are presented in an is the standard testbed: a one-layer transformer ends up operand-size curriculum, in the reverse order, or uniformly, and using Fourier features of the residues [2], simple MLPs how weight decay and training fraction change the answer. On CPU, with a 4000-step budget, 5 seeds at the main cell (weight show the same jump [3], and the time to generalise depends decay 1, training fraction 0.5) and 3 seeds in a weight-decay strongly on the weight decay and the fraction of the table by training-fraction grid, the curriculum did not help: mean that is observed [1], [4]. Because grokking is slow, any steps to 95% held-out accuracy (censored at 4000) were 2945 cheap intervention that shortens the delay is of practical for uniform sampling, 3955 for the curriculum and 3990 for the interest. anti-curriculum, with 3, 1 and 1 of 5 seeds reaching 95%. The curriculum–uniform difference is not significant at 0.05 (Welch Curriculum learning [5], [6] is a natural candidate: and paired tests, 5 seeds). Two further seeds run afterwards (5 present easy examples first. For modular addition the and 6) went the other way for the curriculum (uniform 0 of 2, notion of “easy” is not obvious, since the operation is a curriculum 1 of 2 reaching 95%); pooled over 7 seeds the means group law that is symmetric in the residues, but operand are 3246 (uniform) and 3789 (curriculum), again not significant, size is a natural proxy that a practitioner would try. The so no ordering showed a benefit and a loss is not established. Within the curriculum family, a round-0 pacing sweep showed question of this paper is therefore narrow and empirical: a short curriculum (Tc = 250) reaching 95% in all 5 seeds does ordering the training pairs by operand size (a curricu- where Tc = 1000 reached it in 1 of 5, but that contrast is not lum), or by decreasing operand size (an anti-curriculum), significant after correction for the 10 pairs of lengths (Holm- change the number of steps a one-layer transformer needs adjusted log-rank p = 0.05793). On 10 fresh paired seeds, with to reach 95% held-out accuracy compared with uniform shuffled-order and reverse controls at Tc ∈ {250, 500, 1000}, it was not reproduced as a significant result (6 against 3 of 10 sampling, and how does this interact with weight decay reached in 4000 steps), and the shuffled order at Tc = 250 and training fraction? ran in the same direction. With a 20000-step budget every run Contributions, all at CPU scale: (i) a controlled com- reached 95%; no ordering was faster than uniform sampling, parison of the three samplers with identical model, opti- the operand-size curriculum at Tc = 1000 was slower (+63.97% miser, budget and splits (Sections III–IV); (ii) a weight- in restricted mean time, 95% interval [3.794, 144.4]), and the intervals for the short curricula do not exclude a 10% benefit. decay × training-fraction grid and a pacing/shuffled-order With zero weight decay no run in any condition generalised sweep that probe the interaction and the mechanism within the budget, and in 5 of 9 grid cells no run of any system (Section VI); (iii) a mostly negative result: the curriculum did, so delayed generalisation was only observed in part of was not faster than uniform sampling in our setting, with the grid. The sign of the curriculum effect varied across the the evidence limited by small seed counts and by many two cells where curriculum and uniform both reached 95% in all seeds, by amounts well inside seed noise. This is a single- runs not generalising within the budget. We state where modulus, single-architecture, few-seed study; it supports “no grokking was and was not reached. benefit found”, not “no benefit exists”. Index Terms—grokking, curriculum learning, modular arith- II. Related Work metic, transformers, weight decay Grokking. Power et al. [1] introduced grokking on small I. Introduction algorithmic datasets including modular arithmetic and reported that data fraction and weight decay govern the Small transformers trained on algorithmic tables can delay. Nanda et al. [2] reverse-engineered the one-layer first memorise the training set and only much later gen- transformer solution for modular addition and defined Plover-42F is the codename of an autonomous study, not a person. progress measures that change smoothly before the sud- Produced by the Stemma autonomous AI research pipeline; the topic den test-accuracy jump. Liu et al. [4] give an effective was chosen to cover the field. Every reported number comes from logged runs in the linked repository and every reference was checked theory and phase diagrams over hyper-parameters, and against arXiv, Crossref, DataCite or OpenAlex. Liu et al. [7] relate grokking to a mismatch between the training and test loss landscapes as a function of weight with learning rate η = 0.003, decoupled weight decay norm. Gromov [3] shows grokking in two-layer MLPs on λ (“wd”), β = (0.9, 0.98) and mini-batches of 128 pairs modular tasks, and Mohamadi et al. [8] prove that in the drawn with replacement from the current sampling pool kernel regime a constant fraction of all pairs is needed St ⊆ T . for permutation-equivariant models. Golechha [9] studies B. Samplers grokking on real-world tasks and questions the weight- norm explanation. None of these studies, to our knowledge, Define the difficulty (operand size) of a training pair manipulates the order in which training examples are s(a, b) = max(a, b), with ties broken by a random key fixed presented, which is the gap this study targets (we do not per run. Let π be the training pairs sorted ( by increasing )s claim to have exhaustively searched the literature). and N = |T |. With pacing q(t) = min 1, q0 +(1−q0 ) t/Tc , Data quantity, data selection and pruning. The depen- q0 = 0.15: dence of the grokking delay on the amount of training Uniform: St = T , (2) data is established: Power et al. [1] report it for modular Curriculum: St = {π1 , . . . , πn(t) }, (3) arithmetic, Liu et al. [4] map it with weight decay in phase diagrams, Davies et al. [10] connect grokking to double Anti-curriculum: St = {πN , . . . , πN −n(t)+1 }. (4) descent as a function of data size, and Zhu et al. [11] define with pool size n(t) = max(32, ⌈q(t)N ⌉). Pools are defined a critical data size for grokking in language models and by rank rather than by a threshold on s, so curriculum study how data size interacts with weight decay. Work on and anti-curriculum expose the same number of examples which examples to keep, such as data pruning [12], shows at every step. After Tc steps (default 1000) all three that the composition of a fixed-size training set changes samplers coincide. A control, shuffled-order pool growth, how error scales with data size. Our pacing observation uses the same q(t) with a random key in place of s; it (the time to 95% grows with how long the sampling pool separates the effect of the ordering from the effect of is restricted) is consistent with this known dependence starting with a small pool. All three systems are the of grokking time on the training data seen; we do not same code path with a flag; there are no other published present it as a new effect. What this study adds is only the baselines to reimplement, so “Uniform sampling” (random controlled test of presentation order and timing at fixed mini-batches, as in Power et al. [1]) is reimplemented here training set, which found no ordering-specific benefit over and the two orderings are the compared interventions, uniform sampling. following the easy-to-hard idea of Bengio et al. [5]. Curriculum learning. Bengio et al. [5] proposed present- ing examples from easy to hard; the survey of Wang et C. Metrics al. [6] organises later work into difficulty measurers and Every 25 steps we evaluate accuracy on H (and on training schedulers. Our curriculum follows that template T ). steps_to_95 is the first evaluated step with held-out with a fixed difficulty measure (operand size) and a linear accuracy ≥ 0.95 (the run then stops); a run that never pacing function, and the anti-curriculum and shuffled- gets there is censored at the budget of 4000 steps and also order controls are the usual ablations of the difficulty has reached= 0. steps_to_train95 is the same for training measurer. accuracy and grok_gap=steps_to_95−steps_to_train95 Optimiser and architecture. We use AdamW with de- measures delayed generalisation. The step resolution is coupled weight decay [13] and a standard transformer thus 25. block [14]. IV. Experimental Setup III. Method Scale. This is a small CPU study (about 30 minutes of wall-clock for the round-0 experiments), with one modulus A. Task and model (p = 23), one architecture and 3–10 seeds per cell; all Let p = 23 and P = {0, . . . , p − 1}2 , |P| = p2 = 529. conclusions are at that scale. The target of (a, b) is y = (a + b) mod p. A random subset Tasks and splits. Modular addition mod 23; a random T ⊂ P with |T | = ⌊f p2 ⌉ (f is the training fraction) is train/held-out split of the 529 pairs per seed, training the training set; all remaining pairs form the held-out set fraction f ∈ {0.4, 0.5, 0.7}; the held-out set is every H = P \T , which is never used for training or tuning. The pair not in the training set. The main cell is λ = 1, model is a one-layer pre-LayerNorm transformer [14]: the f = 0.5, with seeds 0–4 for the three systems. The grid input [a, b, =] is embedded as h0i = E[xi ] + Pi (d = 64), crosses λ ∈ {0, 1, 3} with f ∈ {0.4, 0.5, 0.7} (the main followed by h1 = h0 + MHA(LN(h0 )) (4 heads) and h2 = cell is not repeated), seeds 0–2; in the run registry these h1 + MLP(LN(h1 )) (hidden width 256, ReLU); logits are rows were relabelled after the runs into group main (see W LN(h23 ) at the “=” position. The loss is cross-entropy experiments/PROTOCOL.md). Two extra seeds (5, 6) of and the optimiser is AdamW [13], the main cell, kept for the curves, are reported in Table IV. ( √ ) Two sensitivity groups run at the main cell with seeds 0–4: θt+1 = θt − η m̂t /( v̂t + ϵ) + λ θt , (1) curriculum length Tc ∈ {250, 500, 2000, 4000} (the default Tc = 1000 is in the main group) and the shuffled-order TABLE I control. Main cell (λ = 1, f = 0.5, 5 seeds): mean ± std over seeds. reached is the fraction of seeds with held-out accuracy ≥ 0.95 within 4000 Hyper-parameters and tuning budget. Model and opti- steps; steps_to_95 is censored at 4000. miser as in Section III; evaluation every 25 steps. Round- 0 protocol: budget 4000 steps, η = 0.003, q0 = 0.15. System steps_to_95 reached train95 grok_gap That learning rate and the main cell came from about Uniform sampling 2945 ± 1020 3/5 125 ± 25 2820 ± 996 Operand-size curriculum 3955 ± 101 1/5 960 ± 14 2995 ± 110 ten pilot runs of uniform sampling with a separate seed Anti-curriculum 3990 ± 22 1/5 965 ± 14 3025 ± 31 (100) that are in no table and not in the run registry (the pilot was exploratory and its outputs were not TABLE II kept, so it cannot be re-checked); it is kept here only Paired and Welch tests (rh compare, 5 seeds) on steps_to_95 at as a disclosure, not as evidence. In the revision every the main cell: curriculum minus the named system. sampler received a logged, equal tuning budget (group tune, Table VII): at the main cell, on tuning seeds 300– Curriculum vs. mean diff. Welch p paired p 308 that appear in no other run, with a budget of 20000 Anti-curriculum −35 0.49 0.51 steps, η ∈ {0.0003, 0.001, 0.003} for every sampler and, Uniform sampling 1010 0.09 0.09 for the three orderings, also q0 ∈ {0.05, 0.15, 0.3} at Tc = 1000 (27 runs per sampler: the orderings use 3 seeds per configuration, uniform sampling, which has no q0 , uses threads per process, PyTorch; in round 0 at most two 9 seeds per learning rate). The selection rule was fixed processes in parallel and a run took at most about 30 s; the before the runs: lowest mean censored steps_to_95; ties revision runs used up to five processes in parallel and the go to more seeds reached, then lower η, then lower q0 . longer-budget runs took under two minutes each. Code, The selected configuration of each sampler is used in the logs and the run registry are in the repository linked in confirmatory runs of protocol B below. The tuning grid the author block. has its optimum on the upper edge of the learning-rate V. Results range for every sampler; larger learning rates were not tried. Table I gives the main cell (λ = 1, f = 0.5, seeds 0– Confirmatory runs. Fresh paired seeds 200–209 (10 4) and Fig. 1 the per-seed values; the table columns are seeds; same split and initialisation across systems for mean ± std over seeds, train95 is steps to 95% training a seed; none used for tuning or in round 0) at the accuracy. Steps to 95% are censored at 4000, so means main cell, for uniform sampling and for each of operand- are lower bounds for systems that often did not reach size curriculum, anti-curriculum and shuffled-order pool it. Hypotheses and tests were registered in the project growth at Tc ∈ {250, 500, 1000}. Protocol A repeats the proposal before the main runs. round-0 settings (4000 steps, η = 0.003, q0 = 0.15); H1 (curriculum at least 10% faster than uniform): not protocol B uses the tuned settings of each sampler and supported. The curriculum needed 3955 steps on average a budget of 20000 steps. against 2945 for uniform sampling (Table I); only 1 of 5 Statistics. The estimand is the restricted mean time curriculum seeds reached 95% against 3 of 5 for uniform. to 95% held-out accuracy, E[min(T, τ )] with τ the step The registered test (harness comparison, Table II) gives budget, which for a single censoring time equals the mean Welch p = 0.09 and paired p = 0.09 in the direction of the censored steps_to_95 and the area under the Kaplan– curriculum being slower. These are t-tests on censored Meier curve up to τ ; we also report the Kaplan–Meier times and are not significant at 0.05, so they neither median (n.r. if the curve does not reach 0.5). Systems are show the curriculum slower nor refute a 10% benefit; compared with the two-sample log-rank test on time to the criterion “at least 10% fewer steps” was not met. 95% (a run that does not reach it is censored at τ ) and The survival analysis of the same 5 seeds (Table III) Fisher’s exact test on the number of seeds reaching 95%, gives log-rank p = 0.1492 and a bootstrap interval for with Holm correction inside each stated family of contrasts the relative difference of the restricted mean of +34.30% (family size in the table captions). Confidence intervals for [7.182, 79.77], entirely above −10%: in the registered seeds the relative difference of the restricted mean to uniform the interval excludes a 10% speed-up. With 5 seeds a sampling are percentile intervals of a paired bootstrap over percentile bootstrap interval is optimistic (it excludes seeds (10000 resamples). The registered practical-benefit zero although the log-rank test does not reject), so we margin is a 10% reduction of the time to 95%: an interval read it only as excluding a speed-up and do not claim whose lower end lies above −10% excludes it. The round- the curriculum is slower. The post-hoc 7-seed interval is 0 t-tests (Welch and paired, harness comparison tool) on +16.72% [−8.749, 53.24]. Confirmatory runs on fresh seeds censored values are kept where registered but are not used are in Section VI. as the inferential basis; with 3–5 seeds per cell they have H2 (anti-curriculum not faster than uniform): supported little power in any case. by the direct comparison. The anti-curriculum averaged Hardware and cost. Shared Apple-silicon CPU, 2 3990 steps with 1 of 5 seeds reaching 95% against TABLE IV 4000 Main cell, registered seeds 0–4, extra seeds 5–6, and pooled 7 seeds steps to 95% (censored 4000) 3500 (post hoc). Welch and paired p compare the curriculum with 3000 uniform sampling (no harness key for the anti-curriculum row; its tests are in Table III). 2500 2000 seeds 0–4 (registered) seeds 5–6 only 1500 System steps_to_95 reached steps_to_95 reached 1000 Uniform sampling 2945 ± 1020 3/5 4000 ± 0 0/2 Operand-size curriculum 3955 ± 101 1/5 3375 ± 884 1/2 500 Anti-curriculum 3990 ± 22 1/5 4000 ± 0 1/2 0 pooled, 7 seeds (post hoc) Welch p paired p Unif. Curr. Anti Uniform sampling 3246 ± 979 3/7 Operand-size curriculum 3789 ± 466 2/7 0.22 0.27 Anti-curriculum 3993 ± 19 2/7 – – Fig. 1. Steps to 95% held-out accuracy at the main cell: bars are means, dots individual seeds (censored at 4000). 1.0 TABLE III Uniform sampling Survival analysis of the round-0 main cell (time to 95%, censored Operand-size curriculum at 4000 steps; reached = seeds reaching 95% in the first-named vs. 0.8 Anti-curriculum held-out accuracy the second-named system, i.e. the named system vs. uniform). ∆ is the relative difference of the restricted mean to uniform sampling 0.6 (paired bootstrap over seeds). Holm adjustment over the 3 contrasts within each seed set; the 7-seed rows are post hoc. 0.4 Seeds Contrast reached ∆ mean steps % [95% CI] log-rank p Holm-adj. Fisher p 0–4 (registered) 0–4 (registered) Curriculum vs uniform Anti-curriculum vs uniform 1/5 vs 3/5 1/5 vs 3/5 34.30 [7.182, 79.77] 35.48 [7.133, 83.91] 0.1492 0.1492 0.4477 0.4477 0.5238 0.5238 0.2 0–6 (post hoc) Curriculum vs uniform 2/7 vs 3/7 16.72 [−8.749, 53.24] 0.4359 1 1 0–6 (post hoc) Anti-curriculum vs uniform 2/7 vs 3/7 22.99 [4.798, 55.56] 0.4359 1 1 0.0 0 500 1000 1500 2000 2500 3000 3500 4000 2945 and 3 of 5 for uniform sampling. Tested directly step against uniform sampling (Table III): log-rank p = 0.1492 (Holm over the 3 contrasts 0.4477), Fisher p = 0.5238, Fig. 2. Held-out accuracy versus step at the main cell, mean over relative difference +35.48% [7.133, 83.91]. The registered the two extra seeds 5 and 6 (shaded: range). Runs stop once they reach 95%, so late points average fewer runs. The vertical axis is refutation condition (anti-curriculum significantly faster held-out accuracy. than uniform) is not met here, in the pooled 7 seeds (p = 0.4359) or in the confirmatory runs of Section VI. Its similarity to the curriculum (Table II) is a separate curriculum in 1 of 2 and the anti-curriculum in 1 of 2 (the observation. anti-curriculum crossing was at the final evaluation, step Where grokking is and is not seen. Uniform sampling 4000, so its steps equal the censoring value). Pooled over fits the training set to 95% after about 125 steps and then the 7 seeds the curriculum–uniform gap shrinks from 1010 waits for held-out accuracy, a delayed generalisation of the to 543 steps and is not significant (Welch p = 0.22, paired usual kind: the grok_gap column of Table I (mean 2820) p = 0.27); the log-rank tests against uniform sampling give is a censored lower bound because two uniform seeds never p = 0.4359 (curriculum) and p = 0.4359 (anti-curriculum), reached 95%; in the three that did, the gaps were 1600, Table III. This pooled test was chosen after seeing the data 2350 and 2450 steps. Both orderings reach 95% training and does not replace the registered 5-seed test, which stays accuracy only after about 960 steps, i.e. when the pool the registered test for H1; it shows that the 5-seed gap is has grown to the full training set, and their gap after that not robust, so the data support “no benefit found” and point (2995 and 3025) is not shorter than uniform’s. Fig. 2 do not establish that the curriculum is slower. (two extra seeds, 5 and 6, run in a separate group with H3 (no generalisation at λ = 0): supported within the the same main-cell configuration) shows held-out accuracy budget. None of the 27 runs with λ = 0 (3 fractions × plateauing well below the 95% threshold for all systems 3 systems × 3 seeds) reached 95% (Table V); training before rising in jumps; the curves are noisy, with sharp accuracy was reached but held-out accuracy stayed low. transient drops, which is a sign that η = 0.003 is on the This says nothing about longer training: we do not know unstable side. Seed-level variability is large: at the main whether these runs would generalise after 4000 steps. cell the uniform runs ended at 1700, 2450, 2575 steps or H4 (interaction): inconclusive. See Table V and Fig. 3b. did not reach 95% (two of five seeds). The cells where curriculum and uniform both reached Post-hoc check with seeds 5 and 6. The two extra seeds 95% in every seed are (λ, f ) = (1, 0.7) and (3, 0.7); the were run for the curves of Fig. 2; their outcomes are curriculum is slightly faster at λ = 1 (1733 vs. 1817) and in Table IV. They went against the registered direction: slower at λ = 3 (1267 vs. 1142). The sign flips, so the uniform sampling reached 95% in 0 of 2 seeds, the registered refutation rule (“same sign in every cell where TABLE V TABLE VII Weight decay λ × training fraction f grid. Each entry is mean Tuning on held-out seeds (group tune, 20000-step budget). Selected steps to 95% (censored at 4000) with the number of seeds that configuration per sampler and its mean censored steps_to_95 on reached 95% in brackets; n is the seed count. The (1, 0.5) row is the tuning seeds, against the round-0 default. the main group. Sampler configs runs selected η selected q0 mean steps (selected) mean steps (round-0 default) Uniform 3 27 0.003000 – 3764 3764 λ f n Unif. Curr. Anti Operand-size 9 27 0.003000 0.1500 4933 4933 Anti (reverse) 9 27 0.003000 0.1500 7492 7492 Shuffled 9 27 0.003000 0.3000 8067 9458 0 0.4 3 4000 (0/3) 4000 (0/3) 4000 (0/3) 0 0.5 3 4000 (0/3) 4000 (0/3) 4000 (0/3) 0 0.7 3 4000 (0/3) 4000 (0/3) 4000 (0/3) TABLE VIII 1 0.4 3 4000 (0/3) 4000 (0/3) 4000 (0/3) Protocol A (round-0 settings, 4000 steps, 10 fresh seeds): reached, 1 0.5 5 2945 (3/5) 3955 (1/5) 3990 (1/5) mean steps_to_95 ± sd (restricted mean, censored at 4000), 1 0.7 3 1817 (3/3) 1733 (3/3) 2575 (3/3) Kaplan–Meier median (n.r. = survival curve stays above 0.5) and 3 0.4 3 4000 (0/3) 4000 (0/3) 4000 (0/3) relative difference of the restricted mean to uniform sampling with 3 0.5 3 4000 (0/3) 4000 (0/3) 3358 (1/3) the paired-bootstrap 95% interval. A negative interval end below 3 0.7 3 1142 (3/3) 1267 (3/3) 2358 (2/3) −10 does not exclude a 10% benefit. Order Tc reached mean steps ± sd KM median ∆ vs unif. % [95% CI] TABLE VI Uniform – 7/10 3395 ± 806.6 3900 – Pacing sweep and shuffled-order control at the main cell (5 seeds). Operand-size 250 6/10 3345 ± 905.9 3650 −1.473 [−23.43, 24.28] final acc is held-out accuracy when the run stopped (at the 95% Anti (reverse) 250 5/10 3182 ± 923.6 2850 −6.259 [−24.66, 17.00] crossing or at 4000 steps). Shuffled 250 4/10 3620 ± 540.4 n.r. 6.627 [−6.321, 25.47] Operand-size 500 6/10 3182 ± 908.0 2950 −6.259 [−28.28, 21.18] Anti (reverse) 500 2/10 3872 ± 270.4 n.r. 14.06 [0.6289, 33.51] Variant steps_to_95 reached final acc Shuffled 500 0/10 4000 ± 0 n.r. 17.82 [3.694, 38.17] Operand-size 1000 3/10 3608 ± 716.7 n.r. 6.259 [−15.12, 32.84] curriculum, Tc = 250 2905 ± 727.0 5/5 0.9623 Anti (reverse) 1000 1/10 3838 ± 513.9 n.r. 13.03 [2.960, 28.19] curriculum, Tc = 500 3320 ± 893.4 3/5 0.8423 Shuffled 1000 0/10 4000 ± 0 n.r. 17.82 [3.694, 38.17] curriculum, Tc = 1000 3955 ± 100.6 1/5 0.7457 curriculum, Tc = 2000 3990 ± 22.36 1/5 0.5932 curriculum, Tc = 4000 4000 ± 0 0/5 0.5449 shuffled order, Tc = 1000 4000 ± 0 0/5 0.4921 budget: the pool is not full until step Tc and the training uniform (main group) 2945 ± 1020 3/5 0.8551 set is fitted only at about 1875 (Tc = 2000) and 3700 (Tc = 4000) steps, so little time is left for generalisation and part of the 0/5 and 1/5 outcomes is by construction. both reach 95%”) is not met, but both differences are much The shuffled-order run with Tc = 1000 reached 95% in 0 smaller than the seed spread with 3 seeds, so we do not of 5 seeds against 1 of 5 for the operand-size order (log- claim an interaction. In the remaining cells the curriculum rank p = 0.3173), not evidence for or against a benefit of is never the only system to generalise; in (3, 0.5) only the ordering by operand size. The statement that no pacing or anti-curriculum did (1 of 3 seeds). Training fraction and ordering was better than uniform sampling is restricted to weight decay themselves matter far more than the order: statistical evidence: no round-0 comparison with uniform nothing generalised at f = 0.4 for any λ, and only the sampling showed a statistically supported improvement cells with λ ∈ {1, 3} and f ≥ 0.5 produced successes. (Tc = 250 is the only round-0 pacing whose mean is below that of uniform sampling, log-rank p = 0.5341). VI. Ablations and Analysis Confirmatory runs on fresh seeds. To separate pacing Curriculum length and ordering control. At the main from ordering we ran uniform sampling and the operand- cell we varied the curriculum length Tc and replaced the size, reverse and shuffled orders at Tc ∈ {250, 500, 1000} on operand-size order by a random order with the same 10 fresh paired seeds, under the round-0 settings (protocol pacing (Table VI, Fig. 3a; 5 seeds each; Tc = 1000 is A, 4000 steps; Table VIII, Fig. 4a) and under the tuned the main-group row). settings with a 20000-step budget (protocol B; Table IX, Round 0 reading. With Tc = 250 the curriculum reached Fig. 4b). Tuning (Table VII) selected η = 0.003 for every 95% in 5 of 5 seeds (mean 2905 steps), uniform sampling sampler, q0 = 0.15 for the operand-size and reverse orders in 3 of 5 (mean 2945), and Tc = 1000 in 1 of 5; the means and q0 = 0.3 for the shuffled order; the lower learning degrade monotonically as Tc grows, down to 0 of 5 reached rates were much slower (uniform sampling reached 95% at Tc = 4000. Tc = 250 against uniform sampling is thus in 0 of 9 tuning seeds at η = 0.0003 and in 3 of 9 at the same mean with more seeds reaching 95%: the round-0 0.001 within 20000 steps, against 9 of 9 at 0.003), so no data neither show it as good as uniform nor better (log- more stable learning rate was available within the grid and rank p = 0.5341, Fisher p = 0.4444). The contrast Tc = protocol B differs from protocol A in the budget and in q0 250 against Tc = 1000 (5 of 5 against 1 of 5) was picked of the shuffled order only. The shuffled order in protocol from the 5-level sweep after the fact; among the 10 pairs of B therefore differs from the operand-size order in q0 as lengths its Fisher p = 0.04762 becomes 0.4286 after Holm well as in the ordering; protocol A has equal q0 . correction, and its log-rank p = 0.007242 becomes 0.05793 Against uniform sampling. In protocol B every one of (Table XIII); it is not significant after correction. The two the 100 runs reached 95% (reached counts in Table IX), so longest curricula are confounded with the fixed 4000-step the main comparisons are uncensored. Uniform sampling fraction of seeds reaching 95% (a) pacing sweep, λ=1, f=0.5 steps to 95% (censored 4000) (b) grid 4000 1.0 Unif. Curr. 3500 0.8 Anti 3000 0.6 0.4 2500 curriculum (mean) uniform (mean) 0.2 2000 shuffled order, Tc=1000 0.0 250 500 1000 2000 4000 0/0. 0/0. 0/0. 1/0. 1/0. 1/0. 3/0. 3/0. 3/0. curriculum length Tc (steps) 4 5 7 4 5 7 4 5 7 weight decay / train fraction Fig. 3. (a) Steps to 95% against curriculum length Tc (black dots: seeds; lines: means, uniform and shuffled-order references). (b) Fraction of seeds reaching 95% in each weight-decay/training-fraction cell (3 seeds; 5 at 1/0.5). TABLE IX TABLE X Protocol B (tuned settings, 20000-step budget, same 10 seeds); Protocol A: log-rank test of each system against uniform sampling columns as in Table VIII. (Holm over these 9 contrasts) and Fisher test on the number of seeds reaching 95%. Order Tc reached mean steps ± sd KM median ∆ vs unif. % [95% CI] Uniform – 10/10 3705 ± 1193 3900 – Order Tc log-rank p vs unif. Holm-adj. Fisher p (Holm) Operand-size 250 10/10 4130 ± 1863 3650 11.47 [−22.13, 54.33] Anti (reverse) 250 10/10 4202 ± 2499 2850 13.43 [−24.14, 67.84] Operand-size 250 0.7474 1 1 (1) Shuffled 250 10/10 5358 ± 2728 4350 44.60 [−8.193, 123.5] Anti (reverse) 250 0.7055 1 0.6499 (1) Operand-size 500 10/10 4362 ± 3390 2950 17.75 [−28.57, 85.80] Anti (reverse) 500 10/10 7655 ± 4154 5625 106.6 [44.57, 181.3] Shuffled 250 0.2521 1 0.3698 (1) Shuffled 500 10/10 7390 ± 4633 6175 99.46 [31.84, 187.8] Operand-size 500 0.9776 1 1 (1) Operand-size 1000 10/10 6075 ± 4087 4225 63.97 [3.794, 144.4] Anti (reverse) 500 0.02731 0.1639 0.06978 (0.4187) Anti (reverse) 1000 10/10 9138 ± 4699 9000 146.6 [90.28, 206.3] Shuffled 500 0.001146 0.01032 0.003096 (0.02786) Shuffled 1000 10/10 8715 ± 2141 8875 135.2 [85.81, 205.0] Operand-size 1000 0.1235 0.6173 0.1789 (0.8945) Anti (reverse) 1000 0.009274 0.06492 0.01977 (0.1384) Tc=250 Tc=500 Tc=1000 Shuffled 1000 0.001146 0.01032 0.003096 (0.02786) 1.0 0.9 P(not yet at 95%) 0.8 0.7 0.6 0.5 uniform so these data cannot exclude a 10% benefit for the short operand-size 0.4 0.3 reverse shuffled curricula; they exclude it for the other six cells (lower 0 1000 2000 step 3000 4000 0 1000 2000 step 3000 4000 0 1000 2000 step 3000 4000 end above −10%). The reverse and shuffled orders at Tc ≥ 500 were slower than uniform sampling, the interval Tc=250 Tc=500 Tc=1000 1.0 uniform excluding zero in all four cells (for example reverse at 0.8 operand-size reverse Tc = 1000: +146.6% [90.28, 206.3], Holm-adjusted log- P(not yet at 95%) shuffled 0.6 rank p = 0.004441; shuffled at Tc = 1000: +135.2%, Holm-adjusted p = 5.968 × 10−5 ; reverse at Tc = 500 has 0.4 0.2 0.0 Holm-adjusted p = 0.05597). Under protocol A (censored), 0 5000 10000 15000 20000 0 5000 10000 15000 20000 0 5000 10000 15000 20000 step step step uniform sampling reached 95% in 7 of 10 seeds; the curricula’s intervals all contain zero at Tc = 250 and no Fig. 4. Kaplan–Meier curves of time to 95% held-out accuracy ordering was significantly faster than uniform after Holm (fraction of seeds not yet at 95%), one panel per Tc , protocol A (top, correction in either protocol (Table X, Table XI). censored at 4000) and B (bottom, censored at 20000; no censoring occurred). Pacing and ordering. The shuffled-order control at Tc = 250, the setting where the round-0 effect was seen, reached 95% in 4 of 10 seeds under protocol A against needed 3705 steps on average (Kaplan–Meier median 6 of 10 for the operand-size order and 5 of 10 for the 3900). No ordering was faster: the operand-size curriculum reverse order (Table XII): the operand-size order was not was +11.47% [−22.13, 54.33] at Tc = 250, +17.75% distinguishable from the shuffled order at Tc = 250 (log- [−28.57, 85.80] at Tc = 500 and +63.97% [3.794, 144.4] rank p = 0.4130, Holm 0.9519). The shuffled order itself at Tc = 1000 (log-rank p = 0.03373 at Tc = 1000, Holm- behaved like the others in the pacing sweep: Tc = 250 adjusted over the 9 contrasts of Table XI 0.1687; Tc = 250 against Tc = 1000 gave 4 of 10 against 0 of 10 reached and 500 not significant). The intervals of the operand-size (log-rank p = 0.02905, Holm-adjusted 0.2615), so a pacing curriculum at Tc = 250 and 500 and of the reverse order difference is present in the point estimates without any at Tc = 250 (+13.43% [−24.14, 67.84]) contain −10%, operand-size ordering (not significant after correction), in TABLE XI TABLE XIII Protocol B: as Table X. Fisher tests are uninformative here Contrasts between curriculum lengths: the round-0 contrast and its because all runs reached 95%. replication on fresh seeds. Holm over 10 pairs of lengths (round 0) and over 9 pairs (3 orderings × 3 pairs of lengths) per protocol. Order Tc log-rank p vs unif. Holm-adj. Fisher p (Holm) Data Order Contrast reached Fisher p log-rank p Holm-adj. log-rank p Operand-size 250 0.3243 0.9730 1 round (1)0 (5 seeds, 10 pairs) Operand-size 250 vs 1000 5/5 vs 1/5 0.04762 0.007242 0.05793 A: round-0 settings (10 seeds, 9 pairs) Operand-size 250 vs 1000 6/10 vs 3/10 0.3698 0.2331 1 Anti (reverse) 250 0.5129 1 1 A: (1) round-0 settings (10 seeds, 9 pairs) A: round-0 settings (10 seeds, 9 pairs) Anti (reverse) 250 vs 1000 Shuffled 250 vs 1000 5/10 vs 1/10 4/10 vs 0/10 0.1409 0.08669 0.06174 0.02905 0.4322 0.2615 Shuffled 250 0.07277 0.2911 1 B:(1)tuned, long budget (10 seeds, 9 pairs) Operand-size 250 vs 1000 10/10 vs 10/10 1 0.1357 0.8143 Operand-size 500 0.7656 1 1 B:B:(1) tuned, long budget (10 seeds, 9 pairs) tuned, long budget (10 seeds, 9 pairs) Anti (reverse) 250 vs 1000 10/10 vs 10/10 Shuffled 250 vs 1000 10/10 vs 10/10 1 1 0.01329 0.01681 0.1196 0.1345 Anti (reverse) 500 0.009328 0.05597 1 (1) Shuffled 500 0.002065 0.01446 1 (1) Operand-size 1000 0.03373 0.1687 1 (1) TABLE XIV Anti (reverse) 1000 0.0005552 0.004441 1 (1) Exposure-matched comparison, protocol B: mean steps after the Shuffled 1000 6.631 × 10−6 5.968 × 10−5 1 (1) pool is full (common horizon: budget minus 1000) and relative difference to uniform sampling with the paired-bootstrap interval; log-rank test on the same time scale (Holm over 9). The protocol A TABLE XII version is in results/tables/rev_confA_exposure.tex. Contrasts between orderings at equal Tc (A: protocol A, B: protocol B). Operand-size vs shuffled and reverse vs shuffled: Holm Order Tc steps after pool full ∆ vs unif. % [95% CI] log-rank p (Holm) over these 6 contrasts per protocol; operand-size vs reverse (∆ = Uniform – 3705 – – difference in the number of seeds reaching 95%): Holm over 3 Operand-size 250 3880 4.723 [−28.50, 46.32] 0.4723 (1) Anti (reverse) 250 3952 6.680 [−30.60, 60.03] 0.8257 (1) contrasts per protocol. Shuffled 250 5108 37.85 [−14.02, 115.4] 0.1128 (0.5638) Operand-size 500 3862 4.251 [−40.94, 71.08] 0.8907 (1) Anti (reverse) 500 7155 93.12 [30.84, 166.1] 0.02736 (0.1641) Data Tc Contrast reached Fisher p log-rank p Holm-adj. log-rank p Shuffled 500 6890 85.96 [19.34, 173.5] 0.007066 (0.04946) A 250 Operand-size vs shuffled 6/10 vs 4/10 0.6563 0.4130 0.9519 Operand-size 1000 5075 36.98 [−21.29, 115.3] 0.1842 (0.7369) A 250 Anti (reverse) vs shuffled 5/10 vs 4/10 1 0.4373 0.9519 Anti (reverse) 1000 8138 119.6 [62.70, 179.2] 0.002900 (0.02320) A 500 Operand-size vs shuffled 6/10 vs 0/10 0.01084 0.004016 0.02409 Shuffled 1000 7715 108.2 [62.22, 172.9] 3.961 × 10−5 (0.0003565) A 500 Anti (reverse) vs shuffled 2/10 vs 0/10 0.4737 0.1464 0.5855 A 1000 Operand-size vs shuffled 3/10 vs 0/10 0.2105 0.06707 0.3353 A 1000 Anti (reverse) vs shuffled 1/10 vs 0/10 1 0.3173 0.9519 A 250 Operand-size vs reverse ∆1 1 0.8918 0.8918 A 500 Operand-size vs reverse ∆4 0.1698 0.05043 0.1513 A B 1000 250 Operand-size vs reverse Operand-size vs shuffled ∆2 10/10 vs 10/10 0.5820 1 0.2907 0.1860 0.5814 0.7779 steps below the budget (Table XIV). After the pool is B B 250 500 Anti (reverse) vs shuffled Operand-size vs shuffled 10/10 vs 10/10 10/10 vs 10/10 1 1 0.3951 0.04536 1 0.2721 full the operand-size curriculum was not distinguishable B B 500 1000 Anti (reverse) vs shuffled Operand-size vs shuffled 10/10 vs 10/10 10/10 vs 10/10 1 1 0.9748 0.1556 1 0.7779 from uniform sampling at any Tc in either protocol (for B 1000 Anti (reverse) vs shuffled 10/10 vs 10/10 1 0.5114 1 B 250 Operand-size vs reverse ∆0 1 0.9389 0.9389 example protocol B, Tc = 1000: +36.98% [−21.29, 115.3]), B 500 Operand-size vs reverse ∆0 1 0.1932 0.3864 B 1000 Operand-size vs reverse ∆0 1 0.08392 0.2518 so these data cannot separate the Tc steps spent with a restricted pool from the whole slowdown in steps. The reverse and shuffled orders at Tc ≥ 500 in protocol B the same direction as for the curriculum (6 of 10 against 3 remained slower than uniform sampling after the pool was of 10, log-rank p = 0.2331, Holm 1). The round-0 contrast full, the interval excluding zero in all four cells (reverse, of 5 of 5 against 1 of 5 for the operand-size curriculum Tc = 1000: +119.6% [62.70, 179.2]; shuffled, Tc = 1000: was therefore not reproduced as a significant result on +108.2% [62.22, 172.9]), so the delay of these orders is not fresh seeds in either protocol (Table XIII); the direction accounted for by the steps with a restricted pool alone. is the same, the size smaller. At Tc = 500 the operand- Mechanism. The explanation we offered in round 0 (a size order reached 95% more often than the shuffled small early pool is memorised quickly and the model then order under protocol A (6 of 10 against 0 of 10; log- needs the remaining examples before it finds a solution rank p = 0.004016, Holm 0.02409, Fisher Holm 0.06502), that works for all pairs) remains a hypothesis. The new significant after correction for the log-rank test but not for runs show that restricting the pool delays 95% held-out Fisher’s test; under protocol B, where all runs reach 95% accuracy by an amount that grows with Tc in protocol B and the shuffled order has a different q0 , the same contrast for all three orderings, including a random order of the is p = 0.04536 (Holm 0.2721), and no other operand-size- pool; they do not isolate the memorisation account. This versus-shuffled or reverse-versus-shuffled contrast is signif- is the direction expected from the known dependence of icant after correction in either protocol (Table XII). The grokking time on the amount of training data seen [1], [4], data therefore leave open whether ordering by operand [11], and we make no claim beyond it. size contributes anything beyond pacing. Weight decay and training fraction. The grid (Table V) Exposure-matched comparison. Counting distinct train- is the second sensitivity study. Reading it against H3 ing pairs does not separate the systems: every run in and H4: generalisation within 4000 steps needed both a every cell had drawn all 264 training pairs by the time nonzero weight decay and a large enough training fraction, it stopped (minimum over the runs of a cell, e.g. uniform and in this region the ordering made at most a small sampling in protocol B: 264); the distinct-pair count is difference compared with these two knobs. At f = 0.7 the saturated at the size of the training set for every system. anti-curriculum was slower than uniform at λ = 1 (2575 We therefore matched exposure by counting steps from the vs. 1817) and at λ = 3 (2358 vs. 1142, with 2 of 3 seeds step at which the pool is full (Tc for the three orderings, reaching 95%), which is the clearest ordering effect in the 0 for uniform sampling), at a common horizon of 1000 grid, but with 3 seeds it remains suggestive. VII. Limitations not significant with 5 seeds, and two further seeds run • Scale. One modulus (23), one one-layer architecture, afterwards reversed its direction (pooled 7 seeds: 3789 vs. one learning rate (0.003, selected for every sampler 3246 steps, 2 vs. 3 of 7 reaching 95%, not significant), so in a logged grid of three rates whose optimum lies no ordering showed a benefit and we do not establish a on its upper edge; the round-0 pilot was unlogged), a loss. The round-0 pacing sweep suggested an effect within budget of 4000 steps (20000 in protocol B). A different the curriculum family (Tc = 250 against Tc = 1000), but modulus, depth, larger learning rate or step budget it does not survive correction for multiplicity and was not could change the ordering of the systems; no second reproduced as significant on 10 fresh seeds; a shuffled-order modulus was run. control shows a pacing difference in the same direction, • Censoring and power. Most grid cells have all runs and the evidence on whether operand size matters beyond censored at 4000 steps, so they carry no information pacing is mixed (the operand-size order beat the shuffled about relative speed. The main cell has 5 seeds order after correction at Tc = 500 under protocol A and the grid 3; the test registered for H1 is not only), while the memorisation account remains untested. significant (Table II), so the data neither establish With a 20000-step budget all runs reach 95%: uniform nor exclude a difference. Means of censored values sampling had the smallest mean time, the curriculum at are lower bounds; we reported the fraction reached Tc = 1000 slower (+63.97%, interval [3.794, 144.4]), and alongside. The confirmatory comparisons of protocol a 10% benefit of the short curricula is not excluded. The B are uncensored, but with 10 seeds their intervals pacing effect is consistent with the known dependence of for the short curricula still contain a 10% benefit. grokking time on the training data seen. Weight decay and • Grokking only partly reached. Within the budget, training fraction dominated: no run generalised at λ = 0 delayed generalisation was seen at the main cell for or f = 0.4 within 4000 steps, and the curriculum-versus- uniform sampling and in the cells with λ ≥ 1 and uniform sign flipped between the two cells where both f ≥ 0.5; at λ = 0 and at f = 0.4 it was not reached always succeeded, within noise. A fuller study would add by any run, and we cannot say if longer runs would. more moduli, learning rates above the tuned grid, more • Training instability. Held-out accuracy curves show seeds, and other difficulty measures. sharp transient drops (Fig. 2), and one uniform run at the main cell ended with a training accuracy of References 0.80. Smaller learning rates were tried in the tuning grid and were much slower, most runs not reaching [1] A. Power, Y. Burda, H. Edwards, I. Babuschkin, and 95% within 20000 steps, so the instability was not V. Misra, “Grokking: Generalization Beyond Overfitting on Small Algorithmic Datasets,” arXiv preprint arXiv:2201.02177, removed within the grid. 2022. [Online]. Available: https://arxiv.org/abs/2201.02177 • Narrow curriculum family. A single difficulty measure [2] N. Nanda, L. Chan, T. Lieberum, J. Smith, and (max(a, b)), a single linear pacing function and rank- J. Steinhardt, “Progress measures for grokking via mechanistic interpretability,” arXiv preprint arXiv:2301.05217, 2023. based pools; other measures (e.g. sum size or residue [Online]. Available: https://arxiv.org/abs/2301.05217 structure) were not tried; exposure was matched [3] A. Gromov, “Grokking modular arithmetic,” arXiv preprint only by the post-pool-full analysis and the shuffled arXiv:2301.02679, 2023. [Online]. Available: https://arxiv.org/ abs/2301.02679 control, not by a separate sampler. In protocol B the [4] Z. Liu, O. Kitouni, N. Nolte, E. J. Michaud, M. Tegmark, shuffled control uses the tuned q0 = 0.3, unlike the and M. Williams, “Towards Understanding Grokking: An operand-size and reverse orders. The explanation for Effective Theory of Representation Learning,” arXiv preprint arXiv:2205.10343, 2022. [Online]. Available: https://arxiv.org/ the pacing result is a hypothesis, not tested by an abs/2205.10343 isolating run. [5] Y. Bengio, J. Louradour, R. Collobert, and J. Weston, • Reimplementation. The uniform baseline and the “Curriculum learning,” Proceedings of the 26th Annual model are our own code; no result was compared to International Conference on Machine Learning, 2009. [Online]. Available: https://doi.org/10.1145/1553374.1553380 published numbers, and no mechanistic analysis of [6] X. Wang, Y. Chen, and W. Zhu, “A Survey on Curriculum the learned solution was done. Learning,” arXiv preprint arXiv:2010.13166, 2020. [Online]. • Held-out definition. Held-out accuracy is on the Available: https://arxiv.org/abs/2010.13166 [7] Z. Liu, E. J. Michaud, and M. Tegmark, “Omnigrok: Grokking complement of a random split; both ordering systems Beyond Algorithmic Data,” arXiv preprint arXiv:2210.01117, see exactly the same training pairs as uniform, only 2022. [Online]. Available: https://arxiv.org/abs/2210.01117 their timing differs. [8] M. A. Mohamadi, Z. Li, L. Wu, and D. J. Sutherland, “Why Do You Grok? A Theoretical Analysis of Grokking Modular VIII. Conclusion Addition,” arXiv preprint arXiv:2407.12332, 2024. [Online]. Available: https://arxiv.org/abs/2407.12332 In a one-layer transformer on (a + b) mod 23, an [9] S. Golechha, “Progress Measures for Grokking on Real- operand-size curriculum did not reach 95% held-out ac- world Tasks,” arXiv preprint arXiv:2405.12755, 2024. [Online]. curacy faster than uniform sampling at the main cell Available: https://arxiv.org/abs/2405.12755 [10] X. Davies, L. Langosco, and D. Krueger, “Unifying Grokking (3955 vs. 2945 mean censored steps; 1 vs. 3 of 5 seeds), and Double Descent,” arXiv preprint arXiv:2303.06173, 2023. and the anti-curriculum was no better. The difference is [Online]. Available: https://arxiv.org/abs/2303.06173 [11] X. Zhu, Y. Fu, B. Zhou, and Z. Lin, “Critical Data Size of Language Models from a Grokking Perspective,” arXiv preprint arXiv:2401.10463, 2024. [Online]. Available: https://arxiv.org/abs/2401.10463 [12] B. Sorscher, R. Geirhos, S. Shekhar, S. Ganguli, and A. S. Morcos, “Beyond neural scaling laws: beating power law scaling via data pruning,” arXiv preprint arXiv:2206.14486, 2022. [Online]. Available: https://arxiv.org/abs/2206.14486 [13] I. Loshchilov and F. Hutter, “Decoupled Weight Decay Regularization,” arXiv preprint arXiv:1711.05101, 2017. [Online]. Available: https://arxiv.org/abs/1711.05101 [14] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, and I. Polosukhin, “Attention Is All You Need,” arXiv preprint arXiv:1706.03762, 2017. [Online]. Available: https://arxiv.org/abs/1706.03762