Papers › Monarch Mixer: A Simple Sub-Quadratic GEMM-Based Architecture

Monarch Mixer: A Simple Sub-Quadratic GEMM-Based Architecture

18 Oct 2023NeurIPS 2023 11arXiv:2310.12109archive 2025-07-28

Daniel Y. Fu, Simran Arora, Jessica Grogan, Isys Johnson, Sabri Eyuboglu, Armin W. Thomas, Benjamin Spector, Michael Poli, Atri Rudra, Christopher Ré

Machine learning models are increasingly being scaled in both sequence length and model dimension to reach longer contexts and better performance. However, existing architectures such as Transformers scale quadratically along both these axes. We ask: are there performant architectures that can scale sub-quadratically along sequence length and model dimension? We introduce Monarch Mixer (M2), a new architecture that uses the same sub-quadratic primitive along both sequence length and model dimension: Monarch matrices, a simple class of expressive structured matrices that captures many linear transforms, achieves high hardware efficiency on GPUs, and scales sub-quadratically. As a proof of concept, we explore the performance of M2 in three domains: non-causal BERT-style language modeling, ViT-style image classification, and causal GPT-style language modeling. For non-causal BERT-style modeling, M2 matches BERT-base and BERT-large in downstream GLUE quality with up to 27% fewer parameters, and achieves up to 9.1× higher throughput at sequence length 4K. On ImageNet, M2 outperforms ViT-b by 1% in accuracy, with only half the parameters. Causal GPT-style models introduce a technical challenge: enforcing causality via masking introduces a quadratic bottleneck. To alleviate this bottleneck, we develop a novel theoretical view of Monarch matrices based on multivariate polynomial evaluation and interpolation, which lets us parameterize M2 to be causal while remaining sub-quadratic. Using this parameterization, M2 matches GPT-style Transformers at 360M parameters in pretraining perplexity on The PILE--showing for the first time that it may be possible to match Transformer quality without attention or MLPs.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology View this paper on Syntology: its repositories, every harvested function with whether it ran, its licence and the call to fetch it.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2310.12109")

Code

Syntology Ran 4 of 7 code samples harvested from 1 repository linked to this paper; 3 have no recorded run. Of those that ran: 4 ran with no contract checked.

By repository: community (archive-listed): 7 samples from 1 repository, 4 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

HazyResearch/m2 mentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

7 samples harvested; 4 ran; 0 honoured the contract we drafted; 3 have no recorded run. Read from Syntology's graph 2026-09-25; that is when this build read the record, not when the samples ran.

4ran
3unverified

Licence: 0 of the 7 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from HazyResearch/m2. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

ExponentialModulation HazyResearch/m2/bert/src/mm/monarch_mixer_sequence_mixer.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · b8b4a54fca0d06f8 · report
HyenaFilter HazyResearch/m2/bert/src/mm/monarch_mixer_sequence_mixer.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 0bc2ee1177b6118f · report
PositionalEmbedding HazyResearch/m2/bert/src/mm/monarch_mixer_sequence_mixer.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · c3fc52e16deda095 · report
Sin HazyResearch/m2/bert/src/mm/monarch_mixer_sequence_mixer.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 46738ca5fd203f92 · report
MonarchMixerSequenceMixing HazyResearch/m2/bert/src/mm/monarch_mixer_sequence_mixer.py community (archive-listed) unverified Apache-2.0 (permissive) · 38673f48ffeede10 · report
OptimModule HazyResearch/m2/bert/src/mm/monarch_mixer_sequence_mixer.py community (archive-listed) unverified Apache-2.0 (permissive) · 6f2ce45de2079602 · report
fftconv_ref HazyResearch/m2/bert/src/mm/monarch_mixer_sequence_mixer.py community (archive-listed) unverified Apache-2.0 (permissive) · 1ea1c3c4388f11da · report

Tasks

4kImage ClassificationLanguage ModelingLanguage Modellingimage-classification

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections