Early access — cascade metrics are real (derived from canonical token telemetry); the operator field is a curated seed. Learn more about the data
◈ Foundational Metric

Compression Ratio — Output per Input

How much you get back per token you send. The output-to-input ratio at the heart of efficient prompting.

The formula

Compression Ratio = output / input

The compression ratio is the simplest meaningful token metric: divide what the model gave you (output) by what you sent it (input). A ratio of 1 means you got back exactly as many tokens as you sent. A ratio above 1 means the model expanded your input into more output than you provided. A ratio below 1 means you sent more than you got back — your input was “compressed” into a smaller response.

Note: input here refers to fresh input tokens only — not cached tokens. Cached context (cache_read) is reused from prior turns and doesn’t count against your input investment. This is what makes the compression ratio a measure of prompting efficiency rather than total context size.

What it measures

The compression ratio measures how much value you extract per token of fresh input. It answers a simple question: for every token I invest in typing or pasting, how many tokens of useful output do I get back?

This is fundamentally a measure of prompting efficiency. An operator who writes a concise, well-structured prompt that elicits a long, useful response has a high ratio. An operator who pastes an entire file, adds rambling instructions, and gets back a one-line answer has a low ratio.

Why it matters

Fresh input tokens are the most expensive part of the cascade. They cost full price to process, they’re sent from scratch every turn, and — in the yield formula — they appear squared in the denominator. Every fresh input token you send without proportional output is pure waste.

The compression ratio makes that waste visible. If your ratio is trending down over a session, it usually means one of two things: your inputs are getting verbose (you’re re-explaining context that’s already in cache), or your prompts are too vague (the model is giving short, uncommitted responses because it doesn’t know what you want).

Tracking compression ratio over time reveals your prompting habits. The goal isn’t to maximize it in isolation — a ratio of 10 from a 5-token prompt that produces 50 useless tokens is worse than a ratio of 2 from a 500-token prompt that produces 1,000 high-value tokens. But as a diagnostic, it’s the fastest way to spot input bloat.

High ratio vs low ratio

High ratio — efficient prompting

You send concise, targeted inputs and the model responds with substantial, useful output. Your prompts are well-structured: clear intent, minimal redundancy, no unnecessary context. This is the signature of an operator who knows exactly what to ask and how to ask it.

Low ratio — verbose inputs, little return

You send large inputs — pasted files, rambling instructions, redundant context — and get back relatively little. The model is spending its capacity processing your input rather than generating output. This often means your prompts lack focus or you’re re-sending context that’s already cached.

Relationship to yield

Compression ratio is a component of yield. Yield (Υ) = (cache_read × output) / input² can be rewritten as Υ = cache_read × (output / input) / input = cache_read × compression_ratio / input. So yield is your compression ratio amplified by cache reuse and divided by input size.

This means you can have a high compression ratio but still score low on yield if you don’t reuse cached context. The compression ratio tells you your prompting is efficient; yield tells you your overall cascade is efficient. Both matter — but yield is the headline.

How to improve your compression ratio

  • 1. Be specific about what you want. Vague prompts (“help me with this code”) produce short, non-committal responses. Specific prompts (“write a TypeScript function that takes a URL string and returns the query params as a Record<string, string>”) produce substantial, targeted output.
  • 2. Don’t re-paste cached context. If the model already has a file in its context window from a prior turn, don’t paste it again. Reference it: “in the file we discussed earlier, add error handling to the fetch function.” This keeps fresh input small while the model works from cache.
  • 3. Ask for complete deliverables. “Write the full module” produces more output than “what’s wrong with line 42?” When the task allows it, request complete artifacts — functions, tests, documentation — rather than snippets or diagnostics.
  • 4. Trim boilerplate from your prompts. Remove pleasantries, redundant instructions, and context the model can infer. Every token you cut from input that doesn’t reduce output raises your ratio.
  • 5. Use file references over inline code. In tools like Claude Code or Cursor, referencing a file path is cheaper than pasting its contents. The model reads the file from its context without you spending fresh input tokens on the content.

FAQ

What is the token compression ratio in AI coding?
Compression Ratio = output / input. It measures how many tokens the model generates for every token of fresh input you send. A ratio of 3 means you get 3 output tokens per 1 input token. High ratios indicate efficient prompting; low ratios indicate verbose inputs with little return.
What is a good compression ratio for AI coding?
It depends on the task. Code generation tends to produce higher ratios; debugging or review tasks may produce lower ratios. Track your ratio over time — a downward trend usually means your inputs are getting verbose without proportional output.
How is compression ratio different from yield?
Compression ratio = output / input captures one dimension. Yield (Υ) = (cache_read × output) / input² captures three: output, input economy, and cache reuse. You can have a high compression ratio but low yield if you never reuse cached context. Yield is the headline; compression ratio is a component.
Can a compression ratio be too high?
A very high ratio with low absolute output can be misleading. Sending 10 tokens and getting 30 back gives a ratio of 3, but 30 tokens may not be useful. Compression ratio is most meaningful alongside absolute output volume and yield — not in isolation.

Related metrics: Yield (Υ) · Signal-to-Noise Ratio · Velocity · Methodology