LongLLMLingua: Accelerating and Enhancing LLMs in Long Context Scenarios via Prompt Compression

Auteurs : Huiqiang Jiang, Qianhui Wu, Xufang Luo, Dongsheng Li, Chin-Yew Lin, Yuqing Yang, Lili Qiu

Soumis à arXiv le 10 Oct. 2023
Résumé scientifique

In long context scenarios, large language models (LLMs) face three main challenges: higher computational/financial cost, longer latency, and inferior performance. Some studies reveal that the performance of LLMs depends on both the density and the position of the key information (question relevant) in the input prompt. Inspired by these findings, we propose LongLLMLingua for prompt compression towards improving LLMs' perception of the key information to simultaneously address the three challenges. We conduct evaluation on a wide range of long context scenarios including single-/multi-document QA, few-shot learning, summarization, synthetic tasks, and code completion. The experimental results show that LongLLMLingua compressed prompt can derive higher performance with much less cost. The latency of the end-to-end system is also reduced. For example, on NaturalQuestions benchmark, LongLLMLingua gains a performance boost of up to 17.1% over the original prompt with ~4x fewer tokens as input to GPT-3.5-Turbo. It can derive cost savings of \$28.5 and \$27.4 per 1,000 samples from the LongBench and ZeroScrolls benchmark, respectively. Additionally, when compressing prompts of ~10k tokens at a compression rate of 2x-10x, LongLLMLingua can speed up the end-to-end latency by 1.4x-3.8x. Our code is available at https://aka.ms/LLMLingua.

Les articles autour de lui, par date et par proximité

Plus haut, c’est plus proche de cet article ; à gauche, c’est plus ancien. Les traits relient les articles proches entre eux : les groupes de traits sont des sous-thèmes. Sélectionnez un point pour voir pourquoi il est là. Retour au résumé de cet article

Comment lire cette carte ? Guide illustré

Les articles les plus proches Les travaux antérieurs sur lesquels il s’appuie Les articles qui le citent

Les articles autour de celui-ci

Classés selon la proximité de leur titre et de leur résumé avec ceux de cet article. Sélectionnez-en pour les lire ensemble.

