Skip to main content
QUICK REVIEW

[Paper Review] Omnigrok: Grokking Beyond Algorithmic Data

Ziming Liu, Eric J. Michaud|arXiv (Cornell University)|Oct 3, 2022
Machine Learning and Data ClassificationComputer Science8 citations
TL;DR

This paper introduces the 'LU mechanism'—a mismatch between L-shaped training loss and U-shaped test loss against weight norm—as the origin of grokking in neural networks. By analyzing reduced 1D loss landscapes, the authors show grokking emerges from slow optimization dynamics due to this loss landscape mismatch, and demonstrate its occurrence across diverse tasks including images, language, and molecules, with stronger effects in representation-heavy tasks like algorithmic datasets.

ABSTRACT

Grokking, the unusual phenomenon for algorithmic datasets where generalization happens long after overfitting the training data, has remained elusive. We aim to understand grokking by analyzing the loss landscapes of neural networks, identifying the mismatch between training and test losses as the cause for grokking. We refer to this as the "LU mechanism" because training and test losses (against model weight norm) typically resemble "L" and "U", respectively. This simple mechanism can nicely explain many aspects of grokking: data size dependence, weight decay dependence, the emergence of representations, etc. Guided by the intuitive picture, we are able to induce grokking on tasks involving images, language and molecules. In the reverse direction, we are able to eliminate grokking for algorithmic datasets. We attribute the dramatic nature of grokking for algorithmic datasets to representation learning.

Motivation & Objective

  • Understand the origin of grokking, a delayed generalization phenomenon observed in neural networks after overfitting.
  • Investigate whether grokking occurs beyond algorithmic datasets, such as in vision, NLP, and molecular property prediction.
  • Explain the dramatic nature of grokking in algorithmic datasets versus weaker signals in real-world datasets.
  • Identify the role of representation learning in amplifying grokking effects through loss landscape analysis.
  • Demonstrate that constrained weight norm training can suppress grokking, validating the mechanism.

Proposed method

  • Define a reduced loss landscape by minimizing training loss over angular directions at fixed weight norm, yielding a 1D function of weight norm w.
  • Visualize and analyze the resulting training loss (L-shaped) and test loss (U-shaped) against weight norm, identifying the LU mechanism.
  • Use a toy teacher-student model to simulate and validate the slow-fast dynamics induced by the LU mechanism.
  • Apply the LU mechanism intuition to real datasets (MNIST, IMDb, QM9) with modified training setups to induce grokking signals.
  • Compare loss landscapes between algorithmic and real-world datasets to explain differences in grokking severity.
  • Constrain weight norm during training to empirically eliminate grokking, validating the mechanism’s predictive power.

Experimental results

Research questions

  • RQ1What causes the delayed generalization observed in grokking, particularly after overfitting?
  • RQ2Can grokking be induced in non-algorithmic datasets such as image classification, sentiment analysis, and molecule property prediction?
  • RQ3Why is grokking more dramatic in algorithmic datasets compared to real-world datasets like MNIST?
  • RQ4How does representation learning influence the strength and observability of grokking signals?
  • RQ5Can the LU mechanism explain data size dependence, weight decay dependence, and representation emergence in grokking?

Key findings

  • The LU mechanism—where training loss is L-shaped and test loss is U-shaped against weight norm—explains the origin of grokking through a mismatch in loss landscapes.
  • Grokking is observed in image classification (MNIST), sentiment analysis (IMDb), and molecule property prediction (QM9), though signals are weaker than in algorithmic tasks.
  • The severity of grokking correlates strongly with the dependence of test performance on learned representations, which is high in algorithmic datasets and low in MNIST.
  • Constraining weight norm during training nearly eliminates grokking, confirming that the loss landscape mismatch is central to the phenomenon.
  • The grokking time scales as t ∝ 1/λ, matching empirical observations and supporting the LU mechanism’s predictive validity.
  • The study shows that reduced loss landscape analysis is a powerful tool for diagnosing data-model interactions and representation learning dynamics.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.