acceptodds
Published as a conference paper at NeurIPS 2026

Slower Generalization, Faster Memorization: A Sweet Spot in Algorithmic Learning

Shin So, Kyelim Lee, Albert No

Abstract

Critical-data-size accounts of grokking suggest a natural post-threshold intuition: once training data is sufficient to identify the underlying rule, additional data should accelerate validation convergence. We show that this intuition can fail in a controlled structured-output task. In Needleman–Wunsch (NW) matrix generation, small Transformers reach high validation exact-match accuracy fastest at an intermediate dataset size, not at the largest one. Past this dataset-size sweet spot, generalization remains achievable but requires more gradient updates. Conversely, in the regime where partial validation competence first appears, larger datasets can require fewer updates to reach high training accuracy, suggesting that emerging rule structure can accelerate fitting beyond example-wise memorization. A multiplication baseline does not show the same post-threshold slowdown. These results separate the critical data size for the onset of generalization from the dataset size that optimizes update-based convergence, and identify structured-output tasks where learning the rule and completing exact-fitting can diverge.

Keywords:
Sydney, Main Track

Reviews

Among:
Shape:
123456this paper, Bottom 3%
Figure 1. Mean review rating of the reviewed papers at NeurIPS 2026. This paper averages 3.50 over 2 reviews, above 3% of the others.
Reviewer_q5JtOpenReview ↗
Rating
3
Clarity
3
Confidence
4
Originality
3
Quality
3
Significance
2
Read review
Summary

This paper studies how dataset size affects the timing of memorization and generalization in small Transformers trained on algorithmic tasks. The main empirical finding is that, for Needleman–Wunsch (NW) matrix generation, validation exact-match accuracy reaches high thresholds fastest at an intermediate dataset size rather than at the largest dataset size. The paper contrasts this behavior with addition and multiplication baselines, where the same post-threshold slowdown is not observed. The authors propose a two-pressure explanation: increasing data first helps the model learn reusable rule structure, but after this benefit saturates, additional examples increase the cost of strict exact fitting. A random-suffix probe is used to support the distinction between rule-mediated fitting and example-specific memorization.

Strengths and weaknesses

Strengths

  • The paper identifies an interesting and somewhat counterintuitive empirical phenomenon: after validation generalization becomes possible, more data does not always minimize the number of optimizer updates needed to reach high validation exact-match accuracy.
  • The experimental protocol is clean and controlled. Dataset size is swept systematically, and the paper clearly distinguishes update-based convergence from epoch-normalized/sample-efficiency interpretations.
  • The multi-threshold analysis is useful. Lower thresholds help reveal the onset of partial validation competence, while high thresholds capture near-exact task completion.
  • The observation that weak validation competence can emerge before strict training convergence is valuable, since it complicates a purely sequential “memorize first, generalize later” view of grokking.
  • The random-suffix probe is a helpful diagnostic for separating structured, rule-mediated learning from example-specific fitting.

Weaknesses

  • My main concern is the limited scope of the empirical evidence. The main phenomenon is demonstrated primarily on one synthetic structured-output task, Needleman–Wunsch matrix generation. Addition and multiplication are useful controls, but they do not establish that the phenomenon generalizes to broader algorithmic-learning or structured-output settings.
  • The explanation of why NW differs from multiplication remains somewhat underdeveloped. The paper attributes the difference partly to NW’s longer structured output, but output length is confounded with dynamic-programming dependency structure, serialization order, exact-match evaluation, and model/task difficulty.
  • Some abstract-level phrasing is confusing. In particular, “the regime where partial validation competence first appears” is not clearly contrasted with the previous claim about post-sweet-spot high validation convergence. It is unclear from the abstract alone whether “first appears” refers to dataset size or training time, and the sentence switches from validation convergence to training convergence.
  • Figure 4 would be easier to interpret if it showed the raw ATA_T and ARA_R curves in addition to their difference AT−ARA_T - A_R. Showing only the gap can obscure whether the diagnostic is driven by increasing structured training accuracy, lagging suffix accuracy, or both.
Questions

