MLP Fusion: Towards Efficient Fine-tuning of Dense and Mixture-of-Experts Language Models

Tianxin Wei, Zeming Guo, Yifan Chen, Jingrui He, He, Jingrui · DOI

Abstract

Fine-tuning a pre-trained language model (PLM) is the predominant strategy for many NLP applications, yet it remains computationally expensive, particularly for edge devices. While general compression techniques like quantization exist, one-shot methods specifically designed for fine-tuning are rare. We propose MLP Fusion, a technique that leverages the Neural Tangent Kernel (NTK) to approximate the training dynamics of multilayer perceptron (MLP) modules. By decomposing MLPs into sub-MLPs and clustering them into centroids, we create compressed models that preserve both output and learning behavior. Our approach is applicable to both dense and Mixture-of-Experts (MoE) architectures. Extensive experiments demonstrate that MLP Fusion maintains high accuracy while significantly reducing computational overhead.

Introduction

Adapting large-scale pre-trained language models (PLMs) to downstream tasks through fine-tuning is standard practice. However, as models grow, the resource requirements become a bottleneck. Existing compression methods often fall short: Knowledge Distillation is resource-intensive during training; Pruning creates sparse matrices that lack hardware optimization; and LoRA reduces trainable parameters but not the overall memory footprint or inference latency.

The primary challenge is maintaining a model's "trainability"—its ability to learn effectively during downstream fine-tuning. MLP Fusion addresses this by focusing on preserving the gradient descent dynamics of the original model.

Methodology: MLP Fusion with Approximate NTK

The core innovation of MLP Fusion is the preservation of the Neural Tangent Kernel (NTK), which describes how a network's outputs evolve during training.

  1. Sub-MLP Decomposition: A standard MLP layer is viewed as an ensemble of numerous tiny "bottleneck-1" sub-MLPs.
  2. Clustering-based Fusion: These sub-MLPs are grouped using k-means clustering into a smaller set of centroids. These centroids are then reconstructed into a compressed, dense MLP.
  3. NTK Preservation: To ensure the compressed model follows the original's training dynamics, a scaling matrix ($P$) is introduced during fusion. This ensures that the gradient flow in the compressed model approximates that of the full-scale original.
Overview of the MLP Fusion process: sub-MLP decomposition, clustering, and fusion to maintain training dynamics via NTK approximation.

This methodology is versatile, scaling from standard dense MLPs to the individual experts within Mixture-of-Experts (MoE) layers.

Experimental Setup

We evaluated MLP Fusion across diverse benchmarks:

  • Tasks: Natural Language Understanding (GLUE benchmark: SST2, MNLI, etc.) and Natural Language Generation (WebNLG).
  • Models: RoBERTa (encoder), GPT-2 (decoder), and Switch Transformer (MoE).

Results and Discussion

Approximation Accuracy

MLP Fusion achieves a significantly lower NTK approximation error compared to baseline methods like Sketching, SVD, or Pruning. This confirms that the fused model better preserves the original training dynamics.

Comparison of NTK matrix approximation error across various compression methods. MLP Fusion demonstrates the lowest error, indicating superior preservation of training dynamics.

Downstream Performance

On the SST2 task, MLP Fusion achieved 93.23% accuracy, outperforming Sketching (91.90%) and SVD (92.55%). With task-specific tuning, performance reached 93.79%, nearly matching the full RoBERTa model (94.61%).

Efficiency Gains

Because MLP Fusion results in standard dense matrices, it offers real-world hardware acceleration. We observed a 30% training speedup on SST2 and a 2.7x speedup on MNLI compared to standard fine-tuning. In MoE models, by freezing the router and fusing experts, we significantly reduced compute requirements while maintaining global knowledge.

Conclusion

MLP Fusion provides a robust one-shot compression framework that prioritizes training dynamics. By approximating the NTK, it enables efficient fine-tuning without the typical performance degradation associated with heavy compression. Future work will explore more precise error bounds for adaptive optimizers like Adam and extend the method to non-textual domains such as speech and graph mining.

Summary updated

BibTeX
@inproceedings{wei2023mlp,
  author = {Tianxin Wei and Zeming Guo and Yifan Chen and Jingrui He and He, Jingrui},
  title = {{MLP Fusion: Towards Efficient Fine-tuning of Dense and Mixture-of-Experts Language Models}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=LOy8W3UGFK},
}
Figure