Towards Compute-Optimal Transfer Learning

Massimo Caccia, Alexandre Galashov, Arthur Douillard, Amal Rannen-Triki, Dushyant Rao, Michela Paganini, Laurent Charlin, Marc'Aurelio Ranzato, Razvan PascanuarXiv 2023 · DOI

Introduction

The current paradigm in artificial intelligence is dominated by the "bigger is better" philosophy. Large pretrained "foundation" models have set new benchmarks across various domains due to their remarkable ability to adapt to downstream tasks. However, this power comes at a significant cost: finetuning these models requires substantial memory and computational resources. For researchers and practitioners operating on a limited FLOP (Floating Point Operations) budget, the most capable models are often out of reach.

This paper explores a solution to this bottleneck: zero-shot structured pruning. By strategically removing components of a model before finetuning, it is possible to trade a marginal amount of peak potential performance for massive gains in compute efficiency, making transfer learning viable even on a tight budget.

The Compute-Optimal Frontier

A central challenge in transfer learning is determining the right model size for a given computational budget. While a larger model might have a lower "asymptotic error" (the error it achieves with infinite compute), it may perform worse than a smaller model if the training budget is strictly limited. This is because the smaller model can undergo more training iterations within the same budget.

Conceptual illustration of how sparsification shifts the compute-optimal frontier.

As shown in the conceptual plots above, sparsification (pruning) allows a high-capacity foundation model to shift its error-compute curve. This enables the model to reach lower error rates faster, effectively creating a new "compute-optimal" frontier for transfer learning where larger, pruned models outperform smaller, dense ones.

Methodology: Zero-Shot Structured Pruning

The authors focus on pruning the model before it encounters downstream task data, a process known as zero-shot pruning. This is significantly more efficient than traditional pruning-and-retraining cycles. The pruning decisions are based simply on the magnitude of the pretrained weights, which the authors found to be a highly effective signal.

The research highlights a critical distinction between two types of structured pruning:

  1. Channel Pruning: This method removes entire "tubes" of data. While it reduces FLOPs, it also shrinks the internal representation size (feature maps), which can severely limit the model's learning capacity—a phenomenon called the "representation bottleneck."
  2. Convolutional Filter Pruning: This is the "Goldilocks" solution. It removes specific filters within a layer, reducing compute density while preserving the overall dimensionality of the data flowing through the network.

Empirical Evaluation

The proposed methods were tested using the Nevis’22 benchmark, specifically the SHORT stream consisting of 25 diverse visual classification tasks. These tasks range from standard object recognition to specialized domains like medical imaging, OCR, and texture analysis. All models were pretrained on ImageNet before being pruned and transferred.

Results and Analysis

The results demonstrate that in low-compute regimes, pruning convolutional filters provides a substantial advantage across both transfer and continual learning paradigms.

Empirical results comparing pruning methods across diverse visual tasks showing the benefits of filter pruning.

Key findings include:

  • Efficiency Gains: In constrained environments, filter pruning led to a performance boost of over 20% compared to finetuning the original dense model with the same FLOP budget.
  • Superiority of Filter Pruning: Filter pruning consistently outperformed channel pruning and other common baselines, such as only finetuning specific blocks of the network. It achieved nearly the same performance-to-compute tradeoff as unstructured pruning but with real-world speedups.
  • Hardware Compatibility: Unlike unstructured (random) pruning, structured filter pruning translates directly into actual speedups on standard hardware like GPUs and TPUs because it maintains the dense matrix operations the hardware is optimized for.

Conclusion

Zero-shot structured pruning offers a practical path toward compute-optimal transfer learning. By focusing on convolutional filters, researchers can maintain high-dimensional representations while drastically reducing the cost of adaptation. While this study focused on CNNs (specifically ResNet50), the principles suggest a promising future for similar techniques in Transformer architectures, potentially democratizing access to the world's most powerful AI models.

Summary updated

BibTeX
@misc{caccia2023towards,
  author = {Massimo Caccia and Alexandre Galashov and Arthur Douillard and Amal Rannen-Triki and Dushyant Rao and Michela Paganini and Laurent Charlin and Marc'Aurelio Ranzato and Razvan Pascanu},
  title = {{Towards Compute-Optimal Transfer Learning}},
  year = {2023},
  eprint = {2304.13164},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2304.13164},
}
Figure