Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Scaling Sentence Embeddings with Large Language Models

About

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.

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

Related benchmarks

TaskDatasetResultRank
Semantic Textual SimilaritySTS tasks (STS12, STS13, STS14, STS15, STS16, STS-B, SICK-R) various (test)
STS12 Score80.2
393
Sentence Classification Transfer TasksSentEval transfer tasks
Average Accuracy0.9209
99
Sentence ClassificationSentEval Transfer tasks (test)
MR0.9213
73
Semantic Textual SimilarityEnglish STS
Average Score79.08
68
Semantic Textual SimilaritySTS (Semantic Textual Similarity) 2012-2016 (test)
STS-12 Score60.89
57
Transfer LearningSentEval Transfer Learning Tasks (test)
MR90.63
52
Text EmbeddingMTEB
MTEB Score47.02
45
Transfer LearningSentEval Transfer tasks (test)
MR90.63
23
RetrievalLoCo 2048 tokens V1
NDCG@100.0438
12
RetrievalLoCo 4096 tokens V1
NDCG@1012.86
12
Showing 10 of 11 rows

Other info

Code

Follow for update