mlsanityData to 14 Oct 2026

On the Emergence of Position Bias in Transformers

arXiv 2502.01951 ↗First posted 4 Feb 2025cs.LGcited by 59

Not on the map. Why?

Abstract (arXiv)

Recent studies have revealed various manifestations of position bias in transformer architectures, from the "lost-in-the-middle" phenomenon to attention sinks, yet a comprehensive theoretical understanding of how attention masks and positional encodings shape these biases remains elusive. This paper presents a graph-theoretic framework for analyzing position bias in multi-layer attention. Modeling attention masks as directed graphs, we quantify how tokens interact with contextual information based on their sequential positions. We uncover two key insights: First, causal masking inherently biases attention toward earlier positions, as tokens in deeper layers attend to increasingly more contextualized representations of earlier tokens. Second, we characterize the competing effects of the causal mask and relative positional encodings, such as the decay mask and rotary positional encoding (RoPE): while both mechanisms introduce distance-based decay within individual attention maps, their aggregate effect across multiple attention layersunicodex2013coupled with the causal maskunicodex2013leads to a trade-off between the long-term decay effects and the cumulative importance of early sequence positions. Through controlled numerical experiments, we not only validate our theoretical findings but also reproduce position biases observed in real-world LLMs. Our framework offers a principled foundation for understanding positional biases in transformers, shedding light on the complex interplay of attention mechanism components and guiding more informed architectural design.

Key facts. Cited by 59 papers in the map (data through 14 Oct 2026). Builds on 39 of its 50 references that are in the map. First posted on arXiv 4 Feb 2025.

Builds on

39 of 50 references.

References · 39

  1. 2017Attention Is All You Needcited by 60,361
  2. 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,305
  3. 2024The Llama 3 Herd of Modelscited by 14,715
  4. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
  5. 2023Judging LLM-as-a-Judge with MT-Bench and Chatbot Arenacited by 8,626
  6. 2019BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehensioncited by 5,893
  7. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
  8. 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,548
  9. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,455
  10. 2020Longformer: The Long-Document Transformercited by 3,413
  11. 2023Efficient Streaming Language Models with Attention Sinkscited by 2,186
  12. 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,434
27 more
  1. 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,392
  2. 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,135
  3. 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,103
  4. 2019How Contextual are Contextualized Word Representations? Comparing the Geometry of BERT, ELMo, and GPT-2 Embeddingscited by 784
  5. 2020Quantifying Attention Flow in Transformerscited by 775
  6. 2019Are Transformers universal approximators of sequence-to-sequence functions?cited by 406
  7. 2023The Impact of Positional Encoding on Length Generalization in Transformerscited by 327
  8. 2023Large Language Models are Zero-Shot Rankers for Recommender Systemscited by 309
  9. 2024Chain of Thought Empowers Transformers to Solve Inherently Serial Problemscited by 260
  10. 2019Representation Degeneration Problem in Training Natural Language Generation Modelscited by 255
  11. 2024When Attention Sink Emerges in Language Models: An Empirical Viewcited by 208
  12. 2022The Parallelism Tradeoff: Limitations of Log-Precision Transformerscited by 193
  13. 2023The mechanistic basis of data dependence and abrupt learning in an in-context classification taskcited by 118
  14. 2024Round and Round We Go! What makes Rotary Positional Encodings useful?cited by 115
  15. 2023Fast Attention Requires Bounded Entriescited by 102
  16. 2017Structured Attention Networkscited by 95
  17. 2024Transformers need glasses! Information over-squashing in language taskscited by 91
  18. 2022KERPLE: Kernelized Relative Positional Embedding for Length Extrapolationcited by 86
  19. 2020O(n) Connections are Expressive Enough: Universal Approximability of Sparse Transformerscited by 83
  20. 2024Found in the Middle: How Language Models Use Long Contexts Better via Plug-and-Play Positional Encodingcited by 72
  21. 2024Eliminating Position Bias of Language Models: A Mechanistic Approachcited by 65
  22. 2024Anisotropy Is Inherent to Self-Attention in Transformerscited by 63
  23. 2024Active-Dormant Attention Heads: Mechanistically Demystifying Extreme-Token Phenomena in LLMscited by 56
  24. 2024On the Role of Attention Masks and LayerNorm in Transformerscited by 48
  25. 2024One-layer transformers fail to solve the induction heads taskcited by 32
  26. 2024Serial Position Effects of Large Language Modelscited by 30
  27. 2021Multilingual Language Models Predict Human Reading Behaviorcited by 29

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 27; 2026: 32.

59 papers.

Sort:

