Prompt Compression Not Applied

Goal Cost Optimization Frequency Common Category Operations Published View source on GitHub ↗

Issue: Verbose but Relevant Prompt Content Is Sent Uncompressed at Full Token Cost When Established Compression Techniques Would Preserve Meaning at a Fraction of the Length

Frequency: Common

Symptoms

  • Prompts contain long, genuinely relevant reference material (policy text, documentation, prior tool output) expressed in full natural-language verbosity rather than a denser equivalent form
  • No compression pass runs between “this content is relevant and needed” and “this content is sent to the model”
  • Token count for a prompt is dominated by low-information-density filler (repeated phrasing, boilerplate connectives, redundant restatement) rather than by the actual information the model needs
  • Distinct from Context Stuffing: this pattern occurs even when every included piece of content is relevant and needed — the waste is in how verbosely that relevant content is expressed, not in including irrelevant content

Root Cause Content destined for a prompt (retrieved documents, tool outputs, few-shot examples, instructions) is typically included as-is, in its original natural-language form, because that’s the simplest implementation and preserves readability for humans reviewing the prompt. But natural language is highly redundant from a pure information-content perspective — a large fraction of tokens in typical prose carry little decision-relevant signal for the model. Established compression techniques can remove this redundancy while preserving the information the model actually needs, but many agent pipelines never apply them, paying full price for every token of relevant-but-verbosely-expressed content.

Example

Customer-service agent includes the relevant policy section verbatim
in every prompt where it applies:

Original policy text (relevant, correctly included): 800 tokens
  "In the event that a customer wishes to initiate a return of a
   purchased item, it is important to note that the item must be
   returned within a period of thirty (30) days from the original
   date of purchase in order to be eligible for a full refund..."
   [continues at this density for 800 tokens]

Compressed equivalent (same information, compression applied): 40
tokens
  "Returns: full refund within 30 days of purchase; store credit
   31-60 days; no returns after 60 days. Original receipt required."

Both versions convey the same policy information relevant to the task.
The uncompressed version costs 20x the tokens of the compressed one
for identical decision-relevant content.

At 20,000 customer-service calls/month referencing this policy:
  Uncompressed: 20,000 x 800 = 16,000,000 tokens/month
  Compressed:   20,000 x 40 = 800,000 tokens/month
  Waste: 15,200,000 tokens/month (95%) for content that was correctly
  identified as relevant but never compressed before inclusion.

Contributing Factors

  • No compression step exists in the pipeline between content retrieval/relevance-filtering and prompt assembly
  • Source content (policy docs, documentation) is authored for human readability, not for token efficiency, and is included unmodified
  • Concern that compression will lose important nuance or legal precision discourages applying it, even where a verified compressed form (like the policy-summary example) preserves all decision-relevant facts
  • No token-efficiency measurement (information content per token) exists to distinguish “this content is relevant” from “this content is relevant but bloated”

Test Scenario & Reproduction

Scenario Setup

  • An agent pipeline includes verified-relevant reference content (policy text, documentation, prior output) in prompts in its original, verbose natural-language form
  • No prompt-compression step (extractive summarization, redundancy removal, or a dedicated compression model) runs before prompt assembly
  • A compressed, information-equivalent version of the same content is available or can be authored for comparison

Trigger Mechanism

  1. Assemble a prompt including the verbose original reference content and measure its token count
  2. Assemble an equivalent prompt with the same reference content compressed (either via a compression tool/model or a hand-verified dense summary) and measure its token count
  3. Compare model output quality/correctness between the two versions to confirm the compressed version preserves decision-relevant information

Example Reproduction Steps:

1. Select a customer-service query that requires referencing the
   800-token verbose return policy text
2. Run the query with the full verbose policy text included; record
   prompt tokens and check response correctness against the policy
3. Compress the same policy text into a dense, information-equivalent
   form (either automatically or via manual verification)
4. Re-run the same query with the compressed policy text included;
   record prompt tokens and check response correctness
5. Compare token counts and confirm response correctness is equivalent
   between the two versions
6. Repeat across a sample of queries referencing the same policy to
   confirm the compression holds up across varied phrasing of the
   underlying question

Expected Failure State

  • The verbose-original version consumes many times the tokens of the compressed version (order of magnitude, per the example’s 20x) for content carrying the same decision-relevant information
  • Response correctness is equivalent between the verbose and compressed versions, confirming the extra tokens in the verbose version were not contributing decision-relevant signal
  • No compression step exists in the production pipeline; the verbose form is what actually ships in prompts today
  • No token-efficiency metric (tokens per unit of decision-relevant information) exists to have surfaced this gap before manual comparison

