SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.04291 · 2024

BiLLM: Pushing the Limit of Post-Training Quantization for LLMs

arXiv · PDF · Open in the Atlas

Code that ran

8 of 11 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; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 8 failures of our instrument; 3 no recorded run), measured 2026-11-22; 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.04291.json · badge: /api/ran/2402.04291.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
aaronhuang-778/billm canonical (classifier label)
classifier basis: census
8 ran · 3 no recorded run
FunctionStatusWhere it lives
calculate_percentage_and_variance_original Ran
ran; our contract draft was wrong, not the code
aaronhuang-778/billm/utils/autosearch.py
code served (permissive licence) · get_code("979aa3c27b3192b2")
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

torch.manual_seed(0)

# Create small tensors for the function
# weights: tensor of weight values (can be positive or negative)
# abs_weights: tensor of absolute values of weights
# bin_edges: list/tensor defining bin boundaries

weights = torch.randn(12)  # 12 random weight values
abs_weights = torch.abs(weights)  # absolute values

# Create bin edges - these define the boundaries for binning
# We'll create 4 bins: [0, 0.25), [0.25, 0.5), [0.5, 0.75), [0.75, 1.0]
bin_edges = torch.tensor([0.0, 0.25, 0.5, 0.75, 1.0])

ARGS = {
    "weights": weights,
    "abs_weights": abs_weights,
    "bin_edges": bin_edges,
}
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
error_computing Ran
ran; our contract draft was wrong, not the code
aaronhuang-778/billm/utils/autosearch.py
code served (permissive licence) · get_code("6bace2f25ec5ba40")
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 0, dtype family float, 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

torch.manual_seed(0)

# Create two small tensors with distinct shapes for origin and quantized matrices
origin_matrix = torch.randn(2, 4)
quantized_matrix = torch.randn(2, 4)

ARGS = {
    "origin_matrix": origin_matrix,
    "quantized_matrix": quantized_matrix,
}
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 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
find_layers Ran
ran; our contract draft was wrong, not the code
aaronhuang-778/billm/modelutils.py
pointer only (licence: MIT); the stored copy get_code serves, from squeezeailab/kvquant, is pointer only (licence: NONE) · get_code("a9e7f2cdf016b88b")
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 squeezeailab/kvquant, 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.

generate_mask Ran
ran; our contract draft was wrong, not the code
aaronhuang-778/billm/utils/mask.py
code served (permissive licence) · get_code("fc283fd7e228ed38")
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 3, 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

torch.manual_seed(0)

# Create a small matrix with various magnitudes for testing the masks
origin_matrix = torch.randn(2, 4)

# Define border values for the mask thresholds
braq1_border = 0.5  # Lower boundary
braq2_border = 1.5  # Upper boundary

ARGS = {
    "origin_matrix": origin_matrix,
    "braq2_border": braq2_border,
    "braq1_border": braq1_border,
}
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 3, dtype family float — 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
generate_structural_mask Ran
ran; our contract draft was wrong, not the code
aaronhuang-778/billm/utils/mask.py
code served (permissive licence) · get_code("10bfd6f601862d1a")
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 3, 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

torch.manual_seed(0)

# Construct arguments for generate_structural_mask
origin_matrix = torch.randn(2, 4)
mask3 = torch.rand(2, 4) > 0.5
braq1_border = 0.5

ARGS = {
    "origin_matrix": origin_matrix,
    "mask3": mask3,
    "braq1_border": braq1_border,
}
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 3, dtype family float — 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
high_order_residual Ran
ran; our contract draft was wrong, not the code
aaronhuang-778/billm/binary.py
code served (permissive licence) · get_code("7ae3b57ecdeec075")
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

torch.manual_seed(0)

# Construct arguments for high_order_residual function
# x: a 2D tensor (batch_size, features)
# mask: a boolean mask tensor with same shape as x
# order: integer specifying the order of residuals

x = torch.randn(2, 4)  # batch_size=2, features=4
mask = torch.rand(2, 4) > 0.3  # boolean mask, some True some False

ARGS = {
    "x": x,
    "mask": mask,
    "order": 2
}
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
normal_quantize Ran
ran; our contract draft was wrong, not the code
aaronhuang-778/billm/binary.py
code served (permissive licence) · get_code("dd1edfd05dda7353")
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

torch.manual_seed(0)

# Create small test tensors
x = torch.randn(2, 4)  # Small batch of floats to quantize
scale = torch.tensor(0.1)  # Scale factor for quantization
zero = torch.tensor(5, dtype=torch.long)  # Zero point offset
maxq = torch.tensor(15, dtype=torch.long)  # Maximum quantization level

ARGS = {
    "x": x,
    "scale": scale,
    "zero": zero,
    "maxq": maxq,
}
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
part_mean Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
aaronhuang-778/billm/binary.py
code served (permissive licence) · get_code("25eb3a441763f260")
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, 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

