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.
翻译:基础模型与自监督学习已成为现代人工智能的核心,然而该领域的研究仍受限于复杂的代码库、冗余的重新实现以及扩展实验的沉重工程负担。我们推出stable-pretraining——一个基于PyTorch、Lightning、Hugging Face和TorchMetrics构建的模块化、可扩展且性能优化的开源库。与以往仅专注于复现前沿结果的工具包不同,stable-pretraining专为灵活性与迭代速度设计:它将自监督学习的关键工具(包括探针、坍缩检测指标、数据增强流水线及可扩展的评估流程)统一于一个连贯可靠的框架中。其核心设计原则是记录所有训练过程,通过细粒度的训练动态可视化实现无缝的调试、监控与结果复现。我们通过展示该库能以最小开销生成新研究见解(包括深度表征探针分析及CLIP模型在合成数据微调下的性能退化研究)验证了其有效性。通过降低研究门槛并保持大规模实验的可扩展性,stable-pretraining旨在加速基础模型研究的发现进程并拓展其可能性边界。