Papers › All Tokens Matter: Token Labeling for Training Better Vision Transformers

All Tokens Matter: Token Labeling for Training Better Vision Transformers

22 Apr 2021NeurIPS 2021 12arXiv:2104.10858archive 2025-07-28

Zihang Jiang, Qibin Hou, Li Yuan, Daquan Zhou, Yujun Shi, Xiaojie Jin, Anran Wang, Jiashi Feng

In this paper, we present token labeling -- a new training objective for training high-performance vision transformers (ViTs). Different from the standard training objective of ViTs that computes the classification loss on an additional trainable class token, our proposed one takes advantage of all the image patch tokens to compute the training loss in a dense manner. Specifically, token labeling reformulates the image classification problem into multiple token-level recognition problems and assigns each patch token with an individual location-specific supervision generated by a machine annotator. Experiments show that token labeling can clearly and consistently improve the performance of various ViT models across a wide spectrum. For a vision transformer with 26M learnable parameters serving as an example, with token labeling, the model can achieve 84.4% Top-1 accuracy on ImageNet. The result can be further increased to 86.4% by slightly scaling the model size up to 150M, delivering the minimal-sized model among previous models (250M+) reaching 86%. We also show that token labeling can clearly improve the generalization capability of the pre-trained models on downstream tasks with dense prediction, such as semantic segmentation. Our code and all the training details will be made publicly available at https://github.com/zihangJiang/TokenLabeling.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

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

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 5 code samples: 4 from 2 repositories linked to this paper, 1 identical to code harvested from another paper's repository. Across all 5: 3 ran (of which 0 constructed an object rather than computing a result; 1 with no instrument failure: 1 honoured, 0 violated, 0 with no contract checked; 2 where Syntology's instrument failed) · 2 unverified. Where Syntology's instrument failed: 2 where the contract check could not run; failures of Syntology's instrument, not of the code.

By repository: official repository: 2 samples from 1 repository, 1 ran (1 with no instrument failure; 0 where Syntology's instrument failed); community (archive-listed): 2 samples from 1 repository, 2 ran (0 with no instrument failure; 2 where Syntology's instrument failed); 1 identical to code first harvested elsewhere. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

No sample is linked to this paper from 4 of its repositories that Syntology harvested for other papers:

Levels written on 2026-09-22 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.

zihangJiang/TokenLabeling officialmentioned in papermentioned on GitHubpytorchSyntology: 2 samples, 1 ran (0 instrument-failed) · 1 unverified report
catalpaaa/demansia mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Mamba: Linear-Time Sequence Modeling with Selective State Spaces (arXiv:2312.00752; that paper's own run record: 28 ran (of which 7 constructed an object rather than computing a result; 20 with no instrument failure: 0 honoured, 0 violated, 20 with no contract checked; 8 where Syntology's instrument failed) · 34 unverified); nothing checks that they implement this paper's method. report
flytocc/TokenLabeling-paddle mentioned on GitHubpaddleSyntology: not harvested report
naver-ai/vidt mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Co-Scale Conv-Attentional Image Transformers (arXiv:2104.06399; that paper's own run record: 17 ran (of which 11 constructed an object rather than computing a result; 16 with no instrument failure: 0 honoured, 0 violated, 16 with no contract checked; 1 where Syntology's instrument failed) · 5 unverified) and An Extendable, Efficient and Effective Transformer-based Object Detector (arXiv:2204.07962; that paper's own run record: 2 ran (of which 0 constructed an object rather than computing a result; 0 with no instrument failure: 0 honoured, 0 violated, 0 with no contract checked; 2 where Syntology's instrument failed) · 1 unverified); nothing checks that they implement this paper's method. report
sail-sg/dualformer mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localization (arXiv:1610.02391; that paper's own run record: 90 ran (of which 32 constructed an object rather than computing a result; 62 with no instrument failure: 6 honoured, 4 violated, 52 with no contract checked; 28 where Syntology's instrument failed) · 51 unverified); nothing checks that they implement this paper's method. report
zhoudaquan/Refiner_ViT mentioned on GitHubpytorchSyntology: 2 samples, 2 ran (2 instrument-failed) · 0 unverified report
PaddlePaddle/PASSL paddleApache-2.0Syntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to DINOv2: Learning Robust Visual Features without Supervision (arXiv:2304.07193; that paper's own run record: 39 ran (of which 13 constructed an object rather than computing a result; 32 with no instrument failure: 2 honoured, 0 violated, 30 with no contract checked; 7 where Syntology's instrument failed) · 7 unverified); nothing checks that they implement this paper's method. 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.

