BAM! Just Like That: Simple and Efficient Parameter Upcycling for Mixture of Experts

Qizhen Zhang, Nikolas Gritsch, Dwaraknath Gnaneshwar, Simon Guo, David Cairuz +6 more
8/15/2024
cs.LG

No official code found. Best implementation: ch33nchan/BAM (0 stars, last commit 2025-08-23).

Abstract

The Mixture of Experts (MoE) framework has become a popular architecture for large language models due to its superior performance over dense models. However, training MoEs from scratch in a large-scale regime is prohibitively expensive. Existing methods mitigate this by pre-training multiple dense expert models independently and using them to initialize an MoE. This is done by using experts' feed-forward network (FFN) to initialize the MoE's experts while merging other parameters. However, this method limits the reuse of dense model parameters to only the FFN layers, thereby constraining the advantages when "upcycling" these models into MoEs. We propose BAM (Branch-Attend-Mix), a simple yet effective method that addresses this shortcoming. BAM makes full use of specialized dense models by not only using their FFN to initialize the MoE layers but also leveraging experts' attention parameters fully by initializing them into a soft-variant of Mixture of Attention (MoA) layers. We explore two methods for upcycling attention parameters: 1) initializing separate attention experts from dense models including all attention parameters for the best model performance; and 2) sharing key and value parameters across all experts to facilitate for better inference efficiency. To further improve efficiency, we adopt a parallel attention transformer architecture to MoEs, which allows the attention experts and FFN experts to be computed concurrently. Our experiments on seed models ranging from 590 million to 2 billion parameters demonstrate that BAM surpasses baselines in both perplexity and downstream task performance, within the same computational and data constraints.

View on arXivView PDF

Code Implementations(1)

ch33nchan/BAMCommunity74%

a complete implementation of the paper BAM! Just Like That: Simple and Efficient Parameter Upcycling for Mixture of Experts

00HTML, PythonAug 23, 20251 years ago

Similar Papers

Cite this paper

@article{zhang2024bam,
  title  = {BAM! Just Like That: Simple and Efficient Parameter Upcycling for Mixture of Experts},
  author = {Qizhen Zhang and Nikolas Gritsch and Dwaraknath Gnaneshwar and Simon Guo and David Cairuz and Bharat Venkitesh and Jakob Foerster and Phil Blunsom and Sebastian Ruder and Ahmet Ustun and Acyr Locatelli},
  year   = {2024},
  eprint = {2408.08274},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2408.08274},
  url    = {http://arxiv.org/abs/2408.08274v2},
  journal = {NEURIPS 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2408.08274.svg)](https://codeofpaper.com/paper/2408.08274)

Discussion