Beyond Position Bias: Shifting Context Compression from Position-Driven to Semantic-Driven

Jiwei Tang, Zhijing Huang, Xinyu Zhang, Chen Jason Zhang, Jianxing Yu, Libin Zheng, Rui Meng, Jian YinarXiv 2026

TL;DR

Large Language Models (LLMs) struggle with long contexts due to high computational overhead and information redundancy. Existing soft prompt compression methods attempt to solve this but are bottlenecked by "position bias"—relying heavily on physical token layouts or fixed token insertions. This paper introduces Semantic Consistency Context Compression (SeCo), a framework that abandons positional constraints entirely, dynamically anchoring compression in the semantic space by selecting query-relevant tokens as centers and merging the rest based on semantic consistency.

What Problem Does This Paper Address?

Deploying LLMs in long-context scenarios (such as Retrieval-Augmented Generation or multi-turn agents) introduces massive information redundancy and high computational costs due to the Transformer's quadratic attention complexity. Soft prompt compression mitigates this by distilling long sequences into compact continuous embeddings.

However, the authors identify a critical bottleneck in current soft compression paradigms: position bias. This manifests in two systematic forms:

  1. Positional Encoding Bias: Methods that insert learnable tokens at fixed positions are highly sensitive to the positional encodings assigned to them, leading to unstable downstream performance.
  2. Group-Based Position Bias: Methods that group tokens based on their physical layout cause semantic fragmentation, rigidly splitting semantically related tokens into different compression groups and ignoring query relevance.
Figure 1: Comparison between existing methods and SeCo. (a) Performance Instability. Learnable token insertion method, such as ICAE [17], exhibit pronounced sensitivity to the position bias factor β, which controls the positional encoding of learnable tokens (as detailed in Figure 5). Consequently, F1 scores fluctuate substantially across various benchmarks under different β configurations. (b) Semantic Fragmentation. Token A1 in Group A is semantically highly correlated with tokens B1 and B2 in Group B. However, position-based grouping rigidly partitions these semantically related tokens (highlighted in red boxes) into separate compression groups. (c) Semantic Consistency Compression (SeCo). SeCo selects the top-k tokens most relevant to the query as semantic centers. Subsequently, remaining tokens are dynamically assigned and merged directly in the semantic space based on query-centric semantic consistency.

To resolve this, the authors ask: How can we shift context compression from being position-driven to semantic-driven?

Methods

Inspired by cognitive science—specifically how human memory organizes concepts by meaning rather than physical proximity—the authors propose SeCo. It decouples the compression process from the physical token layout using a three-stage pipeline:

  1. Semantic Center Selection: The query tokens are averaged to form a global query representation ($\bar{q}$). Context tokens are then ranked by their cosine similarity to $\bar{q}$. The top-$K$ most relevant tokens are selected to serve as "semantic centers" (anchors).
  2. Semantic Assignment: The remaining non-center tokens are dynamically mapped to the most appropriate semantic center. This mapping is determined by a joint assignment score, which balances a token's local similarity to the center with its global similarity to the query.
  3. Consistency Merging: Tokens within each cluster are aggregated into a single compressed representation using consistency-weighted softmax scores.

The entire framework operates on an encoder-decoder architecture where both components are fine-tuned using Low-Rank Adaptation (LoRA).

Datasets

The authors evaluated SeCo across 14 diverse benchmarks using two backbone models (LLaMA-3.2-1B-Instruct and Qwen3-4B-Instruct):

  • In-Domain (ID) QA: SQuAD, NewsQA, TriviaQA, SearchQA, HotpotQA, and NaturalQuestions (from the MRQA shared task).
  • Out-of-Domain (OOD) QA: DROP, BioASQ, DuoRC.ParaphraseRC, TextbookQA, RelationExtraction, and RACE.
  • Long-Context & Summarization: DialogSum (multi-turn dialogue summarization) and NarrativeQA (deep story comprehension over long-form scripts).

Key Insights and Ideas

  • Ditching the Linear Sequence: Rather than forcing tokens into arbitrary sequential chunks, SeCo allows tokens to autonomously find their optimal compression group directly within the semantic space.
  • Query-Centric Filtering: By selecting semantic anchors based on query relevance, SeCo implicitly filters out task-irrelevant background noise while preserving highly critical context.
  • Mathematical Guarantees: The authors provide rigorous theoretical proofs demonstrating that SeCo's semantic aggregation operator possesses permutation invariance (structurally eliminating ordering bias) and achieves positional noise attenuation, which bounds the residual variance after compression.

Key Results

  • Superior Downstream Accuracy: Under both 16× and 32× compression constraints, SeCo consistently outperformed both task-agnostic and task-aware baselines. For example, at 16× compression on LLaMA-3.2, SeCo achieved an average in-domain F1 score of 68.55%, significantly outperforming competitive baselines like COMI (54.37%) and RAM (51.03%).
  • Lower Latency: By replacing long contexts with compact soft tokens, SeCo accelerates the generation stage. It achieved the lowest total latency (compression time + generation time) across multiple datasets, clocking in at 55.90 ms on SQuAD compared to COMI's 59.03 ms.
  • Robustness to Compression Rates: In stress tests where compression rates were varied dynamically from 2× to 32×, SeCo maintained a stable performance edge in both in-domain and out-of-domain settings, proving its robustness against extreme context shrinking.

Limitations and Future Work

  • Clustering Overhead: SeCo introduces a query-aware clustering step during the compression phase. While the authors demonstrate that this process is lightweight and inherently parallelizable, it still introduces a minor computational step during end-to-end generation.
  • Future Directions: The success of SeCo suggests that long-context compression can be learned entirely within the semantic space. Future work could explore scaling this semantic-driven approach to even larger backbone models and more complex multi-modal long-context tasks.

Summary updated

BibTeX
@misc{tang2026beyond,
  author = {Jiwei Tang and Zhijing Huang and Xinyu Zhang and Chen Jason Zhang and Jianxing Yu and Libin Zheng and Rui Meng and Jian Yin},
  title = {{Beyond Position Bias: Shifting Context Compression from Position-Driven to Semantic-Driven}},
  year = {2026},
  eprint = {2605.09463},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.09463},
}
Figure