mlsanityData to 14 Oct 2026

Contrastive Prompting Enhances Sentence Embeddings in LLMs through Inference-Time Steering

arXiv 2505.12831 ↗First posted 19 May 2025cs.CLcited by 13

Not on the map. Why?

Abstract (arXiv)

Extracting sentence embeddings from large language models (LLMs) is a practical direction, as it requires neither additional data nor fine-tuning. Previous studies usually focus on prompt engineering to guide LLMs to encode the core semantic information of the sentence into the embedding of the last token. However, the last token in these methods still encodes an excess of non-essential information, such as stop words, limiting its encoding capacity. To this end, we propose a Contrastive Prompting (CP) method that introduces an extra auxiliary prompt to elicit better sentence embedding. By contrasting with the auxiliary prompt, CP can steer existing prompts to encode the core semantics of the sentence, rather than non-essential information. CP is a plug-and-play inference-time intervention method that can be combined with various prompt-based methods. Extensive experiments on Semantic Textual Similarity (STS) tasks and downstream classification tasks demonstrate that our method can improve the performance of existing prompt-based methods across different LLMs. Our code will be released at https://github.com/zifengcheng/CP.

Key facts. Cited by 13 papers in the map (data through 14 Oct 2026). Builds on 24 of its 47 references that are in the map. First posted on arXiv 19 May 2025.

Builds on

24 of 47 references.

References · 24

  1. 2017Attention Is All You Needcited by 60,361
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  3. 2024The Llama 3 Herd of Modelscited by 14,715
  4. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
  5. 2021SimCSE: Simple Contrastive Learning of Sentence Embeddingscited by 2,173
  6. 2023Representation Engineering: A Top-Down Approach to AI Transparencycited by 1,336
  7. 2023Inference-Time Intervention: Eliciting Truthful Answers from a Language Modelcited by 1,302
  8. 2023Steering Llama 2 via Contrastive Activation Additioncited by 1,085
  9. 2017SemEval-2017 Task 1: Semantic Textual Similarity - Multilingual and Cross-lingual Focused Evaluationcited by 1,001
  10. 2024NV-Embed: Improved Techniques for Training LLMs as Generalist Embedding Modelscited by 472
  11. 2021Sentence-T5: Scalable Sentence Encoders from Pre-trained Text-to-Text Modelscited by 463
  12. 2024LLM2Vec: Large Language Models Are Secretly Powerful Text Encoderscited by 404
12 more
  1. 2022One Embedder, Any Task: Instruction-Finetuned Text Embeddingscited by 333
  2. 2024Generative Representational Instruction Tuningcited by 233
  3. 2024IMAGDressing-v1: Customizable Virtual Dressingcited by 100
  4. 2023Self-Detoxifying Language Models via Toxification Reversalcited by 46
  5. 2024Fantastic Semantics and Where to Find Them: Investigating Which Layers of Generative LLMs Reflect Lexical Semanticscited by 44
  6. 2023BeLLM: Backward Dependency Enhanced Large Language Model for Sentence Embeddingscited by 32
  7. 2024Simple Techniques for Enhancing Sentence Embeddings in Generative Language Modelscited by 26
  8. 2024When Text Embedding Meets Large Language Model: A Comprehensive Surveycited by 19
  9. 2023Meaning Representations from Trajectories in Autoregressive Modelscited by 18
  10. 2024Token Prepending: A Training-Free Approach for Eliciting Better Sentence Embeddings from LLMscited by 18
  11. 2023Composition-contrastive Learning for Sentence Embeddingscited by 14
  12. 2024Multi-Prompting Decoder Helps Better Language Understandingcited by 2

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 5; 2026: 8.

13 papers.

Sort:

By area: