Lost in the Haystack: Smaller Needles are More Difficult for LLMs to Find.
Large language models (LLMs) face significant challenges with needle-in-a-haystack tasks, where relevant information ("the needle") must be drawn from a large pool of irrelevant context ("the haystack"). Previous studies have highlighted positional bias and distractor quantity as critical factors affecting model performance, yet the influence of <i>gold context size</i> has received little attention. We address this gap by systematically studying how variations in gold context length impact LLM performance on long-context question answering tasks. Our experiments reveal that LLM performance drops sharply when the gold context is shorter, i.e., <b>smaller gold contexts consistently degrade model performance and amplify positional sensitivity,</b> posing a major challenge for agentic systems that must integrate scattered, fine-grained information of <i>varying lengths</i>. This pattern holds across three diverse domains (general knowledge, biomedical reasoning, and mathematical reasoning) and seven state-of-the-art LLMs of various sizes and architectures. Our work provides clear insights to guide the design of robust, context-aware LLM-driven systems.
Authors
- Chelsea X. Alvarado (ORCID: https://orcid.org/0000-0002-5973-7512)
- Mathew J. Koretsky (ORCID: https://orcid.org/0000-0003-4341-3991)
- Daniel Khashabi (ORCID: https://orcid.org/0009-0009-7664-2230)
- Faraz Faghri (ORCID: https://orcid.org/0000-0001-5744-8728)
- Maya Willey (ORCID: https://orcid.org/0009-0003-8282-4643)
- Nicole Kuznetsov (ORCID: https://orcid.org/0009-0005-9847-0282)
- T. K. Nayak
- Mike A. Nalls
- Owen Bianchi
Institutions
- National Institutes of Health (US)
- Johns Hopkins University (US)
- Data Tecnica International (United States) (US)
- Alzheimer Scotland (GB)
Publication Details
- Journal
- PubMed
- Published
- 2025-05-23
- Primary Topic
- Genetics, Bioinformatics, and Biomedical Research
- Type
- article
- Field-Weighted Citation Impact
- 0.00