{"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/learning-graph-quantized-tokenizers-for","title":"Learning Graph Quantized Tokenizers","arxiv_id":"2410.13798","date":"2024-10-17","proceeding":null,"authors":["Limei Wang","Kaveh Hassani","Si Zhang","Dongqi Fu","Baichuan Yuan","Weilin Cong","Zhigang Hua","Hao Wu","Ning Yao","Bo Long"],"abstract":"Transformers serve as the backbone architectures of Foundational Models, where domain-specific tokenizers allow them to adapt to various domains. Graph Transformers (GTs) have recently emerged as leading models in geometric deep learning, outperforming Graph Neural Networks (GNNs) in various graph learning tasks. However, the development of tokenizers for graphs has lagged behind other modalities. To address this, we introduce GQT (\\textbf{G}raph \\textbf{Q}uantized \\textbf{T}okenizer), which decouples tokenizer training from Transformer training by leveraging multi-task graph self-supervised learning, yielding robust and generalizable graph tokens. Furthermore, the GQT utilizes Residual Vector Quantization (RVQ) to learn hierarchical discrete tokens, resulting in significantly reduced memory requirements and improved generalization capabilities. By combining the GQT with token modulation, a Transformer encoder achieves state-of-the-art performance on 20 out of 22 benchmarks, including large-scale homophilic and heterophilic datasets.","url_abs":"https://arxiv.org/abs/2410.13798v2","url_pdf":"https://arxiv.org/pdf/2410.13798v2.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":"learning-graph-quantized-tokenizers-for","repo_url":"https://github.com/limei0307/GQT","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"graph-learning","task_name":"Graph Learning"},{"task_slug":"quantization","task_name":"Quantization"},{"task_slug":"self-supervised-learning","task_name":"Self-Supervised Learning"}],"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"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2410.13798","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.13798"}},"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/limei0307/GQT","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":3,"ran":5,"ran_fixture":1,"unverified":4},"by_repo_kind":{"official":{"samples":13,"ran":9,"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":"adf3b9c6c22af5ce","entry":"accuracy","repo":"limei0307/GQT","repo_kind":"official","path":"gmae2_utils.py","file_url":"https://github.com/limei0307/GQT/blob/HEAD/gmae2_utils.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"adf3b9c6c22af5ce"}},{"code_sha256_prefix":"87767eda0a0d0829","entry":"auc_pair_loss","repo":"limei0307/GQT","repo_kind":"official","path":"gmae2_models/loss_func.py","file_url":"https://github.com/limei0307/GQT/blob/HEAD/gmae2_models/loss_func.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"87767eda0a0d0829"}},{"code_sha256_prefix":"2073c491a6c31e7b","entry":"fit_logistic_regression","repo":"limei0307/gqt","repo_kind":"official","path":"tokenizer/tokenizer.py","file_url":"https://github.com/limei0307/gqt/blob/HEAD/tokenizer/tokenizer.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2073c491a6c31e7b"}},{"code_sha256_prefix":"cf1c82d327548c19","entry":"get_tokenizer_loader","repo":"limei0307/GQT","repo_kind":"official","path":"loader.py","file_url":"https://github.com/limei0307/GQT/blob/HEAD/loader.py","link_basis":"first_harvest_node","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":"cf1c82d327548c19"}},{"code_sha256_prefix":"6f6854c82f6b6dce","entry":"get_tokenizer_loader_sign","repo":"limei0307/GQT","repo_kind":"official","path":"loader.py","file_url":"https://github.com/limei0307/GQT/blob/HEAD/loader.py","link_basis":"first_harvest_node","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":"6f6854c82f6b6dce"}},{"code_sha256_prefix":"942da4a4a8ad2c9d","entry":"index2mask","repo":"limei0307/GQT","repo_kind":"official","path":"data.py","file_url":"https://github.com/limei0307/GQT/blob/HEAD/data.py","link_basis":"first_harvest_node","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":"942da4a4a8ad2c9d"}},{"code_sha256_prefix":"12e79787da214324","entry":"load_tokens","repo":"limei0307/gqt","repo_kind":"official","path":"tokenizer/tokenizer.py","file_url":"https://github.com/limei0307/gqt/blob/HEAD/tokenizer/tokenizer.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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"12e79787da214324"}},{"code_sha256_prefix":"4041b7a277523a7e","entry":"rocauc","repo":"limei0307/GQT","repo_kind":"official","path":"gmae2_utils.py","file_url":"https://github.com/limei0307/GQT/blob/HEAD/gmae2_utils.py","link_basis":"first_harvest_node","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":"4041b7a277523a7e"}},{"code_sha256_prefix":"915b71e73a54fc97","entry":"trunc_normal_","repo":"limei0307/GQT","repo_kind":"official","path":"gmae2_models/loss_func.py","file_url":"https://github.com/limei0307/GQT/blob/HEAD/gmae2_models/loss_func.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"915b71e73a54fc97"}},{"code_sha256_prefix":"c9c9174dc014b586","entry":"get_current_lr","repo":"limei0307/GQT","repo_kind":"official","path":"gmae2_utils.py","file_url":"https://github.com/limei0307/GQT/blob/HEAD/gmae2_utils.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":"c9c9174dc014b586"}},{"code_sha256_prefix":"cbe8b34a9538b1ae","entry":"get_llm_embedding","repo":"limei0307/GQT","repo_kind":"official","path":"data.py","file_url":"https://github.com/limei0307/GQT/blob/HEAD/data.py","link_basis":"first_harvest_node","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":"cbe8b34a9538b1ae"}},{"code_sha256_prefix":"6f9bb5eb98ec4887","entry":"sce_loss","repo":"limei0307/GQT","repo_kind":"official","path":"gmae2_models/loss_func.py","file_url":"https://github.com/limei0307/GQT/blob/HEAD/gmae2_models/loss_func.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":"6f9bb5eb98ec4887"}},{"code_sha256_prefix":"35589fecfce05259","entry":"setup_module","repo":"limei0307/GQT","repo_kind":"official","path":"gmae2_models/edcoder.py","file_url":"https://github.com/limei0307/GQT/blob/HEAD/gmae2_models/edcoder.py","link_basis":"first_harvest_node","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":"35589fecfce05259"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}