Flexformer: Flexible Linear Transformer with Learnable Attention Kernel
Not on the map. Why?
Abstract (arXiv)
Transformer models rely on attention mechanism to capture long-range dependencies but suffer from quadratic complexity, limiting their scalability to long sequences. Kernel-based linear attention reduces this complexity but typically relies on fixed or weakly learnable kernels, restricting expressiveness and performance. In this work, we propose Flexformer, a flexible linear Transformer that learns attention kernels in a fully data-driven manner. Flexformer builds on random Fourier feature-based linear attention and treats spectral frequencies as trainable parameters, enabling the model to learn a broad family of attention kernels. We develop both stationary and nonstationary variants, with the latter offering strictly greater expressiveness. Extensive experiments on language modeling and sequence classification demonstrate that Flexformer consistently outperforms baselines. Moreover, Flexformer can be effectively distilled from pretrained Transformers to recover softmax attention and exhibits strong kernel transferability across domains, achieving both high efficiency and competitive performance on long-sequence tasks.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 33 of its 43 references that are in the map. First posted on arXiv 26 Jun 2026.
Builds on
33 of 43 references.
References · 33
- 2017Attention Is All You Needcited by 60,361
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
- 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,305
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,372
- 2021Swin Transformer: Hierarchical Vision Transformer using Shifted Windowscited by 12,139
- 2018GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understandingcited by 4,899
- 2020Longformer: The Long-Document Transformercited by 3,413
- 2016Pointer Sentinel Mixture Modelscited by 3,096
- 2020Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecastingcited by 2,169
- 2022A Time Series is Worth 64 Words: Long-term Forecasting with Transformerscited by 2,039
21 more
- 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 2,022
- 2020Big Bird: Transformers for Longer Sequencescited by 1,684
- 2020Reformer: The Efficient Transformercited by 1,668
- 2020Rethinking Attention with Performerscited by 1,601
- 2019fairseq: A Fast, Extensible Toolkit for Sequence Modelingcited by 1,488
- 2023iTransformer: Inverted Transformers Are Effective for Time Series Forecastingcited by 931
- 2020Long Range Arena: A Benchmark for Efficient Transformerscited by 700
- 2020Efficient Content-Based Sparse Attention with Routing Transformerscited by 471
- 2018Fundamentals of Recurrent Neural Network (RNN) and Long Short-Term Memory (LSTM) Networkcited by 420
- 2021Random Feature Attentioncited by 354
- 2018Adaptive Input Representations for Neural Language Modelingcited by 226
- 2022cosFormer: Rethinking Softmax in Attentioncited by 213
- 2024Simple linear attention language models balance the recall-throughput tradeoffcited by 208
- 2018ListOps: A Diagnostic Dataset for Latent Tree Learningcited by 129
- 2024The Hedgehog & the Porcupine: Expressive Linear Attentions with Softmax Mimicrycited by 120
- 2021Skyformer: Remodel Self-Attention with Gaussian Kernel and Nystr"om Methodcited by 63
- 2025PolaFormer: Polarity-aware Linear Attention for Vision Transformerscited by 32
- 2015An Exploration of Softmax Alternatives Belonging to the Spherical Loss Familycited by 27
- 2024Understanding the differences in Foundation Models: Attention, State Space Models, and Recurrent Neural Networkscited by 26
- 2023Building Blocks for a Complex-Valued Transformer Architecturecited by 16
- 2024Nonstationary Sparse Spectral Permanental Processcited by 2
Built on by
Citing papers per year: 2026: 1.
1 paper.
- 2026Random Fourier Features in Near-Linear Timecited by 0
- 2026Random Fourier Features in Near-Linear Time10 Oct 2026