{"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/on-the-role-of-discrete-tokenization-in","title":"On the Role of Discrete Tokenization in Visual Representation Learning","arxiv_id":"2407.09087","date":"2024-07-12","proceeding":null,"authors":["Tianqi Du","Yifei Wang","Yisen Wang"],"abstract":"In the realm of self-supervised learning (SSL), masked image modeling (MIM) has gained popularity alongside contrastive learning methods. MIM involves reconstructing masked regions of input images using their unmasked portions. A notable subset of MIM methodologies employs discrete tokens as the reconstruction target, but the theoretical underpinnings of this choice remain underexplored. In this paper, we explore the role of these discrete tokens, aiming to unravel their benefits and limitations. Building upon the connection between MIM and contrastive learning, we provide a comprehensive theoretical understanding on how discrete tokenization affects the model's generalization capabilities. Furthermore, we propose a novel metric named TCAS, which is specifically designed to assess the effectiveness of discrete tokens within the MIM framework. Inspired by this metric, we contribute an innovative tokenizer design and propose a corresponding MIM method named ClusterMIM. It demonstrates superior performance on a variety of benchmark datasets and ViT backbones. Code is available at https://github.com/PKU-ML/ClusterMIM.","url_abs":"https://arxiv.org/abs/2407.09087v1","url_pdf":"https://arxiv.org/pdf/2407.09087v1.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":"on-the-role-of-discrete-tokenization-in","repo_url":"https://github.com/pku-ml/clustermim","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"contrastive-learning","task_name":"Contrastive Learning"},{"task_slug":"representation-learning","task_name":"Representation Learning"},{"task_slug":"self-supervised-learning","task_name":"Self-Supervised Learning"}],"methods":[{"method_slug":"contrastive-learning","method_name":"Contrastive Learning"},{"method_slug":"mim","method_name":"MIM"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2407.09087","atlas_url":"https://app.syntology.ai/?focus=2407.09087","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2407.09087"}},"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":"deterministic:regex_extraction","url":"https://github.com/PKU-ML/ClusterMIM","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/pku-ml/clustermim","reach":{"status":"ok"}}],"summary":{"ran":5,"unverified":1},"by_repo_kind":{"official":{"samples":6,"ran":5,"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":6,"samples":[{"code_sha256_prefix":"60f4e5c9241d5bc8","entry":"LabelSmoothingCrossEntropy","repo":"pku-ml/clustermim","repo_kind":"official","path":"models_mae.py","file_url":"https://github.com/pku-ml/clustermim/blob/HEAD/models_mae.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"60f4e5c9241d5bc8"}},{"code_sha256_prefix":"27f8c4c706fd43ec","entry":"build_dataset","repo":"PKU-ML/ClusterMIM","repo_kind":"official","path":"util/datasets.py","file_url":"https://github.com/PKU-ML/ClusterMIM/blob/HEAD/util/datasets.py","link_basis":"plan_row","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"27f8c4c706fd43ec"}},{"code_sha256_prefix":"800cebf161a8aa26","entry":"build_transform","repo":"PKU-ML/ClusterMIM","repo_kind":"official","path":"util/datasets.py","file_url":"https://github.com/PKU-ML/ClusterMIM/blob/HEAD/util/datasets.py","link_basis":"plan_row","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"800cebf161a8aa26"}},{"code_sha256_prefix":"89edf5372214b57d","entry":"get_layer_id_for_vit","repo":"PKU-ML/ClusterMIM","repo_kind":"official","path":"util/lr_decay.py","file_url":"https://github.com/PKU-ML/ClusterMIM/blob/HEAD/util/lr_decay.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"89edf5372214b57d"}},{"code_sha256_prefix":"8baf25cef41cba16","entry":"param_groups_lrd","repo":"PKU-ML/ClusterMIM","repo_kind":"official","path":"util/lr_decay.py","file_url":"https://github.com/PKU-ML/ClusterMIM/blob/HEAD/util/lr_decay.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8baf25cef41cba16"}},{"code_sha256_prefix":"2b908bbdf251e36b","entry":"MaskedAutoencoderViT","repo":"pku-ml/clustermim","repo_kind":"official","path":"models_mae.py","file_url":"https://github.com/pku-ml/clustermim/blob/HEAD/models_mae.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2b908bbdf251e36b"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}