Table of Contents
Fetching ...

500xCompressor: Generalized Prompt Compression for Large Language Models

Zongqian Li, Yixuan Su, Nigel Collier

TL;DR

500xCompressor introduces a generalized prompt compression method that reduces prompts of about 500 tokens to as few as one token, adding only ~0.3% parameters. It uses a frozen LLM encoder with LoRA ($\Theta_{Lora}$) and a decoder that consumes the encoder’s KV values to regenerate text or answer questions, without fine-tuning the LLM. Evaluations on strictly unseen Arxiv-based data and additional QA benchmarks show the model retains about 62.26%–72.89% of non-compressed capabilities at compression ratios up to $480x$, with KV-value inputs outperforming embeddings in information preservation. The results indicate high compression ratios are feasible for complex content and suggest broad downstream potential across in-context learning, RAG, and personalized LLMs, while significantly reducing latency and cost.

Abstract

Prompt compression is crucial for enhancing inference speed, reducing costs, and improving user experience. However, current methods face challenges such as low compression ratios and potential data leakage during evaluation. To address these issues, we propose 500xCompressor, a method that compresses extensive natural language contexts into a minimum of one single special token. The 500xCompressor introduces approximately 0.3% additional parameters and achieves compression ratios ranging from 6x to 480x. It is designed to compress any text, answer various types of questions, and could be utilized by the original large language model (LLM) without requiring fine-tuning. Initially, 500xCompressor was pretrained on the Arxiv Corpus, followed by fine-tuning on the ArxivQA dataset, and subsequently evaluated on strictly unseen and classical question answering (QA) datasets. The results demonstrate that the LLM retained 62.26-72.89% of its capabilities compared to using non-compressed prompts. This study also shows that not all the compressed tokens are equally utilized and that K V values have significant advantages over embeddings in preserving information at high compression ratios. The highly compressive nature of natural language prompts, even for fine-grained complex information, suggests promising potential for future applications and further research into developing a new LLM language.

500xCompressor: Generalized Prompt Compression for Large Language Models

TL;DR

500xCompressor introduces a generalized prompt compression method that reduces prompts of about 500 tokens to as few as one token, adding only ~0.3% parameters. It uses a frozen LLM encoder with LoRA () and a decoder that consumes the encoder’s KV values to regenerate text or answer questions, without fine-tuning the LLM. Evaluations on strictly unseen Arxiv-based data and additional QA benchmarks show the model retains about 62.26%–72.89% of non-compressed capabilities at compression ratios up to , with KV-value inputs outperforming embeddings in information preservation. The results indicate high compression ratios are feasible for complex content and suggest broad downstream potential across in-context learning, RAG, and personalized LLMs, while significantly reducing latency and cost.

Abstract

Prompt compression is crucial for enhancing inference speed, reducing costs, and improving user experience. However, current methods face challenges such as low compression ratios and potential data leakage during evaluation. To address these issues, we propose 500xCompressor, a method that compresses extensive natural language contexts into a minimum of one single special token. The 500xCompressor introduces approximately 0.3% additional parameters and achieves compression ratios ranging from 6x to 480x. It is designed to compress any text, answer various types of questions, and could be utilized by the original large language model (LLM) without requiring fine-tuning. Initially, 500xCompressor was pretrained on the Arxiv Corpus, followed by fine-tuning on the ArxivQA dataset, and subsequently evaluated on strictly unseen and classical question answering (QA) datasets. The results demonstrate that the LLM retained 62.26-72.89% of its capabilities compared to using non-compressed prompts. This study also shows that not all the compressed tokens are equally utilized and that K V values have significant advantages over embeddings in preserving information at high compression ratios. The highly compressive nature of natural language prompts, even for fine-grained complex information, suggests promising potential for future applications and further research into developing a new LLM language.
Paper Structure (19 sections, 4 equations, 6 figures, 5 tables)

This paper contains 19 sections, 4 equations, 6 figures, 5 tables.

Figures (6)

  • Figure 1: The original text is compressed by 500xCompressor and utilized for downstream tasks.
  • Figure 2: Process of pretraining (left), fine-tuning (middle), and prediction (right) with 500xCompressor.
  • Figure 3: Evaluation results for text regeneration on the Arxiv Corpus.
  • Figure 4: Evaluation results for text regeneration on the Arxiv Corpus and for QA on the ArxivQA dataset.
  • Figure 5: Evaluation loss for 500xCompressor and ICAE during pretraining and fine-tuning.
  • ...and 1 more figures