SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.10631 · ACL · 2024

BitDistiller: Unleashing the Potential of Sub-4-Bit LLMs via Self-Distillation

Jiaqi Guo, Ningyi Xu, Xiaowen Chu, Yijia Zhang, Ting Cao, Dayou Du, Shijie Cao

arXiv · PDF · Open in the Atlas

Code that ran

8 of 15 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; 3 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 4 failures of our instrument; 7 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/2402.10631.json · badge: /api/ran/2402.10631.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
dd-duda/bitdistiller canonical (classifier label)
classifier basis: census
8 ran · 7 no recorded run
FunctionStatusWhere it lives
build_alibi_bias Ran
ran; our contract draft was wrong, not the code
dd-duda/bitdistiller/inference/models/mpt.py
code served (permissive licence) · get_code("f9ef8eeb630a0972")
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. 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 math

torch.manual_seed(0)

ARGS = {
    "n_heads": 8,
    "seq_len": 16,
    "full": True,
    "alibi_bias_max": 8,
    "dtype": torch.float32
}
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 — 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
calculate_zeros_width Ran
ran, honoured the contract we drafted
dd-duda/bitdistiller/quantization/qmodule.py
code served (permissive licence) · get_code("fd8719af3db2c5ae")
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 int, ndim 0, dtype family int, shape () 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 numpy as np

torch.manual_seed(0)

# Analyze the function:
# calculate_zeros_width takes:
# - in_features: an integer (used in arithmetic operations)
# - group_size: an integer with default 128 (used in conditionals and arithmetic)
# - pack_num: an integer with default 8 (used in arithmetic)
# 
# The function performs integer arithmetic and conditional logic.
# No objects or methods are called, just arithmetic operations.

ARGS = {
    "in_features": 256,
    "group_size": 128,
    "pack_num": 8,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, 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
gen_slopes Ran
ran, honoured the contract we drafted
dd-duda/bitdistiller/inference/models/mpt.py
code served (permissive licence) · get_code("5dfd0c2387dff573")
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 4, dtype family float, shape (1, 8, 1, 1) 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 math

torch.manual_seed(0)

ARGS = {
    "n_heads": 8,
    "alibi_bias_max": 8
}
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 4, dtype family float, shape (1, 8, 1, 1) — shape (1, 8, 1, 1) 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_named_linears Ran
ran; our contract draft was wrong, not the code
dd-duda/bitdistiller/quantization/pre_quant.py
code served (permissive licence) · get_code("0310065bdf9208bb")
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 dict. 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)

# Create a simple neural network module with Linear layers
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
        self.relu = nn.ReLU()
        self.linear3 = nn.Linear(2, 1)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.relu(x)
        x = self.linear2(x)
        x = self.linear3(x)
        return x

module = SimpleModel()

