# Contrastive Retrieval Heads for Improved Attention-Based Reranking

*Linh Tran, Yulong Li, Radu Florian, Stacy Patterson, Ana Milanova, Wei Sun*

[NeurIPS page](https://neurips.cc/virtual/2026/poster/150870) · [OpenReview](https://openreview.net/forum?id=el3L9KxeOE) · [alphaXiv](https://www.alphaxiv.org/abs/2510.02219) · [Open on the map](../papers.html#p150870)

Category: [Efficient LLM Inference & Training](../pcat/14.md) › [Attention Optimization and Retrieval](../pgroup/693.md) · Type: new method · Keywords: attention head selection, contrastive scoring, list-wise reranking, efficient retrieval, transformer pruning

Areas: [LLM Reasoning](../areas/reasoning.md) › Efficient Reasoning › Sparse Attention; [Long Context](../areas/longcontext.md) › Long-context mechanisms › Long-context attention mechanisms

## Summary
CoRe heads identify a small subset of retrieval-specialized attention heads via contrastive scoring, yielding a training-free list-wise reranker that improves quality and efficiency.

## Explained to a 5-year-old
A computer program reads many documents to decide which ones are most useful. It does this by looking at each document with a special kind of brain inside the program. This brain is made of many small parts called attention heads that focus on different things. Some of those parts are noisy and point to the wrong things, which makes the ranking less accurate. To fix this, we teach the program a game that picks the brain parts that point to the right documents and ignores the noisy ones.

## Explained to a 5-year-old, longer
A computer program can read many documents and tell you which ones are most important. It does this by looking at each document with a special kind of brain inside the program. This brain is made of many small parts called attention heads that focus on different things. Some of those parts are noisy and point to the wrong things, which makes the ranking less accurate. To fix this, we give the program a game that rewards it for pointing to the right documents and punishes it for pointing to the wrong ones. The game helps the program learn which heads are good and which are noisy, without needing extra training. After playing the game, we keep only the good heads and discard the noisy ones. Using only the good heads makes the ranking more accurate and faster because there are fewer calculations. We also notice that the good heads are usually found in the middle layers of the brain, not at the very top or bottom. Because of this, we can skip many of the later layers, which saves even more time and memory. This way, the program can rank documents quickly while still giving good results. It also uses less computer power, so it can run on smaller machines.

## For a technical reader
The paper addresses the inefficiency of using all attention heads in transformer-based reranking models. It proposes a contrastive scoring function that evaluates each head’s ability to focus on relevant documents versus distractors. By selecting only the most discriminative heads, the system achieves comparable ranking performance with far fewer parameters. An empirical analysis shows that useful heads are concentrated in middle layers, allowing aggressive pruning of the final layers. The result is a training-free reranker that reduces inference latency and GPU memory usage while preserving accuracy.

## Problem
Attention-based rerankers use transformer attention patterns as retrieval signals, but many heads introduce noise and redundancy, limiting reranking quality and efficiency. This makes it difficult to extract the most useful attention heads for effective and efficient reranking.

## Method
The approach scores attention heads using a contrastive objective that rewards attention to relevant documents and penalizes attention to distractors, then selects a small subset of heads. These selected heads are used as retrieval signals in a list-wise reranker without any further training. Additionally, analysis shows that retrieval-relevant computation is sparse and localized in middle layers, enabling layer pruning for efficiency.

## Results
Fewer than 1% of attention heads account for most reranking performance across models and datasets, and these heads consistently concentrate in middle transformer layers. This localization enables aggressive layer pruning: removing the final 50% of transformer layers preserves nearly identical reranking accuracy while substantially reducing inference latency and GPU memory usage.

## Contributions
The paper introduces a contrastive scoring objective to identify highly discriminative retrieval heads, demonstrates that retrieval-relevant computation is sparse and layer-localized, and shows that pruning lower layers yields efficient reranking with minimal accuracy loss.

## Practical relevance
The approach enables faster and more memory-efficient reranking for large-scale retrieval systems, making it practical for deployment on limited hardware.

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. [Suggest a correction](../feedback/?on=p/150870)
