{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/vision-transformers-need-registers","title":"Vision Transformers Need Registers","arxiv_id":"2309.16588","date":"2023-09-28","proceeding":null,"authors":["Timothée Darcet","Maxime Oquab","Julien Mairal","Piotr Bojanowski"],"abstract":"Transformers have recently emerged as a powerful tool for learning visual representations. In this paper, we identify and characterize artifacts in feature maps of both supervised and self-supervised ViT networks. The artifacts correspond to high-norm tokens appearing during inference primarily in low-informative background areas of images, that are repurposed for internal computations. We propose a simple yet effective solution based on providing additional tokens to the input sequence of the Vision Transformer to fill that role. We show that this solution fixes that problem entirely for both supervised and self-supervised models, sets a new state of the art for self-supervised visual models on dense visual prediction tasks, enables object discovery methods with larger models, and most importantly leads to smoother feature maps and attention maps for downstream visual processing.","url_abs":"https://arxiv.org/abs/2309.16588v2","url_pdf":"https://arxiv.org/pdf/2309.16588v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"vision-transformers-need-registers","repo_url":"https://github.com/facebookresearch/dinov2","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"vision-transformers-need-registers","repo_url":"https://github.com/borisdayma/clip-jax","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"jax","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"vision-transformers-need-registers","repo_url":"https://github.com/locuslab/massive-activations","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"vision-transformers-need-registers","repo_url":"https://github.com/nickjiang2378/test-time-registers","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"vision-transformers-need-registers","repo_url":"https://github.com/rwightman/pytorch-image-models","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null},{"paper_slug":"vision-transformers-need-registers","repo_url":"https://gitlab.com/birder/birder","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"object-discovery","task_name":"Object Discovery"},{"task_slug":"self-supervised-image-classification","task_name":"Self-Supervised Image Classification"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"},{"method_slug":"vision-transformer","method_name":"Vision Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/self-supervised-image-classification-on","task":"Self-Supervised Image Classification","dataset":"ImageNet","model":"DINOv2+reg (ViT-g/14)","rank_in_archive_order":1,"of":144,"metrics":{"Number of Params":"1100M","Top 1 Accuracy":"87.1"},"uses_additional_data":true}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2309.16588","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2309.16588"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/rwightman/pytorch-image-models","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/locuslab/massive-activations","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://gitlab.com/birder/birder","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/facebookresearch/dinov2","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/nickjiang2378/test-time-registers","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/borisdayma/clip-jax","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran_draft_wrong":2,"ran_violates":1,"ran_honours":1,"unverified":16},"by_repo_kind":{"official":{"samples":3,"ran":3,"repositories":1},"listed":{"samples":15,"ran":1,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"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"},"n_pointer_only_for_licence":2,"samples":[{"code_sha256_prefix":"7715dbecb1b8cfd6","entry":"convert_path_or_url_to_url","repo":"facebookresearch/dinov2","repo_kind":"official","path":"dinov2/hub/backbones.py","file_url":"https://github.com/facebookresearch/dinov2/blob/HEAD/dinov2/hub/backbones.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"7715dbecb1b8cfd6"}},{"code_sha256_prefix":"911ac52477a145cc","entry":"is_url","repo":"facebookresearch/dinov2","repo_kind":"official","path":"dinov2/hub/backbones.py","file_url":"https://github.com/facebookresearch/dinov2/blob/HEAD/dinov2/hub/backbones.py","link_basis":"first_harvest_node","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"911ac52477a145cc"}},{"code_sha256_prefix":"e7fcb6d9ac9deaf4","entry":"named_apply","repo":"facebookresearch/dinov2","repo_kind":"official","path":"dinov2/models/vision_transformer.py","file_url":"https://github.com/facebookresearch/dinov2/blob/HEAD/dinov2/models/vision_transformer.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e7fcb6d9ac9deaf4"}},{"code_sha256_prefix":"2d67a8a756fe7cf8","entry":"posemb_sincos_2d","repo":"borisdayma/clip-jax","repo_kind":"listed","path":"clip_jax/modeling.py","file_url":"https://github.com/borisdayma/clip-jax/blob/HEAD/clip_jax/modeling.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2d67a8a756fe7cf8"}},{"code_sha256_prefix":"141f5bebbf4455dd","entry":"count_params","repo":"borisdayma/clip-jax","repo_kind":"listed","path":"clip_jax/utils.py","file_url":"https://github.com/borisdayma/clip-jax/blob/HEAD/clip_jax/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"141f5bebbf4455dd"}},{"code_sha256_prefix":"87c57735e68651cc","entry":"get_system_characteristics","repo":"borisdayma/clip-jax","repo_kind":"listed","path":"clip_jax/maxtext/accelerator_to_spec_map.py","file_url":"https://github.com/borisdayma/clip-jax/blob/HEAD/clip_jax/maxtext/accelerator_to_spec_map.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"87c57735e68651cc"}},{"code_sha256_prefix":"1cd2728a84872357","entry":"has_ddp_wrapper","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"1cd2728a84872357"}},{"code_sha256_prefix":"d3f6068e5f1cc03f","entry":"image_to_logits","repo":"borisdayma/clip-jax","repo_kind":"listed","path":"clip_jax/data.py","file_url":"https://github.com/borisdayma/clip-jax/blob/HEAD/clip_jax/data.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d3f6068e5f1cc03f"}},{"code_sha256_prefix":"831515af28a2a745","entry":"load_config","repo":"borisdayma/clip-jax","repo_kind":"listed","path":"clip_jax/utils.py","file_url":"https://github.com/borisdayma/clip-jax/blob/HEAD/clip_jax/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"831515af28a2a745"}},{"code_sha256_prefix":"c8e657cf59894a37","entry":"logical_axis_rules","repo":"borisdayma/clip-jax","repo_kind":"listed","path":"clip_jax/partitions.py","file_url":"https://github.com/borisdayma/clip-jax/blob/HEAD/clip_jax/partitions.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c8e657cf59894a37"}},{"code_sha256_prefix":"e147d773ebc71aa4","entry":"logits_to_image","repo":"borisdayma/clip-jax","repo_kind":"listed","path":"clip_jax/data.py","file_url":"https://github.com/borisdayma/clip-jax/blob/HEAD/clip_jax/data.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e147d773ebc71aa4"}},{"code_sha256_prefix":"4be991be800e82bc","entry":"maybe_get_artifact","repo":"borisdayma/clip-jax","repo_kind":"listed","path":"clip_jax/wandb_utils.py","file_url":"https://github.com/borisdayma/clip-jax/blob/HEAD/clip_jax/wandb_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"4be991be800e82bc"}},{"code_sha256_prefix":"e89c437719b73776","entry":"norm","repo":"borisdayma/clip-jax","repo_kind":"listed","path":"clip_jax/modeling.py","file_url":"https://github.com/borisdayma/clip-jax/blob/HEAD/clip_jax/modeling.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e89c437719b73776"}},{"code_sha256_prefix":"9446a8d501beb52e","entry":"normalize","repo":"borisdayma/clip-jax","repo_kind":"listed","path":"clip_jax/modeling.py","file_url":"https://github.com/borisdayma/clip-jax/blob/HEAD/clip_jax/modeling.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9446a8d501beb52e"}},{"code_sha256_prefix":"f565e9c6316d8c64","entry":"remove_ddp_wrapper","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"f565e9c6316d8c64"}},{"code_sha256_prefix":"9e0d5ce23e1ddbfb","entry":"sample_nucleus_topp_logits","repo":"borisdayma/clip-jax","repo_kind":"listed","path":"clip_jax/maxtext/inference_utils.py","file_url":"https://github.com/borisdayma/clip-jax/blob/HEAD/clip_jax/maxtext/inference_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9e0d5ce23e1ddbfb"}},{"code_sha256_prefix":"213c7fbbc33f5eec","entry":"sample_topk_logits","repo":"borisdayma/clip-jax","repo_kind":"listed","path":"clip_jax/maxtext/inference_utils.py","file_url":"https://github.com/borisdayma/clip-jax/blob/HEAD/clip_jax/maxtext/inference_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"213c7fbbc33f5eec"}},{"code_sha256_prefix":"5d8736f0387a699d","entry":"sampling","repo":"borisdayma/clip-jax","repo_kind":"listed","path":"clip_jax/maxtext/inference_utils.py","file_url":"https://github.com/borisdayma/clip-jax/blob/HEAD/clip_jax/maxtext/inference_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5d8736f0387a699d"}},{"code_sha256_prefix":"fd9f7273b986bc74","entry":"shift_tokens_left","repo":"borisdayma/clip-jax","repo_kind":"listed","path":"clip_jax/data.py","file_url":"https://github.com/borisdayma/clip-jax/blob/HEAD/clip_jax/data.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"fd9f7273b986bc74"}},{"code_sha256_prefix":"b2d0cfef5bc878ce","entry":"with_logical_constraint","repo":"borisdayma/clip-jax","repo_kind":"listed","path":"clip_jax/utils.py","file_url":"https://github.com/borisdayma/clip-jax/blob/HEAD/clip_jax/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b2d0cfef5bc878ce"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}