mlsanityData to 14 Oct 2026

When Precision Meets Position: BFloat16 Breaks Down RoPE in Long-Context Training

arXiv 2411.13476 ↗First posted 20 Nov 2024cs.CLcited by 15

Not on the map. Why?

Abstract (arXiv)

Extending context window sizes allows large language models (LLMs) to process longer sequences and handle more complex tasks. Rotary Positional Embedding (RoPE) has become the de facto standard due to its relative positional encoding properties that benefit long-context training. However, we observe that using RoPE with BFloat16 format results in numerical issues, causing it to deviate from its intended relative positional encoding, especially in long-context scenarios. This issue arises from BFloat16's limited precision and accumulates as context length increases, with the first token contributing significantly to this problem. To address this, we develop AnchorAttention, a plug-and-play attention method that alleviates numerical issues caused by BFloat16, improves long-context capabilities, and speeds up training. AnchorAttention reduces unnecessary attention computations, maintains semantic coherence, and boosts computational efficiency by treating the first token as a shared anchor with a consistent position ID, making it visible to all documents within the training context. Experiments on three types of LLMs demonstrate that AnchorAttention significantly improves long-context performance and reduces training time by over 50% compared to standard full attention mechanisms, while preserving the original LLM's capabilities on general tasks. Our code is available at https://github.com/haonan3/AnchorContext.

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

Builds on

51 of 61 references.

References · 51

  1. 2017Attention Is All You Needcited by 60,361
  2. 2024The Llama 3 Herd of Modelscited by 14,715
  3. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
  4. 2019HellaSwag: Can a Machine Really Finish Your Sentence?cited by 4,100
  5. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
  6. 2023Mistral 7Bcited by 3,164
  7. 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,598
  8. 2023Efficient Streaming Language Models with Attention Sinkscited by 2,186
  9. 2024Phi-3 Technical Report: A Highly Capable Language Model Locally on Your Phonecited by 1,917
  10. 2023GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpointscited by 1,346
  11. 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,346
  12. 2018Self-Attention with Relative Position Representationscited by 1,120
38 more
  1. 2023Extending Context Window of Large Language Models via Positional Interpolationcited by 740
  2. 2020Aligning AI With Shared Human Valuescited by 723
  3. 2023YaRN: Efficient Context Window Extension of Large Language Modelscited by 601
  4. 2023Ring Attention with Blockwise Transformers for Near-Infinite Contextcited by 457
  5. 2024∞Bench: Extending Long Context Evaluation Beyond 100K Tokenscited by 367
  6. 2023Effective Long-Context Scaling of Foundation Modelscited by 303
  7. 2024Massive Activations in Large Language Modelscited by 294
  8. 2023DeepSpeed Ulysses: System Optimizations for Enabling Training of Extreme Long Sequence Transformer Modelscited by 245
  9. 2023LongLoRA: Efficient Fine-tuning of Long-Context Large Language Modelscited by 244
  10. 2019A Study of BFLOAT16 for Deep Learning Trainingcited by 232
  11. 2024When Attention Sink Emerges in Language Models: An Empirical Viewcited by 208
  12. 2024Many-Shot In-Context Learningcited by 206
  13. 2020Rethinking Positional Encoding in Language Pre-trainingcited by 197
  14. 2024Data Engineering for Scaling Language Models to 128K Contextcited by 186
  15. 2024How to Train Long-Context Language Models (Effectively)cited by 146
  16. 2024Physics of Language Models: Part 3.3, Knowledge Capacity Scaling Lawscited by 144
  17. 2024LLM Maybe LongLM: Self-Extend LLM Context Window Without Tuningcited by 136
  18. 2023Unlimiformer: Long-Range Transformers with Unlimited Length Inputcited by 128
  19. 2021Sequence Parallelism: Long Sequence Training from System Perspectivecited by 126
  20. 2023Scaling Laws of RoPE-based Extrapolationcited by 125
  21. 2024HELMET: How to Evaluate Long-Context Language Models Effectively and Thoroughlycited by 125
  22. 2024Leave No Document Behind: Benchmarking Long-Context LLMs with Extended Multi-Doc QAcited by 122
  23. 2023Randomized Positional Encodings Boost Length Generalization of Transformerscited by 117
  24. 2024LongCite: Enabling LLMs to Generate Fine-grained Citations in Long-context QAcited by 81
  25. 2024One Thousand and One Pairs: A "novel" challenge for long-context language modelscited by 80
  26. 2024Attention Score is not All You Need for Token Importance Indicator in KV Cache Reduction: Value Also Matterscited by 73
  27. 2024What is Wrong with Perplexity for Long-context Language Modeling?cited by 69
  28. 2024Active-Dormant Attention Heads: Mechanistically Demystifying Extreme-Token Phenomena in LLMscited by 56
  29. 2024Base of RoPE Bounds Context Lengthcited by 52
  30. 2024Sparser is Faster and Less is More: Efficient Sparse Attention for Long-Range Transformerscited by 52
  31. 2024Can Perplexity Reflect Large Language Model's Ability in Long Text Understanding?cited by 45
  32. 2023CLEX: Continuous Length Extrapolation for Large Language Modelscited by 44
  33. 2024Resonance RoPE: Improving Context Length Generalization of Large Language Modelscited by 27
  34. 2024Analysing The Impact of Sequence Composition on Language Model Pre-Trainingcited by 25
  35. 2024StableMask: Refining Causal Masking in Decoder-only Transformercited by 20
  36. 2024LongSkywork: A Training Recipe for Efficiently Extending Context Length in Large Language Modelscited by 19
  37. 2022Lifelong and Continual Learning Dialogue Systemscited by 9
  38. 2024A Little Goes a Long Way: Efficient Long Context Training and Inference with Partial Contextscited by 9

50 most cited of 51 All 51 (JSON)

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2024: 1; 2025: 8; 2026: 6.

15 papers.

Sort:

By area: