Manuscript Offprint

arXiv:2609.37782

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

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

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.

1 INTRODUCTION

Text embeddings have a wide range of real-world applications, including information retrieval, text clustering, and recommender systems. Recently, motivated by the strong long-context modeling and zero-shot generalization capabilities of large language models (LLMs), several studies (Ding et al., 2026; Fu et al., 2025) have explored directly extracting long-context embeddings from LLMs without additional parameter updates. This training-free paradigm avoids the computational cost of fine-tuning while preserving the original generative capabilities of LLMs, making off-the-shelf models readily applicable as text encoders.

Existing training-free methods improve LLM-based text embeddings by introducing backward dependencies under causal attention, allowing earlier tokens to incorporate information from subsequent positions. Echo (Springer et al., 2025) achieves this by repeating the input sequence and extracting representations from its second occurrence. To avoid the computational overhead of input repetition, Token Prepending (TP) (Fu et al., 2025) places a global semantic representation at the beginning of the input sequence. Hierarchical Token Prepending (HTP) (Ding et al., 2026) further introduces multiple block-level representations, alleviating the information bottleneck caused by compressing the entire document into a single global token.

∗^{*}Equal contribution.

†^{\dagger}Corresponding author.

Although existing methods improve how token representations incorporate global or backward context, they largely overlook the final semantic aggregation step. In particular, mean pooling is commonly adopted and has been shown to outperform last-token pooling for long-context embeddings (Ding et al., 2026). However, mean pooling implicitly assigns equal importance to all tokens, even though long documents often contain substantial amounts of semantically redundant or uninformative content. Consequently, uniformly averaging all token representations may dilute the contribution of salient tokens, causing critical semantic information to be overwhelmed by less informative content (Doshi et al., 2026). This observation motivates the following research question: Can we identify and selectively aggregate informative tokens, rather than treating all tokens equally, to construct long-context embeddings without additional training?

To answer this question, we propose a training-free Semantic Compression-guided Selective Pooling (SCSP) method for long-context embedding. Instead of treating all token representations uniformly, SCSP exploits the attention patterns elicited by semantic compression prompts as intrinsic signals of token importance. Specifically, we partition a long document into sentence-aware chunks and append a semantic compression prompt to each chunk, enabling token importance to be estimated within focused and semantically coherent local contexts. A prompt-isolated attention mask further prevents the inserted prompts from interfering with the original document representations while restricting each prompt to its corresponding chunk. Based on the resulting attention distributions, SCSP selects semantically informative tokens and aggregates their representations to construct the final long-context embedding. Extensive experiments across multiple long-context embedding benchmarks demonstrate that SCSP consistently improves existing training-free approaches and can be seamlessly integrated into fine-tuned embedding models, highlighting the general effectiveness of selective semantic aggregation.

Our main contributions are summarized as follows:

• We revisit the final aggregation step in long-context embedding extraction and show that selectively pooling informative tokens is more effective than uniformly averaging all tokens.

• We propose SCSP, a training-free selective pooling framework that leverages attention elicited by local semantic compression as an intrinsic signal of token importance, enabling informative tokens to be identified and aggregated.

• Extensive experiments across multiple long-context embedding benchmarks show that SCSP consistently improves diverse training-free baselines and further enhances fine-tuned embedding models, demonstrating the broad applicability of selective semantic aggregation.

References (30)