Sparsely activated Mixture-of-Experts (SMoE) has shown promise to scale up the learning capacity of neural networks, however, they have issues like (a) High Memory Usage, due to duplication of the network layers into multiple copies as experts; and (b) Redundancy in Experts, as common learning-based routing policies suffer from representational collapse. Therefore, vanilla SMoE models are memory inefficient and non-scalable, especially for resource-constrained downstream scenarios. In this paper, we ask: Can we craft a compact SMoE model by consolidating expert information? What is the best recipe to merge multiple experts into fewer but more knowledgeable experts? Our pilot investigation reveals that conventional model merging methods fail to be effective in such expert merging for SMoE. The potential reasons are: (1) redundant information overshadows critical experts; (2) appropriate neuron permutation for each expert is missing to bring all of them in alignment. To address this, we propose M-SMoE, which leverages routing statistics to guide expert merging. Specifically, it starts with neuron permutation alignment for experts; then, dominant experts and their "group members" are formed; lastly, every expert group is merged into a single expert by utilizing each expert's activation frequency as their weight for merging, thus diminishing the impact of insignificant experts. Moreover, we observed that our proposed merging promotes a low dimensionality in the merged expert's weight space, naturally paving the way for additional compression. Hence, our final method, MC-SMoE (i.e., Merge, then Compress SMoE), further decomposes the merged experts into low-rank and structural sparse alternatives. Extensive experiments across 8 benchmarks validate the effectiveness of MC-SMoE. For instance, our MC-SMoE achieves up to 80% memory and a 20% FLOPs reduction, with virtually no loss in performance.
翻译:稀疏激活混合专家模型(SMoE)虽在扩展神经网络学习能力方面展现出潜力,但面临两大问题:(a)高内存占用——因网络层被复制为多个专家副本;(b)专家冗余——基于学习的路由策略常导致表征坍缩。因此,原始SMoE模型在资源受限的下游场景中内存效率低下且难以扩展。本文提出关键问题:能否通过整合专家信息打造紧凑型SMoE模型?合并多个专家为更精简但知识更丰富的专家的最优策略是什么?初步探究发现,传统模型合并方法在SMoE专家合并中难以奏效,原因在于:(1)冗余信息掩盖重要专家;(2)缺乏针对各专家的神经元排列对齐操作。为此,我们提出M-SMoE,利用路由统计信息指导专家合并:首先对专家进行神经元排列对齐;继而形成主导专家及其"组内成员";最后基于各专家激活频率作为合并权重,将每个专家组合并为单一专家,从而削弱非关键专家的影响。进一步研究发现,该合并策略可降低合并后专家权重的维度,天然适配后续压缩。最终方法MC-SMoE(即先合并后压缩SMoE)将合并后的专家分解为低秩与结构化稀疏替代形式。在8个基准测试上的广泛实验验证了MC-SMoE的有效性:例如,该方法在近乎无损模型性能的条件下,可实现最高80%的内存节省与20%的FLOPs削减。