[Paper Review] Scaling Expert Language Models with Unsupervised Domain Discovery
This paper introduces c-BTM, a method to train sparse expert language models by unsupervised clustering of text corpora into domain-specific groups, enabling communication-efficient, embarrassingly parallel training. It achieves better performance than dense models with significantly lower FLOPs by specializing experts to learned clusters, with gains increasing with more clusters and larger data.
Large language models are typically trained densely: all parameters are updated with respect to all inputs. This requires synchronization of billions of parameters across thousands of GPUs. We introduce a simple but effective method to asynchronously train large, sparse language models on arbitrary text corpora. Our method clusters a corpus into sets of related documents, trains a separate expert language model on each cluster, and combines them in a sparse ensemble for inference. This approach generalizes embarrassingly parallel training by automatically discovering the domains for each expert, and eliminates nearly all the communication overhead of existing sparse language models. Our technique outperforms dense baselines on multiple corpora and few-shot tasks, and our analysis shows that specializing experts to meaningful clusters is key to these gains. Performance also improves with the number of experts and size of training data, suggesting this is a highly efficient and accessible approach to training large language models.
Motivation & Objective
- To address the high communication and synchronization cost of training large dense language models across thousands of GPUs.
- To enable scalable, communication-efficient training of sparse expert language models without relying on metadata for domain definition.
- To investigate whether unsupervised clustering can discover meaningful domains that improve model performance compared to dense baselines.
- To explore the scaling properties of expert models trained on automatically discovered clusters, particularly in relation to number of experts and data size.
Proposed method
- Apply k-means clustering to a text corpus to discover domain-like groups without using metadata.
- Initialize expert language models (ELMs) from a pre-trained base model (e.g., OPT-1.3B) and fine-tune each ELM independently on its assigned cluster.
- Use a sparse ensemble inference mechanism that selects the top-k experts based on cosine similarity between the input context embedding and each expert’s cluster center.
- Train experts in an embarrassingly parallel fashion, minimizing inter-GPU communication by avoiding synchronized parameter updates.
- Balance clusters during training using offline clustering to ensure even expert utilization and avoid routing bottlenecks.
- Combine the outputs of top-k experts via weighted averaging during inference, enabling efficient sparse computation.
Experimental results
Research questions
- RQ1Can unsupervised clustering of text corpora effectively discover meaningful domains that improve language model performance compared to dense training?
- RQ2How does the number of clusters (i.e., number of experts) affect model performance and training efficiency?
- RQ3Does c-BTM outperform dense baselines in terms of perplexity and FLOP efficiency when scaling to larger datasets?
- RQ4How does the performance of c-BTM compare to existing sparse MoE models with learned routing mechanisms?
- RQ5To what extent does balanced clustering, as opposed to random or unbalanced clustering, impact model performance?
Key findings
- c-BTM outperforms compute-matched dense language models in validation perplexity, with gains increasing as the number of clusters grows.
- Training 128 expert LMs (168B total parameters) on 168B tokens using only 8 GPUs at a time demonstrates effective parallelization and scalability.
- Using 128 experts with top-4 inference achieves similar performance to using all experts, and even top-1 inference outperforms the dense model.
- c-BTM with 1.3B-parameter experts and sparse inference achieves the same perplexity as a 6.7B-parameter dense model but with only 29% of the training FLOPs.
- Balanced clustering performs as well as expert assignment using gold metadata and significantly outperforms random or unbalanced clustering.
- The optimal number of clusters increases with training data size, and performance improves monotonically with more clusters and larger data.
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.