By area:

  1. 2025Long-Context Generalization with Sparse Attentioncited by 21
  2. 2026Large Language Model Reasoning Failurescited by 21
  3. 2025Empirical Analysis of Decoding Biases in Masked Diffusion Modelscited by 19
  4. 2025Positional Biases Shift as Inputs Approach Context Window Limitscited by 9
  5. 2025Lost in the Middle: An Emergent Property from Information Retrieval Demands in LLMscited by 9
  6. 2025Graph-KV: Breaking Sequence via Injecting Structural Biases into Large Language Modelscited by 6
  7. 2025Over-squashing in Spatiotemporal Graph Neural Networkscited by 6
  8. 2025Beyond Early-Token Bias: Model-Specific and Language-Specific Position Effects in Multilingual LLMscited by 5
  9. 2025Fragile Preferences: A Deep Dive Into Order Effects in Large Language Modelscited by 5
  10. 2025DoPE: Denoising Rotary Position Embeddingcited by 5
  11. 2026A Structural Theory of Position Bias in Transformerscited by 5
  12. 2026EvoComp: Learning Visual Token Compression for Multimodal Large Language Models via Semantic-Guided Evolutionary Labelingcited by 5
38 more
  1. 2026ContextEcho: A Benchmark for Persona Drift in Long Agentic-Coding Sessionscited by 5
  2. 2025Assessing the Impact of Code Changes on the Fault Localizability of Large Language Modelscited by 4
  3. 2026Lost in the Middle at Birth: An Exact Theory of Transformer Position Biascited by 4
  4. 2025User-Assistant Bias in LLMscited by 3
  5. 2025Fine-grained Analysis of Brain-LLM Alignment through Input Attributioncited by 3
  6. 2025Natural Language Tools: A Natural Language Approach to Tool Calling In Large Language Agentscited by 3
  7. 2026Why Do LLMs Struggle in Strategic Play? Broken Links Between Observations, Beliefs, and Actionscited by 3
  8. 2026Irminsul: MLA-Native Position-Independent Caching for Agentic LLM Servingcited by 3
  9. 2025Sense and Sensitivity: Examining the Influence of Semantic Recall on Long Context Code Understandingcited by 2
  10. 2025Emergence of Primacy and Recency Effect in Mamba: A Mechanistic Point of Viewcited by 2
  11. 2025GRPOformer: Advancing Hyperparameter Optimization via Group Relative Policy Optimizationcited by 2
  12. 2025ParaScopes: What do Language Models Activations Encode About Future Text?cited by 2
  13. 2025Jailbreaking in the Haystackcited by 2
  14. 2025Accelerate Speculative Decoding with Sparse Computation in Verificationcited by 2
  15. 2026How Data Shapes RoPE Frequency Usage: From Positional Scale Matching to Length Generalizationcited by 2
  16. 2025Probability Consistency in Large Language Models: Theoretical Foundations Meet Empirical Discrepanciescited by 1
  17. 2025LayerNorm Induces Recency Bias in Transformer Decoderscited by 1
  18. 2025Understanding the Failure Modes of Transformers through the Lens of Graph Neural Networkscited by 1
  19. 2026Layer-wise Positional Bias in Short-Context Language Modelingcited by 1
  20. 2026Gender Bias in LLMs: Preliminary Evidence from Shared Parenting Scenario in Czech Family Lawcited by 1
  21. 2026Enhancing LLM-Based Data Annotation with Error Decompositioncited by 1
  22. 2026Context Cartography: Toward Structured Governance of Contextual Space in Large Language Model Systemscited by 1
  23. 2026Self-Describing Structured Data with Dual-Layer Guidance: A Lightweight Alternative to RAG for Precision Retrieval in Large-Scale LLM Knowledge Navigationcited by 1
  24. 2026Bias by Necessity: Impossibility Theorems for Sequential Processing with Convergent AI and Human Validationcited by 1
  25. 2026Logit-Attention Divergence: Mitigating Position Bias in Multi-Image Retrieval via Attention-Guided Calibrationcited by 1
  26. 2026Order Matters: LVLMs as Judges for Temporal Reasoning in Image Sequencescited by 1
  27. 2026Overwhelmed by Choice: Studying LLM Decision Making at Scalecited by 1
  28. 2025Token Homogenization under Positional Biascited by 0
  29. 2025Evaluation Framework for Highlight Explanations of Context Utilisation in Language Modelscited by 0
  30. 2025Struc-EMB: The Potential of Structure-Aware Encoding in Language Embeddingscited by 0
  31. 2025Enhanced MLLM Black-Box Jailbreaking Attacks and Defensescited by 0
  32. 2025Beyond Semantics: How Temporal Biases Shape Retrieval in Transformer and State-Space Modelscited by 0
  33. 2026On the Runway Cascade of Transformers for Language Modelingcited by 0
  34. 2026Probing Cultural Signals in Large Language Models through Author Profilingcited by 0
  35. 2026LLM-ReSum: A Framework for LLM Reflective Summarization through Self-Evaluationcited by 0
  36. 2026The Cost of Context: Mitigating Textual Bias in Multimodal Retrieval-Augmented Generationcited by 0
  37. 2026Continuity Laws for Sequential Modelscited by 0
  38. 2026Kinetic theory for Transformers and the lost-in-the-middle phenomenoncited by 0

50 most cited of 59 All 59 (JSON)