Papers › Scaling Sentence Embeddings with Large Language Models

Scaling Sentence Embeddings with Large Language Models

31 Jul 2023arXiv:2307.16645archive 2025-07-28

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

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.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2307.16645")

Code

Syntology Ran 4 of 4 code samples harvested from 1 repository linked to this paper; 0 have no recorded run. Of those that ran: 4 ran with no contract checked.

By repository: official repository: 4 samples from 1 repository, 4 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

kongds/scaling_sentemb officialmentioned in paperpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

4 samples harvested; 4 ran; 0 honoured the contract we drafted; 0 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

4ran

Licence: 4 of the 4 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from kongds/scaling_sentemb. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

cal_avg_cosine kongds/scaling_sentemb/evaluation_with_multi_templates.py official repository ran no licence file found · pointer only · ab968085774a0a8d · report
generate_sentemb_prompt kongds/scaling_sentemb/ft_llm.py official repository ran no licence file found · pointer only · 541562fdc4531cd9 · report
get_delta kongds/scaling_sentemb/evaluation_with_multi_templates.py official repository ran no licence file found · pointer only · 083d6c8d62e4a0d5 · report
s_eval kongds/scaling_sentemb/evaluation_with_multi_templates.py official repository ran no licence file found · pointer only · 0a116d23cfc3e51b · report

Tasks

Contrastive LearningIn-Context LearningSTSSemantic Textual SimilaritySentenceSentence EmbeddingSentence Embeddings

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Semantic Textual Similarity SICK PromptEOL+CSE+LLaMA-30B Spearman Correlation 0.8238 #2 of 22 Archive leaderboard report
Semantic Textual Similarity SICK PromptEOL+CSE+OPT-13B Spearman Correlation 0.8206 #3 of 22 Archive leaderboard report
Semantic Textual Similarity SICK PromptEOL+CSE+OPT-2.7B Spearman Correlation 0.8129 #5 of 22 Archive leaderboard report
Semantic Textual Similarity STS Benchmark PromptEOL+CSE+LLaMA-30B Spearman Correlation 0.8914 #32 of 66 Archive leaderboard report
Semantic Textual Similarity STS Benchmark PromptEOL+CSE+OPT-13B Spearman Correlation 0.8856 #36 of 66 Archive leaderboard report
Semantic Textual Similarity STS Benchmark PromptEOL+CSE+OPT-2.7B Spearman Correlation 0.8833 #37 of 66 Archive leaderboard report
Semantic Textual Similarity STS12 PromptEOL+CSE+OPT-13B Spearman Correlation 0.8020 #1 of 20 Archive leaderboard report
Semantic Textual Similarity STS12 PromptEOL+CSE+LLaMA-30B Spearman Correlation 0.7972 #2 of 20 Archive leaderboard report
Semantic Textual Similarity STS12 PromptEOL+CSE+OPT-2.7B Spearman Correlation 0.7949 #4 of 20 Archive leaderboard report
Semantic Textual Similarity STS13 PromptEOL+CSE+LLaMA-30B Spearman Correlation 0.9025 #3 of 22 Archive leaderboard report
Semantic Textual Similarity STS13 PromptEOL+CSE+OPT-13B Spearman Correlation 0.9024 #4 of 22 Archive leaderboard report
Semantic Textual Similarity STS13 PromptEOL+CSE+OPT-2.7B Spearman Correlation 0.8964 #5 of 22 Archive leaderboard report
Semantic Textual Similarity STS14 PromptEOL+CSE+LLaMA-30B Spearman Correlation 0.8585 #2 of 21 Archive leaderboard report
Semantic Textual Similarity STS14 PromptEOL+CSE+OPT-13B Spearman Correlation 0.8534 #5 of 21 Archive leaderboard report
Semantic Textual Similarity STS14 PromptEOL+CSE+OPT-2.7B Spearman Correlation 0.8480 #6 of 21 Archive leaderboard report
Semantic Textual Similarity STS15 PromptEOL+CSE+LLaMA-30B Spearman Correlation 0.9004 #1 of 20 Archive leaderboard report
Semantic Textual Similarity STS15 PromptEOL+CSE+OPT-13B Spearman Correlation 0.8952 #3 of 20 Archive leaderboard report
Semantic Textual Similarity STS15 PromptEOL+CSE+OPT-2.7B Spearman Correlation 0.8951 #4 of 20 Archive leaderboard report
Semantic Textual Similarity STS16 PromptEOL+CSE+LLaMA-30B Spearman Correlation 0.8627 #4 of 20 Archive leaderboard report
Semantic Textual Similarity STS16 PromptEOL+CSE+OPT-2.7B Spearman Correlation 0.8591 #5 of 20 Archive leaderboard report
Semantic Textual Similarity STS16 PromptEOL+CSE+OPT-13B Spearman Correlation 0.8590 #6 of 20 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Contrastive LearningLLaMAOPT

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections