UNREAL: Unifying Retrieval and Long-Context with a Single Model
cs.CL, cs.IR, cs.LG
Submitted: 2026-10-06
Updated: 2026-10-06
License: http://creativecommons.org/licenses/by/4.0/
The gist: Long-context inference and Retrieval-Augmented Generation (RAG) handle evidence selection at vastly different scales, from a single long prompt to an entire corpus.
Abstract
Long-context inference and Retrieval-Augmented Generation (RAG) handle evidence selection at vastly different scales, from a single long prompt to an entire corpus. We ask whether a single model-internal mechanism can select evidence across this range. We introduce UNifying REtrieval And Long-Context with a Single Model (UNREAL), a model-native evidence selection framework to span corpus retrieval and long-context inference. UNREAL encodes chunks and derives retrieval queries directly from the frozen LLM's internal representations. It 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 outperform 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. Applied to 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 score from 49.97% to 54.66% at 256K. UNREAL also reduces FLOPs and time-to-first-token relative to full-context inference from roughly 32K tokens onward, with larger gains as context grows. Together, these results establish model-internal evidence selection as a common foundation for corpus retrieval and evidence-sparse long-context inference.
Sources
- Longformer: The Long-Document Transformer
- Mamba: Linear-Time Sequence Modeling with Selective State Spaces
- Retrieval from Within: An Intrinsic Capability of Attention-Based Models
- Hierarchical Sparse Attention Done Right: Toward Infinite Context Modeling
- Stateful Token Reduction for Long-Video Hybrid VLMs
- Long-Context LLMs Meet RAG: Overcoming Challenges for Long Inputs in RAG
- Can Long-Context Language Models Subsume Retrieval, RAG, SQL, and More?
- Search-o1: Agentic Search-Enhanced Large Reasoning Models
- Long Context vs. RAG for LLMs: An Evaluation and Revisits
- Retrieval Augmented Generation or Long-Context LLMs? A Comprehensive Study and Hybrid Approach
- MoBA: Mixture of Block Attention for Long-Context LLMs
- NoLiMa: Long-Context Evaluation Beyond Literal Matching
- Representation Learning with Contrastive Predictive Coding
- Large Language Models Can Be Easily Distracted by Irrelevant Context
- Layer by Layer: Uncovering Hidden Representations in Language Models
- DenseOn with the LateOn: Fully Open Dense and Late-Interaction Models for Multilingual, Long-Context, and Code Search
- Quest: Query-Aware Sparsity for Efficient Long-Context LLM Inference
- Efficient Streaming Language Models with Attention Sinks
- DeepSeek-V4: Towards Highly Efficient Million-Token Context Intelligence
- Retrieval meets Long Context Large Language Models
Related papers
- Exploring Solution Divergence and Its Effect on Large Language Model Problem Solving
- Ishigaki-IDS-Bench: A Benchmark for Generating Information Delivery Specification from BIM Information Requirements
- Subliminal Steering: Stronger Encoding of Hidden Signals
- MedStruct-S: A Benchmark for Key Discovery, Key-Conditioned QA and Semi-Structured Extraction from OCR Clinical Reports
- The End of Transformers? On Challenging Attention and the Rise of Sub-Quadratic Architectures
- Untangling the Mechanisms of Misleading Context in Medical Question Answering