arXiv:2502.12325cs.CL2025-02被引 4

让大模型按文本难易动态分配计算,高效灵活地平衡速度与准确率。

From Dense to Dynamic: Token-Difficulty Driven MoEfication of Pre-Trained LLMs

  • 通过难度感知路由,将不同复杂度的词元分配给对应专家网络。
  • 仅用100亿词元微调,即可生成多种效率-精度权衡的模型变体。
  • 相比同类方法节省90%微调成本,适合资源受限下的模型部署。

为不同推理约束训练大型语言模型(LLM)计算开销巨大,难以控制效率与准确率之间的权衡。此外,训练后模型通常对所有词元统一处理,行为僵化且缺乏灵活性。本文提出一种后训练优化框架DynaMoE,仅需极小代价即可将预训练密集型LLM转化为基于词元难度驱动的专家混合模型(Mixture-of-Experts)。该方法使模型具备动态性,支持敏感度调控以定制效率与准确率的平衡。DynaMoE采用词元难度感知路由器,预测词元复杂度并将其导向合适的子网络或专家:复杂词元由更大专家处理,简单词元则交由小型专家。实验表明,仅需一次微调步骤、使用100亿词元,便能生成一系列适应性模型变体,每种变体均提供独特的准确率与性能权衡。与基线框架Flextron相比,本方法在下游任务上达到相近的综合准确率,但微调成本仅为后者的九分之一。

原文摘要 · Abstract (English)

Training large language models (LLMs) for different inference constraints is computationally expensive, limiting control over efficiency-accuracy trade-offs. Moreover, once trained, these models typically process tokens uniformly, regardless of their complexity, leading to static and inflexible behavior. In this paper, we introduce a post-training optimization framework, DynaMoE, that adapts a pre-trained dense LLM to a token-difficulty-driven Mixture-of-Experts model with minimal fine-tuning cost. This adaptation makes the model dynamic, with sensitivity control to customize the balance between efficiency and accuracy. DynaMoE features a token-difficulty-aware router that predicts the difficulty of tokens and directs them to the appropriate sub-networks or experts, enabling larger experts to handle more complex tokens and smaller experts to process simpler ones. Our experiments demonstrate that DynaMoE can generate a range of adaptive model variants of the existing trained LLM with a single fine-tuning step, utilizing only $10B$ tokens, a minimal cost compared to the base model's training. Each variant offers distinct trade-offs between accuracy and performance. Compared to the baseline post-training optimization framework, Flextron, our method achieves similar aggregated accuracy across downstream tasks, despite using only $\frac{1}{9}\text{th}$ of their fine-tuning cost.

大模型优化动态路由专家混合轻量微调

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