Papers › LeViT: a Vision Transformer in ConvNet's Clothing for Faster Inference

LeViT: a Vision Transformer in ConvNet's Clothing for Faster Inference

2 Apr 2021ICCV 2021 10arXiv:2104.01136archive 2025-07-28

Ben Graham, Alaaeldin El-Nouby, Hugo Touvron, Pierre Stock, Armand Joulin, Hervé Jégou, Matthijs Douze

We design a family of image classification architectures that optimize the trade-off between accuracy and efficiency in a high-speed regime. Our work exploits recent findings in attention-based architectures, which are competitive on highly parallel processing hardware. We revisit principles from the extensive literature on convolutional neural networks to apply them to transformers, in particular activation maps with decreasing resolutions. We also introduce the attention bias, a new way to integrate positional information in vision transformers. As a result, we propose LeVIT: a hybrid neural network for fast inference image classification. We consider different measures of efficiency on different hardware platforms, so as to best reflect a wide range of application scenarios. Our extensive experiments empirically validate our technical choices and show they are suitable to most architectures. Overall, LeViT significantly outperforms existing convnets and vision transformers with respect to the speed/accuracy tradeoff. For example, at 80% ImageNet top-1 accuracy, LeViT is 5 times faster than EfficientNet on CPU. We release the code at https://github.com/facebookresearch/LeViT

PaperPDFConference PDFCodeCode Syntology ran

In Syntology 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="2104.01136")

Code

Syntology Ran 23 of 30 code samples harvested from 6 repositories linked to this paper; 7 have no recorded run. Of those that ran: 3 ran · honoured contract; 1 ran · violated contract; 1 ran · our draft was wrong; 1 ran · fixture could not drive it; 17 ran with no contract checked.

By repository: official repository: 4 samples from 1 repository, 3 ran; community (archive-listed): 26 samples from 5 repositories, 20 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

facebookresearch/LeViT officialmentioned in papermentioned on GitHubpytorch report
rwightman/pytorch-image-models officialmentioned in papermentioned on GitHubpytorch report
ahmedelmahy/myownvit mentioned on GitHubpytorch report
conceptofmind/LeViT-flax mentioned on GitHubjax report
gatech-eic/vitcod mentioned on GitHubpytorch report
huggingface/transformers mentioned on GitHubpytorch report
ttt496/vit-pytorch mentioned on GitHubpytorch report
JoegameZhou/Levit mindsporeApache-2.0 report
mszpc/levit_c mindsporeApache-2.0 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

30 samples harvested; 23 ran; 3 honoured the contract we drafted; 7 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

3ran · honoured contract
1ran · violated contract
1ran · our draft was wrong
1ran · fixture could not drive it
17ran
7unverified

Licence: 0 of the 30 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 6 repositories linked to this paper, official or community; each sample names its own and says which. “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.

