Papers › BHViT: Binarized Hybrid Vision Transformer

BHViT: Binarized Hybrid Vision Transformer

4 Mar 2025CVPR 2025 1arXiv:2503.02394archive 2025-07-28

Tian Gao, Zhiyuan Zhang, Yu Zhang, Huajun Liu, Kaijie Yin, Chengzhong Xu, Hui Kong

Model binarization has made significant progress in enabling real-time and energy-efficient computation for convolutional neural networks (CNN), offering a potential solution to the deployment challenges faced by Vision Transformers (ViTs) on edge devices. However, due to the structural differences between CNN and Transformer architectures, simply applying binary CNN strategies to the ViT models will lead to a significant performance drop. To tackle this challenge, we propose BHViT, a binarization-friendly hybrid ViT architecture and its full binarization model with the guidance of three important observations. Initially, BHViT utilizes the local information interaction and hierarchical feature aggregation technique from coarse to fine levels to address redundant computations stemming from excessive tokens. Then, a novel module based on shift operations is proposed to enhance the performance of the binary Multilayer Perceptron (MLP) module without significantly increasing computational overhead. In addition, an innovative attention matrix binarization method based on quantization decomposition is proposed to evaluate the token's importance in the binarized attention matrix. Finally, we propose a regularization loss to address the inadequate optimization caused by the incompatibility between the weight oscillation in the binary layers and the Adam Optimizer. Extensive experimental results demonstrate that our proposed algorithm achieves SOTA performance among binary ViT methods.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology View this paper on Syntology: its repositories, every harvested function with whether it ran, its licence and the call to fetch it.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2503.02394")

Code

Syntology Ran 16 of 29 code samples harvested from 1 repository linked to this paper; 13 have no recorded run. Of those that ran: 1 ran · fixture could not drive it; 15 ran with no contract checked.

By repository: official repository: 29 samples from 1 repository, 16 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

IMRL/BHViT officialmentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

29 samples harvested; 16 ran; 0 honoured the contract we drafted; 13 have no recorded run. Read from Syntology's graph 2026-09-25; that is when this build read the record, not when the samples ran.

1ran · fixture could not drive it
15ran
13unverified

Licence: 0 of the 29 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from IMRL/BHViT. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

BHViTEmbeddings IMRL/BHViT/transformer/BHViT.py official repository ran · metamorphic tier: deterministic MIT (permissive) · 7e1832d29c4089e3 · report
BHViTPatchEmbeddings IMRL/BHViT/transformer/BHViT.py official repository ran · metamorphic tier: deterministic fingerprinted MIT (permissive) · a1f47c9b7b8a2b6a · report
BinaryActivation_Attention IMRL/BHViT/transformer/BHViT.py official repository ran · metamorphic tier: deterministic fingerprinted MIT (permissive) · e1be08d992cdbec6 · report
BinaryQuantizer IMRL/BHViT/transformer/BHViT.py official repository ran MIT (permissive) · 7864a7f2d635f1cc · report
GSB_Attention IMRL/BHViT/transformer/BHViT.py official repository ran MIT (permissive) · bc00cba6dd4fd931 · report
LayerScale IMRL/BHViT/transformer/BHViT.py official repository ran · metamorphic tier: deterministic MIT (permissive) · 5a33cb0660a4f8f5 · report
LearnableBiasnn IMRL/BHViT/transformer/BHViT.py official repository ran · metamorphic tier: deterministic fingerprinted MIT (permissive) · 80ac18a2d3335ec2 · report
PatchEmbed IMRL/BHViT/transformer/BHViT.py official repository ran · metamorphic tier: deterministic MIT (permissive) · f74b4e57f68230ce · report
RPReLU IMRL/BHViT/transformer/BHViT.py official repository ran · metamorphic tier: deterministic MIT (permissive) · 5053a360d7323930 · report
Shift IMRL/BHViT/transformer/BHViT.py official repository ran fingerprinted MIT (permissive) · 8a8583dbbaae1dd0 · report
Shift2 IMRL/BHViT/transformer/BHViT.py official repository ran fingerprinted MIT (permissive) · 2383072bc4ad455a · report
Shift_channel_mix IMRL/BHViT/transformer/BHViT.py official repository ran fingerprinted MIT (permissive) · 818b750a4ca6f3f2 · report
SymQuantizer IMRL/BHViT/transformer/BHViT.py official repository ran MIT (permissive) · a22c340e89f0aa29 · report
Token_for_Attention IMRL/BHViT/transformer/BHViT.py official repository ran · metamorphic tier: deterministic MIT (permissive) · 7da1d198566520b7 · report
TwnQuantizer IMRL/BHViT/transformer/BHViT.py official repository ran MIT (permissive) · f04ba986abc61036 · report
windows_split IMRL/BHViT/transformer/BHViT.py official repository ran · fixture could not drive it fingerprinted MIT (permissive) · 00e8fb5b0d52f96f · report
BHViTAttention IMRL/BHViT/transformer/BHViT.py official repository unverified MIT (permissive) · 80e2ed60aa621a51 · report
BHViTEncoder IMRL/BHViT/transformer/BHViT.py official repository unverified MIT (permissive) · 6937c2e66bd08ef0 · report
BHViTLayer IMRL/BHViT/transformer/BHViT.py official repository unverified MIT (permissive) · 39ca817be9205f9e · report
BHViTModel IMRL/BHViT/transformer/BHViT.py official repository unverified MIT (permissive) · 061e33af6401f92a · report
BHViTSelfAttention IMRL/BHViT/transformer/BHViT.py official repository unverified MIT (permissive) · 8856810408ef8784 · report
BHViTSelfOutput IMRL/BHViT/transformer/BHViT.py official repository unverified MIT (permissive) · 58380fdab4ebd58e · report
BinaryPatchEmbed IMRL/BHViT/transformer/BHViT.py official repository unverified MIT (permissive) · 50f22547e2f27990 · report
GCLayer IMRL/BHViT/transformer/BHViT.py official repository unverified MIT (permissive) · 505e71bceab8cb1a · report
QuantizeConv2d IMRL/BHViT/transformer/BHViT.py official repository unverified MIT (permissive) · 0af4680021d038d8 · report
QuantizeLinear IMRL/BHViT/transformer/BHViT.py official repository unverified MIT (permissive) · 0cefbcad32882f70 · report
ViTIntermediate IMRL/BHViT/transformer/BHViT.py official repository unverified MIT (permissive) · e071c97816d8e232 · report
ViTOutput IMRL/BHViT/transformer/BHViT.py official repository unverified MIT (permissive) · b0f024c430a3ab21 · report
token_mixer IMRL/BHViT/transformer/BHViT.py official repository unverified MIT (permissive) · f4252cbcf11d1708 · report

Tasks

BinarizationQuantization

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections