Papers › Monarch: Expressive Structured Matrices for Efficient and Accurate Training

Monarch: Expressive Structured Matrices for Efficient and Accurate Training

1 Apr 2022arXiv:2204.00595archive 2025-07-28

Tri Dao, Beidi Chen, Nimit Sohoni, Arjun Desai, Michael Poli, Jessica Grogan, Alexander Liu, Aniruddh Rao, Atri Rudra, Christopher Ré

Large neural networks excel in many domains, but they are expensive to train and fine-tune. A popular approach to reduce their compute or memory requirements is to replace dense weight matrices with structured ones (e.g., sparse, low-rank, Fourier transform). These methods have not seen widespread adoption (1) in end-to-end training due to unfavorable efficiency--quality tradeoffs, and (2) in dense-to-sparse fine-tuning due to lack of tractable algorithms to approximate a given dense weight matrix. To address these issues, we propose a class of matrices (Monarch) that is hardware-efficient (they are parameterized as products of two block-diagonal matrices for better hardware utilization) and expressive (they can represent many commonly used transforms). Surprisingly, the problem of approximating a dense weight matrix with a Monarch matrix, though nonconvex, has an analytical optimal solution. These properties of Monarch matrices unlock new ways to train and fine-tune sparse and dense models. We empirically validate that Monarch can achieve favorable accuracy-efficiency tradeoffs in several end-to-end sparse training applications: speeding up ViT and GPT-2 training on ImageNet classification and Wikitext-103 language modeling by 2x with comparable model quality, and reducing the error on PDE solving and MRI reconstruction tasks by 40%. In sparse-to-dense training, with a simple technique called "reverse sparsification," Monarch matrices serve as a useful intermediate representation to speed up GPT-2 pretraining on OpenWebText by 2x without quality drop. The same technique brings 23% faster BERT pretraining than even the very optimized implementation from Nvidia that set the MLPerf 1.1 record. In dense-to-sparse fine-tuning, as a proof-of-concept, our Monarch approximation algorithm speeds up BERT fine-tuning on GLUE by 1.7x with comparable accuracy.

PaperPDFCodeCode Syntology ran

In Syntology 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="2204.00595")

Code

Syntology Ran 2 of 15 code samples harvested from 1 repository linked to this paper; 13 have no recorded run. Of those that ran: 1 ran · violated contract; 1 ran · fixture could not drive it.

By repository: community (archive-listed): 15 samples from 1 repository, 2 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/monarch officialmentioned in paperpytorchApache-2.0 report
pascalcarrivain/ksmm mentioned on GitHubpytorchApache-2.0 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

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

1ran · violated contract
1ran · fixture could not drive it
13unverified

Licence: 0 of the 15 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 pascalcarrivain/ksmm. “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.

pair pascalcarrivain/ksmm/src/ksmm_py/model/vit.py community (archive-listed) ran · violated contract fingerprinted Apache-2.0 (permissive) · 6ba8cee9f5daea41 · report
posemb_sincos_2d pascalcarrivain/ksmm/src/ksmm_py/model/vit.py community (archive-listed) ran · fixture could not drive it Apache-2.0 (permissive) · 17f6d223949a7e58 · report
add_lines_to_instantiate_kernel_with_hp pascalcarrivain/ksmm/src/ksmm_py/layer/kronecker_sparse/kernel.py community (archive-listed) unverified Apache-2.0 (permissive) · 28185b31217241b1 · report
forward_bmm_bs_first pascalcarrivain/ksmm/src/ksmm_py/layer/bmm/forward_bmm.py community (archive-listed) unverified Apache-2.0 (permissive) · 500510d20d2cda99 · report
forward_bmm_bs_last pascalcarrivain/ksmm/src/ksmm_py/layer/bmm/forward_bmm.py community (archive-listed) unverified Apache-2.0 (permissive) · 59f540493105da3a · report
forward_pass pascalcarrivain/ksmm/src/ksmm_py/benchmark/utils.py community (archive-listed) unverified Apache-2.0 (permissive) · 64f5feef032ab239 · report
from_bmm_format_to_dense pascalcarrivain/ksmm/src/ksmm_py/layer/kronecker_sparse/interface.py community (archive-listed) unverified Apache-2.0 (permissive) · 2248676f55f31017 · report
from_kernel_format_to_dense pascalcarrivain/ksmm/src/ksmm_py/layer/kronecker_sparse/interface.py community (archive-listed) unverified Apache-2.0 (permissive) · 5889d0ad88e0d5f5 · report
generate_factor pascalcarrivain/ksmm/src/ksmm_py/layer/kronecker_sparse/interface.py community (archive-listed) unverified Apache-2.0 (permissive) · d43163d9a5d6f145 · report
get_input_size pascalcarrivain/ksmm/src/ksmm_cu/long_run.py community (archive-listed) unverified Apache-2.0 (permissive) · 49146715588712c1 · report
is_gpu_available pascalcarrivain/ksmm/src/ksmm_cu/long_run.py community (archive-listed) unverified Apache-2.0 (permissive) · 90795aa963bed427 · report
is_valid_configuration_sanity_check pascalcarrivain/ksmm/src/ksmm_cu/long_run.py community (archive-listed) unverified Apache-2.0 (permissive) · f201b7609964135d · report
pattern_is_dense pascalcarrivain/ksmm/src/ksmm_py/benchmark/utils.py community (archive-listed) unverified Apache-2.0 (permissive) · 8358b5b9e35e1a5f · report
posemb_sincos_2d_bsl pascalcarrivain/ksmm/src/ksmm_py/model/vit.py community (archive-listed) unverified Apache-2.0 (permissive) · a076f484cbf3ed79 · report
set_device_and_get_device_name pascalcarrivain/ksmm/src/ksmm_py/benchmark/utils.py community (archive-listed) unverified Apache-2.0 (permissive) · ab4fa31231627e50 · report

Tasks

Language ModelingLanguage ModellingMRI Reconstruction

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

AdamAttentionAttention DropoutBERTBPECosine AnnealingDense ConnectionsDiscriminative Fine-TuningDropoutGPT-2Layer NormalizationLinear LayerLinear Warmup With Cosine AnnealingLinear Warmup With Linear DecayMulti-Head AttentionResidual ConnectionSPEEDSoftmaxWeight DecayWordPiece

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