Les articles les plus proches

  1. Très proche Cité par cet article Utilisé en profondeur par cet article Une méthode qu’il utilise
    LLMLingua: Compressing Prompts for Accelerated Inference of Large Language Models
    Huiqiang Jiang, Qianhui Wu, Chin-Yew Lin et al. · 2023 · Conference on Empirical Methods in Natural Language Processing · cité 419 fois · Pas encore résumé
    Résumé scientifique

    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 prompts fed to LLMs are becoming increasingly lengthy, even exceeding tens of thousands of tokens. To accelerate model inference and reduce cost, this paper presents LLMLingua, a coarse-to-fine prompt compression method that involves a budget controller to maintain semantic integrity under high compression ratios, a token-level iterative compression algorithm to better model the interdependence between compressed contents, and an instruction tuning based method for distributi…

  2. Très proche
    Learning to Compress Prompt in Natural Language Formats
    Yu-Neng Chuang, Tian-Wei Xing, Chia-yuan Chang et al. · 2024 · North American Chapter of the Association for Computational Linguistics · cité 66 fois · Pas encore résumé
    Résumé scientifique

    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 computing the results. Deploying LLMs with precise and informative context helps users process large-scale datasets more effectively and cost-efficiently. Existing works rely on compressing long prompt contexts into soft prompts. However, soft prompt compression encounters limitations in transferability across different LLMs, especially API-based LLMs. To this end, this work aims to compress lengthy prompts in the form of natural language with LLM transferability. This poses t…

  3. Très proche
    Compress, Then Prompt: Improving Accuracy-Efficiency Trade-off of LLM Inference with Transferable Prompt
    Zhaozhuo Xu, Zirui Liu, Beidi Chen et al. · 2023 · Computation and Language · preprint, non relu par les pairs · cité 47 fois · Résumé IA disponible
    Résumé scientifique

    Large Language Models (LLMs), armed with billions of parameters, exhibit exceptional performance across a wide range of Natural Language Processing (NLP) tasks. However, they present a significant computational challenge during inference, especially when deploying on common hardware such as single GPUs. As such, minimizing the latency of LLM inference by curtailing computational and memory requirements, though achieved through compression, becomes critically important. However, this process inevitably instigates a trade-off between efficiency and accuracy, as compressed LLMs typically experience a reduction in predictive precision. In this research, we introduce an innovative perspective: to…

  4. Très proche
    An Empirical Study on Prompt Compression for Large Language Models
    Zheng Zhang, Jin-Yi Li, Yi-Huai Lan et al. · 2025 · arXiv.org · preprint, non relu par les pairs · cité 11 fois · Pas encore résumé
    Résumé scientifique

    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 …

  5. Très proche
    500xCompressor: Generalized Prompt Compression for Large Language Models
    Zong-Qian Li, Yixuan Su, Nigel Collier · 2024 · Annual Meeting of the Association for Computational Linguistics · cité 57 fois · Pas encore résumé
    Résumé scientifique

    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, 500xCompre…

  6. Très proche Cite cet article
    Prompt Compression for Diffusion Large Language Models: An Empirical Evaluation of LLMLingua-2 and LLaDA
    Sterling Huang, Abigayle Brown, Jiyoo Noh et al. · 2026 · International Conference on Advances in Information Technology · cité 1 fois · Pas encore résumé
    Résumé scientifique

    Prompt compression reduces inference cost and context length in large language models, but prior evaluations focus mainly on autoregressive architectures. This study examines whether LLMLingua-2 transfers effectively to diffusion large language models (DLLMs), specifically LLaDA-8B-Instruct. We evaluate GSM8K, DUC2004, and ShareGPT using 250 prompts per dataset at an approximate 50% compression ratio, covering mathematical reasoning, prompt reconstruction, and summarization. Outputs from original, compressed, and reconstructed prompts are compared using exact-match accuracy, BLEU, ROUGE, and BERTScore. Results show that high semantic preservation does not necessarily ensure stable downstream…

  7. Très proche
    Dynamic Compressing Prompts for Efficient Inference of Large Language Models
    Jin-Wu Hu, Wei Zhang, Yufeng Wang et al. · 2025 · arXiv.org · preprint, non relu par les pairs · cité 8 fois · Pas encore résumé
    Résumé scientifique

    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 perform…

  8. Très proche Cite cet article Utilise cet article en profondeur
    Dynamic Prompt Compression for Efficient Inference of Large Language Models
    Jin-Wu Hu, Wei Zhang, Yufeng Wang et al. · 2026 · IEEE Transactions on Knowledge and Data Engineering · cité 2 fois · Pas encore résumé
    Résumé scientifique

    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 Prompt Compression (LLM-DPC). Our method reduces the number of prompt tokens while minimizing any degradation in L…

