Efficient Language Modeling with Sparse all-MLP
Ping Yu, Mikel Artetxe, Myle Ott, Sam Shleifer, Hongyu Gong, Ves Stoyanov, Xian Li
TL;DR
This work tackles expressiveness gaps in all-MLP language models by introducing sparsely activated Mixture-of-Experts (sMLP) that route computations in both feature and token dimensions. It presents two routing strategies—Deterministic Routing and Partial Prediction—implemented via tMoE and sMoE modules to avoid autoregressive leakage while enabling conditional computation. Empirically, sMLP delivers lower perplexity and up to 2x faster pretraining than Transformer-based MoEs and dense transformers, scales to large parameter counts, and achieves superior zero-shot in-context learning on six tasks. Overall, sparse all-MLP emerges as a competitive alternative for large-scale NLP pretraining with practical efficiency and downstream benefits.
Abstract
All-MLP architectures have attracted increasing interest as an alternative to attention-based models. In NLP, recent work like gMLP shows that all-MLPs can match Transformers in language modeling, but still lag behind in downstream tasks. In this work, we analyze the limitations of MLPs in expressiveness, and propose sparsely activated MLPs with mixture-of-experts (MoEs) in both feature and input (token) dimensions. Such sparse all-MLPs significantly increase model capacity and expressiveness while keeping the compute constant. We address critical challenges in incorporating conditional computation with two routing strategies. The proposed sparse all-MLP improves language modeling perplexity and obtains up to 2$\times$ improvement in training efficiency compared to both Transformer-based MoEs (GShard, Switch Transformer, Base Layers and HASH Layers) as well as dense Transformers and all-MLPs. Finally, we evaluate its zero-shot in-context learning performance on six downstream tasks, and find that it surpasses Transformer-based MoEs and dense Transformers.
