TL;DR
State-of-the-art long-document embedding models suffer from severe positional and language biases, heavily favoring early content and high-resource languages like English. This paper introduces a permutation-based evaluation framework to quantify these biases and proposes a training-free, inference-time attention calibration method that redistributes attention to ensure fairer representation of all document segments.
What Problem Does This Paper Address?
Text embedding models are the backbone of modern search engines and Retrieval-Augmented Generation (RAG) systems, mapping documents into a vector space where cosine similarity determines what gets retrieved. However, when dealing with long documents composed of multiple distinct parts (e.g., a legal document with appendices, or a newspaper page with multiple independent articles), standard embedding models exhibit a pronounced "first-position bias." They prioritize information at the very beginning of the text, rendering later sections virtually invisible to semantic search.
Compounding this issue is a language bias: models inherently favor high-resource languages like English. The authors formalize this challenge as Information Representation Fairness—the principle that every segment of a multi-part document should contribute equally to its final embedding vector, regardless of its position or language.
Methods
The authors tackle the problem through a combination of systematic evaluation and a novel algorithmic fix:
- Permutation-Based Framework: To isolate position and language from the actual text content, the authors shuffle the order of document segments across all possible permutations ($n!$). This ensures that content differences do not act as confounding factors.
- Fairness Metrics: They define two core metrics:
- Positional Fairness: Measures how similar the global document embedding is to each standalone segment embedding.
- Information Retention: Measures how much a segment's semantic meaning changes when it is contextualized inside a larger document.
- Inference-Time Attention Calibration: For models using start-of-sequence (
<s>) token pooling, the authors find that the pooling token's attention is heavily front-loaded. To fix this without expensive retraining, they partition the document into fixed-size token "baskets" and mathematically enforce a uniform attention mass across all baskets during the forward pass. This approach requires only two forward passes and zero additional training.
Datasets
The authors constructed a multilingual comparable corpus using topic-aligned Wikipedia articles across six languages:
- High-resource: English (
en), Chinese (zh), German (de), Italian (it) - Lower-resource: Korean (
ko), Hindi (hi)
Each segment consists of a Wikipedia article containing between 1,000 and 2,000 tokens. These segments are concatenated to form synthetic long documents up to the models' maximum context length of 8,192 tokens.
Key Insights and Ideas
- The L-Shaped Bias: In monolingual settings, both evaluated models (mGTE and jina-v3) show a drastic drop-off in representation after the first segment, creating an L-shaped profile. Information in the second or third position is severely marginalized.
- Language Dominates Position: High-resource languages (especially English) are highly resilient to positional decay. If an English segment is placed at the end of a document where the earlier segments are in a lower-resource language, the model's language preference counteracts the positional bias, sometimes over-representing the late English segment at the expense of the rest.
- Attention is the Culprit: In
<s>-pooled models, the self-attention mechanism allocates the vast majority of its budget to the first 128 tokens, explaining why the first segment dominates the final vector.
Key Results
- Quantifying the Bias: In uncalibrated monolingual settings using mGTE, the baseline similarity for the first segment is high (~0.94 for German), but drops sharply by more than 0.50 for segments in the second and third positions.
- Calibration Success: The proposed attention calibration method successfully flattens the representation profiles across all positions. It decreases the over-representation of the first segment while significantly boosting the similarity scores of later segments.
- Preserving Semantics: Control experiments verified that altering the attention weights does not cause semantic collapse; instead, it preserves or improves the semantic fidelity of later positions.
Limitations and Future Work
- Proxy Metrics: The study relies on cosine similarity between global and standalone embeddings as a proxy for representation, which may not perfectly capture the intrinsic information contribution of a segment.
- Model Architecture Scope: The analysis and calibration method are restricted to encoder-based models and primarily optimized for
<s>-token pooling. Its effectiveness on decoder-based models or alternative pooling strategies (like late chunking) remains an open question. - Synthetic vs. Real-World Data: The evaluation uses clean, structured Wikipedia articles. Real-world long documents like legal briefs, financial reports, or textbook chapters possess different structural conventions and noise profiles that warrant further study.
Summary updated