“Ternary” tells me which values a weight can take. It doesn't tell me how many bytes the file needs, which runtime can read it, or how much memory a running server will reserve.

That distinction matters for PrismML's new Bonsai 2.5 27B. The announcement advertises a compact local model; the model card distinguishes several packings of the same ternary weights. [1][2] Before choosing a download, I want to separate the arithmetic from the deployment claim.

Three values, several storage bills

A ternary weight has three possible values. The information needed to distinguish them is log₂(3), about 1.585 bits per weight. That's an information count, not a promise that each weight occupies a fractional addressable bit.

Take an illustrative group of 128 weights. It has 3¹²⁸ possible configurations. An integer encoding of every configuration needs 203 bits, because 2²⁰² is too small and 2²⁰³ is large enough. Add one assumed 16-bit scale for the group and the total becomes 219 bits, or 1.711 bits per weight after rounding.

Now store each ternary value in a two-bit slot instead. The same group takes 256 bits before the scale and 272 bits with it: 2.125 bits per weight. Same three values. Different packing bill.

Three computed storage rates: information only 1.585 bits per weight, ideal group plus scale 1.711, and two-bit slots plus scale 2.125.

Original computed illustration, CC BY 4.0. These are simplified group calculations, not measurements of a released model file.

Here is the complete calculation. Save it as packing.py and run python3 packing.py; it uses only Python's standard library.

import math group = 128 scale_bits = 16 packed_bits = (3 ** group - 1).bit_length() assert packed_bits == math.ceil(group * math.log2(3)) print("packed bits:", packed_bits) print("ideal group + scale:", (packed_bits + scale_bits) / group) print("two-bit slots + scale:", (2 * group + scale_bits) / group) 

Output:

packed bits: 203 ideal group + scale: 1.7109375 two-bit slots + scale: 2.125 

The integer calculation checks the floating-point formula independently. It also makes the assumption visible: the toy packing adds only a group scale. A real format has its own block layout, tensor choices, alignment and metadata.

Read the filename and the engine together

PrismML's card reports 1.76 bits per weight and 5.93 GB for PTQ1_0. It describes PQ2_0 as two-bit slots and Q2_0 as the stock llama.cpp option. PTQ1_0 and PQ2_0 require the PrismML fork. The card warns that Q2_0 needs upstream b11556 or newer; older engines can load it and produce incorrect output. [2]

That is a compatibility question before it is a speed question. A successful file load is a weak test when the missing feature changes activation handling. Check the engine bundled inside an application, rather than assuming its download date identifies the engine build.

The model card's packing table is also why I wouldn't replace its published file size with my group calculation. The calculation explains how ternary storage works. It doesn't reconstruct this artifact.

Leave room for the process

My deployment checklist has separate entries for the exact weight artifact, optional model components, context and concurrency settings, runtime allocations and measured peak memory. A weight-file figure fills only the first entry. It can't establish that an entire serving process fits.

The useful mistake to avoid is multiplying a headline parameter count by log₂(3) and treating the answer as a machine requirement. Use that as a theoretical reference, then inspect the actual artifact and runtime. The integer arithmetic above ran locally; I did not download Bonsai weights, run inference or measure its memory or speed. PrismML's benchmark claims remain its own results.

References and figure credit

[1] PrismML: Introducing Ternary Bonsai 2.5 27B.

[2] PrismML: Ternary Bonsai 2.5 27B GGUF model card, especially Weight Representation, Packings and runtime compatibility.

Figure: original illustration calculated from the included example, licensed CC BY 4.0.

AI disclosure

AI was used to draft the article.