U-NIAH: Unified RAG and LLM Evaluation for Long Context Needle-In-A-Haystack
Yunfan GaoYun XiongWenlong WuZijing HuangBLBohan Li
Haofen Wang Yunfan Gao
Yun Xiong
Wenlong Wu
Zijing Huang
BLBohan Li

Haofen Wang
+6
U-NIAH is a unified evaluation framework that compares LLMs and RAG in controlled long-context settings using synthetic data to avoid pretraining bias. It introduces multi-needle, long-needle, and needle-in-needle configurations. Experiments show RAG improves smaller LLMs by mitigating the "lost-in-the-middle" effect, achieving an 82.58% win-rate over LLMs, while retrieval noise and reverse chunk ordering degrade performance, and advanced reasoning LLMs have reduced RAG compatibility due to sensitivity to semantic distractors.

arXiv ·
· March 1, 2025