ReAttn: Improving Attention-based Re-ranking via Attention Re-weighting

Yuxing Tian, Fengran Mo, Weixu Zhang, Yiyan Qi, Jian-Yun Nie

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:

  1. 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.
  2. 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.
Figure 1: Illustration of two issues in attention-based re-ranking. (a) Signal concentration: the total atten- tion mass is heavily concentrated on a few tokens of a few documents, leaving most candidates with negligible attention scores. (b) Lexical bias: attention dispropor- tionately highlights tokens that are lexically similar to the query (e.g., producer, Jiang Wen), causing irrelevant documents with lexical overlap to the query to receive inflated relevance scores and misleading the 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:

  1. 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.
  2. 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

Abstract

The strong capabilities of recent Large Language Models (LLMs) have made them highly effective for zero-shot re-ranking task. Attention-based re-ranking methods, which derive relevance scores directly from attention weights, offer an efficient and interpretable alternative to generation-based re-ranking methods. However, they still face two major limitations. First, attention signals are highly concentrated a small subset of tokens within a few documents, making others indistinguishable. Second, attention often overemphasizes phrases lexically similar to the query, yielding biased rankings that irrelevant documents with mere lexical resemblance are regarded as relevant. In this paper, we propose \textbf{ReAttn}, a post-hoc re-weighting strategy for attention-based re-ranking methods. It first compute the cross-document IDF weighting to down-weight attention on query-overlapping tokens that frequently appear across the candidate documents, reducing lexical bias and emphasizing distinctive terms. It then employs entropy-based regularization to mitigate over-concentrated attention, encouraging a more balanced distribution across informative tokens. Both adjustments operate directly on existing attention weights without additional training or supervision. Extensive experiments demonstrate the effectiveness of our method.
BibTeX
@inproceedings{tian2026reattn,
  author = {Yuxing Tian and Fengran Mo and Weixu Zhang and Yiyan Qi and Jian-Yun Nie},
  title = {{ReAttn: Improving Attention-based Re-ranking via Attention Re-weighting}},
  booktitle = {EACL (Findings)},
  year = {2026},
  doi = {10.18653/v1/2026.findings-eacl.66},
}
Figure