Inside the Lab · Field note 014 · Ternzip
Where did the 558 MB go?
We packed an 8B model, unpacked it, and got all 2,182,184,672 bytes back.
We started with a question you can try on paper. If ---+ keeps turning up, why not call it p? Say ++-- is o. If those two keep turning up together, give the pair a name too. The catch is that the dictionary takes up space. A shorthand has to earn its keep.
Prism ML had already trained a model whose weights take just three values, −1, 0 and +1. We wanted a smaller download of that exact model. We found a clue in the way the same shapes turn up in different layers, even when they move sideways or change sign.
Try one sign flip
These are two real columns from the released archive. Column 46 in layer 0 helps predict column 121 in layer 1. Flip the earlier column’s signs and compare the rows underneath. A zero stays zero.
The flipped column still gets more than half the weights wrong. It helps because it changes the odds. Ternzip uses those odds along with a weight’s row, column and scale. A fast entropy coder called rANS then records the actual value. A good prediction saves bits, and a bad one still decodes to the right number.
The scales had patterns of their own. Each block of 128 weights comes with a 16-bit number that sets their strength. For 253 of the 254 ternary tensors, we could predict a scale’s position in a table and store the exact difference. Adding it back recovers every bit of the scale.
What came back
| Prism ML’s original GGUF | 2,182,184,672 bytes |
|---|---|
| Ternzip archive | 1,623,736,952 bytes |
| Saved on disk | 558,447,720 bytes (25.59%) |
| Restored GGUF | 2,182,184,672 bytes |
All 399 tensors, all 63,970,624 scale values, the tokenizer and the file metadata are in the download. We restored the file and checked its SHA-256 against the one Prism ML published. They match. Prism’s original file
See both SHA-256 checksums
- Ternzip download
19ce2237a410208327f69a9f5eff381d2d6e8ffe9dd750f65a433e7f3c747577- Restored GGUF · matches Prism’s original
3c8d70470a5d97e5a2b9410ddd899cb740116591462626c60cb2fead6448f60b
What it took to run
Our custom loader opens the .trits archive directly on Apple Silicon. With its dependencies installed, our M4 Pro took 18.90 and 19.57 seconds to load it. We then gave it story and code prompts, each 4,096 tokens long. Across ten runs it generated a median 61.38 tokens per second after reading the prompt. Seven runs cleared 60.
The archive takes 1.624 GB on disk. The whole process occupied 2.99–3.35 GB of physical memory after generation. Peak resident memory during startup was 5.29–5.30 GB. All ten measurements
What does the extra 465 MB buy?
Prism also publishes a smaller, binary Bonsai 8B. Its weights have two possible values. The ternary model adds a third, zero. Each has its own trained weights. Ternzip preserves the ternary ones exactly. We ran both releases on the same M4 Pro. Prism’s binary file
| Measurement | Ternzip ternary | Prism binary |
|---|---|---|
| Download | 1.624 GB | 1.159 GB |
| Correct next tokens out of 733 | 377 | 358 |
| Perplexity on those 733 (lower is better) | 10.82 | 14.66 |
| Correct across all 12,925 positions | 5,890 | 5,589 |
| Median output tokens/s | 59.76 | 81.34 |
Both models read the same token IDs. For speed we repeated each of the two 4,096-token prompts three times per model, timing generation after the prompt. The binary model was faster and saved another 465.08 MB. The ternary model predicted 301 more next tokens correctly across the four text sets. Asked “What is 17 × 6? Answer with the number only,” both replied “102” and stopped. Measurements from this comparison
Try the restore
Get the v0.1.0 source from GitHub and the archive from Hugging Face. With the archive in the source folder, run this command. It writes the official GGUF and checks Prism’s digest for you.
./ternzip restore ternzip-8b.trits
Created using Bonsai by Prism ML. Ternzip is OptimaTech Labs’ independent, third-party recompression of Prism’s Qwen3-8B-derived checkpoint, released under Apache 2.0. The project README credits earlier work on ternary packing, entropy coding and block matching. Prior work and notices