[Paper Review] Lory: Fully Differentiable Mixture-of-Experts for Autoregressive Language Model Pre-training
Lory introduces a fully differentiable MoE framework for autoregressive language model pre-training using causal segment routing and similarity-based data batching, achieving strong perplexity and downstream gains with segment-level expert merging.
Mixture-of-experts (MoE) models facilitate efficient scaling; however, training the router network introduces the challenge of optimizing a non-differentiable, discrete objective. Recently, a fully-differentiable MoE architecture, SMEAR, was proposed (Muqeeth et al., 2023), which softly merges experts in the parameter space; nevertheless, its effectiveness was only demonstrated in downstream fine-tuning on classification tasks. In this paper, we present Lory, the first approach that scales such architectures to autoregressive language model pre-training. Lory introduces two key techniques: (1) a causal segment routing strategy that achieves high efficiency for expert merging operations while preserving the autoregressive nature of language models; (2) a similarity-based data batching method that encourages expert specialization by grouping similar documents in training instances. We pre-train a series of Lory models on 150B tokens from scratch, with up to 32 experts and 30B (1.5B active) parameters. Experimental results show significant performance gains over parameter-matched dense models on both perplexity (+13.9%) and a variety of downstream tasks (+1.5%-11.1%). Despite segment-level routing, Lory models achieve competitive performance compared to state-of-the-art MoE models with token-level routing. We further demonstrate that the trained experts in Lory capture domain-level specialization without supervision. Our work highlights the potential of fully-differentiable MoE architectures for language model pre-training and advocates future research in this area.
Motivation & Objective
- Motivate and enable fully differentiable MoE architectures for autoregressive LMs beyond encoder/classification tasks.
- Propose efficient expert merging via causal segment routing to preserve autoregressive generation while reducing computation.
- Introduce similarity-based data batching to induce domain-specific expert specialization during pre-training.
- Demonstrate scalability by pre-training Lory models up to 30B full parameters with up to 32 experts on 150B tokens.
Proposed method
- Adopt expert merging where o_x = FFN(h_x; sum_i e_i * theta_i) with e_i from a Softmax router.
- Use causal segment routing: split input into segments of length T, compute merged theta from preceding segment, and apply to current segment to preserve autoregressive causality.
- During training, compute routing weights based on the average hidden representation of the previous segment; stop-gradient to prevent leakage.
- Employ similarity-based data batching to concatenate semantically similar documents, encouraging expert specialization.
- During inference, use prompt-only routing to determine a single merged FFN per layer for the entire generation.
- Train with 150B tokens, 0.3B and 1.5B active parameters, 8/16/32 experts per layer, following a dense model initialization and warmup schedule.
Experimental results
Research questions
- RQ1Can fully differentiable MoE architectures be effectively scaled to autoregressive language model pre-training?
- RQ2Does causal segment routing preserve autoregressive generation while enabling expert merging at segment level?
- RQ3Does similarity-based data batching foster domain-level expert specialization and improve downstream task performance?
- RQ4How do fully differentiable MoE Lory models compare to traditional token-level MoE and dense baselines in perplexity and downstream tasks?
Key findings
- Lory achieves significant perplexity gains over parameter-matched dense baselines across evaluated domains, with +13.9% relative improvement on Books for a 0.3B/32E model and broader perplexity reductions across arXiv, Books, Wikipedia, C4, and Python.
- Downstream tasks show consistent improvements with MoE: +3.7% (commonsense reasoning), +3.3% (reading comprehension), +1.5% (closed-book QA), and +11.1% (text classification) for selected configurations.
- Segment-level routing with causal merging yields competitive performance relative to state-of-the-art token-level MoE models while enabling fully differentiable training.
- Experts exhibit domain-level specialization without supervision, with middle/high layers showing stronger domain signals (e.g., arXiv, Python), indicating effective specialization beyond local token patterns.
- Similarity-based batching significantly boosts MoE performance versus random batching, and is crucial for effective expert training and utilization.
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.