Unified View of Grokking, Double Descent and Emergent Abilities: A Perspective from Circuits Competition

Yufei Huang, Shengding Hu, Xu Han, Zhiyuan Liu, Maosong SunarXiv 2024

Abstract

Recent studies have uncovered intriguing phenomena in deep learning, such as grokking, double descent, and emergent abilities in large language models, which challenge human intuition and are crucial for a deeper understanding of neural models. In this paper, we present a comprehensive framework that provides a unified view of these three phenomena, focusing on the competition between memorization and generalization circuits. This approach, initially employed to explain grokking, is extended in our work to encompass a wider range of model sizes and training data volumes. Our framework delineates four distinct training dynamics, each depending on varying combinations of model size and training data quantity. Utilizing this framework, we provide a detailed analysis of the double descent phenomenon and propose two verifiable predictions regarding its occurrence, both substantiated by our experimental results. Moreover, we expand our framework to the multi-task learning paradigm, demonstrating how algorithm tasks can be turned into emergent abilities. This offers a novel perspective to understand emergent abilities in Large Language Models.

Introduction

Deep learning often defies classical statistical intuition. We observe grokking, where a model suddenly learns to generalize long after it has already overfitted to the training data. We see double descent, where increasing model size or data initially helps, then hurts, and then helps again. Finally, we see emergent abilities in Large Language Models (LLMs), where complex skills like reasoning appear abruptly only after a model reaches a certain massive scale.

Usually, researchers study these "anomalies" in isolation. This paper argues that these are different manifestations of the same underlying dynamics: the internal competition between different types of neural circuits.

The Circuits Competition Hypothesis

The researchers build upon the hypothesis that neural sub-structures can be categorized into two types:

  1. Memorization Circuits: These are "greedy." They develop quickly and achieve high training accuracy but have high parameter norms (they are "heavy") and fail to generalize.
  2. Generalization Circuits: These are "efficient." They take longer to form but have lower parameter norms and work well on unseen data.

The transition from memorization to generalization is driven by weight decay. Because generalization circuits are more parameter-efficient, the optimizer eventually prefers them over memorization circuits to minimize the total loss, provided the model has enough capacity and training time.

The Four-Zone Framework

The paper’s central contribution is a phase diagram that maps training dynamics across two variables: Model Size and Training Data Volume.

Phase diagram of training dynamics categorized by model size and training data volume.

As shown in Figure 1, the framework identifies four distinct zones:

  • Progression: Occurs with plenty of data or small models, leading to standard learning.
  • Ungrokking: Occurs when data is too sparse, causing the model to fail at generalization entirely.
  • Grokking: The "sweet spot" where memorization happens first, followed by a slow transition to generalization.
  • Semi-grokking: A regime where the model achieves partial generalization.
Training (blue) and validation (green) accuracy curves across the four identified regimes.

Figure 2 illustrates how these dynamics manifest in training and validation accuracy over time. In the grokking regime (c), validation accuracy remains near zero long after training accuracy hits 1.0, before eventually surging.

Explaining Double Descent and Emergent Abilities

The authors show that double descent occurs when increasing the model size moves the system through these zones. For instance, a model might move from the "progression" zone into the "ungrokking" trough (where performance drops) and finally into the "grokking" regime as size increases further.

To study emergent abilities, the researchers used a multi-task learning setup, mixing an algorithmic task with a "pure memorization" task (random labels). They found that the memorization task "crowds out" the generalization circuits. In their experiments, adding a memorization task forced the model to be 1570 times larger before the algorithmic ability emerged, compared to learning the algorithm alone. This suggests that emergence in LLMs may be the result of models finally becoming large enough to accommodate specific generalization circuits alongside massive amounts of memorized factual data.

Conclusion

By framing training as a competition between circuits, this work provides a unified theoretical lens for several of deep learning's most puzzling behaviors. While the study relies on toy algorithmic tasks and 1-layer transformers, it offers a compelling explanation for how scaling leads to the sudden emergence of complex capabilities. Future work will involve validating these findings on larger, more realistic natural language datasets and exploring architectural optimizations like Mixture-of-Experts to encourage functional differentiation.

Summary updated

BibTeX
@misc{huang2024unified,
  author = {Yufei Huang and Shengding Hu and Xu Han and Zhiyuan Liu and Maosong Sun},
  title = {{Unified View of Grokking, Double Descent and Emergent Abilities: A Perspective from Circuits Competition}},
  year = {2024},
  eprint = {2402.15175},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.15175},
}
Figure