Saved in:
Bibliographic Details
Main Authors: Yu, Ziyang, Liu, Yuyu
Format: Preprint
Published: 2025
Subjects:
Online Access:https://arxiv.org/abs/2501.01625
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866929657162498048
author Yu, Ziyang
Liu, Yuyu
author_facet Yu, Ziyang
Liu, Yuyu
contents Despite the recent success of Large Language Models (LLMs), it remains challenging to feed LLMs with long prompts due to the fixed size of LLM inputs. As a remedy, prompt compression becomes a promising solution by removing redundant tokens in the prompt. However, using LLM in the existing works requires additional computation resources and leads to memory overheads. To address it, we propose ICPC (In-context Prompt Compression), a novel and scalable prompt compression method that adaptively reduces the prompt length. The key idea of ICPC is to calculate the probability of each word appearing in the prompt using encoders and calculate information carried by each word through the information function, which effectively reduces the information loss during prompt compression and increases the speed of compression. Empirically, we demonstrate that ICPC can effectively compress long texts of different categories and thus achieve better performance and speed on different types of NLP tasks.
format Preprint
id arxiv_https___arxiv_org_abs_2501_01625
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle ICPC: In-context Prompt Compression with Faster Inference
Yu, Ziyang
Liu, Yuyu
Computation and Language
Artificial Intelligence
Despite the recent success of Large Language Models (LLMs), it remains challenging to feed LLMs with long prompts due to the fixed size of LLM inputs. As a remedy, prompt compression becomes a promising solution by removing redundant tokens in the prompt. However, using LLM in the existing works requires additional computation resources and leads to memory overheads. To address it, we propose ICPC (In-context Prompt Compression), a novel and scalable prompt compression method that adaptively reduces the prompt length. The key idea of ICPC is to calculate the probability of each word appearing in the prompt using encoders and calculate information carried by each word through the information function, which effectively reduces the information loss during prompt compression and increases the speed of compression. Empirically, we demonstrate that ICPC can effectively compress long texts of different categories and thus achieve better performance and speed on different types of NLP tasks.
title ICPC: In-context Prompt Compression with Faster Inference
topic Computation and Language
Artificial Intelligence
url https://arxiv.org/abs/2501.01625