HyQE: Ranking Contexts with Hypothetical Query Embeddings

Weichao Zhou, Jiaxin Zhang, Hilaf Hasson, Anu Singh, Wenchao Li


Abstract
In retrieval-augmented systems, context ranking techniques are commonly employed to reorder the retrieved contexts based on their relevance to a user query. A standard approach is to measure this relevance through the similarity between contexts and queries in the embedding space. However, such similarity often fails to capture the relevance. Alternatively, large language models (LLMs) have been used for ranking contexts. However, they can encounter scalability issues when the number of candidate contexts grows and the context window sizes of the LLMs remain constrained. Additionally, these approaches require fine-tuning LLMs with domain-specific data. In this work, we introduce a scalable ranking framework that combines embedding similarity and LLM capabilities without requiring LLM fine-tuning. Our framework uses a pre-trained LLM to hypothesize the user query based on the retrieved contexts and ranks the context based on the similarity between the hypothesized queries and the user query. Our framework is efficient at inference time and is compatible with many other retrieval and ranking techniques. Experimental results show that our method improves the ranking performance across multiple benchmarks.
Anthology ID:
2024.findings-emnlp.761
Volume:
Findings of the Association for Computational Linguistics: EMNLP 2024
Month:
November
Year:
2024
Address:
Miami, Florida, USA
Editors:
Yaser Al-Onaizan, Mohit Bansal, Yun-Nung Chen
Venue:
Findings
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
13014–13032
Language:
URL:
https://preview.aclanthology.org/add-emnlp-2024-awards/2024.findings-emnlp.761/
DOI:
10.18653/v1/2024.findings-emnlp.761
Bibkey:
Cite (ACL):
Weichao Zhou, Jiaxin Zhang, Hilaf Hasson, Anu Singh, and Wenchao Li. 2024. HyQE: Ranking Contexts with Hypothetical Query Embeddings. In Findings of the Association for Computational Linguistics: EMNLP 2024, pages 13014–13032, Miami, Florida, USA. Association for Computational Linguistics.
Cite (Informal):
HyQE: Ranking Contexts with Hypothetical Query Embeddings (Zhou et al., Findings 2024)
Copy Citation:
PDF:
https://preview.aclanthology.org/add-emnlp-2024-awards/2024.findings-emnlp.761.pdf
Software:
 2024.findings-emnlp.761.software.zip