Questions

  1. Could the authors clarify the abstract sentence about “partial validation competence first appears”? I think the intended meaning is that, near the dataset-size regime where low validation thresholds first become reachable, increasing NN can reduce the updates needed for high training accuracy. Stating this explicitly would avoid confusion with the later post-sweet-spot slowdown in high validation convergence.

  2. Can the authors provide stronger evidence that the NW/multiplication difference is due to long dependent structured outputs rather than only output length or task difficulty? For example, it would be useful to test partial NW matrices, longer arithmetic outputs, alternative serialization orders, or another dynamic-programming table-generation task.

  3. In Figure 4, could the authors include the raw ATA_T and ARA_R trajectories, perhaps as faint curves or a companion panel? This would make the train-random gap diagnostic more transparent.

  4. How sensitive is the sweet spot to model capacity and optimization choices? The depth sweep is helpful, but it would be useful to know whether the phenomenon persists under larger models, different batch sizes, or different learning-rate schedules.

  5. The paper interprets residual exact fitting as a memorization-like burden. Could the authors clarify whether they view this as literal example lookup, local associative/copying mechanisms, or simply remaining optimization difficulty under exact-match evaluation?

Limitations

Yes

Paper formatting concerns

No

1 comment

We sincerely thank the reviewer for the careful and highly constructive review.

W1. Limited empirical scope

We agree that evidence beyond NW is important. We therefore evaluated two additional structured tasks. All tables report threshold-crossing iterations at τ=0.98, averaged over five seeds; “–” indicates that the validation threshold was not reached within the training budget.

Edit-distance matrix generation (ED) is a controlled NW variant with the same three-predecessor DP structure and sequential output, but a nonnegative min-cost recurrence (zero-cost matches; insertion/deletion/substitution penalties) in place of NW's signed max-score recurrence.

ED: NN2005007001k5k10k50k
ITI_T3.72k3.60k3.18k3.26k7.52k7.46k19.50k
IVI_V––6.03k5.98k7.72k7.48k19.50k

Elementary cellular automata (CA) provide a structurally different iterative task. Each cell updates in parallel every step from its own value and its two neighbors, following a Boolean rule identified by a rule number. We use a 20-bit circular state and train the model to generate the full 8-step rollout. Rule 90, which sets each cell to the XOR of its neighbors, again exhibits a clear intermediate dataset-size optimum.

CA Rule 90: NN3004005007001k2k3k
ITI_T1.80k2.60k2.30k2.80k5.50k9.10k14.70k
IVI_V––4.40k3.00k5.60k9.10k14.70k

These experiments reproduce the phenomenon beyond NW in two complementary settings. Edit distance changes the scoring convention and output-value distribution while preserving the DP dependency structure. Rule 90 extends the result beyond matrix generation to repeated application of a local transition rule. The phenomenon is not universal across all CA rules. We discuss the contrasting Rules 30 and 110 below.


W2&Q2 Why does NW differ from multiplication?

We agree that our original explanation placed too much emphasis on the long output of NW, while dependency structure, evaluation, and task difficulty are intertwined.

First, the sweet spot persists even with partial outputs. Instead of the full matrix, we trained the model to predict only 2-row/2-column targets. A clear sweet spot was still observed with a shorter output.

Partial NW: NN2005001k2k3k4k5k10k50k
ITI_T1.80k2.70k3.50k6.30k5.90k8.20k10.30k15.00k18.70k
IVI_V––7.30k7.20k6.00k8.20k10.30k15.00k18.70k

Second, we observed larger-N slowdown with scratchpad multiplication. The scratchpad target contains sequential, intermediate steps (products and their addition). Although this does not reproduce the full sweet spot, increasing the dataset size induces a clear slowdown in convergence.

Scratchpad Mul: NN1k5k10k50k100k500k1M5M
ITI_T1.36k3.10k3.74k2.74k3.52k3.34k3.60k5.16k
IVI_V–––2.74k3.54k3.34k3.56k5.56k

Thus, multiplication can also exhibit the post-threshold pressure when the target requires explicit intermediate computation, although our current sweep does not show a full interior optimum.

Third, the CA experiments show the learnability of the local rule matters. Rules 90, 30, and 110 are identical except for the local Boolean transition rule. Rule 90, a linear XOR rule, exhibits a clear sweet spot, whereas Rules 30 and 110 do not under the same setup. This matched comparison suggests that the learnability of the repeated operation is also important.

These results suggest that the effect is not explained by output length, sequentiality, or task difficulty alone. This is consistent with the two-pressure interpretation: the phenomenon appears most clearly when a nontrivial but learnable operation is repeatedly applied over a structured output. In this regime, more data can initially speed reusable rule learning, but its growing exact-fitting burden may later dominate.