Les travaux antérieurs sur lesquels il s’appuie

  1. Proche Une méthode qu’il utilise
    Learning to Compress Prompts with Gist Tokens
    Jesse Mu, Xiang Lisa Li, Noah D. Goodman · 2023 · Neural Information Processing Systems · cité 537 fois · Pas encore résumé
    Résumé scientifique

    Prompting is the primary way to utilize the multitask capabilities of language models (LMs), but prompts occupy valuable space in the input context window, and repeatedly encoding the same prompt is computationally inefficient. Finetuning and distillation methods allow for specialization of LMs without prompting, but require retraining the model for each task. To avoid this trade-off entirely, we present gisting, which trains an LM to compress prompts into smaller sets of"gist"tokens which can be cached and reused for compute efficiency. Gist models can be trained with no additional cost over standard instruction finetuning by simply modifying Transformer attention masks to encourage prompt …

  2. Proche Utilisé en profondeur par cet article Une méthode qu’il utilise
    LongBench: A Bilingual, Multitask Benchmark for Long Context Understanding
    Yushi Bai, Xin Lv, Jia-Jie Zhang et al. · 2023 · Annual Meeting of the Association for Computational Linguistics · cité 1 891 fois · Pas encore résumé
    Résumé scientifique

    Although large language models (LLMs) demonstrate impressive performance for many language tasks, most of them can only handle texts a few thousand tokens long, limiting their applications on longer sequence inputs, such as books, reports, and codebases. Recent works have proposed methods to improve LLMs' long context capabilities by extending context windows and more sophisticated memory mechanisms. However, comprehensive benchmarks tailored for evaluating long context understanding are lacking. In this paper, we introduce LongBench, the first bilingual, multi-task benchmark for long context understanding, enabling a more rigorous evaluation of long context understanding. LongBench comprise…

  3. Proche Une méthode qu’il utilise
    Adapting Language Models to Compress Contexts
    A. Chevalier, Alexander Wettig, Anirudh Ajith et al. · 2023 · Conference on Empirical Methods in Natural Language Processing · cité 466 fois · Pas encore résumé
    Résumé scientifique

    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 propose to adapt pre-trained LMs into AutoCompressors. These models are capable of compressing long contexts into compact summary vectors, which are then accessible to the model as soft prompts. Summary vectors are trained with an unsupervised objective, whereby long documents are processed in segments and summary vectors from all previous segments are used in language modeling. We fine-tune OPT models on sequences of up to 30,720 tokens and show that AutoCompressors can util…

  4. Très proche
    Effective Long-Context Scaling of Foundation Models
    Wenhan Xiong, Jingyu Liu, Igor Molybog et al. · 2023 · Computation and Language · cité 368 fois · Résumé IA disponible
    Résumé scientifique

    We present a series of long-context LLMs that support effective context windows of up to 32,768 tokens. Our model series are built through continual pretraining from Llama 2 with longer training sequences and on a dataset where long texts are upsampled. We perform extensive evaluation on language modeling, synthetic context probing tasks, and a wide range of research benchmarks. On research benchmarks, our models achieve consistent improvements on most regular tasks and significant improvements on long-context tasks over Llama 2. Notably, with a cost-effective instruction tuning procedure that does not require human-annotated long instruction data, the 70B variant can already surpass gpt-3.5…

  5. Proche Utilisé en profondeur par cet article Une méthode qu’il utilise
    Lost in the Middle: How Language Models Use Long Contexts
    Nelson F. Liu, Kevin Lin, John Hewitt et al. · 2023 · Transactions of the Association for Computational Linguistics · cité 5 829 fois · Résumé IA disponible
    Résumé scientifique

    While recent language models have the ability to take long contexts as input, relatively little is known about how well they use longer context. We analyze the performance of language models on two tasks that require identifying relevant information in their input contexts: multi-document question answering and key-value retrieval. We find that performance can degrade significantly when changing the position of relevant information, indicating that current language models do not robustly make use of information in long input contexts. In particular, we observe that performance is often highest when relevant information occurs at the beginning or end of the input context, and significantly de…

