The Position Curse: LLMs Struggle to Locate the Last Few Items in a List
Not on the map. Why?
Abstract (arXiv)
Modern large language models (LLMs) can find a needle in a haystack (locating a single relevant fact buried among hundreds of thousands of irrelevant tokens) with near-saturated accuracy, yet fail to retrieve the last few items in a short list. We call this failure the Position Curse. For instance, even in a two-line code snippet, Claude Opus 4.6 misidentifies the second-to-last line most of the time. To characterize this failure, we evaluated two complementary queries: given a position in a sequence (of letters or words), retrieve the corresponding item; and given an item, return its position. Each position is specified as a forward or backward offset from an anchor, either an endpoint of the list (its start or end) or another item in the list. Across both open-source and frontier closed-source models, backward retrieval substantially lags forward retrieval. To test whether this capability can be rescued by post-training, we constructed PosBench, a position-focused training dataset. LoRA fine-tuning improves both forward and backward retrieval and generalizes to a held-out code-understanding benchmark (PyIndex), yet absolute performance remains far from saturated. As LLM coding agents increasingly operate over large codebases where precise indexing becomes essential for code understanding and editing, position-based retrieval emerges as a key capability for future pretraining objectives and model design.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 14 of its 22 references that are in the map. First posted on arXiv 8 May 2026.
Builds on
14 of 22 references.
References · 14
- 2017Attention Is All You Needcited by 60,361
- 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,380
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,455
- 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,417
- 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,346
- 2022Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 smallcited by 1,165
- 2014Neural Turing Machinescited by 644
- 2024∞Bench: Extending Long Context Evaluation Beyond 100K Tokenscited by 367
- 2023How do Language Models Bind Entities in Context?cited by 108
- 2026When Models Manipulate Manifolds: The Geometry of a Counting Taskcited by 46
- 2024Why Do Large Language Models (LLMs) Struggle to Count Letters?cited by 38
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2025Do RAG Systems Really Suffer From Positional Bias?
- 2026Positional Failures in Long-Context LLMs: A Blind Spot in Reasoning Benchmarks
- 2024Eliminating Position Bias of Language Models: A Mechanistic Approach
- 2024Where is the answer? Investigating Positional Bias in Language Model Knowledge Extraction
- 2024Position Engineering: Boosting Large Language Models through Positional Information Manipulation
- 2024Long-Context LLMs Meet RAG: Overcoming Challenges for Long Inputs in RAG
- 2025Positional Biases Shift as Inputs Approach Context Window Limits
- 2023Found in the Middle: Permutation Self-Consistency Improves Listwise Ranking in Large Language Models