Mitigation Strategies

Prevention

  1. Compression pass on high-reuse reference content: For content that is included in many prompts (policy text, documentation, standard instructions), invest in producing and verifying a dense, compressed equivalent once, and reuse the compressed version in every subsequent prompt inclusion, amortizing the one-time compression effort across all future uses. Trade-off: compression must be verified for information-preservation (especially where the source is like the policy example and precision matters), which requires review effort, unlike simply passing content through unmodified.
  2. Automated compression models for lower-stakes or high-volume content: For content where manual verification of every compression isn’t feasible (e.g., large or frequently-changing document sets), apply an automated compression technique (dynamic budget-controlled token classification) that has been validated to preserve information relevant to the target task, rather than either skipping compression or manually authoring every summary. Trade-off: automated compression models can occasionally drop a detail a specific edge-case query needed, so high-stakes content (legal, safety-critical) may still warrant manual verification rather than fully automated compression.
  3. Token-efficiency review as part of prompt-template design: When designing a new prompt template that includes reference content, explicitly measure and review tokens-per-unit-of-information for that content, treating verbosity as a defect to fix at design time rather than an unavoidable property of natural-language source material. Trade-off: adds a design-time review step, though it’s a one-time cost versus the recurring per-call cost of shipping verbose content indefinitely.

Detection & Response

  1. Token-density auditing on high-reuse content: Periodically sample prompt content that gets included frequently across many calls and estimate its information density (e.g., by comparing model output quality when using a compressed test version against the shipped verbose version); persistently low density on high-reuse content is the clearest target for compression investment.
  2. Compression-opportunity flagging by content size and reuse frequency: Rank reference content by token_size x monthly_inclusion_count to identify where compression effort would have the largest absolute token-savings impact, rather than compressing content in whatever order it’s noticed.
  3. Response-equivalence monitoring after compression is applied: Once a compressed version replaces a verbose one in production, monitor response correctness/quality specifically for queries touching that content, to confirm the compression didn’t silently drop information a downstream query needed.

Architecture Patterns

  1. Compression-as-a-pipeline-stage: Insert a dedicated compression stage between content retrieval/relevance-filtering and prompt assembly, using a three-stage approach (budget-controlled compression ratio allocation, token-level compression preserving conditional dependencies, and alignment to the target model’s expected input distribution) rather than treating compression as an optional, ad hoc step applied inconsistently. Deployment consideration: the compression stage itself adds a small amount of latency/cost, which must be weighed against the token savings on the compressed content’s much larger downstream reuse.
  2. Tiered compression by content stakes: Apply automated, aggressive compression to high-volume, lower-stakes content (general documentation, FAQ-style material) while reserving manual, verified compression (or no compression at all) for high-stakes content (legal terms, safety instructions) where an automated compressor’s occasional information loss carries outsized risk. Deployment consideration: requires a stakes-classification step to route content to the appropriate compression tier, and misclassification risks either under-compressing low-stakes content or over-compressing high-stakes content.
  3. Compressed-content versioning tied to source updates: Store compressed versions of reference content alongside their source, with the compression regenerated (and re-verified, for high-stakes content) whenever the source is updated, so compression benefits persist without becoming a source of staleness as the underlying content changes. Deployment consideration: requires wiring compression regeneration into the same update pipeline that handles Full Reprocessing on Incremental Change, ideally applying it only to the changed sections rather than recompressing unchanged ones.

Metrics

  1. compression_ratio_on_high_reuse_content: Target > 10x reduction on content included in more than 1,000 calls/month; Alert if < 2x (indicating compression isn’t being applied where it would have the largest impact).
  2. response_correctness_delta_after_compression: Target within ±1 percentage point of the pre-compression baseline; Alert if compression correlates with a correctness drop exceeding 3 points (signal that information was lost).
  3. tokens_per_call_on_reference_content: Target trending downward for content identified as compression-eligible; Alert if flat over a quarter despite known-eligible high-reuse content.
  4. compression_staleness_incidents: Target 0 calls served a compressed version that no longer matches an updated source; Alert if > 0.

Alerts

  1. High-Reuse-Content-Uncompressed (P3): Condition - content included in more than 1,000 calls/month shows compression_ratio_on_high_reuse_content below 2x. Action: prioritize a compression pass (manual or automated per stakes tier) for that content.
  2. Post-Compression-Correctness-Drop (P2): Condition - response_correctness_delta_after_compression exceeds a 3-point drop following a compression change. Action: roll back to the verbose version for that content pending review of what information was lost.

References