Selecting What Matters: Semantic Compression-Guided Selective Pooling for Long-Context Embeddings
Zifeng Cheng, Jie Zheng, Zhiwei Jiang, Shuwen Wang, Fei Shen, Shiping Ge, Qing Gu
Abstract
Large language models (LLMs) have shown strong potential as training-free text encoders for long-context embeddings. Existing approaches primarily improve information flow under causal attention and typically construct embeddings by uniformly averaging all token representations. However, for long documents, such mean pooling can dilute salient semantic information with abundant redundant or weakly informative content. To this end, we propose SCSP, a training-free framework that leverages semantic compression for informative token selection in long-context embedding. Specifically, SCSP first partitions a document into sentence-aware chunks and appends a semantic compression prompt to each chunk. A prompt-isolated attention mask preserves information flow among document tokens while restricting each prompt to its corresponding local context. We then use the attention patterns elicited by these prompts to estimate token importance, select informative tokens, and aggregate their intermediate-layer representations into the final embedding. Extensive experiments on long-context embedding benchmarks demonstrate that SCSP can be integrated into both zero-shot and fine-tuned models in a plug-and-play manner, consistently improving their performance.
Create a lesson
Related papers
LongHarness Bench: Stress-Testing Language Model Harnesses for Long-Context Reasoning
Shared title terminologycs.CLQuang Hieu Pham, Thuy Duong Nguyen, Jocelyn Qiaochu Chen et al.
MemFold: Learning Compact Soft Memory for Long-Context Personalization via On-Policy Optimization
Shared title terminologycs.CLJingxuan Wu, Yuzhe Yang, Yiqiao Huang et al.
Context Injection and Long-Horizon Reliability: Separating Duplicate Recognition, Local Processing, and Counter Tracking
Shared title terminologycs.CLThomas Serval
Can LLMs Reason Over Long Horizons? An Empirical Evaluation of Context Strategies for Longitudinal Clinical Reasoning
Shared title terminologycs.CLTaye Akinrele, Noorbakhsh Amiri Golilarz, Subash Neupane et al.
SemOPT: Fixing Semantic Errors in LLM-based Optimization Modeling via Reward-Guided Search
Shared title terminologycs.CLZetong Zhou, Wentao Zhang, Jingyuan Wang et al.
Bridging Semantic Gaps in RAG through Generated Context Knowledge Fusion
Shared title terminologycs.CLXinkai Du, Chao Lv, Yalin Sun et al.