Attention facebookresearch/LeViT/levit.py official repository ran Apache-2.0 (permissive) · f75bc648af8ba051 · report
AttentionSubsample facebookresearch/LeViT/levit.py official repository ran Apache-2.0 (permissive) · 1fc862a8415abe13 · report
Residual facebookresearch/LeViT/levit.py official repository ran fingerprinted Apache-2.0 (permissive) · 2e3b4d9ce0862869 · report
LeViT facebookresearch/LeViT/levit.py official repository unverified Apache-2.0 (permissive) · abad5a7ac0d6223e · report
Attention ahmedelmahy/myownvit/vit_pytorch/levit.py community (archive-listed) ran · metamorphic tier: deterministic MIT (permissive) · 1e3d5a2962c6d68e · report
Attention gatech-eic/vitcod/Algorithm/levit/levit.py community (archive-listed) ran Apache-2.0 (permissive) · a70f356fb000eeaf · report
Attention conceptofmind/LeViT-flax/levit.py community (archive-listed) ran MIT (permissive) · 9a030b11684381a9 · report
AttentionSubsample gatech-eic/vitcod/Algorithm/levit/levit.py community (archive-listed) ran Apache-2.0 (permissive) · 1483bc0115c957b4 · report
BN_Linear gatech-eic/vitcod/Algorithm/levit/levit.py community (archive-listed) ran fingerprinted Apache-2.0 (permissive) · 1f62c224d093c749 · report
FeedForward ahmedelmahy/myownvit/vit_pytorch/levit.py community (archive-listed) ran · metamorphic tier: deterministic MIT (permissive) · fe5a9a73766eb1f4 · report
FeedForward ttt496/vit-pytorch/vit_pytorch/levit.py community (archive-listed) ran · metamorphic tier: invariant MIT (permissive) · 8e82526051003880 · report
LeViT ahmedelmahy/myownvit/vit_pytorch/levit.py community (archive-listed) ran · metamorphic tier: deterministic MIT (permissive) · c571a7adc6cce77a · report
LeViT conceptofmind/LeViT-flax/levit.py community (archive-listed) ran MIT (permissive) · 9a2be313ddf53888 · report
Linear_BN gatech-eic/vitcod/Algorithm/levit/levit.py community (archive-listed) ran Apache-2.0 (permissive) · 1e3dca9dff1d266c · report
MLP conceptofmind/LeViT-flax/levit.py community (archive-listed) ran MIT (permissive) · 471a5ccd8e325eae · report
Subsample gatech-eic/vitcod/Algorithm/levit/levit.py community (archive-listed) ran Apache-2.0 (permissive) · 6b31362b57a70857 · report
Transformer ahmedelmahy/myownvit/vit_pytorch/levit.py community (archive-listed) ran · metamorphic tier: deterministic MIT (permissive) · 50a7b63b362ab9ab · report
Transformer conceptofmind/LeViT-flax/levit.py community (archive-listed) ran MIT (permissive) · c42a6cdb12b88c28 · report
always ahmedelmahy/myownvit/vit_pytorch/levit.py community (archive-listed) ran · our draft was wrong MIT (permissive) · 47332d86fb8b809f · report
cal_num_elements_pattern gatech-eic/vitcod/Algorithm/levit/levit.py community (archive-listed) ran · honoured contract Apache-2.0 (permissive) · 6a217c032da74a62 · report
cal_reduced_Gflops gatech-eic/vitcod/Algorithm/levit/levit.py community (archive-listed) ran · honoured contract Apache-2.0 (permissive) · 654dc28ca7504d97 · report
cast_tuple ahmedelmahy/myownvit/vit_pytorch/levit.py community (archive-listed) ran · honoured contract fingerprinted MIT (permissive) · 15c7fd492938a25c · report
mask_read_files gatech-eic/vitcod/Algorithm/levit/levit.py community (archive-listed) ran · fixture could not drive it Apache-2.0 (permissive) · 66259b2558804bdd · report
str2bool JoegameZhou/Levit/config.py community (archive-listed) ran · violated contract Apache-2.0 (permissive) · 17061f7e01a6fc86 · report
GlobalAvgPool conceptofmind/LeViT-flax/levit.py community (archive-listed) unverified MIT (permissive) · cb105deb9841b373 · report
LeViT gatech-eic/vitcod/Algorithm/levit/levit.py community (archive-listed) unverified Apache-2.0 (permissive) · e527a2503227989c · report
LeViT ttt496/vit-pytorch/vit_pytorch/levit.py community (archive-listed) unverified MIT (permissive) · faac50d91b2a1582 · report
Residual gatech-eic/vitcod/Algorithm/levit/levit.py community (archive-listed) unverified Apache-2.0 (permissive) · 37406361a9c395c4 · report
Transformer ttt496/vit-pytorch/vit_pytorch/levit.py community (archive-listed) unverified MIT (permissive) · 1c076834c8e03a75 · report
print_pattern_ratio gatech-eic/vitcod/Algorithm/levit/levit.py community (archive-listed) unverified Apache-2.0 (permissive) · 2166b093d2de8c9d · report

Tasks

General ClassificationImage Classificationimage-classification

