# Exploiting Activation Sparsity with Dense to Dynamic-k Mixture-of-Experts Conversion

Source: [Exploiting Activation Sparsity with Dense to Dynamic-k Mixture-of-Experts Conversion](<https://www.sota2.com/research/paper/68fa75b61e209131cea69794>)

Collection index: [llms.txt](<https://www.sota2.com/research/llms.txt>)

Data updated: 2025-10-26T03:39:44.122Z

Authors: Filip Szatkowski, Bartosz W\\'ojcik, Miko{\\l}aj Pi\\'orczy\\'nski, Simone Scardapane

Published: 2023-10-06T16:34:51.000Z

## Abstract

Transformer models can face practical limitations due to their high computational requirements. At the same time, such models exhibit significant activation sparsity, which can be leveraged to reduce the inference cost by converting parts of the network into equivalent Mixture-of-Experts (MoE) layers. Despite the crucial role played by activation sparsity, its impact on this process remains unexplored. We demonstrate that the efficiency of the conversion can be significantly enhanced by a proper regularization of the activation sparsity of the base model. Moreover, motivated by the high variance of the number of activated neurons for different inputs, we introduce a more effective dynamic-$k$ expert selection rule that adjusts the number of executed experts on a per-token basis. To achieve further savings, we extend this approach to multi-head attention projections. Finally, we develop an efficient implementation that translates these computational savings into actual wall-clock speedup. The proposed method, Dense to Dynamic-$k$ Mixture-of-Experts (D2DMoE), outperforms existing approaches on common NLP and vision tasks, reducing inference cost by up to 60% without significantly impacting performance.

## Recorded benchmark results

A research result applies to its stated dataset, split, metric and evaluation configuration. Compare like-for-like settings, preserve the metric's unit and direction, and distinguish paper-reported results from independent reproduction. The best result recorded here is not a claim of exhaustive, current global coverage.

- [Image Classification on ImageNet-1K (Accuracy and Latency)](<https://www.sota2.com/research/sota/image-classification-on-imagenet-1k-accuracy-and-latency.md>): Image Classification; ImageNet-1K; Accuracy: 99.

## Original sources and implementation

[Original paper](<https://arxiv.org/abs/2310.04361>)

[PDF](<https://arxiv.org/pdf/2310.04361.pdf>)