NW differs from multiplication not by task type or output length, but because its reusable local recurrence can be learned early and keep reducing fitting costs beyond generalization, while multiplication lacks such a recurrence.

We also verified that this is not an artifact of the strict exact-match. Average cell accuracy shows the sweet spot persists.

NW cell: NN2005001k2k3k4k5k10k50k100k
ITI_T6.22k10.20k9.24k10.14k11.54k10.84k12.20k14.54k24.08k36.45k
IVI_V–––12.45k13.24k11.84k13.06k14.76k24.04k36.45k

W3&Q1. Ambiguous abstract wording

The reviewer's interpretation is exactly correct. "First appears" refers to the dataset-size regime, not training time. Our intended meaning is:

Near the dataset-size regime where low validation thresholds first become reachable, increasing N can reduce the updates needed for high training accuracy.

We will revise the abstract to clearly distinguish training from validation convergence.


W4&Q3. Figure 4 and the raw AT,ARA_T, A_R trajectories

We agree that the raw curves are needed to show what drives the gap. We will add ATA_T and ARA_R from Appendix E to Figure 4 alongside AVA_V and G(t)G(t). They show that the widening gap is driven mainly by ARA_R lagging as NN grows. Here, G=AT−AR>0G=A_T-A_R>0 indicates better fitting of rule-supported targets (ATA_T) than rule-independent suffixes (ARA_R). Structured targets benefit from the shared rule, whereas random suffixes must be fit independently, so their fitting burden grows with the number of examples.


Q4. Sensitivity to model capacity and optimization choices

As the reviewer suggested, we report additional experiments. We conducted an 8-layer model, weight decay and batch size sweep.

8-layer models runs are averaged over 3 seeds.

L8: NN2k4k10k50k100k
ITI_T7.97k8.53k14.53k18.67k30.05k
IVI_V16.30k9.67k15.13k18.67k30.05k

Batch size denotes the effective batch size (micro-batch size ×\times gradient-accumulation steps).

BSNN2005001k2k3k4k5k10k50k100k
80ITI_T9.64k14.38k18.00k21.40k18.48k11.28k21.54k29.02k37.20k44.60k
IVI_V–––22.20k12.40k13.38k22.82k25.30k37.06k44.60k
320ITI_T5.36k6.74k8.52k10.06k11.10k9.20k14.38k18.18k16.62k28.88k
IVI_V–––38.90k18.30k12.42k16.94k19.40k16.76k28.90k

Weight decay addresses the optimization choices. Because it is closely linked to grokking-style memorization/generalization dynamics, we consider it a particularly important robustness test for our effect.

wdNN2005001k2k3k4k5k10k50k100k
0ITI_T5.38k7.90k10.98k12.60k17.00k15.48k15.80k30.18k33.20k33.37k
IVI_V–––31.60k30.10k10.60k24.80k28.20k33.40k33.43k
0.01ITI_T5.62k8.20k10.16k13.40k18.06k13.26k15.50k26.40k27.18k30.50k
IVI_V–––41.00k24.80k16.18k22.60k29.58k27.26k30.50k
0.03ITI_T6.16k8.26k10.64k12.08k13.06k12.60k14.94k23.70k23.00k39.17k
IVI_V–––17.20k19.63k16.68k19.32k26.75k23.10k39.20k

The results consistently preserve the sweet spot behavior across model capacity, effective batch size, and weight decay. Notably, the sweet spot remains clearly visible even when weight decay is set to zero, showing that explicit weight-decay regularization is not required for the effect to emerge in our setting. This indicates that the phenomenon is not an artifact of a particular hyperparameter choice.


Q5. Residual Exact Fitting

By "memorization-like", we refer to the behavioral burden of fitting individual training cases, not literal example lookup or a specific associative/copying mechanism.

As noted in W4&Q3, ARA_R​ reflects fitting that cannot benefit from a shared rule. Around the onset of generalization, we observe AT−AR≈AVA_T−A_R≈A_V​. The train-random gap estimates the training performance attributable to the NW rule, closely tracking AVA_V during this transition (though this may not persist later in training).

Accordingly, "residual exact fitting" denotes the optimization still needed for training cases not yet captured by the model's current reusable rule. Since NW is fully rule-generated, these cases are not intrinsically outside the rule; the learned rule may simply be incomplete. Such training-specific fitting and further rule refinement can therefore coexist, with no fixed ordering implied. This is consistent with [1,2], where dependence on specific examples can coexist with, and sometimes aid, generalization.

