A Generalization of Transformer Networks to Graphs
arXiv:2012.09699
Abstract
We propose a generalization of transformer neural network architecture for arbitrary graphs. The original transformer was designed for Natural Language Processing (NLP), which operates on fully connected graphs representing all connections between the words in a sequence. Such architecture does not leverage the graph connectivity inductive bias, and can perform poorly when the graph topology is important and has not been encoded into the node features. We introduce a graph transformer with four new properties compared to the standard model. First, the attention mechanism is a function of the neighborhood connectivity for each node in the graph. Second, the positional encoding is represented by the Laplacian eigenvectors, which naturally generalize the sinusoidal positional encodings often used in NLP. Third, the layer normalization is replaced by a batch normalization layer, which provides faster training and better generalization performance. Finally, the architecture is extended to edge feature representation, which can be critical to tasks s.a. chemistry (bond type) or link prediction (entity relationship in knowledge graphs). Numerical experiments on a graph benchmark demonstrate the performance of the proposed graph transformer architecture. This work closes the gap between the original transformer, which was designed for the limited case of line graphs, and graph neural networks, that can work with arbitrary graphs. As our architecture is simple and generic, we believe it can be used as a black box for future applications that wish to consider transformer and graphs.
arXiv commentAAAI 2021 Workshop on Deep Learning on Graphs: Methods and Applications (DLG-AAAI 2021); Code at https://github.com/graphdeeplearning/graphtransformer
References in corpus (16)
- PyTorch: An Imperative Style, High-Performance Deep Learning Library
- Neural Machine Translation by Jointly Learning to Align and Translate
- Neural Message Passing for Quantum Chemistry
- Language Models are Few-Shot Learners
- Representation Learning on Graphs with Jumping Knowledge Networks
- Graph Transformer Networks
- Learning to Simulate Complex Physics with Graph Networks
- Gated Graph Sequence Neural Networks
- Residual Gated Graph ConvNets
- Benchmarking Graph Neural Networks
- Fake News Detection on Social Media using Geometric Deep Learning
- Graph-Bert: Only Attention is Needed for Learning Graph Representations
- Distance Encoding: Design Provably More Powerful Neural Networks for Graph Representation Learning
- Position-aware Graph Neural Networks
- Multi-Graph Transformer for Free-Hand Sketch Recognition
- Learning Symbolic Physics with Graph Networks
Cited by in corpus (37)
- Geometric Deep Learning: Grids, Groups, Graphs, Geodesics, and Gauges
- A Comprehensive Survey on Deep Graph Representation Learning
- Do Transformers Really Perform Bad for Graph Representation?
- Attention-based graph neural networks: a survey
- Global Self-Attention as a Replacement for Graph Convolution
- Enhancing Video-Language Representations with Structural Spatio-Temporal Alignment
- How Attentive are Graph Attention Networks?
- GraphiT: Encoding Graph Structure in Transformers
- Company-as-Tribe: Company Financial Risk Assessment on Tribe-Style Graph with Hierarchical Graph Neural Networks
- Component Segmentation of Engineering Drawings Using Graph Convolutional Networks
- Brain Networks and Intelligence: A Graph Neural Network Based Approach to Resting State fMRI Data
- DSAM: A Deep Learning Framework for Analyzing Temporal and Spatial Dynamics in Brain Networks
- Graph Neural Networks with Learnable Structural and Positional Representations
- Logiformer: A Two-Branch Graph Transformer Network for Interpretable Logical Reasoning
- Single-Cell Multimodal Prediction via Transformers
- Gophormer: Ego-Graph Transformer for Node Classification
- Beltrami Flow and Neural Diffusion on Graphs
- Multiresolution Graph Transformers and Wavelet Positional Encoding for Learning Hierarchical Structures
- Zero-Shot Learning with Common Sense Knowledge Graphs
- Graph-to-SFILES: Control structure prediction from process topologies using generative artificial intelligence
- i-Align: an interpretable knowledge graph alignment model
- Improving Graph Convolutional Networks with Transformer Layer in social-based items recommendation
- GENNAPE: Towards Generalized Neural Architecture Performance Estimators
- Neural Garment Dynamics via Manifold-Aware Transformers
- A General-Purpose Transferable Predictor for Neural Architecture Search
- Training a First-Order Theorem Prover from Synthetic Data
- Enhanced Spatial Clustering of Single-Molecule Localizations with Graph Neural Networks
- DyFormer: A Scalable Dynamic Graph Transformer with Provable Benefits on Generalization Ability
- TransCamP: Graph Transformer for 6-DoF Camera Pose Estimation
- LUKE-Graph: A Transformer-based Approach with Gated Relational Graph Attention for Cloze-style Reading Comprehension
- Mixture-of-Experts Graph Transformers for Interpretable Particle Collision Detection
- Hybrid Focal and Full-Range Attention Based Graph Transformers
- Graph Transformer with Disease Subgraph Positional Encoding for Improved Comorbidity Prediction
- Contributions to Representation Learning with Graph Autoencoders and Applications to Music Recommendation
- A Theory of Non-Acyclic Generative Flow Networks
- On Inductive Biases for Machine Learning in Data Constrained Settings
- Multi-hop Graph Convolutional Network with High-order Chebyshev Approximation for Text Reasoning