ModuleFormer:模块性从混合专家中涌现
ModuleFormer: Modularity Emerges from Mixture-of-Experts
AI总结:
本文提出基于稀疏混合专家的模块化架构ModuleFormer,通过新损失函数从非精选数据中诱导模块性,实现了高效性、可扩展性和专业化三大能力。
摘要:
大型语言模型(LLMs)已经取得了显著的成果。然而,现有模型的训练和部署成本高昂,并且在不遗忘先前知识的情况下,很难将其知识扩展到预训练数据之外。本文提出了一种新的神经网络架构ModuleFormer,它利用模块性来提高大型语言模型的效率和灵活性。ModuleFormer基于稀疏混合专家(SMoE)。与之前基于SMoE的模块化语言模型不同,后者需要领域标注数据来学习特定领域的专家,ModuleFormer能够通过其新的负载均衡和集中损失从非精选数据中诱导出模块性。ModuleFormer是一种模块化架构,包含两种不同类型的模块:新的破棍注意力头和前馈专家。在训练和推理期间,不同的模块根据输入标记被稀疏激活。在我们的实验中,我们发现这种模块化架构为大型预训练语言模型赋予了三种重要能力:1)高效性,因为ModuleFormer仅为每个输入标记激活其模块的一个子集,因此它能够以两倍以上的吞吐量实现与密集LLMs相同的性能;2)可扩展性,ModuleFormer比密集LLMs更能抵御灾难性遗忘,并且可以轻松地通过添加新模块来学习训练数据中未包含的新知识;3)专业化,微调ModuleFormer可以使一部分模块专门用于微调任务,而与任务无关的模块可以轻松被剪枝以实现轻量化部署。
英文摘要:
Large Language Models (LLMs) have achieved remarkable results. However, existing models are expensive to train and deploy, and it is also difficult to expand their knowledge beyond pre-training data without forgetting previous knowledge. This paper proposes a new neural network architecture, ModuleFormer, that leverages modularity to improve the efficiency and flexibility of large language models. ModuleFormer is based on the Sparse Mixture of Experts (SMoE). Unlike the previous SMoE-based modular language model, which requires domain-labeled data to learn domain-specific experts, ModuleFormer can induce modularity from uncurated data with its new load balancing and concentration losses. ModuleFormer is a modular architecture that includes two different types of modules: new stick-breaking attention heads and feedforward experts. Different modules are sparsely activated conditions on the input token during training and inference. In our experiment, we found that the modular architecture enables three important abilities for large pre-trained language models: 1) Efficiency, since ModuleFormer only activates a subset of its modules for each input token, thus it could achieve the same performance as dense LLMs with more than two times throughput; 2) Extendability, ModuleFormer is more immune to catastrophic forgetting than dense LLMs and can be easily extended with new modules to learn new knowledge that is not included in the training data; 3) Specialisation, finetuning ModuleFormer could specialize a subset of modules to the finetuning task and the task-unrelated modules could be easily pruned for a lightweight deployment.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。