Lune

ICLR2024Top-tier venue

To Grok or not to Grok: Disentangling Generalization and Memorization on Corrupted Algorithmic Datasets

Darshil Doshi, Aritra Das, Tianyu He, Andrey Gromov

Abstract

Robust generalization is a major challenge in deep learning, particularly when the number of trainable parameters is very large. In general, it is very difficult to know if the network has memorized a particular set of examples or understood the underlying rule (or both). Motivated by this challenge, we study an interpretable model where generalizing representations are understood analytically, and are easily distinguishable from the memorizing ones. Namely, we consider multi-layer perceptron (MLP) and Transformer architectures trained on modular arithmetic tasks, where (ξ⋅100%\xi \cdot 100\%) of labels are corrupted (i.e. some results of the modular operations in the training set are incorrect). We show that (i) it is possible for the network to memorize the corrupted labels and achieve 100%100\% generalization at the same time; (ii) the memorizing neurons can be identified and pruned, lowering the accuracy on corrupted data and improving the accuracy on uncorrupted data; (iii) regularization methods such as weight decay, dropout and BatchNorm force the network to ignore the corrupted data during optimization, and achieve 100%100\% accuracy on the uncorrupted dataset; and (iv) the effect of these regularization methods is (``mechanistically'') interpretable: weight decay and dropout force all the neurons to learn generalizing representations, while BatchNorm de-amplifies the output of memorizing neurons and amplifies the output of the generalizing ones. Finally, we show that in the presence of regularization, the training dynamics involves two consecutive stages: first, the network undergoes grokking dynamics reaching high train and test accuracy; second, it unlearns the memorizing representations, where the train accuracy suddenly jumps from 100%100\% to 100(1−ξ)%100 (1-\xi)\%.

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.

10 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

  • Grokking Beyond the Euclidean Norm of Model Parameters cites Hidden Progress in Deep Learning: SGD Learns Parities Near the Computational Limit
  • On The Geometry and Topology of Representations: the Manifolds of Modular Addition cites Uncovering a Universal Abstract Algorithm for Modular Addition in Neural Networks
  • On The Geometry and Topology of Representations: the Manifolds of Modular Addition cites Learning to grok: Emergence of in-context learning and skill composition in modular arithmetic tasks
  • Memorization Without Overfitting: Analyzing the Training Dynamics of Large Language Models cites Extracting Training Data from Large Language Models
  • Uncovering a Universal Abstract Algorithm for Modular Addition in Neural Networks cites Towards Understanding Grokking: An Effective Theory of Representation Learning
  • Uncovering a Universal Abstract Algorithm for Modular Addition in Neural Networks cites Learning to grok: Emergence of in-context learning and skill composition in modular arithmetic tasks
  • Learning to grok: Emergence of in-context learning and skill composition in modular arithmetic tasks cites Towards Understanding Grokking: An Effective Theory of Representation Learning
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers10

  1. Learning to grok: Emergence of in-context learning and skill composition in modular arithmetic tasksTianyu He, Darshil Doshi, Aritra Das, Andrey GromovNeurIPS 2024 · 52 citations
  2. Uncovering a Universal Abstract Algorithm for Modular Addition in Neural NetworksGavin McCracken, Gabriela Moisescu-Pareja, Vincent Létourneau, Doina Precup et al.NeurIPS 2025 · 14 citations
  3. On The Geometry and Topology of Representations: the Manifolds of Modular AdditionGabriela Moisescu-Pareja, Gavin McCracken, Harley Wiltzer, Colin Daniels et al.ICLR 2026 · 3 citations
  4. FIRE-Bench: Evaluating AI Agents on the Rediscovery of Scientific InsightsZhen Wang, Fan Bai, Zhongyan Luo, Jinyan Su et al.ICML 2026 · 2 citations
  5. Grokking Beyond the Euclidean Norm of Model ParametersPascal Tikeng Notsawo Jr., Guillaume Dumas, Guillaume RabusseauICML 2025

Builds on10

  1. Extracting Training Data from Large Language ModelsNicholas Carlini, Florian Tramèr, Eric Wallace, Matthew Jagielski et al.USENIX Security 2021 · 2,866 citations
  2. Deep Learning on a Data Diet: Finding Important Examples Early in TrainingMansheej Paul, Surya Ganguli, Gintare Karolina DziugaiteNeurIPS 2021 · 806 citations
  3. Memorization Without Overfitting: Analyzing the Training Dynamics of Large Language ModelsKushal Tirumala, Aram H. Markosyan, Luke Zettlemoyer, Armen AghajanyanNeurIPS 2022 · 304 citations
  4. Towards Understanding Grokking: An Effective Theory of Representation LearningZiming Liu, Ouail Kitouni, Niklas Nolte, Eric J. Michaud et al.NeurIPS 2022 · 299 citations
  5. Hidden Progress in Deep Learning: SGD Learns Parities Near the Computational LimitBoaz Barak, Benjamin L. Edelman, Surbhi Goel, Sham M. Kakade et al.NeurIPS 2022 · 220 citations

Related papers

  1. Why Do You Grok? A Theoretical Analysis on Grokking Modular AdditionMohamad Amin Mohamadi, Zhiyuan Li, Lei Wu, Danica J. SutherlandICML 2024
  2. The Curious Case of Benign MemorizationSotiris Anagnostidis, Gregor Bachmann, Lorenzo Noci, Thomas HofmannICLR 2023 · 1 citation
  3. Progress measures for grokking via mechanistic interpretabilityNeel Nanda, Lawrence Chan, Tom Lieberum, Jess Smith et al.ICLR 2023 · 54 citations
  4. Grokking in Linear Estimators - A Solvable Model that Groks without UnderstandingNoam Itzhak Levi, Alon Beck, Yohai Bar-SinaiICLR 2024 · 24 citations
  5. Can Neural Network Memorization Be Localized?Pratyush Maini, Michael Curtis Mozer, Hanie Sedghi, Zachary Chase Lipton et al.ICML 2023 · 82 citations
Dusk over the sea between two cliffs drawn in fine vertical lines