Schaalbare In-context Rangschikking met Generatieve Modellen
Scalable In-context Ranking with Generative Models
October 6, 2025
Auteurs: Nilesh Gupta, Chong You, Srinadh Bhojanapalli, Sanjiv Kumar, Inderjit Dhillon, Felix Yu
cs.AI
Samenvatting
In-context Ranking (ICR) is een opkomend paradigma voor informatiezoeken (IR) dat gebruikmaakt van het contextuele begrip van LLM's door de taakbeschrijving, kandidaatdocumenten en de zoekopdracht direct in de invoerprompt van het model op te nemen en de LLM de taak te geven relevante document(en) te identificeren. Hoewel het effectief is, vormt efficiëntie een aanzienlijke uitdaging in dit paradigma, vooral omdat de kandidaatlijst groeit door de kwadratische/super-lineaire schaling van de aandachtoperatie met de contextlengte. Daarom identificeert dit artikel eerst inherente en uitbuitbare structuren in de aandacht van LLM's die zijn afgestemd voor ICR: (1) inter-document bloksparsiteit: aandacht is dicht binnen elk documentblok maar spaarzaam tussen verschillende documenten in de context; en (2) query-document blokrelevantie: de aandachtsscores van bepaalde querytokens naar een documentblok in middelste lagen correleren sterk met de werkelijke relevantie van dat document. Gemotiveerd door deze observaties introduceren we BlockRank (Blockwise In-context Ranking), een nieuwe methode die de aandachtoperatie in een LLM aanpast door (a) architectonisch de waargenomen inter-document bloksparsiteit af te dwingen, waardoor de aandachtcomplexiteit wordt teruggebracht van kwadratisch naar lineair zonder prestatieverlies, en (b) de query-document blokrelevantie te optimaliseren voor echt relevante documenten tijdens het afstemmen met behulp van een aanvullende contrastieve trainingsdoelstelling, wat de retrieval in aandacht verbetert. Experimenten op BEIR, MSMarco en NQ met Mistral-7B tonen aan dat FLARE Mistral bestaande SOTA lijstgewijze rankers en gecontroleerde afgestemde baselines evenaart of overtreft, terwijl het aanzienlijk efficiënter is bij inferentie (4,7x voor 100 MSMarco-documenten in context) en soepel schaalt naar lange-context shortlists, ongeveer 500 documenten in context (ongeveer 100K contextlengte) binnen een seconde, wat een schaalbare en effectieve oplossing voor ICR biedt.
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.