Abstract
BinaryViT bridges the performance gap between 1-bit Vision Transformers (ViTs) and binary Convolutional Neural Networks (CNNs). By integrating architectural "tricks" from CNNs—such as pyramid structures, multi-pooling branches, and global average pooling—into a pure ViT, the authors achieve 70.6% Top-1 accuracy on ImageNet. This makes binary transformers competitive with state-of-the-art binary CNNs for the first time, offering a path toward efficient transformer deployment on edge devices.
Introduction
As artificial intelligence moves toward edge deployment on devices like smartphones and IoT sensors, the demand for extremely compressed and efficient models has surged. Binarization—the process of reducing weights and activations to a single bit (-1 or +1)—represents a significant milestone in model compression. By replacing expensive floating-point multiplications with simple bitwise operations (XOR and popcount), binarization offers the potential for massive speedups and memory savings.
However, while binary Convolutional Neural Networks (CNNs) have reached high levels of accuracy, binary Vision Transformers (ViTs) have historically lagged behind. When a standard ViT, such as DeiT, is binarized, its accuracy drops significantly more than that of a CNN. This research investigates the architectural "secret sauce" that allows CNNs to maintain robustness under binarization and adapts these properties to create BinaryViT.
The Representational Bottleneck
The primary challenge in binarizing ViTs is the "representational gap." The authors quantify "element-wise representational capability" and find that a binary ResNet-34 has a representational space orders of magnitude larger than a binary DeiT-S. This lack of "slots" for complex information in 1-bit ViTs explains their poor performance.
As shown in the baseline results above, even with advanced techniques like distillation and ReActNet-style activations, standard binary ViTs struggle to exceed 50% accuracy on ImageNet.
Methods: Borrowing from CNNs
To address these limitations, the authors introduce four key architectural modifications to the standard ViT framework:
- Pyramid Structure: Unlike vanilla ViTs that maintain a constant resolution, BinaryViT utilizes a 4-stage pyramid. This allows the model to process high-resolution features in early stages, which is mathematically vital for maintaining binary representational power.
- Global Average Pooling (GAP): Vanilla ViTs rely on a single
[CLS]token for image summarization. In a 1-bit regime, this token becomes a massive bottleneck. Replacing it with GAP allows the model to aggregate information from all patches, increasing the final layer's representational capability by nearly 200x. - Multi-Pooling Branches: Parallel average pooling layers with different kernel sizes (e.g., 1x3, 3x1) are added to mimic how convolutions aggregate local spatial information. This helps recover feature diversity lost during binarization.
- LayerScale: Learnable scaling factors are inserted before residual connections to prevent the identity branch from overwhelming newly processed features, a common failure mode in deep binary networks.
Key Results
BinaryViT demonstrates substantial improvements over previous binary transformer baselines:
- Accuracy: While a baseline binary DeiT-S achieves only 48.5% Top-1 accuracy on ImageNet, BinaryViT reaches 67.7%. With full-precision patch embeddings, it hits 70.6%, outperforming the popular binary CNN ReActNet (67.5%).
- Efficiency: BinaryViT achieves these results with approximately 7x fewer FLOPs and 2x fewer total operations (OPs) than comparable binary ResNet-34 models.
- Complexity: Pooling layers prove to be "free" complexity; they aggregate multiple 1-bit values into higher-precision outputs without adding binary parameters, effectively "up-sampling" bit-depth to maintain signal integrity.
Conclusion and Future Work
BinaryViT proves that transformers can be as efficient and accurate as CNNs in the 1-bit regime if their architecture is properly adapted. While the pyramid structure and pooling branches make the model more "CNN-like," they are essential for overcoming the representational limitations of binary tokens. Future work will focus on closing the remaining 10% accuracy gap between BinaryViT and its full-precision counterparts and further optimizing the computational cost of high-resolution early stages.
Summary updated