Lune

ICLR2026Top-tier venue

Grokking in LLM Pretraining? Monitor Memorization-to-Generalization without Test

Ziyue Li, Chenrui Fan, Tianyi Zhou

Abstract

This paper presents the first study of grokking in practical LLM pretraining. Specifically, we investigate when an LLM memorizes the training data, when its generalization on downstream tasks starts to improve, and what happens if there is a lag between the two. Unlike existing works studying when a small model generalizes to limited and specified tasks during thousands epochs' training on algorithmic data, we focus on a practical setting for LLMs, i.e., near single-pass pretraining of next-token prediction on a cross-domain, large-scale corpus, and generalization on diverse benchmark tasks covering math/commonsense reasoning, code generation, and domain-specific retrieval. Our study, for the first time, verifies that grokking still emerges in pretraining mixture-of-experts (MoE) LLMs, though different local data groups may enter their grokking stages asynchronously due to the heterogeneity of their distributions and attributions to others. To find a mechanistic interpretation of this local grokking, we investigate the dynamics of training data's pathways (i.e., expert choices across layers in MoE). Our primary discovery is that the pathways evolve from random, non-smooth across layers, instance-specific to more structured and transferable across samples, despite the converged pretraining loss. This depicts a transition from memorization to generalization. Two novel metrics are developed to quantify these patterns: one computes the pathway similarity between samples, while the other measures the consistency of aggregated experts between subsequent layers for each sample. These training data based metrics induce near zero cost but can faithfully track and monitor the generalization of LLMs on downstream tasks, reducing reliance on costly instruction tuning and benchmark evaluations. We also ground our findings in a theoretical analysis of one-layer MoE, showing that more structured pathways improve the generalization bound.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

2 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • LoRA: Low-Rank Adaptation of Large Language Models cites Language Models are Few-Shot Learners
  • Beyond Logits: Metastable Latent Dynamics for Sample-Efficient Best-of-N Selection in LLMs cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • Towards Reasoning in Large Language Models: A Survey cites Language Models are Few-Shot Learners
  • Towards Reasoning in Large Language Models: A Survey cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers2

  1. Beyond Logits: Metastable Latent Dynamics for Sample-Efficient Best-of-N Selection in LLMsXinrong Li, Zidong Zhou, Keyu Shen, Wenhao Zhou et al.ICML 2026
  2. Beyond Temperature: Hyperfitting as a Late-Stage Geometric ExpansionMeimingwei Li, Yuanhao Ding, Esteban Garces Arias, Christian HeumannICML 2026

Builds on9

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma et al.NeurIPS 2022 · 22,562 citations
  3. LoRA: Low-Rank Adaptation of Large Language ModelsEdward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu et al.ICLR 2022 · 18,833 citations
  4. Towards Reasoning in Large Language Models: A SurveyJie Huang, Kevin Chen-Chuan ChangACL Findings 2023 · 428 citations
  5. Towards Understanding Grokking: An Effective Theory of Representation LearningZiming Liu, Ouail Kitouni, Niklas Nolte, Eric J. Michaud et al.NeurIPS 2022 · 299 citations

Related papers

  1. What Do Learning Dynamics Reveal About Generalization in LLM Mathematical Reasoning?Katie Kang, Amrith Setlur, Dibya Ghosh, Jacob Steinhardt et al.ICML 2025
  2. XPERT: Expert Knowledge Transfer for Effective Training of Language ModelsChang Liu, boyu shi, Xu Yang, Xin GengICML 2026 · 2 citations
  3. Is Grokking Worthwhile? Functional Analysis and Transferability of Generalization Circuits in TransformersKaiyu He, Mian Zhang, Peilin Wu, Xinya Du et al.ACL Findings 2026
  4. Intrinsic Task Symmetry Drives Generalization in Algorithmic TasksHyeonbin Hwang, Yeachan ParkICML 2026 · 1 citation
  5. Optimal Sparsity of Mixture-of-Experts Language Models for Reasoning TasksTaishi Nakamura, Satoki Ishikawa, Masaki Kawamura, Takumi Okamoto et al.ICLR 2026 · 2 citations
Dusk over the sea between two cliffs drawn in fine vertical lines