[Paper Review] DiLoCo: Distributed Low-Communication Training of Language Models
DiLoCo proposes a distributed training framework for large language models that drastically reduces communication by using large inner optimization steps (500) with AdamW and outer Nesterov momentum updates, achieving performance comparable to fully synchronous training while communicating 500× less data on the C4 dataset, and demonstrating robustness to data distribution, worker availability changes, and heterogeneous devices.
Large language models (LLM) have become a critical component in many applications of machine learning. However, standard approaches to training LLM require a large number of tightly interconnected accelerators, with devices exchanging gradients and other intermediate states at each optimization step. While it is difficult to build and maintain a single computing cluster hosting many accelerators, it might be easier to find several computing clusters each hosting a smaller number of devices. In this work, we propose a distributed optimization algorithm, Distributed Low-Communication (DiLoCo), that enables training of language models on islands of devices that are poorly connected. The approach is a variant of federated averaging, where the number of inner steps is large, the inner optimizer is AdamW, and the outer optimizer is Nesterov momentum. On the widely used C4 dataset, we show that DiLoCo on 8 workers performs as well as fully synchronous optimization while communicating 500 times less. DiLoCo exhibits great robustness to the data distribution of each worker. It is also robust to resources becoming unavailable over time, and vice versa, it can seamlessly leverage resources that become available during training.
Motivation & Objective
- Address the challenge of training large language models when accelerators are not co-located and communication bandwidth is limited.
- Overcome the scalability and reliability issues of fully synchronous distributed training, which require tightly synchronized, high-bandwidth clusters.
- Enable training across multiple isolated clusters (‘islands’) of devices with poor inter-cluster connectivity.
- Improve robustness to data distribution shifts, worker failures, and dynamic availability of compute resources.
- Maintain model performance and efficiency comparable to fully synchronous training while minimizing communication overhead.
Proposed method
- Adopt a federated averaging-inspired framework with large inner steps (H=500) to reduce communication frequency.
- Use AdamW as the inner optimizer for each worker’s local model update, matching standard LLM training practices.
- Apply Nesterov momentum as the outer optimizer to update the global model parameters after aggregating gradients from all workers.
- Decouple model updates into local training phases and infrequent global synchronization, reducing inter-node communication to once every 500 steps.
- Allow workers to operate on different hardware types and locations, with only periodic parameter synchronization.
- Re-dispatch the updated global model to all workers after each outer optimization step, enabling iterative refinement.
Experimental results
Research questions
- RQ1Can a distributed training method with infrequent communication achieve performance comparable to fully synchronous training in large language model training?
- RQ2How robust is the method to variations in data distribution across different worker shards?
- RQ3Can the method handle dynamic changes in worker availability during training, such as failures or new resources joining?
- RQ4Does the method scale effectively beyond 8 workers, and what are the limits of communication reduction?
- RQ5Can the approach maintain training stability and convergence when using non-uniform or heterogeneous devices across clusters?
Key findings
- DiLoCo achieves performance on the C4 dataset that matches or exceeds fully synchronous training in terms of perplexity, despite communicating 500 times less data.
- The method is robust to diverse data distributions across worker shards, maintaining stable training and convergence.
- DiLoCo handles dynamic worker availability gracefully, seamlessly incorporating new workers and recovering from failures.
- The approach enables training across geographically distributed clusters with low-bandwidth connections, reducing communication to once every few minutes instead of every few hundred milliseconds.
- DiLoCo maintains model efficiency and inference speed identical to fully synchronous models, with no performance penalty at inference time.
- While DiLoCo shows diminishing returns beyond 8 workers, it demonstrates strong wall-clock time efficiency and robustness in heterogeneous, loosely connected environments.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.