Where Relevance Emerges: A Layer-Wise Study of Internal Attention for Zero-Shot Re-Ranking

Haodong Chen, Shengyao Zhuang, Zheng Yao, Guido Zuccon, Teerapong Leelanupab

TL;DR

Using Large Language Models (LLMs) for zero-shot document re-ranking is highly effective but bottlenecked by the slow speed of text generation. This paper reveals that relevance signals follow a universal "bell-curve" distribution across LLM layers, peaking in the middle. By isolating these high-signal layers, the authors introduce Selective-ICR, a strategy that slashes inference latency by 30%–50% while maintaining or even improving ranking accuracy.

What Problem Does This Paper Address?

When using LLMs to rank a set of documents relative to a search query, traditional methods rely on generative scoring (asking the model to output a relevance score or label) or output logits. These approaches are computationally expensive, requiring multiple autoregressive decoding steps or numerous forward passes that scale with the number of documents.

A recent alternative, In-Context Re-ranking (ICR), extracts internal attention weights directly from a single forward pass, achieving $O(1)$ complexity relative to the number of candidates. However, existing ICR methods blindly aggregate attention signals across all transformer layers. This paper addresses two major gaps:

  1. Layer-wise contribution: Do all layers contribute equally to identifying relevance, or are some layers just adding noise?
  2. Framework comparison: How does internal attention stack up against traditional generation and likelihood-based scoring mechanisms under identical conditions?

Methods

The authors conduct a granular, layer-by-layer evaluation of internal attention weights to map the "relevance evolution" as information propagates through the model.

Based on their findings, they propose Selective-ICR, which utilizes a Center-Biased Interval Selection strategy. Instead of running the full forward pass through every layer of the LLM, Selective-ICR:

  • Identifies a Peak Layer (the single layer with the highest ranking performance).
  • Creates a compact aggregation window (e.g., 4 consecutive layers) anchored at the peak and extended toward the model's geometric center to capture clean semantic signals.
  • Terminates the forward pass early at the upper bound of this interval, completely skipping the remaining deeper layers of the model.
Illustration of Selective-ICR with Center-Biased Interval Selection

Additionally, the authors perform a comprehensive decoupling study, evaluating three scoring mechanisms (Generation, Likelihood, and Internal Attention) across two prominent ranking frameworks (Listwise and Setwise).

Datasets

The approach was evaluated across several diverse benchmarks:

  • TREC-DL (2019 and 2020): Used for the initial pilot study to map layer-wise performance.
  • BEIR Benchmark: Evaluated across 9 distinct datasets (including T-Covid, NFCorpus, DBPedia, SciFact, SciDocs, FiQA, FEVER, C-FEVER, and NQ) to test cross-domain generalizability.
  • BRIGHT Benchmark: A challenging, reasoning-intensive retrieval benchmark containing 1,385 real-world queries across 12 sub-domains (e.g., mathematics competitions, LeetCode, and formal logic) where simple keyword matching fails.

Key Insights and Ideas

  • The Universal Bell Curve: Across different model families (Llama 3.1, Mistral, Qwen3) and wildly different datasets, relevance signals consistently follow a bell curve. Early layers focus on surface-level/syntactic features, middle layers capture deep semantic relevance, and final layers specialize in next-token prediction.
Detailed layer-wise nDCG@10 trends across diverse BEIR tasks
  • The "Signal Dilution Effect": Indiscriminately averaging attention weights across all layers actually hurts performance. The strong, clean relevance signals from the middle layers get drowned out by the noise of the initial and final layers.
  • Reasoning Without RL: Precisely isolating internal attention signals allows smaller models to punch far above their weight class on complex reasoning tasks. It bypasses the need for massive model scaling or expensive reinforcement learning (RL) alignment.
  • Global vs. Local Context: Internal attention mechanisms inherently rely on "all-to-all" attention across the entire candidate set. As a result, they excel in single-pass, large-context listwise settings but struggle in iterative, localized frameworks like sliding windows or setwise sorting algorithms.

Key Results

  • Massive Speedups: By cutting off the forward pass early, Selective-ICR reduces core model inference latency (Forward Pass) by 35.6% to 51.5% and cuts end-to-end pipeline latency (Total Scoring) by 30.8% to 40.0%.
Efficiency gains of the Selective-ICR strategy
  • Maintained or Improved Accuracy: On the BEIR benchmark, larger models like Qwen3-4B and 8B saw significant performance boosts (nDCG@10 jumping from ~0.449 to over 0.473) by filtering out boundary-layer noise.
  • Superhuman Reasoning Performance: On the brutal BRIGHT benchmark, a zero-shot Llama 3.1 8B model using an optimized single layer (Oracle Peak-ICR) achieved an nDCG@10 of 0.2092, outperforming a 14B parameter model explicitly trained with reinforcement learning (Rank-R1-14B at 0.2050). Even the tiny Qwen3-0.6B model (0.1858) outperformed a GPT-4-based listwise reranker (0.1700).

Limitations and Future Work

  • Calibration Overhead: To eliminate intrinsic model biases (like position or syntax preferences), ICR requires a dual-pass calibration strategy using a content-free query (e.g., "N/A"). This introduces a constant computational overhead that partially offsets the savings of skipping token decoding.
  • Window Constraints: Internal attention signals degrade when forced into narrow local context windows, making them less compatible with iterative refinement strategies like bubblesort or heapsort.
  • Future Directions: The authors suggest exploring more granular, head-level selection strategies (isolating specific query-responsive attention heads rather than entire layers) and developing adaptive, dynamic layer-selection windows to further push the efficiency-effectiveness frontier.

Summary updated

BibTeX
@inproceedings{chen2026where,
  author = {Haodong Chen and Shengyao Zhuang and Zheng Yao and Guido Zuccon and Teerapong Leelanupab},
  title = {{Where Relevance Emerges: A Layer-Wise Study of Internal Attention for Zero-Shot Re-Ranking}},
  booktitle = {International ACM SIGIR Conference on Research and Development in Information Retrieval},
  year = {2026},
  doi = {10.1145/3805712.3808558},
}
Figure