[Paper Review] MoEfication: Conditional Computation of Transformer Models for Efficient Inference
This paper proposes MoEfication, a method to accelerate Transformer inference by transforming standard models into sparse mixture-of-experts (MoE) architectures with no increase in model size. By splitting feed-forward network (FFN) parameters into experts and using routers to conditionally activate only a small subset per input, MoEfication reduces computation by up to 80%—e.g., activating only 20% of FFN parameters in a 700M-parameter model—without performance degradation on text classification and reading comprehension tasks.
Transformer-based pre-trained language models can achieve superior performance on most NLP tasks due to large parameter capacity, but also lead to huge computation cost. Fortunately, we find by empirical study that, most inputs only activate a tiny ratio of neurons during inference. Hence, we explore to accelerate large-model inference by conditional computation based on the sparse activation phenomenon. We propose to transform a large model into its mixture-of-experts (MoE) version with equal model size, namely MoEfication. Model MoEfication consists of two steps: (1) splitting the parameters of feed-forward neural networks (FFNs) into multiple parts as experts, and (2) building expert routers to decide which experts will be used for each input. To further improve the performance of MoEfied models, we can also fine-tune the models on downstream tasks, namely parameter calibration. Experimental results show that the MoEfied models can significantly reduce computation cost, e.g., only activating 20% FFN parameters of a 700-million-parameter model without performance degradation on several downstream tasks including text classification and reading comprehension.
Motivation & Objective
- To address the high computational cost of large pre-trained Transformer models during inference.
- To exploit the empirical observation that only a small fraction of neurons are activated per input, enabling sparse computation.
- To design a method that transforms standard models into MoE architectures with identical parameter count to maintain model capacity.
- To improve inference efficiency without degrading performance on downstream NLP tasks.
- To validate the effectiveness of MoEfication through fine-tuning and quantitative evaluation on real-world benchmarks.
Proposed method
- Splitting the feed-forward network (FFN) parameters of a Transformer into multiple expert sub-networks.
- Introducing expert routers that dynamically select which experts to activate per input token based on input-dependent routing.
- Maintaining the same total parameter count as the original model by distributing parameters across experts without increasing size.
- Applying parameter calibration via fine-tuning on downstream tasks to improve MoEfied model performance.
- Using conditional computation to activate only a small subset of experts per input, reducing FLOPs during inference.
- Leveraging the sparse activation pattern observed empirically in standard models to guide expert routing and efficiency gains.
Experimental results
Research questions
- RQ1Can we achieve significant inference efficiency gains in large Transformer models by exploiting sparse activation patterns?
- RQ2Does transforming a standard Transformer into a mixture-of-experts (MoE) architecture with the same parameter count preserve model performance?
- RQ3To what extent can conditional computation reduce FLOPs during inference without performance degradation?
- RQ4How effective is parameter calibration via fine-tuning in improving the performance of MoEfied models?
- RQ5Can MoEfication be applied effectively across diverse NLP tasks such as text classification and reading comprehension?
Key findings
- MoEfication reduces computation cost by up to 80% during inference, with only 20% of the FFN parameters activated in a 700-million-parameter model.
- The MoEfied model maintains performance on downstream tasks, including text classification and reading comprehension, without any degradation compared to the original model.
- The method achieves significant efficiency gains while preserving model capacity due to the same total parameter count as the original model.
- Fine-tuning (parameter calibration) improves the performance of MoEfied models on downstream tasks, confirming its effectiveness.
- Empirical analysis confirms that most inputs activate only a small fraction of neurons, validating the foundation of conditional computation in MoEfication.
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.