paper-with-me

홈 › Papers

Dynamic Compressing Prompts for Efficient Inference of Large Language Models

2025-04-15 · Jinwu Hu, Wei zhang, Yufeng Wang, Yu Hu, Bin Xiao, Mingkui Tan, Qing Du

Large Language Models (LLMs) have shown outstanding performance across a variety of tasks, partly due to advanced prompting techniques. However, these techniques often require lengthy prompts, which increase computational costs and can hinder performance because of the limited context windows of LLMs. While prompt compression is a straightforward solution, existing methods confront the challenges of retaining essential information, adapting to context changes, and remaining effective across different tasks. To tackle these issues, we propose a task-agnostic method called Dynamic Compressing Prompts (LLM-DCP). Our method reduces the number of prompt tokens while aiming to preserve the performance as much as possible. We model prompt compression as a Markov Decision Process (MDP), enabling the DCP-Agent to sequentially remove redundant tokens by adapting to dynamic contexts and retaining crucial content. We develop a reward function for training the DCP-Agent that balances the compression rate, the quality of the LLM output, and the retention of key information. This allows for prompt token reduction without needing an external black-box LLM. Inspired by the progressive difficulty adjustment in curriculum learning, we introduce a Hierarchical Prompt Compression (HPC) training strategy that gradually increases the compression difficulty, enabling the DCP-Agent to learn an effective compression method that maintains information integrity. Experiments demonstrate that our method outperforms state-of-the-art techniques, especially at higher compression rates. The code for our approach will be available at https://github.com/Fhujinwu/DCP.

📄 PDF Abstract BibTeX arXiv:2504.11004

Code (0)

등록된 구현이 없습니다.

Tasks

Token Reduction

Similar Papers 제목 키워드 기반

Learning to Compress Prompt in Natural Language Formats

2024-02-28 · Yu-Neng Chuang, Tianwei Xing, Chia-Yuan Chang, Zirui Liu 외

Large language models (LLMs) are great at processing multiple natural language processing tasks, but their abilities are constrained by inferior performance with long context, slow inference speed, and the high cost of c…

PromptIntern: Saving Inference Costs by Internalizing Recurrent Prompt during Large Language Model Fine-tuning

2024-07-02 · Jiaru Zou, Mengyu Zhou, Tao Li, Shi Han 외

Recent advances in fine-tuning large language models (LLMs) have greatly enhanced their usage in domain-specific tasks. Despite the success, fine-tuning continues to rely on repeated and lengthy prompts, which escalate c…

Language ModelingLanguage ModellingLarge Language Model

LLMLingua: Compressing Prompts for Accelerated Inference of Large Language Models

2023-10-09 · Huiqiang Jiang, Qianhui Wu, Chin-Yew Lin, Yuqing Yang 외

Large language models (LLMs) have been applied in various applications due to their astonishing capabilities. With advancements in technologies such as chain-of-thought (CoT) prompting and in-context learning (ICL), the …

GSM8KIn-Context Learning

Adapting Language Models to Compress Contexts

2023-05-24 · Alexis Chevalier, Alexander Wettig, Anirudh Ajith, Danqi Chen

Transformer-based language models (LMs) are powerful and widely-applicable tools, but their usefulness is constrained by a finite context window and the expensive computational cost of processing long text documents. We …

In-Context LearningLanguage ModelingLanguage ModellingPassage Re-Ranking+2

Say More with Less: Understanding Prompt Learning Behaviors through Gist Compression

2024-02-25 · Xinze Li, Zhenghao Liu, Chenyan Xiong, Shi Yu 외

Large language models (LLMs) require lengthy prompts as the input context to produce output aligned with user intentions, a process that incurs extra costs during inference. In this paper, we propose the Gist COnditioned…

DecoderLanguage ModelingLanguage ModellingPrompt Learning