Estimate the token savings achieved by compressing or summarizing prompt text.
Token compression reduces prompt size through summarization, removing redundancy, or using specialized compression techniques like LLMLingua. A compression ratio of 0.4 means only 40% of original tokens are retained while preserving most semantic content.
Compression
compressed = original_tokens × compression_ratio; saved = original - compressed
Aggressive compression (below 30% retention) often degrades quality. The sweet spot is typically 40-60% retention where most information is preserved with significant cost savings.
Methods include extractive summarization, removing filler words, LLMLingua-style prompt compression, and structured prompt templates that convey the same information in fewer tokens.