{"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/vqgraph-graph-vector-quantization-for","title":"VQGraph: Rethinking Graph Representation Space for Bridging GNNs and MLPs","arxiv_id":"2308.02117","date":"2023-08-04","proceeding":null,"authors":["Ling Yang","Ye Tian","Minkai Xu","Zhongyi Liu","Shenda Hong","Wei Qu","Wentao Zhang","Bin Cui","Muhan Zhang","Jure Leskovec"],"abstract":"GNN-to-MLP distillation aims to utilize knowledge distillation (KD) to learn computationally-efficient multi-layer perceptron (student MLP) on graph data by mimicking the output representations of teacher GNN. Existing methods mainly make the MLP to mimic the GNN predictions over a few class labels. However, the class space may not be expressive enough for covering numerous diverse local graph structures, thus limiting the performance of knowledge transfer from GNN to MLP. To address this issue, we propose to learn a new powerful graph representation space by directly labeling nodes' diverse local structures for GNN-to-MLP distillation. Specifically, we propose a variant of VQ-VAE to learn a structure-aware tokenizer on graph data that can encode each node's local substructure as a discrete code. The discrete codes constitute a codebook as a new graph representation space that is able to identify different local graph structures of nodes with the corresponding code indices. Then, based on the learned codebook, we propose a new distillation target, namely soft code assignments, to directly transfer the structural knowledge of each node from GNN to MLP. The resulting framework VQGraph achieves new state-of-the-art performance on GNN-to-MLP distillation in both transductive and inductive settings across seven graph datasets. We show that VQGraph with better performance infers faster than GNNs by 828x, and also achieves accuracy improvement over GNNs and stand-alone MLPs by 3.90% and 28.05% on average, respectively. Code: https://github.com/YangLing0818/VQGraph.","url_abs":"https://arxiv.org/abs/2308.02117v3","url_pdf":"https://arxiv.org/pdf/2308.02117v3.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":"vqgraph-graph-vector-quantization-for","repo_url":"https://github.com/yangling0818/vqgraph","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"knowledge-distillation","task_name":"Knowledge Distillation"},{"task_slug":"quantization","task_name":"Quantization"},{"task_slug":"transfer-learning","task_name":"Transfer Learning"}],"methods":[{"method_slug":"knowledge-distillation","method_name":"Knowledge Distillation"},{"method_slug":"vq-vae","method_name":"VQ-VAE"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2308.02117","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2308.02117"}},"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":"deterministic:regex_extraction","url":"https://github.com/YangLing0818/VQGraph","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/yangling0818/vqgraph","reach":{"status":"ok"}}],"summary":{"ran":6,"ran_draft_wrong":5,"ran_fixture":7,"ran_violates":4,"ran_honours":1,"unverified":7},"by_repo_kind":{"official":{"samples":30,"ran":23,"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":30,"samples":[{"code_sha256_prefix":"0b4fc7f49d1b58ba","entry":"CosineSimCodebook","repo":"yangling0818/vqgraph","repo_kind":"official","path":"vq.py","file_url":"https://github.com/yangling0818/vqgraph/blob/HEAD/vq.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":"0b4fc7f49d1b58ba"}},{"code_sha256_prefix":"2e60cd798dd2182c","entry":"all_gather_variably_sized","repo":"yangling0818/vqgraph","repo_kind":"official","path":"vq.py","file_url":"https://github.com/yangling0818/vqgraph/blob/HEAD/vq.py","link_basis":"first_harvest_node","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":"2e60cd798dd2182c"}},{"code_sha256_prefix":"309924b930360692","entry":"batched_bincount","repo":"yangling0818/vqgraph","repo_kind":"official","path":"vq.py","file_url":"https://github.com/yangling0818/vqgraph/blob/HEAD/vq.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":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"309924b930360692"}},{"code_sha256_prefix":"5ebe8a85905da07b","entry":"batched_embedding","repo":"yangling0818/vqgraph","repo_kind":"official","path":"vq.py","file_url":"https://github.com/yangling0818/vqgraph/blob/HEAD/vq.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"5ebe8a85905da07b"}},{"code_sha256_prefix":"c1c89ffd41de10bb","entry":"batched_sample_vectors","repo":"yangling0818/vqgraph","repo_kind":"official","path":"vq.py","file_url":"https://github.com/yangling0818/vqgraph/blob/HEAD/vq.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c1c89ffd41de10bb"}},{"code_sha256_prefix":"60fff7c3c400d7ff","entry":"default","repo":"YangLing0818/VQGraph","repo_kind":"official","path":"vq.py","file_url":"https://github.com/YangLing0818/VQGraph/blob/HEAD/vq.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"60fff7c3c400d7ff"}},{"code_sha256_prefix":"aa5486a3650902d8","entry":"exists","repo":"YangLing0818/VQGraph","repo_kind":"official","path":"vq.py","file_url":"https://github.com/YangLing0818/VQGraph/blob/HEAD/vq.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"aa5486a3650902d8"}},{"code_sha256_prefix":"5b7ca3c80fc2a11a","entry":"get_training_config","repo":"YangLing0818/VQGraph","repo_kind":"official","path":"utils.py","file_url":"https://github.com/YangLing0818/VQGraph/blob/HEAD/utils.py","link_basis":"first_harvest_node","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":"5b7ca3c80fc2a11a"}},{"code_sha256_prefix":"d85a55ec5c2984ef","entry":"gumbel_noise","repo":"yangling0818/vqgraph","repo_kind":"official","path":"vq.py","file_url":"https://github.com/yangling0818/vqgraph/blob/HEAD/vq.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d85a55ec5c2984ef"}},{"code_sha256_prefix":"b91addd507f9e21a","entry":"gumbel_sample","repo":"yangling0818/vqgraph","repo_kind":"official","path":"vq.py","file_url":"https://github.com/yangling0818/vqgraph/blob/HEAD/vq.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b91addd507f9e21a"}},{"code_sha256_prefix":"ba7dbda11c083fd7","entry":"idx_split","repo":"YangLing0818/VQGraph","repo_kind":"official","path":"utils.py","file_url":"https://github.com/YangLing0818/VQGraph/blob/HEAD/utils.py","link_basis":"first_harvest_node","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":"ba7dbda11c083fd7"}},{"code_sha256_prefix":"77c12b26c7311bbd","entry":"is_binary_bag_of_words","repo":"YangLing0818/VQGraph","repo_kind":"official","path":"data_preprocess.py","file_url":"https://github.com/YangLing0818/VQGraph/blob/HEAD/data_preprocess.py","link_basis":"first_harvest_node","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":"77c12b26c7311bbd"}},{"code_sha256_prefix":"aa0a7d67c59e2d8b","entry":"kmeans","repo":"yangling0818/vqgraph","repo_kind":"official","path":"vq.py","file_url":"https://github.com/yangling0818/vqgraph/blob/HEAD/vq.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"aa0a7d67c59e2d8b"}},{"code_sha256_prefix":"eca6cdf05972a95e","entry":"l2norm","repo":"YangLing0818/VQGraph","repo_kind":"official","path":"vq.py","file_url":"https://github.com/YangLing0818/VQGraph/blob/HEAD/vq.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"eca6cdf05972a95e"}},{"code_sha256_prefix":"b5240484210b398a","entry":"laplace_smoothing","repo":"yangling0818/vqgraph","repo_kind":"official","path":"vq.py","file_url":"https://github.com/yangling0818/vqgraph/blob/HEAD/vq.py","link_basis":"first_harvest_node","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b5240484210b398a"}},{"code_sha256_prefix":"aa9c29936dee40a7","entry":"normalize","repo":"YangLing0818/VQGraph","repo_kind":"official","path":"data_preprocess.py","file_url":"https://github.com/YangLing0818/VQGraph/blob/HEAD/data_preprocess.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"aa9c29936dee40a7"}},{"code_sha256_prefix":"527a2ecf26715268","entry":"orthogonal_loss_fn","repo":"yangling0818/vqgraph","repo_kind":"official","path":"vq.py","file_url":"https://github.com/yangling0818/vqgraph/blob/HEAD/vq.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"527a2ecf26715268"}},{"code_sha256_prefix":"64ec7553b1fd0e74","entry":"pad_shape","repo":"yangling0818/vqgraph","repo_kind":"official","path":"vq.py","file_url":"https://github.com/yangling0818/vqgraph/blob/HEAD/vq.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"64ec7553b1fd0e74"}},{"code_sha256_prefix":"cf379aef60d216c3","entry":"sample_multinomial","repo":"yangling0818/vqgraph","repo_kind":"official","path":"vq.py","file_url":"https://github.com/yangling0818/vqgraph/blob/HEAD/vq.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"cf379aef60d216c3"}},{"code_sha256_prefix":"ada1d74afbd92171","entry":"sample_vectors","repo":"yangling0818/vqgraph","repo_kind":"official","path":"vq.py","file_url":"https://github.com/yangling0818/vqgraph/blob/HEAD/vq.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ada1d74afbd92171"}},{"code_sha256_prefix":"1ec5828275165f9e","entry":"sample_vectors_distributed","repo":"yangling0818/vqgraph","repo_kind":"official","path":"vq.py","file_url":"https://github.com/yangling0818/vqgraph/blob/HEAD/vq.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1ec5828275165f9e"}},{"code_sha256_prefix":"c1b14a7851940dca","entry":"to_binary_bag_of_words","repo":"YangLing0818/VQGraph","repo_kind":"official","path":"data_preprocess.py","file_url":"https://github.com/YangLing0818/VQGraph/blob/HEAD/data_preprocess.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c1b14a7851940dca"}},{"code_sha256_prefix":"7a052a0b26ca317a","entry":"train_mini_batch","repo":"YangLing0818/VQGraph","repo_kind":"official","path":"train_and_eval.py","file_url":"https://github.com/YangLing0818/VQGraph/blob/HEAD/train_and_eval.py","link_basis":"first_harvest_node","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":"7a052a0b26ca317a"}},{"code_sha256_prefix":"b6e2f12aa29482a4","entry":"EuclideanCodebook","repo":"yangling0818/vqgraph","repo_kind":"official","path":"vq.py","file_url":"https://github.com/yangling0818/vqgraph/blob/HEAD/vq.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":"b6e2f12aa29482a4"}},{"code_sha256_prefix":"81cfe04feebb1487","entry":"VectorQuantize","repo":"yangling0818/vqgraph","repo_kind":"official","path":"vq.py","file_url":"https://github.com/yangling0818/vqgraph/blob/HEAD/vq.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":"81cfe04feebb1487"}},{"code_sha256_prefix":"cee1bd208302c3f3","entry":"all_gather_sizes","repo":"yangling0818/vqgraph","repo_kind":"official","path":"vq.py","file_url":"https://github.com/yangling0818/vqgraph/blob/HEAD/vq.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":"cee1bd208302c3f3"}},{"code_sha256_prefix":"02dd009b7cb924bb","entry":"noop","repo":"yangling0818/vqgraph","repo_kind":"official","path":"vq.py","file_url":"https://github.com/yangling0818/vqgraph/blob/HEAD/vq.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":"02dd009b7cb924bb"}},{"code_sha256_prefix":"be348e82ea1b9cc3","entry":"train","repo":"YangLing0818/VQGraph","repo_kind":"official","path":"train_and_eval.py","file_url":"https://github.com/YangLing0818/VQGraph/blob/HEAD/train_and_eval.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":"be348e82ea1b9cc3"}},{"code_sha256_prefix":"c5f57af6d7f73831","entry":"train_sage","repo":"YangLing0818/VQGraph","repo_kind":"official","path":"train_and_eval.py","file_url":"https://github.com/YangLing0818/VQGraph/blob/HEAD/train_and_eval.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":"c5f57af6d7f73831"}},{"code_sha256_prefix":"f9a12a99a3e74bc8","entry":"uniform_init","repo":"yangling0818/vqgraph","repo_kind":"official","path":"vq.py","file_url":"https://github.com/yangling0818/vqgraph/blob/HEAD/vq.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":"f9a12a99a3e74bc8"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}