1 archive task tag without a task page not shown.

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Image Classification CIFAR-10 LeViT-192 Percentage correct 98.2 #50 of 265 Archive leaderboard report
Image Classification CIFAR-10 LeViT-256 Percentage correct 98.1 #55 of 265 Archive leaderboard report
Image Classification CIFAR-10 LeViT-384 Percentage correct 98 #59 of 265 Archive leaderboard report
Image Classification CIFAR-10 LeViT-128 Percentage correct 97.6 #77 of 265 Archive leaderboard report
Image Classification CIFAR-10 LeViT-128S Percentage correct 97.5 #79 of 265 Archive leaderboard report
Image Classification Flowers-102 LeViT-384 Accuracy 98.3 #25 of 52 Archive leaderboard report
Image Classification Flowers-102 LeViT-192 Accuracy 97.8 #36 of 52 Archive leaderboard report
Image Classification Flowers-102 LeViT-256 Accuracy 97.7 #37 of 52 Archive leaderboard report
Image Classification Flowers-102 LeViT-128S Accuracy 96.8 #41 of 52 Archive leaderboard report
Image Classification ImageNet LeViT-384 GFLOPs 2.334 #531 of 1060 Archive leaderboard report
Image Classification ImageNet LeViT-384 Number of params 39.4M #531 of 1060 Archive leaderboard report
Image Classification ImageNet LeViT-384 Top 1 Accuracy 82.5% #531 of 1060 Archive leaderboard report
Image Classification ImageNet LeViT-256 GFLOPs 1.066 #624 of 1060 Archive leaderboard report
Image Classification ImageNet LeViT-256 Number of params 17.8M #624 of 1060 Archive leaderboard report
Image Classification ImageNet LeViT-256 Top 1 Accuracy 81.6% #624 of 1060 Archive leaderboard report
Image Classification ImageNet LeViT-192 GFLOPs 0.624 #726 of 1060 Archive leaderboard report
Image Classification ImageNet LeViT-192 Number of params 10.4M #726 of 1060 Archive leaderboard report
Image Classification ImageNet LeViT-192 Top 1 Accuracy 80% #726 of 1060 Archive leaderboard report
Image Classification ImageNet LeViT-128 GFLOPs 0.376 #748 of 1060 Archive leaderboard report
Image Classification ImageNet LeViT-128 Number of params 8.8M #748 of 1060 Archive leaderboard report
Image Classification ImageNet LeViT-128 Top 1 Accuracy 79.6% #748 of 1060 Archive leaderboard report
Image Classification ImageNet LeViT-128S GFLOPs 0.288 #937 of 1060 Archive leaderboard report
Image Classification ImageNet LeViT-128S Number of params 4.7M #937 of 1060 Archive leaderboard report
Image Classification ImageNet LeViT-128S Top 1 Accuracy 75.7% #937 of 1060 Archive leaderboard report
Image Classification ImageNet ReaL LeViT-384 Accuracy 87.5% #33 of 57 Archive leaderboard report
Image Classification ImageNet ReaL LeViT-256 Accuracy 86.9% #35 of 57 Archive leaderboard report
Image Classification ImageNet ReaL LeViT-192 Accuracy 85.8% #38 of 57 Archive leaderboard report
Image Classification ImageNet ReaL LeViT-128 Accuracy 85.6% #40 of 57 Archive leaderboard report
Image Classification ImageNet ReaL LeViT-128S Accuracy 82.6% #48 of 57 Archive leaderboard report
Image Classification ImageNet V2 LeViT-384 Top 1 Accuracy 71.4 #23 of 33 Archive leaderboard report
Image Classification ImageNet V2 LeViT-256 Top 1 Accuracy 69.9 #24 of 33 Archive leaderboard report
Image Classification ImageNet V2 LeViT-192 Top 1 Accuracy 68.7 #27 of 33 Archive leaderboard report
Image Classification ImageNet V2 LeViT-128 Top 1 Accuracy 67.5 #29 of 33 Archive leaderboard report
Image Classification ImageNet V2 LeViT-128S Top 1 Accuracy 63.9 #33 of 33 Archive leaderboard report
Image Classification Stanford Cars LeViT-192 Accuracy 89.8 #15 of 24 Archive leaderboard report
Image Classification Stanford Cars LeViT-384 Accuracy 89.3 #17 of 24 Archive leaderboard report
Image Classification Stanford Cars LeViT-128 Accuracy 88.6 #18 of 24 Archive leaderboard report
Image Classification Stanford Cars LeViT-128S Accuracy 88.4 #19 of 24 Archive leaderboard report
Image Classification Stanford Cars LeViT-256 Accuracy 88.2 #20 of 24 Archive leaderboard report
Image Classification iNaturalist 2018 LeViT-384 Top-1 Accuracy 66.9% #45 of 60 Archive leaderboard report
Image Classification iNaturalist 2018 LeViT-256 Top-1 Accuracy 66.2% #46 of 60 Archive leaderboard report
Image Classification iNaturalist 2018 LeViT-192 Top-1 Accuracy 60.4% #53 of 60 Archive leaderboard report
Image Classification iNaturalist 2018 LeViT-128S Top-1 Accuracy 55.2% #56 of 60 Archive leaderboard report
Image Classification iNaturalist 2018 LeViT-128 Top-1 Accuracy 54% #57 of 60 Archive leaderboard report
Image Classification iNaturalist 2019 LeViT-384 Top-1 Accuracy 74.3 #15 of 22 Archive leaderboard report
Image Classification iNaturalist 2019 LeViT-256 Top-1 Accuracy 72.3 #18 of 22 Archive leaderboard report
Image Classification iNaturalist 2019 LeViT-192 Top-1 Accuracy 70.8 #20 of 22 Archive leaderboard report
Image Classification iNaturalist 2019 LeViT-128 Top-1 Accuracy 68.4 #21 of 22 Archive leaderboard report
Image Classification iNaturalist 2019 LeViT-128S Top-1 Accuracy 66.5 #22 of 22 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Introduced by this paper: LeVIT, LeViT Attention Block

1x1 ConvolutionAttentionAverage PoolingBatch NormalizationConvolutionDense ConnectionsDepthwise ConvolutionDepthwise Separable ConvolutionDropoutEfficientNetHard SwishInverted Residual BlockLayer NormalizationLeVITLeViT Attention BlockLinear LayerMulti-Head AttentionPointwise ConvolutionRMSPropReLUReLU6Sigmoid ActivationSoftmaxSqueeze-and-Excitation Block

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