arXiv:2411.04539cs.IRcs.CL2024-11被引 6

将大模型的搜索排序能力迁移到小模型BERT,降低部署成本。

Best Practices for Distilling Large Language Models into BERT for Web Search Ranking

  • 用持续预训练和排序损失训练大模型,提取点击标题与摘要作为输出。
  • 通过混合点对点与边缘MSE损失,将大模型排序知识迁移到BERT类小模型。
  • 已在商用搜索引擎上线,适合资源受限的工业级搜索系统。

近期研究显示大型语言模型(LLMs)可作为零样本相关性排序器,通过提示学习评估查询与文档的相关性并生成排序列表。尽管潜力巨大,但其高昂的计算成本阻碍了在商业搜索系统中的直接应用。为突破这一瓶颈并充分利用LLMs的排序能力,本文探索将大模型的排序知识迁移到类似BERT的紧凑模型中,采用排序损失实现低资源模型的部署。具体方法包括:通过持续预训练,以查询为输入,点击标题与摘要为输出训练大模型;再使用排序损失对大模型进行监督微调,将最终标记</s>作为整句代表性表示。鉴于自回归语言模型特性,仅末尾标记能捕捉全部前序信息。此外,引入混合点对点与边际MSE损失,实现从大模型到小模型如BERT的知识迁移。离线与在线评估均验证了该方法的有效性,模型已于2024年2月成功集成至商用网页搜索系统。

原文摘要 · Abstract (English)

Recent studies have highlighted the significant potential of Large Language Models (LLMs) as zero-shot relevance rankers. These methods predominantly utilize prompt learning to assess the relevance between queries and documents by generating a ranked list of potential documents. Despite their promise, the substantial costs associated with LLMs pose a significant challenge for their direct implementation in commercial search systems. To overcome this barrier and fully exploit the capabilities of LLMs for text ranking, we explore techniques to transfer the ranking expertise of LLMs to a more compact model similar to BERT, using a ranking loss to enable the deployment of less resource-intensive models. Specifically, we enhance the training of LLMs through Continued Pre-Training, taking the query as input and the clicked title and summary as output. We then proceed with supervised fine-tuning of the LLM using a rank loss, assigning the final token as a representative of the entire sentence. Given the inherent characteristics of autoregressive language models, only the final token </s> can encapsulate all preceding tokens. Additionally, we introduce a hybrid point-wise and margin MSE loss to transfer the ranking knowledge from LLMs to smaller models like BERT. This method creates a viable solution for environments with strict resource constraints. Both offline and online evaluations have confirmed the efficacy of our approach, and our model has been successfully integrated into a commercial web search engine as of February 2024.

大模型蒸馏搜索排序BERT迁移资源优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。