Lune

ICLR2024顶会

The Hedgehog & the Porcupine: Expressive Linear Attentions with Softmax Mimicry

Michael Zhang, Kush Bhatia, Hermann Kumbong, Christopher Ré

摘要

Linear attentions have shown potential for improving Transformer efficiency, reducing attention's quadratic complexity to linear in sequence length. This holds exciting promise for (1) training linear Transformers from scratch, (2) "finetuned-conversion" of task-specific Transformers into linear versions that recover task performance, and (3) "pretrained-conversion" of Transformers such as large language models into linear versions finetunable on downstream tasks. However, linear attentions often underperform standard softmax attention in quality. To close this performance gap, we find prior linear attentions lack key properties of softmax attention tied to good performance: low-entropy (or "spiky") weights and dot-product monotonicity. We further observe surprisingly simple feature maps that retain these properties and match softmax performance, but are inefficient to compute in linear attention. We thus propose Hedgehog, a learnable linear attention that retains the spiky and monotonic properties of softmax attention while maintaining linear complexity. Hedgehog uses simple trainable MLPs to produce attention weights mimicking softmax attention. Experiments show Hedgehog recovers over 99% of standard Transformer quality in train-from-scratch and finetuned-conversion settings, outperforming prior linear attentions up to 6 perplexity points on WikiText-103 with causal GPTs, and up to 8.7 GLUE score points on finetuned bidirectional BERTs. Hedgehog also enables pretrained-conversion. Converting a pretrained GPT-2 into a linear attention variant achieves state-of-the-art 16.7 perplexity on WikiText-103 for 125M subquadratic decoder models. We finally turn a pretrained Llama-2 7B into a viable linear attention Llama. With low-rank adaptation, Hedgehog-Llama2 7B achieves 28.1 higher ROUGE-1 points over the base standard attention model, where prior linear attentions lead to 16.5 point drops.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 42 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Emerging Properties in Self-Supervised Vision Transformers 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness 引用了 Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness 引用了 Efficiently Modeling Long Sequences with Structured State Spaces
  • FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Efficiently Modeling Long Sequences with Structured State Spaces 引用了 Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • Efficiently Modeling Long Sequences with Structured State Spaces 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • The Mamba in the Llama: Distilling and Accelerating Hybrid Models 引用了 Efficiently Modeling Long Sequences with Structured State Spaces
  • The Mamba in the Llama: Distilling and Accelerating Hybrid Models 引用了 Gated Linear Attention Transformers with Hardware-Efficient Training
  • The Mamba in the Llama: Distilling and Accelerating Hybrid Models 引用了 Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality
  • The Mamba in the Llama: Distilling and Accelerating Hybrid Models 引用了 Transformers to SSMs: Distilling Quadratic Knowledge to Subquadratic Models
  • Transformers to SSMs: Distilling Quadratic Knowledge to Subquadratic Models 引用了 The Mamba in the Llama: Distilling and Accelerating Hybrid Models
  • Gated Slot Attention for Efficient Linear-Time Sequence Modeling 引用了 Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • Gated Slot Attention for Efficient Linear-Time Sequence Modeling 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • Gated Slot Attention for Efficient Linear-Time Sequence Modeling 引用了 The Mamba in the Llama: Distilling and Accelerating Hybrid Models
  • Gated Slot Attention for Efficient Linear-Time Sequence Modeling 引用了 Gated Linear Attention Transformers with Hardware-Efficient Training
  • Gated Slot Attention for Efficient Linear-Time Sequence Modeling 引用了 Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality
  • Gated Slot Attention for Efficient Linear-Time Sequence Modeling 引用了 Transformers to SSMs: Distilling Quadratic Knowledge to Subquadratic Models
  • Gated Linear Attention Transformers with Hardware-Efficient Training 引用了 Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • Gated Linear Attention Transformers with Hardware-Efficient Training 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • Gated Linear Attention Transformers with Hardware-Efficient Training 引用了 Efficiently Modeling Long Sequences with Structured State Spaces
  • Gated Linear Attention Transformers with Hardware-Efficient Training 引用了 Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality
  • Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality 引用了 Gated Linear Attention Transformers with Hardware-Efficient Training
  • Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality 引用了 Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality 引用了 Efficiently Modeling Long Sequences with Structured State Spaces
  • Transformers to SSMs: Distilling Quadratic Knowledge to Subquadratic Models 引用了 Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • Transformers to SSMs: Distilling Quadratic Knowledge to Subquadratic Models 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • Transformers to SSMs: Distilling Quadratic Knowledge to Subquadratic Models 引用了 Efficiently Modeling Long Sequences with Structured State Spaces
  • Transformers to SSMs: Distilling Quadratic Knowledge to Subquadratic Models 引用了 Gated Linear Attention Transformers with Hardware-Efficient Training
  • Transformers to SSMs: Distilling Quadratic Knowledge to Subquadratic Models 引用了 Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper42

  1. Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space DualityTri Dao, Albert GuICML 2024 · 1,407 次引用
  2. Gated Linear Attention Transformers with Hardware-Efficient TrainingSonglin Yang, Bailin Wang, Yikang Shen, Rameswar Panda 等ICML 2024 · 390 次引用
  3. The Mamba in the Llama: Distilling and Accelerating Hybrid ModelsJunxiong Wang, Daniele Paliotta, Avner May, Alexander M. Rush 等NeurIPS 2024 · 146 次引用
  4. Gated Slot Attention for Efficient Linear-Time Sequence ModelingYu Zhang, Songlin Yang, Rui-Jie Zhu, Yue Zhang 等NeurIPS 2024 · 93 次引用
  5. Transformers to SSMs: Distilling Quadratic Knowledge to Subquadratic ModelsAviv Bick, Kevin Y. Li, Eric P. Xing, J. Zico Kolter 等NeurIPS 2024 · 78 次引用

它引用的 Paper19

  1. An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn 等ICLR 2021 · 21,477 次引用
  2. Emerging Properties in Self-Supervised Vision TransformersMathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou 等ICCV 2021 · 8,921 次引用
  3. FlashAttention: Fast and Memory-Efficient Exact Attention with IO-AwarenessTri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra 等NeurIPS 2022 · 5,493 次引用
  4. Efficiently Modeling Long Sequences with Structured State SpacesAlbert Gu, Karan Goel, Christopher RéICLR 2022 · 3,482 次引用
  5. Transformers are RNNs: Fast Autoregressive Transformers with Linear AttentionAngelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, François FleuretICML 2020 · 2,665 次引用

相关 Paper

  1. LoLCATs: On Low-Rank Linearizing of Large Language ModelsMichael Zhang, Simran Arora, Rahul Chalamala, Benjamin Frederick Spector 等ICLR 2025
  2. Lizard: An Efficient Linearization Framework for Large Language ModelsChien Van Nguyen, Huy Huu Nguyen, Ruiyi Zhang, Hanieh Deilamsalehy 等ACL 2026 · 8 次引用
  3. MVA: Linear Attention with High-order Query-Keys Integration and Multi-level Vocabulary DecompositionNing Wang, Zekun Li, Tongxin Bai, Man Yao 等ICML 2025
  4. LAWCAT: Efficient Distillation from Quadratic to Linear Attention with Convolution across Tokens for Long Context ModelingZeyu Liu, Souvik Kundu, Lianghao Jiang, Anni Li 等EMNLP Findings 2025
  5. Rectifying Magnitude Neglect in Linear AttentionQihang Fan, Huaibo Huang, Yuang Ai, Ran HeICCV 2025 · 14 次引用
黄昏的海面,两侧是细线勾勒的悬崖