Transformers Generalize DeepSets and Can be Extended to Graphs & Hypergraphs
Jinwoo Kim, Saeyoon Oh, Seunghoon Hong
Abstract
We present a generalization of Transformers to any-order permutation invariant data (sets, graphs, and hypergraphs). We begin by observing that Transformers generalize DeepSets, or first-order (set-input) permutation invariant MLPs. Then, based on recently characterized higher-order invariant MLPs, we extend the concept of self-attention to higher orders and propose higher-order Transformers for order- data ( for graphs and for hypergraphs). Unfortunately, higher-order Transformers turn out to have prohibitive complexity to the number of input nodes . To address this problem, we present sparse higher-order Transformers that have quadratic complexity to the number of input hyperedges, and further adopt the kernel attention approach to reduce the complexity to linear. In particular, we show that the sparse second-order Transformers with kernel attention are theoretically more expressive than message passing operations while having an asymptotically identical complexity. Our models achieve significant performance improvement over invariant MLPs and message-passing graph neural networks in large-scale graph regression and set-to-(hyper)graph prediction tasks. Our implementation is available at https://github.com/jw9730/hot.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Cited by top-tier papers16
- On the Feasibility of Simple Transformer for Dynamic Graph ModelingYuxia Wu, Yuan Fang, Lizi LiaoWWW 2024 · 49 citations
- Graph Metanetworks for Processing Diverse Neural ArchitecturesDerek Lim, Haggai Maron, Marc T. Law, Jonathan Lorraine et al.ICLR 2024 · 47 citations
- High-Order Pooling for Graph Neural Networks with Tensor DecompositionChenqing Hua, Guillaume Rabusseau, Jian TangNeurIPS 2022 · 45 citations
- Crystalformer: Infinitely Connected Attention for Periodic Structure EncodingTatsunori Taniai, Ryo Igarashi, Yuta Suzuki, Naoya Chiba et al.ICLR 2024 · 21 citations
- Cell Graph Transformer for Nuclei ClassificationWei Lou, Guanbin Li, Xiang Wan, Haofeng LiAAAI 2024 · 17 citations
Builds on8
- Transformers are RNNs: Fast Autoregressive Transformers with Linear AttentionAngelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, François FleuretICML 2020 · 2,665 citations
- On Layer Normalization in the Transformer ArchitectureRuibin Xiong, Yunchang Yang, Di He, Kai Zheng et al.ICML 2020 · 1,388 citations
- Graph Neural Networks Exponentially Lose Expressive Power for Node ClassificationKenta Oono, Taiji SuzukiICLR 2020 · 864 citations
- Are Transformers universal approximators of sequence-to-sequence functions?Chulhee Yun, Srinadh Bhojanapalli, Ankit Singh Rawat, Sashank J. Reddi et al.ICLR 2020 · 481 citations
- Hyper-SAGNN: a self-attention based graph neural network for hypergraphsRuochi Zhang, Yuesong Zou, Jian MaICLR 2020 · 228 citations
Related papers
- SpeqNets: Sparsity-aware permutation-equivariant graph networksChristopher Morris, Gaurav Rattan, Sandra Kiefer, Siamak RavanbakhshICML 2022 · 47 citations
- Even Sparser Graph TransformersHamed Shirzad, Honghao Lin, Balaji Venkatachalam, Ameya Velingker et al.NeurIPS 2024 · 18 citations
- Polynormer: Polynomial-Expressive Graph Transformer in Linear TimeChenhui Deng, Zichao Yue, Zhiru ZhangICLR 2024 · 81 citations
- Fast and Accurate Temporal Hypergraph Representation for Hyperedge PredictionYuanyuan Xu, Wenjie Zhang, Ying Zhang, Xiwei Xu et al.KDD 2025 · 7 citations
- Relational Attention: Generalizing Transformers for Graph-Structured TasksCameron Diao, Ricky LoyndICLR 2023 · 6 citations
