TasksSotADatasetsPapersMethodsSubmitAbout
Papers With Code 2

A community resource for machine learning research: papers, code, benchmarks, and state-of-the-art results.

Explore

Notable BenchmarksAll SotADatasetsPapersMethods

Community

Submit ResultsAbout

Data sourced from the PWC Archive (CC-BY-SA 4.0). Built by the community, for the community.

Papers/Scaling Sentence Embeddings with Large Language Models

Scaling Sentence Embeddings with Large Language Models

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

2023-07-31Sentence EmbeddingSentence EmbeddingsSemantic Textual SimilarityContrastive LearningSTS
PaperPDFCode(official)

Abstract

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.

Results

TaskDatasetMetricValueModel
Semantic Textual SimilaritySTS14Spearman Correlation0.8585PromptEOL+CSE+LLaMA-30B
Semantic Textual SimilaritySTS14Spearman Correlation0.8534PromptEOL+CSE+OPT-13B
Semantic Textual SimilaritySTS14Spearman Correlation0.848PromptEOL+CSE+OPT-2.7B
Semantic Textual SimilaritySTS15Spearman Correlation0.9004PromptEOL+CSE+LLaMA-30B
Semantic Textual SimilaritySTS15Spearman Correlation0.8952PromptEOL+CSE+OPT-13B
Semantic Textual SimilaritySTS15Spearman Correlation0.8951PromptEOL+CSE+OPT-2.7B
Semantic Textual SimilaritySICKSpearman Correlation0.8238PromptEOL+CSE+LLaMA-30B
Semantic Textual SimilaritySICKSpearman Correlation0.8206PromptEOL+CSE+OPT-13B
Semantic Textual SimilaritySICKSpearman Correlation0.8129PromptEOL+CSE+OPT-2.7B
Semantic Textual SimilaritySTS13Spearman Correlation0.9025PromptEOL+CSE+LLaMA-30B
Semantic Textual SimilaritySTS13Spearman Correlation0.9024PromptEOL+CSE+OPT-13B
Semantic Textual SimilaritySTS13Spearman Correlation0.8964PromptEOL+CSE+OPT-2.7B
Semantic Textual SimilaritySTS BenchmarkSpearman Correlation0.8914PromptEOL+CSE+LLaMA-30B
Semantic Textual SimilaritySTS BenchmarkSpearman Correlation0.8856PromptEOL+CSE+OPT-13B
Semantic Textual SimilaritySTS BenchmarkSpearman Correlation0.8833PromptEOL+CSE+OPT-2.7B
Semantic Textual SimilaritySTS12Spearman Correlation0.802PromptEOL+CSE+OPT-13B
Semantic Textual SimilaritySTS12Spearman Correlation0.7972PromptEOL+CSE+LLaMA-30B
Semantic Textual SimilaritySTS12Spearman Correlation0.7949PromptEOL+CSE+OPT-2.7B
Semantic Textual SimilaritySTS16Spearman Correlation0.8627PromptEOL+CSE+LLaMA-30B
Semantic Textual SimilaritySTS16Spearman Correlation0.8591PromptEOL+CSE+OPT-2.7B
Semantic Textual SimilaritySTS16Spearman Correlation0.859PromptEOL+CSE+OPT-13B

Related Papers

From Neurons to Semantics: Evaluating Cross-Linguistic Alignment Capabilities of Large Language Models via Neurons Alignment2025-07-20SemCSE: Semantic Contrastive Sentence Embeddings Using LLM-Generated Summaries For Scientific Abstracts2025-07-17HapticCap: A Multimodal Dataset and Task for Understanding User Experience of Vibration Haptic Signals2025-07-17Overview of the TalentCLEF 2025: Skill and Job Title Intelligence for Human Capital Management2025-07-17SGCL: Unifying Self-Supervised and Supervised Learning for Graph Recommendation2025-07-17Similarity-Guided Diffusion for Contrastive Sequential Recommendation2025-07-16LLM-Driven Dual-Level Multi-Interest Modeling for Recommendation2025-07-15Latent Space Consistency for Sparse-View CT Reconstruction2025-07-15