π A curated list of awesome resources focusing on Context Compression techniques for Large Language Models(LLMs).
HTML
77
22 commits
updated Jan 17, 2026
A curated collection of research papers focused on enhancing the efficiency of Large Language Models (LLMs) through context compression techniques. These methods aim to reduce token usage, compress latent states, and optimize memory footprints (KV Cache).
As LLMs scale to handle longer contexts and more complex tasks, efficient context management becomes crucial. This repository organizes papers into three distinct categories based on where and how compression occurs:
Context Compression Methods
βββ Explicit Context Compression (Input Level)
β βββ Token Pruning (LLMLingua, Selective-Context)
β βββ Summarization-based
β βββ Information-theoretic Selection
β
βββ Implicit Context Compression (Latent Level)
β βββ Soft Prompt (AutoCompressor)
β βββ Autoencoder-based (ICAE, CoCom)
β βββ Latent Reasoning (Coconut)
β
βββ Inference-Time KV Compression (Cache Level)
βββ Eviction Policies (H2O, TOVA, SnapKV)
βββ Quantization (KIVI)
βββ Sparse Attention (StreamingLLM)
Definition: Methods that operate primarily on the input text or input tokens. They select, prune, or summarize the context before or during the initial encoding to shorten the input sequence length. The goal is often to fit more context into the window or reduce API costs.
Keywords: Prompt Compression, Token Pruning, Summarization, Information Entropy, Token Selection, Coarse-grained Pruning
| Paper Title | Venue/Date | Tags | Code | TL;DR |
|---|---|---|---|---|
| TokenSkip: Controllable Chain-of-Thought Compression in LLMs | EMNLP 2025 Main | Token Pruning, Distillation | GitHub | A simple yet effective approach that enables LLMs to selectively skip less important tokens, allowing for controllable CoT compression. |
| LLMLingua-2: Data Distillation for Efficient and Faithful Task-Agnostic Prompt Compression | ACL 2024 | Pruning, Distillation | GitHub | Learns compression from GPT-4 annotations, 3x-6x faster than LLMLingua |
| LongLLMLingua: Accelerating and Enhancing LLMs in Long Context Scenarios via Prompt Compression | ACL 2024 | Pruning, RAG | GitHub | Question-aware compression for RAG scenarios, reorders retrieved documents by relevance |
| Keyformer: KV Cache Reduction through Key Tokens Selection for Efficient Generative Inference | MLSys 2024 | Pruning | GitHub | Identifies key tokens at each layer for selective retention |
| RECOMP: Improving Retrieval-Augmented LMs with Compression and Selective Augmentation | ICLR 2024 | Summarization, RAG | GitHub | Trains extractive/abstractive compressors for retrieved documents |
| Nugget: Neural Compression for Efficient Prompt Decoding | ICLR 2024 | Pruning | - | Learns to identify and preserve "nugget" tokens for compression |
| Walking Down the Memory Maze: Beyond Context Limit through Interactive Reading | NAACL 2024 | Summarization | - | MemWalker: iteratively summarizes and navigates long documents |
| LLMLingua: Compressing Prompts for Accelerated Inference of Large Language Models | EMNLP 2023 | Pruning | GitHub | Uses a small LM to calculate perplexity and prune less informative tokens, achieving up to 20x compression |
| Selective-Context: Compressing Contexts for Efficient Inference | EMNLP 2023 | Pruning, Self-Information | GitHub | Filters out low self-information content using a small LM |
Definition: Methods that compress context into soft vectors, embeddings, or latent states. This includes encoding long text into compact vector representations and Latent Reasoning where the "Chain of Thought" or intermediate reasoning steps are performed in the latent space (not outputting tokens) to reduce generation overhead.
Keywords: Soft Prompt, Autoencoder, Memory Vectors, Latent Space Reasoning, Continuous Chain of Thought, Internal State Compression
| Paper Title | Venue/Date | Tags | Code | TL;DR |
|---|---|---|---|---|
| CLaRa: Bridging Retrieval and Generation with Continuous Latent Reasoning | - | Memory Slots, RAG | Github | CLaRa achieves significant compression rates (32x-64x) while preserving essential information for accurate answer generation. |
| REFRAG: Rethinking RAG based Decoding | - | Autoencoder, Memory Slots, RAG | Github | Reduces TTFT delay of RAG system by 30 times. |
| Enhancing RAG Efficiency with Adaptive Context Compression | EMNLP 2025 | Autoencoder, RAG | - | A framework utilizing offline hierarchical compression and dynamic inference-time selection. It achieves >4x faster inference efficiency compared to standard RAG while maintaining competitive performance. |
| PCC: Pretraining Context Compressor for Large Language Models with Embedding-Based Memory | ACL 2025 Main | Autoencoder, Memory Slots | Github | Explore the upper limit of implicit compression ratio and connect to downstream LLMs faster. |
| 500xCompressor: Generalized Prompt Compression for Large Language Models | ACL 2025 Main | Autoencoder, Memory Slots | Github | Compresss a maximum of 500 natural language tokens into only 1 special token. |
| Coconut: Chain of Continuous Thought | arXiv 2024.12 | Latent Reasoning, CoT | Github | Performs reasoning in continuous latent space without outputting tokens |
| xRAG: Extreme Context Compression for Retrieval-augmented Generation with One Token | NeurIPS 2024 | RAG, Compression | Github | Compresses retrieved documents into dense representations |
| PEARL: Prompting Large Language Models to Plan and Execute Actions Over Long Documents | ACL 2024 | Planning, Long Doc | GitHub | Decomposes long document QA into planning and execution |
| ICAE: In-context Autoencoder for Context Compression in a Large Language Model | ICLR 2024 | Autoencoder, Memory Slots | GitHub | ICAE compresses 512 tokens into 128 memory slots for 4x compression |
| AutoCompressor: Adapting Language Models to Compress Contexts | EMNLP 2023 | Soft Prompt | GitHub | AutoCompressor: recursively compresses segments into summary vectors |
| Scaling Latent Reasoning via Thinking Tokens | arXiv 2023.11 | Latent Reasoning, Pause Token | - | Uses "thinking tokens" for implicit reasoning steps |
| Focused Transformer: Contrastive Training for Context Scaling | NeurIPS 2023 | Contrastive, Long-Context | GitHub | LongLLaMA: uses contrastive learning to focus on relevant context |
| Learning to Compress Prompts with Gist Tokens | NeurIPS 2023 | Soft Prompt | GitHub | Compresses instructions into learnable gist tokens |
| Parallel Context Windows for Large Language Models | ACL 2023 | Parallel, Memory | - | PCW: processes context in parallel windows and aggregates |
| Training Language Models with Memory Augmentation | EMNLP 2022 | Memory, TRIME | GitHub | TRIME: retrieves and integrates memory tokens during training |
| Compressive Transformers for Long-Range Sequence Modelling | ICLR 2020 | Compression, Memory | - | Uses compressed memory to extend context beyond window limits |
Definition: Methods that specifically target the Key-Value (KV) Cache during the generation phase. They aim to reduce GPU memory usage and latency by evicting "unimportant" KV pairs, quantizing the cache, or using sparse attention patterns. These methods usually happen on-the-fly during inference.
Keywords: KV Cache Eviction, Heavy Hitters, Sparse Attention, Cache Quantization, Budget-constrained Generation, Infinite Context, Streaming Inference
| Paper Title | Venue/Date | Tags | Code | TL;DR |
|---|---|---|---|---|
| ParallelComp: Parallel Long-Context Compressor for Length Extrapolation | ICML 2025 | Sparse | GitHub | This method divides long texts into smaller chunks and processes them in parallel while automatically removing redundant or irrelevant parts, greatly improving efficiency and performance. |
| UNComp: Can Matrix Entropy Uncover Sparsity? β A Compressor Design from an Uncertainty-Aware Perspective | EMNLP 2025 | Sparse, KV Cache Eviction | GitHub | An uncertainty-aware framework that leverages truncated matrix entropy to identify areas of low information content, thereby revealing sparsity patterns that can be used for adaptive compression. |
| Quest: Query-Aware Sparsity for Efficient Long-Context LLM Inference | ICML 2024 | Sparse, Query-Aware | GitHub | Page-based KV management with query-aware selection |
| PyramidKV: Dynamic KV Cache Compression based on Pyramidal Information Funneling | arXiv 2024.06 | Eviction, Layer-wise | GitHub | Different layers retain different amounts of KV pairs (pyramid structure) |
| MiniCache: KV Cache Compression in Depth Dimension for Large Language Models | arXiv 2024.05 | Eviction, Layer Merge | - | Merges KV caches across similar layers to reduce memory |
| SnapKV: LLM Knows What You are Looking for Before Generation | arXiv 2024.04 | Eviction, Observation Window | GitHub | Uses observation window at prompt end to identify important KV pairs |
| CaM: Cache Merging for Memory-efficient LLMs Inference | ICLR 2024 | Merging | - | Merges similar KV pairs instead of hard eviction |
| Dynamic Memory Compression: Retrofitting LLMs for Accelerated Inference | ICML 2024 | Compression, Learned | - | DMC: learns to decide what to keep/discard dynamically |
| Gear: An Efficient KV Cache Compression Recipe for Near-Lossless Generative Inference | arXiv 2024.03 | Quantization, Residual | GitHub | Quantize majority + low-rank for outliers + sparse residual |
| KIVI: A Tuning-Free Asymmetric 2bit Quantization for KV Cache | ICML 2024 | Quantization, 2-bit | GitHub | Asymmetric quantization: 2-bit for Keys, 2-bit for Values with different schemes |
| Anchor-based Large Language Models | ACL 2024 | Anchor, Compression | GitHub | Groups and anchors tokens for parallel compression |
| InfLLM: Unveiling the Intrinsic Capacity of LLMs for Understanding Extremely Long Sequences | arXiv 2024.02 | Block, Memory | GitHub | Uses block-level memory units for extreme-length processing |
| KVQuant: Towards 10 Million Context Length LLM Inference with KV Cache Quantization | arXiv 2024.01 | Quantization, Per-Channel | GitHub | Per-channel quantization with outlier handling for extreme compression |
| LoMA: Lossless Compressed Memory Attention | arXiv 2024.01 | Compression, Lossless | - | Achieves lossless compression via efficient memory management |
| TOVA: Token-wise Attention for Optimal KV-Cache Reduction | arXiv 2024.01 | Eviction, Token-wise | GitHub | Evicts tokens based on attention received in each generation step |
| Efficient Streaming Language Models with Attention Sinks | ICLR 2024 | Streaming, Attention Sink | GitHub | StreamingLLM: keeps initial "sink" tokens + recent window for infinite streaming |
| H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models | NeurIPS 2023 | Eviction, Heavy Hitter | GitHub | Keeps only "heavy-hitter" tokens (high cumulative attention) plus recent tokens |
| Scissorhands: Exploiting the Persistence of Importance Hypothesis for LLM KV Cache Compression | NeurIPS 2023 | Eviction, Persistence | - | Important tokens remain important; prunes based on historical importance |
| FastGen: Adaptive KV Cache Compression for Efficient LLM Inference | arXiv 2023.10 | Eviction, Adaptive | - | Adaptive compression policies based on attention patterns |
| Paper Title | Venue/Date | Focus |
|---|---|---|
| Prompt Compression for Large Language Models: A Survey | NAACL 2025 | Comprehensive survey on prompt compression |
| A Survey on Efficient Inference for Large Language Models | arXiv 2024 | Covers KV cache and other inference optimizations |
| A Survey on Model Compression for Large Language Models | TACL 2024 | General LLM compression (quantization, pruning, distillation) |
| Beyond the Limits: A Survey of Techniques to Extend the Context Length in Large Language Models | arXiv 2024 | Focuses on extending context length |
| Length Extrapolation of Transformers: A Survey from the Perspective of Positional Encoding | arXiv 2023 | Survey on positional encoding for long contexts |
We welcome contributions! Please follow these steps:
This project is licensed under the MIT License - see the LICENSE file for details.
Special thanks to all researchers whose work is featured in this repository. Your contributions to making LLMs more efficient benefit the entire community.
If you find this repository helpful, please consider giving it a β!
HTML
100.0%
π A curated list of awesome resources focusing on Context Compression techniques for Large Language Models(LLMs).
HTML
77
22 commits
updated Jan 17, 2026
A curated collection of research papers focused on enhancing the efficiency of Large Language Models (LLMs) through context compression techniques. These methods aim to reduce token usage, compress latent states, and optimize memory footprints (KV Cache).
As LLMs scale to handle longer contexts and more complex tasks, efficient context management becomes crucial. This repository organizes papers into three distinct categories based on where and how compression occurs:
Context Compression Methods
βββ Explicit Context Compression (Input Level)
β βββ Token Pruning (LLMLingua, Selective-Context)
β βββ Summarization-based
β βββ Information-theoretic Selection
β
βββ Implicit Context Compression (Latent Level)
β βββ Soft Prompt (AutoCompressor)
β βββ Autoencoder-based (ICAE, CoCom)
β βββ Latent Reasoning (Coconut)
β
βββ Inference-Time KV Compression (Cache Level)
βββ Eviction Policies (H2O, TOVA, SnapKV)
βββ Quantization (KIVI)
βββ Sparse Attention (StreamingLLM)
Definition: Methods that operate primarily on the input text or input tokens. They select, prune, or summarize the context before or during the initial encoding to shorten the input sequence length. The goal is often to fit more context into the window or reduce API costs.
Keywords: Prompt Compression, Token Pruning, Summarization, Information Entropy, Token Selection, Coarse-grained Pruning
| Paper Title | Venue/Date | Tags | Code | TL;DR |
|---|---|---|---|---|
| TokenSkip: Controllable Chain-of-Thought Compression in LLMs | EMNLP 2025 Main | Token Pruning, Distillation | GitHub | A simple yet effective approach that enables LLMs to selectively skip less important tokens, allowing for controllable CoT compression. |
| LLMLingua-2: Data Distillation for Efficient and Faithful Task-Agnostic Prompt Compression | ACL 2024 | Pruning, Distillation | GitHub | Learns compression from GPT-4 annotations, 3x-6x faster than LLMLingua |
| LongLLMLingua: Accelerating and Enhancing LLMs in Long Context Scenarios via Prompt Compression | ACL 2024 | Pruning, RAG | GitHub | Question-aware compression for RAG scenarios, reorders retrieved documents by relevance |
| Keyformer: KV Cache Reduction through Key Tokens Selection for Efficient Generative Inference | MLSys 2024 | Pruning | GitHub | Identifies key tokens at each layer for selective retention |
| RECOMP: Improving Retrieval-Augmented LMs with Compression and Selective Augmentation | ICLR 2024 | Summarization, RAG | GitHub | Trains extractive/abstractive compressors for retrieved documents |
| Nugget: Neural Compression for Efficient Prompt Decoding | ICLR 2024 | Pruning | - | Learns to identify and preserve "nugget" tokens for compression |
| Walking Down the Memory Maze: Beyond Context Limit through Interactive Reading | NAACL 2024 | Summarization | - | MemWalker: iteratively summarizes and navigates long documents |
| LLMLingua: Compressing Prompts for Accelerated Inference of Large Language Models | EMNLP 2023 | Pruning | GitHub | Uses a small LM to calculate perplexity and prune less informative tokens, achieving up to 20x compression |
| Selective-Context: Compressing Contexts for Efficient Inference | EMNLP 2023 | Pruning, Self-Information | GitHub | Filters out low self-information content using a small LM |
Definition: Methods that compress context into soft vectors, embeddings, or latent states. This includes encoding long text into compact vector representations and Latent Reasoning where the "Chain of Thought" or intermediate reasoning steps are performed in the latent space (not outputting tokens) to reduce generation overhead.
Keywords: Soft Prompt, Autoencoder, Memory Vectors, Latent Space Reasoning, Continuous Chain of Thought, Internal State Compression
| Paper Title | Venue/Date | Tags | Code | TL;DR |
|---|---|---|---|---|
| CLaRa: Bridging Retrieval and Generation with Continuous Latent Reasoning | - | Memory Slots, RAG | Github | CLaRa achieves significant compression rates (32x-64x) while preserving essential information for accurate answer generation. |
| REFRAG: Rethinking RAG based Decoding | - | Autoencoder, Memory Slots, RAG | Github | Reduces TTFT delay of RAG system by 30 times. |
| Enhancing RAG Efficiency with Adaptive Context Compression | EMNLP 2025 | Autoencoder, RAG | - | A framework utilizing offline hierarchical compression and dynamic inference-time selection. It achieves >4x faster inference efficiency compared to standard RAG while maintaining competitive performance. |
| PCC: Pretraining Context Compressor for Large Language Models with Embedding-Based Memory | ACL 2025 Main | Autoencoder, Memory Slots | Github | Explore the upper limit of implicit compression ratio and connect to downstream LLMs faster. |
| 500xCompressor: Generalized Prompt Compression for Large Language Models | ACL 2025 Main | Autoencoder, Memory Slots | Github | Compresss a maximum of 500 natural language tokens into only 1 special token. |
| Coconut: Chain of Continuous Thought | arXiv 2024.12 | Latent Reasoning, CoT | Github | Performs reasoning in continuous latent space without outputting tokens |
| xRAG: Extreme Context Compression for Retrieval-augmented Generation with One Token | NeurIPS 2024 | RAG, Compression | Github | Compresses retrieved documents into dense representations |
| PEARL: Prompting Large Language Models to Plan and Execute Actions Over Long Documents | ACL 2024 | Planning, Long Doc | GitHub | Decomposes long document QA into planning and execution |
| ICAE: In-context Autoencoder for Context Compression in a Large Language Model | ICLR 2024 | Autoencoder, Memory Slots | GitHub | ICAE compresses 512 tokens into 128 memory slots for 4x compression |
| AutoCompressor: Adapting Language Models to Compress Contexts | EMNLP 2023 | Soft Prompt | GitHub | AutoCompressor: recursively compresses segments into summary vectors |
| Scaling Latent Reasoning via Thinking Tokens | arXiv 2023.11 | Latent Reasoning, Pause Token | - | Uses "thinking tokens" for implicit reasoning steps |
| Focused Transformer: Contrastive Training for Context Scaling | NeurIPS 2023 | Contrastive, Long-Context | GitHub | LongLLaMA: uses contrastive learning to focus on relevant context |
| Learning to Compress Prompts with Gist Tokens | NeurIPS 2023 | Soft Prompt | GitHub | Compresses instructions into learnable gist tokens |
| Parallel Context Windows for Large Language Models | ACL 2023 | Parallel, Memory | - | PCW: processes context in parallel windows and aggregates |
| Training Language Models with Memory Augmentation | EMNLP 2022 | Memory, TRIME | GitHub | TRIME: retrieves and integrates memory tokens during training |
| Compressive Transformers for Long-Range Sequence Modelling | ICLR 2020 | Compression, Memory | - | Uses compressed memory to extend context beyond window limits |
Definition: Methods that specifically target the Key-Value (KV) Cache during the generation phase. They aim to reduce GPU memory usage and latency by evicting "unimportant" KV pairs, quantizing the cache, or using sparse attention patterns. These methods usually happen on-the-fly during inference.
Keywords: KV Cache Eviction, Heavy Hitters, Sparse Attention, Cache Quantization, Budget-constrained Generation, Infinite Context, Streaming Inference
| Paper Title | Venue/Date | Tags | Code | TL;DR |
|---|---|---|---|---|
| ParallelComp: Parallel Long-Context Compressor for Length Extrapolation | ICML 2025 | Sparse | GitHub | This method divides long texts into smaller chunks and processes them in parallel while automatically removing redundant or irrelevant parts, greatly improving efficiency and performance. |
| UNComp: Can Matrix Entropy Uncover Sparsity? β A Compressor Design from an Uncertainty-Aware Perspective | EMNLP 2025 | Sparse, KV Cache Eviction | GitHub | An uncertainty-aware framework that leverages truncated matrix entropy to identify areas of low information content, thereby revealing sparsity patterns that can be used for adaptive compression. |
| Quest: Query-Aware Sparsity for Efficient Long-Context LLM Inference | ICML 2024 | Sparse, Query-Aware | GitHub | Page-based KV management with query-aware selection |
| PyramidKV: Dynamic KV Cache Compression based on Pyramidal Information Funneling | arXiv 2024.06 | Eviction, Layer-wise | GitHub | Different layers retain different amounts of KV pairs (pyramid structure) |
| MiniCache: KV Cache Compression in Depth Dimension for Large Language Models | arXiv 2024.05 | Eviction, Layer Merge | - | Merges KV caches across similar layers to reduce memory |
| SnapKV: LLM Knows What You are Looking for Before Generation | arXiv 2024.04 | Eviction, Observation Window | GitHub | Uses observation window at prompt end to identify important KV pairs |
| CaM: Cache Merging for Memory-efficient LLMs Inference | ICLR 2024 | Merging | - | Merges similar KV pairs instead of hard eviction |
| Dynamic Memory Compression: Retrofitting LLMs for Accelerated Inference | ICML 2024 | Compression, Learned | - | DMC: learns to decide what to keep/discard dynamically |
| Gear: An Efficient KV Cache Compression Recipe for Near-Lossless Generative Inference | arXiv 2024.03 | Quantization, Residual | GitHub | Quantize majority + low-rank for outliers + sparse residual |
| KIVI: A Tuning-Free Asymmetric 2bit Quantization for KV Cache | ICML 2024 | Quantization, 2-bit | GitHub | Asymmetric quantization: 2-bit for Keys, 2-bit for Values with different schemes |
| Anchor-based Large Language Models | ACL 2024 | Anchor, Compression | GitHub | Groups and anchors tokens for parallel compression |
| InfLLM: Unveiling the Intrinsic Capacity of LLMs for Understanding Extremely Long Sequences | arXiv 2024.02 | Block, Memory | GitHub | Uses block-level memory units for extreme-length processing |
| KVQuant: Towards 10 Million Context Length LLM Inference with KV Cache Quantization | arXiv 2024.01 | Quantization, Per-Channel | GitHub | Per-channel quantization with outlier handling for extreme compression |
| LoMA: Lossless Compressed Memory Attention | arXiv 2024.01 | Compression, Lossless | - | Achieves lossless compression via efficient memory management |
| TOVA: Token-wise Attention for Optimal KV-Cache Reduction | arXiv 2024.01 | Eviction, Token-wise | GitHub | Evicts tokens based on attention received in each generation step |
| Efficient Streaming Language Models with Attention Sinks | ICLR 2024 | Streaming, Attention Sink | GitHub | StreamingLLM: keeps initial "sink" tokens + recent window for infinite streaming |
| H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models | NeurIPS 2023 | Eviction, Heavy Hitter | GitHub | Keeps only "heavy-hitter" tokens (high cumulative attention) plus recent tokens |
| Scissorhands: Exploiting the Persistence of Importance Hypothesis for LLM KV Cache Compression | NeurIPS 2023 | Eviction, Persistence | - | Important tokens remain important; prunes based on historical importance |
| FastGen: Adaptive KV Cache Compression for Efficient LLM Inference | arXiv 2023.10 | Eviction, Adaptive | - | Adaptive compression policies based on attention patterns |
| Paper Title | Venue/Date | Focus |
|---|---|---|
| Prompt Compression for Large Language Models: A Survey | NAACL 2025 | Comprehensive survey on prompt compression |
| A Survey on Efficient Inference for Large Language Models | arXiv 2024 | Covers KV cache and other inference optimizations |
| A Survey on Model Compression for Large Language Models | TACL 2024 | General LLM compression (quantization, pruning, distillation) |
| Beyond the Limits: A Survey of Techniques to Extend the Context Length in Large Language Models | arXiv 2024 | Focuses on extending context length |
| Length Extrapolation of Transformers: A Survey from the Perspective of Positional Encoding | arXiv 2023 | Survey on positional encoding for long contexts |
We welcome contributions! Please follow these steps:
This project is licensed under the MIT License - see the LICENSE file for details.
Special thanks to all researchers whose work is featured in this repository. Your contributions to making LLMs more efficient benefit the entire community.
If you find this repository helpful, please consider giving it a β!
HTML
100.0%