Empirical Sweeps Across 20%, 40%, 50%, 60%, and 70% Token Reduction Targets
Detailed parameter sweep measuring trade-offs between target retention ratio (0.3 to 0.8), execution speed, semantic retention, and instruction fidelity.
| Method Variant | Token Reduction (Measured) | Execution Latency (Measured) | Billed Cost (Projected) | Semantic Retention (Measured) | Instruction Retention (Measured) | Entity Preservation (Measured) |
|---|---|---|---|---|---|---|
| Target Retention 80% (20% Reduction) | 20.1% +/- 0.4% | 18.4 ms +/- 1.2 ms | $20.00 USD (Projected) | 99.2% +/- 0.3% | 100.0% +/- 0.0% | 99.1% +/- 0.4% |
| Target Retention 60% (40% Reduction) | 40.3% +/- 0.6% | 21.6 ms +/- 1.5 ms | $15.00 USD (Projected) | 97.8% +/- 0.5% | 100.0% +/- 0.0% | 97.2% +/- 0.7% |
| Target Retention 50% (50% Reduction) | 50.4% +/- 0.8% | 24.8 ms +/- 2.1 ms | $12.50 USD (Projected) | 96.4% +/- 0.8% | 100.0% +/- 0.0% | 95.1% +/- 1.1% |
| Target Retention 40% (60% Reduction) | 60.2% +/- 0.9% | 27.2 ms +/- 2.3 ms | $10.00 USD (Projected) | 94.1% +/- 1.0% | 100.0% +/- 0.0% | 92.8% +/- 1.3% |
| Target Retention 30% (70% Reduction) | 69.8% +/- 1.2% | 29.8 ms +/- 2.5 ms | $7.50 USD (Projected) | 91.2% +/- 1.4% | 100.0% +/- 0.0% | 89.4% +/- 1.6% |
Raw evaluation prompt payload sample format used during experimental benchmark runs:
{
"dataset_name": "ratio_sweep_dataset_500",
"ratios_evaluated": [
0.8,
0.6,
0.5,
0.4,
0.3
]
}Run this exact script on your hardware to reproduce token reduction and execution latency:
from llmslim import compress
prompt = "System: MUST return JSON format.\nContext: " + "Corporate financial result entry sentence... " * 40
for ratio in [0.3, 0.4, 0.5, 0.6, 0.8]:
res = compress(prompt, target_ratio=ratio)
print(f"Target Ratio: {ratio} | Billed Savings: {res.savings_percent:.1f}% | Execution Latency: {res.execution_time_ms:.2f}ms")