Union of Experts: Adapting Hierarchical Routing to Equivalently Decomposed Transformer
本文提出了一种名为UoE的混合专家模型,通过等价分解和选择性路由机制,在保持高效计算的同时提升了Transformer模型在图像和自然语言处理任务中的性能。
更新于 2025-03-07。作者:Yujiao Yang、Jing Lian、Linhui Li。
中文摘要
混合专家(MoE)在保持计算效率的同时提升了模型性能,使其非常适合大规模应用。然而,现有MoE范式中的专家独立工作,因此缺乏高质量的专家交互。此外,它们尚未有效扩展到注意力块,这限制了进一步的效率提升。为了解决这些问题,我们提出了联合专家(UoE),它将transformer分解成一组等价的专家,并在输入数据和专家之间实施动态路由。我们的方法通过三个关键创新推进了MoE设计:(1)我们基于张量并行中的矩阵划分,在MLP块和注意力块上进行了等价专家分解。(2)我们开发了两种路由范式:分块数据选择和专家选择,以在不同级别应用路由。(3)我们设计了UoE模型的架构,包括选择性多头注意力(SMHA)和联合MLP专家(UoME)。(4)我们开发了UoE的路由和计算操作的并行实现,并根据硬件处理分析优化了效率。实验表明,采用UoE的模型在图像和自然语言领域的多个任务中优于全注意力、最先进的MoE和高效的Transformer。源代码可在https://github.com/YujiaoYang-work/UoE上获取。
英文摘要
Mixture-of-Experts (MoE) enhances model performance while maintaining computational efficiency, making it well-suited for large-scale applications. However, expert in exist MoE paradigm works as an individual, thereby lacking high-quality expert interactions. Moreover, they have not been effectively extended to attention block, which constrains further efficiency improvements. To tackle these issues, we propose Union-of-Experts (UoE), which decomposes transformer into an equitant group of experts, and then implement dynamic routing on input data and experts. Our approach advances MoE design with three key innovations: (1) We conducted equitant expert decomposition on both MLP blocks and attention blocks based on matrix partition in tensor parallelism. (2) We developed two routing paradigms: patch wise data selection and expert selection, to apply routing across different levels. (3) We design the architecture of UoE model, including Selective Multi-Head Attention (SMHA) and Union-of-MLP-Experts (UoME). (4) We develop parallel implementation of UoE's routing and computation operation, and optimize efficiency based on the hardware processing analysis. The experiments demonstrate that the model employed with UoE surpass Full Attention, state-of-art MoEs and efficient transformers in several tasks across image and natural language domains. The source codes are available at https://github.com/YujiaoYang-work/UoE.
解读
一句话总结
本文提出了一种名为UoE的混合专家模型,通过等价分解和选择性路由机制,在保持高效计算的同时提升了Transformer模型在图像和自然语言处理任务中的性能。
问题1:这篇论文想要解决什么具体问题?
- 问题背景:混合专家(MoE)模型虽然提高了模型效率和预测能力,但专家之间缺乏高质量的交互,且尚未有效扩展到注意力块,限制了进一步的效率提升。
- 现有方案不足:现有MoE方法中,专家作为个体工作,缺乏高质量交互,且未有效扩展到注意力块,限制了效率提升。
- 研究目标:提出UoE模型,通过等价分解和选择性路由机制,提升MoE设计,并提高模型效率和性能。
问题2:论文的核心创新点是什么?
- 技术创新:基于张量并行性矩阵划分,对MLP块和注意力块进行等价专家分解。
- 方法改进:开发两种路由范式:数据选择和专家选择,以在不同级别应用路由。
- 优势:与现有方法相比,UoE模型在多个任务上超越了全注意力、最先进的MoE和高效Transformer模型。
问题3:实验结果如何验证了方法的有效性?
- 关键实验:在图像和自然语言处理任务上进行实验,包括语言建模、长序列建模和图像分类。
- 性能提升:在语言建模任务中,与最佳MoE方法相比,平均困惑度降低2.38,平均FLOPs为76%。在长序列建模基准测试中,平均得分至少比所有比较模型高0.68%,而FLOPs仅为最佳MoE方法的50%。在图像分类中,平均准确率提高1.75%,同时保持了可比的FLOPs。
问题4:这个研究的实际应用价值是什么?
- 应用场景:图像和自然语言处理任务。
- 实施建议:根据不同任务和数据集调整模型配置和参数。
- 局限与展望:目前主要在图像和自然语言处理领域进行实验,未来可探索更多应用场景。
来源
机器可读索引:llms.txt