Abstract
This paper demonstrates that "pure" open-source Large Language Models (LLMs), such as LLaMA and Falcon, serve as powerful zero-shot document rankers when framed as Query Likelihood Models (QLMs). The authors reveal a counter-intuitive finding: standard instruction fine-tuning frequently degrades ranking performance unless the model is specifically trained on question-generation tasks. By leveraging base LLMs with hybrid retrieval and score interpolation, the proposed approach achieves results competitive with state-of-the-art supervised models on the BEIR benchmark.
Introduction
Effective document ranking in Information Retrieval (IR) typically necessitates extensive labeled datasets, such as MS MARCO. In the absence of such data, zero-shot methods become essential. A promising approach uses LLMs as Query Likelihood Models (QLMs). Rather than directly predicting relevance, a QLM estimates the probability of a query being generated given a specific document: $P(\text{query} | \text{document})$.
Previous research into zero-shot QLMs often utilized models like T0 or Flan-T5. However, these models were fine-tuned on tasks including question generation, which the authors argue constitutes "task leakage" because it closely mirrors the ranking objective. This study investigates whether LLMs trained solely on unsupervised next-token prediction (true zero-shot) can rank effectively and how subsequent instruction tuning affects this capability.
Methodology
The researchers transformed LLMs into document rankers using several strategies:
- QLM Scoring: Ranking is based on the average log-likelihood of the LLM generating query tokens, conditioned on a prompt and a candidate document.
- Genuine Zero-Shot Evaluation: Base models (LLaMA, Falcon) were compared against instruction-tuned variants (Alpaca, StableVicuna) to isolate the impact of fine-tuning.
- Score Interpolation: LLM-derived semantic scores were combined with BM25 keyword scores via a weighted sum, balancing deep semantic understanding with exact term matching.
- Hybrid First-Stage Retrieval: To provide a high-quality candidate pool, the authors combined BM25 with HyDE (Hypothetical Document Embeddings), which uses an LLM to generate a synthetic answer to a query for better initial retrieval.
- Few-Shot Prompting: A "Guided by Bad Questions" (GBQ) template was tested, providing only three examples of query-document pairs to evaluate the impact of minimal supervision.
Evaluation Framework
The study utilized a subset of the BEIR benchmark to assess cross-domain generalization:
- TRECC: News and web search.
- DBpedia: Entity-centric search.
- FiQA: Financial question answering.
- Robust04: General news archives.
Performance was measured using nDCG@10, focusing on the quality of the top-ranked results.
Analysis of Instruction Tuning and Task Leakage
A primary finding of the study is that instruction tuning can be detrimental to ranking performance. As shown in the comprehensive results table below, base models often outperform their tuned counterparts.
Key insights include:
- The Tuning Penalty: LLaMA-7B (Base) achieved an average nDCG@10 of 51.1, significantly higher than the 45.1 achieved by Alpaca-7B (Instruction-tuned). This suggests that general instruction tuning may cause models to over-prioritize task-following at the expense of document-content nuance.
- Task Leakage Confirmation: The strong performance of models like T0 and Flan-T5 is largely attributed to their exposure to question-generation tasks during fine-tuning, validating the authors' concerns regarding previous "zero-shot" claims.
- Base Models as Natural QLMs: Because base LLMs are optimized for next-token prediction across diverse contexts, they are inherently well-suited for estimating query likelihood without specialized training.
Key Results and Benchmarking
The proposed hybrid pipeline, combining BM25+HyDE retrieval with LLM-QLM re-ranking, demonstrated exceptional performance.
- State-of-the-Art Parity: The zero-shot Falcon-7B pipeline reached an average score of 55.9, surpassing supervised "transferred" retrievers like Contriever-msmarco (45.3).
- Few-Shot Efficiency: With just three examples, Falcon-7B improved to 58.5. This outperforms the monoT5-3B model (56.7), which is significantly larger and heavily fine-tuned on the MS MARCO dataset.
Limitations and Future Directions
Despite their strength, LLM-QLMs face several challenges:
- Logit Dependency: The method requires access to output probability distributions (logits), which is often restricted in closed-source APIs like GPT-4.
- Computational Overhead: Re-ranking candidates with large-scale models (7B to 40B parameters) is computationally intensive compared to traditional sparse or dense retrievers.
- Data Contamination: While using open-source models allows for better control, the possibility remains that some evaluation data existed in the massive pre-training corpora.
Future work will focus on improving the efficiency of these models for real-time applications and exploring methods to achieve similar performance without full logit access.
Summary updated