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.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了最后一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 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 次
它引用的顶会 Paper7
- 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 次
- PromptBERT: Improving BERT Sentence Embeddings with PromptsTing Jiang, Jian Jiao, Shaohan Huang, Zihan Zhang 等EMNLP 2022 · 被引用 148 次
- Composition-contrastive Learning for Sentence EmbeddingsSachin Chanchani, Ruihong HuangACL 2023 · 被引用 11 次
- NV-Embed: Improved Techniques for Training LLMs as Generalist Embedding ModelsChankyu Lee, Rajarshi Roy, Mengyao Xu, Jonathan Raiman 等ICLR 2025
相关 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
- S2IP-LLM: Semantic Space Informed Prompt Learning with LLM for Time Series ForecastingZijie Pan, Yushan Jiang, Sahil Garg, Anderson Schneider 等ICML 2024 · 被引用 23 次
- Investigating the Effectiveness of Task-Agnostic Prefix Prompt for Instruction FollowingSeonghyeon Ye, Hyeonbin Hwang, Sohee Yang, Hyeongu Yun 等AAAI 2024 · 被引用 50 次
- Focusing Condition: Inference-Time Self-Contrastive Steering Elicits Better Conditional Text Embeddings in LLMsZifeng Cheng, Lingyun Qian, Zhiwei Jiang, Cong Wang 等ACL 2026
