Mixture-of-Transformers Learn Faster: A Theoretical Study on Classification Problems

Hongbo Li, Qinhang Wu, Sen Lin, Yingbin Liang, Ness B. Shroff
10/30/2025
cs.LG

No confident code implementation found for this paper.

Abstract

Mixture-of-Experts (MoE) models improve transformer efficiency but lack a unified theoretical explanation, especially when both feed-forward and attention layers are allowed to specialize. To this end, we study the Mixture-of-Transformers (MoT), a tractable theoretical framework in which each transformer block acts as an expert governed by a continuously trained gating network. This design allows us to isolate and study the core learning dynamics of expert specialization and attention alignment. In particular, we develop a three-stage training algorithm with continuous training of the gating network, and show that each transformer expert specializes in a distinct class of tasks and that the gating network accurately routes data samples to the correct expert. Our analysis shows how expert specialization reduces gradient conflicts and makes each subtask strongly convex. We prove that the training drives the expected prediction loss to near zero in $O(\log(ε^{-1}))$ iteration steps, significantly improving over the $O(ε^{-1})$ rate for a single transformer. We further validate our theoretical findings through extensive real-data experiments, demonstrating the practical effectiveness of MoT. Together, these results offer the first unified theoretical account of transformer-level specialization and learning dynamics, providing practical guidance for designing efficient large-scale models.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{li2025mixtureoftransformers,
  title  = {Mixture-of-Transformers Learn Faster: A Theoretical Study on Classification Problems},
  author = {Hongbo Li and Qinhang Wu and Sen Lin and Yingbin Liang and Ness B. Shroff},
  year   = {2025},
  eprint = {2510.27004},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2510.27004v1}
}

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/2510.27004.svg)](https://codeofpaper.com/paper/2510.27004)

Discussion