stable-pretraining-v1: Foundation Model Research Made Simple
Randall Balestriero, Hugues Van Assel, Sami BuGhanem, Lucas Maes
TL;DR
This work addresses the heavy engineering burden that constrains foundation-model and self-supervised learning (SSL) research, such as large-scale data handling, complex training loops, and disparate evaluation pipelines. It introduces stable-pretraining, a modular library built atop PyTorch, Lightning, Hugging Face, and TorchMetrics that unifies SSL utilities, including probes, collapse detection metrics, augmentation pipelines, and evaluation routines, under a log-everything framework. The paper details core design choices—a Manager coordinating training, a dictionary-first data/module interface, and plug-and-play callbacks for monitoring—alongside demonstrations such as depth-wise representation probing and analysis of CLIP degradation under synthetic-data fine-tuning. Collectively, stable-pretraining aims to accelerate discovery, improve reproducibility, and lower the barrier to entry for large-scale foundation-model research, enabling rapid iteration and broader exploration of new ideas.
Abstract
Foundation models and self-supervised learning (SSL) have become central to modern AI, yet research in this area remains hindered by complex codebases, redundant re-implementations, and the heavy engineering burden of scaling experiments. We present stable-pretraining, a modular, extensible, and performance-optimized library built on top of PyTorch, Lightning, Hugging Face, and TorchMetrics. Unlike prior toolkits focused narrowly on reproducing state-of-the-art results, stable-pretraining is designed for flexibility and iteration speed: it unifies essential SSL utilities--including probes, collapse detection metrics, augmentation pipelines, and extensible evaluation routines--within a coherent and reliable framework. A central design principle is logging everything, enabling fine-grained visibility into training dynamics that makes debugging, monitoring, and reproducibility seamless. We validate the library by demonstrating its ability to generate new research insights with minimal overhead, including depthwise representation probing and the analysis of CLIP degradation under synthetic data finetuning. By lowering barriers to entry while remaining scalable to large experiments, stable-pretraining aims to accelerate discovery and expand the possibilities of foundation model research.
