TMLR 2023

Self-Attention in Colors: Another Take on Encoding Graph Structure in Transformers

Romain Menegaux, Emmanuel Jehanno, Margot Selosse, J. Mairal

Main figure for Self-Attention in Colors: Another Take on Encoding Graph Structure in Transformers

Abstract

We introduce a novel self-attention mechanism, which we call CSA (Chromatic Self-Attention), which extends the notion of attention scores to attention _filters_, independently modulating the feature channels. We showcase CSA in a fully-attentional graph Transformer CGT (Chromatic Graph Transformer) which integrates both graph structural information and edge features, completely bypassing the need for local message-passing components. Our method flexibly encodes graph structure through node-node interactions, by enriching the original edge features with a relative positional encoding scheme. We propose a new scheme based on random walks that encodes both structural and positional information, and show how to incorporate higher-order topological information, such as rings in molecular graphs. Our approach achieves state-of-the-art results on the ZINC benchmark dataset, while providing a flexible framework for encoding graph structure and incorporating higher-order topology.

Benchmark Results

Tested on 1 dataset

Tables show presented results in global context (best 3 papers + GCN + MLP).

Classic

#ModelMAE ↓Paper
1
TIGT
0.0140 ±0.0010
2
FloydNet
0.0160
3
GSSC
0.0190 ±0.0010
57
CSA-rings
0.0560 ±0.0020
This paper
69
GIN
0.0880 ±0.0020
SOTA performance (not significantly different from the best) Baseline / comparison (this paper) Global context (other papers)