SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.08041 · ICLR · 2024

QLLM: Accurate and Efficient Low-Bitwidth Quantization for Large Language Models

Jing Liu, Bohan Zhuang, Ruihao Gong, Xiuying Wei, Jianfei Cai, Zhiwei Dong

arXiv · PDF · Open in the Atlas

Code that ran

7 of 16 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, 0 violated it and 0 have no contract verdict; 6 failures of our instrument; 9 no recorded run), measured 2026-11-21; 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/2310.08041.json · badge: /api/ran/2310.08041.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
modeltc/qllm canonical (classifier label)
classifier basis: census
7 ran · 8 no recorded run
wejoncy/QLLM reimplementation (classifier label)
classifier basis: classifier_2025
0 ran · 1 no recorded run
FunctionStatusWhere it lives
assembly Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
modeltc/qllm/assembly/ca_module.py
code served (permissive licence) · get_code("de4a0bd85bb546f8")
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 3, dtype family float, shape (2, 3, 2) 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)

# Analyze the function:
# - x: shape (B, N, C) where C must be even (split into src/dst)
# - src_idx: indices for gathering from src, shape should be compatible with expand(n, t1, r)
# - dst_idx: indices for scattering to dst, shape should be compatible with expand(n, t1, r)
# - r: integer, number of elements to select
# - mode: string for scatter_reduce operation

B = 2
N = 3
C = 4  # Must be even; will split into src_C=2, dst_C=2

# x shape: (B, N, C) = (2, 3, 4)
x = torch.randn(B, N, C)

# ori_src_idx = [0, 2], ori_dst_idx = [1, 3]
# src and dst will each have shape (B, N, 2)
src_C = 2
dst_C = 2

# r is the number of elements to select
r = 2

# src_idx needs to be expandable to (n, t1, r) where n=B, t1=N
# src_idx should index into src which has C=src_C=2 channels
# So src_idx should have values in range [0, src_C)
src_idx = torch.tensor([[0, 1], [1, 0], [0, 1]])  # shape (N, r) = (3, 2)

# dst_idx needs to be expandable to (n, t1, r) where n=B, t1=N
# dst_idx should index into dst which has C=dst_C=2 channels
# So dst_idx should have values in range [0, dst_C)
dst_idx = torch.tensor([[0, 1], [1, 0], [0, 1]])  # shape (N, r) = (3, 2)

mode = 'mean'

ARGS = {
    'x': x,
    'src_idx': src_idx,
    'dst_idx': dst_idx,
    'r': r,
    'mode': mode
}
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 3, dtype family float, shape (2, 3, 2) — shape (2, 3, 2) 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
do_nothing Ran
ran, honoured the contract we drafted
modeltc/qllm/assembly/ca_module.py
code served (permissive licence) · get_code("356d0dfdff3db93a")
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, 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
import torch.nn as nn

torch.manual_seed(0)

# The function do_nothing simply takes x and returns it
# So x can be anything - let's use a simple tensor
x = torch.randn(2, 4)

ARGS = {
    "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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 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
find_layers Ran
ran; our contract draft was wrong, not the code
modeltc/qllm/models/models_utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from utkarshsaxena1/eigenattn, is pointer only (licence: NONE) · get_code("904cd61df2fe8fb9")
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 utkarshsaxena1/eigenattn, 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.

make_disjoint_window Ran
ran; our contract draft was wrong, not the code
modeltc/qllm/models/models_utils.py
code served (permissive licence) · get_code("4df9168e0a0c38eb")
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) and returned tuple. 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 numpy as np

torch.manual_seed(0)

# The function takes a pair (a, b) where both a and b are sequences
# It slices a to remove the last (len(b) - 1) elements
# Both a and b should support len() and slicing operations
# Lists work perfectly for this

a = [1, 2, 3, 4, 5, 6, 7, 8]  # Context window
b = [9, 10, 11]  # Continuation window

pair = (a, b)

ARGS = {
    "pair": pair
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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
sort_layers_by_params Ran
ran; our contract draft was wrong, not the code
modeltc/qllm/parallel_utils.py
code served (permissive licence) · get_code("e5e341cb2fd0757b")
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 list, ndim 1, dtype family float; 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
import torch.nn as nn

torch.manual_seed(0)

# Create a few simple nn.Module instances with different parameter counts
class SimpleModel(nn.Module):
    def __init__(self, in_features, out_features):
        super().__init__()
        self.linear = nn.Linear(in_features, out_features)
    
    def forward(self, x):
        return self.linear(x)

class TinyModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(2, 1)
    
    def forward(self, x):
        return self.linear(x)

class MediumModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 8)
        self.linear2 = nn.Linear(8, 4)
    
    def forward(self, x):
        return self.linear2(self.linear1(x))

class LargeModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(10, 20)
        self.linear2 = nn.Linear(20, 10)
        self.linear3 = nn.Linear(10, 5)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        x = self.linear3(x)
        return x

# Create instances with different parameter counts
tiny_model = TinyModel()
small_model = SimpleModel(2, 3)
medium_model = MediumModel()
large_model = LargeModel()

layers = [small_model, tiny_model, medium_model, large_model]

ARGS = {
    "layers": layers
}
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 list, ndim 1, dtype family float — a list 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
truncate_number Ran
ran; our contract draft was wrong, not the code
modeltc/qllm/models/transformation.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from saic-fi/mobilequant, is pointer only (licence: NOASSERTION) · get_code("94587954e392b665")
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 saic-fi/mobilequant, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

truncate_number Ran
ran; our contract draft was wrong, not the code
modeltc/qllm/models/models_utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from utkarshsaxena1/eigenattn, is pointer only (licence: NONE) · get_code("4e53fbbdfa160f7d")
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 utkarshsaxena1/eigenattn, 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.

apply_rotary_pos_emb_k Not yet run
unverified (harvested, no recorded run)
modeltc/qllm/models/int_llama_layer.py
code served (permissive licence) · get_code("08e5e88401071307")
How it ran

no invocation recorded.

apply_rotary_pos_emb_q Not yet run
unverified (harvested, no recorded run)
modeltc/qllm/models/int_llama_layer.py
code served (permissive licence) · get_code("69b6e7d6c2228088")
How it ran

no invocation recorded.

assign_layers_to_gpus Not yet run
unverified (harvested, no recorded run)
modeltc/qllm/parallel_utils.py
code served (permissive licence) · get_code("b4401e4eaf52f123")
How it ran

no invocation recorded.

bipartite_soft_matching_x_w Not yet run
unverified (harvested, no recorded run)
modeltc/qllm/assembly/ca_module.py
code served (permissive licence) · get_code("aa4f281a4d0a2c47")
How it ran

no invocation recorded.

gen_rand_orthos Not yet run
unverified (harvested, no recorded run)
wejoncy/QLLM/qllm/quantization/method.py
code served (permissive licence) · get_code("a4eda67b643f2d95")
How it ran

no invocation recorded. this sample carries JSON test cases instead of a setup block; get_reference_implementation serves them with the level they back.

get_lowest_occupied_gpu Not yet run
unverified (harvested, no recorded run)
modeltc/qllm/parallel_utils.py
code served (permissive licence) · get_code("90df7d0b5fc6bf9a")
How it ran

no invocation recorded.

get_pile Not yet run
unverified (harvested, no recorded run)
modeltc/qllm/datautils.py
code served (permissive licence) · get_code("2b6e5673cf2914c8")
How it ran

no invocation recorded.

get_ptb Not yet run
unverified (harvested, no recorded run)
modeltc/qllm/datautils.py
code served (permissive licence) · get_code("1b68bae7cd1dd862")
How it ran

no invocation recorded.

get_wikitext2 Not yet run
unverified (harvested, no recorded run)
modeltc/qllm/datautils.py
code served (permissive licence) · get_code("78a5251d494aa3a6")
How it ran

no invocation recorded.

Also present in other papers' code

