Contrastive Prompting Enhances Sentence Embeddings in LLMs through Inference-Time Steering
Zifeng Cheng, Zhonghui Wang, Yuchen Fu, Zhiwei Jiang, Yafeng Yin, Cong Wang, Qing Gu
摘要
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 plugand-play inference-time intervention method that can be combined with various promptbased 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 .
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 10 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- One Embedder, Any Task: Instruction-Finetuned Text Embeddings 引用了 SimCSE: Simple Contrastive Learning of Sentence Embeddings
- One Embedder, Any Task: Instruction-Finetuned Text Embeddings 引用了 Sentence-T5: Scalable Sentence Encoders from Pre-trained Text-to-Text Models
- LLM-based Embeddings: Attention Values Encode Sentence Semantics Better Than Hidden States 引用了 Sentence-T5: Scalable Sentence Encoders from Pre-trained Text-to-Text Models
- Steering When Necessary: Flexible Steering Large Language Models with Backtracking 引用了 Inference-Time Intervention: Eliciting Truthful Answers from a Language Model
- Steering When Necessary: Flexible Steering Large Language Models with Backtracking 引用了 Advanced Sign Language Video Generation with Compressed and Quantized Multi-Condition Tokenization
- PromptBERT: Improving BERT Sentence Embeddings with Prompts 引用了 SimCSE: Simple Contrastive Learning of Sentence Embeddings
- Sentence-T5: Scalable Sentence Encoders from Pre-trained Text-to-Text Models 引用了 SimCSE: Simple Contrastive Learning of Sentence Embeddings
- Hierarchical Token Prepending: Enhancing Information Flow in Decoder-based LLM Embeddings 引用了 PromptBERT: Improving BERT Sentence Embeddings with Prompts
- Hierarchical Token Prepending: Enhancing Information Flow in Decoder-based LLM Embeddings 引用了 SimCSE: Simple Contrastive Learning of Sentence Embeddings
- Hierarchical Token Prepending: Enhancing Information Flow in Decoder-based LLM Embeddings 引用了 Sentence-T5: Scalable Sentence Encoders from Pre-trained Text-to-Text Models
引用它的顶会 Paper10
- Advanced Sign Language Video Generation with Compressed and Quantized Multi-Condition TokenizationCong Wang, Zexuan Deng, Zhiwei Jiang, Yafeng Yin 等NeurIPS 2025 · 13 次引用
- Steering When Necessary: Flexible Steering Large Language Models with BacktrackingZifeng Cheng, Jinwei Gan, Zhiwei Jiang, Cong Wang 等NeurIPS 2025 · 9 次引用
- Hierarchical Token Prepending: Enhancing Information Flow in Decoder-based LLM EmbeddingsXueying Ding, Xingyue Huang, Mingxuan Ju, Liam Collins 等ACL 2026 · 3 次引用
- LLM-based Embeddings: Attention Values Encode Sentence Semantics Better Than Hidden StatesYeqin Zhang, Yunfei Wang, Jiaxuan Chen, Ke Qin 等ICML 2026 · 1 次引用
- Beyond Step Pruning: Information Theory Based Step-level Optimization for Self-Refining Large Language ModelsJinman Zhao, Erxue Min, Hui Wu, Ziheng Li 等AAAI 2026 · 1 次引用
它引用的 Paper14
- SimCSE: Simple Contrastive Learning of Sentence EmbeddingsTianyu Gao, Xingcheng Yao, Danqi ChenEMNLP 2021 · 2,496 次引用
- Inference-Time Intervention: Eliciting Truthful Answers from a Language ModelKenneth Li, Oam Patel, Fernanda B. Viégas, Hanspeter Pfister 等NeurIPS 2023 · 1,549 次引用
- Sentence-T5: Scalable Sentence Encoders from Pre-trained Text-to-Text ModelsJianmo Ni, Gustavo Hernández Ábrego, Noah Constant, Ji Ma 等ACL Findings 2022 · 358 次引用
- PromptBERT: Improving BERT Sentence Embeddings with PromptsTing Jiang, Jian Jiao, Shaohan Huang, Zihan Zhang 等EMNLP 2022 · 148 次引用
- One Embedder, Any Task: Instruction-Finetuned Text EmbeddingsHongjin Su, Weijia Shi, Jungo Kasai, Yizhong Wang 等ACL Findings 2023 · 134 次引用
相关 Paper
- Focusing Condition: Inference-Time Self-Contrastive Steering Elicits Better Conditional Text Embeddings in LLMsZifeng Cheng, Lingyun Qian, Zhiwei Jiang, Cong Wang 等ACL 2026
- Scaling Sentence Embeddings with Large Language ModelsTing Jiang, Shaohan Huang, Zhongzhi Luan, Deqing Wang 等EMNLP Findings 2024 · 61 次引用
- Token Prepending: A Training-Free Approach for Eliciting Better Sentence Embeddings from LLMsYuchen Fu, Zifeng Cheng, Zhiwei Jiang, Zhonghui Wang 等ACL 2025
- Refining Sentence Embedding Model through Ranking Sentences Generation with Large Language ModelsLiyang He, Chenglong Liu, Rui Li, Zhenya Huang 等ACL Findings 2025 · 1 次引用
- Meta-Task Prompting Elicits Embeddings from Large Language ModelsYibin Lei, Di Wu, Tianyi Zhou, Tao Shen 等ACL 2024 · 6 次引用