Les articles qui le citent

  1. Très proche Utilise cet article en profondeur
    Prompt Compression in the Wild: Measuring Latency, Rate Adherence, and Quality for Faster LLM Inference
    Cornelius Kummer, Lena Jurkschat, Michael Färber et al. · 2026 · European Conference on Information Retrieval · cité 9 fois · Pas encore résumé
    Résumé scientifique

    With the wide adoption of language models for IR -- and specifically RAG systems -- the latency of the underlying LLM becomes a crucial bottleneck, since the long contexts of retrieved passages lead large prompts and therefore, compute increase. Prompt compression, which reduces the size of input prompts while aiming to preserve performance on downstream tasks, has established itself as a cost-effective and low-latency method for accelerating inference in large language models. However, its usefulness depends on whether the additional preprocessing time during generation is offset by faster decoding. We present the first systematic, large-scale study of this trade-off, with thousands of runs…

  2. Très proche Utilise cet article en profondeur
    PC-SubMax: Efficient Prompt Compression via Regularized Submodular Maximization
    Zi-Yi Zhang, Shuang Cui, Hao-Tian Zhang et al. · 2026 · cité 1 fois · Pas encore résumé
    Résumé scientifique

    While large language models (LLMs) are increasingly deployed in long-context scenarios, lengthy prompts can increase inference costs and latency and exacerbate the ``lost-in-the-middle''phenomenon. Selective prompt compression offers a model-agnostic approach to alleviating these issues. However, methods based on fixed token- or sentence-level importance scores may overlook how content contributions change with the selected subset, limiting their ability to account for inter-sentence redundancy. Compression procedures that rely on autoregressive LLM scoring can also introduce substantial overhead. We propose PC-SubMax, a theoretically grounded framework that formulates selective prompt compr…

  3. Proche Utilise cet article en profondeur
    COMI: Coarse-to-fine Context Compression via Marginal Information Gain
    Jiwei Tang, Shilei Liu, Zhicheng Zhang et al. · 2026 · International Conference on Learning Representations · cité 17 fois · Pas encore résumé
    Résumé scientifique

    Large Language Models (LLMs) have demonstrated exceptional capabilities across diverse tasks. However, their deployment in long context scenarios remains hindered by computational inefficiency and information redundancy. Context compression methods address these challenges by significantly reducing input length and eliminating redundancy. We propose COMI, a coarse-to-fine adaptive context compression framework that jointly optimizes for semantic relevance and diversity under high compression rates. We introduce Marginal Information Gain (MIG), a metric defined as the relevance of a unit to the input query minus its semantic redundancy with other units, guiding the compression process to prio…

  4. Très proche
    Lost in Compression: A Controlled Cross-Lingual Audit of Extractive Prompt Compressors
    Mantas Lukauskas · 2026 · arXiv.org · preprint, non relu par les pairs · cité 1 fois · Pas encore résumé
    Résumé scientifique

    Extractive prompt compression promises to cut LLM inference costs by removing low-information tokens, and learned compressors such as LLMLingua-2 report strong results on English benchmarks. Most other languages already pay a token premium: the same content costs 1.3-1.8x more tokens than in English. We ask whether compression closes or widens this gap. Using fully parallel data in ten languages spanning five scripts, with controls budget-matched in the target model's tokenizer, we audit four learned compressors against four deterministic baselines, on eleven target models from ten vendors (over 250,000 evaluation calls). Three of the compressors are trained with English supervision (LLMLing…

  5. Très proche Utilise cet article en profondeur
    Every Time I Hire a Linguist, Inference Costs Go Down: On Linguistic Rules as Effective Prompt Compressors
    Jianfei Ma, Zhao-Xin Feng, E. Chersoni et al. · 2026 · arXiv.org · preprint, non relu par les pairs · Pas encore résumé
    Résumé scientifique

    Prompt compression shortens LLM input to reduce inference cost, yet existing methods score token importance through LM forward passes. It remains questionable whether such nuanced, costly token selection is necessary. Compression requires identifying informative content, a problem that linguistic research has long addressed through cues that can be operationalized as deterministic rules. We therefore ask: can \textbf{linguistic rules alone} serve as effective prompt compressors, without LM-based scoring at compression time? To address this, we conduct offline evolutionary search over lexical, syntactic, semantic, and discourse seeds to find competitive rule combinations. The resulting lingui…

Comment ces articles sont-ils trouvés ?

Nous comparons le titre et le résumé de cet article avec ceux de tous les articles résumés sur ce site, et avec les articles que Semantic Scholar recommande, ceux qu’il cite et ceux qui le citent (pour un article très cité, ses citations les plus récentes et, depuis OpenAlex, les plus citées). Parmi les travaux antérieurs et les suites, les articles qui s’utilisent en profondeur, une méthode qu’il utilise et les suites très citées remontent un peu. Les niveaux (très proche, proche, apparenté) viennent de la similarité des textes, pas d’un jugement de qualité ; * signale un article sans résumé, comparé par son titre. La phrase sous un article est écrite par une IA à partir des deux résumés : vérifiez-la dans les articles. Un article jugé hors sujet par trois lecteurs quitte la liste.

Mis à jour le 4 novembre 2026.

Le guide illustré des articles autour d’un article