Richard Hoekstra

Reported experiment

PPM-C compression experiments and a Lean roundtrip

Companion to the Hodge-Epsilon Program
Richard Hoekstra · April 2026

What does a roundtrip prove?

Suppose a decoder returns every byte you give its encoder. How many bytes must the encoder have saved?

Try the copy encoder

This encoder copies the UTF-8 bytes of the input. Its decoder reads the copy back as text.

11 bytes
Encoded size · 11 bytes

Exact recovery. 0 bytes saved. 8 bits per input byte.

Even a thousand copies of the same letter take up the original space here. A roundtrip tells us the input can be recovered. To establish a compression rate, we also need the length of the emitted bitstream.

The experiments report 2.16 bits per byte on a one-million-byte enwik8 prefix and 1.964 on 100 million bytes. The Lean roundtrip concerns a different encoding. In Proof/Kolmogorov/Bound.lean, payloadCode uses Encodable.encode on the byte list, and the decoder recovers that number from an interval width. compressedBits can be supplied independently of the roundtrip. Its example value is the code number itself. The file explicitly leaves the cross-entropy and Kolmogorov inequalities open.

The original engineering question was which changes to a count-based byte predictor help at more than one scale. Five interventions that helped separately at 500,000 bytes performed 0.036 bpb worse together than skip-gram alone at one million. The version history and ablations below are reported experiment results. A size certificate for these rates would require the actual emitted bitstream, its length, a decoder that recovers the named corpus, and an accounting of the decoder and side information.

Reported version history

VersionChangeDelta (bpb)Cumulative (bpb)Reduction
v1Baseline (parent+delta)—3.68—
v2+ exclusion−0.363.32−10%
v3+ PPM-C escape−0.273.05−17%
v4+ online trie update−0.482.57−30%
v5Combined + tuned−0.312.26−39%
v6+ skip-gram (1M)−0.102.16−41%

Twenty single-variable experiments

#ExperimentRoundDelta (bpb)Result
1Bayesian escape1+0.730FAIL
2CDF 12-bit quantization1−0.044PASS
3KT estimator1+2.170FAIL
4MDL context pruning1−0.058PASS
5Exclusion order reversal1—BUGGY
6Exact rational arithmetic10.000NEUTRAL
7c-theorem prior on depth1+0.045FAIL
8Forward filter (γ=0.99)1−0.024PASS
9Lookahead coding10.000NEUTRAL
10Entry count pruning1+0.075FAIL
11Context inheritance2+0.031FAIL
12Count aging (halflife)2+1.050FAIL
13Skip-gram (α=0.2)2−0.089PASS
14Dual-parent (α=0.1)2−0.028PASS
15Local alphabet restriction20.000NEUTRAL
16Bigram trie2+0.034FAIL
17Elimination coding2—BUGGY
18Second-order escape2−0.006PASS
19Sliding window (64k)2+0.669FAIL
20Depth ensemble20.000NEUTRAL

Interactions across sample sizes

ComponentDelta at 500kDelta at 1M
Skip-gram−0.089−0.030
MDL pruning−0.058−0.010
Dual-parent−0.028−0.013
CDF 12-bit−0.044−0.008
Forward filter−0.024−0.005

April manuscript with correction (HTML) · Annotated manuscript (PDF)

Cite this page

Richard Hoekstra. PPM-C compression experiments and a Lean roundtrip. https://richardhoekstra.nl/papers/byte-compression.html