Token Prepending: A Training-Free Approach for Eliciting Better Sentence Embeddings from LLMs
Yuchen Fu, Zifeng Cheng, Zhiwei Jiang, Zhonghui Wang, Yafeng Yin, Zhengliang Li, Qing Gu
摘要
Extracting sentence embeddings from large language models (LLMs) is a promising direction, as LLMs have demonstrated stronger semantic understanding capabilities. Previous studies typically focus on prompt engineering to elicit sentence embeddings from LLMs by prompting the model to encode sentence information into the embedding of the last token. However, LLMs are mostly decoder-only models with causal attention and the earlier tokens in the sentence cannot attend to the latter tokens, resulting in biased encoding of sentence information and cascading effects on the final decoded token. To this end, we propose a novel Token Prepending (TP) technique that prepends each layer's decoded sentence embedding to the beginning of the sentence in the next layer's input, allowing earlier tokens to attend to the complete sentence information under the causal attention mechanism. The proposed TP technique is a plug-and-play and training-free technique, which means it can be seamlessly integrated with various promptbased sentence embedding methods and autoregressive LLMs. Extensive experiments on various Semantic Textual Similarity (STS) tasks and downstream classification tasks demonstrate that our proposed TP technique can significantly improve the performance of existing prompt-based sentence embedding methods across different LLMs, while incurring negligible additional inference cost.
问 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
- RegionMarker: A Region-Triggered Semantic Watermarking Framework for Embedding-as-a-Service Copyright Protection 引用了 Language Models are Few-Shot Learners
- PromptBERT: Improving BERT Sentence Embeddings with Prompts 引用了 Language Models are Few-Shot Learners
- 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
- FreeRet: MLLMs as Training-Free RetrieversYuhan Zhu, Xiangyu Zeng, Chenting Wang, Xinhao Li 等ICML 2026 · 5 次引用
- Hierarchical Token Prepending: Enhancing Information Flow in Decoder-based LLM EmbeddingsXueying Ding, Xingyue Huang, Mingxuan Ju, Liam Collins 等ACL 2026 · 3 次引用
- 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 次引用
- The Truth Lies Somewhere in the Middle (of the Generated Tokens)Sophie Wang, Phillip Isola, Brian CheungICML 2026 · 1 次引用
- RegionMarker: A Region-Triggered Semantic Watermarking Framework for Embedding-as-a-Service Copyright ProtectionShufan Yang, Zifeng Cheng, Zhiwei Jiang, Yafeng Yin 等AAAI 2026 · 1 次引用
它引用的 Paper10
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
- SimCSE: Simple Contrastive Learning of Sentence EmbeddingsTianyu Gao, Xingcheng Yao, Danqi ChenEMNLP 2021 · 2,496 次引用
- 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
- Contrastive Prompting Enhances Sentence Embeddings in LLMs through Inference-Time SteeringZifeng Cheng, Zhonghui Wang, Yuchen Fu, Zhiwei Jiang 等ACL 2025
- Causal2Vec: Improving Decoder-only LLMs as Embedding Models through a Contextual TokenAiliang Lin, Zhuoyun Li, Yusong Wang, Kotaro Funakoshi 等ACL 2026
- Scaling Sentence Embeddings with Large Language ModelsTing Jiang, Shaohan Huang, Zhongzhi Luan, Deqing Wang 等EMNLP Findings 2024 · 61 次引用
- SemPA: Improving Sentence Embeddings of Large Language Models through Semantic Preference AlignmentZiyang Chen, Zhenxuan Huang, Yile Wang, Weiqin Wang 等ACL Findings 2026
- S2IP-LLM: Semantic Space Informed Prompt Learning with LLM for Time Series ForecastingZijie Pan, Yushan Jiang, Sahil Garg, Anderson Schneider 等ICML 2024 · 23 次引用
