Papers › Structure-Aware Transformer for Graph Representation Learning

Structure-Aware Transformer for Graph Representation Learning

7 Feb 2022arXiv:2202.03036archive 2025-07-28

Dexiong Chen, Leslie O'Bray, Karsten Borgwardt

The Transformer architecture has gained growing attention in graph representation learning recently, as it naturally overcomes several limitations of graph neural networks (GNNs) by avoiding their strict structural inductive biases and instead only encoding the graph structure via positional encoding. Here, we show that the node representations generated by the Transformer with positional encoding do not necessarily capture structural similarity between them. To address this issue, we propose the Structure-Aware Transformer, a class of simple and flexible graph Transformers built upon a new self-attention mechanism. This new self-attention incorporates structural information into the original self-attention by extracting a subgraph representation rooted at each node before computing the attention. We propose several methods for automatically generating the subgraph representation and show theoretically that the resulting representations are at least as expressive as the subgraph representations. Empirically, our method achieves state-of-the-art performance on five graph prediction benchmarks. Our structure-aware framework can leverage any existing GNN to extract the subgraph representation, and we show that it systematically improves performance relative to the base GNN model, successfully combining the advantages of GNNs and Transformers. Our code is available at https://github.com/BorgwardtLab/SAT.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2202.03036")

Code

Syntology Ran 4 of 9 code samples harvested from 2 repositories linked to this paper; 5 have no recorded run. Of those that ran: 3 ran · honoured contract; 1 ran with no contract checked.

By repository: official repository: 2 samples from 1 repository, 2 ran; community (archive-listed): 7 samples from 1 repository, 2 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

borgwardtlab/sat officialmentioned in papermentioned on GitHubpytorchBSD-3-Clause report
BorgwardtLab/SAT mentioned on GitHubpytorchBSD-3-Clause report
borgwardtlab/pst mentioned on GitHubpytorchBSD-3-Clause report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

9 samples harvested; 4 ran; 3 honoured the contract we drafted; 5 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

3ran · honoured contract
1ran
5unverified

Licence: 0 of the 9 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: 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. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

eval_epoch borgwardtlab/sat/experiments/train_zinc.py official repository ran · honoured contract BSD-3-Clause (permissive) · 324691a9739115fa · report
train_epoch borgwardtlab/sat/experiments/train_zinc.py official repository ran · honoured contract BSD-3-Clause (permissive) · ab698930f5477224 · report
apply_rotary_pos_emb borgwardtlab/pst/pst/rotary_embedding.py community (archive-listed) ran fingerprinted BSD-3-Clause (permissive) · 2a127d3ae372d7bd · report
rotate_half borgwardtlab/pst/pst/rotary_embedding.py community (archive-listed) ran · honoured contract fingerprinted BSD-3-Clause (permissive) · 437c7011506995a3 · report
accuracy borgwardtlab/pst/pst/downstream/mlp.py community (archive-listed) unverified BSD-3-Clause (permissive) · e6346ac266435823 · report
get_model borgwardtlab/pst/pst/esm2.py community (archive-listed) unverified BSD-3-Clause (permissive) · a86103fee746fce2 · report
to_dense_batch borgwardtlab/pst/pst/utils.py community (archive-listed) unverified BSD-3-Clause (permissive) · 34890f3c2b8599f9 · report
train_and_eval_linear borgwardtlab/pst/pst/downstream/mlp.py community (archive-listed) unverified BSD-3-Clause (permissive) · 59c49da00f1bc1d8 · report
unpad_dense_batch borgwardtlab/pst/pst/utils.py community (archive-listed) unverified BSD-3-Clause (permissive) · 94a8734c22d5fd0f · report

Tasks

Emotion Recognition in ConversationGraph Representation LearningRepresentation Learning

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Emotion Recognition in Conversation IEMOCAP SAMGN Weighted-F1 71.11 #10 of 59 Archive leaderboard report
Graph Property Prediction ogbg-code2 SAT Ext. data No #4 of 21 Archive leaderboard report
Graph Property Prediction ogbg-code2 SAT Number of params 15734000 #4 of 21 Archive leaderboard report
Graph Property Prediction ogbg-code2 SAT Test F1 score 0.1937 ± 0.0028 #4 of 21 Archive leaderboard report
Graph Property Prediction ogbg-code2 SAT Validation F1 score 0.1773 ± 0.0023 #4 of 21 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Absolute Position EncodingsAdamAttentionBASEBPEDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections