Introduction
Large Language Models (LLMs) have significantly expanded their context windows, yet they continue to struggle with "long context" processing. Two primary issues degrade performance: extreme redundancy and noise in prompts, and the "lost in the middle" phenomenon, where models fail to retrieve information buried in the center of a long sequence. While prompt compression offers a solution, existing task-agnostic methods often inadvertently prune critical information. This paper presents Perception Compressor, a training-free framework designed to compress long prompts while maintaining or even enhancing model performance on complex reasoning tasks.
Methodology
Perception Compressor utilizes a three-stage pipeline to intelligently reduce prompt length without requiring additional training.
1. Perception Retriever
To overcome the "lost in the middle" challenge, the framework employs a Socratic-inspired retrieval method. Instead of relying solely on the user's initial query, the system prompts an LLM to generate multiple "guiding questions." These sub-questions provide a more comprehensive representation of the information needed. The retriever then scores and reorders document snippets, moving the most relevant content to the beginning of the prompt where LLMs demonstrate higher attention.
2. Dual-slope Ratio Allocator
Compression budgets are not applied uniformly across the prompt. The Dual-slope Ratio Allocator uses two mathematical slopes ($k_1$ and $k_2$) to dynamically distribute the compression ratio. This ensures that high-value sections, such as few-shot demonstrations and identified key information, are preserved with higher fidelity, while redundant background noise is compressed more aggressively.
3. Semi-guided Iterative Compression
At the token level, the system distinguishes between Key Information Tokens (KITs) and Non-key Information Tokens (NITs) using contrast perplexity. This metric measures the change in a model's "surprise" (perplexity) for a token when the question context is provided versus when it is absent.
Tokens that become significantly more predictable in the presence of the question are labeled as KITs and retained. Conversely, tokens with high perplexity that do not contribute to the answer (NITs) are identified as distractors and pruned to reduce the model's cognitive load.
Experimental Results
The framework was evaluated on NaturalQuestions, LongBench, and MuSiQue benchmarks.
Performance and Accuracy
On the NaturalQuestions dataset, Perception Compressor achieved an accuracy of 66.3% at a 4x compression ratio, notably surpassing the 63.1% accuracy of the original, uncompressed prompt. This suggests that the method effectively filters out distracting noise that hinders the base model. In the LongBench suite, it consistently outperformed state-of-the-art baselines like LongLLMLingua and LLMLingua2.
Efficiency and Robustness
The method is computationally efficient, adding only approximately 1.2 seconds of latency for question generation while reducing inference memory requirements (e.g., from ~19 GB to ~17 GB). Furthermore, the framework demonstrates high robustness across various hyperparameters, eliminating the need for tedious task-specific fine-tuning.
Discussion and Limitations
A key insight of this work is that reordering information is as critical as the compression itself. By positioning relevant data at the start of the prompt, the model bypasses inherent architectural biases. However, as an explicit compression method that deletes tokens, Perception Compressor has a physical upper bound on its compression ratio compared to "soft prompt" embedding methods. Future work will focus on improving boundary detection for unstructured text and further optimizing the computational overhead of the iterative compression stage.
Summary updated