SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2404.00456 · 2024

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

arXiv · PDF · Open in the Atlas

Code that ran

9 of 14 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 7 failures of our instrument; 5 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2404.00456.json · badge: /api/ran/2404.00456.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
spcl/quarot canonical (classifier label)
classifier basis: census
7 ran · 5 no recorded run
jingyangxiang/dfrot extension (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
FunctionStatusWhere it lives
asym_quant Ran
ran; our contract draft was wrong, not the code
spcl/quarot/quarot/functional/quantization.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from CAS-CLab/DartQuant, is pointer only (licence: NONE) · get_code("0979b095b9a8e5d5")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from CAS-CLab/DartQuant, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_minq_maxq Ran
ran, honoured the contract we drafted
spcl/quarot/quarot/functional/quantization.py
code served (permissive licence) · get_code("5fd801fc2dec6d7d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

ARGS = {
    "bits": 8,
    "sym": True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family int — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_rope_function_name Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
spcl/quarot/fake_quant/model_utils.py
code served (permissive licence) · get_code("8005fc23ccbe61fb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import transformers
from transformers.models.llama.modeling_llama import LlamaForCausalLM
from transformers import LlamaConfig

torch.manual_seed(0)

# Create a minimal LlamaForCausalLM model
config = LlamaConfig(
    vocab_size=256,
    hidden_size=64,
    num_hidden_layers=2,
    num_attention_heads=2,
    num_key_value_heads=2,
    intermediate_size=128,
    max_position_embeddings=512,
)

model = LlamaForCausalLM(config)

ARGS = {
    'model': model,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
is_pow2 Ran
ran, violated the contract we drafted
jingyangxiang/dfrot/scripts/optimize_procrustes_alter.py
pointer only (licence: NONE) · get_code("e36d941e3a44f9df")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, jingyangxiang/dfrot when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

module_benchmark Ran
ran; our contract draft was wrong, not the code
spcl/quarot/benchmarks/qlinear_benchmark.py
code served (permissive licence) · get_code("e0252c4b005d7e3d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import time

torch.manual_seed(0)

class SimpleModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

module = SimpleModule()
x = torch.randn(2, 4)

ARGS = {
    "module": module,
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
repeated_run Ran
ran; our contract draft was wrong, not the code
spcl/quarot/e2e/benchmark_layer.py
code served (permissive licence) · get_code("e1e6871001b12507")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned function. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

class SimpleModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

module = SimpleModule()
x = torch.randn(2, 4)

ARGS = {
    'num_repeats': 5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
to_numpy Ran
ran; our contract draft was wrong, not the code
jingyangxiang/dfrot/scripts/optimize_procrustes_alter.py
pointer only (licence: NONE) · get_code("962843b3fc75bc61")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, jingyangxiang/dfrot when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

two_compl Ran
ran; our contract draft was wrong, not the code
spcl/quarot/quarot/functional/quantization.py
code served (permissive licence) · get_code("b1913ca92eadd3ed")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 1, dtype family int, shape (4,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# two_compl takes:
# - x: a tensor (used with torch.where and compared with 0, arithmetic operations)
# - bits: an int (used in 2**bits arithmetic)

x = torch.tensor([-5, -2, 3, 7], dtype=torch.int32)
bits = 8

ARGS = {
    "x": x,
    "bits": bits,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 1, dtype family int, shape (4,) — shape (4,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
unpack_i4_and_asym_dequantize Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
spcl/quarot/quarot/transformers/kv_cache.py
code served (permissive licence) · get_code("995fb9ff253a9793")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 8) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# q: uint8 tensor that will be unpacked from i4 (4-bit integers)
# The function expects q to have shape (..., N) where each uint8 value encodes two 4-bit values
# After unpacking, it becomes (..., N*2)
q = torch.randint(0, 256, (2, 4), dtype=torch.uint8)

# scale: multiplicative factor for dequantization
# Should broadcast with the unpacked q shape (2, 8) after unpacking
scale = torch.randn(2, 8)

# zero: additive factor for dequantization (subtracted after scaling)
# Should broadcast with the unpacked q shape (2, 8) after unpacking
zero = torch.randn(2, 8)

ARGS = {
    "q": q,
    "scale": scale,
    "zero": zero,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 8) — shape (2, 8) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_layers Not yet run
unverified (harvested, no recorded run)
spcl/quarot/fake_quant/model_utils.py
code served (permissive licence) · get_code("eb59d0a73734e449")
How it ran

no invocation recorded.

model_type_extractor Not yet run
unverified (harvested, no recorded run)
spcl/quarot/fake_quant/model_utils.py
code served (permissive licence) · get_code("cdd805f7fc7a0842")
How it ran

no invocation recorded.

module_benchmark Not yet run
unverified (harvested, no recorded run)
spcl/quarot/e2e/benchmark_layer.py
code served (permissive licence) · get_code("a7b10909f03b6f25")
How it ran

no invocation recorded.

module_benchmark Not yet run
unverified (harvested, no recorded run)
spcl/quarot/benchmarks/qattention_benchmark.py
code served (permissive licence) · get_code("3511c8d92f8511a9")
How it ran

no invocation recorded.

module_benchmark Not yet run
unverified (harvested, no recorded run)
spcl/quarot/e2e/benchmark.py
code served (permissive licence) · get_code("e17335503c7768a8")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 8 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 8 later) and 6 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
get_rope_function_name 4 other papers
4 later
2511.04063 (2025-11)
DartQuant: Efficient Rotational Distribution Calibration for LLM Quantization
2602.02546 (2026-02)
D 2 Quant: Accurate Low-bit Post-Training Weight Quantization for LLMs
2604.07955 (2026-04)
Rethinking Residual Errors in Compensation-based LLM Quantization
and 1 more not named here
get_layers 3 other papers
3 later
2511.04063 (2025-11)
DartQuant: Efficient Rotational Distribution Calibration for LLM Quantization
2604.07955 (2026-04)
Rethinking Residual Errors in Compensation-based LLM Quantization
2605.15491 (2026-05)
Ghosted Layers: Unconstrained Activation Alignment for Recovering Layer-Pruned LLMs
is_pow2 3 other papers
1 dated earlier, 2 later
2402.17762 (2024-02)
Massive Activations in Large Language Models
2410.13229 (2024-10)
Quamba: A Post-Training Quantization Recipe for Selective State Space Models
2412.00648 (2024-12)
DFRot: Achieving Outlier-Free and Massive Activation-Free for Rotated LLMs with Refined Rotation
model_type_extractor 3 other papers
3 later
2511.04063 (2025-11)
DartQuant: Efficient Rotational Distribution Calibration for LLM Quantization
2604.07955 (2026-04)
Rethinking Residual Errors in Compensation-based LLM Quantization
2605.15491 (2026-05)
Ghosted Layers: Unconstrained Activation Alignment for Recovering Layer-Pruned LLMs
asym_quant 2 other papers
2 later
2511.04063 (2025-11)
DartQuant: Efficient Rotational Distribution Calibration for LLM Quantization
2605.19660 (2026-05)
OScaR: The Occam's Razor for Extreme KV Cache Quantization in LLMs and Beyond
to_numpy 2 other papers
1 dated earlier, 1 later
2402.17762 (2024-02)
Massive Activations in Large Language Models
2412.00648 (2024-12)
DFRot: Achieving Outlier-Free and Massive Activation-Free for Rotated LLMs with Refined Rotation
module_benchmark 1 other paper
1 later
2604.02570 (2026-04)
WSVD: Weighted Low-Rank Approximation for Fast and Efficient Execution of Low-Precision Vision-Language Models
repeated_run 1 other paper
1 later
2604.02570 (2026-04)
WSVD: Weighted Low-Rank Approximation for Fast and Efficient Execution of Low-Precision Vision-Language Models

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

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.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2404.00456")
get_code_for_paper("2404.00456")
have("2404.00456")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2404.00456.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2404.00456.svg)](https://syntology.ai/paper/2404.00456)

Connect an agent — have() is free.