Flowformer: Linearizing Transformers with Conservation Flows
Haixu Wu, Jialong Wu, Jiehui Xu, Jianmin Wang, Mingsheng Long
摘要
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 .
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 40 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- MogaNet: Multi-order Gated Aggregation Network 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- MogaNet: Multi-order Gated Aggregation Network 引用了 Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
- MogaNet: Multi-order Gated Aggregation Network 引用了 Language Models are Few-Shot Learners
- MogaNet: Multi-order Gated Aggregation Network 引用了 Training data-efficient image transformers & distillation through attention
- UniTS: A Unified Multi-Task Time Series Model 引用了 Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecasting
- UniTS: A Unified Multi-Task Time Series Model 引用了 TimesNet: Temporal 2D-Variation Modeling for General Time Series Analysis
- UniTS: A Unified Multi-Task Time Series Model 引用了 Language Models are Few-Shot Learners
- UniTS: A Unified Multi-Task Time Series Model 引用了 iTransformer: Inverted Transformers Are Effective for Time Series Forecasting
- An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale 引用了 Language Models are Few-Shot Learners
- TimesNet: Temporal 2D-Variation Modeling for General Time Series Analysis 引用了 Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecasting
- TimesNet: Temporal 2D-Variation Modeling for General Time Series Analysis 引用了 Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
- TimesNet: Temporal 2D-Variation Modeling for General Time Series Analysis 引用了 Language Models are Few-Shot Learners
- Transolver: A Fast Transformer Solver for PDEs on General Geometries 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Transolver: A Fast Transformer Solver for PDEs on General Geometries 引用了 Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
- Transolver: A Fast Transformer Solver for PDEs on General Geometries 引用了 Language Models are Few-Shot Learners
- Swin Transformer: Hierarchical Vision Transformer using Shifted Windows 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Swin Transformer: Hierarchical Vision Transformer using Shifted Windows 引用了 Training data-efficient image transformers & distillation through attention
- Training data-efficient image transformers & distillation through attention 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- iTransformer: Inverted Transformers Are Effective for Time Series Forecasting 引用了 Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecasting
- iTransformer: Inverted Transformers Are Effective for Time Series Forecasting 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- iTransformer: Inverted Transformers Are Effective for Time Series Forecasting 引用了 TimesNet: Temporal 2D-Variation Modeling for General Time Series Analysis
- iTransformer: Inverted Transformers Are Effective for Time Series Forecasting 引用了 Language Models are Few-Shot Learners
引用它的顶会 Paper40
- iTransformer: Inverted Transformers Are Effective for Time Series ForecastingYong Liu, Tengge Hu, Haoran Zhang, Haixu Wu 等ICLR 2024 · 1,703 次引用
- TimesNet: Temporal 2D-Variation Modeling for General Time Series AnalysisHaixu Wu, Tengge Hu, Yong Liu, Hang Zhou 等ICLR 2023 · 423 次引用
- Transolver: A Fast Transformer Solver for PDEs on General GeometriesHaixu Wu, Huakun Luo, Haowen Wang, Jianmin Wang 等ICML 2024 · 228 次引用
- UniTS: A Unified Multi-Task Time Series ModelShanghua Gao, Teddy Koker, Owen Queen, Tom Hartvigsen 等NeurIPS 2024 · 159 次引用
- MogaNet: Multi-order Gated Aggregation NetworkSiyuan Li, Zedong Wang, Zicheng Liu, Cheng Tan 等ICLR 2024 · 151 次引用
它引用的 Paper20
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
- Swin Transformer: Hierarchical Vision Transformer using Shifted WindowsZe Liu, Yutong Lin, Yue Cao, Han Hu 等ICCV 2021 · 31,683 次引用
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn 等ICLR 2021 · 21,477 次引用
- Training data-efficient image transformers & distillation through attentionHugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa 等ICML 2021 · 8,974 次引用
- Informer: Beyond Efficient Transformer for Long Sequence Time-Series ForecastingHaoyi Zhou, Shanghang Zhang, Jieqi Peng, Shuai Zhang 等AAAI 2021 · 7,289 次引用
相关 Paper
- cosFormer: Rethinking Softmax In AttentionZhen Qin, Weixuan Sun, Hui Deng, Dongxu Li 等ICLR 2022 · 303 次引用
- The Devil in Linear TransformerZhen Qin, Xiaodong Han, Weixuan Sun, Dongxu Li 等EMNLP 2022 · 24 次引用
- ELFATT: Efficient Linear Fast Attention for Vision TransformersChong Wu, Maolin Che, Renjie Xu, Zhuoheng Ran 等ACM MM 2025 · 3 次引用
- PolySketchFormer: Fast Transformers via Sketching Polynomial KernelsPraneeth Kacham, Vahab Mirrokni, Peilin ZhongICML 2024 · 27 次引用
- Bridging the Divide: Reconsidering Softmax and Linear AttentionDongchen Han, Yifan Pu, Zhuofan Xia, Yizeng Han 等NeurIPS 2024 · 69 次引用
