UNREAL: Unifying Retrieval and Long-Context with a Single Model
Long-context inference and RAG both require selecting relevant evidence, but at very different scales—from a single long prompt to an entire corpus. The paper asks whether one model-internal mechanism can handle evidence selection across that full range.
UNREAL (UNifying REtrieval And Long-Context with a Single Model) is a model-native evidence selection framework. It encodes chunks and derives retrieval queries directly from the frozen LLM's internal representations, adds fewer than 500K trainable parameters, and leaves the backbone unchanged.
On a 3B-token, 21M-chunk Wikipedia index, all four dense and hybrid UNREAL backbones beat state-of-the-art retriever-reranker systems. The best model raises recall from 49.1% to 73.2% on HotpotQA, from 31.7% to 60.1% on 2WikiMultiHopQA, and from 8.8% to 14.4% on MuSiQue.
For long-context tasks, the same selection mechanism removes distractors before generation, raising NoLiMa accuracy from 1.0% to 24.83% at its maximum context length of 128K tokens and LV-Eval's F1 from 49.97% to 54.66% at 256K. UNREAL also reduces FLOPs and time-to-first-token relative to full-context inference from about 32K tokens onward, with larger gains as context grows.
The authors conclude that model-internal evidence selection can serve as a common foundation for both corpus retrieval and evidence-sparse long-context inference.