Testing guide

A/B testing compression

Before rolling out compression to all users, run an A/B test to verify that answer quality is maintained. Here is the methodology.

By Arjun Shah - Creator of SuperCompress - Updated 2026-07-03

A/B test protocol

  1. Split traffic — 50% control (no compression), 50% treatment (with compression)
  2. Run for sufficient samples — Minimum 1,000 queries per variant
  3. Measure these metrics — Answer accuracy, user satisfaction, response latency, token cost
  4. Statistical significance — Use a chi-squared test at p < 0.05

Implementation

import random
from supercompress import Compressor

comp = Compressor()

def handle_query(context, query, user_id):
    use_compression = hash(user_id) % 2 == 0
    if use_compression:
        result = comp.compress(context, query)
        context = result.compressed_text
    response = llm.generate(context, query)
    log_result(user_id, use_compression, response, context)
    return response

Frequently asked questions

How long should the A/B test run?

At least 1,000 queries per variant, or one week, whichever is longer.

What if quality drops?

Roll back compression for that use case and investigate which context types are being incorrectly removed.

Build with less context

Put compression in front of your next LLM call.

Use the hosted API or run SuperCompress locally. Keep the evidence, drop the token waste, and measure the savings before it reaches your model.

Get an API keyRead the guide