Transformers are efficient hierarchical chemical graph learners
Abstract
Transformers, adapted from natural language processing, are emerging as a leading approach for graph representation learning. Contemporary graph transformers often treat nodes or edges as separate tokens. This approach leads to computational challenges for even moderately-sized graphs due to the quadratic scaling of self-attention complexity with token count. In this paper, we introduce SubFormer, a graph transformer that operates on subgraphs that aggregate information by a message-passing mechanism. This approach reduces the number of tokens and enhances learning long-range interactions. We demonstrate SubFormer on benchmarks for predicting molecular properties from chemical structures and show that it is competitive with state-of-the-art graph transformers at a fraction of the computational cost, with training times on the order of minutes on a consumer-grade graphics card. We interpret the attention weights in terms of chemical structures. We show that SubFormer exhibits limited over-smoothing and avoids over-squashing, which is prevalent in traditional graph neural networks.
Benchmark Results
Tested on 1 dataset 1 baseline value reported too low
Tables show presented results in global context (best 3 papers + GCN + MLP).
LRGB
| # | Model | MAE ↓ | Paper |
|---|---|---|---|
| 1 | GCN | 0.2421
±0.0016 best reported | best at pub: Where Did the Gap Go? Reassessing the Long-Range Graph Benchmark (TMLR 2023) best today: From Message-Passing to Linearized Graph Sequence Models (2026) |
| 2 | IPR-MPNN | 0.2422
±0.0007 | |
| 3 | TANGO-GPS | 0.2422
±0.0014 | |
| 5 | GIN | 0.2429
±0.0019 best reported | best today: From Message-Passing to Linearized Graph Sequence Models (2026) |
| 73 | MP | 0.2487
±0.0009 | This paper |
| 112 | GT | 0.2529
±0.0016 | This paper |
| 124 | SAN | 0.2545
±0.0012 | This paper |
| 201 | MLP | 0.4351
±0.0008 |
