# What is Context Compression? Definition & Technical Mechanics

> **Source:** [SPIDITS AI AI Glossary](https://spidits.com/ai-glossary)  
> **Category:** Model Architectures  
> **Canonical Citation:** [https://spidits.com/ai-glossary/context-compression](https://spidits.com/ai-glossary/context-compression)

## Definition
Context Compression is a technique that summarizes, prunes, or distills long prompt contexts and conversational history into compact representations before passing them to an LLM context window.

## Architectural Mechanics & Deep Dive
Context Compression preserves critical semantic information while drastically reducing token count. As conversation histories expand, compression algorithms remove filler tokens, summarize historical turns, or synthesize key facts into dense memory blocks, keeping LLM API costs low and maintaining high attention accuracy.

## Industry Applications & Real-World Use Cases
Extending context limits, lowering token costs, and reducing attention latency

## Frequently Asked Questions

### How does context compression improve LLM speed?
By reducing total prompt tokens, context compression decreases pre-fill latency and attention computation overhead in transformers.

### What is the difference between context compression and truncation?
Truncation simply deletes older tokens, while context compression retains essential semantic facts through summarization or vector distillation.

## Related Terminology
- [kv-cache](https://spidits.com/ai-glossary/kv-cache)
- [llm](https://spidits.com/ai-glossary/llm)
- [attention-mechanism](https://spidits.com/ai-glossary/attention-mechanism)

---
*From the SPIDITS AI Knowledge Base (336+ terms indexed). Explore full technical definitions: [https://spidits.com/ai-glossary](https://spidits.com/ai-glossary)*