Our experiments do not identify whether this fitting arises via literal lookup, local associative mechanisms, or otherwise. Doing so would require direct counterfactual or influence-based analysis. We will revise the paper to use the term in this operational sense.

[1] Feldman, “Does Learning Require Memorization? …” STOC 2020.

[2] Feldman & Zhang, “What Neural Networks Memorize and Why: ...,” NeurIPS 2020.

Reviewer_HoWpOpenReview ↗
Rating
4
Clarity
3
Confidence
3
Originality
3
Quality
3
Significance
2
Read review
Summary

The paper studies the relative speed of generalization and memorization, instead of always following a strict ordering of generalization happening after memorization, can be reversed. In Needleman–Wunsch (NW) matrix generation, small transformer models learns the underlying dynamic programming rule faster, resulting in the highest validation accuracy at an intermediate dataset size instead of the largest size. On the contrary, past this sweet spot, instance fitting becomes the learning bottleneck, requiring more gradient updates before achieving generalization.

Strengths and weaknesses

Strengths

  1. (Originality) The paper studies a very interesting phenomenon that refined the classical view in grokking and shows that "memorization and generalization are not purely sequential [and] partial rule learning can make fitting easier";
  2. (Quality) The study is relatively complete and the experiment details are well-documented;
  3. (Clarity) Overall writing is clear and very easy-to-follow;

Weaknesses

  1. (Significance) While this is an interesting study, the scope, especially where the finding applies and transfers, remains limited:
    • The study mainly focuses on only one synthetic NW matrix generation task; although the paper claims to expect similar results on other tasks like edit distance, Smith–Waterman, Viterbi, or parsing tables where generalization / rule learning emerges early, there is no established results;
    • It feels that the scope can also be strengthened with a discussion / analysis of the broader implication. For example (the following is more of suggestions), connecting it to the observation in modern LLM (pre-)training, where structured data like code can improve the model's reasoning capabilities disproportionately, or synthetic data of algorithmic tasks / small high-quality data can "unlock" certain capabilities.
Questions

The primary concerns are about the scope of the paper (see weakness 1). The finding itself is very interesting and can refine current understanding of generalization and memorization behaviors.

  1. Can similar results be reproduced on at least one more task?
  2. What are some potential broader implications of this finding in modern practice of model training?

If the two questions above can be addressed during the revision, the reviewer is willing to raise the rating to a higher score.

Limitations

Yes

Paper formatting concerns

N/A

Final justification

The author's rebuttal has mostly addressed my concern regarding the limited scope of evaluation and broader implication. Overall I believe the work consists of an interesting and insightful study and complements the current understanding of generalization and memorization. Therefore, I raised my score to 4.

1 comment

We sincerely thank the reviewer for the constructive comments and for recognizing the potential of our finding to refine the conventional view of memorization and generalization.

W1&Q1. Limited task scope / generalizability

We agree that empirical evidence beyond NW would substantially strengthen the paper. Motivated by this review, we tested additional structured tasks under the same update-based analysis. All results are averaged over 5 seeds.

Edit-distance (ED) matrix generation preserves the same three-neighbor dynamic-programming structure as NW, but uses a nonnegative min-cost recurrence with zero-cost matches and insertion, deletion, and substitution penalties, rather than NW's signed max-score recurrence with match rewards and mismatch/gap penalties. We therefore use it as a controlled variant that keeps the underlying sequential table-generation structure fixed while changing the optimization direction, score semantics, sign pattern, and output-value distribution.

ED: NN2005007001k5k10k50k
ITI_T at τ=0.98\tau=0.983.72k3.60k3.18k3.26k7.52k7.46k19.50k
IVI_V at τ=0.98\tau=0.98––6.03k5.98k7.72k7.48k19.50k

Edit distance exhibits the same qualitative pattern as NW: validation first becomes attainable near the intermediate regime, reaches its fastest crossing at NN=1k, and then slows as NN increases.

Elementary cellular automata (CA) provide a structurally different iterative-computation task. Starting from a 20-bit binary state, every cell is updated in parallel from its three-bit local neighborhood according to a fixed Boolean rule. We use circular boundary conditions and predict an eight-step rollout. For Rule 90, whose update is the XOR of the left and right neighbors, validation convergence again has a clear intermediate optimum.

