mlsanityData to 14 Oct 2026

U-NIAH: Unified RAG and LLM Evaluation for Long Context Needle-In-A-Haystack

arXiv 2503.00353 ↗First posted 1 Mar 2025cs.CL cs.IRcited by 20

On the map: Retrieval-augmented generation → RAG pipeline design and evaluation

Abstract (arXiv)

Recent advancements in Large Language Models (LLMs) have expanded their context windows to unprecedented lengths, sparking debates about the necessity of Retrieval-Augmented Generation (RAG). To address the fragmented evaluation paradigms and limited cases in existing Needle-in-a-Haystack (NIAH), this paper introduces U-NIAH, a unified framework that systematically compares LLMs and RAG methods in controlled long context settings. Our framework extends beyond traditional NIAH by incorporating multi-needle, long-needle, and needle-in-needle configurations, along with different retrieval settings, while leveraging the synthetic Starlight Academy dataset-a fictional magical universe-to eliminate biases from pre-trained knowledge. Through extensive experiments, we investigate three research questions: (1) performance trade-offs between LLMs and RAG, (2) error patterns in RAG, and (3) RAG's limitations in complex settings. Our findings show that RAG significantly enhances smaller LLMs by mitigating the "lost-in-the-middle" effect and improving robustness, achieving an 82.58% win-rate over LLMs. However, we observe that retrieval noise and reverse chunk ordering degrade performance, while surprisingly, advanced reasoning LLMs exhibit reduced RAG compatibility due to sensitivity to semantic distractors. We identify typical error patterns including omission due to noise, hallucination under high noise critical condition, and self-doubt behaviors. Our work not only highlights the complementary roles of RAG and LLMs, but also provides actionable insights for optimizing deployments. Code: https://github.com/Tongji-KGLLM/U-NIAH.

Key facts. Cited by 20 papers in the map (data through 14 Oct 2026). Placed in RAG pipeline design and evaluation, one of 15 directions in Retrieval-augmented generation. Builds on 36 of its 43 references that are in the map. First posted on arXiv 1 Mar 2025.

Builds on

36 of 43 references.

Closest ancestors · 6

Same direction, newest first

  1. 2024Long-Context LLMs Meet RAG: Overcoming Challenges for Long Inputs in RAG8 Oct
  2. 2024Modular RAG: Transforming RAG Systems into LEGO-like Reconfigurable Frameworks26 Jul
  3. 2024Retrieval Augmented Generation or Long-Context LLMs? A Comprehensive Study and Hybrid Approach23 Jul
  4. 2024ChatQA 2: Bridging the Gap to Proprietary LLMs in Long Context and RAG Capabilities19 Jul
  5. 2024Summary of a Haystack: A Challenge to Long-Context LLMs and RAG Systems1 Jul
  6. 2024The Power of Noise: Redefining Retrieval for RAG Systems26 Jan

Other references · 30

  1. 2024Qwen2.5 Technical Reportcited by 4,942
  2. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,455
  3. 2023GPQA: A Graduate-Level Google-Proof Q&A Benchmarkcited by 2,879
  4. 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,417
  5. 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,346
  6. 2023Extending Context Window of Large Language Models via Positional Interpolationcited by 740
  7. 2023A Prompt Pattern Catalog to Enhance Prompt Engineering with ChatGPTcited by 619
  8. 2024KVQuant: Towards 10 Million Context Length LLM Inference with KV Cache Quantizationcited by 591
  9. 2024LongBench v2: Towards Deeper Understanding and Reasoning on Realistic Long-context Multitaskscited by 379
  10. 2024∞Bench: Extending Long Context Evaluation Beyond 100K Tokenscited by 367
  11. 2024LongRoPE: Extending LLM Context Window Beyond 2 Million Tokenscited by 313
  12. 2024BABILong: Testing the Limits of LLMs with Long Context Reasoning-in-a-Haystackcited by 215
