用分层专家分配减少参数,高效扩展多语言大模型。
Less, but Better: Efficient Multilingual Expansion for LLMs via Layer-wise Mixture-of-Experts
- 按层分配新专家,基于语言表征相似性决定数量。
- 单次扩展少60%参数,终身扩展少33.3%参数。
- 适合需要低成本多语言扩展的场景。
持续扩展大语言模型(LLM)的新语言是构建强大多语言模型的有前景但具挑战性的方法。最大挑战在于模型在学习新语言的同时保持对旧语言的熟练能力。现有方法采用专家混合(MoE)架构,通过添加新专家来扩展语言,并通过将对应令牌路由到原始模型主干(旧专家)来避免灾难性遗忘。尽管直观,但该方法在扩展新语言时参数开销大,且仍不可避免地影响旧语言性能。为此,我们分析了不同层中语言的特征,提出分层专家分配算法(LayerMoE),确定每层应添加的新专家数量。具体而言,我们发现不同层中语言间的表征相似性存在差异,利用该相似性作为指标进行专家分配:相似度越高,所需新专家越少。此外,为进一步缓解旧语言遗忘问题,我们在相似度较高的层上,在路由器前加入分类器,引导旧语言令牌的路由。实验结果表明,本方法在单次扩展设置下比先前最先进基线少60%专家,在终身扩展设置下少33.3%专家,证明了其有效性。
原文摘要 · Abstract (English)
Continually expanding new languages for existing large language models (LLMs) is a promising yet challenging approach to building powerful multilingual LLMs. The biggest challenge is to make the model continuously learn new languages while preserving the proficient ability of old languages. To achieve this, recent work utilizes the Mixture-of-Experts (MoE) architecture to expand new languages by adding new experts and avoid catastrophic forgetting of old languages by routing corresponding tokens to the original model backbone (old experts). Although intuitive, this kind of method is parameter-costly when expanding new languages and still inevitably impacts the performance of old languages. To address these limitations, we analyze the language characteristics of different layers in LLMs and propose a layer-wise expert allocation algorithm (LayerMoE) to determine the appropriate number of new experts for each layer. Specifically, we find different layers in LLMs exhibit different representation similarities between languages and then utilize the similarity as the indicator to allocate experts for each layer, i.e., the higher similarity, the fewer experts. Additionally, to further mitigate the forgetting of old languages, we add a classifier in front of the router network on the layers with higher similarity to guide the routing of old language tokens. Experimental results show that our method outperforms the previous state-of-the-art baseline with 60% fewer experts in the single-expansion setting and with 33.3% fewer experts in the lifelong-expansion setting, demonstrating the effectiveness of our method.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。