Lune

ACL2025Top-tier venue

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

Abstract

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.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

10 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • One Embedder, Any Task: Instruction-Finetuned Text Embeddings cites SimCSE: Simple Contrastive Learning of Sentence Embeddings
  • One Embedder, Any Task: Instruction-Finetuned Text Embeddings cites 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 cites Language Models are Few-Shot Learners
  • PromptBERT: Improving BERT Sentence Embeddings with Prompts cites Language Models are Few-Shot Learners
  • PromptBERT: Improving BERT Sentence Embeddings with Prompts cites SimCSE: Simple Contrastive Learning of Sentence Embeddings
  • Sentence-T5: Scalable Sentence Encoders from Pre-trained Text-to-Text Models cites SimCSE: Simple Contrastive Learning of Sentence Embeddings
  • Hierarchical Token Prepending: Enhancing Information Flow in Decoder-based LLM Embeddings cites PromptBERT: Improving BERT Sentence Embeddings with Prompts
  • Hierarchical Token Prepending: Enhancing Information Flow in Decoder-based LLM Embeddings cites SimCSE: Simple Contrastive Learning of Sentence Embeddings
  • Hierarchical Token Prepending: Enhancing Information Flow in Decoder-based LLM Embeddings cites Sentence-T5: Scalable Sentence Encoders from Pre-trained Text-to-Text Models
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers10

  1. FreeRet: MLLMs as Training-Free RetrieversYuhan Zhu, Xiangyu Zeng, Chenting Wang, Xinhao Li et al.ICML 2026 · 5 citations
  2. Hierarchical Token Prepending: Enhancing Information Flow in Decoder-based LLM EmbeddingsXueying Ding, Xingyue Huang, Mingxuan Ju, Liam Collins et al.ACL 2026 · 3 citations
  3. Beyond Step Pruning: Information Theory Based Step-level Optimization for Self-Refining Large Language ModelsJinman Zhao, Erxue Min, Hui Wu, Ziheng Li et al.AAAI 2026 · 1 citation
  4. The Truth Lies Somewhere in the Middle (of the Generated Tokens)Sophie Wang, Phillip Isola, Brian CheungICML 2026 · 1 citation
  5. RegionMarker: A Region-Triggered Semantic Watermarking Framework for Embedding-as-a-Service Copyright ProtectionShufan Yang, Zifeng Cheng, Zhiwei Jiang, Yafeng Yin et al.AAAI 2026 · 1 citation

Builds on10

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. SimCSE: Simple Contrastive Learning of Sentence EmbeddingsTianyu Gao, Xingcheng Yao, Danqi ChenEMNLP 2021 · 2,496 citations
  3. Sentence-T5: Scalable Sentence Encoders from Pre-trained Text-to-Text ModelsJianmo Ni, Gustavo Hernández Ábrego, Noah Constant, Ji Ma et al.ACL Findings 2022 · 358 citations
  4. PromptBERT: Improving BERT Sentence Embeddings with PromptsTing Jiang, Jian Jiao, Shaohan Huang, Zihan Zhang et al.EMNLP 2022 · 148 citations
  5. One Embedder, Any Task: Instruction-Finetuned Text EmbeddingsHongjin Su, Weijia Shi, Jungo Kasai, Yizhong Wang et al.ACL Findings 2023 · 134 citations

Related papers

  1. Contrastive Prompting Enhances Sentence Embeddings in LLMs through Inference-Time SteeringZifeng Cheng, Zhonghui Wang, Yuchen Fu, Zhiwei Jiang et al.ACL 2025
  2. Causal2Vec: Improving Decoder-only LLMs as Embedding Models through a Contextual TokenAiliang Lin, Zhuoyun Li, Yusong Wang, Kotaro Funakoshi et al.ACL 2026
  3. Scaling Sentence Embeddings with Large Language ModelsTing Jiang, Shaohan Huang, Zhongzhi Luan, Deqing Wang et al.EMNLP Findings 2024 · 61 citations
  4. SemPA: Improving Sentence Embeddings of Large Language Models through Semantic Preference AlignmentZiyang Chen, Zhenxuan Huang, Yile Wang, Weiqin Wang et al.ACL Findings 2026
  5. S2IP-LLM: Semantic Space Informed Prompt Learning with LLM for Time Series ForecastingZijie Pan, Yushan Jiang, Sahil Garg, Anderson Schneider et al.ICML 2024 · 23 citations
Dusk over the sea between two cliffs drawn in fine vertical lines