18 more
  1. 2024RankRAG: Unifying Context Ranking with Retrieval-Augmented Generation in LLMscited by 202
  2. 2024Leave No Context Behind: Efficient Infinite Context Transformers with Infini-attentioncited by 200
  3. 2022Self-Adaptive In-Context Learning: An Information Compression Perspective for In-Context Example Selection and Orderingcited by 161
  4. 2024Certifiably Robust RAG against Retrieval Corruptioncited by 151
  5. 2024Leave No Document Behind: Benchmarking Long-Context LLMs with Extended Multi-Doc QAcited by 122
  6. 2023Scaling Transformer to 1M tokens and beyond with RMTcited by 98
  7. 2023Dense X Retrieval: What Retrieval Granularity Should We Use?cited by 88
  8. 2024Beyond the Limits: A Survey of Techniques to Extend the Context Length in Large Language Modelscited by 76
  9. 2024Late Chunking: Contextual Chunk Embeddings Using Long-Context Embedding Modelscited by 73
  10. 2023Advancing Transformer Architecture in Long-Context Large Language Models: A Comprehensive Surveycited by 72
  11. 2024Needle In A Multimodal Haystackcited by 58
  12. 2024In Defense of RAG in the Era of Long-Context Language Modelscited by 53
  13. 2024LongRAG: A Dual-Perspective Retrieval-Augmented Generation Paradigm for Long-Context Question Answeringcited by 49
  14. 2023Extending Context Window of Large Language Models via Semantic Compressioncited by 45
  15. 2024Retrieve, Summarize, Plan: Advancing Multi-hop Question Answering with an Iterative Approachcited by 40
  16. 2024Long Context vs. RAG for LLMs: An Evaluation and Revisitscited by 26
  17. 2024Benchmarking and Building Long-Context Retrieval Models with LoCo and M2-BERTcited by 21
  18. 2024LLMs' Reading Comprehension Is Affected by Parametric Knowledge and Struggles with Hypothetical Statementscited by 12

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 10; 2026: 10.

20 papers.

Sort:

By area:

  1. 2025DeepSeek-R1 Thoughtology: Let's think about LLM Reasoningcited by 92
  2. 2025Retrieval Augmented Generation Evaluation in the Era of Large Language Models: A Comprehensive Surveycited by 20
  3. 2025LastingBench: Defend Benchmarks Against Knowledge Leakagecited by 14
  4. 2025Context Is What You Need: The Maximum Effective Context Window for Real World Limits of LLMscited by 12
  5. 2025A Survey of Scaling in Large Language Model Reasoningcited by 10
  6. 2025Hidden in the Haystack: Smaller Needles are More Difficult for LLMs to Findcited by 7
  7. 2025MultiRAG: A Knowledge-guided Framework for Mitigating Hallucination in Multi-source Retrieval Augmented Generationcited by 3
  8. 2025Context Engineering for Trustworthiness: Rescorla Wagner Steering Under Mixed and Inappropriate Contextscited by 3
  9. 2026HeteroCache: A Dynamic Retrieval Approach to Heterogeneous KV Cache Compression for Long-Context LLM Inferencecited by 3
  10. 2025MultiHal: Multilingual Dataset for Knowledge-Graph Grounded Evaluation of LLM Hallucinationscited by 2
  11. 2026RAGExplorer: A Visual Analytics System for the Comparative Diagnosis of RAG Systemscited by 2
  12. 2026To Isolate or to Score? Model-Adaptive Assessment for Cost-Efficient Multi-Agent RAGcited by 2
8 more
  1. 2026Addressable Recall Compaction for Long Context-Window Control in AI Agentscited by 2
  2. 2025Harnessing the Unseen: The Hidden Influence of Intrinsic Knowledge in Long-Context Language Modelscited by 1
  3. 2026Beyond Sequential Distance: Inter-Modal Distance Invariant Position Encodingcited by 1
  4. 2026Prompt Design at Scale: How Format, Instruction Count, and Context Length Shape Instruction Adherence and Hallucination in Large Language Modelscited by 1
  5. 2026Beyond the Needle's Illusion: Decoupled Evaluation of Evidence Access and Use under Semantic Interference at 326M-Token Scalecited by 0
  6. 2026Coordinated Semantic Alignment and Evidence Constraints for Retrieval-Augmented Generation with Large Language Modelscited by 0
  7. 2026EASE-TTT: Evidence-Aligned Selective Test-Time Training for Long-Context Question Answeringcited by 0
  8. 2026The Laws of Context Allocation: Causal Measurement and Closed-Loop Orchestration in Generative Searchcited by 0

Similar, not cited

Close in wording, no citation either way

  1. 2024Long Context RAG Performance of Large Language Models
  2. 2025LaRA: Benchmarking Retrieval-Augmented Generation and Long-Context LLMs -- No Silver Bullet for LC or RAG Routing
  3. 2025When Retrieval Succeeds and Fails: Rethinking Retrieval-Augmented Generation for LLMs
  4. 2024RAG Foundry: A Framework for Enhancing LLMs for Retrieval Augmented Generation
  5. 2023Retrieval-Augmented Generation for Large Language Models: A Survey
  6. 2024FlashRAG: A Modular Toolkit for Efficient Retrieval-Augmented Generation Research
  7. 2024CoFE-RAG: A Comprehensive Full-chain Evaluation Framework for Retrieval-Augmented Generation with Enhanced Data Diversity
  8. 2025Does RAG Really Perform Bad For Long-Context Processing?