HyperAIHyperAI

Command Palette

Search for a command to run...

3 months ago

Scaling Sentence Embeddings with Large Language Models

Ting Jiang Shaohan Huang Zhongzhi Luan Deqing Wang Fuzhen Zhuang

Scaling Sentence Embeddings with Large Language Models

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.

Code Repositories

kongds/scaling_sentemb
Official
pytorch

Benchmarks

BenchmarkMethodologyMetrics
semantic-textual-similarity-on-sickPromptEOL+CSE+OPT-13B
Spearman Correlation: 0.8206
semantic-textual-similarity-on-sickPromptEOL+CSE+OPT-2.7B
Spearman Correlation: 0.8129
semantic-textual-similarity-on-sickPromptEOL+CSE+LLaMA-30B
Spearman Correlation: 0.8238
semantic-textual-similarity-on-sts-benchmarkPromptEOL+CSE+LLaMA-30B
Spearman Correlation: 0.8914
semantic-textual-similarity-on-sts-benchmarkPromptEOL+CSE+OPT-13B
Spearman Correlation: 0.8856
semantic-textual-similarity-on-sts-benchmarkPromptEOL+CSE+OPT-2.7B
Spearman Correlation: 0.8833
semantic-textual-similarity-on-sts12PromptEOL+CSE+LLaMA-30B
Spearman Correlation: 0.7972
semantic-textual-similarity-on-sts12PromptEOL+CSE+OPT-13B
Spearman Correlation: 0.8020
semantic-textual-similarity-on-sts12PromptEOL+CSE+OPT-2.7B
Spearman Correlation: 0.7949
semantic-textual-similarity-on-sts13PromptEOL+CSE+LLaMA-30B
Spearman Correlation: 0.9025
semantic-textual-similarity-on-sts13PromptEOL+CSE+OPT-13B
Spearman Correlation: 0.9024
semantic-textual-similarity-on-sts13PromptEOL+CSE+OPT-2.7B
Spearman Correlation: 0.8964
semantic-textual-similarity-on-sts14PromptEOL+CSE+OPT-13B
Spearman Correlation: 0.8534
semantic-textual-similarity-on-sts14PromptEOL+CSE+OPT-2.7B
Spearman Correlation: 0.8480
semantic-textual-similarity-on-sts14PromptEOL+CSE+LLaMA-30B
Spearman Correlation: 0.8585
semantic-textual-similarity-on-sts15PromptEOL+CSE+OPT-2.7B
Spearman Correlation: 0.8951
semantic-textual-similarity-on-sts15PromptEOL+CSE+OPT-13B
Spearman Correlation: 0.8952
semantic-textual-similarity-on-sts15PromptEOL+CSE+LLaMA-30B
Spearman Correlation: 0.9004
semantic-textual-similarity-on-sts16PromptEOL+CSE+LLaMA-30B
Spearman Correlation: 0.8627
semantic-textual-similarity-on-sts16PromptEOL+CSE+OPT-13B
Spearman Correlation: 0.8590
semantic-textual-similarity-on-sts16PromptEOL+CSE+OPT-2.7B
Spearman Correlation: 0.8591

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp
Scaling Sentence Embeddings with Large Language Models | Papers | HyperAI