gzip Predicts Data-dependent Scaling Laws

Rohan PandeyarXiv 2024 · DOI

Introduction

Neural scaling laws, most notably the Chinchilla scaling law, have become the cornerstone of efficient Large Language Model (LLM) development. These laws provide a roadmap for balancing model parameters ($N$) and training tokens ($D$) to minimize loss for a given compute budget. However, a critical assumption underlying these laws is that they are largely data-agnostic. This research challenges that assumption, investigating whether the complexity of the training data itself dictates a different optimal scaling strategy.

Methodology: Measuring Complexity with gzip

To systematically explore data-dependent scaling, the study utilizes Probabilistic Context-Free Grammars (PCFG) to generate synthetic datasets with precisely controlled syntactic complexity. By varying the number of grammar rules and production lengths, the researchers created a spectrum of datasets ranging from highly structured to nearly random.

A key innovation of this work is the use of gzip compression as a proxy for information-theoretic entropy. The gzip compressibility ratio ($H$) serves as a "complexity meter," allowing for a cheap and scalable way to categorize both synthetic and real-world data.

Comparison of compressibility between real-world data (Code, Natural Language) and synthetic PCFG datasets, demonstrating that PCFGs effectively span the complexity range of natural data.

The experimental setup involved training a suite of Transformer models, ranging from 4.2 million to 1.4 billion parameters, across six synthetic datasets with $H$ values ranging from 0.11 to 0.61.

Key Insights: The End of One-Size-Fits-All Scaling

The primary finding is that scaling laws are fundamentally data-dependent. The "1-to-1" scaling ratio suggested by Chinchilla is a specific instance applicable to general web text, but it fails to generalize to data with different entropy levels.

  1. Complexity Shifts the Strategy: As data becomes more complex (higher $H$), the optimal allocation of compute shifts toward training on more tokens rather than increasing model parameters. Conversely, for "simpler" data like Python code, the model benefits more from increased parameter counts.
  2. The Crossover Point: The research identifies a balance point at a compressibility ratio of approximately 0.27. Below this threshold, parameters are the priority; above it, data volume becomes the dominant factor for performance gains.
  3. Code vs. Prose: Real-world code is significantly more compressible than natural language prose. This implies that specialized models for code should be "parameter-heavy" relative to their training sets compared to general-purpose LLMs.

Empirical Results and Compute Efficiency

The training dynamics across different model sizes confirm these shifts. Larger models demonstrate a more pronounced sensitivity to data complexity, as seen in the training loss trajectories.

Training loss curves for a 1.4B parameter model across varying levels of data complexity (gzip ratio), showing how higher complexity leads to higher irreducible loss and slower convergence.

By incorporating the gzip ratio into the scaling law equations, the researchers derived a more accurate predictive model. Applying this "data-aware" law to specialized domains yields significant efficiency gains. For example, the authors estimate that a model like StarCoder (6B parameters) could achieve the same performance while using 24% fewer FLOPs if the training was optimized for the specific complexity of code. This translates to a potential saving of nearly $280,000 in compute costs for a single large-scale training run.

Conclusion

This work demonstrates that gzip is a powerful, low-cost tool for predicting the scaling behavior of neural models. By moving beyond data-agnostic scaling laws, researchers can significantly optimize compute allocation, particularly when training specialized models on non-standard datasets. Future work will focus on validating these coefficients across a wider array of real-world datasets and exploring neural-based entropy estimators for even finer-grained scaling predictions.

Summary updated

BibTeX
@misc{pandey2024gzip,
  author = {Rohan Pandey},
  title = {{gzip Predicts Data-dependent Scaling Laws}},
  year = {2024},
  eprint = {2405.16684},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.16684},
}
Figure