arXiv:2409.01483cs.LGcs.CL2024-09被引 11

通过任务感知剪枝优化SMoE模型,发现专家数量有最佳裁剪阈值。

Revisiting SMoE Language Models by Evaluating Inefficiencies with Task Specific Expert Pruning

  • 提出UNCURL剪枝法,离线减少MoE每层专家数
  • 实验显示专家裁剪存在性能下降临界点
  • 适合关注推理优化的SMoE架构设计者

稀疏专家混合(SMoE)模型已成为语言建模中可扩展的替代方案。这些模型在Transformer块中使用条件激活的前馈子网络,实现总参数量与单例计算量的分离。然而,大规模令牌路由的SMoE模型在推理时面临显著挑战:整个模型必须用于序列或批量处理,导致分布式环境下延迟升高,抵消了按令牌稀疏激活的优势。本研究通过任务特定模型剪枝,探讨如何指导SMoE架构设计,主要调节预训练中的专家数量选择。我们探究剪枝模型相较于从零开始训练的小型SMoE模型在任务上的表现优势。为此,引入一种自适应任务感知剪枝技术UNCURL,以离线方式在预训练后减少每层MoE的专家数量。研究发现,存在一个依赖于预训练阶段专家数量的阈值剪枝因子,超过该因子后,模型性能开始下降。这些发现有助于理解预训练阶段使用SMoE架构时的设计权衡,尤其对后续阶段的任务特定推理优化具有参考价值。

原文摘要 · Abstract (English)

Sparse Mixture of Expert (SMoE) models have emerged as a scalable alternative to dense models in language modeling. These models use conditionally activated feedforward subnetworks in transformer blocks, allowing for a separation between total model parameters and per-example computation. However, large token-routed SMoE models face a significant challenge: during inference, the entire model must be used for a sequence or a batch, resulting in high latencies in a distributed setting that offsets the advantages of per-token sparse activation. Our research explores task-specific model pruning to inform decisions about designing SMoE architectures, mainly modulating the choice of expert counts in pretraining. We investigate whether such pruned models offer advantages over smaller SMoE models trained from scratch, when evaluating and comparing them individually on tasks. To that end, we introduce an adaptive task-aware pruning technique UNCURL to reduce the number of experts per MoE layer in an offline manner post-training. Our findings reveal a threshold pruning factor for the reduction that depends on the number of experts used in pretraining, above which, the reduction starts to degrade model performance. These insights contribute to our understanding of model design choices when pretraining with SMoE architectures, particularly useful when considering task-specific inference optimization for later stages.

SMoE模型剪枝推理优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。