Critical Data Size of Language Models from a Grokking Perspective
Xuekai Zhu, Yao Fu, Bowen Zhou, Zhouhan Lin
TL;DR
The paper investigates how data size governs the transition from memorization to generalization in language models by introducing the Critical Data Size (CDS) and the Data Efficiency Hypothesis. It develops a grokking configuration based on initialization rescaling and weight decay to reproduce data-dependent phase transitions across modular addition, IMDB, Yelp, and instruction-tuning tasks, and validates both sample-wise and model-wise grokking. The results show that CDS shifts upward with model size and reveal interpretable weight-norm dynamics across learning stages, underscoring the nuanced role of data quantity and regularization. Practically, the work offers data-pruning and initialization-control techniques to surface learning dynamics, informing how data and capacity should be balanced in real-language model training.
Abstract
We explore the critical data size in language models, a threshold that marks a fundamental shift from quick memorization to slow generalization. We formalize the phase transition under the grokking configuration into the Data Efficiency Hypothesis and identify data insufficiency, sufficiency, and surplus regimes in language models training dynamics. We develop a grokking configuration to reproduce grokking on simplistic language models stably by rescaling initialization and weight decay. We show that generalization occurs only when language models reach a critical size. We analyze grokking across sample-wise and model-wise, verifying the proposed data efficiency hypothesis. Our experiments reveal smoother phase transitions occurring at the critical dataset size for language datasets. As the model size increases, this critical point also becomes larger, indicating that larger models require more data. Our results deepen the understanding of language model training, offering a novel perspective on the role of data in the learning mechanism of language models.