Of 16 samples lifted from this paper's linked repositories, 16 carry a function identity and 0 do not. Of the 16 distinct functions with an identity, 9 are also present in other papers whose code we hold (9 with at least one paper dated earlier, 0 the same month, 8 later) and 7 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
make_disjoint_window 10 other papers
2 dated earlier, 8 later
2304.01089 (2023-04)
RPTQ: Reorder-based Post-training Quantization for Large Language Models
2308.13137 (2023-08)
OmniQuant: Omnidirectionally Calibrated Quantization for Large Language Models
2402.11295 (2024-02)
OneBit: Towards Extremely Low-bit Large Language Models
and 7 more not named here
find_layers 9 other papers
2 dated earlier, 7 later
2304.01089 (2023-04)
RPTQ: Reorder-based Post-training Quantization for Large Language Models
2308.13137 (2023-08)
OmniQuant: Omnidirectionally Calibrated Quantization for Large Language Models
2402.11295 (2024-02)
OneBit: Towards Extremely Low-bit Large Language Models
and 6 more not named here
truncate_number 8 other papers
1 dated earlier, 7 later
2308.13137 (2023-08)
OmniQuant: Omnidirectionally Calibrated Quantization for Large Language Models
2402.11295 (2024-02)
OneBit: Towards Extremely Low-bit Large Language Models
2403.12544 (2024-03)
AffineQuant: Affine Transformation Quantization for Large Language Models
and 5 more not named here
truncate_number 8 other papers
1 dated earlier, 7 later
2308.13137 (2023-08)
OmniQuant: Omnidirectionally Calibrated Quantization for Large Language Models
2403.12544 (2024-03)
AffineQuant: Affine Transformation Quantization for Large Language Models
2404.14047 (2024-04)
An empirical study of LLaMA3 quantization: from LLMs to MLLMs
and 5 more not named here
get_pile 7 other papers
1 dated earlier, 6 later
2308.13137 (2023-08)
OmniQuant: Omnidirectionally Calibrated Quantization for Large Language Models
2402.11295 (2024-02)
OneBit: Towards Extremely Low-bit Large Language Models
2404.14047 (2024-04)
An empirical study of LLaMA3 quantization: from LLMs to MLLMs
and 4 more not named here
get_lowest_occupied_gpu 6 other papers
2 dated earlier, 4 later
2304.01089 (2023-04)
RPTQ: Reorder-based Post-training Quantization for Large Language Models
2308.13137 (2023-08)
OmniQuant: Omnidirectionally Calibrated Quantization for Large Language Models
2403.12544 (2024-03)
AffineQuant: Affine Transformation Quantization for Large Language Models
and 3 more not named here
sort_layers_by_params 6 other papers
2 dated earlier, 4 later
2304.01089 (2023-04)
RPTQ: Reorder-based Post-training Quantization for Large Language Models
2308.13137 (2023-08)
OmniQuant: Omnidirectionally Calibrated Quantization for Large Language Models
2403.12544 (2024-03)
AffineQuant: Affine Transformation Quantization for Large Language Models
and 3 more not named here
assign_layers_to_gpus 5 other papers
2 dated earlier, 3 later
2304.01089 (2023-04)
RPTQ: Reorder-based Post-training Quantization for Large Language Models
2308.13137 (2023-08)
OmniQuant: Omnidirectionally Calibrated Quantization for Large Language Models
2403.12544 (2024-03)
AffineQuant: Affine Transformation Quantization for Large Language Models
and 2 more not named here
do_nothing 2 other papers
2 dated earlier
2203.12601 (2022-03)
R3M: A Universal Visual Representation for Robot Manipulation
2306.00958 (2023-06)
LIV: Language-Image Representations and Rewards for Robotic Control

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-21.

Repositories linked to this paper

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

Abstract

Large Language Models (LLMs) have demonstrated unparalleled efficacy in natural language processing. However, their high computational demands and memory overheads hinder their broad deployment. To address this, two quantization strategies emerge, including Quantization-Aware Training (QAT) and Post-Training Quantization (PTQ). For LLMs, the billions of parameters make the QAT impractical due to the prohibitive training cost and thus PTQ becomes more prevalent. In existing studies, activation outliers in particular channels are identified as the biggest challenge to PTQ accuracy. They propose to transform the magnitudes from activations to weights, which however offers limited alleviation or suffers from unstable gradients, resulting in a severe performance drop at low-bitwidth. In this paper, we propose QLLM, an accurate and efficient low-bitwidth PTQ method designed for LLMs. QLLM introduces an adaptive channel reassembly technique that reallocates the magnitude of outliers to other channels, thereby mitigating their impact on the quantization range. This is achieved by channel disassembly and channel assembly, which first breaks down the outlier channels into several sub-channels to ensure a more balanced distribution of activation magnitudes. Then similar channels are merged to maintain the original channel number for efficiency. Additionally, an adaptive strategy is designed to autonomously determine the optimal number of sub-channels for channel disassembly. To further compensate for the performance loss caused by quantization, we propose an efficient tuning method that only learns a small number of low-rank weights while freezing the pre-trained quantized model. After training, these low-rank parameters can be fused into the frozen weights without affecting inference. Extensive experiments on LLaMA-1 and LLaMA-2 show that QLLM is able to obtain accurate quantized models efficiently. For example, QLLM quantizes the 4-bit LLaMA-2-70B within 10 hours on a single A100-80G GPU, outperforming the previous state-of-the-art method by 7.89% on the average accuracy across five zero-shot tasks. Code is available at ZIP Lab and ModelTC.

For agents

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

get_harvested_code_for_paper("2310.08041")
get_code_for_paper("2310.08041")
have("2310.08041")

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

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

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

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

Connect an agent — have() is free.