arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.03552cs.CLcs.IR
收藏

交叉编码器能产生有用的句子嵌入吗?

Can Cross Encoders Produce Useful Sentence Embeddings?

IBM(国际商业机器公司(IBM))

Haritha Ananthakrishnan, Julian Dolby, Harsha Kokel, Horst Samulowitz, Kavitha Srinivas

AI总结:

本文发现交叉编码器早期层的嵌入可用于信息检索,并提出利用交叉编码器蒸馏轻量双编码器的方法,在保持效果的同时实现5.15倍推理加速。

摘要:

交叉编码器(CEs)使用句子对进行训练,以检测相关性。由于交叉编码器在推理时需要句子对,主流观点认为它们只能用作信息检索流程中的重排序器。相反,双编码器(DEs)用于对句子进行嵌入,在训练时句子对由两个权重共享的独立编码器编码,并通过损失函数确保若句子相关,则句子对的嵌入在向量空间中彼此接近。然而,双编码器需要大得多的数据集来训练,且准确率低于交叉编码器。我们报告了一个有趣的发现:交叉编码器较早层的嵌入实际上可以用于信息检索流程中。我们展示了如何利用交叉编码器蒸馏出一个更轻量的双编码器,推理时间实现了5.15倍的加速。

英文摘要:

Cross encoders (CEs) are trained with sentence pairs to detect relatedness. As CEs require sentence pairs at inference, the prevailing view is that they can only be used as re-rankers in information retrieval pipelines. Dual encoders (DEs) are instead used to embed sentences, where sentence pairs are encoded by two separate encoders with shared weights at training, and a loss function that ensures the pair's embeddings lie close in vector space if the sentences are related. DEs however, require much larger datasets to train, and are less accurate than CEs. We report a curious finding that embeddings from earlier layers of CEs can in fact be used within an information retrieval pipeline. We show how to exploit CEs to distill a lighter-weight DE, with a 5.15x speedup in inference time.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