Compression ratio
A compression ratio is the factor relating a representation’s size or complexity before compression to its size or complexity afterward.
Retrieval Augmented Generation, The Foundational Ideas
A compression ratio is the proportion or factor by which an input representation is reduced in size relative to the original.
- How it is used
- Measures prompt-size reduction when selecting context compression for a retrieval-augmented generator.
- How deep it goes
- Works through token counts, benchmark ratios, accuracy tradeoffs, and validation steps; does not make ratio a guarantee of semantic preservation.
- Examples
- Uses contract clauses, token-count inspection, and AttentionRAG benchmark settings to show why equal or higher ratios need quality checks.
- What you can do after
- Evaluate/understand it by comparing compressed and baseline answers on held-out queries, then adjusting the target ratio.
Read how Retrieval Augmented Generation, The Foundational Ideas explains compression ratio →
Quantization and Fast Inference
Compression ratio is the factor by which a model's stored representation is reduced relative to an original representation.
- How it is used
- Estimates and measures model-size reduction when comparing quantized models with their original representations.
- How deep it goes
- Calculates a theoretical INT8 ceiling from parameter shares and compares it with measured results, including scale overhead.
- Examples
- Compares measured compression for ResNet-18, BERT-base, and TinyLlama-1.1B.
- What you can do after
- Evaluate likely TorchAO INT8 weight-only size reduction by calculating the share of parameters in nn.Linear layers.
Read how Quantization and Fast Inference explains compression ratio →
Related concepts
- LongLLMLinguameasured by · LongLLMLingua is a prompt-compression method that uses question-conditioned perplexity to remove less informative tokens while preserving information useful for downstream generation.
- compactionmeasures · The consolidation or reorganization of data, objects, or context to reduce size or fragmentation while preserving necessary information or state.
- ratiokind of · A ratio is a quantitative comparison of two quantities expressed through their relative sizes or quotient.
Questions about compression ratio
What is compression ratio?
A compression ratio is the factor relating a representation’s size or complexity before compression to its size or complexity afterward.
Which Manning books explain compression ratio?
Retrieval Augmented Generation, The Foundational Ideas and Quantization and Fast Inference.
What is the difference between compression ratio and semantic loss?
A compression ratio is the factor relating a representation’s size or complexity before compression to its size or complexity afterward. Semantic loss is the reduction in meaning or task-relevant information caused by compressing text or context.
What is compression ratio a kind of?
Compression ratio is a kind of ratio. A ratio is a quantitative comparison of two quantities expressed through their relative sizes or quotient.
What is compression ratio also called?
Compression ratio is also called compression rate.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

