{"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/which-tokens-to-use-investigating-token","title":"Which Tokens to Use? Investigating Token Reduction in Vision Transformers","arxiv_id":"2308.04657","date":"2023-08-09","proceeding":null,"authors":["Joakim Bruslund Haurum","Sergio Escalera","Graham W. Taylor","Thomas B. Moeslund"],"abstract":"Since the introduction of the Vision Transformer (ViT), researchers have sought to make ViTs more efficient by removing redundant information in the processed tokens. While different methods have been explored to achieve this goal, we still lack understanding of the resulting reduction patterns and how those patterns differ across token reduction methods and datasets. To close this gap, we set out to understand the reduction patterns of 10 different token reduction methods using four image classification datasets. By systematically comparing these methods on the different classification tasks, we find that the Top-K pruning method is a surprisingly strong baseline. Through in-depth analysis of the different methods, we determine that: the reduction patterns are generally not consistent when varying the capacity of the backbone model, the reduction patterns of pruning-based methods significantly differ from fixed radial patterns, and the reduction patterns of pruning-based methods are correlated across classification datasets. Finally we report that the similarity of reduction patterns is a moderate-to-strong proxy for model performance. Project page at https://vap.aau.dk/tokens.","url_abs":"https://arxiv.org/abs/2308.04657v1","url_pdf":"https://arxiv.org/pdf/2308.04657v1.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":"which-tokens-to-use-investigating-token","repo_url":"https://github.com/JoakimHaurum/TokenReduction","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"classification-1","task_name":"Classification"},{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"token-reduction","task_name":"Token Reduction"},{"task_slug":"image-classification","task_name":"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":"pruning","method_name":"Pruning"},{"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":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2308.04657","atlas_url":"https://app.syntology.ai/?focus=2308.04657","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2308.04657"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/JoakimHaurum/TokenReduction","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":2,"ran":4,"unverified":2},"by_repo_kind":{"listed":{"samples":8,"ran":6,"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":0,"samples":[{"code_sha256_prefix":"908619be92da9903","entry":"batch_index_select","repo":"JoakimHaurum/TokenReduction","repo_kind":"listed","path":"models/dyvit.py","file_url":"https://github.com/JoakimHaurum/TokenReduction/blob/HEAD/models/dyvit.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"908619be92da9903"}},{"code_sha256_prefix":"582b2f1aa69315a0","entry":"batched_index_select","repo":"JoakimHaurum/TokenReduction","repo_kind":"listed","path":"models/ats.py","file_url":"https://github.com/JoakimHaurum/TokenReduction/blob/HEAD/models/ats.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"582b2f1aa69315a0"}},{"code_sha256_prefix":"df3ccc72b60b293e","entry":"build_nabirds_transform","repo":"JoakimHaurum/TokenReduction","repo_kind":"listed","path":"datasets.py","file_url":"https://github.com/JoakimHaurum/TokenReduction/blob/HEAD/datasets.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"df3ccc72b60b293e"}},{"code_sha256_prefix":"6968174cad423485","entry":"cluster_dpc_knn","repo":"JoakimHaurum/TokenReduction","repo_kind":"listed","path":"models/dpcknn.py","file_url":"https://github.com/JoakimHaurum/TokenReduction/blob/HEAD/models/dpcknn.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6968174cad423485"}},{"code_sha256_prefix":"1e125c8d8e5f4f15","entry":"index_points","repo":"JoakimHaurum/TokenReduction","repo_kind":"listed","path":"models/dpcknn.py","file_url":"https://github.com/JoakimHaurum/TokenReduction/blob/HEAD/models/dpcknn.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1e125c8d8e5f4f15"}},{"code_sha256_prefix":"2f8afc8e34c74e5f","entry":"merge_tokens","repo":"JoakimHaurum/TokenReduction","repo_kind":"listed","path":"models/dpcknn.py","file_url":"https://github.com/JoakimHaurum/TokenReduction/blob/HEAD/models/dpcknn.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2f8afc8e34c74e5f"}},{"code_sha256_prefix":"5dac11fdc41c896b","entry":"checkpoint_filter_fn","repo":"JoakimHaurum/TokenReduction","repo_kind":"listed","path":"models/deit_viz.py","file_url":"https://github.com/JoakimHaurum/TokenReduction/blob/HEAD/models/deit_viz.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5dac11fdc41c896b"}},{"code_sha256_prefix":"1dbef2d4da4ee10f","entry":"resize_pos_embed","repo":"JoakimHaurum/TokenReduction","repo_kind":"listed","path":"models/deit_viz.py","file_url":"https://github.com/JoakimHaurum/TokenReduction/blob/HEAD/models/deit_viz.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1dbef2d4da4ee10f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}