Scaling Laws for Sparsely-Connected Foundation Models

Elias Frantar, Carlos Riquelme Ruiz, Neil Houlsby, Dan Alistarh, Utku Evci

Introduction

In recent years, "scaling laws"—such as those established by OpenAI and DeepMind's Chinchilla—have allowed researchers to predictably forecast a dense model's performance based on its parameter count and training data. Concurrently, model compression techniques like weight sparsity (pruning) have become increasingly popular for reducing the massive computational costs of these models.

However, the interaction between sparsity and these scaling laws has remained largely unknown. Most pruning research evaluates models on smaller datasets (like ImageNet) where dense models eventually saturate, making it easy for sparse models to appear competitive. In the "foundation model" regime, where models are trained on massive datasets and dense models continuously improve with more compute, it is entirely unclear if training a larger, sparse model is a better use of a fixed compute budget than simply training a smaller, dense model.

This paper bridges that gap by introducing the first scaling laws for sparsely-connected foundation models, mapping the relationship between weight sparsity, non-zero parameter count, and training data across both vision and language domains.

Methodology: Formulating the Joint Scaling Law

To understand these dynamics, the authors conducted massive training sweeps across different model sizes, training durations, and sparsity levels (ranging from 0% to 87.5%). They sparsified the models during pretraining using Gradual Magnitude Pruning (GMP), a robust technique that gradually removes the smallest weights. To ensure the results apply to modern foundation models, they used massive datasets across two domains: JFT-4B (4 billion images) for Vision Transformers (ViT), and C4 (>150 billion tokens) for T5 and standard decoder-only language models.

Using empirical data from these sweeps, they fitted a novel joint scaling law equation:

$$L(S, N, D) = (a_S(1-S)^{b_S} + c_S) \cdot (1/N)^{b_N} + a_D/D^{b_D} + c$$

Here, $S$ represents sparsity, $N$ is the number of non-zero parameters, and $D$ is the amount of training data.

Quality of fit for the joint scaling law

This fitted scaling law proved remarkably robust. It successfully predicted the loss of a 2.3 billion parameter T5 model pruned to 75% sparsity—a massive ~6.75x extrapolation beyond the data used to fit the curve, demonstrating the predictive power of the formulation.

Key Insights and Discoveries

Sparsity and Data are Independent

The scaling law reveals that sparsity acts as a penalty to the model's capacity (the parameter term in the equation) but doesn't significantly interact with the data term. This means sparsity affects models of different sizes in roughly the same multiplicative way. The relative capacity gained through sparsity is surprisingly consistent across both vision and text domains, effectively acting as a universal multiplier on parameter count.

The "2.15x Rule" and Capacity Multipliers

The authors identified clear equivalencies between sparse and dense models trained on the same amount of data:

  • A model with 75% sparsity performs similarly to a fully dense model with ~2.15x the number of parameters.
  • 50% sparsity yields a ~1.6x capacity multiplier.
  • 87.5% sparsity yields a ~2.6x capacity multiplier.

Sparsity Loves Long Training

If you have a fixed compute budget, the "optimal sparsity" level increases the longer you train. Sparse models overtake dense models only when you train significantly longer than the standard "Chinchilla-optimal" baseline, where dense model gains start to diminish.

Optimal sparsity contours for ViT/JFT

Pretrained vs. Scratch

If you already have a fully trained dense model, pruning it is highly efficient—up to 4x more efficient than sparsifying from scratch. However, if you factor in the sunk cost of the initial pretraining, pruning from scratch is actually more compute-efficient overall.

Structured Sparsity Works

The authors also extended their experiments to include hardware-friendly structured sparsity (n:m patterns, like 2:4 or 4:8) using a custom iterative pruning algorithm. They found that hardware-accelerated n:m sparsity patterns perform almost identically to 50% unstructured sparsity, yielding the same ~1.6x capacity gain while being much easier to accelerate on modern GPUs.

Limitations and Future Work

The study focuses strictly on the "infinite data" pretraining regime (a single pass over massive data). Sparsity might behave differently in data-constrained environments where models are trained for multiple epochs and overfitting is a risk. Additionally, the chosen pruning method (GMP) was optimized for stability across massive scaling sweeps; highly specialized, state-of-the-art pruning algorithms might yield slightly better absolute performance. Finally, at extreme sparsity levels (e.g., 64x compression), the models sometimes deviate from the predicted scaling curves due to optimization bottlenecks.

Future work will look to extend these scaling laws to target actual wall-clock speedups on specific hardware—rather than just theoretical parameter counts and FLOPs—and explore how these pretraining sparsity laws transfer to specialized downstream finetuning tasks.

Summary updated

BibTeX
@inproceedings{frantar2024scaling,
  author = {Elias Frantar and Carlos Riquelme Ruiz and Neil Houlsby and Dan Alistarh and Utku Evci},
  title = {{Scaling Laws for Sparsely-Connected Foundation Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=i9K2ZWkYIP},
}
Figure