mlsanityData to 7 Oct 2026

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

arXiv 2402.04347 ↗First posted 6 Feb 2024cs.LG cs.CLcited by 119

Not on the map. Why?

Abstract (arXiv)

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.

Key facts. Cited by 119 papers in the map (data through 7 Oct 2026). Builds on 38 of its 42 references that are in the map. First posted on arXiv 6 Feb 2024.

Builds on

38 of 42 references.

References · 38

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
  4. 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,084
  5. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  6. 2021Emerging Properties in Self-Supervised Vision Transformerscited by 6,893
  7. 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,530
  8. 2019Parameter-Efficient Transfer Learning for NLPcited by 4,195
  9. 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,611
  10. 2023QLoRA: Efficient Finetuning of Quantized LLMscited by 3,355
  11. 2016Pointer Sentinel Mixture Modelscited by 2,992
  12. 2021Efficiently Modeling Long Sequences with Structured State Spacescited by 2,424
26 more
  1. 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 1,979
  2. 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,830
  3. 2023Pythia: A Suite for Analyzing Large Language Models Across Training and Scalingcited by 1,734
  4. 2020Rethinking Attention with Performerscited by 1,584
  5. 2018Neural Network Acceptability Judgmentscited by 952
  6. 2023Extending Context Window of Large Language Models via Positional Interpolationcited by 721
  7. 2020Long Range Arena: A Benchmark for Efficient Transformerscited by 696
  8. 2019SAMSum Corpus: A Human-annotated Dialogue Dataset for Abstractive Summarizationcited by 530
  9. 2022Hungry Hungry Hippos: Towards Language Modeling with State Space Modelscited by 495
  10. 2021Linear Transformers Are Secretly Fast Weight Programmerscited by 471
  11. 2021Nystr"omformer: A Nystr"om-Based Algorithm for Approximating Self-Attentioncited by 468
  12. 2023Hyena Hierarchy: Towards Larger Convolutional Language Modelscited by 388
  13. 2021Random Feature Attentioncited by 350
  14. 2022cosFormer: Rethinking Softmax in Attentioncited by 212
  15. 2019Transformer Dissection: A Unified Understanding of Transformer's Attention via the Lens of Kernelcited by 211
  16. 2016Using Fast Weights to Attend to the Recent Pastcited by 161
  17. 2022On The Computational Complexity of Self-Attentioncited by 137
  18. 2023Fast Attention Requires Bounded Entriescited by 102
  19. 2022The Devil in Linear Transformercited by 98
  20. 2021Finetuning Pretrained Transformers into RNNscited by 94
  21. 2021Going Beyond Linear Transformers with Recurrent Fast Weight Programmerscited by 84
  22. 2021Skyformer: Remodel Self-Attention with Gaussian Kernel and Nystr"om Methodcited by 61
  23. 2022Fine-Tuning Pre-trained Transformers into Decaying Fast Weightscited by 26
  24. 2021Hybrid Random Featurescited by 25
  25. 2023Efficient Attention via Control Variatescited by 23
  26. 2020Exploring Alternatives to Softmax Functioncited by 16

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 31; 2025: 44; 2026: 44.

119 papers.

Sort:

By area:

  1. 2024From Decoding to Meta-Generation: Inference-time Algorithms for Large Language Modelscited by 136
  2. 2024The Mamba in the Llama: Distilling and Accelerating Hybrid Modelscited by 120
  3. 2024Keep the Cost Down: A Review on Methods to Optimize LLM' s KV-Cache Consumptioncited by 96
  4. 2024Gated Slot Attention for Efficient Linear-Time Sequence Modelingcited by 73
  5. 2024Transformers to SSMs: Distilling Quadratic Knowledge to Subquadratic Modelscited by 66
  6. 2025Test-time regression: a unifying framework for designing sequence models with associative memorycited by 63
  7. 2024Linearizing Large Language Modelscited by 51
  8. 2024Sparser is Faster and Less is More: Efficient Sparse Attention for Long-Range Transformerscited by 51
  9. 2024Training of Physical Neural Networkscited by 47
  10. 2025Jet-Nemotron: Efficient Language Model with Post Neural Architecture Searchcited by 39
  11. 2024ThunderKittens: Simple, Fast, and Adorable AI Kernelscited by 34
  12. 2025Liger: Linearizing Large Language Models to Gated Recurrent Structurescited by 32
