Papers › 4-bit Shampoo for Memory-Efficient Network Training

4-bit Shampoo for Memory-Efficient Network Training

28 May 2024arXiv:2405.18144archive 2025-07-28

Sike Wang, Pan Zhou, Jia Li, Hua Huang

Second-order optimizers, maintaining a matrix termed a preconditioner, are superior to first-order optimizers in both theory and practice. The states forming the preconditioner and its inverse root restrict the maximum size of models trained by second-order optimizers. To address this, compressing 32-bit optimizer states to lower bitwidths has shown promise in reducing memory usage. However, current approaches only pertain to first-order optimizers. In this paper, we propose the first 4-bit second-order optimizers, exemplified by 4-bit Shampoo, maintaining performance similar to that of 32-bit ones. We show that quantizing the eigenvector matrix of the preconditioner in 4-bit Shampoo is remarkably better than quantizing the preconditioner itself both theoretically and experimentally. By rectifying the orthogonality of the quantized eigenvector matrix, we enhance the approximation of the preconditioner's eigenvector matrix, which also benefits the computation of its inverse 4-th root. Besides, we find that linear square quantization slightly outperforms dynamic tree quantization when quantizing second-order optimizer states. Evaluation on various networks for image classification and natural language modeling demonstrates that our 4-bit Shampoo achieves comparable performance to its 32-bit counterpart while being more memory-efficient.

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="2405.18144")

Code

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

By repository: official repository: 15 samples from 1 repository, 13 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

sike-wang/low-bit-shampoo officialmentioned in papermentioned 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

15 samples harvested; 13 ran; 0 honoured the contract we drafted; 2 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.

13ran
2unverified

Licence: 15 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 sike-wang/low-bit-shampoo. “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.

MatPower sike-wang/low-bit-shampoo/optimizers/matrix_functions.py official repository ran fingerprinted no licence file found · pointer only · 7f680e86e6397b23 · report
densenet121 sike-wang/low-bit-shampoo/models/densenet.py official repository ran no licence file found · pointer only · 567029bd46065708 · report
densenet169 sike-wang/low-bit-shampoo/models/densenet.py official repository ran no licence file found · pointer only · 3ed7580937fb0008 · report
densenet201 sike-wang/low-bit-shampoo/models/densenet.py official repository ran no licence file found · pointer only · b70932e817d72f6c · report
resnet18 sike-wang/low-bit-shampoo/models/resnet.py official repository ran no licence file found · pointer only · 71ae4764866d8ea8 · report
resnet34 sike-wang/low-bit-shampoo/models/resnet.py official repository ran no licence file found · pointer only · 8422d19ea2f1ab19 · report
resnet50 sike-wang/low-bit-shampoo/models/resnet.py official repository ran no licence file found · pointer only · aa756ebc41f95062 · report
swin_tiny sike-wang/low-bit-shampoo/models/swin.py official repository ran no licence file found · pointer only · 1b9cf937758df695 · report
vgg11 sike-wang/low-bit-shampoo/models/vgg.py official repository ran no licence file found · pointer only · 05abe9f6c5347322 · report
vgg13 sike-wang/low-bit-shampoo/models/vgg.py official repository ran no licence file found · pointer only · d77d79a6e5db71b8 · report
vgg16 sike-wang/low-bit-shampoo/models/vgg.py official repository ran no licence file found · pointer only · 0579755ab192dafc · report
vit_base_32_224 sike-wang/low-bit-shampoo/models/vit.py official repository ran no licence file found · pointer only · 6ecf696df373b05d · report
vit_small sike-wang/low-bit-shampoo/models/vit.py official repository ran no licence file found · pointer only · 42ddec61c2f4cb83 · report
ComputePower sike-wang/low-bit-shampoo/optimizers/matrix_functions.py official repository unverified no licence file found · pointer only · d77abe9d00f96a18 · report
PowerIter sike-wang/low-bit-shampoo/optimizers/matrix_functions.py official repository unverified no licence file found · pointer only · 3e19268a6eb951a3 · report

Tasks

Image ClassificationLanguage ModelingLanguage ModellingQuantizationimage-classification

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

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