用假设查询嵌入提升检索排序,无需微调大模型
HyQE: Ranking Contexts with Hypothetical Query Embeddings
- 基于检索上下文生成假设查询,再比对原查询相似度
- 在多个基准上超越传统方法,性能提升显著
- 无需微调、高效可扩展,适合各类检索系统
在检索增强系统中,上下文排序常用于根据相关性重排检索结果。传统方法依赖嵌入空间中的查询与上下文相似度,但该方式难以准确捕捉相关性。虽有大语言模型(LLM)被用于排序,但在候选上下文增多时面临可扩展性问题,且受限于上下文窗口长度,还需领域数据微调。本文提出一种无需微调的可扩展排序框架,结合嵌入相似度与LLM能力:利用预训练LLM根据检索上下文生成假设查询,并以假设查询与真实查询的相似度对上下文排序。该方法推理高效,兼容多种检索与排序技术。实验表明,在多个基准上均取得更优性能。完整代码与数据见 https://github.com/zwc662/hyqe
原文摘要 · Abstract (English)
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. The complete code and data are available at https://github.com/zwc662/hyqe
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。