CA Rule 90: NN3004005007001k2k3k
ITI_T at τ=0.98\tau=0.981.80k2.60k2.30k2.80k5.50k9.10k14.70k
IVI_V at τ=0.98\tau=0.98––4.40k3.00k5.60k9.10k14.70k

This result shows that the phenomenon is not restricted to dynamic-programming matrices: it also appears in a rollout task requiring repeated composition of a shared local rule.

4-digit scratchpad multiplication spells out the intermediate partial products and their addition in the target. Once reliable generalization becomes attainable, increasing the dataset size produces a clear large-N slowdown rather than a full interior optimum.

scratchpad Mul: NN5001k5k10k50k100k500k1M5M
ITI_T at τ=0.98\tau=0.981.90k1.36k3.10k3.74k2.74k3.52k3.34k3.60k5.16k
IVI_V at τ=0.98\tau=0.98––––2.74k3.54k3.34k3.56k5.56k

These results fit the two-pressure interpretation proposed in our paper. Increasing NN can initially help the model acquire reusable structure, allowing one learned rule to explain many training examples at once. As this benefit saturates, however, additional examples continue to increase the remaining exact-fitting burden, so the validation update cost can eventually rise with NN. Whether this trade-off produces a full interior optimum or only a large-NN slowdown therefore depends on the task's learning regime.

Importantly, the phenomenon is not universal even within one task family. Under the same CA state length, rollout horizon, boundary condition, architecture, and training protocol, Rule 90 appears to occupy a favorable regime in which its reusable XOR rule can be learned but must still be composed repeatedly across rollout steps, much as NW repeatedly applies a local dynamic-programming recurrence. Rules 30 and 110, by contrast, are learned readily enough by the model that no sweet spot appears. We therefore view task-dependent learnability, the balance between how readily reusable structure is acquired and how much exact fitting remains, as a plausible determinant of the observed data-scaling curve.

We will add these results and revise the scope of our claims accordingly.


W2&Q2. Limited discussion of broader implications

Thank you for suggesting this broader connection. We believe our controlled setting captures, in one of the simplest possible forms, an optimization trade-off that may also underlie capability unlocking from structured, synthetic, or small high-quality datasets: maximizing the number of distinct examples is not always the fastest route to acquiring a reusable computation. While our experiments do not directly establish this behavior in large-scale LLM training, they isolate a setting in which a smaller, appropriately sized dataset enables faster emergence of structured generalization than a substantially larger one.

Our finding connects directly to Charton and Kempe [1]. Under a fixed training budget, they show that Transformers trained on smaller sets of repeated examples can outperform models trained on larger sets of mostly single-use examples. Their intervention varies repetition while ours varies dataset size under a fixed update protocol, but both results point to the same optimization-level lesson: the number of distinct examples is itself a training variable and need not always be maximized. In our setting, additional diversity eventually provides diminishing benefit for reusable-rule acquisition while increasing the remaining fitting burden; in [1], reducing diversity increases repeated exposure to a smaller set and can improve learning. Both observations point to the same question: how to balance example diversity against repeated optimization, rather than maximizing diversity by default.

We view our result as a more abstract controlled connection that provides a useful starting point for similar trade-offs in modern structured domains such as code or synthetic reasoning data, where relatively small amounts of informative data can sometimes unlock new capabilities. We will add this connection while clearly distinguishing it from our direct empirical claims.

[1] François Charton & Julia Kempe, "Emergent Properties with Repeated Examples." arXiv preprint arXiv:2410.07041, 2024.

Comments on the paper

1 comment
Meta-review

This paper presents a novel discovery regarding the classic grokking behavior: in certain tasks (NW matrix generation) the traditional ordering of generalization happening after memorization can be reversed, resulting in small transformers reaching the highest validation accuracy fastest at an intermediate dataset size.

Strengths: most reviewers agree the paper is overall very well-written. The studied phenomenon is quite novel and even counterintuitive empirically, the authors also provided useful baselines like digit multiplication where the slowdown was not observed. The experiment is rigorously conducted and the provided explanation is reasonable and clear.

Weaknesses: all reviewers point out this paper's limited scope: only the synthetic NW matrix generation task is studied, so it is unclear how this behavior translates to real-world structured-output scenarios. I would suggest the authors to add more experiments on other tasks in the rebuttal to further strengthen the paper's broad applicability in more domains.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.