Lune

ICML2022Top-tier venue

Flowformer: Linearizing Transformers with Conservation Flows

Haixu Wu, Jialong Wu, Jiehui Xu, Jianmin Wang, Mingsheng Long

Abstract

Transformers based on the attention mechanism have achieved impressive success in various areas. However, the attention mechanism has a quadratic complexity, significantly impeding Transformers from dealing with numerous tokens and scaling up to bigger models. Previous methods mainly utilize the similarity decomposition and the associativity of matrix multiplication to devise linear-time attention mechanisms. They avoid degeneration of attention to a trivial distribution by reintroducing inductive biases such as the locality, thereby at the expense of model generality and expressiveness. In this paper, we linearize Transformers free from specific inductive biases based on the flow network theory. We cast attention as the information flow aggregated from the sources (values) to the sinks (results) through the learned flow capacities (attentions). Within this framework, we apply the property of flow conservation into attention and propose the Flow-Attention mechanism of linear complexity. By respectively conserving the incoming flow of sinks for source competition and the outgoing flow of sources for sink allocation, Flow-Attention inherently generates informative attentions without using specific inductive biases. Empowered by the Flow-Attention, Flowformer yields strong performance in linear time for wide areas, including long sequence, time series, vision, natural language, and reinforcement learning. The code and settings are available at this repository: https://github.com/thuml/Flowformer .

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.

40 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

  • MogaNet: Multi-order Gated Aggregation Network cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • MogaNet: Multi-order Gated Aggregation Network cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
  • MogaNet: Multi-order Gated Aggregation Network cites Language Models are Few-Shot Learners
  • MogaNet: Multi-order Gated Aggregation Network cites Training data-efficient image transformers & distillation through attention
  • UniTS: A Unified Multi-Task Time Series Model cites Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecasting
  • UniTS: A Unified Multi-Task Time Series Model cites TimesNet: Temporal 2D-Variation Modeling for General Time Series Analysis
  • UniTS: A Unified Multi-Task Time Series Model cites Language Models are Few-Shot Learners
  • UniTS: A Unified Multi-Task Time Series Model cites iTransformer: Inverted Transformers Are Effective for Time Series Forecasting
  • An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale cites Language Models are Few-Shot Learners
  • TimesNet: Temporal 2D-Variation Modeling for General Time Series Analysis cites Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecasting
  • TimesNet: Temporal 2D-Variation Modeling for General Time Series Analysis cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
  • TimesNet: Temporal 2D-Variation Modeling for General Time Series Analysis cites Language Models are Few-Shot Learners
  • Transolver: A Fast Transformer Solver for PDEs on General Geometries cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Transolver: A Fast Transformer Solver for PDEs on General Geometries cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
  • Transolver: A Fast Transformer Solver for PDEs on General Geometries cites Language Models are Few-Shot Learners
  • Swin Transformer: Hierarchical Vision Transformer using Shifted Windows cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Swin Transformer: Hierarchical Vision Transformer using Shifted Windows cites Training data-efficient image transformers & distillation through attention
  • Training data-efficient image transformers & distillation through attention cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • iTransformer: Inverted Transformers Are Effective for Time Series Forecasting cites Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecasting
  • iTransformer: Inverted Transformers Are Effective for Time Series Forecasting cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • iTransformer: Inverted Transformers Are Effective for Time Series Forecasting cites TimesNet: Temporal 2D-Variation Modeling for General Time Series Analysis
  • iTransformer: Inverted Transformers Are Effective for Time Series Forecasting cites Language Models are Few-Shot Learners
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers40

  1. iTransformer: Inverted Transformers Are Effective for Time Series ForecastingYong Liu, Tengge Hu, Haoran Zhang, Haixu Wu et al.ICLR 2024 · 1,703 citations
  2. TimesNet: Temporal 2D-Variation Modeling for General Time Series AnalysisHaixu Wu, Tengge Hu, Yong Liu, Hang Zhou et al.ICLR 2023 · 423 citations
  3. Transolver: A Fast Transformer Solver for PDEs on General GeometriesHaixu Wu, Huakun Luo, Haowen Wang, Jianmin Wang et al.ICML 2024 · 228 citations
  4. UniTS: A Unified Multi-Task Time Series ModelShanghua Gao, Teddy Koker, Owen Queen, Tom Hartvigsen et al.NeurIPS 2024 · 159 citations
  5. MogaNet: Multi-order Gated Aggregation NetworkSiyuan Li, Zedong Wang, Zicheng Liu, Cheng Tan et al.ICLR 2024 · 151 citations

Builds on20

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Swin Transformer: Hierarchical Vision Transformer using Shifted WindowsZe Liu, Yutong Lin, Yue Cao, Han Hu et al.ICCV 2021 · 31,683 citations
  3. 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
  4. Training data-efficient image transformers & distillation through attentionHugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa et al.ICML 2021 · 8,974 citations
  5. Informer: Beyond Efficient Transformer for Long Sequence Time-Series ForecastingHaoyi Zhou, Shanghang Zhang, Jieqi Peng, Shuai Zhang et al.AAAI 2021 · 7,289 citations

Related papers

  1. cosFormer: Rethinking Softmax In AttentionZhen Qin, Weixuan Sun, Hui Deng, Dongxu Li et al.ICLR 2022 · 303 citations
  2. The Devil in Linear TransformerZhen Qin, Xiaodong Han, Weixuan Sun, Dongxu Li et al.EMNLP 2022 · 24 citations
  3. ELFATT: Efficient Linear Fast Attention for Vision TransformersChong Wu, Maolin Che, Renjie Xu, Zhuoheng Ran et al.ACM MM 2025 · 3 citations
  4. PolySketchFormer: Fast Transformers via Sketching Polynomial KernelsPraneeth Kacham, Vahab Mirrokni, Peilin ZhongICML 2024 · 27 citations
  5. Bridging the Divide: Reconsidering Softmax and Linear AttentionDongchen Han, Yifan Pu, Zhuofan Xia, Yizeng Han et al.NeurIPS 2024 · 69 citations
Dusk over the sea between two cliffs drawn in fine vertical lines