解锁大型语言模型中的涌现模块化
Unlocking Emergent Modularity in Large Language Models
AI总结:
本文提出 Emergent MoE(EMoE),利用标准语言模型中自发出现的涌现模块化结构,在不增加额外参数的情况下将 LMs 微调为 MoE 模型,实验证明其能提升域内与域外泛化能力,并可扩展至 Llama2-7B 和 Llama-30B。
摘要:
模块化神经网络(MNNs)相较于单体模型展现出多种优势。现有的 MNN 通常是显式的:其模块化架构是预先定义的,期望各个模块实现不同的功能。近期研究揭示,标准预训练 Transformer 中存在隐式模块化,即涌现模块化。这些研究表明,此类模块化结构会在预训练早期阶段自发出现。尽管模块化具有诸多益处,但在预训练和微调范式中,大多数语言模型(LMs)仍被视为单体模型,其涌现模块化被锁定且未得到充分利用。在本工作中,我们聚焦于解锁语言模型中的涌现模块化,展示了标准 LMs 可以在不引入任何额外参数的情况下,被微调为其 Mixture-of-Expert(MoE)对应模型。此类 MoE 源自涌现模块化,被称为 Emergent MoE(EMoE)。我们的实验表明,与普通微调相比,微调 EMoE 能有效提升下游域内和域外泛化能力。我们的分析和消融研究进一步说明,该方法对多种配置具有鲁棒性,并可扩展至大型语言模型(即 Llama2-7B 和 Llama-30B)。代码可在 https://github.com/qiuzh20/EMoE 获取。
英文摘要:
Modular Neural Networks (MNNs) demonstrate various advantages over monolithic models. Existing MNNs are generally $\textit{explicit}$: their modular architectures are pre-defined, with individual modules expected to implement distinct functions. Recent works reveal that there exists $\textit{implicit}$ modularity in standard pre-trained transformers, namely $\textit{Emergent Modularity}$. They indicate that such modular structures spontaneously exhibit during the early pre-training phase. Despite the benefits of modularity, most Language Models (LMs) are still treated as monolithic models in the pre-train and fine-tune paradigm, with their emergent modularity locked and underutilized. In this work, focusing on unlocking the emergent modularity in LMs, we showcase that standard LMs could be fine-tuned as their Mixture-of-Expert (MoEs) counterparts without introducing any extra parameters. Such MoEs are derived from emergent modularity and are referred to as Emergent MoEs (EMoE). Our experiments demonstrate that fine-tuning EMoE effectively improves downstream in-domain and out-of-domain generalization compared with vanilla fine-tuning. Our analysis and ablation studies further illustrate that it is robust to various configurations and can scale up to Large Language Models (i.e., Llama2-7B and Llama-30B). Code is available at https://github.com/qiuzh20/EMoE.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。