SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2201.07703 · 2022

Q-ViT: Fully Differentiable Quantization for Vision Transformer

arXiv · PDF · Open in the Atlas

Code that ran

7 of 9 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; 2 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 4 failures of our instrument; 2 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/2201.07703.json · badge: /api/ran/2201.07703.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
zhexinli/Q-ViT-DeiT canonical (classifier label)
classifier basis not recorded on the link
7 ran · 2 no recorded run
FunctionStatusWhere it lives
binaryconv3x3 Ran
ran; our contract draft was wrong, not the code
zhexinli/Q-ViT-DeiT/quantization/binary_layer.py
pointer only (licence: Apache-2.0) · get_code("80f2879bb6f51376")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, zhexinli/Q-ViT-DeiT, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with 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.

bit_pass Ran
ran on a synthesized input
zhexinli/Q-ViT-DeiT/quantization/lsq_layer.py
pointer only (licence: Apache-2.0) · get_code("95541a011a466d49")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, zhexinli/Q-ViT-DeiT, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with 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.

build_transform Ran
ran; our contract draft was wrong, not the code
zhexinli/Q-ViT-DeiT/datasets.py
pointer only (licence: Apache-2.0) · get_code("3bc74137ab36aa79")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, zhexinli/Q-ViT-DeiT, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with 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.

conv1x1 Ran
ran; our contract draft was wrong, not the code
zhexinli/Q-ViT-DeiT/quantization/binary_layer.py
pointer only (licence: Apache-2.0) · get_code("d9def42110729a85")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, zhexinli/Q-ViT-DeiT, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with 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.

conv3x3 Ran
ran; our contract draft was wrong, not the code
zhexinli/Q-ViT-DeiT/quantization/binary_layer.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from lixiaotong97/DSU, is pointer only (licence: NONE) · get_code("fac5364e2f53c6db")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, zhexinli/Q-ViT-DeiT, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with 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.

grad_scale Ran
ran, honoured the contract we drafted
zhexinli/Q-ViT-DeiT/quantization/lsq_layer.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from hustzxd/LSQuantization, is pointer only (licence: NONE) · get_code("d75564df9359ef7b")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, zhexinli/Q-ViT-DeiT, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with 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.

round_pass Ran
ran, honoured the contract we drafted
zhexinli/Q-ViT-DeiT/quantization/lsq_layer.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from hustzxd/LSQuantization, is pointer only (licence: NONE) · get_code("40027e5e78ca8837")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, zhexinli/Q-ViT-DeiT, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with 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.

build_dataset Not yet run
unverified (harvested, no recorded run)
zhexinli/Q-ViT-DeiT/datasets.py
pointer only (licence: Apache-2.0) · get_code("73f2b0390392d532")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, zhexinli/Q-ViT-DeiT, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with 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. No invocation recorded.

get_default_kwargs_q Not yet run
unverified (harvested, no recorded run)
zhexinli/Q-ViT-DeiT/quantization/_quan_base.py
pointer only (licence: Apache-2.0) · get_code("43729536d4f65a49")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, zhexinli/Q-ViT-DeiT, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with 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. No invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 7 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 1 the same month, 7 later) and 2 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
conv3x3 686 other papers
363 dated earlier, 4 the same month, 308 later, 11 same year, order not determinable · 31 only as an assembly brick
1406.2661 (2014-06)
Generative Adversarial Networks
1409.0575 (2014-09)
ImageNet Large Scale Visual Recognition Challenge
1412.6572 (2014-12)
Explaining and Harnessing Adversarial Examples
and 683 more not named here
conv1x1 431 other papers
168 dated earlier, 251 later, 11 same year, order not determinable, 1 undated · 38 only as an assembly brick
1409.1556 (2014-09)
Very Deep Convolutional Networks for Large-Scale Image Recognition
1506.01186 (2015-06)
Cyclical Learning Rates for Training Neural Networks
1507.05717 (2015-07)
An End-to-End Trainable Neural Network for Image-based Sequence Recognition and Its Application to Scene Text Recognition
and 428 more not named here
build_transform 37 other papers
8 dated earlier, 27 later, 2 same year, order not determinable
2104.05707 (2021-04)
LocalViT: Analyzing Locality in Vision Transformers
2104.13840 (2021-04)
Twins: Revisiting the Design of Spatial Attention in Vision Transformers
2106.00515 (2021-06)
KVT: k-NN Attention for Boosting Vision Transformers
and 34 more not named here
build_dataset 25 other papers
5 dated earlier, 17 later, 3 same year, order not determinable
2104.05707 (2021-04)
LocalViT: Analyzing Locality in Vision Transformers
2106.00515 (2021-06)
KVT: k-NN Attention for Boosting Vision Transformers
2106.01401 (2021-06)
Container: Context Aggregation Network
and 22 more not named here
grad_scale 5 other papers
1 dated earlier, 4 later
1902.08153 (2019-02)
Learned Step Size Quantization
aaai_28109 (2024 (year only))
Bi-ViT: Pushing the Limit of Vision Transformer Quantization
2404.05662 (2024-04)
BinaryDM: Accurate Weight Binarization for Efficient Diffusion Models
and 2 more not named here
round_pass 5 other papers
1 dated earlier, 4 later
1902.08153 (2019-02)
Learned Step Size Quantization
aaai_28109 (2024 (year only))
Bi-ViT: Pushing the Limit of Vision Transformer Quantization
2404.05662 (2024-04)
BinaryDM: Accurate Weight Binarization for Efficient Diffusion Models
and 2 more not named here
binaryconv3x3 2 other papers
1 dated earlier, 1 later
2102.08946 (2021-02)
S 2 -BNN: Bridging the Gap Between Self-Supervised Real and 1-bit Neural Networks via Guided Distribution Calibration
2209.01404 (2022-09)
Towards Accurate Binary Neural Networks via Modeling Contextual Dependencies

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

In this paper, we propose a fully differentiable quantization method for vision transformer (ViT) named as Q-ViT, in which both of the quantization scales and bit-widths are learnable parameters. Specifically, based on our observation that heads in ViT display different quantization robustness, we leverage head-wise bit-width to squeeze the size of Q-ViT while preserving performance. In addition, we propose a novel technique named switchable scale to resolve the convergence problem in the joint training of quantization scales and bit-widths. In this way, Q-ViT pushes the limits of ViT quantization to 3-bit without heavy performance drop. Moreover, we analyze the quantization robustness of every architecture component of ViT and show that the Multi-head Self-Attention (MSA) and the Gaussian Error Linear Units (GELU) are the key aspects for ViT quantization. This study provides some insights for further research about ViT quantization. Extensive experiments on different ViT models, such as DeiT and Swin Transformer show the effectiveness of our quantization method. In particular, our method outperforms the state-of-the-art uniform quantization method by 1.5% on DeiT-Tiny.

For agents

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

get_harvested_code_for_paper("2201.07703")
get_code_for_paper("2201.07703")
have("2201.07703")

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

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

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

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

Connect an agent — have() is free.