paper-with-me

홈 › Papers

Token Prepending: A Training-Free Approach for Eliciting Better Sentence Embeddings from LLMs

2024-12-16 · 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 prompt-based 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.

📄 PDF Abstract BibTeX arXiv:2412.11556

Code (0)

등록된 구현이 없습니다.

Tasks

Prompt EngineeringSemantic Textual SimilaritySentenceSentence EmbeddingSentence-EmbeddingSentence EmbeddingsSTS

Methods 이 논문이 사용한 방법론

Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…
Attention 설명 없음
Focus 설명 없음

Similar Papers 제목 키워드 기반

Hierarchical Token Prepending: Enhancing Information Flow in Decoder-based LLM Embeddings

2025-11-18 · Xueying Ding, Xingyue Huang, Mingxuan Ju, Liam Collins 외 arxiv

Large language models produce powerful text embeddings, but their causal attention mechanism restricts the flow of information from later to earlier tokens, degrading representation quality. While recent methods attempt …

FlashBack:Efficient Retrieval-Augmented Language Modeling for Long Context Inference

2024-05-07 · Runheng Liu, Xingchen Xiao, Heyan Huang, Zewen Chi 외

Retrieval-Augmented Language Modeling (RALM) by integrating large language models (LLM) with relevant documents from an external corpus is a proven method for enabling the LLM to generate information beyond the scope of …

Language ModelingLanguage ModellingRetrieval

Activation Control for Efficiently Eliciting Long Chain-of-thought Ability of Language Models

2025-05-23 · Zekai Zhao, Qi Liu, Kun Zhou, Zihan Liu 외

Despite the remarkable reasoning performance, eliciting the long chain-of-thought (CoT) ability in large language models (LLMs) typically requires costly reinforcement learning or supervised fine-tuning on high-quality d…

parameter-efficient fine-tuning

Inoculation Prompting: Eliciting traits from LLMs during training can suppress them at test-time

2025-10-05 · Daniel Tan, Anders Woodruff, Niels Warncke, Arun Jose 외 arxiv

Language model finetuning often results in learning undesirable traits in combination with desired ones. To address this, we propose inoculation prompting: modifying finetuning data by prepending a short system-prompt in…

Awakening Diffusion Transformers: Eliciting Stronger Generation and Understanding via Massive Activation Modulation

2026-07-03 · Chaofan Gan, Zicheng Zhao, Yuanpeng Tu, Xi Chen 외 arxiv

Massive Activations (MAs) have been widely observed in Transformer-based models, yet their structure and functional roles in Diffusion Transformers (DiTs) remain insufficiently understood. In this work, we systematically…