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.

Level: advancedTopic: Prompt context engineering

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

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.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.