TL;DR
ReAttn is a training-free, post-hoc adjustment strategy that improves how Large Language Models (LLMs) re-rank documents using internal attention weights. By applying cross-document IDF weighting and entropy-based regularization directly to existing attention layers, it successfully mitigates lexical bias and attention signal concentration, boosting retrieval accuracy with minimal computational overhead.
What Problem Does This Paper Address?
Modern information retrieval pipelines often use a two-stage approach: a fast initial retriever pulls a broad set of candidate documents, and a powerful re-ranker (like an LLM) refines the top results. While prompting an LLM to generate a re-ranked list is highly accurate, it is computationally expensive, slow, and sensitive to prompt design.
Attention-based re-ranking offers a faster, more interpretable alternative by using the LLM's internal attention weights as implicit relevance scores. However, the authors identify two major flaws in raw attention signals:
- Signal Concentration: Attention mass tends to collapse onto a tiny subset of tokens within just a few documents, leaving most other candidate documents with negligible scores and making them indistinguishable.
- Lexical Bias: LLMs naturally over-attend to exact word matches from the query. This causes irrelevant documents that happen to share superficial keywords to receive inflated relevance scores, misleading the final ranking.
Methods
ReAttn introduces a two-step, post-hoc re-weighting pipeline that operates directly on calibrated attention weights without requiring any additional training or supervision:
- Cross-Document IDF Weighting: To combat lexical bias, ReAttn calculates the document frequency of query tokens across the candidate document set. If a query term appears ubiquitously across almost all candidate documents, its attention weight is scaled down using a normalized Inverse Document Frequency (IDF) weight. This forces the model to rely on distinctive, semantically meaningful terms rather than generic keyword overlaps.
- Entropy-Based Regularization: To fix signal concentration, ReAttn measures the Shannon entropy of the token-level attention distribution within each document. High entropy indicates that attention is spread across multiple informative tokens (broad coverage), while low entropy signals an overly narrow focus on a few tokens. Document scores are adjusted based on their deviation from the average entropy, penalizing hyper-focused distractors and rewarding documents with well-distributed evidence.
Datasets
The authors evaluated ReAttn across two primary tasks using open-weight LLMs:
- Re-ranking: 11 diverse public datasets from the BEIR benchmark, including Natural Questions (NQ), COVID, NFCorpus, FiQA, SciFact, SciDocs, FEVER, Climate, DBPedia, and Robust04.
- Long-Context Reasoning: The LongMemEval and CLIPPER benchmarks, which evaluate an LLM's ability to retrieve and reason over extended contexts.
Key Insights and Ideas
- Attention is a noisy proxy for relevance: Raw attention weights carry intrinsic structural biases (such as favoring longer documents or punctuation) and superficial lexical preferences that do not align perfectly with true semantic relevance.
- Smaller models suffer more from attention collapse: The authors noted that smaller LLMs (like 3B parameters) exhibit sharper attention distributions, making them more vulnerable to signal concentration. ReAttn provides a vital stabilizing effect for these smaller architectures.
- Synergy of Lexical and Structural Fixes: Lexical bias and signal concentration are non-overlapping failure modes. Ablation studies showed that applying IDF adjustments alone helps on keyword-heavy datasets (like NQ), while entropy adjustments alone help on long-form text (like Robust04). Combining them yields consistent, robust improvements across all dataset types.
Key Results
- Consistent Performance Gains: ReAttn consistently improved upon baseline attention-based re-rankers (ICR and QRhead) across three different model families: Llama-3.2-3B, Llama-3.1-8B, and Qwen-2.5-7B.
- Outperforming Supervised Baselines: On the BEIR benchmark (measured via nDCG@10), adding ReAttn to the QRhead baseline pushed the average score to 50.9 using Llama-3.1-8B-Instruct. This training-free approach outperformed strong supervised cross-encoders like MSMARCO-MiniLM (48.0) and GTR-T5-base (45.2).
- Long-Context Robustness: In long-context reasoning tasks, ReAttn successfully boosted both retrieval recall and downstream end-to-end performance by preventing attention saturation over long token sequences, making it easier for the model to find sparse but crucial evidence.
Limitations and Future Work
- General-Purpose LLM Constraint: ReAttn was only evaluated on general-purpose, instruction-tuned LLMs. Its interaction with LLMs specifically fine-tuned for information retrieval—which possess distinct attention dynamics—remains unexplored.
- Coarse Head Aggregation: The method operates on aggregated attention scores post-hoc rather than dynamically filtering or weighting individual attention heads based on their specific functional roles during inference.
- English-Only Evaluation: The experiments were limited to English-language datasets. Assessing ReAttn's cross-lingual robustness and behavior across different linguistic typologies is a critical next step.
Summary updated