Improving Long-Context Retrieval with Multi-Prefix Embedding

Zhenglin Yu, Xueguang Ma, Shengyao Zhuang, Zhichao Xu, Luyu Gao, Crystina Zhang, Jimmy LinarXiv 2026

TL;DR

Multi-Prefix Embedding (MPE) addresses the efficiency-accuracy trade-off in long-context text retrieval. By inserting EOS tokens between document chunks and encoding the text in a single causal forward pass, MPE extracts compact, contextualized multi-vector representations. This approach achieves fine-grained matching via MaxSim without the massive storage overhead of token-level methods or the context loss of independent chunking.

What Problem Does This Paper Address?

Retrieving relevant information from long documents (thousands of tokens) is a core challenge in modern information retrieval. Existing dense retrieval methods generally fall into three camps, each with a distinct drawback:

  1. Single-vector models: Compress an entire document into one vector. While highly efficient, this process loses fine-grained details and obscures localized evidence.
  2. Token-level multi-vector models (e.g., ColBERT): Retain representations for every single token. This preserves detail but results in massive index sizes and prohibitive storage costs.
  3. Chunk-based models: Split documents into chunks and encode them independently. This reduces costs but completely destroys cross-chunk context, requiring complex post-hoc aggregation.

The authors introduce Multi-Prefix Embedding (MPE) to bridge this gap, aiming to retain fine-grained matching and cross-chunk context while keeping storage requirements compact.

Methods

MPE leverages the causal attention mechanism of modern decoder-only language models. The core workflow consists of three main components:

  • EOS-Based Prefix Construction: A long document is partitioned into consecutive chunks of $m$ tokens. Crucially, an <eos> token is appended after each chunk. The entire sequence is then processed by a causal language model in a single forward pass. Because of the causal masking, the hidden state at each <eos> position naturally attends to its current chunk and all preceding chunks, creating a contextualized prefix embedding.
Figure 1: Multi-Prefix Embedding (MPE). A long docu- ment is split into chunks separated by EOS tokens and encoded in one causal forward pass. Prefix embeddings are extracted at EOS1, . . . , EOSK, and query–document relevance is computed via MaxSim.
  • MaxSim Scoring: At retrieval time, the similarity between a query $q$ and a document $p$ is computed using the MaxSim operator, which selects the maximum inner product between the query vector and any of the document's prefix embeddings.
  • Random Prefix-Length Augmentation (MPE-Rand): To prevent the model from overfitting to a specific chunk size, the authors introduce a training variation where the chunk length $m$ is randomly sampled from a uniform distribution ($m \sim U[m_{min}, m_{max}]$) for each passage. This allows a single trained model to generalize across various inference chunk sizes.

Datasets

The authors evaluated MPE across three long-context retrieval benchmarks:

  • MLDR-en: A long-document retrieval dataset containing documents up to 8,192 tokens. It was used for both fine-tuning and in-domain evaluation.
  • BrowseComp-Plus: A zero-shot out-of-domain benchmark consisting of 830 difficult web queries paired with human-verified supporting documents and mined hard negatives.
  • LongEmbed: A long-context evaluation suite where the authors tested on four real-document subsets: NarrativeQA, 2WikiMQA, SummScreen, and QMSum.

Key Insights and Ideas

  • Causal Attention is Essential: A key "aha moment" came from an ablation study where the authors replaced the causal self-attention mask with a bidirectional mask during fine-tuning. Performance on MLDR-en dropped significantly (nDCG@10 fell from 0.783 to 0.694). This proves that MPE's success relies heavily on the ordered, cumulative context provided by the pretrained causal structure, rather than just exposing the EOS tokens to more text.
  • Granularity Robustness via Randomization: Fixed-size MPE models suffer when the evaluation chunk size doesn't match the training chunk size. However, the randomized training strategy (MPE-Rand) successfully tracks the upper performance envelope of all fixed models using a single checkpoint.
Figure 2: Granularity mismatch on MLDR-en. Fixed- size MPE degrades under mismatched granularities, while MPE-Rand tracks the upper envelope with a single model. Star symbols denote matched train–eval sizes; circle symbols denote mismatched sizes.
  • Built-in Source Attribution: Because MaxSim identifies the specific prefix embedding that matches the query, MPE provides a natural mechanism for locating evidence. The MaxSim-selected chunk matched or was within $\pm1$ position of LLM-annotated answer spans in 65.7% of cases, showing a strong Spearman correlation ($\rho = 0.77$).

Key Results

The MPE framework was implemented on top of the Qwen3-Embedding-0.6B base model. Key quantitative findings include:

  • State-of-the-Art Dense Retrieval: MPE Fixed-64 achieved the highest dense retrieval score on MLDR-en (0.783 nDCG@10), outperforming single-vector (0.548) and independent chunking baselines like MaxP-Train (0.776).
  • Out-of-Domain Generalization: On BrowseComp-Plus, MPE-Rand[32, 1024] was the only multi-vector variant to outperform the single-vector baseline (0.153 vs. 0.132 nDCG@10).
  • Downstream Agent Benefits: When integrated into an end-to-end search agent powered by Gemini 3 Flash, replacing a single-vector retriever with MPE-Rand boosted final answer accuracy from 42.29% to 51.45% while simultaneously reducing the average number of retrieval calls.

Limitations and Future Work

While promising, the authors note several limitations:

  • Scale and Language: The evaluation was restricted to a single 0.6B parameter model and focused exclusively on English-language benchmarks. Scaling to larger models and multilingual contexts remains untested.
  • Storage Overhead: Although MPE requires significantly less storage than token-level late-interaction models, it still demands more storage than single-vector models. Future work will need to explore compression techniques like product quantization or adaptive prefix selection to ease deployment costs.
  • Evaluation Noise: The source attribution analysis relied on Gemini-generated answer spans rather than human gold-standard annotations, which introduces potential evaluation noise.

Summary updated

BibTeX
@misc{yu2026improving,
  author = {Zhenglin Yu and Xueguang Ma and Shengyao Zhuang and Zhichao Xu and Luyu Gao and Crystina Zhang and Jimmy Lin},
  title = {{Improving Long-Context Retrieval with Multi-Prefix Embedding}},
  year = {2026},
  eprint = {2606.23642},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.23642},
}
Figure