Manuscript Offprint

arXiv:2610.08463

UNREAL: Unifying Retrieval and Long-Context with a Single Model

Edan Kinderman, Elad Hoffer, Yochai Blau, Brian Chmiel, Ron Banner, Daniel Soudry, Boris Ginsburg

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

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 2Wiki-MultiHopQA, 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.

Nemotron-3.5-Lightning-30B-A3B

Qwen3.5-35B-A3B

Muse-Glimmer-30B

Figure

Figure 1: Exact match on question-answering as context length grows from 8K to 100M tokens. Full context evaluation is shown only until computationally infeasible. For retrieval-based methods, relevant context is first extracted from the input and then fed to the model to generate the answer. Unlike baselines that rely on external models, UNREAL leverages the frozen LLM's internal representations to retrieve relevant context, maintaining the highest accuracy across long context lengths.

1 INTRODUCTION

Modern LLMs often process contexts where relevant information is sparsely distributed. To isolate these key signals, evidence selection is done differently, depending on the scale. At long-context scale, selection is implicit and internal: the model receives the full context and must suppress irrelevant content while generating. This avoids having a separate retriever, but is vulnerable to distractors (Modarressi et al., 2025; Shi et al., 2023), and scaling it requires dedicated architectures, efficiency mechanisms, and long-context training. At larger, corpus scale, this selection is explicit and external: a separate retriever selects passages before generation (Lewis et al., 2020). This creates a two-model pipeline that must be trained, served, and kept aligned.

Despite being studied as alternative approaches (Xu et al., 2024; Li et al., 2024; 2025b; Lee et al., 2024), long-context and RAG perform the same operation: query-conditioned selection of candidate evidence. Only the scale differs, from hundreds of chunks in a prompt to millions in a corpus. This suggests that the strengths of both approaches can be combined: make selection internal, so evidence is ranked in the representation space of the model that will use it, and make selection explicit, so distractors are removed during generation (Yu et al., 2024a). We therefore ask: can a single pretrained LLM explicitly select evidence at both scales? An affirmative answer would make retrieval and long-context inference two scales of one mechanism rather than competing systems.

References (86)