A paper named beside a repository with no sample linked to this paper is shown with that paper's own run record, not this paper's: “ran” means executed on a synthesized input, not that the code is correct, and “where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Papers are listed in arXiv-id order, at most three per repository.

Code Syntology ran Syntology

5 samples harvested: 3 ran (of which 0 constructed an object rather than computing a result; 1 with no instrument failure: 1 honoured, 0 violated, 0 with no contract checked; 2 where Syntology's instrument failed) · 2 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page has not changed since , the first build that kept a record date for it; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

1ran · honoured contract
2ran; the contract check could not run
2unverified

Licence: 3 of the 5 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; the list below is grouped by repository, each group headed by its name and what it is to the paper. 1 sample is listed last, in a group without a repository. “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. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. For 1 sample that ran, the graph records a signature this page does not show: an argument's recorded type or element kind is a printout of an object in Syntology's harness (such as a mock object, a class or a pandas printout), not the type of an input, so it does not describe the call's shape. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (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 are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. 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 six 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; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. 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.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity.

zihangJiang/TokenLabeling official repository 2 samples, 1 ran (0 instrument-failed) · 1 unverified
get_dpr tlt/models/lvvit.py ran · honoured contract Apache-2.0 (permissive) · b240fa8e2e8f8ec6 · report fixture: signature drop_path_rate:float/0/float, depth:int/0/int, drop_path_decay:str/0/str · returned list · level recorded 2026-09-22
get_block in 40 papers tlt/models/lvvit.py unverified Apache-2.0 (permissive) · 219807603e18aac6 · report
zhoudaquan/Refiner_ViT community (archive-listed) 2 samples, 2 ran (2 instrument-failed) · 0 unverified
Position_embedding models/refined_transformer.py ran; the contract check could not run (RAISES) · metamorphic tier: well formed no licence file found · pointer only · 9ebf0e5695d4429d · report fixture: signature size:tuple/1/int, stride:int/0/int · returned Tensor · level recorded 2026-09-22
get_points_single models/refined_transformer.py ran; the contract check could not run (RAISES) · metamorphic tier: well formed no licence file found · pointer only · c8df8fc3cbc72444 · report fixture: returned Tensor · level recorded 2026-09-22
Repository not located 1 sample, 0 ran · 1 unverified
1 sample is identical to code Syntology harvested from another paper's repository; this paper's own copy was not located, so no repository is named and no licence is recorded.
rand_bbox in 63 papers repository not located unverified licence of this copy not recorded · d34a085d71b8f4b5 · report

Tasks

AllEfficient ViTsGeneral ClassificationImage ClassificationSemantic Segmentationimage-classification

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Efficient ViTs ImageNet-1K (With LV-ViT-S) Base (LV-ViT-S) GFLOPs 6.6 #3 of 19 Archive leaderboard report
Efficient ViTs ImageNet-1K (With LV-ViT-S) Base (LV-ViT-S) Top 1 Accuracy 83.3 #3 of 19 Archive leaderboard report
Image Classification ImageNet LV-ViT-L GFLOPs 214.8 #151 of 1060 Archive leaderboard report
Image Classification ImageNet LV-ViT-L Number of params 151M #151 of 1060 Archive leaderboard report
Image Classification ImageNet LV-ViT-L Top 1 Accuracy 86.4% #151 of 1060 Archive leaderboard report
Image Classification ImageNet LV-ViT-M GFLOPs 16 #356 of 1060 Archive leaderboard report
Image Classification ImageNet LV-ViT-M Number of params 56M #356 of 1060 Archive leaderboard report
Image Classification ImageNet LV-ViT-M Top 1 Accuracy 84.1% #356 of 1060 Archive leaderboard report
Image Classification ImageNet LV-ViT-S GFLOPs 6.6 #438 of 1060 Archive leaderboard report
Image Classification ImageNet LV-ViT-S Number of params 26M #438 of 1060 Archive leaderboard report
Image Classification ImageNet LV-ViT-S Top 1 Accuracy 83.3% #438 of 1060 Archive leaderboard report
Semantic Segmentation ADE20K LV-ViT-L (UperNet, MS) Params (M) 209 #91 of 235 Archive leaderboard report
Semantic Segmentation ADE20K LV-ViT-L (UperNet, MS) Validation mIoU 51.8 #91 of 235 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

AttentionDense ConnectionsLV-ViTLayer NormalizationLinear LayerMulti-Head AttentionResidual ConnectionSoftmaxVision Transformer

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