Papers › QuaRot: Outlier-Free 4-Bit Inference in Rotated LLMs

QuaRot: Outlier-Free 4-Bit Inference in Rotated LLMs

30 Mar 2024arXiv:2404.00456archive 2025-07-28

Saleh Ashkboos, Amirkeivan Mohtashami, Maximilian L. Croci, Bo Li, Pashmina Cameron, Martin Jaggi, Dan Alistarh, Torsten Hoefler, James Hensman

We introduce QuaRot, a new Quantization scheme based on Rotations, which is able to quantize LLMs end-to-end, including all weights, activations, and KV cache in 4 bits. QuaRot rotates LLMs in a way that removes outliers from the hidden state without changing the output, making quantization easier. This computational invariance is applied to the hidden state (residual) of the LLM, as well as to the activations of the feed-forward components, aspects of the attention mechanism, and to the KV cache. The result is a quantized model where all matrix multiplications are performed in 4 bits, without any channels identified for retention in higher precision. Our 4-bit quantized LLaMa2-70B model has losses of at most 0.47 WikiText-2 perplexity and retains 99% of the zero-shot performance. We also show that QuaRot can provide lossless 6 and 8 bit LLaMa2 models without any calibration data using round-to-nearest quantization. Code is available at: https://github.com/spcl/QuaRot.

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

Code

Syntology Ran 7 of 14 code samples harvested from 2 repositories linked to this paper; 7 have no recorded run. Of those that ran: 1 ran · violated contract; 1 ran · our draft was wrong; 5 ran with no contract checked.

By repository: official repository: 12 samples from 1 repository, 5 ran; community (archive-listed): 2 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.

spcl/quarot officialmentioned in papermentioned on GitHubpytorchApache-2.0 report
jingyangxiang/dfrot mentioned on GitHubpytorch report
ruikangliu/IntactKV 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

14 samples harvested; 7 ran; 0 honoured the contract we drafted; 7 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 · our draft was wrong
5ran
7unverified

Licence: 2 of the 14 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 2 repositories linked to this paper, official or community; each sample names its own and says which. “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.

get_minq_maxq spcl/quarot/quarot/functional/quantization.py official repository ran Apache-2.0 (permissive) · 5fd801fc2dec6d7d · report
get_rope_function_name spcl/quarot/fake_quant/model_utils.py official repository ran Apache-2.0 (permissive) · 8005fc23ccbe61fb · report
module_benchmark spcl/quarot/benchmarks/qlinear_benchmark.py official repository ran Apache-2.0 (permissive) · e0252c4b005d7e3d · report
two_compl spcl/quarot/quarot/functional/quantization.py official repository ran fingerprinted Apache-2.0 (permissive) · b1913ca92eadd3ed · report
unpack_i4_and_asym_dequantize spcl/quarot/quarot/transformers/kv_cache.py official repository ran Apache-2.0 (permissive) · 995fb9ff253a9793 · report
asym_quant spcl/quarot/quarot/functional/quantization.py official repository unverified Apache-2.0 (permissive) · 0979b095b9a8e5d5 · report
get_layers spcl/quarot/fake_quant/model_utils.py official repository unverified Apache-2.0 (permissive) · eb59d0a73734e449 · report
model_type_extractor spcl/quarot/fake_quant/model_utils.py official repository unverified Apache-2.0 (permissive) · cdd805f7fc7a0842 · report
module_benchmark spcl/quarot/e2e/benchmark_layer.py official repository unverified Apache-2.0 (permissive) · a7b10909f03b6f25 · report
module_benchmark spcl/quarot/benchmarks/qattention_benchmark.py official repository unverified Apache-2.0 (permissive) · 3511c8d92f8511a9 · report
module_benchmark spcl/quarot/e2e/benchmark.py official repository unverified Apache-2.0 (permissive) · e17335503c7768a8 · report
repeated_run spcl/quarot/e2e/benchmark_layer.py official repository unverified Apache-2.0 (permissive) · e1e6871001b12507 · report
is_pow2 jingyangxiang/dfrot/scripts/optimize_procrustes_alter.py community (archive-listed) ran · violated contract fingerprinted no licence file found · pointer only · e36d941e3a44f9df · report
to_numpy jingyangxiang/dfrot/scripts/optimize_procrustes_alter.py community (archive-listed) ran · our draft was wrong no licence file found · pointer only · 962843b3fc75bc61 · report

Tasks

Quantization

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