{"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/simplifying-and-empowering-transformers-for-1","title":"SGFormer: Simplifying and Empowering Transformers for Large-Graph Representations","arxiv_id":"2306.10759","date":"2023-06-19","proceeding":"NeurIPS 2023 11","authors":["Qitian Wu","Wentao Zhao","Chenxiao Yang","Hengrui Zhang","Fan Nie","Haitian Jiang","Yatao Bian","Junchi Yan"],"abstract":"Learning representations on large-sized graphs is a long-standing challenge due to the inter-dependence nature involved in massive data points. Transformers, as an emerging class of foundation encoders for graph-structured data, have shown promising performance on small graphs due to its global attention capable of capturing all-pair influence beyond neighboring nodes. Even so, existing approaches tend to inherit the spirit of Transformers in language and vision tasks, and embrace complicated models by stacking deep multi-head attentions. In this paper, we critically demonstrate that even using a one-layer attention can bring up surprisingly competitive performance across node property prediction benchmarks where node numbers range from thousand-level to billion-level. This encourages us to rethink the design philosophy for Transformers on large graphs, where the global attention is a computation overhead hindering the scalability. We frame the proposed scheme as Simplified Graph Transformers (SGFormer), which is empowered by a simple attention model that can efficiently propagate information among arbitrary nodes in one layer. SGFormer requires none of positional encodings, feature/graph pre-processing or augmented loss. Empirically, SGFormer successfully scales to the web-scale graph ogbn-papers100M and yields up to 141x inference acceleration over SOTA Transformers on medium-sized graphs. Beyond current results, we believe the proposed methodology alone enlightens a new technical path of independent interest for building Transformers on large graphs.","url_abs":"https://arxiv.org/abs/2306.10759v5","url_pdf":"https://arxiv.org/pdf/2306.10759v5.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":"simplifying-and-empowering-transformers-for-1","repo_url":"https://github.com/qitianwu/sgformer","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"node-property-prediction","task_name":"Node Property Prediction"},{"task_slug":"philosophy","task_name":"Philosophy"},{"task_slug":"property-prediction","task_name":"Property Prediction"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2306.10759","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2306.10759"}},"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/qitianwu/SGFormer","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/qitianwu/sgformer","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":5,"unverified":10},"by_repo_kind":{"official":{"samples":15,"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":0,"samples":[{"code_sha256_prefix":"dd90ba29f6b0b76a","entry":"TransConv","repo":"qitianwu/sgformer","repo_kind":"official","path":"medium/ours.py","file_url":"https://github.com/qitianwu/sgformer/blob/HEAD/medium/ours.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"dd90ba29f6b0b76a"}},{"code_sha256_prefix":"2e7f4f12c1100a83","entry":"TransConvLayer","repo":"qitianwu/sgformer","repo_kind":"official","path":"medium/ours.py","file_url":"https://github.com/qitianwu/sgformer/blob/HEAD/medium/ours.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2e7f4f12c1100a83"}},{"code_sha256_prefix":"de5bdf76ff672322","entry":"class_rand_splits","repo":"qitianwu/SGFormer","repo_kind":"official","path":"100M/data_utils.py","file_url":"https://github.com/qitianwu/SGFormer/blob/HEAD/100M/data_utils.py","link_basis":"plan_row","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":"de5bdf76ff672322"}},{"code_sha256_prefix":"10e5b33e372f7d10","entry":"index2mask","repo":"qitianwu/SGFormer","repo_kind":"official","path":"100M/nb-sample.py","file_url":"https://github.com/qitianwu/SGFormer/blob/HEAD/100M/nb-sample.py","link_basis":"plan_row","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":"10e5b33e372f7d10"}},{"code_sha256_prefix":"ef6b5e211f3c0418","entry":"load_fixed_splits","repo":"qitianwu/SGFormer","repo_kind":"official","path":"large/data_utils.py","file_url":"https://github.com/qitianwu/SGFormer/blob/HEAD/large/data_utils.py","link_basis":"plan_row","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":"ef6b5e211f3c0418"}},{"code_sha256_prefix":"a01a5d91eae8f860","entry":"SGFormer","repo":"qitianwu/sgformer","repo_kind":"official","path":"medium/ours.py","file_url":"https://github.com/qitianwu/sgformer/blob/HEAD/medium/ours.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":"a01a5d91eae8f860"}},{"code_sha256_prefix":"2f1e99a101ce9610","entry":"evaluate","repo":"qitianwu/SGFormer","repo_kind":"official","path":"100M/nb-sample.py","file_url":"https://github.com/qitianwu/SGFormer/blob/HEAD/100M/nb-sample.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":"2f1e99a101ce9610"}},{"code_sha256_prefix":"aa034199e64c32ba","entry":"full_attention_conv","repo":"qitianwu/SGFormer","repo_kind":"official","path":"100M/ours.py","file_url":"https://github.com/qitianwu/SGFormer/blob/HEAD/100M/ours.py","link_basis":"plan_row","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":"aa034199e64c32ba"}},{"code_sha256_prefix":"ceb81f08da4bb951","entry":"full_attention_conv","repo":"qitianwu/sgformer","repo_kind":"official","path":"medium/ours.py","file_url":"https://github.com/qitianwu/sgformer/blob/HEAD/medium/ours.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":"ceb81f08da4bb951"}},{"code_sha256_prefix":"67fc014db49b3eba","entry":"load_fb100","repo":"qitianwu/SGFormer","repo_kind":"official","path":"100M/load_data.py","file_url":"https://github.com/qitianwu/SGFormer/blob/HEAD/100M/load_data.py","link_basis":"plan_row","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":"67fc014db49b3eba"}},{"code_sha256_prefix":"985aeae95edfd025","entry":"load_twitch","repo":"qitianwu/SGFormer","repo_kind":"official","path":"100M/load_data.py","file_url":"https://github.com/qitianwu/SGFormer/blob/HEAD/100M/load_data.py","link_basis":"plan_row","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":"985aeae95edfd025"}},{"code_sha256_prefix":"e4ab5e839e7c665a","entry":"parse_method","repo":"qitianwu/SGFormer","repo_kind":"official","path":"100M/parse.py","file_url":"https://github.com/qitianwu/SGFormer/blob/HEAD/100M/parse.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":"e4ab5e839e7c665a"}},{"code_sha256_prefix":"13234652741e2264","entry":"rand_train_test_idx","repo":"qitianwu/SGFormer","repo_kind":"official","path":"large/data_utils.py","file_url":"https://github.com/qitianwu/SGFormer/blob/HEAD/large/data_utils.py","link_basis":"plan_row","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":"13234652741e2264"}},{"code_sha256_prefix":"eea43aafe5795815","entry":"rand_train_test_idx","repo":"qitianwu/SGFormer","repo_kind":"official","path":"100M/data_utils.py","file_url":"https://github.com/qitianwu/SGFormer/blob/HEAD/100M/data_utils.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":"eea43aafe5795815"}},{"code_sha256_prefix":"31388e2d020da353","entry":"train","repo":"qitianwu/SGFormer","repo_kind":"official","path":"100M/nb-sample.py","file_url":"https://github.com/qitianwu/SGFormer/blob/HEAD/100M/nb-sample.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":"31388e2d020da353"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}