Introduction
As Large Language Models (LLMs) are deployed for increasingly complex tasks, the length of input prompts has become a significant bottleneck. Long contexts lead to slower inference speeds (specifically Time to First Token), increased computational costs in terms of FLOPs and memory, and often exceed the hard context limits of the underlying models.
Existing solutions typically involve Hard Pruning (deleting tokens) or Soft Compression (summarizing text into learned "gist" tokens). However, these methods often struggle with high information loss at extreme compression ratios. 500xCompressor addresses these challenges by introducing a novel soft compression method capable of squeezing up to 500 natural language tokens into a single special token while maintaining high performance across diverse downstream tasks.
Methodology
500xCompressor utilizes an encoder-decoder architecture built upon a frozen LLaMA-3-8B backbone. The encoder consists of the frozen LLM augmented with trainable LoRA (Low-Rank Adaptation) parameters, while the decoder is the original unmodified LLM.
The primary innovation, termed KV-Value Passing, involves passing the Key-Value (KV) states for each layer to the decoder rather than standard embeddings. This approach preserves significantly more detailed information, such as proper nouns and numerical data, which is often lost in embedding-based compression. The system is trained in two stages:
- Pre-training (Regeneration): Learning to reconstruct the exact original text from compressed tokens.
- Fine-tuning (QA): Optimizing the model to answer extractive questions based on the compressed context.
Experimental Setup and Datasets
To ensure the model relies on the provided context rather than internal memory, the authors evaluated it using ArxivCorpus, a collection of academic abstracts published after the LLM's knowledge cutoff (post-January 2024). They also introduced ArxivQA, a dataset of 250,000 extractive QA pairs. To test generalization, the model was benchmarked on five unseen cross-domain datasets: TriviaQA, RelationExtraction, NaturalQuestions, TextbookQA, and RACE.
Results and Evaluation
500xCompressor demonstrates remarkable efficiency and performance retention. At a 500x compression ratio, the model achieves a 27-90% reduction in calculations and 55-83% memory savings during generation.
In terms of accuracy, the model retained 70-74% of its F1 score and 77-84% Exact Match capability on ArxivQA compared to uncompressed prompts. It significantly outperformed leading baselines like ICAE, particularly at extreme ratios. For instance, in text regeneration, 500xCompressor achieved a BLEU score of 73.05, compared to 49.33 for ICAE. Furthermore, the model showed strong zero-shot generalization, improving average F1 scores by up to 21.93 points over ICAE on unseen domains.
Conclusion
500xCompressor represents a major step forward in prompt engineering, acting as a universal "zip tool" for LLM contexts. By leveraging KV states, it proves that natural language is highly redundant and can be compressed far more than previously thought. While a performance gap remains compared to full prompts, the massive gains in inference speed and memory efficiency make it a powerful tool for scaling LLM applications. Future work will focus on expanding the training corpus and addressing more complex, non-extractive reasoning tasks.
Summary updated