An Empirical Study on Prompt Compression for Large Language Models

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Zhang, Zheng, Li, Jinyi, Lan, Yihuai, Wang, Xiang, Wang, Hao
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866918005671198720
author Zhang, Zheng
Li, Jinyi
Lan, Yihuai
Wang, Xiang
Wang, Hao
author_facet Zhang, Zheng
Li, Jinyi
Lan, Yihuai
Wang, Xiang
Wang, Hao
contents Prompt engineering enables Large Language Models (LLMs) to perform a variety of tasks. However, lengthy prompts significantly increase computational complexity and economic costs. To address this issue, we study six prompt compression methods for LLMs, aiming to reduce prompt length while maintaining LLM response quality. In this paper, we present a comprehensive analysis covering aspects such as generation performance, model hallucinations, efficacy in multimodal tasks, word omission analysis, and more. We evaluate these methods across 13 datasets, including news, scientific articles, commonsense QA, math QA, long-context QA, and VQA datasets. Our experiments reveal that prompt compression has a greater impact on LLM performance in long contexts compared to short ones. In the Longbench evaluation, moderate compression even enhances LLM performance. Our code and data is available at https://github.com/3DAgentWorld/Toolkit-for-Prompt-Compression.
format Preprint
id arxiv_https___arxiv_org_abs_2505_00019
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle An Empirical Study on Prompt Compression for Large Language Models
Zhang, Zheng
Li, Jinyi
Lan, Yihuai
Wang, Xiang
Wang, Hao
Computation and Language
Artificial Intelligence
Prompt engineering enables Large Language Models (LLMs) to perform a variety of tasks. However, lengthy prompts significantly increase computational complexity and economic costs. To address this issue, we study six prompt compression methods for LLMs, aiming to reduce prompt length while maintaining LLM response quality. In this paper, we present a comprehensive analysis covering aspects such as generation performance, model hallucinations, efficacy in multimodal tasks, word omission analysis, and more. We evaluate these methods across 13 datasets, including news, scientific articles, commonsense QA, math QA, long-context QA, and VQA datasets. Our experiments reveal that prompt compression has a greater impact on LLM performance in long contexts compared to short ones. In the Longbench evaluation, moderate compression even enhances LLM performance. Our code and data is available at https://github.com/3DAgentWorld/Toolkit-for-Prompt-Compression.
title An Empirical Study on Prompt Compression for Large Language Models
topic Computation and Language
Artificial Intelligence
url https://arxiv.org/abs/2505.00019