arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2307.16645cs.CL
收藏

基于大型语言模型的句子嵌入扩展

Scaling Sentence Embeddings with Large Language Models

Beihang University(北京航空航天大学)

Ting Jiang, Shaohan Huang, Zhongzhi Luan, Deqing Wang, Fuzhen Zhuang

AI总结:

本文提出基于上下文学习的方法提升LLMs句子嵌入性能,发现无需微调即可媲美对比学习,且2.7B OPT结合提示方法在STS任务上超越4.8B ST5取得最优。

摘要:

大型语言模型(LLMs)最近引起了广泛关注。通过上下文学习,LLMs在各种自然语言任务中取得了令人瞩目的成果。然而,将LLMs应用于句子嵌入仍是一个持续研究的领域。在本研究中,我们提出了一种基于上下文学习的方法,旨在提升句子嵌入的性能。我们的方法包括:适配先前用于自回归模型的基于提示的表示方法,构建一个使LLMs能够进行上下文学习的演示集,并将LLMs扩展到不同的模型规模。通过大量实验发现,上下文学习使LLMs无需任何微调即可生成高质量的句子嵌入。这有助于LLMs取得与当前对比学习方法相媲美的性能。通过扩展模型规模,我们发现扩展到数百亿参数以上会损害在语义文本相似性(STS)任务上的性能。然而,最大的模型优于其他同类模型,并在迁移任务上取得了新的最优结果。我们还使用当前的对比学习方法对LLMs进行微调,2.7B OPT模型结合我们基于提示的方法,超越了4.8B ST5的性能,在STS任务上取得了新的最优结果。代码可在https://github.com/kongds/scaling_sentemb获取。

英文摘要:

Large language models (LLMs) have recently garnered significant interest. With in-context learning, LLMs achieve impressive results in various natural language tasks. However, the application of LLMs to sentence embeddings remains an area of ongoing research. In this work, we propose an in-context learning-based method aimed at improving sentence embeddings performance. Our approach involves adapting the previous prompt-based representation method for autoregressive models, constructing a demonstration set that enables LLMs to perform in-context learning, and scaling up the LLMs to different model sizes. Through extensive experiments, in-context learning enables LLMs to generate high-quality sentence embeddings without any fine-tuning. It helps LLMs achieve performance comparable to current contrastive learning methods. By scaling model size, we find scaling to more than tens of billion parameters harms the performance on semantic textual similarity (STS) tasks. However, the largest model outperforms other counterparts and achieves the new state-of-the-art result on transfer tasks. We also fine-tune LLMs with current contrastive learning approach, and the 2.7B OPT model, incorporating our prompt-based method, surpasses the performance of 4.8B ST5, achieving the new state-of-the-art results on STS tasks. Our code is available at https://github.com/kongds/scaling_sentemb.

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

↑