AI engineering glossary · Prompt context engineering
What is prompt compression?
Prompt compression: A family of methods that shorten a prompt automatically, for example by scoring tokens or sentences with a small model and deleting the least informative ones, as done by the LLMLingua research approach. It reduces cost while trying to keep accuracy.
Prompt compression: an example
A 3,000-token retrieved context is compressed to 800 tokens before being sent to the main model.
Related terms
More Prompt context engineering terms
- Prompt engineering
- Prompt optimisation
- Prompt registry
- Prompt regression testing
- Prompt sensitivity
- Prompt template
- Prompt versioning
- Pydantic validation of LLM output
Where you learn it
Prompt compression is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.