SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.00034 · 2023

PB-LLM: Partially Binarized Large Language Models

arXiv · PDF · Open in the Atlas

Code that ran

5 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; 5 failures of our instrument; 6 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/2310.00034.json · badge: /api/ran/2310.00034.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
hahnyuan/binaryllm canonical (classifier label)
classifier basis: census
5 ran · 6 no recorded run
FunctionStatusWhere it lives
find_layers Ran
ran; our contract draft was wrong, not the code
hahnyuan/binaryllm/gptq_pb/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.

get_scheduler Ran
ran; our contract draft was wrong, not the code
hahnyuan/binaryllm/qat/run_qat.py
code served (permissive licence) · get_code("fab444ffcb40c0e4")
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
from torch.optim import Adam

torch.manual_seed(0)

# Create a simple model to optimize
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create optimizer
model = SimpleModel()
optimizer = Adam(model.parameters(), lr=0.001)

# Define the argument
ARGS = {
    "num_training_steps": 1000
}
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 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
prepare_model_for_eval Ran
ran; our contract draft was wrong, not the code
hahnyuan/binaryllm/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from liqunma/fbi-llm, is pointer only (licence: NONE) · get_code("5cc6ee4fff500d54")
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 liqunma/fbi-llm, 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.

prepare_model_for_training Ran
ran; our contract draft was wrong, not the code
hahnyuan/binaryllm/utils.py
code served (permissive licence) · get_code("9fa7ef614ee2fada")
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 SimpleModel. 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 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 SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.embeddings = nn.Embedding(10, 4)
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        x = self.embeddings(x)
        x = self.linear(x)
        return x
    
    def get_input_embeddings(self):
        return self.embeddings
    
    def gradient_checkpointing_enable(self):
        self.gradient_checkpointing = True

model = SimpleModel()

ARGS = {
    "model": model,
}
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 SimpleModel — a SimpleModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModel 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
quantize Ran
ran; our contract draft was wrong, not the code
hahnyuan/binaryllm/gptq_pb/high_quant.py
code served (permissive licence) · get_code("50ceff9d34d96d60")
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)

# x: tensor to quantize
x = torch.randn(2, 4)

# scale: scaling factor (tensor or float)
scale = torch.tensor(0.1)

# zero: zero point offset
zero = torch.tensor(0, dtype=torch.long)

# maxq: maximum quantization level
maxq = 255

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
get_english_quote Not yet run
unverified (harvested, no recorded run)
hahnyuan/binaryllm/datautils.py
code served (permissive licence) · get_code("1cbf0df5b5d26b2a")
How it ran

no invocation recorded.

get_ptb Not yet run
unverified (harvested, no recorded run)
hahnyuan/binaryllm/gptq_pb/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_qat_dataset Not yet run
unverified (harvested, no recorded run)
hahnyuan/binaryllm/datautils.py
code served (permissive licence) · get_code("b1795af698ba5bc6")
How it ran

no invocation recorded.

get_redpajama_train Not yet run
unverified (harvested, no recorded run)
hahnyuan/binaryllm/datautils.py
code served (permissive licence) · get_code("783b484325d75ee8")
How it ran

no invocation recorded.

get_tokenizer Not yet run
unverified (harvested, no recorded run)
hahnyuan/binaryllm/gptq_pb/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)
hahnyuan/binaryllm/gptq_pb/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, 8 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 1 the same month, 8 later) and 3 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
4 dated earlier, 1 the same month, 20 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
7 later
2402.04291 (2024-02)
BiLLM: Pushing the Limit of Post-Training Quantization for LLMs
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
6 later
2402.04291 (2024-02)
BiLLM: Pushing the Limit of Post-Training Quantization for LLMs
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
6 later
2402.04291 (2024-02)
BiLLM: Pushing the Limit of Post-Training Quantization for LLMs
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
quantize 6 other papers
1 dated earlier, 5 later
2307.15290 (2023-07)
ChatHome: Development and Evaluation of a Domain-Specific Language Model for Home Renovation
2024.findings-naacl.145 (2024 (year only))
Role Prompting Guided Domain Adaptation with General Capability Preserve for Large Language Models
2402.17946 (2024-02)
SparseLLM: Towards Global Pruning of Pre-trained Language Models
and 3 more not named here
get_english_quote 1 other paper
1 later
2312.05821 (2023-12)
ASVD: Activation-aware Singular Value Decomposition for Compressing Large Language Models
get_redpajama_train 1 other paper
1 later
2312.05821 (2023-12)
ASVD: Activation-aware Singular Value Decomposition for Compressing Large Language Models
prepare_model_for_eval 1 other paper
1 later
2407.07093 (2024-07)
FBI-LLM: Scaling Up Fully Binarized LLMs from Scratch via Autoregressive Distillation

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

This paper explores network binarization, a radical form of quantization, compressing model weights to a single bit, specifically for Large Language Models (LLMs) compression. Due to previous binarization methods collapsing LLMs, we propose a novel approach, Partially-Binarized LLM (PB-LLM), which can achieve extreme low-bit quantization while maintaining the linguistic reasoning capacity of quantized LLMs. Specifically, our exploration first uncovers the ineffectiveness of naive applications of existing binarization algorithms and highlights the imperative role of salient weights in achieving low-bit quantization. Thus, PB-LLM filters a small ratio of salient weights during binarization, allocating them to higher-bit storage, i.e., partially-binarization. PB-LLM is extended to recover the capacities of quantized LMMs, by analyzing from the perspective of post-training quantization (PTQ) and quantization-aware training (QAT). Under PTQ, combining the concepts from GPTQ, we reconstruct the binarized weight matrix guided by the Hessian matrix and successfully recover the reasoning capacity of PB-LLM in low-bit. Under QAT, we freeze the salient weights during training, explore the derivation of optimal scaling factors crucial for minimizing the quantization error, and propose a scaling mechanism based on this derived scaling strategy for residual binarized weights. Those explorations and the developed methodologies significantly contribute to rejuvenating the performance of low-bit quantized LLMs and present substantial advancements in the field of network binarization for LLMs.The code is available at https://github.com/hahnyuan/BinaryLLM.

For agents

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

get_harvested_code_for_paper("2310.00034")
get_code_for_paper("2310.00034")
have("2310.00034")

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

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

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

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

Connect an agent — have() is free.