mlsanityData to 14 Oct 2026

Scaling Stick-Breaking Attention: An Efficient Implementation and In-depth Study

arXiv 2410.17980 ↗First posted 23 Oct 2024cs.LG cs.AI cs.CLcited by 13

Not on the map. Why?

Abstract (arXiv)

The self-attention mechanism traditionally relies on the softmax operator, necessitating positional embeddings like RoPE, or position biases to account for token order. But current methods using still face length generalisation challenges. We investigate an alternative attention mechanism based on the stick-breaking process in larger scale settings. The method works as follows: For each token before the current, we determine a break point, which represents the proportion of the stick, the weight of the attention, to allocate to the current token. We repeat this on the remaining stick, until all tokens are allocated a weight, resulting in a sequence of attention weights. This process naturally incorporates recency bias, which has linguistic motivations for grammar parsing. We study the implications of replacing the conventional softmax-based attention mechanism with stick-breaking attention. We then discuss implementation of numerically stable stick-breaking attention and adapt Flash Attention to accommodate this mechanism. When used as a drop-in replacement for current softmax+RoPE attention systems, we find that stick-breaking attention performs competitively with current methods on length generalisation and downstream tasks. Stick-breaking also performs well at length generalisation, allowing a model trained with 211 context window to perform well at 214 with perplexity improvements.

Key facts. Cited by 13 papers in the map (data through 14 Oct 2026). Builds on 32 of its 51 references that are in the map. First posted on arXiv 23 Oct 2024.

Builds on

32 of 51 references.

References · 32

  1. 2017Attention Is All You Needcited by 60,361
  2. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
  3. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
  4. 2021Training Verifiers to Solve Math Word Problemscited by 10,109
  5. 2018Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challengecited by 4,886
  6. 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,718
  7. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
  8. 2019HellaSwag: Can a Machine Really Finish Your Sentence?cited by 4,100
  9. 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,673
  10. 2019PIQA: Reasoning about Physical Commonsense in Natural Languagecited by 2,883
  11. 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,598
  12. 2023Efficient Streaming Language Models with Attention Sinkscited by 2,186
20 more
  1. 2018Can a Suit of Armor Conduct Electricity? A New Dataset for Open Book Question Answeringcited by 2,164
  2. 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,346
  3. 2018Self-Attention with Relative Position Representationscited by 1,120
  4. 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,103
  5. 2017RACE: Large-scale ReAding Comprehension Dataset From Examinationscited by 861
  6. 2024MiniCPM: Unveiling the Potential of Small Language Models with Scalable Training Strategiescited by 723
  7. 2024TinyLlama: An Open-Source Small Language Modelcited by 618
  8. 2016Adaptive Computation Time for Recurrent Neural Networkscited by 506
  9. 2023The Impact of Positional Encoding on Length Generalization in Transformerscited by 327
  10. 2023Zoology: Measuring and Improving Recall in Efficient Language Modelscited by 204
  11. 2024The Illusion of State in State-Space Modelscited by 187
  12. 2021PonderNet: Learning to Pondercited by 168
  13. 2023Quantizable Transformers: Removing Outliers by Helping Attention Heads Do Nothingcited by 151
  14. 2022Transformer Language Models without Positional Encodings Still Learn Positional Informationcited by 150
  15. 2019Language Modeling with Deep Transformerscited by 96
  16. 2024Transformers Can Achieve Length Generalization But Not Robustlycited by 86
  17. 2021The Neural Data Router: Adaptive Control Flow in Transformers Improves Systematic Generalizationcited by 62
  18. 2017Neural Language Modeling by Jointly Learning Syntax and Lexiconcited by 57
  19. 2023Sparse Universal Transformercited by 32
  20. 2024Power Scheduler: A Batch Size and Token Number Agnostic Learning Rate Schedulercited by 28

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 9; 2026: 4.

13 papers.

Sort:

By area: