TL;DR
While causal language models often get "lost in the middle," dense retrieval encoders suffer from a different bias: they dwell in the beginning. When documents are compressed into single dense vectors, embeddings disproportionately represent opening text, causing retrieval performance to collapse if key information appears later in the document.
What Problem Does This Paper Address?
Modern Transformer architectures can process thousands of tokens at once, but how effectively does a single dense vector embedding represent an entire long document?
Prior research in generative LLMs revealed a "lost in the middle" phenomenon, where models effectively recall information at the extreme start and end of context windows but ignore the middle. This paper asks whether similar positional biases affect dense retrieval models (bi-encoders) that map an entire document into a single vector, and investigates at which stage of training these biases emerge.
Methods
The authors analyze the standard multi-stage dense retrieval training recipe using a custom model, T5-2K:
- Architecture: A tied bi-encoder built on
T5-base, modified with Dynamic NTK-RoPE (Rotary Position Embeddings) to extend context length to 2,048 tokens and enable FlashAttention. The single-token decoder output serves as the pooled document representation. - Training Pipeline:
- Language Model Pre-training: Continuous span corruption (masking 15% of tokens in 3-token spans) on 8 billion tokens from MS-MARCO.
- Unsupervised Contrastive Pre-training: Contrastive loss on randomly cropped spans (10% to 50% length) within documents.
- Supervised Contrastive Fine-tuning: Fine-tuning on MS-MARCO using ANCE-MaxP hard negatives refreshed every two epochs over eight epochs.
- Diagnostic Probes:
- Passage Relocation: For 1,130 MS-MARCO queries, the known relevant passage was moved across 10 uniform insertion points from the document's start to its end.
- Sub-string Embedding Similarity: Documents were partitioned into 10 sequential 10% slices to measure cosine similarity between the full document embedding and each local slice.
- Span Corruption Probing: Measuring span reconstruction accuracy uniformly across 10 position windows.
Datasets
- MS-MARCO (v1) Document Dataset: Primary dataset used for continual pre-training, fine-tuning, and retrieval benchmarking.
- MS-MARCO Passage Dataset: Mapped via exact matching to identify specific relevant passage locations inside 75,000 training documents and 1,130 test documents.
- No new external datasets were released, but the authors introduce a position-shifting evaluation protocol and released their code and checkpoints.
Key Insights and Ideas
- "Dwell in the Beginning" vs. "Lost in the Middle": Unlike generative models that form a U-shaped attention curve, dense retrievers exhibit a monotonic decline in recall and MRR as relevant information is placed further down the text.
- The Bias Originates in Contrastive Learning, Not Language Modeling:
- Standard masked span prediction accuracy is completely uniform across the 2,048-token window.
- Positional bias appears immediately during unsupervised contrastive pre-training (random cropping), even when spans are sampled uniformly.
- Data Distribution Compounds the Effect: Web texts naturally follow an "inverted pyramid" journalistic structure where summaries and core topics appear early. In MS-MARCO, the median starting position of a relevant passage is just 746 characters into the document. Supervised fine-tuning heavily capitalizes on this prior, exacerbating the bias.
Key Results
- Retrieval Performance: T5-2K achieves competitive performance on the MS-MARCO document dev benchmark (0.414 MRR@100, 0.915 Recall@100), performing on par with specialized models like ADORE and SEED.
- Impact of Passage Position:
- When the relevant passage is placed at position 1 (start), MRR peaks at ~0.50 (for a 4-episode T5-2K model).
- Placing the relevant passage anywhere from position 2 to 10 causes performance to drop below the baseline to ~0.33 MRR.
- A similar drop occurs in RepLLaMA-7B, showing the phenomenon generalizes across model scales and decoder-only architectures.
- Embedding Alignment:
- Full-document embeddings have the highest cosine similarity (~0.85) with the first 10% of the document. Similarity steadily degrades to below ~0.65 for the final 10%.
- This holds regardless of whether the encoder uses decoder pooling or average token pooling.
Limitations and Future Work
- Tied Encoders: The study focuses primarily on tied bi-encoders (sharing weights between query and document encoders). Untied encoders may behave differently given query–document length asymmetry.
- English & Web Text Focus: Tests were conducted exclusively on English MS-MARCO documents. Other languages and non-web domains (e.g., scientific papers, legal contracts) might exhibit different structural characteristics.
- Mitigation Strategies: The authors suggest future work should focus on designing position-balanced contrastive pre-training objectives and evaluating on specialized long-context retrieval benchmarks like LoCo and DAPR.
Summary updated