Task-agnostic Prompt Compression with Context-aware Sentence Embedding and Reward-guided Task Descriptor

Barys Liskavets, Shuvendu Roy, Maxim Ushakov, Mark Klibanov, Ali Etemad +1 more
2/19/2025
cs.CL

No confident code implementation found for this paper.

Abstract

The rise of Large Language Models (LLMs) has led to significant interest in prompt compression, a technique aimed at reducing the length of input prompts while preserving critical information. However, the prominent approaches in prompt compression often require explicit questions or handcrafted templates for compression, limiting their generalizability.

Show full abstract

We propose Task-agnostic Prompt Compression (TPC), a novel framework that generalizes compression across tasks and domains without requiring input questions or templates. TPC generates a context-relevant task description using a task descriptor trained on a curated dataset of context and query pairs, and fine-tuned via reinforcement learning with a reward function designed to capture the most relevant information. The task descriptor is then utilized to compute the relevance of each sentence in the prompt to generate the compressed prompt. We introduce 3 model sizes (Base, Large, and Huge), where the largest model outperforms the existing state-of-the-art methods on LongBench and ZeroSCROLLS benchmarks, and our smallest model performs comparable to the existing solutions while being considerably smaller.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{liskavets2025taskagnostic,
  title  = {Task-agnostic Prompt Compression with Context-aware Sentence Embedding and Reward-guided Task Descriptor},
  author = {Barys Liskavets and Shuvendu Roy and Maxim Ushakov and Mark Klibanov and Ali Etemad and Shane Luke},
  year   = {2025},
  eprint = {2502.13374},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.13374v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2502.13374.svg)](https://codeofpaper.com/paper/2502.13374)

Discussion