torch.manual_seed(0)

# Create a small tensor with shape (batch=2, features=4)
# The function uses tensor operations: != comparison, *, mean(-1), view(-1, 1)
tensor = torch.randn(2, 4)

# The function has op parameter but it's not actually used in the body
op = '-'

ARGS = {
    'tensor': tensor,
    'op': op
}
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, 1) — shape (2, 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_ptb Not yet run
unverified (harvested, no recorded run)
aaronhuang-778/billm/datautils.py
pointer only (licence: MIT); the stored copy get_code serves, from Aaronhuang-778/MC-MoE, is pointer only (licence: NONE) · get_code("a7cbf4fc49c71e03")
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 Aaronhuang-778/MC-MoE, 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. No invocation recorded.

get_tokenizer Not yet run
unverified (harvested, no recorded run)
aaronhuang-778/billm/datautils.py
code served (permissive licence) · get_code("729f957048af4a3f")
How it ran

no invocation recorded.

get_wikitext2 Not yet run
unverified (harvested, no recorded run)
aaronhuang-778/billm/datautils.py
pointer only (licence: MIT); the stored copy get_code serves, from Aaronhuang-778/MC-MoE, is pointer only (licence: NONE) · get_code("011909315dfdbc2e")
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 Aaronhuang-778/MC-MoE, 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. No invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 7 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 4 the same month, 7 later) and 4 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
find_layers 27 other papers
9 dated earlier, 1 the same month, 15 later, 1 same year, order not determinable, 1 undated
2203.13474 (2022-03)
CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis
2023.emnlp-main.892 (2023 (year only))
Z-FOLD: A Frustratingly Easy Post-Training Quantization Scheme for LLMs
2307.09288 (2023-07)
Llama 2: Open Foundation and Fine-Tuned Chat Models
and 24 more not named here
get_ptb 7 other papers
1 dated earlier, 1 the same month, 5 later
2310.00034 (2023-10)
PB-LLM: Partially Binarized Large Language Models
2402.17946 (2024-02)
SparseLLM: Towards Global Pruning of Pre-trained Language Models
2405.15756 (2024-05)
Wasserstein Distances, Neuronal Entanglement, and Sparsity
and 4 more not named here
get_tokenizer 6 other papers
1 dated earlier, 1 the same month, 4 later
2310.00034 (2023-10)
PB-LLM: Partially Binarized Large Language Models
2402.17946 (2024-02)
SparseLLM: Towards Global Pruning of Pre-trained Language Models
2409.18850 (2024-09)
Two Sparse Matrices are Better than One: Sparsifying Neural Networks with Double Sparse Factorization
and 3 more not named here
get_wikitext2 6 other papers
1 dated earlier, 1 the same month, 4 later
2310.00034 (2023-10)
PB-LLM: Partially Binarized Large Language Models
2402.17946 (2024-02)
SparseLLM: Towards Global Pruning of Pre-trained Language Models
2409.18850 (2024-09)
Two Sparse Matrices are Better than One: Sparsifying Neural Networks with Double Sparse Factorization
and 3 more not named here
high_order_residual 1 other paper
1 later
2505.02214 (2025-05)
An Empirical Study of Qwen3 Quantization
normal_quantize 1 other paper
1 later
2505.02214 (2025-05)
An Empirical Study of Qwen3 Quantization
part_mean 1 other paper
1 later
2505.02214 (2025-05)
An Empirical Study of Qwen3 Quantization

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

Repositories linked to this paper

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

Abstract

Pretrained large language models (LLMs) exhibit exceptional general language processing capabilities but come with significant demands on memory and computational resources. As a powerful compression technology, binarization can extremely reduce model weights to a mere 1 bit, lowering the expensive computation and memory requirements. However, existing quantization techniques fall short of maintaining LLM performance under ultra-low bit-widths. In response to this challenge, we present BiLLM, a groundbreaking 1-bit post-training quantization scheme tailored for pretrained LLMs. Based on the weight distribution of LLMs, BiLLM first identifies and structurally selects salient weights, and minimizes the compression loss through an effective binary residual approximation strategy. Moreover, considering the bell-shaped distribution of the non-salient weights, we propose an optimal splitting search to group and binarize them accurately. BiLLM achieving for the first time high-accuracy inference (e.g. 8.41 perplexity on LLaMA2-70B) with only 1.08-bit weights across various LLMs families and evaluation metrics, outperforms SOTA quantization methods of LLM by significant margins. Moreover, BiLLM enables the binarization process of the LLM with 7 billion weights within 0.5 hours on a single GPU, demonstrating satisfactory time efficiency. Our code is available at https://github.com/Aaronhuang-778/BiLLM.

For agents

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

get_harvested_code_for_paper("2402.04291")
get_code_for_paper("2402.04291")
have("2402.04291")

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

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

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

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

Connect an agent — have() is free.