ArticleslgStudy

computer science

Grokking (machine learning)

Grokking (machine learning) is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Grokking (machine learning) rather than just read about it. In short: In machine learning, grokking, or delayed generalization, is a phenomenon observed in some settings where a model abruptly transitions from overfitting (performing well only on training data) to generalizing (performing well on both training and test data), after many training iterations with little or no improvement on the held-out data. This contrasts with what is typically observed in machine learning, where gene…

Grokking (machine learning) — main illustration
Grokking (machine learning) — illustration

Key takeaways

  • Grokking (machine learning) belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Grokking (machine learning) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Grokking (machine learning) from memory before moving on to harder problems.

Reference excerpt

In machine learning, grokking, or delayed generalization, is a phenomenon observed in some settings where a model abruptly transitions from overfitting (performing well only on training data) to generalizing (performing well on both training and test data), after many training iterations with little or no improvement on the held-out data. This contrasts with what is typically observed in machine learning, where generalization occurs gradually alongside improved performance on training data.

Origin The term grokking was introduced by OpenAI researcher Alethea Power and colleagues in the January 2022 paper "Grokking: Generalization Beyond Overfitting on Small Algorithmic Datasets". It is derived from the word grok coined by Robert Heinlein in his novel Stranger in a Strange Land. In ML research, "grokking" is not used as a synonym for "generalization"; rather, it names a sometimes-observed delayed‑generalization training phenomenon in which training and held‑out performance do not improve in tandem, and in which held‑out performance rises abruptly after a long period in which test performance has reached what appears to be a maximum value. Authors also analyze the "grokking time", the epoch or step at which this transition occurs in those scenarios.

Interpretations Grokking can be understood as a phase transition during the training process. In particular, recent work has shown that grokking may be due to a complexity phase transition in the model during training. While grokking has been thought of as largely a phenomenon of relatively shallow models, grokking has been observed in deep neural networks and non-neural models and is the subject of active research. One potential explanation is that the weight decay (a component of the loss function that penalizes higher values of the neural network parameters, also called regularization) slightly favors the general solution that is simpler (in that it involves lower weight values) but that is also harder to find. According to Neel Nanda, the process of learning the general solution may be gradual, even though the transition to the general solution occurs more suddenly later. Recent theories have hypothesized that grokking occurs when neural networks transition from a "lazy training" regime where the weights do not deviate far from initialization, to a "rich" regime where weights abruptly begin to move in task-relevant directions. Follow-up empirical and theoretical work has accumulated evidence in support of this perspective, and it offers a unifying view of earlier work as the transition from lazy to rich training dynamics is known to arise from properties of adaptive optimizers, weight decay, initial parameter weight norm, and more. This perspective is complementary to a unifying "pattern learning speeds" framework that links grokking and double descent; within this view, delayed generalization can arise across training time ("epoch‑wise") or across model size ("model‑wise"), and the authors report "model‑wise grokking".

See also Overfitting Generalization error Double descent Neural tangent kernel Feature learning Reward hacking AI alignment Information bottleneck method Regularization (mathematics) Statistical learning theory

References

Sources

Illustrations

Grokking (machine learning): The blue loss curves represent early memorization of the training set (overfitting), and the red curves show late generalization, with the learning of a modular addition algorithm that works with unseen inputs.[1]
The blue loss curves represent early memorization of the training set (overfitting), and the red curves show late generalization, with the learning of a modular addition algorithm that works with unseen inputs.[1]

Worked examples

Example 1 — a first encounter with Grokking (machine learning)

Start with the simplest possible case. Write down what Grokking (machine learning) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Grokking (machine learning) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Grokking (machine learning) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Grokking (machine learning)

In research
Grokking (machine learning) appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Grokking (machine learning) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Grokking (machine learning) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Machine learning, Phenomena, so understanding it makes those chapters shorter.
In everyday life
Look for Grokking (machine learning) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Grokking (machine learning)” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Grokking (machine learning) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Grokking (machine learning) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Grokking (machine learning) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Grokking (machine learning) in simple terms?

In machine learning, grokking, or delayed generalization, is a phenomenon observed in some settings where a model abruptly transitions from overfitting (performing well only on training data) to generalizing (performing well on both training and test data), after many training iterations with littl…

Why does Grokking (machine learning) matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Grokking (machine learning)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Grokking (machine learning).

Tags

  • Machine learning
  • Phenomena

Keep exploring