{"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/pure-transformers-are-powerful-graph-learners","title":"Pure Transformers are Powerful Graph Learners","arxiv_id":"2207.02505","date":"2022-07-06","proceeding":null,"authors":["Jinwoo Kim","Tien Dat Nguyen","Seonwoo Min","Sungjun Cho","Moontae Lee","Honglak Lee","Seunghoon Hong"],"abstract":"We show that standard Transformers without graph-specific modifications can lead to promising results in graph learning both in theory and practice. Given a graph, we simply treat all nodes and edges as independent tokens, augment them with token embeddings, and feed them to a Transformer. With an appropriate choice of token embeddings, we prove that this approach is theoretically at least as expressive as an invariant graph network (2-IGN) composed of equivariant linear layers, which is already more expressive than all message-passing Graph Neural Networks (GNN). When trained on a large-scale graph dataset (PCQM4Mv2), our method coined Tokenized Graph Transformer (TokenGT) achieves significantly better results compared to GNN baselines and competitive results compared to Transformer variants with sophisticated graph-specific inductive bias. Our implementation is available at https://github.com/jw9730/tokengt.","url_abs":"https://arxiv.org/abs/2207.02505v2","url_pdf":"https://arxiv.org/pdf/2207.02505v2.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":"pure-transformers-are-powerful-graph-learners","repo_url":"https://github.com/jw9730/tokengt","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"pure-transformers-are-powerful-graph-learners","repo_url":"https://github.com/luis-mueller/wl-transformers","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"graph-classification","task_name":"Graph Classification"},{"task_slug":"graph-learning","task_name":"Graph Learning"},{"task_slug":"graph-regression","task_name":"Graph Regression"},{"task_slug":"inductive-bias","task_name":"Inductive Bias"},{"task_slug":"molecular-property-prediction","task_name":"Molecular Property Prediction"}],"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":"graph-transformer","method_name":"Graph Transformer"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"lapeigen","method_name":"LapEigen"},{"method_slug":"laplacian-pe","method_name":"Laplacian PE"},{"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":[{"leaderboard":"/sota/graph-classification-on-dd","task":"Graph Classification","dataset":"D&D","model":"TokenGT","rank_in_archive_order":48,"of":53,"metrics":{"Accuracy":"73.950±3.361"},"uses_additional_data":false},{"leaderboard":"/sota/graph-classification-on-imdb-b","task":"Graph Classification","dataset":"IMDb-B","model":"TokenGT","rank_in_archive_order":6,"of":51,"metrics":{"Accuracy":"80.250±3.304"},"uses_additional_data":false},{"leaderboard":"/sota/graph-classification-on-nci1","task":"Graph Classification","dataset":"NCI1","model":"TokenGT","rank_in_archive_order":46,"of":69,"metrics":{"Accuracy":"76.740±2.054"},"uses_additional_data":false},{"leaderboard":"/sota/graph-classification-on-nci109","task":"Graph Classification","dataset":"NCI109","model":"TokenGT","rank_in_archive_order":33,"of":38,"metrics":{"Accuracy":"72.077±1.883"},"uses_additional_data":false},{"leaderboard":"/sota/graph-regression-on-esr2","task":"Graph Regression","dataset":"ESR2","model":"TokenGT","rank_in_archive_order":8,"of":9,"metrics":{"R2":"0.641±0.000","RMSE":"0.529±0.641"},"uses_additional_data":false},{"leaderboard":"/sota/graph-regression-on-f2","task":"Graph Regression","dataset":"F2","model":"TokenGT","rank_in_archive_order":8,"of":9,"metrics":{"R2":"0.872±0.000","RMSE":"0.363±0.872"},"uses_additional_data":false},{"leaderboard":"/sota/graph-regression-on-kit","task":"Graph Regression","dataset":"KIT","model":"TokenGT","rank_in_archive_order":8,"of":9,"metrics":{"R2":"0.800±0.000","RMSE":"0.486±0.800"},"uses_additional_data":false},{"leaderboard":"/sota/graph-regression-on-lipophilicity","task":"Graph Regression","dataset":"Lipophilicity","model":"TokenGT","rank_in_archive_order":16,"of":23,"metrics":{"R2":"0.545±0.024","RMSE":"0.852±0.023"},"uses_additional_data":false},{"leaderboard":"/sota/graph-regression-on-parp1","task":"Graph Regression","dataset":"PARP1","model":"TokenGT","rank_in_archive_order":8,"of":9,"metrics":{"R2":"0.907±0.000","RMSE":"0.383±0.907"},"uses_additional_data":false},{"leaderboard":"/sota/graph-regression-on-pcqm4mv2-lsc","task":"Graph Regression","dataset":"PCQM4Mv2-LSC","model":"TokenGT","rank_in_archive_order":17,"of":20,"metrics":{"Test MAE":"0.0919","Validation MAE":"0.0910"},"uses_additional_data":false},{"leaderboard":"/sota/graph-regression-on-pgr","task":"Graph Regression","dataset":"PGR","model":"TokenGT","rank_in_archive_order":5,"of":9,"metrics":{"R2":"0.684±0.000","RMSE":"0.543±0.684"},"uses_additional_data":false},{"leaderboard":"/sota/graph-regression-on-peptides-struct","task":"Graph Regression","dataset":"Peptides-struct","model":"TokenGT","rank_in_archive_order":21,"of":39,"metrics":{"MAE":"0.2489±0.0013"},"uses_additional_data":false},{"leaderboard":"/sota/graph-regression-on-zinc-full","task":"Graph Regression","dataset":"ZINC-full","model":"TokenGT","rank_in_archive_order":13,"of":19,"metrics":{"Test MAE":"0.047±0.010"},"uses_additional_data":false},{"leaderboard":"/sota/molecular-property-prediction-on-esol","task":"Molecular Property Prediction","dataset":"ESOL","model":"TokenGT","rank_in_archive_order":12,"of":20,"metrics":{"R2":"0.892±0.036","RMSE":"0.667±0.103"},"uses_additional_data":false},{"leaderboard":"/sota/molecular-property-prediction-on-freesolv","task":"Molecular Property Prediction","dataset":"FreeSolv","model":"TokenGT","rank_in_archive_order":8,"of":22,"metrics":{"R2":"0.930±0.018","RMSE":"1.038±0.125"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2207.02505","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2207.02505"}},"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/luis-mueller/wl-transformers","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/jw9730/tokengt","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_violates":2,"ran":5},"by_repo_kind":{"official":{"samples":7,"ran":7,"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":7,"samples":[{"code_sha256_prefix":"60fff7c3c400d7ff","entry":"default","repo":"jw9730/tokengt","repo_kind":"official","path":"large-scale-regression/tokengt/modules/performer_pytorch.py","file_url":"https://github.com/jw9730/tokengt/blob/HEAD/large-scale-regression/tokengt/modules/performer_pytorch.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"60fff7c3c400d7ff"}},{"code_sha256_prefix":"49eae9f4f9e2a885","entry":"drop_path","repo":"jw9730/tokengt","repo_kind":"official","path":"large-scale-regression/tokengt/modules/droppath.py","file_url":"https://github.com/jw9730/tokengt/blob/HEAD/large-scale-regression/tokengt/modules/droppath.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":false,"mcp_get_code":{"code_sha256":"49eae9f4f9e2a885"}},{"code_sha256_prefix":"19925529d217754e","entry":"empty","repo":"jw9730/tokengt","repo_kind":"official","path":"large-scale-regression/tokengt/modules/performer_pytorch.py","file_url":"https://github.com/jw9730/tokengt/blob/HEAD/large-scale-regression/tokengt/modules/performer_pytorch.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"19925529d217754e"}},{"code_sha256_prefix":"aa5486a3650902d8","entry":"exists","repo":"jw9730/tokengt","repo_kind":"official","path":"large-scale-regression/tokengt/modules/performer_pytorch.py","file_url":"https://github.com/jw9730/tokengt/blob/HEAD/large-scale-regression/tokengt/modules/performer_pytorch.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"aa5486a3650902d8"}},{"code_sha256_prefix":"f13c4bce34f13104","entry":"gaussian_orthogonal_random_matrix","repo":"jw9730/tokengt","repo_kind":"official","path":"large-scale-regression/tokengt/modules/orf.py","file_url":"https://github.com/jw9730/tokengt/blob/HEAD/large-scale-regression/tokengt/modules/orf.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":false,"mcp_get_code":{"code_sha256":"f13c4bce34f13104"}},{"code_sha256_prefix":"a02dd771934e8662","entry":"orthogonal_matrix_chunk","repo":"jw9730/tokengt","repo_kind":"official","path":"large-scale-regression/tokengt/modules/orf.py","file_url":"https://github.com/jw9730/tokengt/blob/HEAD/large-scale-regression/tokengt/modules/orf.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":false,"mcp_get_code":{"code_sha256":"a02dd771934e8662"}},{"code_sha256_prefix":"23f8c3620122768a","entry":"orthogonal_matrix_chunk_batched","repo":"jw9730/tokengt","repo_kind":"official","path":"large-scale-regression/tokengt/modules/orf.py","file_url":"https://github.com/jw9730/tokengt/blob/HEAD/large-scale-regression/tokengt/modules/orf.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":false,"mcp_get_code":{"code_sha256":"23f8c3620122768a"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}