SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2203.08368 · ECCV · 2022

Mixed-Precision Neural Network Quantization via Learned Layer-wise Importance

Wenwu Zhu, Chen Tang, Yaowei Wang, Zhi Wang, Kai Ouyang, Yifei Zhu, Wen Ji

arXiv · PDF · Open in the Atlas

Code that ran

6 of 6 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 3 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 1 failure of our instrument; 0 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/2203.08368.json · badge: /api/ran/2203.08368.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
1hunters/LIMPQ marked official in Papers with Code
Papers with Code archive
4 ran · 0 no recorded run
copy not recorded community
not in the paper's declared repositories
2 ran · 0 no recorded run
FunctionStatusWhere it lives
LsqQuan Ran
ran on a synthesized input · constructed an object; no result was computed
1hunters/LIMPQ/quantization_training/quan/quantizer/lsq.py
code served (permissive licence) · get_code("19b82b339c16e729")
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 an instance of its own class, LsqQuan: the run constructed the object and did not call it, so no result was computed. 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)

# Build the ARGS dict with all parameters for LsqQuan.__init__
ARGS = {
    'bit': 8,
    'all_positive': False,
    'symmetric': False,
    'per_channel': True,
    'floor_weight': 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 LsqQuan — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a LsqQuan 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
Quantizer Ran
ran on a synthesized input · constructed an object; no result was computed
1hunters/LIMPQ/quantization_training/quan/quantizer/lsq.py
code served (permissive licence) · get_code("c72e6780cb69622d")
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 an instance of its own class, Quantizer: the run constructed the object and did not call it, so no result was computed. 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 small input tensor (batch_size=2, features=4)
x = torch.randn(2, 4)

# Create bits parameter
bits = 8

# Define ARGS dict with all parameters for Quantizer.__init__
ARGS = {
    'bit': 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 Quantizer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Quantizer 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
compute_thd Ran
ran, honoured the contract we drafted
1hunters/LIMPQ/quantization_training/quan/quantizer/lsq.py
code served (permissive licence) · get_code("47babd16aec6e5d9")
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
import torch.nn as nn

class QuantizationConfig(nn.Module):
    def __init__(self, all_positive=False, symmetric=False):
        super().__init__()
        self.all_positive = all_positive
        self.symmetric = symmetric
    
    def compute_thd(self, bits):
        if self.all_positive:
            assert not self.symmetric, 'Positive quantization cannot be symmetric'
            thd_neg = 0
            thd_pos = 2 ** bits - 1
        elif self.symmetric:
            thd_neg = -2 ** (bits - 1) + 1
            thd_pos = 2 ** (bits - 1) - 1
        else:
            thd_neg = -2 ** (bits - 1)
            thd_pos = 2 ** (bits - 1) - 1
        return (thd_neg, thd_pos)

torch.manual_seed(0)

# Create an instance with default settings (not all_positive, not symmetric)
quantizer = QuantizationConfig(all_positive=False, symmetric=False)

ARGS = {
    'self': quantizer,
    'bits': 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 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
grad_scale Ran
ran, honoured the contract we drafted
this paper's copy was not recorded; identical code first harvested from jiyoonkm/columnquant
pointer only; the stored copy get_code serves, from jiyoonkm/columnquant, is pointer only (licence: NONE) · get_code("a488bae52f1bfd5d")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

quant_operator Ran
ran; our contract draft was wrong, not the code
1hunters/LIMPQ/quantization_training/quan/quantizer/lsq.py
code served (permissive licence) · get_code("ed0c43d8f1ea3ee2")
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)

# Analyze the function:
# - x: used with .numel(), /, torch.clamp(), round_pass()
#   -> must be a tensor
# - s: used with grad_scale(), / operator
#   -> must be a tensor (scalar or broadcastable)
# - thd_neg, thd_pos: used in torch.clamp()
#   -> numeric values (floats)
# - floor: parameter exists but is never used in the function body
#   -> can be any value

x = torch.randn(2, 4)
s = torch.tensor(0.5)
thd_neg = -1.0
thd_pos = 1.0
floor = 0

ARGS = {
    "x": x,
    "s": s,
    "thd_neg": thd_neg,
    "thd_pos": thd_pos,
    "floor": floor
}
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
round_pass Ran
ran, honoured the contract we drafted
this paper's copy was not recorded; identical code first harvested from jiyoonkm/columnquant
pointer only; the stored copy get_code serves, from jiyoonkm/columnquant, is pointer only (licence: NONE) · get_code("ed1a69e092272dba")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 2 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
grad_scale
brick of this paper's assembly: helper
4 other papers
2 dated earlier, 2 later
1902.08153 (2019-02)
Learned Step Size Quantization
2004.09576 (2020-04)
LSQ+: Improving low-bit quantization through learnable offsets and better initialization
2302.02210 (2023-02)
Oscillation-free Quantization for Low-bit Vision Transformers
and 1 more not named here
round_pass
brick of this paper's assembly: helper
4 other papers
2 dated earlier, 2 later
1902.08153 (2019-02)
Learned Step Size Quantization
2004.09576 (2020-04)
LSQ+: Improving low-bit quantization through learnable offsets and better initialization
2302.02210 (2023-02)
Oscillation-free Quantization for Low-bit Vision Transformers
and 1 more not named here

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

The exponentially large discrete search space in mixed-precision quantization (MPQ) makes it hard to determine the optimal bit-width for each layer. Previous works usually resort to iterative search methods on the training set, which consume hundreds or even thousands of GPUhours. In this study, we reveal that some unique learnable parameters in quantization, namely the scale factors in the quantizer, can serve as importance indicators of a layer, reflecting the contribution of that layer to the final accuracy at certain bit-widths. These importance indicators naturally perceive the numerical transformation during quantization-aware training, which can precisely provide quantization sensitivity metrics of layers. However, a deep network always contains hundreds of such indicators, and training them one by one would lead to an excessive time cost. To overcome this issue, we propose a joint training scheme that can obtain all indicators at once. It considerably speeds up the indicators training process by parallelizing the original sequential training processes. With these learned importance indicators, we formulate the MPQ search problem as a one-time integer linear programming (ILP) problem. That avoids the iterative search and significantly reduces search time without limiting the bit-width search space. For example, MPQ search on ResNet18 with our indicators takes only 0.06 seconds, which improves time efficiency exponentially compared to iterative search methods. Also, extensive experiments show our approach can achieve SOTA accuracy on ImageNet for far-ranging models with various constraints (e.g., BitOps, compress rate).

For agents

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

get_harvested_code_for_paper("2203.08368")
get_code_for_paper("2203.08368")
have("2203.08368")

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

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

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

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

Connect an agent — have() is free.