arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2307.08941cs.LGcs.CL
收藏

MLP Fusion:迈向密集型与混合专家语言模型的高效微调

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

School of Information Sciences, University of Illinois Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校信息科学学院);Hong Kong Baptist University(香港浸会大学);Jacobs Technion-Cornell Institute, Cornell Tech(康奈尔理工学院雅各布斯以色列理工学院)

Mengting Ai, Tianxin Wei, Yifan Chen, Zeming Guo, Jingrui He

AI总结:

本文提出MLP Fusion,通过聚类子MLP并近似神经正切核,一次性压缩密集型与MoE语言模型,在保持输出和训练动态的同时实现高效微调。

摘要:

微调预训练语言模型(PLM)已成为许多自然语言处理应用中的主要策略。然而,众所周知这一过程代价高昂,尤其是在计算能力较低的边缘设备上。尽管量化和蒸馏等通用方法已被广泛研究,以降低PLM微调的计算量与内存占用,但专门为微调设计的一次性压缩技术仍基本未被探索。本文研究PLM中多层感知机(MLP)模块的神经正切核(NTK)——该核可揭示神经网络的梯度下降动态——并提出通过近似NTK的MLP融合来构建轻量级PLM。通过将NTK纳入压缩过程,MLP Fusion不仅保留原始模型的输出,还维持其训练动态。为此,我们将MLP重新视为一组子MLP,并把它们聚类为给定数量的质心,随后可将这些质心恢复为压缩后的MLP,并能出人意料地很好近似原始PLM的NTK。该方法适用于PLM中的标准MLP模块和混合专家(MoE)模块,展示了其可扩展性与多功能性。此外,我们给出理论推导,说明所提压缩如何保持NTK。本文在自然语言理解和生成任务上进行了大量PLM微调实验,以验证MLP融合的有效性。代码位于https://github.com/weitianxin/MLP_Fusion。

英文摘要:

Fine-tuning a pre-trained language model (PLM) emerges as the predominant strategy in many natural language processing applications. However, this process is known to be expensive, especially on edge devices with low computing power. While general approaches (e.g. quantization and distillation) have been widely studied to reduce the compute/memory of PLM fine-tuning, one-shot compression techniques specifically designed for fine-tuning remain largely unexplored. In this paper, we investigate the neural tangent kernel (NTK)--which reveals the gradient descent dynamics of neural networks--of the multilayer perceptrons (MLP) modules in a PLM and propose to coin a lightweight PLM through NTK-approximating MLP fusion. By incorporating NTK into the compression process, MLP Fusion not only preserves the original model's output but also maintains its training dynamics. To achieve this, we reconsider the MLP as a bundle of sub-MLPs and cluster them into a given number of centroids, which can then be restored as a compressed MLP and surprisingly well approximate the NTK of the original PLM. Our approach is applicable to both standard MLP modules and Mixture-of-Experts (MoE) modules in PLMs, demonstrating its scalability and versatility. Additionally, we provide theoretical derivations to demonstrate how the proposed compression preserves the NTK. Extensive experiments of PLM fine-tuning on both natural language understanding and generation tasks are provided to verify the effectiveness of MLP fusion. Our code is available at https://github.com/weitianxin/MLP_Fusion.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