Training Transformers Together

Alexander Borzunov, Max Ryabinin, Tim Dettmers, Quentin Lhoest, Lucile Saulnier, Michael Diskin, Yacine Jernite, Thomas Wolf · DOI

Abstract

Training state-of-the-art, billion-parameter models has traditionally been the exclusive domain of large technology companies with access to massive supercomputers. This paper demonstrates that by pooling heterogeneous hardware from volunteers over the public internet, it is possible to successfully train a 1.1-billion-parameter DALL-E-style model. This work proves that decentralized, collaborative deep learning is a viable path for the broader research community, effectively bridging the "compute divide."

Introduction

We are currently in an era of "compute-heavy" AI. Training the latest Transformers requires high-performance computing (HPC) clusters with specialized interconnects and massive budgets. This creates a divide where only a few large corporations can afford to push the boundaries of the field. This research tackles the engineering challenges of moving this process to the public internet, where hardware is heterogeneous, connections are slow, and the environment is inherently insecure.

Methods

The authors utilized the hivemind library to coordinate decentralized training. Their approach relies on several key technical pillars:

  • Communication Efficiency: To handle slow internet speeds, the team used large-batch training and aggressive 8-bit quantization for exchanging gradients and parameters, significantly reducing bandwidth requirements.
  • Memory Efficiency: They employed 8-bit optimizers and offloaded optimizer statistics to the CPU. To fit a large model on consumer GPUs, they used weight tying, which reduced the parameter count by 8x while maintaining the same amount of computation.
  • Fault Tolerance: The method allows devices to process different numbers of samples per batch, ensuring that slow home connections do not bottleneck faster participants.
  • Security: Authentication and gradient aggregation techniques were implemented to remain robust against "poisoning" or malicious participants.

Data and Infrastructure

The primary dataset used was LAION-400M, specifically the first 100 million image-text pairs. To save bandwidth, images were preprocessed into VQGAN codes and compressed using Brotli, resulting in an 18x reduction in data transfer. Dataset streaming was essential to make collaborative training accessible to the average user without requiring massive local downloads.

Results

The resulting model is a decoder-only transformer with approximately 1.1 billion parameters, 64 layers, and 1024 hidden units. The training run lasted 2.5 months, engaging 37 volunteers.

Qualitatively, the model produced reasonable images for various prompts, excelling at capturing styles, textures, and colors. Most impressively, the model showed an ability to generalize to concepts not present in the training set, such as generating a "Communist Statue of Liberty" by combining learned embeddings in novel ways.

Limitations and Future Work

Despite its success, the 1.1B parameter model is still relatively small for the LAION dataset, leading to some loss of detail and occasional struggles with complex spatial reasoning. The primary bottleneck for scaling to even larger models remains the gap between home internet and data center interconnects. Future work will involve refining these decentralized algorithms to support more participants and larger architectures, further closing the gap between grassroots research and industrial labs.

Summary updated

BibTeX
@inproceedings{borzunov2021training,
  author = {Alexander Borzunov and Max Ryabinin and Tim Dettmers and Quentin Lhoest and Lucile Saulnier and Michael Diskin and Yacine Jernite and Thomas Wolf},
  title = {{Training Transformers Together}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=cyXLNaEqFTC},
}
Figure