Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

Can Language Models Actually Retrieve In-Context? Drowning in Documents at Million Token Scale

About

Language models (LMs) raise an intriguing alternative to vector-based retrieval: conditioning on an in-context corpus and directly generating a relevant answer. However, prior work has largely focused on proprietary systems or the smaller-scale reranking task, leaving corpus-scale in-context retrieval largely unexplored. In this work, we present the first systematic study of in-context retrieval on two scales practical retrievers demand: million-token corpora and length-generalization far beyond training-time sizes. We first introduce BlockSearch, a 0.6B LM retriever whose architectural and training modifications improve over prior LM baselines and length-generalize up to 10 times beyond its training regime. Nevertheless, retrieval still collapses under more extreme extrapolation. We trace this failure to an attention dilution effect: as the corpus grows, irrelevant documents dominate the softmax denominator, reducing the normalized mass on the gold document even when its pre-softmax score stays high. Motivated by this analysis, we introduce length-aware adjustments to the attention softmax and document-level sparse attention. With these modifications, at the million-token scale, our model matches dense retrieval on widely studied benchmarks (e.g, MS MARCO and NQ), while outperforming the concurrent model MSA despite being 7 times smaller. Furthermore, it significantly outperforms dense retrieval on tasks requiring entirely different notions of similarity, such as LIMIT, achieving a 3 times higher score. Together, our results position in-context retrieval a promising alternative to classical retrieval while emphasizing attention control under extreme context growth as a new challenge.

Siddharth Gollapudi, Nilesh Gupta, Prasann Singhal, Sewon Min• 2026

Related benchmarks

TaskDatasetResultRank
Document RetrievalMS Marco
Recall@196.5
50
Document RetrievalHotpotQA
Recall@198.2
40
Information RetrievalNatural Questions
Recall@193.2
40
Lexical RetrievalNatural Questions
Recall@50.982
35
Lexical RetrievalHotpotQA
Recall@575
35
Lexical RetrievalMS Marco
Recall@599.8
35
Information RetrievalLIMIT small
Recall@10.439
9
Analogue RetrievalMath N=3.5k
R@185.2
7
Analogue RetrievalWriting N=4k
R@194.2
7
Descriptive RetrievalTwitter N=10k
R@10.1
7
Showing 10 of 14 rows

Other info

Follow for update