arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2407.01906cs.CLcs.AIcs.LG
收藏

让专家各司其职:面向稀疏架构大语言模型的专家特化微调

Let the Expert Stick to His Last: Expert-Specialized Fine-Tuning for Sparse Architectural Large Language Models

DeepSeek AI(深度求索人工智能公司);Northwestern University(西北大学)

Zihan Wang, Deli Chen, Damai Dai, Runxin Xu, Zhuoshu Li, Y. Wu

AI总结:

针对稀疏MoE架构大语言模型,本文提出专家特化微调ESFT,仅微调与下游任务最相关的专家并冻结其余部分,在提升效率的同时达到甚至超越全参数微调性能。

摘要:

参数高效微调(PEFT)对于在有限资源条件下定制大语言模型(LLMs)至关重要。尽管针对稠密架构大语言模型已有多种PEFT方法,但面向稀疏架构大语言模型的PEFT仍未得到充分探索。本文研究了针对混合专家(MoE)架构大语言模型的PEFT方法,主要工作包括三个方面:(1)我们考察了定制任务中被激活专家的分散程度,发现特定任务的路由分布往往高度集中,而不同任务之间被激活专家的分布差异显著。(2)我们提出专家特化微调(Expert-Specialized Fine-Tuning,简称ESFT),仅微调与下游任务最相关的专家,同时冻结其他专家和模块;实验结果表明,该方法不仅提高了微调效率,而且性能与全参数微调相当甚至更优。(3)我们进一步分析了MoE架构对专家特化微调的影响。我们发现,专家粒度更细的MoE模型在选择与下游任务最相关的专家组合方面更具优势,从而同时提升训练效率和效果。代码见 https://github.com/deepseek-ai/ESFT。

英文摘要:

Parameter-efficient fine-tuning (PEFT) is crucial for customizing Large Language Models (LLMs) with constrained resources. Although there have been various PEFT methods for dense-architecture LLMs, PEFT for sparse-architecture LLMs is still underexplored. In this work, we study the PEFT method for LLMs with the Mixture-of-Experts (MoE) architecture and the contents of this work are mainly threefold: (1) We investigate the dispersion degree of the activated experts in customized tasks, and found that the routing distribution for a specific task tends to be highly concentrated, while the distribution of activated experts varies significantly across different tasks. (2) We propose Expert-Specialized Fine-Tuning, or ESFT, which tunes the experts most relevant to downstream tasks while freezing the other experts and modules; experimental results demonstrate that our method not only improves the tuning efficiency, but also matches or even surpasses the performance of full-parameter fine-tuning. (3) We further analyze the impact of the MoE architecture on expert-specialized fine-tuning. We find that MoE models with finer-grained experts are more advantageous in selecting the combination of experts that are most relevant to downstream tasks, thereby enhancing both the training efficiency and effectiveness. Our code is available at https://github.com/deepseek-ai/ESFT.

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

↑