38 more
  1. 2024The Fine-Grained Complexity of Gradient Computation for Training Large Language Modelscited by 30
  2. 2025PolaFormer: Polarity-aware Linear Attention for Vision Transformerscited by 30
  3. 2024Training Tensor Attention Efficiently: From Cubic to Almost Linear Timecited by 29
  4. 2025Tensor Product Attention Is All You Needcited by 27
  5. 2024LoLCATs: On Low-Rank Linearizing of Large Language Modelscited by 25
  6. 2024Multi-Layer Transformers Gradient Can be Approximated in Almost Linear Timecited by 22
  7. 2025Thinking Slow, Fast: Scaling Inference Compute with Distilled Reasonerscited by 22
  8. 2025M1: Towards Scalable Test-Time Compute with Mamba Reasoning Modelscited by 21
  9. 2025Efficient Attention Mechanisms for Large Language Models: A Surveycited by 21
  10. 2024MetaLA: Unified Optimal Linear Approximation to Softmax Attention Mapcited by 20
  11. 2024A Tighter Complexity Analysis of SparseGPTcited by 19
  12. 2024HSR-Enhanced Sparse Attention Accelerationcited by 19
  13. 2024Understanding and Mitigating Bottlenecks of State Space Models through the Lens of Recency and Over-smoothingcited by 17
  14. 2026PISA: Piecewise Sparse Attention Is Wiser for Efficient Diffusion Transformerscited by 16
  15. 2024Mimetic Initialization Helps State Space Models Learn to Recallcited by 15
  16. 2026VGG-T3: Offline Feed-Forward 3D Reconstruction at Scalecited by 14
  17. 2025TabFlex: Scaling Tabular Learning to Millions with Linear Attentioncited by 13
  18. 2025Attention Surgery: An Efficient Recipe to Linearize Your Video Diffusion Transformercited by 13
  19. 2025Scaling Linear Attention with Sparse State Expansioncited by 12
  20. 2024LightTransfer: Your Long-Context LLM is Secretly a Hybrid Model with Effortless Adaptationcited by 11
  21. 2025Multimodal Mamba: Decoder-only Multimodal State Space Model via Quadratic to Linear Distillationcited by 11
  22. 2025LoLA: Low-Rank Linear Attention With Sparse Cachingcited by 10
  23. 2024Distributed Speculative Inference (DSI): Speculation Parallelism for Provably Faster Lossless Language Model Inferencecited by 9
  24. 2025ZETA: Leveraging Z-order Curves for Efficient Top-k Attentioncited by 9
  25. 2025Fast RoPE Attention: Combining the Polynomial Method and Fast Fourier Transformcited by 9
  26. 2025LinVideo: A Post-Training Framework towards O(n) Attention in Efficient Video Generationcited by 9
  27. 2025Selective Rotary Position Embeddingcited by 8
  28. 2025Only Large Weights (And Not Skip Connections) Can Prevent the Perils of Rank Collapsecited by 7
  29. 2024Exact Conversion of In-Context Learning to Model Weights in Linearized-Attention Transformerscited by 6
  30. 2025Lizard: An Efficient Linearization Framework for Large Language Modelscited by 6
  31. 2026ReHyAt: Recurrent Hybrid Attention for Video Diffusion Transformerscited by 6
  32. 2024CARE Transformer: Mobile-Friendly Linear Visual Transformer via Decoupled Dual Interactioncited by 5
  33. 2025ViT-Linearizer: Distilling Quadratic Knowledge into Linear-Time Vision Modelscited by 5
  34. 2025MonarchAttention: Zero-Shot Conversion to Fast, Hardware-Aware Structured Attentioncited by 5
  35. 2025ReGLA: Refining Gated Linear Attentioncited by 4
  36. 2025Linear Attention for Efficient Bidirectional Sequence Modelingcited by 4
  37. 2025X-EcoMLA: Upcycling Pre-Trained Attention into MLA for Efficient and Extreme KV Compressioncited by 4
  38. 2025LOTFormer: Doubly-Stochastic Linear Attention via Low-Rank Optimal Transportcited by 4

50 most cited of 119 All 119 (JSON)