{"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/exphormer-sparse-transformers-for-graphs","title":"Exphormer: Sparse Transformers for Graphs","arxiv_id":"2303.06147","date":"2023-03-10","proceeding":null,"authors":["Hamed Shirzad","Ameya Velingker","Balaji Venkatachalam","Danica J. Sutherland","Ali Kemal Sinop"],"abstract":"Graph transformers have emerged as a promising architecture for a variety of graph learning and representation tasks. Despite their successes, though, it remains challenging to scale graph transformers to large graphs while maintaining accuracy competitive with message-passing networks. In this paper, we introduce Exphormer, a framework for building powerful and scalable graph transformers. Exphormer consists of a sparse attention mechanism based on two mechanisms: virtual global nodes and expander graphs, whose mathematical characteristics, such as spectral expansion, pseduorandomness, and sparsity, yield graph transformers with complexity only linear in the size of the graph, while allowing us to prove desirable theoretical properties of the resulting transformer models. We show that incorporating Exphormer into the recently-proposed GraphGPS framework produces models with competitive empirical results on a wide variety of graph datasets, including state-of-the-art results on three datasets. We also show that Exphormer can scale to datasets on larger graphs than shown in previous graph transformer architectures. Code can be found at \\url{https://github.com/hamed1375/Exphormer}.","url_abs":"https://arxiv.org/abs/2303.06147v2","url_pdf":"https://arxiv.org/pdf/2303.06147v2.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":"exphormer-sparse-transformers-for-graphs","repo_url":"https://github.com/hamed1375/exphormer","is_official":1,"mentioned_in_paper":1,"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":"link-prediction","task_name":"Link Prediction"},{"task_slug":"node-classification","task_name":"Node Classification"}],"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-cifar10-100k","task":"Graph Classification","dataset":"CIFAR10 100k","model":"Exphormer","rank_in_archive_order":7,"of":20,"metrics":{"Accuracy (%)":"74.754±0.194"},"uses_additional_data":false},{"leaderboard":"/sota/graph-classification-on-mnist","task":"Graph Classification","dataset":"MNIST","model":"Exphormer","rank_in_archive_order":6,"of":13,"metrics":{"Accuracy":"98.414±0.038"},"uses_additional_data":false},{"leaderboard":"/sota/graph-classification-on-malnet-tiny","task":"Graph Classification","dataset":"MalNet-Tiny","model":"Exphormer","rank_in_archive_order":3,"of":4,"metrics":{"Accuracy":"94.02±0.209"},"uses_additional_data":false},{"leaderboard":"/sota/graph-classification-on-peptides-func","task":"Graph Classification","dataset":"Peptides-func","model":"Exphormer","rank_in_archive_order":32,"of":44,"metrics":{"AP":"0.6527±0.0043"},"uses_additional_data":false},{"leaderboard":"/sota/graph-regression-on-peptides-struct","task":"Graph Regression","dataset":"Peptides-struct","model":"Exphormer","rank_in_archive_order":18,"of":39,"metrics":{"MAE":"0.2481±0.0007"},"uses_additional_data":false},{"leaderboard":"/sota/link-prediction-on-pcqm-contact","task":"Link Prediction","dataset":"PCQM-Contact","model":"Exphormer","rank_in_archive_order":11,"of":18,"metrics":{"MRR":"0.3637±0.0020"},"uses_additional_data":false},{"leaderboard":"/sota/node-classification-on-amz-photo","task":"Node Classification","dataset":"AMZ Photo","model":"Exphormer","rank_in_archive_order":4,"of":14,"metrics":{"Accuracy":"95.35±0.22%"},"uses_additional_data":false},{"leaderboard":"/sota/node-classification-on-cluster","task":"Node Classification","dataset":"CLUSTER","model":"Exphormer","rank_in_archive_order":5,"of":12,"metrics":{"Accuracy":"78.22±0.045"},"uses_additional_data":false},{"leaderboard":"/sota/node-classification-on-coco-sp","task":"Node Classification","dataset":"COCO-SP","model":"Exphormer","rank_in_archive_order":6,"of":19,"metrics":{"macro F1":"0.343±0.0008"},"uses_additional_data":false},{"leaderboard":"/sota/node-classification-on-coauthor-cs","task":"Node Classification","dataset":"Coauthor CS","model":"Exphormer","rank_in_archive_order":14,"of":24,"metrics":{"Accuracy":"94.93±0.46%"},"uses_additional_data":false},{"leaderboard":"/sota/node-classification-on-coauthor-physics","task":"Node Classification","dataset":"Coauthor Physics","model":"Exphormer","rank_in_archive_order":9,"of":14,"metrics":{"Accuracy":"96.89±0.09%"},"uses_additional_data":false},{"leaderboard":"/sota/node-classification-on-pattern","task":"Node Classification","dataset":"PATTERN","model":"Exphormer","rank_in_archive_order":6,"of":11,"metrics":{"Accuracy":"86.74"},"uses_additional_data":false},{"leaderboard":"/sota/node-classification-on-pascalvoc-sp-1","task":"Node Classification","dataset":"PascalVOC-SP","model":"Exphormer","rank_in_archive_order":6,"of":21,"metrics":{"macro F1":"0.396±0.0027"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2303.06147","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2303.06147"}},"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/hamed1375/exphormer","reach":null}],"summary":{"ran_draft_wrong":1},"by_repo_kind":{"official":{"samples":1,"ran":1,"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":"b888018e8acd3f1d","entry":"get_activation","repo":"hamed1375/exphormer","repo_kind":"official","path":"graphgps/layer/Exphormer.py","file_url":"https://github.com/hamed1375/exphormer/blob/HEAD/graphgps/layer/Exphormer.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":"b888018e8acd3f1d"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}