Skalierbares In-Context-Ranking mit generativen Modellen
Scalable In-context Ranking with Generative Models
October 6, 2025
papers.authors: Nilesh Gupta, Chong You, Srinadh Bhojanapalli, Sanjiv Kumar, Inderjit Dhillon, Felix Yu
cs.AI
papers.abstract
In-context Ranking (ICR) ist ein aufstrebendes Paradigma für Information Retrieval (IR), das das kontextuelle Verständnis von LLMs (Large Language Models) nutzt, indem die Aufgabenbeschreibung, Kandidatendokumente und die Anfrage direkt in den Eingabe-Prompt des Modells integriert werden und der LLM beauftragt wird, relevante Dokumente zu identifizieren. Obwohl dieser Ansatz effektiv ist, stellt die Effizienz eine erhebliche Herausforderung in diesem Paradigma dar, insbesondere wenn die Kandidatenliste aufgrund des quadratischen/super-linearen Skalierens der Aufmerksamkeitsoperation mit der Kontextlänge wächst. Vor diesem Hintergrund identifiziert dieses Papier zunächst inhärente und nutzbare Strukturen in der Aufmerksamkeit von LLMs, die für ICR feinabgestimmt wurden: (1) Inter-Dokument-Block-Sparsity: Die Aufmerksamkeit ist innerhalb jedes Dokumentblocks dicht, aber über verschiedene Dokumente im Kontext hinweg spärlich; und (2) Query-Dokument-Block-Relevanz: Die Aufmerksamkeitswerte bestimmter Anfrage-Tokens zu einem Dokumentblock in mittleren Schichten korrelieren stark mit der tatsächlichen Relevanz dieses Dokuments. Motiviert durch diese Beobachtungen führen wir BlockRank (Blockwise In-context Ranking) ein, eine neuartige Methode, die die Aufmerksamkeitsoperation in einem LLM anpasst, indem (a) die beobachtete Inter-Dokument-Block-Sparsity architektonisch durchgesetzt wird, wodurch die Komplexität der Aufmerksamkeit von quadratisch auf linear reduziert wird, ohne Leistungseinbußen, und (b) die Query-Dokument-Block-Relevanz für tatsächlich relevante Dokumente während des Feinabstimmens durch ein zusätzliches kontrastives Trainingsziel optimiert wird, was die Retrieval-Leistung in der Aufmerksamkeit verbessert. Experimente auf BEIR, MSMarco und NQ mit Mistral-7B zeigen, dass FLARE Mistral bestehende State-of-the-Art (SOTA) Listwise-Ranker und kontrolliert feinabgestimmte Baselines erreicht oder übertrifft, während es bei der Inferenz deutlich effizienter ist (4,7x für 100 MSMarco-Dokumente im Kontext) und sich elegant auf lange Kontext-Kurzlisten skaliert, etwa 500 Dokumente im Kontext (ca. 100K Kontextlänge) innerhalb einer Sekunde, und somit eine skalierbare und effektive Lösung für ICR darstellt.
English
In-context Ranking (ICR) is an emerging paradigm for Information Retrieval
(IR), which leverages contextual understanding of LLMs by directly
incorporating the task description, candidate documents, and the query into the
model's input prompt and tasking the LLM to identify relevant document(s).
While it is effective, efficiency is a significant challenge in this paradigm,
especially as the candidate list grows due to quadratic/super-linear scaling of
attention operation with context length. To this end, this paper first
identifies inherent and exploitable structures in the attention of LLMs
finetuned for ICR: (1) inter-document block sparsity: attention is dense within
each document block but sparse across different documents in the context; and
(2) query-document block relevance: the attention scores from certain query
tokens to a document block in middle layers strongly correlate with that
document's actual relevance. Motivated by these observations, we introduce
BlockRank (Blockwise In-context Ranking), a novel method that adapts the
attention operation in an LLM by (a) architecturally enforcing the observed
inter-document block sparsity, reducing attention complexity from quadratic to
linear without loss in performance, and (b) optimizing query-document block
relevance for true relevant documents during fine-tuning using an auxiliary
contrastive training objective, improving retrieval in attention. Experiments
on BEIR, MSMarco and NQ with Mistral-7B demonstrate that FLARE Mistral matches
or outperforms existing SOTA listwise rankers and controlled fine-tuned
baseline while being significantly more efficient at inference (4.7x for 100
MSMarco documents in context) and scaling gracefully to long-context
shortlists, around 500 documents in-context (approximately 100K context length)
within a second, presenting a scalable and effective solution for ICR.