Lune

ICLR2025Top-tier venue

Linear Transformer Topological Masking with Graph Random Features

Isaac Reid, Kumar Avinava Dubey, Deepali Jain, William F. Whitney, Amr Ahmed, Joshua Ainslie, Alex Bewley, Mithun George Jacob, Aranyak Mehta, David Rendleman, Connor Schenck, Richard E. Turner

Abstract

When training transformers on graph-structured data, incorporating information about the underlying topology is crucial for good performance. Topological masking, a type of relative position encoding, achieves this by upweighting or downweighting attention depending on the relationship between the query and keys in a graph. In this paper, we propose to parameterise topological masks as a learnable function of a weighted adjacency matrix -a novel, flexible approach which incorporates a strong structural inductive bias. By approximating this mask with graph random features (for which we prove the first known concentration bounds), we show how this can be made fully compatible with linear attention, preserving O(N ) time and space complexity with respect to the number of input tokens. The fastest previous alternative was O(N log N ) and only suitable for specific graphs. Our efficient masking algorithms provide strong performance gains for tasks on image and point cloud data, including with > 30k nodes.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

4 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • ViViT: A Video Vision Transformer cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • SWING: Unlocking Implicit Graph Representations for Graph Random Features cites Computationally-efficient Graph Modeling with Refined Graph Random Features
  • SWING: Unlocking Implicit Graph Representations for Graph Random Features cites Graph Random Features for Scalable Gaussian Processes
  • SWING: Unlocking Implicit Graph Representations for Graph Random Features cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Computationally-efficient Graph Modeling with Refined Graph Random Features cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Do Transformers Really Perform Badly for Graph Representation? cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Learning the RoPEs: Better 2D and 3D Position Encodings with STRING cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • Learning the RoPEs: Better 2D and 3D Position Encodings with STRING cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers4

  1. Graph Random Features for Scalable Gaussian ProcessesMatthew Zhang, Jihao Andreas Lin, Krzysztof Choromanski, Adrian Weller et al.ICLR 2026 · 4 citations
  2. Computationally-efficient Graph Modeling with Refined Graph Random FeaturesKrzysztof Choromanski, Kumar Avinava Dubey, Arijit Sehanobish, Isaac ReidICML 2026 · 2 citations
  3. SWING: Unlocking Implicit Graph Representations for Graph Random FeaturesAlessandro Manenti, Kumar Avinava Dubey, Arijit Sehanobish, Cesare Alippi et al.ICML 2026
  4. Learning the RoPEs: Better 2D and 3D Position Encodings with STRINGConnor Schenck, Isaac Reid, Mithun George Jacob, Alex Bewley et al.ICML 2025

Builds on19

  1. An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
  2. ViViT: A Video Vision TransformerAnurag Arnab, Mostafa Dehghani, Georg Heigold, Chen Sun et al.ICCV 2021 · 2,947 citations
  3. Transformers are RNNs: Fast Autoregressive Transformers with Linear AttentionAngelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, François FleuretICML 2020 · 2,665 citations
  4. Do Transformers Really Perform Badly for Graph Representation?Chengxuan Ying, Tianle Cai, Shengjie Luo, Shuxin Zheng et al.NeurIPS 2021 · 1,632 citations
  5. Score-Based Generative Modeling through Stochastic Differential EquationsYang Song, Jascha Sohl-Dickstein, Diederik P. Kingma, Abhishek Kumar et al.ICLR 2021 · 1,270 citations

Related papers

  1. From block-Toeplitz matrices to differential equations on graphs: towards a general theory for scalable masked TransformersKrzysztof Choromanski, Han Lin, Haoxian Chen, Tianyi Zhang et al.ICML 2022 · 47 citations
  2. Transformers over Directed Acyclic GraphsYuankai Luo, Veronika Thost, Lei ShiNeurIPS 2023 · 43 citations
  3. Structure-Aware Transformer for Graph Representation LearningDexiong Chen, Leslie O'Bray, Karsten M. BorgwardtICML 2022 · 349 citations
  4. Homomorphism Counts as Structural Encodings for Graph LearningLinus Bao, Emily Jin, Michael M. Bronstein, Ismail Ilkan Ceylan et al.ICLR 2025
  5. Rotary Position Encodings for GraphsIsaac Reid, Arijit Sehanobish, Cederik Höfs, Bruno Mlodozeniec et al.ICML 2026
Dusk over the sea between two cliffs drawn in fine vertical lines