17 Models, $38.95, and One Paradox: What We Learned Training Compression Models in Public

Community Article
Published June 26, 2026

Peter Lodri · June 26, 2026

kompress hero


We just published a paper proving that multi-checkpoint voting ensembles collapse to their weakest voter. We trained 17 kompress models on HuggingFace to fix it. Total cost: $38.95. Here's the full story — the dead ends, the breakthrough, and the open-source toolkit we built along the way.

The Problem

kompress is a 149M-param ModernBERT token classifier that decides which tokens to keep when compressing LLM context. It's used by the headroom proxy to reduce token costs for coding agents.

The problem: it drops critical tokens — compiler flags (-O2), hex addresses (0xDEAD), file paths (/var/log), error names (TokenExpiredError). These get split across subword tokens by the ModernBERT tokenizer, and the single-token classifier misses them.

The Paradox

We tried building an ensemble of models from different checkpoints. The ensemble should be better than any single model, right?

It was worse. Much worse.

paradox

Under kk-of-\(N\) drop voting, the ensemble eviction indicator IEI_E equals the kk-th order statistic of the per-voter indicators:

IE=I(Nk+1)I_E = I_{(N-k+1)}

The ensemble collapses to its weakest member on every stratum. We proved this formally and validated it empirically: an ensemble of v3, v3.1, and v3.2 scored 0.931 heretic-exact — worse than v4 alone at 0.967.

The Fix: λ=3.0\lambda = 3.0 Asymmetric Loss Modulation

Three mechanisms resolve the paradox:

  1. Training (\(\lambda = 3.0\)): Weighted binary cross-entropy with penalty multiplier on critical-syntactic tokens:

L=twt[ytlog(y^t)+(1yt)log(1y^t)]\mathcal{L} = -\sum_{t} w_t \left[ y_t \log(\hat{y}_t) + (1-y_t) \log(1-\hat{y}_t) \right]

where wt=3.0w_t = 3.0 for must-keep tokens, 1.01.0 for regular keeps, 0.50.5 for drops.

  1. Inference overrides: Post-inference regex safety net catches what the tokenizer splits across subword boundaries (PR #1419)
  2. C3 Self-Distillation: Qwen2.5-7B teacher labels must-keep spans on real tool outputs; student model learns to match the teacher's judgment

The Pareto Frontier

pareto

We mapped the full tradeoff curve by varying λ\lambda:

λ\lambda Model Heretic Compression Status
v8 0.955 15% Optimal ★
v17 0.963 3.7% Too conservative
10× v16 0.972 2.8% Useless compression

The tradeoff is fundamental: higher λ\lambda improves precision linearly but kills compression. λ=3.0\lambda = 3.0 is the Pareto-optimal point.

The 17-Model Journey

All models on HuggingFace: PeetPedro — 18 models with full cards, benchmarks, and training details.

Version What We Tried Heretic Keep Rate Lesson
v2-base Baseline 0.975 0.897 Precision ceiling
v4 Self-labels 0.943 0.823 Override internalized
v6 Agent-distribution 0.962 Dead end
v8 Qwen2.5 teacher 0.955 0.854 Production ★
v9 C3-only 0.921 Overfit
v11 Large encoder (352M) 0.906 0.517 Capacity ≠ precision
v12 Qwen3-Coder teacher 0.949 Too conservative
v14 Council-controlled 0.882 Concept proven
v15 Everything bagel 0.878 Diluted signal
v16 10× weight 0.972 0.972 Pareto endpoint
v17 5× weight 0.963 0.963 Tradeoff

11 of 17 models were dead ends. We published them all. The dead ends are the research.

Open Science

Everything is public. All 18 models on HuggingFace. All experiment logs on pocoo.vaked.dev. All code open source.

What We Learned

  1. Label quality is the bottleneck — not model capacity (v11 at 352M collapsed to 0.906), not data quantity (v15 with 983 pairs regressed to 0.878)
  2. Small, calibrated datasets win — v8's 97 carefully labeled pairs (33% C3 ratio) outperformed models trained on 3× more data
  3. Regex in production beats training the model — post-inference safety nets are surgical; training is blunt. The must-keep override (PR #1419) pushes agent mk_in_ref from 0.652 to 1.000 with zero model changes.
  4. The Pareto frontier is real — you cannot have perfect precision and aggressive compression simultaneously with this architecture
  5. Dead ends are the research — 11 of 17 models were dead ends, and we published every one. The loop doesn't just produce models; it produces understanding.

Community

This project is part of the broader loop engineering ecosystem with Addy Osmani, LangChain, and Cobus Greyling.

We're applying for an HF GPU Community Grant to run the Eval Space on a T4 — if you'd like to support open compression research, check out the Space and give it a ⭐!


"The agent forgets. The repo does not." — Addy Osmani

ICLR 2027 submission. All models, data, and code open source.

Community

Article author
Peter Lodri requests your endorsement to submit an article to the cs.LG
section of arXiv. To tell us that you would (or would not) like to
endorse this person, please visit the following URL:

https://arxiv.org/auth/endorse?x=QLCC8Y

If that URL does not work for you, please visit

http://arxiv.org/auth/endorse.php

and enter the following six-digit alphanumeric string:

Endorsement Code: QLCC8Y

Sign up or log in to comment