Papers › Not All Patches are What You Need: Expediting Vision Transformers via Token Reorganizations

Not All Patches are What You Need: Expediting Vision Transformers via Token Reorganizations

16 Feb 2022arXiv:2202.07800archive 2025-07-28

Youwei Liang, Chongjian Ge, Zhan Tong, Yibing Song, Jue Wang, Pengtao Xie

Vision Transformers (ViTs) take all the image patches as tokens and construct multi-head self-attention (MHSA) among them. Complete leverage of these image tokens brings redundant computations since not all the tokens are attentive in MHSA. Examples include that tokens containing semantically meaningless or distractive image backgrounds do not positively contribute to the ViT predictions. In this work, we propose to reorganize image tokens during the feed-forward process of ViT models, which is integrated into ViT during training. For each forward inference, we identify the attentive image tokens between MHSA and FFN (i.e., feed-forward network) modules, which is guided by the corresponding class token attention. Then, we reorganize image tokens by preserving attentive image tokens and fusing inattentive ones to expedite subsequent MHSA and FFN computations. To this end, our method EViT improves ViTs from two perspectives. First, under the same amount of input image tokens, our method reduces MHSA and FFN computation for efficient inference. For instance, the inference speed of DeiT-S is increased by 50% while its recognition accuracy is decreased by only 0.3% for ImageNet classification. Second, by maintaining the same computational cost, our method empowers ViTs to take more image tokens as input for recognition accuracy improvement, where the image tokens are from higher resolution images. An example is that we improve the recognition accuracy of DeiT-S by 1% for ImageNet classification at the same computational cost of a vanilla DeiT-S. Meanwhile, our method does not introduce more parameters to ViTs. Experiments on the standard benchmarks show the effectiveness of our method. The code is available at https://github.com/youweiliang/evit

PaperPDFCodeCode 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="2202.07800")

Code

Syntology Ran 6 of 15 code samples harvested from 2 repositories linked to this paper; 9 have no recorded run. Of those that ran: 2 ran · our draft was wrong; 2 ran · fixture could not drive it; 2 ran with no contract checked.

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

youweiliang/evit officialmentioned in papermentioned on GitHubpytorchApache-2.0 report
shiming-chen/zslvit mentioned 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

15 samples harvested; 6 ran; 0 honoured the contract we drafted; 9 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.

2ran · our draft was wrong
2ran · fixture could not drive it
2ran
9unverified

Licence: 12 of the 15 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 2 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.

adjust_keep_rate youweiliang/evit/helpers.py official repository ran Apache-2.0 recorded; this copy not marked cleared · pointer only · 66733f50aff69220 · report
drop_path youweiliang/evit/evit.py official repository ran · fixture could not drive it Apache-2.0 recorded; this copy not marked cleared · pointer only · 39eace7e2822504f · report
resize_pos_embed youweiliang/evit/evit.py official repository ran · fixture could not drive it Apache-2.0 recorded; this copy not marked cleared · pointer only · 191b2735955d18f4 · report
speed_test youweiliang/evit/helpers.py official repository ran Apache-2.0 recorded; this copy not marked cleared · pointer only · e294b62d47bcc26f · report
build_transform youweiliang/evit/datasets.py official repository unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · 3bc74137ab36aa79 · report
checkpoint_filter_fn youweiliang/evit/evit.py official repository unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · 6d8a1f8a0697180f · report
dumps_pyarrow youweiliang/evit/folder2lmdb.py official repository unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · 9e7bf674714e06d5 · report
get_deeper_idx youweiliang/evit/visualize_mask.py official repository unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · efdf8b9d60927bcd · report
get_real_idx youweiliang/evit/visualize_mask.py official repository unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · 22f1fefd3b89cf1f · report
loads_pyarrow youweiliang/evit/folder2lmdb.py official repository unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · b4c154b6f0568b6b · report
mask youweiliang/evit/visualize_mask.py official repository unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · 5112560529a3d643 · report
raw_reader youweiliang/evit/folder2lmdb.py official repository unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · 51738010a21f76a1 · report
merge Retinal-Research/EVIT-UNET/unet/eff_unet.py community ran · our draft was wrong MIT (permissive) · 5ce6e78745861c0e · report
stem Retinal-Research/EVIT-UNET/unet/eff_unet.py community ran · our draft was wrong MIT (permissive) · 560e3160f50add18 · report
load_from Retinal-Research/EVIT-UNET/train_unetKD.py community unverified MIT (permissive) · 4ce559065d5b1b96 · report

Tasks

AllEfficient ViTs

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Efficient ViTs ImageNet-1K (With LV-ViT-S) EViT (70%) GFLOPs 4.7 #10 of 19 Archive leaderboard report
Efficient ViTs ImageNet-1K (With LV-ViT-S) EViT (70%) Top 1 Accuracy 83.0 #10 of 19 Archive leaderboard report
Efficient ViTs ImageNet-1K (With LV-ViT-S) EViT (50%) GFLOPs 3.9 #16 of 19 Archive leaderboard report
Efficient ViTs ImageNet-1K (With LV-ViT-S) EViT (50%) Top 1 Accuracy 82.5 #16 of 19 Archive leaderboard report
Efficient ViTs ImageNet-1K (with DeiT-S) EViT (80%) GFLOPs 3.5 #7 of 41 Archive leaderboard report
Efficient ViTs ImageNet-1K (with DeiT-S) EViT (80%) Top 1 Accuracy 79.8 #7 of 41 Archive leaderboard report
Efficient ViTs ImageNet-1K (with DeiT-S) EViT (90%) GFLOPs 4.0 #10 of 41 Archive leaderboard report
Efficient ViTs ImageNet-1K (with DeiT-S) EViT (90%) Top 1 Accuracy 79.8 #10 of 41 Archive leaderboard report
Efficient ViTs ImageNet-1K (with DeiT-S) EViT (70%) GFLOPs 3.0 #21 of 41 Archive leaderboard report
Efficient ViTs ImageNet-1K (with DeiT-S) EViT (70%) Top 1 Accuracy 79.5 #21 of 41 Archive leaderboard report
Efficient ViTs ImageNet-1K (with DeiT-S) EViT (60%) GFLOPs 2.6 #32 of 41 Archive leaderboard report
Efficient ViTs ImageNet-1K (with DeiT-S) EViT (60%) Top 1 Accuracy 78.9 #32 of 41 Archive leaderboard report
Efficient ViTs ImageNet-1K (with DeiT-S) EViT (50%) GFLOPs 2.3 #37 of 41 Archive leaderboard report
Efficient ViTs ImageNet-1K (with DeiT-S) EViT (50%) Top 1 Accuracy 78.5 #37 of 41 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

SPEED

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