Focusing Condition: Inference-Time Self-Contrastive Steering Elicits Better Conditional Text Embeddings in LLMs
Zifeng Cheng, Lingyun Qian, Zhiwei Jiang, Cong Wang, Yafeng Yin, Fei Shen, Ao Zhou, Qing Gu
Abstract
Extracting conditional text embeddings from large language models (LLMs) is a promising paradigm, as it requires neither additional data nor fine-tuning. Existing methods incorporate conditions into prompts to guide LLMs to focus on specific aspects and elicit conditional text embeddings. However, relying solely on prompts often fails to produce high-quality conditional text embeddings, as they remain entangled with general text embeddings, ultimately degrading their quality. To this end, we propose an inference-time, plug-and-play Self-Contrastive Steering (SCS) method that constructs unconditional general text embeddings and uses them to refine conditional text embeddings, making them more focused on the target condition. Specifically, we modify the attention mask and positional encodings to mask the condition, thereby obtaining unconditional text embeddings and intervening in the multi-head self-attention computation process. Notably, our method is highly efficient, requiring only a single additional multi-head self-attention computation at inference time. Extensive experiments on clustering, Semantic Textual Similarity, and triplet alignment datasets demonstrate that our method can seamlessly improve the performance of existing prompt-based methods across different LLMs in a training-free and plug-and-play manner. Our code will be released at https://github.com/zifengcheng/SCS
Create a lesson
Metadata
- Comments
- ACL 2026 (Oral)
Related papers
Focus On Facts: Stylistically Invariant and Factually Sensitive Text Embeddings
Shared title terminologycs.CLMaximus Adeola
Inference-Time Target Speaker Unlearning in LLM-Based Automatic Speech Recognition
Shared title terminologycs.CLBo Su, Yueru Yan, Thai Le
Beyond Self-Consistency: Recursive Self-Improvement at Test Time
Shared title terminologycs.CLJianyu Wu, Yizhou Wang, Encheng Su et al.
Trallie: from Free-Form Text to Structured Data with LLMs
Shared title terminologycs.CLVijayasri Iyer, Cristiano De Nobili, Mubashir Hussain Shah et al.
TQTS-Bench: A Multi-Syntax Benchmark for Text-to-Query over Time-Series Databases
Shared title terminologycs.CLFei Lyu, Zhiyi Peng, Jiaming Liu et al.
Using LLMs to Detect LLM-Generated Texts: A Cross-Generation Analysis
Shared title terminologycs.CLHaiyue Yuan, Jie Guo, Weidong Qiu et al.