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

通过激活模式分析实现分析性FFN到MoE的重构

Analytical FFN-to-MoE Restructuring via Activation Pattern Analysis

The Chinese University of Hong Kong(香港中文大学);Huawei Technologies Co., Ltd(华为技术有限公司)

Zehua Pei, Hui-Ling Zhen, Lancheng Zou, Xianzhi Yu, Wulong Liu, Sinno Jialin Pan, Mingxuan Yuan, Bei Yu

AI总结:

本文提出一种分析性后训练框架,通过小数据集将FFN重构为稀疏MoE,利用激活模式分析划分共享专家和路由专家,实现快速部署或轻量微调,实验显示在计算受限场景下速度提升达1.17倍。

摘要:

扩大大型语言模型(LLMs)可提升性能,但显著增加推理成本,其中前馈网络(FFN)消耗了大部分计算资源。尽管混合专家(MoE)架构可通过稀疏激活降低此成本,但将现有密集模型重构为MoE通常需要在数十亿个标记上进行大量重新训练。我们提出了一种分析性后训练框架,仅使用小校准数据集即可快速将FFN重构为稀疏MoE架构。该方法分析神经元激活模式,将神经元划分为始终活跃的共享专家和条件激活的路由专家,然后从代表性神经元统计中构建路由器,实现即时部署或可选的轻量级微调。此方法适用于密集模型,并可递归应用于现有MoE模型以实现分层稀疏性。实验显示,在仅几分钟处理和2k样本微调的情况下,计算受限场景下的速度提升达1.17倍,优于需要更多资源的方法。

英文摘要:

Scaling large language models (LLMs) improves performance but significantly increases inference costs, with feed-forward networks (FFNs) consuming the majority of computational resources. While Mixture-of-Experts (MoE) architectures can reduce this cost through sparse activation, restructuring existing dense models into MoEs typically requires extensive retraining on hundreds of billions of tokens. We propose an analytical post-training framework that rapidly restructures FFNs into sparse MoE architectures using only a small calibration dataset. The method analyzes neuron activation patterns to partition neurons into always-active shared experts and conditionally activated routed experts, then constructs a router analytically from representative neuron statistics, enabling immediate deployment or optional lightweight fine-tuning. This approach applies both to dense models and recursively to existing MoE models for hierarchical sparsity. Experiments demonstrate up to $1.17\times$ speedup in compute-bound scenarios with only minutes of processing and 2k-sample fine-tuning, outperforming methods requiring orders of magnitude more resources.

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

↑