← all concepts

BlockRank

A method that makes LLM in-context ranking scale to large candidate sets by exploiting the block-sparse structure of attention.

BlockRank is a method from UT Austin and Google that makes in-context ranking with LLMs fast enough for large candidate sets. Standard in-context ranking is quadratic in cost; BlockRank cuts that to roughly linear by restructuring how the model attends.

Three heatmaps illustrate sparse attention patterns focusing heavily on a single relevant document in the model middle layers.

It rests on two observations about a fine-tuned ranking model's attention: attention is dense within a document but sparse across documents, and certain end-of-query "retrieval heads" reliably point at the relevant document in the model's middle layers. BlockRank enforces that structure — document tokens attend only within their own document plus shared instructions, while query tokens attend to everything — and adds a contrastive training objective so query-to-document attention becomes a dependable relevance signal.

A diagram illustrating the BlockRank workflow, showing how prompt segmentation, structured attention, and a contrastive objective produce relevance scores.

The payoff is scale: it can rank up to 500 documents in under a second, runs about 4.7× faster than a fine-tuned Mistral-7B baseline, and matches or beats prior state of the art. For relevance engineering it's a glimpse of how generative retrieval stays affordable at web scale.

Paper: Scalable In-context Ranking with Generative Models

Related concepts

  1. In-Context Ranking
  2. Attention
  3. Relevance Engineering
  4. MUVERA


Method

Mentioned in