ARGS = {
    "module": module
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
make_divisible Ran
ran, honoured the contract we drafted
dd-duda/bitdistiller/quantization/qmodule.py
code served (permissive licence) · get_code("ad85b288e9acb9c2")
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 int, ndim 0, dtype family int, shape () 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

ARGS = {
    "c": 10,
    "divisor": 3
}
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 int, ndim 0, dtype family int, 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
precompute_freqs_cis Ran
ran, violated the contract we drafted
dd-duda/bitdistiller/inference/models/llama.py
pointer only (licence: MIT); the stored copy get_code serves, from meituan-automl/visionllama, is pointer only (licence: NONE) · get_code("14a84c2cbfebc413")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from meituan-automl/visionllama, 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.

reshape_for_broadcast Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
dd-duda/bitdistiller/inference/models/llama.py
pointer only (licence: MIT); the stored copy get_code serves, from alpha-vllm/llama2-accessory, is pointer only (licence: NOASSERTION) · get_code("70bf6ebaafd266c4")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from alpha-vllm/llama2-accessory, 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.

rotate_half Ran
ran; our contract draft was wrong, not the code
dd-duda/bitdistiller/inference/models/falcon.py
pointer only (licence: MIT); the stored copy get_code serves, from dmgcsilva/vigia, is pointer only (licence: NONE) · get_code("766ad0e51b7a8f09")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from dmgcsilva/vigia, 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_emb Not yet run
unverified (harvested, no recorded run)
dd-duda/bitdistiller/inference/models/llama.py
code served (permissive licence) · get_code("797af70a155dd94f")
How it ran

no invocation recorded.

convertModelToQuant Not yet run
unverified (harvested, no recorded run)
dd-duda/bitdistiller/quantization/qlinear.py
code served (permissive licence) · get_code("daff7fa3b7b944d2")
How it ran

no invocation recorded.

get_blocks Not yet run
unverified (harvested, no recorded run)
dd-duda/bitdistiller/quantization/pre_quant.py
code served (permissive licence) · get_code("fa80a6587641fb46")
How it ran

no invocation recorded.

get_calib_dataset Not yet run
unverified (harvested, no recorded run)
dd-duda/bitdistiller/quantization/clip_utils.py
code served (permissive licence) · get_code("a1ca17436132cd8f")
How it ran

no invocation recorded.

get_calib_dataset_code Not yet run
unverified (harvested, no recorded run)
dd-duda/bitdistiller/quantization/clip_utils.py
code served (permissive licence) · get_code("eca59c8a0da72a0c")
How it ran

no invocation recorded.

get_pile_dataset Not yet run
unverified (harvested, no recorded run)
dd-duda/bitdistiller/quantization/clip_utils.py
code served (permissive licence) · get_code("05aeb596afd8012e")
How it ran

no invocation recorded.

run_awq Not yet run
unverified (harvested, no recorded run)
dd-duda/bitdistiller/quantization/pre_quant.py
code served (permissive licence) · get_code("fa755c29499d4073")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 6 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 4 the same month, 6 later) and 9 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
reshape_for_broadcast 58 other papers
18 dated earlier, 4 the same month, 36 later · 2 only as an assembly brick
2023.emnlp-main.534 (2023 (year only))
Disentangling Transformer Language Models as Superposed Topic Models
2303.09736 (2023-03)
Dynamic Structure Pruning for Compressing CNNs
2307.09288 (2023-07)
Llama 2: Open Foundation and Fine-Tuned Chat Models
and 55 more not named here
precompute_freqs_cis 47 other papers
16 dated earlier, 2 the same month, 29 later · 1 only as an assembly brick
2023.emnlp-main.534 (2023 (year only))
Disentangling Transformer Language Models as Superposed Topic Models
2303.09736 (2023-03)
Dynamic Structure Pruning for Compressing CNNs
2307.09288 (2023-07)
Llama 2: Open Foundation and Fine-Tuned Chat Models
and 44 more not named here
rotate_half 9 other papers
6 dated earlier, 2 later, 1 same year, order not determinable
2305.11072 (2023-05)
Self-supervised Fine-tuning for Improved Content Representations by Speaker-invariant Clustering
2310.13802 (2023-10)
Improving Molecular Properties Prediction Through Latent Space Fusion
2311.04219 (2023-11)
OtterHD: A High-Resolution Multi-modality Model
and 6 more not named here
calculate_zeros_width 3 other papers
1 the same month, 2 later
2402.02750 (2024-02)
KIVI: A Tuning-Free Asymmetric 2bit Quantization for KV Cache
2403.05527 (2024-03)
GEAR: An Efficient KV Cache Compression Recipe for Near-Lossless Generative Inference of LLM
make_divisible 3 other papers
1 the same month, 2 later
2402.02750 (2024-02)
KIVI: A Tuning-Free Asymmetric 2bit Quantization for KV Cache
2403.05527 (2024-03)
GEAR: An Efficient KV Cache Compression Recipe for Near-Lossless Generative Inference of LLM
get_named_linears 1 other paper
1 later
Li_MBQ_Modality-Balanced_Quantization_for_Large_Vision-Language_Models_CVPR_2025_paper (2025 (year only))
MBQ: Modality-Balanced Quantization for Large 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

The upscaling of Large Language Models (LLMs) has yielded impressive advances in natural language processing, yet it also poses significant deployment challenges. Weight quantization has emerged as a widely embraced solution to reduce memory and computational demands. This paper introduces BitDistiller, a framework that synergizes Quantization-Aware Training (QAT) with Knowledge Distillation (KD) to boost the performance of LLMs at ultra-low precisions (sub-4-bit). Specifically, BitDistiller first incorporates a tailored asymmetric quantization and clipping technique to maximally preserve the fidelity of quantized weights, and then proposes a novel Confidence-Aware Kullback-Leibler Divergence (CAKLD) objective, which is employed in a self-distillation manner to enable faster convergence and superior model performance. Empirical evaluations demonstrate that BitDistiller significantly surpasses existing methods in both 3-bit and 2-bit configurations on general language understanding and complex reasoning benchmarks. Notably, Bit-Distiller is shown to be more cost-effective, demanding fewer data and training resources. The code is available at https://github.com/ DD-DuDa/BitDistiller.

For agents

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

get_harvested_code_for_paper("2402.10631")
get_code_for_paper("2402.10631")
have("2402.10631")

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

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

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

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

Connect an agent — have() is free.